17,101
edits
(Invert attacker/target for special descriptions) |
mNo edit summary |
||
Line 1: | Line 1: | ||
-- Version: ALPHA V0.21 (?1113) | |||
--[[The text to decode can be generated in the console via | --[[The text to decode can be generated in the console via | ||
(function() { | (function() { | ||
Line 14: | Line 16: | ||
for (var i = 0; i < items.length; i++) { | for (var i = 0; i < items.length; i++) { | ||
itemsAdj[i] = {...items[i]} | itemsAdj[i] = {...items[i]} | ||
// Amend elements of specialAttacks to | // Amend elements of specialAttacks to include descriptions | ||
if (itemsAdj[i].specialAttacks !== undefined) { | if (itemsAdj[i].specialAttacks !== undefined) { | ||
itemsAdj[i].specialAttacks | for (var j = 0; j < itemsAdj[i].specialAttacks.length; j++) { | ||
itemsAdj[i].specialAttacks[j].description = describeAttack(itemsAdj[i].specialAttacks[j], youNoun, enemyNoun).replaceAll(/<span class=\".+?\">(.+?)<\/span>/ig, '$1') | |||
} | |||
} | } | ||
} | } | ||
Line 23: | Line 27: | ||
txt = txt.replace(/\\\"/g, "\\\\\"") | txt = txt.replace(/\\\"/g, "\\\\\"") | ||
fullText += "\r\n\r\nlocal itemData = {}\r\nitemData.Items = mw.text.jsonDecode('" + txt + "')" | fullText += "\r\n\r\nlocal itemData = {}\r\nitemData.Items = mw.text.jsonDecode('" + txt + "')" | ||
txt = JSON.stringify(Object.getOwnPropertyNames(new EquipmentStats())) | txt = JSON.stringify(Object.getOwnPropertyNames(new EquipmentStats())) | ||
Line 47: | Line 38: | ||
})() | })() | ||
--]] | --]] | ||
local itemData = {} | local itemData = {} | ||
itemData | |||
itemData.EquipmentStatKeys = mw.text.jsonDecode('["attackSpeed","stabAttackBonus","slashAttackBonus","blockAttackBonus","rangedAttackBonus","magicAttackBonus","meleeStrengthBonus","rangedStrengthBonus","magicDamageBonus","meleeDefenceBonus","rangedDefenceBonus","magicDefenceBonus","damageReduction","summoningMaxhit"]') | itemData.EquipmentStatKeys = mw.text.jsonDecode('["attackSpeed","stabAttackBonus","slashAttackBonus","blockAttackBonus","rangedAttackBonus","magicAttackBonus","meleeStrengthBonus","rangedStrengthBonus","magicDamageBonus","meleeDefenceBonus","rangedDefenceBonus","magicDefenceBonus","damageReduction","summoningMaxhit"]') | ||
return itemData | return itemData |