Module:ItemTables: Difference between revisionsGive feedback
1) refactor a bit to use GameData module. 2) Update fire rate stat to better include Burst Fire |
Gammaton32 (talk | contribs) capacitor move slow |
||
| (16 intermediate revisions by 3 users not shown) | |||
| Line 5: | Line 5: | ||
local GameData = require("Module:GameData") | local GameData = require("Module:GameData") | ||
-- Translate internal attribute names to plain text for module calls | |||
local friendly_to_internal = {} | local friendly_to_internal = {} | ||
friendly_to_internal["ammo"] = { "BonusClipSizePercent", "BonusClipSize", "ActiveReloadPercent" } | friendly_to_internal["ammo"] = { "BonusClipSizePercent", "BonusClipSize", "ActiveReloadPercent" } | ||
| Line 17: | Line 18: | ||
friendly_to_internal["spirit resist reduction"] = { "TechArmorDamageReduction", "MagicResistReduction" } | friendly_to_internal["spirit resist reduction"] = { "TechArmorDamageReduction", "MagicResistReduction" } | ||
friendly_to_internal["bonus health"] = { "BonusHealth" } | friendly_to_internal["bonus health"] = { "BonusHealth" } | ||
friendly_to_internal["bonus base health"] = { "BonusBaseHealth", "MaxHealthLossPercent" } | |||
friendly_to_internal["health regen"] = { "BonusHealthRegen" } | friendly_to_internal["health regen"] = { "BonusHealthRegen" } | ||
friendly_to_internal["regeneration"] = { "Regeneration" } | friendly_to_internal["regeneration"] = { "Regeneration" } | ||
| Line 30: | Line 32: | ||
friendly_to_internal["move speed"] = { "BonusMoveSpeed", "ActiveBonusMoveSpeed", "FervorMovespeed",} | friendly_to_internal["move speed"] = { "BonusMoveSpeed", "ActiveBonusMoveSpeed", "FervorMovespeed",} | ||
friendly_to_internal["sprint speed"] = { "BonusSprintSpeed", "InvisMoveSpeedMod" } | friendly_to_internal["sprint speed"] = { "BonusSprintSpeed", "InvisMoveSpeedMod" } | ||
friendly_to_internal["movement slow"] = { "SlowPercent", "MovementSpeedSlow" } | friendly_to_internal["movement slow"] = { "SlowPercent", "MovementSpeedSlow", "MaxSlowPercent" } | ||
friendly_to_internal["reload time"] = { "ReloadSpeedMultipler" } | friendly_to_internal["reload time"] = { "ReloadSpeedMultipler" } | ||
friendly_to_internal["heavy melee distance"] = { "MeleeDistanceScale" } | friendly_to_internal["heavy melee distance"] = { "MeleeDistanceScale" } | ||
friendly_to_internal["bonus heavy damage"] = { "BonusHeavyMeleeDamage" } | friendly_to_internal["bonus heavy damage"] = { "BonusHeavyMeleeDamage" } | ||
friendly_to_internal["bonus melee damage"] = { "BonusMeleeDamagePercent" } | friendly_to_internal["bonus melee damage"] = { "BonusMeleeDamagePercent", "AmbushBonusMeleeDamage" } | ||
friendly_to_internal["melee resist"] = { "MeleeResistPercent" } | friendly_to_internal["melee resist"] = { "MeleeResistPercent" } | ||
friendly_to_internal["stamina"] = { "Stamina" } | friendly_to_internal["stamina"] = { "Stamina" } | ||
| Line 44: | Line 46: | ||
friendly_to_internal["item cooldown reduction"] = { "ItemCooldownReduction" } | friendly_to_internal["item cooldown reduction"] = { "ItemCooldownReduction" } | ||
friendly_to_internal["charge cooldown reduction"] = { "CooldownReductionOnChargedAbilities" } | friendly_to_internal["charge cooldown reduction"] = { "CooldownReductionOnChargedAbilities" } | ||
friendly_to_internal["debuff resist"] = { "StatusResistancePercent" } | friendly_to_internal["debuff resist"] = { "StatusResistancePercent", "FervorStatusResistancePercent" } | ||
friendly_to_internal["ability range"] = { "TechRangeMultiplier", "ImbuedTechRangeMultiplier"} | friendly_to_internal["ability range"] = { "TechRangeMultiplier", "ImbuedTechRangeMultiplier"} | ||
friendly_to_internal["falloff range"] = { "BonusAttackRangePercent" } | friendly_to_internal["falloff range"] = { "BonusAttackRangePercent" } | ||
| Line 51: | Line 53: | ||
friendly_to_internal["dash distance"] = { "GroundDashReductionPercent", "AirMoveIncreasePercent" } | friendly_to_internal["dash distance"] = { "GroundDashReductionPercent", "AirMoveIncreasePercent" } | ||
friendly_to_internal["damage reduction"] = { "OutgoingDamagePenaltyPercent", "DeathImmunityDamageReduction" } | friendly_to_internal["damage reduction"] = { "OutgoingDamagePenaltyPercent", "DeathImmunityDamageReduction" } | ||
friendly_to_internal["gravity scale"] = { "GravityScale" } | |||
-- Override dead/hidden stats that exist in data but don't actually work in‑game. | -- Override dead/hidden stats that exist in data but don't actually work in‑game. | ||
| Line 56: | Line 59: | ||
local deadStatOverrides = { | local deadStatOverrides = { | ||
["Witchmail"] = { CooldownReduction = "0" }, | ["Witchmail"] = { CooldownReduction = "0" }, | ||
["Refresher"] = { BulletResist = "0", TechResist = "0" } | ["Refresher"] = { BulletResist = "0", TechResist = "0" }, | ||
["Glass Cannon"] = { SlowPercent = "0", MovementSpeedSlow = "0" }, | |||
["Majestic Leap"] = { SlowPercent = "0", MovementSpeedSlow = "0" }, | |||
["Improved Spirit"] = { BonusSprintSpeed = "0"}, | |||
} | } | ||
| Line 109: | Line 115: | ||
"HealLifePercentOutOfCombat", | "HealLifePercentOutOfCombat", | ||
"ReloadSpeedMultipler", | "ReloadSpeedMultipler", | ||
"MeleeDistanceScale", "BonusHeavyMeleeDamage", "BonusMeleeDamagePercent", "MeleeResistPercent", | "MeleeDistanceScale", "BonusHeavyMeleeDamage", "BonusMeleeDamagePercent", "MeleeResistPercent", "AmbushBonusMeleeDamage", | ||
"SlideScale", | "SlideScale", | ||
"StaminaCooldownReduction", | "StaminaCooldownReduction", | ||
"SlowPercent", "MovementSpeedSlow", | "SlowPercent", "MovementSpeedSlow", "MaxSlowPercent", | ||
"HealAmpReceivePenaltyPercent", "HealAmpRegenPenaltyPercent", | "HealAmpReceivePenaltyPercent", "HealAmpRegenPenaltyPercent", | ||
"ImbuedBonusDuration", "NonImbuedBonusDuration", "BonusAbilityDurationPercent", | "ImbuedBonusDuration", "NonImbuedBonusDuration", "BonusAbilityDurationPercent", | ||
| Line 124: | Line 130: | ||
"TechDamageReduction", | "TechDamageReduction", | ||
"OutgoingDamagePenaltyPercent", "DeathImmunityDamageReduction", "TechPowerPercent", | "OutgoingDamagePenaltyPercent", "DeathImmunityDamageReduction", "TechPowerPercent", | ||
"GroundDashReductionPercent", "AirMoveIncreasePercent" | "GroundDashReductionPercent", "AirMoveIncreasePercent", | ||
"GravityScale", | |||
"BonusBaseHealth", "MaxHealthLossPercent" | |||
}, | }, | ||
["m/s"] = { "BonusMoveSpeed", "ActiveBonusMoveSpeed", "BonusSprintSpeed", "FervorMovespeed", "InvisMoveSpeedMod" }, | ["m/s"] = { "BonusMoveSpeed", "ActiveBonusMoveSpeed", "BonusSprintSpeed", "FervorMovespeed", "InvisMoveSpeedMod" }, | ||
| Line 194: | Line 202: | ||
local createTable = mw.html.create('table') | local createTable = mw.html.create('table') | ||
:addClass('wikitable sortable item-stat-table') | |||
:tag('caption'):done() | |||
local soulIcon = frame:expandTemplate{ title = 'Souls' } | local soulIcon = frame:expandTemplate{ title = 'Souls' } | ||
| Line 275: | Line 283: | ||
end | end | ||
for _, row in ipairs(requirements) do | |||
createTable:node(row) | |||
end | |||
local edit_url = mw.uri.fullUrl("Module:ItemTables", { action = "edit" }) | |||
local disclaimer = frame:preprocess( | |||
'<div class="item-stat-table-disclaimer">' | |||
.. 'This is a dynamic list ' | |||
.. '<span class="item-stat-table-list-name">"' .. property .. '"</span>. ' | |||
.. '[' .. tostring(edit_url) .. ' Edit contents].' | |||
.. '</div>' | |||
) | |||
return disclaimer .. tostring(createTable) | |||
end | end | ||
return p | return p | ||