人生重生模拟器幼年版

This commit is contained in:
DC_DC 2023-07-07 17:51:01 +08:00
parent b1f02ba0a0
commit 4ffdea4581

View File

@ -2,6 +2,9 @@
#初始属性
#开始游戏后,随机生成性比我和出生点
#每年都会生成人生的经历(随机)
import random
import sys
import time
print('-------------------------------')
print('| |')
@ -43,4 +46,126 @@ while True:
#如果上述条件都未被触发,则玩家的输入都是正确的
print("属性输入完毕~")
print(f'颜值{face},体质{strong},智力{iq},家境{home}')
break
break
#随机生成角色性别
point = random.randint(1, 6) #生成随机整数
if point % 2 == 1:
gender = 'boy'
print('你是个男孩')
else:
gender = 'girl'
print('你是个女孩')
#设定角色的出生点
#家境加上随机数,决定出生点
point = random.randint(1, 3)
if home == 10:
#第一档
print("你出生在帝都,你的父母都是高官政要")
home += 1
iq += 1
face += 1
elif 7 <= home <= 9:
#第二档
if point == 1:
print("你出生在大城市,你的父母都是公务员")
face += 2
elif point == 2:
print("你出生在大城市,父母都是企业高管")
home += 2
else:
print("你出生在大城市,父母都是大学教授")
iq += 2
elif 4 <= home <= 6:
#第三档
if point == 1:
print("你出生在三线城市,你的父母都是医生")
strong += 1
elif point == 2:
print("你出生在小镇上,你的父母是教师")
iq += 1
else:
print("你出生在镇上,你的父母是个体户")
home += 1
else:
#第四档
if point == 1:
print("你出生在农村,父母是辛苦劳作的农民")
strong += 1
face -= 2
elif point == 2:
print("你出生在穷乡僻壤,你的父母是无业游民")
home -= 1
else:
print("你出生在镇上,你的父母感情不和")
strong -= 1
print(f"颜值:{face},体质:{strong},智力:{iq},家境:{home}")
#幼年阶段[1,10] 可塑性强
for age in range(1, 11):
info = f'你今年{age}岁。'
point = random.randint(1, 3)
#性别触发事件
if gender == 'girl' and home <= 3 and point == 1:
info += '你的家里人重男轻女,你被遗弃了'
print(info)
print('游戏结束!!!')
sys.exit(0)
#体质触发的事件
elif strong <6 and point < 3:
info += '你生了一场病'
if home >= 5:
info += '在父母的悉心照料下,你康复了'
strong -= 1
home -= 1
else:
info += '你的父母没精力管你,你的身体更加糟糕了'
strong -= 1
#颜值触发的事件
elif face <= 4 and age >= 7:
info += '你长得太丑了,别的小朋友都不喜欢你'
if iq > 5:
info += '你决定用学习武装自己'
iq += 1
else:
if gender == 'boy':
info += '你和别的小朋友打架'
strong += 1
iq -= 1
else:
info += '你经常被别的小朋友欺负'
strong -= 1
#智商触发的事件
elif iq < 5:
info += '你看起来傻傻的'
if home >= 8 and age >= 6:
info += '你的父母把你送到更好的学校学习'
iq += 1
elif 4 <= home <= 7:
if gender == 'boy':
info += '你的父母鼓励你多运动,争取成为运动员'
strong += 1
else:
info += '你的父母为此经常吵架'
if point == 1:
strong -= 1
elif point == 2:
iq -= 1
else:
pass
#健康成长事件
else:
info += '你健康成长'
if point == 1:
info += '看起来更结实了'
strong += 1
elif point == 2:
info += '你看起来更好看了'
face += 1
else:
pass
print(info)
print(f'颜值{face},体质{strong},智力{iq},家境{home}')
print('---------------------------------------------')
time.sleep(1)
#青年阶段[11,20] 求学
#幼年阶段[20,50] 平稳
#老年阶段50岁以上 颜值和体质显著退化