海岛生存游戏v1.2.7.5开源代码一
2024-09-04 18:32:22
发布于:浙江
开源代码一
#include<bits/stdc++.h>//因为我C++只学了半年不到,所以难免会有些粗糙,还清谅解!
#include<unistd.h>
#include<stdlib.h>
#include<windows.h>
using namespace std;
string input;//玩家一开始的输入
int wood = 0;//木头
int stone = 0, iron = 0, copper = 0, sliver = 0, gold = 0;//各种矿石
int crimtane = 0;//克苏鲁之脑掉落的猩红矿
int life = 100,life2;//生命值
int attack = 15, defense = 0;//攻击与防御
int coin = 0;//金币
int mine = 0;//这个表示下矿次数,当你下矿太多次,就会遇见隐藏boss!
int resentment = 0;//怨念
int ci = 0;//抢劫次数
int kan = 0;//砍树次数,防止肝帝刷木头升攻击力
int mode = 0;//模式
int palladium = 0;//困难模式专属矿石
int chlorophyte = 0;//叶绿矿
//计时
void wait(int time){//time*1000=秒数
clock_t now = clock();
while(clock() - now < time);
}
//开始时的剧情
void start(){
string l;
cout << "是否跳过剧情?如要跳过,回答1" << endl;
cin >> l;
if(l == "1") return;
cout << "[你,是村子里的一个家财万贯的人]" << endl;
wait(1000);
cout << "[有一天,你在村里散步时,突然被一个人给打了]" << endl;
wait(1000);
system("color C0");
system("color 0F");
cout << "[“什么人,还敢在我面前出现”]" << endl;
wait(1000);
cout << "[你感到头晕目眩]" << endl;
wait(1000);
cout << "[醒来后你发现你身上什么也没有了]" << endl;
wait(1000);
cout << "[你环顾四周,发现你在一座巨大的海岛上,附近除了一个矿洞,一个村庄和一片小树林,什么也没有]" << endl;
wait(1000);
cout << "[没办法,你为了活下去,只能在上面生存,直到有人救你]" << endl;
wait(1000);
cout << "[于是,一场海岛的生存]" << endl;
wait(1000);
cout << "[正式开始]" << endl;
wait(1000);
}
//主页
void jm(){
system("cls");
cout << "-- -- -- 海岛生存v1.2.7.5 -- -- --" << endl;
cout << "这是一个物资贫瘠的海岛,这里面有一片小树林和一个矿洞,以及一个村庄" << endl;
cout << "你想要做什么?" << endl;
cout << "1,去小树林砍树" << endl;
cout << "2,下矿(可能会遇到怪物)" << endl;
cout << "3,去村子里抢劫(可以获得金币以及食物)" << endl;
cout << "4,制作武器与装备(加攻击与防御)" << endl;
cout << "5,找商人买东西" << endl;
if(mode == 0){
cout << "6,去打克苏鲁之眼(boss)" << endl;
cout << "7,去打克苏鲁之脑(boss)" << endl;
cout << "8,去打骷髅队长(boss)" << endl;
cout << "9,去打血肉之墙(大BOSS)" << endl;
}
else if(mode == 1){
cout << "6,去打双子魔眼(boss)" << endl;
cout << "7,去打毁灭者(boss)" << endl;
cout << "8,去打机械骷髅王(boss)" << endl;
cout << "9,去打奥库瑞姆(大BOSS)" << endl;
}
else if(mode == 2){
cout << "6,去打世纪之花(boss)" << endl;
cout << "7,去打瘟疫使者歌莉娅(boss)" << endl;
cout << "8,去打痴愚金龙(boss)" << endl;
cout << "9,去打丛林龙(大BOSS,奉劝你一句,不要随便打)" << endl;
}
else if(mode == 3){
cout << "6,去打白金星舰(boss)" << endl;
cout << "7,去打星神游龙(boss)" << endl;
cout << "8,去打亵渎守卫(boss)" << endl;
cout << "9,去打亵渎天神-普罗维登斯(大BOSS,我最后再奉劝你一句,不要随便打)" << endl;
}
cout << "10,去刷怪(随机的怪物)" << endl;
cout << "11,显示自己的状态" << endl;
cout << "12,退出游戏" << endl;
while(1){
cin >> input;
if(input == "1"){//砍树
if(kan <= 35){
cout << "砍树砍到了1块木头" << endl; //砍树
wood += 1;
kan++;
}
else{
cout << "这片小树林已经被你砍光了!" << endl;
}
system("pause");
system("cls");
jm();
}
else if(input == "2"){//下矿
system("cls");//以下为挖矿
int _ = rand()%2;
cout << "正在挖矿……" << endl;
sleep(2);
if(mine < 10){
_ = rand()%2;
if(_ == 0){
cout << "这次挖矿没有遇到任何怪物!" << endl;
}
else{
if(mode == 0){
life2 = 40;
_ = 0;
cout << "这回你运气不好,遇到了一只骷髅!" << endl;
if(resentment != 0){cout << "骷髅因为怨念被增强了!" << endl; life2 += resentment/2;}
cout << "骷髅详情:" << endl << "生命:40 " << "攻击:10 " << "防御:0" << endl;
string q;
while(life || life2){//一直干到有人噶了
cout << "请做出你的选择:\n1,干!" << endl;
cin >> q;
if(q == "1"){
cout << "你向骷髅发起了攻击!" << endl;
wait(200);
system("color C0");
life2 -= attack;
wait(200);
system("color 0F");
cout << "你对骷髅造成了" << attack << "点伤害!" << endl;
if(life2 <= 0){//赢咯!
cout << "骷髅被你击败了!你获得了5个金币!……但增加了30点怨念" << endl;
coin += 5;
ci++;
resentment += 30;
wait(1000);
break;
}
cout << "骷髅还剩" << life2 << "点生命!" << endl;
wait(200);
cout << "骷髅发起了反击!" << endl;
wait(200);
system("color C0");
_ = 10 - defense;
if(_ < 1) _ = 1;
life -= _;
wait(200);
system("color 0F");
cout << "骷髅打掉了你" << _ << "点生命!" << endl;
if(life <= 0){//你死了
cout << "你被杀死了!" << endl;
wait(1000);
cout << "等待复活……" << endl;
wait(1000);
life = 100;
jm();
}
cout << "你还有" << life << "点生命" << endl;
system("pause");
system("cls");
continue;
}
else{
cout << "别乱选啊" << endl;
continue;
}
}
}
else if(mode == 1 || mode == 2){
life2 = 150;
_ = 0;
cout << "这回你运气不好,遇到了一只装甲骷髅!" << endl;
if(resentment != 0){cout << "装甲骷髅因为怨念被增强了!" << endl; life2 += resentment/2;}
cout << "骷髅详情:" << endl << "生命:150 " << "攻击:120 " << "防御:30" << endl;
string q;
while(life || life2){//一直干到有人噶了
cout << "请做出你的选择:\n1,干!" << endl;
cin >> q;
if(q == "1"){
cout << "你向装甲骷髅发起了攻击!" << endl;
wait(200);
system("color C0");
_ = attack - 30;
if(attack < 1) _ = 1;
life2 -= _;
wait(200);
system("color 0F");
cout << "你对装甲骷髅造成了" << attack << "点伤害!" << endl;
if(life2 <= 0){//赢咯!
cout << "装甲骷髅被你击败了!你获得了15个金币!……但增加了50点怨念" << endl;
coin += 15;
ci++;
resentment += 50;
wait(1000);
break;
}
cout << "装甲骷髅还剩" << life2 << "点生命!" << endl;
wait(200);
cout << "装甲骷髅发起了反击!" << endl;
wait(200);
system("color C0");
_ = 80 - defense;
if(_ < 1) _ = 1;
life -= _;
wait(200);
system("color 0F");
cout << "装甲骷髅打掉了你" << _ << "点生命!" << endl;
if(life <= 0){//你死了
cout << "你被杀死了!" << endl;
wait(1000);
cout << "等待复活……" << endl;
wait(1000);
life = 100;
jm();
}
cout << "你还有" << life << "点生命" << endl;
system("pause");
system("cls");
continue;
}
else{
cout << "别乱选啊" << endl;
continue;
}
}
}
}
}
else if(rand() % 3 == 0){//作者的隐藏boss!!!
system("cls");
if(mode == 0){
life2 = 1400;
int cnt = 0;//霉菌层数
int temp = 1;//阶段
cout << "恭喜你遇到了作者附赠的隐藏boss——菌生蟹!" << endl;
if(resentment != 0){cout << "菌生蟹因为怨念被增强了!" << endl; life2 += resentment/2;}
string q;
cout << "菌生蟹详情:" << endl << "生命:1400 " << "攻击:120(霉菌伤害10) " << "防御:80" << endl;
while(life|| life2){
cout << "请做出你的选择\n1,干!" << endl;
int _;
cin >> q;
if(q == "1"){
cout << "你向菌生蟹发起了攻击!" << endl;
wait(200);
system("color C0");
wait(200);
system("color 0F");
_ = attack - 80;
if(_ < 1) _ = 1;
life2 -= _;
cout << "你对菌生蟹造成了" << _ << "点伤害!" << endl;
wait(200);
cout << "菌生蟹还剩" << life2 << "点生命!" << endl;
if(life2 < 1){
cout << "菌生蟹被你击败了!你真厉害!" << endl;
wait(1000);
cout << "你获得了30枚金币!防御力恢复了!生命值增加了50点!并获取了8个去村庄抢劫的次数!还获得了60个金矿!……但你的怨念也增加了150点" << endl;
wait(1000);
coin += 30;
life += 50;
ci += 8;
gold += 60;
defense += cnt * 5;
resentment += 150;
system("pause");
system("cls");
jm();
}
if(life2 <= 700 && temp == 1){
cout << "菌生蟹进入了第二阶段!" << endl;
temp = 2;
}
_ = rand() % 2;
wait(200);
if(temp == 1){
if(_ != 0){
cout << "菌生蟹对你使用了重压!" << endl;
wait(200);
system("color C0");
wait(200);
system("color 0F");
wait(200);
_ = 90 - defense;
if(_ < 1) _ = 1;
life -= _;
}
else{
cout << "菌生蟹对你使用了霉菌攻击!" << endl;
wait(200);
system("color F0");
wait(200);
system("color 0F");
wait(200);
_ = 10 - defense;
if(_ < 1) _ = 1;
life -= _;
cnt++;
cout << "你被霉菌侵蚀了!防御力降低了5点!" << endl;
defense -= 5;
}
}
else{
_ = rand()%2;
if(_ != 0){
cout << "菌生蟹对你使用了夹击!" << endl;
wait(200);
system("color C0");
wait(200);
system("color 0F");
wait(200);
_ = 120 - defense;
if(_ < 1) _ = 1;
life -= _;
}
else{
_ = rand() % 3 + 1;
cout << "菌生蟹对你发射了" << _ << "个霉菌团!" << endl;
wait(200);
system("color F0");
wait(200);
system("color 0F");
wait(200);
cnt += _ * 5;
defense -= _ * 5;
_ = 10 * 2 * _ - defense;
if(_ < 1) _ = 1;
life -= _;
cout << "你被霉菌侵蚀了!防御力降低了" << _ * 5 << "点!" << endl;
}
}
if(life < 1){
cout << "你被菌生蟹击败了!" << endl;
wait(1000);
cout << "等待复活……" << endl;
wait(1000);
life = 100;
defense += cnt * 5;
jm();
}
cout << "你受到了" << _ << "点伤害!" << endl;
wait(200);
cout << "你还剩" << life << "点生命!" << endl;
system("pause");
system("cls");
}
else{
cout << "你别乱选!这可是作者附赠boss!" << endl;
system("pause");
system("cls");
continue;
}
}
}
else{
life2 = 10000;
int cnt = 0;//霉菌层数
int temp = 1;//阶段
cout << "恭喜你遇到了作者附赠的隐藏boss(困难模式)——猩红菌生蟹!" << endl;
if(resentment != 0){cout << "菌生蟹因为怨念被增强了!" << endl; life2 += resentment/2;}
cout << "猩红菌生蟹详情:" << endl << "生命:10000 " << "攻击:200(霉菌伤害30) " << "防御:300" << endl;
string q;
while(life|| life2){
cout << "请做出你的选择\n1,干!" << endl;
int _;
cin >> q;
if(q == "1"){
cout << "你向猩红菌生蟹发起了攻击!" << endl;
wait(200);
system("color C0");
wait(200);
system("color 0F");
_ = attack - 300;
if(_ < 1) _ = 1;
life2 -= _;
cout << "你对猩红菌生蟹造成了" << _ << "点伤害!" << endl;
wait(200);
cout << "猩红菌生蟹还剩" << life2 << "点生命!" << endl;
if(life2 < 1){
cout << "猩红菌生蟹被你击败了!你真厉害!" << endl;
wait(1000);
cout << "你获得了110枚金币!防御力恢复了!生命值增加了80点!并获取了10个去村庄抢劫的次数!……但你的怨念也增加了250点" << endl;
wait(1000);
coin += 110;
life += 80;
ci += 10;
defense += cnt * 6;
resentment += 250;
system("pause");
system("cls");
jm();
}
if(life2 <= 5000 && temp == 1){
cout << "猩红菌生蟹进入了第二阶段!" << endl;
temp = 2;
}
_ = rand() % 2;
wait(200);
if(temp == 1){
if(_ != 0){
cout << "猩红菌生蟹对你使用了重压!" << endl;
wait(200);
system("color C0");
wait(200);
system("color 0F");
wait(200);
_ = 180 - defense;
if(_ < 1) _ = 1;
life -= _;
}
else{
cout << "猩红菌生蟹对你使用了霉菌攻击!" << endl;
wait(200);
system("color F0");
wait(200);
system("color 0F");
wait(200);
_ = 30 - defense;
if(_ < 1) _ = 1;
life -= _;
cnt++;
cout << "你被霉菌侵蚀了!防御力降低了8点!" << endl;
defense -= 8;
}
}
else{
_ = rand()%2;
if(_ != 0){
cout << "猩红菌生蟹对你使用了夹击!" << endl;
wait(200);
system("color C0");
wait(200);
system("color 0F");
wait(200);
_ = 250 - defense;
if(_ < 1) _ = 1;
life -= _;
}
else{
_ = rand() % 3 + 1;
cout << "猩红菌生蟹对你发射了" << _ << "个霉菌团!" << endl;
wait(200);
system("color F0");
wait(200);
system("color 0F");
wait(200);
cnt += _ * 8;
defense -= _ * 8;
_ = 30 * 2 * _ - defense;
if(_ < 1) _ = 1;
life -= _;
cout << "你被霉菌侵蚀了!防御力降低了" << _ * 8 << "点!" << endl;
}
}
if(life < 1){
cout << "你被猩红菌生蟹击败了!" << endl;
wait(1000);
cout << "等待复活……" << endl;
wait(1000);
life = 100;
defense += cnt * 8;
jm();
}
cout << "你受到了" << _ << "点伤害!" << endl;
wait(200);
cout << "你还剩" << life << "点生命!" << endl;
system("pause");
system("cls");
}
else{
cout << "别乱选!这可是作者附赠boss!" << endl;
system("pause");
system("cls");
continue;
}
}
}
}
int n = rand()%5 + 8;
cout << "你挖到了" << n << "块石头,";
stone += n;
n = rand()%13 + 1;
cout << n << "块铜矿,";
copper += n;
n = rand()%11;
cout << n << "块铁矿,";
iron += n;
n = rand()%11;
cout << n << "块银矿,";
sliver += n;
n = rand()%6;
cout << n << "块金矿,";
gold += n;
if(mode != 0){
n = rand()%10+3;
cout << n << "块钯金矿";
palladium += n;
}
if(mode >= 2){
n = rand()%10+1;
cout << n << "块叶绿矿";
chlorophyte += n;
}
cout << endl;
mine++;
cout << "你总共下矿了" << mine << "次" << endl;
system("pause");
system("cls");
jm();
}
else if(input == "3"){//去村里抢劫
if(attack >= 30){
if(ci > 0){
if(rand()%3 == 1){
system("cls");
cout << "你在偷东西时不小心踩到了一个东西,发出了声音,你撒腿就跑,村民们气的来干你,你寡不敌众,扣了5点生命(不要问我为什么你防御那么高却还是扣了5滴血)" << endl;
life -= 5;
ci--;
if(life <= 0){//你死了
cout << "你被村民杀死了!" << endl;
wait(1000);
cout << "等待复活……" << endl;
wait(1000);
life = 100;
jm();//直接终止程序
}
system("pause");
system("cls");
}
else{
system("cls");
cout << "你的运气很好,村民们没发现你" << endl;
int _ = rand() % 4 + 1;
int temp = rand() % 5 + 5;
cout << "你获得了" << _ << "枚金币和" << temp << "块面包,你把它们吃了,回复了" << temp << "点生命" << endl;
coin += _;
life += temp;
ci--;
system("pause");
system("cls");
}
jm();
}
else{
cout << "去刷怪获取次数" << endl;
system("pause");
system("cls");
jm();
}
}
else{
cout << "你的攻击力不够,没能力去抢劫" << endl;
system("pause");
system("cls");
jm();
}
continue;
}
else if(input == "4"){//做东西
system("cls");
while(1){
cout << "你想制作什么?" << endl << "1,木剑 加5点伤害 消耗 15 木头" << endl << "2,木甲 加3点防御力 消耗 20 木头" << endl << "3,石剑 加8点伤害 消耗 15 石头" << endl << "4,石甲 加5点防御力 消耗 20 石头" << endl;
cout << "5,铜剑 加10点伤害 消耗 15 铜矿" << endl << "6,铜甲 加8点防御 消耗 20 铜矿" << endl << "7,铁剑 加12点伤害 消耗 15 铁矿" << endl << "8,铁甲 加10点防御 消耗 20 铁矿" << endl << "9,银剑 加 15 点伤害 消耗 15 银矿" << endl << "10,银甲 加 12 点防御 消耗 20 银矿" << endl;
cout << "11,金剑 加18点伤害 消耗 15 金矿" << endl << "12,金甲 加15点防御 消耗 20 金矿" << endl << "13,猩红剑 加22点伤害 消耗 15 猩红矿" << endl << "14,猩红甲 加18点防御 消耗 20 猩红矿" << endl << "15,钯金剑 加 30 点伤害 消耗 15 钯金矿" << endl << "16,钯金甲 加 25 防御 消耗 20 钯金矿" << endl;
cout << "17,叶绿剑 加35伤害 消耗 15 叶绿矿" << endl << "18,叶绿甲 加30防御 消耗 20 叶绿矿" << endl << "19,返回" << endl;
string q;
cin >> q;
if(q == "1"){
if(wood >= 15){
cout << "你用15木头做出了一把木剑" << endl;
wood -= 15;
attack += 5;
system("pause");
system("cls");
}
else{
cout << "你的木头不够" << endl;
system("pause");
system("cls");
continue;
}
}
else if(q == "2"){
if(wood >= 20){
cout << "你用20木头做出了一套木甲" << endl;
wood -= 20;
defense += 3;
system("pause");
system("cls");
}
else{
cout << "你的木头不够" << endl;
system("pause");
system("cls");
continue;
}
}
else if(q == "3"){
if(stone >= 15){
cout << "你用15石头做出了一把石剑" << endl;
stone -= 15;
attack += 8;
system("pause");
system("cls");
}
else{
cout << "你的石头不够" << endl;
system("pause");
system("cls");
continue;
}
}
else if(q == "4"){
if(stone >= 20){
cout << "你用20石头做出了一套石甲" << endl;
stone -= 20;
defense += 5;
system("pause");
system("cls");
}
else{
cout << "你的石头不够" << endl;
system("pause");
system("cls");
continue;
}
}
else if(q == "5"){
if(copper >= 15){
cout << "你用15铜矿做出了一把铜剑" << endl;
copper -= 15;
attack += 10;
system("pause");
system("cls");
}
else{
cout << "你的铜矿不够" << endl;
system("pause");
system("cls");
continue;
}
}
else if(q == "6"){
if(copper >= 20){
cout << "你用20铜矿做出了一套铜甲" << endl;
copper -= 20;
defense += 8;
system("pause");
system("cls");
}
else{
cout << "你的铜矿不够" << endl;
system("pause");
system("cls");
continue;
}
}
else if(q == "7"){
if(iron >= 15){
cout << "你用15铁矿做出了一把铁剑" << endl;
iron -= 15;
attack += 12;
system("pause");
system("cls");
}
else{
cout << "你的铁矿不够" << endl;
system("pause");
system("cls");
continue;
}
}
else if(q == "8"){
if(iron >= 20){
cout << "你用20铁矿做出了一套铁甲" << endl;
iron -= 20;
defense += 10;
system("pause");
system("cls");
}
else{
cout << "你的铁矿不够" << endl;
system("pause");
system("cls");
continue;
}
}
else if(q == "9"){
if(sliver >= 15){
cout << "你用15银矿做出了一把银剑" << endl;
sliver -= 15;
attack += 15;
system("pause");
system("cls");
}
else{
cout << "你的银矿不够" << endl;
system("pause");
system("cls");
continue;
}
}
else if(q == "10"){
if(sliver >= 20){
cout << "你用20银矿做出了一套银甲" << endl;
sliver -= 20;
defense += 12;
system("pause");
system("cls");
}
else{
cout << "你的银矿不够" << endl;
system("pause");
system("cls");
continue;
}
}
else if(q == "11"){
if(gold >= 15){
cout << "你用15金矿做出了一把金剑" << endl;
gold -= 15;
attack += 18;
system("pause");
system("cls");
}
else{
cout << "你的金矿不够" << endl;
system("pause");
system("cls");
continue;
}
}
else if(q == "12"){
if(gold >= 20){
cout << "你用20金矿做出了一套金甲" << endl;
gold -= 20;
defense += 15;
system("pause");
system("cls");
}
else{
cout << "你的金矿不够" << endl;
system("pause");
system("cls");
continue;
}
}
else if(q == "13"){
if(crimtane >= 15){
cout << "你用15猩红矿做出了一把猩红剑" << endl;
crimtane -= 15;
attack += 22;
system("pause");
system("cls");
}
else{
cout << "你的猩红矿不够" << endl;
system("pause");
system("cls");
continue;
}
}
else if(q == "14"){
if(crimtane >= 20){
cout << "你用20猩红矿做出了一套猩红甲" << endl;
crimtane -= 20;
defense += 18;
system("pause");
system("cls");
}
else{
cout << "你的猩红矿不够" << endl;
system("pause");
system("cls");
continue;
}
}
else if(q == "15"){
if(palladium >= 15){
cout << "你用15钯金矿做出了一把钯金剑" << endl;
palladium -= 15;
attack += 30;
system("pause");
system("cls");
}
else{
cout << "你的钯金矿不够" << endl;
system("pause");
system("cls");
continue;
}
}
else if(q == "16"){
if(palladium >= 20){
cout << "你用20钯金矿做出了一套钯金甲" << endl;
palladium -= 20;
defense += 25;
system("pause");
system("cls");
}
else{
cout << "你的钯金矿不够" << endl;
system("pause");
system("cls");
continue;
}
}
else if(q == "17"){
if(chlorophyte >= 15){
cout << "你用15叶绿矿做出了一把叶绿剑" << endl;
chlorophyte -= 15;
attack += 35;
system("pause");
system("cls");
}
else{
cout << "你的叶绿矿不够" << endl;
system("pause");
system("cls");
continue;
}
}
else if(q == "18"){
if(chlorophyte >= 20){
cout << "你用20叶绿矿做出了一套叶绿甲" << endl;
chlorophyte -= 15;
defense += 30;
system("pause");
system("cls");
}
else{
cout << "你的叶绿矿不够" << endl;
system("pause");
system("cls");
continue;
}
}
else if(q == "19") break; //chlorophyte
else{
system("cls");
cout << "给劳资重输" << endl;
continue;
}
}
jm();
}
else if(input == "5"){//买东西
system("cls");
while(1){
cout << "-- -- -- 奸商 -- -- --" << endl;
cout << "你想买啥?" << endl;
cout << "1,冰雪刃 加 30 点伤害 花费 80 金币" << endl;
cout << "2,寒冰链甲 加 25 点防御 花费 95 金币" << endl;
cout << "3,永夜刃 加 50 点伤害 花费 120 金币" << endl;
cout << "4,熔岩甲 加 35 点防御 花费 130 金币" << endl;
cout << "5,治疗药水 回复 20 点生命 花费 200 金币" << endl;
cout << "6,跟奸商告别" << endl;
int _;
cin >> _;
if(_ == 1){
if(coin >= 80){
cout << "购买成功!" << endl;
attack += 30;
coin -= 80;
system("pause");
system("cls");
continue;
}
else{
cout << "你的金币不够" << endl;
system("pause");
system("cls");
continue;
}
}
else if(_ == 2){
if(coin >= 95){
cout << "购买成功!" << endl;
defense += 25;
coin -= 95;
system("pause");
system("cls");
continue;
}
else{
cout << "你的金币不够" << endl;
system("pause");
system("cls");
continue;
}
}
else if(_ == 3){
if(coin >= 120){
cout << "购买成功!" << endl;
attack += 50;
coin -= 120;
system("pause");
system("cls");
continue;
}
else{
cout << "你的金币不够" << endl;
system("pause");
system("cls");
continue;
}
}
else if(_ == 4){
if(coin >= 130){
cout << "购买成功!" << endl;
defense += 35;
coin -= 130;
system("pause");
system("cls");
continue;
}
else{
cout << "你的金币不够" << endl;
system("pause");
system("cls");
continue;
}
}
else if(_ == 5){
if(coin >= 200){
cout << "购买成功!生命增加了20点" << endl;
coin -= 200;
life += 20;
system("pause");
system("cls");
continue;
}
else{
cout << "你的金币不够" << endl;
system("pause");
system("cls");
continue;
}
}
else if(_ == 6){
cout << "奸商:“欢迎下次来送钱啊!”" << endl;
system("pause");
system("cls");
jm();
}
else{
cout << "给我重输" << endl;
system("pause");
system("cls");
continue;
}
}
}
全部评论 2
你去看看我发的开头
2024-09-04 来自 广东
0算了,有空你私聊
2024-09-04 来自 广东
0哦
2024-09-06 来自 浙江
0
游戏最好发布到灌水区。学术板块一般用于交流学术问题。
2024-09-03 来自 加拿大
0
有帮助,赞一个