1
This commit is contained in:
parent
024b9ddece
commit
d79b1d0d0b
@ -456,7 +456,7 @@ AttrAdditionHandle Ability::AddAttr(int attr_id, float rate)
|
|||||||
if (IsValidHumanAttr(attr_id)) {
|
if (IsValidHumanAttr(attr_id)) {
|
||||||
list_add_tail(&p->entry, &std::get<1>(attr_add_[attr_id]));
|
list_add_tail(&p->entry, &std::get<1>(attr_add_[attr_id]));
|
||||||
} else {
|
} 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);
|
RecalcAttrAddition(attr_id);
|
||||||
return p->ptr;
|
return p->ptr;
|
||||||
@ -482,7 +482,7 @@ AttrRuduceHandle Ability::DecAttr(int attr_id, float rate)
|
|||||||
if (IsValidHumanAttr(attr_id)) {
|
if (IsValidHumanAttr(attr_id)) {
|
||||||
list_add_tail(&p->entry, &std::get<1>(attr_dec_[attr_id]));
|
list_add_tail(&p->entry, &std::get<1>(attr_dec_[attr_id]));
|
||||||
} else {
|
} 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);
|
RecalcAttrRuduce(attr_id);
|
||||||
return p->ptr;
|
return p->ptr;
|
||||||
@ -506,7 +506,7 @@ void Ability::RecalcAttrAddition(int attr_id)
|
|||||||
if (IsValidHumanAttr(attr_id)) {
|
if (IsValidHumanAttr(attr_id)) {
|
||||||
head = &std::get<1>(attr_add_[attr_id]);
|
head = &std::get<1>(attr_add_[attr_id]);
|
||||||
} else if (IsValidHumanVirtualAttr(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 {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -528,7 +528,7 @@ void Ability::RecalcAttrRuduce(int attr_id)
|
|||||||
if (IsValidHumanAttr(attr_id)) {
|
if (IsValidHumanAttr(attr_id)) {
|
||||||
head = &std::get<1>(attr_dec_[attr_id]);
|
head = &std::get<1>(attr_dec_[attr_id]);
|
||||||
} else if (IsValidHumanVirtualAttr(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 {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -571,7 +571,7 @@ float Ability::GetAttrAddition(int attr_id)
|
|||||||
if (IsValidHumanAttr(attr_id)) {
|
if (IsValidHumanAttr(attr_id)) {
|
||||||
return std::get<0>(attr_add_[attr_id]);
|
return std::get<0>(attr_add_[attr_id]);
|
||||||
} else if (IsValidHumanVirtualAttr(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 {
|
} else {
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
@ -582,7 +582,7 @@ float Ability::GetAttrRuduce(int attr_id)
|
|||||||
if (IsValidHumanAttr(attr_id)) {
|
if (IsValidHumanAttr(attr_id)) {
|
||||||
return std::get<0>(attr_dec_[attr_id]);
|
return std::get<0>(attr_dec_[attr_id]);
|
||||||
} else if (IsValidHumanVirtualAttr(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 {
|
} else {
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
|
@ -3088,10 +3088,10 @@ float Creature::GetSpeed()
|
|||||||
float addition = 0.0f;
|
float addition = 0.0f;
|
||||||
float ruduce = 0.0f;
|
float ruduce = 0.0f;
|
||||||
if (aiming) {
|
if (aiming) {
|
||||||
if (GetHeroMeta()->fall_speed() > ONE_LIMIT) {
|
if (GetHeroMeta()->aim_speed() > ONE_LIMIT) {
|
||||||
addition += GetHeroMeta()->fall_speed();
|
addition += GetHeroMeta()->aim_speed();
|
||||||
} else {
|
} else {
|
||||||
ruduce += GetHeroMeta()->fall_speed();
|
ruduce += GetHeroMeta()->aim_speed();
|
||||||
}
|
}
|
||||||
} else if (action_type == AT_Reload) {
|
} else if (action_type == AT_Reload) {
|
||||||
if (GetHeroMeta()->reload_speed() > ONE_LIMIT) {
|
if (GetHeroMeta()->reload_speed() > ONE_LIMIT) {
|
||||||
@ -3132,6 +3132,11 @@ float Creature::GetSpeed()
|
|||||||
ruduce = std::max(ruduce, GetAbility()->GetAttrRuduce(kHAT_Speed));
|
ruduce = std::max(ruduce, GetAbility()->GetAttrRuduce(kHAT_Speed));
|
||||||
float rate = addition - ruduce;
|
float rate = addition - ruduce;
|
||||||
finaly_speed *= 1.0f + rate;
|
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;
|
return std::max(min_speed, finaly_speed) / SERVER_FRAME_RATE;
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ int Skill::GetCd()
|
|||||||
meta->skill_type() == kPassiveSkill) {
|
meta->skill_type() == kPassiveSkill) {
|
||||||
return meta->skill_cd() * 1000;
|
return meta->skill_cd() * 1000;
|
||||||
} else {
|
} else {
|
||||||
return meta->skill_cd() * 1000 * (1 + owner->GetBattleConetxt()->GetSkillCdPct());
|
return meta->skill_cd() * 1000 * (1 + owner->GetBattleContext()->GetSkillCdPct());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user