|
|
|
@ -41,6 +41,7 @@ All rights reserved. |
|
|
|
|
#include "AdventuresInLestoria.h" |
|
|
|
|
#include "SoundEffect.h" |
|
|
|
|
#include "BulletTypes.h" |
|
|
|
|
#include "Arc.h" |
|
|
|
|
|
|
|
|
|
using A=Attribute; |
|
|
|
|
|
|
|
|
@ -51,6 +52,7 @@ void Monster::STRATEGY::OCTOPUS_ARM(Monster&m,float fElapsedTime,std::string str |
|
|
|
|
INIT, |
|
|
|
|
RISE_ANIMATION, |
|
|
|
|
SEARCH, |
|
|
|
|
PREPARE_ATTACK, |
|
|
|
|
}; |
|
|
|
|
switch(PHASE()){ |
|
|
|
|
case INIT:{ |
|
|
|
@ -66,7 +68,36 @@ void Monster::STRATEGY::OCTOPUS_ARM(Monster&m,float fElapsedTime,std::string str |
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
case SEARCH:{ |
|
|
|
|
if(util::distance(m.GetPos(),game->GetPlayer()->GetPos())<="Attack Radius"_F/100.f*24){ |
|
|
|
|
SETPHASE(PREPARE_ATTACK); |
|
|
|
|
m.F(A::ATTACK_COOLDOWN)="Attack Wiggle Time Range"_FRange; |
|
|
|
|
m.PerformAnimation("ATTACKING",game->GetPlayer()->GetPos()); |
|
|
|
|
float arcAngle{}; |
|
|
|
|
switch(m.GetFacingDirection()){ |
|
|
|
|
case Direction::NORTH:{ |
|
|
|
|
arcAngle=-PI/2; |
|
|
|
|
}break; |
|
|
|
|
case Direction::EAST:{ |
|
|
|
|
arcAngle=0.f; |
|
|
|
|
}break; |
|
|
|
|
case Direction::WEST:{ |
|
|
|
|
arcAngle=PI; |
|
|
|
|
}break; |
|
|
|
|
case Direction::SOUTH:{ |
|
|
|
|
arcAngle=PI/2; |
|
|
|
|
}break; |
|
|
|
|
} |
|
|
|
|
Arc attackArc{m.GetPos(),"Attack Radius"_F/100.f*24,arcAngle,util::degToRad("Attack Arc"_F)}; |
|
|
|
|
m.SetStrategyDrawFunction([&attackArc](AiL*game,Monster&monster,const std::string&strategy){ |
|
|
|
|
attackArc.Draw(game,BLUE); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
case PREPARE_ATTACK:{ |
|
|
|
|
m.F(A::ATTACK_COOLDOWN)-=fElapsedTime; |
|
|
|
|
if(m.F(A::ATTACK_COOLDOWN)<=0.f){ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
} |
|
|
|
|
} |