Remove magic number IDs from Monsters and use display names as the key names. Fixed all references to numerical IDs in code. Refreshed all game maps so the monster name enums export as name strings instead of numbers.

pull/28/head
sigonasr2 1 year ago
parent 455dd3a818
commit fcb3ee87fd
  1. 4
      Crawler/ConnectionPoint.h
  2. 12
      Crawler/Crawler.cpp
  3. 2
      Crawler/Crawler.h
  4. 6
      Crawler/Crawler.tiled-project
  5. 3
      Crawler/DEFINES.h
  6. 6
      Crawler/EncountersSpawnListScrollableWindowComponent.h
  7. 24
      Crawler/Monster.cpp
  8. 12
      Crawler/Monster.h
  9. 74
      Crawler/MonsterData.cpp
  10. 12
      Crawler/RUN_STRATEGY.cpp
  11. 2
      Crawler/RunTowards.cpp
  12. 6
      Crawler/SlimeKing.cpp
  13. 9
      Crawler/SpawnEncounterLabel.h
  14. 8
      Crawler/TMXParser.h
  15. 2
      Crawler/Version.h
  16. 184
      Crawler/assets/Campaigns/1_1_v2.tmx
  17. 4
      Crawler/assets/Campaigns/1_2.tmx
  18. 2
      Crawler/assets/Campaigns/1_3.tmx
  19. 2
      Crawler/assets/Campaigns/1_4.tmx
  20. 2
      Crawler/assets/Campaigns/Boss_1.tmx
  21. 2
      Crawler/assets/Campaigns/Boss_1_v2.tmx
  22. 18
      Crawler/assets/config/Monsters.txt

