Created
January 3, 2013 02:19
-
-
Save theneosloth/4440221 to your computer and use it in GitHub Desktop.
Tf2 random item generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
weapon_nouns = ["Bat","Bottle","Fists","Launcher","Knife","Axe","SMG","Kukri","Syringe Gun","Flame Thrower","Sticky Launcher","Huntsman","Saw","Shotgun","Revolver"] | |
weapon_adjectives = ["Pain","Direct","Charging","Power","Eternal","Black","Crusader's","Back","Steel","Volcano","Persian","Family","Disciplinary","Atomic"] | |
hat_nouns = ["Hat","Cap","Helmet","Beanie","Fedora","Beard","Earbuds","Bucket","Mask","Head","Gasmask"] | |
hat_adjectives = ["Fancy","Mining","Football","Towering","Expensive","Detective","Splendid","Last"] | |
class Item: | |
def __init__(self): | |
chance = random.random() | |
if (chance>0.80): | |
self.rarity = "Ultra Rare" | |
elif (chance>0.70): | |
self.rarity = "Rare" | |
elif (chance > 0.50): | |
self.rarity = "Scarce" | |
elif (chance > 0.10): | |
self.rarity = "Ordinary" | |
else: | |
self.rarity = "Extremely Common" | |
chance = random.random() | |
if (chance > 0.60): | |
self.type = "Hat" | |
self.adjective = random.choice(hat_adjectives) | |
self.noun = random.choice(hat_nouns) | |
else: | |
self.type = "Weapon" | |
self.adjective = random.choice(weapon_adjectives) | |
self.noun = random.choice(weapon_nouns) | |
self.name = self.rarity + " " + self.adjective + " " + self.noun | |
while True: | |
item = Item() | |
print item.name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how do you use?