嘿嘿嘿,我回来了!!!!!!!!!!!!!!!!!

按照我的习惯……闲话少说,代码

import random
import time
monster = ['火柴鼠', '瞌睡熊', '板牙狸', '博学企鹅', 
           '绅士企鹅','漂浮龟', '贪玩虎', '蹦蹦蛙', 
           '聒噪鸦','弹簧蛇', '小火龙','旋转鳄鱼']
monster2 = ['火柴鼠', '瞌睡熊', '板牙狸', '博学企鹅', 
           '绅士企鹅','漂浮龟', '贪玩虎', '蹦蹦蛙', 
           '聒噪鸦','弹簧蛇', '小火龙','旋转鳄鱼']
energy = [10 ,11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21]
live=60
bag=[]
bag2=[]
cnt1=0
cnt2=0
bag2=1
start3=0
opponent=['追风少年','大灰狼','世界上最美丽的女子','sb才怪','33','5233','神觉吧','堵车堵的厉害的vvv','简单冰激淋大s']
a='''重大声明: 由于在参赛期间 (代码之星)怕别人抄袭,所以不让改编,现比赛完毕,可以改编
欢迎来到精灵大战,主页正在加载中.......'''

for b in a:
    print(b,flush = True,end = "")
    time.sleep(0.1)
