用户:
神兽喵查看:0 回复:0 评论:0 创建时间:2021-12-08T18:00:51
//本游戏由 210410 制作,请勿修改、删除!!!
#include <iostream>
#include <cstdlib>
using namespace std;
int main(){
int job=0;
int choose,pl_hp=100,pl_maxHp=100,pl_hurt=10,pl_level=1,pl_mp=10,pl_kills,bug_hp,bug_hurt,random,hp,hurt,bj,bug_churt=0,chttm;
bool fangyu = false,bug_fy = false;
cout<<"是否观看剧情?"<<endl;
cout<<"1.观看"<<endl;
cout<<"2.跳过"<<endl;
cin>>choose;
if(choose==1){
cout<<"3年前,bug大军进犯国家"<<endl;
cout<<"在一处名叫“坠裂深渊”的峡谷展开激战"<<endl;
cout<<"一时间,魔法师的吟唱、圣骑士的呐喊不绝于耳"<<endl;
cout<<"经过了1年半的苦战,帝国终于战胜了bug"<<endl;
cout<<"但现在又有bug图谋不轨!"<<endl;
cout<<"作为帝国的战士,你挺身而出,前往剿灭bug [任务-击杀30只bug]"<<endl<<endl<<endl;
}
while(job==0){
cout<<"请选择你的职业(不同的职业技能不同): "<<endl;
cout<<"1.魔法师"<<endl;
cout<<"2.圣骑士"<<endl;
cin>>choose;
if(choose==1){
choose=0;
cout<<"魔法师"<<endl;
cout<<"浅吟-罪恶驱散:对敌方造成1.5倍的伤害 [4魔力]"<<endl;
cout<<"高歌-圣界雷鸣:对敌方一次性造成两倍等级伤害,且恢复自己与伤害同等的血量,并持续火焰伤害(对方血量/10血)4次 [8魔力]"<<endl;
cout<<"1.确定 2.再想想"<<endl;
cin>>choose;
if(choose==1){
job=1;
}
}else if(choose==2){
choose=0;
cout<<"圣骑士"<<endl;
cout<<"断罪之剑:对敌方造成2倍的伤害 [4魔力]"<<endl;
cout<<"泣血之刃:损伤自己30%血量(不会致命)对敌方伤害损伤血量的5倍伤害 [8魔力]"<<endl;
cout<<"1.确定 2.再想想"<<endl;
cin>>choose;
if(choose==1){
job=2;
}
}else{
continue;
}
}
cout<<endl;
while(pl_kills<30){
bug_hp=50 + rand() % 150*(pl_level/2)+pl_hurt;
bug_hurt=5 + rand() % 15 + pl_hp/15;
while(bug_hp>0){
choose=0;
fangyu=false;
cout<<"是否攻击bug?"<<endl;
cout<<"本轮bug: hp:"<<bug_hp<<" 伤害:"<<bug_hurt<<endl;
cout<<"你的状态: hp:"<<pl_hp<<" 伤害:"<<pl_hurt<<" 魔力:"<<pl_mp<<endl;
cout<<"1.攻击"<<endl;
cout<<"2.防御"<<endl;
cout<<"3.回血"<<endl;
pl_mp+=2;
if(job==1){
cout<<"4.浅吟-罪恶驱散"<<endl;
cout<<"5.高歌-圣界雷鸣"<<endl;
}else if(job==2){
cout<<"4.断罪之剑"<<endl;
cout<<"5.泣血之刃"<<endl;
}
while((choose!=1&&choose!=2&&choose!=3&choose!=4&choose!=5)||(choose==4&&pl_mp<4)||(choose==5&&pl_mp<8)){
if((choose==4&&pl_mp<4)||(choose==5&&pl_mp<8)){
cout<<"魔力不足!"<<endl;
}
cout<<"请选择你要进行的操作(1/2/3/4/5):";
cin>>choose;
}
if(bug_churt!=0){
bug_hp-=bug_churt;
cout<<"·bug遭受持续伤害!hp-"<<bug_churt<<endl;
}
if(chttm>0){
chttm-=1;
cout<<"·持续伤害回合剩余"<<chttm<<endl;
}
if(choose==1){
cout<<"·你做出行动:攻击"<<endl;
if(bug_fy==false){
hurt=pl_hurt;
}else{
hurt=pl_hurt/3;
}
if(0+rand()%10<3){
bj=2+rand()%10;
hurt*=bj;
cout<<"·你打出了暴击! 伤害翻"<<bj<<"倍!"<<endl;
}
bug_hp-=hurt;
cout<<"·bug的hp-"<<hurt<<endl;
}else if(choose==2){
fangyu=true;
cout<<"·你做出行动:防御"<<endl;
}else if(choose==3){
hp = 5+rand()%10;
if(pl_hp<pl_maxHp-hp){
pl_hp+=hp;
cout<<"·你做出行动:回血 你的hp+"<<hp<<endl;
}else{
pl_hp=pl_maxHp;
cout<<"·你做出行动:回血 你的hp恢复至最高值"<<endl;
}
}else if(choose==4){
cout<<"·你做出行动:技能1"<<endl;
if(job==1){
if(bug_fy==false){
hurt=pl_hurt*1.5;
}else{
hurt=pl_hurt/3*1.5;
}
if(0+rand()%10<3){
bj=2+rand()%10;
hurt*=bj;
cout<<"·你打出了暴击! 伤害翻"<<bj<<"倍!"<<endl;
}
bug_hp-=hurt;
pl_mp-=4;
cout<<"·bug的hp-"<<hurt<<endl;
}else if(job==2){
if(bug_fy==false){
hurt=pl_hurt*2;
}else{
hurt=pl_hurt/3*2;
}
if(0+rand()%10<3){
bj=2+rand()%10;
hurt*=bj;
cout<<"·你打出了暴击! 伤害翻"<<bj<<"倍!"<<endl;
}
bug_hp-=hurt;
pl_mp-=4;
cout<<"·bug的hp-"<<hurt<<endl;
}
}else if(choose==5){
cout<<"·你做出行动:技能2"<<endl;
if(job==1){
if(bug_fy==false){
hurt=pl_level*2+hurt;
}else{
hurt=pl_level*2/3+hurt;
}
if(0+rand()%10<3){
bj=2+rand()%10;
hurt*=bj;
cout<<"·你打出了暴击! 伤害翻"<<bj<<"倍!"<<endl;
}
bug_churt=bug_hp/10;
chttm=4;
bug_hp-=hurt;
pl_hp+=hurt;
pl_mp-=8;
cout<<"·bug的hp-"<<hurt<<endl;
cout<<"·你的hp+"<<hurt<<endl;
}else if(job==2){
if(bug_fy==false){
hurt=pl_hp*0.3*5;//损伤自己30%血量(不会致命)对敌方伤害损伤血量的5倍伤害
}else{
hurt=pl_hp*0.3*5/3;
}
if(0+rand()%10<3){
bj=2+rand()%10;
hurt*=bj;
cout<<"·你打出了暴击! 伤害翻"<<bj<<"倍!"<<endl;
}
pl_hp-=pl_hp*0.3;
bug_hp-=hurt;
pl_mp-=8;
cout<<"·bug的hp-"<<hurt<<endl;
cout<<"·你的hp-"<<pl_hp*0.3<<endl;
}
}
random = 0+rand()%2;
if(random==0){
cout<<"* bug做出行动:攻击"<<endl;
if(fangyu==false){
hurt=bug_hurt;
}else{
hurt=bug_hurt/3;
}
if(0+rand()%10<3){
bj=2+rand()%10;
hurt*=bj;
cout<<"* bug打出了暴击! 伤害翻"<<bj<<"倍!"<<endl;
}
pl_hp-=hurt;
cout<<"* 你的hp-"<<hurt<<endl;
bug_fy=false;
}else if(random==1){
bug_fy=true;
cout<<"* bug做出行动:防御"<<endl;
}else if(random==2){
hp = 5+rand()%10+pl_level;
bug_hp+=hp;
cout<<"* bug做出行动:回血 bug的hp+"<<hp<<endl;
}
if(pl_hp<=0){
cout<<"你喵了!"<<endl;
cout<<"等级:"<<pl_level<<"hp:"<<pl_hp<<"伤害:"<<pl_hurt<<endl;
pl_hp=100;
pl_level=1;
pl_hurt=10;
cout<<"输入0以重新开局"<<endl;
cin>>choose;
if(choose==0){
break;
}else{
return 0;
}
}
cout<<endl;
}
pl_level += 1;
pl_maxHp += 5+rand()%15;
pl_hp=pl_maxHp;
pl_hurt += 5+rand()%15;
pl_kills+=1;
cout<<"击败一只野生bug!"<<endl;
cout<<"等级:"<<pl_level<<" 最高生命值:"<<pl_maxHp<<" 伤害:"<<pl_hurt<<" 击喵ug:"<<pl_kills<<endl<<endl;
}
cout<<"OHHHHHHH!"<<endl;
cout<<"你真是太棒了!"<<endl;
cout<<"居然真的做到了击杀30只bug"<<endl;
cout<<"达成成就 [*帝国勇者*]"<<endl<<endl;
}