forked from Cryz/battle_royale_sim
telegram bot more commands, and use the debug function to start a first day iteration
This commit is contained in:
26
debug.py
26
debug.py
@@ -3,7 +3,7 @@ import random as _rand
|
||||
import main as _main
|
||||
from entities import weapon_syms as _wsyms
|
||||
|
||||
def init_debug():
|
||||
def _debug_data():
|
||||
players= [
|
||||
{
|
||||
'name': 'Elara',
|
||||
@@ -24,14 +24,32 @@ def init_debug():
|
||||
'name': 'Seraphina',
|
||||
},
|
||||
]
|
||||
#w= _wsyms.KNIFE
|
||||
##weapons= [{_wsyms.WEAPONS[w]['name' ]: 1}]
|
||||
#weapons= [{w: 1}]
|
||||
weapons= []
|
||||
|
||||
Arena= _main.init_arena(players, weapons)
|
||||
print(f'Players: {Arena.get_players()}')
|
||||
print(f'Weapons: {Arena.get_weapons()}')
|
||||
return Arena
|
||||
|
||||
def _end_game_debug(alive_players, day):
|
||||
last_player= alive_players[0]
|
||||
print(f'{last_player.get_name()} sopravvive e vince dopo {day} lunghi Giorni, conquistando l\'amore eterno di Guarino')
|
||||
|
||||
def play_one_day_debug(Arena):
|
||||
alive_players= Arena.get_alive_players()
|
||||
if not Arena.get_players(): return
|
||||
if len(alive_players) == 1:
|
||||
day= Arena.day
|
||||
return _end_game_debug(alive_players, day)
|
||||
|
||||
p_one, p_two= _rand.sample(alive_players, 2)
|
||||
_dmg, msg= p_one.attack(p_two)
|
||||
Arena.next_day()
|
||||
print(f'Giorno #{Arena.day}')
|
||||
return msg
|
||||
|
||||
def init_debug_loop():
|
||||
Arena= _debug_data()
|
||||
while (len(Arena.get_alive_players()) > 1):
|
||||
alive_players= Arena.get_alive_players()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user