Skip to content

Commit

Permalink
Merge pull request #97 from neph1/update-v0.36.2
Browse files Browse the repository at this point in the history
Update v0.36.2
  • Loading branch information
neph1 authored Oct 31, 2024
2 parents 9350be3 + 9fdfcb8 commit 4212f07
Show file tree
Hide file tree
Showing 27 changed files with 487 additions and 438 deletions.
4 changes: 2 additions & 2 deletions generic_items.json → items/generic_items.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@
{
"name": "Beer",
"weight": 0.5,
"short_descr": "A glass of beer",
"short_descr": "A bottle of beer",
"effect": 5,
"type": "Drink",
"value": 2
},
{
"name": "Wine",
"weight": 0.5,
"short_descr": "A glass of wine",
"short_descr": "A bottle of wine",
"effect": 5,
"type": "Drink",
"value": 3
Expand Down
88 changes: 88 additions & 0 deletions items/wearables_fantasy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"wearables" : [
{
"name": "robe",
"location": "FULL_BODY",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "cloak",
"location": "BACK",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "tunic",
"location": "TORSO",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "shirt",
"location": "TORSO",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "pants",
"location": "LEGS",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "shoes",
"location": "FEET",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "belt",
"location": "WAIST",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "hat",
"location": "HEAD",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "steel_helmet",
"location": "HEAD",
"weight": 3,
"value": 10,
"ac": 3
},
{
"name": "mail_coif",
"location": "HEAD",
"weight": 3,
"value": 10,
"ac": 2
},
{
"name": "breeches",
"location": "LEGS",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "chainmail",
"location": "TORSO",
"weight": 3,
"value": 10,
"ac": 3
}
]
}
193 changes: 193 additions & 0 deletions items/wearables_modern.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
{
"wearables" : [
{
"name": "t-shirt",
"location": "TORSO",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "shirt",
"location": "TORSO",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "jeans",
"location": "LEGS",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "sneakers",
"location": "FEET",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "belt",
"location": "WAIST",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "dress_shoes",
"location": "FEET",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "hat",
"location": "HEAD",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "dress",
"location": "FULL_BODY",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "suit",
"location": "FULL_BODY",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "jacket",
"location": "TORSO",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "coat",
"location": "TORSO",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "cap",
"location": "HEAD",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "pants",
"location": "LEGS",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "shorts",
"location": "LEGS",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "boxers",
"location": "UNDER_GARMENTS",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "briefs",
"location": "UNDER_GARMENTS",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "bra",
"location": "UNDER_GARMENTS",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "socks",
"location": "UNDER_GARMENTS",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "panties",
"location": "UNDER_GARMENTS",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "thong",
"location": "UNDER_GARMENTS",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "stockings",
"location": "UNDER_GARMENTS",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "skirt",
"location": "LEGS",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "dress_shirt",
"location": "TORSO",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "blouse",
"location": "TORSO",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "sweater",
"location": "TORSO",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "coveralls",
"location": "FULL_BODY",
"weight": 1,
"value": 10,
"ac": 0
},
{
"name": "top",
"location": "TORSO",
"weight": 1,
"value": 10,
"ac": 0
}
]
}
9 changes: 4 additions & 5 deletions stories/dungeon/story.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def __init__(self, path = '', layout_generator = LayoutGenerator(), mob_populato


def init(self, driver: Driver) -> None:
self.llm_util = driver.llm_util
super(Story, self).init(driver)

def init_player(self, player: Player) -> None:
Expand Down Expand Up @@ -91,8 +92,6 @@ def welcome_savegame(self, player: Player) -> str:
"""welcome text when player enters the game after loading a saved game"""
player.tell("<bright>Hello %s, welcome back to %s.</>" % (player.title, self.config.name), end=True)
player.tell("\n")
player.tell(self.driver.resources["messages/welcome.txt"].text)
player.tell("\n")
return ""

def goodbye(self, player: Player) -> None:
Expand Down Expand Up @@ -124,7 +123,7 @@ def add_zone(self, zone: Zone) -> bool:
self.world.add_item_spawner(item_spawner)

if zone.center.z == self.max_depth:
self.driver.llm_util.generate_character
self.llm_util.generate_character

if not first_zone:
self.layout_generator.spawn_gold(zone=zone)
Expand All @@ -137,7 +136,7 @@ def _describe_rooms(self, zone: Zone, layout: Layout, rooms: list):
for num in range(0, len(rooms), 10):
sliced_rooms.extend(rooms[num:num+10])
for i in range(3):
described_rooms_slice = self.driver.llm_util.generate_dungeon_locations(zone_info=zone.get_info(), locations=sliced_rooms, depth = self.depth, max_depth=self.max_depth) # type LocationDescriptionResponse
described_rooms_slice = self.llm_util.generate_dungeon_locations(zone_info=zone.get_info(), locations=sliced_rooms, depth = self.depth, max_depth=self.max_depth) # type LocationDescriptionResponse
if described_rooms_slice.valid:
described_rooms.extend(described_rooms_slice.location_descriptions)
sliced_rooms = []
Expand Down Expand Up @@ -189,7 +188,7 @@ def _connect_locations(self, layout: Layout) -> None:
Exit.connect(cell_location, parent_location.name, '', None, parent_location, cell_location.name, '', None)

def _generate_boss(self, zone: Zone) -> bool:
character = self.driver.llm_util.generate_character(keywords=['final boss']) # Characterv2
character = self.llm_util.generate_character(keywords=['final boss']) # Characterv2
if character:
boss = RoamingMob(character.name,
gender=character.gender,
Expand Down
15 changes: 1 addition & 14 deletions tale/cmds/normal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1368,20 +1368,7 @@ def do_flee(player: Player, parsed: base.ParseResult, ctx: util.Context) -> None
pass
raise ActionRefused("You can't flee anywhere!")


@cmd("save")
@disable_notify_action
@disabled_in_gamemode(GameMode.MUD)
def do_save(player: Player, parsed: base.ParseResult, ctx: util.Context) -> Generator:
"""Save your game."""
if not ctx.driver.do_check_savefile_free(player):
if not (yield "input", ("Are you sure you want to overwrite the previous save game?", lang.yesno)):
player.tell("Ok, not saved.")
return
ctx.driver.do_save(player)


@cmd("load", "reload", "restore", "restart")
@cmd("load", "reload", "restore")
@disable_notify_action
@disabled_in_gamemode(GameMode.MUD)
def do_load(player: Player, parsed: base.ParseResult, ctx: util.Context) -> None:
Expand Down
6 changes: 6 additions & 0 deletions tale/cmds/wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -904,3 +904,9 @@ def do_create_item(player: Player, parsed: base.ParseResult, ctx: util.Context)
player.tell(item.name + ' added.', evoke=False)
else:
raise ParseError("Item could not be added")

@wizcmd("restart_story")
def do_restart(player: Player, parsed: base.ParseResult, ctx: util.Context) -> None:
"""Restart the game."""
player.tell("Restarting the game... Please reconnect")
os.execv(sys.executable, ['python3'] + sys.argv)
Loading

0 comments on commit 4212f07

Please sign in to comment.