跳到正文

个人记录

3231

GDM114514约 95 分钟
原文
文章信息与版本

文章信息

发布
2024年4月9日
收录
2026年7月1日
更新
2026年10月31日
篇幅
约 95 分钟

版本

  1. v1当前

//如果你编译172行报错,请点击工具-编译选项-勾选编译时加入以下命令,在下面的框中输入:-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() {

C++
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 << ”□□■□■□■□■□■□■□■□■□■■■■■■■■□□” << 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 << ”□□■□■□■□■□■□■□■□■□■■■■■■■■□□” << 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 << ”□□□□□□□□□■■■■■■■■□□□□□□□□□□□” << endl; cout << ”□□□□□□□□□□■■■■■■□□□□□□□□□□□□” << endl; cout << ”□□□□□□□□□□□□■■□□□□□□□□□□□□□□” << endl; cout << ”□□□□□□□□□□□□□□□□□□□□□□□□□□□□” << endl; slowly(“一秒钟后,飞机开始往下坠落”); Sleep(1000); system(“cls”); cout << ”□□□□□□□□□□□□□□□□□□□□□□□□□□□□” << endl; cout << ”□□□□□□□□□□□■■■■□□□□□□□□□□□□□” << endl; cout << ”□□□□□□□□□■■■■■■■■□□□□□□□□□□□” << endl; cout << ”□□□□■■■■■■□□■■□□■■■■■■□□□□□□” << endl; cout << ”□□□□□□□□□■■■■■■■■□□□□□□□□□□□” << endl; cout << ”□□□□□□□□□□■■■■■■□□□□□□□□□□□□” << endl; cout << ”□□□□□□□□□□□□■■□□□□□□□□□□□□□□” << endl; cout << ”□□□□□□□□□□□□□□□□□□□□□□□□□□□□” << endl; slowly(“行李架上的行李掉了下来,砸中了你,你眼前一黑,昏了过去…”); Sleep(1000); system(“cls”); Sleep(3000); slowly(“醒来后,你发现你躺在一个池塘边,靠着石头。”); getch(); return 0; } bool isinto = false; int town(int y, int x) { system(“cls”); cout << ” 小镇_” << endl; cout << “|是否进入 |” << endl; cout << ”|(y/n) |” << endl; cout << ”||” << endl; char c; cin >> c; if (c == ‘y’) { system(“cls”); cout << “一个村民手拿大刀,拦在了入口处” << endl; _getch(); if (!fight(“村民”, 1000, 100, 10, 1000)) { system(“cls”); slowly(“眼前的世界烟消云散…”); Sleep(1000); return 0; } system(“cls”); int xunrou = rand() % 3, changmao = rand() % 2, rou = rand() % 5; cout << “掉落:” << endl; cout << “1,熏肉*” << xunrou << endl; cout << “2,肉*” << rou << endl; cout << “3,长矛*” << changmao << endl; for (int j = 0; j < 1000; j++) { if (bag[j].name == “熏肉”) { bag[j].num += xunrou; break; } if (bag[j].name == "" && xunrou != 0) { bag[j] = { “食物”,“熏肉”,0,0,0,xunrou,false,0 }; break; } } for (int j = 0; j < 1000; j++) { if (bag[j].name == “肉”) { bag[j].num += rou; break; } if (bag[j].name == "" && rou != 0) { bag[j] = { “食物”,“肉”,0,0,0,rou,false,0 }; break; } } for (int j = 0; j < 1000; j++) { if (bag[j].name == “长矛”) { bag[j].num += changmao; break; } if (bag[j].name == "" && changmao != 0) { bag[j] = { “武器”,“长矛”,0,0,0,changmao,false,0 }; break; } } getch(); system(“cls”); cout << “另一个村民手拿着长矛,跑了过来” << endl; getch(); if (!fight(“村民”, 1000, 100, 10, 1000)) { system(“cls”); slowly(“眼前的世界烟消云散…”); Sleep(1000); return 0; } int pimao = rand() % 3, buliao = rand() % 5; rou = rand() % 5; cout << “掉落:” << endl; cout << “1,皮毛*” << pimao << endl; cout << “2,肉*” << rou << endl; cout << “3,布料*” << changmao << endl; for (int j = 0; j < 1000; j++) { if (bag[j].name == “皮毛”) { bag[j].num += pimao; break; } if (bag[j].name == "" && pimao != 0) { bag[j] = { “物品”,“皮毛”,0,0,0,pimao,false,0 }; break; } } for (int j = 0; j < 1000; j++) { if (bag[j].name == “肉”) { bag[j].num += rou; break; } if (bag[j].name == "" && rou != 0) { bag[j] = { “食物”,“肉”,0,0,0,rou,false,0 }; break; } } for (int j = 0; j < 1000; j++) { if (bag[j].name == “布料”) { bag[j].num += buliao; break; } if (bag[j].name == "" && buliao != 0) { bag[j] = { “物品”,“布料”,0,0,0,buliao,false,0 }; break; } } getch(); system(“cls”); cout << “安静下来了” << endl; getch(); pimao = rand() % 3; buliao = rand() % 5; rou = rand() % 5; cout << “获得:” << endl; cout << “1,皮毛*” << pimao << endl; cout << “2,肉*” << rou << endl; cout << “3,布料*” << changmao << endl; for (int j = 0; j < 1000; j++) { if (bag[j].name == “皮毛”) { bag[j].num += pimao; break; } if (bag[j].name == "") { bag[j] = { “物品”,“皮毛”,0,0,0,pimao,false,0 }; break; } } for (int j = 0; j < 1000; j++) { if (bag[j].name == “肉”) { bag[j].num += rou; break; } if (bag[j].name == "") { bag[j] = { “食物”,“肉”,0,0,0,rou,false,0 }; break; } } for (int j = 0; j < 1000; j++) { if (bag[j].name == “布料”) { bag[j].num += buliao; break; } if (bag[j].name == "") { bag[j] = { “物品”,“布料”,0,0,0,buliao,false,0 }; break; } } getch(); slowly(“你离开了小镇…”); f[y][x] = ‘P’; Outpostx[opxi++] = x; Outposty[opyi++] = y; return 1; } else if (c != ‘n’) { town(y, x); } return 1; } int hole(int y, int x) { system(“cls”); cout << ” 巨坑” << endl; cout << “|是否进入 |” << endl; cout << ”|(y/n) |” << endl; cout << ”||” << endl; char c; cin >> c; if (c == ‘y’) { system(“cls”); cout << “外星人举起了枪…” << endl; getch(); fight(“外星人”, 10000, 1000, 100, 10000); int waixinghejin = rand() % 3 + 1, taihejin = rand() % 5 + 1, jiguangbuqiang = rand() % 3 + 1; cout << “掉落:” << endl; cout << “1,外星合金*” << waixinghejin << endl; cout << “2,钛合金*” << taihejin << endl; cout << “3,激光步枪*” << jiguangbuqiang << endl; bool isfind = false; for (int j = 0; j < 1000; j++) { if (bag[j].name == “外星合金”) { isfind = true; bag[j].num += waixinghejin; break; } if (bag[j].name == "" && !isfind) { bag[j] = { “材料”,“外星合金”,0,0,0,waixinghejin,false,0 }; break; } } for (int j = 0; j < 1000; j++) { if (bag[j].name == “钛合金”) { isfind = true; bag[j].num += taihejin; break; } if (bag[j].name == "" && !isfind) { bag[j] = { “材料”,“钛合金”,0,0,0,taihejin,false,0 }; break; } } for (int j = 0; j < 1000; j++) { if (bag[j].name == “激光步枪”) { isfind = true; bag[j].num += jiguangbuqiang; break; } if (bag[j].name == "" && !isfind) { bag[j] = { “武器”,“激光步枪”,0,0,0,jiguangbuqiang,false,0 }; break; } } getch(); system(“cls”); slowly(“你离开了巨坑…”); f[y][x] = ‘P’; Outpostx[opxi++] = x; Outposty[opyi++] = y; } else if (c != ‘n’) { hole(y, x); } return 0; } int iron(int y, int x) { system(“cls”); cout << ” 铁矿__” << endl; cout << “|是否进入 |” << endl; cout << ”|(y/n) |” << endl; cout << ”||” << endl; char c; cin >> c; if (c == ‘y’) { system(“cls”); cout << “野兽来袭…” << endl; getch(); fight(“野兽”, 5000, 500, 50, 5000); int tie = rand() % 3 + 1; cout << “掉落:” << endl; cout << “1,铁*” << tie << endl; bool isfind = false; for (int j = 0; j < 1000; j++) { if (bag[j].name == “铁”) { isfind = true; bag[j].num += tie; break; } if (bag[j].name == "" && !isfind) { bag[j] = { “材料”,“铁”,0,0,0,tie,false,0 }; break; } } getch(); system(“cls”); for (int i = 0; i < 100; i++) { if (way[i].name == “挖矿之路”) { way[i].b[way[i].bnum++] = “挖铁矿”; break; } if (way[i].name == "") { way[waynum++] = { “挖矿之路”,{“挖铁矿”},1 }; break; } } slowly(“你离开了铁矿…”); f[y][x] = ‘P’; Outpostx[opxi++] = x; Outposty[opyi++] = y; } else if (c != ‘n’) { iron(y, x); } return 0; } int coal(int y, int x) { system(“cls”); cout << ” 煤矿__” << endl; cout << “|是否进入 |” << endl; cout << ”|(y/n) |” << endl; cout << ”||” << endl; char c; cin >> c; if (c == ‘y’) { system(“cls”); cout << “野兽来袭…” << endl; getch(); fight(“野兽”, 7000, 300, 100, 7000); int mei = rand() % 3 + 1; cout << “掉落:” << endl; cout << “1,煤*” << mei << endl; bool isfind = false; for (int j = 0; j < 1000; j++) { if (bag[j].name == “煤”) { isfind = true; bag[j].num += mei; break; } if (bag[j].name == "" && !isfind) { bag[j] = { “材料”,“煤”,0,0,0,mei,false,0 }; break; } } getch(); system(“cls”); for (int i = 0; i < 100; i++) { if (way[i].name == “挖矿之路”) { way[i].b[way[i].bnum++] = “挖煤矿”; break; } if (way[i].name == "") { way[waynum++] = { “挖矿之路”,{“挖煤矿”},1 }; break; } } slowly(“你离开了煤矿…”); f[y][x] = ‘P’; Outpostx[opxi++] = x; Outposty[opyi++] = y; } else if (c != ‘n’) { coal(y, x); } return 0; } int gold(int y, int x) { system(“cls”); cout << ” 金矿__” << endl; cout << “|是否进入 |” << endl; cout << ”|(y/n) |” << endl; cout << ”||” << endl; char c; cin >> c; if (c == ‘y’) { system(“cls”); cout << “野兽来袭…” << endl; getch(); fight(“野兽”, 10000, 500, 70, 10000); int mei = rand() % 3 + 1; cout << “掉落:” << endl; cout << “1,金*” << mei << endl; bool isfind = false; for (int j = 0; j < 1000; j++) { if (bag[j].name == “金”) { isfind = true; bag[j].num += mei; break; } if (bag[j].name == "" && !isfind) { bag[j] = { “材料”,“金”,0,0,0,mei,false,0 }; break; } } getch(); system(“cls”); for (int i = 0; i < 100; i++) { if (way[i].name == “挖矿之路”) { way[i].b[way[i].bnum++] = “挖金矿”; break; } if (way[i].name == "") { way[waynum++] = { “挖矿之路”,{“挖金矿”},1 }; break; } } slowly(“你离开了金矿…”); f[y][x] = ‘P’; Outpostx[opxi++] = x; Outposty[opyi++] = y; } else if (c != ‘n’) { coal(y, x); } return 0; } int brenstone(int y, int x) { system(“cls”); cout << ” 硫磺矿” << endl; cout << “|是否进入 |” << endl; cout << ”|(y/n) |” << endl; cout << ”||” << endl; char c; cin >> c; if (c == ‘y’) { system(“cls”); cout << “野兽来袭…” << endl; _getch(); fight(“野兽”, 10000, 800, 10, 10000); int mei = rand() % 3 + 1; cout << “掉落:” << endl; cout << “1,硫磺*” << mei << endl; bool isfind = false; for (int j = 0; j < 1000; j++) { if (bag[j].name == “硫磺”) { isfind = true; bag[j].num += mei; break; } if (bag[j].name == "" && !isfind) { bag[j] = { “材料”,“硫磺”,0,0,0,mei,false,0 }; break; } } _getch(); system(“cls”); for (int i = 0; i < 100; i++) { if (way[i].name == “挖矿之路”) { way[i].b[way[i].bnum++] = “挖硫磺矿”; break; } if (way[i].name == "") { way[waynum++] = { “挖矿之路”,{“挖硫磺矿”},1 }; break; } } slowly(“你离开了金矿…”); f[y][x] = ‘P’; Outpostx[opxi++] = x; Outposty[opyi++] = y; } else if (c != ‘n’) { coal(y, x); } return 0; } int forest() { int x = 51, y = 14; char c; for (int i = 0; i < opxi; i++) f[Outposty[i]][Outpostx[i]] = ‘P’; while (1) { system(“cls”); cout << “水:” << water << ”/” << maxwater << endl; f[y][x] = ’@’; if (skills[0]) { isf[y + 3][x] = true; isf[y + 2][x + 1] = true; isf[y + 2][x] = true; isf[y + 2][x - 1] = true; isf[y + 1][x + 2] = true; isf[y + 1][x + 1] = true; isf[y + 1][x] = true; isf[y + 1][x - 1] = true; isf[y + 1][x - 2] = true; isf[y][x + 3] = true; isf[y][x + 2] = true; isf[y][x + 1] = true; isf[y][x] = true; isf[y][x - 1] = true; isf[y][x - 2] = true; isf[y][x - 3] = true; isf[y - 1][x + 2] = true; isf[y - 1][x + 1] = true; isf[y - 1][x] = true; isf[y - 1][x - 1] = true; isf[y - 1][x - 2] = true; isf[y - 2][x + 1] = true; isf[y - 2][x] = true; isf[y - 2][x - 1] = true; isf[y - 3][x] = true; } else { isf[y + 2][x] = true; isf[y + 1][x + 1] = true; isf[y + 1][x] = true; isf[y + 1][x - 1] = true; isf[y][x + 2] = true; isf[y][x + 1] = true; isf[y][x]; isf[y][x] = true; isf[y][x - 1] = true; isf[y][x - 2] = true; isf[y - 1][x + 1] = true; isf[y - 1][x] = true; isf[y - 1][x - 1] = true; isf[y - 2][x] = true; } for (int i = y - 20; i < y + 20; i++) { if (i < 0 || i > 25) { continue; } for (int j = x - 20; j < x + 20; j++) { if (j >= 0 && j <= 100) { if (isf[i][j]) { cout << f[i][j]; } else { cout << ” ”; } } } cout << endl; } c = _getch(); water—; if (water == 0) MessageBox(0, TEXT(“水喝完了”), TEXT(“重要提示”), MB_OK); if (water == -1) MessageBox(0, TEXT(“你感觉口干舌燥”), TEXT(“重要提示”), MB_OK); if (water == -2) { MessageBox(0, TEXT(“你倒在森林里…”), TEXT(“重要提示”), MB_OK); system(“cls”); slowly(“眼前的世界烟消云散…”); Sleep(1000); f[y][x] = ’.’; return 0; } int move = 4; if (c == ‘w’)move = 0; if (c == ‘a’)move = 1; if (c == ‘s’)move = 2; if (c == ‘d’)move = 3; if (move == 4) { continue; } if (f[y + movey[move]][x + movex[move]] == ‘o’) { if (!town(y + movey[move], x + movex[move])) { f[y][x] = ’.’; return 0; } } else if (f[y + movey[move]][x + movex[move]] == ‘H’) { if (!hole(y + movey[move], x + movex[move])) { f[y][x] = ’.’; return 0; } } else if (f[y + movey[move]][x + movex[move]] == ‘I’) { if (!iron(y + movey[move], x + movex[move])) { f[y][x] = ’.’; return 0; } } else if (f[y + movey[move]][x + movex[move]] == ‘C’) { if (!coal(y + movey[move], x + movex[move])) { f[y][x] = ’.’; return 0; } } else if (f[y + movey[move]][x + movex[move]] == ‘G’) { if (!gold(y + movey[move], x + movex[move])) { f[y][x] = ’.’; return 0; } } else if (f[y + movey[move]][x + movex[move]] == ‘P’) { f[y + movey[move]][x + movex[move]] = ’@’; f[y][x] = ’.’; y += movey[move]; x += movex[move]; MessageBox(0, TEXT(“水补充好了”), TEXT(“前方哨所”), MB_OK); water = maxwater; MessageBox(0, TEXT(“熏肉+7”), TEXT(“前方哨所”), MB_OK); for (int j = 0; j < 1000; j++) { if (bag[j].name == “熏肉”) { bag[j].num += 7; break; } if (bag[j].name == "") { bag[j] = { “食物”,“熏肉”,0,0,0,7,false,0 }; break; } } } else if (f[y + movey[move]][x + movex[move]] == ‘U’) { slowly(“你来到了一个村庄,是时候享用那些人留下的成绩了…”); int jiguangbuqiang, shoulai, daodan, zidan, buqiang, gang, tie, mei, waixinghejin, taihejin, huojiantong; jiguangbuqiang = rand() % 2 + 1; shoulai = rand() % 3 + 2; daodan = rand() % 3 + 1; zidan = rand() % 50 + 50; buqiang = rand() % 5 + 1; waixinghejin = rand() % 5 + 5; tie = rand() % 10 + 10; mei = rand() % 10 + 10; gang = rand() % 10 + 10; taihejin = rand() % 10 + 10, huojiantong = rand() % 2 + 1; for (int j = 0; j < 1000; j++) { if (bag[j].name == “激光步枪”) { bag[j].num += jiguangbuqiang; break; } if (bag[j].name == "") { bag[j] = { “机枪”,“激光步枪”,1000,0,0,jiguangbuqiang,false,0 }; break; } } for (int j = 0; j < 1000; j++) { if (bag[j].name == “手雷”) { bag[j].num += shoulai; break; } if (bag[j].name == "") { bag[j] = { “武器”,“手雷”,0,0,0,shoulai,false,0 }; break; } } for (int j = 0; j < 1000; j++) { if (bag[j].name == “导弹”) { bag[j].num += daodan; break; } if (bag[j].name == "") { bag[j] = { “武器”,“导弹”,0,0,0,daodan,false,0 }; break; } } for (int j = 0; j < 1000; j++) { if (bag[j].name == “子弹”) { bag[j].num += zidan; break; } if (bag[j].name == "") { bag[j] = { “武器”,“子弹”,0,0,0,zidan,false,0 }; break; } } for (int j = 0; j < 1000; j++) { if (bag[j].name == “火箭筒”) { bag[j].num += huojiantong; break; } if (bag[j].name == "") { bag[j] = { “机枪”,“火箭筒”,700,0,0,huojiantong,false,0 }; break; } } for (int j = 0; j < 1000; j++) { if (bag[j].name == “步枪”) { bag[j].num += buqiang; break; } if (bag[j].name == "") { bag[j] = { “机枪”,“步枪”,300,0,0,buqiang,false,0 }; break; } } for (int j = 0; j < 1000; j++) { if (bag[j].name == “钢”) { bag[j].num += gang; break; } if (bag[j].name == "") { bag[j] = { “材料”,“钢”,0,0,0,gang,false,0 }; break; } } for (int j = 0; j < 1000; j++) { if (bag[j].name == “铁”) { bag[j].num += tie; break; } if (bag[j].name == "") { bag[j] = { “材料”,“铁”,0,0,0,tie,false,0 }; break; } } for (int j = 0; j < 1000; j++) { if (bag[j].name == “煤”) { bag[j].num += mei; break; } if (bag[j].name == "") { bag[j] = { “材料”,“煤”,0,0,0,mei,false,0 }; break; } } for (int j = 0; j < 1000; j++) { if (bag[j].name == “外星合金”) { bag[j].num += waixinghejin; break; } if (bag[j].name == "") { bag[j] = { “材料”,“外星合金”,0,0,0,waixinghejin,false,0 }; break; } } for (int j = 0; j < 1000; j++) { if (bag[j].name == “钛合金”) { bag[j].num += taihejin; break; } if (bag[j].name == "") { bag[j] = { “材料”,“钛合金”,0,0,0,taihejin,false,0 }; break; } } MessageBox(0, TEXT(“你看着这些东西,突然觉悟”), TEXT(“你”), MB_OK); MessageBox(0, TEXT(“我能造出更多东西了”), TEXT(“你”), MB_OK); canmakething[canmakethingi++] = “钢”; canmakething[canmakethingi++] = “精铁”; canmakething[canmakethingi++] = “钢刀”; canmakething[canmakethingi++] = “钢剑”; canmakething[canmakethingi++] = “钢镐”; canmakething[canmakethingi++] = “钢斧”; canmakething[canmakethingi++] = “铁刀”; canmakething[canmakethingi++] = “精铁剑”; canmakething[canmakethingi++] = “精铁镐”; canmakething[canmakethingi++] = “精铁斧”; canmakething[canmakethingi++] = “强·石斧”; canmakething[canmakethingi++] = “强·石剑”; canmakething[canmakethingi++] = “强·石镐”; canmakething[canmakethingi++] = “木锄”; canmakething[canmakethingi++] = “石锄”; canmakething[canmakethingi++] = “铁锄”; canmakething[canmakethingi++] = “工作室”; _getch(); } if (f[y + movey[move]][x + movex[move]] == ‘A’) { f[y][x] = ’.’; return 0; } if (f[y + movey[move]][x + movex[move]] == ’.’) { f[y][x] = ’.’; f[y + movey[move]][x + movex[move]] = ’@’; y += movey[move]; x += movex[move]; } } return 0; } int weapon() { char c; int now = 0; bool isbag[1000] = { true, false }; thing bag2[1000]; int bag2i = 0; for (int i = 0; bag[i].name != ""; i++) { if (bag[i].type == “剑” || bag[i].type == “刀” || bag[i].type == “手枪” || bag[i].type == “机枪”) { bag2[bag2i] = bag[i]; bag2i++; } } while (1) { system(“cls”); for (int i = 0; bag2[i].name != ""; i++) { if (isbag[i] == true) { cout << ”>” << bag2[i].name << ”<”; } else { cout << ” ” << bag2[i].name << ” ”; } cout << endl; } c = _getch(); if (c == ‘w’ && now > 0) { isbag[now] = false; isbag[now - 1] = true; now -= 1; } if (c == ‘s’ && bag2[now + 1].name != "") { isbag[now] = false; isbag[now + 1] = true; now += 1; } if (c == 32) { nowweapon = bag2[now]; return 0; } } return 0; } int tool_axe() {}

原文