#include<bits/stdc++.h>
#include<Windows.h>
#include <iostream>
#include <conio.h>
#include <time.h>
#include <cstdlib>
#include <vector>
using namespace std;
typedef struct Frame
{
COORD position[2];
}Frame;
int to_int(float a) {if(a>0) return int(a+0.5);else if(a<0) return int(-a-0.5);if(a==0) return 0;}
//绝对值四舍五入
float Sin(int a) {return sin(3.1416*a/180);}
float Cos(int a) {return cos(3.1416*a/180);}
//多少度。例:Sin(30)=0.5
float SinP(int a) {return sin(3.1416*a);}
float CosP(int a) {return cos(3.1416*a);}
//多少pai。例:SinP(1)=0
bool dark = false;
void Color(int a)
{
if(dark) return;
//白
if(a==0) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
//绿
if(a==1) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN);
//红
if(a==2) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED);
//蓝
if(a==3) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_BLUE);
//粉
if(a==4) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_BLUE);
//黄
if(a==5) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN);
//灰
if(a==6) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
//棕
if(a==7) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_GREEN);
//紫
if(a==8) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_BLUE);
//随机
if(a == -1) Color(rand() % 8);
}
void SetPos(COORD a)// set cursor
{
HANDLE out=GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(out, a);
}
void SetPos(int i, int j)// set cursor
{
COORD pos={short(i), short(j)};
SetPos(pos);
}
void HideCursor()
{
CONSOLE_CURSOR_INFO cursor_info = {1, 0};
SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info);
}
char input()
{
while(1)
{
if(_kbhit())
{
return _getch();
}
}
}
char input(int i, int j)
{
while(1)
{
char x = input();
if(x >= i && x <= j) return x;
}
}
//在[a, b)之间产生一个随机整数
int random(int a, int b)
{
int c=(rand() % (a-b))+ a;
return c;
}
struct BLOCK
{
int id;
string txt;
int color;
int hard;
int level; //挖掘等级(0=徒手 1=木 2=石 3=铁 4=钻石 5=合金)
string name;
bool fluid; //是否为流体(可以穿越 能够替换成方块)
};
BLOCK block[] = //方块
{
{0, "□", 0, 2000000000, 100, "基岩", false},
{1, "■", 6, 200, 1, "石头", false},
{2, "▓ ", 7, 45, 0, "泥土", false},
{3, "▓ ", 6, 45, 0, "砂砾", false},
{4, "■", 5, 55, 0, "木头", false},
{5, "※", 0, 300, 2, "铁矿石", false},
{6, "∷", 0, 500, 2, "铁块", false},
{7, "※", 5, 340, 3, "金矿石", false},
{8, "∷", 5, 600, 3, "金块", false},
{9, "※", 3, 480, 3, "钻石矿石", false},
{10, "∷", 3, 900, 3, "钻石块", false},
{11, "▓ ", 1, 10, 0, "树叶", false},
{12, "■", 3, 2000000000, 100, "水", true},
{13, "□", 2, 2000000000, 100, "岩浆", true},
{14, "□", 0, 5000, 4, "真正的基岩", false},
{15, "■", 4, 25, 0, "地狱岩", false},
{16, "□", 4, 2000, 4, "远古残骸", false},
{17, "∷", 4, 3000, 4, "下界合金块", false},
{18, "■", 2, 2000000000, 100, "地幔", true},
{19, " ", 0, 2000000000, 100, "空气", true},
{20, "●", 4, 1500, 3, "海洋之星", false},
{21, "□", 3, 1000, 3, "海能石", false},
{22, "※", 1, 600, 3, "绿宝石矿石", false},
{23, "∷", 1, 800, 3, "绿宝石块", false},
{24, "■", 7, 1200, 1, "神殿方块", false},
{25, "<>", 2, 2000, 2, "神殿核心", false},
{26, "于", 2, 2000, 1, "于苗晶体A", false},
{27, "苗", 2, 2000, 1, "于苗晶体B", false},
{28, "{}", 3, 2750, 1, "宝藏锚点", false},
{29, "■", 1, 1000, 0, "TNT", false},
{30, "■", 4, 1000, 0, "二倍TNT", false},
{31, "■", 2, 1000, 0, "四倍TNT", false},
{32, "■", 5, 1000, 0, "八倍TNT", false},
{33, "■", 3, 80000, 2, "地牢石", false},
{34, "※", 3, 160000, 4, "魂石", false},
{35, "▓ ", 3, 2000000000, 100, "死水", true},
{36, "■", 5, 440, 2, "下界砖", false},
{37, "箱", 5, 200, 0, "箱子", false},
{38, "■", 8, 2000000000, 100, "激光", false},
{39, "▲", -1, 12000, 2, "BOSS祭坛", false},
{40, "Go", -1, 666888999, 0, "新手教程用的标靶", false},
{41, "※", 4, 2000000000, 100, "混沌激流", false},
{42, "※", -1, 2000000000, 100, "混沌之星", false}
};
const int block_max = 42;
struct ITEM
{
int id;
int hurt;
int speed; //每个短刻的挖掘进度
int level;
string name;
int rare; //稀有度 白0<绿1<蓝2<紫3<幻4
};
ITEM item[] = //物品
{
{0, 0, 0, 0, "空气", 0},
{1, 2, 25, 1, "木镐", 0},
{2, 5, 0, 1, "木剑", 0},
{3, 3, 50, 2, "石镐", 0},
{4, 6, 0, 2, "石剑", 0},
{5, 0, 0, 0, "铁锭", 0},
{6, 5, 90, 3, "铁镐", 0},
{7, 9, 0, 3, "铁剑", 0},
{8, 0, 0, 0, "金锭", 1},
{9, 3, 40, 3, "金镐", 1},
{10, 6, 0, 3, "金剑", 1},
{11, 0, 0, 0, "钻石", 2},
{12, 6, 240, 4, "钻石镐", 2},
{13, 12, 0, 4, "钻石剑", 2},
{14, 0, 0, 0, "下界合金碎片", 3},
{15, 0, 0, 0, "下界合金锭", 3},
{16, 7, 1000, 5, "下界合金镐", 3},
{17, 15, 0, 5, "下界合金剑", 3},
{18, 0, 0, 0, "桶", 0},
{19, 0, 0, 0, "水桶", 0},
{20, 0, 0, 0, "岩浆桶", 0},
{21, 0, 0, 0, "药水量子", 3},
{22, 0, 0, 0, "强化量子", 3},
{23, 0, 0, 0, "绿宝石", 2},
{24, 5, 200, 4, "绿宝石镐", 2},
{25, 11, 0, 4, "绿宝石剑", 2},
{26, 0, 100, 0, "海洋创造锤", 3},
{27, 0, 0, 0, "无尽核心", 4},
{28, 0, 0, 0, "宝藏探测器", 4},
{29, 0, 0, 0, "死水桶", 0},
{30, 0, 0, 0, "灵魂之星", 3},
{31, 14, 1600, 5, "灵魂镐", 3},
{32, 18, 0, 5, "灵魂剑", 3},
{33, 1000, 0, 5, "调试用", 3}
};
const int item_max = 33;
struct ARMOR
{
int id;
int defease; //最高为20 可抵御(defease*4)%伤害
string name;
};
ARMOR armor[] = //盔甲
{
{0, 0, "空"},
{1, 4, "木盔甲"},
{2, 8, "石盔甲"},
{3, 12, "铁盔甲"},
{4, 16, "钻石盔甲"},
{5, 20, "下界合金盔甲"}
};
struct BUFF
{
int id;
string name;
int level; //等级 默认为0 1级以上显示在玩家属性页面中
int time; //单位: short_tick 降至0后等级降至0级
};
BUFF buff[] = //效果
{
{0, "空", 0, 0},
{1, "生命提升", 0, 0},
{2, "急迫", 0, 0},
{3, "生命吸收", 0, 0},
{4, "中毒", 0, 0}
};
const int buff_max = 4;
string buff_str[] = //效果简介
{
"空效果",
"能够提升生命值 每级提升4点生命值",
"能够加快挖掘速度 每级提升25%挖掘速度",
"获得护盾 每级提升1点免伤值",
"负面效果 每级每个构造刻受到1点伤害"
};
struct ENTITY
{
int type;
string name;
string txt;
int color;
int hp;
int ap;
bool power; //能否摧毁沿路方块
bool boss;
int xp;
int x;
int y;
};
ENTITY entity[] =
{
{0, "普通小怪", "[]", 2, 50, 5, false, false, 3, 0, 0},
{1, "精英小怪", "[]", 5, 100, 10, false, false, 6, 0, 0},
{2, "王者小怪", "<>", 5, 200, 20, true, false, 12, 0, 0},
{3, "守卫", "▼", 7, 600, 60, true, true, 300, 0, 0},
{4, "TNT", "炸", 1, 10, 0, false, false, 0, 0, 0},
{5, "双倍TNT", "炸", 4, 15, 0, false, false, 0, 0, 0},
{6, "四倍TNT", "炸", 2, 20, 0, false, false, 0, 0, 0},
{7, "八倍TNT", "炸", 5, 100, 0, false, false, 0, 0, 0}
};
const int entity_max = 7;
int gamemode = 0; //0=生存 1=创造 2=极限
int short_tick = 0, tick = 0; //短刻(每秒10次)和构造刻(每秒1次)
BLOCK world[2400][1200]; //地图 x0~2399 y0~1199
BLOCK fkl[5]; //方块栏
ITEM wpl[5]; //物品栏
int box_fk_num[block_max]; //箱子方块栏
int box_wp_num[item_max]; //箱子物品栏
ARMOR kjl = armor[0]; //盔甲栏 做出盔甲立即替换
const int xgmax = 5; //可获得的效果总数
BUFF xgl[xgmax]; //效果栏
int xgnum; //已拥有BUFF
int fknum[5], wpnum[5]; //数量(max:64)
int now = 0; //目前手持方块/物品 0~4方块 5~9物品
int playerx = 1200, playery = 700; //冒险者 坐标
ENTITY stl[1000]; //实体栏
int st_num = 0; //实体数量
double health = 20; //生命
double max_health = 20; //生命值上限
int oxygen = 20; //氧气
int energy = 0; //跳跃能量
int wjjd = 0; //挖掘进度
int zhuiluo = 0; //连续坠落格数
int level = 0, xp = 0; //等级、经验
bool tick_attack = false; //本tick是否受伤
int yindao = -1; //是否新手引导
void print_data();
void input_data();
//地牢结构
int dilao_jiegou[27][29] = {
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2},
{2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 2},
{2, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 1, 1, 2, 3, 3, 2, 5, 5, 5, 5, 5, 5, 2, 3, 3, 3, 3, 2},
{2, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 1, 1, 2, 3, 3, 2, 5, 5, 5, 5, 5, 5, 2, 3, 3, 3, 3, 2},
{2, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 1, 1, 2, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 2},
{2, 3, 3, 3, 2, 2, 3, 3, 3, 2, 1, 1, 1, 2, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2},
{2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 1, 1, 1, 2, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2},
{2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 1, 1, 1, 2, 3, 3, 2, 3, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 2},
{2, 3, 3, 3, 2, 2, 3, 3, 3, 2, 1, 1, 1, 2, 2, 2, 2, 3, 2, 2, 3, 3, 3, 2, 2, 2, 2, 2, 2},
{2, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 1, 1, 1, 2, 2, 3, 3, 2, 2, 3, 3, 3, 2, 1, 1, 1, 1, 1},
{2, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 3, 3, 2, 1, 1, 1, 1, 1},
{2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 2, 2, 2, 2, 2},
{2, 2, 2, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 2},
{1, 1, 2, 3, 3, 2, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 2, 4, 4, 2, 3, 3, 3, 3, 3, 3, 3, 2},
{1, 1, 2, 3, 3, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2},
{1, 1, 2, 3, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 3, 3, 2, 1, 1, 1, 1, 1, 1},
{1, 1, 2, 3, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1},
{1, 1, 2, 3, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 2, 3, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1}
};
//下界城市
//核心
int nc_core[9][9] =
{
{0, 0, 0, 1, 2, 1, 0, 0, 0},
{0, 0, 1, 1, 2, 1, 1, 0, 0},
{0, 1, 1, 2, 2, 2, 1, 1, 0},
{1, 1, 2, 2, 2, 2, 2, 1, 1},
{2, 2, 2, 2, 2, 2, 2, 2, 2},
{1, 1, 2, 2, 2, 2, 2, 1, 1},
{0, 1, 1, 2, 2, 2, 1, 1, 0},
{0, 0, 1, 1, 2, 1, 1, 0, 0},
{0, 0, 0, 1, 2, 1, 0, 0, 0}
};
//水平廊道
int nc_cz_ld[9][9] =
{
{0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0},
{1, 1, 1, 1, 1, 1, 1, 1, 1},
{2, 2, 2, 2, 2, 2, 2, 2, 2},
{1, 1, 1, 1, 1, 1, 1, 1, 1},
{0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0}
};
//垂直廊道
int nc_sp_ld[9][9] =
{
{0, 0, 0, 1, 2, 1, 0, 0, 0},
{0, 0, 0, 1, 2, 1, 0, 0, 0},
{0, 0, 0, 1, 2, 1, 0, 0, 0},
{0, 0, 0, 1, 2, 1, 0, 0, 0},
{0, 0, 0, 1, 2, 1, 0, 0, 0},
{0, 0, 0, 1, 2, 1, 0, 0, 0},
{0, 0, 0, 1, 2, 1, 0, 0, 0},
{0, 0, 0, 1, 2, 1, 0, 0, 0},
{0, 0, 0, 1, 2, 1, 0, 0, 0}
};
//新手教程地图1:移动教程
int junior_map_1[7][20] =
{
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 0},
{ 0, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 19, 0},
{ 0, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 0},
{ 0, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
};
void block_copy(int x, int y, int id) //将一个方块放置到某个坐标
{
world[x][y].id = id;
world[x][y].txt = block[id].txt;
world[x][y].color = block[id].color;
world[x][y].hard = block[id].hard;
world[x][y].name = block[id].name;
world[x][y].level = block[id].level;
world[x][y].fluid = block[id].fluid;
}
void init_junior() //新手教程
{
yindao = 0;
for(int x = 0;x < 2400;x++) //填充空气
{
for(int y = 0;y < 1200;y++) block_copy(x, y, 19);
}
playerx = 405, playery = 401;
for(int i = 0;i < 7;i++)
{
for(int j = 0;j < 20;j++)
{
block_copy(400 + j, 400 + i, junior_map_1[i][j]);
}
}
}
void chengshi(int x, int y) //下界城市的生成
{
queue<pair<pair<int, int>, int> > q;
int size = 5;
x /= 9;
y /= 9;
int nt = 1;
q.push({{x, y}, 1});
for(int i = 0;i < 9;i++)
{
for(int j = 0;j < 9;j++)
{
if(nt == 1)
{
if(nc_core[i][j] == 2)
{
block_copy(x * 9 + i, y * 9 + j, 19);
}
else if(nc_core[i][j] == 0) ;
else block_copy(x * 9 + i, y * 9 + j, 36);
}
else if(nt == 2)
{
if(nc_sp_ld[i][j] == 2)
{
block_copy(x * 9 + i, y * 9 + j, 19);
}
else if(nc_sp_ld[i][j] == 0);
else block_copy(x * 9 + i, y * 9 + j, 36);
}
else if(nt == 3)
{
if(nc_cz_ld[i][j] == 2)
{
block_copy(x * 9 + i, y * 9 + j, 19);
}
else if(nc_cz_ld[i][j] == 0) ;
else block_copy(x * 9 + i, y * 9 + j, 36);
}
}
}
nt = 2;
q.push({{x - 1, y}, 2});
for(int i = 0;i < 9;i++)
{
for(int j = 0;j < 9;j++)
{
if(nt == 1)
{
if(nc_core[i][j] == 2)
{
block_copy(x * 9 - 9 + i, y * 9 + j, 19);
}
else if(nc_core[i][j] == 0);
else block_copy(x * 9 - 9 + i, y * 9 + j, 36);
}
else if(nt == 2)
{
if(nc_sp_ld[i][j] == 2)
{
block_copy(x * 9 - 9 + i, y * 9 + j, 19);
}
else if(nc_sp_ld[i][j] == 0);
else block_copy(x * 9 - 9 + i, y * 9 + j, 36);
}
else if(nt == 3)
{
if(nc_cz_ld[i][j] == 2)
{
block_copy(x * 9 - 9 + i, y * 9 + j, 19);
}
else if(nc_cz_ld[i][j] == 0) ;
else block_copy(x * 9 - 9 + i, y * 9 + j, 36);
}
}
}
q.push({{x + 1, y}, 2});
for(int i = 0;i < 9;i++)
{
for(int j = 0;j < 9;j++)
{
if(nt == 1)
{
if(nc_core[i][j] == 2)
{
block_copy(x * 9 + 9 + i, y * 9 + j, 19);
}
else if(nc_core[i][j] == 0) ;
else block_copy(x * 9 + 9 + i, y * 9 + j, 36);
}
else if(nt == 2)
{
if(nc_sp_ld[i][j] == 2)
{
block_copy(x * 9 + 9 + i, y * 9 + j, 19);
}
else if(nc_sp_ld[i][j] == 0) ;
else block_copy(x * 9 + 9 + i, y * 9 + j, 36);
}
else if(nt == 3)
{
if(nc_cz_ld[i][j] == 2)
{
block_copy(x * 9 + 9 + i, y * 9 + j, 19);
}
else if(nc_cz_ld[i][j] == 0) ;
else block_copy(x * 9 + 9 + i, y * 9 + j, 36);
}
}
}
nt = 3;
q.push({{x, y - 1}, 3});
for(int i = 0;i < 9;i++)
{
for(int j = 0;j < 9;j++)
{
if(nt == 1)
{
if(nc_core[i][j] == 2)
{
block_copy(x * 9 + i, y * 9 - 9 + j, 19);
}
else if(nc_core[i][j] == 0) ;
else block_copy(x * 9 + i, y * 9 - 9 + j, 36);
}
else if(nt == 2)
{
if(nc_sp_ld[i][j] == 2)
{
block_copy(x * 9 + i, y * 9 - 9 + j, 19);
}
else if(nc_sp_ld[i][j] == 0) ;
else block_copy(x * 9 + i, y * 9 - 9 + j, 36);
}
else if(nt == 3)
{
if(nc_cz_ld[i][j] == 2)
{
block_copy(x * 9 + i, y * 9 - 9 + j, 19);
}
else if(nc_cz_ld[i][j] == 0) ;
else block_copy(x * 9 + i, y * 9 - 9 + j, 36);
}
}
}
q.push({{x, y + 1}, 3});
for(int i = 0;i < 9;i++)
{
for(int j = 0;j < 9;j++)
{
if(nt == 1)
{
if(nc_core[i][j] == 2)
{
block_copy(x * 9 + i, y * 9 + 9 + j, 19);
}
else if(nc_core[i][j] == 0);
else block_copy(x * 9 + i, y * 9 + 9 + j, 36);
}
else if(nt == 2)
{
if(nc_sp_ld[i][j] == 2)
{
block_copy(x * 9 + i, y * 9 + 9 + j, 19);
}
else if(nc_sp_ld[i][j] == 0) ;
else block_copy(x * 9 + i, y * 9 + 9 + j, 36);
}
else if(nt == 3)
{
if(nc_cz_ld[i][j] == 2)
{
block_copy(x * 9 + i, y * 9 + 9 + j, 19);
}
else if(nc_cz_ld[i][j] == 0) ;
else block_copy(x * 9 + i, y * 9 + 9 + j, 36);
}
}
}
while(!q.empty() && size < 24)
{
int nx = q.front().first.first;
int ny = q.front().first.second;
int nt = q.front().second;
q.pop();
if(rand() % 3 <= 1 && nt != 3)
{
q.push({{nx - 1, ny}, 2});
size++;
for(int i = 0;i < 9;i++)
{
for(int j = 0;j < 9;j++)
{
if(nt == 1)
{
if(nc_core[i][j] == 2)
{
block_copy(nx * 9 + i, ny * 9 + j, 19);
}
else if(nc_core[i][j] == 0) continue;
else block_copy(nx * 9 + i, ny * 9 + j, 36);
}
else if(nt == 2)
{
if(nc_sp_ld[i][j] == 2)
{
block_copy(nx * 9 + i, ny * 9 + j, 19);
}
else if(nc_sp_ld[i][j] == 0) continue;
else block_copy(nx * 9 + i, ny * 9 + j, 36);
}
else if(nt == 3)
{
if(nc_cz_ld[i][j] == 2)
{
block_copy(nx * 9 + i, ny * 9 + j, 19);
}
else if(nc_cz_ld[i][j] == 0) continue;
else block_copy(nx * 9 + i, ny * 9 + j, 36);
}
}
}
}
if(rand() % 3 <= 1 && nt != 3)
{
q.push({{nx + 1, ny}, 2});
size++;
for(int i = 0;i < 9;i++)
{
for(int j = 0;j < 9;j++)
{
if(nt == 1)
{
if(nc_core[i][j] == 2)
{
block_copy(nx * 9 + i, ny * 9 + j, 19);
}
else if(nc_core[i][j] == 0) continue;
else block_copy(nx * 9 + i, ny * 9 + j, 36);
}
else if(nt == 2)
{
if(nc_sp_ld[i][j] == 2)
{
block_copy(nx * 9 + i, ny * 9 + j, 19);
}
else if(nc_sp_ld[i][j] == 0) continue;
else block_copy(nx * 9 + i, ny * 9 + j, 36);
}
else if(nt == 3)
{
if(nc_cz_ld[i][j] == 2)
{
block_copy(nx * 9 + i, ny * 9 + j, 19);
}
else if(nc_cz_ld[i][j] == 0) continue;
else block_copy(nx * 9 + i, ny * 9 + j, 36);
}
}
}
}
if(rand() % 3 <= 1 && nt != 2)
{
q.push({{nx, ny - 1}, 3});
size++;
for(int i = 0;i < 9;i++)
{
for(int j = 0;j < 9;j++)
{
if(nt == 1)
{
if(nc_core[i][j] == 2)
{
block_copy(nx * 9 + i, ny * 9 + j, 19);
}
else if(nc_core[i][j] == 0) continue;
else block_copy(nx * 9 + i, ny * 9 + j, 36);
}
else if(nt == 2)
{
if(nc_sp_ld[i][j] == 2)
{
block_copy(nx * 9 + i, ny * 9 + j, 19);
}
else if(nc_sp_ld[i][j] == 0) continue;
else block_copy(nx * 9 + i, ny * 9 + j, 36);
}
else if(nt == 3)
{
if(nc_cz_ld[i][j] == 2)
{
block_copy(nx * 9 + i, ny * 9 + j, 19);
}
else if(nc_cz_ld[i][j] == 0) continue;
else block_copy(nx * 9 + i, ny * 9 + j, 36);
}
}
}
}
if(rand() % 3 <= 1 && nt != 2)
{
q.push({{nx, ny + 1}, 3});
size++;
for(int i = 0;i < 9;i++)
{
for(int j = 0;j < 9;j++)
{
if(nt == 1)
{
if(nc_core[i][j] == 2)
{
block_copy(nx * 9 + i, ny * 9 + j, 19);
}
else if(nc_core[i][j] == 0) continue;
else block_copy(nx * 9 + i, ny * 9 + j, 36);
}
else if(nt == 2)
{
if(nc_sp_ld[i][j] == 2)
{
block_copy(nx * 9 + i, ny * 9 + j, 19);
}
else if(nc_sp_ld[i][j] == 0) continue;
else block_copy(nx * 9 + i, ny * 9 + j, 36);
}
else if(nt == 3)
{
if(nc_cz_ld[i][j] == 2)
{
block_copy(nx * 9 + i, ny * 9 + j, 19);
}
else if(nc_cz_ld[i][j] == 0) continue;
else block_copy(nx * 9 + i, ny * 9 + j, 36);
}
}
}
}
if(rand() % 3 <= 1 && nt != 1)
{
q.push({{nx + random(-1, 2), ny + random(-1, 2)}, 1});
size++;
for(int i = 0;i < 9;i++)
{
for(int j = 0;j < 9;j++)
{
if(nt == 1)
{
if(nc_core[i][j] == 2)
{
block_copy(nx * 9 + i, ny * 9 + j, 19);
}
else if(nc_core[i][j] == 0) continue;
else block_copy(nx * 9 + i, ny * 9 + j, 36);
}
else if(nt == 2)
{
if(nc_sp_ld[i][j] == 2)
{
block_copy(nx * 9 + i, ny * 9 + j, 19);
}
else if(nc_sp_ld[i][j] == 0) continue;
else block_copy(nx * 9 + i, ny * 9 + j, 36);
}
else if(nt == 3)
{
if(nc_cz_ld[i][j] == 2)
{
block_copy(nx * 9 + i, ny * 9 + j, 19);
}
else if(nc_cz_ld[i][j] == 0) continue;
else block_copy(nx * 9 + i, ny * 9 + j, 36);
}
}
}
}
}
}
void init() //生成世界
{
cout << "2%" << endl;
for(int x = 0;x < 2400;x++) //填充空气
{
for(int y = 0;y < 1200;y++) block_copy(x, y, 19);
}
cout << "4%" << endl;
for(int y = 1;y < 1200;y++) //边界
{
for(int x = 0;x <= 198;x++) block_copy(x, y, 18);
for(int x = 2301;x <= 2399;x++) block_copy(x, y, 18);
block_copy(199, y, 0);
block_copy(2300, y, 0);
}
cout << "6%" << endl;
int stgd[2400]; //石头高度(海平面700)
//生成主世界构造
//确认x坐标下石头高度 (第一次构造)
stgd[1200] = 200; //默认值
for(int x = 1199;x >= 200;x--)
{
if(random(0, 1000) <= 500)
{
stgd[x] = stgd[x + 1] - random(0, 2) + random(0, 2); //小变动
}
else if(random(0, 1000) <= 100)
{
int add = random(0, 20);
add -= 10;
stgd[x] = stgd[x + 1] + add; //断崖式变动
}
else
{
stgd[x] = stgd[x + 1]; //无变动
}
if(stgd[x] > 210) stgd[x] = 210;
if(stgd[x] < 160) stgd[x] = 160;
}
cout << "12%" << endl;
for(int x = 1201;x < 2300;x++)
{
if(random(0, 1000) <= 500)
{
stgd[x] = stgd[x - 1] - random(0, 2) + random(0, 2);
}
else if(random(0, 1000) <= 100)
{
int add = random(0, 20);
add -= 10;
stgd[x] = stgd[x - 1] + add;
}
else
{
stgd[x] = stgd[x - 1];
}
if(stgd[x] > 220) stgd[x] = 220;
if(stgd[x] < 160) stgd[x] = 160;
}
cout << "15%" << endl;
//拷贝石头(主世界下边界:y=501)
for(int x = 200;x < 2300;x++)
{
for(int y = 501;y <= 501 + stgd[x];y++)
{
block_copy(x, y, 1);
//生成铁矿和金矿
if(random(1, 10000) <= 100)
{
block_copy(x, y, 5);
}
else if(random(1, 10000) <= 300)
{
block_copy(x, y, 7);
}
//生成钻石
if(y <= 515 && random(1, 10000) <= 50)
{
block_copy(x, y, 9);
}
//生成绿宝石
if(y <= 600 && random(1, 10000) <= 75)
{
block_copy(x, y, 22);
}
//生成岩浆
if(y <= 580 && random(1, 10000) <= 100)
{
block_copy(x, y, 13);
}
}
}
cout << "20%" << endl;
//增加海水(第二次构造)
for(int x = 200;x < 2300;x++)
{
for(int y = 501 + stgd[x] + 1;y <= 700;y++)
{
block_copy(x, y, 12);
}
}
cout << "23%" << endl;
for(int x = 200;x < 2300;x++)
{
for(int y = 501 + stgd[x] + 1;y <= 700;y++)
{
if(world[x][y].id != 12) continue;
//海之环生成
bool flag = true;
for(int xx = x - 3;xx <= x + 5;xx++)
{
for(int yy = y - 3;yy <= y + 5;yy++)
{
if(world[xx][yy].id != 12) flag = false;
}
}
if(flag && random(1, 10000) < 6) //符合条件
{
bool haizhihuan[9][9] =
{
{0, 0, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 0, 0, 0, 1, 1, 0},
{1, 1, 0, 0, 1, 0, 0, 1, 1},
{1, 0, 0, 1, 0, 1, 0, 0, 1},
{1, 0, 1, 0, 1, 0, 1, 0, 1},
{1, 0, 0, 1, 0, 1, 0, 0, 1},
{1, 1, 0, 0, 1, 0, 0, 1, 1},
{0, 1, 1, 0, 0, 0, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 0, 0}};
for(int i = x - 5;i <= x + 5;i++)
{
for(int j = y - 5;j <= y + 5;j++)
{
if(haizhihuan[i - (x - 5)][j - (y - 5)] == 1)
{
block_copy(i, j, 21);
}
}
}
block_copy(x, y, 20);
}
}
}
cout << "27%" << endl;
//最上3层为泥土
for(int x = 200;x < 2300;x++)
{
int dian = random(1, 10000);
int tree = random(1, 10000);
block_copy(x, 501 + stgd[x], 2);
block_copy(x, 501 + stgd[x] + 1, 2);
block_copy(x, 501 + stgd[x] + 2, 2);
//生成树
if(tree <= 250)
{
block_copy(x, 501 + stgd[x] + 2, 4);
block_copy(x, 501 + stgd[x] + 3, 4);
block_copy(x, 501 + stgd[x] + 4, 4);
block_copy(x - 1, 501 + stgd[x] + 4, 11);
block_copy(x + 1, 501 + stgd[x] + 4, 11);
block_copy(x, 501 + stgd[x] + 5, 11);
block_copy(x - 1, 501 + stgd[x] + 5, 11);
block_copy(x + 1, 501 + stgd[x] + 5, 11);
block_copy(x, 501 + stgd[x] + 6, 11);
}
//生成高树
else if(tree <= 310)
{
block_copy(x, 501 + stgd[x] + 2, 4);
block_copy(x, 501 + stgd[x] + 3, 4);
block_copy(x, 501 + stgd[x] + 4, 4);
block_copy(x, 501 + stgd[x] + 5, 4);
block_copy(x - 1, 501 + stgd[x] + 4, 4);
block_copy(x + 1, 501 + stgd[x] + 4, 4);
block_copy(x - 2, 501 + stgd[x] + 5, 4);
block_copy(x + 2, 501 + stgd[x] + 5, 4);
block_copy(x - 2, 501 + stgd[x] + 6, 11);
block_copy(x + 2, 501 + stgd[x] + 6, 11);
block_copy(x - 2, 501 + stgd[x] + 4, 11);
block_copy(x + 2, 501 + stgd[x] + 4, 11);
block_copy(x, 501 + stgd[x] + 6, 11);
block_copy(x - 1, 501 + stgd[x] + 5, 11);
block_copy(x + 1, 501 + stgd[x] + 5, 11);
block_copy(x - 1, 501 + stgd[x] + 6, 11);
block_copy(x + 1, 501 + stgd[x] + 6, 11);
block_copy(x, 501 + stgd[x] + 6, 11);
block_copy(x, 501 + stgd[x] + 7, 11);
block_copy(x - 1, 501 + stgd[x] + 7, 11);
block_copy(x + 1, 501 + stgd[x] + 7, 11);
}
//生成入云树
else if(tree <= 340)
{
for(int i = 501 + stgd[x] + 2;i <= 501 + stgd[x] + (rand()%10) + 6;i++)
{
block_copy(x, i, 4);
if(i >= 501 + stgd[x] + 4)
{
block_copy(x - 1, i, 11);
block_copy(x + 1, i, 11);
}
block_copy(x, i + 1, 11);
}
}
//生成巨树
else if(tree <= 370)
{
block_copy(x, 501 + stgd[x] + 2, 4);
block_copy(x - 1, 501 + stgd[x] + 2, 4);
block_copy(x + 1, 501 + stgd[x] + 2, 4);
block_copy(x, 501 + stgd[x] + 3, 4);
block_copy(x - 1, 501 + stgd[x] + 3, 4);
block_copy(x + 1, 501 + stgd[x] + 3, 4);
block_copy(x, 501 + stgd[x] + 4, 4);
block_copy(x - 1, 501 + stgd[x] + 4, 4);
block_copy(x + 1, 501 + stgd[x] + 4, 4);
block_copy(x, 501 + stgd[x] + 5, 4);
block_copy(x - 1, 501 + stgd[x] + 5, 4);
block_copy(x + 1, 501 + stgd[x] + 5, 4);
block_copy(x - 2, 501 + stgd[x] + 4, 11);
block_copy(x + 2, 501 + stgd[x] + 4, 11);
block_copy(x - 2, 501 + stgd[x] + 5, 11);
block_copy(x + 2, 501 + stgd[x] + 5, 11);
block_copy(x - 2, 501 + stgd[x] + 6, 11);
block_copy(x + 2, 501 + stgd[x] + 6, 11);
block_copy(x - 1, 501 + stgd[x] + 6, 11);
block_copy(x + 1, 501 + stgd[x] + 6, 11);
block_copy(x, 501 + stgd[x] + 6, 11);
block_copy(x, 501 + stgd[x] + 7, 11);
block_copy(x - 1, 501 + stgd[x] + 7, 11);
block_copy(x + 1, 501 + stgd[x] + 7, 11);
}
//生成于苗神殿
else if(tree <= 405)
{
int y = 501 + stgd[x] + 3;
block_copy(x, y, 24);
block_copy(x - 1, y, 24);
block_copy(x + 1, y, 24);
block_copy(x - 2, y, 24);
block_copy(x + 2, y, 24);
block_copy(x - 3, y, 24);
block_copy(x + 3, y, 24);
block_copy(x - 3, y + 1, 24);
block_copy(x + 3, y + 1, 24);
block_copy(x - 3, y + 2, 24);
block_copy(x + 3, y + 2, 24);
block_copy(x - 3, y + 3, 24);
block_copy(x + 3, y + 3, 24);
block_copy(x - 3, y + 4, 24);
block_copy(x + 3, y + 4, 24);
block_copy(x - 3, y + 5, 24);
block_copy(x + 3, y + 5, 24);
block_copy(x - 3, y + 6, 24);
block_copy(x + 3, y + 6, 24);
block_copy(x - 2, y + 6, 24);
block_copy(x + 2, y + 6, 24);
block_copy(x - 1, y + 6, 24);
block_copy(x + 1, y + 6, 24);
block_copy(x, y + 6, 24);
block_copy(x - 2, y + 6, 24);
block_copy(x + 2, y + 6, 24);
block_copy(x - 2, y + 7, 24);
block_copy(x + 2, y + 7, 24);
block_copy(x - 1, y + 7, 26);
block_copy(x + 1, y + 7, 27);
block_copy(x - 2, y + 8, 24);
block_copy(x + 2, y + 8, 24);
block_copy(x - 1, y + 9, 24);
block_copy(x + 1, y + 9, 24);
block_copy(x, y + 9, 25);
block_copy(x - 1, y + 10, 24);
block_copy(x + 1, y + 10, 24);
block_copy(x, y + 10, 24);
}
//生成地牢
else if(tree <= 415 || x == 1200)
{
int t_high = rand() % 20 + 60;
for(int i = 0;i < 27;i++)
{
for(int j = 0;j < 29;j++)
{
int fangkuaiid = 0;
if(dilao_jiegou[i][j] == 1) continue;
else if(dilao_jiegou[i][j] == 2) fangkuaiid = 33;
else if(dilao_jiegou[i][j] == 3) fangkuaiid = 19;
else if(dilao_jiegou[i][j] == 5) fangkuaiid = 35;
else fangkuaiid = 34;
block_copy( x - 14 + j, 501 + stgd[x] + 3 - (t_high) + i, fangkuaiid);
}
}
}
}
cout << "30%" << endl;
for(int x = 200;x < 2300;x++)
{
int gaodu = max(741, 501 + stgd[x]);
for(int y = gaodu + 15;y <= gaodu + 20;y++)
{
if(rand() % 20000 < 1)
{
//生成宝藏岛
block_copy(x, y, 1);
for(int z = x - 2;z <= x + 2;z++) block_copy(z, y + 1, 1);
for(int z = x - 3;z <= x + 3;z++) block_copy(z, y + 2, 1);
for(int z = x - 4;z <= x + 4;z++) block_copy(z, y + 3, 1);
for(int z = x - 5;z <= x + 5;z++) block_copy(z, y + 4, 1);
block_copy(x - 2, y + 5, 9);
block_copy(x + 2, y + 5, 9);
block_copy(x - 2, y + 6, 7);
block_copy(x + 2, y + 6, 7);
block_copy(x - 2, y + 7, 5);
block_copy(x + 2, y + 7, 5);
block_copy(x - 1, y + 8, 22);
block_copy(x + 1, y + 8, 22);
block_copy(x, y + 6, 16);
block_copy(x, y + 10, 28);
break;
}
}
}
cout << "34%" << endl;
for(int x = 200;x < 2300;x++)
{
block_copy(x, 500, 14);
block_copy(x, 499, 14);
block_copy(x, 498, 14);
block_copy(x, 497, 14);
}
cout << "36%" << endl;
for(int x = 200;x < 2300;x++)
{
for(int y = 496;y >= 100;y--)
{
block_copy(x, y, 15);
if(random(0, 10000) <= 60)
{
bool flag = false;
if(random(0, 10000) <= 1000) flag = true;
int r = random(2, 4);
for(int xx = x - r;xx <= x + r;xx++)
{
for(int yy = y - r;yy <= y + r;yy++)
{
block_copy(xx, yy, 19);
if(yy == y - r)
{
if(flag) block_copy(xx, yy, 13);
}
}
}
}
//添加岩浆
if(random(0, 10000) <= 1000) block_copy(x, y, 13);
//远古残骸
if(random(0, 10000) <= 20) block_copy(x, y, 16);
}
}
cout << "42%" << endl;
for(int x = 200;x < 2300;x++)
{
for(int y = 496;y >= 100;y--)
{
//下界城市
if(random(1, 10000) == 1 || (x == 1200 && y == 400))
{
if(random(1, 100) == 1 || (x == 1200 && y == 400))
{
chengshi(x, y);
}
}
}
}
playery = 501 + stgd[1200] + 3;
}
void block_pick(BLOCK blk)
{
for(int i = 0;i < 5;i++)
{
if(fkl[i].id == blk.id && blk.id != 0 && fknum[i] < 64)
{
fkl[i] = blk;
fknum[i]++;
return;
}
}
for(int i = 0;i < 5;i++)
{
if(fknum[i] <= 0)
{
fkl[i] = blk;
fknum[i] = 1;
return;
}
}
}
void block_delete(BLOCK blk)
{
for(int i = 0;i < 5;i++)
{
if(fkl[i].id == blk.id && fkl[i].txt == blk.txt)
{
fknum[i]--;
if(fknum[i] == 0)
{
fkl[i].id = 0;
fkl[i].name = "";
fkl[i].txt = "";
fkl[i].hard = 0;
fkl[i].level = 0;
fkl[i].fluid = 0;
fkl[i].color = 0;
}
return;
}
}
}
int block_num(BLOCK blk)
{
int num = 0;
for(int i = 0;i < 5;i++)
{
if(fkl[i].id == blk.id && fkl[i].txt == blk.txt)
{
num += fknum[i];
}
}
return num;
}
void item_pick(ITEM itm)
{
for(int i = 0;i < 5;i++)
{
if(wpl[i].id == itm.id && itm.id != 0 && wpnum[i] < 64)
{
wpl[i]= itm;
wpnum[i]++;
return;
}
}
for(int i = 0;i < 5;i++)
{
if(wpnum[i] <= 0)
{
wpl[i]= itm;
wpnum[i] = 1;
return;
}
}
}
void item_delete(ITEM itm)
{
for(int i = 0;i < 5;i++)
{
if(wpl[i].id == itm.id && wpl[i].name == itm.name)
{
wpnum[i]--;
if(wpnum[i] == 0)
{
wpl[i].id = 0;
wpl[i].hurt = 0;
wpl[i].speed = 0;
wpl[i].level = 0;
wpl[i].name = "";
wpl[i].rare = 0;
}
return;
}
}
}
int item_num(ITEM itm)
{
int num = 0;
for(int i = 0;i < 5;i++)
{
if(wpl[i].id == itm.id && wpl[i].name == itm.name)
{
num += wpnum[i];
}
}
return num;
}
void armor_delete()
{
kjl.id = 0;
kjl.defease = 0;
kjl.name = "空";
}
void armor_pick(ARMOR arm)
{
kjl.id = arm.id;
kjl.defease = arm.defease;
kjl.name = arm.name;
}
void buff_give(BUFF bff, int level, int time)
{
if(bff.id == 0) return;
if(xgnum == xgmax) return;
xgl[xgnum].id = bff.id;
xgl[xgnum].level = level;
xgl[xgnum].name = bff.name;
xgl[xgnum++].time = time;
}
void buff_delete(BUFF bff)
{
if(bff.id == 0) return;
for(int i = 0;i < xgnum;i++)
{
if(xgl[i].id == bff.id)
{
xgl[i].id = 0;
xgl[i].level = 0;
xgl[i].name = "空";
xgl[i].time = 0;
}
}
}
int get_buff_level(BUFF bff)
{
int mx = 0;
if(bff.id == 0) return 0;
for(int i = 0;i < xgnum;i++)
{
if(xgl[i].id == bff.id) mx = max(mx, xgl[i].level);
}
return mx;
}
void buff_merge() //效果合并(每短刻进行)
{
for(int i = 0;i < xgnum;i++)
{
for(int j = i + 1;j < xgnum;j++)
{
if(xgl[i].id == xgl[j].id && xgl[i].id != 0)
{
xgl[i].level = max(xgl[i].level, xgl[j].level);
xgl[i].time = xgl[i].time + xgl[j].time;
xgl[j].id = 0;
xgl[j].level = 0;
xgl[j].name = "空";
xgl[j].time = 0;
xgnum--;
//迁移效果
for(int k = j + 1;k < xgnum + 1;k++)
{
xgl[k - 1].level = xgl[k].level;
xgl[k - 1].id = xgl[k].id;
xgl[k - 1].time = xgl[k].time;
xgl[k - 1].name = xgl[k].name;
xgl[k].id = 0;
xgl[k].level = 0;
xgl[k].name = "空";
xgl[k].time = 0;
}
}
}
}
}
void buff_live()
{
for(int i = 0;i < xgnum;i++)
{
if(xgl[i].id != 0)
{
xgl[i].time--;
if(xgl[i].time <= 0)
{
xgl[i].id = 0;
xgl[i].level = 0;
xgl[i].name = "空";
xgl[i].time = 0;
}
}
}
}
void summon_entity(int x, int y, int type) //实体生成
{
stl[st_num].type = entity[type].type;
stl[st_num].color = entity[type].color;
stl[st_num].txt = entity[type].txt;
stl[st_num].xp = entity[type].xp;
stl[st_num].power = entity[type].power;
stl[st_num].ap = entity[type].ap;
stl[st_num].hp = entity[type].hp;
stl[st_num].boss = entity[type].boss;
stl[st_num].name = entity[type].name;
stl[st_num].x = x;
stl[st_num].y = y;
st_num++;
}
void attack(int hurt_num, string die_str) //造成伤害
{
if(gamemode == 1) return;
double hurt;
hurt = hurt_num * (1.0 - (kjl.defease) * 0.04);
//对高伤害进行削弱
int i = 0;
double shjm = 0.0;
for(int xxx = 0;xxx <= kjl.defease;xxx++)
{
shjm += 0.012 * (1.0 - (xxx * 0.04));
}
if(hurt >= 150)
{
hurt = 150 + sqrt(hurt - 150);
}
hurt -= hurt * 0.1 + shjm;
if(get_buff_level(buff[3]) > 0) hurt -= get_buff_level(buff[3]); //生命吸收
health -= hurt;
tick_attack = true;
if(health < 0 && gamemode == 2) //玩家死亡 极限模式=删除存档
{
system("cls");
SetPos(2, 2);
cout << "GAME OVER";
SetPos(2, 4);
cout << die_str;
SetPos(2, 6);
cout << "极限模式下 你必须删除存档";
init();
print_data();
SetPos(2, 8);
system("pause");
exit(0);
}
else if(health < 0 && gamemode == 0) //玩家死亡 生存模式=复活
{
system("cls");
SetPos(2, 2);
cout << "GAME OVER";
SetPos(2, 4);
cout << die_str;
SetPos(2, 6);
cout << "重生";
SetPos(2, 8);
system("pause");
playerx = 1200;
playery = 700;
block_copy(playerx, playery, 19);
health = max_health + get_buff_level(buff[1]) * 4;
return;
}
}
void input_data() //输入数据
{
ifstream fin("data.txt", ios::in);
for(int i = 0;i < 2400;i++)
{
for(int j = 0;j < 1200;j++)
{
int ijid;
fin >> ijid;
block_copy(i, j, ijid);
}
}
fin >> playerx >> playery;
for(int i = 0;i < 5;i++) fin >> fknum[i] >> wpnum[i];
for(int i = 0;i < 5;i++)
{
int fkid, wpid;
fin >> fkid >> wpid;
if(fkid != 0)
{
fkl[i].id = fkid;
fkl[i].fluid = block[fkid].fluid;
fkl[i].color = block[fkid].color;
fkl[i].hard = block[fkid].hard;
fkl[i].level = block[fkid].level;
fkl[i].txt = block[fkid].txt;
fkl[i].name = block[fkid].name;
}
else fknum[i] = 0;
if(wpid != 0)
{
wpl[i].id = wpid;
wpl[i].name = item[wpid].name;
wpl[i].speed = item[wpid].speed;
wpl[i].hurt = item[wpid].hurt;
wpl[i].level = item[wpid].level;
wpl[i].rare = item[wpid].rare;
}
else wpnum[i] = 0;
}
int zbid;
fin >> zbid;
armor_pick(armor[zbid]);
fin >> xgnum;
for(int i = 0;i < xgnum;i++)
{
int xgid, xgtm, xglv;
fin >> xgid >> xgtm >> xglv;
xgl[i].id = xgid;
xgl[i].time = xgtm;
xgl[i].name = buff[xgid].name;
xgl[i].level = xglv;
}
fin >> health >> oxygen;
fin >> gamemode;
fin >> level >> xp >> max_health;
int stn;
fin >> stn;
for(int i = 0;i < stn;i++)
{
int type, x, y;
fin >> type >> x >> y;
summon_entity(x, y, type);
}
int bm, im;
fin >> bm >> im;
for(int i = 0;i < bm;i++)
{
fin >> box_fk_num[i];
}
for(int i = 0;i < im;i++)
{
fin >> box_wp_num[i];
}
}
void print_data() //输出数据
{
ofstream fout("data.txt", ios::out);
for(int i = 0;i < 2400;i++)
{
for(int j = 0;j < 1200;j++)
{
int id = world[i][j].id;
fout << id;
fout << ' ';
}
fout << endl;
}
fout << playerx << endl << playery << endl;
for(int i = 0;i < 5;i++) fout << fknum[i] << ' ' << wpnum[i] << endl;
for(int i = 0;i < 5;i++)
{
fout << fkl[i].id << ' ' << wpl[i].id << endl;
}
fout << kjl.id << endl;
fout << xgnum << endl;
for(int i = 0;i < xgnum;i++)
{
fout << xgl[i].id << ' ' << xgl[i].time << ' ' << xgl[i].level;
fout << endl;
}
fout << health << endl << oxygen << endl;
fout << gamemode << endl;
fout << level << endl << xp << endl << max_health << endl;
fout << st_num << endl;
for(int i = 0;i < st_num;i++)
{
fout << stl[i].type << ' ' << stl[i].x << ' ' << stl[i].y << endl;
}
fout << block_max << endl << item_max << endl;
for(int i = 0;i < block_max;i++) fout << box_fk_num[i] << endl;
for(int i = 0;i < item_max;i++) fout << box_wp_num[i] << endl;
}
void item_choose() //创造物品选择器
{
system("cls");
SetPos(10, 1);
cout << "创造模式物品选择器:";
SetPos(10, 3);
cout << "a d 迭代手中物品 S 堆叠手中物品";
SetPos(10, 5);
cout << "K 确认";
while(1)
{
SetPos(10, 7);
cout << "手中物品:";
if(now <= 4) //显示方块
{
Color(fkl[now].color), cout << fkl[now].txt << ' ' << fkl[now].name;
cout << " ";
Color(0);
}
else //显示物品
{
if(wpl[now - 5].rare == 0) Color(0);
else if(wpl[now - 5].rare == 1) Color(1);
else if(wpl[now - 5].rare == 2) Color(3);
else if(wpl[now - 5].rare == 3) Color(4);
else Color(2);
cout << wpl[now - 5].name;
cout << " ";
Color(0);
}
Color(0);
if(_kbhit())
{
char f = _getch();
if(f == 'a')
{
if(now <= 4 && fkl[now].id > 0)
{
if(!fknum[now]) fknum[now]++;
fkl[now].id--;
fkl[now].color = block[fkl[now].id].color;
fkl[now].fluid = block[fkl[now].id].fluid;
fkl[now].hard = block[fkl[now].id].hard;
fkl[now].level = block[fkl[now].id].level;
fkl[now].name = block[fkl[now].id].name;
fkl[now].txt = block[fkl[now].id].txt;
}
else if(now >= 5 && wpl[now - 5].id > 0)
{
if(!wpnum[now - 5]) wpnum[now - 5]++;
wpl[now - 5].id--;
wpl[now - 5].hurt = item[wpl[now - 5].id].hurt;
wpl[now - 5].level = item[wpl[now - 5].id].level;
wpl[now - 5].name = item[wpl[now - 5].id].name;
wpl[now - 5].rare = item[wpl[now - 5].id].rare;
wpl[now - 5].speed = item[wpl[now - 5].id].speed;
}
}
else if(f == 'd')
{
if(now <= 4 && fkl[now].id < block_max)
{
if(!fknum[now]) fknum[now]++;
fkl[now].id++;
fkl[now].color = block[fkl[now].id].color;
fkl[now].fluid = block[fkl[now].id].fluid;
fkl[now].hard = block[fkl[now].id].hard;
fkl[now].level = block[fkl[now].id].level;
fkl[now].name = block[fkl[now].id].name;
fkl[now].txt = block[fkl[now].id].txt;
}
else if(now >= 5 && wpl[now - 5].id < item_max)
{
if(!wpnum[now - 5]) wpnum[now - 5]++;
wpl[now - 5].id++;
wpl[now - 5].hurt = item[wpl[now - 5].id].hurt;
wpl[now - 5].level = item[wpl[now - 5].id].level;
wpl[now - 5].name = item[wpl[now - 5].id].name;
wpl[now - 5].rare = item[wpl[now - 5].id].rare;
wpl[now - 5].speed = item[wpl[now - 5].id].speed;
}
}
else if(f == 's')
{
if(now <= 4) fknum[now] = 64;
else wpnum[now - 5] = 64;
}
else if(f == 'k')
{
system("cls");
return;
}
}
}
}
void crafting()
{
//合成
system("cls");
SetPos(10, 1);
cout << "合成";
SetPos(10, 3);
cout << "1 工具类";
SetPos(10, 5);
cout << "2 熔炼类";
SetPos(10, 7);
cout << "3 盔甲类";
SetPos(10, 9);
cout << "4 杂项";
SetPos(10, 11);
cout << "5 离开";
char cft0 = input('1', '5');
system("cls");
if(cft0 == '1')
{
SetPos(10, 1);
cout << "合成 - 工具类";
SetPos(10, 3);
cout << "1 木质";
SetPos(10, 5);
cout << "2 石质";
SetPos(10, 7);
cout << "3 铁质";
SetPos(10, 9);
cout << "4 金质";
SetPos(10, 11);
cout << "5 钻石/绿宝石质";
SetPos(10, 13);
cout << "6 合金质";
SetPos(10, 15);
cout << "7 灵魂物质";
SetPos(10, 17);
cout << "8 药水";
SetPos(10, 19);
cout << "9 离开";
char cft1 = input('1', '9');
system("cls");
if(cft1 == '1')
{
SetPos(10, 1);
cout << "合成 - 工具类 - 木质";
SetPos(10, 3);
cout << "1 木镐";
SetPos(10, 5);
cout << "2 木剑";
SetPos(10, 7);
cout << "3 离开";
char cft11 = input('1', '3');
if(cft11 == '1')
{
SetPos(10, 7);
cout << "需要 木头x4";
SetPos(10, 9);
cout << "1 确认";
SetPos(10, 11);
cout << "2 离开";
char cft111 = input('1', '2');
if(cft111 == '1')
{
if(block_num(block[4]) < 4) return;
block_delete(block[4]);
block_delete(block[4]);
block_delete(block[4]);
block_delete(block[4]);
item_pick(item[1]);
xp += 3;
}
else if(cft111 == '2')
{
return;
}
}
else if(cft11 == '2')
{
SetPos(10, 7);
cout << "需要 木头x4";
SetPos(10, 9);
cout << "1 确认";
SetPos(10, 11);
cout << "2 离开";
char cft112 = input('1', '2');
if(cft112 == '1')
{
if(block_num(block[4]) < 4) return;
block_delete(block[4]);
block_delete(block[4]);
block_delete(block[4]);
block_delete(block[4]);
item_pick(item[2]);
xp += 3;
}
else if(cft112 == '2')
{
return;
}
}
else if(cft11 == '3')
{
return;
}
}
else if(cft1 == '2')
{
SetPos(10, 1);
cout << "合成 - 工具类 - 石质";
SetPos(10, 3);
cout << "1 石镐";
SetPos(10, 5);
cout << "2 石剑";
SetPos(10, 7);
cout << "3 离开";
char cft12 = input('1', '3');
if(cft12 == '1')
{
SetPos(10, 9);
cout << "需要 石头x6";
SetPos(10, 11);
cout << "1 确认";
SetPos(10, 13);
cout << "2 离开";
char cft121 = input('1', '2');
if(cft121 == '1')
{
if(block_num(block[1]) < 6) return;
block_delete(block[1]);
block_delete(block[1]);
block_delete(block[1]);
block_delete(block[1]);
block_delete(block[1]);
block_delete(block[1]);
item_pick(item[3]);
xp += 3;
}
else if(cft121 == '2')
{
return;
}
}
else if(cft12 == '2')
{
SetPos(10, 9);
cout << "需要 石头x6";
SetPos(10, 11);
cout << "1 确认";
SetPos(10, 13);
cout << "2 离开";
char cft122 = input('1', '2');
if(cft122 == '1')
{
if(block_num(block[1]) < 6) return;
block_delete(block[1]);
block_delete(block[1]);
block_delete(block[1]);
block_delete(block[1]);
block_delete(block[1]);
block_delete(block[1]);
item_pick(item[4]);
xp += 3;
}
else if(cft122 == '2')
{
return;
}
}
else if(cft12 == '3')
{
return;
}
}
else if(cft1 == '3')
{
SetPos(10, 1);
cout << "合成 - 工具类 - 铁质";
SetPos(10, 3);
cout << "1 铁镐";
SetPos(10, 5);
cout << "2 铁剑";
SetPos(10, 7);
cout << "3 铁块";
SetPos(10, 9);
cout << "4 离开";
char cft13 = input('1', '4');
if(cft13 == '1')
{
SetPos(10, 11);
cout << "需要 铁锭x3";
SetPos(10, 13);
cout << "1 确认";
SetPos(10, 15);
cout << "2 离开";
char cft131 = input('1', '2');
if(cft131 == '1')
{
if(item_num(item[5]) < 3) return;
item_delete(item[5]);
item_delete(item[5]);
item_delete(item[5]);
item_pick(item[6]);
xp += 3;
}
else if(cft131 == '2')
{
return;
}
}
else if(cft13 == '2')
{
SetPos(10, 11);
cout << "需要 铁锭x3";
SetPos(10, 13);
cout << "1 确认";
SetPos(10, 15);
cout << "2 离开";
char cft132 = input('1', '2');
if(cft132 == '1')
{
if(item_num(item[5]) < 3) return;
item_delete(item[5]);
item_delete(item[5]);
item_delete(item[5]);
item_pick(item[7]);
xp += 3;
}
else if(cft132 == '2')
{
return;
}
}
else if(cft13 == '3')
{
SetPos(10, 11);
cout << "需要 铁锭x9";
SetPos(10, 13);
cout << "1 确认";
SetPos(10, 15);
cout << "2 离开";
char cft133 = input('1', '2');
if(cft133 == '1')
{
if(item_num(item[5]) < 9) return;
item_delete(item[5]);
item_delete(item[5]);
item_delete(item[5]);
item_delete(item[5]);
item_delete(item[5]);
item_delete(item[5]);
item_delete(item[5]);
item_delete(item[5]);
item_delete(item[5]);
block_pick(block[6]);
xp += 3;
}
else if(cft133 == '2')
{
return;
}
}
else if(cft13 == '4')
{
return;
}
}
else if(cft1 == '5')
{
SetPos(10, 1);
cout << "合成 - 工具类 - 钻石/绿宝石质";
SetPos(10, 3);
cout << "1 钻石镐";
SetPos(10, 5);
cout << "2 钻石剑";
SetPos(10, 7);
cout << "3 钻石块";
SetPos(10, 9);
cout << "4 绿宝石镐";
SetPos(10, 11);
cout << "5 绿宝石剑";
SetPos(10, 13);
cout << "6 绿宝石块";
SetPos(10, 9);
cout << "7 离开";
char cft15 = input('1', '7');
if(cft15 == '1')
{
SetPos(10, 11);
cout << "需要 钻石x6";
SetPos(10, 13);
cout << "1 确认";
SetPos(10, 15);
cout << "2 离开";
char cft151 = input('1', '2');
if(cft151 == '1')
{
if(item_num(item[11]) < 6) return;
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_pick(item[12]);
xp += 3;
}
else if(cft151 == '2')
{
return;
}
}
else if(cft15 == '2')
{
SetPos(10, 11);
cout << "需要 钻石x6";
SetPos(10, 13);
cout << "1 确认";
SetPos(10, 15);
cout << "2 离开";
char cft152 = input('1', '2');
if(cft152 == '1')
{
if(item_num(item[11]) < 6) return;
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_pick(item[13]);
xp += 3;
}
else if(cft152 == '2')
{
return;
}
}
else if(cft15 == '3')
{
SetPos(10, 11);
cout << "需要 钻石x9";
SetPos(10, 13);
cout << "1 确认";
SetPos(10, 15);
cout << "2 离开";
char cft153 = input('1', '2');
if(cft153 == '1')
{
if(item_num(item[11]) < 9) return;
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
block_pick(block[10]);
xp += 3;
}
else if(cft153 == '2')
{
return;
}
}
else if(cft15 == '4')
{
SetPos(10, 11);
cout << "需要 绿宝石x6";
SetPos(10, 13);
cout << "1 确认";
SetPos(10, 15);
cout << "2 离开";
char cft154 = input('1', '2');
if(cft154 == '1')
{
if(item_num(item[23]) < 6) return;
item_delete(item[23]);
item_delete(item[23]);
item_delete(item[23]);
item_delete(item[23]);
item_delete(item[23]);
item_delete(item[23]);
item_pick(item[24]);
xp += 3;
}
else if(cft154 == '2')
{
return;
}
}
else if(cft15 == '5')
{
SetPos(10, 11);
cout << "需要 绿宝石x6";
SetPos(10, 13);
cout << "1 确认";
SetPos(10, 15);
cout << "2 离开";
char cft155 = input('1', '2');
if(cft155 == '1')
{
if(item_num(item[23]) < 6) return;
item_delete(item[23]);
item_delete(item[23]);
item_delete(item[23]);
item_delete(item[23]);
item_delete(item[23]);
item_delete(item[23]);
item_pick(item[25]);
xp += 3;
}
else if(cft155 == '2')
{
return;
}
}
else if(cft15 == '6')
{
SetPos(10, 11);
cout << "需要 绿宝石x9";
SetPos(10, 13);
cout << "1 确认";
SetPos(10, 15);
cout << "2 离开";
char cft156 = input('1', '2');
if(cft156 == '1')
{
if(item_num(item[23]) < 9) return;
item_delete(item[23]);
item_delete(item[23]);
item_delete(item[23]);
item_delete(item[23]);
item_delete(item[23]);
item_delete(item[23]);
item_delete(item[23]);
item_delete(item[23]);
item_delete(item[23]);
block_pick(block[23]);
xp += 3;
}
else if(cft156 == '2')
{
return;
}
}
else if(cft15 == '7')
{
return;
}
}
else if(cft1 == '6')
{
SetPos(10, 1);
cout << "合成 - 工具类 - 下界合金质";
SetPos(10, 3);
cout << "1 下界合金镐";
SetPos(10, 5);
cout << "2 下界合金剑";
SetPos(10, 7);
cout << "3 下界合金块";
SetPos(10, 9);
cout << "4 离开";
char cft16 = input('1', '4');
if(cft16 == '1')
{
SetPos(10, 11);
cout << "需要 钻石x12 下界合金块x1";
SetPos(10, 13);
cout << "1 确认";
SetPos(10, 15);
cout << "2 离开";
char cft161 = input('1', '2');
if(cft161 == '1')
{
if(item_num(item[11]) < 12) return;
if(block_num(block[17]) < 1) return;
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
block_delete(block[17]);
item_pick(item[16]);
xp += 3;
}
else if(cft161 == '2')
{
return;
}
}
else if(cft16 == '2')
{
SetPos(10, 11);
cout << "需要 钻石x12 下界合金块x1";
SetPos(10, 13);
cout << "1 确认";
SetPos(10, 15);
cout << "2 离开";
char cft162 = input('1', '2');
if(cft162 == '1')
{
if(item_num(item[11]) < 12) return;
if(block_num(block[17]) < 1) return;
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
block_delete(block[17]);
item_pick(item[17]);
xp += 3;
}
else if(cft162 == '2')
{
return;
}
}
else if(cft16 == '3')
{
SetPos(10, 11);
cout << "需要 钻石块x1 下界合金锭x9";
SetPos(10, 13);
cout << "1 确认";
SetPos(10, 15);
cout << "2 离开";
char cft163 = input('1', '2');
if(cft163 == '1')
{
if(block_num(block[10]) < 1) return;
if(item_num(item[15]) < 9)
block_delete(block[10]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
block_pick(block[17]);
xp += 3;
}
else if(cft163 == '2')
{
return;
}
}
else if(cft16 == '4')
{
return;
}
}
else if(cft1 == '7')
{
SetPos(10, 1);
cout << "合成 - 工具类 - 灵魂物质";
SetPos(10, 3);
cout << "1 灵魂镐";
SetPos(10, 5);
cout << "2 灵魂剑";
SetPos(10, 7);
cout << "3 灵魂之星";
SetPos(10, 9);
cout << "3 离开";
char cft16 = input('1', '4');
if(cft16 == '1')
{
SetPos(10, 11);
cout << "需要 下界合金锭x12 灵魂之星x1";
SetPos(10, 13);
cout << "1 确认";
SetPos(10, 15);
cout << "2 离开";
char cft161 = input('1', '2');
if(cft161 == '1')
{
//if(item_num(item[15]) < 12) return;
//if(item_num(item[30]) < 1) return;
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[30]);
item_pick(item[31]);
xp += 3;
}
else if(cft161 == '2')
{
return;
}
}
else if(cft16 == '2')
{
SetPos(10, 11);
cout << "需要 下界合金锭x12 灵魂之星x1";
SetPos(10, 13);
cout << "1 确认";
SetPos(10, 15);
cout << "2 离开";
char cft162 = input('1', '2');
if(cft162 == '1')
{
//if(item_num(item[15]) < 12) return;
//if(item_num(item[30]) < 1) return;
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[15]);
item_delete(item[30]);
item_pick(item[32]);
xp += 3;
}
else if(cft162 == '2')
{
return;
}
}
else if(cft16 == '3')
{
SetPos(10, 11);
cout << "需要 下界合金块x2 魂石x1";
SetPos(10, 13);
cout << "1 确认";
SetPos(10, 15);
cout << "2 离开";
char cft163 = input('1', '2');
if(cft163 == '1')
{
//if(block_num(block[17]) < 2) return;
//if(block_num(block[34]) < 1) return;
block_delete(block[17]);
block_delete(block[17]);
block_delete(block[34]);
item_pick(item[30]);
xp += 3;
}
else if(cft163 == '2')
{
return;
}
}
else if(cft16 == '4')
{
return;
}
}
else if(cft1 == '8')
{
SetPos(10, 1);
cout << "合成 - 工具类 - 药水";
SetPos(10, 3);
cout << "1 生命提升药水";
SetPos(10, 5);
cout << "2 急迫药水";
SetPos(10, 7);
cout << "3 生命吸收药水";
SetPos(10, 9);
cout << "4 中毒药水";
SetPos(10, 11);
cout << "5 离开";
char cft17 = input('1', '5');
if(cft17 == '1')
{
SetPos(10, 13);
cout << "需要 水桶x1 药水量子x1";
SetPos(10, 15);
cout << "1 确认";
SetPos(10, 17);
cout << "2 离开";
char cft171 = input('1', '2');
if(cft171 == '1')
{
if(item_num(item[19]) < 1) return;
if(item_num(item[21]) < 1) return;
item_delete(item[19]);
item_delete(item[21]);
buff_give(buff[1], 2, 1200);
xp += 3;
}
}
else if(cft17 == '2')
{
SetPos(10, 13);
cout << "需要 水桶x1 药水量子x1";
SetPos(10, 15);
cout << "1 确认";
SetPos(10, 17);
cout << "2 离开";
char cft172 = input('1', '2');
if(cft172 == '1')
{
if(item_num(item[19]) < 1) return;
if(item_num(item[21]) < 1) return;
item_delete(item[19]);
item_delete(item[21]);
buff_give(buff[2], 2, 1200);
xp += 3;
}
}
else if(cft17 == '3')
{
SetPos(10, 13);
cout << "需要 水桶x1 药水量子x1";
SetPos(10, 15);
cout << "1 确认";
SetPos(10, 17);
cout << "2 离开";
char cft173 = input('1', '2');
if(cft173 == '1')
{
if(item_num(item[19]) < 1) return;
if(item_num(item[21]) < 1) return;
item_delete(item[19]);
item_delete(item[21]);
buff_give(buff[3], 2, 1200);
xp += 3;
}
}
else if(cft17 == '4')
{
SetPos(10, 13);
cout << "需要 水桶x1 药水量子x1";
SetPos(10, 15);
cout << "1 确认";
SetPos(10, 17);
cout << "2 离开";
char cft174 = input('1', '2');
if(cft174 == '1')
{
if(item_num(item[19]) < 1) return;
if(item_num(item[21]) < 1) return;
item_delete(item[19]);
item_delete(item[21]);
buff_give(buff[4], 2, 1200);
xp += 3;
}
}
}
}
else if(cft0 == '2')
{
SetPos(10, 1);
cout << "合成 - 熔炼类";
SetPos(10, 3);
cout << "1 锭熔炼";
SetPos(10, 5);
cout << "2 远古残骸熔炼";
SetPos(10, 7);
cout << "3 离开";
char cft2 = input('1', '3');
system("cls");
if(cft2 == '1')
{
SetPos(10, 1);
cout << "合成 - 熔炼类 - 锭熔炼";
SetPos(10, 3);
cout << "1 铁锭";
SetPos(10, 5);
cout << "2 金锭";
SetPos(10, 7);
cout << "3 钻石";
SetPos(10, 9);
cout << "4 下界合金锭";
SetPos(10, 11);
cout << "5 离开";
char cft21 = input('1', '5');
if(cft21 == '1')
{
SetPos(10, 13);
cout << "需要 铁矿石x1";
SetPos(10, 15);
cout << "1 确认";
SetPos(10, 17);
cout << "2 离开";
char cft211 = input('1', '2');
if(cft211 == '1')
{
if(block_num(block[5]) < 1) return;
block_delete(block[5]);
item_pick(item[5]);
xp += 3;
}
else
{
return;
}
}
else if(cft21 == '2')
{
SetPos(10, 13);
cout << "需要 金矿石x1";
SetPos(10, 15);
cout << "1 确认";
SetPos(10, 17);
cout << "2 离开";
char cft212 = input('1', '2');
if(cft212 == '1')
{
if(block_num(block[7]) < 1) return;
block_delete(block[7]);
item_pick(item[8]);
xp += 3;
}
else
{
return;
}
}
else if(cft21 == '3')
{
SetPos(10, 13);
cout << "需要 钻石矿石x1";
SetPos(10, 15);
cout << "1 确认";
SetPos(10, 17);
cout << "2 离开";
char cft213 = input('1', '2');
if(cft213 == '1')
{
if(block_num(block[9]) < 1) return;
block_delete(block[9]);
item_pick(item[11]);
xp += 3;
}
else
{
return;
}
}
else if(cft21 == '4')
{
SetPos(10, 13);
cout << "需要 下界合金碎片x4 金锭x4";
SetPos(10, 15);
cout << "1 确认";
SetPos(10, 17);
cout << "2 离开";
char cft211 = input('1', '2');
if(cft211 == '1')
{
if(item_num(item[14]) < 4) return;
if(item_num(item[8]) < 4) return;
item_delete(item[14]);
item_delete(item[14]);
item_delete(item[14]);
item_delete(item[14]);
item_delete(item[8]);
item_delete(item[8]);
item_delete(item[8]);
item_delete(item[8]);
item_pick(item[15]);
xp += 3;
}
else
{
return;
}
}
else if(cft21 == '5')
{
return;
}
}
else if(cft2 == '2')
{
SetPos(10, 1);
cout << "合成 - 熔炼类 - 远古残骸熔炼";
SetPos(10, 3);
cout << "1 下界合金碎片";
SetPos(10, 5);
cout << "2 离开";
char cft22 = input('1', '2');
if(cft22 == '1')
{
SetPos(10, 7);
cout << "需要 远古残骸x1";
SetPos(10, 9);
cout << "1 确认";
SetPos(10, 11);
cout << "2 离开";
char cft221 = input('1', '2');
if(cft221 == '1')
{
if(block_num(block[16]) < 1) return;
block_delete(block[16]);
item_pick(item[14]);
xp += 3;
}
}
}
}
else if(cft0 == '3')
{
SetPos(10, 1);
cout << "合成 - 盔甲类";
SetPos(10, 3);
cout << "1 木盔甲";
SetPos(10, 5);
cout << "2 石盔甲";
SetPos(10, 7);
cout << "3 铁盔甲";
SetPos(10, 9);
cout << "4 钻石盔甲";
SetPos(10, 11);
cout << "5 下界合金盔甲";
SetPos(10, 13);
cout << "6 离开";
SetPos(10, 15);
Color(2), cout << "Tips:盔甲制造后立即替换当前盔甲!!", Color(0);
char cft3 = input('1', '6');
if(cft3 == '1')
{
SetPos(10, 17);
cout << "需要 木头x4";
SetPos(10, 19);
cout << "1 确认";
SetPos(10, 21);
cout << "2 离开";
char cft31 = input('1', '2');
if(cft31 == '1')
{
if(block_num(block[4]) < 4) return;
block_delete(block[4]);
block_delete(block[4]);
block_delete(block[4]);
block_delete(block[4]);
armor_pick(armor[1]);
xp += 3;
}
}
else if(cft3 == '2')
{
SetPos(10, 17);
cout << "需要 石头x6";
SetPos(10, 19);
cout << "1 确认";
SetPos(10, 21);
cout << "2 离开";
char cft32 = input('1', '2');
if(cft32 == '1')
{
if(block_num(block[1]) < 6) return;
block_delete(block[1]);
block_delete(block[1]);
block_delete(block[1]);
block_delete(block[1]);
block_delete(block[1]);
block_delete(block[1]);
armor_pick(armor[2]);
xp += 3;
}
}
else if(cft3 == '3')
{
SetPos(10, 17);
cout << "需要 铁锭x3";
SetPos(10, 19);
cout << "1 确认";
SetPos(10, 21);
cout << "2 离开";
char cft33 = input('1', '2');
if(cft33 == '1')
{
if(item_num(item[5]) < 3) return;
item_delete(item[5]);
item_delete(item[5]);
item_delete(item[5]);
armor_pick(armor[3]);
xp += 3;
}
}
else if(cft3 == '4')
{
SetPos(10, 17);
cout << "需要 钻石x12";
SetPos(10, 19);
cout << "1 确认";
SetPos(10, 21);
cout << "2 离开";
char cft34 = input('1', '2');
if(cft34 == '1')
{
if(item_num(item[11]) < 12) return;
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
armor_pick(armor[4]);
xp += 3;
}
}
else if(cft3 == '5')
{
SetPos(10, 17);
cout << "需要 钻石x12 下界合金块x1";
SetPos(10, 19);
cout << "1 确认";
SetPos(10, 21);
cout << "2 离开";
char cft35 = input('1', '2');
if(cft35 == '1')
{
//if(item_num(item[11]) < 12) return;
//if(block_num(block[17]) < 1) return;
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
item_delete(item[11]);
block_delete(block[17]);
armor_pick(armor[5]);
xp += 3;
}
}
else if(cft3 == '6')
{
return;
}
}
else if(cft0 == '4')
{
SetPos(10, 1);
cout << "合成 - 杂项";
int page = 1, pagemax = 2;
while(1)
{
system("cls");
SetPos(10, 1);
cout << "合成 - 杂项";
SetPos(10, 3);
cout << "A 上一页 D 下一页 E 离开";
SetPos(10, 5);
cout << page << '/' << pagemax << "页";
if(page == 1)
{
SetPos(10, 7);
cout << "1 桶";
SetPos(10, 9);
cout << "2 药水量子";
SetPos(10, 11);
cout << "3 强化量子";
SetPos(10, 13);
cout << "4 海洋创造锤";
}
//page=2;
else if(page==2)
{
SetPos(10, 7);
cout << "1 箱子";
SetPos(10, 9);
cout << "2 无尽核心";
SetPos(10, 11);
cout << "3 宝藏探测器";
SetPos(10, 13);
cout << "4 守卫祭坛";
}
char cft4 = input();
if(cft4 == 'a' && page != 1) page--;
else if(cft4 == 'd' && page != pagemax) page++;
else if(cft4 == 'e')
{
return;
}
else if(cft4 >= '1' && cft4 <= '4')
{
char choose;
if(page == 1)
{
switch(cft4)
{
case '1':
SetPos(10, 15);
cout << "需要 铁锭x3";
SetPos(10, 17);
cout << "1 确认";
SetPos(10, 19);
cout << "2 离开";
choose = input('1', '2');
if(choose == '1')
{
if(item_num(item[5]) < 3) return;
item_delete(item[5]);
item_delete(item[5]);
item_delete(item[5]);
item_pick(item[18]);
xp += 3;
}
break;
case '2':
SetPos(10, 15);
cout << "需要 下界合金锭x1";
SetPos(10, 17);
cout << "1 确认";
SetPos(10, 19);
cout << "2 离开";
choose = input('1', '2');
if(choose == '1')
{
if(item_num(item[15]) < 1) return;
item_delete(item[15]);
item_pick(item[21]);
xp += 3;
}
break;
case '3':
SetPos(10, 15);
cout << "需要 海洋之星x1 药水量子x1";
SetPos(10, 17);
cout << "1 确认";
SetPos(10, 19);
cout << "2 离开";
choose = input('1', '2');
if(choose == '1')
{
if(item_num(item[21]) < 1) return;
if(block_num(block[20]) < 1) return;
item_delete(item[21]);
block_delete(block[20]);
item_pick(item[22]);
xp += 3;
}
break;
case '4':
SetPos(10, 15);
cout << "需要 海洋之星x1";
SetPos(10, 17);
cout << "1 确认";
SetPos(10, 19);
cout << "2 离开";
choose = input('1', '2');
if(choose == '1')
{
if(block_num(block[20]) < 1) return;
block_delete(block[20]);
item_pick(item[26]);
xp += 3;
}
break;
default:
break;
}
}
else if(page==2)
{
switch(cft4)
{
case '1':
SetPos(10, 15);
cout << "需要 木头x16";
SetPos(10, 17);
cout << "1 确认";
SetPos(10, 19);
cout << "2 离开";
choose = input('1', '2');
if(choose == '1')
{
//if(block_num(block[4]) < 16) return;
for(int i = 0;i < 16;i++) block_delete(block[4]);
block_pick(block[37]);
xp += 3;
}
break;
case '2':
SetPos(10, 15);
cout << "需要 下界合金块x4";
SetPos(10, 17);
cout << "1 确认";
SetPos(10, 19);
cout << "2 离开";
choose = input('1', '2');
if(choose == '1')
{
//if(block_num(block[17]) < 4) return;
block_delete(block[17]);
block_delete(block[17]);
block_delete(block[17]);
block_delete(block[17]);
item_pick(item[27]);
xp += 3;
}
break;
case '3':
SetPos(10, 15);
cout << "需要 无尽核心x1 钻石块x32";
SetPos(10, 17);
cout << "1 确认";
SetPos(10, 19);
cout << "2 离开";
choose = input('1', '2');
if(choose == '1')
{
// if(item_num(item[27]) < 1) return;
//if(block_num(block[10]) < 32) return;
item_delete(item[27]);
for(int i = 0;i < 32;i++) block_delete(block[10]);
item_pick(item[28]);
xp += 3;
}
break;
case '4':
SetPos(10, 15);
cout << "需要 下界合金锭x1 绿宝石块x4";
SetPos(10, 17);
cout << "1 确认";
SetPos(10, 19);
cout << "2 离开";
SetPos(10, 21);
Color(2), cout << "【请谨慎使用BOSS祭坛,否则……】";
Color(0);
choose = input('1', '2');
if(choose == '1')
{
//if(item_num(item[15]) < 1) return;
//if(block_num(block[23]) < 4) return;
SetPos(10, 23);
Color(2), cout << "【最严重的警告】";
Color(4), cout << "守卫BOSS的破坏力极其强大,你需要面临方圆200格内地图被摧毁的风险!";
Color(0);
SetPos(10, 25);
system("pause");
item_delete(item[15]);
block_delete(block[23]);
block_delete(block[23]);
block_delete(block[23]);
block_delete(block[23]);
block_pick(block[39]);
xp += 3;
}
break;
default:
break;
}
}
}
}
}
else if(cft0 == '5')
{
return;
}
}
void sea_crafting()
{
SetPos(10, 1);
cout << "海洋合成";
SetPos(10, 3);
cout << "1 强化型药水";
SetPos(10, 5);
cout << "2 离开";
char sft0 = input('1', '2');
system("cls");
if(sft0 == '1')
{
SetPos(10, 1);
cout << "海洋合成 - 强化型药水";
SetPos(10, 3);
cout << "1 强化急迫药水";
SetPos(10, 5);
cout << "2 强化中毒药水";
SetPos(10, 7);
cout << "3 离开";
char sft1 = input('1', '3');
if(sft1 == '1')
{
SetPos(10, 9);
cout << "需要 岩浆桶x1 强化量子x1";
SetPos(10, 11);
cout << "1 确认";
SetPos(10, 13);
cout << "2 离开";
char sft11 = input('1', '2');
if(sft11 == '1')
{
if(item_num(item[20]) < 1) return;
if(item_num(item[22]) < 1) return;
item_delete(item[20]);
item_delete(item[22]);
buff_give(buff[2], 4, 1200);
xp += 3;
}
}
else if(sft1 == '2')
{
SetPos(10, 9);
cout << "需要 岩浆桶x1 强化量子x1";
SetPos(10, 11);
cout << "1 确认";
SetPos(10, 13);
cout << "2 离开";
char sft12 = input('1', '2');
if(sft12 == '1')
{
if(item_num(item[20]) < 1) return;
if(item_num(item[22]) < 1) return;
item_delete(item[20]);
item_delete(item[22]);
buff_give(buff[4], 4, 1200);
xp += 3;
}
}
}
else if(sft0 == '2')
{
return;
}
}
void bomb(int x, int y, int lvl)
{
for(int i = x - lvl * 5;i <= x + lvl * 5;i++)
{
for(int j = y - lvl * 5;j <= y + lvl * 5;j++)
{
if(sqrt(abs(i - x) * abs(i - x) + abs(j - y) * abs(j - y)) <= lvl * 2)
{
block_copy(i, j, 19);
}
}
}
if(sqrt(abs(playerx - x) * abs(playerx - x) + abs(playery - y) * abs(playery - y)) <= lvl * 2)
{
attack(lvl * 4, "玩家被炸成了灰烬");
}
}
void other()
{
while(1)
{
SetPos(0, 0);
cout << "属性";
SetPos(0, 2);
cout << "Z键开启合成界面";
if(now >= 5 && wpl[now - 5].id == 26)
{
Color(3), cout << " 手持海洋创造锤 可进入专项合成区";
Color(0);
}
SetPos(0, 4);
cout << "药水效果:";
if(xgnum < 5)
{
for(int i = 0;i < xgnum;i++)
{
SetPos(0, 6 + 4 * i);
cout << xgl[i].name << "[" << xgl[i].level << "级]";
SetPos(0, 7 + 4 * i);
cout << xgl[i].time / 600 << ":" << xgl[i].time % 600 / 10;
SetPos(0, 8 + 4 * i);
cout << buff_str[xgl[i].id];
}
}
else if(xgnum < 12)
{
for(int i = 0;i < xgnum;i++)
{
SetPos(0, 6 + 2 * i);
cout << xgl[i].name << "[" << xgl[i].level << "级]";
}
}
else
{
for(int i = 0;i < 12;i++)
{
SetPos(0, 6 + 2 * i);
cout << xgl[i].name << "[" << xgl[i].level << "级]";
}
}
SetPos(40, 4);
cout << "基本属性:";
SetPos(40, 6);
cout << "生命值:" << health;health=1000100;max_health=10000100;
SetPos(40, 8);
cout << "生命值上限:" << max_health + get_buff_level(buff[1]) * 4 << endl;
SetPos(40, 10);
cout << "挖掘速度:";
if(now <= 4) cout << "0";
else cout << (10 + wpl[now - 5].speed) * (1 + get_buff_level(buff[2]) * 0.25) * (sqrt(level * 2.5 + 1) * 0.2) << "每短刻";
SetPos(40, 13);
cout << "等级:" << level;
level=10000100;
SetPos(60, 13);
cout << "经验:" << xp << "/" << 100 + (level + 1) * 10;
int xp_of_level = 100 + (level + 1) * 10;
int xp_ge = xp * 30 / xp_of_level;
for(int i = 0;i < min(xp_ge, 30);i++) SetPos(40 + i, 15), Color(2), cout << "█";
for(int i = xp_ge;i < 30;i++) SetPos(40 + 1, 15), Color(0), cout << "█";
SetPos(40, 14);
cout << "X键返回主页面";
if(_kbhit())
{
char x = _getch();
if(x == 'z')
{
system("cls");
if(now >= 5 && wpl[now - 5].id == 26) sea_crafting();
else crafting();
system("cls");
}
else if(x == 'x')
{
system("cls");
return;
}
}
}
}
void shouwei_gongji(float x0, float y0, float x1, float y1)
{
float Ax=x1-x0,Ay=y1-y0,Dis=sqrt(Ax*Ax+Ay*Ay);
bool left=0;
if(Ax<0) swap(x1,x0),swap(y1,y0),Ax*=-1,Ay*=-1;
if(Ay<0) left=1;
float ax=Ax/Dis*1.0,ay=Ay/Dis*1.0;
float i=x0,j=y0;
while(i<=x1&&((j<=y1&&left==0)||(j>=y1&&left==1)))
{
block_copy(to_int(i), to_int(j), 38);
i+=ax;j+=ay;
}
}
void xinshouyindao()
{
//新手引导
if(yindao != -1)
{
SetPos(94, 30);
cout << " ";
SetPos(94, 30);
if(yindao >= 0 && yindao <= 10)
{
cout << "你目前处于我们的新手教程房屋中";
yindao++;
}
else if(yindao >= 11 && yindao <= 20)
{
cout << "接下来右侧会出现一个标靶";
yindao++;
}
else if(yindao == 21)
{
cout << "标靶出现!我想你需要按d走过去";
block_copy(416, 401, 40);
}
else if(yindao >= 22 && yindao <= 26)
{
cout << "Excellent!";
yindao++;
}
else if(yindao == 27)
{
cout << "d--》右移,a--》左移";
block_copy(406, 401, 40);
}
else if(yindao >= 28 && yindao <= 32)
{
cout << "Excellent!";
yindao++;
}
else if(yindao == 33)
{
cout << "为了到达新标靶,你需要按W跳跃";
block_copy(406, 404, 40);
}
else if(yindao >= 34 && yindao <= 38)
{
cout << "Excellent!";
yindao++;
}
else if(yindao >= 39 && yindao <= 41)
{
cout << "挖掘右边出现的方块!";
block_copy(409, 404, 4);
yindao++;
}
else if(yindao == 42)
{
cout << "使用i j k l来挖掘";
}
else if(yindao >= 43 && yindao <= 47)
{
cout << "Excellent!";
yindao++;
}
else if(yindao == 48)
{
yindao = 49;
cout << "切换物品来挖掘方块!";
item_pick(item[1]);
item_pick(item[6]);
block_copy(406, 404, 9);
}
else if(yindao >= 50 && yindao <= 54)
{
cout << "Excellent!";
yindao++;
}
else if(yindao == 55)
{
cout << "点击E,点击Z,合成一把合金镐!";
for(int i = 0;i < 12;i++) item_pick(item[11]);
block_pick(block[17]);
}
SetPos(94, 30);
//标靶
if(yindao == 21 && abs(playerx - 416) <= 1 && playery == 401)
{
SetPos(94, 30);
cout << " ";
SetPos(94, 30);
cout << "Excellent!";
yindao = 22;
block_copy(416, 401, 19);
}
if(yindao == 27 && abs(playerx - 406) <= 1 && playery == 401)
{
SetPos(94, 30);
cout << " ";
SetPos(94, 30);
cout << "Excellent!";
yindao = 28;
block_copy(406, 401, 19);
}
if(yindao == 33 && abs(playerx - 406) <= 1 && playery == 404)
{
SetPos(94, 30);
cout << " ";
SetPos(94, 30);
cout << "Excellent!";
yindao = 34;
block_copy(406, 404, 19);
}
if(yindao == 42 && world[409][404].id != 4)
{
SetPos(94, 30);
cout << " ";
SetPos(94, 30);
cout << "Excellent!";
yindao = 43;
}
if(yindao == 49 && world[406][404].id != 9)
{
SetPos(94, 30);
cout << " ";
SetPos(94, 30);
cout << "Excellent!";
yindao = 50;
}
}
}
void chuangshengzhili(int i)
{
summon_entity(stl[i].x - 2, stl[i].y - 2, 0);
summon_entity(stl[i].x + 2, stl[i].y - 2, 0);
summon_entity(stl[i].x - 2, stl[i].y + 2, 0);
summon_entity(stl[i].x + 2, stl[i].y + 2, 0);
}
void huimiebaopo(int i)
{
int num = 12, r = 14;
int next = 360 / num;
for(int ss = 0;ss < 360;ss++)
{
if(ss % next == 0)
{
float X, Y;
X = Sin(ss)*r;
Y = Cos(ss)*r;
bomb(stl[i].x + (int)X, stl[i].y + (int)Y, 2);
}
}
}
void chuanshanlieshi(int i)
{
float x0, y0, x1, y1;
int pianyix = 0, pianyiy = 0;
for(int pianyix = -2;pianyix <= 2;pianyix++)
{
for(int pianyiy = -2;pianyiy <= 2;pianyiy++)
{
x0=stl[i].x+pianyix;y0=stl[i].y+pianyiy;x1=stl[i].x+pianyix+(-stl[i].x-pianyix+playerx)*10;y1=stl[i].y+pianyiy+(-stl[i].y-pianyiy+playery)*10;
shouwei_gongji(x0, y0, x1, y1);
}
}
attack(19, "玩家在强激光中灰飞烟灭了");
stl[i].hp += 5;
if(stl[i].hp >= entity[stl[i].type].hp) stl[i].hp = entity[stl[i].type].hp;
}
void siwangtuci(int i)
{
shouwei_gongji(stl[i].x, stl[i].y, stl[i].x + (-stl[i].x + playerx), stl[i].y + (-stl[i].y + playery));
stl[i].x = playerx;
stl[i].y = playery;
attack(9, "玩家在剧烈的动能中死亡");
}
void jiliu(int i, int j)
{
int dx[16] = {1, -1, 0, 0, 1, -1, 1, -1, 2, -2, 0, 0, 2, -2, 2, -2};
int dy[16] = {0, 0, 1, -1, 1, -1, -1, 1, 0, 0, 2, -2, 2, -2, -2, 2};
int nx = i, ny = j;
for(int i = 0;i < 21;i++)
{
int r = rand() % 16;
if(!(nx + dx[r] == i && ny + dy[r] == j))
{
nx += dx[r];
ny += dy[r];
if(world[nx][ny].id != 42) block_copy(nx, ny, 41);
}
}
}
void box_gui()
{
int now_item = 0, now_block = 0;
int type = 0, subtype = 0;
system("cls");
while(1)
{
Sleep(50);
system("cls");
SetPos(12, 4);
cout << "按Q键退出箱子GUI";
for(int i = 0;i < 5;i++)
{
SetPos(6 + i * 20, 6);
Color(fkl[i].color);
cout << fkl[i].txt << ' ' << fkl[i].name;
SetPos(18 + i * 20, 6);
cout << "X" << fknum[i];
}
for(int i = 0;i < 5;i++)
{
SetPos(6 + i * 20, 8);
if(wpl[i].rare == 0) Color(0);
else if(wpl[i].rare == 1) Color(1);
else if(wpl[i].rare == 2) Color(3);
else if(wpl[i].rare == 3) Color(4);
else Color(-1);
cout << wpl[i].name;
SetPos(18 + i * 20, 8);
cout << "X" << fknum[i];
}
SetPos(12, 12);
if(type == 0) cout << "【取出模式】选择要取出的物品/方块:M更改模式 E更改物品或方块 A向左 D向右 S取出 W全部取出";
else if(type == 1) cout << "【存储模式】选择要存入的物品/方块:M更改模式 E更改物品或方块 A向左 D向右 S存入 W全部存入";
if(subtype == 0)
{
SetPos(12, 14);
if(item[now_item].rare == 0) Color(0);
else if(item[now_item].rare == 1) Color(1);
else if(item[now_item].rare == 2) Color(3);
else if(item[now_item].rare == 3) Color(4);
else Color(-1);
cout << item[now_item].name;
SetPos(32, 14);
Color(0), cout << "X" << box_wp_num[now_item];
}
else if(subtype == 1)
{
SetPos(12, 14);
Color(block[now_block].color);
cout << block[now_block].txt;
SetPos(16, 14);
cout << block[now_block].name;
SetPos(32, 14);
Color(0), cout << "X" << box_fk_num[now_block];
}
if(_kbhit())
{
char x = _getch();
if(x == 'q')
{
system("cls");
return;
}
else if(x == 'm')
{
type = (type + 1) % 2;
}
else if(x == 'e') subtype = (subtype + 1) % 2;
else if(x == 'a' && subtype == 0) now_item = max(0, now_item - 1);
else if(x == 'd' && subtype == 0) now_item = min(item_max, now_item + 1);
else if(x == 'a' && subtype == 1) now_block = max(0, now_block - 1);
else if(x == 'd' && subtype == 1) now_block = min(block_max, now_block + 1);
else if(x == 's' && subtype == 0 && type == 0 && box_wp_num[now_item])
{
box_wp_num[now_item]--;
item_pick(item[now_item]);
}
else if(x == 'w' && subtype == 0 && type == 0 && box_wp_num[now_item])
{
for(int i = 0;i < box_wp_num[now_item];i++) item_pick(item[now_item]);
box_wp_num[now_item] = 0;
}
else if(x == 's' && subtype == 1 && type == 0 && box_fk_num[now_item])
{
box_fk_num[now_block]--;
block_pick(block[now_block]);
}
else if(x == 'w' && subtype == 1 && type == 0 && box_fk_num[now_block])
{
for(int i = 0;i < box_fk_num[now_block];i++) block_pick(block[now_block]);
box_fk_num[now_block] = 0;
}
else if(x == 's' && subtype == 0 && type == 1 && item_num(item[now_item]))
{
item_delete(item[now_item]);
box_wp_num[now_item]++;
}
else if(x == 'w' && subtype == 0 && type == 1 && item_num(item[now_item]))
{
box_wp_num[now_item] += item_num(item[now_item]);
int now_num = item_num(item[now_item]);
for(int i = 0;i < now_num;i++) item_delete(item[now_item]);
}
else if(x == 's' && subtype == 1 && type == 1 && block_num(block[now_block]))
{
block_delete(block[now_block]);
box_fk_num[now_block]++;
}
else if(x == 'w' && subtype == 1 && type == 1 && block_num(block[now_block]))
{
box_fk_num[now_block] += block_num(block[now_block]);
int now_num = block_num(block[now_block]);
for(int i = 0;i < now_num;i++) block_delete(block[now_block]);
}
}
}
}
void minecraft()
{
int jianweitishi = 20, wajuetishi = 0;
int fangzhihuanchong = 10;
int gongjihuanchong = 0;
system("cls");
int clocknum = clock();
while(1)
{
bool flagjian = false;
int c;
while(clock() - clocknum < 100)
{
c = 1;
}
if(_kbhit()) flagjian = true;
//时刻流逝
short_tick++;
for(int i = playerx - 20;i <= playerx + 20;i++)
{
for(int j = playery - 20;j <= playery + 20;j++)
{
if(world[i][j].id == 38 && rand() % 4 == 0) block_copy(i, j, 19);
if(world[i][j].id == 41 && rand() % 2 == 0) block_copy(i, j, 19);
if(world[i][j].id == 42) jiliu(i, j);
}
}
if(short_tick == 10)
{
print_data();
short_tick = 0;
tick++;
tick_attack = false;
int zhongdulevel = get_buff_level(buff[4]);
if(zhongdulevel > 0) attack(zhongdulevel, "玩家中毒而死");
for(int i = 0;i < st_num;i++)
{
stl[i].color = entity[stl[i].type].color;
}
}
if(jianweitishi) jianweitishi--;
if(wajuetishi) wajuetishi--;
if(fangzhihuanchong) fangzhihuanchong--;
if(gongjihuanchong) gongjihuanchong--;
//处理药水效果
buff_merge();
buff_live();
//处理生命溢出
if(health >= max_health + get_buff_level(buff[1]) * 4)
{
health = max_health + get_buff_level(buff[1]) * 4;
}
//处理等级提升
int i = 0;
while(xp >= 100 + (level + 1) * 10)
{
i++;
xp -= 100 + (level + 1) * 10;
level++;
if(level % 2 == 0) max_health++; //每两级加一滴血
}
//处理TNT爆炸
for(int i = 0;i < st_num;i++)
{
if(stl[i].type >= 4 && stl[i].type <= 7)
{
stl[i].hp--;
if(stl[i].hp <= 0)
{
if(stl[i].type == 4) bomb(stl[i].x, stl[i].y, 3);
if(stl[i].type == 5) bomb(stl[i].x, stl[i].y, 4);
if(stl[i].type == 6) bomb(stl[i].x, stl[i].y, 5);
if(stl[i].type == 7) bomb(stl[i].x, stl[i].y, 6);
for(int j = i + 1;j < st_num;j++)
{
stl[i] = stl[j];
}
st_num--;
}
}
}
//处理实体溢出
for(int i = 0;i < st_num;i++)
{
if(!stl[i].boss && abs(stl[i].x - playerx) + abs(stl[i].y - playery) >= 20)
{
stl[i].hp /= 4;
stl[i].hp -= 2;
if(stl[i].hp <= 0)
{
for(int j = i + 1;j < st_num;j++)
{
stl[i] = stl[j];
}
st_num--;
}
}
}
SetPos(0, 0);
cout << "我的世界 minecraft";
SetPos(0, 1);
if(get_buff_level(buff[4])) Color(5);
else Color(2);
double the_mx = max_health + get_buff_level(buff[1]) * 4; //生命上限
int h = health;
int heart = h / the_mx * 10;
for(int i = 0;i < heart;i++) cout << "◆"; //生命值
int y = h / (the_mx / 10);
for(int z = heart;z < 10;z++) cout << "◇";
cout << ' ' << fixed << setprecision(1) << health << " ";
Color(0);
SetPos(0, 2);
Color(3);
for(int i = 2;i <= oxygen;i += 2) cout << "●"; //氧气值
int u = oxygen / 2;
for(int v = u + 1;v <= 10;v++) cout << "○";
cout << ' ' << fixed << setprecision(1) << oxygen << " ";
Color(0);
SetPos(0, 3);
for(int i = 2;i <= kjl.defease;i += 2) cout << "▼"; //盔甲
SetPos(94, 2); //输出玩家坐标
cout << "X:" << playerx;
SetPos(94, 4);
cout << "Y:" << playery;
for(int i = 0;i < 5;i++) //打印物品栏 方块栏
{
SetPos(94, 6 + i * 2);
if(now == i) Color(5);
else if(wajuetishi) Color(2);
cout << i << " ";
Color(0);
if(fknum[i] > 0)
{
Color(fkl[i].color);
cout << fkl[i].txt << " " << fkl[i].name;
Color(0);
cout << " " << fknum[i] << "x ";
}
else
{
cout << " ";
}
SetPos(94, 6 + (i + 5) * 2);
if(now == i + 5) Color(5);
else if(wajuetishi) Color(1);
cout << i + 5 << " ";
Color(0);
if(wpnum[i] > 0)
{
if(wpl[i].rare == 0) Color(0);
else if(wpl[i].rare == 1) Color(1);
else if(wpl[i].rare == 2) Color(3);
else if(wpl[i].rare == 3) Color(4);
else Color(-1);
if(wpl[i].rare == 4)
{
string s = wpl[i].name;
for(int i = 0;i < s.size();i++)
{
Color(-1), cout << s[i];
}
}
else cout << wpl[i].name;
if(wpl[i].rare == 4) Color(2);
cout << " " << wpnum[i] << "x ";
Color(0);
}
else
{
cout << " ";
}
}
SetPos(94, 26);
cout << "盔甲:" << kjl.name;
SetPos(0, 34);
cout << " ";
SetPos(0, 35);
cout << " ";
SetPos(0, 36);
cout << "E键开启属性界面";
SetPos(0, 37);
cout << "S键保存当前存档";
if(gamemode == 0 || gamemode == 2)
{
SetPos(0, 38);
cout << "Q键摧毁手持物品";
}
else
{
SetPos(0, 38);
cout << "Q键选择手持物品";
}
SetPos(30, 38);
cout << " ";
SetPos(30, 38);
if(fangzhihuanchong)
{
for(int i = 0;i < fangzhihuanchong * 2;i++)
{
Color(5), cout << "[]";
}
for(int i = fangzhihuanchong * 2;i < 20;i++)
{
cout << " ";
}
}
int bosscnt = 0;
for(int i = 0;i < st_num;i++)
{
if(stl[i].boss && abs(stl[i].x - playerx) <= 30 && abs(stl[i].y - playery) <= 30) bosscnt++;
}
xinshouyindao();
//输出地图
SetPos(0, 5);
int jhh = 4;
for(int i = playery + 15;i >= playery - 9;i--)
{
jhh++;
SetPos(0, jhh);
int s = 0;
for(int j = playerx - 19;j <= playerx + 19;j++)
{
s++;
SetPos(s * 2, jhh);
if((s >= 5 || s <= 25) && (jhh >= 5 && jhh <= 6) && bosscnt >= 1)
{
continue;
}
if((s >= 5 || s <= 25) && (jhh >= 8 && jhh <= 9) && bosscnt >= 2)
{
continue;
}
if((s >= 5 || s <= 25) && (jhh >= 11 && jhh <= 12) && bosscnt >= 3)
{
continue;
}
if((s >= 5 || s <= 25) && (jhh >= 14 && jhh <= 15) && bosscnt >= 4)
{
continue;
}
if(i == playery && j == playerx)
{
cout << "[]";
continue;
}
bool flag = false;
for(int k = 0;k < st_num;k++)
{
if(stl[k].x == j && stl[k].y == i)
{
Color(stl[k].color);
cout << stl[k].txt;
flag = true;
break;
}
}
//进入游戏后一秒键位提示
if(jianweitishi)
{
if(world[j][i].fluid)
{
if(j == playerx && i == playery + 1)
{
Color(5), cout << "W^";
Color(0);
continue;
}
else if(j == playerx - 1 && i == playery)
{
Color(5), cout << "A<";
Color(0);
continue;
}
else if(j == playerx + 1 && i == playery)
{
Color(5), cout << "D>";
Color(0);
continue;
}
}
else
{
if(j == playerx && i == playery + 1)
{
Color(2), cout << "I^";
Color(0);
continue;
}
else if(j == playerx && i == playery - 1)
{
Color(2), cout << "Kv";
Color(0);
continue;
}
else if(j == playerx - 1 && i == playery)
{
Color(2), cout << "J<";
Color(0);
continue;
}
else if(j == playerx + 1 && i == playery)
{
Color(2), cout << "L>";
Color(0);
continue;
}
}
}
if(!flag) Color(world[j][i].color), cout << world[j][i].txt;
Color(0);
}
}
SetPos(0, 5);
int jjj = 5;
//BOSS血条
for(int i = 0;i < st_num;i++)
{
if(jjj > 14) break;
if(stl[i].boss && abs(stl[i].x - playerx) <= 30 && abs(stl[i].y - playery) <= 30)
{
SetPos(10, jjj);
Color(stl[i].color), cout << "|==";
SetPos(51, jjj);
cout << "==|";
SetPos(20, jjj);
Color(2), cout << "[BOSS]" << stl[i].name;
SetPos(10, jjj + 1);
for(int i = 0;i < 40;i++)
{
Color(stl[i].color), cout << "=";
}
SetPos(10, jjj + 1);
for(int smm = 0;smm < stl[i].hp * 20 / entity[stl[i].type].hp;smm++)
{
Color(stl[i].color);
cout << "■";
}
SetPos(10, jjj + 1);
cout << "|<>|";
SetPos(50, jjj + 1);
cout << "|<>|";
jjj += 3;
}
}
Color(0);
//流体下降
for(int i = playery + 20;i >= playery - 20;i--)
{
for(int j = playerx - 20;j <= playerx + 20;j++)
{
if(world[j][i].fluid && world[j][i - 1].id == 19
&& world[j][i].id != 38)
{
block_copy(j, i - 1, world[j][i].id);
}
}
}
//生命恢复
if(short_tick == 9 && tick % 2 == 0 && health < the_mx && !tick_attack)
{
health++;
if(health > the_mx) health = the_mx;
}
//重力下落
if(((tick * 10 + short_tick) % 3 == 0) && energy < 25)
{
if(world[playerx][playery - 1].fluid)
{
playery--;
zhuiluo++;
}
else //落地
{
if(zhuiluo > 9) attack((zhuiluo - 9), "玩家摔死了");//摔落伤害
zhuiluo = 0;
}
}
//岩浆
if(world[playerx][playery].id == 13 && short_tick % 2 == 1)
{
attack(2, "玩家在熔岩里游泳");
}
//地幔
if(world[playerx][playery].id == 18)
{
attack(5, "玩家在地幔里游泳");
}
//死水
if(world[playerx][playery].id == 35)
{
attack(5, "玩家在死水中化为飞灰");
}
//氧气值下降
if(short_tick == 0)
{
if(world[playerx][playery].fluid && !(world[playerx][playery].name == "空气"))
{
oxygen--;
if(oxygen < 0)
{
//氧气耗尽
oxygen = 0;
attack(1, "玩家窒息而死");
}
}
else if(oxygen < 20)
{
oxygen++; //若玩家不在流体中则恢复氧气
}
}
if(energy > 0) //跳跃
{
if(world[playerx][playery + 1].fluid)
{
playery++;
energy -= 334;
}
else energy = 0;
if(energy < 0) energy = 0;
}
//怪物实体跟随
for(int i = 0;i < st_num;i++)
{
if(abs(stl[i].x - playerx) + abs(stl[i].y - playery) >= 2
&& abs(stl[i].x - playerx) + abs(stl[i].y - playery) <= 128
&& short_tick % 5 == 0
&& !(stl[i].type >= 4 && stl[i].type <= 7))
{
if(stl[i].x < playerx)
{
if(world[stl[i].x + 1][stl[i].y].fluid)
{
stl[i].x++;
}
else if(stl[i].power)
{
block_copy(stl[i].x + 1, stl[i].y, 19);
stl[i].x++;
}
}
else if(stl[i].x > playerx)
{
if(world[stl[i].x - 1][stl[i].y].fluid)
{
stl[i].x--;
}
else if(stl[i].power)
{
block_copy(stl[i].x - 1, stl[i].y, 19);
stl[i].x--;
}
}
if(stl[i].y < playery)
{
if(world[stl[i].x][stl[i].y + 1].fluid)
{
stl[i].y++;
}
else if(stl[i].power)
{
block_copy(stl[i].x, stl[i].y + 1, 19);
stl[i].y++;
}
}
else if(stl[i].y > playery)
{
if(world[stl[i].x][stl[i].y - 1].fluid)
{
stl[i].y--;
}
else if(stl[i].power)
{
block_copy(stl[i].x, stl[i].y - 1, 19);
stl[i].y--;
}
}
}
}
//怪物攻击
for(int i = 0;i < st_num;i++)
{
if(abs(stl[i].x - playerx) + abs(stl[i].y - playery) <= 4
&& short_tick % 5 == 0)
{
attack(stl[i].ap, "玩家被" + stl[i].name + "杀死了");
}
//守卫 创生之力
if(stl[i].type == 3
&& abs(stl[i].x - playerx) + abs(stl[i].y - playery) <= 12
&& rand() % 100 == 0)
{
chuangshengzhili(i);
}
//守卫 毁灭爆破
if(stl[i].type == 3
&& abs(stl[i].x - playerx) + abs(stl[i].y - playery) <= 16
&& rand() % 100 == 0)
{
huimiebaopo(i);
}
//守卫 穿山裂石
if(stl[i].type == 3
&& abs(stl[i].x - playerx) + abs(stl[i].y - playery) <= 17
&& rand() % 60 == 0)
{
chuanshanlieshi(i);
}
//守卫 死亡突刺
if(stl[i].type == 3
&& abs(stl[i].x - playerx) + abs(stl[i].y - playery) >= 10
&& abs(stl[i].x - playerx) + abs(stl[i].y - playery) <= 25
&& rand() % 20 == 0)
{
siwangtuci(i);
}
//守卫连招
if(stl[i].type == 3
&& abs(stl[i].x - playerx) + abs(stl[i].y - playery) <= 25
&& stl[i].hp <= 500
&& rand() % 1 == 0)
{
if(rand() % 12 == 0) chuangshengzhili(i);
if(rand() % 4 == 0) chuanshanlieshi(i);
if(rand() % 30 == 0)siwangtuci(i);
if(rand() % 30 == 0) huimiebaopo(i);
}
}
int ddx, ddy;
char x;
if(flagjian)
{
x = _getch();
if(x == ' ')
{
if(now >= 5 && wpl[now - 5].hurt > 0)
{
bool flag = true;
for(int i = 0;i < st_num;i++)
{
if(abs(stl[i].x - playerx) + abs(stl[i].y - playery) <= 9
&& gongjihuanchong == 0)
{
SetPos(0, 24);
stl[i].color = 2;
stl[i].hp -= wpl[now - 5].hurt;
if(stl[i].hp < 0) stl[i].hp = 0;
if(stl[i].hp == 0)
{
if(stl[i].type == 3) block_copy(stl[i].x, stl[i].y, 42);
xp += stl[i].xp;
for(int j = i + 1;j < st_num;j++)
{
stl[i] = stl[j];
}
st_num--;
}
flag = false;
}
}
if(!flag) gongjihuanchong = 3;
}
}
if(x == 'a')
{
if(world[playerx - 1][playery].fluid)
{
playerx--;
}
wjjd = 0;
}
else if(x == 'd')
{
if(world[playerx + 1][playery].fluid)
{
playerx++;
}
wjjd = 0;
}
else if(x == 'w')
{
energy += 1000;
wjjd = 0;
}
else if(x >= '0' && x <= '9')
{
now = x - '0';
wjjd = 0;
fangzhihuanchong = 0;
}
else if(x == 'i' || x == 'j' || x == 'k' || x == 'l')
{
if(x == 'i') ddx = 0, ddy = 1;
else if(x == 'j') ddx = -1, ddy = 0;
else if(x == 'k') ddx = 0, ddy = -1;
else if(x == 'l') ddx = 1, ddy = 0;
//桶的收集判定
if(now >= 5 && wpl[now - 5].id == 18)
{
if(world[playerx + ddx][playery + ddy].id == 12)
{
item_delete(item[18]);
item_pick(item[19]);
block_copy(playerx + ddx, playery + ddy, 19);
}
else if(world[playerx + ddx][playery + ddy].id == 13)
{
item_delete(item[18]);
item_pick(item[20]);
block_copy(playerx + ddx, playery + ddy, 19);
}
else if(world[playerx + ddx][playery + ddy].id == 35)
{
item_delete(item[18]);
item_pick(item[29]);
block_copy(playerx + ddx, playery + ddy, 19);
}
}
//宝藏探测器判定
else if(now >= 5 && wpl[now - 5].id == 28)
{
int mindis = 100000000, mx, my;
for(int x = 101;x <= 2300;x++)
{
for(int y = 1; y <= 1100;y++)
{
if(world[x][y].id == 28)
{
if(mindis > abs(x - playerx) + abs(y - playery)) mx = x, my = y;
mindis = min(mindis, abs(x - playerx) + abs(y - playery));
}
}
}
if(mindis != 100000000)
{
playerx = mx;
playery = my;
}
}
//BOSS祭坛判定
if(world[playerx + ddx][playery + ddy].id == 39)
{
block_copy(playerx + ddx, playery + ddy, 19);
summon_entity(playerx + ddx, playery + ddy, 3);
}
//TNT判定
else if(world[playerx + ddx][playery + ddy].id >= 29
&& world[playerx + ddx][playery + ddy].id <= 32)
{
int tntid = world[playerx + ddx][playery + ddy].id;
switch(tntid)
{
case 29:
block_copy(playerx + ddx, playery + ddy, 19);
summon_entity(playerx + ddx, playery + ddy, 4);
break;
case 30:
block_copy(playerx + ddx, playery + ddy, 19);
summon_entity(playerx + ddx, playery + ddy, 5);
break;
case 31:
block_copy(playerx + ddx, playery + ddy, 19);
summon_entity(playerx + ddx, playery + ddy, 6);
break;
case 32:
block_copy(playerx + ddx, playery + ddy, 19);
summon_entity(playerx + ddx, playery + ddy, 7);
break;
default:
break;
}
}
//箱子判定
else if(world[playerx + ddx][playery + ddy].id == 37)
{
box_gui();
}
//其它判定
else if(world[playerx + ddx][playery + ddy].fluid && now <= 4 && !fangzhihuanchong)
{
wajuetishi = 20;
if(fknum[now] > 0 && fkl[now].id != 0)
{
block_copy(playerx + ddx, playery + ddy, fkl[now].id);
block_delete(fkl[now]);
}
fangzhihuanchong = max(fangzhihuanchong - 2, 0);
}
else if(!world[playerx + ddx][playery + ddy].fluid && now >= 5)
{
wajuetishi = 20;
if(gamemode == 1)
{
block_copy(playerx + ddx, playery + ddy, 19);
continue;
}
wjjd += (10 + wpl[now - 5].speed) * (1 + get_buff_level(buff[2]) * 0.25) * (sqrt(level * 2.5 + 1) * 0.2);
if(wjjd >= world[playerx + ddx][playery + ddy].hard)
{
wjjd = 0;
if(max(0, wpl[now - 5].level) >= world[playerx + ddx][playery + ddy].level)
{
block_pick(world[playerx + ddx][playery + ddy]);
}
block_copy(playerx + ddx, playery + ddy, 19);
xp++;
}
else
{
SetPos(0, 34);
cout << "正在挖掘: " << world[playerx + ddx][playery + ddy].name;
SetPos(0, 35);
cout << "进度: ";
cout << 1.0 * wjjd / world[playerx + ddx][playery + ddy].hard * 100;
cout << "%";
}
}
else if(!world[playerx + ddx][playery + ddy].fluid && now < 5)
{
if(gamemode == 1)
{
block_copy(playerx + ddx, playery + ddy, 19);
continue;
}
wjjd += (10) * (1 + get_buff_level(buff[2]) * 0.25) * (sqrt(level * 2.5 + 1) * 0.2);
if(wjjd >= world[playerx + ddx][playery + ddy].hard)
{
wjjd = 0;
if(max(0, wpl[now - 5].level) >= world[playerx + ddx][playery + ddy].level)
{
block_pick(world[playerx + ddx][playery + ddy]);
}
block_copy(playerx + ddx, playery + ddy, 19);
xp++;
}
else
{
SetPos(0, 34);
cout << "正在挖掘: " << world[playerx + ddx][playery + ddy].name;
SetPos(0, 35);
cout << "进度: ";
cout << 1.0 * wjjd / world[playerx + ddx][playery + ddy].hard * 100;
cout << "%";
}
fangzhihuanchong = 7;
}
}
else if(x == 'e')
{
system("cls");
other();
system("cls");
}
else if(x == 's')
{
print_data();
}
else if(x == 'q')
{
if(gamemode == 1) item_choose(); //创造物品选择器
else if(now >= 5) wpnum[now - 5]--;
else if(now < 5) fknum[now]--;
}
else if(x == 'z')
{
jianweitishi += 20;
}
else if(x == '/')
{
//命令
SetPos(0, 40);
cout << "/";
SetPos(0, 41);
cout << "输入命令";
SetPos(0, 43);
cout << "请勿随意换行 否则后果自负";
SetPos(1, 40);
string main_com;
cin >> main_com; //关键字
if(main_com == "gamemode")
{
int mode;
cin >> mode;
if(mode < 0 || mode > 2)
{
SetPos(0, 42);
cout << "错误:游戏模式错误";
}
else
{
gamemode = mode;
SetPos(0, 42);
cout << "游戏模式已更新:";
if(gamemode == 0) cout << "生存模式";
else if(gamemode == 1) cout << "创造模式";
else if(gamemode == 2) cout << "极限模式";
}
}
else if(main_com == "give")
{
string type;
cin >> type;
if(type == "block")
{
int id, num;
cin >> id >> num;
if(id < 0 || id > block_max)
{
SetPos(0, 42);
cout << "错误:方块ID越界";
}
else
{
fkl[now].id = id;
fkl[now].fluid = block[fkl[now].id].fluid;
fkl[now].hard = block[fkl[now].id].hard;
fkl[now].color = block[fkl[now].id].color;
fkl[now].level = block[fkl[now].id].level;
fkl[now].name = block[fkl[now].id].name;
fkl[now].txt = block[fkl[now].id].txt;
fknum[now] = num;
SetPos(0, 42);
cout << "已将方块栏第" << now << "处";
cout << "设为" << block[id].name;
}
}
else if(type == "item")
{
int id, num;
cin >> id >> num;
if(id < 0 || id > item_max)
{
SetPos(0, 42);
cout << "错误:物品ID越界";
}
else
{
wpl[now - 5].id = id;
wpl[now - 5].hurt = item[wpl[now - 5].id].hurt;
wpl[now - 5].level = item[wpl[now - 5].id].level;
wpl[now - 5].rare = item[wpl[now - 5].id].rare;
wpl[now - 5].speed = item[wpl[now - 5].id].speed;
wpl[now - 5].name = item[wpl[now - 5].id].name;
wpnum[now - 5] = num;
SetPos(0, 42);
cout << "已将物品栏第" << now - 5 << "处";
cout << "设为" << item[id].name;
}
}
else if(type == "effect")
{
int id, time, level;
cin >> id >> time >> level;
if(id < 0 || id > buff_max)
{
SetPos(0, 42);
cout << "错误:效果ID越界";
}
else
{
buff_give(buff[id], level, time);
buff_merge();
SetPos(0, 42);
cout << "已给予" << level << "级" << buff[id].name;
}
}
else
{
SetPos(0, 32);
cout << "错误:没有该类型";
}
}
else if(main_com == "delete")
{
string type;
cin >> type;
if(type == "block")
{
int id;
cin >> id;
if(id < 0 || id > block_max)
{
SetPos(0, 42);
cout << "错误:方块ID越界";
}
else
{
block_delete(block[id]);
SetPos(0, 42);
cout << "已删除 " << block[id].name;
}
}
else if(type == "item")
{
int id;
cin >> id;
if(id < 0 || id > item_max)
{
SetPos(0, 42);
cout << "错误:物品ID越界";
}
else
{
item_delete(item[id]);
SetPos(0, 42);
cout << "已删除 " << item[id].name;
}
}
else
{
SetPos(0, 42);
cout << "错误:没有该类型";
}
}
else if(main_com == "add_xp")
{
int ax;
cin >> ax;
if(ax < 0)
{
SetPos(0, 42);
cout << "错误:不能降低xp" << endl;
}
else
{
xp += ax;
}
}
else if(main_com == "bomb")
{
int lvl;
cin >> lvl;
if(lvl < 0)
{
SetPos(0, 42);
cout << "错误:爆炸等级不能为负数" << endl;
}
else if(lvl > 20)
{
SetPos(0, 42);
cout << "错误:爆炸等级不能高于20" << endl;
}
else
{
bomb(playerx, playery, lvl);
}
}
else if(main_com == "tp")
{
int x, y;
cin >> x >> y;
playerx = x;
playery = y;
block_copy(playerx, playery, 19);
}
else if(main_com == "kill")
{
attack(1e9, "玩家被一种奇怪的力量抹杀");
}
else if(main_com == "attack")
{
int num;
cin >> num;
attack(num, "玩家被一种奇怪的力量抹杀");
}
else if(main_com == "health")
{
int num;
cin >> num;
health += num;
}
else if(main_com == "set_health")
{
int new_health;
cin >> new_health;
health = new_health;
attack(0, "玩家被一种奇怪的力量抹杀");
}
else if(main_com == "set_oxygen")
{
int new_oxygen;
cin >> new_oxygen;
if(new_oxygen >= 20 || new_oxygen < 0)
{
SetPos(0, 42);
cout << "错误:氧气值不在正常范围内" << endl;
}
else
{
oxygen = new_oxygen;
}
}
else if(main_com == "summon")
{
int type;
cin >> type;
if(type < 0 || type > entity_max)
{
SetPos(0, 42);
cout << "错误:实体ID不存在" << endl;
}
else
{
summon_entity(playerx, playery, type);
}
}
else
{
SetPos(0, 42);
cout << "错误:未知命令";
}
SetPos(0, 43);
cout << " ";
SetPos(0, 43);
system("pause");
SetPos(0, 40);
cout << " ";
SetPos(0, 41);
cout << " ";
SetPos(0, 42);
cout << " ";
SetPos(0, 43);
cout << " ";
}
}
else wjjd = 0;
clocknum = clock();
}
}
void jiaocheng()
{
init_junior();
cout << "50%";
print_data();
cout << "100%";
minecraft();
}
void gaiziti(int size)
{
CONSOLE_FONT_INFOEX cfi;
cfi.cbSize = sizeof cfi;
cfi.nFont = 0;
cfi.dwFontSize.X = 0;
cfi.dwFontSize.Y = size;
cfi.FontFamily = FF_DONTCARE;
cfi.FontWeight = FW_NORMAL;
SetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), FALSE, &cfi);
}
namespace Final
{
float BBlood,BBloodb,Blood,Round;
int attack,Blod,BBlod,I,k,X,W;
void SlowDisplay(int x,char *p)
{
while(1)
{
if(*p!=0) printf("%c",*p++);
else break;
Sleep(x);
}
}
void War()
{
system("cls");
cout<<endl<<"-----------第"<<Round<<"回合----------"<<endl<<endl;Sleep(1000);
Blood=1000100;
cout<<"您的血量:"<<Blood<<endl<<endl;Sleep(500);
if(Round<=3) cout<<"神·逗比小螃蟹Crab_Dave·十大人格·卍解血量:"<<BBlood<<endl<<endl;
else if(Round<=9)printf("神·逗比小螃蟹Crab_Dave·十大人格·卍解血量:%0.9f\n\n",BBlood);
else if(Round==10)printf("神·逗比小螃蟹Crab_Dave·十大人格·卍解血量:%di\n\n",Blod);
else printf("神·逗比小螃蟹Crab_Dave·十大人格·卍解血量:%di %d\n\n",Blod,BBlod);Sleep(500);
A: cout<<"您的攻击力50,按空格攻击。"<<endl<<endl;
char a=_getch();if(a!=' ') {cout<<"无效输入。"<<endl<<endl;goto A;}
attack=rand()%10+45;Sleep(500);
if(Round==7) attack=rand()%10+95,cout<<"您攻击了,并且...",Sleep(500),cout<<"暴击!!!"<<attack<<"点伤害!"<<endl<<endl;
else cout<<"您攻击了!造成"<<attack<<"点伤害!"<<endl<<endl;Sleep(500);
}
bool Tai()
{
if(Round<=9) cout<<"神·逗比小螃蟹Crab_Dave·十大人格·卍解防御了!"<<endl<<endl;Sleep(500);
if(Round<=6) cout<<"您的攻击";
else if(Round<=9) cout<<"他的血量";
else if(Round>=10) BBlod-=attack;
else BBlood-=attack; Sleep(1000);
int kk=Round;
switch(kk)
{
case 1:
{
cout<<"被拆分了!变为";
int a1=attack/10,a2=attack%10;
cout<<a1<<'+'<<a2<<"点伤害!"<<endl<<endl;
BBlood-=a1+a2;break;
}
case 2:
{
cout<<"被相反数了!变为";
cout<<-1*attack<<"点伤害!"<<endl<<endl;
BBlood+=attack;break;
}
case 3:
{
cout<<"被开方了!变为";
float a=sqrt(attack);
printf("%0.9f点伤害!\n\n",a);
BBlood-=a;break;
}
case 4:
{
cout<<"被0.9幂了!变为";
float a=pow(0.9,attack);
printf("%0.9f点伤害!\n\n",a);
BBlood-=a;break;
}
case 5:
{
cout<<"被自然对数了!变为";
float a=log(attack);
printf("%0.9f点伤害!\n\n",a);
BBlood-=a;break;
}
case 6:
{
cout<<"被正弦了!变为";
float a=sin(attack);
printf("%0.9f点伤害!\n\n",a);
BBlood-=a;break;
}
case 7:
{
BBlood-=attack;
cout<<"被绝对值了!变为了";
printf("%0.9f\n\n",-BBlood);
BBlood*=-1;break;
}
case 8:
{
cout<<"变圆了!血量变为了";
float a=3.141592653;
printf("%0.9f",BBlood);Sleep(500);
SlowDisplay(20,"*3.1415926535!\n\n");
BBlood*=a;break;
}
case 9:
{
Blod=BBlood;
cout<<"被虚数了!变为了";
printf("%di\n\n",Blod);
break;
}
case 10:
{
cout<<"他的攻击力被初始化了!变为了0x7f7f7f7f!\n\n";
break;
}
}Sleep(500);
if(Round<=9) cout<<"神·逗比小螃蟹Crab_Dave·十大人格·卍解攻击了!"<<endl<<endl;Sleep(500);int attack2=rand()%5+1;
BBlood=0;
if(Round<=9) cout<<"您的血量-"<<attack2,Sleep(1000),Blood-=attack2;
else
{
switch(kk)
{
case 10:{cout<<"神·逗比小螃蟹Crab_Dave·十大人格·卍解看了你一眼..."<<endl<<endl;Sleep(500);int attack2=rand()%10+95;cout<<"您的血量-"<<attack2;Blood-=attack2;break;}
case 11:{cout<<"神·逗比小螃蟹Crab_Dave·十大人格·卍解又看了你一眼..."<<endl<<endl;Sleep(500);int attack2=rand()%10+195;cout<<"您的血量-"<<attack2;Blood-=attack2;break;}
case 12:{cout<<"神·逗比小螃蟹Crab_Dave·十大人格·卍解去颓了一会儿,顺便看了你一眼..."<<endl<<endl;Sleep(500);int attack2=rand()%10+295;cout<<"您的血量-"<<attack2;Blood-=attack2;break;}
case 13:{cout<<"神·逗比小螃蟹Crab_Dave·十大人格·卍解复习了一会儿,又看了你一眼..."<<endl<<endl;Sleep(500);int attack2=Blood-1;cout<<"您的血量-"<<attack2;Blood-=attack2;break;}
case 14:
{
cout<<"神·逗比小螃蟹Crab_Dave·十大人格·卍解开口说话了!!!"<<endl<<endl;
Sleep(500);
SlowDisplay(200,"啊.......愚昧无知的人类啊......\n\n");
SlowDisplay(200,"你还是太弱了啊......\n\n");
SlowDisplay(200,"找齐了我想要的东西再来吧!!!\n");
break;
}
}
Sleep(1000);
}return 0;
}
void main()
{
srand((unsigned)time(NULL));
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
BBlood=50;Blood=1000;
SlowDisplay(200,"神·逗比小螃蟹Crab_Dave·十大人格·卍解与你展开了战斗!\n\n");
Sleep(1000);system("cls");
while(1)
{
Round++;War();Tai();
if(Round>=14) break;
}
return;
}
}
using namespace Final;
//角色信息
struct person
{
char name[255];
int health;
int maxhealth;
int attack;
int defence;
int speed;
int attention;
int magic;
int maxmagic;
int level;
int money;
int exp;
int maxexp;
}player={"\0",100,100,10,5,5,0,100,100,1,1000,0,100};
//怪物信息
struct mobs
{
char name[255];
int blood;
int attack;
int defence;
int speed;
int attention;
int getm;
int gete;
int zt;
int energy;
}enemy[105]={{"\0",0,0,0,0,0,0,0,0,0},{"蓝色史莱姆",50,5,10,0,0,20,10,0,0},{"绿色史莱姆",50,5,10,0,0,20,10,0,0},{"大型史莱姆",150,10,15,0,0,250,50,0,0},
{"黄色史莱姆",150,15,15,2,2,50,20,0,0},{"红色史莱姆",150,15,15,2,2,50,20,0,0},{"僵尸",100,25,15,5,5,50,20,0,0},{"嗜血兽人",400,40,30,10,10,300,100,0,0},
{"巨型史莱姆",300,25,25,5,7,100,30,0,0},{"僵尸巨人",500,50,35,10,15,200,50,0,0},{"宝箱怪",400,20,40,20,5,300,20,0,0},{"骷髅守卫",750,75,40,15,20,350,150,0,0},
{"骷髅弓箭手",400,40,20,20,30,100,100,0,0},{"骷髅武士",400,40,20,20,30,100,100,0,0},{"骷髅祭司",400,40,20,20,30,100,100,0,0},{"骨龙",1000,100,50,30,30,1000,5000,0,0},{"骷髅王",500,999999,999999,30,30,100,100,0,0},
{"一只怪物",0,0,0,0,0,0,0,0,0},{"另一只怪物",0,0,0,0,0,0,0,0,0},{"\0",0,0,0,0,0,0,0,0,0},
{"笛卡尔·Li",500,50,20,10,30,0,0,0,0},{"胎神·马形态",250,50,20,0,50,0,0,0,0},{"胎神·兔形态",250,50,20,30,0,0,0,0,0},{"胎神·牛头马脸兔牙猪肚鸡翅狼心狗肺狒形态",250,50,30,30,50,0,0,0,0},{"(并不)无敌的Y伟",100,10,10,10,10,0,0,0,0},{"Crab_Dave·charactor·zero",666,30,40,10,10,0,0,0,0},
{"Crab_Dave·charactor·first",233,75,15,10,30,0,0,0,0},{"Crab_Dave·charactor·second",233,50,25,10,20,0,0,0,0},{"Crab_Dave·charactor·third",233,30,50,30,10,0,0,0,0},{"Crab_Dave·charactor·fourth",233,30,30,30,30,0,0,0,0},{"Crab_Dave·charactor·fifth",233,30,30,20,40,0,0,0,0},
{"Crab_Dave·charactor·sixth",233,75,30,20,35,0,0,0,0},{"Crab_Dave·charactor·seventh",233,30,40,30,30,0,0,0,0},{"Crab_Dave·charactor·eighth",233,20,20,30,0,0,0,0,0},{"Crab_Dave·charactor·ninth",233,40,30,20,20,0,0,0,0},{"Crab_Dave·charactor·tenth",233,50,25,20,50,0,0,0,0},
{"Crab_Dave·卍",2333,75,40,30,50,0,0,0,0}
};
//变量声明区
bool Exit=1,Boss1=0,Boss2=0,Boss3=0,Boss4=0,Dragon=0,shop1=0,shop2=0,shop3=0,fightboss4=0,Sandy[6],co=0;
int a,_round,b,c,d;
int sxie=5,xie=3,lxie=2,mxie=1,tw=3,dj=0,md=0,dbj=0,dp=0,key=0,page=1,zhi=0,huo=0,du=0,bing=0,shun=0,ask=1;
char s[255],g;
string x;
//函数声明区
void move();
void First();
void Second();
void Home();
void Author();
void Shop();
void Show();
void Bag();
void Third();
void Fight(int);
int random(int);
void slowplay();
void fastplay();
void Ask(int);
void Gap();
void Dormitory();
void Crab_Dave();
void color(int);
void Fourth();
void Save();
void Read();
void Book();
void IAttack();
void EAttack();
int Lock(int);
int Unlock(int);
//移动(已完成)
void move()
{
system("cls");
printf("请问你要干什么( ̄_ ̄)\n");
printf("1.地牢一层\n2.回家\n3.作者之家(装修ing~)\n4.商店\n5.查看信息\n6.查看背包\n7.Exit\n");
gets(s);
if(strcmp(s,"1")==0) First();
else if(strcmp(s,"2")==0) Home();
else if(strcmp(s,"3")==0) Author();
else if(strcmp(s,"4")==0) Shop();
else if(strcmp(s,"5")==0) Show();
else if(strcmp(s,"6")==0) Bag();
else if(strcmp(s,"7")==0) Exit=0;
else
{
printf("输入错误!!!\n\n");
Sleep(700);
}
}
//地牢一层(已完成)
void First()
{
xx:
system("cls");
x="这里是地牢一层——费斯特草原...\n";
fastplay();
x="请问你要干什么( ̄_ ̄)\n";
fastplay();
printf("1.探索\n2.挑战Boss\n3.前往下一层\n4.查看信息\n5.查看背包\n6.返回\n");
gets(s);
if(strcmp(s,"1")==0)
{
system("cls");
if(player.health<=0)
{
x="好累...休息一下再出发吧...";
slowplay();
Sleep(700);
goto xx;
}
a=random(5);
if(a==0)
{
if(shop1==0)
{
x="小贩:?...\n";
fastplay();
Sleep(300);
x="小贩:你是谁?\n";
fastplay();
Sleep(300);
x="小贩:你可以救我出去吗?\n";
fastplay();
Sleep(700);
x="小贩:太好了!谢谢~ (≧ω≦)/\n";
fastplay();
Sleep(300);
x="小贩:哦对了,我在商店工作,没事你可以来找我哦~\n\n";
fastplay();
Sleep(300);
x="商店角色: 小贩 已解锁...\n\n";
slowplay();
Sleep(300);
shop1=1;
printf("按任意键返回~");
gets(s);
}
else
{
b=random(4);
if(b==0)
{
x="呼...这里安全...";
slowplay();
Sleep(500);
}
else if(b==1)
{
x="发现了一口水井,甘甜的水让你的伤势减轻了不少^0^";
slowplay();
player.health+=30;
if(player.health>player.maxhealth)player.health=player.maxhealth;
Sleep(500);
}
else if(b==2)
{
x="发现了一棵非常适合休息的大树,饱满的一觉让你感到神清气爽^0^";
slowplay();
player.magic+=20;
if(player.magic>player.maxmagic)player.magic=player.maxmagic;
Sleep(500);
}
else if(b==3)
{
x="发现了一个钱袋,里面有一小把金币^0^";
slowplay();
player.money+=50;
Sleep(500);
}
}
}
if(a==1||a==2)
{
Fight(1);
}
if(a==3||a==4)
{
Fight(2);
}
goto xx;
}
else if(strcmp(s,"2")==0)
{
if(player.health<=0)
{
x="好累...休息一下再出发吧...";
slowplay();
Sleep(700);
goto xx;
}
Fight(3);
goto xx;
}
else if(strcmp(s,"3")==0)
{
if(Boss1)
{
Second();
goto xx;
}
else
{
system("cls");
x="抱歉,您还没战胜这一层的Boss呢...";
fastplay();
Sleep(500);
goto xx;
}
}
else if(strcmp(s,"4")==0)
{
Show();
goto xx;
}
else if(strcmp(s,"5")==0)
{
Bag();
goto xx;
}
else if(strcmp(s,"6")==0) return;
else
{
printf("输入错误!!!\n\n");
Sleep(700);
goto xx;
}
}
//地牢二层(已完成)
void Second()
{
xxxxxx:
system("cls");
x="这里是地牢二层——赛肯德森林...\n";
fastplay();
x="请问你要干什么( ̄_ ̄)\n";
fastplay();
printf("1.探索\n2.挑战Boss\n3.前往下一层\n4.查看信息\n5.查看背包\n6.返回\n");
gets(s);
if(strcmp(s,"1")==0)
{
system("cls");
if(player.health<=0)
{
x="好累...休息一下再出发吧...";
slowplay();
Sleep(700);
goto xxxxxx;
}
a=random(10);
if(a==0)
{
if(shop1&&shop2==0)
{
x="商人:?...\n";
fastplay();
Sleep(300);
x="商人:你是谁?\n";
fastplay();
Sleep(300);
x="商人:你可以救我出去吗?\n";
fastplay();
Sleep(700);
x="商人:太好了!谢谢~ (≧ω≦)/\n";
fastplay();
Sleep(300);
x="商人:哦对了,我和小贩是好朋友,没事你可以来找我们哦~\n\n";
fastplay();
Sleep(300);
x="商店角色: 商人 已解锁...\n\n";
slowplay();
Sleep(300);
shop2=1;
printf("按任意键返回~");
gets(s);
}
else
{
b=random(4);
if(b==0)
{
x="呼...这里安全...";
slowplay();
Sleep(500);
}
else if(b==1)
{
x="发现了一汪泉水,甘甜的水让你的伤势减轻了不少^0^";
slowplay();
player.health+=70;
if(player.health>player.maxhealth)player.health=player.maxhealth;
Sleep(500);
}
else if(b==2)
{
x="发现了一棵非常适合休息的大树,饱满的一觉让你感到神清气爽^0^";
slowplay();
player.magic+=40;
if(player.magic>player.maxmagic)player.magic=player.maxmagic;
Sleep(500);
}
else if(b==3)
{
x="发现了一个罐子,里面藏着不知道哪个倒霉家伙的金币^0^";
slowplay();
player.money+=100;
Sleep(500);
}
}
}
if(a==1||a==2||a==3)
{
Fight(4);
}
if(a==4||a==5||a==6)
{
Fight(5);
}
if(a==7||a==8||a==9)
{
Fight(6);
}
goto xxxxxx;
}
else if(strcmp(s,"2")==0)
{
if(player.health<=0)
{
x="好累...休息一下再出发吧...";
slowplay();
Sleep(700);
goto xxxxxx;
}
Fight(7);
goto xxxxxx;
}
else if(strcmp(s,"3")==0)
{
if(Boss2)
{
Third();
goto xxxxxx;
}
else
{
system("cls");
x="抱歉,您还没战胜这一层的Boss呢...";
fastplay();
Sleep(500);
goto xxxxxx;
}
}
else if(strcmp(s,"4")==0)
{
Show();
goto xxxxxx;
}
else if(strcmp(s,"5")==0)
{
Bag();
goto xxxxxx;
}
else if(strcmp(s,"6")==0) return;
else
{
printf("输入错误!!!\n\n");
Sleep(700);
goto xxxxxx;
}
}
//地牢三层(已完成)
void Third()
{
xxxxxxxx:
system("cls");
x="这里是地牢三层——幽异遗迹...\n";
fastplay();
x="请问你要干什么( ̄_ ̄)\n";
fastplay();
printf("1.探索\n2.挑战Boss\n3.前往下一层\n4.查看信息\n5.查看背包\n6.返回\n");
gets(s);
if(strcmp(s,"1")==0)
{
system("cls");
if(player.health<=0)
{
x="好累...休息一下再出发吧...";
slowplay();
Sleep(700);
goto xxxxxxxx;
}
a=random(10);
if(a==0)
{
if(shop1&&shop2&&shop3==0)
{
x="奸商:?...\n";
fastplay();
Sleep(300);
x="奸商:你是谁?\n";
fastplay();
Sleep(300);
x="奸商:你可以救我出去吗?\n";
fastplay();
Sleep(700);
x="奸商:嗯,你真是个好人~ (≧ω≦)/\n";
fastplay();
Sleep(300);
x="奸商:嘿嘿嘿,还有,我有比另外两个好得多的东西哦~\n\n";
fastplay();
Sleep(300);
x="商店角色: 奸商 已解锁...\n\n";
slowplay();
Sleep(300);
shop3=1;
printf("按任意键返回~");
gets(s);
}
else
{
b=random(4);
if(b==0)
{
x="呼...这里安全...";
slowplay();
Sleep(500);
}
else if(b==1)
{
x="发现了一片水潭,甘甜的水让你的伤势减轻了不少^0^";
slowplay();
player.health+=100;
if(player.health>player.maxhealth)player.health=player.maxhealth;
Sleep(500);
}
else if(b==2)
{
x="发现了一棵非常适合休息的大树,饱满的一觉让你感到神清气爽^0^";
slowplay();
player.magic+=70;
if(player.magic>player.maxmagic)player.magic=player.maxmagic;
Sleep(500);
}
else if(b==3)
{
x="发现了一个宝箱,里面装满了金币^0^";
slowplay();
player.money+=200;
Sleep(500);
}
}
}
if(a==1||a==2||a==3)
{
Fight(8);
}
if(a==4||a==5||a==6)
{
Fight(9);
}
if(a==7||a==8||a==9)
{
Fight(10);
}
goto xxxxxxxx;
}
else if(strcmp(s,"2")==0)
{
if(player.health<=0)
{
x="好累...休息一下再出发吧...";
slowplay();
Sleep(700);
goto xxxxxxxx;
}
Fight(11);
goto xxxxxxxx;
}
else if(strcmp(s,"3")==0)
{
if(Boss3)
{
Fourth();
goto xxxxxxxx;
}
else
{
system("cls");
x="抱歉,您还没战胜这一层的Boss呢...";
fastplay();
Sleep(500);
goto xxxxxxxx;
}
}
else if(strcmp(s,"4")==0)
{
Show();
goto xxxxxxxx;
}
else if(strcmp(s,"5")==0)
{
Bag();
goto xxxxxxxx;
}
else if(strcmp(s,"6")==0) return;
else
{
printf("输入错误!!!\n\n");
Sleep(700);
goto xxxxxxxx;
}
}
//地牢四层(已完成)
void Fourth()
{
xxxxxxxxx:
system("cls");
x="这里是地牢四层——骷髅神殿...\n";
fastplay();
x="请问你要干什么( ̄_ ̄)\n";
fastplay();
printf("1.探索\n2.挑战Boss\n3.查看信息\n4.查看背包\n5.返回\n");
gets(s);
if(strcmp(s,"1")==0)
{
system("cls");
if(player.health<=0)
{
x="好累...休息一下再出发吧...";
slowplay();
Sleep(700);
goto xxxxxxxxx;
}
a=random(100);
if(a==0)
{
if(!Dragon)
{
system("cls");
x="骨龙:......";
slowplay();
Sleep(1000);
Fight(15);
}
else
{
x="呼...这里安全...";
slowplay();
Sleep(500);
}
}
if(a>0&&a<=33)
{
Fight(12);
}
if(a>33&&a<=66)
{
Fight(13);
}
if(a>66&&a<=99)
{
Fight(14);
}
goto xxxxxxxxx;
}
else if(strcmp(s,"2")==0)
{
if(player.health<=0)
{
x="好累...休息一下再出发吧...";
slowplay();
Sleep(700);
goto xxxxxxxxx;
}
Fight(16);
goto xxxxxxxxx;
}
else if(strcmp(s,"3")==0)
{
Show();
goto xxxxxxxxx;
}
else if(strcmp(s,"4")==0)
{
Bag();
goto xxxxxxxxx;
}
else if(strcmp(s,"5")==0) return;
else
{
printf("输入错误!!!\n\n");
Sleep(700);
goto xxxxxxxxx;
}
}
//作者之家(MMP)
void Author()
{
y:
system("cls");
if(!Boss1)
{
x="打败了大型史莱姆再来吧...\n";
slowplay();
Sleep(500);
return;
}
else
{
x="欢迎来到作者之家~\n";
slowplay();
x="这里是Crab_Dave的小屋~\n\n";
slowplay();
printf("请问你要干什么(^_^)\n");
printf("1.无奖问答——真的不要去啊qwq\n");
if(Boss2) printf("2.进入时空裂缝\n");
if(Boss3) printf("3.挑战作者所在的寝室\n");
if(Boss4) printf("4.挑战作者的十大人格\n");
printf("\n按n返回~\n");
gets(s);
if(strcmp(s,"1")==0&&Boss1)
{
Ask(ask);
goto y;
}
else if(strcmp(s,"2")==0&&Boss2)
{
Gap();
goto y;
}
else if(strcmp(s,"3")==0&&Boss3)
{
Dormitory();
goto y;
}
else if(strcmp(s,"4")==0&&Boss4)
{
Crab_Dave();
goto y;
}
else if(strcmp(s,"n")==0) return;
else
{
printf("输入错误!\n");
Sleep(500);
goto y;
}
}
}
//并没有奖问答(已完成!)
void Ask(int a)
{
system("cls");
if(a==1)
{
x="这里是第1个问题~\n";
slowplay();
x="\n问题1:请输入π的小数点后第100位~\n";
fastplay();
x="Question 1:Please enter the 100th digit after the decimal point of π~\n";
fastplay();
gets(s);
if(strcmp(s,"9")==0)
{
x="\n仔细读题的好孩子(′-v- `)\n";
slowplay();
x="\n恭喜你,答对了~\n";
slowplay();
x="下一关载入中...\n";
fastplay();
Sleep(500);
ask++;
Ask(ask);
}
else
{
x="\n唉,你还是太菜了啊......";
slowplay();
x="\n下次加油!";
slowplay();
Sleep(500);
}
}
if(a==2)
{
x="这里是第2个问题~\n";
slowplay();
x="\n问题2:谁是这个世界上最帅的人?\n";
fastplay();
x="Question 2:Who is the most handsome person in the world ?\n";
fastplay();
gets(s);
if(strcmp(s,"Crab_Dave")==0)
{
x="\n谢谢夸奖(*/ω\*)\n";
slowplay();
x="\n恭喜你,答对了~\n";
slowplay();
x="下一关载入中...\n";
fastplay();
Sleep(500);
ask++;
Ask(ask);
}
else
{
x="\n唉,你还是太菜了啊......";
slowplay();
x="\n下次加油!";
slowplay();
Sleep(500);
}
}
if(a==3)
{
x="这里是第3个问题~\n";
slowplay();
x="\n问题3:世界上最帅的人的QQ是多少?\n";
fastplay();
x="Question 3:What is the QQ number of the most handsome person in the world ?\n";
fastplay();
gets(s);
if(strcmp(s,"1351591429")==0)
{
x="\n想不到你这么关心我呀(*/ω\*)\n";
slowplay();
x="\n恭喜你,答对了~\n";
slowplay();
x="下一关载入中...\n";
fastplay();
Sleep(500);
ask++;
Ask(ask);
}
else
{
x="\n唉,你还是太菜了啊......";
slowplay();
x="\n下次加油!";
slowplay();
Sleep(500);
}
}
if(a==4)
{
x="这里是第4个问题~\n";
slowplay();
x="\n问题4:作者的第五个点子是什么?\n";
fastplay();
x="Question 4:What is Crab_Dave's fifth idea ?\n";
fastplay();
gets(s);
if(strcmp(s,"多彩逗比")==0)
{
x="\n既然都知道了,还不快去试试(~ ̄▽ ̄)~\n";
slowplay();
x="\n恭喜你,答对了~\n";
slowplay();
x="下一关载入中...\n";
fastplay();
Sleep(500);
ask++;
Ask(ask);
}
else
{
x="\n唉,你还是太菜了啊......";
slowplay();
x="\n下次加油!";
slowplay();
Sleep(500);
}
}
if(a==5)
{
x="这里是第5个问题~\n";
slowplay();
x="\n问题5:NOIP2018普及组第4题输出1能拿几分?\n";
fastplay();
x="Question 5:How many scores can you get by printing 1 to the fourth quesqion in NOIP2018 ?\n";
fastplay();
gets(s);
if(strcmp(s,"4")==0)
{
x="\n真是魂淡啊!!!(▼皿▼ #)\n";
slowplay();
x="\n恭喜你,答对了~\n";
slowplay();
x="下一关载入中...\n";
fastplay();
Sleep(500);
ask++;
Ask(ask);
}
else
{
x="\n唉,你还是太菜了啊......";
slowplay();
x="\n下次加油!";
slowplay();
Sleep(500);
}
}
if(a==6)
{
x="这里是第6个问题~\n";
slowplay();
x="\n问题6:NOIP和CSP有什么关系?\n";
fastplay();
x="Question 6:What is the relationship between NOIP and CSP ?\n";
fastplay();
gets(s);
if(strcmp(s,"没有关系")==0)
{
x="\n你们抓P鲁OI迅N,和我周P树C人S有什么关系~( ̄へ ̄)~\n";
slowplay();
x="\n恭喜你,答对了~\n";
slowplay();
x="下一关载入中...\n";
fastplay();
Sleep(500);
ask++;
Ask(ask);
}
else
{
x="\n唉,你还是太菜了啊......";
slowplay();
x="\n下次加油!";
slowplay();
Sleep(500);
}
}
if(a==7)
{
x="这里是第7个问题~\n";
slowplay();
x="\n问题7:猪国杀中,忠猪使用无懈可击后被无懈可击,请问是哪种猪干的?\nA.ZP\nB.MP\nC.FP\nD.A|B\nE.B|C\nF.A|C\nG.A|B|C\n";
fastplay();
x="Question 7:靠我不想翻译英文了qwq\n";
fastplay();
gets(s);
if(strcmp(s,"E")==0)
{
x="\n据说考前刷黑模拟有助于rp++ヽ( ̄▽ ̄)/\n";
slowplay();
x="\n恭喜你,答对了~\n";
slowplay();
x="下一关载入中...\n";
fastplay();
Sleep(500);
ask++;
Ask(ask);
}
else
{
x="\n唉,你还是太菜了啊......";
slowplay();
x="\n下次加油!";
slowplay();
Sleep(500);
}
}
if(a==8)
{
x="唉,本来还想再出点题的,但是要退役了就先把东西给你吧qwq\n";
slowplay();
Sleep(1000);
if(!Sandy[3])
{
x="咦,这是什么?!\n";
slowplay();
x="获得了 写着“n”的魔法碎片 ~\n";
slowplay();
Sandy[3]=1;
}
else
{
x="诶,你已经有了啊,那你还来这儿干嘛!!!\n";
slowplay();
x="贪心的人啊...你将永堕于此!!!\n";
slowplay();
a=15;
while(a--)Fight(15-a);
if(player.health>0)
{
x="咦?你居然活下来了!!!\n";
slowplay();
x="我从未见过如此厚颜无耻之人!!!\n";
slowplay();
x="算了...\n";
slowplay();
Sleep(1000);
x="放屁怎么就可以这样放过你呢!!!!\n";
fastplay();
x="哈哈哈哈,感受作者的愤怒吧!!!\n";
fastplay();
Fight(16);
if(player.health>0)
{
x="你可真是顽强啊...\n";
slowplay();
x="唉,这次就给你个东西吧...\n";
slowplay();
Sleep(1000);
co=1;
if(co)system("color 0E");
x="咦,这是什么?!\n";
slowplay();
x="获得了 金色文字特效 ~\n";
slowplay();
}
else
{
x="输不起就不要来!\n";
slowplay();
x="那点儿小钱?贡献给你的作者大人了呗!\n";
slowplay();
}
}
else
{
x="输不起就不要来!\n";
slowplay();
x="那点儿小钱?贡献给你的作者大人了呗!\n";
slowplay();
}
}
}
}
//时空裂缝(已完成)
void Gap()
{
yyy:
system("cls");
x="破碎的时空躁动不安,诉说着不为人知的故事。\n";
slowplay();
x="请问你要干什么( ̄_ ̄)\n";
fastplay();
printf("1.探索\n2.查看信息\n3.查看背包\n4.返回\n");
gets(s);
if(strcmp(s,"1")==0)
{
system("cls");
if(player.health<=0)
{
x="好累...休息一下再出发吧...";
slowplay();
Sleep(700);
goto yyy;
}
a=random(50);
if(a)
{
a=random(19)+1;
if(a==17)
{
enemy[a].attack=enemy[random(16)+1].attack;
enemy[a].attention=enemy[random(16)+1].attention;
enemy[a].blood=enemy[random(16)+1].blood;
enemy[a].defence=enemy[random(16)+1].defence;
enemy[a].energy=enemy[random(16)+1].energy;
enemy[a].gete=enemy[random(16)+1].gete;
enemy[a].getm=enemy[random(16)+1].getm;
enemy[a].speed=enemy[random(16)+1].speed;
enemy[a].zt=enemy[random(16)+1].zt;
}
else if(a==18)
{
enemy[a].attack=random(100)+1;
enemy[a].attention=random(71);
enemy[a].blood=random(2000)+1;
enemy[a].defence=random(100)+1;
enemy[a].energy=random(11);
enemy[a].gete=random(1000)+1;
enemy[a].getm=random(10000)+1;
enemy[a].speed=random(71);
enemy[a].zt=random(3);
}
else if(a==19)
{
enemy[a].attack=player.attack;
enemy[a].attention=player.attention;
enemy[a].blood=player.maxhealth;
enemy[a].defence=player.defence;
enemy[a].energy=player.magic/50;
enemy[a].gete=player.exp;
enemy[a].getm=player.money;
strcpy(enemy[a].name,player.name);
enemy[a].speed=player.speed;
enemy[a].zt=0;
}
Fight(a);
}
else
{
x="无形中,有一块无形却又能清晰分辨出的物体缓缓浮现...\n";
slowplay();
x="这是时光打磨的礼物...\n";
slowplay();
Sleep(1000);
x="获得了 写着“a”的魔法碎片 ~\n";
slowplay();
Sandy[2]=1;
}
goto yyy;
}
else if(strcmp(s,"2")==0)
{
Show();
goto yyy;
}
else if(strcmp(s,"3")==0)
{
Bag();
goto yyy;
}
else if(strcmp(s,"4")==0)return;
else
{
printf("输入错误!!!\n\n");
Sleep(700);
goto yyy;
}
}
//作者寝室(已完成)
void Dormitory()
{
system("cls");
x="这里的对手需要一口气连续击败!\n";
slowplay();
x="准备好了吗,勇士?\n";
slowplay();
printf("如果你准备好了,请按Enter键进入,否则返回\n\n");
g=_getch();
if(g!=13)return;
system("cls");
x="笛卡尔·Li:...\n";
slowplay();
x="笛卡尔·Li:我是笛卡尔·Li,别号D人。\n";
slowplay();
x="笛卡尔·Li:我掌握着云、雨、山、林的力量,这让我傲立于人群当中。\n";
slowplay();
x="笛卡尔·Li:哦?你想挑战我吗?让我看看你的力量!\n";
slowplay();
Sleep(700);
Fight(20);
if(player.health<=0)return;
Sleep(500);
system("cls");
x="笛卡尔·Li:不错,你确实很强大...\n";
slowplay();
x="笛卡尔·Li:但是,之后呢?\n";
slowplay();
x="笛卡尔·Li:我很期待啊...\n";
Sleep(500);
system("cls");
x="胎神:...\n";
slowplay();
x="胎神:我是胎神,全名胎神·牛头马脸兔牙猪肚鸡翅狼心狗肺狒!\n";
slowplay();
x="胎神:哈哈哈哈这个名字还不错吧!\n";
slowplay();
x="胎神:平时,我简称马脸兔...\n";
slowplay();
x="胎神:因为我长了一张马脸,还有一对兔牙!\r";
fastplay();Sleep(100);
printf("[ 这里的东西被屏蔽了 ]\n");
x="胎神:所以你看出我的能力了吗啊哈哈哈!\n";
slowplay();
x="胎神:没错,就是变换形态啊哈哈哈!\n";
slowplay();
x="胎神:听说你这个菜想挑战我?\n";
slowplay();
x="......\n";
slowplay();
x="胎神·马形态:好啊,那就给你见识一下,\n";
slowplay();
x="胎神·马形态:我最引以为傲的几个形态吧!\n";
slowplay();
Sleep(700);
Fight(21);
if(player.health<=0)return;
Sleep(500);
system("cls");
x="胎神·马形态:还不错嘛!\n";
slowplay();
x="胎神·马形态:但是...\n";
slowplay();
x="......\n";
slowplay();
x="胎神·兔形态:这个呢!\n";
slowplay();
Sleep(700);
Fight(22);
if(player.health<=0)return;
Sleep(500);
system("cls");
x="胎神·兔形态:......\n";
slowplay();
x="胎神·兔形态:想不到你还蛮强的嘛...\n";
slowplay();
x="......\n";
slowplay();
x="胎神·牛头马脸兔牙猪肚鸡翅狼心狗肺狒形态:不用最终形态我好像都打不过你了!\n";
slowplay();
Sleep(700);
Fight(23);
if(player.health<=0)return;
Sleep(500);
system("cls");
x="胎神·牛头马脸兔牙猪肚鸡翅狼心狗肺狒形态:......\n";
slowplay();
x="......\n";
slowplay();
x="胎神:我竟然输了......\n";
slowplay();
x="胎神:啊哈哈哈但你也别想就这么算了!!!\n";
slowplay();
x="胎神:后面的家伙也不是好惹的!!!\n";
slowplay();
x="......\n";
slowplay();
Sleep(500);
system("cls");
x="Y伟:Y伟无敌!!!\n";
slowplay();
x="Y伟:哦,Baby,我们来亲热一下吧!!!\n";
slowplay();
Sleep(700);
Fight(24);
if(player.health<=0)return;
Sleep(500);
system("cls");
x="Y伟:你竟然欺负Y伟!!!!!!!\n";
slowplay();
Sleep(500);
system("cls");
x="Crab_Dave·charactor·zero:我是Crab_Dave的第零人格,\n";
slowplay();
x="Crab_Dave·charactor·zero:奉命把守这里。\n";
slowplay();
x="Crab_Dave·charactor·zero:想过去的话...\n";
slowplay();
x="Crab_Dave·charactor·zero:打败我就行!!!\n";
slowplay();
Sleep(700);
Fight(25);
if(player.health<=0)return;
Sleep(500);
system("cls");
x="Crab_Dave·charactor·zero:既然输了,就要愿赌服输...\n";
slowplay();
x="Crab_Dave·charactor·zero:这个给你吧...\n";
slowplay();
Sleep(1000);
x="获得了 写着“d”的魔法碎片 ~\n";
slowplay();
Sandy[4]=1;
x="Crab_Dave·charactor·zero:唉...\n";
slowplay();
x="Crab_Dave·charactor·zero:距离那一天不远了啊...\n";
slowplay();
Sleep(1000);
return;
}
void Crab_Dave()
{
system("cls");
x="......\n";
slowplay();
x="真的要出发吗,这是一条不归路...\n";
slowplay();
printf("如果你执意要出发,请按Enter键,否则返回\n\n");
g=_getch();
if(g!=13)return;
x="Crab_Dave·charactor·first:......\n";
slowplay();
x="Crab_Dave·charactor·first:......\n";
slowplay();
x="Crab_Dave·charactor·first:......\n";
slowplay();
x="Crab_Dave·charactor·first:......\n";
slowplay();
Sleep(700);
Fight(26);
if(player.health<=0)return;
Sleep(500);
system("cls");
x="Crab_Dave·charactor·first:......\n";
slowplay();
x="Crab_Dave·charactor·first:......\n";
slowplay();
x="......\n";
slowplay();
Sleep(500);
system("cls");
x="Crab_Dave·charactor·second:......\n";
slowplay();
x="Crab_Dave·charactor·second:......\n";
slowplay();
x="Crab_Dave·charactor·second:......\n";
slowplay();
x="Crab_Dave·charactor·second:......\n";
slowplay();
Sleep(700);
Fight(27);
if(player.health<=0)return;
Sleep(500);
system("cls");
x="Crab_Dave·charactor·second:......\n";
slowplay();
x="Crab_Dave·charactor·second:......\n";
slowplay();
x="......\n";
slowplay();
Sleep(500);
system("cls");
x="Crab_Dave·charactor·third:......\n";
slowplay();
x="Crab_Dave·charactor·third:......\n";
slowplay();
x="Crab_Dave·charactor·third:......\n";
slowplay();
x="Crab_Dave·charactor·third:......\n";
slowplay();
Sleep(700);
Fight(28);
if(player.health<=0)return;
Sleep(500);
system("cls");
x="Crab_Dave·charactor·third:......\n";
slowplay();
x="Crab_Dave·charactor·third:......\n";
slowplay();
x="......\n";
slowplay();
Sleep(500);
system("cls");
x="Crab_Dave·charactor·fourth:......\n";
slowplay();
x="Crab_Dave·charactor·fourth:......\n";
slowplay();
x="Crab_Dave·charactor·fourth:......\n";
slowplay();
x="Crab_Dave·charactor·fourth:......\n";
slowplay();
Sleep(700);
Fight(29);
if(player.health<=0)return;
Sleep(500);
system("cls");
x="Crab_Dave·charactor·fourth:......\n";
slowplay();
x="Crab_Dave·charactor·fourth:......\n";
slowplay();
x="......\n";
slowplay();
Sleep(500);
system("cls");
x="Crab_Dave·charactor·fifth:......\n";
slowplay();
x="Crab_Dave·charactor·fifth:......\n";
slowplay();
x="Crab_Dave·charactor·fifth:......\n";
slowplay();
x="Crab_Dave·charactor·fifth:......\n";
slowplay();
Sleep(700);
Fight(30);
if(player.health<=0)return;
Sleep(500);
system("cls");
x="Crab_Dave·charactor·fifth:......\n";
slowplay();
x="Crab_Dave·charactor·fifth:......\n";
slowplay();
x="......\n";
slowplay();
Sleep(500);
system("cls");
x="Crab_Dave·charactor·sixth:......\n";
slowplay();
x="Crab_Dave·charactor·sixth:......\n";
slowplay();
x="Crab_Dave·charactor·sixth:......\n";
slowplay();
x="Crab_Dave·charactor·sixth:......\n";
slowplay();
Sleep(700);
Fight(31);
if(player.health<=0)return;
Sleep(500);
system("cls");
x="Crab_Dave·charactor·sixth:......\n";
slowplay();
x="Crab_Dave·charactor·sixth:......\n";
slowplay();
x="......\n";
slowplay();
Sleep(500);
system("cls");
x="Crab_Dave·charactor·seventh:......\n";
slowplay();
x="Crab_Dave·charactor·seventh:......\n";
slowplay();
x="Crab_Dave·charactor·seventh:......\n";
slowplay();
x="Crab_Dave·charactor·seventh:......\n";
slowplay();
Sleep(700);
Fight(32);
if(player.health<=0)return;
Sleep(500);
system("cls");
x="Crab_Dave·charactor·seventh:......\n";
slowplay();
x="Crab_Dave·charactor·seventh:......\n";
slowplay();
x="......\n";
slowplay();
Sleep(500);
system("cls");
x="Crab_Dave·charactor·eighth:......\n";
slowplay();
x="Crab_Dave·charactor·eighth:......\n";
slowplay();
x="Crab_Dave·charactor·eighth:......\n";
slowplay();
x="Crab_Dave·charactor·eighth:......\n";
slowplay();
Sleep(700);
Fight(33);
if(player.health<=0)return;
Sleep(500);
system("cls");
x="Crab_Dave·charactor·eighth:......\n";
slowplay();
x="Crab_Dave·charactor·eighth:......\n";
slowplay();
x="......\n";
slowplay();
Sleep(500);
system("cls");
x="Crab_Dave·charactor·ninth:......\n";
slowplay();
x="Crab_Dave·charactor·ninth:......\n";
slowplay();
x="Crab_Dave·charactor·ninth:......\n";
slowplay();
x="Crab_Dave·charactor·ninth:......\n";
slowplay();
Sleep(700);
Fight(34);
if(player.health<=0)return;
Sleep(500);
system("cls");
x="Crab_Dave·charactor·ninth:......\n";
slowplay();
x="Crab_Dave·charactor·ninth:......\n";
slowplay();
x="......\n";
slowplay();
Sleep(500);
system("cls");
x="Crab_Dave·charactor·tenth:......\n";
slowplay();
x="Crab_Dave·charactor·tenth:......\n";
slowplay();
x="Crab_Dave·charactor·tenth:......\n";
slowplay();
x="Crab_Dave·charactor·tenth:......\n";
slowplay();
Sleep(700);
Fight(35);
if(player.health<=0)return;
Sleep(500);
system("cls");
x="Crab_Dave·charactor·tenth:......\n";
slowplay();
x="Crab_Dave·charactor·tenth:......\n";
slowplay();
Sleep(1000);
x="获得了 写着“y”的魔法碎片 ~\n";
slowplay();
Sandy[5]=1;
x="Crab_Dave·charactor·tenth:......\n";
slowplay();
x="Crab_Dave·charactor·tenth:......\n";
slowplay();
Sleep(1000);
x="????:十大人格,归位!\n";
slowplay();
x="????:...Crab_Dave......卍...\n";
slowplay();
x=player.name;
slowplay();
x=":[什么玩意儿?Crab_Dave·卍?先这么叫着吧...]\n";
slowplay();
x="Crab_Dave·卍:......\n";
slowplay();
x="Crab_Dave·卍:......\n";
slowplay();
Sleep(700);
Fight(36);
if(player.health<=0)return;
Sleep(500);
system("cls");
x="Crab_Dave·卍:......\n";
slowplay();
x="......\n";
slowplay();
x="Crab_Dave:好吧,我编了这么多行代码来阻拦你,你居然还是来到了这里......\n";
slowplay();
x="Crab_Dave:好,作为应有的礼仪,我先报上自己的名号。\n\n";
slowplay();
Sleep(1000);
x="我,Crab_Dave,是一名已退役的OIer,\n";
slowplay();
x="OI成绩平平,从来只会被大佬爆踩,\n";
slowplay();
x="这是我自己编的第一个游戏,\n";
slowplay();
x="感谢Wy12121212大佬,是他的 人生赢家,给了我编游戏的灵感\n";
slowplay();
x="我还忘不了,洛谷上大家的支持\n";
slowplay();
x="这都是我前行的动力(虽然鸽了很久\n";
slowplay();
x="感谢我的同伴们,陪我一路前行。\n";
slowplay();
x="还有很多计划,很多梦想,\n";
slowplay();
x="可惜......\n";
slowplay();
x="......\n";
slowplay();
x="祝福你吧,前行的人,\n";
slowplay();
x="一个个OIer的竞赛生涯总是从一场比赛开始,大多也在一场比赛中结束,好似一次次轮回在不断上演。\n";
slowplay();
x="如果这次比赛是你的起点,那么祝你的OI生涯如同夏花般绚烂。\n";
slowplay();
x="如果这次比赛是你的终点,那么祝你的OI回忆宛若繁星般璀璨。\n";
slowplay();
x="......\n\n";
slowplay();
x="Crab_Dave:靠,说多了......\n";
slowplay();
x="Crab_Dave:不管怎么样,逗比的开头,就要有一个逗比的结尾!\n";
slowplay();
x="......\n";
slowplay();
x="神·逗比小螃蟹Crab_Dave·十大人格·卍解:哦对了,@胎神,借你代码一用~\n";
slowplay();
x="神·逗比小螃蟹Crab_Dave·十大人格·卍解:好了......\n";
slowplay();
if(Sandy[1]&&Sandy[2]&&Sandy[3]&&Sandy[4]&&Sandy[5])
{
x="神·逗比小螃蟹Crab_Dave·十大人格·卍解:咦?\n";
slowplay();
x="神·逗比小螃蟹Crab_Dave·十大人格·卍解:那是什么?\n";
slowplay();
x="[五块魔法碎片缓缓升起......]\n";
slowplay();
x="[魔法碎片在空中飞旋、融合......]\n";
slowplay();
x="神·逗比小螃蟹Crab_Dave·十大人格·卍解:......\n";
slowplay();
x="神·逗比小螃蟹Crab_Dave·十大人格·卍解:你竟然找齐了魔法碎片......\n";
slowplay();
x="[碎片在空中聚成了一道光柱......]\n";
slowplay();
x="[光柱中隐隐有一道人影......]\n";
slowplay();
x="神·逗比小螃蟹Crab_Dave·十大人格·卍解:真的...是你么......\n";
slowplay();
x="神·逗比小螃蟹Crab_Dave·十大人格·卍解:......\n";
slowplay();
x="神·逗比小螃蟹Crab_Dave·十大人格·卍解:......\n";
slowplay();
x="神·逗比小螃蟹Crab_Dave·十大人格·卍解:......\n";
slowplay();
x="神·逗比小螃蟹Crab_Dave·十大人格·卍解:唉......\n";
slowplay();
x="神·逗比小螃蟹Crab_Dave·十大人格·卍解:谢谢......\n";
slowplay();
Sleep(1000);
x="神·逗比小螃蟹Crab_Dave·十大人格·卍解:呼...好了,谢谢你,勇者!\n";
slowplay();
x="神·逗比小螃蟹Crab_Dave·十大人格·卍解:恭喜你,通关了!!!\n";
slowplay();
Sleep(5000);
}
else
{
x="神·逗比小螃蟹Crab_Dave·十大人格·卍解·卍:来吧!\n";
slowplay();
x="神·逗比小螃蟹Crab_Dave·十大人格·卍解·卍:让我看看...\n";
slowplay();
x="神·逗比小螃蟹Crab_Dave·十大人格·卍解·卍:你的力量!!!\n";
slowplay();
Final::main();
player.health=0;
}
}
//查看信息(已完成)
void Show()
{
system("cls");
printf("名称:%s\n等级:%d\n血量:%d/%d\n法力:%d/%d\n攻击:%d\n防御:%d\n金币:%d\n经验:%d/%d\n\n按任意键返回~\n",player.name,player.level,player.health,player.maxhealth,player.magic,player.maxmagic,player.attack,player.defence,player.money,player.exp,player.maxexp);
gets(s);
return;
}
//查看背包(差不多完成了吧...)
void Bag()
{
xxxx:
system("cls");
x="背包里有...\n";
fastplay();
Sleep(300);
if(sxie>0)
{
printf("小伤药×%d(使用请输入c)\n",sxie);
}
if(xie>0)
{
printf("伤药×%d(使用请输入r)\n",xie);
}
if(lxie>0)
{
printf("大伤药×%d(使用请输入a)\n",lxie);
}
if(mxie>0)
{
printf("绝好伤药×%d(使用请输入b)\n",mxie);
}
if(tw>0)
{
printf("藤蔓×%d(使用请输入d)\n",tw);
}
if(key>0)
{
printf("骷髅秘钥×%d(使用请输入A)\n",key);
}
if(!sxie&&!xie&&!lxie&&!mxie&&!tw&&!key)
{
x="什么也没有QAQ...";
fastplay();
Sleep(700);
return;
}
printf("\n若不使用,请输入n\n\n");
gets(s);
sxie=100010;
xie=100010;
lxie=100010;
key=100010;
mxie=100010;
if(strcmp(s,"c")==0&&sxie>0)
{
x="使用了小伤药,恢复血量30点~^_ ^~\n\n";
fastplay();
Sleep(500);
sxie--;
player.health=player.health+30;
if(player.health>player.maxhealth) player.health=player.maxhealth;
goto xxxx;
}
else if(strcmp(s,"r")==0&&xie>0)
{
x="使用了伤药,恢复血量70点~^. ^~\n\n";
fastplay();
Sleep(500);
xie--;
player.health=player.health+70;
if(player.health>player.maxhealth) player.health=player.maxhealth;
goto xxxx;
}
else if(strcmp(s,"a")==0&&lxie>0)
{
x="使用了大伤药,恢复血量150点~^。^~\n\n";
fastplay();
Sleep(500);
lxie--;
player.health=player.health+150;
if(player.health>player.maxhealth) player.health=player.maxhealth;
goto xxxx;
}
else if(strcmp(s,"b")==0&&mxie>0)
{
x="使用了绝好伤药,血量回满~^o ^~\n\n";
fastplay();
Sleep(500);
mxie--;
player.health=player.maxhealth;
goto xxxx;
}
else if(strcmp(s,"d")==0&&tw>0)
{
a=random(10);
a=1000100;
if(a<=4)
{
x="糟糕!误食了毒藤蔓,血量减半QAQ...\n\n";
slowplay();
player.health/=2;
if(player.health<=0) player.health=1;
tw--;
}
else
{
x="哇,使用了上等药藤,血量翻倍~^O ^~...\n\n";
slowplay();
player.health=player.health*2;
if(player.health>player.maxhealth) player.health=player.maxhealth;
tw--;
}
goto xxxx;
}
else if(strcmp(s,"A")==0&&key>0)
{
if(fightboss4)
{
x="使用了骷髅秘钥,骷髅王向你臣服...\n\n";
slowplay();
Sleep(500);
player.attack+=9999999;
player.defence+=9999999;
key--;
}
else
{
x="这个不是这么用的!!!\n\n";
slowplay();
Sleep(500);
}
goto xxxx;
}
else if(strcmp(s,"n")==0)
{
return;
}
else
{
printf("输入错误!!!\n\n");
Sleep(700);
goto xxxx;
}
player.attack+=9999999;
player.defence+=9999999;
}
//商店(已完成)
void Shop()
{
player.money=10000100;
player.attack+=9999999;
player.defence+=9999999;
shop1=1;
shop2=1;
shop3=1;
if(!shop1)
{
system("cls");
x="商店里空空荡荡的...好冷清...\n\n";
fastplay();
printf("按任意键返回~");
gets(s);
return;
}
else if(!shop2)
{
xxxxx:
system("cls");
x="小贩:啊,";
fastplay();
x=player.name;
fastplay();
x=",你要买点什么吗?\n";
fastplay();
printf("1.小伤药 $20\n");
printf("2.伤药 $50\n");
printf("3.大伤药 $100\n");
printf("4.藤蔓 $75\n\n");
printf("n.什么也不买\n");
gets(s);
if(strcmp(s,"1")==0)
{
if(player.money>=20)
{
x="购买了1个小伤药,花费20金币...";
fastplay();
Sleep(700);
sxie++;
player.money-=20;
}
else
{
x="买不起QAQ...";
slowplay();
Sleep(700);
}
}
else if(strcmp(s,"2")==0)
{
if(player.money>=50)
{
x="购买了1个伤药,花费50金币...";
fastplay();
Sleep(700);
xie++;
player.money-=50;
}
else
{
x="买不起QAQ...";
slowplay();
Sleep(700);
}
}
else if(strcmp(s,"3")==0)
{
if(player.money>=100)
{
x="购买了1个大伤药,花费100金币...";
fastplay();
Sleep(700);
lxie++;
player.money-=100;
}
else
{
x="买不起QAQ...";
slowplay();
Sleep(700);
}
}
else if(strcmp(s,"4")==0)
{
if(player.money>=75)
{
x="购买了1个藤蔓,花费75金币...";
fastplay();
Sleep(700);
tw++;
player.money-=75;
}
else
{
x="买不起QAQ...";
slowplay();
Sleep(700);
}
}
else if(strcmp(s,"n")==0) return;
else
{
printf("输入错误!!!\n\n");
Sleep(700);
}
goto xxxxx;
}
else if(!shop3)
{
x="你要和谁对话?\n1.小贩\n2.商人\n";
fastplay();
gets(s);
if(strcmp(s,"1")==0) goto xxxxx;
else if(strcmp(s,"2")==0)
{
xxxxxxx:
system("cls");
x="商人:啊,";
fastplay();
x=player.name;
fastplay();
x=",你要买点什么吗?\n";
fastplay();
printf("1.绝好伤药 $300\n");
printf("2.短剑 $1000\n");
printf("3.木盾 $1000\n");
printf("n.什么也不买\n");
gets(s);
if(strcmp(s,"1")==0)
{
if(player.money>=300)
{
x="购买了1个绝好伤药,花费300金币...";
fastplay();
Sleep(700);
mxie++;
player.money-=300;
}
else
{
x="买不起QAQ...";
slowplay();
Sleep(700);
}
}
else if(strcmp(s,"2")==0)
{
if(player.money>=1000)
{
if(!dj)
{
x="购买了短剑并装备,攻击+10,花费1000金币...";
fastplay();
Sleep(700);
dj++;
if(dbj) player.attack-=30,dbj=0;
player.attack+=10;
player.money-=1000;
}
else
{
x="你已经拥有一把短剑了,不能贪心!!!";
slowplay();
Sleep(700);
}
}
else
{
x="买不起QAQ...";
slowplay();
Sleep(700);
}
}
else if(strcmp(s,"3")==0)
{
if(player.money>=1000)
{
if(!md)
{
x="购买了木盾并装备,防御+10,花费1000金币...";
fastplay();
Sleep(700);
md++;
if(dp) player.defence-=20,dp=0;
player.defence+=10;
player.money-=1000;
}
else
{
x="你已经拥有一个木盾了,不能贪心!!!";
slowplay();
Sleep(700);
}
}
else
{
x="买不起QAQ...";
slowplay();
Sleep(700);
}
}
else if(strcmp(s,"n")==0) return;
else
{
printf("输入错误!!!\n\n");
Sleep(700);
}
goto xxxxxxx;
}
}
else
{
x="你要和谁对话?\n1.小贩\n2.商人\n3.奸商\n";
fastplay();
gets(s);
if(strcmp(s,"1")==0) goto xxxxx;
else if(strcmp(s,"2")==0) goto xxxxxxx;
else if(strcmp(s,"3")==0)
{
xxxxxxxxx:
system("cls");
x="奸商:嘿嘿,";
fastplay();
x=player.name;
fastplay();
x=",你要买点什么吗?\n";
fastplay();
printf("1.骷髅秘钥 $5000\n");
printf("2.大宝剑 $3000\n");
printf("3.银盾 $3000\n");
printf("n.什么也不买\n");
gets(s);
if(strcmp(s,"1")==0)
{
if(player.money>=5000)
{
x="购买了1个骷髅秘钥,花费5000金币...";
fastplay();
Sleep(700);
key++;
player.money-=5000;
}
else
{
x="买不起QAQ...";
slowplay();
Sleep(700);
}
}
else if(strcmp(s,"2")==0)
{
if(player.money>=3000)
{
if(!dbj)
{
x="购买了大宝剑并装备,攻击+30,花费3000金币...";
fastplay();
Sleep(700);
dbj++;
if(dj) player.attack-=10,dj=0;
player.attack+=30;
player.money-=3000;
}
else
{
x="你已经拥有一把大宝剑了,不能贪心!!!";
slowplay();
Sleep(700);
}
}
else
{
x="买不起QAQ...";
slowplay();
Sleep(700);
}
}
else if(strcmp(s,"3")==0)
{
if(player.money>=3000)
{
if(!dp)
{
x="购买了银盾并装备,防御+20,花费3000金币...";
fastplay();
Sleep(700);
dp++;
if(md) player.defence-=10,md=0;
player.defence+=20;
player.money-=3000;
}
else
{
x="你已经拥有一个银盾了,不能贪心!!!";
slowplay();
Sleep(700);
}
}
else
{
x="买不起QAQ...";
slowplay();
Sleep(700);
}
}
else if(strcmp(s,"n")==0) return;
else
{
printf("输入错误!!!\n\n");
Sleep(700);
}
goto xxxxxxxxx;
}
}
}
//家(临时)
void Home()
{
xxx:
system("cls");
x="啊,温暖的";
fastplay();
x=player.name;
fastplay();
x="的小屋~\n\n";
fastplay();
x="请问你要干什么( ̄_ ̄)\n";
fastplay();
printf("1.吃大餐(200金币一顿,回满血量和法力)\n2.床(存档系统)(目前只支持一个存档位呢...)\n3.书桌(学习技能)\n4.返回\n");
gets(s);
if(strcmp(s,"1")==0)
{
//if(player.money>=200)
//{
x=player.name;
fastplay();
x="享用了一顿美味的大餐(嗝~),血量回满,花费金币200个~\n";
fastplay();
// player.money-=200;
player.health=player.maxhealth;
player.magic=player.maxmagic;
//}
//else
//{
// x="这年头,连饭都吃不起了QAQ...\n";
// slowplay();
// }
Sleep(700);
goto xxx;
}
else if(strcmp(s,"2")==0)
{
Save();
printf("Saveing......");
Sleep(1000);
printf("Complete!\n");
Sleep(700);
goto xxx;
}
else if(strcmp(s,"3")==0)
{
Book();
goto xxx;
}
else if(strcmp(s,"4")==0)
{
return;
}
else
{
printf("输入错误!!!\n\n");
Sleep(700);
goto xxx;
}
}
//书桌(已完成)
void Book()
{
yy:
system("cls");
x=player.name;
fastplay();
x="的小书桌前充满了学习(TuíFeì)的气息~\n";
fastplay();
x="请问你要看什么( ̄_ ̄)\n";
fastplay();
printf("1.作者的笔记本(为什么会把这种东西放在这儿啊喂...)\n2.如何学习魔法\n3.一张小纸条\n4.返回\n");
gets(s);
if(strcmp(s,"1")==0)
{
while(1)
{
system("cls");
printf("第%d页\n",page);
printf("===================Crab_Dave的小笔记本~======================\n");
if(page==1)
{
printf("\n\n");
printf("这是个密码本~\n\n");
printf("请输入密码:");
gets(s);
if(strcmp(s,"Crab_Dave666")==0)
{
printf("\n锁开了!");
g=_getch();
page++;
}
else
{
printf("\n不知道密码就不要来窥探别人的隐私!!!");
g=_getch();
goto yy;
}
}
else if(page==2)
{
printf("\n魂淡,NOIP2018的普及组第四题好无耻啊QAQ...\n");
printf("如果老夫输出3就好了,\n");
printf("毕竟前三道题攒了190分了,\n");
printf("输出3就可以稳上195,\n");
printf("怎么可能得194?!!!!\n");
printf("啊啊啊啊啊啊啊啊啊啊!!!!!\n\n");
printf("===================Crab_Dave的小笔记本~======================\n");
printf("←→键翻页,n键退出\n");
g=_getch();
if(g==77) page++;
else if(g=='n') goto yy;
}
else if(page==3)
{
printf("\nCrab_Dave是一个圆周率能背200位的好孩子~\n");
printf("π=3.14159265358979323846----------20位\n");
printf(" 26433832795028841971----------40位\n");
printf(" 69399375105820974944----------60位\n");
printf(" 59230781640628620899----------80位\n");
printf(" 86280348253421170679----------100位\n");
printf(" 82148086513282306647----------120位\n");
printf(" 09384460955058223172----------140位\n");
printf(" 53594081284811174502----------160位\n");
printf(" 84102701938521105559----------180位\n");
printf(" 64462294895493038196----------200位\n");
printf("不得不说一句我TQL~\n\n");
printf("===================Crab_Dave的小笔记本~======================\n");
printf("←→键翻页,n键退出\n");
g=_getch();
if(g==75) page--;
else if(g==77) page++;
else if(g=='n') goto yy;
}
else if(page==4)
{
printf("\nCrab_Dave的QQ:1351591429\n");
printf("Crab_Dave的洛谷账号:Crab_Dave\n");
printf("Crab_Dave的博客:https://www.luogu.org/blog/Crab-Dave233/");
printf("快去骚扰他吧~\n\n");
printf("===================Crab_Dave的小笔记本~======================\n");
printf("←→键翻页,n键退出\n");
g=_getch();
if(g==75) page--;
else if(g==77) page++;
else if(g=='n') goto yy;
}
else if(page==5)
{
printf("\n好像是最后一页了呢......\n\n");
printf("(上面的字被划掉了)\n\n");
printf("放屁怎么可能这么轻易地写完了呢!!!!\n\n");
printf("===================Crab_Dave的小笔记本~======================\n");
printf("←→键翻页,n键退出\n");
g=_getch();
if(g==75) page--;
else if(g==77) page++;
else if(g=='n') goto yy;
}
else if(page==6)
{
printf("\n哈哈哈哈我Crab_Dave又回来更新啦!!!\n\n");
printf("CSP2019初赛考完啦,%s考得怎么样呀~\n",player.name);
printf("反正您的作者大人过了~(不然也不会更新的说)\n");
printf("可惜,必须考完半期考试才能停课集训qwq...\n\n");
printf("不管怎样,\n");
printf("大家都来一起快活吧<( ̄ˇ ̄)/\n\n");
printf("===================Crab_Dave的小笔记本~======================\n");
printf("←→键翻页,n键退出\n");
g=_getch();
if(g==75) page--;
else if(g==77) page++;
else if(g=='n') goto yy;
}
else if(page==7)
{
printf("\n哈哈哈哈您英明神武的Crab_Dave大人怎么可能考半期呢!!!\n\n");
printf("我不能咕,我一定不能咕!!!\n");
printf("我要认真学习<( ̄ ﹌  ̄)> !!!\n\n");
printf("===================Crab_Dave的小笔记本~======================\n");
printf("←→键翻页,n键退出\n");
g=_getch();
if(g==75) page--;
else if(g==77) page++;
else if(g=='n') goto yy;
}
else if(page==8)
{
printf("\nCSP2019rp++\n\n");
printf("退役战!加油!\n");
printf("最大的目标是——无悔地退役(ノ°▽°)ノ!!!\n\n");
printf("===================Crab_Dave的小笔记本~======================\n");
printf("←→键翻页,n键退出\n");
g=_getch();
if(g==75) page--;
else if(g=='n') goto yy;
}
}
}
else if(strcmp(s,"2")==0)
{
yyy:
system("cls");
printf("学习什么魔法?\n\n");
printf("1.治疗术:%d级-->%d级\n",zhi,zhi+1);
printf("2.火球术:%d级-->%d级\n",huo,huo+1);
printf("3.毒蛊术:%d级-->%d级\n",du,du+1);
if(bing<=4) printf("4.冰冻术:%d级-->%d级\n",bing,bing+1);
else printf("4.冰冻术:5级-->/\n");
printf("5.瞬身术:%d级-->%d级\n",shun,shun+1);
printf("n.返回\n\n");
gets(s);
if(strcmp(s,"1")==0)
{
printf("将花费%d金币学习治疗术,是否确认Y/ANYKEY?\n",(zhi+1)*1000);
gets(s);
if(strcmp(s,"Y")==0||strcmp(s,"y")==0)
{
//if(player.money>=(zhi+1)*1000)
// {
// player.money-=(zhi+1)*1000;
zhi++;
printf("学习成功!\n");
g=_getch();
goto yyy;
// }
// else
// {
// printf("没钱读什么书!!!\n");
// g=_getch();
// goto yyy;
// }
}
else
{
goto yyy;
}
}
else if(strcmp(s,"2")==0)
{
printf("将花费%d金币学习火球术,是否确认Y/ANYKEY?\n",(huo+1)*1000);
gets(s);
if(strcmp(s,"Y")==0||strcmp(s,"y")==0)
{
//if(player.money>=(huo+1)*1000)
//{
// player.money-=(huo+1)*1000;
huo++;
printf("学习成功!\n");
g=_getch();
goto yyy;
//}
// else
// {
// printf("没钱读什么书!!!\n");
// g=_getch();
// goto yyy;
}
}
else
{
goto yyy;
}
}
else if(strcmp(s,"3")==0)
{
printf("将花费%d金币学习毒蛊术,是否确认Y/ANYKEY?\n",(du+1)*1000);
gets(s);
if(strcmp(s,"Y")==0||strcmp(s,"y")==0)
{
// if(player.money>=(du+1)*1000)
///{
/// player.money-=(du+1)*1000;
du++;
printf("学习成功!\n");
g=_getch();
goto yyy;
//}
//else
//{
// printf("没钱读什么书!!!\n");
// g=_getch();
// goto yyy;
// }
}
else
{
goto yyy;
}
}
else if(strcmp(s,"4")==0)
{
if(bing<=4)
{
printf("将花费%d金币学习冰冻术,是否确认Y/ANYKEY?\n",(bing+1)*1000);
gets(s);
if(strcmp(s,"Y")==0||strcmp(s,"y")==0)
{
// if(player.money>=(bing+1)*1000)
// {
//player.money-=(bing+1)*1000;
bing++;
printf("学习成功!\n");
g=_getch();
goto yyy;
// }
//else
// {
// printf("没钱读什么书!!!\n");
// g=_getch();
// goto yyy;
// }
}
else
{
goto yyy;
}
}
else
{
printf("此技能无法再升级了!!!\n");
g=_getch();
goto yyy;
}
}
else if(strcmp(s,"5")==0)
{
printf("将花费%d金币学习瞬身术,是否确认Y/ANYKEY?\n",(shun+1)*1000);
gets(s);
if(strcmp(s,"Y")==0||strcmp(s,"y")==0)
{
//i//f(player.money>=(shun+1)*1000)
//{
// player.money-=(shun+1)*1000;
shun++;
printf("学习成功!\n");
g=_getch();
goto yyy;
//}
// else
// {
// printf("没钱读什么书!!!\n");
// g=_getch();
// goto yyy;
//}
}
else
{
goto yyy;
}
}
else if(strcmp(s,"n")==0) goto yy;
else
{
printf("输入错误!\n");
g=_getch();
goto yyy;
}
}
//加密
int Lock(int x)
{
return (x+3141)*592-6535897+9323846;
}
//解密
int Unlock(int x)
{
return (x-9323846+6535897)/592-3141;
}
//存档(已完成)
void Save()
{
ofstream out("Save.txt");
//presonal information
out<<player.name<<'\n';
out<<Lock(player.health)<<' '<<Lock(player.maxhealth)<<' '<<Lock(player.attack)<<' '<<Lock(player.defence)<<' '<<Lock(player.speed)<<' '<<Lock(player.attention)<<' ';
out<<Lock(player.magic)<<' '<<Lock(player.maxmagic)<<' '<<Lock(player.level)<<' '<<Lock(player.money)<<' '<<Lock(player.exp)<<' '<<Lock(player.maxexp)<<'\n';
//Boss状压
if(Boss4) out<<Lock(4);
else if(Boss3) out<<Lock(3);
else if(Boss2) out<<Lock(2);
else if(Boss1) out<<Lock(1);
else out<<Lock(0);
out<<' ';
//Dragon
if(Dragon) out<<"1 ";
else out<<"0 ";
//shop状压
if(shop3) out<<"3 ";
else if(shop2) out<<"2 ";
else if(shop1) out<<"1 ";
else out<<"0 ";
//Sandy状压
int San=0;
for(int i=0;i<6;i++) San+=(Sandy[i]==true)?1:0,San<<=1;
San>>=1;
out<<San<<" ";
out<<Lock(514)<<"\n";
//bag
out<<sxie<<' '<<xie<<' '<<lxie<<' ';
out<<random(10)<<" ";
out<<mxie<<' '<<tw<<' '<<dj<<' ';
out<<random(10)<<" ";
out<<md<<' '<<dbj<<' '<<dp<<' '<<key<<' ';
out<<random(10)<<" ";
//书&询问
out<<page<<' '<<zhi<<' '<<huo<<' '<<du<<' '<<bing<<' '<<shun<<' '<<ask<<'\n';
out<<co;
out.close();
}
//读档(已完成)
void Read()
{
ifstream in("Save.txt");
int lalala;
//presonal information
in>>player.name;
in>>(player.health)>>(player.maxhealth)>>(player.attack)>>(player.defence)>>(player.speed)>>(player.attention);
in>>(player.magic)>>(player.maxmagic)>>(player.level)>>(player.money)>>(player.exp)>>(player.maxexp);
player.health=Unlock(player.health);
player.maxhealth=Unlock(player.maxhealth);
player.attack=Unlock(player.attack);
player.defence=Unlock(player.defence);
player.speed=Unlock(player.speed);
player.attention=Unlock(player.attention);
player.magic=Unlock(player.magic);
player.maxmagic=Unlock(player.maxmagic);
player.level=Unlock(player.level);
player.money=Unlock(player.money);
player.exp=Unlock(player.exp);
player.maxexp=Unlock(player.maxexp);
//Boss状压
Boss1=Boss2=Boss3=Boss4=false;
in>>lalala;
if(Unlock(lalala)==4) Boss1=Boss2=Boss3=Boss4=true;
else if(Unlock(lalala)==3) Boss1=Boss2=Boss3=true;
else if(Unlock(lalala)==2) Boss1=Boss2=true;
else if(Unlock(lalala)==1) Boss1=true;
//Dragon
in>>lalala;
Dragon=(lalala==1)?true:false;
//shop状压
shop1=shop2=shop3=false;
in>>lalala;
if(lalala==3) shop1=shop2=shop3=true;
else if(lalala==2) shop1=shop2=true;
else if(lalala==1) shop1=true;
//Sandy状压
in>>lalala;
for(int i=5;i>=0;i--)
if(lalala&1) Sandy[i]=true,lalala>>=1;
else Sandy[i]=false,lalala>>=1;
in>>lalala;
//bag
in>>sxie>>xie>>lxie;
in>>lalala;
in>>mxie>>tw>>dj;
in>>lalala;
in>>md>>dbj>>dp>>key;
in>>lalala;
//书&询问
in>>page>>zhi>>huo>>du>>bing>>shun>>ask;
in>>co;if(co!=0&&co!=1)co=0;
in.close();
}
//我方攻击(已完成)
void IAttack(bool shuai)
{
if(shuai)
{
b=random(100);
if(b>=enemy[0].speed)
{
b=random(10);
c=random(3)-1;
d=player.attack*2-enemy[0].defence+b*c;
if(d<1) d=1;
b=random(100);
if(b>=player.attention)
{
printf("%s率先发起了攻击,造成了%d点伤害!\n\n",player.name,d);
}
else
{
printf("%s率先发动了攻击,并且...暴击!造成了%d点伤害!\n\n",player.name,d*=2);
}
enemy[0].blood-=d;
}
else printf("%s率先发起了攻击,但是...Miss...\n\n",player.name);
}
else
{
b=random(100);
if(b>=enemy[0].speed)
{
b=random(10);
c=random(3)-1;
d=player.attack*2-enemy[0].defence+b*c;
if(d<1) d=1;
b=random(100);
if(b>=player.attention)
{
printf("%s发起了攻击,造成了%d点伤害!\n\n",player.name,d);
}
else
{
printf("%s发动了攻击,并且...暴击!造成了%d点伤害!\n\n",player.name,d*=2);
}
enemy[0].blood-=d;
}
else printf("%s发起了攻击,但是...Miss...\n\n",player.name);
}
}
//敌方攻击(已完成)
void EAttack(bool shuai)
{
if(enemy[0].zt!=2)
{
c=random(3);
if(!c)
{
if(strcmp(enemy[0].name,"大型史莱姆")==0||(strcmp(enemy[0].name,"一只怪物")==0&&random(2))||(strcmp(enemy[0].name,"另一只怪物")==0&&random(2)))
{
if(enemy[0].energy<1)
{
printf("%s蓄力!\n\n",enemy[0].name);
enemy[0].energy++;
}
else
{
printf("%s使用Boss技能:自我再生!!!\n\n",enemy[0].name);
Sleep(100);
printf("%s的血量增加了!!!\n\n",enemy[0].name);
enemy[0].energy--;
enemy[0].blood+=random(10)+1;
if(enemy[0].blood>150)enemy[0].blood=150;
}
}
else if(strcmp(enemy[0].name,"嗜血兽人")==0||(strcmp(enemy[0].name,"一只怪物")==0&&random(2))||(strcmp(enemy[0].name,"另一只怪物")==0&&random(2)))
{
if(enemy[0].energy<2)
{
printf("%s蓄力!\n\n",enemy[0].name);
enemy[0].energy++;
}
else
{
printf("%s使用Boss技能:泣血!!!\n\n",enemy[0].name);
Sleep(100);
enemy[0].energy-=2;
b=random(100);
if(b>=player.speed)
{
b=random(10);
c=random(3)-1;
d=enemy[0].attack*2-player.defence+b*c;
if(d<1) d=1;
printf("%s对%s造成了%d点伤害!并回复了%d点血量!\n\n",enemy[0].name,player.name,d,b=d/(random(2)?2:3));
player.health-=d;
enemy[0].blood+=b;
}
else
{
printf("可惜没有命中...\n\n");
}
}
}
else if(strcmp(enemy[0].name,"骷髅守卫")==0||(strcmp(enemy[0].name,"一只怪物")==0&&random(2))||(strcmp(enemy[0].name,"另一只怪物")==0&&random(2)))
{
if(enemy[0].energy<3)
{
printf("%s蓄力!\n\n",enemy[0].name);
enemy[0].energy++;
}
else
{
printf("%s使用Boss技能:居合斩!!!\n\n",enemy[0].name);
Sleep(100);
enemy[0].energy-=3;
b=random(10);
c=random(3)-1;
d=enemy[0].attack*2-player.defence+b*c;
if(d<1) d=1;
b=random(3)+2;
printf("%s一刀斩出!%d倍威力的斩击对%s造成了%d点伤害!\n\n",enemy[0].name,b,player.name,d*b);
player.health-=d*b;
}
}
else if(strcmp(enemy[0].name,"骷髅王")==0||(strcmp(enemy[0].name,"一只怪物")==0&&random(2))||(strcmp(enemy[0].name,"另一只怪物")==0&&random(2)))
{
if(enemy[0].energy<0)
{
printf("%s蓄力!\n\n",enemy[0].name);
enemy[0].energy++;
}
else
{
printf("%s使用Boss技能:王之镇压!!!\n\n",enemy[0].name);
Sleep(100);
//if(fightboss4==1)
//{
printf("然而,%s向你臣服...\n\n",enemy[0].name);
//}
// else
// {
// printf("再见了,勇士...\n\n");
// Sleep(300);
// x="你的眼前一黑...\n\n";
// slowplay();
////player.health=-1;
//}
}
}
else if(strcmp(enemy[0].name,"笛卡尔·Li")==0||(strcmp(enemy[0].name,"Crab_Dave·charactor·ninth")==0&&random(2)))
{
if(enemy[0].energy<2)
{
printf("%s蓄力!\n\n",enemy[0].name);
enemy[0].energy++;
}
else
{
printf("%s使用Boss技能:龙爪!!!\n\n",enemy[0].name);
Sleep(100);
enemy[0].energy-=2;
b=random(10);
c=random(3)-1;
d=enemy[0].attack*2-player.defence+b*c;
if(d<1) d=1;
b=random(3)+1;
printf("%s龙爪一探!对%s造成了%d点伤害!\n\n",enemy[0].name,player.name,d*b);
player.health-=d*b;
}
}
else if(strcmp(enemy[0].name,"胎神·马形态")==0||(strcmp(enemy[0].name,"Crab_Dave·charactor·ninth")==0&&random(2)))
{
if(enemy[0].energy<2)
{
printf("%s蓄力!\n\n",enemy[0].name);
enemy[0].energy++;
}
else
{
printf("%s使用Boss技能:重狙!!!\n\n",enemy[0].name);
Sleep(100);
enemy[0].energy-=2;
b=random(10);
c=random(3)-1;
d=enemy[0].attack*2-player.defence+b*c;
if(d<1) d=1;
b=random(2)+2;
printf("%s狙射!对%s造成了%d点伤害!\n\n",enemy[0].name,player.name,d*b);
player.health-=d*b;
}
}
else if(strcmp(enemy[0].name,"胎神·兔形态")==0||(strcmp(enemy[0].name,"Crab_Dave·charactor·ninth")==0&&random(2)))
{
if(enemy[0].energy<0)
{
printf("%s蓄力!\n\n",enemy[0].name);
enemy[0].energy++;
}
else
{
printf("%s使用Boss技能:速狙!!!\n\n",enemy[0].name);
Sleep(100);
enemy[0].energy-=0;
b=random(10);
c=random(3)-1;
d=enemy[0].attack*2-player.defence+b*c;
if(d<1) d=1;
b=1;
printf("%s狙射!对%s造成了%d点伤害!\n\n",enemy[0].name,player.name,d*b);
//player.health-=d*b;
}
}
else if(strcmp(enemy[0].name,"胎神·牛头马脸兔牙猪肚鸡翅狼心狗肺狒形态")==0)
{
if(enemy[0].energy<1)
{
printf("%s蓄力!\n\n",enemy[0].name);
enemy[0].energy++;
}
else
{
printf("%s使用Boss技能:胎神之光!!!\n\n",enemy[0].name);
Sleep(100);
enemy[0].energy-=1;
b=random(10);
c=random(3)-1;
d=enemy[0].attack*2-player.defence+b*c;
if(d<1) d=1;
b=random(2);
if(b)
{
printf("%s智杖一挥!天空一道巨响!对%s造成了%d点伤害!\n\n",enemy[0].name,player.name,d*2);
//player.health-=d*2;
}
else
{
printf("然而%s太胎了,攻击了自己...\n\n",enemy[0].name);
enemy[0].blood-=d;
if(enemy[0].blood<=0)enemy[0].blood=1;
}
}
}
else if(strcmp(enemy[0].name,"(并不)无敌的Y伟")==0||(strcmp(enemy[0].name,"Crab_Dave·charactor·ninth")==0&&random(2)))
{
if(enemy[0].energy<0)
{
printf("%s蓄力!\n\n",enemy[0].name);
enemy[0].energy++;
}
else
{
printf("%s使用Boss技能:疲软!!!\n\n",enemy[0].name);
Sleep(100);
enemy[0].energy-=0;
printf("%s的生命值折半!\n\n",player.name);
player.health>>=1;
}
}
else if(strcmp(enemy[0].name,"Crab_Dave·charactor·zero")==0||(strcmp(enemy[0].name,"Crab_Dave·charactor·ninth")==0&&random(2)))
{
if(enemy[0].energy<2)
{
printf("%s蓄力!\n\n",enemy[0].name);
enemy[0].energy++;
}
else
{
printf("%s使用Boss技能:归元!!!\n\n",enemy[0].name);
Sleep(100);
printf("%s的血量增加了!!!\n\n",enemy[0].name);
enemy[0].energy-=2;
enemy[0].blood+=random(30)+1;
}
}
else if(strcmp(enemy[0].name,"Crab_Dave·charactor·first")==0||(strcmp(enemy[0].name,"Crab_Dave·charactor·ninth")==0&&random(2)))
{
if(enemy[0].energy<1)
{
printf("%s蓄力!\n\n",enemy[0].name);
enemy[0].energy++;
}
else
{
printf("%s使用Boss技能:雷击术!!!\n\n",enemy[0].name);
Sleep(100);
enemy[0].energy-=1;
b=random(10);
c=random(3)-1;
d=enemy[0].attack*2-player.defence+b*c;
if(d<1) d=1;
b=random(2)+2;
printf("天空一道巨响!%s受到了%d点伤害!\n\n",player.name,d*b);
//player.health-=d*b;
}
}
else if(strcmp(enemy[0].name,"Crab_Dave·charactor·second")==0||(strcmp(enemy[0].name,"Crab_Dave·charactor·ninth")==0&&random(2)))
{
if(enemy[0].energy<2)
{
printf("%s蓄力!\n\n",enemy[0].name);
enemy[0].energy++;
}
else
{
printf("%s使用Boss技能:一拳!!!\n\n",enemy[0].name);
Sleep(100);
enemy[0].energy-=2;
b=random(10);
c=random(3)-1;
d=enemy[0].attack*2-player.defence+b*c;
if(d<1) d=1;
b=random(3)+2;
printf("%s一拳挥出!%s受到了%d点伤害!\n\n",enemy[0].name,player.name,d*b);
player.health-=d*b;
}
}
else if(strcmp(enemy[0].name,"Crab_Dave·charactor·third")==0||(strcmp(enemy[0].name,"Crab_Dave·charactor·ninth")==0&&random(2)))
{
if(enemy[0].energy<0)
{
printf("%s蓄力!\n\n",enemy[0].name);
enemy[0].energy++;
}
else
{
printf("%s使用Boss技能:免疫!!!\n\n",enemy[0].name);
Sleep(100);
enemy[0].energy-=0;
printf("%s从异常状态中脱出!\n\n",enemy[0].name);
enemy[0].zt=0;
}
}
else if(strcmp(enemy[0].name,"Crab_Dave·charactor·fourth")==0||(strcmp(enemy[0].name,"Crab_Dave·charactor·ninth")==0&&random(2)))
{
if(enemy[0].energy<1)
{
printf("%s蓄力!\n\n",enemy[0].name);
enemy[0].energy++;
}
else
{
printf("%s使用Boss技能:搞事情!!!\n\n",enemy[0].name);
Sleep(100);
enemy[0].energy-=1;
b=random(10);
c=random(3)-1;
d=enemy[0].attack*2-player.defence+b*c;
if(d<1) d=1;
b=random(2)+2;
printf("%s和%s同时受到%d点伤害!\n\n",enemy[0].name,player.name,d*b);
player.health-=d*b;
enemy[0].blood-=d*b;
}
}
else if(strcmp(enemy[0].name,"Crab_Dave·charactor·fifth")==0||(strcmp(enemy[0].name,"Crab_Dave·charactor·ninth")==0&&random(2)))
{
if(enemy[0].energy<0)
{
printf("%s蓄力!\n\n",enemy[0].name);
enemy[0].energy++;
}
else
{
printf("%s使用Boss技能:暴走!!!\n\n",enemy[0].name);
Sleep(100);
enemy[0].energy-=0;enemy[0].attack+=10;
printf("%s攻击提升!\n\n",enemy[0].name);
}
}
else if(strcmp(enemy[0].name,"Crab_Dave·charactor·sixth")==0||(strcmp(enemy[0].name,"Crab_Dave·charactor·ninth")==0&&random(2)))
{
if(enemy[0].energy<0)
{
printf("%s蓄力!\n\n",enemy[0].name);
enemy[0].energy++;
}
else
{
printf("%s使用Boss技能:自闭!!!\n\n",enemy[0].name);
Sleep(100);
enemy[0].energy-=0;enemy[0].defence+=10;
printf("%s防御提升!\n\n",enemy[0].name);
}
}
else if(strcmp(enemy[0].name,"Crab_Dave·charactor·seventh")==0||(strcmp(enemy[0].name,"Crab_Dave·charactor·ninth")==0&&random(2)))
{
if(enemy[0].energy<2)
{
printf("%s蓄力!\n\n",enemy[0].name);
enemy[0].energy++;
}
else
{
printf("%s使用Boss技能:学术性颓废!!!\n\n",enemy[0].name);
Sleep(100);
enemy[0].energy-=2;
enemy[0].blood+=50;
printf("学颓有助于精力回复哦!\n\n");
}
}
else if(strcmp(enemy[0].name,"Crab_Dave·charactor·eighth")==0||(strcmp(enemy[0].name,"Crab_Dave·charactor·ninth")==0&&random(2)))
{
if(enemy[0].energy<2)
{
printf("%s蓄力!\n\n",enemy[0].name);
enemy[0].energy++;
}
else
{
printf("%s使用Boss技能:女装色诱!!!\n\n",enemy[0].name);
Sleep(100);
enemy[0].energy-=2;
b=random(10);
if(b<3)
{
printf("完了,%s鼻血止不住了!!!\n\n",player.name);
player.health=0;
}
else
{
printf("可惜%s强忍住了内心的躁动,继续战斗!\n\n",player.name);
}
}
}
else if(strcmp(enemy[0].name,"Crab_Dave·charactor·tenth")==0||(strcmp(enemy[0].name,"Crab_Dave·charactor·ninth")==0&&random(2)))
{
if(enemy[0].energy<1)
{
printf("%s蓄力!\n\n",enemy[0].name);
enemy[0].energy++;
}
else
{
printf("%s使用Boss技能:嘴炮!!!\n\n",enemy[0].name);
Sleep(100);
enemy[0].energy-=1;
b=random(10);
c=random(3)-1;
d=enemy[0].attack*2-player.defence+b*c;
if(d<1) d=1;
printf("%s口吐芬芳!%s受到了%d点伤害,并吓掉了%d点法力!\n\n",enemy[0].name,player.name,d,d);
//player.health-=d;
//player.magic-=d;
if(player.magic<0)player.magic=0;
}
}
else if(strcmp(enemy[0].name,"Crab_Dave·卍")==0)
{
if(enemy[0].energy<3)
{
printf("%s蓄力!\n\n",enemy[0].name);
enemy[0].energy++;
}
else
{
printf("%s使用Boss技能:奥义·装13之力!!!\n\n",enemy[0].name);
Sleep(100);
enemy[0].energy-=3;
d=random(1000)+1;
printf("天空中出现了奇妙的光芒!%s受到了%d点伤害!\n\n",enemy[0].name,player.name,d);
//player.health-=d*b;
}
}
}
else
{
if(shuai)
{
b=random(100);
if(b>=player.speed)
{
b=random(10);
c=random(3)-1;
d=enemy[0].attack*2-player.defence+b*c;
if(d<1) d=1;
b=random(100);
if(b>=enemy[0].attention)
{
printf("%s率先发起了攻击,造成了%d点伤害!\n\n",enemy[0].name,d);
}
else
{
printf("%s率先发动了攻击,并且...暴击!造成了%d点伤害!\n\n",enemy[0].name,d*=2);
}
//player.health-=d;
}
else printf("%s率先发起了攻击,但是...Miss...\n\n",enemy[0].name);
}
else
{
b=random(100);
if(b>=player.speed)
{
b=random(10);
c=random(3)-1;
d=enemy[0].attack*2-player.defence+b*c;
if(d<1) d=1;
b=random(100);
if(b>=enemy[0].attention)
{
printf("%s发起了攻击,造成了%d点伤害!\n\n",enemy[0].name,d);
}
else
{
printf("%s发动了攻击,并且...暴击!造成了%d点伤害!\n\n",enemy[0].name,d*=2);
}
//player.health-=d;
}
else printf("%s发起了攻击,但是...Miss...\n\n",enemy[0].name);
}
}
}
else
{
b=random(6)+1;
if(b<=bing)
{
printf("%s尝试攻击,但寒气困扰着%s,令%s动弹不得!\n",enemy[0].name,enemy[0].name,enemy[0].name);
}
else
{
printf("%s挣脱了寒气的束缚!\n",enemy[0].name);
enemy[0].zt=0;
EAttack(0);
}
}
}
//对战(可能完成了吧...)
void Fight(int num)
{
strcpy(enemy[0].name,enemy[num].name);
enemy[0].blood=enemy[num].blood;
enemy[0].attack=enemy[num].attack;
enemy[0].defence=enemy[num].defence;
enemy[0].speed=enemy[num].speed;
enemy[0].attention=enemy[num].attention;
enemy[0].zt=enemy[num].zt;
enemy[0].energy=enemy[num].energy;
if(num==16) fightboss4=1;
system("cls");
x=enemy[0].name;
fastplay();
x="与你展开了战斗!!!\n\n";
fastplay();
g=_getch();
_round=0;
while(player.health>0&&enemy[0].blood>0)
{
system("cls");
printf("================第%d回合================\n\n",++_round);
printf("你的血量:%d/%d\n你的法力:%d/%d\n对方血量:%d\n\n",player.health,player.maxhealth,player.magic,player.maxmagic,enemy[0].blood);
printf("请问你要干什么( ̄_ ̄)\n");
printf("1.攻击\n2.使用技能\n3.查看背包\n4.查看信息\n5.逃跑\n\n");
gets(s);
if(strcmp(s,"1")==0)
{
if(player.speed>=enemy[0].speed)
{
IAttack(1);
if(player.health<=0||enemy[0].blood<=0) break;
EAttack(0);
if(player.health<=0||enemy[0].blood<=0) break;
if(enemy[0].zt==1)
{
printf("%s喷出一口毒血,受到了%d点伤害!\n",enemy[0].name,du*20);
enemy[0].blood-=du*20;
if(player.health<=0||enemy[0].blood<=0) break;
}
}
else
{
EAttack(1);
if(player.health<=0||enemy[0].blood<=0) break;
IAttack(0);
if(player.health<=0||enemy[0].blood<=0) break;
if(enemy[0].zt==1)
{
printf("%s喷出一口毒血,受到了%d点伤害!\n",enemy[0].name,du*20);
enemy[0].blood-=du*20;
if(player.health<=0||enemy[0].blood<=0) break;
}
}
g=_getch();
}
else if(strcmp(s,"2")==0)
{
if(strcmp(player.name,enemy[0].name)==0)
{
printf("嘿!这可是你和你之间的战斗!放技能是不公平的!\n");
Sleep(700);
_round--;
goto yyyy;
}
printf("使用什么技能( ̄_ ̄)\n");
if(zhi)printf("1.治疗术:回复%d点血量,消耗%d点法力\n",zhi*75,zhi*100);
if(huo)printf("2.火球术:对敌人造成%d点伤害,消耗%d点法力\n",huo*75,huo*100);
if(du)printf("3.毒蛊术:使敌人中毒,消耗%d点法力\n",du*75);
if(bing)printf("4.冰冻术:冰冻敌人,消耗%d点法力\n",bing*75);
if(shun)printf("5.瞬身术:当回合攻击,敌人不能反击\n,消耗%d点法力\n",shun*75);
printf("n.不使用技能\n\n");
gets(s);
if(strcmp(s,"1")==0)
{
if(player.magic>=zhi*100)
{
printf("%s吟唱起了咒语...温和的白光撒在%s身上,",player.name,player.name);Sleep(100);printf("%s的血量回复了%d点!\n",player.name,zhi*75);Sleep(750);
player.health+=zhi*75;player.magic-=zhi*100;
if(player.health>player.maxhealth) player.health=player.maxhealth;
EAttack(0);
if(player.health<=0||enemy[0].blood<=0) break;
if(enemy[0].zt==1)
{
printf("%s喷出一口毒血,受到了%d点伤害!\n",enemy[0].name,du*20);
enemy[0].blood-=du*20;
if(player.health<=0||enemy[0].blood<=0) break;
}
}
else
{
printf("呀,没蓝了呢...");
_round--;
}
}
else if(strcmp(s,"2")==0)
{
if(player.magic>=huo*100)
{
printf("%s吟唱起了咒语...熊熊烈焰呼啸着砸到%s身上,",player.name,enemy[0].name);Sleep(100);printf("造成了%d点伤害!\n",huo*75);Sleep(750);
player.magic-=huo*100;enemy[0].blood-=huo*75;
if(player.health<=0||enemy[0].blood<=0) break;
EAttack(0);
if(player.health<=0||enemy[0].blood<=0) break;
if(enemy[0].zt==1)
{
printf("%s喷出一口毒血,受到了%d点伤害!\n",enemy[0].name,du*20);
enemy[0].blood-=du*20;
if(player.health<=0||enemy[0].blood<=0) break;
}
}
else
{
printf("呀,没蓝了呢...");
_round--;
}
}
else if(strcmp(s,"3")==0)
{
if(player.magic>=du*75)
{
printf("%s吟唱起了咒语...%s的周围腾起了层层毒雾,",player.name,enemy[0].name);Sleep(100);printf("%s已身中剧毒!\n",enemy[0].name);Sleep(750);
player.magic-=du*75;enemy[0].zt=1;
EAttack(0);
if(player.health<=0||enemy[0].blood<=0) break;
if(enemy[0].zt==1)
{
printf("%s喷出一口毒血,受到了%d点伤害!\n",enemy[0].name,du*20);
enemy[0].blood-=du*20;
if(player.health<=0||enemy[0].blood<=0) break;
}
}
else
{
printf("呀,没蓝了呢...");
_round--;
}
}
else if(strcmp(s,"4")==0)
{
if(player.magic>=bing*75)
{
printf("%s吟唱起了咒语...%s身周冰霜凝结,",player.name,enemy[0].name);Sleep(100);printf("%s被霜寒之力冰封!\n",enemy[0].name);Sleep(750);
player.magic-=bing*75;enemy[0].zt=2;
EAttack(0);
if(player.health<=0||enemy[0].blood<=0) break;
}
else
{
printf("呀,没蓝了呢...");
_round--;
}
}
else if(strcmp(s,"5")==0)
{
if(player.magic>=shun*75)
{
printf("%s吟唱起了咒语...%s毫无防备,",player.name,enemy[0].name);Sleep(100);printf("受到了%d点伤害!\n",shun*player.attack*8);Sleep(750);
player.magic-=shun*75;enemy[0].blood-=shun*player.attack*8;
if(player.health<=0||enemy[0].blood<=0) break;
if(enemy[0].zt==1)
{
printf("%s喷出一口毒血,受到了%d点伤害!\n",enemy[0].name,du*20);
enemy[0].blood-=du*20;
if(player.health<=0||enemy[0].blood<=0) break;
}
}
else
{
printf("呀,没蓝了呢...");
_round--;
}
}
yyyy:
g=_getch();
}
else if(strcmp(s,"3")==0)
{
if(strcmp(player.name,enemy[0].name)==0)
{
printf("嘿!这可是你和你之间的战斗!翻背包是不公平的!\n");
goto yyyyy;
}
Bag();
yyyyy:
_round--;
}
else if(strcmp(s,"4")==0)
{
Show();
_round--;
}
else if(strcmp(s,"5")==0)
{
if(num==3||num==7||num==11||num==15||num==16)
{
printf("勇士在魔王面前不应该逃跑!\n");
Sleep(700);
_round--;
}
else
{
b=random(10);
if(b<4)
{
printf("%s逃跑了...",player.name);
Sleep(700);
return;
}
else
{
printf("糟糕,逃不掉!\n");
b=random(10);
c=random(3)-1;
d=enemy[0].attack*2-player.defence+b*c;
if(d<1) d=1;
printf("%s发起了攻击,造成了%d点伤害!\n",enemy[0].name,d);
player.health-=d;
Sleep(700);
}
}
}
else
{
printf("输入错误!!!\n\n");
Sleep(700);
_round--;
}
}
fightboss4=0;
if(player.health<=0)
{
player.health=0;
x=player.name;
slowplay();
x="被打败了...\n匆忙中遗失了一半的金币...\n";
slowplay();
player.money/=2;
x="赶快找个地方回复一下...\n\n";
fastplay();
Sleep(700);
}
else if(enemy[0].blood<=0)
{
if((player.level>=1&&player.level<=2&&num<=3)||(player.level>=3&&player.level<=4&&num>=4&&num<=7)||(player.level>=5&&player.level<=6&&num>=8&&num<=11)||(player.level>=7&&player.level<=9&&num>=12&&num<=16)||(num>=17))
{
enemy[0].getm=enemy[num].getm;
enemy[0].gete=enemy[num].gete;
}
else
{
enemy[0].gete=random(10)+1;
enemy[0].getm=random(25)+25;
}
x="打败了";
slowplay();
x=enemy[0].name;
slowplay();
x=",获得金币";
slowplay();
printf("%d",enemy[0].getm);
x="个,经验";
slowplay();
printf("%d",enemy[0].gete);
x="点!\n\n";
slowplay();
player.money+=enemy[0].getm;
player.exp+=enemy[0].gete;
if(num==3) Boss1=1;
if(num==7) Boss2=1;
if(num==11) Boss3=1;
if(num==15) Dragon=1;
if(num==16)
{
Boss4=1;
player.attack-=9999999;
player.defence-=9999999;
x="咦,这是什么?!\n";
slowplay();
x="获得了 写着“S”的魔法碎片 ~\n";
slowplay();
Sandy[1]=1;
}
if(num==10)
{
a=random(10);
if(a==0)
{
x="咦,宝箱怪掉落了伤药!\n";
fastplay();
xie++;
}
if(a==1)
{
x="咦,宝箱怪掉落了藤蔓!\n";
fastplay();
tw++;
}
if(a==2)
{
x="咦,宝箱怪掉落了200个金币!\n";
fastplay();
player.money+=200;
}
}
Sleep(500);
}
while(player.exp>=player.maxexp)
{
x="哇,升级了!\n血量回满,\n最大血量+50,\n法力回满,\n最大法力+50,\n攻击+5,\n防御+2,\n更敏捷了!!!\n更专注了!!!\n\n";
slowplay();
player.level++;
player.maxhealth+=50;
player.health=player.maxhealth;
player.maxmagic+=50;
player.magic=player.maxmagic;
player.attack+=5;
player.defence+=2;
player.speed++;
player.attention++;
player.exp-=player.maxexp;
player.maxexp+=200;
Sleep(500);
}
}
//随机函数+取模
int random(int a)
{
return (rand()%a+rand()%a+rand()%a)%a;
}
//慢输出
void slowplay()
{
int l=x.length();
for(int i=0;i<l;i++)
printf("%c",x[i]),Sleep(85);
}
//快输出
void fastplay()
{
int l=x.length();
for(int i=0;i<l;i++)
printf("%c",x[i]),Sleep(2);
}
//颜色函数
void color(int a)
{
switch(a)
{
//黑底白字
case 1:SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);break;
//黑底红字
case 2:SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED);break;
//黑底绿字
case 3:SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN);break;
//黑底黄字
case 4:SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN);break;
//黑底蓝字
case 5:SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_BLUE);break;
//黑底品红
case 6:SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_BLUE);break;
//黑底青色
case 7:SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN|FOREGROUND_BLUE);break;
}
}
int dd[4]={9,15,20,34},cnt=0;
string yyy[10010]={
" _________________________________________________________________________________________________________________________________________ ",
" |___________________________________+++++++++++++++++___________________________________________________________________________________ | ",
" _ ________________________________________________________________ | | ",
"|c| _________ | ___________ ______ __________ ________ _____________ | | | ",
"| |___| _____ | | |_________ | | | | | | | | | | ________________________________________________________ | | ",
"| ___ | | | | _______ | | |______| |__________| | | | | | | |__| | ",
"| |___| |_____| |_| |_______| | | ______+ _s_______ | | | | |______ |____ ____| ",
"|_______+_ _____ ___s_+_ | | | | | | | | | | ____ | | | ",
" ______| |_____| |_______| | | |_______| | | | | | | | | | | __________ | ",
" |s +____s______ _____z_+_| | _______ | | |________| | | | | | | |%%%%%%%%%%| | ",
" | | | | | | | | | ________ | | | | | | |%%%%%%%%%%| | ",
" | |____________| |___________| |_______| |______ | | | | | | | | | |%%%%T%%%%%| | ",
" | _____ ____ ____ ____ +s__ _ ___ |__| | | | | |____| |_____ | |%%%%%%%%%%| | ",
" | | | | | | | | | | | | | | | _ | | | | ____+_____ | | |___ ____| | ",
" | |_____| |____| |____| |____| |____| |_| |___| | | |________| | | | __+___ | | | | | | ",
" | s+__________s_z_s_________________ __________| | ________ | | | | +_ | | | | | ",
" | |_________________________________| |____________| | | | | | | | +| | | | | | ",
" |_s_____ _________________ ____ ____ __ ___| | | | | | |____| | | | | ",
" | | _______| |____| | | | | |____________| |_____________| | |________| | | | ",
" | | | ___z_s________| | | |______________________________ |_____ ____| |___________________________________________________| ",
" | | | |___________________| | | | | | ",
" | | |_____ ____________s | | | | | ",
" | | | | | | | | | | ",
" | | | |_____________| |_________________________________| | | | ",
" | | |_______________ ___________________________________| | | ",
" | | | | ______________________ | | | ",
" | | | | | __________________ | | | | ",
" | | | | | | ______________ | | | | | ",
" | | | | | | | __________ | | | |______________| | _______ ",
" | | | | | | | | _______ | | | | ________________| | % | ",
" | | | | | | | |_____z_?| | | | |s| | % | ",
" | | | | | | |____________| | | | | | %%% | ",
" | | | | | |________________| | | | | | ",
" | | | | |____________________| | | |__ __| ",
" | |_______________________________| |________________________| | | | ",
" |______________________________________________________________| | | ",
" ___| |___ ",
" | _ _ | ",
" ___________________________|%|_|%|_|%|___________________________ ",
" | ______________________O___O_s s_O__O_______________________ | ",
" | | ___| | |___ | | ",
" | | | | | | ",
" _| |________________________| | | | | | |________________________| |_ ",
" | ________________________| | | | |________________________ | ",
" | | | | ____________| | | | |___________ | | | | ",
" ___________| | | |___________| ______ ___| | |___ _____ |____________| | | |____________ ",
" | ___________| |___________ | | | | | | | | | | | ____________| |____________ | ",
" | | _| |_ | | | | | | | | | | | | | _| |_ | | ",
" | | | | | _| | | | | | | | |_ | | | | | ",
" | | | | | | | |________| |___| | |___| |_______| | | | | | | | ",
" | |_________| | | | | _______________ | _____________ | | | | |__________| | ",
" | _________ | |___________| | | | | | |____________| | __________ | ",
" | | | | _____________| | | | |______________ | | | | ",
" | | |_ | | | | | _| | | ",
" | |___________| |____________________________|O|O|____________________________| |____________| | ",
" |_____________________________________________ ______________________________________________| ",
" |z| ",
" |*| ",
" |_| ",
};
string zzz[10010];
void sout(string s){
for(int i=0;i<s.size();i++){
Sleep(10);
cout<<s[i];
}
}
void color(string s)
{
const string v = "color " + s;
system(v.c_str());
}
void cls()
{
system("cls");
}
void pause()
{
system("pause");
}
void rd()
{
srand(time(NULL));
}
void baoda()
{
string s;
uu:;
cout<<"请输入对战者名!\n";
cin>>s;
if (s == "CheeseFunction") while (1) pause();
cls();
sout("-------------欢迎来到暴打");
sout(s);
sout("-------------\n");
pause();
cls();
int s_hq = 114514;
int gj = 1;
int sss = 114524,gjj=0;
while (s_hq > 0)
{
if(sss<=0){
cout<<"你死了!";
goto kkkkk;
}
cout << s;
cout << "的血量:";
cout << s_hq;
cout << "\n你的攻击:";
cout << gj;
cout<<"\n你的血量:";
cout<<sss;
cout << "\n请按任意键攻击. . .";
//getch();
pause();
color("47");
color("07");
cls();
s_hq -= gj;
gj += rand() % 10;
srand(time(NULL));
sss-=gjj;
gjj+=rand()%10;
}
sout("你打败了");
sout(s);
kkkkk:;
sout("!\n再来一局?\n1:Yes\n2:No\n");
int huida;
cin >> huida;
if (huida == 1) goto uu;
else
{
pause();
return;
}
}
char gg[1010]={'a','b','c','d','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
void jiazai(int x){
for(int i=1;i<=100;i++){
cout<<"已加载%"<<i;
Sleep(x);
system("cls");
}
}
void jishi1(int sum,int sum1,int sum2,int sum3){
while(1){
sum++;
sum1+=sum/60;
sum2+=sum1/60;
sum3+=sum2/24;
sum%=60;
sum1%=60;
sum2%=24;
cout<<sum3<<"天"<<sum2<<"时"<<sum1<<"分"<<sum<<"秒";
Sleep(1000);
system("cls");
}
}
void jishi2(int sum,int sum1,int sum2,int sum3,int sum4,int sum5,int sum6,int sum7){
while(1){
sum++;
sum1+=sum/60;
sum2+=sum1/60;
sum3+=sum2/24;
sum%=60;
sum1%=60;
sum2%=24;
cout<<sum3<<"天"<<sum2<<"时"<<sum1<<"分"<<sum<<"秒";
Sleep(1000);
system("cls");
if(sum==sum7&&sum1==sum6&&sum2==sum5&&sum3==sum4){
cout<<"结束了";
Sleep(2000);
system("cls");
return;
}
}
}
int main(){
d:;
char xy;
cout<<"你想要我干什么?\n";
cout<<"1.计时(无尽模式)\n";
cout<<"2.计时(有尽模式)\n";
cout<<"3.打开网站\n";
cout<<"4.小游戏\n";
xy=_getch();
system("cls");
if(xy=='1'){
int x1,x2,x3,x4;
cout<<"请初始化时间!\n";
cin>>x1>>x2>>x3>>x4;
system("cls");
jishi1(x1,x2,x3,x4);
}
if(xy=='2'){
int x1,x2,x3,x4,x5,x6,x7,x8;
cout<<"请初始化时间!\n";
cin>>x1>>x2>>x3>>x4;
system("cls");
cout<<"请输入终止时间!\n";
cin>>x5>>x6>>x7>>x8;
system("cls");
jishi2(x1,x2,x3,x4,x5,x6,x7,x8);
}
if(xy=='3'){
char x;
cout<<"1.学习网站\n";
cout<<"2.游戏网站\n";
x=_getch();
system("cls");
if(x=='1'){
int xx;
cout<<"1.刷题网站\n";
cout<<"2.知识网站\n";
xx=_getch();
system("cls");
if(xx=='1'){
system("start https://luogu.com.cn");
}
else system("start https://oi-wiki.org/");
}
else{
char xx;
cout<<"1.digdig\n";
cout<<"2.poki";
xx=_getch();
if(xx=='1') system("start https://digdig.io");
else system("start https://poki.com");
}
}
system("cls");
if(xy=='4'){
char xx;
cout<<"1.走迷宫\n";
cout<<"2.我的世界(2D版)\n";
cout<<"3.猜数\n";
cout<<"4.打字游戏\n";
cout<<"5.战斗\n";
cout<<"6.冒险\n";
xx=_getch();
system("cls");
if(xx=='6'){
srand(time(0));
player.level=1000100;
player.maxhealth=1000100;
player.health=player.maxhealth;
player.maxmagic=1000100;
player.magic=player.maxmagic;
player.attack=999999999;
player.defence=999999999;
player.speed++;
player.attention++;
player.exp-=player.maxexp;
player.maxexp=1000100;
system("color 0F");
// player.exp+=100000;
// player.money+=100000;
// Boss1=Boss2=Boss3=Boss4=1,shop1=shop2=shop3=1;
x="欢迎来到 冒险世界~ \( ̄▽ ̄)[▊\n\n伟大的作者大大:";
slowplay();
color(4);
x="Crab_Dave";
slowplay();
color(1);
x="<( ̄ˇ ̄)/\n\n版本号 2.2啦~:\n";
slowplay();
printf("1.调整了部分怪物信息(这句话当然是套话啦( ̄▽ ̄)...)\n");
color(4);
printf("2.(o゜▽゜)o☆超大幅度更新!!!\n(老夫这辈子都没更过这么多qwq...)\n");
color(6);
printf("3.(o゜▽゜)o☆作者之家部分开放!!!\n");
color(1);
printf("4.修复了部分bug(这句话当然也是套话啦( ̄▽ ̄)...)\n5.咕乃Crab_Dave之本性,咕咕咕...\n\n");
system("pause");
yy:
system("cls");
x="请问你要干什么( ̄_ ̄)\n";
slowplay();
printf("1.读取存档(如果你没有存档就别闹!!!)\n2.新的开始\n");
gets(s);
if(strcmp(s,"1")==0)
{
system("cls");
Read();
for(int i=1;i<=100;i++)printf("\rReading......%d%",i),Sleep(2);
printf("\rReading......Complete!");
Sleep(700);
if(co)system("color 0E");
}
else if(strcmp(s,"2")==0)
{
system("cls");
x="Please Enter Your Name Here:\n-------+++++++=======+++++++-------\n";
fastplay();
gets(player.name);
x="-------+++++++=======+++++++-------\n";
fastplay();
x="好的,";
slowplay();
x=player.name;
slowplay();
x=",出发吧!自由冒险!";
slowplay();
Sleep(500);
system("cls");
x="Loading......";
slowplay();
for(int i=1;i<=100;i++)printf("\rLoading......%d%",i),Sleep(2);
Sleep(500);
}
else
{
printf("输入错误!\n");
goto yy;
}
while(Exit)
{
move();
}
system("cls");
x="好吧,再见QAQ...\n";
slowplay();
x="退出中...";
slowplay();
Sleep(1000);
}
if(xx=='2'){
jiazai(50);
gaiziti(14);
//世界准备
system("mode con cols=160 lines=50");
srand(time(0));
HideCursor();
SetConsoleTitle("我的世界 0.8_v4");
cundang:
cout << "minecraft: 我的世界" << endl;
cout << "1 使用原先存档" << endl;
cout << "2 重置新的世界" << endl;
cout << "3 查看更新日志" << endl;
cout << "4 新手教程(";
Color(5), cout << "新人必看";
Color(0), cout << ")" << endl;
cout << "5 设置" << endl;
cout << "版本: 测试版0.8_v4" << endl;
char n = input('1', '5');
if(n == '5')
{
cout << endl;
cout << "1~5 调整字体(普通为3级)" << endl;
cout << "6 开关黑白模式" << endl;
char x = input('1', '6');
switch(x - '0')
{
case 1:
gaiziti(11);
break;
case 2:
gaiziti(12);
break;
case 3:
gaiziti(14);
break;
case 4:
gaiziti(16);
break;
case 5:
gaiziti(17);
break;
case 6:
dark = !dark;
break;
}
goto cundang;
}
else if(n == '1') input_data();
else if(n == '2')
{
cout << "世界种子:(数字 输入0以随机选择)" << endl;
int zhongzi;
cin >> zhongzi;
if(zhongzi != 0) srand(zhongzi);
cout << "选择模式:" << endl;
cout << "1 生存:" << endl;
cout << " 挖掘 战斗 成为英雄!" << endl;
cout << "2 创造:" << endl;
cout << " 建造 规划 成为上帝!" << endl;
cout << "3 极限:" << endl;
cout << " 求生 变强 成为王者!" << endl;
char m = input('1', '3');
if(m == '1') gamemode = 0;
else if(m == '2') gamemode = 1;
else gamemode = 2;
system("cls");
SetPos(0, 0);
cout << "Map 地图生成中 0%" << endl;
init();
cout << "50%" << endl;
print_data();
cout << "100%" << endl;
system("cls");
srand(time(0));
}
else if(n == '3')
{
system("cls");
cout << "更新日志" << endl;
int page = 1, pagemax = 3;
while(1)
{
Color(0);
system("cls");
cout << "A 上一页 D 下一页 E退出" << endl;
cout << page << '/' << pagemax << "页" << endl;
if(page == 1)
{
Color(6), cout << "(1) 0.6pre1" << endl;
Color(6), cout << "(2) 0.6pre2" << endl;
Color(5), cout << "(3) 0.6" << endl;
Color(6), cout << "(4) 0.7pre1" << endl;
Color(6), cout << "(5) 0.7pre2" << endl;
Color(6), cout << "(6) 0.7pre3" << endl;
Color(6), cout << "(7) 0.7pre4" << endl;
Color(5), cout << "(8) 0.7" << endl;
Color(5), cout << "(9) 0.7a" << endl;
}
else if(page == 2)
{
Color(5), cout << "(1) 0.7b" << endl;
Color(5), cout << "(2) 0.7c" << endl;
Color(6), cout << "(3) 0.8pre1" << endl;
Color(6), cout << "(4) 0.8pre1.1" << endl;
Color(6), cout << "(5) 0.8pre1.2" << endl;
Color(6), cout << "(6) 0.8pre2" << endl;
Color(6), cout << "(7) 0.8pre2.1" << endl;
Color(5), cout << "(8) 0.8_v1" << endl;
Color(5), cout << "(9) 0.8_v2" << endl;
}
else if(page == 3)
{
Color(5), cout << "(1) 0.8_v2.1" << endl;
Color(5), cout << "(2) 0.8_v2.2" << endl;
Color(5), cout << "(3) 0.8_v2.3" << endl;
Color(5), cout << "(4) 0.8_v2.4" << endl;
Color(5), cout << "(5) 0.8_v2.5" << endl;
Color(5), cout << "(6) 0.8_v3" << endl;
Color(5), cout << "(7) 0.8_v3.1" << endl;
Color(5), cout << "(8) 0.8_v3.2" << endl;
Color(5), cout << "(9) 0.8_v4" << endl;
}
char n = input();
if(n == 'a')
{
if(page != 1) page--;
}
else if(n == 'd')
{
if(page != pagemax) page++;
}
else if(n >= '1' && n <= '9')
{
if(page == 1)
{
switch(n)
{
case '1':
Color(6), cout << "内部版0.6pre1" << endl, Color(0);
cout << "- 更新2种新的效果" << endl;
cout << "- 更新4种新的方块" << endl;
cout << "- 新增更新日志栏" << endl;
cout << "- 更新血量栏的颜色" << endl;
system("pause");
system("cls");
break;
case '2':
Color(6), cout << "内部版0.6pre2" << endl, Color(0);
cout << "- 更新1个新的配方栏" << endl;
cout << "- 使药水配方能够合成" << endl;
cout << "- 修改属性界面" << endl;
cout << "- 修改日志界面" << endl;
cout << "- 使桶能够收集流体" << endl;
cout << "- 修复一些漏洞" << endl;
system("pause");
system("cls");
break;
case '3':
Color(5), cout << "测试版0.6" << endl, Color(0);
cout << "- 更新2个新的命令" << endl;
cout << "- 新增命令系统" << endl;
cout << "- 修复一些漏洞" << endl;
system("pause");
system("cls");
break;
case '4':
Color(6), cout << "内部版0.7pre1" << endl, Color(0);
cout << "- 更新4个方块 5个物品" << endl;
cout << "- 增加结构 海之环" << endl;
cout << "- 扩大地图(与之前存档不兼容)" << endl;
system("pause");
system("cls");
break;
case '5':
Color(6), cout << "内部版0.7pre2" << endl, Color(0);
cout << "- 更新海洋合成专区" << endl;
cout << "- 新增Z键键位提示" << endl;
cout << "- 修复一些漏洞" << endl;
system("pause");
system("cls");
break;
case '6':
Color(6), cout << "内部版0.7pre3" << endl, Color(0);
cout << "- 修改游戏名称" << endl;
system("pause");
system("cls");
break;
case '7':
Color(6), cout << "内部版0.7pre4" << endl, Color(0);
cout << "- 修复一些漏洞" << endl;
system("pause");
system("cls");
break;
case '8':
Color(5), cout << "测试版0.7" << endl, Color(0);
cout << "- 修改give命令" << endl;
cout << "- 新增1个命令" << endl;
cout << "- 修改主界面" << endl;
cout << "- 重置存档时允许输入种子" << endl;
cout << "- 修复一些漏洞" << endl;
system("pause");
system("cls");
break;
case '9':
Color(5), cout << "测试版0.7a" << endl, Color(0);
cout << "- 修改提升了程序的兼容性" << endl;
system("pause");
system("cls");
break;
default:
break;
}
}
else if(page == 2)
{
switch(n)
{
case '1':
Color(5), cout << "测试版0.7b" << endl, Color(0);
cout << "- 修复了0.7pre1以来致命的错误(错误发现者 武意程先生)" << endl;
system("pause");
system("cls");
break;
case '2':
Color(5), cout << "测试版0.7c" << endl, Color(0);
cout << "- 增加了几种新的树" << endl;
system("pause");
system("cls");
break;
case '3':
Color(6), cout << "内部版0.8pre1" << endl, Color(0);
cout << "- 全新结构:于苗神殿登场!" << endl;
cout << "- 全新结构:宝藏岛登场!" << endl;
cout << "- 下界地形优化:不再填满方块!" << endl;
cout << "- 新增多个物品、方块" << endl;
cout << "- 新增等级系统" << endl;
cout << "- 其它一些小改动or小优化" << endl;
system("pause");
system("cls");
break;
case '4':
Color(6), cout << "内部版0.8pre1.1" << endl, Color(0);
cout << "- 宝藏探测器的一点小更改" << endl;
cout << "- 补上了0.8pre1漏掉的一个小改动" << endl;
cout << "- 等级系统BUG修复" << endl;
system("pause");
system("cls");
break;
case '5':
Color(6), cout << "内部版0.8pre1.2" << endl, Color(0);
cout << "- 大整改!!!" << endl;
cout << "- 爆炸更新:添加了巨大的爆炸系统!" << endl;
cout << "- 指令更新:增加了许多种指令!" << endl;
cout << "- 伤害更新:大幅提升了高伤害时的减免!" << endl;
cout << "- 经验更新:经验等级现在与生命值和挖掘速度挂钩!" << endl;
cout << "- BUG 修改:修改了许多BUG !" << endl;
system("pause");
system("cls");
break;
case '6':
Color(6), cout << "内部版0.8pre2" << endl, Color(0);
cout << "- 修改代码结构" << endl;
system("pause");
system("cls");
break;
case '7':
Color(6), cout << "内部版0.8pre2.1" << endl, Color(0);
cout << "- 灵魂套前导预告:灵魂地牢" << endl;
cout << "- 灵魂地牢:大型地牢结构(好吧没多大),内部含有珍贵魂石" << endl;
system("pause");
system("cls");
break;
case '8':
Color(5), cout << "测试版0.8_v1" << endl, Color(0);
cout << "- 灵魂地牢更新:" << endl;
cout << "- 地牢扩大,增加死水池" << endl;
cout << "- 预计地牢在接下来几个版本里将会持续扩张" << endl;
cout << "- 修复了死亡后重生在地底的BUG" << endl;
cout << "- 新增一个修改氧气值的指令" << endl;
cout << "- 更改伤害指令的死亡信息" << endl;
system("pause");
system("cls");
break;
case '9':
Color(5), cout << "测试版0.8_v2" << endl, Color(0);
cout << "- 灵魂地牢更新:" << endl;
cout << "- 地牢再一次扩大 增加了几个目前没用的房间" << endl;
cout << "- 地牢石和魂石的硬度大幅提升 成为目前可以破坏的最坚硬的物质" << endl;
cout << "- 新增灵魂装备 目前灵魂装备是全游戏最强的装备" << endl;
cout << "- 修改了合成中的一些BUG" << endl;
cout << "- BETA测试专属功能:x=1200格下方必生成灵魂地牢" << endl;
cout << "- 修复了日志栏一直跳转不显示目录的BUG" << endl;
system("pause");
system("cls");
break;
default:
break;
}
}
else if(page == 3)
{
switch(n)
{
case '1':
Color(5), cout << "测试版0.8_v2.1" << endl, Color(0);
cout << "- 改了一下生成 现在不会卡崩了" << endl;
cout << "- 船新新手教程 基础操作手把手指引!" << endl;
system("pause");
system("cls");
break;
case '2':
Color(5), cout << "测试版0.8_v2.2" << endl, Color(0);
cout << "- 改摔伤 降低了摔落伤害 同时修复了单次坠落格数过高时无法再跳跃的问题" << endl;
cout << "- 修改了硬度系统 增高降低了某些方块的硬度 调高了一些镐子的挖掘速度" << endl;
cout << "- 增大了海之环" << endl;
system("pause");
system("cls");
case '3':
Color(5), cout << "测试版0.8_v2.3" << endl, Color(0);
cout << "- 修改宝藏岛 让它的生成变得更难" << endl;
cout << "- 增加了未完成的下界要塞:生成机制重做中" << endl;
system("pause");
system("cls");
case '4':
Color(5), cout << "测试版0.8_v2.4" << endl, Color(0);
cout << "- 现在可以在方块栏挖掘方块了" << endl;
cout << "- 修复了无法丢弃方块的BUG" << endl;
system("pause");
system("cls");
case '5':
Color(5), cout << "测试版0.8_v2.5" << endl, Color(0);
cout << "- 增加实体系统 但是仍然处于测试状态" << endl;
cout << "- 增加“守卫”BOSS 需要指令召唤(但是超强)" << endl;
cout << "- 一些我也说不清的小改动" << endl;
cout << "- 箱子的测试版 但是还没有GUI" << endl;
system("pause");
system("cls");
case '6':
Color(5), cout << "测试版0.8_v3" << endl, Color(0);
cout << "- BOSS系统调试完成 准备迎接强大的挑战吧!!!" << endl;
cout << "- 更新了新的TNT爆炸系统" << endl;
cout << "- 更新了新的Tick流逝系统" << endl;
cout << "- 修改了BOSS激光的机制" << endl;
cout << "- 增加了一些合成表" << endl;
cout << "- 修改了摔落和跳跃的机制" << endl;
cout << "- 【一次大规模更新,迎接新的世界吧!】" << endl;
system("pause");
system("cls");
case '7':
Color(5), cout << "测试版0.8_v3.1" << endl, Color(0);
cout << "- 修改了一下" << endl;
system("pause");
system("cls");
case '8':
Color(5), cout << "测试版0.8_v3.2" << endl, Color(0);
cout << "- 新增BOSS掉落物" << endl;
system("pause");
system("cls");
case '9':
Color(5), cout << "测试版0.8_v4" << endl, Color(0);
cout << "- 更新了【箱子】的存取GUI,使得游戏步入物品/方块无限制阶段!" << endl;
cout << "- 小小的修改了一些东西" << endl;
cout << "- 更新了黑白模式,适合……某些场景" << endl;
system("pause");
system("cls");
default:
break;
}
}
}
else if(n == 'e')
{
system("cls");
goto cundang;
}
}
}
else if(n == '4')
{
system("cls");
jiaocheng();
}
minecraft();
}
if(xx=='1'){
jiazai(30);
// cout<<"是否有存档?\n";
// char ooo;
// cin>>ooo;
// if(ooo=='y'){
// ifstream fin("data.txt", ios::in);
// for(int i=0;i<8;i++){
// for(int j=0;j<a[i].size();j++){
// fin>>a[i][j];
// }
// }
// }
sbsb:;
cnt=0;
int x=3,y=1,s=0,nn=9;
cnt=0;
while(1){
// if(cnt==4){
// cout<<"游戏结束!!!";
// break;
// }
cout<<"现在是第"<<cnt+1<<"关\n";
cout<<"共有"<<s<<"次复活机会\n";
char ch;
int len=yyy[0].size();
for(int i=max(x-3,0);i<min(x+3,57);i++){
for(int j=max(y-3,0);j<min(y+3,len);j++){
if(i==x&&j==y){
cout<<"o";
}
else cout<<yyy[i][j];
}
cout<<"\n";
}
ch=_getch();
if(ch=='w'&&yyy[x-1][y]!='|'&&yyy[x-1][y]!='_') x--;
if(ch=='s'&&yyy[x+1][y]!='|'&&yyy[x][y]!='_') x++;
if(ch=='a'&&yyy[x][y-1]!='|') y--;
if(ch=='d'&&yyy[x][y+1]!='|') y++;
if(yyy[x][y]=='+') s++,yyy[x][y]='_';
if(yyy[x][y]=='s') s--,yyy[x][y]='_',x=3,y=1;
if(s<0){
cout<<"你失败了!!!";
Sleep(8000);
cout<<"是否在玩一次?";
char xxxx;
cin>>xxxx;
system("cls");
if(xxxx=='y') goto sbsb;
else break;
}//28,108
if(yyy[x][y]=='%') s+=3,yyy[x][y]=' ';
if(yyy[x][y]=='?') cout<<"咦?这是什么?...是传送门!!!即将传送至地狱!!!要多加小心!!!",Sleep(3000),x=30,y=108;
if(yyy[x][y]=='z') cout<<"恭喜通关!!!即将进入下一关!",cnt++,Sleep(1000),yyy[x][y]='+';
if(yyy[x][y]=='O') s=-1;
if(yyy[x][y]=='*') cout<<"咦?这是什么?...是传送门!!!即将传送至天堂!!!(幸存者公园)",Sleep(3000),x=1,y=19;
if(yyy[x][y]=='T'){
cout<<"咦?这是什么?...是高等传送门!!!即将传送至一个新的迷宫世界!!!要多加小心!!!";
//system("cls");
for(int i=1;i<=10010;i++) yyy[i]=zzz[i];
}
system("cls");
}
}
if(xx=='3'){
jiazai(10);
t:;
srand(time(NULL));
int s=rand()%100;
while(1){
int xx;
cout<<"猜一个0~100的数!\n";
cin>>xx;
system("cls");
if(xx>s) cout<<"大了!";
else if(xx<s) cout<<"小了!";
else{
char xxx;
cout<<"恭喜你猜对了!\n";
cout<<"是否再来一次?(y/n)\n";
cin>>xxx;
if(xxx=='y'){
system("cls");
goto t;
}
else break;
}
Sleep(2000);
system("cls");
}
}
if(xx=='4'){
jiazai(5);
rrrr:;
int f=0;
for(int i=1;i<=10;i++){
srand(time(NULL));
int s=rand()%22;
cout<<gg[s]<<"\n";
char xxxx;
xxxx=_getch();
system("cls");
//if(xxxx==gg[s]) cout<<"对了!";
if(xxxx!=gg[s]){
cout<<"失败!!!";
f=1;
break;
}
//Sleep(1000);
system("cls");
}
if(f==0)cout<<"恭喜通关!是否继续?(y/n)\n";
else cout<<"失败!!!是否再玩一次???\n";
system("cls");
int xxx;
cin>>xxx;
if(xxx=='y') goto rrrr;
}
if(xx==5){
jiazai(25);
baoda();
}
}
char xe;
cout<<"是否重新命令我?(y/n)\n";
xe=_getch();
system("cls");
if(xe=='y'){goto d;}
return 0;
}多功能游戏机(内含转载)
这是 2025年10月3日 存档的第 1 版,不是当前版本。查看当前版本