Octopus Boss implementation
This commit is contained in:
parent
b7e486690d
commit
9b94a90326
@ -45,6 +45,7 @@ All rights reserved.
|
|||||||
using A=Attribute;
|
using A=Attribute;
|
||||||
|
|
||||||
INCLUDE_game
|
INCLUDE_game
|
||||||
|
INCLUDE_MONSTER_LIST
|
||||||
|
|
||||||
void Monster::STRATEGY::GIANT_OCTOPUS(Monster&m,float fElapsedTime,std::string strategy){
|
void Monster::STRATEGY::GIANT_OCTOPUS(Monster&m,float fElapsedTime,std::string strategy){
|
||||||
enum PhaseName{
|
enum PhaseName{
|
||||||
@ -53,10 +54,32 @@ void Monster::STRATEGY::GIANT_OCTOPUS(Monster&m,float fElapsedTime,std::string s
|
|||||||
};
|
};
|
||||||
switch(PHASE()){
|
switch(PHASE()){
|
||||||
case IDENTIFY_ARMS:{
|
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;
|
}break;
|
||||||
case NORMAL:{
|
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;
|
}break;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -154,4 +154,6 @@ enum class Attribute{
|
|||||||
SUCTION_TIMER,
|
SUCTION_TIMER,
|
||||||
STORED_ARC,
|
STORED_ARC,
|
||||||
SWING_OCCURRED,
|
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))};
|
const float alphaTimer{float(std::fmod(game->GetRunTime(),2.f))};
|
||||||
uint8_t alpha{util::lerp(uint8_t(0),uint8_t(255),alphaTimer)};
|
uint8_t alpha{util::lerp(uint8_t(0),uint8_t(255),alphaTimer)};
|
||||||
if(alphaTimer>1.f)alpha=util::lerp(0,255,1-(alphaTimer-1));
|
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)});
|
attackArc.Draw(game,{0,0,255,uint8_t(alpha)});
|
||||||
if(storedArc.has_value()){
|
if(storedArc.has_value()){
|
||||||
const uint8_t effectAlpha{util::lerp(uint8_t(0),uint8_t(255),alphaTimer/attackEffectTime)};
|
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_MAJOR 1
|
||||||
#define VERSION_MINOR 3
|
#define VERSION_MINOR 3
|
||||||
#define VERSION_PATCH 0
|
#define VERSION_PATCH 0
|
||||||
#define VERSION_BUILD 11794
|
#define VERSION_BUILD 11795
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #a
|
#define stringify_(a) #a
|
||||||
|
@ -1218,4 +1218,9 @@ MonsterStrategy
|
|||||||
# Amount of time the spreading aftershock effect appears for.
|
# Amount of time the spreading aftershock effect appears for.
|
||||||
Attack Effect Time = 0.4s
|
Attack Effect Time = 0.4s
|
||||||
}
|
}
|
||||||
|
Giant Octopus
|
||||||
|
{
|
||||||
|
# Min, Max duration
|
||||||
|
Tentacle Move Timer = 15s,25s
|
||||||
|
}
|
||||||
}
|
}
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user