Make 4-way directional facing directions updating a bit more lenient. Framework for boss arrow indicators when bosses go off-screen. Release Build 9382.
This commit is contained in:
parent
6902852b51
commit
4720f59ba7
@ -378,7 +378,7 @@ void Monster::UpdateFacingDirection(vf2d facingTargetPoint){
|
||||
float facingAngle=util::angleTo(GetPos(),facingTargetPoint);
|
||||
vf2d diff=GetPos()-facingTargetPoint;
|
||||
|
||||
if(abs(facingAngle-prevFacingDirectionAngle)<(7*PI)/16.f||lastFacingDirectionChange<0.25f)return; //We don't want to change facing angle until a more drastic angle of change has occurred. About 1/4 circle should be acceptable.
|
||||
if(abs(facingAngle-prevFacingDirectionAngle)<PI/4.f||lastFacingDirectionChange<0.25f)return; //We don't want to change facing angle until a more drastic angle of change has occurred. About 1/4 circle should be acceptable.
|
||||
|
||||
prevFacingDirectionAngle=facingAngle;
|
||||
lastFacingDirectionChange=0.f;
|
||||
@ -1071,4 +1071,8 @@ void Monster::SetIframes(const float iframeTime){
|
||||
|
||||
const std::string_view Monster::GetDisplayName()const{
|
||||
return MONSTER_DATA.at(GetName()).GetDisplayName();
|
||||
}
|
||||
|
||||
const bool Monster::HasArrowIndicator()const{
|
||||
return MONSTER_DATA.at(GetName()).HasArrowIndicator();
|
||||
}
|
@ -175,6 +175,7 @@ public:
|
||||
const float GetCollisionRadius()const;
|
||||
const bool IsDead()const;
|
||||
const std::string_view GetDisplayName()const;
|
||||
const bool HasArrowIndicator()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.
|
||||
|
@ -187,6 +187,7 @@ void MonsterData::InitializeMonsterData(){
|
||||
|
||||
monster.collisionRadius=8;
|
||||
if(DATA["Monsters"][MonsterName].HasProperty("Collision Radius"))monster.collisionRadius=DATA["Monsters"][MonsterName]["Collision Radius"].GetReal();
|
||||
if(DATA["Monsters"][MonsterName].HasProperty("ShowBossIndicator"))monster.hasArrowIndicator=DATA["Monsters"][MonsterName]["ShowBossIndicator"].GetBool();
|
||||
|
||||
if(hasFourWaySpriteSheet)monster.SetUsesFourWaySprites();
|
||||
|
||||
@ -437,4 +438,7 @@ const std::optional<float>MonsterData::GetLifetime()const{
|
||||
}
|
||||
const float MonsterData::GetCollisionRadius()const{
|
||||
return collisionRadius;
|
||||
}
|
||||
const bool MonsterData::HasArrowIndicator()const{
|
||||
return hasArrowIndicator;
|
||||
}
|
@ -101,6 +101,7 @@ public:
|
||||
const std::optional<float>GetLifetime()const;
|
||||
//If an object has a collision radius, returns it.
|
||||
const float GetCollisionRadius()const;
|
||||
const bool HasArrowIndicator()const;
|
||||
private:
|
||||
std::string name;
|
||||
int hp;
|
||||
@ -129,4 +130,5 @@ private:
|
||||
bool invulnerable{false};
|
||||
std::optional<float>lifetime{};
|
||||
float collisionRadius{};
|
||||
bool hasArrowIndicator{false};
|
||||
};
|
@ -39,7 +39,7 @@ All rights reserved.
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 2
|
||||
#define VERSION_PATCH 0
|
||||
#define VERSION_BUILD 9381
|
||||
#define VERSION_BUILD 9382
|
||||
|
||||
#define stringify(a) stringify_(a)
|
||||
#define stringify_(a) #a
|
||||
|
@ -222,6 +222,9 @@ Monsters
|
||||
|
||||
XP = 150
|
||||
|
||||
# A flag to show an arrow indicator when the boss is off-screen.
|
||||
ShowBossIndicator = True
|
||||
|
||||
Strategy = Slime King
|
||||
StartPhase = 1
|
||||
|
||||
@ -898,6 +901,9 @@ Monsters
|
||||
|
||||
XP = 5
|
||||
|
||||
# A flag to show an arrow indicator when the boss is off-screen.
|
||||
ShowBossIndicator = True
|
||||
|
||||
Strategy = Zephy
|
||||
|
||||
#Size of each animation frame
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user