def animation_load(self, user, user_input, input_kwargs): first_person = "You easily slide the magazine into your {}.".format(self.name) target_person = "{} slides a magazine into {} {}.".format(user.name, Lex.gender(user, "own"), self.name) third_person = "{} slides a magazine into {} {}.".format(user.name, Lex.gender(user, "own"), self.name) return first_person, target_person, third_person
def animation_load(self, user, user_input, input_kwargs): print(user.inventory) first_person = "You side-load {} into your {} and it immediately spins up, humming with energy.".format( Lex.a_an(user.inventory['l_hand']['contents'].name), user.inventory['r_hand']['contents'].name) target_person = "" third_person = "{} side-loads {} into {} {}.".format( user.name, Lex.a_an(user.inventory['l_hand']['contents'].name), Lex.gender(user, "own"), Lex.a_an(user.inventory['r_hand']['contents'].name)) return first_person, target_person, third_person
def display_npc_inventory(target): npc_inv = [] for i in target.inventory: if target.inventory[i]['contents'] == None: pass else: npc_inv.append("{} {} {} {}".format( target.inventory[i]['contents'].name, target.inventory[i]['worn'], Lex.gender(target, "own"), target.inventory[i]['name'])) if npc_inv == []: npc_inv = "nothing" print(npc_inv) return npc_inv
def entity_description(self, user, user_input, input_kwargs): if self.vitals['alive'] == True: first_person_value = "{}".format(self.description['desc']) target_person_value = "" third_person_value = "{} observes {}.".format(self.description['name'], Lex.a_an(self.description['name'])) else: first_person_value = "{} is dead. {}".format(Lex.gender(self.description['name'], "pro").capitalize(), self.description['desc']), target_person_value = "{} observes your dead body.".format(self.description['name']) third_person_value = "{} observes {}.".format(self.description['name'], Lex.a_an(self.description['name'])) Lex.pub_print( self=user, target=input_kwargs['target'], send_kwargs={'type': 'text', 'spacing': 1}, first_person = first_person_value, target_person = target_person_value, third_person = third_person_value, )
def fire_gun(self, user_input, input_kwargs): # Combat flow parameters --- combat_kwargs = { "round_time": 5, "combat_action": "fire_gun", "attribute": "dex" } # --- mag = items[self.inventory["r_hand"] ["contents"].dynamic_stats['ammo_id']] mag.dynamic_stats['current_capacity'] -= 1 Lex.pub_print( self=self, target=None, send_kwargs={ 'type': 'text', 'spacing': 0 }, first_person="|self_speech| You fire your {} at {}! |self_speechx|" .format(self.inventory["r_hand"]["contents"].name, Lex.a_an(input_kwargs['target'].name)), target_person="", third_person="{} fires {} {} at {}!".format( self.name, Lex.gender(self, "own"), self.inventory["r_hand"]["contents"].name, Lex.a_an(input_kwargs['target'].name))) # Run post-attack combat flow Combat.combat_flow(self, user_input, input_kwargs, combat_kwargs) if mag.dynamic_stats['current_capacity'] < 1: self.inventory["r_hand"]["contents"].dynamic_stats[ 'loaded'] = False self.inventory["r_hand"]["contents"].dynamic_stats[ 'ammo_id'] = None self.inventory["r_hand"]["contents"].item_inv.remove( items[mag.uuid_id]) del items[mag.uuid_id] Lex.pub_print( self=self, target=None, send_kwargs={ 'type': 'text', 'spacing': 1 }, first_person= "|alert|You're dry!|alertx| You release the empty {} and it casually falls to the ground out of sight." .format(mag.name), target_person="", third_person= "{} releases a spent magazine from {} {} and it falls aside.". format(self.name, Lex.gender(self, "own"), self.inventory["r_hand"]["contents"].name)) else: pass
def swap_hands(self, user_input, input_kwargs): right_hand = self.inventory['r_hand']['contents'] left_hand = self.inventory['l_hand']['contents'] self.inventory['r_hand']['contents'] = left_hand self.inventory['l_hand']['contents'] = right_hand Lex.pub_print( self=self, target=None, send_kwargs={'type': 'text', 'spacing': 1}, first_person = "You swap the items in your hands.", target_person = "", third_person = "{} swaps the items in {} hands.".format(self.name.capitalize(), Lex.gender(self, "own"))) Update_Client.update_player_inventory(self)