- Hello, World!
我的世界(半成品)
- @ 2026-4-5 15:38:01
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
typedef long long ll;
typedef string str;
str getdieinfo(str h){
if(h=="water")return "溺水了";
else if(h=="fire")return "被烧死了";
else if(h=="fall")return "从高空坠落而亡";
else if(h=="岩浆")return "试图在岩浆里游泳";
else if(h=="岩浆块")return "发现地板是岩浆做的";
else if(h=="void")return "掉出了这个世界";
else if(h=="runtovoid")return "不共戴天";
else if(h=="magic")return "被魔法杀死了";
else if(h=="command")return "被指令所击杀";
else if(h=="wall")return "被卡在墙里窒息而亡";
else if(h=="enderdragon")return "被末地的主宰击杀";
else if(h=="wither")return "被下界的主宰击杀";
else if(h=="player")return "击杀了";
else if(h=="bed")return "被[刻意的游戏设计]击杀了";//炸床
else if(h=="error")return "[UNKNOW ERROR]";//永远不会触发,除非改代码
else return "[未知击杀信息]";
}
struct player{
ll hp=20,hungry=20,def=0;
str name="";
str hurt(str what,ll atk){//what=伤害类型
hp-=(atk-(def/3));
if(hp<=0){
return name+getdieinfo(what);
}
return "";
}
str hurt(player a,ll atk){
hp-=(atk-(def/3));
if(hp<=0){
return name+"被"+a.name+"击杀了";
}
return "";
}
};
int main(){
player a,b;
a.name="ly280";b.name="wemmbu";
cout<<a.hurt(b,1000);
return 0;
}
0 条评论
目前还没有评论...
信息
- ID
- 1
- 时间
- ms
- 内存
- MiB
- 难度
- 7
- 标签
- (无)
- 递交数
- 21
- 已通过
- 9
- 上传者