@ -45,9 +45,9 @@ struct ConnectionPoint{
std::string map;
std::string unlockCondition;
std::array<int,8>neighbors; //Indices into the connectionPoint array.
std::vector<int>spawns;
std::vector<std::string>spawns;
bool levelDataExists=false;
inline ConnectionPoint(geom2d::rect<float>rect,std::string type,std::string name,std::string map,std::string unlockCondition,std::vector<int>spawns)
inline ConnectionPoint(geom2d::rect<float>rect,std::string type,std::string name,std::string map,std::string unlockCondition,std::vector<std::string>spawns)
:rect(rect),type(type),name(name),map(map),unlockCondition(unlockCondition),spawns(spawns){
neighbors.fill(-1);
}

@ -1460,7 +1460,7 @@ void Crawler::InitializeLevel(std::string mapFile,MapName map){
}
if(LEVEL_NAMES.count(cp.map)&&&MapHelper::MapFromString(cp.map)==&MAP_DATA[map]){
MAP_DATA[map].name=cp.name;
for(int spawn:MAP_DATA[map].spawns){
for(std::string spawn:MAP_DATA[map].spawns){
cp.spawns.push_back(spawn);
}
cp.levelDataExists=true;
@ -1485,12 +1485,12 @@ void Crawler::LoadLevel(MapName map){
#pragma region Monster Spawn Data Setup
for(auto&[key,value]:MAP_DATA[map].SpawnerData){
SpawnerTag&spawnData=MAP_DATA[map].SpawnerData[key];
std::vector<std::pair<int,vf2d>>monster_list;
std::vector<std::pair<std::string,vf2d>>monster_list;
vf2d spawnerRadius=vf2d{spawnData.ObjectData.GetFloat("width"),spawnData.ObjectData.GetFloat("height")}/2;
for(XMLTag&monster:spawnData.monsters){
int monsterTypeID=monster.GetInteger("value")-1;
monster_list.push_back({monsterTypeID,{monster.GetInteger("x")-spawnData.ObjectData.GetFloat("x"),monster.GetInteger("y")-spawnData.ObjectData.GetFloat("y")}});
std::string monsterName=monster.GetString("value");
monster_list.push_back({monsterName,{monster.GetInteger("x")-spawnData.ObjectData.GetFloat("x"),monster.GetInteger("y")-spawnData.ObjectData.GetFloat("y")}});
}
SPAWNER_LIST.push_back(MonsterSpawner{{spawnData.ObjectData.GetFloat("x"),spawnData.ObjectData.GetFloat("y")},spawnerRadius*2,monster_list,spawnData.upperLevel,spawnData.bossNameDisplay});
}
@ -1950,8 +1950,8 @@ void Crawler::InitializeLevels(){
LEVEL_NAMES.SetInitialized();
}
void Crawler::SpawnMonster(vf2d pos,MonsterData*data,bool upperLevel,bool isBossSpawn){
monstersToBeSpawned.push_back(Monster(pos,*data,upperLevel,isBossSpawn));
void Crawler::SpawnMonster(vf2d pos,MonsterData&data,bool upperLevel,bool isBossSpawn){
monstersToBeSpawned.push_back(Monster(pos,data,upperLevel,isBossSpawn));
if(isBossSpawn){
totalBossEncounterMobs++;
}

@ -172,7 +172,7 @@ public:
void RenderTile(vi2d pos,TilesheetData tileSheet,int tileSheetIndex,vi2d tileSheetPos);
void RenderTile(TileRenderData&tileSheet,Pixel col);
bool IsReflectiveTile(TilesheetData tileSheet,int tileID);
void SpawnMonster(vf2d pos,MonsterData*data,bool upperLevel=false,bool isBossSpawn=false); //Queues a monster for spawning on the next frame.
void SpawnMonster(vf2d pos,MonsterData&data,bool upperLevel=false,bool isBossSpawn=false); //Queues a monster for spawning on the next frame.
void DrawPie(vf2d center,float radius,float degreesCut,Pixel col);
void DrawSquarePie(vf2d center,float radius,float degreesCut,Pixel col);
void RenderCooldowns();

@ -187,8 +187,8 @@
{
"name": "Type",
"propertyType": "MonsterName",
"type": "int",
"value": 0
"type": "string",
"value": "None"
},
{
"name": "spawner",
@ -206,7 +206,7 @@
{
"id": 3,
"name": "MonsterName",
"storageType": "int",
"storageType": "string",
"type": "enum",
"values": [
"None",

@ -41,8 +41,7 @@ All rights reserved.
#define INCLUDE_SPAWNER_LIST extern std::vector<MonsterSpawner>SPAWNER_LIST;
#define INCLUDE_DAMAGENUMBER_LIST extern std::vector<std::shared_ptr<DamageNumber>>DAMAGENUMBER_LIST;
#define INCLUDE_game extern Crawler*game;
#define INCLUDE_MONSTER_DATA extern std::map<int,MonsterData>MONSTER_DATA;
#define INCLUDE_MONSTER_NAME_DATA extern safemap<std::string,MonsterData*>MONSTER_NAME_DATA;
#define INCLUDE_MONSTER_DATA extern std::map<std::string,MonsterData>MONSTER_DATA;
#define INCLUDE_BULLET_LIST extern std::vector<std::unique_ptr<Bullet>>BULLET_LIST;
#define INCLUDE_EMITTER_LIST extern std::vector<std::unique_ptr<Emitter>>EMITTER_LIST;
#define INCLUDE_DATA extern utils::datafile DATA;

@ -52,7 +52,7 @@ protected:
public:
inline EncountersSpawnListScrollableWindowComponent(geom2d::rect<float>rect,ComponentAttr attributes=ComponentAttr::BACKGROUND|ComponentAttr::OUTLINE)
:ScrollableWindowComponent(rect,attributes){}
virtual inline void UpdateSpawns(std::vector<int>&spawns){
virtual inline void UpdateSpawns(std::vector<std::string>&spawns){
Menu::menus.at(parentMenu)->components.erase_if([&](auto key){
if(key.first.starts_with("Spawn ")){
std::erase_if(components,[&](MenuComponent*component){return key.second==component;});
@ -62,8 +62,8 @@ public:
return false;});
int offsetY=0;
vf2d parentSize=Menu::menus.at(OVERWORLD_LEVEL_SELECT)->size;
for(int spawn:spawns){
ADD("Spawn "+std::to_string(spawn),SpawnEncounterLabel)({vf2d{0,float(offsetY)},{parentSize.x,12}},MONSTER_DATA.at(spawn-1).GetDisplayName(),spawn-1)END;
for(std::string spawn:spawns){
ADD("Spawn "+spawn,SpawnEncounterLabel)({vf2d{0,float(offsetY)},{parentSize.x,12}},MONSTER_DATA.at(spawn).GetDisplayName(),spawn)END;
offsetY+=14;
}
}

@ -57,10 +57,10 @@ INCLUDE_DATA
INCLUDE_GFX
safemap<std::string,std::function<void(Monster&,float,std::string)>>STRATEGY_DATA;
std::map<int,Renderable*>MonsterData::imgs;
std::map<std::string,Renderable*>MonsterData::imgs;
Monster::Monster(vf2d pos,MonsterData data,bool upperLevel,bool bossMob):
pos(pos),hp(data.GetHealth()),maxhp(data.GetHealth()),atk(data.GetAttack()),moveSpd(data.GetMoveSpdMult()),size(data.GetSizeMult()),targetSize(data.GetSizeMult()),strategy(data.GetAIStrategy()),id(data.GetID()),upperLevel(upperLevel),isBoss(bossMob),facingDirection(DOWN){
pos(pos),hp(data.GetHealth()),maxhp(data.GetHealth()),atk(data.GetAttack()),moveSpd(data.GetMoveSpdMult()),size(data.GetSizeMult()),targetSize(data.GetSizeMult()),strategy(data.GetAIStrategy()),name(data.GetDisplayName()),upperLevel(upperLevel),isBoss(bossMob),facingDirection(DOWN){
bool firstAnimation=true;
for(std::string&anim:data.GetAnimations()){
animation.AddState(anim,ANIMATION_DATA[anim]);
@ -101,13 +101,13 @@ void Monster::UpdateAnimation(std::string state){
animation.ChangeState(internal_animState,state);
}
void Monster::PerformJumpAnimation(){
animation.ChangeState(internal_animState,MONSTER_DATA[id].GetJumpAnimation());
animation.ChangeState(internal_animState,MONSTER_DATA[name].GetJumpAnimation());
}
void Monster::PerformShootAnimation(){
animation.ChangeState(internal_animState,MONSTER_DATA[id].GetShootAnimation());
animation.ChangeState(internal_animState,MONSTER_DATA[name].GetShootAnimation());
}
void Monster::PerformIdleAnimation(){
animation.ChangeState(internal_animState,MONSTER_DATA[id].GetIdleAnimation());
animation.ChangeState(internal_animState,MONSTER_DATA[name].GetIdleAnimation());
}
bool Monster::SetX(float x){
vf2d newPos={x,pos.y};
@ -235,8 +235,8 @@ void Monster::DrawReflection(float drawRatioX,float multiplierX){
game->SetDecalMode(DecalMode::NORMAL);
}
void Monster::Collision(Player*p){
if(MONSTER_DATA[id].GetCollisionDmg()>0&&!hasHitPlayer){
if(p->Hurt(MONSTER_DATA[id].GetCollisionDmg(),OnUpperLevel(),GetZ())){
if(MONSTER_DATA[name].GetCollisionDmg()>0&&!hasHitPlayer){
if(p->Hurt(MONSTER_DATA[name].GetCollisionDmg(),OnUpperLevel(),GetZ())){
hasHitPlayer=true;
}
}
@ -275,7 +275,7 @@ void Monster::Moved(){
}
}
std::string Monster::GetDeathAnimationName(){
return MONSTER_DATA[id].GetDeathAnimation();
return MONSTER_DATA[name].GetDeathAnimation();
}
bool Monster::Hurt(int damage,bool onUpperLevel,float z){
if(!IsAlive()||onUpperLevel!=OnUpperLevel()||HasIframes()||abs(GetZ()-z)>1) return false;
@ -317,7 +317,7 @@ vf2d&Monster::GetTargetPos(){
}
MonsterSpawner::MonsterSpawner(){}
MonsterSpawner::MonsterSpawner(vf2d pos,vf2d range,std::vector<std::pair<int,vf2d>>monsters,bool upperLevel,std::string bossNameDisplay)
MonsterSpawner::MonsterSpawner(vf2d pos,vf2d range,std::vector<std::pair<std::string,vf2d>>monsters,bool upperLevel,std::string bossNameDisplay)
:pos(pos),range(range),monsters(monsters),upperLevel(upperLevel),bossNameDisplay(bossNameDisplay){
}
bool MonsterSpawner::SpawnTriggered(){
@ -333,8 +333,8 @@ vf2d MonsterSpawner::GetPos(){
void MonsterSpawner::SetTriggered(bool trigger,bool spawnMonsters){
triggered=trigger;
if(spawnMonsters){
for(std::pair<int,vf2d>&monsterInfo:monsters){
game->SpawnMonster(pos+monsterInfo.second,&MONSTER_DATA[monsterInfo.first],DoesUpperLevelSpawning(),bossNameDisplay!="");
for(std::pair<std::string,vf2d>&monsterInfo:monsters){
game->SpawnMonster(pos+monsterInfo.second,MONSTER_DATA[monsterInfo.first],DoesUpperLevelSpawning(),bossNameDisplay!="");
}
if(bossNameDisplay!=""){
game->SetBossNameDisplay(bossNameDisplay);
@ -447,7 +447,7 @@ void Monster::OnDeath(){
game->ReduceBossEncounterMobCount();
}
for(MonsterDropData data:MONSTER_DATA.at(id).GetDropData()){
for(MonsterDropData data:MONSTER_DATA.at(name).GetDropData()){
if(util::random(100)<=data.dropChance){
//This isn't necessarily fair odds for each quantity dropped.
int dropQuantity=int(data.minQty+std::round(util::random(float(data.maxQty-data.minQty))));

@ -72,7 +72,6 @@ struct MonsterDropData{
struct MonsterData{
private:
int id;
std::string name;
int hp;
int atk;
@ -87,14 +86,13 @@ struct MonsterData{
std::vector<MonsterDropData> dropData;
public:
MonsterData();
MonsterData(int id,std::string name,int hp,int atk,std::vector<std::string>animations,std::vector<MonsterDropData>drops,float moveSpd=1.0f,float size=1.0f,std::string strategy="Run Towards",int collisionDmg=0);
MonsterData(std::string name,int hp,int atk,std::vector<std::string>animations,std::vector<MonsterDropData>drops,float moveSpd=1.0f,float size=1.0f,std::string strategy="Run Towards",int collisionDmg=0);
int GetHealth();
int GetAttack();
float GetMoveSpdMult();
float GetSizeMult();
std::string GetAIStrategy();
int GetCollisionDmg();
int GetID();
std::string GetIdleAnimation();
std::string GetJumpAnimation();
std::string GetShootAnimation();
@ -105,14 +103,14 @@ struct MonsterData{
const std::vector<MonsterDropData>&GetDropData();
std::string GetDisplayName();
static void InitializeMonsterData();
static std::map<int,Renderable*>imgs;
static std::map<std::string,Renderable*>imgs;
};
struct Monster:IAttributable{
friend struct STRATEGY;
private:
int id=0;
std::string name;
vf2d pos;
vf2d vel={0,0};
float friction=400;
@ -215,14 +213,14 @@ struct MonsterSpawner{
private:
vf2d pos;
vf2d range;
std::vector<std::pair<int,vf2d>>monsters;
std::vector<std::pair<std::string,vf2d>>monsters;
bool triggered=false;
bool upperLevel=false;
std::string bossNameDisplay="";
public:
MonsterSpawner();
//For the monster list, the second pair item is the position relative to the spawner to spawn the monster.
MonsterSpawner(vf2d pos,vf2d range,std::vector<std::pair<int,vf2d>>MONSTER_LIST,bool upperLevel=false,std::string bossNameDisplay="");
MonsterSpawner(vf2d pos,vf2d range,std::vector<std::pair<std::string,vf2d>>MONSTER_LIST,bool upperLevel=false,std::string bossNameDisplay="");
bool SpawnTriggered();
vf2d GetRange();
vf2d GetPos();

@ -48,27 +48,28 @@ INCLUDE_STRATEGY_DATA
INCLUDE_ANIMATION_DATA
INCLUDE_ITEM_DATA
std::map<int,MonsterData>MONSTER_DATA;
safemap<std::string,MonsterData*>MONSTER_NAME_DATA;
std::map<std::string,MonsterData>MONSTER_DATA;
MonsterData::MonsterData()
:atk(0),collisionDmg(0),hp(0),id(0),moveSpd(0),size(0),strategy("Run Towards"){}
MonsterData::MonsterData(int id,std::string name,int hp,int atk,std::vector<std::string>animations,std::vector<MonsterDropData>drops,float moveSpd,float size,std::string strategy,int collisionDmg):
id(id),name(name),hp(hp),atk(atk),moveSpd(moveSpd),size(size),strategy(strategy),animations(animations),dropData(drops),collisionDmg(collisionDmg){}
:atk(0),collisionDmg(0),hp(0),moveSpd(0),size(0),strategy("Run Towards"){}
MonsterData::MonsterData(std::string name,int hp,int atk,std::vector<std::string>animations,std::vector<MonsterDropData>drops,float moveSpd,float size,std::string strategy,int collisionDmg):
name(name),hp(hp),atk(atk),moveSpd(moveSpd),size(size),strategy(strategy),animations(animations),dropData(drops),collisionDmg(collisionDmg){}
void MonsterData::InitializeMonsterData(){
int id=0;
while(DATA["Monsters"].HasProperty(std::to_string(id))){
std::string MonsterName=DATA["Monsters"][std::to_string(id)]["DisplayName"].GetString();
for(auto&[key,size]:DATA["Monsters"].GetKeys()){
std::string MonsterName=key;
if(MONSTER_DATA.count(key)){
ERR("WARNING! A monster with the name "<<key<<" already exists in the database! Duplicates are not allowed.")
}
std::vector<std::string>animations{
MonsterName+"_IDLE",
MonsterName+"_JUMP",
MonsterName+"_SPIT",
MonsterName+"_DIE",
MonsterName+"_IDLE",
MonsterName+"_JUMP",
MonsterName+"_SPIT",
MonsterName+"_DIE",
};
MonsterData::imgs[id]=NEW Renderable();
MonsterData::imgs[id]->Load("assets/monsters/"+MonsterName+".png");
MonsterData::imgs[MonsterName]=NEW Renderable();
MonsterData::imgs[MonsterName]->Load("assets/monsters/"+MonsterName+".png");
for(int i=0;i<animations.size();i++){
std::string animationConfigName="";
@ -92,16 +93,16 @@ void MonsterData::InitializeMonsterData(){
}break;
}
Animate2D::Style style=Animate2D::Style::Repeat;
if(DATA["Monsters"][std::to_string(id)][animationConfigName+"Animation"].GetString(2)=="Repeat"){
if(DATA["Monsters"][MonsterName][animationConfigName+"Animation"].GetString(2)=="Repeat"){
style=Animate2D::Style::Repeat;
} else
if(DATA["Monsters"][std::to_string(id)][animationConfigName+"Animation"].GetString(2)=="OneShot"){
if(DATA["Monsters"][MonsterName][animationConfigName+"Animation"].GetString(2)=="OneShot"){
style=Animate2D::Style::OneShot;
} else
if(DATA["Monsters"][std::to_string(id)][animationConfigName+"Animation"].GetString(2)=="PingPong"){
if(DATA["Monsters"][MonsterName][animationConfigName+"Animation"].GetString(2)=="PingPong"){
style=Animate2D::Style::PingPong;
} else
if(DATA["Monsters"][std::to_string(id)][animationConfigName+"Animation"].GetString(2)=="Reverse"){
if(DATA["Monsters"][MonsterName][animationConfigName+"Animation"].GetString(2)=="Reverse"){
style=Animate2D::Style::Reverse;
}
@ -113,15 +114,15 @@ void MonsterData::InitializeMonsterData(){
ANIMATION_DATA[state]=anim;
};
int frameCount = DATA["Monsters"][std::to_string(id)][animationConfigName+"Animation"].GetInt(0);
vf2d frameSize = vf2d{float(DATA["Monsters"][std::to_string(id)]["SheetFrameSize"].GetInt(0)),float(DATA["Monsters"][std::to_string(id)]["SheetFrameSize"].GetInt(1))};
CreateHorizontalAnimationSequence(*MonsterData::imgs[id],frameCount,frameSize,MonsterName+imgName,i,AnimationData{float(DATA["Monsters"][std::to_string(id)][animationConfigName+"Animation"].GetReal(1)),style});
int frameCount = DATA["Monsters"][MonsterName][animationConfigName+"Animation"].GetInt(0);
vf2d frameSize = vf2d{float(DATA["Monsters"][MonsterName]["SheetFrameSize"].GetInt(0)),float(DATA["Monsters"][MonsterName]["SheetFrameSize"].GetInt(1))};
CreateHorizontalAnimationSequence(*MonsterData::imgs[MonsterName],frameCount,frameSize,MonsterName+imgName,i,AnimationData{float(DATA["Monsters"][MonsterName][animationConfigName+"Animation"].GetReal(1)),style});
}
//Add additional custom animations defined in the config.
int animationCounter=0;
while(DATA["Monsters"][std::to_string(id)].HasProperty("ANIMATION["+std::to_string(animationCounter)+"]")){
animations.push_back(DATA["Monsters"][std::to_string(id)]["ANIMATION["+std::to_string(animationCounter)+"]"].GetString());
while(DATA["Monsters"][MonsterName].HasProperty("ANIMATION["+std::to_string(animationCounter)+"]")){
animations.push_back(DATA["Monsters"][MonsterName]["ANIMATION["+std::to_string(animationCounter)+"]"].GetString());
animationCounter++;
}
@ -129,8 +130,8 @@ void MonsterData::InitializeMonsterData(){
//Add drop items to monster data from the config.
int dropDataCounter=0;
while(DATA["Monsters"][std::to_string(id)].HasProperty("DROP["+std::to_string(dropDataCounter)+"]")){
datafile drop=DATA["Monsters"][std::to_string(id)]["DROP["+std::to_string(dropDataCounter)+"]"];
while(DATA["Monsters"][MonsterName].HasProperty("DROP["+std::to_string(dropDataCounter)+"]")){
datafile drop=DATA["Monsters"][MonsterName]["DROP["+std::to_string(dropDataCounter)+"]"];
if(!ITEM_DATA.count(drop.GetString(0))){
ERR("Could not add drop "<<drop.GetString(0)<<" to "<<MonsterName<<"'s drop table! Item does not exist!");
}
@ -138,31 +139,25 @@ void MonsterData::InitializeMonsterData(){
dropDataCounter++;
}
const std::string&strategyName=DATA["Monsters"][std::to_string(id)]["Strategy"].GetString();
const std::string&strategyName=DATA["Monsters"][MonsterName]["Strategy"].GetString();
if(!STRATEGY_DATA.count(strategyName)){
ERR("WARNING! Strategy for "<<MonsterName<<" does not exist in strategy database!");
}
MonsterData monster(
id,
MonsterName,
DATA["Monsters"][std::to_string(id)]["Health"].GetInt(),
DATA["Monsters"][std::to_string(id)]["Attack"].GetInt(),
DATA["Monsters"][MonsterName]["Health"].GetInt(),
DATA["Monsters"][MonsterName]["Attack"].GetInt(),
animations,
drops,
float(DATA["Monsters"][std::to_string(id)]["MoveSpd"].GetReal())/100,
float(DATA["Monsters"][std::to_string(id)]["Size"].GetReal())/100,
float(DATA["Monsters"][MonsterName]["MoveSpd"].GetReal())/100,
float(DATA["Monsters"][MonsterName]["Size"].GetReal())/100,
strategyName,
DATA["Monsters"][std::to_string(id)]["CollisionDmg"].GetInt()
DATA["Monsters"][MonsterName]["CollisionDmg"].GetInt()
);
MONSTER_DATA[id]=monster;
MONSTER_NAME_DATA[MonsterName]=&MONSTER_DATA[id];
id++;
MONSTER_DATA[MonsterName]=monster;
}
MONSTER_NAME_DATA.SetInitialized();
}
int MonsterData::GetHealth(){
return hp;
@ -179,9 +174,6 @@ float MonsterData::GetSizeMult(){
int MonsterData::GetCollisionDmg(){
return collisionDmg;
}
int MonsterData::GetID(){
return id;
}
std::string MonsterData::GetAIStrategy(){
return strategy;
}

@ -43,22 +43,22 @@ INCLUDE_DATA
INCLUDE_STRATEGY_DATA
int Monster::STRATEGY::_GetInt(Monster&m,std::string param,std::string strategy,int index){
if(DATA["Monsters"][std::to_string(m.id)].HasProperty(param)){
return DATA["Monsters"][std::to_string(m.id)].GetProperty(param).GetInt(index);
if(DATA["Monsters"][m.name].HasProperty(param)){
return DATA["Monsters"][m.name].GetProperty(param).GetInt(index);
} else {
return DATA["MonsterStrategy"][strategy].GetProperty(param).GetInt(index);
}
}
float Monster::STRATEGY::_GetFloat(Monster&m,std::string param,std::string strategy,int index){
if(DATA["Monsters"][std::to_string(m.id)].HasProperty(param)){
return float(DATA["Monsters"][std::to_string(m.id)].GetProperty(param).GetReal(index));
if(DATA["Monsters"][m.name].HasProperty(param)){
return float(DATA["Monsters"][m.name].GetProperty(param).GetReal(index));
} else {
return float(DATA["MonsterStrategy"][strategy].GetProperty(param).GetReal(index));
}
}
std::string Monster::STRATEGY::_GetString(Monster&m,std::string param,std::string strategy,int index){
if(DATA["Monsters"][std::to_string(m.id)].HasProperty(param)){
return DATA["Monsters"][std::to_string(m.id)].GetProperty(param).GetString(index);
if(DATA["Monsters"][m.name].HasProperty(param)){
return DATA["Monsters"][m.name].GetProperty(param).GetString(index);
} else {
return DATA["MonsterStrategy"][strategy].GetProperty(param).GetString(index);
}

@ -68,7 +68,7 @@ void Monster::STRATEGY::RUN_TOWARDS(Monster&m,float fElapsedTime,std::string str
m.PerformJumpAnimation();
} else {
m.SetState(State::NORMAL);//Revert state once we've finished moving towards target.
m.UpdateAnimation(MONSTER_DATA[m.id].GetIdleAnimation());
m.UpdateAnimation(MONSTER_DATA[m.name].GetIdleAnimation());
}
}break;
case State::PATH_AROUND:{

@ -48,7 +48,7 @@ All rights reserved.
INCLUDE_game
INCLUDE_BULLET_LIST
INCLUDE_ANIMATION_DATA
INCLUDE_MONSTER_NAME_DATA
INCLUDE_MONSTER_DATA
using A=Attribute;
@ -89,11 +89,11 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,std::string strat
for(int i=0;i<spawnCount;i++){
float randomAngle=util::random(2*PI);
vf2d spawnPos=m.pos+vf2d{cos(randomAngle),sin(randomAngle)}*m.GetSizeMult()*12;
for(int attempts=0;attempts<MAX_ATTEMPTS&&PositionInRangeOfPlayer(spawnPos,MONSTER_NAME_DATA[spawnMonster]->GetSizeMult()*12);attempts++){
for(int attempts=0;attempts<MAX_ATTEMPTS&&PositionInRangeOfPlayer(spawnPos,MONSTER_DATA[spawnMonster].GetSizeMult()*12);attempts++){
randomAngle=util::random(2*PI);
spawnPos=m.pos+vf2d{cos(randomAngle),sin(randomAngle)}*m.GetSizeMult()*12;
}
game->SpawnMonster(spawnPos,MONSTER_NAME_DATA[spawnMonster]);
game->SpawnMonster(spawnPos,MONSTER_DATA[spawnMonster]);
}
};
switch(newPhase){

@ -46,13 +46,13 @@ INCLUDE_MONSTER_DATA
INCLUDE_ANIMATION_DATA
class SpawnEncounterLabel:public MenuLabel{
int monsterID;
std::string monsterName;
Animate2D::Animation<std::string>anim;
Animate2D::AnimationState state;
public:
inline SpawnEncounterLabel(geom2d::rect<float>rect,std::string label,int monsterID)
:MenuLabel(rect,label),monsterID(monsterID){
anim.AddState("IDLE",ANIMATION_DATA.at(MONSTER_DATA.at(monsterID).GetIdleAnimation()));
inline SpawnEncounterLabel(geom2d::rect<float>rect,std::string label,std::string monsterName)
:MenuLabel(rect,label),monsterName(monsterName){
anim.AddState("IDLE",ANIMATION_DATA.at(MONSTER_DATA.at(monsterName).GetIdleAnimation()));
anim.ChangeState(state,"IDLE");
anim.UpdateState(state,util::random(1));
}
@ -70,7 +70,6 @@ protected:
vf2d imgScale=imgSize/vf2d{imgRect.size};
window.DrawPartialDecal(rect.pos,imgSize,anim.GetFrame(state).GetSourceImage()->Decal(),imgRect.pos,imgRect.size);
float verticalAlignYOffset=(rect.size.y-8)/2;
std::string monsterName=MONSTER_DATA.at(monsterID).GetDisplayName();
vf2d monsterNameTextSize=game->GetTextSizeProp(monsterName);
float textXSpaceAvailable=rect.size.x-imgSize.x-4-16/*12 for the scrollbar*/;
float textXScaling=textXSpaceAvailable/monsterNameTextSize.x;

@ -53,6 +53,7 @@ struct XMLTag{
float GetFloat(std::string dataTag);
double GetDouble(std::string dataTag);
bool GetBool(std::string dataTag);
std::string GetString(std::string dataTag);
};
struct MapTag{
@ -94,7 +95,7 @@ struct Map{
std::vector<XMLTag> TilesetData;
std::vector<LayerTag> LayerData;
std::string mapType="";
std::set<int>spawns;
std::set<std::string>spawns;
std::map<int,SpawnerTag> SpawnerData; //Spawn groups have IDs, mobs associate which spawner they are tied to via this ID.
std::map<std::string,std::vector<::ZoneData>> ZoneData;
std::string FormatLayerData(std::ostream& os, std::vector<LayerTag>tiles);
@ -171,6 +172,9 @@ class TMXParser{
double XMLTag::GetDouble(std::string dataTag) {
return std::stod(data[dataTag]);
}
std::string XMLTag::GetString(std::string dataTag) {
return data[dataTag];
}
bool XMLTag::GetBool(std::string dataTag) {
if (data[dataTag]=="0"||data[dataTag]=="false") {
return false;
@ -345,7 +349,7 @@ class TMXParser{
} else
if (newTag.tag=="property"&&monsterPropertyTagCount==0) {
monsterTag.data["value"]=newTag.data["value"];
parsedMapInfo.spawns.insert(newTag.GetInteger("value"));
parsedMapInfo.spawns.insert(newTag.GetString("value"));
monsterPropertyTagCount++;
} else
if (newTag.tag=="property"&&monsterPropertyTagCount==1) {

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 0
#define VERSION_MINOR 2
#define VERSION_PATCH 1
#define VERSION_BUILD 4146
#define VERSION_BUILD 4156
#define stringify(a) stringify_(a)
#define stringify_(a) #a

@ -1281,21 +1281,21 @@
</object>
<object id="3" name="Green Slime" type="Monster" x="1103.33" y="4220">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="2"/>
</properties>
<point/>
</object>
<object id="4" name="Green Slime" type="Monster" x="1052" y="4304">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="2"/>
</properties>
<point/>
</object>
<object id="5" name="Green Slime" type="Monster" x="1087.33" y="4427.33">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="2"/>
</properties>
<point/>
@ -1305,35 +1305,35 @@
</object>
<object id="7" name="Blue Slime" type="Monster" x="1880" y="4198.67">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="2"/>
<property name="Type" propertytype="MonsterName" value="Blue Slime"/>
<property name="spawner" type="object" value="6"/>
</properties>
<point/>
</object>
<object id="8" name="Blue Slime" type="Monster" x="1844" y="4366.67">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="2"/>
<property name="Type" propertytype="MonsterName" value="Blue Slime"/>
<property name="spawner" type="object" value="6"/>
</properties>
<point/>
</object>
<object id="9" name="Green Slime" type="Monster" x="2022.67" y="4220">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="6"/>
</properties>
<point/>
</object>
<object id="10" name="Green Slime" type="Monster" x="1950" y="4422">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="6"/>
</properties>
<point/>
</object>
<object id="11" name="Green Slime" type="Monster" x="2832" y="4260">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="12"/>
</properties>
<point/>
@ -1341,49 +1341,49 @@
<object id="12" name="Spawn Group 3" type="SpawnGroup" x="2646" y="3996" width="242.667" height="592"/>
<object id="13" name="Green Slime" type="Monster" x="2838" y="4314">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="12"/>
</properties>
<point/>
</object>
<object id="14" name="Green Slime" type="Monster" x="2814" y="4212">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="12"/>
</properties>
<point/>
</object>
<object id="15" name="Green Slime" type="Monster" x="2820" y="4380">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="12"/>
</properties>
<point/>
</object>
<object id="16" name="Flower" type="Monster" x="3110" y="4342.67">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="12"/>
</properties>
<point/>
</object>
<object id="17" name="Flower" type="Monster" x="3112" y="4184">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="12"/>
</properties>
<point/>
</object>
<object id="18" name="Flower" type="Monster" x="2982" y="4368">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="12"/>
</properties>
<point/>
</object>
<object id="19" name="Flower" type="Monster" x="3312" y="4324">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="12"/>
</properties>
<point/>
@ -1393,35 +1393,35 @@
</object>
<object id="21" name="Green Slime" type="Monster" x="3658" y="4358">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="20"/>
</properties>
<point/>
</object>
<object id="22" name="Green Slime" type="Monster" x="3736.67" y="4232.67">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="20"/>
</properties>
<point/>
</object>
<object id="23" name="Green Slime" type="Monster" x="3690.67" y="4174">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="20"/>
</properties>
<point/>
</object>
<object id="24" name="Green Slime" type="Monster" x="3514" y="4047.33">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="20"/>
</properties>
<point/>
</object>
<object id="25" name="Green Slime" type="Monster" x="3824.67" y="4363.33">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="20"/>
</properties>
<point/>
@ -1431,35 +1431,35 @@
</object>
<object id="27" name="Green Slime" type="Monster" x="3930.67" y="3618.67">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="26"/>
</properties>
<point/>
</object>
<object id="28" name="Green Slime" type="Monster" x="3588" y="3444">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="26"/>
</properties>
<point/>
</object>
<object id="29" name="Green Slime" type="Monster" x="3924.67" y="3418">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="26"/>
</properties>
<point/>
</object>
<object id="30" name="Red Slime" type="Monster" x="3732" y="3420">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="3"/>
<property name="Type" propertytype="MonsterName" value="Red Slime"/>
<property name="spawner" type="object" value="26"/>
</properties>
<point/>
</object>
<object id="31" name="Red Slime" type="Monster" x="3822" y="3360">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="3"/>
<property name="Type" propertytype="MonsterName" value="Red Slime"/>
<property name="spawner" type="object" value="26"/>
</properties>
<point/>
@ -1469,28 +1469,28 @@
</object>
<object id="33" name="Red Slime" type="Monster" x="3684.66" y="2826.67">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="3"/>
<property name="Type" propertytype="MonsterName" value="Red Slime"/>
<property name="spawner" type="object" value="32"/>
</properties>
<point/>
</object>
<object id="34" name="Red Slime" type="Monster" x="3876.66" y="2856">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="3"/>
<property name="Type" propertytype="MonsterName" value="Red Slime"/>
<property name="spawner" type="object" value="32"/>
</properties>
<point/>
</object>
<object id="35" name="Red Slime" type="Monster" x="3780.66" y="2808">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="3"/>
<property name="Type" propertytype="MonsterName" value="Red Slime"/>
<property name="spawner" type="object" value="32"/>
</properties>
<point/>
</object>
<object id="36" name="Red Slime" type="Monster" x="3554" y="2858.67">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="3"/>
<property name="Type" propertytype="MonsterName" value="Red Slime"/>
<property name="spawner" type="object" value="32"/>
</properties>
<point/>
@ -1500,28 +1500,28 @@
</object>
<object id="38" name="Red Slime" type="Monster" x="3604.67" y="2002.67">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="3"/>
<property name="Type" propertytype="MonsterName" value="Red Slime"/>
<property name="spawner" type="object" value="37"/>
</properties>
<point/>
</object>
<object id="39" name="Red Slime" type="Monster" x="3839.34" y="1966.67">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="3"/>
<property name="Type" propertytype="MonsterName" value="Red Slime"/>
<property name="spawner" type="object" value="37"/>
</properties>
<point/>
</object>
<object id="40" name="Flower" type="Monster" x="3498" y="1919.33">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="37"/>
</properties>
<point/>
</object>
<object id="41" name="Flower" type="Monster" x="3955.34" y="1953.33">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="37"/>
</properties>
<point/>
@ -1531,28 +1531,28 @@
</object>
<object id="43" name="Red Slime" type="Monster" x="3744.67" y="1002">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="3"/>
<property name="Type" propertytype="MonsterName" value="Red Slime"/>
<property name="spawner" type="object" value="42"/>
</properties>
<point/>
</object>
<object id="44" name="Flower" type="Monster" x="3906" y="936">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="42"/>
</properties>
<point/>
</object>
<object id="45" name="Green Slime" type="Monster" x="3687.34" y="925.997">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="42"/>
</properties>
<point/>
</object>
<object id="46" name="Green Slime" type="Monster" x="3640.67" y="964.663">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="42"/>
</properties>
<point/>
@ -1577,140 +1577,140 @@
</object>
<object id="53" name="Green Slime" type="Monster" x="3102" y="588">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="47"/>
</properties>
<point/>
</object>
<object id="54" name="Green Slime" type="Monster" x="3126" y="444">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="47"/>
</properties>
<point/>
</object>
<object id="55" name="Green Slime" type="Monster" x="2410" y="496">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="50"/>
</properties>
<point/>
</object>
<object id="56" name="Green Slime" type="Monster" x="1889.33" y="600">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="52"/>
</properties>
<point/>
</object>
<object id="57" name="Green Slime" type="Monster" x="3168" y="420">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="47"/>
</properties>
<point/>
</object>
<object id="58" name="Green Slime" type="Monster" x="3102" y="528">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="47"/>
</properties>
<point/>
</object>
<object id="59" name="Green Slime" type="Monster" x="3150" y="606">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="47"/>
</properties>
<point/>
</object>
<object id="60" name="Green Slime" type="Monster" x="2817.33" y="394.67">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="49"/>
</properties>
<point/>
</object>
<object id="61" name="Green Slime" type="Monster" x="2693.33" y="414.004">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="49"/>
</properties>
<point/>
</object>
<object id="62" name="Green Slime" type="Monster" x="2888.67" y="396.67">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="48"/>
</properties>
<point/>
</object>
<object id="63" name="Green Slime" type="Monster" x="2883.33" y="596.671">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="48"/>
</properties>
<point/>
</object>
<object id="64" name="Green Slime" type="Monster" x="2524" y="423.337">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="50"/>
</properties>
<point/>
</object>
<object id="65" name="Green Slime" type="Monster" x="2372.67" y="606.003">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="50"/>
</properties>
<point/>
</object>
<object id="66" name="Green Slime" type="Monster" x="2189.33" y="412.004">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="51"/>
</properties>
<point/>
</object>
<object id="67" name="Green Slime" type="Monster" x="2242.67" y="385.333">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="51"/>
</properties>
<point/>
</object>
<object id="68" name="Green Slime" type="Monster" x="2120" y="614.67">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="51"/>
</properties>
<point/>
</object>
<object id="69" name="Red Slime" type="Monster" x="2156.67" y="408.67">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="3"/>
<property name="Type" propertytype="MonsterName" value="Red Slime"/>
<property name="spawner" type="object" value="51"/>
</properties>
<point/>
</object>
<object id="70" name="Red Slime" type="Monster" x="1942.67" y="467.337">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="3"/>
<property name="Type" propertytype="MonsterName" value="Red Slime"/>
<property name="spawner" type="object" value="52"/>
</properties>
<point/>
</object>
<object id="71" name="Red Slime" type="Monster" x="1957.33" y="618.004">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="3"/>
<property name="Type" propertytype="MonsterName" value="Red Slime"/>
<property name="spawner" type="object" value="52"/>
</properties>
<point/>
</object>
<object id="72" name="Red Slime" type="Monster" x="1806" y="545.337">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="3"/>
<property name="Type" propertytype="MonsterName" value="Red Slime"/>
<property name="spawner" type="object" value="52"/>
</properties>
<point/>
@ -1720,42 +1720,42 @@
</object>
<object id="74" name="Flower" type="Monster" x="1584" y="949.337">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="73"/>
</properties>
<point/>
</object>
<object id="75" name="Flower" type="Monster" x="1717.33" y="966.003">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="73"/>
</properties>
<point/>
</object>
<object id="76" name="Flower" type="Monster" x="1403.33" y="999.337">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="73"/>
</properties>
<point/>
</object>
<object id="77" name="Flower" type="Monster" x="1398" y="1128">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="73"/>
</properties>
<point/>
</object>
<object id="78" name="Flower" type="Monster" x="1722" y="1134">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="73"/>
</properties>
<point/>
</object>
<object id="79" name="Flower" type="Monster" x="1440" y="1218">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="73"/>
</properties>
<point/>
@ -1763,70 +1763,70 @@
<object id="80" name="Spawn Group 16" type="SpawnGroup" x="1374" y="2004" width="465.333" height="226.667"/>
<object id="81" name="Flower" type="Monster" x="1416" y="2223.33">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="80"/>
</properties>
<point/>
</object>
<object id="82" name="Flower" type="Monster" x="1428" y="2365.33">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="80"/>
</properties>
<point/>
</object>
<object id="83" name="Flower" type="Monster" x="1529.33" y="2499.33">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="80"/>
</properties>
<point/>
</object>
<object id="84" name="Flower" type="Monster" x="1706" y="2624.67">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="80"/>
</properties>
<point/>
</object>
<object id="85" name="Flower" type="Monster" x="2104" y="2565.33">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="80"/>
</properties>
<point/>
</object>
<object id="86" name="Flower" type="Monster" x="1788.67" y="2344">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="80"/>
</properties>
<point/>
</object>
<object id="87" name="Flower" type="Monster" x="2345.33" y="2350.67">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="80"/>
</properties>
<point/>
</object>
<object id="88" name="Flower" type="Monster" x="2049" y="2279">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="80"/>
</properties>
<point/>
</object>
<object id="89" name="Flower" type="Monster" x="1908.66" y="2169.66">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="80"/>
</properties>
<point/>
</object>
<object id="90" name="Flower" type="Monster" x="1656" y="2262">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="80"/>
</properties>
<point/>
@ -1837,98 +1837,98 @@
</object>
<object id="93" name="Flower" type="Monster" x="2460" y="2540">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="91"/>
</properties>
<point/>
</object>
<object id="94" name="Flower" type="Monster" x="2843" y="2187">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="91"/>
</properties>
<point/>
</object>
<object id="95" name="Flower" type="Monster" x="3372" y="2238">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="91"/>
</properties>
<point/>
</object>
<object id="96" name="Flower" type="Monster" x="3372" y="2394">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="91"/>
</properties>
<point/>
</object>
<object id="97" name="Flower" type="Monster" x="2999" y="2494">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="5"/>
<property name="Type" propertytype="MonsterName" value="Flower Turret"/>
<property name="spawner" type="object" value="91"/>
</properties>
<point/>
</object>
<object id="98" name="Red Slime" type="Monster" x="2598" y="2058">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="3"/>
<property name="Type" propertytype="MonsterName" value="Red Slime"/>
<property name="spawner" type="object" value="91"/>
</properties>
<point/>
</object>
<object id="99" name="Red Slime" type="Monster" x="2679" y="2061">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="3"/>
<property name="Type" propertytype="MonsterName" value="Red Slime"/>
<property name="spawner" type="object" value="91"/>
</properties>
<point/>
</object>
<object id="100" name="Red Slime" type="Monster" x="2839" y="2614">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="3"/>
<property name="Type" propertytype="MonsterName" value="Red Slime"/>
<property name="spawner" type="object" value="91"/>
</properties>
<point/>
</object>
<object id="101" name="Red Slime" type="Monster" x="2532" y="2657">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="3"/>
<property name="Type" propertytype="MonsterName" value="Red Slime"/>
<property name="spawner" type="object" value="91"/>
</properties>
<point/>
</object>
<object id="102" name="Red Slime" type="Monster" x="3254" y="2100">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="3"/>
<property name="Type" propertytype="MonsterName" value="Red Slime"/>
<property name="spawner" type="object" value="91"/>
</properties>
<point/>
</object>
<object id="103" name="Red Slime" type="Monster" x="3241" y="2630">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="3"/>
<property name="Type" propertytype="MonsterName" value="Red Slime"/>
<property name="spawner" type="object" value="91"/>
</properties>
<point/>
</object>
<object id="104" name="Red Slime" type="Monster" x="3591" y="2304">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="3"/>
<property name="Type" propertytype="MonsterName" value="Red Slime"/>
<property name="spawner" type="object" value="92"/>
</properties>
<point/>
</object>
<object id="105" name="Red Slime" type="Monster" x="3558" y="2326">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="3"/>
<property name="Type" propertytype="MonsterName" value="Red Slime"/>
<property name="spawner" type="object" value="92"/>
</properties>
<point/>
</object>
<object id="106" name="Red Slime" type="Monster" x="3590" y="2341">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="3"/>
<property name="Type" propertytype="MonsterName" value="Red Slime"/>
<property name="spawner" type="object" value="92"/>
</properties>
<point/>
@ -1936,35 +1936,35 @@
<object id="107" name="Spawn Group 19" type="SpawnGroup" x="4086" y="2116.67" width="320" height="376"/>
<object id="108" name="Yellow Slime" type="Monster" x="4770" y="2280">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="4"/>
<property name="Type" propertytype="MonsterName" value="Yellow Slime"/>
<property name="spawner" type="object" value="107"/>
</properties>
<point/>
</object>
<object id="109" name="Red Slime" type="Monster" x="4725.67" y="2235">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="3"/>
<property name="Type" propertytype="MonsterName" value="Red Slime"/>
<property name="spawner" type="object" value="107"/>
</properties>
<point/>
</object>
<object id="110" name="Red Slime" type="Monster" x="4728" y="2340">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="3"/>
<property name="Type" propertytype="MonsterName" value="Red Slime"/>
<property name="spawner" type="object" value="107"/>
</properties>
<point/>
</object>
<object id="111" name="Green Slime" type="Monster" x="4158" y="2046">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="107"/>
</properties>
<point/>
</object>
<object id="112" name="Green Slime" type="Monster" x="4164" y="2628">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="1"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="107"/>
</properties>
<point/>

@ -605,14 +605,14 @@
</object>
<object id="3" type="Monster" x="480" y="3096">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="4"/>
<property name="Type" propertytype="MonsterName" value="Yellow Slime"/>
<property name="spawner" type="object" value="2"/>
</properties>
<point/>
</object>
<object id="4" type="Monster" x="498" y="3198">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="4"/>
<property name="Type" propertytype="MonsterName" value="Yellow Slime"/>
<property name="spawner" type="object" value="2"/>
</properties>
<point/>

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.2" orientation="orthogonal" renderorder="right-down" width="240" height="120" tilewidth="24" tileheight="24" infinite="0" nextlayerid="6" nextobjectid="1">
<map version="1.10" tiledversion="1.10.1" orientation="orthogonal" renderorder="right-down" width="240" height="120" tilewidth="24" tileheight="24" infinite="0" nextlayerid="6" nextobjectid="1">
<tileset firstgid="1" source="../maps/Tilesheet_No_Shadow24x24.tsx"/>
<tileset firstgid="2913" source="../maps/Decorations_c1_No_Shadow24x24.tsx"/>
<layer id="2" name="Layer 1" width="240" height="120">

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.2" orientation="orthogonal" renderorder="right-down" width="200" height="120" tilewidth="24" tileheight="24" infinite="0" nextlayerid="8" nextobjectid="1">
<map version="1.10" tiledversion="1.10.1" orientation="orthogonal" renderorder="right-down" width="200" height="120" tilewidth="24" tileheight="24" infinite="0" nextlayerid="8" nextobjectid="1">
<tileset firstgid="1" source="../maps/Tilesheet_No_Shadow24x24.tsx"/>
<tileset firstgid="2913" source="../maps/Decorations_c1_No_Shadow24x24.tsx"/>
<layer id="5" name="Layer 1" width="200" height="120">

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.1" orientation="orthogonal" renderorder="right-down" width="64" height="64" tilewidth="24" tileheight="24" infinite="0" nextlayerid="4" nextobjectid="1">
<tileset firstgid="1" source="../maps/grass_tiles_24x24.tsx"/>
<tileset firstgid="784" source="../maps/Cave.tsx"/>
<tileset firstgid="440" source="../maps/Cave.tsx"/>
<layer id="1" name="Layer 1" width="64" height="64">
<data encoding="csv">
410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,

@ -267,7 +267,7 @@
</object>
<object id="4" name="Slime King" type="Monster" x="792" y="744">
<properties>
<property name="Type" type="int" propertytype="MonsterName" value="6"/>
<property name="Type" propertytype="MonsterName" value="Slime King"/>
<property name="spawner" type="object" value="3"/>
</properties>
<point/>

@ -1,8 +1,7 @@
Monsters
{
0
Green Slime
{
DisplayName = Green Slime
Health = 10
Attack = 5
@ -31,9 +30,8 @@ Monsters
# Frame Count, Frame Speed (s), Frame Cycling (Repeat,OneShot,PingPong,Reverse)
#ANIMATION[0] = 6, 0.1, Repeat
}
1
Blue Slime
{
DisplayName = Blue Slime
Health = 30
Attack = 10
@ -60,9 +58,8 @@ Monsters
#Additional custom animations go down below. Start with ANIMATION[0]
#ANIMATION[0] = MY_NEW_ANIMATION
}
2
Red Slime
{
DisplayName = Red Slime
Health = 25
Attack = 10
@ -89,9 +86,8 @@ Monsters
#Additional custom animations go down below. Start with ANIMATION[0]
#ANIMATION[0] = MY_NEW_ANIMATION
}
3
Yellow Slime
{
DisplayName = Yellow Slime
Health = 175
Attack = 10
@ -117,9 +113,8 @@ Monsters
#Additional custom animations go down below. Start with ANIMATION[0]
#ANIMATION[0] = MY_NEW_ANIMATION
}
4
Flower Turret
{
DisplayName = Flower Turret
Health = 40
Attack = 10
@ -146,9 +141,8 @@ Monsters
#Additional custom animations go down below. Start with ANIMATION[0]
#ANIMATION[0] = MY_NEW_ANIMATION
}
5
Slime King
{
DisplayName = Slime King
Health = 1200
Attack = 10

Loading…
Cancel
Save