forked from Cryz/battle_royale_sim
57 lines
1.4 KiB
Python
57 lines
1.4 KiB
Python
from entities import player as _player
|
|
from entities import weapons as _weapons
|
|
from entities import weapon_syms as _wsyms
|
|
|
|
class BrSimArena():
|
|
|
|
# players = [{'name': name, 'inventory': default_inventory, other_stats}]
|
|
# weapons = [{WEAPON.KNIFE: quantity}, etc...] # this is the whole quantity of the items available on the world
|
|
|
|
def __init__(self, players, weapons):
|
|
self.day= 1
|
|
self.players= players
|
|
self.weapons= weapons
|
|
|
|
def next_day(self):
|
|
self.day+= 1
|
|
|
|
def get_alive_players(self):
|
|
res= []
|
|
for p in self.players:
|
|
if not p.is_alive(): continue
|
|
res.append(p)
|
|
return res
|
|
|
|
def get_death_players(self):
|
|
res= []
|
|
for p in self.players:
|
|
if p.is_alive(): continue
|
|
res.append(p)
|
|
return res
|
|
|
|
def do_random_event(self):
|
|
#XXX random player does random action according to his inventory health, wounds, available weapons on the world, etc...
|
|
pass
|
|
|
|
def supporter_donation(self):
|
|
#XXX supporter donate a random item or weapon to a random player
|
|
#TODO maybe in future a player can have charism stats that can influence the chance to get a donation
|
|
pass
|
|
|
|
|
|
def init_arena():
|
|
players= [{'name': 'Crystal'}, {'name': 'Andrea'}]
|
|
weapons= [{_wsyms.KNIFE['name']: 1}]
|
|
return BrSimArena(players, weapons)
|
|
|
|
|
|
def run_event(Arena):
|
|
pass
|
|
|
|
def local_debug():
|
|
Arena= init_arena()
|
|
print(Arena.players)
|
|
print(Arena.weapons)
|
|
run_event(Arena)
|
|
|