Fixed bosses being able to leave their arenas. (Issue#41) Fix Slime King not actually moving during the Phase 4 retreat jump (division by zero when jump lockon timers were implemented). Release Build 8652.

pull/57/head
sigonasr2 8 months ago
parent 3f13c574c0
commit 020f47f1f9
  1. 4
      Adventures in Lestoria/Monster.cpp
  2. 4
      Adventures in Lestoria/SlimeKing.cpp
  3. 2
      Adventures in Lestoria/Version.h
  4. BIN
      x64/Release/Adventures in Lestoria.exe

@ -165,7 +165,7 @@ bool Monster::_SetX(float x,const bool monsterInvoked){
} }
#pragma endregion #pragma endregion
#pragma region lambdas #pragma region lambdas
auto NoEnemyCollisionWithTile=[&](){return (isBoss&&insideArenaBounds)||!geom2d::overlaps(newPos,collision);}; auto NoEnemyCollisionWithTile=[&](){return (isBoss&&insideArenaBounds)||(!isBoss&&!geom2d::overlaps(newPos,collision));};
#pragma endregion #pragma endregion
collision.pos+=tilePos; collision.pos+=tilePos;
if(NoEnemyCollisionWithTile()){ if(NoEnemyCollisionWithTile()){
@ -204,7 +204,7 @@ bool Monster::_SetY(float y,const bool monsterInvoked){
} }
#pragma endregion #pragma endregion
#pragma region lambdas #pragma region lambdas
auto NoEnemyCollisionWithTile=[&](){return (isBoss&&insideArenaBounds)||!geom2d::overlaps(newPos,collision);}; auto NoEnemyCollisionWithTile=[&](){return (isBoss&&insideArenaBounds)||(!isBoss&&!geom2d::overlaps(newPos,collision));};
#pragma endregion #pragma endregion
collision.pos+=tilePos; collision.pos+=tilePos;
if(NoEnemyCollisionWithTile()){ if(NoEnemyCollisionWithTile()){

@ -349,10 +349,10 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,std::string strat
} }
if(m.I(A::PHASE_REPEAT_COUNT)>=5){ if(m.I(A::PHASE_REPEAT_COUNT)>=5){
m.I(A::PHASE_REPEAT_COUNT)=0; m.I(A::PHASE_REPEAT_COUNT)=0;
float jumpAngle=util::angleTo(m.GetPos(),game->GetCurrentMapData().MapSize*game->GetCurrentMapData().tilewidth/2); //We jump towards the center to keep the player from constantly dealing with a stuck boss. float jumpAngle=util::angleTo(m.GetPos(),game->GetCurrentMapData().MapSize/2*game->GetCurrentMapData().tilewidth); //We jump towards the center to keep the player from constantly dealing with a stuck boss.
float jumpDistance=ConfigFloat("Phase4.JumpDistance")/100*game->GetCurrentMapData().tilewidth; float jumpDistance=ConfigFloat("Phase4.JumpDistance")/100*game->GetCurrentMapData().tilewidth;
float jumpSpd=jumpDistance/ConfigFloat("Phase4.JumpDuration"); float jumpSpd=jumpDistance/ConfigFloat("Phase4.JumpDuration");
float lockedInTargetTime=jumpDistance/ConfigFloat("Phase4.JumpLockinTargetTime"); float lockedInTargetTime=ConfigFloat("Phase4.JumpLockinTargetTime");
StartJump(ConfigFloat("Phase4.JumpDuration"),m.GetPos()+vf2d{cos(jumpAngle)*jumpDistance,sin(jumpAngle)*jumpDistance},0,jumpSpd,lockedInTargetTime); StartJump(ConfigFloat("Phase4.JumpDuration"),m.GetPos()+vf2d{cos(jumpAngle)*jumpDistance,sin(jumpAngle)*jumpDistance},0,jumpSpd,lockedInTargetTime);
}else }else
if(m.I(A::PATTERN_REPEAT_COUNT)<5&&m.F(A::SHOOT_TIMER)==0){ if(m.I(A::PATTERN_REPEAT_COUNT)<5&&m.F(A::SHOOT_TIMER)==0){

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 0 #define VERSION_MINOR 0
#define VERSION_PATCH 0 #define VERSION_PATCH 0
#define VERSION_BUILD 8647 #define VERSION_BUILD 8652
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

Loading…
Cancel
Save