Editing Module:AbilityHints

Warning: You are not logged in. Once you make an edit, a temporary account will be created for you. Learn more. Log in or create an account to continue receiving notifications after this account expires, and to access other features.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision Your text
Line 2: Line 2:
-- Used by Template:AbilitySection. Styles are there too.
-- Used by Template:AbilitySection. Styles are there too.


-- label_dict_key names the [[Data:Dictionary]] entry holding the tooltip text. It is
-- resolved at render time rather than here, so the tooltip follows the page language
-- and so no frame is needed while the module is still loading.
local CONFIG = {
local CONFIG = {
     { list = "melee",            file = "Melee Lifesteal.png",  label_dict_key = "AbilityHintsMelee" },
     { list = "melee",            file = "Melee Lifesteal.png",  tip = "Benefits from melee items (e.g. [[Melee Lifesteal]])" },
     { list = "dontbreakstealth", file = "Veil Walker.png",      label_dict_key = "AbilityHintsDontBreakStealth" },
     { list = "dontbreakstealth", file = "Veil Walker.png",      tip = "Casting does not break stealth from [[Veil Walker]] or [[Shadow Weave]]" },
     { list = "movementbased",    file = "Slowing Hex.png",      label_dict_key = "AbilityHintsMovementBased" },
     { list = "movementbased",    file = "Slowing Hex.png",      tip = "Disabled by [[Slowing Hex]]" },
     { list = "debuffresist",    file = "Debuff Reducer.png",  label_dict_key = "AbilityHintsDebuffResist" },
     { list = "debuffresist",    file = "Debuff Reducer.png",  tip = "Debuff duration reduced by [[Debuff Resist]]" },
     { list = "heal",            file = "Healing Booster.png",  label_dict_key = "AbilityHintsHeal" },
     { list = "heal",            file = "Healing Booster.png",  tip = "Healing amplified by [[Healing Booster]] and affected by healing reduction" },
     { list = "healingtempo",    file = "Healing Tempo.png",    label_dict_key = "AbilityHintsHealingTempo" },
     { list = "healingtempo",    file = "Healing Tempo.png",    tip = "Healing triggers [[Healing Tempo]]'s unique effect" },
     { list = "reactivebarrier",  file = "Reactive Barrier.png", label_dict_key = "AbilityHintsReactiveBarrier" },
     { list = "reactivebarrier",  file = "Reactive Barrier.png", tip = "Triggers [[Reactive Barrier]]" },
     { list = "dispelmagic",      file = "Dispel Magic.png",    label_dict_key = "AbilityHintsDispelMagic" },
     { list = "dispelmagic",      file = "Dispel Magic.png",    tip = "Effect can be [[Dispel Magic|dispelled]]" },
     { list = "indomitable",      file = "Indomitable.png",      label_dict_key = "AbilityHintsIndomitable" },
     { list = "indomitable",      file = "Indomitable.png",      tip = "Disable prevented by [[Indomitable]]" },
     { list = "unstoppable",      file = "Unstoppable.png",      label_dict_key = "AbilityHintsUnstoppable" },
     { list = "unstoppable",      file = "Unstoppable.png",      tip = "CC effect suppressed by [[Unstoppable]]" },
     { list = "platedarmor",      file = "Plated Armor.png",    label_dict_key = "AbilityHintsPlatedArmor" },
     { list = "platedarmor",      file = "Plated Armor.png",    tip = "On-shot effect prevented by [[Plated Armor]]" },
     { list = "summons",          file = "Monster Rounds.png",  label_dict_key = "AbilityHintsSummons" },
     { list = "summons",          file = "Monster Rounds.png",  tip = "Summons affected by [[Monster Rounds]] and [[Heroic Aura]]" },
}
 
-- Tooltip wording for a manually placed icon, keyed by its iconbox state. Each entry
-- takes the item title as {{{1}}}, so translations can put the object where their
-- grammar wants it rather than always after the verb. The enhanced state has no entry
-- of its own: the glow already marks it, so it falls through to the normal wording.
local STATE_DICT_KEYS = {
    normal  = "AbilityHintsInteracts",
    disabled = "AbilityHintsInteractsNot",
    partial  = "AbilityHintsInteractsPartial",
}
}


local AbilityTable = require("Module:AbilityTable")
local AbilityTable = require("Module:AbilityTable")
local dictionary = require("Module:Dictionary")
local resource_lookup = mw.loadJsonData("Data:ResourceLookup.json")
local resource_lookup = mw.loadJsonData("Data:ResourceLookup.json")
local item_data = mw.loadJsonData("Data:ItemData.json")
local item_data = mw.loadJsonData("Data:ItemData.json")
Line 76: Line 62:
local function hint_icon(def)
local function hint_icon(def)
     return '<span class="ability-hint">' .. icon_img(def.file)
     return '<span class="ability-hint">' .. icon_img(def.file)
         .. '<span class="ability-hint-tip">' .. dictionary.translate(def.label_dict_key) .. '</span></span>'
         .. '<span class="ability-hint-tip">' .. def.tip .. '</span></span>'
end
end


local function manual_icon(m)
local function manual_icon(m)
     local cls = 'ability-hint'
     local cls = 'ability-hint'
     local dict_key = STATE_DICT_KEYS.normal
     local verb = 'Interacts with'
     local partial = false
     local partial = false
     if m.state == 'disabled' then
     if m.state == 'disabled' then
         cls = cls .. ' ability-hint--disabled'
         cls = cls .. ' ability-hint--disabled'
         dict_key = STATE_DICT_KEYS.disabled
         verb = 'Does not interact with'
     elseif m.state == 'partial' then
     elseif m.state == 'partial' then
         dict_key = STATE_DICT_KEYS.partial
         verb = 'Interacts partially with'
         partial = true
         partial = true
    elseif m.state == 'enhanced' then
        cls = cls .. ' ability-hint--enhanced'
     end
     end
    local tip = dictionary.translate(dict_key, nil, nil, { m.title })
        .. '<br>' .. dictionary.translate('AbilityHintsClickReveal')
     return '<span class="' .. cls .. '">' .. icon_img(m.file, '#' .. m.anchor, partial)
     return '<span class="' .. cls .. '">' .. icon_img(m.file, '#' .. m.anchor, partial)
         .. '<span class="ability-hint-tip">' .. tip .. '</span></span>'
         .. '<span class="ability-hint-tip">' .. verb .. ' ' .. m.title .. '.<br>Click to reveal more info.</span></span>'
end
end


Please note that all contributions to The Deadlock Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see Deadlock:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)
Preview page with this template

Pages included on this page: