Advertisement
The_Filip

Avatar Battles 260722

Jul 26th, 2022 (edited)
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 42.54 KB | None | 0 0
  1. import random,time,os,math
  2.  
  3.  
  4.  
  5.  
  6. ###########################################NEEED TO SAVE STR AND OTHER STATS, AND ALSO MAKE IT SO WHEN GOES INTO FIGHT, AFTER FIGHT THE STATS RESET.
  7.  
  8.  
  9.  
  10.  
  11.  
  12. clear = lambda: os.system('cls')
  13.  
  14. NumberOfKnockouts = 4#4
  15.  
  16. BaseKnockout = 4#4
  17. BaseElementAmmo = 5#3
  18. Random = True
  19. #GAMEMODES : PvP | PvC | CvC | Story(WIP)
  20. gameMode = "PvC"
  21.  
  22. varienceLow=70
  23. varienceLow100=100
  24. varienceHigh=140
  25.  
  26. TSvarienceLow=60
  27. TSvarienceHigh=150
  28.  
  29.  
  30. attackBonus = 1.15
  31.  
  32. attack2Mod = 1.3
  33. bendingMod = 1.13
  34. nonBenderMod = 1.05
  35. waterBenderChiBonus= math.floor(BaseElementAmmo/2)
  36. SPDAttackBonus = 50
  37.  
  38.  
  39. chargeGain = 1
  40. chargeSPDGain = 1.07
  41.  
  42.  
  43.  
  44.  
  45. defenseRate = 3 #1/x
  46.  
  47.  
  48.  
  49. attack1Cost = 1
  50. attack2Cost = 3
  51. attack3Cost = 4
  52.  
  53.  
  54. BattleOrder = []
  55. N=0
  56. tempX=None
  57. attackSuccess=None
  58. defends=None
  59. defends1=None
  60. defends2=None
  61. action = None
  62. defaultKnockback = 1
  63. extraKnockback = 0
  64.  
  65. MaxTurns = 3
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80. ##################################################### CHARACTERS
  81.  
  82. #xxx-Character|xxx-Level|xxx-XP|xxx-StatPoints|xxx-Gold|xxx-STR|xxx-DEF|xxx-SPD
  83. #014001000000000076053062 - Starter Bolin
  84.  
  85.  
  86. #NAME|STR|DEF|SPD
  87. CharacterList = ["Korra","Aang","Katara","Ghazan","Zuko","Toph","Mako","Yakone","Amon","Kioshi","Ozai","P'Li","Tenzin","Bolin","Kuvira","Roku"]
  88. 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,
  89. "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]
  90.  
  91.  
  92.  
  93. fireBenders=["Mako","Zuko","Ozai","P'Li","Roku"]
  94. waterBenders=["Korra","Katara","Yakone","Amon"]
  95. earthBenders=["Bolin","Toph","Kioshi","Kuvira","Ghazan"]
  96. airBenders=["Aang","Tenzin"]
  97. nonBenders=[]
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104. CharacterChoice1="Zuko"
  105. CharacterChoice2="Katara"
  106.  
  107.  
  108.  
  109. CharacterChoice1 = random.choice(CharacterList)#input("Character 1: ")
  110. CharacterChoice2 = random.choice(CharacterList)#input("Character 2: ")
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120. while CharacterChoice1 == CharacterChoice2:
  121. #CharacterChoice1 = random.choice(CharacterList)#input("Character 1: ")
  122.  
  123. CharacterChoice2 = random.choice(CharacterList)#input("Character 2: ")
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131. ##################################################### CHARACTERS END
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141. ###########################STORY MODE
  142.  
  143. global userLevel
  144. global userCharacter
  145. global levelUpBase
  146. global levelUpBonus
  147. userCharacter = ""
  148. userLevel = 0
  149. userXP = 0
  150. levelUpBase = 55
  151. levelUpBonus = 25
  152. enemyDifficultyLow = 75
  153. enemyDifficultyHigh = 135
  154.  
  155. global strCost
  156. global defCost
  157. global spdCost
  158.  
  159. def statCosts():
  160. global strCost
  161. global defCost
  162. global spdCost
  163. strCost=1*(userLevel/4.42)
  164. defCost=1*(userLevel/4.42)
  165. spdCost=1*(userLevel/4.42)
  166.  
  167.  
  168.  
  169. def enemyDifficulty():
  170. enemyDifficulty=random.randint(enemyDifficultyLow,enemyDifficultyHigh)
  171.  
  172.  
  173. baseXPGain=5
  174. def xpGain():
  175. global gain
  176. gain = baseXPGain*(enemyDifficulty/100)
  177.  
  178. def xpGoalAPP():
  179. global xpGoal
  180. xpGoal = (levelUpBase + levelUpBonus) * (math.ceil(userLevel) * 0.21)
  181.  
  182.  
  183.  
  184. userStatPoints=0
  185. userGold = 0
  186.  
  187. if gameMode == "Story":
  188.  
  189. print("Load Character?")
  190. ########loadCharacter = input()
  191. loadCharacter="Yes"
  192. if loadCharacter == "Yes":
  193. #xxx-Character|xxx-Level|xxx-XP|xxx-StatPoints|xxx-Gold|xxx-STR|xxx-DEF|xxx-SPD
  194. #TEST CODE - 004123456789111099088077
  195. #004123456789111099088077
  196. #014001000000000076053062
  197. #004123456788070100088077
  198. #004123456788070099088077
  199.  
  200.  
  201.  
  202.  
  203. #014002000000018076054063
  204.  
  205.  
  206. print("Code:")
  207. code=str(input())
  208. #code = "014001000000000076053062"
  209.  
  210.  
  211. if str(code[1:2]) == "0":########################## CHARACTER
  212. loadGameCode1 = int(code[2:3])
  213. else:
  214. loadGameCode1 = int(code[1:3])
  215.  
  216.  
  217.  
  218.  
  219. if str(code[3:4]) == "0":########################## Level
  220. if str(code[4:5]) == "0":
  221. loadGameCode2 = int(code[5:6])
  222. else:
  223. loadGameCode2 = int(code[4:6])
  224. else:
  225. loadGameCode2 = int(code[3:6])
  226.  
  227.  
  228.  
  229. if str(code[6:7]) == "0":########################## XP
  230. if str(code[7:8]) == "0":
  231. loadGameCode3 = int(code[8:9])
  232. else:
  233. loadGameCode3 = int(code[7:9])
  234. else:
  235. loadGameCode3 = int(code[6:9])
  236.  
  237.  
  238.  
  239. if str(code[9:10]) == "0":########################## Stat Points
  240. if str(code[10:11]) == "0":
  241. loadGameCode4 = int(code[11:12])
  242. else:
  243. loadGameCode4 = int(code[10:12])
  244. else:
  245. loadGameCode4 = int(code[9:12])
  246.  
  247.  
  248.  
  249. loadGameCode5 = int(code[12:15])
  250.  
  251.  
  252.  
  253. if str(code[15:16]) == "0":########################## STR
  254. if str(code[16:17]) == "0":
  255. loadGameCode6 = int(code[17:18])
  256. else:
  257. loadGameCode6 = int(code[16:18])
  258. else:
  259. loadGameCode6 = int(code[15:18])
  260.  
  261.  
  262.  
  263. if str(code[18:19]) == "0":########################## DEF
  264. if str(code[19:20]) == "0":
  265. loadGameCode7 = int(code[20:21])
  266. else:
  267. loadGameCode7 = int(code[19:21])
  268. else:
  269. loadGameCode7 = int(code[18:21])
  270.  
  271. if str(code[21:22]) == "0":########################## SPD
  272. if str(code[22:23]) == "0":
  273. loadGameCode8 = int(code[23:24])
  274. else:
  275. loadGameCode8 = int(code[22:24])
  276. else:
  277. loadGameCode8 = int(code[21:24])
  278.  
  279.  
  280.  
  281.  
  282.  
  283. userCharacter = str(CharacterList[(loadGameCode1)-1:(loadGameCode1)]).replace('[', '').replace(']', '').replace("'", '')
  284. CharacterChoice1=userCharacter
  285. userLevel = int(loadGameCode2)
  286. #print (userLevel)
  287. userXP = int(loadGameCode3)
  288. userStatPoints = int(loadGameCode4)
  289. userGold = int(loadGameCode5)
  290.  
  291. userSTR = int(loadGameCode6)
  292. userDEF = int(loadGameCode7)
  293. userSPD = int(loadGameCode8)
  294. else:
  295. loadGameCode1 = 1
  296. loadGameCode2 = 1
  297. loadGameCode3 = 0
  298. loadGameCode4 = 0
  299. loadGameCode5 = 0
  300.  
  301. loadGameCode6 = 1
  302. loadGameCode7 = 1
  303. loadGameCode8 = 1
  304.  
  305.  
  306.  
  307.  
  308.  
  309. def saving():
  310. global userLevel
  311. global userCharacter
  312. global userXP
  313. global userStatPoints
  314. global userGold
  315.  
  316. userCharacterCode = CharacterList.index(userCharacter)+1
  317. print (userLevel)
  318. #####CHARACTER FORMATING
  319. ############################################################THIS IS NOT GIVING ENOUGH NUMBES
  320. if userCharacterCode < 10:
  321. textCC = str(userCharacterCode)
  322. userCharacterCode=("00",textCC)
  323. else:
  324. textCC = str(userCharacterCode)
  325. userCharacterCode=("0",textCC)
  326. #####USER LEVEL
  327. if userLevel < 10:
  328. textCC = str(userLevel)
  329. userLevelCode=("00",textCC)
  330. elif userLevel < 100:
  331. textCC = str(userLevel)
  332. userLevelCode=("0",textCC)
  333. else:
  334. textCC = str(userLevel)
  335. userLevelCode=(textCC)
  336. #####USERXP
  337. if userXP < 10:
  338. textCC = str(math.floor(userXP))
  339. userXPCode=("00",textCC)
  340. elif userXP < 100:
  341. textCC = str(math.floor(userXP))
  342. userLevelCode=("0",textCC)
  343. else:
  344. textCC = str(math.floor(userXP))
  345. userXPCode=(textCC)
  346. #####STAT POINTS
  347. if userStatPoints < 10:
  348. textCC = str(userStatPoints)
  349. userStatPointsCode=("00",textCC)
  350. elif userStatPoints < 100:
  351. textCC = str(userStatPoints)
  352. userStatPointsCode=("0",textCC)
  353. else:
  354. textCC = str(userStatPoints)
  355. userStatPointsCode=(textCC)
  356. #####GOLD
  357. if userGold < 10:
  358. textCC = str(math.floor(userGold))
  359. userGoldCode=("00",textCC)
  360. elif userGold < 100:
  361. textCC = str(math.floor(userGold))
  362. userGoldCode=("0",textCC)
  363. else:
  364. textCC = str(math.floor(userGold))
  365. userGoldCode=(textCC)
  366. #####STR
  367. if userSTR < 10:
  368. textCC = str(math.floor(userSTR))
  369. userSTRCode=("00",textCC)
  370. elif userSTR < 100:
  371. textCC = str(math.floor(userSTR))
  372. userSTRCode=("0",textCC)
  373. else:
  374. textCC = str(math.floor(userSTR))
  375. userSTRCode=(textCC)
  376. #####DEF
  377. if userDEF < 10:
  378. textCC = str(math.floor(userDEF))
  379. userDEFCode=("00",textCC)
  380. elif userGold < 100:
  381. textCC = str(math.floor(userDEF))
  382. userDEFCode=("0",textCC)
  383. else:
  384. textCC = str(math.floor(userDEF))
  385. userDEFCode=(textCC)
  386. #####SPD
  387. if userSPD < 10:
  388. textCC = str(math.floor(userSPD))
  389. userSPDCode=("00",textCC)
  390. elif userGold < 100:
  391. textCC = str(math.floor(userSPD))
  392. userSPDCode=("0",textCC)
  393. else:
  394. textCC = str(math.floor(userSPD))
  395. userSPDCode=(textCC)
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405. printCode1 = userCharacterCode,userLevelCode,userXPCode,userStatPointsCode,userGoldCode,userSTRCode,userDEFCode,userSPDCode
  406. printCode = str(printCode1).replace('(', '').replace(')', '').replace(",", '').replace(" ", '').replace(".", '').replace("-", '')
  407. print("Save Code:",(printCode).replace("'", ''))
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431. def get_digit(number, n):
  432. return number // 10**n % 10
  433.  
  434.  
  435. def Charge(BEA,user):
  436. global tempX
  437. global SPD1
  438. global SPD2
  439. tempX = BEA
  440. if tempX >= BaseElementAmmo:
  441. print("Can't charge Chi. Increasing Speed.")
  442. if user == 1:
  443. SPD1 *= chargeSPDGain
  444. if user == 2:
  445. SPD2 *= chargeSPDGain
  446. else:
  447. tempX+=chargeGain
  448. print("Charges")
  449. if user == 1:
  450. SPD1 *= chargeSPDGain
  451. if user == 2:
  452. SPD2 *= chargeSPDGain
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460. def defense(BEA,user):
  461. global defends
  462. global defends1
  463. global defends2
  464. global tempX
  465. tempX = BEA
  466. defendsuccess = random.randint(1,defenseRate)
  467. if defendsuccess != 1:
  468. if user == 1:
  469. defends1=True
  470. if user == 2:
  471. defends2=True
  472. print("Defends")
  473. if defendsuccess == 1:
  474. print("Defense unsuccessful")
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483. def Attack1(BEA,user):
  484. global attackSuccess
  485. global tempX
  486.  
  487. tempX = BEA
  488. if tempX < attack1Cost:
  489. print("Tries to attack but not enough chi")
  490. else:
  491. if user == 1:
  492. print(C1,"attacks")
  493. A1 = (STR1*(random.randint(varienceLow,varienceHigh)/100)*((SPD1+SPDAttackBonus)/100))*attackBonus
  494. D2 = (DEF2*(random.randint(varienceLow,varienceHigh)/100))*((SPD2+SPDAttackBonus)/100)
  495. if A1 > D2:
  496. attackSuccess=True
  497. else:
  498. print(C1,"misses the attack")
  499.  
  500. if user == 2:
  501. print(C2,"attacks")
  502. A2 = ((STR2*(random.randint(varienceLow,varienceHigh)/100))*((SPD1+SPDAttackBonus)/100))*attackBonus
  503. D1 = (DEF1*(random.randint(varienceLow,varienceHigh)/100))*((SPD2+SPDAttackBonus)/100)
  504. if A2 > D1:
  505. attackSuccess=True
  506. else:
  507. print(C2,"misses the attack")
  508.  
  509.  
  510. tempX -= attack1Cost
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521. def Attack2(BEA,user):
  522. global attackSuccess
  523. global tempX
  524.  
  525. tempX = BEA
  526. if tempX < attack2Cost:
  527. print("Tries to attack but not enough chi")
  528. else:
  529. if user == 1:
  530. print(C1,"performs a cool attack")
  531. A1 = (((STR1*(random.randint(varienceLow,varienceHigh)/100))*((SPD1+SPDAttackBonus)/100))*attack2Mod)*attackBonus
  532. D2 = (DEF2*(random.randint(varienceLow,varienceHigh)/100))*(((SPD2+SPDAttackBonus)/100))
  533. if A1 > D2:
  534. attackSuccess=True
  535. else:
  536. print(C1,"misses the attack")
  537.  
  538. if user == 2:
  539. print(C2,"performs a cool attack")
  540. A2 = ((STR2*(random.randint(varienceLow,varienceHigh)/100)*((SPD1+SPDAttackBonus)/100))*attack2Mod)*attackBonus
  541. D1 = (DEF1*(random.randint(varienceLow,varienceHigh)/100)*((SPD2+SPDAttackBonus)/100))
  542. if A2 > D1:
  543. attackSuccess=True
  544. else:
  545. print(C2,"misses the attack")
  546.  
  547.  
  548. tempX -= attack2Cost
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557. def Attack3(BEA,user,EBEA):
  558. global attackSuccess
  559. global attack3Success
  560. global tempX
  561. global extraKnockback
  562. global tempEnemyChi
  563. global BEA1
  564. global BEA2
  565.  
  566. tempEnemyChi = EBEA
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576. tempX = BEA
  577. if tempX < attack3Cost:
  578. print("Tries to attack but not enough chi")
  579. else:
  580.  
  581.  
  582.  
  583.  
  584. if user == 1:
  585. if C1 in fireBenders: ###################FIRE BENDER SPECIAL ABILITYYYYY
  586. A1 = (((STR1*(random.randint(varienceLow,varienceHigh)/100))*((SPD1+SPDAttackBonus)/100))/(attack2Mod*(random.randint(varienceLow100,varienceHigh)/100)))*attackBonus
  587. D2 = (DEF2*(random.randint(varienceLow,varienceHigh)/100))*(((SPD2+SPDAttackBonus)/100))*(random.randint(varienceLow,varienceHigh)/100)
  588. if A1 > D2:
  589. print(C1,"performs a special fire attack")
  590. attackSuccess=True
  591. attack3Success=True
  592. if (tempEnemyChi-1) < 0:######################################WORKING HEREEEEEEE working here
  593. tempEnemyChi=0
  594. BEA2 = tempEnemyChi
  595. print("Removes Enemy Chi")
  596. else:
  597. tempEnemyChi-=1
  598. BEA2 = tempEnemyChi
  599. print("Removes Enemy Chi")
  600. else:
  601. print(C1,"misses the special fire attack")
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611. # WATER BENDER SPECIAL ABILITY!!!
  612.  
  613. elif C1 in waterBenders: # WATER BENDER SPECIAL ABILITY!!!
  614.  
  615.  
  616. if C1 == "Amon" or C1== "Yakone":#############AMON AND YAKONE SPECIAL ABILITY
  617. A1 = (((STR1*(random.randint(varienceLow,varienceHigh)/100))*((SPD1+SPDAttackBonus)/100))/(attack2Mod*(random.randint(varienceLow100,varienceHigh)/100)))*attackBonus
  618. D2 = (DEF2*(random.randint(varienceLow,varienceHigh)/100))*(((SPD2+SPDAttackBonus)/100))*(random.randint(varienceLow,varienceHigh)/100)
  619. if A1 > D2:
  620. print(C1,"performs a special water attack")
  621. attackSuccess=True
  622. if (tempEnemyChi-1) < -1:######################################WORKING HEREEEEEEE working here
  623. tempEnemyChi=-1
  624. BEA2 = tempEnemyChi
  625. print("Removes Enemy Chi")
  626. else:
  627. tempEnemyChi-=2
  628. BEA2 = tempEnemyChi
  629. print("Removes Enemy Chi")
  630. else:
  631. print(C1,"misses the special water attack")
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639. ##### EXCEPTIONS / BASIC ATTACK3 SPECIAL
  640.  
  641. else:
  642. A1 = (((STR1*(random.randint(varienceLow,varienceHigh)/100))*((SPD1+SPDAttackBonus)/100))/(attack2Mod*(random.randint(varienceLow100,varienceHigh)/100)))*attackBonus
  643. D2 = (DEF2*(random.randint(varienceLow,varienceHigh)/100))*(((SPD2+SPDAttackBonus)/100))*(random.randint(varienceLow,varienceHigh)/100)
  644. if A1 > D2:
  645. print(C1,"performs a special water attack")
  646. attackSuccess=True
  647. if (tempEnemyChi-1) < 0:######################################WORKING HEREEEEEEE working here
  648. tempEnemyChi=0
  649. BEA1 = tempEnemyChi
  650. print("Removes Enemy Chi")
  651. else:
  652. tempEnemyChi-=1
  653. BEA2 = tempEnemyChi
  654. print("Removes Enemy Chi")
  655. else:
  656. print(C1,"misses the special water attack")
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678. else:
  679. A1 = (((STR1*(random.randint(varienceLow,varienceHigh)/100)))*((SPD1+SPDAttackBonus)/100)*attack2Mod)*attackBonus
  680. D2 = (DEF2*(random.randint(varienceLow,varienceHigh)/100))*(((SPD2+SPDAttackBonus)/100))
  681. if A1 > D2:
  682. print(C1,"performs a special attack")
  683. attackSuccess=True
  684. attack3Success=True
  685. else:
  686. print(C1,"misses the special attack")
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696. if user == 2:
  697. if C2 in fireBenders: #### FIRE BENDER SPECIAL ABILITY
  698. A2 = (((STR2*(random.randint(varienceLow,varienceHigh)/100))*((SPD2+SPDAttackBonus)/100))/(attack2Mod*(random.randint(varienceLow100,varienceHigh)/100)))*attackBonus
  699. D1 = (DEF1*(random.randint(varienceLow,varienceHigh)/100))*(((SPD1+SPDAttackBonus)/100))*(random.randint(varienceLow,varienceHigh)/100)
  700. if A2 > D1:
  701. print(C2,"performs a special fire attack")
  702. attackSuccess=True
  703. attack3Success=True
  704. if (tempEnemyChi-1) < 0:######################################WORKING HEREEEEEEE working here
  705. tempEnemyChi=0
  706. BEA1 = tempEnemyChi
  707. print("Removes Enemy Chi")
  708. else:
  709. tempEnemyChi-=1
  710. BEA1 = tempEnemyChi
  711. print("Removes Enemy Chi")
  712. else:
  713. print(C2,"misses the special fire attack")
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720. elif C2 in waterBenders: ## IF PLAYER 2 IS FIRE BENDER, LOWER CHANCE OF HITTING - TAKES AWAY 1 ENEMY CHI
  721. if C2 == "Amon" or C2== "Yakone":
  722. A2 = (((STR2*(random.randint(varienceLow,varienceHigh)/100))*((SPD2+SPDAttackBonus)/100))/(attack2Mod*(random.randint(varienceLow100,varienceHigh)/100)))*attackBonus
  723. D1 = (DEF1*(random.randint(varienceLow,varienceHigh)/100))*(((SPD1+SPDAttackBonus)/100))*(random.randint(varienceLow,varienceHigh)/100)
  724. if A2 > D1:
  725. print(C2,"performs a special water attack")
  726. attackSuccess=True
  727. if (tempEnemyChi-1) < -1:######################################WORKING HEREEEEEEE working here
  728. tempEnemyChi=-1
  729. BEA1 = tempEnemyChi
  730. print("Removes Enemy Chi")
  731. else:
  732. tempEnemyChi-=2
  733. BEA1 = tempEnemyChi
  734. print("Removes Enemy Chi")
  735. else:
  736. print(C2,"misses the special water attack")
  737.  
  738.  
  739.  
  740. else:
  741.  
  742. A2 = (((STR2*(random.randint(varienceLow,varienceHigh)/100))*((SPD2+SPDAttackBonus)/100))/(attack2Mod*(random.randint(varienceLow100,varienceHigh)/100)))*attackBonus
  743. D1 = (DEF1*(random.randint(varienceLow,varienceHigh)/100))*(((SPD1+SPDAttackBonus)/100))*(random.randint(varienceLow,varienceHigh)/100)
  744. if A2 > D1:
  745. print(C2,"performs a special water attack")
  746. attackSuccess=True
  747. if (tempEnemyChi-1) < 0:######################################WORKING HEREEEEEEE working here
  748. tempEnemyChi=0
  749. BEA1 = tempEnemyChi
  750. print("Removes Enemy Chi")
  751. else:
  752. tempEnemyChi-=1
  753. BEA1 = tempEnemyChi
  754. print("Removes Enemy Chi")
  755. else:
  756. print(C2,"misses the special water attack")
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763. ##### EXCEPTIONS / BASIC ATTACK3 SPECIAL
  764. else:
  765. if user == 2:
  766. A2 = ((STR2*(random.randint(varienceLow,varienceHigh)/100)+((SPD2+SPDAttackBonus)/100))*attack2Mod)*attackBonus
  767. D1 = (DEF1*(random.randint(varienceLow,varienceHigh)/100)+((SPD1+SPDAttackBonus)/100))
  768. if A2 > D1:
  769. print(C2,"performs a special attack")
  770. attackSuccess=True
  771. attack3Success=True
  772.  
  773. else:
  774. print(C2,"misses the special attack")
  775.  
  776. tempX -= attack3Cost
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786. ####################################################IF 0 CHI ALWAYS CHARGE | IF MAX CHI DONT CHARGE
  787.  
  788.  
  789.  
  790.  
  791.  
  792. #def CharacterTurn(BEAMain,user,EBEA):
  793. if Random == True:
  794. choice = random.randint(1,4)
  795. if choice == 1:
  796. action = "Attack"
  797. elif choice == 2:
  798. action = "Attack2"
  799. elif choice == 3:
  800. action = "Defend"
  801. elif choice == 4:
  802. action = "Charge"
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810. def CharacterTurn(BEAMain,user,EBEA):
  811. if Random == True:
  812. choice = random.randint(5,7)
  813. if choice == 1:
  814. action = "Attack"
  815. elif choice == 2:
  816. action = "Attack2"
  817. elif choice == 3:
  818. action = "Defend"
  819. elif choice == 4:
  820. action = "Charge"
  821.  
  822. #### 11111111
  823. if choice == 5 or choice == 6 or choice == 7:
  824. if user == 1:
  825. uBEA = BEA1
  826.  
  827.  
  828.  
  829.  
  830. if uBEA>=attack3Cost:
  831. choice = random.randint(1,10)
  832. if choice == 1 or choice == 5 or choice == 6:
  833. action = "Attack"
  834. elif choice == 4 or choice == 3 or choice == 7:
  835. action = "Attack2"
  836. elif choice == 2 or choice == 9:
  837. action = "Defend"
  838. elif choice == 10 or choice == 8:
  839. action = "Attack3"
  840.  
  841.  
  842.  
  843.  
  844. elif uBEA>=attack2Cost:
  845. choice = random.randint(1,6)
  846. if choice == 1 or choice == 2:
  847. action = "Attack"
  848. elif choice == 4 or choice == 3:
  849. action = "Attack2"
  850. elif choice == 5:
  851. action = "Defend"
  852. elif choice == 6:
  853. action = "Charge"
  854.  
  855.  
  856.  
  857.  
  858. elif uBEA>=attack1Cost:
  859. choice = random.randint(1,6)
  860. if choice == 1 or choice == 4 :
  861. action = "Attack"
  862. elif choice == 2:
  863. action = "Defend"
  864. elif choice == 3 or choice == 5 or choice == 6:
  865. action = "Charge"
  866.  
  867.  
  868.  
  869.  
  870. else:
  871. choice = random.randint(1,5)
  872. if choice == 1 or choice == 2:
  873. action = "Defend"
  874. elif choice == 3 or choice == 4 or choice == 5:
  875. action = "Charge"
  876.  
  877.  
  878.  
  879.  
  880.  
  881. #### 22222222222222
  882. if user == 2:
  883. uBEA = BEA2
  884.  
  885. if uBEA>=attack3Cost:
  886. choice = random.randint(1,10)
  887. if choice == 1 or choice == 5 or choice == 6:
  888. action = "Attack"
  889. elif choice == 4 or choice == 3 or choice == 7:
  890. action = "Attack2"
  891. elif choice == 2 or choice == 9:
  892. action = "Defend"
  893. elif choice == 10 or choice == 8:
  894. action = "Attack3"
  895.  
  896.  
  897.  
  898.  
  899. elif uBEA>=attack2Cost:
  900. choice = random.randint(1,6)
  901. if choice == 1 or choice == 2:
  902. action = "Attack"
  903. elif choice == 4 or choice == 3:
  904. action = "Attack2"
  905. elif choice == 5:
  906. action = "Defend"
  907. elif choice == 6:
  908. action = "Charge"
  909.  
  910.  
  911.  
  912.  
  913. elif uBEA>=attack1Cost:
  914. choice = random.randint(1,6)
  915. if choice == 1 or choice == 4 :
  916. action = "Attack"
  917. elif choice == 2:
  918. action = "Defend"
  919. elif choice == 3 or choice == 5 or choice == 6:
  920. action = "Charge"
  921.  
  922.  
  923.  
  924. else:
  925. choice = random.randint(1,5)
  926. if choice == 1 or choice == 2:
  927. action = "Defend"
  928. elif choice == 3 or choice == 4 or choice == 5:
  929. action = "Charge"
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941. else:
  942. print("---Move|Chi Cost---")
  943. print("Attack - ",attack1Cost,"\nAttack2 - ",attack2Cost,"\nAttack3 - ",attack3Cost,"\nDefend - ",(math.floor(100/defenseRate)),"% Success Rate\nCharge - Gain 1 Chi + Increase Speed")
  944. action = input("...")
  945.  
  946. if action == "Attack":
  947. Attack1(BEAMain,user)
  948. elif action == "Attack2":
  949. Attack2(BEAMain,user,)
  950. elif action == "Attack3":
  951. Attack3(BEAMain,user,EBEA)
  952. elif action == "Defend":
  953. defense(BEAMain,user)
  954. elif action == "Charge":
  955. Charge(BEAMain,user)
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965. #Character 1
  966. global STR1
  967. global DEF1
  968. global SPD1
  969. C1=Characters[(Characters.index(CharacterChoice1))]
  970. Choice1=(Characters.index(CharacterChoice1))
  971. Knockout1=BaseKnockout
  972. BEA1=BaseElementAmmo
  973. Name1=Characters[(Characters.index(CharacterChoice1))]
  974. STR1=Characters[(Characters.index(CharacterChoice1)+1)]
  975. DEF1=Characters[(Characters.index(CharacterChoice1)+2)]
  976. SPD1=Characters[(Characters.index(CharacterChoice1)+3)]
  977. if gameMode == "Story":
  978. STR1=userSTR
  979. DEF1=userDEF
  980. SPD1=userSPD
  981.  
  982. if gameMode != "Story":
  983. loadCharacter = "No"
  984. if loadCharacter != "Yes":
  985.  
  986. C1=Characters[(Characters.index(CharacterChoice1))]
  987. Choice1=(Characters.index(CharacterChoice1))
  988. Knockout1=BaseKnockout
  989. BEA1=BaseElementAmmo
  990. Name1=Characters[(Characters.index(CharacterChoice1))]
  991. STR1=Characters[(Characters.index(CharacterChoice1)+1)]
  992. DEF1=Characters[(Characters.index(CharacterChoice1)+2)]
  993. SPD1=Characters[(Characters.index(CharacterChoice1)+3)]
  994.  
  995.  
  996. #Character 2
  997.  
  998. global STR2
  999. global DEF2
  1000. global SPD2
  1001. C2=Characters[(Characters.index(CharacterChoice2))]
  1002. Choice2=(Characters.index(CharacterChoice2))
  1003. Knockout2=BaseKnockout
  1004. BEA2=BaseElementAmmo
  1005. Name2=Characters[(Characters.index(CharacterChoice2))]
  1006. STR2=Characters[(Characters.index(CharacterChoice2)+1)]
  1007. DEF2=Characters[(Characters.index(CharacterChoice2)+2)]
  1008. SPD2=Characters[(Characters.index(CharacterChoice2)+3)]
  1009.  
  1010.  
  1011.  
  1012. #
  1013. ## IF BENDERS MODIFIERS###############################################
  1014. if loadCharacter != "Yes":
  1015. if C1 in fireBenders:
  1016. STR1*=bendingMod
  1017. if C2 in fireBenders:
  1018. STR2*=bendingMod
  1019.  
  1020. if C1 in waterBenders:
  1021. BEA1+=waterBenderChiBonus
  1022. if C2 in waterBenders:
  1023. BEA2+=waterBenderChiBonus
  1024.  
  1025. if C1 in airBenders:
  1026. SPD1*=bendingMod
  1027. if C2 in fireBenders:
  1028. SPD2*=bendingMod
  1029.  
  1030. if C1 in earthBenders:
  1031. DEF1*=bendingMod
  1032. if C2 in earthBenders:
  1033. DEF2*=bendingMod
  1034.  
  1035. if C1 in nonBenders:
  1036. STR1*=nonBenderMod
  1037. DEF1*=nonBenderMod
  1038.  
  1039. if C2 in nonBenders:
  1040. STR2*=nonBenderMod
  1041. DEF2*=nonBenderMod
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055. #################################STORY
  1056.  
  1057.  
  1058. #userCharacter = ""
  1059. #userLevel = 0
  1060. #userXP = 0
  1061. #levelUpBase = 50
  1062. #levelUpBonus = 15
  1063. #enemyDifficultyLow = 75
  1064. #enemyDifficultyHigh = 135
  1065. #enemyDifficulty=random.randint(enemyDifficultyLow,enemyDifficultyHigh)
  1066. #xpGoal = (levelUpBase + levelUpBonus) * (math.ceil(userLevel) * 0.25)
  1067. #userStatPoints=0
  1068. #userGold = 0
  1069.  
  1070.  
  1071.  
  1072. ### 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?
  1073. tempSTR=STR1
  1074. tempDEF=DEF1
  1075. tempSPD=SPD1
  1076. tempBEA=BEA1
  1077.  
  1078. while gameMode == "Story":
  1079. xpGoalAPP()
  1080. Knockout1=BaseKnockout
  1081. while userXP >= xpGoal:
  1082. userXP-=xpGoal
  1083. userLevel+=1
  1084. if userLevel > 10:
  1085. userStatPoints+=1
  1086. userStatPoints+=1
  1087. randomChoice = random.randint(1,3)
  1088. if randomChoice==1:
  1089. STR1+=1
  1090. userSTR=STR1
  1091. tempSTR=userSTR
  1092. if randomChoice==2:
  1093. DEF1+=1
  1094. userDEF=DEF1
  1095. tempDEF=userDEF
  1096. if randomChoice==3:
  1097. SPD1+=1
  1098. userSPD=SPD1
  1099. tempSPD=userSPD
  1100. print("Level up!")
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107. while userXP <= -1:
  1108.  
  1109.  
  1110.  
  1111. if userLevel > 10:
  1112. userXP-=xpGoal ###############CHECK IF THIS WOULD MAKE IT SO IF YOU LEVEL DOWN ITS 190/200 OR SOMETHING
  1113. userLevel-=1
  1114. print("Level down!")
  1115. else:
  1116. userXP=0
  1117. if userGold < 0:
  1118. userGold = 0
  1119. xpGoalAPP()
  1120. print("Player 1 ~ Name: ",Name1,"| Level: ",userLevel,"| Gold: ",userGold,"| Current XP: ",userXP,"| XP Goal: ",xpGoal,"| Stat Upgrades: ",userStatPoints,"| Strength: ",STR1,"| Defense: ",DEF1,"| Speed: ",SPD1)
  1121. userChoice=int(input("What do?\n1-Fight\n2-Stat Upgrade\n3-Save Code\n..."))
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131. ###########################FIGHT OPTION
  1132. if userChoice==1:
  1133.  
  1134. #########################CHOOSE ENEMY
  1135. CharacterChoice2 = random.choice(CharacterList)#input("Character 2: ")
  1136. while CharacterChoice1 == CharacterChoice2:
  1137. CharacterChoice2 = random.choice(CharacterList)#input("Character 2: ")
  1138.  
  1139.  
  1140. ##################################SET ENEMY STATS
  1141. C2=Characters[(Characters.index(CharacterChoice2))]
  1142. Choice2=(Characters.index(CharacterChoice2))
  1143. Knockout2=BaseKnockout
  1144. BEA2=BaseElementAmmo
  1145. Name2=Characters[(Characters.index(CharacterChoice2))]
  1146. STR2=Characters[(Characters.index(CharacterChoice2)+1)]
  1147. DEF2=Characters[(Characters.index(CharacterChoice2)+2)]
  1148. SPD2=Characters[(Characters.index(CharacterChoice2)+3)]
  1149.  
  1150.  
  1151.  
  1152. #
  1153. ## IF BENDERS MODIFIERS###############################################
  1154.  
  1155. if C2 in fireBenders:
  1156. STR2*=bendingMod
  1157. if C2 in waterBenders:
  1158. BEA2+=waterBenderChiBonus
  1159. if C2 in fireBenders:
  1160. SPD2*=bendingMod
  1161. if C2 in earthBenders:
  1162. DEF2*=bendingMod
  1163. if C2 in nonBenders:
  1164. STR2*=nonBenderMod
  1165. DEF2*=nonBenderMod
  1166. #enemyDifficulty()
  1167.  
  1168. enemyDifficulty=random.randint(enemyDifficultyLow,enemyDifficultyHigh)
  1169.  
  1170. STR2*=(enemyDifficulty/100)
  1171. DEF2*=(enemyDifficulty/100)
  1172. SPD2*=(enemyDifficulty/100)
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178. print("-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`")
  1179. print("Player 1 ~ Name: ",Name1,"| Strength: ",STR1,"| Defense: ",DEF1,"| Speed: ",SPD1)
  1180.  
  1181. print("Player 2 ~ Name: ",Name2,"| Strength: ",STR2,"| Defense: ",DEF2,"| Speed: ",SPD2)
  1182. turns=0
  1183. while Knockout1 > 0 and Knockout2 > 0:
  1184.  
  1185. TSPD1 = SPD1*(random.randint(TSvarienceLow,TSvarienceHigh)/100)
  1186. TSPD2 = SPD2*(random.randint(TSvarienceLow,TSvarienceHigh)/100)
  1187. if TSPD1 > TSPD2:
  1188. BattleOrder.insert(0,C1)
  1189. elif TSPD2 > TSPD1:
  1190. BattleOrder.insert(0,C2)
  1191. else:
  1192. r=random.randint(1,2)
  1193. if r==1:
  1194. BattleOrder.insert(0,C1)
  1195. else:
  1196. BattleOrder.insert(0,C2)
  1197.  
  1198.  
  1199. #clear() #Clear console
  1200.  
  1201.  
  1202.  
  1203.  
  1204. if len(BattleOrder)>MaxTurns:
  1205. if BattleOrder[0] == BattleOrder[-1] and BattleOrder[0] == BattleOrder[(MaxTurns*-1)]:
  1206. if BattleOrder[0] == C1:
  1207. BattleOrder.pop(0)
  1208. BattleOrder.insert(0,C2)
  1209. else:
  1210. BattleOrder.pop(0)
  1211. BattleOrder.insert(0,C1)
  1212.  
  1213. turns+=1
  1214. attackSuccess=None
  1215. attack3Success=None
  1216. extraKnockback=0
  1217. #print (attackSuccess , defends)
  1218. #print("Order:",BattleOrder)
  1219. print("Name: ",Name1,"| Chi: ",BEA1,"| Knockouts: ",Knockout1)
  1220. print("Name: ",Name2,"| Chi: ",BEA2,"| Knockouts: ",Knockout2)
  1221. first=BattleOrder[0]
  1222. print(first+"'s Turn")
  1223. ####################################################
  1224. if BattleOrder[0] == C1:
  1225.  
  1226.  
  1227.  
  1228. #GAME MODE CHOICES ################################################
  1229. Random = False
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235. if defends1==True:
  1236. defends1=None
  1237. CharacterTurn(BEA1,1,BEA2) #### RANDOM CHOICE
  1238. #print(action)
  1239. BEA1 = tempX
  1240.  
  1241. tempOrder = BattleOrder[0]
  1242. BattleOrder.remove(tempOrder)
  1243. BattleOrder.append(tempOrder)
  1244. if attackSuccess==True and defends2 != True:
  1245. Knockout2-=1
  1246. if attack3Success==True:
  1247. defends2=None
  1248. Knockout2-=1
  1249. defends2=None
  1250. attackSuccess=None
  1251. elif attackSuccess==True and defends2 == True:
  1252. defends2=None
  1253. attackSuccess=None
  1254. print("Attack unsuccessful, target defended")
  1255.  
  1256.  
  1257. else:
  1258.  
  1259. #GAME MODE CHOICES ################################################
  1260. Random = True
  1261.  
  1262.  
  1263.  
  1264.  
  1265. if defends2==True:
  1266. defends2=None
  1267. CharacterTurn(BEA2,2,BEA1)#### RANDOM CHOICE
  1268. #print(action)
  1269. BEA2 = tempX
  1270. tempOrder = BattleOrder[0]
  1271. BattleOrder.remove(tempOrder)
  1272. BattleOrder.append(tempOrder)
  1273. if attackSuccess==True and defends1 != True:
  1274. Knockout1-=1
  1275. if attack3Success==True:
  1276. defends1=None
  1277. Knockout1-=1
  1278. defends1=None
  1279. attackSuccess=None
  1280. elif attackSuccess==True and defends1 == True:
  1281. defends1=None
  1282. attackSuccess=None
  1283. print("Attack unsuccessful, target defended")
  1284.  
  1285. print("OVER")
  1286. print(turns)
  1287. STR1=tempSTR
  1288. DED1=tempDEF
  1289. SPD1=tempSPD
  1290. BEA1=tempBEA
  1291. if Knockout1 > Knockout2:
  1292. print("Winner: ",C1," ~ ",Knockout1," left",)
  1293. xpGain()
  1294. userXP+=(gain*(random.randint(varienceLow,varienceHigh))/100)
  1295. userGold+=(gain*(random.randint(varienceLow,varienceHigh))/100)
  1296. else:
  1297. print("Winner: ",C2," ~ ",Knockout2," left",)
  1298. xpGain()
  1299. if userLevel > 10:
  1300. userXP-=(gain*(random.randint(varienceLow,varienceHigh))/100)
  1301. userGold-=(gain*(random.randint(varienceLow,varienceHigh))/100)
  1302. print("-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`")
  1303.  
  1304.  
  1305.  
  1306. #################################STAT UPGRADE
  1307. if userChoice==2:
  1308. statCosts()
  1309. print("Choose stat:\n1)STR\n2)DEF\n3)SPD")
  1310. statChoice=int(input())
  1311. if userStatPoints < 1:
  1312. print ("Not enough points to upgrade")
  1313. else:
  1314. if statChoice==1:
  1315. if userGold < strCost:
  1316. print("Not enough(t?) gold.")
  1317. else:
  1318. userGold-=strCost
  1319. userStatPoints-=1
  1320. STR1+=1
  1321. userSTR=STR1
  1322. tempSTR=userSTR
  1323. if statChoice==2:
  1324. if userGold < defCost:
  1325. print("Not enough(t?) gold.")
  1326. else:
  1327. userGold-=defCost
  1328. userStatPoints-=1
  1329. DEF1+=1
  1330. userDEF=DEF1
  1331. tempDEF=userDEF
  1332. if statChoice==3:
  1333. if userGold < spdCost:
  1334. print("Not enough(t?) gold.")
  1335. else:
  1336. userGold-=spdCost
  1337. userStatPoints-=1
  1338. SPD1+=1
  1339. userSPD=SPD1
  1340. tempSPD=userSPD
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346. ###################################SAVING CODE
  1347. if userChoice==3:
  1348. saving()
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410. #BATTLE
  1411. #if (SPD1*(random.randint(TSvarienceLow,TSvarienceHigh)/100)) > (SPD2*(random.randint(TSvarienceLow,TSvarienceHigh)/100)):
  1412. #BattleOrder=[]
  1413. #BattleOrder.append(C1)
  1414. #BattleOrder.append(C2)
  1415. #elif (SPD2*(random.randint(TSvarienceLow,TSvarienceHigh)/100)) > (SPD1*(random.randint(TSvarienceLow,TSvarienceHigh)/100)):
  1416. #BattleOrder=[]
  1417. #BattleOrder.append(C2)
  1418. #BattleOrder.append(C1)
  1419. #else:
  1420. #r=random.randint(1,2)
  1421. #if r==1:
  1422. #BattleOrder=[]
  1423. #BattleOrder.append(C1)
  1424. #BattleOrder.append(C2)
  1425. #else:
  1426. #BattleOrder=[]
  1427. #BattleOrder.append(C2)
  1428. #BattleOrder.append(C1)
  1429.  
  1430.  
  1431.  
  1432. while gameMode != "Story":
  1433. print("Player 1 ~ Name: ",Name1,"| Strength: ",STR1,"| Defense: ",DEF1,"| Speed: ",SPD1)
  1434.  
  1435. print("Player 2 ~ Name: ",Name2,"| Strength: ",STR2,"| Defense: ",DEF2,"| Speed: ",SPD2)
  1436. turns=0
  1437. while Knockout1 > 0 and Knockout2 > 0:
  1438.  
  1439. TSPD1 = SPD1*(random.randint(TSvarienceLow,TSvarienceHigh)/100)
  1440. TSPD2 = SPD2*(random.randint(TSvarienceLow,TSvarienceHigh)/100)
  1441. if TSPD1 > TSPD2:
  1442. BattleOrder.insert(0,C1)
  1443. elif TSPD2 > TSPD1:
  1444. BattleOrder.insert(0,C2)
  1445. else:
  1446. r=random.randint(1,2)
  1447. if r==1:
  1448. BattleOrder.insert(0,C1)
  1449. else:
  1450. BattleOrder.insert(0,C2)
  1451.  
  1452.  
  1453. #clear() #Clear console
  1454.  
  1455.  
  1456.  
  1457.  
  1458. if len(BattleOrder)>MaxTurns:
  1459. if BattleOrder[0] == BattleOrder[-1] and BattleOrder[0] == BattleOrder[(MaxTurns*-1)]:
  1460. if BattleOrder[0] == C1:
  1461. BattleOrder.pop(0)
  1462. BattleOrder.insert(0,C2)
  1463. else:
  1464. BattleOrder.pop(0)
  1465. BattleOrder.insert(0,C1)
  1466.  
  1467. turns+=1
  1468. attackSuccess=None
  1469. attack3Success=None
  1470. extraKnockback=0
  1471. #print (attackSuccess , defends)
  1472. #print("Order:",BattleOrder)
  1473. print("-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`")
  1474. print("Name: ",Name1,"| Chi: ",BEA1,"| Knockouts: ",Knockout1)
  1475. print("Name: ",Name2,"| Chi: ",BEA2,"| Knockouts: ",Knockout2)
  1476. first=BattleOrder[0]
  1477. print(first+"'s Turn")
  1478. ####################################################
  1479. if BattleOrder[0] == C1:
  1480.  
  1481.  
  1482.  
  1483. #GAME MODE CHOICES ################################################
  1484. if gameMode == "PvP":
  1485. Random = False
  1486. if gameMode == "PvC":
  1487. Random = False
  1488. if gameMode == "CvC":
  1489. Random = True
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495. if defends1==True:
  1496. defends1=None
  1497. CharacterTurn(BEA1,1,BEA2) #### RANDOM CHOICE
  1498. #print(action)
  1499. BEA1 = tempX
  1500.  
  1501. tempOrder = BattleOrder[0]
  1502. BattleOrder.remove(tempOrder)
  1503. BattleOrder.append(tempOrder)
  1504. if attackSuccess==True and defends2 != True:
  1505. Knockout2-=1
  1506. if attack3Success==True:
  1507. defends2=None
  1508. Knockout2-=1
  1509. defends2=None
  1510. attackSuccess=None
  1511. elif attackSuccess==True and defends2 == True:
  1512. defends2=None
  1513. attackSuccess=None
  1514. print("Attack unsuccessful, target defended")
  1515.  
  1516.  
  1517. else:
  1518.  
  1519. #GAME MODE CHOICES ################################################
  1520. if gameMode == "PvP":
  1521. Random = False
  1522. if gameMode == "PvC":
  1523. Random = True
  1524. if gameMode == "CvC":
  1525. Random = True
  1526.  
  1527.  
  1528.  
  1529.  
  1530. if defends2==True:
  1531. defends2=None
  1532. CharacterTurn(BEA2,2,BEA1)#### RANDOM CHOICE
  1533. #print(action)
  1534. BEA2 = tempX
  1535. tempOrder = BattleOrder[0]
  1536. BattleOrder.remove(tempOrder)
  1537. BattleOrder.append(tempOrder)
  1538. if attackSuccess==True and defends1 != True:
  1539. Knockout1-=1
  1540. if attack3Success==True:
  1541. defends1=None
  1542. Knockout1-=1
  1543. defends1=None
  1544. attackSuccess=None
  1545. elif attackSuccess==True and defends1 == True:
  1546. defends1=None
  1547. attackSuccess=None
  1548. print("Attack unsuccessful, target defended")
  1549.  
  1550. print("OVER")
  1551. print(turns)
  1552. if Knockout1 > Knockout2:
  1553. print("Winner: ",C1," ~ ",Knockout1," left",)
  1554. else:
  1555. print("Winner: ",C2," ~ ",Knockout2," left",)
  1556.  
  1557. print("Player 1 ~ Name: ",Name1,"| Strength: ",STR1,"| Defense: ",DEF1,"| Speed: ",SPD1)
  1558.  
  1559. print("Player 2 ~ Name: ",Name2,"| Strength: ",STR2,"| Defense: ",DEF2,"| Speed: ",SPD2)
  1560.  
  1561.  
  1562. input()
  1563.  
  1564. #DO:UNDER ATTACK - INCLUDE CALCULATIONS FOR STRENGTH AND STUFF TO MAKE THEM MATTER
  1565.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement