Beispiel #1
0
def testAgility():
    '''
	Simulate who attacks first depending on agility value
	'''
    myWarrior = Warrior(5, 4, 11)
    compWarrior = Warrior(5, 4, 11)
    determineAttacker(myWarrior, compWarrior)
Beispiel #2
0
def AowTacticalBattle():
    '''
	Tactical battle inspired by Age Of Wonders
	'''
    warrior = Warrior(5, 5, 5)
    defender = Warrior(4, 4, 4)
    round = TacticalRound(warrior, defender)
    round.attack()
Beispiel #3
0
def char_decision(name, pick):
    if pick == "1":
        return Warrior.Warrior(name, sixCube)
    elif pick == "2":
        return Mage.Mage(name, sixCube)
    elif pick == "3":
        return Warlock.Warlock(name, sixCube)
    elif pick == "4":
        return Thief.Thief(name, sixCube)
Beispiel #4
0
def main():
    battlesimulator = Master()
    battlesimulator.introMessage()
    setupPlayers = SetupPlayers()
    setupPlayers.askPlayer()
    battlesimulator.displayStats(Warrior(1, 2, 3), Warrior(4, 5, 6))
    warriorSet = WarriorSet(Warrior(1, 2, 3), Warrior(4, 5, 6))
    warriorSet.printWarriors()
    simulation = Simulation()
    simulation.setWarriors(Warrior(1, 2, 3), Warrior(4, 5, 6))
    simulation.run()
Beispiel #5
0
def GameMenu():
    #Introduction is the welcome prompt for the RPG Game.
    Introduction = 'Welcome to the World of Sheridan.' + '\n' + '\n' + 'The school has been infested with teachers that sleep,' + '\n' + 'when they teach and we want to get rid of them by the time the summer ends.' + '\n'
    #Printing the Introduction to the user.
    print(Introduction)
    #Input asking user what their name is.
    Name = input('Before we begin what is your name? ' + '\n')
    #Capitalizing the first letter of the name
    NameCap = Name.capitalize()
    #Declaring AskRoleConfirmation as an empty string
    AskRoleConfirmation = ''
    #A new Introduction variable, welcoming the user based and their name.
    Introduction = '\n' + f'Well {NameCap}, you have just entered the school property and you see this problem ' 
    #Printing the introduction with the users Name.
    print(Introduction)
    #Loop until the user has confirmed their choice if they end up saying no keep asking them what their role may be.
    while(AskRoleConfirmation.lower() != 'y' and AskRoleConfirmation.lower() != 'yes'):
        #When user input equals the role create an object of Warrior or Wizard accordingly to the user input
        AskRole = input('The dean gives you two options: ' + '\n' +  'Warrior or Wizard, in order to wake up these bad teachers. ')
        #If the user input is the warrior then assign them the role of "Warrior" from the warrior module
        if (AskRole.lower() == 'warrior'):
            #Character variable assigned to the Warrior module dot Warrior object(capitalizedName)
            Character = Warrior.Warrior(NameCap)
            #Input for user confirming that they would like to choose this class being Warrior
            AskRoleConfirmation = input('Are you sure you would like to choose ' + Character.__class__.__name__ + ' (Y/N)?')
        #If the user input is the wizard then assign them the role of "Wizard" from the wizard module            
        elif(AskRole.lower() == 'wizard'):
            #Character variable assigned to the Wizard module dot Wizard object(capitalizedName)
            Character = Wizard.Wizard(NameCap)
            #Input for user confirming that they would like to choose this class being Wizard
            AskRoleConfirmation = input('Are you sure you would like to choose ' + Character.__class__.__name__ + ' (Y/N)?')
    #Once the Character is assigned give the first challenge to the user and pass the Character through the FirstChallenge that returns a string either 'a','b','c','d' and this string will be equal to ResultFirstChallenge
    ResultFirstChallenge = FirstChallenge(Character)
    #The first challenge will give a string that will result whether or not the user has loss or won, then make, the object adjustments on the member variables
    #Permuations of challenges shall report them to the next challenges 
    #If the user has critically lost the FirstChallenge
    if(ResultFirstChallenge == 'a'):
        #If the firstChallege output is a, then the user critically lost, -1 from stats and -1 vitality which decreases health
        Loss = Character.criticalLoss()
        #Print the string that is returned from Character.criticalLoss() method in the Warrior and Wizard modules
        print(str(Loss))
        #Even if the user critical loss then provide the user with the second challenge.
        SecondResultOutcome = SecondChallenge(Character)
        #If the user has critically lost the SecondChallenge.
        if(SecondResultOutcome == 'a'):
            #Give the user the third challenge
            ThirdChallenge(Character)
        #If the user has lost the SecondChallenge.
        elif(SecondResultOutcome == 'b'):
            #Give the user the third challenge
            ThirdChallenge(Character)
        #If the user has won the SecondChallenge.
        elif(SecondResultOutcome == 'c'):
            #Give the user the third challenge
            ThirdChallenge(Character)
        #If the user has critically won the SecondChallenge.    
        elif(SecondResultOutcome == 'd'):
            #Give the user the third challenge
            ThirdChallenge(Character)
    #If the user has lost the FirstChallenge
    elif(ResultFirstChallenge == 'b'):
        #Even if the user critical loss then provide the user with the second challenge.
        SecondResultOutcome = SecondChallenge(Character)
        #If the user has critically lost the SecondChallenge.
        if(SecondResultOutcome == 'a'):
            #Give the user the third challenge
            ThirdChallenge(Character)
        #If the user has lost the SecondChallenge.
        elif(SecondResultOutcome == 'b'):
            #Give the user the third challenge
            ThirdChallenge(Character)
        #If the user has won the SecondChallenge.
        elif(SecondResultOutcome == 'c'):
            #Give the user the third challenge
            ThirdChallenge(Character)
        #If the user has critically won the SecondChallenge.
        elif(SecondResultOutcome == 'd'):
            #Give the user the third challenge
            ThirdChallenge(Character)
    #If the user has won the FirstChallenge
    elif(ResultFirstChallenge == 'c'):
        #Even if the user won then provide the user with the second challenge.
        SecondResultOutcome = SecondChallenge(Character)
        #If the user has critically lost the SecondChallenge.
        if(SecondResultOutcome == 'a'):
            #Give the user the third challenge
            ThirdChallenge(Character)
        #If the user has lost the SecondChallenge.
        elif(SecondResultOutcome == 'b'):
            #Give the user the third challenge
            ThirdChallenge(Character)
        #If the user has won the SecondChallenge.
        elif(SecondResultOutcome == 'c'):
            #Give the user the third challenge
            ThirdChallenge(Character)
        #If the user has critically won the SecondChallenge.
        elif(SecondResultOutcome == 'd'):
            #Give the user the third challenge
            ThirdChallenge(Character)
    #If the firstChallege output is d, then the user critically won, +1 from stats and +1 vitality which increases health
    elif(ResultFirstChallenge == 'd'):
        Win = Character.criticalWin()
        print(str(Win))
        ResultOutcome = SecondChallenge(Character)
        if(ResultOutcome == 'd'):
            ThirdChallenge(Character)
