This commit is contained in:
aozhiwei 2023-03-28 13:58:21 +08:00
parent 024b9ddece
commit d79b1d0d0b
3 changed files with 15 additions and 10 deletions

View File

@ -456,7 +456,7 @@ AttrAdditionHandle Ability::AddAttr(int attr_id, float rate)
if (IsValidHumanAttr(attr_id)) {
list_add_tail(&p->entry, &std::get<1>(attr_add_[attr_id]));
} else {
list_add_tail(&p->entry, &std::get<1>(vattr_add_[attr_id]));
list_add_tail(&p->entry, &std::get<1>(vattr_add_[attr_id - kHVAT_Begin]));
}
RecalcAttrAddition(attr_id);
return p->ptr;
@ -482,7 +482,7 @@ AttrRuduceHandle Ability::DecAttr(int attr_id, float rate)
if (IsValidHumanAttr(attr_id)) {
list_add_tail(&p->entry, &std::get<1>(attr_dec_[attr_id]));
} else {
list_add_tail(&p->entry, &std::get<1>(vattr_dec_[attr_id]));
list_add_tail(&p->entry, &std::get<1>(vattr_dec_[attr_id - kHVAT_Begin]));
}
RecalcAttrRuduce(attr_id);
return p->ptr;
@ -506,7 +506,7 @@ void Ability::RecalcAttrAddition(int attr_id)
if (IsValidHumanAttr(attr_id)) {
head = &std::get<1>(attr_add_[attr_id]);
} else if (IsValidHumanVirtualAttr(attr_id)) {
head = &std::get<1>(vattr_add_[attr_id]);
head = &std::get<1>(vattr_add_[attr_id - kHVAT_Begin]);
} else {
return;
}
@ -528,7 +528,7 @@ void Ability::RecalcAttrRuduce(int attr_id)
if (IsValidHumanAttr(attr_id)) {
head = &std::get<1>(attr_dec_[attr_id]);
} else if (IsValidHumanVirtualAttr(attr_id)) {
head = &std::get<1>(vattr_dec_[attr_id]);
head = &std::get<1>(vattr_dec_[attr_id - kHVAT_Begin]);
} else {
return;
}
@ -571,7 +571,7 @@ float Ability::GetAttrAddition(int attr_id)
if (IsValidHumanAttr(attr_id)) {
return std::get<0>(attr_add_[attr_id]);
} else if (IsValidHumanVirtualAttr(attr_id)) {
return std::get<0>(vattr_add_[attr_id]);
return std::get<0>(vattr_add_[attr_id - kHVAT_Begin]);
} else {
return 0.0f;
}
@ -582,7 +582,7 @@ float Ability::GetAttrRuduce(int attr_id)
if (IsValidHumanAttr(attr_id)) {
return std::get<0>(attr_dec_[attr_id]);
} else if (IsValidHumanVirtualAttr(attr_id)) {
return std::get<0>(vattr_dec_[attr_id]);
return std::get<0>(vattr_dec_[attr_id - kHVAT_Begin]);
} else {
return 0.0f;
}

View File

@ -3088,10 +3088,10 @@ float Creature::GetSpeed()
float addition = 0.0f;
float ruduce = 0.0f;
if (aiming) {
if (GetHeroMeta()->fall_speed() > ONE_LIMIT) {
addition += GetHeroMeta()->fall_speed();
if (GetHeroMeta()->aim_speed() > ONE_LIMIT) {
addition += GetHeroMeta()->aim_speed();
} else {
ruduce += GetHeroMeta()->fall_speed();
ruduce += GetHeroMeta()->aim_speed();
}
} else if (action_type == AT_Reload) {
if (GetHeroMeta()->reload_speed() > ONE_LIMIT) {
@ -3132,6 +3132,11 @@ float Creature::GetSpeed()
ruduce = std::max(ruduce, GetAbility()->GetAttrRuduce(kHAT_Speed));
float rate = addition - ruduce;
finaly_speed *= 1.0f + rate;
#ifdef DEBUG
if (IsPlayer() && finaly_speed >500) {
a8::XPrintf("player speed:%f\n", {finaly_speed});
}
#endif
}
return std::max(min_speed, finaly_speed) / SERVER_FRAME_RATE;
}

View File

@ -58,7 +58,7 @@ int Skill::GetCd()
meta->skill_type() == kPassiveSkill) {
return meta->skill_cd() * 1000;
} else {
return meta->skill_cd() * 1000 * (1 + owner->GetBattleConetxt()->GetSkillCdPct());
return meta->skill_cd() * 1000 * (1 + owner->GetBattleContext()->GetSkillCdPct());
}
}