Octopus Boss implementation

master
sigonasr2 5 days ago
parent b7e486690d
commit 9b94a90326
  1. 27
      Adventures in Lestoria/GiantOctopus.cpp
  2. 2
      Adventures in Lestoria/MonsterAttribute.h
  3. 1
      Adventures in Lestoria/OctopusArm.cpp
  4. 2
      Adventures in Lestoria/Version.h
  5. 5
      Adventures in Lestoria/assets/config/MonsterStrategies.txt
  6. BIN
      x64/Release/Adventures in Lestoria.exe

@ -45,6 +45,7 @@ All rights reserved.
using A=Attribute;
INCLUDE_game
INCLUDE_MONSTER_LIST
void Monster::STRATEGY::GIANT_OCTOPUS(Monster&m,float fElapsedTime,std::string strategy){
enum PhaseName{
@ -53,10 +54,32 @@ void Monster::STRATEGY::GIANT_OCTOPUS(Monster&m,float fElapsedTime,std::string s
};
switch(PHASE()){
case IDENTIFY_ARMS:{
m.F(A::CASTING_TIMER)=util::random_range(ConfigFloatArr("Tentacle Move Timer",0),ConfigFloatArr("Tentacle Move Timer",1));
for(std::shared_ptr<Monster>&arm:MONSTER_LIST){
const std::string OCTOPUS_ARM_NAME{"Octopus Arm"};
if(arm->GetName()==OCTOPUS_ARM_NAME){
std::weak_ptr<Monster>armPtr{arm};
m.VEC(A::ARM_LIST).emplace_back(armPtr);
m.VEC(A::ARM_LOCATIONS).emplace_back(armPtr.lock()->GetPos());
}
}
}break;
case NORMAL:{
m.F(A::CASTING_TIMER)-=fElapsedTime;
if(m.F(A::CASTING_TIMER)<=0.f){
int deadMonsterCount{0};
std::vector<vf2d>tempArmLocs;
for(size_t i=0U;std::any&arm:m.VEC(A::ARM_LIST)){
const std::weak_ptr<Monster>&m{std::any_cast<std::weak_ptr<Monster>>(arm)};
if(m.expired()||m.lock()->IsDead()){
deadMonsterCount++;
tempArmLocs.emplace_back(std::any_cast<vf2d>(m.VEC(A::ARM_LOCATIONS)));
}
}
if(deadMonsterCount>0){
}
}
}break;
}
}

@ -154,4 +154,6 @@ enum class Attribute{
SUCTION_TIMER,
STORED_ARC,
SWING_OCCURRED,
ARM_LOCATIONS,
ARM_LIST,
};

@ -119,6 +119,7 @@ void Monster::STRATEGY::OCTOPUS_ARM(Monster&m,float fElapsedTime,std::string str
const float alphaTimer{float(std::fmod(game->GetRunTime(),2.f))};
uint8_t alpha{util::lerp(uint8_t(0),uint8_t(255),alphaTimer)};
if(alphaTimer>1.f)alpha=util::lerp(0,255,1-(alphaTimer-1));
game->DrawShadowStringDecal({100,100},std::format("{} - {}",alpha,alphaTimer));
attackArc.Draw(game,{0,0,255,uint8_t(alpha)});
if(storedArc.has_value()){
const uint8_t effectAlpha{util::lerp(uint8_t(0),uint8_t(255),alphaTimer/attackEffectTime)};

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 3
#define VERSION_PATCH 0
#define VERSION_BUILD 11794
#define VERSION_BUILD 11795
#define stringify(a) stringify_(a)
#define stringify_(a) #a

@ -1218,4 +1218,9 @@ MonsterStrategy
# Amount of time the spreading aftershock effect appears for.
Attack Effect Time = 0.4s
}
Giant Octopus
{
# Min, Max duration
Tentacle Move Timer = 15s,25s
}
}
Loading…
Cancel
Save