コード例 #1
0
# Instances of Weapon Objects
import Weapons as w

dirk = w.Weapon("dirk", 2, 7, "piercing", 1, "dagger")
spear = w.Weapon("spear", 3, 10, "piercing", 2, "spear")
axe = w.Weapon("axe", 4, 12, "bludgeoning", 3, "axe")
longsword = w.Weapon("longsword", 1, 80, "slashing", 5, "sword")
knife = w.Weapon("knife", 1, 60, "piercing", 1, "dagger")
コード例 #2
0
import sys
import Weapons
import Main
import Map

disk = Weapons.Weapon("Scratched Fortnite Disk", 2, "Blah")
backpack = [disk]

def showInv():
    print ('You have ')
    for stuff in backpack:
        print(stuff.getName())

commandList = ['? - Help', 'go - Move direction', 'exit - Exit game', 'inventory - Open inventory', 'get - pick up object']

def listCommands(commandList):
    print ('\tYou can do the folowing: ')
    for x in commandList:
        print ('\t', x)


print ("Hello, welcome to our house!")


name = input("What\'s your name? ")

print("\tHi", name)

command = ''
command = input("What would you like to do? ")