diff --git a/server/gameserver/bullet.cc b/server/gameserver/bullet.cc index 0faed9d..1219820 100644 --- a/server/gameserver/bullet.cc +++ b/server/gameserver/bullet.cc @@ -158,6 +158,12 @@ void Bullet::ProcBomb() { ProcSignalGunBomb(delay_time); } + break; + case IS_SHIELD_WALL: + { + ProcShieldWallBomb(delay_time); + } + break; default: { } @@ -214,7 +220,8 @@ bool Bullet::IsBomb() meta->i->_inventory_slot() == IS_POSION_GAS_BOMB || meta->i->_inventory_slot() == IS_MOLOTOR_COCKTAIL || meta->i->_inventory_slot() == IS_C4 || - meta->i->_inventory_slot() == IS_SINGAL_GUN; + meta->i->_inventory_slot() == IS_SINGAL_GUN || + meta->i->_inventory_slot() == IS_SHIELD_WALL; } void Bullet::MapServiceUpdate() @@ -411,3 +418,19 @@ void Bullet::ProcSignalGunBomb(int delay_time) sender.Get()->buff_vec2_param1 = old_buff_vec2_param1; } } + +void Bullet::ProcShieldWallBomb(int delay_time) +{ + if (sender.Get()) { + a8::Vec2 old_buff_vec2_param1 = sender.Get()->buff_vec2_param1; + sender.Get()->buff_vec2_param1 = GetPos(); + MetaData::Buff * buff_meta = MetaMgr::Instance()->GetBuff(gun_meta->i->buffid()); + if (buff_meta) { + sender.Get()->AddBuff(sender.Get(), + buff_meta, + 1 + ); + } + sender.Get()->buff_vec2_param1 = old_buff_vec2_param1; + } +} diff --git a/server/gameserver/bullet.h b/server/gameserver/bullet.h index 2b88b56..c785b64 100644 --- a/server/gameserver/bullet.h +++ b/server/gameserver/bullet.h @@ -51,6 +51,7 @@ protected: void ProcMolotorCocktailBomb(int delay_time); void ProcC4Bomb(int delay_time); void ProcSignalGunBomb(int delay_time); + void ProcShieldWallBomb(int delay_time); inline void MapServiceUpdate(); void Check(float distance); diff --git a/server/gameserver/creature.cc b/server/gameserver/creature.cc index 5eb1866..feb658f 100644 --- a/server/gameserver/creature.cc +++ b/server/gameserver/creature.cc @@ -290,6 +290,21 @@ void Creature::RemoveBuffById(int buff_id) for (auto& tuple1 : removed_buffs) { MetaData::Buff* buff_meta = std::get<0>(tuple1); Creature* caster = std::get<1>(tuple1); + + for (int child_buff_id : buff_meta->child_buff_list) { + RemoveBuffById(child_buff_id); + } + + if (!HasBuffEffect(buff_meta->i->buff_effect()) && + !list_empty(&depend_effect_[buff_meta->i->buff_effect()])) { + struct list_head work_list; + list_replace_init(&depend_effect_[buff_meta->i->buff_effect()], &work_list); + while (!list_empty(&work_list)) { + Buff* buff = list_first_entry(&work_list, Buff, depend_entry); + RemoveBuffById(buff->meta->i->buff_id()); + } + } + for (const auto& tuple : buff_meta->post_remove_action) { switch (std::get<0>(tuple)) { case kRemoveBuffByIdAction: @@ -317,18 +332,6 @@ void Creature::RemoveBuffById(int buff_id) break; } } - for (int child_buff_id : buff_meta->child_buff_list) { - RemoveBuffById(child_buff_id); - } - if (!HasBuffEffect(buff_meta->i->buff_effect()) && - !list_empty(&depend_effect_[buff_meta->i->buff_effect()])) { - struct list_head work_list; - list_replace_init(&depend_effect_[buff_meta->i->buff_effect()], &work_list); - while (!list_empty(&work_list)) { - Buff* buff = list_first_entry(&work_list, Buff, depend_entry); - RemoveBuffById(buff->meta->i->buff_id()); - } - } } RecalcBuffAttr(); #ifdef DEBUG diff --git a/server/gameserver/player.cc b/server/gameserver/player.cc index 1b05c3d..81010d3 100644 --- a/server/gameserver/player.cc +++ b/server/gameserver/player.cc @@ -600,6 +600,7 @@ void Player::LootInteraction(Loot* entity) break; case EQUIP_TYPE_SPOILS: { + ProcSpoils(entity, item_meta); } break;