Fighters
Random Fightersunknown
python
2 years ago
2.4 kB
3
Indexable
Never
import random A = ["Fighter 1"] B = ["Fighter 2"] Skills = ["Douge", "Smoke", "Rage"] Weapons = ["Dagger", "Sword", "Gun"] getWep1 = random.choice(Weapons) getWep2 = random.choice(Weapons) getSkill1 = random.choice(Skills) getSkill2 = random.choice(Skills) redomnLw = random.randint(0, len(Weapons)) for i in Weapons: if i is getWep1: x = Weapons.index(i) A += [Weapons[x]] if i is getWep2: x = Weapons.index(i) B += [Weapons[x]] for i in Skills: if i is getSkill1: x = Skills.index(i) A += [Skills[x]] if i is getSkill2: x = Skills.index(i) B += [Skills[x]] def Fight(): for i in Weapons: if i in A: for x in Skills: if x in A: print(A[0], ":", "Weapon:", i, "|", "Skill:", x) if i in B: for x in Skills: if x in B: print(B[0], ":", "Weapon:", i, "|", "Skill:", x) L = Weapons.index(A[1]) R = Weapons.index(B[1]) L1 = Skills.index(A[2]) R1 = Skills.index(B[2]) # WEAPON CHACKING if A[0] == A[L]: WinChanceA = random.randint(50, 100) print(A[0], "Just Pop that head off NICE!") elif A[1] == A[L]: WinChanceA = random.randint(50, 100) print() elif A[2] == A[L]: WinChanceA = random.randint(50, 100) print() if B[0] == B[R]: WinChanceB = random.randint(50, 100) print() elif B[1] == B[R]: WinChanceB = random.randint(50, 100) print() elif B[2] == B[R]: WinChanceB = random.randint(50, 100) print() # SKILL CHACKING if A[0] == A[L1]: WinChanceAS = random.randint(50, 100) print() elif A[1] == A[L1]: WinChanceAS = random.randint(50, 100) print() elif A[2] == A[L1]: WinChanceAS = random.randint(50, 100) print() if B[0] == B[R1]: WinChanceBS = random.randint(50, 100) print() elif B[1] == B[R1]: WinChanceBS = random.randint(50, 100) print() elif B[2] == B[R1]: WinChanceBS = random.randint(50, 100) print() try: Fight() print("Fighter 1:", WinChanceA + WinChanceAS, "Points", "|", "Fighter 2:", WinChanceB + WinChanceBS, "Points") k = WinChanceA + WinChanceAS t = WinChanceB + WinChanceBS if k > t: print(A[0], "Win!") elif k == t: print("TIE!") else: print(B[0], "Win!") except NameError as e: print(e)