37 lines
948 B
Python
37 lines
948 B
Python
import random as _random
|
|
from entities import resource as _resource
|
|
from entities.items import syms as _isyms
|
|
|
|
class BrSimItem(_resource.BrSimResource):
|
|
#XXX i don't know yet if we need to call this clas
|
|
# or we need to have subclasses that inherit this one
|
|
# for example class Weapon and class Medikit (or something else)
|
|
# 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):
|
|
return True
|
|
|
|
def get_data(self):
|
|
return self.item
|
|
|
|
def get_name(self):
|
|
idata= self.get_data()
|
|
return idata['name']
|
|
|
|
def get_weight(self):
|
|
idata= self.get_data()
|
|
return idata['weight']
|
|
|
|
def is_weapon(self):
|
|
idata= self.get_data()
|
|
return idata['is_weapon']
|
|
|
|
def is_cure(self):
|
|
#XXX not sure about it
|
|
# maybe we could have more item type, like foods, drink, poison...
|
|
return not self.is_weapon()
|