diff --git a/Adventures in Lestoria/Bear.cpp b/Adventures in Lestoria/Bear.cpp index e1b39da8..a22d8295 100644 --- a/Adventures in Lestoria/Bear.cpp +++ b/Adventures in Lestoria/Bear.cpp @@ -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::circleattackCircle={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)){ diff --git a/Adventures in Lestoria/MonsterAttribute.h b/Adventures in Lestoria/MonsterAttribute.h index 7cc265d6..211a8457 100644 --- a/Adventures in Lestoria/MonsterAttribute.h +++ b/Adventures in Lestoria/MonsterAttribute.h @@ -90,4 +90,6 @@ enum class Attribute{ ENVIRONMENT_PHASE, CHARGE_COOLDOWN, BULLETS_REMOVED, + BEAR_STOMP_COUNT, + PREVIOUS_PHASE, }; \ No newline at end of file diff --git a/Adventures in Lestoria/SaveFile.cpp b/Adventures in Lestoria/SaveFile.cpp index 78a5196d..bda16b26 100644 --- a/Adventures in Lestoria/SaveFile.cpp +++ b/Adventures in Lestoria/SaveFile.cpp @@ -383,11 +383,13 @@ const void SaveFile::Server_SaveMetadataFile(std::functionSendRequest("save_server"_S,CreateServerRequest(SaveFileOperation::SAVE_METADATA_FILE,fileContents.str())); game->responseCallback=respCallbackFunc; } diff --git a/Adventures in Lestoria/Ursule.cpp b/Adventures in Lestoria/Ursule.cpp index 647b6085..cb471ad6 100644 --- a/Adventures in Lestoria/Ursule.cpp +++ b/Adventures in Lestoria/Ursule.cpp @@ -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(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,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::CHARGE_COOLDOWN)=ConfigFloat("Phase 3.Charge Attack Cooldown"); 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; + 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())); } diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 18bac3c3..5e361da2 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -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 diff --git a/Adventures in Lestoria/assets/config/Monsters.txt b/Adventures in Lestoria/assets/config/Monsters.txt index 2e3b0600..d5145098 100644 --- a/Adventures in Lestoria/assets/config/Monsters.txt +++ b/Adventures in Lestoria/assets/config/Monsters.txt @@ -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 } } \ No newline at end of file diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 23b738a0..24756aba 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