📄 damage.cpp
字号:
#include "assert.h"
#include "ray.h"
#include "globals.h"
#include "message.h"
#include "damage.h"
#include "visuals.h"
#include "sprinter.h"
void Give_Damage(pobject the_obj, short amount) {
if (the_obj->stats.current_health>0) {
the_obj->stats.current_health-=amount;
if (the_obj==the_player) {
Visuals_Message(HURT_MESSAGE, (pdata)amount);
}
if (the_obj->stats.current_health<=0) {
if (the_obj==the_player) {
Create_Object(the_player->x, the_player->y,
the_player->z, the_player->angle, EXPLOSION_TYPE,
the_player->owner, the_player->team);
Visuals_Message(VIS_DIE_MSG, NULL);
} else Send_Specific_Message(NULL, the_obj, DIE_MESSAGE, NULL);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -