import random
# weapon material its weight and price
weapon_materials = ['gold', 'silver', 'iron', 'bronze', 'steel', 'obsidian']
weapon_materials_weight = {
'gold': 70,
'silver': 50,
'iron': 40,
'bronze': 30,
'steel': 50,
'obsidian': 20
}
weapon_materials_price = {
'gold': 1000,
'silver': 500,
'iron': 100,
'bronze': 50,
'obsidian': 10,
}
# weapon type, sharpness, weapon weight modifier and weapon type price
weapon_types = ['flail', 'longsword', 'shortsword', 'spear', 'warhamer', 'mace']
weapon_type_sharpness = {
'flail': 10,
'longsword': 50,
'shortsword': 50,
'spear': 100,
'warhamer': 10,
'mace': 20
}
weapon_type_weight_mod = {
'flail': 10,
'longsword': 5,
'shortsword': 3,
'spear': 3,
'warhamer': 20,
'mace': 15
}
weapon_type_price = {
'flail': 3,
'longsword': 7,
'shortsword': 4,
'spear': 1,
'warhamer': 1,
'mace': 5
}
# FUNCTIONS
def make_weapon(name):
name["name"] = name
name["type"] = random.choice(weapon_types)
name["material"] = random.choice(weapon_materials)
name["damage"] = weapon_materials_weight[name["material"]] * weapon_type_weight_mod[name["type"]] + weapon_type_sharpness[name["type"]]
name["weight"] = weapon_materials_weight[name["material"]] * weapon_type_weight_mod[name["type"]]
name["price"] = weapon_materials_weight[name["material"]] * weapon_type_weight_mod[name["type"]] * weapon_materials_price[name["material"]]
return name
def weapon_description(weapon):
print
print "The %s, a %s %s" % (weapon["name"], weapon["material"], weapon["type"])
print "=====STATS======"
print "damage - ", weapon["damage"]
print "weight - ", weapon["weight"], "|O"
print "price - ", weapon["price"], "G"
print
return True
# WEAPON GENERATOR CODE BELOW
print "============================="
print "= WEAPON GENERATOR ="
print "============================="
print
print "==================================================================================="
print "= Upon naming weapon this program will first create weapon from TYPE and MATERIAL ="
print "= Then it will calculate stats of weapon: DAMAGE , WEIGHT, PRICE ="
print "==================================================================================="
print
weapon_created = raw_input("name your weapon : ")
make_weapon(weapon_created)