未完待续。
2025-08-10 17:19:07
发布于:广东
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
ll scard=0;
ll ask_start;//询问是否开始
ll ask_island1_choise;//询问在岛 1 上的选择
ll nmd;
ll coin=10000;//金币
ll level;// 等级
ll damage=20,health=50,sheild=5;//攻击、生命、防御
ll wood,stone,raw_iron,iron,raw_silver,silver,raw_copper,copper,raw_gold,gold,coal,aluminum_dirt,aluminum,coal_iron;
// 木 石 粗铁 铁 粗银 银 粗铜 铜 粗金 金 碳 铝土 铝
ll wait_wood=30;
ll mine_attack;
ll remine;
struct zombies{
string name;
ll heal;
ll attack;
ll d;
ll give;
}zom1[100];
bool touch=true;
void wait(int time){
clock_t now = clock();
while(clock() - now < time);
}
void start(ll n){
if(n!=1){
exit(0);
}
else{
cout<<'\n';
cout<<"加载中......"<<'\n';
wait(1000);
cout<<"0%"<<'\n';
wait(800);
cout<<"20%"<<'\n';
wait(600);
cout<<"40%"<<'\n';
wait(400);
cout<<"60%"<<'\n';
wait(200);
cout<<"80%"<<'\n';
wait(200);
cout<<"100%"<<'\n';
}
return;
}
void island_1(){
cout<<"1-砍树"<<'\n';
cout<<"2-挖矿(可能有怪)"<<'\n';
cout<<"3-烧炼"<<'\n';
cout<<"4-锻造武器"<<'\n';
cout<<"5-升级"<<'\n';
cout<<"6-刷怪"<<'\n';
cout<<"7-挑战boss"<<'\n';
cout<<"8-抢劫村庄"<<'\n';
cout<<"9-商店"<<'\n';
cout<<"10-查看数据"<<'\n';
cout<<"11-合金坊"<<'\n';
cout<<"12-退出游戏"<<'\n';
wait(1000);
}
void error(int nmd){
if(nmd>=10){
cout<<"错误次数已达上限,请在5秒后继续游玩,即将返回主界面"<<'\n'<<'\n';
wait(1000);
cout<<5<<'\n';
wait(1000);
cout<<4<<'\n';
wait(1000);
cout<<3<<'\n';
wait(1000);
cout<<2<<'\n';
wait(1000);
cout<<1<<'\n';
wait(1000);
cout<<"请继续游玩"<<'\n'<<'\n';
}
}
void starting(){
cout<<"[但是这里十分凶险]"<<'\n';
cout<<"[你可以通过收集资源、打猎生存下去]"<<'\n'<<'\n';
return;
}
int main(){
cout<<"————< 欢迎来到《地狱十八层》 >—————"<<'\n';
cout<<" W.X.R.制作"<<'\n';
cout<<'\n';
cout<<"按 1 开始游玩--"<<'\n';
cout<<"按 其他 退出--"<<'\n';
cin>>ask_start;
cout<<'\n';
system("cls");
start(ask_start);
system("cls");
cout<<'\n'<<"[你来到了一座岛上]"<<'\n';
starting();
system("cls");
while(true){
system("cls");
zom1[1].name="普通僵尸",zom1[1].heal=50+level*3,zom1[1].attack=15+level*2,zom1[1].d=zom1[1].heal/3,zom1[1].give=10+level;
zom1[2].name="小僵尸",zom1[2].heal=30+level*2,zom1[2].attack=20+level*2,zom1[2].d=zom1[2].heal/4,zom1[2].give=15+level*2;
zom1[3].name="巨型僵尸",zom1[3].heal=120+level*3,zom1[3].attack=20+level*3,zom1[3].d=60+level,zom1[3].give=30+level;
zom1[4].name="举盾僵尸",zom1[4].heal=200+level*4,zom1[4].attack=5+level,zom1[4].d=50+level,zom1[4].give=30+level*2;
zom1[5].name="荧光僵尸",zom1[5].heal=20+level,zom1[5].attack=10+level*2,zom1[5].d=0,zom1[5].give=50+level*2;
zom1[6].name="普通骷髅",zom1[6].heal=40+level*3,zom1[6].attack=15+level*2,zom1[6].d=5+level,zom1[6].give=10+level*3;
zom1[7].name="双弓骷髅",zom1[7].heal=45+level*3,zom1[7].attack=30+level*4,zom1[7].d=15+level,zom1[7].give=30+level*2;
zom1[8].name="强弓骷髅",zom1[8].heal=45+level*3,zom1[8].attack=20+level*3,zom1[8].d=20+level,zom1[8].give=30+level*2;
island_1();
cin>>ask_island1_choise;
if(ask_island1_choise==1){
ll cut=rand()%5;
cut++;
wood+=cut;
if(wait_wood-cut>=0){
wait_wood-=cut;
cout<<"正在砍树......"<<'\n';
wait(cut*1000);
cout<<"你砍到了 "<<cut<<" 根木头"<<'\n'<<'\n';
wait(500);
system("cls");
continue;
}
else{
cout<<"这片树林已经砍完了,等树木长出来再砍"<<'\n';
wait(500);
system("cls");
continue;
}
}
else if(ask_island1_choise==2){
if(touch){
ll ask_scard;
system("cls");
cout<<"火把燃尽了,下矿会增加幽闭值(是-1 / 否-其他)消耗2根木头+1个碳 制作一个火把"<<'\n';
cin>>ask_scard;
if(ask_scard==1&&wood>=2&&coal>=1){
wood-=1;
coal-=2;
touch=false;
}
else if(ask_scard==1&&(wood<1||coal<2)){
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
else{
scard+=5+level*2;
cout<<"增加了 "<<5+level*2<<" 点幽闭值"<<'\n';
wait(1000);
system("cls");
}
ll touch_burn=rand()%8;
if(touch_burn==0){
touch=false;//火把熄灭
}
}
else{
ll add_stone=(rand()%10)+level;
ll add_raw_iron=(rand()%4)+level;
ll add_raw_copper=(rand()%6)+level;
ll add_coal=(rand()%7)+level;
ll add_raw_silver=(rand()%3)+level/2;
ll add_raw_gold=(rand()%3)+level/2;
ll add_aluminum_dirt=(rand()%10)+level/2;
cout<<"采集矿物中......"<<'\n';
wait(rand()%2500);
cout<<"你采集到了 "<<add_stone<<" 块石头 "<<add_raw_iron<<" 块粗铁 "<<add_raw_copper<<" 块粗铜 "<<add_raw_silver<<" 块粗银 "<<add_raw_gold<<" 块粗金 "<<add_aluminum_dirt<<" 块铝土 "<<'\n';
wait(1000);
system("cls");
stone+=add_stone;
raw_iron+=add_raw_iron;
aluminum_dirt+=add_aluminum_dirt;
raw_copper+=add_raw_copper;
raw_silver+=add_raw_silver;
raw_gold+=add_raw_gold;
coal+=add_coal;
ll zom=rand()%1000;
if(zom%7==0||zom<=scard){
ll fight_mine=rand()%8;
cout<<"你在返回途中被怪物袭击"<<'\n';
cout<<"请做出你的选择"<<'\n'<<"1-攻击 2-逃跑(10%成功)" <<'\n'<<'\n';
cin>>mine_attack;
if(mine_attack==2){
int run=rand()%10;
if(run==0){
wait(2000);
cout<<"逃跑成功";
system("cls");
break;
}
else{
wait(2000);
cout<<"逃跑失败,你受到了 "<<run*5<<" 点伤害"<<'\n';
health-=run*5;
if(health<=0){
cout<<"你死了"<<'\n';
wait(1000);
system("cls");
break;
}
}
}
else if(mine_attack==1){
ll zfa=zom1[fight_mine].attack;
ll zfh=zom1[fight_mine].heal;
ll zfd=zom1[fight_mine].d-15;
fight_mine++;
while(1){
ll fight_;
cout<<"你的敌人是 "<<zom1[fight_mine].name<<'\n';
cout<<"攻击:"<<zfa<<'\n';
cout<<"生命:"<<zfh<<'\n';
cout<<"防御:"<<zfd<<'\n';
cout<<"你的数据:"<<'\n';
cout<<"攻击:"<<damage<<'\n';
cout<<"生命:"<<health<<'\n';
cout<<"防御:"<<sheild<<'\n';
cout<<"按 1 攻击"<<'\n';
cin>>fight_;
if(fight_==1){
//reat玩家真实伤害
ll reat;
if(damage-zfd<=0){
reat=1;
}
else{
reat=damage-zfd;
}
if(zfh-reat<0){
zfh=reat;
}
cout<<"你对他造成了 "<<reat<<" 点伤害 它的血量还剩 "<<zfh-reat<<" 点"<<'\n';
zfh-=reat;
if(zfh<=0){
cout<<"你将它击败了,你获得了 "<<zom1[fight_mine].give<<" 枚金币"<<'\n';
coin+=zom1[fight_mine].give;
system("cls");
break;
}
wait(500);
ll player_reat;//对玩家的伤害
if(zfa-sheild<=1){
player_reat=1;
}
else{
player_reat=zfa-sheild;
}
if(health-player_reat<0){
health=player_reat;
}
cout<<"它对你造成了 "<<player_reat<<" 点伤害 你的生命还剩 "<<health-player_reat<<" 点"<<'\n';
health-=player_reat;
if(health<=0){
cout<<"——你死了——"<<'\n';
system("cls");
break;
}
}
}
break;
}
else{
cout<<"逃跑失败,你受到了 "<<level*5<<" 点伤害"<<'\n';
health-=level*5;
if(health<=0){
cout<<"你死了"<<'\n';
system("cls");
break;
}
}
}
}
}
else if(ask_island1_choise==3){
while(1){
system("cls");
wait(1000);
cout<<"你拥有 "<<raw_iron<<" 块粗铁,"<<raw_copper<<" 块粗铜,"<<raw_silver<<" 块粗银,"<<raw_gold<<"块粗金,"<<aluminum_dirt<<" 块铝土,"<<coal<<" 块碳"<<'\n';
wait(1000);
cout<<"你可以消耗 2 根木头,获得一块碳————11" <<'\n';
cout<<"每轮烧炼需要 1 块碳"<<'\n'<<'\n';
cout<<"2 块粗铁 = 1 块精铁————1"<<'\n';
cout<<"4 块粗铜 = 1 块精铜————2"<<'\n';
cout<<"2 块粗银 = 1 块纯银————3"<<'\n';
cout<<"2 块粗金 = 1 块纯金————4"<<'\n';
cout<<"8 块铝土 = 1 块精铝————5"<<'\n';
cout<<"2 块粗铁 + 1块碳 = 1 块精钢————6"<<'\n';
cout<<"按 其他 退出"<<'\n';
ll burn_choose;
cin>>burn_choose;
if(burn_choose==1){
cout<<"正在烧炼中......"<<'\n';
if(raw_iron>=2&&coal>=1){
raw_iron-=2;
iron++;
coal--;
wait(3000);
cout<<"消耗了 2 块粗铁,炼出了 1 块精铁"<<'\n';
system("cls");
continue;
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
system("cls");
continue;
}
}
else if(burn_choose==2){
cout<<"正在烧炼中......"<<'\n';
if(raw_copper>=2&&coal>=1){
raw_copper-=4;
copper++;
coal--;
wait(3000);
cout<<"消耗了 4 块粗铜,炼出了 1 块精铜"<<'\n';
system("cls");
continue;
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(burn_choose==3){
cout<<"正在烧炼中......"<<'\n';
if(raw_silver>=2&&coal>=1){
raw_silver-=2;
silver++;
coal--;
wait(3000);
cout<<"消耗了 2 块粗银,炼出了 1 块"<<'\n';
system("cls");
continue;
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(burn_choose==4){
cout<<"正在烧炼中......"<<'\n';
if(raw_gold>=2&&coal>=1){
raw_gold-=2;
gold++;
coal--;
wait(3000);
cout<<"消耗了 2 块粗金,炼出了 1 块纯金"<<'\n';
system("cls");
continue;
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(burn_choose==5){
cout<<"正在烧炼中......"<<'\n';
if(aluminum_dirt>=8&&coal>=1){
aluminum_dirt-=8;
aluminum++;
coal--;
wait(3000);
cout<<"消耗了 8 块铝土,炼出了 1 块精铝"<<'\n';
system("cls");
continue;
}
else{
cout<<"材料不足"<<'\n';
system("cls");
wait(1000);
continue;
}
}
else if(burn_choose==6){
cout<<"正在烧炼中......"<<'\n';
if(raw_iron>=2&&coal>=2){
raw_iron-=2;
coal-=2;
coal_iron++;
wait(3000);
cout<<"合成中......"<<'\n';
wait(2000);
cout<<"消耗了 2 块粗铁和 1 块碳,炼出了 1 块精钢"<<'\n';
system("cls");
continue;
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(burn_choose==11){
if(wood>=2){
cout<<"正在烧制......"<<'\n';
coal++;
wood-=2;
wait(2000);
cout<<"你获得了 1 块碳"<<'\n';
system("cls");
continue;
}
}
else{
cout<<"正在退出......"<<'\n'<<'\n';
wait(2000);
system("cls");
break;
}
}
}
else if(ask_island1_choise==4){
while(1){
cout<<"你拥有 "<<iron<<"枚精铁,"<<copper<<"枚精铜,"<<silver<<"枚纯银,"<<gold<<"枚纯金,"<<coal_iron<<"枚精钢,"<<aluminum<<" 枚精铝"<<'\n'<<'\n';
cout<<"0——消耗10根木材——木刀——攻击加 2"<<'\n';
cout<<"1——消耗15根木材——木剑——攻击加 3 "<<'\n';
cout<<"2——消耗20根木材——木甲——防御加 4"<<'\n';
cout<<"3——消耗12枚精铁——铁刀——攻击加 6"<<'\n';
cout<<"4——消耗15枚精铁——铁剑——攻击加 10"<<'\n';
cout<<"5——消耗20枚精铁——铁甲——防御加 12"<<'\n';
cout<<"6——消耗5枚精铜——铜刀——攻击加 3"<<'\n';
cout<<"7——消耗10枚精铜——铜剑——攻击加 5"<<'\n';
cout<<"8——消耗15枚精铜——铜甲——防御加 6"<<'\n';
cout<<"9——消耗10枚纯银——银刀——攻击加 8"<<'\n';
cout<<"10——消耗12枚纯银——银剑——攻击加 12"<<'\n';
cout<<"11——消耗18枚纯银——银甲——防御加 15"<<'\n';
cout<<"12——消耗6枚纯金——金刀——攻击加 10"<<'\n';
cout<<"13——消耗10枚纯金——金剑——攻击加20"<<'\n';
cout<<"14——消耗12枚纯金——金甲——防御加20"<<'\n';
cout<<"15——消耗5枚精铝——铝刀——攻击加 3"<<'\n';
cout<<"16——消耗10枚精铝——铝剑——攻击加 7"<<'\n';
cout<<"17——消耗15枚精铝——铝甲——防御加 6"<<'\n';
cout<<"18——消耗10枚精钢——钢刀——攻击加 10"<<'\n';
cout<<"19——消耗12枚精钢——钢剑——攻击加 16"<<'\n';
cout<<"20——消耗18枚精钢——钢甲——防御加 18"<<'\n';
cout<<"21——消耗10枚石材——石刀——攻击加 4"<<'\n';
cout<<"22——消耗15枚石材——石剑——攻击加 6 "<<'\n';
cout<<"23——消耗20枚石材——石甲——防御加 8"<<'\n';
cout<<"按 其他 退出"<<'\n';
ll hel;
cin>>hel;
if(hel==0){
if(wood>=10){
damage+=2;
wood-=10;
cout<<"锻造中......"<<'\n';
wait(2000);
cout<<"锻造成功!"<<'\n';
system("cls");
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(hel==1){
if(wood>=15){
damage+=3;
wood-=15;
cout<<"锻造中......"<<'\n';
wait(2000);
cout<<"锻造成功!"<<'\n';
system("cls");
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(hel==2){
if(wood>=15){
sheild+=4;
wood-=20;
cout<<"锻造中......"<<'\n';
wait(2000);
cout<<"锻造成功!"<<'\n';
system("cls");
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(hel==3){
if(iron>=12){
damage+=6;
iron-=12;
cout<<"锻造中......"<<'\n';
wait(2000);
cout<<"锻造成功!"<<'\n';
system("cls");
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(hel==4){
if(iron>=15){
damage+=10;
iron-=15;
cout<<"锻造中......"<<'\n';
wait(2000);
cout<<"锻造成功!"<<'\n';
system("cls");
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(hel==5){
if(iron>=18){
sheild+=12;
iron-=18;
cout<<"锻造中......"<<'\n';
wait(2000);
cout<<"锻造成功!"<<'\n';
system("cls");
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(hel==6){
if(copper>=5){
damage+=3;
copper-=5;
cout<<"锻造中......"<<'\n';
wait(2000);
cout<<"锻造成功!"<<'\n';
system("cls");
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(hel==7){
if(copper>=10){
damage+=5;
copper-=5;
cout<<"锻造中......"<<'\n';
wait(2000);
cout<<"锻造成功!"<<'\n';
system("cls");
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(hel==8){
if(copper>=15){
sheild+=6;
copper-=15;
cout<<"锻造中......"<<'\n';
wait(2000);
cout<<"锻造成功!"<<'\n';
system("cls");
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(hel==9){
if(silver>=10){
damage+=8;
silver-=10;
cout<<"锻造中......"<<'\n';
wait(2000);
cout<<"锻造成功!"<<'\n';
system("cls");
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(hel==10){
if(silver>=12){
damage+=12;
silver-=12;
cout<<"锻造中......"<<'\n';
wait(2000);
cout<<"锻造成功!"<<'\n';
system("cls");
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(hel==11){
if(silver>=18){
sheild+=15;
silver-=18;
cout<<"锻造中......"<<'\n';
wait(2000);
cout<<"锻造成功!"<<'\n';
system("cls");
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(hel==12){
if(gold>=6){
damage+=10;
gold-=6;
cout<<"锻造中......"<<'\n';
wait(2000);
cout<<"锻造成功!"<<'\n';
system("cls");
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(hel==13){
if(gold>=10){
damage+=20;
gold-=10;
cout<<"锻造中......"<<'\n';
wait(2000);
cout<<"锻造成功!"<<'\n';
system("cls");
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(hel==14){
if(gold>=12){
sheild+=20;
gold-=12;
cout<<"锻造中......"<<'\n';
wait(2000);
cout<<"锻造成功!"<<'\n';
system("cls");
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(hel==15){
if(aluminum>=5){
damage+=3;
aluminum-=5;
cout<<"锻造中......"<<'\n';
wait(2000);
cout<<"锻造成功!"<<'\n';
system("cls");
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(hel==16){
if(aluminum>=10){
damage+=7;
aluminum-=10;
cout<<"锻造中......"<<'\n';
wait(2000);
cout<<"锻造成功!"<<'\n';
system("cls");
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(hel==17){
if(aluminum>=15){
sheild+=6;
aluminum-=15;
cout<<"锻造中......"<<'\n';
wait(2000);
cout<<"锻造成功!"<<'\n';
system("cls");
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(hel==18){
if(coal_iron>=10){
damage+=10;
coal_iron-=10;
cout<<"锻造中......"<<'\n';
wait(2000);
cout<<"锻造成功!"<<'\n';
system("cls");
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(hel==19){
if(coal_iron>=12){
damage+=16;
coal_iron-=12;
cout<<"锻造中......"<<'\n';
wait(2000);
cout<<"锻造成功!"<<'\n';
system("cls");
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(hel==20){
if(coal_iron>=18){
sheild+=18;
coal_iron-=18;
cout<<"锻造中......"<<'\n';
wait(2000);
cout<<"锻造成功!"<<'\n';
system("cls");
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(hel==21){
if(stone>=10){
damage+=4;
cout<<"锻造中......"<<'\n';
wait(2000);
cout<<"锻造成功!"<<'\n';
system("cls");
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(hel==22){
if(stone>=15){
damage+=6;
stone-=15;
cout<<"锻造中......"<<'\n';
wait(2000);
cout<<"锻造成功!"<<'\n';
system("cls");
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else if(hel==23){
if(stone>=20){
sheild+=8;
stone-=20;
cout<<"锻造中......"<<'\n';
wait(2000);
cout<<"锻造成功!"<<'\n';
system("cls");
}
else{
cout<<"材料不足"<<'\n';
wait(1000);
system("cls");
continue;
}
}
else{
cout<<"已退出"<<'\n';
wait(500);
system("cls");
break;
}
}
}
else if(ask_island1_choise==5){
while(1){
system("cls");
ll uplevel=level+damage+sheild+health;
cout<<"你现在有 "<<coin<<"个金币"<<'\n';
cout<<"你现在的等级:"<<level<<'\n';
cout<<"你现在的攻击:"<<damage<<'\n';
cout<<"你现在的生命:"<<health<<'\n';
cout<<"你现在的防御:"<<sheild<<'\n';
cout<<"升一级所需;"<<uplevel<<" 枚金币"<<'\n';
cout<<"升级后的攻击:"<<damage+damage/5<<'\n';
cout<<"升级后的生命:"<<health+health/4<<'\n';
cout<<"升级后的防御:"<<sheild+sheild/4<<'\n';
cout<<"1——升级 其他——取消"<<'\n';
ll is_uplevel;
cin>>is_uplevel;
if(is_uplevel==1){
if(coin>=uplevel){
coin-=uplevel;
level++;
damage+=(damage/5);
health+=(health/4);
sheild+=(sheild/4);
cout<<"升级成功"<<'\n';
system("cls");
}
else{
cout<<"升级失败,金币不足"<<'\n';
system("cls");
break;
}
}
else{
cout<<"已退出"<<'\n';
system("cls");
break;
}
}
}
else if(ask_island1_choise==6){
while(1){
cout<<"——商店——"<<'\n';
cout<<"你有:"<<coin<<"枚金币"<<'\n';
cout<<"1——货物换金币"<<'\n';
cout<<"2——金币换货物"<<'\n';
cout<<"3——神秘女巫"<<'\n';
cout<<"其他——退出"<<'\n';
ll shop;
cin>>shop;
if(shop==1){
system("cls");
cout<<"1——1铁=15金币"<<'\n';
cout<<"2——1铜=10金币"<<'\n';
cout<<"3——1银=20金币"<<'\n';
cout<<"4——1金=40金币"<<'\n';
cout<<"5——1铝=10金币"<<'\n';
cout<<"6——1钢=20金币"<<'\n';
cout<<"7——1碳=5金币"<<'\n';
cout<<"8——1石=3金币"<<'\n';
cout<<"9——1木=5金币"<<'\n';
cout<<"不收原矿"<<'\n';
ll thing_coin;
cin>>coin;
if(thing_coin==1){
if(iron>=1){
coin+=15;
iron--;
cout<<"交易成功"<<'\n';
wait(500);
system("cls");
continue;
}
else{
cout<<"交易失败"<<'\n';
wait(500);
system("cls");
continue;
}
}
else if(thing_coin==2){
if(copper>=1){
coin+=10;
copper--;
cout<<"交易成功"<<'\n';
wait(500);
system("cls");
continue;
}
else{
cout<<"交易失败"<<'\n';
wait(500);
system("cls");
continue;
}
}
else if(thing_coin==3){
if(silver>=1){
coin+=20;
copper--;
cout<<"交易成功"<<'\n';
wait(500);
system("cls");
continue;
}
else{
cout<<"交易失败"<<'\n';
wait(500);
system("cls");
continue;
}
}
else if(thing_coin==4){
if(gold>=1){
coin+=40;
gold--;
cout<<"交易成功"<<'\n';
wait(500);
system("cls");
continue;
}
else{
cout<<"交易失败"<<'\n';
wait(500);
system("cls");
continue;
}
}
if(thing_coin==5){
if(aluminum>=1){
coin+=40;
aluminum--;
cout<<"交易成功"<<'\n';
wait(500);
system("cls");
continue;
}
else{
cout<<"交易失败"<<'\n';
wait(500);
system("cls");
continue;
}
}
if(thing_coin==6){
if(coal_iron>=1){
coin+=20;
coal_iron--;
cout<<"交易成功"<<'\n';
wait(500);
system("cls");
continue;
}
else{
cout<<"交易失败"<<'\n';
wait(500);
system("cls");
continue;
}
}
else if(thing_coin==7){
if(coal>=1){
coin+=5;
coal--;
cout<<"交易成功"<<'\n';
wait(500);
system("cls");
continue;
}
else{
cout<<"交易失败"<<'\n';
wait(500);
system("cls");
continue;
}
}
else if(thing_coin==8){
if(stone>=1){
coin+=3;
stone--;
cout<<"交易成功"<<'\n';
wait(500);
system("cls");
continue;
}
else{
cout<<"交易失败"<<'\n';
wait(500);
system("cls");
continue;
}
}
else if(thing_coin==9){
if(wood>=1){
coin+=5;
wood--;
cout<<"交易成功"<<'\n';
wait(500);
system("cls");
continue;
}
else{
cout<<"交易失败"<<'\n';
wait(500);
system("cls");
continue;
}
}
else{
cout<<"已退出"<<'\n';
wait(500);
system("cls");
continue;
}
}
else if(shop==2){
}
else if(shop==3){
}
else{
cout<<"已退出"<<'\n';
wait(500);
system("cls");
break;
}
}
}
else if(ask_island1_choise==7){
}
else if(ask_island1_choise==8){
}
else if(ask_island1_choise==9){
}
else if(ask_island1_choise==10){
}
else if(ask_island1_choise==11){
}
else if(ask_island1_choise==12){
cout<<"感谢游玩~~"<<'\n';
cout<<"退出中......"<<'\n';
wait(1000);
exit(0);
}
else{
cout<<"给我重输!!"<<'\n'<<'\n';
nmd++;
error(nmd);
}
}
wait(4000);
cout<<"[你来到了另一个岛上]"<<'\n';
wait(700);
cout<<"[你很诧异]"<<'\n';
wait(100);
cout<<"[为什么你还活着]"<<'\n';
wait(100);
cout<<"[或许......]"<<'\n';
wait(2000);
cout<<"[之前的一切只是一个梦......]"<<'\n'<<'\n';
wait(1000);
cout<<"加载世界中......"<<'\n';
wait(500);
cout<<"0%"<<'\n';
wait(500);
cout<<"25%"<<'\n';
wait(500);
cout<<"50%"<<'\n';
wait(500);
cout<<"100%"<<'\n';
wait(500);
starting();
while(1){
system("cls");
island_1();
}
return 0;
}
这里空空如也
有帮助,赞一个