Beispiel #6
0
def miniSimulation():
    simulation = Simulation()
    simulation.setWarriors(Warrior(1, 2, 3), Warrior(4, 5, 6))
    simulation.run()
Beispiel #7
0
def battleWithDice():
    '''
	Simulate damage with simple die mechanism
	'''
    myWarrior = Warrior(6, 5, 9)  # Hard code my and cpu warrior
    compWarrior = Warrior(8, 4, 8)
    myWarrior.setName("My warrior")
    compWarrior.setName("Computer warrior")
    divider = "-" * 10
    battleStats = BattleStats(
        myWarrior, compWarrior)  # Keep track of stats to be shown in end
    while myWarrior.getHealth() > 0 and compWarrior.getHealth(
    ) > 0:  # Loop battle rounds
        print(divider)
        printCondition(myWarrior, compWarrior)
        attacker = determineAttacker(myWarrior, compWarrior)
        defender = determineDefender(attacker, myWarrior, compWarrior)
        damage = damageCalculator(attacker.getAttack(), defender.getDefense())
        printDamageMsg(damage)
        # print ("damage = ", damage)
        defender.reduceHealth(damage)
        battleStats.addRounds()
        battleStats.recordDamage(myWarrior.getHealth(),
                                 compWarrior.getHealth())
        print("Options:  (Enter)Continue\t(b)Main Menu")
        a = input()
        if a == "b":
            print("You attempted to go to Main Menu; not yet implemented")
        else:
            continue
    if myWarrior.getHealth() <= 0:  # End battle scenario
        print(myWarrior.getName(), "is dead!")
        battleStats.setWinner(compWarrior)
    else:
        print(compWarrior.getName(), "is dead!")
        battleStats.setWinner(myWarrior)
    print(divider)
    print("Battle stats:")  # Show battle stats
    print("Winner = " + battleStats.getWinner())
    print("Total rounds = ", battleStats.getRounds())
    print("HP history = ")
    print(myWarrior.getName(), "  = ", battleStats.getHistory(myWarrior))
    print(compWarrior.getName(), "= ", battleStats.getHistory(compWarrior))
Beispiel #8
0
from Creature import *
from Warrior import *

