python小黑屋

import random
import time

EVENT = [“衣衫褴褛的人”,“沼泽”,“xxx”]#事件列表
SOURCE = [“木材”,“肉”,“布”]#资源列表
SKILL = [“降龙十八掌”,“打狗棒法”,“九阴白骨爪”,“九阴真经”,“如来神掌”]#技能列表
def Init():#初始人物
person = {“HP”:100, “Hungry”:100, “IQ”:100,
“skill”:"",
“木材”:1, “fire”:0}#人的初始状态
time.sleep(2)#停止运行2秒
print(“人物生成中>>>>>>>>>>50%”)
time.sleep(2)
print(“人物生成中>>>>>>>>>>>>>>>>>>>>>>>>>>>>>90%”)
time.sleep(2)
print(“人物生成完毕>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>100%”)
showPerson(person)
return person
def showPerson(person):
print(“你现在的状态是:”,person)

def fire(person):
person[“木材”] = person[“木材”] - 1
person[“fire”] = 1
print(“火堆燃起来了!”)

return person

def PlayGame(person):
#point = random.randint(0,1)
point = 0
if point == 0:
time.sleep(1)
print(“你碰到了衣衫褴褛的人”)
choose = input(“是否要给他木材:”)
print(“你的火堆熊熊燃烧中”)
time.sleep(1)
if choose == “是”:
time.sleep(1)
person[“木材”] = person[“木材”] - 1
if 80 < random.randint(0,100):#如果点数大于80,就能随机选择技能
skill = random.choice(SKILL)#随机选择技能
SKILL.remove(skill)#将技能从技能列表删除
person[“skill”] = person[“skill”]+ skill
person[“HP”] = person[“HP”] + 100
else:
print(“你获得了衣衫褴褛的人的感激”)
return person

person = Init()
person = fire(person)
person = PlayGame(person)
showPerson(person)

上一篇:sqlserver 库服务器导数据


下一篇:Skill如何翻转一个list