用户:
星屿_星斗查看:0 回复:0 评论:0 创建时间:2024-07-14T18:53:48
【作品展示】

【作品介绍】
【作品源代码】
from random import randint
import time
day = 1
animal = ['编程猫','雷电猴','喵灵灵','星能猫']
sound = ['喵~','嗷呜~','呜呼~','喵呜~']
try:
pet = int(input('''
请选择一只宠物领养:
1.编程猫
2.雷电猴
3.喵灵灵
4.星能猫
'''))
if ((pet > 0) and (pet < 5)):
sounds = sound[pet - 1]
pet = animal[pet - 1]
eat = 250
find = 0
print ('成功领养',pet,sep='')
time.sleep(1)
print('Hi!我是',pet,',快来和我一起玩吧!',sep='')
time.sleep(1)
print('输入E喂食宠物\n输入F和宠物一起寻宝!')
time.sleep(1)
print('十五天后,',pet,'就能长大了!',sep='')
time.sleep(1)
print('喂食会增加50~150体力,寻宝会减少50~150体力\n当体力值大于500或小于0时,宠物会撑喵或饿喵')
time.sleep(1)
while True:
print('\n——·——\n')
print('第',day,'天')
do = input ('想要'+str(pet)+'做什么?')
print (sounds)
if 'E' in do:
eat += randint(50,150)
if eat > 500:
print('不行了,吃太撑啦!')
print('因喂食量太大,导致' ,pet,'吃撑了\n希望下次你能注意控制一下!',sep='')
break
else:
print('什么东西,真香!')
time.sleep(1)
elif 'F' in do:
print('你和',pet,'一起去寻宝了……',sep='')
time.sleep(1)
hp = randint(50,150)
eat -= hp
if eat <= 0:
print(pet,'突然晕倒了!',sep='')
help_ = randint(20,30)
time.sleep(1)
if find >= help_:
if randint(1,2) == 1:
print('幸运的是,',pet,'被好心人救治了!',sep='')
eat = 0
else:
print(pet,'因体力透支晕倒,送往了源码医院抢救……\n离开你之前,它还希望你不要难过。',sep='')
break
else:
print(pet,'因体力透支晕倒,送往了源码医院抢救……\n离开你之前,它还希望你不要难过。',sep='')
break
find_ = hp // 10
find += find_
print(pet,'和你找到了',find_,'颗源码晶石!',sep='')
time.sleep(1)
else:
print(pet,'听不懂你说了什么。',sep='')
eat -= randint(10,50)
time.sleep(1)
if eat <= 0:
print(pet, '突然晕倒了!', sep='')
time.sleep(1)
print(pet, '因体力透支晕倒,送往了源码医院抢救……\n离开你之前,它还希望你不要难过。', sep='')
break
print('体力值:',eat,'/500')
day += 1
if day == 16:
print('\n——·——\n')
print('你对',pet,'照顾得十分用心\n现在它长大啦!\n在此期间,你和',pet,'共找到了',find,'颗源码晶石',sep='')
time.sleep(1)
input('按下回车键结束游戏吧!\n')
break
if day != 16:
print('\n——·——\n')
print('你和', pet, '终究是要分别的\n在此期间,你和', pet, '共找到了',find, '颗源码晶石\n或许在源码世界的', pet, '一定也很想你吧!', sep='')
time.sleep(1)
input('按下回车键结束游戏吧!\n')
else:
print('领养失败!')
input('按下回车键结束游戏吧!\n')
except:
print('领养失败!')
input('按下回车键结束游戏吧!\n')
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn