1
This commit is contained in:
parent
e476451958
commit
016cea1b76
@ -121,6 +121,7 @@ enum BuffEffectType_e
|
|||||||
kBET_Invincible = 4, //无敌
|
kBET_Invincible = 4, //无敌
|
||||||
kBET_Camouflage = 5, //伪装
|
kBET_Camouflage = 5, //伪装
|
||||||
kBET_AdPlaying = 6, //看广告中
|
kBET_AdPlaying = 6, //看广告中
|
||||||
|
kBET_LordMode = 7, //上帝模式
|
||||||
kBET_OnceChgAttr = 11, //一次性buff
|
kBET_OnceChgAttr = 11, //一次性buff
|
||||||
kBET_End
|
kBET_End
|
||||||
};
|
};
|
||||||
@ -293,3 +294,5 @@ const int MAX_ALL_HTTP_NUM = MAX_SYS_HTTP_NUM + MAX_USER_HTTP_NUM;
|
|||||||
const int DEFAULT_BORN_POINT_X = 3000;
|
const int DEFAULT_BORN_POINT_X = 3000;
|
||||||
const int DEFAULT_BORN_POINT_Y = 3000;
|
const int DEFAULT_BORN_POINT_Y = 3000;
|
||||||
|
|
||||||
|
const int ADPLAY_BUFFID = 1006;
|
||||||
|
|
||||||
|
@ -93,6 +93,9 @@ void HandlerMgr::RegisterNetMsgHandlers()
|
|||||||
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMLeave);
|
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMLeave);
|
||||||
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMRevive);
|
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMRevive);
|
||||||
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMCancelRevive);
|
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMCancelRevive);
|
||||||
|
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMAdStart);
|
||||||
|
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMAdCancel);
|
||||||
|
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMAdEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandlerMgr::ProcGMMsg(unsigned long saddr, int sockhandle,
|
void HandlerMgr::ProcGMMsg(unsigned long saddr, int sockhandle,
|
||||||
|
@ -307,6 +307,7 @@ protected:
|
|||||||
HumanCar car_;
|
HumanCar car_;
|
||||||
|
|
||||||
MetaData::Skill* skill_meta_ = nullptr;
|
MetaData::Skill* skill_meta_ = nullptr;
|
||||||
|
xtimer_list* ad_timer_ = nullptr;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CircleCollider* self_collider_ = nullptr;
|
CircleCollider* self_collider_ = nullptr;
|
||||||
|
@ -1216,3 +1216,63 @@ void Player::_CMCancelRevive(f8::MsgHdr& hdr, const cs::CMCancelRevive& msg)
|
|||||||
{
|
{
|
||||||
CancelRevive();
|
CancelRevive();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Player::_CMAdStart(f8::MsgHdr& hdr, const cs::CMAdStart& msg)
|
||||||
|
{
|
||||||
|
if (downed || dead) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (GetBuffByEffectId(kBET_LordMode)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (GetBuffByEffectId(kBET_AdPlaying)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(ADPLAY_BUFFID);
|
||||||
|
if (buff_meta) {
|
||||||
|
AddBuff(buff_meta, 1);
|
||||||
|
room->xtimer.
|
||||||
|
AddDeadLineTimerAndAttach(
|
||||||
|
buff_meta->i->duration_time() * SYNC_FRAME_RATE + 2,
|
||||||
|
a8::XParams()
|
||||||
|
.SetSender(this),
|
||||||
|
[] (const a8::XParams& param)
|
||||||
|
{
|
||||||
|
|
||||||
|
},
|
||||||
|
&xtimer_attacher.timer_list,
|
||||||
|
[] (const a8::XParams& param)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Player::_CMAdCancel(f8::MsgHdr& hdr, const cs::CMAdCancel& msg)
|
||||||
|
{
|
||||||
|
if (GetBuffByEffectId(kBET_LordMode)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (GetBuffByEffectId(kBET_AdPlaying)) {
|
||||||
|
RemoveBuffByEffectId(kBET_AdPlaying);
|
||||||
|
if (ad_timer_) {
|
||||||
|
room->xtimer.DeleteTimer(ad_timer_);
|
||||||
|
ad_timer_ = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Player::_CMAdEnd(f8::MsgHdr& hdr, const cs::CMAdEnd& msg)
|
||||||
|
{
|
||||||
|
if (GetBuffByEffectId(kBET_LordMode)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (GetBuffByEffectId(kBET_AdPlaying)) {
|
||||||
|
RemoveBuffByEffectId(kBET_AdPlaying);
|
||||||
|
if (ad_timer_) {
|
||||||
|
room->xtimer.DeleteTimer(ad_timer_);
|
||||||
|
ad_timer_ = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -95,5 +95,8 @@ class Player : public Human
|
|||||||
void _CMLeave(f8::MsgHdr& hdr, const cs::CMLeave& msg);
|
void _CMLeave(f8::MsgHdr& hdr, const cs::CMLeave& msg);
|
||||||
void _CMRevive(f8::MsgHdr& hdr, const cs::CMRevive& msg);
|
void _CMRevive(f8::MsgHdr& hdr, const cs::CMRevive& msg);
|
||||||
void _CMCancelRevive(f8::MsgHdr& hdr, const cs::CMCancelRevive& msg);
|
void _CMCancelRevive(f8::MsgHdr& hdr, const cs::CMCancelRevive& msg);
|
||||||
|
void _CMAdStart(f8::MsgHdr& hdr, const cs::CMAdStart& msg);
|
||||||
|
void _CMAdCancel(f8::MsgHdr& hdr, const cs::CMAdCancel& msg);
|
||||||
|
void _CMAdEnd(f8::MsgHdr& hdr, const cs::CMAdEnd& msg);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -14,6 +14,9 @@ enum CMMessageId_e
|
|||||||
_CMLeave = 209;
|
_CMLeave = 209;
|
||||||
_CMRevive = 210;
|
_CMRevive = 210;
|
||||||
_CMCancelRevive = 211;
|
_CMCancelRevive = 211;
|
||||||
|
_CMAdStart = 212;
|
||||||
|
_CMAdCancel = 213;
|
||||||
|
_CMAdEnd = 214;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum SMMessageId_e
|
enum SMMessageId_e
|
||||||
|
@ -782,6 +782,7 @@ message CMAdCancel
|
|||||||
//广告播放完毕(玩家看完广告)
|
//广告播放完毕(玩家看完广告)
|
||||||
message CMAdEnd
|
message CMAdEnd
|
||||||
{
|
{
|
||||||
|
optional int32 param = 1; //1:屠夫 2:南瓜
|
||||||
}
|
}
|
||||||
|
|
||||||
//endcmmsg
|
//endcmmsg
|
||||||
|
Loading…
x
Reference in New Issue
Block a user