From 48e8e3cb8fd487fdb6563c27f1aabd760a135e33 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 27 May 2024 18:08:18 +0800 Subject: [PATCH] 1 --- server/gameserver/mt/Param.h | 7 +++++-- server/gameserver/pbutils.cc | 18 +++++++++--------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/server/gameserver/mt/Param.h b/server/gameserver/mt/Param.h index 880f8d4c..d4f85bc1 100644 --- a/server/gameserver/mt/Param.h +++ b/server/gameserver/mt/Param.h @@ -78,8 +78,11 @@ namespace mt int self_kill_color = 0xFFFF00; int self_bekill_color = 0xFF0000; - int other_bekill_color = 0xFFFFFF; - int other_kill_color = 0xFFFFFF; + int teammate_kill_color1 = 0xff0000; + int teammate_kill_color2 = 0x0F0FFF; + + int other_kill_color1 = 0xFFFFFF; + int other_kill_color2 = 0xFFFFFF; int map_cell_width = 64 * 8; int bullet_planck_step_length = 15; diff --git a/server/gameserver/pbutils.cc b/server/gameserver/pbutils.cc index 0b42c60c..f9b362e1 100644 --- a/server/gameserver/pbutils.cc +++ b/server/gameserver/pbutils.cc @@ -350,28 +350,28 @@ void KillMgr::BoradcastRollMsgCb(Human* dead_hum, auto proc_dead = [dead_hum, info, killer_team_id] (cs::MFRichTextElement* element, Human* hum) { - if (dead_hum == hum) { - auto color = mt::Param::s().self_bekill_color; + if (killer_team_id == hum->team_id) { + auto color = mt::Param::s().teammate_kill_color2; element->mutable_union_obj_1()->set_color(color); } else if (dead_hum->team_id == hum->team_id) { - auto color = mt::Param::s().teammate_bekill_color; + auto color = mt::Param::s().teammate_kill_color1; element->mutable_union_obj_1()->set_color(color); } else { - auto color = mt::Param::s().other_bekill_color; + auto color = mt::Param::s().other_kill_color2; element->mutable_union_obj_1()->set_color(color); } }; auto proc_killer = [dead_hum, info, killer_team_id] (cs::MFRichTextElement* element, Human* hum) { - if (info->killer_id == hum->GetUniId()) { - auto color = mt::Param::s().self_kill_color; + if (killer_team_id == hum->team_id) { + auto color = mt::Param::s().teammate_kill_color1; element->mutable_union_obj_1()->set_color(color); - } else if (killer_team_id == hum->team_id) { - auto color = mt::Param::s().teammate_kill_color; + } else if (dead_hum->team_id == hum->team_id) { + auto color = mt::Param::s().teammate_kill_color2; element->mutable_union_obj_1()->set_color(color); } else { - auto color = mt::Param::s().other_kill_color; + auto color = mt::Param::s().other_kill_color1; element->mutable_union_obj_1()->set_color(color); } };