This commit is contained in:
aozhiwei 2024-09-05 17:42:23 +08:00
parent 6fc087a1fd
commit 857f3ef773
2 changed files with 20 additions and 16 deletions

View File

@ -91,7 +91,7 @@ static float CalcSpeedRateIn(list_head* head)
} }
} }
s_speed_ratein_list.clear(); s_speed_ratein_list.clear();
return result; return result - 1.0f;
} }
static bool IsMulCalc(int attr_id) static bool IsMulCalc(int attr_id)
@ -352,9 +352,12 @@ void Ability::RecalcAttrRuduce(int attr_id)
} else { } else {
return; return;
} }
float new_val = 0.0f;
if (attr_id == kHAT_vSpeedRateIn) {
new_val = CalcSpeedRateIn(head);
} else {
list_head* pos = nullptr; list_head* pos = nullptr;
list_head* next = nullptr; list_head* next = nullptr;
float new_val = 0.0f;
bool inited = false; bool inited = false;
list_for_each_safe(pos, next, head) { list_for_each_safe(pos, next, head) {
AttrAddition* e = list_entry(pos, AttrAddition* e = list_entry(pos,
@ -370,6 +373,7 @@ void Ability::RecalcAttrRuduce(int attr_id)
new_val += e->value; new_val += e->value;
} }
} }
}
if (IsValidHumanAttr(attr_id)) { if (IsValidHumanAttr(attr_id)) {
std::get<0>(attr_dec_[attr_id]) = new_val; std::get<0>(attr_dec_[attr_id]) = new_val;
} else if (IsValidHumanVirtualAttr(attr_id)) { } else if (IsValidHumanVirtualAttr(attr_id)) {

View File

@ -3498,7 +3498,7 @@ float Creature::InternalGetSpeed()
ruduce = std::max(ruduce, GetAbility()->GetAttrRuduce(kHAT_vSpeedRateIn)); ruduce = std::max(ruduce, GetAbility()->GetAttrRuduce(kHAT_vSpeedRateIn));
#endif #endif
float rate = addition + ruduce; float rate = addition + ruduce;
finaly_speed *= 1.0f + std::min(mt::Param::s().speed_rate_max, rate / mt::Param::s().speed_rf); finaly_speed *= 1.0f + rate;
#ifdef MYDEBUG #ifdef MYDEBUG
if (IsPlayer() && finaly_speed > 500) { if (IsPlayer() && finaly_speed > 500) {
a8::XPrintf("player speed:%f\n", {finaly_speed}); a8::XPrintf("player speed:%f\n", {finaly_speed});