#include<bits/stdc++.h>
#include<string>
#include<windows.h>
#include<conio.h>
#include<fstream>
#include<ctime>
#include<time.h>
#include<stdio.h>
using namespace std;
ifstream fin("小岛战争data.txt");
struct black_daye {
string name;
int gongji;
int fangyu;
int xiel;
};
black_daye peopledata_dy[4] = { "看门大爷",150,100,800 };
int sbbspeople = 10;
int a, ag;
int name, password;
int sinput;
int newhand = 0;
string root;
int rootdh;
string kuangwu[1000] = { "金刚石","铁","铜","金","银","煤炭"
,"铀","铁","按钮","钢","钛" };
string ezj[3] = { "地下水","地雷","臭袜子" };
int data[1000];
/*0武器等级 1合成劵 2金刚石 3铁 4铜 5金 6银 7煤炭
8木屋 9军事基地 10港口 11防空洞 12士兵宿舍
13独木舟 14小艇 15战舰 16潜艇 17航空母舰 18核潜艇
19血量 20攻击 21领地 22防御 23矿工铲 24士兵人数
25电锯 26密码 27账号 28木头 29独木舟 30小艇 31战舰
32潜艇 33航空母舰 34核潜艇 35铀块 36铁块 37按钮
38弓箭 39火炮 40护甲 41粽子 42钛合金 43钢合金 44核弹
45钢 46钛 47油漆 48核弹发射器 49不锈钢 50导弹 51钱
52石油
*/
string make[1000] = { "矿工铲","电锯","弓箭","火炮","护甲","粽子",
"钛合金","钢合金","核弹","核弹发射器","不锈钢","导弹"," "
};
int suiji = 0;
int jsq = 0;
bool yj = false;
void mout(char* p) {//每隔100毫秒输出一个字符
while (1) {
if (*p != 0)
printf("%c", *p++);
else
break;
Sleep(100);
}
}
void outmake() {
cout << "木头:" << data[28] << endl;
cout << "金刚石:" << data[2] << endl;
cout << "铁:" << data[3] << endl;
cout << "铜:" << data[4] << endl;
cout << "金:" << data[5] << endl;
cout << "银:" << data[6] << endl;
cout << "煤炭:" << data[7] << endl;
cout << "铀块:" << data[35] << endl;
cout << "钢:" << data[45] << endl;
cout << "钛:" << data[46] << endl;
cout << "按钮:" << data[37] << endl;
cout << "油漆:" << data[47] << endl;
cout << "合成物品:" << endl;
return;
}
void outzb() {
cout << "电锯:" << data[25] << endl;
cout << "弓箭:" << data[38] << endl;
cout << "火炮:" << data[39] << endl;
cout << "护甲:" << data[40] << endl;
cout << "粽子:" << data[41] << endl;
cout << "钛合金:" << data[42] << endl;
cout << "钢合金:" << data[43] << endl;
cout << "核弹:" << data[44] << endl;
cout << "核弹发射器:" << data[48] << endl;
cout << "不锈钢:" << data[49] << endl;
cout << "导弹:" << data[50] << endl;
return;
}
void outjz() {
cout << "木屋:" << data[8] << endl;
cout << "军事基地:" << data[9] << endl;
cout << "港口:" << data[10] << endl;
cout << "防空洞:" << data[11] << endl;
cout << "士兵宿舍:" << data[12] << endl;
return;
}
void outcz() {
cout << "1独木舟:" << data[13] << endl;
cout << "2小艇:" << data[14] << endl;
cout << "3战舰:" << data[15] << endl;
cout << "4潜艇:" << data[16] << endl;
cout << "5航空母舰:" << data[17] << endl;
cout << "6核潜艇:" << data[18] << endl;
return;
}
void zd() {
int nm = 0;
int oxl;
int dxl = rand() % 5000 + 1000;
string zdzb[3];
int zbzbi[3];
int mesh = 0, mefy = 0;
int pbsgj = rand() % 500 + 100;
int pbssbrs = rand() % 50 + 10;
int pbsfy = rand() % 250 + 50;
part7:
system("cls");
cout << "请选择你的出战装备(每种各选一个,可不选):" << endl;
cout << "防御:" << endl;
cout << "0不选 1护甲" << endl;
cout << "出战工具:" << endl;
cout << "0不选 1航母 2独木舟 3小艇 4战舰 5潜艇 6核潜艇" << endl;
cin >> zbzbi[1] >> zbzbi[2];
if (zbzbi[1] == 0) {
zdzb[1] = "无";
}
else {
if (data[40] < 1) {
cout << "你没有护甲" << endl;
Sleep(1000);
goto part7;
}
zdzb[1] = "护甲";
mefy += 150;
}
switch (zbzbi[2]) {
case 0: {
zdzb[2] = "无";
break;
}
case 1: {
if (data[17] < 1) {
cout << "你没有航母" << endl;
Sleep(1000);
goto part7;
}
zdzb[2] = "航母";
mesh += 200;
break;
}
case 2: {
if (data[13] < 1) {
cout << "你没有独木舟" << endl;
Sleep(1000);
goto part7;
}
zdzb[2] = "独木舟";
mesh += 10;
break;
}
case 3: {
if (data[14] < 1) {
cout << "你没有小艇" << endl;
Sleep(1000);
goto part7;
}
zdzb[2] = "小艇";
mesh += 25;
break;
}
case 4: {
if (data[15] < 1) {
cout << "你没有战舰" << endl;
Sleep(1000);
goto part7;
}
zdzb[2] = "战舰";
mesh += 150;
break;
}
case 5: {
if (data[16] < 1) {
cout << "你没有潜艇" << endl;
Sleep(1000);
goto part7;
}
zdzb[2] = "潜艇";
mesh += 140;
break;
}
case 6: {
if (data[17] < 1) {
cout << "你没有核潜艇" << endl;
Sleep(1000);
goto part7;
}
zdzb[2] = "核潜艇";
mesh += 200;
break;
}
}
string djnname[5] = { "大砍刀","吸血","打王者荣耀","射箭","高射炮" };
int djnjx[5] = { 80,100,0,70,150 };
system("cls");
while (data[19] > 0 && dxl > 0) {
suiji = rand() % 4 + 0;
cout << "我方装备:" << zdzb[0] << endl;
cout << "我方防御:" << zdzb[1] << endl;
cout << "我方血量:" << data[19] << endl;
cout << endl;
cout << "敌方血量:" << dxl << endl;
cout << "敌方技能:" << djnname[suiji] << endl;
oxl = data[19];
data[19] = data[19] - pbsgj + data[22] + data[24] / 10 * 2 - pbssbrs / 10 - djnjx[suiji] + mefy;
oxl = oxl - data[19];
cout << "你掉了" << oxl << "滴血" << endl;
partyu1:
cout << "你是否要用粽子来回血,1yes,2no" << endl;
cin >> sinput;
if (sinput == 1) {
if (data[41] < 1) {
cout << "你没有粽子" << endl;
Sleep(1000);
goto partyu1;
}
part12:
cout << "请输入数量:" << endl;
cin >> sinput;
if (data[41] < sinput) {
cout << "不够" << endl;
goto part12;
}
cout << "补血成功" << endl;
data[19] += data[41] * sinput * 75;
Sleep(1000);
}
partyui1:
Sleep(500);
cout << "你用什么武器?" << endl;
cout << "0不选 1弓箭 2火炮 3核弹 4导弹" << endl;
cin >> zbzbi[0];
switch (zbzbi[0]) {
case 0: {
zdzb[0] = " ";
break;
}
case 1: {
if (data[38] < 1) {
cout << "你没有弓箭" << endl;
Sleep(1000);
goto part7;
}
zdzb[0] = "弓箭";
mesh = 70;
break;
}
case 2: {
if (data[39] < 1) {
cout << "你没有火炮" << endl;
Sleep(1000);
goto part7;
}
zdzb[0] = "火炮";
mesh = 100;
break;
}
case 3: {
if (data[44] < 1) {
cout << "你没有核弹" << endl;
Sleep(1000);
goto part7;
}
zdzb[0] = "核弹";
mesh = 500;
break;
}
case 4: {
if (data[50] < 1) {
cout << "你没有导弹" << endl;
Sleep(1000);
goto part7;
}
zdzb[0] = "导弹";
mesh = 250;
break;
}
}
dxl = dxl - data[20] - data[24] / 10 + pbsfy + pbssbrs / 10 * 2 - mesh;
cout << "对方掉了" << dxl << "滴血" << endl;
Sleep(500);
pbssbrs -= data[20] * 0.2;
data[24] -= pbsgj * 0.2;
}
if (dxl < 0) {
cout << "你把对方干掉了" << endl;
cout << "战利品:" << endl;
suiji = rand() % 100 + 1;
switch (suiji) {
case 1: {
cout << "获得豪华大礼包一个!!" << endl;
cout << "油漆*10" << endl;
cout << "金刚石*5" << endl;
cout << "钛*6" << endl;
cout << "铁*10" << endl;
cout << "领地*1" << endl;
cout << "士兵*100" << endl;
cout << "粽子*1" << endl;
cout << "弓箭*8" << endl;
data[47] += 10;
data[2] += 5;
data[3] += 10;
data[46] += 6;
data[21] += 1;
data[24] += 100;
data[41] += 1;
data[38] += 8;
Sleep(5000);
return;
break;
}
case 25: {
cout << "获得领地1块" << endl;
cout << "获得士兵" << pbssbrs / 100 * 2 << endl;
data[21] += 1;
data[24] += pbssbrs / 100 * 2;
Sleep(5000);
return;
break;
}
}
if (suiji == 2) {
cout << "敌人太穷了,什么也没有" << endl;
Sleep(1000);
return;
}
else if (suiji > 2 && suiji < 25) {
cout << "获得航空母舰1艘,军事基地一个" << endl;
data[17] += 1;
data[9] += 1;
Sleep(1000);
return;
}
else if (suiji > 25 && suiji <= 98) {
cout << "你获得士兵100" << endl;
data[24] += 100;
Sleep(1000);
return;
}
}
else {
cout << "你被打死了" << endl;
cout << "士兵-100" << endl;
data[24] -= 100;
Sleep(5000);
return;
}
}
void outdata() {
ofstream fout("小岛战争data.txt");
for (int i = 0; i < 52; i++)
fout << data[i] << " ";
cout << "OK" << endl;
Sleep(1000);
return;
}
void start() {
system("cls");
mout("欢迎来到小岛战争1.0.0正式版\n");
MessageBox(NULL, TEXT("请不要输入除了选项之外的数字,后果自负"), TEXT("游戏提示"), MB_OK);
mout("作者:jsh\n");
mout("—_ —\n");
mout("输入一个数开始游戏\n");
cin >> sinput;
return;
}
void dl() {
int bnm;
pt1:
system("cls");
cout << "1登录,2注册" << endl;
cin >> bnm;
if (bnm == 1) {
newhand = 1;
cout << "账号:";
cin >> name;
cout << "密码:";
cin >> password;
if (data[26] != password || data[27] != name) {
cout << "错误!" << endl;
Sleep(2000);
goto pt1;
}
else
return;
}
else {
cout << "账号:";
cin >> name;
cout << "密码:";
cin >> password;
data[26] = password;
data[27] = name;
return;
}
return;
}
void cave_tie() {
cout << "你来到铁矿..." << endl;
part1:
system("cls");
mout("正在挖矿...\n");
Sleep(1000);
suiji = rand() % 2 + 1;
if (suiji == 2) {
suiji = rand() % 2 + 0;
cout << "你挖到了" << ezj[suiji] << endl;
Sleep(2000);
cout << "是否继续挖矿,1继续,2退出" << endl;
cin >> a;
if (a == 1)
goto part1;
else
return;
}
cout << "你挖到了" << kuangwu[1] << endl;
ag = rand() % 15 + 1;
data[3] += ag;
cout << "是否继续挖矿,1继续,2退出" << endl;
cin >> a;
if (a == 1);
else
return;
Sleep(2000);
goto part1;
}
void cave_mei() {
cout << "你来到煤矿..." << endl;
part2:
system("cls");
mout("正在挖矿...\n");
Sleep(1000);
suiji = rand() % 2 + 1;
if (suiji == 2) {
suiji = rand() % 2 + 0;
cout << "你挖到了" << ezj[suiji] << endl;
Sleep(2000);
cout << "是否继续挖矿,1继续,2退出" << endl;
cin >> a;
if (a == 1)
goto part2;
else
return;
}
cout << "你挖到了" << kuangwu[5] << endl;
ag = rand() % 20 + 1;
data[7] += ag;
cout << "是否继续挖矿,1继续,2退出" << endl;
cin >> a;
if (a == 1);
else
return;
Sleep(2000);
goto part2;
}
void cave_jingangshi() {
cout << "你来到金刚石矿..." << endl;
part3:
system("cls");
mout("正在挖矿...\n");
Sleep(1000);
suiji = rand() % 2 + 1;
if (suiji == 2) {
suiji = rand() % 2 + 0;
cout << "你挖到了" << ezj[suiji] << endl;
Sleep(2000);
cout << "是否继续挖矿,1继续,2退出" << endl;
cin >> a;
if (a == 1)
goto part3;
else
return;
}
cout << "你挖到了" << kuangwu[0] << endl;
ag = rand() % 5 + 1;
data[2] += ag;
cout << "是否继续挖矿,1继续,2退出" << endl;
cin >> a;
if (a == 1);
else
return;
Sleep(2000);
goto part3;
}
void cave_tong() {
cout << "你来到铜矿..." << endl;
part4:
system("cls");
mout("正在挖矿...\n");
Sleep(1000);
suiji = rand() % 2 + 1;
if (suiji == 2) {
suiji = rand() % 2 + 0;
cout << "你挖到了" << ezj[suiji] << endl;
Sleep(2000);
cout << "是否继续挖矿,1继续,2退出" << endl;
cin >> a;
if (a == 1)
goto part4;
else
return;
}
ag = rand() % 10 + 1;
cout << "你挖到了" << kuangwu[2] << ag << endl;
data[4] += ag;
cout << "是否继续挖矿,1继续,2退出" << endl;
cin >> a;
if (a == 1);
else
return;
Sleep(2000);
goto part4;
}
void cave_jin() {
cout << "你来到金矿..." << endl;
part5:
system("cls");
mout("正在挖矿...\n");
Sleep(1000);
suiji = rand() % 2 + 1;
if (suiji == 2) {
suiji = rand() % 2 + 0;
cout << "你挖到了" << ezj[suiji] << endl;
Sleep(2000);
cout << "是否继续挖矿,1继续,2退出" << endl;
cin >> a;
if (a == 1)
goto part5;
else
return;
}
ag = rand() % 7 + 1;
cout << "你挖到了" << kuangwu[3] << ag << endl;
data[5] += ag;
cout << "是否继续挖矿,1继续,2退出" << endl;
cin >> a;
if (a == 1);
else
return;
Sleep(2000);
goto part5;
}
void cave_yin() {
cout << "你来到银矿..." << endl;
part6:
system("cls");
mout("正在挖矿...\n");
Sleep(1000);
suiji = rand() % 2 + 1;
if (suiji == 2) {
suiji = rand() % 2 + 0;
cout << "你挖到了" << ezj[suiji] << endl;
Sleep(2000);
cout << "是否继续挖矿,1继续,2退出" << endl;
cin >> a;
if (a == 1)
goto part6;
else
return;
}
ag = rand() % 9 + 1;
cout << "你挖到了" << kuangwu[4] << ag << endl;
data[6] += ag;
cout << "是否继续挖矿,1继续,2退出" << endl;
cin >> a;
if (a == 1);
else
return;
Sleep(2000);
goto part6;
}
void cave_zhoukuai() {
cout << "你来到铀矿..." << endl;
part6:
system("cls");
mout("正在挖矿...\n");
Sleep(1000);
suiji = rand() % 2 + 1;
if (suiji == 2) {
suiji = rand() % 2 + 0;
cout << "你挖到了" << ezj[suiji] << endl;
Sleep(2000);
cout << "是否继续挖矿,1继续,2退出" << endl;
cin >> a;
if (a == 1)
goto part6;
else
return;
}
ag = rand() % 5 + 1;
cout << "你挖到了" << kuangwu[6] << ag << endl;
data[35] += ag;
cout << "是否继续挖矿,1继续,2退出" << endl;
cin >> a;
if (a == 1);
else
return;
Sleep(2000);
goto part6;
}
void cave_tai() {
cout << "你来到钛矿..." << endl;
part10:
system("cls");
mout("正在挖矿...\n");
Sleep(1000);
suiji = rand() % 2 + 1;
if (suiji == 2) {
suiji = rand() % 2 + 0;
cout << "你挖到了" << ezj[suiji] << endl;
Sleep(2000);
cout << "是否继续挖矿,1继续,2退出" << endl;
cin >> a;
if (a == 1)
goto part10;
else
return;
}
ag = rand() % 5 + 1;
cout << "你挖到了" << kuangwu[6] << ag << endl;
data[46] += ag;
cout << "是否继续挖矿,1继续,2退出" << endl;
cin >> a;
if (a == 1);
else
return;
Sleep(2000);
goto part10;
}
void cave_shiyou() {
cout << "你来到油田..." << endl;
part11:
system("cls");
mout("正在吸油...\n");
Sleep(1000);
suiji = rand() % 2 + 1;
if (suiji == 2) {
suiji = rand() % 2 + 0;
cout << "你挖到了" << ezj[suiji] << endl;
Sleep(2000);
cout << "是否继续挖矿,1继续,2退出" << endl;
cin >> a;
if (a == 1)
goto part11;
else
return;
}
ag = rand() % 5 + 1;
cout << "你挖到了" << kuangwu[6] << ag << endl;
data[46] += ag;
cout << "是否继续挖矿,1继续,2退出" << endl;
cin >> a;
if (a == 1);
else
return;
Sleep(2000);
goto part11;
}
void cave() {
int a;
int ag = 0;
mout("山洞里有各种危险,但也可能有宝藏\n");
/*if(data[23]<1){
mout("你没有矿工铲,无法挖矿\n");
Sleep(2000);
return ;
}*/
part0:
system("cls");
cout << "1铁矿,2煤矿,3金刚石矿,4铜矿,5金矿,6银矿,7铀矿,8钛矿 9退出" << endl;
cin >> sinput;
switch (sinput) {
case 1: {
cave_tie();
goto part0;
break;
}
case 2: {
cave_mei();
goto part0;
break;
}
case 3: {
cave_jingangshi();
goto part0;
break;
}
case 4: {
cave_tong();
goto part0;
break;
}
case 5: {
cave_jin();
goto part0;
break;
}
case 6: {
cave_yin();
goto part0;
break;
}
case 7: {
cave_zhoukuai();
goto part0;
break;
}
case 8: {
cave_tai();
goto part0;
break;
}
case 9: {
return;
break;
}
}
}
void woods() {
int sdfgh;
int asdfg = 0;
mout("你来到了森林,准备砍树做船\n");
/*if(data[8]<1){
mout("你没有电锯,无法砍树\n");
Sleep(2000);
return ;
}*/
part2:
system("cls");
mout("你开始砍树...\n");
asdfg = rand() % 100 + 1;
if (asdfg % 2 == 0) {
mout("你得到");
asdfg = rand() % 10 + 1;
cout << asdfg;
mout("根木头");
data[28] += asdfg;
}
cout << "是否继续砍树,1继续,2退出" << endl;
cin >> sdfgh;
if (sdfgh == 1);
else
return;
Sleep(2000);
goto part2;
}
void xmw() {
int df;
mout("你回到了小木屋\n");
mout("你经过一天的工作,觉得很累\n");
part11:
cout << "你是否要吃粽子,1yes 2no" << endl;
cin >> df;
if (df == 1) {
cout << "你要吃几个?" << endl;
cin >> df;
if (data[41] < df) {
cout << "你没有那么多的粽子" << endl;
goto part11;
}
data[41] -= df;
data[19] += data[41] * 100;
data[20] += data[41] * 80;
data[21] += data[41] * 65;
goto part11;
}
return;
}
void gzs() {
int yui;
party1:
system("cls");
outmake();
cout << "1独木舟,2小艇,3战舰,4潜艇,5航空母舰,6核潜艇,7退出" << endl;
cin >> yui;
switch (yui) {
case 1: {
if (data[28] < 25) {
cout << "木头不够!!" << endl;
Sleep(2000);
goto party1;
}
else {
mout("合成中...\n");
Sleep(5000);
cout << "合成成功" << endl;
data[13]++;
data[28] -= 25;
}
break;
}
case 2: {
if (data[28] < 50 || data[3] < 5) {
cout << "木头或者铁不够!!" << endl;
Sleep(2000);
goto party1;
}
else {
mout("合成中...\n");
Sleep(5000);
cout << "合成成功" << endl;
data[14]++;
data[28] -= 50;
data[3] - 5;
}
break;
}
case 3: {
if (data[28] < 75 || data[3] < 50 || data[4] < 50 || data[7] < 25) {
cout << "材料不够!!" << endl;
Sleep(2000);
goto party1;
}
else {
mout("合成中...\n");
Sleep(5000);
cout << "合成成功" << endl;
data[15]++;
data[28] -= 75;
data[3] -= 50;
data[4] -= 50;
data[7] -= 25;
}
break;
}
case 5: {
if (data[28] < 100 || data[3] < 75 || data[4] < 75 || data[7] < 50 || data[2] < 15 || data[6] < 20) {
cout << "材料不够!!" << endl;
Sleep(2000);
goto party1;
}
else {
mout("合成中...\n");
Sleep(5000);
cout << "合成成功" << endl;
data[17]++;
data[28] -= 100;
data[3] -= 75;
data[4] -= 75;
data[7] -= 50;
data[2] -= 15;
data[6] -= 20;
}
break;
}
case 4: {
if (data[28] < 100 || data[3] < 75 || data[4] < 75 || data[7] < 100 || data[2] < 15 || data[6] < 25) {
cout << "材料不够!!" << endl;
Sleep(2000);
goto party1;
}
else {
mout("合成中...\n");
Sleep(5000);
cout << "合成成功" << endl;
data[16]++;
data[28] -= 100;
data[3] -= 75;
data[4] -= 75;
data[7] -= 100;
data[2] -= 15;
data[6] -= 20;
}
break;
}
case 6: {
if (data[28] < 100 || data[3] < 75 || data[4] < 75 || data[7] < 50 || data[2] < 15 || data[6] < 20 || data[5] < 50) {
cout << "材料不够!!" << endl;
Sleep(2000);
goto party1;
}
else {
mout("合成中...\n");
Sleep(5000);
cout << "合成成功" << endl;
data[18]++;
data[28] -= 100;
data[3] -= 100;
data[4] -= 75;
data[7] - 25;
data[2] - 15;
data[6] - 20;
data[5] - 50;
}
break;
}
case 7:return; break;
}
goto party1;
}
void kfz() {
mout("你看着小岛,觉得少了点什么\n");
mout("你决定在小岛上建一些建筑\n");
int yuio;
party2:
system("cls");
outmake();
cout << "1木屋,2军事基地,3港口,4防空洞,5士兵宿舍,6退出" << endl;
cin >> yuio;
switch (yuio) {
case 1: {
if (data[28] < 50) {
cout << "木头不够!!" << endl;
Sleep(2000);
goto party2;
}
else {
mout("建造中...\n");
Sleep(5000);
cout << "建造成功" << endl;
data[8]++;
data[28] -= 25;
}
break;
}
case 2: {
if (data[28] < 50 || data[3] < 5) {
cout << "木头或者铁不够!!" << endl;
Sleep(2000);
goto party2;
}
else {
mout("合成中...\n");
Sleep(5000);
cout << "合成成功" << endl;
data[9]++;
data[28] -= 50;
data[3] -= 5;
}
break;
}
case 3: {
if (data[28] < 75 || data[3] < 50 || data[4] < 50 || data[7] < 25) {
cout << "材料不够!!" << endl;
Sleep(2000);
goto party2;
}
else {
mout("合成中...\n");
Sleep(5000);
cout << "合成成功" << endl;
data[10]++;
data[28] -= 75;
data[3] -= 50;
data[4] -= 50;
data[7] -= 25;
}
break;
}
case 5: {
if (data[28] < 100 || data[3] < 75 || data[4] < 75 || data[7] < 50 || data[2] < 15 || data[6] < 20) {
cout << "材料不够!!" << endl;
Sleep(2000);
goto party2;
}
else {
mout("合成中...\n");
Sleep(5000);
cout << "合成成功" << endl;
data[11]++;
data[28] -= 100;
data[3] -= 75;
data[4] -= 75;
data[7] -= 50;
data[2] -= 15;
data[6] -= 20;
}
break;
}
case 4: {
if (data[28] < 100 || data[3] < 75 || data[4] < 75 || data[7] < 100 || data[2] < 15 || data[6] < 25) {
cout << "材料不够!!" << endl;
Sleep(2000);
goto party2;
}
else {
mout("合成中...\n");
Sleep(5000);
cout << "合成成功" << endl;
data[12]++;
data[28] - 100;
data[3] -= 75;
data[4] - 75;
data[7] - 100;
data[2] - 15;
data[6] - 20;
}
break;
}
case 6:return; break;
}
goto party2;
}
void sbssj() {
int qwe;
if (data[12] < 1) {
cout << "你没有士兵宿舍" << endl;
Sleep(1000);
return;
}
part4:
system("cls");
cout << "你有士兵:" << data[24] << "人" << endl;
cout << "你有宿舍:" << data[12] << "座" << endl;
cout << "你要招募士兵吗?(1次消耗10金),1=招募,2=退出" << endl;
cin >> qwe;
int zxc = 0;
if (qwe == 1) {
if (data[5] < 10) {
cout << "你没有钱" << endl;
Sleep(1000);
return;
}
data[5] -= 10;
mout("你发布了招募任务...\n");
zxc = rand() % 50 + 10;
data[24] += zxc;
Sleep(1000);
if (sbbspeople * data[12] < data[24]) {
cout << "现有士兵宿舍不够,无法招募" << endl;
mout("进行退款...");
Sleep(2000);
data[5] += 10;
data[24] -= zxc;
return;
}
cout << "你招募到了" << zxc << "名士兵" << endl;
goto part4;
}
}
void shez() {
int cvb;
cout << "变强攻略:" << endl;
cout << "1=打开,2=退出" << endl;
cin >> cvb;
if (cvb = 2) return;
else {
system("start https://paste.ubuntu.com/p/gtPVjtNx7x/");
/*
如果你不想注册/登录账号,并且看到了这里,这里搬运了链接的内容:
获得更多领地:提升士兵数;
多挖矿
金刚石是个好东西;
如果别人的船只比你厉害就别去攻打对方的小岛
领地越大越厉害
作者很良心
多关心你的小岛
每次更新时不用删除原存档
*/
}
return;
}
void zzs() {
int nm = 0;
int oxl;
int odxl;
cout << "1战斗,2退出" << endl;
cin >> sinput;
if (sinput == 2)
return;
zd();
return;
}
void indata() {
int sj;
int i = 0;
while (fin >> sj) {
data[i] = sj;
i++;
}
}
void makeroom() {
cout << "你来到合成屋" << endl;
part8:
system("cls");
outmake();
cout << "木头:" << data[28] << endl;
cout << "金刚石:" << data[2] << endl;
cout << "铁:" << data[3] << endl;
cout << "铜:" << data[4] << endl;
cout << "金:" << data[5] << endl;
cout << "银:" << data[6] << endl;
cout << "煤炭:" << data[7] << endl;
cout << "铀块:" << data[35] << endl;
cout << "合成物品:" << endl;
cout << "0退出 1电锯 2弓箭 3火炮 4粽子 5护甲 6钛合金 7钢合金 8核弹" << endl;
cout << "9核弹发射器 10导弹" << endl;
cin >> sinput;
switch (sinput) {
case 0: {
return;
break;
}
case 1: {
if (data[7] < 3 || data[3] < 5) {
cout << "材料不够!" << endl;
Sleep(1000);
goto part8;
}
cout << "合成成功!" << endl;
data[25]++;
data[7] -= 3;
data[3] -= 5;
Sleep(1000);
goto part8;
break;
}
case 2: {
if (data[3] < 3 || data[4] < 5) {
cout << "材料不够!" << endl;
Sleep(1000);
goto part8;
}
cout << "合成成功!" << endl;
Sleep(1000);
data[38]++;
data[3] -= 3;
data[4] -= 5;
goto part8;
break;
}
case 3: {
if (data[7] < 10 || data[3] < 5 || data[4] < 2) {
cout << "材料不够!" << endl;
Sleep(1000);
goto part8;
}
cout << "合成成功!" << endl;
Sleep(1000);
data[39]++;
data[3] -= 5;
data[7] -= 10;
data[4] -= 2;
goto part8;
break;
}
case 4: {
if (data[2] < 1) {
cout << "材料不够!" << endl;
Sleep(1000);
goto part8;
}
cout << "合成成功!" << endl;
Sleep(1000);
data[41]++;
data[2] -= 1;
goto part8;
break;
}
case 5: {
if (data[2] < 1 || data[5] < 3 || data[6] < 2) {
cout << "材料不够!" << endl;
Sleep(1000);
goto part8;
}
cout << "合成成功!" << endl;
Sleep(1000);
data[40]++;
data[2] -= 1;
data[5] -= 3;
data[6] -= 2;
goto part8;
break;
}
case 6: {
if (data[2] < 1 || data[5] < 3 || data[6] < 2) {
cout << "材料不够!" << endl;
Sleep(1000);
goto part8;
}
cout << "合成成功!" << endl;
Sleep(1000);
data[40]++;
data[2] -= 1;
data[5] -= 3;
data[6] -= 2;
goto part8;
break;
}
case 7: {
if (data[3] < 1 || data[5] < 2 || data[7] < 2) {
cout << "材料不够!" << endl;
Sleep(1000);
goto part8;
}
cout << "合成成功!" << endl;
Sleep(1000);
data[43]++;
data[3] -= 1;
data[5] -= 2;
data[7] -= 2;
goto part8;
break;
}
case 8: {
if (data[35] < 1 || data[3] < 5 || data[48] < 1) {
cout << "材料不够!" << endl;
Sleep(1000);
goto part8;
}
cout << "合成成功!" << endl;
Sleep(1000);
data[44]++;
data[35] -= 1;
data[3] -= 5;
data[48] -= 1;
goto part8;
break;
}
case 9: {
if (data[3] < 5 || data[45] < 1) {
cout << "材料不够!" << endl;
Sleep(1000);
goto part8;
}
cout << "合成成功!" << endl;
Sleep(1000);
data[48]++;
data[3] -= 5;
data[45] -= 1;
goto part8;
break;
}
case 10: {
if (data[3] < 10 || data[45] < 10 || data[7] < 100) {
cout << "材料不够!" << endl;
Sleep(1000);
goto part8;
}
cout << "合成成功!" << endl;
Sleep(1000);
data[50]++;
data[3] -= 10;
data[45] -= 10;
data[7] -= 100;
goto part8;
break;
}
}
}
void makebiao() {
cout << "合成表:" << endl;
cout << "电锯=3煤炭+5铁" << endl;
cout << "弓箭=3铁+5铜" << endl;
cout << "火炮=10煤炭+5铁+3铜" << endl;
cout << "粽子=1金刚石" << endl;
cout << "护甲=1金刚石+3金+2银" << endl;
cout << "钛合金=1钛+2金+2煤炭" << endl;
cout << "钢合金=1钢+2金+2煤炭" << endl;
cout << "核弹=铀块*1+铁块*5+发射器" << endl;
cout << "核弹发射器=5铁块+1钢" << endl;
cout << "导弹=10铁+10钢+100煤" << endl;
cout << "输入任意数退出" << endl;
cin >> a;
return;
}
void bag() {
outmake();
outzb();
outjz();
outcz();
cout << "输入一个数退出..." << endl;
cin >> sinput;
return;
}
void sea_hd() {
int inint;
cout << "你遇到了海盗!!" << endl;
if (root == "独木舟") {
cout << "独木舟上没有任何防御武器" << endl;
cout << "是否进入全速耗油模式,1yes,2no" << endl;
cin >> sinput;
if (sinput == 1) {
cout << "你开启了加速模式" << endl;
cout << "输入1加速" << endl;
while (cin >> inint) {
if (inint == 1) {
mout("加速中...");
data[52] -= 0.2;
}
suiji = rand() % 5 + 0;
if (suiji >= 2 && suiji <= 4) {
cout << "你成功的躲避了海盗的袭击" << endl;
Sleep(1000);
cout << "你朝周围一看——" << endl;
Sleep(1000);
cout << "你回到了你的小岛上" << endl;
return;
}
if (data[52] < 1) {
cout << "你没油了" << endl;
Sleep(1000);
cout << "你被海盗抓住了" << endl;
cout << "海盗抢走了你的独木舟" << endl;
data[13]--;
return;
}
else {
cout << "你被海盗抓住了" << endl;
cout << "海盗抢走了你的独木舟" << endl;
Sleep(2000);
data[13]--;
return;
}
}
}
else {
cout << "你被海盗俘虏了" << endl;
cout << "海盗抢走了你的独木舟" << endl;
Sleep(1000);
cout << "你拼尽全力游回了小岛" << endl;
Sleep(1000);
data[13]--;
return;
}
}
if (root == "小艇") {
cout << "小艇上有一根铁杆" << endl;
Sleep(1000);
cout << "1和海盗战斗,2全速逃离" << endl;
cin >> sinput;
if (sinput == 2) {
cout << "你开启了加速模式" << endl;
cout << "为了提升速度,你扔掉了铁杆" << endl;
Sleep(1000);
cout << "输入1加速" << endl;
while (cin >> inint) {
if (inint == 1) {
mout("加速中...");
data[52] -= 0.2;
}
suiji = rand() % 5 + 0;
if (suiji >= 2 && suiji <= 4) {
cout << "你成功的躲避了海盗的袭击" << endl;
Sleep(1000);
cout << "你朝周围一看——" << endl;
Sleep(1000);
cout << "你回到了你的小岛上" << endl;
return;
}
if (data[52] < 1) {
cout << "你没油了" << endl;
Sleep(1000);
cout << "你被海盗抓住了" << endl;
cout << "海盗抢走了你的小艇" << endl;
data[14]--;
return;
}
else {
cout << "你被海盗抓住了" << endl;
cout << "海盗抢走了你的小艇" << endl;
Sleep(2000);
data[14]--;
return;
}
}
}
else {
cout << "你开始和海盗战斗" << endl;
int dxl = rand() % 1000 + 50;
while (data[19] > 0 && dxl > 0) {
dxl -= 64;
cout << "你用铁杆打击海盗,海盗-64滴血" << endl;
Sleep(500);
data[19] -= 80;
cout << "海盗拿着铁棍朝你冲过来,你-80滴血" << endl;
Sleep(500);
}
if (data[19] <= 0) {
cout << "你被海盗扔回了小岛" << endl;
cout << "你的小艇没了" << endl;
data[14]--;
return;
}
else {
cout << "你击败了海盗" << endl;
Sleep(1000);
return;
}
}
}
if (root == "战舰") {
cout << "战舰上有一些武器" << endl;
Sleep(1000);
cout << "1和海盗战斗,2全速逃离" << endl;
cin >> sinput;
if (sinput == 2) {
cout << "你开启了加速模式" << endl;
cout << "为了提升速度,你扔掉了武器" << endl;
Sleep(1000);
cout << "输入1加速" << endl;
while (cin >> inint) {
if (inint == 1) {
mout("加速中...");
data[52] -= 0.2;
}
suiji = rand() % 5 + 0;
if (suiji >= 2 && suiji <= 4) {
cout << "你成功的躲避了海盗的袭击" << endl;
Sleep(1000);
cout << "你朝周围一看——" << endl;
Sleep(1000);
cout << "你回到了你的小岛上" << endl;
return;
}
if (data[52] < 1) {
cout << "你没油了" << endl;
Sleep(1000);
cout << "你被海盗抓住了" << endl;
cout << "海盗抢走了你的战舰" << endl;
data[15]--;
return;
}
else {
cout << "你被海盗抓住了" << endl;
cout << "海盗抢走了你的战舰" << endl;
Sleep(2000);
data[15]--;
return;
}
}
}
else {
cout << "你开始和海盗战斗" << endl;
int dxl = rand() % 1000 + 50;
while (data[19] > 0 && dxl > 0) {
dxl -= 100;
cout << "你用武器打击海盗,海盗-100滴血" << endl;
Sleep(500);
data[19] -= 120;
cout << "海盗拿着火箭筒朝你冲过来,你-120滴血" << endl;
Sleep(500);
}
if (data[19] <= 0) {
cout << "你被海盗扔回了小岛" << endl;
cout << "你的战舰没了" << endl;
data[15]--;
return;
}
else {
cout << "你击败了海盗" << endl;
Sleep(1000);
return;
}
}
}
if (root == "潜艇") {
cout << "潜艇上有好多<?)))><<雷" << endl;
Sleep(1000);
cout << "1和海盗战斗,2全速逃离" << endl;
cin >> sinput;
if (sinput == 2) {
cout << "你开启了加速模式" << endl;
cout << "为了提升速度,你扔掉了鱼雷" << endl;
Sleep(1000);
cout << "输入1加速" << endl;
while (cin >> inint) {
if (inint == 1) {
mout("加速中...");
data[52] -= 0.2;
}
suiji = rand() % 5 + 0;
if (suiji >= 2 && suiji <= 4) {
cout << "你成功的躲避了海盗的袭击" << endl;
Sleep(1000);
cout << "你朝周围一看——" << endl;
Sleep(1000);
cout << "你回到了你的小岛上" << endl;
return;
}
if (data[52] < 1) {
cout << "你没油了" << endl;
Sleep(1000);
cout << "你被海盗抓住了" << endl;
cout << "海盗抢走了你的潜艇" << endl;
data[15]--;
return;
}
else {
cout << "你被海盗抓住了" << endl;
cout << "海盗抢走了你的潜艇" << endl;
Sleep(2000);
data[16]--;
return;
}
}
}
else {
cout << "你开始和海盗战斗" << endl;
int dxl = rand() % 1000 + 50;
while (data[19] > 0 && dxl > 0) {
dxl -= 120;
cout << "你用鱼雷打击海盗,海盗-120滴血" << endl;
Sleep(500);
data[19] -= 130;
cout << "海盗朝你狂扔水雷,你-130滴血" << endl;
Sleep(500);
}
if (data[19] <= 0) {
cout << "你被海盗扔回了小岛" << endl;
cout << "你的潜艇没了" << endl;
data[16]--;
return;
}
else {
cout << "你击败了海盗" << endl;
Sleep(1000);
return;
}
}
}
if (root == "航空母舰") {
cout << "航母上有好多高科技武器" << endl;
Sleep(1000);
cout << "1和海盗战斗,2全速逃离" << endl;
cin >> sinput;
if (sinput == 2) {
cout << "你开启了加速模式" << endl;
cout << "为了提升速度,你扔掉了鱼雷" << endl;
Sleep(1000);
cout << "输入1加速" << endl;
while (cin >> inint) {
if (inint == 1) {
mout("加速中...");
data[52] -= 0.2;
}
suiji = rand() % 5 + 0;
if (suiji >= 2 && suiji <= 4) {
cout << "你成功的躲避了海盗的袭击" << endl;
Sleep(1000);
cout << "你朝周围一看——" << endl;
Sleep(1000);
cout << "你回到了你的小岛上" << endl;
return;
}
if (data[52] < 1) {
cout << "你没油了" << endl;
Sleep(1000);
cout << "你被海盗抓住了" << endl;
cout << "海盗抢走了你的航母" << endl;
data[17]--;
return;
}
else {
cout << "你被海盗抓住了" << endl;
cout << "海盗抢走了你的航母" << endl;
Sleep(2000);
data[17]--;
return;
}
}
}
else {
cout << "你开始和海盗战斗" << endl;
int dxl = rand() % 1000 + 50;
while (data[19] > 0 && dxl > 0) {
dxl -= 120;
cout << "你用机关炮打击海盗,海盗-150滴血" << endl;
Sleep(500);
data[19] -= 130;
cout << "海盗朝你扔大刀,你-145滴血" << endl;
Sleep(500);
}
if (data[19] <= 0) {
cout << "你被海盗扔回了小岛" << endl;
cout << "你的航母没了" << endl;
data[17]--;
return;
}
else {
cout << "你击败了海盗" << endl;
Sleep(1000);
return;
}
}
}
if (root == "核潜艇") {
cout << "核潜艇上有核导弹" << endl;
Sleep(1000);
cout << "1和海盗战斗,2全速逃离" << endl;
cin >> sinput;
if (sinput == 2) {
cout << "你开启了加速模式" << endl;
cout << "为了提升速度,你扔掉了鱼雷" << endl;
Sleep(1000);
cout << "输入1加速" << endl;
while (cin >> inint) {
if (inint == 1) {
mout("加速中...");
data[52] -= 0.2;
}
suiji = rand() % 5 + 0;
if (suiji >= 2 && suiji <= 4) {
cout << "你成功的躲避了海盗的袭击" << endl;
Sleep(1000);
cout << "你朝周围一看——" << endl;
Sleep(1000);
cout << "你回到了你的小岛上" << endl;
return;
}
if (data[52] < 1) {
cout << "你没油了" << endl;
Sleep(1000);
cout << "你被海盗抓住了" << endl;
cout << "海盗抢走了你的核潜艇" << endl;
data[18]--;
return;
}
else {
cout << "你被海盗抓住了" << endl;
cout << "海盗抢走了你的核潜艇" << endl;
Sleep(2000);
data[18]--;
return;
}
}
}
else {
cout << "你开始和海盗战斗" << endl;
int dxl = rand() % 1000 + 50;
while (data[19] > 0 && dxl > 0) {
dxl -= 120;
cout << "你用机关炮打击海盗,海盗-150滴血" << endl;
Sleep(500);
data[19] -= 130;
cout << "海盗朝你扔大刀,你-145滴血" << endl;
Sleep(500);
}
if (data[19] <= 0) {
cout << "你被海盗扔回了小岛" << endl;
cout << "你的航母没了" << endl;
data[17]--;
return;
}
else {
cout << "你击败了海盗" << endl;
Sleep(1000);
return;
}
}
}
}
void sea_nopeopleisland() {
cout << "你来到了一个小岛上" << endl;
Sleep(1000);
cout << "你仔细的观察了小岛,发现这是一个无人岛" << endl;
Sleep(1000);
cout << "你十分失望,准备离开" << endl;
Sleep(1000);
cout << "就在这时,一只老虎扑了出来" << endl;
Sleep(1000);
cout << "1逃跑,2战斗" << endl;
cin >> sinput;
if (sinput == 1) {
cout << "你立刻上了船,回到你的小岛上" << endl;
Sleep(1000);
return;
}
cout << "你随手拿起一根木棍,开始战斗";
int dxl = rand() % 1000 + 100;
while (data[19] > 0 && dxl > 0) {
cout << "你剪掉了80滴血" << endl;
Sleep(1000);
data[19] -= 80;
cout << "对方剪掉了75第血" << endl;
dxl -= 75;
Sleep(1000);
}
if (dxl <= 0) {
cout << "你把老虎干掉了并回到了你自己的小岛上" << endl;
Sleep(1000);
return;
}
else {
cout << "你被老虎咬死了" << endl;
Sleep(1000);
return;
}
}
void sea_peopleisland() {
int qwq;
cout << "你来到了一个小岛上,上面有人..." << endl;
Sleep(1000);
cout << "你和他们开始了交易..." << endl;
while (qwq != '*') {
cout << "当地人:" << endl;
cout << "你想要什么?" << endl;
cout << "1弓箭 15铁" << endl;
cout << "2火炮 5金刚石" << endl;
cout << "3粽子 8金刚石" << endl;
cout << "4护甲 9金刚石" << endl;
cout << "输入10退出" << endl;
cin >> qwq;
if (qwq == 1) {
if (data[3] < 15) {
cout << "你的材料不够,交易无法进行" << endl;
continue;
}
cout << "交易成功" << endl;
data[3] -= 15;
data[38]++;
}
if (qwq == 2) {
if (data[2] < 5) {
cout << "你的材料不够,交易无法进行" << endl;
}
cout << "交易成功" << endl;
data[2] -= 5;
data[39]++;
}
if (qwq == 3) {
if (data[2] < 8) {
cout << "你的材料不够,交易无法进行" << endl;
continue;
}
cout << "交易成功" << endl;
data[2] -= 8;
data[41]++;
}
if (qwq == 4) {
if (data[2] < 9) {
cout << "你的材料不够,交易无法进行" << endl;
continue;
}
cout << "交易成功" << endl;
data[2] -= 9;
data[40]++;
}
else
return;
}
}
void sea_way() {
cout << "你在海上漂啊飘" << endl;
Sleep(1000);
cout << "你发现周围什么也没有" << endl;
Sleep(1000);
mout("三天后...");
cout << "你回到了自己的小岛" << endl;
}
void buy_sell() {
if (data[13] < 1 || data[14] < 1 || data[15] < 1 || data[16] < 1 || data[17] < 1 || data[18] < 1) {
cout << "你没有船只,请使用小岛商店" << endl;
Sleep(1000);
return;
}
cout << "海上充满着未知,要继续吗?1yes,2no" << endl;
cin >> sinput;
if (data[52] < 1) {
cout << "你没有油!" << endl;
Sleep(1000);
return;
}
if (sinput == 1)
return;
part15:
cout << "请选择船只:" << endl;
outcz();
cin >> sinput;
cout << "1独木舟:" << data[13] << endl;
cout << "2小艇:" << data[14] << endl;
cout << "3战舰:" << data[15] << endl;
cout << "4潜艇:" << data[16] << endl;
cout << "5航空母舰:" << data[17] << endl;
cout << "6核潜艇:" << data[18] << endl;
switch (sinput) {
case 1: {
if (data[13] < 1) {
cout << "你没有独木舟" << endl;
Sleep(1000);
goto part15;
}
root = "独木舟";
rootdh = data[13];
break;
}
case 2: {
if (data[14] < 1) {
cout << "你没有小艇" << endl;
Sleep(1000);
goto part15;
}
root = "小艇";
rootdh = data[14];
break;
}
case 3: {
if (data[15] < 1) {
cout << "你没有战舰" << endl;
Sleep(1000);
goto part15;
}
root = "战舰";
rootdh = data[15];
break;
}
case 4: {
if (data[16] < 1) {
cout << "你没有潜艇" << endl;
Sleep(1000);
goto part15;
}
root = "潜艇";
rootdh = data[16];
break;
}
case 5: {
if (data[17] < 1) {
cout << "你没有航空母舰" << endl;
Sleep(1000);
goto part15;
}
root = "航空母舰";
rootdh = data[17];
break;
}
case 6: {
if (data[18] < 1) {
cout << "你没有核潜艇" << endl;
Sleep(1000);
goto part15;
}
root = "核潜艇";
rootdh = data[18];
break;
}
}
part13:
system("cls");
mout("你登上了船只,开始航行...");
for (int i = 1; i <= 10; i++) {
cout << "..." << endl;
Sleep(1000);
}
suiji = rand() % 4 + 1;
switch (suiji) {
case 1: {
sea_hd();
cout << "是否退出,1yes,2no" << endl;
cin >> sinput;
if (sinput == 1)
return;
else
goto part13;
break;
}
case 2: {
sea_way();
cout << "是否退出,1yes,2no" << endl;
cin >> sinput;
if (sinput == 1)
return;
else
goto part13;
break;
}
case 3: {
sea_nopeopleisland();
cout << "是否退出,1yes,2no" << endl;
cin >> sinput;
if (sinput == 1)
return;
else
goto part13;
break;
}
case 4: {
sea_peopleisland();
cout << "是否退出,1yes,2no" << endl;
cin >> sinput;
if (sinput == 1)
return;
else
goto part13;
break;
}
}
}
void island_bs() {
cout << "你来到小岛商店" << endl;
Sleep(1000);
cout << "交易的客户已经有了好多人" << endl;
Sleep(1000);
cout << "你开始交易:" << endl;
int people = rand() % 15 + 5;
while (people > 0) {
int suiji1 = rand() % 10 + 0;
cout << "客户:" << endl;
int suiji2 = rand() % 15 + 6;
suiji = rand() % 20 + 5;
cout << "我有" << kuangwu[suiji1] << "," << "要" << suiji2 << "金刚石" << endl;
cout << "是否交易1yes,2no" << endl;
cin >> sinput;
if (sinput == 1) {
if (data[2] < suiji2) {
cout << "你没有这些金刚石" << endl;
continue;
}
cout << "开始交易..." << endl;
Sleep(1000);
cout << "交易成功" << endl;
Sleep(1000);
data[2] -= suiji2;
if (suiji1 == 0) data[2] += suiji;
if (suiji1 == 1) data[3] += suiji;
if (suiji1 == 2) data[4] += suiji;
if (suiji1 == 3) data[5] += suiji;
if (suiji1 == 4) data[6] += suiji;
if (suiji1 == 5) data[7] += suiji;
if (suiji1 == 6) data[35] += suiji;
if (suiji1 == 7) data[36] += suiji;
if (suiji1 == 8) data[37] += suiji;
if (suiji1 == 9) data[45] += suiji;
if (suiji1 == 10) data[46] += suiji;
}
people--;
cout << "下一个人" << endl;
Sleep(1000);
}
cout << "交易完毕" << endl;
Sleep(1000);
return;
}
void island_jz() {
int djia = 1;
int injg;
cout << "1精卫填海,2退出" << endl;
cin >> sinput;
if (sinput == 1) {
cout << "你开始填海" << endl;
cout << "请输入你要填多大的海(填海过程中不可退出)" << endl;
cin >> sinput;
while (sinput > 0) {
system("cls");
mout("填海中...");
Sleep(1000);
data[21] += 0.1;
sinput--;
}
}
else
return;
}
void island() {
cout << "1小岛商店,2扩建小岛,3退出" << endl;
cin >> sinput;
if (sinput == 1)
island_bs();
if (sinput == 2)
island_jz();
else
return;
}
void black() {
int cinput;
cout << "你来到黑市" << endl;
Sleep(1000);
cout << "黑市看门的:" << ":入场费15铁" << endl;
Sleep(1000);
if (data[3] < 15) {
cout << "你没有入场费,你被扔出了黑市" << endl;
Sleep(1000);
return;
}
data[3] -= 15;
cout << "你进入了黑市,发现里面什么都有" << endl;
partn:
system("cls");
cout << "你要买什么?" << endl;
cout << "1基础,2装备,3小岛 4退出" << endl;
cin >> sinput;
switch (sinput) {
case 1: {
cout << "1血量 2防御 3攻击 " << endl;
cin >> cinput;
if (cinput == 1) {
cout << "你要买多少?" << endl;
cin >> cinput;
if (cinput > 1000000) {
cout << "你太贪心了,你被扔出了黑市" << endl;
Sleep(1000);
return;
}
int jiage = rand() % 1000 + 100;
jiage += cinput;
cout << "价格:" << jiage << "银,1买,2退出" << endl;
cin >> sinput;
if (sinput == 2) {
goto partn;
}
if (data[6] < jiage) {
cout << "你没有钱" << endl;
Sleep(1000);
goto partn;
}
cout << "交易成功" << endl;
Sleep(1000);
data[19] += cinput;
data[6] -= jiage;
goto partn;
}
else if (cinput == 2) {
cout << "你要买多少?" << endl;
cin >> cinput;
if (cinput > 1000000) {
cout << "你太贪心了,你被扔出了黑市" << endl;
Sleep(1000);
return;
}
int jiage = rand() % 1000 + 100;
jiage += cinput + cinput * 0.1;
cout << "价格:" << jiage << "煤炭,1买,2退出" << endl;
cin >> sinput;
if (sinput == 2) {
goto partn;
}
if (data[7] < jiage) {
cout << "你没有钱" << endl;
Sleep(1000);
goto partn;
}
cout << "交易成功" << endl;
Sleep(1000);
data[22] += cinput;
data[7] -= jiage;
goto partn;
}
else if (cinput == 3) {
cout << "你要买多少?" << endl;
cin >> cinput;
if (cinput > 1000000) {
cout << "你太贪心了,你被扔出了黑市" << endl;
Sleep(1000);
return;
}
int jiage = rand() % 1000 + 100;
jiage += cinput + cinput * 0.2;
cout << "价格:" << jiage << "铜,1买,2退出" << endl;
cin >> sinput;
if (sinput == 2) {
goto partn;
}
if (data[4] < jiage) {
cout << "你没有钱" << endl;
Sleep(1000);
goto partn;
}
cout << "交易成功" << endl;
Sleep(1000);
data[20] += cinput;
data[4] -= jiage;
goto partn;
}
break;
}
case 2: {
cout << "1油漆 2按钮 3钱 " << endl;
cin >> cinput;
if (cinput == 1) {
cout << "你要买多少?" << endl;
cin >> cinput;
if (cinput > 1000000) {
cout << "你太贪心了,你被扔出了黑市" << endl;
Sleep(1000);
return;
}
int jiage = rand() % 1000 + 100;
jiage += cinput;
cout << "价格:" << jiage << "铁,1买,2退出" << endl;
cin >> sinput;
if (sinput == 2) {
goto partn;
}
if (data[3] < jiage) {
cout << "你没有钱" << endl;
Sleep(1000);
goto partn;
}
cout << "交易成功" << endl;
Sleep(1000);
data[47] += cinput;
data[3] -= jiage;
goto partn;
}
else if (cinput == 2) {
cout << "你要买多少?" << endl;
cin >> cinput;
if (cinput > 1000000) {
cout << "你太贪心了,你被扔出了黑市" << endl;
Sleep(1000);
return;
}
int jiage = rand() % 1000 + 100;
jiage += cinput + cinput * 0.1;
cout << "价格:" << jiage << "银,1买,2退出" << endl;
cin >> sinput;
if (sinput == 2) {
goto partn;
}
if (data[7] < jiage) {
cout << "你没有钱" << endl;
Sleep(1000);
goto partn;
}
cout << "交易成功" << endl;
Sleep(1000);
data[37] += cinput;
data[6] -= jiage;
goto partn;
}
else if (cinput == 3) {
cout << "你要买多少?" << endl;
cin >> cinput;
if (cinput > 1000000) {
cout << "你太贪心了,你被扔出了黑市" << endl;
Sleep(1000);
return;
}
int jiage = rand() % 1000 + 100;
jiage += cinput + cinput * 0.2;
cout << "价格:" << jiage << "铜,1买,2退出" << endl;
cin >> sinput;
if (sinput == 2) {
goto partn;
}
if (data[4] < jiage) {
cout << "你没有钱" << endl;
Sleep(1000);
goto partn;
}
cout << "交易成功" << endl;
Sleep(1000);
data[51] += cinput;
data[4] -= jiage;
goto partn;
}
case 3: {
cout << "1一座小岛:25000金刚石" << endl;
cin >> sinput;
if (sinput == 1) {
if (data[2] < 25000) {
cout << "钱不够" << endl;
Sleep(1000);
goto partn;
}
cout << "购买成功" << endl;
Sleep(1000);
data[21]++;
data[19] += 10000;
data[20] += 9000;
data[22] += 8000;
data[24] += 5000;
goto partn;
}
else
goto partn;
break;
}
case 4: {
return;
break;
}
}
}
}
void konghanshu() {
return;
}
int main() {
indata();
int qwq;
srand((unsigned)time(NULL));//随机数
start();
dl();
zjm1:
system("cls");
cout << "血量:" << data[19] << endl;
cout << "攻击:" << data[20] << endl;
cout << "防御:" << data[22] << endl;
cout << "领地:" << data[21] << endl;
cout << "士兵人数:" << data[24] << endl;
cout << "0保存" << endl;
cout << "1山洞 2森林 3小木屋 4造船厂 5工地 6士兵宿舍" << endl;
cout << "7作战室 8设置 9合成屋 10合成表 11背包 12海上贸易 13查看小岛" << endl;
cout << "14黑市" << endl;
cin >> qwq;
switch (qwq) {
case 0: {
outdata();
goto zjm1;
break;
}
case 1: {
cave();
goto zjm1;
break;
}
case 2: {
woods();
goto zjm1;
break;
}
case 3: {
xmw();
goto zjm1;
break;
}
case 4: {
gzs();
goto zjm1;
break;
}
case 5: {
kfz();
goto zjm1;
break;
}
case 6: {
sbssj();
goto zjm1;
break;
}
case 7: {
zzs();
goto zjm1;
break;
}
case 8: {
shez();
goto zjm1;
break;
}
case 9: {
makeroom();
goto zjm1;
break;
}
case 10: {
makebiao();
goto zjm1;
break;
}
case 11: {
bag();
goto zjm1;
break;
}
case 12: {
buy_sell();
goto zjm1;
break;
}
case 13: {
island();
goto zjm1;
break;
}
case 14: {
black();
goto zjm1;
break;
}
}
return 0;
}