def test_screep_does_not_move_when_dead(): s1 = Screep(REDTEAM, 4, move=1, move_func=screep.maint_dist_to_target) s2 = Screep(BLUETEAM, 0) s1.set_target([s2]) s1.move([s2]) assert s1.posn == 3 s1.hp = 0 s1.move([s2]) assert s1.posn == 3
def test_screep_does_not_attack_when_dead(): s1 = Screep(REDTEAM, 1, range_att=1) s2 = Screep(BLUETEAM, 0) start_hp = s2.hp s1.set_target([s2]) s1.attack([s2]) assert s2.hp < start_hp start_hp = s2.hp s1.hp = 0 s1.attack([s2]) assert s2.hp == start_hp