Make skill and giant strength item abilities base their strength on ability strength rather than on item level

- Original ability strength is "archived" in case it was the designer's intent, so that it can be easily put back if desired.
This commit is contained in:
2015-01-26 12:16:31 -05:00
parent d107fd9750
commit 944457753d
3 changed files with 12 additions and 10 deletions

View File

@@ -543,14 +543,13 @@ void pc_attack(short who_att,iLiving* target) {
dam_adj += 10;
}
// TODO: These should check abil_data[0], not item_level
if((skill_item = attacker.has_abil_equip(eItemAbil::SKILL)) < 24) {
hit_adj += 5 * (attacker.items[skill_item].item_level / 2 + 1);
dam_adj += attacker.items[skill_item].item_level / 2;
hit_adj += 5 * (attacker.items[skill_item].abil_data[0] / 2 + 1);
dam_adj += attacker.items[skill_item].abil_data[0] / 2;
}
if((skill_item = attacker.has_abil_equip(eItemAbil::GIANT_STRENGTH)) < 24) {
dam_adj += attacker.items[skill_item].item_level;
hit_adj += attacker.items[skill_item].item_level * 2;
dam_adj += attacker.items[skill_item].abil_data[0];
hit_adj += attacker.items[skill_item].abil_data[0] * 2;
}
attacker.void_sanctuary();

View File

@@ -540,16 +540,15 @@ static void display_pc_info(cDialog& me, const short pc) {
if(!univ.party[pc].traits[eTrait::AMBIDEXTROUS] && weap2 < 24)
hit_adj -= 25;
// TODO: These should check abil_data[0] instead of item_level
// TODO: Perhaps dam_adj and hit_adj calculation should be moved into a function somewhere?
dam_adj = univ.party[pc].stat_adj(eSkill::STRENGTH) + minmax(-8,8,univ.party[pc].status[eStatus::BLESS_CURSE]);
if((skill_item = univ.party[pc].has_abil_equip(eItemAbil::SKILL)) < 24) {
hit_adj += 5 * (univ.party[pc].items[skill_item].item_level / 2 + 1);
dam_adj += univ.party[pc].items[skill_item].item_level / 2;
hit_adj += 5 * (univ.party[pc].items[skill_item].abil_data[0] / 2 + 1);
dam_adj += univ.party[pc].items[skill_item].abil_data[0] / 2;
}
if((skill_item = univ.party[pc].has_abil_equip(eItemAbil::GIANT_STRENGTH)) < 24) {
dam_adj += univ.party[pc].items[skill_item].item_level;
hit_adj += univ.party[pc].items[skill_item].item_level * 2;
dam_adj += univ.party[pc].items[skill_item].abil_data[0];
hit_adj += univ.party[pc].items[skill_item].abil_data[0] * 2;
}
me["weap1a"].setText("No weapon.");

View File

@@ -549,6 +549,8 @@ void cItem::append(legacy::item_record_type& old){
break;
case 37:
ability = eItemAbil::SKILL;
abil_data[1] = abil_data[0]; // archive original ability strength (SKILL doesn't use abil_data[1] for anything)
abil_data[0] = item_level; // Put level into ability strength to preserve legacy behaviour
break;
case 38: // Strength
ability = eItemAbil::BOOST_STAT;
@@ -573,6 +575,8 @@ void cItem::append(legacy::item_record_type& old){
break;
case 43:
ability = eItemAbil::GIANT_STRENGTH;
abil_data[1] = abil_data[0]; // archive original ability strength (GIANT_STRENGTH doesn't use abil_data[1] for anything)
abil_data[0] = item_level; // Put level into ability strength to preserve legacy behaviour
break;
case 44:
ability = eItemAbil::LIGHTER_OBJECT;