-
个人简介
(备注:http://121.199.47.161/user/831) ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა ૮₍˶•▿•˶₎ა (备注:http://121.199.47.161/user/831) 不能偷,这是你的૮₍˶•▿•˶₎ა ▬▬▅▅▆▇◤ --▬▬▅▅▆▇◤
#include <iostream> #include <vector> #include <string> #include <ctime> #include <cstdlib> #include <thread> #include <chrono> using namespace std; // --- 游戏配置 --- const string MAP_NAME = "零号大坝"; const string FACTION = "G.T.I.特勤组"; // --- 物品结构体 --- struct Item { string name; int value; string rarity; }; // --- 干员类 --- class Operator { public: string name; int health; int maxHealth; int armorLevel; int weaponDamage; vector<Item> backpack; int backpackCapacity; int totalWealth; Operator(string n) : name(n), health(100), maxHealth(100), armorLevel(3), weaponDamage(25), backpackCapacity(5), totalWealth(0) {} void showStatus() { cout << "--------------------------------" << endl; cout << "干员: " << name << " [" << FACTION << "]" << endl; cout << "生命: " << health << "/" << maxHealth << " | 护甲: Lv." << armorLevel << endl; cout << "武器伤害: " << weaponDamage << " | 背包: " << backpack.size() << "/" << backpackCapacity << endl; cout << "当前资产: " << totalWealth << " 哈夫克币" << endl; cout << "--------------------------------" << endl; } bool lootItem(Item item) { if (backpack.size() < backpackCapacity) { backpack.push_back(item); cout << ">>> 获得物品: [" << item.rarity << "] " << item.name << " (价值: " << item.value << ")" << endl; return true; } else { cout << ">>> 背包已满!无法拾取 " << item.name << endl; return false; } } bool combat(vector<string> enemies) { cout << "\n!!! 警告:发现敌对势力 !!!" << endl; for (const auto& enemy : enemies) { cout << "- " << enemy << endl; } int enemyPower = enemies.size() * 20; int myPower = weaponDamage + (armorLevel * 5); cout << "\n[战斗结算中...]" << endl; this_thread::sleep_for(chrono::seconds(1)); int randomFactor = rand() % 20 - 10; int result = myPower + randomFactor - enemyPower; if (result > 0) { cout << ">>> 战斗胜利!你成功消灭了敌人。" << endl; int damageTaken = max(0, (enemyPower - randomFactor) / 2); health -= damageTaken; cout << ">>> 受到损伤: " << damageTaken << " HP" << endl; if (health <= 0) { cout << "!!! 你倒下了... 任务失败。" << endl; return false; } } else { cout << ">>> 遭遇伏击!你受了重伤被迫撤退。" << endl; health -= 50; if (!backpack.empty()) { Item lost = backpack.back(); backpack.pop_back(); cout << ">>> 慌乱中掉落了: " << lost.name << endl; } if (health <= 0) { cout << "!!! 伤势过重,任务失败。" << endl; return false; } } return true; } }; void playGame() { srand(time(0)); cout << "========================================" << endl; cout << " 欢迎来到《三角洲行动:文字版》 " << endl; cout << " 目标:深入 " << MAP_NAME << ",搜刮并撤离 " << endl; cout << "========================================" << endl; string opName; cout << "请输入你的干员代号: "; cin >> opName; Operator player(opName); int turn = 1; bool isAlive = true; while (isAlive) { cout << "\n[第 " << turn << " 回合] - 当前区域: " << MAP_NAME << " 深处" << endl; player.showStatus(); cout << "行动选择:" << endl; cout << "1. 搜索物资箱 (高风险)" << endl; cout << "2. 快速搜刮 (低风险)" << endl; cout << "3. 尝试呼叫撤离" << endl; cout << ">> 请输入指令 (1/2/3): "; int choice; cin >> choice; int encounterChance = rand() % 100; if (choice == 1) { cout << ">>> 你正在撬开一个上锁的保险箱..." << endl; this_thread::sleep_for(chrono::milliseconds(800)); Item rareItem = {"曼德尔砖", 50000, "SSR"}; Item commonItem = {"显卡", 2000, "R"}; if (rand() % 2 == 0) player.lootItem(rareItem); else player.lootItem(commonItem); if (encounterChance < 40) { isAlive = player.combat({"哈夫克重装卫队", "巡逻无人机"}); } } else if (choice == 2) { cout << ">>> 你在桌子上搜寻了一番..." << endl; this_thread::sleep_for(chrono::milliseconds(500)); Item junk = {"旧手机", 100, "N"}; Item med = {"简易手术包", 500, "R"}; if (rand() % 3 == 0) player.lootItem(med); else player.lootItem(junk); if (encounterChance < 10) { isAlive = player.combat({"流浪拾荒者"}); } } else if (choice == 3) { cout << ">>> 正在呼叫直升机..." << endl; this_thread::sleep_for(chrono::seconds(1)); if (encounterChance < 50) { cout << ">>> 撤离点发生交火!你被迫放弃撤离。" << endl; isAlive = player.combat({"阿萨拉卫队"}); turn++; } else { cout << "========================================" << endl; cout << " 撤离成功!欢迎回家,特勤干员。 " << endl; cout << " 本次行动带回资产: " << player.totalWealth << " 哈夫克币 " << endl; cout << "========================================" << endl; break; } } turn++; player.totalWealth = 0; for(const auto& item : player.backpack) { player.totalWealth += item.value; } } } int main() { // 注意:这里不再调用 SetConsoleOutputCP,而是依赖文件本身的 ANSI 编码 // 请务必在编辑器中将文件保存为 ANSI 格式 playGame(); cout << "\n按回车键退出..." << endl; cin.get(); cin.get(); return 0; } -
最近活动