def cheat_ending2(character): character.loc = [3.5, 3] chooseroom(character) bach(character) much(character) write(text, character.room['setting']) character.status = 'end2'
def __init__(self, loc, health, status, token, inventory = []): self.loc = loc self.inventory = inventory self.status = status self.health = health self.token = token chooseroom(self)
def teleport_command(character, cmd): for i in roomslist: if i['locname'] == cmd.item: write(text, 'Success! You have teleported to the ' + i['locname']) character.loc = i['location'] chooseroom(character) bach(character) much(character)
def exit_command(character): if character.room in [clearing1, house1, cave1]: write(text, 'You exit the ' + character.room['locname']) character.loc[0] = character.loc[0] - 0.5 chooseroom(character) bach(character) much(character) noreplace_write(text, character.room['setting'])
def continue2_command(character): write( text, '''Ok. I'll just drop you off at the waterfall. Hey, why don't you head over to the village? Maybe that'll help you out. Bye!''') character.loc = [3, 3] chooseroom(character) bach(character) much(character) noreplace_write(text, character.room['setting'])
def south_command(character): if character.room in [mountain1, waterfall1, jungle1, hill1]: write(text, 'You walk to the south.') character.loc[0] = character.loc[0] - 1 chooseroom(character) bach(character) much(character) noreplace_write(text, 'You are now at the ' + character.room['locname']) noreplace_write(text, character.room['setting']) character.health = character.health - 2 else: write(text, 'You can\'t go that way!')
def north_command(character): if character.room in [beach1, jungle1, hill1, cliff1]: write(text, 'You walk to the north.') character.loc[0] = character.loc[0] + 1 chooseroom(character) bach(character) much(character) noreplace_write(text, 'You are now at the ' + character.room['locname']) noreplace_write(text, character.room['setting']) character.health = character.health - 2 else: write(text, 'You can\'t go that way!')
def east_command(character): if character.room in [mountain1, village1, rocks1]: write(text, 'You walk to the east.') character.loc[1] = character.loc[1] + 1 chooseroom(character) bach(character) much(character) noreplace_write(text, 'You are now at the ' + character.room['locname']) noreplace_write(text, character.room['setting']) character.health = character.health - 2 else: write(text, 'You can\'t go that way!')
def west_command(character): if character.room in [waterfall1, jungle1, beach1]: write(text, 'You walk to the west.') character.loc[1] = character.loc[1] - 1 chooseroom(character) bach(character) much(character) noreplace_write(text, 'You are now at the ' + character.room['locname']) noreplace_write(text, character.room['setting']) character.health = character.health - 2 else: write(text, 'You can\'t go that way!')
def enter_command(character): if character.room in [jungle1, village1, waterfall1]: character.loc[0] = character.loc[0] + 0.5 chooseroom(character) if character.room == cave1: write(text, 'You step through the waterfall....') else: write(text, '') bach(character) much(character) noreplace_write(text, 'You enter the ' + character.room['locname']) noreplace_write(text, character.room['setting']) if character.room == cave1: character.status = 'end2'