def __init__(self, type): ## All weapons start w/ a base d, and they gain or lose depending on what kind of weapon they're fighting against self.weaponInfo = weaponInfo() self.type = type self.damageCap = 0 self.isRanged = False self.range = 1 self.damage = self.findDamage() self.selfConstructed = False self.usesLeft = 50 self.setRanged() self.damageCap = self.weaponInfo.weaponStrength(self.type)
def __init__(self, self_type): # All weapons start w/ a base d, and # they gain or lose depending on what kind of weapon they're fighting against self.weapon_info = weaponInfo() self.type = self_type self.damage_cap = 0 self.is_ranged = False self.range = 1 self.damage = self.find_damage() self.self_constructed = False self.uses_left = 50 self.set_ranged() self.damage_cap = self.weapon_info.weaponStrength(self.type)
def __init__(self, goals, actions, x=0, y=0, district='d12', gender='male', do_not_load=False): Particle.__init__(self, (x, y), 1, 1) self.id = Tribute.ID_COUNTER Tribute.ID_COUNTER += 1 self.goals = goals self.actions = actions # remove the fight action. we don't want them fighting unless someone is in range self.fight_action = actions[5] self.explore_action = actions[12] self.actions = self.actions[:5] + self.actions[6:12] self.district = district self.has_weapon = False self.weapon = weapon('') self.has_ally = False self.allies = [] self.craftPouch = [] self.fighting_state = FIGHT_STATE['not_fighting'] self.opponent = None self.last_opponent = None self.sighted = None self.last_sighted_location = None self.last_action = None self.printy_action = 'none' self.old_state = self.state self.visited_set = set() self.explore_point_index = 0 self.explore_point = NAVIGATION_POINTS[self.explore_point_index] self.hidden = False self.weaponInfo = weaponInfo() self.wepCanCraft = '' self.bestScavChoice = '' self.bestScavPoints = 0 if do_not_load: self.attributes = None self.gender = gender self.stats = None self.last_name = None self.first_name = None self.killed = None else: d = json.load(open('./distributions/stats.json')) self.attributes = { 'size': U(d['size']['mean'], d['size']['spread']), 'strength': U(d['strength']['mean'], d['strength']['spread']), 'speed': U(d['speed']['mean'], d['speed']['spread']), 'hunting_skill': U(d['hunting_skill'][self.district]['mean'], d['hunting_skill'][self.district]['spread']), 'fighting_skill': U(d['fighting_skill'][self.district]['mean'], d['fighting_skill'][self.district]['spread']), 'weapon_skill': U(d['weapon_skill'][self.district]['mean'], d['weapon_skill'][self.district]['spread']), 'camouflage_skill': U(d['camouflage_skill'][self.district]['mean'], d['camouflage_skill'][self.district]['spread']), 'friendliness': U(d['friendliness']['mean'], d['friendliness']['spread']), 'district_prejudices': dict(d['district_prejudices'][self.district]), 'stamina': U(d['stamina']['mean'], d['stamina']['spread']), 'endurance': U(d['endurance']['mean'], d['endurance']['spread']), 'crafting_skill': U(d['crafting_skill'][self.district]['mean'], d['crafting_skill'][self.district]['spread']), 'bloodlust': U(d['bloodlust']['mean'], d['bloodlust']['spread']), 'max_health': U(d['max_health']['mean'], d['max_health']['spread']) } self.gender = gender self.stats = { 'health': self.attributes['max_health'], 'energy': self.attributes['stamina'], 'hunger_energy': 100 } self.last_name = random.choice(d['last_names']) if self.gender == 'male': self.first_name = random.choice(d['first_names_male']) else: self.first_name = random.choice(d['first_names_female']) self.killed = False pass