def battle_turn(battle: Battle):
    for i in range(BATTlE_TICKS_PER_TURN):
        battle.refresh_from_db()
        if battle.current:
            battle_tick(battle)

    battle.tile.world.broadcast('messaging/messages/battle_progress.html',
                                'Battle in {}'.format(battle.tile.name),
                                {'battle': battle}, battle.get_absolute_url())
Beispiel #2
0
def battle_turn(battle: Battle):
    for i in range(15):
        battle.refresh_from_db()
        if battle.current:
            battle_tick(battle)

    battle.tile.world.broadcast(
        ("The battle in {} continues".format(battle.tile) if battle.current
         else "The battle in {} has ended".format(battle.tile)), 'battle',
        battle.get_absolute_url())