1
This commit is contained in:
parent
c97f7ab12c
commit
4e07bbeae4
@ -1,5 +1,7 @@
|
|||||||
#include "precompile.h"
|
#include "precompile.h"
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
#include "obstacle.h"
|
#include "obstacle.h"
|
||||||
#include "metamgr.h"
|
#include "metamgr.h"
|
||||||
#include "room.h"
|
#include "room.h"
|
||||||
@ -155,6 +157,11 @@ void Obstacle::FillMFObjectFull(Room* room, Human* hum, cs::MFObjectFull* full_d
|
|||||||
p->set_dead(IsDead(room));
|
p->set_dead(IsDead(room));
|
||||||
p->set_dead_at_thisframe(IsDead(room) ? GetDeadFrameNo(room) <= room->GetFrameNo() : false);
|
p->set_dead_at_thisframe(IsDead(room) ? GetDeadFrameNo(room) <= room->GetFrameNo() : false);
|
||||||
|
|
||||||
|
if (!IsPermanent()) {
|
||||||
|
RoomObstacle* ob = (RoomObstacle*)this;
|
||||||
|
p->set_born_frameno(ceil(ob->born_frameno / 2.0));
|
||||||
|
}
|
||||||
|
|
||||||
p->set_is_door(is_door_);
|
p->set_is_door(is_door_);
|
||||||
if (is_door_ && IsPermanent()) {
|
if (is_door_ && IsPermanent()) {
|
||||||
ObstacleData* data = room->GetPermanentObstacleData(GetUniId());
|
ObstacleData* data = room->GetPermanentObstacleData(GetUniId());
|
||||||
|
@ -58,6 +58,7 @@ void RoomObstacle::Initialize()
|
|||||||
if (meta->sweep_tags != 0) {
|
if (meta->sweep_tags != 0) {
|
||||||
room->mine_objects[GetUniId()] = GetWeakPtrRef();
|
room->mine_objects[GetUniId()] = GetWeakPtrRef();
|
||||||
}
|
}
|
||||||
|
born_frameno = room->GetFrameNo();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RoomObstacle::RecalcSelfCollider()
|
void RoomObstacle::RecalcSelfCollider()
|
||||||
|
@ -22,6 +22,7 @@ class RoomObstacle : public Obstacle
|
|||||||
std::shared_ptr<Ability> context_ability;
|
std::shared_ptr<Ability> context_ability;
|
||||||
bool sweep_lock = false;
|
bool sweep_lock = false;
|
||||||
MetaData::Buff* buff_meta = nullptr;
|
MetaData::Buff* buff_meta = nullptr;
|
||||||
|
long long born_frameno = 0;
|
||||||
|
|
||||||
virtual ~RoomObstacle() override;
|
virtual ~RoomObstacle() override;
|
||||||
virtual void Initialize() override;
|
virtual void Initialize() override;
|
||||||
|
@ -293,6 +293,8 @@ message MFObstacleFull
|
|||||||
optional int32 obj_uniid = 1; //唯一id
|
optional int32 obj_uniid = 1; //唯一id
|
||||||
optional MFVec2 pos = 2; //位置
|
optional MFVec2 pos = 2; //位置
|
||||||
optional float scale = 3; //缩放比
|
optional float scale = 3; //缩放比
|
||||||
|
//出生帧号 born_frameno == SMUpdate.frmanoe时表示在当前这帧出生(可能出现为0的情况比如静态物件)
|
||||||
|
optional int32 born_frameno = 4 [default = 0];
|
||||||
|
|
||||||
optional int32 obstacle_id = 6; //阻挡物id
|
optional int32 obstacle_id = 6; //阻挡物id
|
||||||
optional float health = 7; //血量
|
optional float health = 7; //血量
|
||||||
|
Loading…
x
Reference in New Issue
Block a user