From 28a630d9e734e24c04a539b6ecc5bd1a4ecd1471 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Thu, 29 Jan 2015 17:07:29 -0500 Subject: [PATCH] Fix an ability strength of 7-10 being worse than one of 6 for protect form damage/species abilities. --- src/boe.party.cpp | 8 ++++---- src/classes/item.cpp | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/boe.party.cpp b/src/boe.party.cpp index 85c4a9fcf..4667ef987 100644 --- a/src/boe.party.cpp +++ b/src/boe.party.cpp @@ -2608,21 +2608,21 @@ bool damage_pc(short which_pc,short how_much,eDamageType damage_type,eRace type_ if((level = univ.party[which_pc].get_prot_level(eItemAbil::DAMAGE_PROTECTION,int(damage_type))) > 0) { if(damage_type == eDamageType::WEAPON) how_much -= level; - else how_much = how_much / ((level >= 7) ? 4 : 2); + else how_much = how_much / 2; } // TODO: Do these perhaps depend on the ability strength less than they should? if((level = univ.party[which_pc].get_prot_level(eItemAbil::PROTECT_FROM_SPECIES,int(type_of_attacker))) > 0) - how_much = how_much / ((level >= 7) ? 4 : 2); + how_much = how_much / 2; if(isHumanoid(type_of_attacker) && !isHuman(type_of_attacker) && type_of_attacker != eRace::HUMANOID) { // If it's a slith, nephil, vahnatai, or goblin, Protection from Humanoids also helps // Humanoid is explicitly excluded here because otherwise it would help twice. if((level = univ.party[which_pc].get_prot_level(eItemAbil::PROTECT_FROM_SPECIES,int(eRace::HUMANOID))) > 0) - how_much = how_much / ((level >= 7) ? 4 : 2); + how_much = how_much / 2; } if(type_of_attacker == eRace::SKELETAL) { // Protection from Undead helps with both types of undead if((level = univ.party[which_pc].get_prot_level(eItemAbil::PROTECT_FROM_SPECIES,int(eRace::UNDEAD))) > 0) - how_much = how_much / ((level >= 7) ? 4 : 2); + how_much = how_much / 2; } // invuln diff --git a/src/classes/item.cpp b/src/classes/item.cpp index 9d945315f..637b80d05 100644 --- a/src/classes/item.cpp +++ b/src/classes/item.cpp @@ -466,10 +466,12 @@ void cItem::append(legacy::item_record_type& old){ case 32: // Fire protection ability = eItemAbil::DAMAGE_PROTECTION; abil_data[1] = int(eDamageType::FIRE); + if(abil_data[0] >= 7) abil_data[0] /= 2; break; case 33: // Cold protection ability = eItemAbil::DAMAGE_PROTECTION; abil_data[1] = int(eDamageType::COLD); + if(abil_data[0] >= 7) abil_data[0] /= 2; break; case 34: // Poison protection ability = eItemAbil::STATUS_PROTECTION; @@ -478,6 +480,7 @@ void cItem::append(legacy::item_record_type& old){ case 35: // Magic protection ability = eItemAbil::DAMAGE_PROTECTION; abil_data[1] = int(eDamageType::MAGIC); + if(abil_data[0] >= 7) abil_data[0] /= 2; break; case 36: // Acid protection ability = eItemAbil::STATUS_PROTECTION; @@ -562,22 +565,27 @@ void cItem::append(legacy::item_record_type& old){ case 57: // Protect from undead ability = eItemAbil::DAMAGE_PROTECTION; abil_data[1] = int(eDamageType::UNDEAD); + if(abil_data[0] >= 7) abil_data[0] /= 2; break; case 58: // Protect from demons ability = eItemAbil::DAMAGE_PROTECTION; abil_data[1] = int(eDamageType::DEMON); + if(abil_data[0] >= 7) abil_data[0] /= 2; break; case 59: // Protect from humanoids ability = eItemAbil::PROTECT_FROM_SPECIES; abil_data[1] = int(eRace::HUMANOID); + if(abil_data[0] >= 7) abil_data[0] /= 2; break; case 60: // Protect from reptiles ability = eItemAbil::PROTECT_FROM_SPECIES; abil_data[1] = int(eRace::REPTILE); + if(abil_data[0] >= 7) abil_data[0] /= 2; break; case 61: // Protect from giants ability = eItemAbil::PROTECT_FROM_SPECIES; abil_data[1] = int(eRace::GIANT); + if(abil_data[0] >= 7) abil_data[0] /= 2; break; case 62: // Protect from disease ability = eItemAbil::STATUS_PROTECTION;