Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random, sys
- # Get user input for seed, or generate a random one if not provided
- x = input("Enter Seed: ")
- if len(x) == 0:
- seed = random.randrange(1,999999999999999999)
- else:
- seed = int(x)
- # Set the random seed for consistent random number generation
- random.seed(int(seed), version=2)
- # Initialize modifiers for style and mentality
- styleMod = 0
- mentalityMod = 0
- # Possible moves for each action type
- DefMoves = ["Own Special/Ready","Ready","Retaliate","Seize a Position"]
- EvaMoves = ["Own Special/Test Balance","Bolster or Hinder","Commit"]
- AtkMoves = ["Own Special/Strike","Strike","Pressure","Smash"]
- # Function to modify the style modifier based on the chosen style
- def styleModifier():
- global styleMod
- if style == "Offense":
- styleMod = 2
- elif style == "Off-Support":
- styleMod = 1
- elif style == "Def-Support":
- styleMod = -1
- elif style == "Defense":
- styleMod = -2
- # Function to modify the mentality modifier based on the chosen mentality
- def mentalityModifier():
- global mentalityMod
- if mentality == "Positive Jing":
- mentalityMod = 2
- elif mentality == "Neutral Jing":
- mentalityMod = 0
- elif mentality == "Negative Jing":
- mentalityMod = -2
- # Main function to determine character's action and move
- def main(cName,cStyle,cMentality):
- global style, mentality, action, name
- global roll1, roll2
- # Get character information or user input
- if cName == None:
- name = input("Character Name:")
- else:
- name = cName
- # Get character style or user input
- if cStyle == None:
- style = input("Offense\nOff-Support\nDef-Support\nDefense\nFighting Style:")
- else:
- style = cStyle
- # Get character mentality or user input
- if cMentality == None:
- mentality = input("Positive Jing\nNeutral Jing\nNegative Jing\nMentality:")
- else:
- mentality = cMentality
- # Apply style and mentality modifiers
- styleModifier()
- mentalityModifier()
- # Calculate the roll for turn action
- roll1 = (random.randrange(1,20)+(styleMod+mentalityMod))
- action = None
- # Decide action based on the roll
- print("--------------------------------------------------------")
- print(name)
- print("if 2 the same, then second is own move if possible.")
- if roll1 <= 7:
- print("Def")
- print("1 - ",(random.choice(DefMoves)))
- print("2 - ",(random.choice(DefMoves)))
- print("3 - ",(random.choice(DefMoves)))
- print("4 - ",(random.choice(DefMoves)))
- action = "Def"
- elif roll1 >= 8 and roll1 <= 13:
- print("Eva")
- action = "Eva"
- print("1 - ",(random.choice(EvaMoves)))
- print("2 - ",(random.choice(EvaMoves)))
- print("3 - ",(random.choice(DefMoves)))
- print("4 - ",(random.choice(DefMoves)))
- elif roll1 >= 14:
- print("Atk")
- action = "Atk"
- print("1 - ",(random.choice(AtkMoves)))
- print("2 - ",(random.choice(AtkMoves)))
- print("3 - ",(random.choice(DefMoves)))
- print("4 - ",(random.choice(DefMoves)))
- # Lists to store characters' actions
- _eva = []
- _def = []
- _atk = []
- # Characters with their styles and mentalities
- template = ["Name","Style","Mentality"]
- # Earth
- Yuka = ["Yuka","Offense","Positive Jing"]
- Asuka = ["Asuka","Def-Support","Neutral Jing"]
- Renji = ["Renji","Off-Support","Negative Jing"]
- JinHo = ["Jin-Ho","Offense","Neutral Jing"]
- Kaito = ["Kaito","Def-Support","Positive Jing"]
- Mei = ["Mei","Def-Support","Neutral Jing"]
- # Fire
- Manami = ["Manami","Offense","Negative Jing"]
- # Water
- Aputi = ["Aputi","Off-Support","Positive Jing"]
- # Team composition for the match
- team1 = [Yuka,Asuka,Renji]
- team2 = [JinHo,Kaito,Mei]
- # Combine both teams for the match
- list = [team1[0],team1[1],team1[2],team2[0],team2[1],team2[2]]
- # Iterate through characters and determine their actions
- for i in range(6):
- currentC = None
- currentC = list[0]
- list.pop(0)
- mName = currentC[0]
- mStyle = currentC[1]
- mMentality = currentC[2]
- main(mName,mStyle,mMentality)
- # Append character's action to respective lists
- if action == "Def":
- _def.append(name)
- if action == "Atk":
- _atk.append(name)
- if action == "Eva":
- _eva.append(name)
- # Print the results of the match
- print("--------------------------------------------------------")
- print("--------------------------------------------------------")
- print("seed: ",seed)
- print("Def - ",_def)
- print("Atk - ",_atk)
- print("Eva - ",_eva)
Advertisement
Add Comment
Please, Sign In to add comment