1
This commit is contained in:
parent
8c0bc41e93
commit
536a930d80
@ -1615,16 +1615,25 @@ void Human::RecalcBaseAttr()
|
||||
}
|
||||
}
|
||||
if (driver_meta_ && tank_meta_ && driver_meta_->i->g_type() == tank_meta_->i->type()) {
|
||||
std::map<int, float> attr_coeff_hash;
|
||||
for (auto& pair : driver_meta_->attr_up) {
|
||||
float* p_attr = GetAbilityById(pair.first);
|
||||
if (p_attr) {
|
||||
*p_attr += (driver.driver_lv / std::get<1>(pair.second)) * std::get<0>(pair.second);
|
||||
if (attr_coeff_hash.find(pair.first) == attr_coeff_hash.end()) {
|
||||
attr_coeff_hash[pair.first] = 0.0f;
|
||||
}
|
||||
attr_coeff_hash[pair.first] += std::get<0>(pair.second) + driver.driver_lv * std::get<1>(pair.second);
|
||||
}
|
||||
for (auto& pair : driver_meta_->passive_skill_attr) {
|
||||
if (driver.driver_lv >= std::get<1>(pair.second)) {
|
||||
if (attr_coeff_hash.find(pair.first) == attr_coeff_hash.end()) {
|
||||
attr_coeff_hash[pair.first] = 0.0f;
|
||||
}
|
||||
attr_coeff_hash[pair.first] += std::get<0>(pair.second);
|
||||
}
|
||||
}
|
||||
for (auto& pair : attr_coeff_hash) {
|
||||
float* p_attr = GetAbilityById(pair.first);
|
||||
if (p_attr && driver.driver_lv >= std::get<1>(pair.second)) {
|
||||
*p_attr += std::get<0>(pair.second);
|
||||
if (p_attr) {
|
||||
*p_attr = (*p_attr) * (1 + pair.second);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -392,9 +392,9 @@ namespace MetaData
|
||||
abort();
|
||||
}
|
||||
int attr_type = a8::XValue(strings2[0]);
|
||||
float attr_value = a8::XValue(strings2[1]).GetDouble();
|
||||
int attr_level = a8::XValue(strings2[2]).GetDouble();
|
||||
attr_up[attr_type] = std::make_tuple(attr_value, attr_level);
|
||||
float base_value = a8::XValue(strings2[1]).GetDouble();
|
||||
float up_value = a8::XValue(strings2[2]).GetDouble();
|
||||
attr_up[attr_type] = std::make_tuple(base_value, up_value);
|
||||
}
|
||||
}
|
||||
{
|
||||
|
@ -184,7 +184,7 @@ namespace MetaData
|
||||
const metatable::Driver* i = nullptr;
|
||||
|
||||
void Init();
|
||||
std::map<int, std::tuple<float, int>> attr_up;
|
||||
std::map<int, std::tuple<float, float>> attr_up;
|
||||
std::map<int, std::tuple<float, int>> passive_skill_attr;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user