Module:Constants: Difference between revisions

Tweaked how bonuses for multiple rows simultaneously are handled
(getModifierText: Adjust display of various time based modifier values)
(Tweaked how bonuses for multiple rows simultaneously are handled)
Line 43: Line 43:
   ["increasedFoodHealingValue"] = { text =  "+{V}% Food Healing Value", },
   ["increasedFoodHealingValue"] = { text =  "+{V}% Food Healing Value", },
   ["increasedChanceToPreservePrayerPoints"] = { text =  "+{V}% Chance To Preserve Prayer Points", },
   ["increasedChanceToPreservePrayerPoints"] = { text =  "+{V}% Chance To Preserve Prayer Points", },
  ["increasedFlatPrayerCostReduction"] = { text =  "+{V} Flat Prayer Cost Reduction", },
   ["increasedMinAirSpellDmg"] = { text =  "+{V} Min Air Spell Dmg", },
   ["increasedMinAirSpellDmg"] = { text =  "+{V} Min Air Spell Dmg", },
   ["increasedMinWaterSpellDmg"] = { text =  "+{V} Min Water Spell Dmg", },
   ["increasedMinWaterSpellDmg"] = { text =  "+{V} Min Water Spell Dmg", },
Line 86: Line 85:
   ["decreasedFoodHealingValue"] = { text =  "-{V}% Food Healing Value", isNegative = true },
   ["decreasedFoodHealingValue"] = { text =  "-{V}% Food Healing Value", isNegative = true },
   ["decreasedChanceToPreservePrayerPoints"] = { text =  "-{V}% Chance To Preserve Prayer Points", isNegative = true },
   ["decreasedChanceToPreservePrayerPoints"] = { text =  "-{V}% Chance To Preserve Prayer Points", isNegative = true },
  ["decreasedFlatPrayerCostReduction"] = { text =  "-{V} Flat Prayer Cost Reduction", isNegative = true },
   ["decreasedMinAirSpellDmg"] = { text =  "-{V} Min Air Spell Dmg", isNegative = true },
   ["decreasedMinAirSpellDmg"] = { text =  "-{V} Min Air Spell Dmg", isNegative = true },
   ["decreasedMinWaterSpellDmg"] = { text =  "-{V} Min Water Spell Dmg", isNegative = true },
   ["decreasedMinWaterSpellDmg"] = { text =  "-{V} Min Water Spell Dmg", isNegative = true },
Line 193: Line 191:


   if type(value) == 'table' then
   if type(value) == 'table' then
     if Shared.tableCount(value) == 1 and type(value[1]) == 'table' then
     if Shared.tableCount(value) > 0 and type(value[1]) == 'table' then
       value = value[1]
       --Potentially return multiple rows if necessay
    end
      local resultArray = {}
     if value[1] ~= nil then
      for i, subVal in Shared.skpairs(value) do
      local skillName = p.getSkillName(value[1])
        table.insert(resultArray, p.getModifierText, modifier, subVal, doColor)
      if skillName ~= nil then
      end
        result = string.gsub(result, '{SV0}', p.getSkillName(value[1]))
      return table.concat(resultArray, '<br/>')
     else
      if value[1] ~= nil then
        local skillName = p.getSkillName(value[1])
        if skillName ~= nil then
          result = string.gsub(result, '{SV0}', p.getSkillName(value[1]))
        end
      end
      if value[2] ~= nil then
        result = string.gsub(result, '{V1}', value[2])
        result = string.gsub(result, '{VMS1}', value[2] / 1000)
       end
       end
    end
    if value[2] ~= nil then
      result = string.gsub(result, '{V1}', value[2])
      result = string.gsub(result, '{VMS1}', value[2] / 1000)
     end
     end
   else
   else