Giant meteor and add check for dead targets for lightning bolt chain spread

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
pull/28/head
sigonasr2, Sig, Sigo 2 years ago
parent 0229982717
commit 93cf655a40
  1. 9
      Crawler/LightningBolt.cpp
  2. BIN
      Crawler/assets/c30010.png

@ -53,10 +53,11 @@ 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);
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(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;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Loading…
Cancel
Save