print()
for i in range(101):
    print(f'\r[{i:3}%' + '==' * (i//10+1) + '>]', end='')
    time.sleep(0.05)
print()
c='''主页加载成功!
 一键三连, 求个赞 '''
for d in c:
    print(d,flush = True,end = "")
    time.sleep(0.1)
print('\x1bc')
while start3==0:
    print()
    e='''1开始游戏  2游戏剧情  3更新日志  4制作人'''
    for f in e:
        print(f,flush = True,end = "")
        time.sleep(0.1)
    start=int(input())
    if start==1:
        n='''你选择了1
游戏加载中....
重大声明: 由于在参赛期间 (代码之星)怕别人抄袭,所以不让改编,现比赛完毕,可以改编'''
        for o in n:
            print(o,flush = True,end = "")
            time.sleep(0.1)
            
        print()
        for i in range(101):
            print(f'\r[{i:3}%' + '==' * (i//10+1) + '>]', end='')
            time.sleep(0.05)
        print()
        p='''游戏加载成功
开始游戏'''
        for q in p:
            print(q,flush = True,end = "")
            time.sleep(0.1)
        print()
        time.sleep(1)
        print('\x1bc')
        r='''你现在没有精灵,但有60体力,作者先带你抓精灵'''
        for s in r:
            print(s,flush = True,end = "")
            time.sleep(0.1)
        t='''你在去往精灵山洞的路上,遇到3只精灵拦路,分别消耗体力:
12,4,7'''
        print()
        for u in t:
            print(u,flush = True,end = "")
            time.sleep(0.1)
        f='''你要扑捉他们吗 1要 2不要'''
        for g in f:
            print(g,flush = True,end = "")
            time.sleep(0.1)
        cash=int(input())
        if cash==1:
            h='''扑捉完成,现有37体力
原来他们是火柴鼠的弟弟和哥哥
他们若不经风,被你打死了'''
            for i in h:
                print(i,flush = True,end = "")
                time.sleep(0.1)
            time.sleep(1)
            print('\x1bc')
            live=37
            print()
            l='''你走啊走,看见一个能量100的急救包,你要拿起并使用吗 1要 2不要'''
            for m in l:
                print(m,flush = True,end = "")
                time.sleep(0.1)
            n=int(input())
            if n==1:
                o='''使用完毕,目前体力137'''
                for p in o:
                    
                    print(p,flush = True,end = "")
                    time.sleep(0.1)
                live=137
                time.sleep(1)
                print('\x1bc')
            q='''你继续前进,终于到了扑捉精灵山洞
规则:
电脑会自动扑捉3只,然后你可以自己挑选要不要扑捉'''
            for r in q:
                print(r,flush = True,end = "")
                time.sleep(0.1)
            print()
            print('3')
            time.sleep(1)
            print('2')
            time.sleep(1)
            print('1')
            time.sleep(1)
            print('扑捉精灵开始')
            cash2=0
            time.sleep(1)
            print('\x1bc')
            for _ in range(3):
                if live<=0:
                    a='''你没体力了,游戏结束'''
                    for d in a:
                        print(d,flush = True,end = "")
                        time.sleep(0.1)  
                    start3==1
                    time.sleep(1)
                    print('\x1bc')
                    break  
                m= random.choice(monster)
                print()
                a='''遇到精灵:'''
                for d in a:
                    print(d,flush = True,end = "")
                    time.sleep(0.1)
                print(m)
                i = monster.index(m)
                e = energy[i]
                f='''扑捉他需要耗费体力:'''
                for r in f:
                    print(r,flush = True,end = "")
                    time.sleep(0.1)
                print(e)
                w='''以自动抓扑'''
                for q in w:
                    print(q,flush = True,end = "")
                    time.sleep(0.1)
                live-=e
                bag.append(m)
                print()
                g='''扑捉完成,现有'''
                for q in g:
                    print(q,flush = True,end = "")
                    time.sleep(0.1)
                print(live)
                l='''体力'''
                for q in l:
                    print(q,flush = True,end = "")
                    time.sleep(0.1)
                print()
                time.sleep(1)
                print('\x1bc')
            print('你可以想抓不抓了')
            while cash2==0:
                if live>=10:
                    print()
                    q='''在要抓吗 1要 2不要'''
                    for r in q:
                        print(r,flush = True,end = "")
                        time.sleep(0.1)
                    cash3=int(input())
                    if cash3==2:
                        cash2==1
                        break
                    m= random.choice(monster)
                    print()
                    rt='''遇到精灵:'''
                    for rty in rt:
                        print(rty,flush = True,end = "")
                        time.sleep(0.1)
                    print(m)
                    print()
                    i = monster.index(m)
                    e = energy[i]
                    ji='''扑捉他需要耗费体力:'''
                    for jiu in ji:
                        print(jiu,flush = True,end = "")
                        time.sleep(0.1)
                    print(e)
                    print()
                    if live >= e:
                        re='''要抓吗 1要 2不要'''
                        for lop in re:
                            print(lop,flush = True,end = "")
                            time.sleep(0.1)
                        cash=int(input())
                        if cash == 1:
                            live-=e
                            bag.append(m)
                            print()
                            g='''扑捉完成,现有'''
                            for q in g:
                                print(q,flush = True,end = "")
                                time.sleep(0.1)
                            print(live)
                            l='''体力'''
                            for q in l:
                                print(q,flush = True,end = "")
                                time.sleep(0.1)
                            print()
                            time.sleep(1)
                            print('\x1bc')
                        else:
                            live-=2
                            g='''放弃抓扑,扣2体力,现有'''
                            for q in g:
                                print(q,flush = True,end = "")
                                time.sleep(0.1)
                            print(live)
                            l='''体力'''
                            for q in l:
                                print(q,flush = True,end = "")
                                time.sleep(0.1)
                            print()
                            time.sleep(1)
                            print('\x1bc')
                    else:
                        g='''体力不够,现有'''
                        for q in g:
                            print(q,flush = True,end = "")
                            time.sleep(0.1)
                        print(live)
                        l='''体力'''
                        for q in l:
                            print(q,flush = True,end = "")
                            time.sleep(0.1)
                        time.sleep(1)
                        print('\x1bc')
                else:
                    hjumk='''你剩下的体力不足以扑捉任何精灵'''
                    for q in hjumk:
                        print(q,flush = True,end = "")
                        time.sleep(0.1)
                    time.sleep(1)
                    print('\x1bc')
                    break  
            print()                     
            u='''扑捉完毕,以自动增加45体力值,即将开始游戏'''
            for v in u:
                print(v,flush = True,end = "")
                time.sleep(0.1)
            live+=45 
            print()
            w='''正在挑选对手.....'''
            for x in w:
                print(x,flush = True,end = "")
                time.sleep(0.1)  
            print()
            for i in range(101):
                print(f'\r[{i:3}%' + '==' * (i//10+1) + '>]', end='')
                time.sleep(0.03)
            print()
            y='''以挑选完选手:'''
            for z in y:
                print(z,flush = True,end = "")
                time.sleep(0.1)
            print(random.choice(opponent))
            print('3')
            time.sleep(1)
            print('2')
            time.sleep(1)
            print('1')
            time.sleep(1)
            
            print('\x1bc')
            y='''精灵大战开始:
以下是精灵与攻击力对照表,上为精灵,下为攻击力,两两对应'''
            for z in y:
                print(z,flush = True,end = "")
                time.sleep(0.1)
            print()
            print(monster)
            print(energy)
            print()
            print('你有精灵:')
            print(bag)
            print()
            time.sleep(10)
            while not live<=0 or bag2!=0:
                A=random.choice(monster)
                B= monster.index(A)
                C =int(energy[B]) 
                if live<=0:
                    y='''你没体力了,游戏结束'''
                    for z in y:
                        print(z,flush = True,end = "")
                        time.sleep(0.1)
                    time.sleep(1)
                    print('\x1bc')
                    break
                y='''对手出'''
                for z in y:
                    print(z,flush = True,end = "")
                    time.sleep(0.1)
                print(A)
                print()
                y='''攻击力'''
                for z in y:
                    print(z,flush = True,end = "")
                    time.sleep(0.1)
                print(C)
                print()
                y='''你出的精灵 填精灵名称'''
                for z in y:
                    print(z,flush = True,end = "")
                    time.sleep(0.1)
                D=input()
                if not D in bag :
                    y='''你没有这个精灵,游戏结束'''
                    for z in y:
                        print(z,flush = True,end = "")
                        time.sleep(0.1) 
                    cnt2+=1
                    time.sleep(1)
                    print('\x1bc')
                    break
                F= monster2.index(D)
                G = energy[F]
                if G>=C:
                    y='''你赢了,扣6体力'''
                    for z in y:
                        print(z,flush = True,end = "")
                        time.sleep(0.1)
                    cnt1+=1
                    live-=6
                    bag.remove(D)
                    print()
                    time.sleep(1)
                    print('\x1bc')
                    y='''现有精灵:'''
                    for z in y:
                        print(z,flush = True,end = "")
                        time.sleep(0.1)
                    bag2=int(len(bag))
                    print(bag)
                    if bag2 == 0:
                        break
                else:
                    cnt2+=1
                    y='''你输了,扣体力'''
                    for z in y:
                        print(z,flush = True,end = "")
                        time.sleep(0.1)
                    print()
                    time.sleep(1)
                    print('\x1bc')
                    y='''现有精灵:'''
                    for z in y:
                        print(z,flush = True,end = "")
                        time.sleep(0.1)
                    bag2=int(len(bag))
                    bag.remove(D)
                    print(bag)
                    live-=C
                    if bag2 == 0:
                        break
            G='''你赢了:'''            
            for H in G:
                print(H,flush = True,end = "")
                time.sleep(0.1)
            print(cnt1,'场')
            I='''你输了:'''            
            for J in I:
                print(J,flush = True,end = "")
                time.sleep(0.1)
            print(cnt2,'场')
            if cnt1 > cnt2:
                G='''总体来讲你赢了'''            
                for H in G:
                    print(H,flush = True,end = "")
                    time.sleep(0.1)
                time.sleep(1)
                print('\x1bc')
            elif cnt2 > cnt1:
                G='''总体来讲你输了'''            
                for H in G:
                    print(H,flush = True,end = "")
                    time.sleep(0.1)
                time.sleep(1)
                print('\x1bc')
            else:
                G='''总体来讲是平局'''            
                for H in G:
                    print(H,flush = True,end = "")
                    time.sleep(0.1)
                time.sleep(1)
                print('\x1bc')
                    
        else:
            j='''人家把你灭了,游戏结束'''
            for k in j:
                print(k,flush = True,end = "")
                time.sleep(0.1)
            time.sleep(1)
            print('\x1bc')
            break
    elif start==2:
        g='''游戏剧情:
旁白:一天,你在公园散步,忽然看到一个传送门
旁白:你怀着好奇心,走了进去
旁白:忽然金光一闪......
你:这是啥地方?
作者:我等了10天10夜,终于你来了
你:我是谁,我在那?
作者:你要不要和我打一场?
你:啥?
作者:精灵大战
你:咋整?
作者:开始游戏再告诉你
你:干嘛不告诉我?
旁白:然后你就被作者.....
重大声明: 由于在参赛期间 (代码之星)怕别人抄袭,所以不让改编,现比赛完毕,可以改编
(回车返回主页)'''
        for h in g:
            print(h,flush = True,end = "")
            time.sleep(0.1)        
        start2=input()
        start3=0
        time.sleep(1)
        print('\x1bc')
    elif start==3:
        j='''更新日志:
7/21精灵游戏开始编(精灵游戏未发布至公开社区)
7/22精灵游戏发布(至今无人点赞)
7/25精灵大战开始编写
(精灵游戏挺像精灵大战的)
7/25编完
7/26日优化了一些代码
7/28修复了一些bug
7/28改进了一些代码
11/3日升级至2.0.0,多了自动页面清理及进度条
11/3此作品参加第一届学而思代码之星挑战赛
重大声明: 由于在参赛期间 (代码之星)怕别人抄袭,所以不让改编,现比赛完毕,可以改编
(回车返回主页)'''
        for k in j:
            print(k,flush = True,end = "")
            time.sleep(0.1)
        start2=input()
        start3=0
        time.sleep(1)
        print('\x1bc')
    elif start==4:
        l='''制作人:
白龙马工作室
复仇流浪者编写
欢迎改编
可以盗版!!!!!
感谢 python 集团
感谢 小猴编程
感谢 学而思
'''
        for m in l:
            print(m,flush = True,end = "")
            time.sleep(0.1)
        start2=input()
        start3=0
        time.sleep(1)
        print('\x1bc')



好啦,这期就到此结束啦,拜拜

本站作者已申明原创,禁止转载!

文章内容属作者个人观点,不代表本站立场,如有侵权立删。

   口袋儿题库-青少儿编程自测题库