diff --git a/Adventures in Lestoria/MonsterData.cpp b/Adventures in Lestoria/MonsterData.cpp index 573b3104..5fe12cef 100644 --- a/Adventures in Lestoria/MonsterData.cpp +++ b/Adventures in Lestoria/MonsterData.cpp @@ -57,6 +57,7 @@ MonsterData::MonsterData(std::string name,std::string displayName,int hp,int atk name(name),displayName(displayName),hp(hp),atk(atk),xp(xp),moveSpd(moveSpd),size(size),strategy(strategy),dropData(drops),collisionDmg(collisionDmg),collisionRadius(8.f*this->size){} void MonsterData::InitializeMonsterData(){ + MONSTER_DATA.clear(); for(auto&[key,size]:DATA["Monsters"].GetKeys()){ std::string MonsterName=key; std::string MonsterImgName=MonsterName; diff --git a/Adventures in Lestoria/Seagull.cpp b/Adventures in Lestoria/Seagull.cpp index 3e2f81f0..f9d0d645 100644 --- a/Adventures in Lestoria/Seagull.cpp +++ b/Adventures in Lestoria/Seagull.cpp @@ -47,5 +47,41 @@ using A=Attribute; INCLUDE_game void Monster::STRATEGY::SEAGULL(Monster&m,float fElapsedTime,std::string strategy){ + enum PhaseName{ + CHILLING, + STARTLED, + FLY_AWAY, + DISABLED, + }; + switch(PHASE()){ + case CHILLING:{ + m.PerformAnimation("IDLE",game->GetPlayer()->GetPos()); + float distToPlayer{util::distance(game->GetPlayer()->GetPos(),m.GetPos())}; + if(distToPlayer<=ConfigFloat("Startled Range")/100.f*24){ + SETPHASE(STARTLED); + m.F(A::CASTING_TIMER)=ConfigFloat("Takeoff Time"); + m.V(A::PREV_POS)=m.GetPos(); + } + }break; + case STARTLED:{ + m.PerformAnimation("FLY",m.GetPos()+util::pointTo(game->GetPlayer()->GetPos(),m.GetPos())); + m.F(A::CASTING_TIMER)-=fElapsedTime; + if(m.F(A::CASTING_TIMER)<=0.f)SETPHASE(FLY_AWAY); + }break; + case FLY_AWAY:{ + vf2d moveVec{m.GetPos().x-game->GetPlayer()->GetPos().x,0.f}; + m.PerformAnimation("FLY",m.GetPos()+util::pointTo(game->GetPlayer()->GetPos(),m.GetPos())); + m.MoveForward(moveVec,fElapsedTime); + m.SetVelocity({0.f,-ConfigFloat("Fly Away Z Speed")}); + float distTraveled{util::distance(m.V(A::PREV_POS),m.GetPos())}; + if(distTraveled>=ConfigFloat("Despawn Range")/100.f*24){ + m.lifetime=1.f; + SETPHASE(DISABLED); + } + }break; + case DISABLED:{ + //NO-OP + }break; + } } \ No newline at end of file diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 8f136df9..490755bd 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_PATCH 0 -#define VERSION_BUILD 11667 +#define VERSION_BUILD 11673 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/Campaigns/3_1.tmx b/Adventures in Lestoria/assets/Campaigns/3_1.tmx index 8382ae59..2724eedd 100644 --- a/Adventures in Lestoria/assets/Campaigns/3_1.tmx +++ b/Adventures in Lestoria/assets/Campaigns/3_1.tmx @@ -1,5 +1,5 @@ - + @@ -865,11 +865,6 @@ - - - - - @@ -1248,5 +1243,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Adventures in Lestoria/assets/config/MonsterStrategies.txt b/Adventures in Lestoria/assets/config/MonsterStrategies.txt index 4db31e88..75144b2f 100644 --- a/Adventures in Lestoria/assets/config/MonsterStrategies.txt +++ b/Adventures in Lestoria/assets/config/MonsterStrategies.txt @@ -1114,7 +1114,10 @@ MonsterStrategy } Seagull { - + Startled Range = 1000 + Takeoff Time = 2s + Despawn Range = 4000 + Fly Away Z Speed = 30 } Sandworm { diff --git a/Adventures in Lestoria/assets/maps/Monsters/Seagull.tx b/Adventures in Lestoria/assets/maps/Monsters/Seagull.tx new file mode 100644 index 00000000..20e4f271 --- /dev/null +++ b/Adventures in Lestoria/assets/maps/Monsters/Seagull.tx @@ -0,0 +1,5 @@ + + diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index aeb31715..7fd5ea0d 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