diff --git a/Adventures in Lestoria/Monster.cpp b/Adventures in Lestoria/Monster.cpp index 62be3661..f09d818c 100644 --- a/Adventures in Lestoria/Monster.cpp +++ b/Adventures in Lestoria/Monster.cpp @@ -272,7 +272,7 @@ bool Monster::Update(float fElapsedTime){ lastFacingDirectionChange+=fElapsedTime; timeSpentAlive+=fElapsedTime; - if(IsSolid()){ + if(IsSolid()&&FadeoutWhenStandingBehind()){ if(GetPos().y>=game->GetPlayer()->GetPos().y)solidFadeTimer=std::min(TileGroup::FADE_TIME,solidFadeTimer+game->GetElapsedTime()); else solidFadeTimer=std::max(0.f,solidFadeTimer-game->GetElapsedTime()); } @@ -371,7 +371,7 @@ bool Monster::Update(float fElapsedTime){ } } } - if(GetState()==State::NORMAL){ + if(GetState()==State::NORMAL&&FaceTarget()){ UpdateFacingDirection(game->GetPlayer()->GetPos()); } if(!game->TestingModeEnabled()&&CanMove())Monster::STRATEGY::RUN_STRATEGY(*this,fElapsedTime); @@ -1529,4 +1529,11 @@ void Monster::Stun(const float stunDuration){ } const float&Monster::GetRemainingStunDuration()const{ return stunTimer; +} + +const bool Monster::FadeoutWhenStandingBehind()const{ + return MONSTER_DATA.at(name).FadeoutWhenStandingBehind(); +} +const bool Monster::FaceTarget()const{ + return MONSTER_DATA.at(name).FaceTarget(); } \ No newline at end of file diff --git a/Adventures in Lestoria/Monster.h b/Adventures in Lestoria/Monster.h index 221f83f4..56969f0f 100644 --- a/Adventures in Lestoria/Monster.h +++ b/Adventures in Lestoria/Monster.h @@ -220,6 +220,8 @@ public: const bool IsBackstabAttack()const; void Stun(const float stunDuration); const float&GetRemainingStunDuration()const; + const bool FadeoutWhenStandingBehind()const; + const bool FaceTarget()const; private: //NOTE: Marking a monster for deletion does not trigger any death events. It just simply removes the monster from the field!! // The way this works is that monsters marked for deletion will cause the monster update loop to detect there's at least one or more monsters that must be deleted and will call erase_if on the list at the end of the iteration loop. diff --git a/Adventures in Lestoria/MonsterData.cpp b/Adventures in Lestoria/MonsterData.cpp index 0a9cf54a..cda1ebb1 100644 --- a/Adventures in Lestoria/MonsterData.cpp +++ b/Adventures in Lestoria/MonsterData.cpp @@ -178,6 +178,8 @@ void MonsterData::InitializeMonsterData(){ DATA["Monsters"][MonsterName]["CollisionDmg"].GetInt() ); + if(DATA["Monsters"][MonsterName].HasProperty("Fadeout"))monster.fadeout=DATA["Monsters"][MonsterName]["Fadeout"].GetBool(); + if(DATA["Monsters"][MonsterName].HasProperty("No Facing"))monster.noFacing=DATA["Monsters"][MonsterName]["No Facing"].GetBool(); if(DATA["Monsters"][MonsterName].HasProperty("Ignore Collisions"))monster.ignoresCollision=DATA["Monsters"][MonsterName]["Ignore Collisions"].GetBool(); if(DATA["Monsters"][MonsterName].HasProperty("Mounted Animation"))monster.mountedAnimName=DATA["Monsters"][MonsterName]["Mounted Animation"].GetString(); if(DATA["Monsters"][MonsterName].HasProperty("Mounted Animation Offset")){ @@ -459,4 +461,12 @@ const bool MonsterData::HasArrowIndicator()const{ const std::optional>&MonsterData::GetRectangleCollision()const{ return rectCollision; +} + + +const bool MonsterData::FadeoutWhenStandingBehind()const{ + return fadeout; +} +const bool MonsterData::FaceTarget()const{ + return !noFacing; } \ No newline at end of file diff --git a/Adventures in Lestoria/MonsterData.h b/Adventures in Lestoria/MonsterData.h index 0bdba432..4745104e 100644 --- a/Adventures in Lestoria/MonsterData.h +++ b/Adventures in Lestoria/MonsterData.h @@ -106,6 +106,8 @@ public: const float GetCollisionRadius()const; const bool HasArrowIndicator()const; const std::optional>&GetRectangleCollision()const; + const bool FadeoutWhenStandingBehind()const; + const bool FaceTarget()const; private: std::string name; int hp; @@ -132,6 +134,8 @@ private: bool ignoresCollision{false}; //If set to true, this monster does not run into terrain. bool immovable{false}; bool invulnerable{false}; + bool fadeout{false}; + bool noFacing{false}; std::optionallifetime{}; float collisionRadius{}; bool hasArrowIndicator{false}; diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index a4a9dddb..8c45b49b 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 3 -#define VERSION_BUILD 11084 +#define VERSION_BUILD 11085 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/Campaigns/Hub_v2.tmx b/Adventures in Lestoria/assets/Campaigns/Hub_v2.tmx index 179dd2c9..cff9fed5 100644 --- a/Adventures in Lestoria/assets/Campaigns/Hub_v2.tmx +++ b/Adventures in Lestoria/assets/Campaigns/Hub_v2.tmx @@ -1,5 +1,5 @@ - + @@ -453,5 +453,18 @@ + + + + + + + + + + + + + diff --git a/Adventures in Lestoria/assets/config/Monsters.txt b/Adventures in Lestoria/assets/config/Monsters.txt index 36158b4e..7fe42dba 100644 --- a/Adventures in Lestoria/assets/config/Monsters.txt +++ b/Adventures in Lestoria/assets/config/Monsters.txt @@ -1150,6 +1150,90 @@ Monsters # Death Sound = Slime Dead # Walk Sound = Slime Walk + # Drop Item Name, Drop Percentage(0-100%), Drop Min Quantity, Drop Max Quantity + # DROP[0] = Ring of the Bear,100%,1,1 + } + Training Dummy + { + Health = 999999999 + Attack = 0 + + CollisionDmg = 0 + + Fadeout = False + No Facing = True + + MoveSpd = 0% + Size = 100% + Collision Radius = 9 + + XP = 0 + + Strategy = Do Nothing + + #Size of each animation frame + SheetFrameSize = 24,24 + + # Setting this to true means every four rows indicates one animation, the ordering of the directions is: NORTH, EAST, SOUTH, WEST + 4-Way Spritesheet = False + + Animations + { + # Frame Count, Frame Speed (s), Frame Cycling (Repeat,OneShot,PingPong,Reverse,ReverseOneShot) + # 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 = 1, 0.4, OneShot + WALK = 1, 0.2, Repeat + STAND BEHIND ME = 1, 0.2, OneShot + DEATH = 1, 0.15, OneShot + } + + Hurt Sound = Monster Hurt + Death Sound = Slime Dead + Walk Sound = Slime Walk + + # Drop Item Name, Drop Percentage(0-100%), Drop Min Quantity, Drop Max Quantity + # DROP[0] = Ring of the Bear,100%,1,1 + } + Large Training Dummy + { + Health = 999999999 + Attack = 0 + + CollisionDmg = 0 + + Fadeout = False + No Facing = True + + MoveSpd = 0% + Size = 200% + Collision Radius = 9 + + XP = 0 + + Strategy = Do Nothing + + #Size of each animation frame + SheetFrameSize = 24,24 + + # Setting this to true means every four rows indicates one animation, the ordering of the directions is: NORTH, EAST, SOUTH, WEST + 4-Way Spritesheet = False + + Animations + { + # Frame Count, Frame Speed (s), Frame Cycling (Repeat,OneShot,PingPong,Reverse,ReverseOneShot) + # 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 = 1, 0.4, OneShot + WALK = 1, 0.2, Repeat + STAND BEHIND ME = 1, 0.2, OneShot + DEATH = 1, 0.15, OneShot + } + + Hurt Sound = Monster Hurt + Death Sound = Slime Dead + Walk Sound = Slime Walk + # Drop Item Name, Drop Percentage(0-100%), Drop Min Quantity, Drop Max Quantity # DROP[0] = Ring of the Bear,100%,1,1 } diff --git a/Adventures in Lestoria/assets/gamepack.pak b/Adventures in Lestoria/assets/gamepack.pak index a920109c..8732f9f3 100644 Binary files a/Adventures in Lestoria/assets/gamepack.pak and b/Adventures in Lestoria/assets/gamepack.pak differ diff --git a/Adventures in Lestoria/assets/maps/Monster_Presets.tmx b/Adventures in Lestoria/assets/maps/Monster_Presets.tmx index 1d2df413..5c214039 100644 --- a/Adventures in Lestoria/assets/maps/Monster_Presets.tmx +++ b/Adventures in Lestoria/assets/maps/Monster_Presets.tmx @@ -1,5 +1,5 @@ - + @@ -27,5 +27,7 @@ + + diff --git a/Adventures in Lestoria/assets/maps/Monsters/Large Training Dummy.tx b/Adventures in Lestoria/assets/maps/Monsters/Large Training Dummy.tx new file mode 100644 index 00000000..c7540d9e --- /dev/null +++ b/Adventures in Lestoria/assets/maps/Monsters/Large Training Dummy.tx @@ -0,0 +1,5 @@ + + diff --git a/Adventures in Lestoria/assets/maps/Monsters/Training Dummy.tx b/Adventures in Lestoria/assets/maps/Monsters/Training Dummy.tx new file mode 100644 index 00000000..a3112ba7 --- /dev/null +++ b/Adventures in Lestoria/assets/maps/Monsters/Training Dummy.tx @@ -0,0 +1,5 @@ + + diff --git a/Adventures in Lestoria/assets/maps/monsters-tileset.png b/Adventures in Lestoria/assets/maps/monsters-tileset.png index 16e60c79..b34a9b6c 100644 Binary files a/Adventures in Lestoria/assets/maps/monsters-tileset.png and b/Adventures in Lestoria/assets/maps/monsters-tileset.png differ diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 10920d73..61835f19 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