|
|
@ -61,26 +61,25 @@ void Monster::STRATEGY::BOAR(Monster&m,float fElapsedTime,std::string strategy){ |
|
|
|
case PhaseName::MOVE:{ |
|
|
|
case PhaseName::MOVE:{ |
|
|
|
float distToPlayer=geom2d::line<float>(m.GetPos(),game->GetPlayer()->GetPos()).length(); |
|
|
|
float distToPlayer=geom2d::line<float>(m.GetPos(),game->GetPlayer()->GetPos()).length(); |
|
|
|
if(m.canMove&&distToPlayer>=ConfigInt("Closein Range")/100.f*24){ |
|
|
|
if(m.canMove&&distToPlayer>=ConfigInt("Closein Range")/100.f*24){ |
|
|
|
m.RemoveBuff(BuffType::SLOWDOWN); |
|
|
|
m.RemoveBuff(BuffType::SELF_INFLICTED_SLOWDOWN); |
|
|
|
m.targetAcquireTimer=0.f; |
|
|
|
|
|
|
|
RUN_TOWARDS(m,fElapsedTime,"Run Towards"); |
|
|
|
RUN_TOWARDS(m,fElapsedTime,"Run Towards"); |
|
|
|
}else |
|
|
|
}else |
|
|
|
if(m.canMove&&distToPlayer<=ConfigInt("Backpedal Range")/100.f*24){ |
|
|
|
if(m.HasLineOfSight(game->GetPlayer()->GetPos())&&m.canMove&&distToPlayer<=ConfigInt("Backpedal Range")/100.f*24){ |
|
|
|
m.AddBuff(BuffType::SLOWDOWN,INFINITE,(100-ConfigInt("Backpedal Movespeed"))/100.f); |
|
|
|
m.RemoveBuff(BuffType::SELF_INFLICTED_SLOWDOWN); |
|
|
|
|
|
|
|
m.AddBuff(BuffType::SELF_INFLICTED_SLOWDOWN,INFINITE,(100-ConfigInt("Backpedal Movespeed"))/100.f); |
|
|
|
m.target=geom2d::line<float>(m.GetPos(),game->GetPlayer()->GetPos()).rpoint(-100); |
|
|
|
m.target=geom2d::line<float>(m.GetPos(),game->GetPlayer()->GetPos()).rpoint(-100); |
|
|
|
m.targetAcquireTimer=INFINITY; |
|
|
|
|
|
|
|
if(m.attackedByPlayer)goto ScratchPhaseTransition; |
|
|
|
if(m.attackedByPlayer)goto ScratchPhaseTransition; |
|
|
|
RUN_TOWARDS(m,fElapsedTime,"Run Towards"); |
|
|
|
RUN_TOWARDS(m,fElapsedTime,"Run Towards"); |
|
|
|
m.UpdateFacingDirection(game->GetPlayer()->GetPos()); |
|
|
|
m.UpdateFacingDirection(game->GetPlayer()->GetPos()); |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
ScratchPhaseTransition: |
|
|
|
ScratchPhaseTransition: |
|
|
|
m.PerformOtherAnimation(0); |
|
|
|
m.PerformOtherAnimation(0); |
|
|
|
m.F(A::CASTING_TIMER)=ConfigInt("Ground Scratch Count")*m.GetCurrentAnimation().GetTotalAnimationDuration(); |
|
|
|
m.F(A::CASTING_TIMER)=ConfigInt("Ground Scratch Count")*m.GetCurrentAnimation().GetTotalAnimationDuration(); |
|
|
|
m.phase=PhaseName::SCRATCH; |
|
|
|
m.phase=PhaseName::SCRATCH; |
|
|
|
} |
|
|
|
} |
|
|
|
}break; |
|
|
|
}break; |
|
|
|
case PhaseName::SCRATCH:{ |
|
|
|
case PhaseName::SCRATCH:{ |
|
|
|
m.RemoveBuff(BuffType::SLOWDOWN); |
|
|
|
m.RemoveBuff(BuffType::SELF_INFLICTED_SLOWDOWN); |
|
|
|
m.F(A::CASTING_TIMER)-=fElapsedTime; |
|
|
|
m.F(A::CASTING_TIMER)-=fElapsedTime; |
|
|
|
if(m.F(A::CASTING_TIMER)<=0.f){ |
|
|
|
if(m.F(A::CASTING_TIMER)<=0.f){ |
|
|
|
m.PerformShootAnimation(); |
|
|
|
m.PerformShootAnimation(); |
|
|
@ -90,9 +89,16 @@ void Monster::STRATEGY::BOAR(Monster&m,float fElapsedTime,std::string strategy){ |
|
|
|
|
|
|
|
|
|
|
|
m.target=chargeTargetPoint; |
|
|
|
m.target=chargeTargetPoint; |
|
|
|
m.AddBuff(BuffType::SPEEDBOOST,INFINITE,ConfigFloat("Charge Movespeed")/100.f-1); |
|
|
|
m.AddBuff(BuffType::SPEEDBOOST,INFINITE,ConfigFloat("Charge Movespeed")/100.f-1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
float distanceToChargePoint=geom2d::line<float>(m.GetPos(),chargeTargetPoint).length(); |
|
|
|
|
|
|
|
m.F(A::TARGET_TIMER)=distanceToChargePoint/(100.f*m.GetMoveSpdMult()); //This should be how long a charge takes.
|
|
|
|
|
|
|
|
m.AddBuff(BuffType::COLLISION_KNOCKBACK_STRENGTH,15,ConfigFloat("Charge Knockback Amount")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
m.UpdateFacingDirection(game->GetPlayer()->GetPos()); |
|
|
|
}break; |
|
|
|
}break; |
|
|
|
case PhaseName::CHARGE:{ |
|
|
|
case PhaseName::CHARGE:{ |
|
|
|
|
|
|
|
m.F(A::TARGET_TIMER)-=fElapsedTime; |
|
|
|
|
|
|
|
|
|
|
|
float distToTarget=geom2d::line<float>(m.GetPos(),m.target).length(); |
|
|
|
float distToTarget=geom2d::line<float>(m.GetPos(),m.target).length(); |
|
|
|
|
|
|
|
|
|
|
|
auto TransitionToRecoveryPhase=[&](){ |
|
|
|
auto TransitionToRecoveryPhase=[&](){ |
|
|
@ -101,15 +107,16 @@ void Monster::STRATEGY::BOAR(Monster&m,float fElapsedTime,std::string strategy){ |
|
|
|
m.PerformIdleAnimation(); |
|
|
|
m.PerformIdleAnimation(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
if(m.bumpedIntoTerrain||distToTarget<4.f){ |
|
|
|
if(m.F(A::TARGET_TIMER)<=0||m.bumpedIntoTerrain||distToTarget<12.f){ |
|
|
|
TransitionToRecoveryPhase(); |
|
|
|
TransitionToRecoveryPhase(); |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
m.targetAcquireTimer=INFINITY; //Don't acquire a new target.
|
|
|
|
|
|
|
|
RUN_TOWARDS(m,fElapsedTime,"Run Towards"); |
|
|
|
RUN_TOWARDS(m,fElapsedTime,"Run Towards"); |
|
|
|
|
|
|
|
m.PerformShootAnimation(); |
|
|
|
if(!m.canMove)TransitionToRecoveryPhase(); |
|
|
|
if(!m.canMove)TransitionToRecoveryPhase(); |
|
|
|
} |
|
|
|
} |
|
|
|
}break; |
|
|
|
}break; |
|
|
|
case PhaseName::RECOVERY:{ |
|
|
|
case PhaseName::RECOVERY:{ |
|
|
|
|
|
|
|
m.RemoveBuff(BuffType::COLLISION_KNOCKBACK_STRENGTH); |
|
|
|
m.F(A::CHARGE_COOLDOWN)-=fElapsedTime; |
|
|
|
m.F(A::CHARGE_COOLDOWN)-=fElapsedTime; |
|
|
|
m.targetAcquireTimer=0.f; |
|
|
|
m.targetAcquireTimer=0.f; |
|
|
|
m.RemoveBuff(BuffType::SPEEDBOOST); |
|
|
|
m.RemoveBuff(BuffType::SPEEDBOOST); |
|
|
|