|
|
|
@ -60,18 +60,20 @@ void Monster::STRATEGY::BOAR(Monster&m,float fElapsedTime,std::string strategy){ |
|
|
|
|
switch(m.phase){ |
|
|
|
|
case PhaseName::MOVE:{ |
|
|
|
|
float distToPlayer=geom2d::line<float>(m.GetPos(),game->GetPlayer()->GetPos()).length(); |
|
|
|
|
if(distToPlayer>=ConfigInt("Closein Range")/100.f*24){ |
|
|
|
|
if(m.canMove&&distToPlayer>=ConfigInt("Closein Range")/100.f*24){ |
|
|
|
|
m.RemoveBuff(BuffType::SLOWDOWN); |
|
|
|
|
m.targetAcquireTimer=0.f; |
|
|
|
|
RUN_TOWARDS(m,fElapsedTime,"Run Towards"); |
|
|
|
|
}else |
|
|
|
|
if(distToPlayer<=ConfigInt("Backpedal Range")/100.f*24){ |
|
|
|
|
Key prevFacingDirection=m.GetFacingDirection(); |
|
|
|
|
if(m.canMove&&distToPlayer<=ConfigInt("Backpedal Range")/100.f*24){ |
|
|
|
|
m.AddBuff(BuffType::SLOWDOWN,INFINITE,(100-ConfigInt("Backpedal Movespeed"))/100.f); |
|
|
|
|
m.targetAcquireTimer=0.f; |
|
|
|
|
RUN_AWAY(m,fElapsedTime,"Run Away"); |
|
|
|
|
m.target=geom2d::line<float>(m.GetPos(),game->GetPlayer()->GetPos()).rpoint(-100); |
|
|
|
|
m.targetAcquireTimer=INFINITY; |
|
|
|
|
if(m.attackedByPlayer)goto ScratchPhaseTransition; |
|
|
|
|
RUN_TOWARDS(m,fElapsedTime,"Run Towards"); |
|
|
|
|
m.UpdateFacingDirection(game->GetPlayer()->GetPos()); |
|
|
|
|
}else{ |
|
|
|
|
ScratchPhaseTransition: |
|
|
|
|
m.PerformOtherAnimation(0); |
|
|
|
|
m.F(A::CASTING_TIMER)=ConfigInt("Ground Scratch Count")*m.GetCurrentAnimation().GetTotalAnimationDuration(); |
|
|
|
|
m.phase=PhaseName::SCRATCH; |
|
|
|
|