C++热血之刃/The blade of blood

热血之刃/The blade of blood


本蒟蒻第一次编游戏
欢迎批评斧正!


1.5版本

这个游戏的重难点在于存档及防作弊
最近闲得没事干
于是更新了这个1.8.5版本
就是现在这个游戏你又要将账号密码记在桌面 你想记的地方
好了,费话不多说,上代码

1.8.6

#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
#include<thread> 
using namespace std;
#define W  SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
#define R  SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED);
#define G  SetConsoleTextAttribute(hStdOutHandle, FOREGROUND_GREEN | FOREGROUND_INTENSITY);
#define P  SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_BLUE);
#define B  SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_BLUE|FOREGROUND_INTENSITY);
string name="aaaa";
fstream file;
int mony=600,jb=5,ts,r=0,wait1=400,wait2=500,gc=1,jy1[100]={
   
   -1,25,200,350,460,600,850,1000,1500,2187,2898},djj[100]={
   
   0,10,15,25,30,40,45,60,70,85,100},dj=0,jy=0,year=0,day=0,month,tyear,tday,tmonth;
time_t now=time(0);
tm *ltm=localtime(&now);
double xn=20,dx,zx,xx,sx=20,fy=1,gj=4,cd,tcd;
ifstream fin("2.txt"); 
string wq=",",d="Accteped",hj=",",tzh,mm,tmm;
bool f=0,sl=1,party_11=0;
void print(string s){
   
   
    for(int i=0;i<s.size();++i){
   
   
        cout<<s[i];
        Sleep(70);
    }
}
void save(){
   
   
	while(1){
   
   
		cd=((((int(xn+gj+fy)%100+(int(xx+zx+dx)*2)%100+(jb+mony*2)%100+(jy+dj)%100)+(day+month*32+year*100+ts*100)%100)%100))<<3;
		file.open(name.c_str(), ios::out | ios::trunc);
        file<<year<<' '<<month<<' '<<day<<' '<<ts<<' '<<cd<<' '<<dj<<' '<<jy<<' '<<hj<<' '<<name<<' '<<mony<<' '<<xn<<' '<<gc<<' '<<sx<<' '<<gj<<' '<<fy<<' '<<jb<<' '<<xx<<' '<<zx<<' '<<dx<<' '<<r<<' '<<wq<<' '<<mm;
		file.close();
		Sleep(5000);
	}
}
void Hwnd(HWND &hWnd){
   
   
	SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE     );
}
void qp(){
   
   
    system("cls");
}
void jsdj(){
   
   
	int tdj=dj;
	if(tdj>=10)return ;
	for(int i=dj;i<=10;++i){
   
   
		if(jy>=jy1[i])dj=i;
		else break;
	}
	if(dj>tdj){
   
   
		for(int i=tdj;i<=dj;++i){
   
   
			xn+=djj[i];
			sx+=djj[i];
			gj+=int(djj[i]/((rand()%2)+2));
			fy+=0.5;
		}
		xn=sx;
	}
}
void cg(){
   
   
	qp();
	int dgj=gc*4+(rand()%4),dxn=gc*6+(rand()%10),dfy=rand()%2+1,cst=1+rand()%2,cs=0;
	cout<<"是否购买不死金身(800)1(是)/任意(否)";
	cout<<"\n我方血量:"<<xn<<"     "<<"敌方血量:"<<dxn<<endl<<"我方攻击:"<<gj<<"     "<<"敌方攻击:"<<dgj<<endl<<"我方防御:"<<fy<<"     "<<"敌方防御:"<<dfy<<endl;
	int txn;
	bool jsxn;
	int ss;
	cin>>ss;
	if(ss==1){
   
   
		if(mony>=800){
   
   
			jsxn=true;
			txn=xn;
			mony-=800;
			cout<<"购买成功";
		}else{
   
   
			cout<<"金币不足";
		}
	}else{
   
   
		jsxn=false;
	}
	Sleep(1000);
	qp();
    cout<<"第"<<gc<<"关"<<endl;
	for(int i=1;1;++i){
   
   
		ks:
		jsdj();
		cs++;
        cout<<"我方血量:"<<xn<<"     "<<"敌方血量:"<<dxn<<endl<<"我方攻击:"<<gj<<"     "<<"敌方攻击:"<<dgj<<endl<<"我方防御:"<<fy<<"     "<<"敌方防御:"<<dfy<<endl;
        string t="攻击",tdg="攻击",dfs="防御",fs="防御";
        int kx=gj,dkx=dgj,tdf=dfy,tf=fy;
        if(rand()%4==0){
   
   
            tdg="暴击";
            dkx+=rand()%5;
        }
        if(rand()%3==0){
   
   
            t="暴击";
            kx+=rand()%5;
        }
        if(rand()%4==0){
   
   
            tdf+=rand()%3+1;
            dfs="铁壁";
        }
        if(rand()%3==0){
   
   
            tf+=rand()%3+1;
            fs="铁壁";
        }
        cout<<"我方使用"<<t<<",敌方使用"<<dfs<<"抵消"<<tdf<<"点血"<<"      "<<"我方扣除敌方";
        dxn-=(kx-tdf);
        if(kx-tdf<=0){
   
   
            cout<<0<<endl;
        } 
        else{
   
   
            cout<<kx-tdf<<endl;
        }
        if(dxn<=0){
   
   
        	int jyjj=(rand()%13+5);
        	jy+=jyjj;
			Sleep(1000);
        	qp();
        	gc++;
            int jjjjj=260+rand()%40,jjx=rand()%10;
            cout<<"敌方剩余血量为"<<dxn<<'\n'<<"我方胜利!!\n"<<"恭喜你获得"<<jjjjj<<"金币     "<<jyjj<<"点经验\n"<<"你还剩"<<xn<<"滴血\n";
            mony+=jjjjj;
            if(xn+jjx>=sx)xn=sx; 
            else xn+=jjx;
            if(jsxn){
   
   
            	sjs:
	            cout<<"\n是否开启金身(1是,0否)";
	            char sjd=getch();
	            if(sjd=='1')xn=txn;
	            else if(sjd=='0')mony+=600;
	            else goto sjs;
	            jsxn=false;
			}
            cout<<"\n1.下一关\n0.退出";dd:char z;
            Sleep(1000);
            z=getch();
			if(z=='1'){
   
   
				qp();
			    dgj=gc*(3+rand()%4),dxn=gc*(5+rand()%10),dfy=rand()%2+1;
			    cout<<"是否购买不死金身(800)1(是)/任意(否)";
				cout<<"\n我方血量:"<<xn<<"     "<<"敌方血量:"<<dxn<<endl<<"我方攻击:"<<gj<<"     "<<"敌方攻击:"<<dgj<<endl<<"我方防御:"
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值