Exemplo n.º 1
0
def test_room_paths():
    center = Scene("Center", "Test room in the center.")
    north = Scene("North", "Test room in the north.")
    south = Scene("South", "Test room in the south.")

    center.add_paths({'north': north, 'south': south})
    assert_equal(center.go('north'), north)
    assert_equal(center.go('south'), south)
Exemplo n.º 2
0
def test_map():
    start = Scene("Start", "You can go west and down a hole.")
    west = Scene("Tres", "There are trees here, you can go east.")
    down = Scene("Dungeon", "It's dark down here, you can go up.")

    start.add_paths({'west': west, 'down': down})
    west.add_paths({'east': start})
    down.add_paths({'up':start})

    assert_equal(start.go('west'), west)
    assert_equal(start.go('west').go('east'), start)
    assert_equal(start.go('down').go('up'), start)
Exemplo n.º 3
0
def test_map():
    start = Scene("Start", "start", "You can go west to see the painting.")
    west = Scene("Sofa", "sofa", "There is a sofa here, you can seat.")
    down = Scene("Alarm", "alarm",
                 "There is an alarm down there. You should be careful..")

    start.add_paths({'west': west, 'down': down})
    west.add_paths({'east': start})
    down.add_paths({'up': start})

    assert_equal(start.go('west'), west)
    assert_equal(start.go('west').go('east'), start)
    assert_equal(start.go('down').go('up'), start)
Exemplo n.º 4
0
death_four = Scene(
    "The Nightmare Continues...", "death", """
Billy throws the Pokeball at Pikachu.
Oh no! He won't enter it!
Pikachu hates Pokeballs.
Billy is too slow, Pikachu's lightsaber separates Billy's head from his body.
Damn it.

Billy won't be able to wake up in the real world until he successfully fought
the monsters of his subconciousness.
""", '')

# Defining the action commands available in each scene

final_fight.add_paths({'pokeball': death_four, 'finish him!': the_end_winner})

home_office.add_paths({'finish him!': the_end_winner, 'no kill': final_fight})

kitchen.add_paths({
    'pacman': death_two,
    'orange': death_three,
    'tablecloth': home_office
})

bunny.add_paths({'bedroom': death_one, 'bathroom': kitchen})

generic_death.add_paths({'start': prologue})

prologue.add_paths({
    'stay under the blanket': generic_death,
Exemplo n.º 5
0
You jump into pod 2 and hit the eject button. The pod flies out into space heading
to the planet below. As you're heading down, you look back and see your ship implode
and then explode like a supernova, taking down the Gothon ship at the same time.
You made it!
""", "")

the_end_loser = Scene(
    "...", "death", """
You jump into a random pod and hit the eject button. The pod escapes into space
but there's a crack in the hull. Uh oh. The pod implodes and you with it.
""", "")

generic_death = Scene("Death...", "death", "You died.", '')

# Defining the action commands available in each scene
escape_pod.add_paths({'2': the_end_winner, '*': the_end_loser})

the_bridge.add_paths({
    'throw the bomb': generic_death,
    'slowly place the bomb': escape_pod
})

laser_weapon_armory.add_paths({'123': the_bridge, '*': generic_death})

central_corridor.add_paths({
    'shoot!': generic_death,
    'dodge!': generic_death,
    'tell a joke': laser_weapon_armory
})

generic_death.add_paths({'start': central_corridor})