|
|
@ -19,6 +19,7 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,int strategyNumbe |
|
|
|
|
|
|
|
|
|
|
|
float bulletSpd=ConfigFloat("BulletSpd")/100*24; |
|
|
|
float bulletSpd=ConfigFloat("BulletSpd")/100*24; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m.F(A::SHOOT_TIMER)=std::max(0.f,m.F(A::SHOOT_TIMER)-fElapsedTime); |
|
|
|
m.F(A::SHOOT_RING_TIMER)=std::max(0.f,m.F(A::SHOOT_RING_TIMER)-fElapsedTime); |
|
|
|
m.F(A::SHOOT_RING_TIMER)=std::max(0.f,m.F(A::SHOOT_RING_TIMER)-fElapsedTime); |
|
|
|
m.F(A::SHOOT_RING_DELAY)=std::max(0.f,m.F(A::SHOOT_RING_DELAY)-fElapsedTime); |
|
|
|
m.F(A::SHOOT_RING_DELAY)=std::max(0.f,m.F(A::SHOOT_RING_DELAY)-fElapsedTime); |
|
|
|
m.F(A::JUMP_LANDING_TIMER)=std::max(0.f,m.F(A::JUMP_LANDING_TIMER)-fElapsedTime); |
|
|
|
m.F(A::JUMP_LANDING_TIMER)=std::max(0.f,m.F(A::JUMP_LANDING_TIMER)-fElapsedTime); |
|
|
@ -138,13 +139,18 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,int strategyNumbe |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(m.state==State::CASTING){ |
|
|
|
|
|
|
|
m.UpdateAnimation("monsters/Slime King - Cast.png"); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
switch(m.phase){ |
|
|
|
switch(m.phase){ |
|
|
|
case 0:{ |
|
|
|
case 0:{ |
|
|
|
m.size=ConfigInt("Phase1.Size")/100; |
|
|
|
m.size=ConfigInt("Phase1.Size")/100; |
|
|
|
m.diesNormally=false; |
|
|
|
m.diesNormally=false; |
|
|
|
m.F(A::IFRAME_TIME_UPON_HIT)=0; |
|
|
|
m.F(A::IFRAME_TIME_UPON_HIT)=0; |
|
|
|
m.iframe_timer=ConfigFloat("Phase5.IframeTimePerHit"); |
|
|
|
m.iframe_timer=ConfigFloat("Phase5.IframeTimePerHit"); |
|
|
|
m.phase=1; |
|
|
|
m.phase=ConfigInt("StartPhase"); |
|
|
|
}break; |
|
|
|
}break; |
|
|
|
case 1:{ |
|
|
|
case 1:{ |
|
|
|
if(m.hp<=m.maxhp*ConfigFloat("Phase2.Change")/100){ |
|
|
|
if(m.hp<=m.maxhp*ConfigFloat("Phase2.Change")/100){ |
|
|
@ -186,6 +192,20 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,int strategyNumbe |
|
|
|
TransitionPhase(m.phase); |
|
|
|
TransitionPhase(m.phase); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if(m.F(A::SHOOT_TIMER)==0){ |
|
|
|
|
|
|
|
m.F(A::SHOOT_TIMER)=ConfigInt("Phase2.ShootRate"); |
|
|
|
|
|
|
|
m.I(A::PATTERN_REPEAT_COUNT)++; |
|
|
|
|
|
|
|
int bulletCount=ConfigInt("Phase2.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("Phase2.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})); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(m.I(A::PATTERN_REPEAT_COUNT)>ConfigInt("Phase2.ShootCount")){ |
|
|
|
|
|
|
|
m.I(A::PATTERN_REPEAT_COUNT)=0; |
|
|
|
|
|
|
|
m.SetState(State::CASTING); |
|
|
|
|
|
|
|
} |
|
|
|
}break; |
|
|
|
}break; |
|
|
|
case 3:{ |
|
|
|
case 3:{ |
|
|
|
if(m.hp<=m.maxhp*ConfigFloat("Phase4.Change")/100){ |
|
|
|
if(m.hp<=m.maxhp*ConfigFloat("Phase4.Change")/100){ |
|
|
|