From 34ae57b5448ffdadf61b4f51d230978a6870c503 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 18 May 2023 14:25:50 +0800 Subject: [PATCH] 1 --- server/gameserver/constant.h | 4 +++- server/gameserver/human.cc | 12 ++++++------ server/tools/protobuild/cs_proto.proto | 1 + 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/server/gameserver/constant.h b/server/gameserver/constant.h index 17709d8e..445c227a 100644 --- a/server/gameserver/constant.h +++ b/server/gameserver/constant.h @@ -81,7 +81,9 @@ enum InventorySlot_e IS_SINGAL_GUN = 23, //信号枪 IS_OIL_BUCKET = 24, //汽油桶 - IS_GEMSTONE = 25, //能量宝石 + IS_YELLOW_STONE = 25, //黄宝石 + IS_BLUE_STONE = 26, //蓝宝石 + IS_PURPLE_STONE = 27, //紫宝石 IS_MAX = 30, IS_END diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 24ed1504..d3a7d868 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -1249,7 +1249,7 @@ void Human::DeadDrop() on_dead_remove_objects_.clear(); } { - if (GetInventory(IS_GEMSTONE) > 0 && gemstone > 0) { + if (GetInventory(IS_YELLOW_STONE) > 0 && gemstone > 0) { room->frame_event.AddPropChg ( GetWeakPtrRef(), @@ -1266,8 +1266,8 @@ void Human::DeadDrop() SetMaxHP(GetBattleContext()->GetMaxHP()); gemstone = 0; - DecInventory(IS_GEMSTONE, GetInventory(IS_GEMSTONE)); - SyncVolume(IS_GEMSTONE); + DecInventory(IS_YELLOW_STONE, GetInventory(IS_YELLOW_STONE)); + SyncVolume(IS_YELLOW_STONE); } } MarkSyncActivePlayer(__FILE__, __LINE__, __func__); @@ -3235,10 +3235,10 @@ void Human::SyncVolume(int slot_id) void Human::ProcGemStoneItem(AddItemDTO& dto) { - if (GetInventory(IS_GEMSTONE) >= GetVolume(IS_GEMSTONE)) { + if (GetInventory(IS_YELLOW_STONE) >= GetVolume(IS_YELLOW_STONE)) { return; } - AddInventory(IS_GEMSTONE, 1); + AddInventory(IS_YELLOW_STONE, 1); gemstone += 1; room->frame_event.AddPropChg ( @@ -3283,7 +3283,7 @@ void Human::ProcGemStoneItem(AddItemDTO& dto) 0, GetMaxHP(), true); - SyncVolume(IS_GEMSTONE); + SyncVolume(IS_YELLOW_STONE); //刷新数量 int add_num = 1; Entity* entity = room->GetEntityByUniId(dto.uniid); diff --git a/server/tools/protobuild/cs_proto.proto b/server/tools/protobuild/cs_proto.proto index fca3f845..f37f7b2e 100755 --- a/server/tools/protobuild/cs_proto.proto +++ b/server/tools/protobuild/cs_proto.proto @@ -253,6 +253,7 @@ message MFWeapon optional string weapon_uniid = 3; //武器唯一id optional int32 ammo = 4; //弹药数 optional int32 volume = 5; //弹夹容量 + optional int32 weapon_battle_lv = 6 [default = 0]; //武器战内等级(升级) } //皮肤