forked from Cryz/battle_royale_sim
cleans
This commit is contained in:
1
bot.py
1
bot.py
@@ -89,7 +89,6 @@ async def bot_commands(update, context):
|
|||||||
seconds= max(1, text)
|
seconds= max(1, text)
|
||||||
return await _bot_repeat.start_loop_game(update, context, seconds)
|
return await _bot_repeat.start_loop_game(update, context, seconds)
|
||||||
|
|
||||||
|
|
||||||
print(f'bot_command: {chat_id} sent this text: {text}')
|
print(f'bot_command: {chat_id} sent this text: {text}')
|
||||||
await update.message.reply_text(_botsyms.WIP_MSG)
|
await update.message.reply_text(_botsyms.WIP_MSG)
|
||||||
|
|
||||||
|
|||||||
@@ -2,13 +2,9 @@ import random as _rand
|
|||||||
from bot_libs import syms as _bot_syms
|
from bot_libs import syms as _bot_syms
|
||||||
|
|
||||||
async def add_player(update, context, name):
|
async def add_player(update, context, name):
|
||||||
#name= " ".join(context.args)
|
|
||||||
print(f'add_player: {name}')
|
print(f'add_player: {name}')
|
||||||
Arena= context.application.bot_data['arena']
|
Arena= context.application.bot_data['arena']
|
||||||
Arena.add_player(name)
|
Arena.add_player(name)
|
||||||
#players= [p.get_name() for p in Arena.get_players()]
|
|
||||||
#players_str= '\n'.join(players)
|
|
||||||
#await update.message.reply_text(f'Ecco i giocatori presenti nel mondo do gioco: \n{players_str}')
|
|
||||||
|
|
||||||
async def add_random_players(update, context, colors_names= False):
|
async def add_random_players(update, context, colors_names= False):
|
||||||
if colors_names: names= _bot_syms.COLORS_NAMES
|
if colors_names: names= _bot_syms.COLORS_NAMES
|
||||||
@@ -25,21 +21,21 @@ async def add_random_players(update, context, colors_names= False):
|
|||||||
|
|
||||||
async def get_players(update, context):
|
async def get_players(update, context):
|
||||||
Arena= context.application.bot_data['arena']
|
Arena= context.application.bot_data['arena']
|
||||||
print(f'get_players: {Arena.get_players()}')
|
|
||||||
players= [p.get_name() for p in Arena.get_players()]
|
players= [p.get_name() for p in Arena.get_players()]
|
||||||
players_str= '\n'.join(players)
|
players_str= '\n'.join(players)
|
||||||
|
print(f'get_players: {players_str}')
|
||||||
await update.message.reply_text(f'Ecco i giocatori presenti nel mondo do gioco: \n{players_str}')
|
await update.message.reply_text(f'Ecco i giocatori presenti nel mondo do gioco: \n{players_str}')
|
||||||
|
|
||||||
async def get_alive_players(update, context):
|
async def get_alive_players(update, context):
|
||||||
Arena= context.application.bot_data['arena']
|
Arena= context.application.bot_data['arena']
|
||||||
print(f'get_alive_players: {Arena.get_alive_players()}')
|
|
||||||
alive= [a.get_name() for a in Arena.get_alive_players()]
|
alive= [a.get_name() for a in Arena.get_alive_players()]
|
||||||
alive_str= '\n'.join(alive)
|
alive_str= '\n'.join(alive)
|
||||||
|
print(f'get_alive_players: {alive_str}')
|
||||||
await update.message.reply_text(f'Ecco i giocatori ancora vivi: \n{alive_str}')
|
await update.message.reply_text(f'Ecco i giocatori ancora vivi: \n{alive_str}')
|
||||||
|
|
||||||
async def get_death_players(update, context):
|
async def get_death_players(update, context):
|
||||||
Arena= context.application.bot_data['arena']
|
Arena= context.application.bot_data['arena']
|
||||||
print(f'get_death_players: {Arena.get_death_players()}')
|
|
||||||
death= [d.get_name() for d in Arena.get_death_players()]
|
death= [d.get_name() for d in Arena.get_death_players()]
|
||||||
death_str= '\n'.join(death)
|
death_str= '\n'.join(death)
|
||||||
|
print(f'get_death_players: {death_str}')
|
||||||
await update.message.reply_text(f'Ecco i giocatori morti x.x: \n{death_str}')
|
await update.message.reply_text(f'Ecco i giocatori morti x.x: \n{death_str}')
|
||||||
|
|||||||
17
main.py
17
main.py
@@ -8,20 +8,3 @@ def init_arena(players= None, weapons= None):
|
|||||||
def run_events(Arena):
|
def run_events(Arena):
|
||||||
#A event for each player:
|
#A event for each player:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def local_debug():
|
|
||||||
players= [{'name': 'Crystal'}, {'name': 'Andrea'}, {'name' : 'giampi'}]
|
|
||||||
w= _wsyms.KNIFE
|
|
||||||
#weapons= [{_wsyms.WEAPONS[w]['name' ]: 1}]
|
|
||||||
weapons= [{w: 1}]
|
|
||||||
|
|
||||||
Arena= init_arena(players, weapons)
|
|
||||||
print(f'Players: {Arena.get_players()}')
|
|
||||||
print(f'Weapons: {Arena.get_weapons()}')
|
|
||||||
while (len(Arena.get_alive_players()) > 1):
|
|
||||||
#Start a day
|
|
||||||
run_events(Arena)
|
|
||||||
|
|
||||||
#At 23:59:
|
|
||||||
Arena.next_day()
|
|
||||||
#End of day
|
|
||||||
|
|||||||
Reference in New Issue
Block a user