复活添加变身buff
This commit is contained in:
parent
3af2905498
commit
2038ae2ae2
@ -1162,6 +1162,7 @@ void Player::_CMRevive(f8::MsgHdr& hdr, const cs::CMRevive& msg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
InternalAdOk();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1221,35 +1222,7 @@ void Player::_CMAdEnd(f8::MsgHdr& hdr, const cs::CMAdEnd& msg)
|
|||||||
if (GetBuffByEffectId(kBET_LordMode)) {
|
if (GetBuffByEffectId(kBET_LordMode)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (GetBuffByEffectId(kBET_AdPlaying)) {
|
InternalAdOk();
|
||||||
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(ADPLAY_BUFFID);
|
|
||||||
if (buff_meta) {
|
|
||||||
MetaData::Buff* lord_buff_meta = nullptr;
|
|
||||||
if (msg.param() == 1) {
|
|
||||||
lord_buff_meta = MetaMgr::Instance()->GetBuff(buff_meta->param1);
|
|
||||||
} else if (msg.param() == 2) {
|
|
||||||
lord_buff_meta = MetaMgr::Instance()->GetBuff(buff_meta->param2);
|
|
||||||
}
|
|
||||||
if (lord_buff_meta) {
|
|
||||||
a8::SetBitFlag(status, HS_AlreadyLordMode);
|
|
||||||
AddBuff(lord_buff_meta, 1);
|
|
||||||
std::vector<std::string> strings;
|
|
||||||
a8::Split(lord_buff_meta->i->buff_param1(), strings, ':');
|
|
||||||
for (auto& str : strings) {
|
|
||||||
int buff_id = a8::XValue(str);
|
|
||||||
MetaData::Buff* ext_buff_meta = MetaMgr::Instance()->GetBuff(buff_id);
|
|
||||||
if (ext_buff_meta) {
|
|
||||||
AddBuff(ext_buff_meta, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RemoveBuffByEffectId(kBET_AdPlaying);
|
|
||||||
if (ad_timer_) {
|
|
||||||
room->xtimer.DeleteTimer(ad_timer_);
|
|
||||||
ad_timer_ = nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::InternalAdCancel()
|
void Player::InternalAdCancel()
|
||||||
@ -1265,3 +1238,37 @@ void Player::InternalAdCancel()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Player::InternalAdOk()
|
||||||
|
{
|
||||||
|
if (a8::HasBitFlag(status, HS_AlreadyLordMode)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(ADPLAY_BUFFID);
|
||||||
|
if (buff_meta) {
|
||||||
|
MetaData::Buff* lord_buff_meta = nullptr;
|
||||||
|
if (rand() % 2 < 1) {
|
||||||
|
lord_buff_meta = MetaMgr::Instance()->GetBuff(buff_meta->param1);
|
||||||
|
} else {
|
||||||
|
lord_buff_meta = MetaMgr::Instance()->GetBuff(buff_meta->param2);
|
||||||
|
}
|
||||||
|
if (lord_buff_meta) {
|
||||||
|
a8::SetBitFlag(status, HS_AlreadyLordMode);
|
||||||
|
AddBuff(lord_buff_meta, 1);
|
||||||
|
std::vector<std::string> strings;
|
||||||
|
a8::Split(lord_buff_meta->i->buff_param1(), strings, ':');
|
||||||
|
for (auto& str : strings) {
|
||||||
|
int buff_id = a8::XValue(str);
|
||||||
|
MetaData::Buff* ext_buff_meta = MetaMgr::Instance()->GetBuff(buff_id);
|
||||||
|
if (ext_buff_meta) {
|
||||||
|
AddBuff(ext_buff_meta, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RemoveBuffByEffectId(kBET_AdPlaying);
|
||||||
|
if (ad_timer_) {
|
||||||
|
room->xtimer.DeleteTimer(ad_timer_);
|
||||||
|
ad_timer_ = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -101,4 +101,5 @@ class Player : public Human
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void InternalAdCancel();
|
void InternalAdCancel();
|
||||||
|
void InternalAdOk();
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user