|
|
@ -73,24 +73,57 @@ void Monster::STRATEGY::STONE_ELEMENTAL(Monster&m,float fElapsedTime,std::string |
|
|
|
case WAITING:{ |
|
|
|
case WAITING:{ |
|
|
|
m.F(A::ATTACK_COOLDOWN)+=fElapsedTime; |
|
|
|
m.F(A::ATTACK_COOLDOWN)+=fElapsedTime; |
|
|
|
|
|
|
|
|
|
|
|
float distToPlayer=util::distance(m.GetPos(),game->GetPlayer()->GetPos()); |
|
|
|
//float distToPlayer=util::distance(m.GetPos(),game->GetPlayer()->GetPos());
|
|
|
|
if(distToPlayer>=ConfigPixels("Auto Dive Range"))m.phase=DIVE_UNDERGROUND_DIG; |
|
|
|
//if(distToPlayer>=ConfigPixels("Auto Dive Range"))m.phase=DIVE_UNDERGROUND_DIG;
|
|
|
|
|
|
|
|
|
|
|
|
if(m.F(A::ATTACK_COOLDOWN)>=ConfigFloat("Attack Wait Time")){ |
|
|
|
if(m.F(A::ATTACK_COOLDOWN)>=ConfigFloat("Attack Wait Time")){ |
|
|
|
switch(util::random()%3){ |
|
|
|
switch(util::random()%1){ |
|
|
|
case 0:m.phase=STONE_PILLAR_CAST;break; |
|
|
|
case 0:{ |
|
|
|
case 1:m.phase=SHOOT_STONE_CAST;break; |
|
|
|
m.PerformAnimation("STONE PILLAR CAST"); |
|
|
|
case 2:m.phase=DIVE_UNDERGROUND_DIG;break; |
|
|
|
m.phase=STONE_PILLAR_CAST; |
|
|
|
|
|
|
|
m.F(A::CASTING_TIMER)=ConfigFloat("Stone Pillar Cast Time"); |
|
|
|
|
|
|
|
m.V(A::LOCKON_POS)=game->GetPlayer()->GetPos(); |
|
|
|
|
|
|
|
game->AddEffect(std::make_unique<Effect>(m.V(A::LOCKON_POS),ConfigFloat("Stone Pillar Cast Time"),"range_indicator.png",m.OnUpperLevel(),vf2d{1.f,1.f}*MONSTER_DATA.at("Stone Pillar").GetSizeMult(),0.3f,vf2d{},ConfigPixel("Stone Pillar Spell Circle Color"),util::random(2*PI),util::degToRad(ConfigFloat("Stone Pillar Spell Circle Rotation Spd"))),true); |
|
|
|
|
|
|
|
game->AddEffect(std::make_unique<Effect>(m.V(A::LOCKON_POS),ConfigFloat("Stone Pillar Cast Time"),"spell_insignia.png",m.OnUpperLevel(),vf2d{1.f,1.f}*MONSTER_DATA.at("Stone Pillar").GetSizeMult()*0.75f,0.3f,vf2d{},ConfigPixel("Stone Pillar Spell Insignia Color"),util::random(2*PI),util::degToRad(ConfigFloat("Stone Pillar Spell Insignia Rotation Spd"))),true); |
|
|
|
|
|
|
|
}break; |
|
|
|
|
|
|
|
case 1:{ |
|
|
|
|
|
|
|
m.PerformAnimation("ROCK TOSS CAST"); |
|
|
|
|
|
|
|
m.phase=SHOOT_STONE_CAST; |
|
|
|
|
|
|
|
m.F(A::CASTING_TIMER)=ConfigFloat("Rock Toss Track Time")+ConfigFloat("Rock Toss Wait Time"); |
|
|
|
|
|
|
|
}break; |
|
|
|
|
|
|
|
case 2:{ |
|
|
|
|
|
|
|
m.PerformAnimation("BURROW UNDEGROUND"); |
|
|
|
|
|
|
|
m.phase=DIVE_UNDERGROUND_DIG; |
|
|
|
|
|
|
|
m.F(A::CASTING_TIMER)=ConfigFloat("Burrow Wait Time"); |
|
|
|
|
|
|
|
}break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}break; |
|
|
|
}break; |
|
|
|
case STONE_PILLAR_CAST:{ |
|
|
|
case STONE_PILLAR_CAST:{ |
|
|
|
m.PerformAnimation("STONE PILLAR CAST"); |
|
|
|
m.F(A::CASTING_TIMER)-=fElapsedTime; |
|
|
|
|
|
|
|
if(m.F(A::CASTING_TIMER)<=0.f){ |
|
|
|
|
|
|
|
m.phase=STONE_PILLAR_ATTACK; |
|
|
|
|
|
|
|
} |
|
|
|
}break; |
|
|
|
}break; |
|
|
|
case SHOOT_STONE_CAST:{ |
|
|
|
case SHOOT_STONE_CAST:{ |
|
|
|
m.PerformAnimation("ROCK TOSS CAST"); |
|
|
|
m.F(A::CASTING_TIMER)-=fElapsedTime; |
|
|
|
|
|
|
|
if(m.F(A::CASTING_TIMER)<=0.f){ |
|
|
|
|
|
|
|
m.phase=SHOOT_STONE_ATTACK; |
|
|
|
|
|
|
|
} |
|
|
|
}break; |
|
|
|
}break; |
|
|
|
case DIVE_UNDERGROUND_DIG:{ |
|
|
|
case DIVE_UNDERGROUND_DIG:{ |
|
|
|
|
|
|
|
m.F(A::CASTING_TIMER)-=fElapsedTime; |
|
|
|
|
|
|
|
if(m.F(A::CASTING_TIMER)<=0.f){ |
|
|
|
|
|
|
|
m.phase=DIVE_UNDERGROUND_SURFACE; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}break; |
|
|
|
|
|
|
|
case STONE_PILLAR_ATTACK:{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}break; |
|
|
|
|
|
|
|
case SHOOT_STONE_ATTACK:{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}break; |
|
|
|
|
|
|
|
case DIVE_UNDERGROUND_SURFACE:{ |
|
|
|
|
|
|
|
|
|
|
|
}break; |
|
|
|
}break; |
|
|
|
} |
|
|
|
} |
|
|
|