This commit is contained in:
aozhiwei 2021-08-31 18:00:06 +08:00
parent d41e24a5dd
commit 786afc5f23
4 changed files with 12 additions and 50 deletions

View File

@ -210,18 +210,11 @@ enum BuffSelectTarget_e
enum VirtualWeapon_e
{
VW_SafeArea = 9000000,
VW_Spectate = 9000001,
VW_SelfDetonate = 9000002,
VW_Mine = 9000003,
VW_Tank = 9000004,
};
enum VirtualPlayer_e
{
VP_SafeArea = 9000000,
VP_Spectate = 9000001,
VP_SelfDetonate = 9000002,
VP_Mine = 9000003,
};
enum EquipType_e

View File

@ -39,17 +39,7 @@ void KillMgr::OnHumanDead(Human* dead_hum, KillInfo* info)
((Human*)hum)->kill_humans.insert(this);
((Human*)hum)->SyncAroundPlayers(__FILE__, __LINE__, __func__);
((Human*)hum)->GetTrigger()->Kill(this);
if (weapon_id == VW_Tank) {
info.killer_id = killer->GetUniId();
info.killer_team_id = killer->team_id;
SendRollMsgEx
(info,
TEXT("battle_server_dead_car", "%s 使用 载具 干掉了 %s").c_str(),
{
killer_name,
name
});
} else {
{
info.killer_id = killer->GetUniId();
info.killer_team_id = killer->team_id;
SendRollMsgEx
@ -74,36 +64,6 @@ void KillMgr::OnHumanDead(Human* dead_hum, KillInfo* info)
});
}
break;
case VW_Spectate:
{
SendRollMsgEx
(info,
TEXT("battle_server_dead_specate", "%s ${weapon_text_icon}").c_str(),
{
name
});
}
break;
case VW_SelfDetonate:
{
SendRollMsgEx
(info,
TEXT("battle_server_dead_self_detonate", "%s ${weapon_text_icon}").c_str(),
{
name
});
}
break;
case VW_Mine:
{
SendRollMsgEx
(info,
TEXT("battle_server_dead_mine", "%s ${weapon_text_icon}").c_str(),
{
name
});
}
break;
default:
{
}
@ -112,6 +72,12 @@ void KillMgr::OnHumanDead(Human* dead_hum, KillInfo* info)
}
}
#endif
}
void KillMgr::PreprocessRollMsg(cs::SMRollMsg* pb_msg,
const char* fmt,
std::initializer_list<a8::XValue> args)
{
#if 0
cs::SMRollMsg *pb_msg = new cs::SMRollMsg;
{

View File

@ -27,6 +27,9 @@ class KillMgr : public a8::Singleton<KillMgr>
void OnHumanDead(Human* dead_hum, KillInfo* info);
private:
void PreprocessRollMsg(cs::SMRollMsg* pb_msg,
const char* fmt,
std::initializer_list<a8::XValue> args);
void BoradcastRollMsg(Human* dead_hum,
KillInfo* info,
int killer_team_id,

View File

@ -373,7 +373,7 @@ void Player::UpdateSpectate()
spectate = false;
return;
}
BeKill(GetUniId(), name, VW_Spectate);
BeKill(GetUniId(), name, 0);
spectate = false;
}
@ -1399,7 +1399,7 @@ void Player::_CMLeave(f8::MsgHdr& hdr, const cs::CMLeave& msg)
if (!leave_) {
if (room->BattleStarted()) {
//如果战斗已经开始算自杀
BeKill(GetUniId(), name, VW_Spectate);
BeKill(GetUniId(), name, 0);
}
leave_ = true;
leave_frameno_ = room->GetFrameNo();