forked from Cryz/battle_royale_sim
item
This commit is contained in:
1
debug.py
1
debug.py
@@ -1,7 +1,6 @@
|
|||||||
import time as _time
|
import time as _time
|
||||||
import random as _rand
|
import random as _rand
|
||||||
import main as _main
|
import main as _main
|
||||||
from entities import weapon_syms as _wsyms
|
|
||||||
|
|
||||||
def _debug_data():
|
def _debug_data():
|
||||||
players= [
|
players= [
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
from entities import player as _player
|
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 import event_picker as _events
|
||||||
|
from entities.items import weapons as _weapons
|
||||||
|
|
||||||
class BrSimArena():
|
class BrSimArena():
|
||||||
|
|
||||||
|
|||||||
21
entities/items/item.py
Normal file
21
entities/items/item.py
Normal 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
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
KNIFE= 1
|
KNIFE= 1
|
||||||
GUN= 2
|
ARCH= 2
|
||||||
BOMB= 3
|
|
||||||
|
|
||||||
SHORT_RANGE= 1
|
SHORT_RANGE= 1
|
||||||
FAR_RANGE= 2
|
FAR_RANGE= 2
|
||||||
@@ -14,7 +13,7 @@ WEAPONS= {
|
|||||||
'ammons': -1, # -1, no limit
|
'ammons': -1, # -1, no limit
|
||||||
'range': SHORT_RANGE,
|
'range': SHORT_RANGE,
|
||||||
},
|
},
|
||||||
GUN: {
|
ARCH: {
|
||||||
'weight': 2,
|
'weight': 2,
|
||||||
'name': 'gun',
|
'name': 'gun',
|
||||||
'damage': 3,
|
'damage': 3,
|
||||||
@@ -22,12 +21,4 @@ WEAPONS= {
|
|||||||
'ammons': 10, # -1, no limit
|
'ammons': 10, # -1, no limit
|
||||||
'range': FAR_RANGE,
|
'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,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
import random as _random
|
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):
|
def __init__(self, wtype= None):
|
||||||
self.weapon= _syms.WEAPONS[wtype]
|
self.weapon= _syms.WEAPONS[wtype or _random.randint(1,2)]
|
||||||
self.name= self.weapon['name']
|
self.name= self.weapon['name']
|
||||||
self.damage= self.weapon['damage']
|
self.damage= self.weapon['damage']
|
||||||
self.weight= self.weapon['weight']
|
self.weight= self.weapon['weight']
|
||||||
Reference in New Issue
Block a user