1
This commit is contained in:
parent
dbb53b64bc
commit
1ba97eabe0
@ -294,6 +294,7 @@ bool Obstacle::DoInteraction(Human* sender)
|
||||
default:
|
||||
{
|
||||
if (!IsDead(sender->room) && IsOpenInteraction()) {
|
||||
dead_reason = 1;
|
||||
Die(sender->room);
|
||||
sender->DropItems(this);
|
||||
BroadcastFullState(sender->room);
|
||||
|
@ -15,6 +15,7 @@ class Obstacle : public Entity
|
||||
MapService* permanent_map_service = nullptr;
|
||||
bool is_permanent = false;
|
||||
float scale = 1.0f;
|
||||
int dead_reason = 0;
|
||||
|
||||
virtual ~Obstacle() override;
|
||||
virtual void Initialize() override;
|
||||
|
@ -451,6 +451,7 @@ void Obstacle::FillMFObjectFull(Room* room, Human* hum, cs::MFObjectFull* full_d
|
||||
p->set_health(GetHealth(room));
|
||||
p->set_dead(IsDead(room));
|
||||
p->set_dead_at_thisframe(IsDead(room) ? GetDeadFrameNo(room) <= room->GetFrameNo() : false);
|
||||
p->set_dead_reason(dead_reason);
|
||||
|
||||
if (!IsPermanent()) {
|
||||
RoomObstacle* ob = (RoomObstacle*)this;
|
||||
|
@ -359,6 +359,7 @@ message MFObstacleFull
|
||||
optional float health = 7; //血量
|
||||
optional bool dead = 8; //是否已死亡
|
||||
optional bool dead_at_thisframe = 9; //是否当前帧死亡(播放死亡特效)
|
||||
optional int32 dead_reason = 42 [default = 0]; //死亡原因 0:被打 1:被开
|
||||
|
||||
optional bool is_door = 20; //是否门
|
||||
//只有当is_door==ture时以下字段才有意义
|
||||
|
Loading…
x
Reference in New Issue
Block a user