if current_room.get_character() is not None: fight_with = input("What will you fight with? ") result = current_room.get_character().fight(fight_with) if result: current_room.set_character(None) else: print("Sadly you have been off'ed by " + current_room.get_character().name + " which ends the game") break else: print("There is nobody in this room to fight with") else: myhelp.prompt(command_list[0]) elif len(command_list) == 2: #handle two word commands here if command_list[0] == 'move': current_room = current_room.move(command_list[1]) elif command_list[0] == 'talk': if command_list[1] == 'dave': dave.describe() dave.talk() else: print("There is no body here by that name.") else: myhelp.prompt(command_list[0]) else: myhelp.prompt(command_list[0]) #current_room = current_room.move(command)
from character import Character from character import Enemy sylv = Enemy("Sylvanas","A dirty, smelly, morally grey banshee zombie.") sylv.describe() sylv.set_conversation("BURN IT!") sylv.talk() sylv.set_weakness("Frostmourne") print("What will you fight with?") fight_with = input() sylv.fight(fight_with)
from character import Character from character import Enemy dave = Character("Dave", "A smelly zombie!") dave.describe() dave.set_conversation("Hi!!") dave.talk() #*I am going to create the enemy zombie, bob bob = Enemy("Bob", "A dangerous zombie!") bob.describe() fight_with = input("What will you fight bob with?") bob.set_weakness("cheese") bob.fight(fight_with)
from character import Enemy sid = Enemy('sid','demon from hell') sid.describe() sid.set_conversation("I lurk in the darkness") sid.talk() sid.set_weakness('light') sid.get_weakness() x = input() sid.fight(x)
from character import Enemy derek = Enemy("Derek", "A smelly zombie!") derek.describe() # Add some dialogue for Derek for when he is spoken to derek.set_conversation("What's up dude?") derek.talk() # Trigger a conversation with Derek # Set a weakness derek.set_weakness("penicilin") # Fight with Derek print("What is your weapon of choice?") weapon = input() derek.fight(weapon)