猫史档案馆


未做完(导入easygui即可)

用户:陶夕晨陶夕晨查看:0 回复:1 评论:0 创建时间:2019-05-04T08:45:43


import easygui as tu
import sys
import time
import random as shu

ke = []
xun = ["训练师杰克","短裤小子","训练师迈克","训练师张鹏","训练师陈诚","训练师杰瑞"]
dui = ["鲤鱼王","角金鱼","杰尼龟","小火龙"]

ji = 1
g1 = ji * 2
g2 = ji * 4
g3 = ji * 3
g4 = ji * 5
g1s = ji * 1
g2s = ji * 3
g3s = ji * 4
g4s = ji * 5
zhi = 0
hp = ji * 10
hps = ji * 10
zhis = ji * 100
jieguo = 0
jineng = []
name = input("请输入用户名:")

tu.msgbox(name + ",欢迎游玩此游戏!")

msg = "请选择初始宝可梦:"

title = "请选择"

choices = ["小火龙","妙蛙种子","呱呱泡蛙","皮卡丘"]

choice = tu.choicebox(msg,title,choices)

if choice == '小火龙':

jineng = ["利爪"]

jineng1 = ["火花"]

if choice == '妙蛙种子':

jineng = ["撞击"]

jineng1 = ["藤蔓攻击"]

if choice == '呱呱泡蛙':

jineng = ["水花"]

jineng1 = ["撞击"]

if choice == '皮卡丘':

jineng = ["电击"]

jineng1 = ["撞击"]

tu.msgbox("你选择的是" + str(choice))

ke.append(choice)

while ji <= 50:

if zhi == zhis:

ji += 1

zhi -= zhis

if zhi > zhis:

ji += 1

zhi -= zhis

 

hp = ji * 10
hps = ji * 10
zhis = ji * 100

msg = "你希望干什么?"

title = "请选择"

choices = ["战斗","补给","查看","学习","退出"]

choice = tu.choicebox(msg,title,choices)

tu.msgbox("你选择的是" + str(choice))

if str(choice) == "查看":

tu.msgbox(str(ke) + "\n等级:" + str(ji) + "\n经验:" + str(zhi) + "|" + str(zhis) + "\nHP:" + str(hp))

if str(choice) == "退出":

msg = "你确定退出吗?"

title = "请选择"

choices = ["确定","取消"]

choice = tu.choicebox(msg,title,choices)

if str(choice) == "确定":

tu.msgbox("已退出!")

jieguo = 1

break

if str(choice) == "取消":

tu.msgbox("你已取消!")

if str(choice) == "战斗":

tu.msgbox("正在寻找合适的训练师...")

time.sleep(shu.randrange(2,3))

xuns = xun[shu.randrange(0,5)]

tu.msgbox("已找到" + str(xuns))

duis = dui[shu.randrange(0,3)]

tu.msgbox("对方派出了" + str(ji) + "级的" + str(duis))

msg = "你要派出谁?"

title = "请选择"

choices = [str(ke)]

choice = tu.choicebox(msg,title,choices)

tu.msgbox("你已派出" + str(choice))

tu.msgbox("战斗开始!")

while not hp > 0 or hps > 0:

tu.msgbox("我方攻击")

msg = "要使用什么?"

title = "请选择"

choices = [str(jineng),str(jineng1)]

choice = tu.choicebox(msg,title,choices)

if '小火龙' in str(ke):

if '利爪' in str(choice):

tu.msgbox("你使用了利爪")

gong = shu.randrange(g1,g2)

tu.msgbox("你对对方宝可梦造成了" + str(gong) + "点伤害")

hps -= gong

tu.msgbox("对方还剩" + str(hps) + "点血")

if '火花' in str(choice):

tu.msgbox("你使用了火花")

gong = shu.randrange(g3,g4)

tu.msgbox("你对对方宝可梦造成了" + str(gong) + "点伤害")

hps -= gong

tu.msgbox("对方还剩" + str(hps) + "点血")

if '妙蛙种子' in str(ke):

if '撞击' in str(choice):

tu.msgbox("你使用了撞击")

gong = shu.randrange(g1,g2)

tu.msgbox("你对对方宝可梦造成了" + str(gong) + "点伤害")

hps -= gong

tu.msgbox("对方还剩" + str(hps) + "点血")

if '藤蔓攻击' in str(choice):

tu.msgbox("你使用了藤蔓攻击")

gong = shu.randrange(g3,g4)

tu.msgbox("你对对方宝可梦造成了" + str(gong) + "点伤害")

hps -= gong

tu.msgbox("对方还剩" + str(hps) + "点血")


if '呱呱泡蛙' in str(ke):

if '撞击' in str(choice):

tu.msgbox("你使用了撞击")

gong = shu.randrange(g1,g2)

tu.msgbox("你对对方宝可梦造成了" + str(gong) + "点伤害")

hps -= gong

tu.msgbox("对方还剩" + str(hps) + "点血")

if '水花' in str(choice):

tu.msgbox("你使用了水花")

gong = shu.randrange(g3,g4)

tu.msgbox("你对对方宝可梦造成了" + str(gong) + "点伤害")

hps -= gong

tu.msgbox("对方还剩" + str(hps) + "点血")


if '皮卡丘' in str(ke):

if '撞击' in str(choice):

tu.msgbox("你使用了撞击")

gong = shu.randrange(g1,g2)

tu.msgbox("你对对方宝可梦造成了" + str(gong) + "点伤害")

hps -= gong

tu.msgbox("对方还剩" + str(hps) + "点血")

if '电击' in str(choice):

tu.msgbox("你使用了电击")

gong = shu.randrange(g3,g4)

tu.msgbox("你对对方宝可梦造成了" + str(gong) + "点伤害")

hps -= gong

tu.msgbox("对方还剩" + str(hps) + "点血")

tu.msgbox("对方攻击")

if '鲤鱼王' in str(duis):

dikeg = '拍击'

dikegs = '水花'

duiss = shu.randrange(dikeg,dikegs)

tu.msgbox("对方使用了" + str(duiss))

if '拍击' in str(duiss):

dj = shu.randrange(g1s,g2s)

hp -= dj

tu.msgbox("对手对你的宝可梦造成了" + str(dj) + "点伤害!")

if hp <= 0:

tu.msgbox("你输了!")

if hps <= 0:

tu.msgbox("你赢了!")

sheng = ji * 30

tu.msgbox("增长" + str(sheng) + "点经验值")

zhi += sheng


回复

上一页1 页 / 共 1下一页
量子jSNA量子jSNA

。。。

点赞0


评论