diff --git a/server/gameserver/bullet.cc b/server/gameserver/bullet.cc index dc65883..6c374c8 100644 --- a/server/gameserver/bullet.cc +++ b/server/gameserver/bullet.cc @@ -62,7 +62,7 @@ void Bullet::Update(int delta_time) } } } - float bullet_range = meta->i->range() + ability.shot_range + buff_attr_abs_[kHAT_ShotRange]; + float bullet_range = meta->i->range() + master->ability.shot_range + master->BuffAttrAbs(kHAT_ShotRange); if (!objects.empty() || distance > bullet_range || (IsBomb() && distance >= fly_distance) ) { @@ -238,7 +238,9 @@ void Bullet::ProcMissible(const a8::XParams& param) Human* target = sender->room->GetHumanByUniId(param.param2); if (target && !target->dead) { if (bullet_meta->i->equip_subtype() == kBulletType_Trace) { - float bullet_range = bullet_meta->i->range() + ability.shot_range + buff_attr_abs_[kHAT_ShotRange]; + float bullet_range = bullet_meta->i->range() + + sender->ability.shot_range + + sender->BuffAttrAbs(kHAT_ShotRange); if (src_pos.Distance(target->pos) < bullet_range) { target->OnHit(); if (!target->HasBuffEffect(kBET_Invincible)) { diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 390e0db..b3da47c 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -1581,6 +1581,24 @@ void Human::SendGameOver() } } +float Human::BuffAttrAbs(int buff_effect_id) +{ + if (buff_effect_id >= kBET_Begin && buff_effect_id < kBET_End) { + return buff_attr_abs_[buff_effect_id]; + } else { + return 0.0f; + } +} + +float Human::BuffAttrRate(int buff_effect_id) +{ + if (buff_effect_id >= kBET_Begin && buff_effect_id < kBET_End) { + return buff_attr_rate_[buff_effect_id]; + } else { + return 0.0f; + } +} + void Human::_UpdateMove(int speed) { for (int i = 0; i < speed; ++i) { diff --git a/server/gameserver/human.h b/server/gameserver/human.h index c2ce5e5..aa32ee1 100644 --- a/server/gameserver/human.h +++ b/server/gameserver/human.h @@ -200,6 +200,8 @@ class Human : public Entity float* GetAbilityById(int attr_id); void RecalcBaseAttr(); void SendGameOver(); + float BuffAttrAbs(int buff_effect_id); + float BuffAttrRate(int buff_effect_id); protected: void _UpdateMove(int speed);