<commit_before>#!/usr/bin/python

#
# Tutorial 7 shows how to introduce mortality your game.
#

# Allows access to the bwx_adventure module
import os
import sys
sys.path.insert(1, os.path.join(sys.path[0], '..'))
sys.path.insert(1, os.path.join(sys.path[0], '../bwx_adventure'))

from bwx_adventure.advent import *
from bwx_adventure.advent_devtools import *


# We'll start out with our familiar brightworks entryway:

game = Game("Brightworks Adventure")

sidewalk = game.new_location(
  "Sidewalk",
  "There is a large glass door to the east. The sign says 'Come In!'")

vestibule = game.new_location(
  "Vestibule",
"""A small area at the bottom of a flight of stairs.
There is a glass door to the west and door to the south.""")

office = game.new_location(
  "Office",
"""A nicely organized office.
There is a door to the north.""")

game.new_connection("Glass Door", sidewalk, vestibule, [IN, EAST], [OUT, WEST])
game.new_connection("Office Door", vestibule, office, [IN, SOUTH], [OUT, NORTH])

cat = Pet("cat")
cat.set_location(sidewalk)
cat.set_allowed_locations([sidewalk])

player = game.new_player(sidewalk)

#
# Lets put a deadly object on the sidewalk:
# The object is a Drink and the arguments we pass to Drink() are:
#   - name of the object "vial"
#   - description of the object "a small vial of..."
#   - a verb to perform when the Drink is consumed, we use the Die() verb
#     which kills any actor that performs it, after printing out the text
#     provided to Die()
#   - an Object() to replace the vial after it is consumed, "empty vial"
#
# Try the following commands in this tutorial:
# > drink vial<commit_msg>shanes work<commit_after>#!/usr/bin/python

#
# Tutorial 7 shows how to introduce mortality your game.
#

# Allows access to the bwx_adventure module
import os
import sys
sys.path.insert(1, os.path.join(sys.path[0], '..'))
sys.path.insert(1, os.path.join(sys.path[0], '../bwx_adventure'))

from bwx_adventure.advent import *
from bwx_adventure.advent_devtools import *


# We'll start out with our familiar brightworks entryway:

game = Game("Willow Of Death")

porch = game.new_location(
  "Porch",
  "You are on a porch. It is raining. To the North is an office door, to the west is a ramp.")
game.new_connection(open(
vestibule = game.new_location(
  "Vestibule",
"""A small area at the bottom of a flight of stairs.
There is a glass door to the west and door to the south.""")

office = game.new_location(
  "Office",
"""A nicely organized office.
There is a door to the north.""")

game.new_connection("Glass Door", sidewalk, vestibule, [IN, EAST], [OUT, WEST])
game.new_connection("Office Door", vestibule, office, [IN, SOUTH], [OUT, NORTH])

cat = Pet("cat")
cat.set_location(sidewalk)
cat.set_allowed_locations([sidewalk])

player = game.new_player(sidewalk)

#
# Lets put a deadly object on the sidewalk:
# The object is a Drink and the arguments we pass to Drink() are:
#   - name of the object "vial"
#   - description of the object "a small vial of..."
#   - a verb to perform when the Drink is consumed, we use the Die() verb
#     which kills any actor that performs it, after printing out the text
#     provided to Die()
#   - an Object() to replace the vial after it is consumed, "empty vial"
#
# Try the following commands in this tutorial:
# > drink vial
{'fraction_non_alphanumeric': 0.11567502265176684, 'fraction_numerical': 0.0030202355783751134, 'mean_word_length': 4.1669266770670825, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6308520', 'n_tokens_mistral': 1105, 'n_tokens_neox': 1078, 'n_words': 421}