From 311a184e98bcf08010239ba8967859ffd884b050 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 10 Jun 2021 12:00:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B1=B1=E9=A1=B6=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/gameserver/constant.h | 3 ++- server/gameserver/constant_export.h | 1 + server/gameserver/creature.cc | 18 ++++++++++++++++++ server/tools/protobuild/metatable.proto | 1 + 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/server/gameserver/constant.h b/server/gameserver/constant.h index ed10efe..0e9d0ea 100755 --- a/server/gameserver/constant.h +++ b/server/gameserver/constant.h @@ -308,7 +308,8 @@ enum ColliderTag_e kColliderTag_Grass = 2, //草丛 kColliderTag_Water = 3, //水 kColliderTag_Ice = 4, //冰 - kColliderSpecTag_End = 4, + kColliderTag_MountainTop = 5, //山顶 + kColliderSpecTag_End = 5, }; enum GameChannel_e diff --git a/server/gameserver/constant_export.h b/server/gameserver/constant_export.h index f8566af..1bab14b 100644 --- a/server/gameserver/constant_export.h +++ b/server/gameserver/constant_export.h @@ -11,6 +11,7 @@ const int kInWaterBuffId = 7007; const int kInIceBuffId = 7008; const int kBeRecycleBuffId = 7009; const int kTraceBuffId = 7011; +const int kInMountainTopBuffId = 7015; enum BuffEffectType_e { diff --git a/server/gameserver/creature.cc b/server/gameserver/creature.cc index 7f6c014..484ca22 100644 --- a/server/gameserver/creature.cc +++ b/server/gameserver/creature.cc @@ -1457,6 +1457,14 @@ void Creature::CheckSpecObject() } } + if (!a8::SameBitFlag(old_cell_flags, cell_flags_, kColliderTag_MountainTop)) { + if (a8::HasBitFlag(cell_flags_, kColliderTag_MountainTop)) { + TryAddBuff(this, kInMountainTopBuffId); + } else { + RemoveBuffById(kInMountainTopBuffId); + } + } + } #ifdef DEBUG if (IsPlayer()) { @@ -1478,6 +1486,11 @@ void Creature::CheckSpecObject() } else { msg += " 灰:0"; } + if (a8::HasBitFlag(old_cell_flags, kColliderTag_MountainTop)) { + msg += " 山顶:1"; + } else { + msg += " 山顶:0"; + } } { msg += " new:"; @@ -1496,6 +1509,11 @@ void Creature::CheckSpecObject() } else { msg += " 灰:0"; } + if (a8::HasBitFlag(cell_flags_, kColliderTag_MountainTop)) { + msg += " 山顶:1"; + } else { + msg += " 山顶:0"; + } } msg += a8::Format(" o:%d n:%d w:%d h:%d", {old_cell_flags, cell_flags_, water_w, water_h}); SendDebugMsg(msg); diff --git a/server/tools/protobuild/metatable.proto b/server/tools/protobuild/metatable.proto index 95d0190..2b47d17 100755 --- a/server/tools/protobuild/metatable.proto +++ b/server/tools/protobuild/metatable.proto @@ -396,6 +396,7 @@ message TerrainJson repeated int32 dust = 2; repeated int32 water = 3; repeated int32 grass = 4; + repeated int32 mountain_top = 5; } message MapLayerJson