Exemplo n.º 1
0
def test_diplo1(s, p):

    (p0, s0), (p1, s1) = setup_combat(s, UNITS.FRIGATE)

    assert health(s0) == max_health(s0)
    assert health(s1) == max_health(s1)

    # declare war
    AddEnemyPair(p0, p1).execute(s)
    # declare peace
    AddAllyPair(p0, p1).execute(s)

    s.run(seconds=60)

    assert health(s0) == max_health(s0)
    assert health(s1) == max_health(s1)

    # declare war
    AddEnemyPair(p0, p1).execute(s)
    # declare peace
    AddNeutralPair(p0, p1).execute(s)

    s.run(seconds=60)

    assert health(s0) == max_health(s0)
    assert health(s1) == max_health(s1)

    # declare war
    AddEnemyPair(p0, p1).execute(s)
    s.run(seconds=60)

    assert health(s0) != max_health(s0)
    assert health(s1) != max_health(s1)
Exemplo n.º 2
0
	def add_neutral(self):
		"""
		Callback for setting neutral status between local player and tab's player
		"""
		AddNeutralPair(self.player, self.local_player).execute(self.player.session)
		# check the correct checkbox
		self.check_diplomacy_state()