#include <iostream>//为民除害零错误版
#include <time.h>
#include <windows.h>
using namespace std;
int hh = 0;
long long jx = 15 , fx = 8, hpx = 30 , jy = 0, gold = 0 , lv = 1 , a , b ,lvd,yyi,yer,ysan,ysi,hhx,dhhx;
int jn = 0 , zt = 0 , dzt = 0 , ztx , dztx ;
string cinmmz , cinboss;
long long j = jx , f = fx, hp = hpx;
bool dhpx = false, kg = false;;
string name;
bool z1,z2,z3,z4,z5,z6,z7;
int renwuyi,renwuer,renwusan,renwusi;
int slowout(string p) {
int shuchu=0;
while(shuchu!=p.size()) {
cout<<p[shuchu];
shuchu++;
Sleep(70);
}
}
int so(char *o) {
while(1) {
if(*o!=0)
printf("%c",*o++);
else
break;
Sleep(10);
}
}
void wap(int dg , int df ,int dhp,string boss,int jyx , int goldx) {
Sleep(900);
slowout("\n是否攻击/逃跑?(1/2)");
cin >> ysi;
zt = 0;
dzt = 0;
while(hp > 0 && dhp > 0 && ysi == 1) {
j = jx;
f = fx;
if(jn >= 1 && ysi == 1) {
system("cls");
cout << "\n你使用了---飞龙在天!";
system("pause");
j += 20000;
f += 10000;
}
dztx = 0;
ztx = 0;
system("cls");
dhpx = false;
cout << boss;
printf("剩余血量%d\n",dhp);
Sleep(800);
cout << name;
printf("剩余血量%d\n",hp);
Sleep(800);
srand(time(0));
ztx = rand() % 3 + 1;
if(ztx != 1)zt ++;
if(zt == 1) {
cout << name << "精神振作了一点,状态增加一级!\n";
j += 2;
}
if(zt == 2) {
cout << name << "燃起斗志了,状态增加二级!\n";
j += 3;
}
if(zt == 3) {
if(hhx > 1) {
srand(time(0));
ztx = rand()%3+1;
if(ztx == 1) {
cout << name << "恢复正常了,状态增加零!\n";
j = jx;
hhx = 0;
}
} else {
cout << name << "进入暴走状态,火力全开!!!\n";
j += 4;
hhx ++;
}
}
cout << name << "向" << boss << "攻击!\n";
if(j>=df) {
dhp -= j - df;
cout<<boss;
printf("扣了%d滴血\n",j-df);
} else {
dhp-=0;
cout<<boss;
printf("扣了0滴血");
}
if(dhp <= 0) {
printf("你打败了");
cout << boss;
printf("!\n");
if(boss=="小金毛"&&renwuyi==1) {
cout<<"你已完成任务一\n获得金币一百\n";
gold+=100;
renwuyi=0;
}
if(boss=="茶杯犬"&&renwuer==1) {
cout<<"你已完成任务二\n获得金币一百\n";
gold+=100;
renwuer=0;
}
if(boss=="小金毛"&&renwusan==1) {
cout<<"你已完成任务三\n获得金币三百\n";
gold+=300;
renwusan=0;
}
if(boss=="灭霸"&&renwusi==1) {
cout<<"你已完成任务四\n获得外挂副效果解决办法!!!";
kg=false;
renwusi=0;
}
jy += jyx;
gold += goldx;
dhpx = true;
system("pause");
} else {
srand(time(0));
dztx = rand() % 3 + 1;
if(dztx != 1)dzt ++;
if(dzt == 1) {
cout << boss << "精神振作了一点,状态增加一级!\n";
dg += 2;
}
if(dzt == 2) {
cout << boss << "燃起斗志了,状态增加二级!\n";
dg += 3;
}
if(dzt == 3) {
if(dhhx > 1) {
srand(time(0));
dztx = rand()%3+1;
if(dztx == 1) {
cout << boss << "恢复正常了,状态增加零!\n";
dg = jx;
dhhx = 0;
绝对可以运行的C++为民除害游戏代码
于 2023-08-15 11:06:37 首次发布