1
This commit is contained in:
parent
4e18a90b59
commit
9b883ac099
@ -2635,7 +2635,7 @@ void Human::ProcLootCar(Loot* entity, MetaData::Equip* item_meta)
|
|||||||
SetPos(entity->GetPos());
|
SetPos(entity->GetPos());
|
||||||
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(car_.meta->i->buffid());
|
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(car_.meta->i->buffid());
|
||||||
if (buff_meta) {
|
if (buff_meta) {
|
||||||
AddBuff(buff_meta, 1);
|
AddBuff(this, buff_meta, 1);
|
||||||
}
|
}
|
||||||
CancelAction();
|
CancelAction();
|
||||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||||
@ -2876,21 +2876,21 @@ void Human::TriggerOneObjectBuff(Entity* target, BuffTriggerType_e trigger_type)
|
|||||||
case kBuffTargetSelf: //自己
|
case kBuffTargetSelf: //自己
|
||||||
{
|
{
|
||||||
if (hum == this) {
|
if (hum == this) {
|
||||||
hum->AddBuff(buff_meta, GetSkillLv());
|
hum->AddBuff(this, buff_meta, GetSkillLv());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case kBuffTargetFriendly: //友军
|
case kBuffTargetFriendly: //友军
|
||||||
{
|
{
|
||||||
if (hum->team_id == team_id) {
|
if (hum->team_id == team_id) {
|
||||||
hum->AddBuff(buff_meta, GetSkillLv());
|
hum->AddBuff(this, buff_meta, GetSkillLv());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case kBuffTargetEnemy: //敌军
|
case kBuffTargetEnemy: //敌军
|
||||||
{
|
{
|
||||||
if (hum->team_id != team_id) {
|
if (hum->team_id != team_id) {
|
||||||
hum->AddBuff(buff_meta, GetSkillLv());
|
hum->AddBuff(this, buff_meta, GetSkillLv());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -2908,7 +2908,7 @@ void Human::TriggerBuff(std::set<Entity*>& target_list, BuffTriggerType_e trigge
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Human::AddBuff(MetaData::Buff* buff_meta, int skill_lv)
|
void Human::AddBuff(Human* caster, MetaData::Buff* buff_meta, int skill_lv)
|
||||||
{
|
{
|
||||||
if (GetBuffById(buff_meta->i->buff_id())) {
|
if (GetBuffById(buff_meta->i->buff_id())) {
|
||||||
return;
|
return;
|
||||||
@ -2956,7 +2956,7 @@ void Human::AddBuff(MetaData::Buff* buff_meta, int skill_lv)
|
|||||||
&buff->xtimer_attacher.timer_list_
|
&buff->xtimer_attacher.timer_list_
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
ProcBuffEffect(buff);
|
ProcBuffEffect(caster, buff);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Human::RemoveBuffById(int buff_id)
|
void Human::RemoveBuffById(int buff_id)
|
||||||
@ -3008,7 +3008,7 @@ bool Human::HasBuffEffect(int buff_effect_id)
|
|||||||
return GetBuffByEffectId(buff_effect_id) != nullptr;
|
return GetBuffByEffectId(buff_effect_id) != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Human::ProcBuffEffect(Buff* buff)
|
void Human::ProcBuffEffect(Human* caster, Buff* buff)
|
||||||
{
|
{
|
||||||
switch (buff->meta->i->buff_effect()) {
|
switch (buff->meta->i->buff_effect()) {
|
||||||
case kBET_ChgAttr:
|
case kBET_ChgAttr:
|
||||||
@ -3217,7 +3217,7 @@ void Human::Revive()
|
|||||||
{
|
{
|
||||||
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(kREVIVE_BUFF_ID);
|
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(kREVIVE_BUFF_ID);
|
||||||
if (buff_meta) {
|
if (buff_meta) {
|
||||||
AddBuff(buff_meta, 1);
|
AddBuff(this, buff_meta, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
room->frame_event.AddRevive(this);
|
room->frame_event.AddRevive(this);
|
||||||
@ -3772,7 +3772,7 @@ void Human::AddPassiveSkillBuff(MetaData::Skill* skill_meta)
|
|||||||
for (int buff_id : skill_meta->buff_list) {
|
for (int buff_id : skill_meta->buff_list) {
|
||||||
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(buff_id);
|
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(buff_id);
|
||||||
if (buff_meta) {
|
if (buff_meta) {
|
||||||
AddBuff(buff_meta, buff_id);
|
AddBuff(this, buff_meta, buff_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -255,14 +255,14 @@ class Human : public MoveableEntity
|
|||||||
float GetSkillAtkAdd(int skill_id);
|
float GetSkillAtkAdd(int skill_id);
|
||||||
void TriggerOneObjectBuff(Entity* target, BuffTriggerType_e trigger_type);
|
void TriggerOneObjectBuff(Entity* target, BuffTriggerType_e trigger_type);
|
||||||
void TriggerBuff(std::set<Entity*>& target_list, BuffTriggerType_e trigger_type);
|
void TriggerBuff(std::set<Entity*>& target_list, BuffTriggerType_e trigger_type);
|
||||||
void AddBuff(MetaData::Buff* buff_meta, int skill_lv);
|
void AddBuff(Human* caster, MetaData::Buff* buff_meta, int skill_lv);
|
||||||
void RemoveBuffById(int buff_id);
|
void RemoveBuffById(int buff_id);
|
||||||
void RemoveBuffByEffectId(int buff_effect_id);
|
void RemoveBuffByEffectId(int buff_effect_id);
|
||||||
void ClearBuffList();
|
void ClearBuffList();
|
||||||
bool HasBuffEffect(int buff_effect_id);
|
bool HasBuffEffect(int buff_effect_id);
|
||||||
Buff* GetBuffByEffectId(int effect_id);
|
Buff* GetBuffByEffectId(int effect_id);
|
||||||
void RecalcBuffAttr();
|
void RecalcBuffAttr();
|
||||||
void ProcBuffEffect(Buff* buff);
|
void ProcBuffEffect(Human* caster, Buff* buff);
|
||||||
int GetLevel() {return 1;};
|
int GetLevel() {return 1;};
|
||||||
void OnAttack() {};
|
void OnAttack() {};
|
||||||
void OnHit() {};
|
void OnHit() {};
|
||||||
|
@ -282,7 +282,7 @@ void Player::UpdateUseItemId()
|
|||||||
if (HasBuffEffect(kBET_Camouflage)) {
|
if (HasBuffEffect(kBET_Camouflage)) {
|
||||||
RemoveBuffByEffectId(kBET_Camouflage);
|
RemoveBuffByEffectId(kBET_Camouflage);
|
||||||
}
|
}
|
||||||
AddBuff(buff_meta, 1);
|
AddBuff(this, buff_meta, 1);
|
||||||
DecItem(use_item_id, 1);
|
DecItem(use_item_id, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -800,7 +800,7 @@ void Player::ProcPrepareItems(const ::google::protobuf::RepeatedField< ::google:
|
|||||||
car_.meta = item_meta;
|
car_.meta = item_meta;
|
||||||
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(car_.meta->i->buffid());
|
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(car_.meta->i->buffid());
|
||||||
if (buff_meta) {
|
if (buff_meta) {
|
||||||
AddBuff(buff_meta, 1);
|
AddBuff(this, buff_meta, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1213,7 +1213,7 @@ void Player::_CMRevive(f8::MsgHdr& hdr, const cs::CMRevive& msg)
|
|||||||
{
|
{
|
||||||
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(kREVIVE_BUFF_ID);
|
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(kREVIVE_BUFF_ID);
|
||||||
if (buff_meta) {
|
if (buff_meta) {
|
||||||
AddBuff(buff_meta, 1);
|
AddBuff(this, buff_meta, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1246,7 +1246,7 @@ void Player::_CMAdStart(f8::MsgHdr& hdr, const cs::CMAdStart& msg)
|
|||||||
}
|
}
|
||||||
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(ADPLAY_BUFFID);
|
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(ADPLAY_BUFFID);
|
||||||
if (buff_meta) {
|
if (buff_meta) {
|
||||||
AddBuff(buff_meta, 1);
|
AddBuff(this, buff_meta, 1);
|
||||||
room->xtimer.
|
room->xtimer.
|
||||||
AddDeadLineTimerAndAttach(
|
AddDeadLineTimerAndAttach(
|
||||||
buff_meta->i->duration_time() * SERVER_FRAME_RATE + 2,
|
buff_meta->i->duration_time() * SERVER_FRAME_RATE + 2,
|
||||||
@ -1309,14 +1309,14 @@ void Player::InternalAdOk()
|
|||||||
}
|
}
|
||||||
if (lord_buff_meta) {
|
if (lord_buff_meta) {
|
||||||
a8::SetBitFlag(status, HS_AlreadyLordMode);
|
a8::SetBitFlag(status, HS_AlreadyLordMode);
|
||||||
AddBuff(lord_buff_meta, 1);
|
AddBuff(this, lord_buff_meta, 1);
|
||||||
std::vector<std::string> strings;
|
std::vector<std::string> strings;
|
||||||
a8::Split(lord_buff_meta->i->buff_param1(), strings, ':');
|
a8::Split(lord_buff_meta->i->buff_param1(), strings, ':');
|
||||||
for (auto& str : strings) {
|
for (auto& str : strings) {
|
||||||
int buff_id = a8::XValue(str);
|
int buff_id = a8::XValue(str);
|
||||||
MetaData::Buff* ext_buff_meta = MetaMgr::Instance()->GetBuff(buff_id);
|
MetaData::Buff* ext_buff_meta = MetaMgr::Instance()->GetBuff(buff_id);
|
||||||
if (ext_buff_meta) {
|
if (ext_buff_meta) {
|
||||||
AddBuff(ext_buff_meta, 1);
|
AddBuff(this, ext_buff_meta, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2555,7 +2555,7 @@ void Room::AddPlayerPostProc(Player* hum)
|
|||||||
for (int buff_id : MetaMgr::Instance()->newbie_buff_list) {
|
for (int buff_id : MetaMgr::Instance()->newbie_buff_list) {
|
||||||
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(buff_id);
|
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(buff_id);
|
||||||
if (buff_meta) {
|
if (buff_meta) {
|
||||||
hum->AddBuff(buff_meta, 1);
|
hum->AddBuff(hum, buff_meta, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (room_type_ == RT_MidBrid) {
|
if (room_type_ == RT_MidBrid) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user