Fix bug with monsters not facing the player on spawn and incorrectly adjusting their directions initially with the previous facing direction not matching their starting facing direction. Fixed Issue #54 . Mounted animations can be specified for the encounter spawn labels so that their combined sprites display properly now. Release Build 9220.
//Spawns the drops a monster would drop as if they were defeated. Returns what items were dropped and their amounts.
//Spawns the drops a monster would drop as if they were defeated. Returns what items were dropped and their amounts.
std::map<ItemInfo*,uint16_t>SpawnDrops();
std::map<ItemInfo*,uint16_t>SpawnDrops();
floatprevFacingDirectionAngle=0.f;//Keeps track of the angle of the previous target to ensure four-way sprite facing changes don't happen too early or spastically.
floatprevFacingDirectionAngle=PI;//Keeps track of the angle of the previous target to ensure four-way sprite facing changes don't happen too early or spastically.
floatlastFacingDirectionChange=0.f;//How much time has passed since the last facing direction change. Used to ensure another facing direction change doesn't happen too quickly. Probably allowing one every quarter second is good enough.
floatlastFacingDirectionChange=0.f;//How much time has passed since the last facing direction change. Used to ensure another facing direction change doesn't happen too quickly. Probably allowing one every quarter second is good enough.
std::vector<DeathSpawnInfo>deathData;//Data that contains further actions and information when this monster dies. Mostly used to spawn sub-monsters from a defeated monster.
std::vector<DeathSpawnInfo>deathData;//Data that contains further actions and information when this monster dies. Mostly used to spawn sub-monsters from a defeated monster.
elseERR(std::format("WARNING! Monster {} containing a mounted animation offset has {} for reading in a vector, when vectors are supposed to only have two values! Please check the \"Mounted Animation Offset\" configuration value for {}",MonsterName,DATA["Monsters"][MonsterName]["Mounted Animation Offset"].GetValueCount(),MonsterName));
std::stringidleAnimation="WARRIOR_IDLE_S";//Represents the basic animation name, not the full animation name that ANIMATION_DATA indexes into!! (Ex. Not GREEN_SLIME_IDLE, but IDLE)
std::stringjumpAnimation="WARRIOR_IDLE_S";//Represents the basic animation name, not the full animation name that ANIMATION_DATA indexes into!! (Ex. Not GREEN_SLIME_JUMP, but JUMP)
std::stringshootAnimation="WARRIOR_IDLE_S";//Represents the basic animation name, not the full animation name that ANIMATION_DATA indexes into!! (Ex. Not GREEN_SLIME_SHOOT, but SHOOT)
std::stringdeathAnimation="WARRIOR_IDLE_S";//Represents the basic animation name, not the full animation name that ANIMATION_DATA indexes into!! (Ex. Not GREEN_SLIME_DEATH, but DEATH)
std::stringstrategy;
intcollisionDmg;
EventNamehurtSound="";
EventNamedeathSound="";
EventNamewalkSound="";
std::vector<MonsterDropData>dropData;
boolisNPC=false;
boolfourWayDirectionalSprites=false;//When this flag is set, a monster has 4-way animations instead of the default 1-direction animation.
std::stringidleAnimation="WARRIOR_IDLE_S";//Represents the basic animation name, not the full animation name that ANIMATION_DATA indexes into!! (Ex. Not GREEN_SLIME_IDLE, but IDLE)
std::stringjumpAnimation="WARRIOR_IDLE_S";//Represents the basic animation name, not the full animation name that ANIMATION_DATA indexes into!! (Ex. Not GREEN_SLIME_JUMP, but JUMP)
std::stringshootAnimation="WARRIOR_IDLE_S";//Represents the basic animation name, not the full animation name that ANIMATION_DATA indexes into!! (Ex. Not GREEN_SLIME_SHOOT, but SHOOT)
std::stringdeathAnimation="WARRIOR_IDLE_S";//Represents the basic animation name, not the full animation name that ANIMATION_DATA indexes into!! (Ex. Not GREEN_SLIME_DEATH, but DEATH)
std::stringstrategy;
intcollisionDmg;
EventNamehurtSound="";
EventNamedeathSound="";
EventNamewalkSound="";
std::vector<MonsterDropData>dropData;
boolisNPC=false;
boolfourWayDirectionalSprites=false;//When this flag is set, a monster has 4-way animations instead of the default 1-direction animation.