一个小游戏

#include<bits/stdc++.h>
using namespace std;
struct player {
    long long hp;
    long long ap;
    long long dp;
};
player peo,boss;
int money=0;
int inp=0;
int qkp=0;
int smz=0;
int main() {
    while(1) {
        system("color 0F");
        system("CLS");
        int healthy=0;
        int bh=0;
        int cnt=0;
        srand(time(NULL));
        cout<<"欢迎来到究极之战!!!"<<endl;
        cout<<"请选择你的英雄:1.圣光骑士 2.黑暗骑士 3.SCP-682 4.幻影刺客 5.大蛇 6.镇天帝 7.翼";
        if(money>=4&&inp==0)cout<<endl<<"是否花费4金币购买隐藏人物?是请输入8!";
        if(money>=6&&qkp==0&&inp==1)cout<<endl<<"是否花费6金币购买隐藏人物?是请输入9!";
        if(money>=10&&qkp==1&&inp==1&&smz==0)cout<<endl<<"是否花费10金币购买隐藏人物?是请输入0"<<endl;
        if(inp==1)cout<<endl<<"8.原初仙帝";
        if(qkp==1)cout<<"9.乾坤老祖";
        if(smz==1)cout<<"0.弑魔者魔眼";
        cout<<endl<<"请注意:翼会极其影响游戏体验!"<<endl;
        cout<<"你的金钱:"<<money<<endl;
        int x;
        int y;
        cin>>x;
        if(x==8&&inp==0&&money>=4) {
            money-=4;
            inp=1;
            cout<<"购买成功!"<<endl;
        }
        if(x==9&&qkp==0&&inp==1&&money>=6) {
            money-=6;
            qkp=1;
            cout<<"购买成功!"<<endl;
        }
        if(x==0&&qkp==1&&inp==1&&smz==0&&money>=10) {
            money-=10;
            smz=1;
            cout<<"购买成功!"<<endl;
        }
        if(x==8&&inp==1) {
            cout<<"您选择了原初仙帝"<<endl;
            peo.hp=1000000;
            peo.ap=10000;
            peo.dp=50000;
        } else if(x==9&&qkp==1&&inp==1) {
            cout<<"您选择了乾坤老祖"<<endl;
            peo.hp=500000;
            peo.ap=30000;
            peo.dp=60000;
        } else if(x==0&&qkp==1&&inp==1&&smz==1) {
            cout<<"您选择了弑魔者魔眼"<<endl;
            peo.hp=100000;
            peo.ap=0;
            peo.dp=100000;
        } else if(x==1) {
            cout<<"您选择了圣光骑士"<<endl;
            peo.hp=70000;
            peo.ap=1000;
            peo.dp=1500;
        } else if(x==2) {
            cout<<"您选择了黑暗骑士"<<endl;
            peo.hp=40000;
            peo.ap=2500;
            peo.dp=250;
        } else if(x==3) {
            cout<<"您选择了SCP-682"<<endl;
            peo.hp=60000;
            peo.ap=2000;
            peo.dp=1000;
        } else if(x==4) {
            cout<<"您选择了幻影刺客"<<endl;
            peo.hp=15000;
            peo.ap=10000;
            peo.dp=0;
        } else if(x==5) {
            cout<<"您选择了大蛇"<<endl;
            peo.hp=25000;
            peo.ap=3000;
            peo.dp=1000;
        } else if(x==6) {
            cout<<"您选择了镇天帝"<<endl;
            peo.hp=100000;
            peo.ap=5000;
            peo.dp=2500;
        } else if(x==7) {
            cout<<"您选择了翼"<<endl;
            peo.hp=40000;
            peo.ap=10000;
            peo.dp=5000;
        } else if(x==10) {
            cout<<"您选择了通天教主"<<endl;
            peo.hp=1000000;
            peo.ap=123456789;
            peo.dp=10000;
        } else if(x==1234567890) {
            cout<<"您使用了修改器"<<endl;
            cout<<"请输入血量:"<<endl;
            cin>>peo.hp;
            cout<<"请输入攻击:"<<endl;
            cin>>peo.ap;
            cout<<"请输入防御:"<<endl;
            cin>>peo.dp;
        }
        cout<<"请选择BOSS难度:1 easy  2 normal  3 hard 4 噩梦  5 地狱  6 无限"<<endl;
        cin>>y;
        if(y==1) {
            int zzz=rand()%100;
            if(zzz<50) {
                cout<<"BOSS:魔化大骑士"<<endl;
                boss.hp=100000;
                boss.ap=1500;
                boss.dp=1000;
            } else if(zzz>=50) {
                cout<<"BOSS:魔化大法师"<<endl;
                boss.hp=50000;
                boss.ap=5000;
                boss.dp=500;
            }
        } else if(y==2) {
            int zzz=rand()%100;
            if(zzz<50) {
                cout<<"BOSS:六翼黑暗堕落天使"<<endl;
                boss.hp=200000;
                boss.ap=2000;
                boss.dp=1500;

            } else if(zzz>=50) {
                cout<<"BOSS:地狱魔王"<<endl;
                boss.hp=400000;
                boss.ap=3000;
                boss.dp=500;
            }
        } else if(y==3) {
            int zzz=rand()%100;
            if(zzz<50) {
                cout<<"BOSS:十二翼黑暗堕落天使"<<endl;
                boss.hp=500000;
                boss.ap=3000;
                boss.dp=2500;

            } else if(zzz>=50) {
                cout<<"BOSS:地狱魔帝"<<endl;
                boss.hp=600000;
                boss.ap=4000;
                boss.dp=1500;
            }
        } else if(y==4) {
            int zzz=rand()%100;
            if(zzz<50) {
                cout<<"BOSS:暗黑路西法"<<endl;
                boss.hp=1000000;
                boss.ap=5000;
                boss.dp=3000;
            } else if(zzz>=50) {
                cout<<"BOSS:撒旦君主"<<endl;
                boss.hp=1500000;
                boss.ap=8000;
                boss.dp=2500;
            }
        } else if(y==5) {
            int zzz=rand()%100;
            if(zzz<50) {
                cout<<"BOSS:暗黑上帝"<<endl;
                boss.hp=5000000;
                boss.ap=10000;
                boss.dp=4000;
            } else if(zzz>=50) {
                cout<<"BOSS:血肉巨山"<<endl;
                boss.hp=100000000000;
                boss.ap=999;
                boss.dp=999;
            }

        } else if(y==6) {
            cout<<"BOSS:无天魔佛"<<endl;
            boss.hp=10000000;
            boss.ap=50000;
            boss.dp=50000;
        } else if(y==7) {
            cout<<"BOSS:黯天帝二代"<<endl;
            boss.hp=10000;
            boss.ap=500;
            boss.dp=500;
        } else {
            cout<<"BOSS:远古石人"<<endl;
            boss.hp=rand()%100*10000;
            boss.ap=rand()%100*1000;
            boss.dp=rand()%100*1000;
        }
        int a;
        while(1) {
            if(boss.hp<=0&&bh==0&&peo.hp<=0&&healthy==0) {
                cout<<"敌人:"<<boss.hp<<endl;
                cout<<"player:"<<peo.hp<<endl;
                cout<<"DRAW!"<<endl;
                system("pause");
                break;
            } else if(boss.hp<=0&&bh==0) {
                cout<<"敌人:"<<boss.hp<<endl;
                cout<<"player:"<<peo.hp<<endl;
                cout<<"You win"<<endl;
                system("pause");
                money+=y;
                break;
            } else if(peo.hp<=0&&healthy==0) {
                cout<<"敌人:"<<boss.hp<<endl;
                cout<<"player:"<<peo.hp<<endl;
                cout<<"You lose"<<endl;
                system("pause");
                break;
            } else if(peo.hp<=0&&healthy>=1) {
                cout<<"复活!!!"<<endl;
                peo.hp=50000;
                healthy--;
            }
            cout<<"敌人:"<<boss.hp<<endl;
            cout<<"player:"<<peo.hp<<endl;
            cout<<"生命:"<<healthy<<endl;
            cout<<"请选择攻击方式:1.普攻 2.牵制 3.全力";
            if(x==8)cout<<"4.自残!";
            if(x==1&&cnt==0)cout<<" 4大招:圣光救赎";
            if(x==4&&cnt==0)cout<<" 4大招:幻影斩杀";
            if(x==2&&cnt==0)cout<<" 4大招:暗黑破坏";
            if(x==3&&cnt==0)cout<<" 4大招:复活甲!";
            if(x==5&&cnt==0)cout<<" 4大招:阳光普照";
            if(x==6&&cnt==0)cout<<" 4必杀:独镇天地";
            if(x==8&&cnt==0&&peo.hp<=10000)cout<<"5必杀:重开天地!";
            if(x==9&&cnt==0)cout<<" 4必杀:逆转乾坤";
            if(x==10&&cnt==0)cout<<" 4.摆下诛仙剑阵"<<" 5.去取六魂幡";
            cout<<endl;
            cin>>a;
            if(a==1) {
                int s=rand()%6;
                int ss=rand()%4;
                boss.hp-=peo.ap*s-boss.dp*ss;
                cout<<"你造成了"<< peo.ap*s-boss.dp*ss<<"伤害"<<endl;
                if(x==5) {
                    boss.hp-=peo.ap*s-boss.dp*ss;
                    cout<<"你造成了"<< peo.ap*s-boss.dp*ss<<"伤害"<<endl;
                }
                if(x==7) {
                    int hhh=rand()%1000;
                    for(int i=0; i<hhh; i++) {
                        int qqq=rand()%15;
                        boss.hp-=abs(peo.ap*s*qqq);
                        cout<<"真.雷火球之术"<<endl;
                        cout<<"你造成了"<< abs(peo.ap*s*qqq)<<"伤害"<<endl;
                    }
                }
                peo.hp-=boss.ap*s-peo.dp*ss;
                cout<<"BOSS造成了"<<boss.ap*s-peo.dp*ss<<"伤害"<<endl;
                if(x==0) {
                    boss.hp-=boss.ap*s-peo.dp*ss/2;
                    cout<<"你反弹造成了"<<boss.ap*s-peo.dp*ss/2<<"伤害"<<endl;
                }
            } else if(a==2) {
                int s=rand()%3;
                int ss=rand()%2;
                boss.hp-=peo.ap*s-boss.dp*ss;
                cout<<"你造成了"<< peo.ap*s-boss.dp*ss<<"伤害"<<endl;
                if(x==7) {
                    int hhh=rand()%1000;
                    for(int i=0; i<hhh; i++) {
                        int qqq=rand()%7;
                        boss.hp-=abs(peo.ap*s*qqq);
                        cout<<"截天七剑!"<<endl;
                        cout<<"你造成了"<< abs(peo.ap*s*qqq)<<"伤害"<<endl;
                    }
                }
                int ttt=rand()%1000;
                if(x==4||x==5)ttt-=100;
                if(ttt<500)cout<<"BOSS并没有对你造成伤害"<<endl;
                else {
                    peo.hp-=boss.ap*s-peo.dp*ss;
                    cout<<"BOSS对你造成了"<<boss.ap*s-peo.dp*ss<<"伤害"<<endl;
                    if(x==0) {
                        boss.hp-=boss.ap*s-peo.dp*ss/2;
                        cout<<"你反弹造成了"<<boss.ap*s-peo.dp*ss/2<<"伤害"<<endl;
                    }
                }
            } else if(a==3) {
                int p=rand()%10000;
                int b=rand()%10000;
                cout<<"开始比拼力量!"<<endl;
                if(p>b) {
                    cout<<"你的力量更大!"<<endl;
                    boss.hp-=peo.ap*10;
                    cout<<"你造成了"<<peo.ap*10<<"伤害"<<endl;
                    if(x==7) {
                        int hhh=rand()%1000;
                        for(int i=0; i<hhh; i++) {
                            boss.hp-=peo.ap*10;
                            cout<<"混元破灭击!"<<endl;
                            cout<<"你造成了"<<peo.ap*10<<"伤害"<<endl;
                        }
                    }
                    if(x==5) {
                        boss.hp-=peo.ap*10;
                        cout<<"你造成了"<<peo.ap*10<<"伤害"<<endl;
                    }
                } else {
                    cout<<"BOSS的力量更大!"<<endl;
                    peo.hp-=boss.ap*15*y;
                    cout<<"BOSS造成了"<<boss.ap*15*y<<"伤害"<<endl;
                    if(x==0) {
                        boss.hp-=boss.ap*15*y/2;
                        cout<<"你反弹造成了"<<boss.ap*15*y/2<<"伤害"<<endl;
                    }
                }
            } else if(a==4&&x==4&&cnt==0) {
                int yyy=rand()%peo.hp;
                cout<<"消耗"<<yyy<<"血量进行斩杀"<<endl;
                peo.hp-=yyy;
                boss.hp-=yyy*10-boss.dp;
                cout<<"敌人血量减少"<<yyy*10-boss.dp<<endl;
                cnt=3;
            } else if(a==4&&x==1&&cnt==0) {
                int yyy=rand()%4;
                cout<<"player血量回复:"<<peo.hp*yyy<<endl;
                peo.hp+=peo.hp*yyy;
                cout<<"BOSS血量减少"<<peo.ap*yyy*2-boss.dp<<endl;
                boss.hp-=peo.ap*yyy*2-boss.dp;
                cnt=10;
            } else if(a==4&&x==2&&cnt==0) {
                int yyy=rand()%10;
                boss.hp-=peo.ap*yyy*4-boss.dp;
                cout<<"BOSS血量减少"<<peo.ap*yyy*4-boss.dp<<endl;
                cnt=3;
            } else if(a==4&&x==3&&cnt==0) {
                healthy++;
                cout<<"player生命加一!"<<endl;
                cnt=99;
            } else if(a==4&&x==5&&cnt==0) {
                cout<<"大蛇:让一切归于无吧!"<<endl;
                int f1=rand()%1000;
                int f2=rand()%10000;
                int f3=rand()%100000;
                int f4=rand()%1000000;
                boss.hp-=f1*3-boss.dp;
                cout<<"BOSS血量减少"<<f1*3-boss.dp<<endl;
                boss.hp-=f1*3+f2*4-boss.dp;
                cout<<"BOSS血量减少"<<f1*3+f2*4-boss.dp<<endl;
                boss.hp-=f1*3+f2*4+f3*5-boss.dp;
                cout<<"BOSS血量减少"<<f1*3+f2*4+f3*5-boss.dp<<endl;
                boss.hp-=f1*3+f2*4+f3*5+f4*6-boss.dp;
                cout<<"BOSS血量减少"<<f1*3+f2*4+f3*5+f4*6-boss.dp<<endl;
                cnt=9;
            } else if(a==4&&x==6&&cnt==0) {
                peo.hp-=peo.hp*0.1;
                cout<<"消耗"<<peo.hp*0.1<<"血量运行禁术!!!"<<endl;
                if(peo.hp<30000) {
                    cout<<"血量太低了!运转时没有做够血量支撑!"<<endl;
                    cout<<"you lose"<<endl;
                    system("pause");
                    break;
                }
                int ppp=rand()%5;
                if(ppp==0) {
                    int yyy=rand()%peo.hp;
                    cout<<"消耗"<<yyy<<"血量进行斩杀"<<endl;
                    peo.hp-=yyy;
                    boss.hp-=yyy*3-boss.dp;
                    cout<<"敌人血量减少"<<yyy*3-boss.dp<<endl;
                } else if(ppp==1) {
                    int yyy=rand()%4;
                    cout<<"player血量回复:"<<peo.hp*yyy<<endl;
                    peo.hp+=peo.hp*yyy;
                    cout<<"BOSS血量减少"<<peo.ap*yyy*2-boss.dp<<endl;
                    boss.hp-=peo.ap*yyy*2-boss.dp;
                } else if(ppp==2) {
                    int yyy=rand()%10;
                    boss.hp-=peo.ap*yyy*4-boss.dp;
                    cout<<"BOSS血量减少"<<peo.ap*yyy*4-boss.dp<<endl;
                } else if(ppp==3) {
                    healthy++;
                    cout<<"player生命加一!"<<endl;
                } else if(ppp==4) {
                    int f1=rand()%1000;
                    int f2=rand()%10000;
                    int f3=rand()%100000;
                    int f4=rand()%1000000;
                    boss.hp-=f1*2-boss.dp;
                    cout<<"BOSS血量减少"<<f1*2-boss.dp<<endl;
                    boss.hp-=f1*2+f2*3-boss.dp;
                    cout<<"BOSS血量减少"<<f1*2+f2*3-boss.dp<<endl;
                    boss.hp-=f1*2+f2*3+f3*4-boss.dp;
                    cout<<"BOSS血量减少"<<f1*2+f2*3+f3*4-boss.dp<<endl;
                    boss.hp-=f1*2+f2*3+f3*4+f4*5-boss.dp;
                    cout<<"BOSS血量减少"<<f1*2+f2*3+f3*4+f4*5-boss.dp<<endl;
                } else if(ppp==5) {
                    cout<<"运转失败!!!"<<endl;
                    peo.hp-=10000;
                    cout<<"player生命减少"<<10000<<endl;
                }
            } else if(a==4&&x==8) {
                peo.hp-=990000;
                cout<<"player血量减少990000"<<endl;
            } else if(a==5&&x==8&&cnt==0&&peo.hp<=10000) {
                cout<<"败了又如何?赢了又如何?大不了重开天地,再立地火水风再来一遭!"<<endl;
                peo.ap+=99999999;
                cout<<"player攻击增加99999999"<<endl;
                cnt=100;
            } else if(a==4&&x==9) {
                cout<<"看我逆转乾坤!"<<endl;
                int rrr=rand()%1000;
                if(rrr<300) {
                    long long t=peo.hp;
                    peo.hp=boss.hp;
                    boss.hp=t;
                    cout<<"交换血量!"<<endl;
                }
                if(rrr>=300&&rrr<=700) {
                    long long t=peo.ap;
                    peo.ap=boss.ap;
                    boss.ap=t;
                    cout<<"交换攻击!"<<endl;
                }
                if(rrr>700) {
                    long long t=peo.dp;
                    peo.dp=boss.dp;
                    boss.dp=t;
                    cout<<"交换防御!"<<endl;
                }
                cnt=5;
            } else if(x==10&&a==4&&cnt==0) {
                cout<<"非铜非铁亦非钢,曾在须弭山下藏;不用阴阳颠倒炼,岂无水火淬锋芒?"<<endl;
                cout<<"诛仙利"<<endl;
                boss.hp-=peo.ap*100;
                cout<<"BOSS血量减少"<<peo.ap*100<<endl;
                cout<<"戮仙亡"<<endl;
                int uuu=rand()%10;
                if(uuu==5) {
                    boss.hp-=boss.hp*0.999;
                    cout<<"BOSS血量减少"<<boss.hp*0.999<<endl;
                } else {
                    boss.hp-=peo.ap*50;
                    cout<<"BOSS血量减少"<<peo.ap*50<<endl;
                }
                cout<<"陷仙四处起红光"<<endl;
                int fff=rand()%100;
                if(cnt>=fff)cnt-=fff;
                else cnt=0;
                cout<<"技能CD减少"<<fff<<endl;
                cout<<"绝仙变化无穷妙"<<endl;
                boss.ap-=boss.ap*0.5;
                boss.dp-=boss.dp*0.5;
                cout<<"BOSS攻击减少"<<boss.ap*0.5<<endl;
                cout<<"BOSS防御减少"<<boss.dp*0.5<<endl;
                int mmm=rand()%1000;
                if(mmm%100==0) {
                    cout<<"大罗神仙血染裳!!!"<<endl;
                    cout<<"大罗神仙血染裳!!!"<<endl;
                    cout<<"大罗神仙血染裳!!!"<<endl;
                    cout<<"You win!!!"<<endl;
                    return 0;
                }
                cnt=150;
            } else if(x==10&&a==5&&cnt==0) {
                cout<<"只见那通天教主喊道:长耳定光仙,取我六魂幡来!"<<endl;
                if(peo.hp<boss.hp) {
                    cout<<"那长耳定光仙见通天教主落了下风,对方看上去又法力无边,心生恐惧,将六魂幡交给了BOSS"<<endl;
                    cout<<"只见那BOSS微微一笑,摇动六魂幡,通天教主就被坏了半条性命,失去了大量法力身负重伤!"<<endl;
                    peo.hp-=peo.hp*0.8;
                    peo.ap-=peo.ap*0.8;
                    cout<<"攻击减少"<<peo.ap*0.8<<endl;
                    cout<<"血量减少"<<peo.hp*0.8<<endl;
                    cnt=999999;
                } else {
                    cout<<"定光仙将六魂幡交到通天教主手上!通天教主晃动六魂幡,那BOSS便晕头转向,不知所措,身受重伤!"<<endl;
                    cout<<"BOSS血量减少"<<boss.hp-1<<endl;
                    boss.hp=1;
                    cnt=100;
                }
            } else {
                system("CLS");
                cout<<"不要瞎输啊!只见天空中出现了雷云,雷云中夹杂着紫色,仿佛要把世界毁灭一般!这便是传说中的九九都天紫霄灭世神雷!"<<endl;
                int hhh=1;
                while(hhh<=81) {
                    system("color 4E");
                    cout<<"第"<<hhh<<"道神雷!!!"<<endl;
                    cout<<"血量减少"<<100000*hhh*5<<endl;
                    peo.hp-=100000*hhh*5;
                    if(peo.hp<0)break;
                    hhh++;
                }
                if(peo.hp<0) {
                    cout<<"在大道的愤怒下,你连渣都不剩!!!"<<endl;
                    cout<<"You lose"<<endl;
                    system("pause");
                    a=0;
                    break;
                } else {
                    cout<<"怎么可能,你居然扛过了雷劫?"<<endl;
                    peo.ap+=10000000000;
                    peo.dp+=10000000000;
                    cout<<"攻击、防御增加"<<10000000000<<endl;
                }
            }
            if(boss.hp<20000) {
                system("color 4A");
                cout<<"BOSS暴走!!!"<<endl;
                cout<<"BOSS全部属性上涨!!!"<<endl;
                boss.ap+=100*y;
                boss.dp+=25*y;
                boss.hp+=5000*y;
                cout<<"BOSS回复"<<5000*y<<"血量!!!"<<endl;
                cout<<"BOSS暴走咆哮,对你造成2500伤害"<<endl;
                peo.hp-=2500;
            }
            if(x==3) {
                int c=rand()%20000;
                peo.hp+=c;
                cout<<"player血量回复:"<<c<<endl;
            }
            if(x==4) {
                int c=rand()%100;
                peo.ap+=c;
                cout<<"player攻击增加"<<c<<endl;
            }
            if(y==7) {
                cout<<"我为黯天帝!"<<endl;
                cout<<"BOSS全属性*10!"<<endl;
                boss.hp*=10;
                boss.ap*=10;
                boss.dp*=10;
            }
            if(x==0) {
                cout<<"肉盾!!!"<<endl;
                peo.hp+=peo.hp*1;
                cout<<"player血量增加"<<peo.hp*1<<endl;
            }
            if(cnt>0)cnt--;
        }
    }
}

0 条评论

目前还没有评论...