Fix scaling and display for cor / phr

This commit is contained in:
Akkadius 2019-06-11 15:19:27 -05:00
parent 79d8a6329c
commit 660416065e
3 changed files with 12 additions and 4 deletions

View File

@ -189,11 +189,11 @@ inline std::string GetMobAttributeByString(Mob *mob, const std::string &attribut
}
if (attribute == "cor") {
return std::to_string(mob->GetCorrup());
return commify(std::to_string(mob->GetCorrup())) + scaling_modified;
}
if (attribute == "phy") {
return std::to_string(mob->GetPhR());
return commify(std::to_string(mob->GetPhR())) + scaling_modified;
}
if (attribute == "name") {

View File

@ -2215,6 +2215,14 @@ void NPC::ModifyNPCStat(const char *identifier, const char *new_value)
CR = atoi(val.c_str());
return;
}
else if (id == "cor") {
Corrup = atoi(val.c_str());
return;
}
else if (id == "phr") {
PhR = atoi(val.c_str());
return;
}
else if (id == "pr") {
PR = atoi(val.c_str());
return;

View File

@ -98,10 +98,10 @@ void NpcScaleManager::ScaleNPC(NPC * npc)
npc->ModifyNPCStat("dr", std::to_string(scale_data.disease_resist).c_str());
}
if (npc->GetCorrup() == 0) {
npc->ModifyNPCStat("cr", std::to_string(scale_data.corruption_resist).c_str());
npc->ModifyNPCStat("cor", std::to_string(scale_data.corruption_resist).c_str());
}
if (npc->GetPhR() == 0) {
npc->ModifyNPCStat("pr", std::to_string(scale_data.physical_resist).c_str());
npc->ModifyNPCStat("phr", std::to_string(scale_data.physical_resist).c_str());
}
if (npc->GetMinDMG() == 0 && npc->GetMaxDMG() == 0) {
int min_dmg = scale_data.min_dmg;