tresinformal / drakkar

The tresinformal video game called 'Drakkar'
GNU General Public License v3.0
11 stars 4 forks source link

A player that is out is immune to stun rockets #624

Open TheoPannetier opened 1 year ago

TheoPannetier commented 1 year ago

Context

A player that has been killed should be immune to stun rockets, and should not stop their trajectory!

Test

// (624) A player that is out cannot be stunned
    // and does not absorb stun rockets
    game g;
    g.kill_player(0);

    // Player 2 shoots, rocket goes on player 1
    g.do_action(1, action_type::shoot_stun_rocket);
    g.tick();
    const coordinate c_p1 = g.get_player(0).get_position();
    g.get_projectiles().back().place(c_p1);

    g.tick();
    assert(!is_stunned(g.get_player(0)));
    assert(count_n_projectiles(g) == 1);