forked from Cryz/battle_royale_sim
add items also on the telegram bot
This commit is contained in:
@@ -25,9 +25,9 @@ class BrSimArena():
|
||||
|
||||
def init_items(self, items):
|
||||
if not items: return
|
||||
for item in items:
|
||||
for itype, quantity in item.items():
|
||||
for i in range(quantity): self.items.append(_items.BrSimItem(wrype))
|
||||
for item_id in items:
|
||||
I= _items.BrSimItem(item_id)
|
||||
self.items.append(I)
|
||||
|
||||
def next_day(self):
|
||||
self.day+= 1
|
||||
|
||||
@@ -53,8 +53,7 @@ class BrSimMap():
|
||||
self.game_map.append(_copy.deepcopy(width))
|
||||
#_logs.log_debug(f'init_map_matrix: {self.game_map}')
|
||||
_logs.log_debug(f'players: %s'% [(p.get_name(), p.get_coordinates()) for p in self.players])
|
||||
print('##')
|
||||
_logs.log_debug(f'items: %s' % [(p.get_name(), p.get_coordinates()) for p in self.items])
|
||||
_logs.log_debug(f'items: %s' % [(i.get_name(), i.get_coordinates()) for i in self.items])
|
||||
|
||||
def populate_map(self):
|
||||
for player in self.players:
|
||||
|
||||
@@ -9,6 +9,7 @@ class BrSimItem(_resource.BrSimResource):
|
||||
# this decision would change everything from Arena init
|
||||
|
||||
def __init__(self, item_id):
|
||||
super().__init__()
|
||||
self.item= _isyms.ITEMS[item_id]
|
||||
|
||||
def is_item(self):
|
||||
|
||||
@@ -6,7 +6,7 @@ from utils import logs as _logs
|
||||
class BrSimPlayer(_resource.BrSimResource):
|
||||
|
||||
def __init__(self, name, inventory= None):
|
||||
super()
|
||||
super().__init__()
|
||||
self.id= str(_uuid.uuid4())
|
||||
self.name= name
|
||||
self.stats= ''
|
||||
|
||||
Reference in New Issue
Block a user