debug daily events, now all players plays during a day
This commit is contained in:
24
debug.py
24
debug.py
@@ -38,17 +38,29 @@ def _end_game_debug(alive_players, day):
|
||||
return msg
|
||||
|
||||
def play_one_day_debug(Arena):
|
||||
alive_players= Arena.get_alive_players()
|
||||
if not Arena.get_players(): return
|
||||
print(f'Giorno #{Arena.day}')
|
||||
alive_players= Arena.get_alive_players()
|
||||
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)
|
||||
|
||||
daily_events= []
|
||||
_rand.shuffle(alive_players)
|
||||
for p_one in alive_players:
|
||||
if not p_one.is_alive(): continue #he could be dead during this day cycle
|
||||
p_two= _rand.sample(alive_players, 1)[0]
|
||||
while p_one.get_id() == p_two.get_id():
|
||||
p_two= _rand.sample(alive_players, 1)[0]
|
||||
_dmg, msg= p_one.attack(p_two)
|
||||
daily_events.append(msg)
|
||||
|
||||
Arena.next_day()
|
||||
print(f'Giorno #{Arena.day}')
|
||||
return msg
|
||||
res= '\n'.join(daily_events)
|
||||
return res
|
||||
#p_one, p_two= _rand.sample(alive_players, 2)
|
||||
#_dmg, msg= p_one.attack(p_two)
|
||||
#return msg
|
||||
|
||||
def init_debug_loop():
|
||||
Arena= _debug_data()
|
||||
|
||||
Reference in New Issue
Block a user