//转自:https://www.luogu.com.cn/team/32221#main
//收藏者的温馨提示:部分情节作者没有更完就咕咕咕啦
//如果你编译报错,请点击工具-编译选项-勾选编译时加入以下命令,在下面的框中输入:-std=c++11,确定即可
#include <iostream>
#include <string>
#include <windows.h>
#include <conio.h>
#include <fstream>
#include <ctime>
#include <time.h>
#include <stdio.h>
using namespace std;
struct thing
{
string type;
string name;
int attack;
int defense;
int health;
int num;
bool disposable;
int sharp;
int durability;
};
struct w
{
string name;
string b[100];
int bnum;
};
int health = 1000, maxhealth = 1000, defense = 10, attack = 100;
int capacity = 0;
string name;
int nowway = 0, water = 0, maxwater = 10;
int bagi = 1, protectlevel;
string protect;
string canmakething[1000] = {
"退出","木剑","木斧","木镐","工作台" };
int canmakethingi = 5;
string f[100] = {
{
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"},
{
"+..................................................................................................+"},
{
"+..................................................................................................+"},
{
"+.........+............................................K...........................................+"},
{
"+.......FV+........................................................................................+"},
{
"+...................F..........T...................................................................+"},
{
"+........+................+.............+.............V.......................CF...................+"},
{
"+.......+..........................................................................................+"},
{
"+.............................................................+.H.+..............B.................+"},
{
"+......F.......+.......+............V............................+.................................+"},
{
"+...............V....+...............................................................Y.............+"},
{
"+....................F+.......+++............++....................................................+"},
{
"+.............................+C+.......o....I+.....o...................S..........F...............+"},
{
"+..........................................+++.....................................................+"},
{
"+.............................+.........................V..........................................+"},
{
"+.........Y...........H......+..........o.......+..A...........+...................................+"},
{
"+...........................+..................o+............++....G..............YV...............+"},
{
"+.....................................................+......+.I...................................+"},
{
"+......................+++.......................+++..........+....................................+"},
{
"+.....................+..U+......................V........+....+.............Y.....................+"},
{
"+.......H...........++...++........................................................................+"},
{
"+.......................+Y................++...................M...................................+"},
{
"+......................................+...G+...........T..........................................+"},
{
"+...H..............W............................................................Y..................+"},
{
"+..................................................................................................+"},
{
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"},
};
bool isf[100][100];
int movex[4] = {
0,-1,0,1 };
int movey[4] = {
-1,0,1,0 };
//H巨坑 I铁矿 C煤矿 G金矿 o小镇 Y城市 V洞穴 S飞船 F战场 M沼泽 T钛矿 P前哨 B硫磺矿 K军事基地
int Outpostx[100], opxi = 0;
int Outposty[100], opyi = 0;
w way[100] = {
{
"池塘",{
"进入森林","背包","状态","装备","制作"}, 5},
{
"帮助&设置",{
"制造配方"},1}
};
int waynum = 2;
bool isw[100] = {
true, false, false };
bool isb[100] = {
true, false, false };
thing nowaxe, nowpickaxe, nowweapon, nowhoe;
thing bag[1000] = {
{
"退出","退出",0,0,0,0,false},
};
string outbutton()
{
char c;
int now = 0;
for (int i = 0; i < 100; i++)
{
if (isb[i] == true)
{
now = i;
}
}
while (1)
{
system("cls");
for (int i = 0; way[i].name != ""; i++)
{
if (isw[i] == true)
{
cout << "*" << way[i].name << "*";
}
else
{
cout << " " << way[i].name << " ";
}
}
cout << endl;
for (int i = 0; way[nowway].b[i] != ""; i++)
{
if (isb[i] == true)
{
cout << ">" << way[nowway].b[i] << "<" << endl;
}
else
{
cout << " " << way[nowway].b[i] << " " << endl;
}
}
c = _getch();
if (c == 'w' && now > 0)
{
isb[now] = false;
isb[now - 1] = true;
now -= 1;
}
if (c == 's' && way[nowway].b[now + 1] != "")
{
isb[now] = false;
isb[now + 1] = true;
now += 1;
}
if (c == 'a' && nowway > 0)
{
isw[nowway] = false;
isw[nowway - 1] = true;
nowway -= 1;
isb[now] = false;
isb[0] = true;
}
if (c == 'd' && way[nowway + 1].name != "")
{
isw[nowway] = false;
isw[nowway + 1] = true;
nowway += 1;
isb[now] = false;
isb[0] = true;
}
if (c == 32)
{
return way[nowway].b[now];
}
}
return "";
}
string outbag()
{
char c;
int now = 0;
bool isbag[1000] = {
true, false };
while (1)
{
system("cls");
for (int i = 0; bag[i].name != ""; i++)
{
if (isbag[i] == true)
{
cout << ">" << bag[i].name << "<";
}
else
{
cout << " " << bag[i].name << " ";
}
for (int j = 0; j < 20 - bag[i].name.size() - to_string(bag[i].num).size(); j++)
{
cout << " ";
}
cout << bag[i].num << " " << bag[i].durability << endl;
}
c = _getch();
if (c == 'w' && now > 0)
{
isbag[now] = false;
isbag[now - 1] = true;
now -= 1;
}
if (c == 's' && bag[now + 1].name != "")
{
isbag[now] = false;
isbag[now + 1] = true;
now += 1;
}
if (c == 32)
{
return bag[now].name;
}
}
return 0;
}
bool skills[10];//勘察术 美食家 矿工 收集家 野蛮人 战士 铠甲人 医生 忍者
int fight(string hn, int hmh, int ha, int hd, int hh)
{
while (1)
{
if (nowweapon.type == "剑") cout << "1,扎刺";
else if (nowweapon.type == "刀") cout << "1,劈砍";
else if (nowweapon.type == "机枪") cout << "1,扫射";
else if (nowweapon.type == "手枪") cout << "1,射击";
else if (nowweapon.type == "") cout << "1,拳击";
bool is1 = false, is2 = false, is3 = false;
int i1, i2, i3;
for (int i = 0; i < 1000; i++)
{
if (bag[i].name == "手雷" && bag[i].num != 0)
{
cout << " 2,丢出[" << bag[i].num << "]";
is1 = true;
i1 = i;
break;
}
}
for (int i = 0; i < 1000; i++)
{
if (bag[i].name == "长矛" && bag[i].num != 0)
{
cout << " 3,投掷[" << bag[i].num << "]";
is2 = true;
i2 = i;
break;
}
}
for (int i = 0; i < 1000; i++)
{
if (bag[i].name == "熏肉" && bag[i].num != 0)
{
cout << " 4,吃肉[" << bag[i].num << "]";
is3 = true;
i3 = i;
break;
}
}
if (skills[7])
{
cout << "5,医治";
}
string which;
cin >> which;
int bullet = 0, missile = 0;
for (int i = 0; i < 1000; i++)
{
if (bag[i].name == "子弹")
{
bullet = bag[i].num;
}
if (bag[i].name == "导弹")
{
missile = bag[i].num;
}
else if (bag[i].name == "")
{
break;
}
}
if (which == "1")
{
if (nowweapon.type == "剑" || nowweapon.type == "刀" || nowweapon.type == "")
{
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "] @ E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "] @ E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "] @ E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "] @ E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "] @ E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "] @ E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "] @ E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "] @E[" << hh << "/" << hmh << "]";
if (skills[5]) hh -= (attack + nowweapon.attack) * 2 - hd;
else hh -= attack + nowweapon.attack - hd;
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "] @ E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "] @ E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "] @ E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ E[" << hh << "/" << hmh << "]";
}
else if (nowweapon.name == "激光步枪" || bullet > 0 || (nowweapon.name == "火箭筒" && missile > 0))
{
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@o E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ o E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ o E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ o E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ o E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ o E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ o E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ oE[" << hh << "/" << hmh << "]";
if (skills[5]) hh -= (attack + nowweapon.attack) * 2 - hd;
else hh -= attack + nowweapon.attack - hd;
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ E[" << hh << "/" << hmh << "]";
}
else if (bullet <= 0 || (nowweapon.name == "火箭筒" && missile <= 0))
{
MessageBox(0, TEXT("没弹药了..."), TEXT("重要提示"), MB_OK);
}
}
else if (which == "2" && is1)
{
hh -= 500;
system("cls");
cout << "砰!";
Sleep(1000);
system("cls");
cout << "[" << health << "/" << maxhealth << "]@ E[" << hh << "/" << hmh << "]";
bag[i1].num--;
}
else if (which == "3" && is2)
{
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@> E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@-> E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ -> E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ -> E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ -> E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ -> E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ -> E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ ->E[" << hh << "/" << hmh << "]";
hh -= 200 - hd;
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ E[" << hh << "/" << hmh << "]";
bag[i2].num--;
}
else if (which == "4" && is3)
{
if (skills[2])
{
cout << "生命+1000";
health += 1000;
if (health > maxhealth)
{
health = maxhealth;
}
}
else
{
cout << "生命+500";
health += 500;
if (health > maxhealth)
{
health = maxhealth;
}
}
bag[is3].num--;
}
else if (which == "5" && skills[7])
{
cout << "生命+1500";
health += 1500;
if (health > maxhealth)
{
health = maxhealth;
}
}
if (hh <= 0)
{
cout << "对方死亡";
Sleep(1000);
return 1;
}
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ E[" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ E [" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ E [" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ E [" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ E [" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ E [" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ E [" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ E [" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@E [" << hh << "/" << hmh << "]";
if (skills[8])
{
if (rand() % 3 == 2) health -= ha + -defense;
}
else if (rand() % 2) health -= ha + -defense;
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ E [" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ E [" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ E [" << hh << "/" << hmh << "]";
Sleep(10);
system("cls");
cout << "\n\n\n\n\n";
cout << "[" << health << "/" << maxhealth << "]@ E[" << hh << "/" << hmh << "]";
Sleep(1000);
cout << endl;
if (health <= 0)
{
cout << "你死亡";
Sleep(1000);
return 0;
}
}
return 0;
}
void slowly(const char* p)
{
while (1)
{
if (*p != 0)
{
printf("%c", *p++);
}
else
{
break;
}
Sleep(75);
}
}
int welcome()
{
cout << "野外生存1.1.0 (不支持存档)" << endl;
cout << "" << endl;
cout << "" << endl;
cout << "" << endl;
cout << "" << endl;
cout << " 本页面会持续更新... " << endl;
cout << "" << endl;
cout << "" << endl;
cout << "" << endl;
cout << "" << endl;
_getch();
return 0;
}
int start()
{
system("cls");
cout << "□□□□□□■□□□□□□□□□□□□□□□□□□□□□" << endl;
cout << "□□□□□□■■□□□□□□□□□□□□□□□□□■□□" << endl;
cout << "□□□□□□■■■□□□□□□□□□□□□□□□■■□□" << endl;
cout << "□□□■■■■■■■■■■■■■■■□□□□■■■■□□" << endl;
cout << "□□■□■□■□■□■□■□■□■□■■■■■■■■□□" << endl;
cout << "□□□■■■■■■■■■■■■■■■■■■■■■■□□□" << endl;
cout << "□□□□□□□□■■■■■□□□□□□□□□□□□□□□" << endl;
cout << "□□□□□□□□□■■■■■□□□□□□□□□□□□□□" << endl;
cout << "□□□□□□□□□□□■■■□□□□□□□□□□□□□□" << endl;
cout << "□□□□□□□□□□□□■■■□□□□□□□□□□□□□" << endl;
cout << "□□□□□□□□□□□□□■■■□□□□□□□□□□□□" << endl;
slowly("一天,你坐着飞机,正打算去美国...");
Sleep(1000);
system("cls");
cout << "□□□□□□■□□□□□□□□□□□□□□□□□□□□□" << endl;
cout << "□□□□□□■■□□□□□□□□□□□□□□□□□■□□" << endl;
cout << "□□□□□□■■■□□□□□□□□□□□□□□□■■□□" << endl;
cout << "□□□■■■■■■■■■■■■■■■□□□□■■■■□□" << endl;
cout &l
c++野外生存
最新推荐文章于 2025-04-22 20:52:25 发布