def l1_value():
'''
购买1级石头
l1_value = 0.75 # 1颗1级石头消耗0.75金
l1_value_diamod = 8 # 1颗1级石头消耗8砖石
'''
gold = 1 * 0.75
diamod = 1 * 8
return gold + diamod * 0.05
def l3_value():
'''
1级合成3级
l1_to_l3 = 12 # 1颗1级石头变成1颗3级石头,需要消耗12颗1级石头
l1_to_l3_gold = 0.39 # 需要消耗0.39金
l1_to_l3_vit = 10 # 需要消耗10点体力
'''
l1 = l1_value() * 13
gold = 0.39
vit = 10
return l1 + gold + vit
def l4_value():
'''
3级合成4级
l3_to_l4 = 16 # 1颗3级石头变成1颗4级石头,需要消耗16个1级石头
l3_to_l4_gold = 0.897 # 需要消耗0.897金
l3_to_l4_vit = 10
l3_to_l4_rate = 0.4878 # 成功率0.4878,如果失败,金和16颗1级五行石被扣除,不消耗体力
'''
l3 = l3_value()
l1 = l1_value() * 16
gold = 0.897
vit = 10
rate = 0.4878
suc = (l3 + l1 + gold + vit) / rate
fai = (l1 + gold) / (1-rate)
return (suc + fai)/2
def l6_value():
'''
4级合成6级
l4_to_l6 = 12 # 1颗3级石头变成6级石头,概率100%,需要消耗12颗4级石头
l4_to_l6_gold = 19.75 # 需要消耗金 19.75
l4_to_l6_vit = 10
'''
l4 = l4_value() * 12
gold = 19.75
vit = 10
return l4 + gold + vit
print l1_value()
print l3_value()
print l4_value()
print l6_value()