|
|
|
@ -108,7 +108,7 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,int strategyNumbe |
|
|
|
|
if(m.GetState()==State::RECOVERY){ |
|
|
|
|
m.F(A::RECOVERY_TIME)=std::max(0.f,m.F(A::RECOVERY_TIME)-fElapsedTime); |
|
|
|
|
if(m.F(A::RECOVERY_TIME)==0){ |
|
|
|
|
m.GetState()==State::NORMAL; |
|
|
|
|
m.SetState(State::NORMAL); |
|
|
|
|
Recovered(); |
|
|
|
|
} |
|
|
|
|
return; |
|
|
|
@ -253,6 +253,25 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,int strategyNumbe |
|
|
|
|
TransitionPhase(m.phase); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if(m.I(A::PATTERN_REPEAT_COUNT)==0){ |
|
|
|
|
StartJump(ConfigFloat("Phase3.JumpDelayTime"),game->GetPlayer()->GetPos(),ConfigFloat("Phase3.JumpRecoveryTime"),ConfigFloat("Phase3.JumpMoveSpd")); |
|
|
|
|
m.I(A::PATTERN_REPEAT_COUNT)++; |
|
|
|
|
}else |
|
|
|
|
if(m.I(A::PATTERN_REPEAT_COUNT)<4&&m.F(A::SHOOT_TIMER)==0){ |
|
|
|
|
m.F(A::SHOOT_TIMER)=ConfigFloat("Phase3.ShootRate"); |
|
|
|
|
m.I(A::PATTERN_REPEAT_COUNT)++; |
|
|
|
|
int bulletCount=ConfigInt("Phase3.ShootProjectileCount"); |
|
|
|
|
for(int i=0;i<bulletCount;i++){ |
|
|
|
|
float initialAngle=util::angleTo(m.GetPos(),game->GetPlayer()->GetPos()); |
|
|
|
|
float angle=(i-(bulletCount/2))*util::degToRad(ConfigFloat("Phase3.ShootAngleSpread"))+initialAngle; |
|
|
|
|
BULLET_LIST.emplace_back(std::make_unique<Bullet>(m.GetPos(),vf2d{cos(angle),sin(angle)}*bulletSpd,6,ConfigInt("ProjectileDamage"),m.OnUpperLevel(),false,YELLOW,vf2d{6,6})); |
|
|
|
|
} |
|
|
|
|
}else |
|
|
|
|
if(m.I(A::PATTERN_REPEAT_COUNT)>=4){ |
|
|
|
|
m.F(A::RECOVERY_TIME)=ConfigFloat("Phase3.PhaseRecoveryTime"); |
|
|
|
|
m.SetState(State::RECOVERY); |
|
|
|
|
m.I(A::PATTERN_REPEAT_COUNT)=0; |
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
case 4:{ |
|
|
|
|
if(m.hp<=0){ |
|
|
|
|