Skip to content

Commit

Permalink
some wearable fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
neph1 committed Oct 5, 2024
1 parent 6811e74 commit 941a691
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion llm_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ BASE_PROMPT: '<context>{context}</context>\n[USER_START] Rewrite [{input_text}]
DIALOGUE_PROMPT: '<context>{context}</context>\nThe following is a conversation between {character1} and {character2}; {character2}s sentiment towards {character1}: {sentiment}. Write a single response as {character2} in third person pov, using {character2} description and other information found inside the <context> tags. If {character2} has a quest active, they will discuss it based on its status. Respond in JSON using this template: """{dialogue_template}""". [USER_START]Continue the following conversation as {character2}: {previous_conversation}'
COMBAT_PROMPT: '<context>{context}</context>\nThe following is a combat scene between {attackers} and {defenders} in {location}. [USER_START] Describe the following combat result in about 150 words in vivid language, using the characters weapons and their health status: 1.0 is highest, 0.0 is lowest. Combat Result: {input_text}'
PRE_JSON_PROMPT: 'Below is an instruction that describes a task, paired with an input that provides further context. Write a response in valid JSON format that appropriately completes the request.'
CREATE_CHARACTER_PROMPT: '<context>{context}</context>\n[USER_START] Create a diverse character with rich personality that can be interacted with using the story context and keywords. {{quest_prompt}} Do not mention height. keywords: {keywords}. Fill in this JSON template and write nothing else: {character_template}'
CREATE_CHARACTER_PROMPT: '<context>{context}</context>\n[USER_START] Create a diverse character with rich personality that can be interacted with using the story context and keywords. {{quest_prompt}} Do not mention height. Keywords: {keywords}. Fill in the blanks in this JSON template and write nothing else: {character_template}'
CREATE_LOCATION_PROMPT: '<context>{context}</context>\nZone info: {zone_info}; Exit json example: {exit_template}; Npc or mob example: {npc_template}. Existing connected locations: {exit_locations}. [USER_START] Using the information supplied inside the <context> tags, describe the following location: {location_name}. {items_prompt} {spawn_prompt} Add a brief description, and one to three additional exits leading to new locations. Fill in this JSON template and do not write anything else: {location_template}. Write the response in valid JSON.'
CREATE_ZONE_PROMPT: '<context>{context}</context>\n[USER_START]Using the information supplied inside the <context> tags, create an new area that can be further populated with multiple locations. It is connected in the {direction} to {zone_info}. Add a name and brief description. Choose the names of 5 creatures from the supplied list likely to find in the area. Fill in "items" with the names and types of 5 common items in the area. Fill in this JSON template and do not write anything else: {zone_template}. Write the response in valid JSON.'
CREATE_DUNGEON_LOCATIONS: '<context>{context}</context>\n For the supplied list of rooms, generate a name and a one line description for each room, keeping the theme from the Zone. Use the information supplied inside the <context> tags to create a unique and interesting locations. Do not include any creatures. Depth indicates how deep in the dungeon it is. Respond with an array of locations in JSON format and do not write anything else: [{dungeon_location_template},{dungeon_location_template},...].'
Expand Down
2 changes: 1 addition & 1 deletion tale/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,7 @@ def wielding(self, weapon: Optional[Weapon]) -> None:
self.tell_others("{Actor} unwields %s." % self.__wielding.title, evoke=True, short_len=True)
self.tell("You unwield %s." % self.__wielding.title)

def set_wearable(self, wearable: Optional[Wearable], wear_location: Optional[wearable.WearLocation] = wearable.WearLocation.TORSO) -> None:
def set_wearable(self, wearable: Optional[Wearable], wear_location: Optional[wearable.WearLocation] = None) -> None:
""" Wear an item if item is not None, else unwear location"""
if wearable:
loc = wear_location if wear_location else wearable.wear_location
Expand Down
2 changes: 1 addition & 1 deletion tale/equip_npcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ def dress_npc(npc: LivingNpc, setting: str = 'fantasy', max_attempts = 5) -> Non
max_attempts -= 1
continue
npc.insert(wearable_item, npc)
npc.set_wearable(wearable_item, bodypart)
npc.set_wearable(wearable_item, wear_location=wearable_item.wear_location)
return
2 changes: 1 addition & 1 deletion tale/wearable.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def random_wearable_for_body_part(bodypart: WearLocation, setting: str = 'fantas
# TODO: Fix name
wearable = wearables[wearable_name]
wearable['name'] = wearable_name
wearable['short_descr'] = f"A {wearable['name']} in {random.choice(wearable_colors)}"
wearable['short_descr'] = f"{random.choice(wearable_colors)} {wearable['name']}"
return wearable

wearable_colors = ['black', 'green', 'blue', 'red', 'yellow', 'white', 'brown', 'grey', 'purple', 'orange', 'pink', 'cyan', 'magenta']
Expand Down

0 comments on commit 941a691

Please sign in to comment.