This commit is contained in:
aozhiwei 2019-07-25 11:54:49 +08:00
parent 1124b18595
commit cc3730473a
3 changed files with 24 additions and 2 deletions

View File

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

View File

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

View File

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