Add in a run towards phase after a certain number of stomps for second boss.
This commit is contained in:
parent
3f53625aab
commit
9163eecd4a
@ -84,6 +84,7 @@ void Monster::STRATEGY::BEAR(Monster&m,float fElapsedTime,std::string strategy){
|
||||
if(m.F(A::CASTING_TIMER)==0.f){
|
||||
SoundEffect::PlaySFX("Bear Slam Attack",m.V(A::LOCKON_POS));
|
||||
m.I(A::PHASE)=0;
|
||||
m.I(A::BEAR_STOMP_COUNT)++;
|
||||
geom2d::circle<float>attackCircle={m.V(A::LOCKON_POS),float(operator""_Pixels(ConfigFloat("Smash Attack Diameter"))/2.f)};
|
||||
if(geom2d::overlaps(attackCircle,game->GetPlayer()->Hitbox())){
|
||||
if(game->GetPlayer()->Hurt(m.GetAttack(),m.OnUpperLevel(),0.f)){
|
||||
|
@ -90,4 +90,6 @@ enum class Attribute{
|
||||
ENVIRONMENT_PHASE,
|
||||
CHARGE_COOLDOWN,
|
||||
BULLETS_REMOVED,
|
||||
BEAR_STOMP_COUNT,
|
||||
PREVIOUS_PHASE,
|
||||
};
|
@ -383,11 +383,13 @@ const void SaveFile::Server_SaveMetadataFile(std::function<void(std::string_view
|
||||
}
|
||||
}
|
||||
std::string contents=fileContents.str();
|
||||
#ifdef __EMSCRIPTEN__
|
||||
emscripten_idb_async_store("/assets",("save_file_path"_S+"metadata.dat"+"_online").c_str(),contents.data(),contents.length(),0,[](void*arg){
|
||||
std::cout<<"Saved metadata successfully!"<<std::endl;
|
||||
},[](void*arg){
|
||||
std::cout<<"Failed to save metadata!"<<std::endl;
|
||||
});
|
||||
#endif
|
||||
game->SendRequest("save_server"_S,CreateServerRequest(SaveFileOperation::SAVE_METADATA_FILE,fileContents.str()));
|
||||
game->responseCallback=respCallbackFunc;
|
||||
}
|
||||
|
@ -140,6 +140,15 @@ void Monster::STRATEGY::URSULE(Monster&m,float fElapsedTime,std::string strategy
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(m.I(A::BEAR_STOMP_COUNT)%(ConfigInt("Phase 1.Stomp Count")+1)==ConfigInt("Phase 1.Stomp Count")){
|
||||
m.F(A::RUN_AWAY_TIMER)=ConfigFloat("Phase 1.Run Time");
|
||||
m.I(A::PREVIOUS_PHASE)=m.phase;
|
||||
m.AddBuff(SPEEDBOOST,10.f,ConfigFloat("Phase 1.Run Speed Boost")/100.f);
|
||||
m.phase=6;
|
||||
break;
|
||||
}
|
||||
|
||||
bear:
|
||||
BEAR(m,fElapsedTime,"Bear");
|
||||
}break;
|
||||
@ -261,7 +270,6 @@ void Monster::STRATEGY::URSULE(Monster&m,float fElapsedTime,std::string strategy
|
||||
if(m.I(A::PHASE)!=0)goto bear2; //Prevent doing anything else if a part of bear AI is still running.
|
||||
|
||||
if(m.GetRemainingHPPct()<=ConfigFloat("Phase 4.Change")/100.f){
|
||||
|
||||
auto TransitionToPhase5=[&](){
|
||||
m.phase=5;
|
||||
m.PerformOtherAnimation(1);
|
||||
@ -294,7 +302,11 @@ void Monster::STRATEGY::URSULE(Monster&m,float fElapsedTime,std::string strategy
|
||||
|
||||
if(distToPlayer>=ConfigFloat("Phase 3.Charge Range")/100.f*24.f&&m.F(A::CHARGE_COOLDOWN)==0.f){
|
||||
if(ConfigFloat("Phase 3.Charge Cast Time")!=0.f){
|
||||
if(m.F(A::CASTING_TIMER)==0.f)m.F(A::CASTING_TIMER)=ConfigFloat("Phase 3.Charge Cast Time");
|
||||
if(m.F(A::CASTING_TIMER)==0.f){
|
||||
m.F(A::CASTING_TIMER)=ConfigFloat("Phase 3.Charge Cast Time");
|
||||
m.UpdateFacingDirection(geom2d::line<float>(m.GetPos(),game->GetPlayer()->GetPos()).vector());
|
||||
m.PerformOtherAnimation(4);
|
||||
}
|
||||
}
|
||||
if(m.F(A::CASTING_TIMER)>0.f){
|
||||
m.F(A::CASTING_TIMER)=std::max(0.f,m.F(A::CASTING_TIMER)-fElapsedTime);
|
||||
@ -310,9 +322,19 @@ void Monster::STRATEGY::URSULE(Monster&m,float fElapsedTime,std::string strategy
|
||||
m.F(A::TARGET_TIMER)=ConfigFloat("Phase 3.Charge Max Run Time");
|
||||
m.F(A::CHARGE_COOLDOWN)=ConfigFloat("Phase 3.Charge Attack Cooldown");
|
||||
m.PerformOtherAnimation(3);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(m.F(A::CASTING_TIMER)==0.f){
|
||||
if(m.I(A::BEAR_STOMP_COUNT)%(ConfigInt("Phase 3.Stomp Count")+1)==ConfigInt("Phase 3.Stomp Count")){
|
||||
m.F(A::RUN_AWAY_TIMER)=ConfigFloat("Phase 3.Run Time");
|
||||
m.AddBuff(SPEEDBOOST,10.f,ConfigFloat("Phase 3.Run Speed Boost")/100.f);
|
||||
m.I(A::PREVIOUS_PHASE)=m.phase;
|
||||
m.phase=6;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bear2:
|
||||
@ -399,6 +421,18 @@ void Monster::STRATEGY::URSULE(Monster&m,float fElapsedTime,std::string strategy
|
||||
}
|
||||
}
|
||||
}break;
|
||||
case 6:{
|
||||
//Run towards the target for a set amount of time.
|
||||
m.F(A::RUN_AWAY_TIMER)=std::max(0.f,m.F(A::RUN_AWAY_TIMER)-fElapsedTime);
|
||||
m.targetAcquireTimer=20.f;
|
||||
m.target=game->GetPlayer()->GetPos();
|
||||
RUN_TOWARDS(m,fElapsedTime,"Run Towards");
|
||||
if(m.F(A::RUN_AWAY_TIMER)==0.f){
|
||||
m.phase=m.I(A::PREVIOUS_PHASE);
|
||||
m.RemoveBuff(SPEEDBOOST);
|
||||
m.I(A::BEAR_STOMP_COUNT)=0;
|
||||
}
|
||||
}break;
|
||||
default:{
|
||||
ERR(std::format("WARNING! Unknown phase {} for {} reached!",m.phase,m.GetName()));
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ All rights reserved.
|
||||
#define VERSION_MAJOR 0
|
||||
#define VERSION_MINOR 3
|
||||
#define VERSION_PATCH 0
|
||||
#define VERSION_BUILD 6394
|
||||
#define VERSION_BUILD 6400
|
||||
|
||||
#define stringify(a) stringify_(a)
|
||||
#define stringify_(a) #a
|
||||
|
@ -390,5 +390,6 @@ Monsters
|
||||
ANIMATION[1] = 6, 0.15, OneShot
|
||||
ANIMATION[2] = 2, 0.2, Reverse
|
||||
ANIMATION[3] = 5, 0.1, Repeat
|
||||
ANIMATION[4] = 4, 0.3, Repeat
|
||||
}
|
||||
}
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user