diff --git a/Adventures in Lestoria/Monster.cpp b/Adventures in Lestoria/Monster.cpp index 5e18365d..c378248c 100644 --- a/Adventures in Lestoria/Monster.cpp +++ b/Adventures in Lestoria/Monster.cpp @@ -67,7 +67,7 @@ std::mapMonsterData::imgs; Monster::Monster(vf2d pos,MonsterData data,bool upperLevel,bool bossMob): pos(pos),spawnPos(pos),hp(data.GetHealth()),size(data.GetSizeMult()),targetSize(data.GetSizeMult()),strategy(data.GetAIStrategy()),name(data.GetDisplayName()),upperLevel(upperLevel),isBoss(bossMob),facingDirection(DOWN){ for(const std::string&anim:data.GetAnimations()){ - animation.AddState(anim,ANIMATION_DATA[anim]); + animation.AddState(anim,ANIMATION_DATA[std::format("{}_{}",name,anim)]); } PerformIdleAnimation(); stats.A("Health")=data.GetHealth(); @@ -705,7 +705,7 @@ std::mapMonster::SpawnDrops(){ int dropQuantity=int(data.minQty+std::round(util::random(float(data.maxQty-data.minQty)))); for(int i=0;i(&data.item))++; + drops[const_cast(&data.item)]++; } } } diff --git a/Adventures in Lestoria/MonsterData.cpp b/Adventures in Lestoria/MonsterData.cpp index 777a166a..2b185829 100644 --- a/Adventures in Lestoria/MonsterData.cpp +++ b/Adventures in Lestoria/MonsterData.cpp @@ -52,7 +52,7 @@ std::mapMONSTER_DATA; MonsterData::MonsterData() :atk(0),collisionDmg(0),hp(0),moveSpd(0),size(0),strategy("Run Towards"){} MonsterData::MonsterData(std::string name,int hp,int atk,const uint32_t xp,std::vectordrops,float moveSpd,float size,std::string strategy,int collisionDmg): - name(name),hp(hp),atk(atk),xp(xp),moveSpd(moveSpd),size(size),strategy(strategy),animations(animations),dropData(drops),collisionDmg(collisionDmg){} + name(name),hp(hp),atk(atk),xp(xp),moveSpd(moveSpd),size(size),strategy(strategy),dropData(drops),collisionDmg(collisionDmg){} void MonsterData::InitializeMonsterData(){ for(auto&[key,size]:DATA["Monsters"].GetKeys()){ @@ -173,12 +173,7 @@ void MonsterData::InitializeNPCData(){ if(MONSTER_DATA.count(key)){ ERR("WARNING! A monster with the name "<animations{ - NPCName+"_IDLE", - NPCName+"_JUMP", - NPCName+"_SPIT", - NPCName+"_DIE", - }; + std::vectoranimations; MonsterData::imgs[NPCName]=NEW Renderable(); const rcode imgLoadResult=MonsterData::imgs[NPCName]->Load("assets/npcs/"+NPCName+".png"); @@ -270,7 +265,7 @@ void MonsterData::InitializeNPCData(){ MonsterData monster(NPCName,health,attack,xp,drops,moveSpd,size/100,strategyName,collisionDmg); for(size_t animationRow=0;const std::string&animationName:animations){ - //if(!monster.animations.insert(animationName).second)ERR(std::format("WARNING! The Animation {} for Monster {} already exists! Animations should have unique names!",animationName,NPCName)); + if(!monster.animations.insert(animationName).second)ERR(std::format("WARNING! The Animation {} for Monster {} already exists! Animations should have unique names!",animationName,NPCName)); switch(animationRow){ case 0:monster.idleAnimation=animationName;break; diff --git a/Adventures in Lestoria/SpawnEncounterLabel.h b/Adventures in Lestoria/SpawnEncounterLabel.h index d5e5456f..cfc7cd5b 100644 --- a/Adventures in Lestoria/SpawnEncounterLabel.h +++ b/Adventures in Lestoria/SpawnEncounterLabel.h @@ -52,7 +52,7 @@ class SpawnEncounterLabel:public MenuLabel{ public: inline SpawnEncounterLabel(geom2d::rectrect,std::string label,std::string monsterName) :MenuLabel(rect,label),monsterName(monsterName){ - anim.AddState("IDLE",ANIMATION_DATA.at(MONSTER_DATA.at(monsterName).GetIdleAnimation())); + anim.AddState("IDLE",ANIMATION_DATA.at(std::format("{}_{}",monsterName,MONSTER_DATA.at(monsterName).GetIdleAnimation()))); anim.ChangeState(state,"IDLE"); anim.UpdateState(state,util::random(1)); } diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index ae3c74eb..c1492211 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 1 #define VERSION_MINOR 2 #define VERSION_PATCH 0 -#define VERSION_BUILD 9115 +#define VERSION_BUILD 9125 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/config/Monsters.txt b/Adventures in Lestoria/assets/config/Monsters.txt index 8477aa24..0262f157 100644 --- a/Adventures in Lestoria/assets/config/Monsters.txt +++ b/Adventures in Lestoria/assets/config/Monsters.txt @@ -256,7 +256,7 @@ Monsters # Animations must be defined in the same order as they are in their sprite sheets # The First Four animations must represent a standing, walking, attack, and death animation. Their names are up to the creator. IDLE = 3, 0.2, PingPong - JUMP = 4, 0.06, PingPong + WALK = 4, 0.06, PingPong SHOOT = 10, 0.1, OneShot DEATH = 4, 0.1, OneShot } diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 76602f74..e86de2cb 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