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 does not take damage from regular rockets #623

Open TheoPannetier opened 1 year ago

TheoPannetier commented 1 year ago

Context

A player that has been killed should not take further damage from other players' rockets, or interrupt them.

Test

// (623) A player that is out does not take damage from regular rockets
    game g;
    const double initial_p_size = get_nth_player_size(g, 0);
    g.kill_player(0);

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

    g.tick();
    assert(are_equal(get_nth_player_size(g, 0), initial_p_size, 0.0001));
    assert(count_n_projectiles(g) == 1);