This commit is contained in:
andrea
2025-07-26 23:10:51 +02:00
parent da0368d6c5
commit bee2e94f82
5 changed files with 29 additions and 18 deletions

View File

@@ -1,7 +1,6 @@
import time as _time
import random as _rand
import main as _main
from entities import weapon_syms as _wsyms
def _debug_data():
players= [

View File

@@ -1,7 +1,6 @@
from entities import player as _player
from entities import weapons as _weapons
from entities import weapon_syms as _wsyms
from entities import event_picker as _events
from entities.items import weapons as _weapons
class BrSimArena():

21
entities/items/item.py Normal file
View File

@@ -0,0 +1,21 @@
import random as _random
class BrSimItem():
def __init__(self):
pass
def get_name(self):
return self.name
def get_item_type(self):
return self.item_type
def get_weight(self):
return self.weight
def is_weapon(self):
return False
def is_cure(self):
return False

View File

@@ -1,6 +1,5 @@
KNIFE= 1
GUN= 2
BOMB= 3
ARCH= 2
SHORT_RANGE= 1
FAR_RANGE= 2
@@ -14,7 +13,7 @@ WEAPONS= {
'ammons': -1, # -1, no limit
'range': SHORT_RANGE,
},
GUN: {
ARCH: {
'weight': 2,
'name': 'gun',
'damage': 3,
@@ -22,12 +21,4 @@ WEAPONS= {
'ammons': 10, # -1, no limit
'range': FAR_RANGE,
},
BOMB: {
'weight': 2,
'name': 'bomb',
'damage': 10,
'miss_chance': 5, # from 0 to 100, this is the probably to miss the hit
'ammons': 1,
'range': FAR_RANGE,
},
}

View File

@@ -1,10 +1,11 @@
import random as _random
from entities import weapon_syms as _syms
from entities.items import item as _item
from entities.items import weapon_syms as _syms
class BrSimWeapon():
class BrSimWeapon(_item.BrSimItem):
def __init__(self, wtype):
self.weapon= _syms.WEAPONS[wtype]
def __init__(self, wtype= None):
self.weapon= _syms.WEAPONS[wtype or _random.randint(1,2)]
self.name= self.weapon['name']
self.damage= self.weapon['damage']
self.weight= self.weapon['weight']