#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
const int maxn = 1e6 + 7;
struct person {
string name;
ll maxhealth;
ll health;
ll fight;
ll qian;
ll shoulei;
ll yzd;
};
struct guai {
ll maxhealth;
ll health;
ll fight;
};
//小怪:{222,222,50}
//中等怪:{444,444,70}
//大怪:{666,666,90}
//Boss:{1000,1000,111}
person wo = {"", 130, 130, 30, 0, 0, 0};
void play(person g1, guai g, string name, int money) {
person me = g1;
guai zomb = g;
int z = 5;
while (1) {
if (me.health <= 0 && zomb.health <= 0) {
cout << "游戏结束!!!" << endl;
cout << "你和" << name << "同归于尽了!" << endl;
exit(0);
}
if (me.health <= 0) {
cout << "游戏结束!!!" << endl;
cout << "你被 " << name << "杀死了!" << endl;
exit(0);
}
if (zomb.health <= 0) {
cout << "你胜利了!!!" << endl;
cout << name << "死了!" << endl;
cout << "你获得了" << money << "个金币!!!" << endl;
wo.qian += money;
return ;
}
cout << "你的血量为:" << me.health << "/" << me.maxhealth << endl;
cout << name << "的血量为:" << zomb.health << "/" << zomb.maxh
C++文字冒险小游戏《异世界1》
最新推荐文章于 2025-04-17 18:36:06 发布