I am building a random class generator for Call of Duty classes. Hit 'generate', and it will generate a random class.
I am running into an issue when it comes to kill streaks. Essentially, if you get 3 kills in a row, you can use your selected kill streak. There are, however, multiple kill streaks you can earn at 3 kills, 4 kills, 5 kills, etc.
So, if I just build a list of all the kill streaks and use the random import, it is likely it will generate a few of the same valued streaks; which you cannot use in the game. They must be separate values.
How can I counter this? Thanks in advance! Here is the code I have thus far:
#this portion will generate the primary weapon
import random
primaryGun_list = ['AK-47', 'AN-94', 'AS VAL', 'CR-56 AMAX', 'FAL', 'FR 5.56', 'Grau 5.56', 'Kilo 141', 'M13', 'M4A1', 'Oden', 'FN SCAR 17', 'RAM-7', 'AUG', 'P90', 'MP5', 'Uzi', 'PP19 Bizon', 'MP7', 'Striker 45', 'Fennec', 'ISO', 'Model 680', 'R9-0', '725', 'Origin 12', 'VLK Rogue', 'JAK-12', 'PKM', 'SA87', 'M91', 'MG34', 'Holger-26', 'Bruen Mk9', 'FiNN LMG', 'Dragunov', 'HDR', 'AX-50', 'Rytec AMR', 'EBR', 'MK2 Carbine', 'Kar98k', 'Crossbow', 'SKS']
print("Primary Weapon:", random.choice(primaryGun_list))
#this portion will generate the secondary weapon
import random
secondaryGun_list = ['PILA', 'Strela-P', 'JOKR', 'RPG-7', 'X16', '1911', '.357', 'M19', '.50 GS', 'Renetti', 'Riot Shield', 'Combat Knife', 'Kali Sticks', 'Dual Kodachis']
print("Secondary Weapon:", random.choice(secondaryGun_list))
#this portion will generate 'Perk 1'
import random
perk1_list = ['Double Time', 'Kill Chain', 'Scavenger', 'E.O.D.', 'Cold-Blooded', 'Quick Fix']
print("Perk 1:", random.choice(perk1_list))
#this portion will generate 'Perk 2'
import random
perk2_list = ['Restock', 'Hardline', 'High Alert', 'Ghost', 'Pointman', 'Overkill']
print("Perk 2:", random.choice(perk2_list))
#this portion will generate 'Perk 3'
import random
perk3_list = ['Tune Up', 'Amped', 'Shrapnel', 'Battle Hardened', 'Spotter', 'Tracker']
print("Perk 3:", random.choice(perk3_list))
#this portion will generate the Lethal
import random
lethal_list = ['Claymore', 'Frag Grenade', 'Molotov Cocktail', 'C4', 'Semtex', 'Throwing Knife', 'Proximity Mine', 'Thermite', 'Flaming Throwing Knife', 'EHV Throwing Knife', 'Phlebotomist']
print("Lethal:", random.choice(lethal_list))
#this portion will generate the Tactical
import random
tactical_list = ['Flash Grenade', 'Stun Grenade', 'Smoke Grenade', 'Snapshot Grenade', 'Heartbeat Sensor', 'Stim', 'Decoy Grenade', 'Gas Grenade']
print("Tactical:", random.choice(tactical_list))
#this portion will generate the Field Upgrade(s)
import random
fieldUpgrade_list = ['Munitions Box', 'Recon Drone', 'Dead Silence', 'Stopping Rounds', 'Trophy System', 'Deployable Cover', 'Tactical Insertion', 'EMP Drone', 'Weapon Drop']
print("Field Upgrades:", random.sample(fieldUpgrade_list, 2))
#this portion will generate the 3 Killstreaks
#import random
#killstreak_list = ['
Aucun commentaire:
Enregistrer un commentaire