|
|
|
@ -53,11 +53,12 @@ bool LightningBolt::MonsterHit(Monster& monster) |
|
|
|
|
geom2d::line<float>lineToTarget=geom2d::line<float>(monster.GetPos(),m.GetPos()); |
|
|
|
|
float dist=lineToTarget.length(); |
|
|
|
|
if(dist<=72){ |
|
|
|
|
m.Hurt(game->GetPlayer().GetAttack()*2); |
|
|
|
|
if(m.Hurt(game->GetPlayer().GetAttack()*2)){ |
|
|
|
|
EMITTER_LIST.push_back(std::make_unique<LightningBoltEmitter>(LightningBoltEmitter(monster.GetPos(),m.GetPos(),0.05,0.25,upperLevel))); |
|
|
|
|
game->AddEffect(Effect(m.GetPos(),0.5,AnimationState::LIGHTNING_SPLASH,upperLevel,monster.GetSizeMult(),0.25,{},WHITE,util::random(PI))); |
|
|
|
|
targetsHit++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(targetsHit>=2)break; |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|