This commit is contained in:
aozhiwei 2021-06-18 13:31:31 +08:00
parent 65c6094079
commit d396d12c8f
4 changed files with 41 additions and 13 deletions

View File

@ -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;
}
}

View File

@ -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);

View File

@ -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

View File

@ -600,6 +600,7 @@ void Player::LootInteraction(Loot* entity)
break;
case EQUIP_TYPE_SPOILS:
{
ProcSpoils(entity, item_meta);
}
break;