Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random,time,os,math
- ###########################################NEEED TO SAVE STR AND OTHER STATS, AND ALSO MAKE IT SO WHEN GOES INTO FIGHT, AFTER FIGHT THE STATS RESET.
- clear = lambda: os.system('cls')
- NumberOfKnockouts = 4#4
- BaseKnockout = 4#4
- BaseElementAmmo = 5#3
- Random = True
- #GAMEMODES : PvP | PvC | CvC | Story(WIP)
- gameMode = "PvC"
- varienceLow=70
- varienceLow100=100
- varienceHigh=140
- TSvarienceLow=60
- TSvarienceHigh=150
- attackBonus = 1.15
- attack2Mod = 1.3
- bendingMod = 1.13
- nonBenderMod = 1.05
- waterBenderChiBonus= math.floor(BaseElementAmmo/2)
- SPDAttackBonus = 50
- chargeGain = 1
- chargeSPDGain = 1.07
- defenseRate = 3 #1/x
- attack1Cost = 1
- attack2Cost = 3
- attack3Cost = 4
- BattleOrder = []
- N=0
- tempX=None
- attackSuccess=None
- defends=None
- defends1=None
- defends2=None
- action = None
- defaultKnockback = 1
- extraKnockback = 0
- MaxTurns = 3
- ##################################################### CHARACTERS
- #xxx-Character|xxx-Level|xxx-XP|xxx-StatPoints|xxx-Gold|xxx-STR|xxx-DEF|xxx-SPD
- #014001000000000076053062 - Starter Bolin
- #NAME|STR|DEF|SPD
- CharacterList = ["Korra","Aang","Katara","Ghazan","Zuko","Toph","Mako","Yakone","Amon","Kioshi","Ozai","P'Li","Tenzin","Bolin","Kuvira","Roku"]
- Characters = ["Bolin",75.5,52,61.5,"Mako",77.5,58.5,62,"Korra",70,57.5,59,"Katara",63.5,69,54,"Zuko",74,53,62.5,"Toph",61.5,73,56,"Ozai",87.5,60,67.5,"Aang",66.5,83.5,86,
- "Tenzin",64,79.5,77,"Kioshi",77.5,70,62.5,"Yakone",77.5,68.5,56,"Amon",76,70,64,"P'Li",92.5,53.5,71.5,"Kuvira",76.5,75,69.5,"Roku",70,66,60,"Ghazan",72,56.5,70.5]
- fireBenders=["Mako","Zuko","Ozai","P'Li","Roku"]
- waterBenders=["Korra","Katara","Yakone","Amon"]
- earthBenders=["Bolin","Toph","Kioshi","Kuvira","Ghazan"]
- airBenders=["Aang","Tenzin"]
- nonBenders=[]
- CharacterChoice1="Zuko"
- CharacterChoice2="Katara"
- CharacterChoice1 = random.choice(CharacterList)#input("Character 1: ")
- CharacterChoice2 = random.choice(CharacterList)#input("Character 2: ")
- while CharacterChoice1 == CharacterChoice2:
- #CharacterChoice1 = random.choice(CharacterList)#input("Character 1: ")
- CharacterChoice2 = random.choice(CharacterList)#input("Character 2: ")
- ##################################################### CHARACTERS END
- ###########################STORY MODE
- global userLevel
- global userCharacter
- global levelUpBase
- global levelUpBonus
- userCharacter = ""
- userLevel = 0
- userXP = 0
- levelUpBase = 55
- levelUpBonus = 25
- enemyDifficultyLow = 75
- enemyDifficultyHigh = 135
- global strCost
- global defCost
- global spdCost
- def statCosts():
- global strCost
- global defCost
- global spdCost
- strCost=1*(userLevel/4.42)
- defCost=1*(userLevel/4.42)
- spdCost=1*(userLevel/4.42)
- def enemyDifficulty():
- enemyDifficulty=random.randint(enemyDifficultyLow,enemyDifficultyHigh)
- baseXPGain=5
- def xpGain():
- global gain
- gain = baseXPGain*(enemyDifficulty/100)
- def xpGoalAPP():
- global xpGoal
- xpGoal = (levelUpBase + levelUpBonus) * (math.ceil(userLevel) * 0.21)
- userStatPoints=0
- userGold = 0
- if gameMode == "Story":
- print("Load Character?")
- ########loadCharacter = input()
- loadCharacter="Yes"
- if loadCharacter == "Yes":
- #xxx-Character|xxx-Level|xxx-XP|xxx-StatPoints|xxx-Gold|xxx-STR|xxx-DEF|xxx-SPD
- #TEST CODE - 004123456789111099088077
- #004123456789111099088077
- #014001000000000076053062
- #004123456788070100088077
- #004123456788070099088077
- #014002000000018076054063
- print("Code:")
- code=str(input())
- #code = "014001000000000076053062"
- if str(code[1:2]) == "0":########################## CHARACTER
- loadGameCode1 = int(code[2:3])
- else:
- loadGameCode1 = int(code[1:3])
- if str(code[3:4]) == "0":########################## Level
- if str(code[4:5]) == "0":
- loadGameCode2 = int(code[5:6])
- else:
- loadGameCode2 = int(code[4:6])
- else:
- loadGameCode2 = int(code[3:6])
- if str(code[6:7]) == "0":########################## XP
- if str(code[7:8]) == "0":
- loadGameCode3 = int(code[8:9])
- else:
- loadGameCode3 = int(code[7:9])
- else:
- loadGameCode3 = int(code[6:9])
- if str(code[9:10]) == "0":########################## Stat Points
- if str(code[10:11]) == "0":
- loadGameCode4 = int(code[11:12])
- else:
- loadGameCode4 = int(code[10:12])
- else:
- loadGameCode4 = int(code[9:12])
- loadGameCode5 = int(code[12:15])
- if str(code[15:16]) == "0":########################## STR
- if str(code[16:17]) == "0":
- loadGameCode6 = int(code[17:18])
- else:
- loadGameCode6 = int(code[16:18])
- else:
- loadGameCode6 = int(code[15:18])
- if str(code[18:19]) == "0":########################## DEF
- if str(code[19:20]) == "0":
- loadGameCode7 = int(code[20:21])
- else:
- loadGameCode7 = int(code[19:21])
- else:
- loadGameCode7 = int(code[18:21])
- if str(code[21:22]) == "0":########################## SPD
- if str(code[22:23]) == "0":
- loadGameCode8 = int(code[23:24])
- else:
- loadGameCode8 = int(code[22:24])
- else:
- loadGameCode8 = int(code[21:24])
- userCharacter = str(CharacterList[(loadGameCode1)-1:(loadGameCode1)]).replace('[', '').replace(']', '').replace("'", '')
- CharacterChoice1=userCharacter
- userLevel = int(loadGameCode2)
- #print (userLevel)
- userXP = int(loadGameCode3)
- userStatPoints = int(loadGameCode4)
- userGold = int(loadGameCode5)
- userSTR = int(loadGameCode6)
- userDEF = int(loadGameCode7)
- userSPD = int(loadGameCode8)
- else:
- loadGameCode1 = 1
- loadGameCode2 = 1
- loadGameCode3 = 0
- loadGameCode4 = 0
- loadGameCode5 = 0
- loadGameCode6 = 1
- loadGameCode7 = 1
- loadGameCode8 = 1
- def saving():
- global userLevel
- global userCharacter
- global userXP
- global userStatPoints
- global userGold
- userCharacterCode = CharacterList.index(userCharacter)+1
- print (userLevel)
- #####CHARACTER FORMATING
- ############################################################THIS IS NOT GIVING ENOUGH NUMBES
- if userCharacterCode < 10:
- textCC = str(userCharacterCode)
- userCharacterCode=("00",textCC)
- else:
- textCC = str(userCharacterCode)
- userCharacterCode=("0",textCC)
- #####USER LEVEL
- if userLevel < 10:
- textCC = str(userLevel)
- userLevelCode=("00",textCC)
- elif userLevel < 100:
- textCC = str(userLevel)
- userLevelCode=("0",textCC)
- else:
- textCC = str(userLevel)
- userLevelCode=(textCC)
- #####USERXP
- if userXP < 10:
- textCC = str(math.floor(userXP))
- userXPCode=("00",textCC)
- elif userXP < 100:
- textCC = str(math.floor(userXP))
- userLevelCode=("0",textCC)
- else:
- textCC = str(math.floor(userXP))
- userXPCode=(textCC)
- #####STAT POINTS
- if userStatPoints < 10:
- textCC = str(userStatPoints)
- userStatPointsCode=("00",textCC)
- elif userStatPoints < 100:
- textCC = str(userStatPoints)
- userStatPointsCode=("0",textCC)
- else:
- textCC = str(userStatPoints)
- userStatPointsCode=(textCC)
- #####GOLD
- if userGold < 10:
- textCC = str(math.floor(userGold))
- userGoldCode=("00",textCC)
- elif userGold < 100:
- textCC = str(math.floor(userGold))
- userGoldCode=("0",textCC)
- else:
- textCC = str(math.floor(userGold))
- userGoldCode=(textCC)
- #####STR
- if userSTR < 10:
- textCC = str(math.floor(userSTR))
- userSTRCode=("00",textCC)
- elif userSTR < 100:
- textCC = str(math.floor(userSTR))
- userSTRCode=("0",textCC)
- else:
- textCC = str(math.floor(userSTR))
- userSTRCode=(textCC)
- #####DEF
- if userDEF < 10:
- textCC = str(math.floor(userDEF))
- userDEFCode=("00",textCC)
- elif userGold < 100:
- textCC = str(math.floor(userDEF))
- userDEFCode=("0",textCC)
- else:
- textCC = str(math.floor(userDEF))
- userDEFCode=(textCC)
- #####SPD
- if userSPD < 10:
- textCC = str(math.floor(userSPD))
- userSPDCode=("00",textCC)
- elif userGold < 100:
- textCC = str(math.floor(userSPD))
- userSPDCode=("0",textCC)
- else:
- textCC = str(math.floor(userSPD))
- userSPDCode=(textCC)
- printCode1 = userCharacterCode,userLevelCode,userXPCode,userStatPointsCode,userGoldCode,userSTRCode,userDEFCode,userSPDCode
- printCode = str(printCode1).replace('(', '').replace(')', '').replace(",", '').replace(" ", '').replace(".", '').replace("-", '')
- print("Save Code:",(printCode).replace("'", ''))
- def get_digit(number, n):
- return number // 10**n % 10
- def Charge(BEA,user):
- global tempX
- global SPD1
- global SPD2
- tempX = BEA
- if tempX >= BaseElementAmmo:
- print("Can't charge Chi. Increasing Speed.")
- if user == 1:
- SPD1 *= chargeSPDGain
- if user == 2:
- SPD2 *= chargeSPDGain
- else:
- tempX+=chargeGain
- print("Charges")
- if user == 1:
- SPD1 *= chargeSPDGain
- if user == 2:
- SPD2 *= chargeSPDGain
- def defense(BEA,user):
- global defends
- global defends1
- global defends2
- global tempX
- tempX = BEA
- defendsuccess = random.randint(1,defenseRate)
- if defendsuccess != 1:
- if user == 1:
- defends1=True
- if user == 2:
- defends2=True
- print("Defends")
- if defendsuccess == 1:
- print("Defense unsuccessful")
- def Attack1(BEA,user):
- global attackSuccess
- global tempX
- tempX = BEA
- if tempX < attack1Cost:
- print("Tries to attack but not enough chi")
- else:
- if user == 1:
- print(C1,"attacks")
- A1 = (STR1*(random.randint(varienceLow,varienceHigh)/100)*((SPD1+SPDAttackBonus)/100))*attackBonus
- D2 = (DEF2*(random.randint(varienceLow,varienceHigh)/100))*((SPD2+SPDAttackBonus)/100)
- if A1 > D2:
- attackSuccess=True
- else:
- print(C1,"misses the attack")
- if user == 2:
- print(C2,"attacks")
- A2 = ((STR2*(random.randint(varienceLow,varienceHigh)/100))*((SPD1+SPDAttackBonus)/100))*attackBonus
- D1 = (DEF1*(random.randint(varienceLow,varienceHigh)/100))*((SPD2+SPDAttackBonus)/100)
- if A2 > D1:
- attackSuccess=True
- else:
- print(C2,"misses the attack")
- tempX -= attack1Cost
- def Attack2(BEA,user):
- global attackSuccess
- global tempX
- tempX = BEA
- if tempX < attack2Cost:
- print("Tries to attack but not enough chi")
- else:
- if user == 1:
- print(C1,"performs a cool attack")
- A1 = (((STR1*(random.randint(varienceLow,varienceHigh)/100))*((SPD1+SPDAttackBonus)/100))*attack2Mod)*attackBonus
- D2 = (DEF2*(random.randint(varienceLow,varienceHigh)/100))*(((SPD2+SPDAttackBonus)/100))
- if A1 > D2:
- attackSuccess=True
- else:
- print(C1,"misses the attack")
- if user == 2:
- print(C2,"performs a cool attack")
- A2 = ((STR2*(random.randint(varienceLow,varienceHigh)/100)*((SPD1+SPDAttackBonus)/100))*attack2Mod)*attackBonus
- D1 = (DEF1*(random.randint(varienceLow,varienceHigh)/100)*((SPD2+SPDAttackBonus)/100))
- if A2 > D1:
- attackSuccess=True
- else:
- print(C2,"misses the attack")
- tempX -= attack2Cost
- def Attack3(BEA,user,EBEA):
- global attackSuccess
- global attack3Success
- global tempX
- global extraKnockback
- global tempEnemyChi
- global BEA1
- global BEA2
- tempEnemyChi = EBEA
- tempX = BEA
- if tempX < attack3Cost:
- print("Tries to attack but not enough chi")
- else:
- if user == 1:
- if C1 in fireBenders: ###################FIRE BENDER SPECIAL ABILITYYYYY
- A1 = (((STR1*(random.randint(varienceLow,varienceHigh)/100))*((SPD1+SPDAttackBonus)/100))/(attack2Mod*(random.randint(varienceLow100,varienceHigh)/100)))*attackBonus
- D2 = (DEF2*(random.randint(varienceLow,varienceHigh)/100))*(((SPD2+SPDAttackBonus)/100))*(random.randint(varienceLow,varienceHigh)/100)
- if A1 > D2:
- print(C1,"performs a special fire attack")
- attackSuccess=True
- attack3Success=True
- if (tempEnemyChi-1) < 0:######################################WORKING HEREEEEEEE working here
- tempEnemyChi=0
- BEA2 = tempEnemyChi
- print("Removes Enemy Chi")
- else:
- tempEnemyChi-=1
- BEA2 = tempEnemyChi
- print("Removes Enemy Chi")
- else:
- print(C1,"misses the special fire attack")
- # WATER BENDER SPECIAL ABILITY!!!
- elif C1 in waterBenders: # WATER BENDER SPECIAL ABILITY!!!
- if C1 == "Amon" or C1== "Yakone":#############AMON AND YAKONE SPECIAL ABILITY
- A1 = (((STR1*(random.randint(varienceLow,varienceHigh)/100))*((SPD1+SPDAttackBonus)/100))/(attack2Mod*(random.randint(varienceLow100,varienceHigh)/100)))*attackBonus
- D2 = (DEF2*(random.randint(varienceLow,varienceHigh)/100))*(((SPD2+SPDAttackBonus)/100))*(random.randint(varienceLow,varienceHigh)/100)
- if A1 > D2:
- print(C1,"performs a special water attack")
- attackSuccess=True
- if (tempEnemyChi-1) < -1:######################################WORKING HEREEEEEEE working here
- tempEnemyChi=-1
- BEA2 = tempEnemyChi
- print("Removes Enemy Chi")
- else:
- tempEnemyChi-=2
- BEA2 = tempEnemyChi
- print("Removes Enemy Chi")
- else:
- print(C1,"misses the special water attack")
- ##### EXCEPTIONS / BASIC ATTACK3 SPECIAL
- else:
- A1 = (((STR1*(random.randint(varienceLow,varienceHigh)/100))*((SPD1+SPDAttackBonus)/100))/(attack2Mod*(random.randint(varienceLow100,varienceHigh)/100)))*attackBonus
- D2 = (DEF2*(random.randint(varienceLow,varienceHigh)/100))*(((SPD2+SPDAttackBonus)/100))*(random.randint(varienceLow,varienceHigh)/100)
- if A1 > D2:
- print(C1,"performs a special water attack")
- attackSuccess=True
- if (tempEnemyChi-1) < 0:######################################WORKING HEREEEEEEE working here
- tempEnemyChi=0
- BEA1 = tempEnemyChi
- print("Removes Enemy Chi")
- else:
- tempEnemyChi-=1
- BEA2 = tempEnemyChi
- print("Removes Enemy Chi")
- else:
- print(C1,"misses the special water attack")
- else:
- A1 = (((STR1*(random.randint(varienceLow,varienceHigh)/100)))*((SPD1+SPDAttackBonus)/100)*attack2Mod)*attackBonus
- D2 = (DEF2*(random.randint(varienceLow,varienceHigh)/100))*(((SPD2+SPDAttackBonus)/100))
- if A1 > D2:
- print(C1,"performs a special attack")
- attackSuccess=True
- attack3Success=True
- else:
- print(C1,"misses the special attack")
- if user == 2:
- if C2 in fireBenders: #### FIRE BENDER SPECIAL ABILITY
- A2 = (((STR2*(random.randint(varienceLow,varienceHigh)/100))*((SPD2+SPDAttackBonus)/100))/(attack2Mod*(random.randint(varienceLow100,varienceHigh)/100)))*attackBonus
- D1 = (DEF1*(random.randint(varienceLow,varienceHigh)/100))*(((SPD1+SPDAttackBonus)/100))*(random.randint(varienceLow,varienceHigh)/100)
- if A2 > D1:
- print(C2,"performs a special fire attack")
- attackSuccess=True
- attack3Success=True
- if (tempEnemyChi-1) < 0:######################################WORKING HEREEEEEEE working here
- tempEnemyChi=0
- BEA1 = tempEnemyChi
- print("Removes Enemy Chi")
- else:
- tempEnemyChi-=1
- BEA1 = tempEnemyChi
- print("Removes Enemy Chi")
- else:
- print(C2,"misses the special fire attack")
- elif C2 in waterBenders: ## IF PLAYER 2 IS FIRE BENDER, LOWER CHANCE OF HITTING - TAKES AWAY 1 ENEMY CHI
- if C2 == "Amon" or C2== "Yakone":
- A2 = (((STR2*(random.randint(varienceLow,varienceHigh)/100))*((SPD2+SPDAttackBonus)/100))/(attack2Mod*(random.randint(varienceLow100,varienceHigh)/100)))*attackBonus
- D1 = (DEF1*(random.randint(varienceLow,varienceHigh)/100))*(((SPD1+SPDAttackBonus)/100))*(random.randint(varienceLow,varienceHigh)/100)
- if A2 > D1:
- print(C2,"performs a special water attack")
- attackSuccess=True
- if (tempEnemyChi-1) < -1:######################################WORKING HEREEEEEEE working here
- tempEnemyChi=-1
- BEA1 = tempEnemyChi
- print("Removes Enemy Chi")
- else:
- tempEnemyChi-=2
- BEA1 = tempEnemyChi
- print("Removes Enemy Chi")
- else:
- print(C2,"misses the special water attack")
- else:
- A2 = (((STR2*(random.randint(varienceLow,varienceHigh)/100))*((SPD2+SPDAttackBonus)/100))/(attack2Mod*(random.randint(varienceLow100,varienceHigh)/100)))*attackBonus
- D1 = (DEF1*(random.randint(varienceLow,varienceHigh)/100))*(((SPD1+SPDAttackBonus)/100))*(random.randint(varienceLow,varienceHigh)/100)
- if A2 > D1:
- print(C2,"performs a special water attack")
- attackSuccess=True
- if (tempEnemyChi-1) < 0:######################################WORKING HEREEEEEEE working here
- tempEnemyChi=0
- BEA1 = tempEnemyChi
- print("Removes Enemy Chi")
- else:
- tempEnemyChi-=1
- BEA1 = tempEnemyChi
- print("Removes Enemy Chi")
- else:
- print(C2,"misses the special water attack")
- ##### EXCEPTIONS / BASIC ATTACK3 SPECIAL
- else:
- if user == 2:
- A2 = ((STR2*(random.randint(varienceLow,varienceHigh)/100)+((SPD2+SPDAttackBonus)/100))*attack2Mod)*attackBonus
- D1 = (DEF1*(random.randint(varienceLow,varienceHigh)/100)+((SPD1+SPDAttackBonus)/100))
- if A2 > D1:
- print(C2,"performs a special attack")
- attackSuccess=True
- attack3Success=True
- else:
- print(C2,"misses the special attack")
- tempX -= attack3Cost
- ####################################################IF 0 CHI ALWAYS CHARGE | IF MAX CHI DONT CHARGE
- #def CharacterTurn(BEAMain,user,EBEA):
- if Random == True:
- choice = random.randint(1,4)
- if choice == 1:
- action = "Attack"
- elif choice == 2:
- action = "Attack2"
- elif choice == 3:
- action = "Defend"
- elif choice == 4:
- action = "Charge"
- def CharacterTurn(BEAMain,user,EBEA):
- if Random == True:
- choice = random.randint(5,7)
- if choice == 1:
- action = "Attack"
- elif choice == 2:
- action = "Attack2"
- elif choice == 3:
- action = "Defend"
- elif choice == 4:
- action = "Charge"
- #### 11111111
- if choice == 5 or choice == 6 or choice == 7:
- if user == 1:
- uBEA = BEA1
- if uBEA>=attack3Cost:
- choice = random.randint(1,10)
- if choice == 1 or choice == 5 or choice == 6:
- action = "Attack"
- elif choice == 4 or choice == 3 or choice == 7:
- action = "Attack2"
- elif choice == 2 or choice == 9:
- action = "Defend"
- elif choice == 10 or choice == 8:
- action = "Attack3"
- elif uBEA>=attack2Cost:
- choice = random.randint(1,6)
- if choice == 1 or choice == 2:
- action = "Attack"
- elif choice == 4 or choice == 3:
- action = "Attack2"
- elif choice == 5:
- action = "Defend"
- elif choice == 6:
- action = "Charge"
- elif uBEA>=attack1Cost:
- choice = random.randint(1,6)
- if choice == 1 or choice == 4 :
- action = "Attack"
- elif choice == 2:
- action = "Defend"
- elif choice == 3 or choice == 5 or choice == 6:
- action = "Charge"
- else:
- choice = random.randint(1,5)
- if choice == 1 or choice == 2:
- action = "Defend"
- elif choice == 3 or choice == 4 or choice == 5:
- action = "Charge"
- #### 22222222222222
- if user == 2:
- uBEA = BEA2
- if uBEA>=attack3Cost:
- choice = random.randint(1,10)
- if choice == 1 or choice == 5 or choice == 6:
- action = "Attack"
- elif choice == 4 or choice == 3 or choice == 7:
- action = "Attack2"
- elif choice == 2 or choice == 9:
- action = "Defend"
- elif choice == 10 or choice == 8:
- action = "Attack3"
- elif uBEA>=attack2Cost:
- choice = random.randint(1,6)
- if choice == 1 or choice == 2:
- action = "Attack"
- elif choice == 4 or choice == 3:
- action = "Attack2"
- elif choice == 5:
- action = "Defend"
- elif choice == 6:
- action = "Charge"
- elif uBEA>=attack1Cost:
- choice = random.randint(1,6)
- if choice == 1 or choice == 4 :
- action = "Attack"
- elif choice == 2:
- action = "Defend"
- elif choice == 3 or choice == 5 or choice == 6:
- action = "Charge"
- else:
- choice = random.randint(1,5)
- if choice == 1 or choice == 2:
- action = "Defend"
- elif choice == 3 or choice == 4 or choice == 5:
- action = "Charge"
- else:
- print("---Move|Chi Cost---")
- print("Attack - ",attack1Cost,"\nAttack2 - ",attack2Cost,"\nAttack3 - ",attack3Cost,"\nDefend - ",(math.floor(100/defenseRate)),"% Success Rate\nCharge - Gain 1 Chi + Increase Speed")
- action = input("...")
- if action == "Attack":
- Attack1(BEAMain,user)
- elif action == "Attack2":
- Attack2(BEAMain,user,)
- elif action == "Attack3":
- Attack3(BEAMain,user,EBEA)
- elif action == "Defend":
- defense(BEAMain,user)
- elif action == "Charge":
- Charge(BEAMain,user)
- #Character 1
- global STR1
- global DEF1
- global SPD1
- C1=Characters[(Characters.index(CharacterChoice1))]
- Choice1=(Characters.index(CharacterChoice1))
- Knockout1=BaseKnockout
- BEA1=BaseElementAmmo
- Name1=Characters[(Characters.index(CharacterChoice1))]
- STR1=Characters[(Characters.index(CharacterChoice1)+1)]
- DEF1=Characters[(Characters.index(CharacterChoice1)+2)]
- SPD1=Characters[(Characters.index(CharacterChoice1)+3)]
- if gameMode == "Story":
- STR1=userSTR
- DEF1=userDEF
- SPD1=userSPD
- if gameMode != "Story":
- loadCharacter = "No"
- if loadCharacter != "Yes":
- C1=Characters[(Characters.index(CharacterChoice1))]
- Choice1=(Characters.index(CharacterChoice1))
- Knockout1=BaseKnockout
- BEA1=BaseElementAmmo
- Name1=Characters[(Characters.index(CharacterChoice1))]
- STR1=Characters[(Characters.index(CharacterChoice1)+1)]
- DEF1=Characters[(Characters.index(CharacterChoice1)+2)]
- SPD1=Characters[(Characters.index(CharacterChoice1)+3)]
- #Character 2
- global STR2
- global DEF2
- global SPD2
- C2=Characters[(Characters.index(CharacterChoice2))]
- Choice2=(Characters.index(CharacterChoice2))
- Knockout2=BaseKnockout
- BEA2=BaseElementAmmo
- Name2=Characters[(Characters.index(CharacterChoice2))]
- STR2=Characters[(Characters.index(CharacterChoice2)+1)]
- DEF2=Characters[(Characters.index(CharacterChoice2)+2)]
- SPD2=Characters[(Characters.index(CharacterChoice2)+3)]
- #
- ## IF BENDERS MODIFIERS###############################################
- if loadCharacter != "Yes":
- if C1 in fireBenders:
- STR1*=bendingMod
- if C2 in fireBenders:
- STR2*=bendingMod
- if C1 in waterBenders:
- BEA1+=waterBenderChiBonus
- if C2 in waterBenders:
- BEA2+=waterBenderChiBonus
- if C1 in airBenders:
- SPD1*=bendingMod
- if C2 in fireBenders:
- SPD2*=bendingMod
- if C1 in earthBenders:
- DEF1*=bendingMod
- if C2 in earthBenders:
- DEF2*=bendingMod
- if C1 in nonBenders:
- STR1*=nonBenderMod
- DEF1*=nonBenderMod
- if C2 in nonBenders:
- STR2*=nonBenderMod
- DEF2*=nonBenderMod
- #################################STORY
- #userCharacter = ""
- #userLevel = 0
- #userXP = 0
- #levelUpBase = 50
- #levelUpBonus = 15
- #enemyDifficultyLow = 75
- #enemyDifficultyHigh = 135
- #enemyDifficulty=random.randint(enemyDifficultyLow,enemyDifficultyHigh)
- #xpGoal = (levelUpBase + levelUpBonus) * (math.ceil(userLevel) * 0.25)
- #userStatPoints=0
- #userGold = 0
- ### CURRENTLY, Need to input stats too so they transfer over save files - and make it so all stats (knockback, str, spd etc) reset after fights. Do this by maybe adding a hold variable with the basic stats then at the beginning of the While loop make the stats the hold stats? then if stats are updated update the hold stats?
- tempSTR=STR1
- tempDEF=DEF1
- tempSPD=SPD1
- tempBEA=BEA1
- while gameMode == "Story":
- xpGoalAPP()
- Knockout1=BaseKnockout
- while userXP >= xpGoal:
- userXP-=xpGoal
- userLevel+=1
- if userLevel > 10:
- userStatPoints+=1
- userStatPoints+=1
- randomChoice = random.randint(1,3)
- if randomChoice==1:
- STR1+=1
- userSTR=STR1
- tempSTR=userSTR
- if randomChoice==2:
- DEF1+=1
- userDEF=DEF1
- tempDEF=userDEF
- if randomChoice==3:
- SPD1+=1
- userSPD=SPD1
- tempSPD=userSPD
- print("Level up!")
- while userXP <= -1:
- if userLevel > 10:
- userXP-=xpGoal ###############CHECK IF THIS WOULD MAKE IT SO IF YOU LEVEL DOWN ITS 190/200 OR SOMETHING
- userLevel-=1
- print("Level down!")
- else:
- userXP=0
- if userGold < 0:
- userGold = 0
- xpGoalAPP()
- print("Player 1 ~ Name: ",Name1,"| Level: ",userLevel,"| Gold: ",userGold,"| Current XP: ",userXP,"| XP Goal: ",xpGoal,"| Stat Upgrades: ",userStatPoints,"| Strength: ",STR1,"| Defense: ",DEF1,"| Speed: ",SPD1)
- userChoice=int(input("What do?\n1-Fight\n2-Stat Upgrade\n3-Save Code\n..."))
- ###########################FIGHT OPTION
- if userChoice==1:
- #########################CHOOSE ENEMY
- CharacterChoice2 = random.choice(CharacterList)#input("Character 2: ")
- while CharacterChoice1 == CharacterChoice2:
- CharacterChoice2 = random.choice(CharacterList)#input("Character 2: ")
- ##################################SET ENEMY STATS
- C2=Characters[(Characters.index(CharacterChoice2))]
- Choice2=(Characters.index(CharacterChoice2))
- Knockout2=BaseKnockout
- BEA2=BaseElementAmmo
- Name2=Characters[(Characters.index(CharacterChoice2))]
- STR2=Characters[(Characters.index(CharacterChoice2)+1)]
- DEF2=Characters[(Characters.index(CharacterChoice2)+2)]
- SPD2=Characters[(Characters.index(CharacterChoice2)+3)]
- #
- ## IF BENDERS MODIFIERS###############################################
- if C2 in fireBenders:
- STR2*=bendingMod
- if C2 in waterBenders:
- BEA2+=waterBenderChiBonus
- if C2 in fireBenders:
- SPD2*=bendingMod
- if C2 in earthBenders:
- DEF2*=bendingMod
- if C2 in nonBenders:
- STR2*=nonBenderMod
- DEF2*=nonBenderMod
- #enemyDifficulty()
- enemyDifficulty=random.randint(enemyDifficultyLow,enemyDifficultyHigh)
- STR2*=(enemyDifficulty/100)
- DEF2*=(enemyDifficulty/100)
- SPD2*=(enemyDifficulty/100)
- print("-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`")
- print("Player 1 ~ Name: ",Name1,"| Strength: ",STR1,"| Defense: ",DEF1,"| Speed: ",SPD1)
- print("Player 2 ~ Name: ",Name2,"| Strength: ",STR2,"| Defense: ",DEF2,"| Speed: ",SPD2)
- turns=0
- while Knockout1 > 0 and Knockout2 > 0:
- TSPD1 = SPD1*(random.randint(TSvarienceLow,TSvarienceHigh)/100)
- TSPD2 = SPD2*(random.randint(TSvarienceLow,TSvarienceHigh)/100)
- if TSPD1 > TSPD2:
- BattleOrder.insert(0,C1)
- elif TSPD2 > TSPD1:
- BattleOrder.insert(0,C2)
- else:
- r=random.randint(1,2)
- if r==1:
- BattleOrder.insert(0,C1)
- else:
- BattleOrder.insert(0,C2)
- #clear() #Clear console
- if len(BattleOrder)>MaxTurns:
- if BattleOrder[0] == BattleOrder[-1] and BattleOrder[0] == BattleOrder[(MaxTurns*-1)]:
- if BattleOrder[0] == C1:
- BattleOrder.pop(0)
- BattleOrder.insert(0,C2)
- else:
- BattleOrder.pop(0)
- BattleOrder.insert(0,C1)
- turns+=1
- attackSuccess=None
- attack3Success=None
- extraKnockback=0
- #print (attackSuccess , defends)
- #print("Order:",BattleOrder)
- print("Name: ",Name1,"| Chi: ",BEA1,"| Knockouts: ",Knockout1)
- print("Name: ",Name2,"| Chi: ",BEA2,"| Knockouts: ",Knockout2)
- first=BattleOrder[0]
- print(first+"'s Turn")
- ####################################################
- if BattleOrder[0] == C1:
- #GAME MODE CHOICES ################################################
- Random = False
- if defends1==True:
- defends1=None
- CharacterTurn(BEA1,1,BEA2) #### RANDOM CHOICE
- #print(action)
- BEA1 = tempX
- tempOrder = BattleOrder[0]
- BattleOrder.remove(tempOrder)
- BattleOrder.append(tempOrder)
- if attackSuccess==True and defends2 != True:
- Knockout2-=1
- if attack3Success==True:
- defends2=None
- Knockout2-=1
- defends2=None
- attackSuccess=None
- elif attackSuccess==True and defends2 == True:
- defends2=None
- attackSuccess=None
- print("Attack unsuccessful, target defended")
- else:
- #GAME MODE CHOICES ################################################
- Random = True
- if defends2==True:
- defends2=None
- CharacterTurn(BEA2,2,BEA1)#### RANDOM CHOICE
- #print(action)
- BEA2 = tempX
- tempOrder = BattleOrder[0]
- BattleOrder.remove(tempOrder)
- BattleOrder.append(tempOrder)
- if attackSuccess==True and defends1 != True:
- Knockout1-=1
- if attack3Success==True:
- defends1=None
- Knockout1-=1
- defends1=None
- attackSuccess=None
- elif attackSuccess==True and defends1 == True:
- defends1=None
- attackSuccess=None
- print("Attack unsuccessful, target defended")
- print("OVER")
- print(turns)
- STR1=tempSTR
- DED1=tempDEF
- SPD1=tempSPD
- BEA1=tempBEA
- if Knockout1 > Knockout2:
- print("Winner: ",C1," ~ ",Knockout1," left",)
- xpGain()
- userXP+=(gain*(random.randint(varienceLow,varienceHigh))/100)
- userGold+=(gain*(random.randint(varienceLow,varienceHigh))/100)
- else:
- print("Winner: ",C2," ~ ",Knockout2," left",)
- xpGain()
- if userLevel > 10:
- userXP-=(gain*(random.randint(varienceLow,varienceHigh))/100)
- userGold-=(gain*(random.randint(varienceLow,varienceHigh))/100)
- print("-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`")
- #################################STAT UPGRADE
- if userChoice==2:
- statCosts()
- print("Choose stat:\n1)STR\n2)DEF\n3)SPD")
- statChoice=int(input())
- if userStatPoints < 1:
- print ("Not enough points to upgrade")
- else:
- if statChoice==1:
- if userGold < strCost:
- print("Not enough(t?) gold.")
- else:
- userGold-=strCost
- userStatPoints-=1
- STR1+=1
- userSTR=STR1
- tempSTR=userSTR
- if statChoice==2:
- if userGold < defCost:
- print("Not enough(t?) gold.")
- else:
- userGold-=defCost
- userStatPoints-=1
- DEF1+=1
- userDEF=DEF1
- tempDEF=userDEF
- if statChoice==3:
- if userGold < spdCost:
- print("Not enough(t?) gold.")
- else:
- userGold-=spdCost
- userStatPoints-=1
- SPD1+=1
- userSPD=SPD1
- tempSPD=userSPD
- ###################################SAVING CODE
- if userChoice==3:
- saving()
- #BATTLE
- #if (SPD1*(random.randint(TSvarienceLow,TSvarienceHigh)/100)) > (SPD2*(random.randint(TSvarienceLow,TSvarienceHigh)/100)):
- #BattleOrder=[]
- #BattleOrder.append(C1)
- #BattleOrder.append(C2)
- #elif (SPD2*(random.randint(TSvarienceLow,TSvarienceHigh)/100)) > (SPD1*(random.randint(TSvarienceLow,TSvarienceHigh)/100)):
- #BattleOrder=[]
- #BattleOrder.append(C2)
- #BattleOrder.append(C1)
- #else:
- #r=random.randint(1,2)
- #if r==1:
- #BattleOrder=[]
- #BattleOrder.append(C1)
- #BattleOrder.append(C2)
- #else:
- #BattleOrder=[]
- #BattleOrder.append(C2)
- #BattleOrder.append(C1)
- while gameMode != "Story":
- print("Player 1 ~ Name: ",Name1,"| Strength: ",STR1,"| Defense: ",DEF1,"| Speed: ",SPD1)
- print("Player 2 ~ Name: ",Name2,"| Strength: ",STR2,"| Defense: ",DEF2,"| Speed: ",SPD2)
- turns=0
- while Knockout1 > 0 and Knockout2 > 0:
- TSPD1 = SPD1*(random.randint(TSvarienceLow,TSvarienceHigh)/100)
- TSPD2 = SPD2*(random.randint(TSvarienceLow,TSvarienceHigh)/100)
- if TSPD1 > TSPD2:
- BattleOrder.insert(0,C1)
- elif TSPD2 > TSPD1:
- BattleOrder.insert(0,C2)
- else:
- r=random.randint(1,2)
- if r==1:
- BattleOrder.insert(0,C1)
- else:
- BattleOrder.insert(0,C2)
- #clear() #Clear console
- if len(BattleOrder)>MaxTurns:
- if BattleOrder[0] == BattleOrder[-1] and BattleOrder[0] == BattleOrder[(MaxTurns*-1)]:
- if BattleOrder[0] == C1:
- BattleOrder.pop(0)
- BattleOrder.insert(0,C2)
- else:
- BattleOrder.pop(0)
- BattleOrder.insert(0,C1)
- turns+=1
- attackSuccess=None
- attack3Success=None
- extraKnockback=0
- #print (attackSuccess , defends)
- #print("Order:",BattleOrder)
- print("-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`")
- print("Name: ",Name1,"| Chi: ",BEA1,"| Knockouts: ",Knockout1)
- print("Name: ",Name2,"| Chi: ",BEA2,"| Knockouts: ",Knockout2)
- first=BattleOrder[0]
- print(first+"'s Turn")
- ####################################################
- if BattleOrder[0] == C1:
- #GAME MODE CHOICES ################################################
- if gameMode == "PvP":
- Random = False
- if gameMode == "PvC":
- Random = False
- if gameMode == "CvC":
- Random = True
- if defends1==True:
- defends1=None
- CharacterTurn(BEA1,1,BEA2) #### RANDOM CHOICE
- #print(action)
- BEA1 = tempX
- tempOrder = BattleOrder[0]
- BattleOrder.remove(tempOrder)
- BattleOrder.append(tempOrder)
- if attackSuccess==True and defends2 != True:
- Knockout2-=1
- if attack3Success==True:
- defends2=None
- Knockout2-=1
- defends2=None
- attackSuccess=None
- elif attackSuccess==True and defends2 == True:
- defends2=None
- attackSuccess=None
- print("Attack unsuccessful, target defended")
- else:
- #GAME MODE CHOICES ################################################
- if gameMode == "PvP":
- Random = False
- if gameMode == "PvC":
- Random = True
- if gameMode == "CvC":
- Random = True
- if defends2==True:
- defends2=None
- CharacterTurn(BEA2,2,BEA1)#### RANDOM CHOICE
- #print(action)
- BEA2 = tempX
- tempOrder = BattleOrder[0]
- BattleOrder.remove(tempOrder)
- BattleOrder.append(tempOrder)
- if attackSuccess==True and defends1 != True:
- Knockout1-=1
- if attack3Success==True:
- defends1=None
- Knockout1-=1
- defends1=None
- attackSuccess=None
- elif attackSuccess==True and defends1 == True:
- defends1=None
- attackSuccess=None
- print("Attack unsuccessful, target defended")
- print("OVER")
- print(turns)
- if Knockout1 > Knockout2:
- print("Winner: ",C1," ~ ",Knockout1," left",)
- else:
- print("Winner: ",C2," ~ ",Knockout2," left",)
- print("Player 1 ~ Name: ",Name1,"| Strength: ",STR1,"| Defense: ",DEF1,"| Speed: ",SPD1)
- print("Player 2 ~ Name: ",Name2,"| Strength: ",STR2,"| Defense: ",DEF2,"| Speed: ",SPD2)
- input()
- #DO:UNDER ATTACK - INCLUDE CALCULATIONS FOR STRENGTH AND STUFF TO MAKE THEM MATTER
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement