Phase 1&2 prepping.

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
pull/35/head
Nic0Nic0Nii 10 months ago
parent 77ba0369fb
commit aabc9e4cc5
  1. 6
      Adventures in Lestoria/SlimeKing.cpp
  2. 19
      Adventures in Lestoria/Ursule.cpp
  3. 3
      Adventures in Lestoria/assets/config/MonsterStrategies.txt

@ -244,7 +244,7 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,std::string strat
m.phase=ConfigInt("StartPhase"); m.phase=ConfigInt("StartPhase");
}break; }break;
case 1:{ case 1:{
if(m.hp<=m.stats.A("Health")*ConfigFloat("Phase2.Change")/100){ if(m.GetRemainingHPPct()<=ConfigFloat("Phase2.Change")/100.f){
m.phase=2; m.phase=2;
m.SetSize(ConfigFloat("Phase2.Size")/100,false); m.SetSize(ConfigFloat("Phase2.Size")/100,false);
TransitionPhase(m.phase); TransitionPhase(m.phase);
@ -277,7 +277,7 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,std::string strat
} }
}break; }break;
case 2:{ case 2:{
if(m.hp<=m.stats.A("Health")*ConfigFloat("Phase3.Change")/100){ if(m.GetRemainingHPPct()<=ConfigFloat("Phase3.Change")/100.f){
m.phase=3; m.phase=3;
m.SetSize(ConfigFloat("Phase3.Size")/100,false); m.SetSize(ConfigFloat("Phase3.Size")/100,false);
TransitionPhase(m.phase); TransitionPhase(m.phase);
@ -302,7 +302,7 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,std::string strat
} }
}break; }break;
case 3:{ case 3:{
if(m.hp<=m.stats.A("Health")*ConfigFloat("Phase4.Change")/100){ if(m.GetRemainingHPPct()<=ConfigFloat("Phase4.Change")/100.f){
m.phase=4; m.phase=4;
m.SetSize(ConfigFloat("Phase4.Size")/100,false); m.SetSize(ConfigFloat("Phase4.Size")/100,false);
m.AddBuff(BuffType::SLOWDOWN,99999,ConfigFloat("Phase4.MoveSpdModifier")/100); m.AddBuff(BuffType::SLOWDOWN,99999,ConfigFloat("Phase4.MoveSpdModifier")/100);

@ -52,15 +52,26 @@ INCLUDE_MONSTER_DATA
using A=Attribute; using A=Attribute;
void Monster::STRATEGY::URSULE(Monster&m,float fElapsedTime,std::string strategy){ void Monster::STRATEGY::URSULE(Monster&m,float fElapsedTime,std::string strategy){
switch(m.I(A::PHASE)){ switch(m.phase){
case 0:{ case 0:{
m.phase=ConfigInt("StartPhase"); m.phase=ConfigInt("StartPhase");
}break; }break;
case 1:{ //Run bear strategy in phase 1. case 1:{ //Run bear strategy in phase 1.
if(m.GetRemainingHPPct()<=ConfigInt("Phase 2.Change")/100.f){ if(m.GetRemainingHPPct()<=ConfigFloat("Phase 2.Change")/100.f){
m.I(A::PHASE)=2; if(m.F(A::RUN_AWAY_TIMER)==0.f)m.F(A::RUN_AWAY_TIMER)=10.f;
} //before moving to Phase 2, we need to make sure we're in Phase 0 of the bear AI.
//We also need to move to the center of the map.
if(m.I(A::PHASE)!=0.f)goto bear;
else{
float distToCenter=geom2d::line<float>(m.GetPos(),game->GetCurrentMap().MapData.MapSize*{game->GetCurrentMap().MapData.tilewidth,game->GetCurrentMap().MapData.tileheight}).length();
if(){
}else{ //Now we're finally good for phase 2.
m.phase=2;
}
}
}
bear:
BEAR(m,fElapsedTime,"Bear"); BEAR(m,fElapsedTime,"Bear");
}break; }break;
case 2:{ case 2:{

@ -233,6 +233,9 @@ MonsterStrategy
# Which phase to start on. Should be 1 most of the time. # Which phase to start on. Should be 1 most of the time.
StartPhase = 1 StartPhase = 1
# The maximum amount of time to spend trying to run to the center of the map.
Run To Center Max Time = 10.0s
Wisp Pattern 0 Wisp Pattern 0
{ {
Row[0] = .O...O.. Row[0] = .O...O..

Loading…
Cancel
Save