warr1 = Warrior(40, 60, 300, 50, "Tííííoo")
Beispiel #9
0
def battleWithDice():
	'''
	Simulate damage with simple die mechanism
	'''
	myWarrior = Warrior(6, 5, 9) 						# Hard code my and cpu warrior
	compWarrior = Warrior(8, 4, 8)
	myWarrior.setName("My warrior")
	compWarrior.setName("Computer warrior")
	divider = "-" * 10
	battleStats = BattleStats(myWarrior, compWarrior) 	# Keep track of stats to be shown in end
	while myWarrior.getHealth() > 0 and compWarrior.getHealth() > 0:  # Loop battle rounds
		print (divider)
		printCondition(myWarrior, compWarrior)
		attacker = determineAttacker(myWarrior, compWarrior)
		defender = determineDefender(attacker, myWarrior, compWarrior)
		damage = damageCalculator(attacker.getAttack(), defender.getDefense())
		printDamageMsg(damage)
		# print ("damage = ", damage)
		defender.reduceHealth(damage)
		battleStats.addRounds()
		battleStats.recordDamage(myWarrior.getHealth(), compWarrior.getHealth())
		print ("Options:  (Enter)Continue\t(b)Main Menu")
		a = input()
		if a == "b":
			print ("You attempted to go to Main Menu; not yet implemented")
		else:
			continue
	if myWarrior.getHealth() <= 0: 						# End battle scenario
		print (myWarrior.getName(), "is dead!")
		battleStats.setWinner(compWarrior)
	else:
		print (compWarrior.getName(), "is dead!")
		battleStats.setWinner(myWarrior)
	print (divider)
	print ("Battle stats:")  								# Show battle stats
	print ("Winner = "+ battleStats.getWinner())
	print ("Total rounds = ", battleStats.getRounds())
	print ("HP history = ")
	print (myWarrior.getName(), "  = ", battleStats.getHistory(myWarrior))
	print (compWarrior.getName(), "= ", battleStats.getHistory(compWarrior))
Beispiel #10
0
Class = raw_input("Enter a class:")
while Class.lower() != "warlock" and Class.lower() != "lock" and Class.lower(
) != "warrior" and Class.lower() != "war" and Class.lower(
) != "shaman" and Class.lower() != "shammy" and Class.lower(
) != "sham" and Class.lower() != "priest":
    Class = raw_input(Class +
                      " Is not a valid entry. Please re-enter your class:")
if Class.lower() == "warlock" or Class.lower() == "lock":
    Spec = raw_input("Enter a specialization:")
    Spec = Spec.lower()
    Warlock.WarlockSpecEntry(Spec)

elif Class.lower() == "warrior" or Class.lower() == "war":
    Spec = raw_input("Enter a specialization:")
    Spec = Spec.lower()
    Warrior.WarSpecEntry(Spec)

elif Class.lower() == "shaman" or Class.lower() == "shammy" or Class.lower(
) == "sham":
    Spec = raw_input("Enter a specilization:")
    Spec = Spec.lower()
    Shaman.ShamanSpecEntry(Spec)

elif Class.lower() == "priest":
    Spec = raw_input("Enter a specilization:")
    Spec = Spec.lower()
    Priest.PriestSpecEntry(Spec)

else:
    print "The class entered is not supported"
    input()
Beispiel #11
0
                        Role.itemBackpack.append(item)
                        print("You have now equipped the " + item + "...")
                        secondKey = True
                    elif (pickUp.lower() == 'n' or pickUp.lower() == 'no'):
                        print("Back to the school")
            elif (decision.lower() == 'e' or decision.lower() == 'bag'):
                if not (Role.itemBackpack):
                    print("Your bag is empty")
                else:
                    print(*Role.itemBackpack, sep="\n")
            elif (decision.lower() == 'f' or 'stats'):
                print(Role.Stats())
        #While Loop that gives the user options A-D: resulting in Broadcasting Room, Library, Coffee Shop, Classroom (Coffee and Secondkey) not until Flashlight is true, Microphone used is true, Coffee in the backpack and the classroom is unlocked with Secondkey
        while (flashLight != True or microphoneUsed != True
               or 'Coffee' in Role.itemBackpack or ClassRoomUnlocked == True):
            decision = input(
                '\n' +
                'There are four spots to check in the front of the school and are as listed (E to check bag, F for Character Statistics):'
                + '\n' + 'A: Broadcasting Station' + '\n' + 'B: Library' +
                '\n' + 'C: Coffee Shop' + '\n' + 'B: Classroom' + '\n'
                'Your choice: ')
            if (decision.lower() == 'c' and secondKey == False):
                textLocation = 'You check the classroom and see that the class room is locked' + '\n'
                print(textLocation)
        #textLocation = 'You check the coffee shop and see that there is a fresh pot of coffee there' + '\n'
        #print(textLocation)
        return resultOutcome


Character = Warrior.Warrior("Arzen")
thirdChallenge(Character)