#include "olcPixelGameEngine.h" #include "Monster.h" #include "Animation.h" #include "config.h" #include "DEFINES.h" #include "safemap.h" INCLUDE_DATA INCLUDE_STRATEGY_DATA INCLUDE_ANIMATION_DATA std::mapMONSTER_DATA; safemapMONSTER_NAME_DATA; MonsterData::MonsterData() :atk(0),collisionDmg(0),hp(0),id(0),moveSpd(0),size(0),strategy(0){} MonsterData::MonsterData(int id,std::string name,int hp,int atk,std::vectoranimations,float moveSpd,float size,int strategy,int collisionDmg): id(id),name(name),hp(hp),atk(atk),moveSpd(moveSpd),size(size),strategy(strategy),animations(animations),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(); std::vectoranimations{ MonsterName+"_IDLE", MonsterName+"_JUMP", MonsterName+"_SPIT", MonsterName+"_DIE", }; MonsterData::imgs[id]=new Renderable(); MonsterData::imgs[id]->Load("assets/monsters/"+MonsterName+".png"); for(int i=0;i