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){
|
if(m.F(A::CASTING_TIMER)==0.f){
|
||||||
SoundEffect::PlaySFX("Bear Slam Attack",m.V(A::LOCKON_POS));
|
SoundEffect::PlaySFX("Bear Slam Attack",m.V(A::LOCKON_POS));
|
||||||
m.I(A::PHASE)=0;
|
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)};
|
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(geom2d::overlaps(attackCircle,game->GetPlayer()->Hitbox())){
|
||||||
if(game->GetPlayer()->Hurt(m.GetAttack(),m.OnUpperLevel(),0.f)){
|
if(game->GetPlayer()->Hurt(m.GetAttack(),m.OnUpperLevel(),0.f)){
|
||||||
|
@ -90,4 +90,6 @@ enum class Attribute{
|
|||||||
ENVIRONMENT_PHASE,
|
ENVIRONMENT_PHASE,
|
||||||
CHARGE_COOLDOWN,
|
CHARGE_COOLDOWN,
|
||||||
BULLETS_REMOVED,
|
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();
|
std::string contents=fileContents.str();
|
||||||
emscripten_idb_async_store("/assets",("save_file_path"_S+"metadata.dat"+"_online").c_str(),contents.data(),contents.length(),0,[](void*arg){
|
#ifdef __EMSCRIPTEN__
|
||||||
std::cout<<"Saved metadata successfully!"<<std::endl;
|
emscripten_idb_async_store("/assets",("save_file_path"_S+"metadata.dat"+"_online").c_str(),contents.data(),contents.length(),0,[](void*arg){
|
||||||
},[](void*arg){
|
std::cout<<"Saved metadata successfully!"<<std::endl;
|
||||||
std::cout<<"Failed to save metadata!"<<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->SendRequest("save_server"_S,CreateServerRequest(SaveFileOperation::SAVE_METADATA_FILE,fileContents.str()));
|
||||||
game->responseCallback=respCallbackFunc;
|
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:
|
||||||
BEAR(m,fElapsedTime,"Bear");
|
BEAR(m,fElapsedTime,"Bear");
|
||||||
}break;
|
}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.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){
|
if(m.GetRemainingHPPct()<=ConfigFloat("Phase 4.Change")/100.f){
|
||||||
|
|
||||||
auto TransitionToPhase5=[&](){
|
auto TransitionToPhase5=[&](){
|
||||||
m.phase=5;
|
m.phase=5;
|
||||||
m.PerformOtherAnimation(1);
|
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(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(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){
|
if(m.F(A::CASTING_TIMER)>0.f){
|
||||||
m.F(A::CASTING_TIMER)=std::max(0.f,m.F(A::CASTING_TIMER)-fElapsedTime);
|
m.F(A::CASTING_TIMER)=std::max(0.f,m.F(A::CASTING_TIMER)-fElapsedTime);
|
||||||
@ -310,8 +322,18 @@ 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::TARGET_TIMER)=ConfigFloat("Phase 3.Charge Max Run Time");
|
||||||
m.F(A::CHARGE_COOLDOWN)=ConfigFloat("Phase 3.Charge Attack Cooldown");
|
m.F(A::CHARGE_COOLDOWN)=ConfigFloat("Phase 3.Charge Attack Cooldown");
|
||||||
m.PerformOtherAnimation(3);
|
m.PerformOtherAnimation(3);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -399,6 +421,18 @@ void Monster::STRATEGY::URSULE(Monster&m,float fElapsedTime,std::string strategy
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}break;
|
}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:{
|
default:{
|
||||||
ERR(std::format("WARNING! Unknown phase {} for {} reached!",m.phase,m.GetName()));
|
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_MAJOR 0
|
||||||
#define VERSION_MINOR 3
|
#define VERSION_MINOR 3
|
||||||
#define VERSION_PATCH 0
|
#define VERSION_PATCH 0
|
||||||
#define VERSION_BUILD 6394
|
#define VERSION_BUILD 6400
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #a
|
#define stringify_(a) #a
|
||||||
|
@ -390,5 +390,6 @@ Monsters
|
|||||||
ANIMATION[1] = 6, 0.15, OneShot
|
ANIMATION[1] = 6, 0.15, OneShot
|
||||||
ANIMATION[2] = 2, 0.2, Reverse
|
ANIMATION[2] = 2, 0.2, Reverse
|
||||||
ANIMATION[3] = 5, 0.1, Repeat
|
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