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 81: |
Line 81: |
| return "* <code>" .. mw.text.nowiki(call) .. "</code> → '''" .. sb | | return "* <code>" .. mw.text.nowiki(call) .. "</code> → '''" .. sb |
| .. "''' ''(default " .. base .. ")''" | | .. "''' ''(default " .. base .. ")''" |
| end
| |
|
| |
| -- True when Street Brawl changes at least one of this hero's abilities. Accepts a
| |
| -- hero_* key or the hero's English name, so callers may pass whichever they hold.
| |
| function p.hero_has_changes(hero)
| |
| if hero == nil or hero == "" then return false end
| |
| local record = mw.loadJsonData(HERO_PAGE)[hero]
| |
| local name = (record and record.Name) or hero
| |
| local owners = build_owner_map()
| |
| local changes = mw.loadJsonData(SB_PAGE)["ability-changes"]
| |
| for key in pairs(changes) do
| |
| local owner = owners[key]
| |
| if owner and owner.hero == name then return true end
| |
| end
| |
| return false
| |
| end
| |
|
| |
| -- {{#invoke:StreetBrawlAbilities|hasChanges|HERO}} exposes the same check to wikitext,
| |
| -- answering "1" or the empty string so #if can branch on it.
| |
| function p.hasChanges(frame)
| |
| return p.hero_has_changes(mw.text.trim(frame.args[1] or "")) and "1" or ""
| |
| end | | end |
|
| |
|