Module:Sandbox/Skills/data: Difference between revisions

m
Add item/monster IDs
m (Special attack testing)
m (Add item/monster IDs)
Line 1: Line 1:
-- Version: ALPHA V0.21 (?1114)
-- Version: ALPHA V0.22.1 (?1217)


--[[The text to decode can be generated in the console via
--[[The text to decode can be generated in the console via
Line 23: Line 23:
       'monster': describeAttack(a, enemyNoun, youNoun).replaceAll(/<span class=\".+?\">(.+?)<\/span>/ig, '$1')
       'monster': describeAttack(a, enemyNoun, youNoun).replaceAll(/<span class=\".+?\">(.+?)<\/span>/ig, '$1')
     }
     }
    attacksByID[a.id].items = []
    attacksByID[a.id].monsters = []
   }
   }
  // For each attack, build a list of items & monsters which use that attack
  for (const item of items) {
    if (item.specialAttacks !== undefined) {
      for (const sp of item.specialAttacks) {
        attacksByID[sp.id].items.push(item.id)
      }
    }
  }
  for (const monster of MONSTERS) {
    if (monster.specialAttacks !== undefined) {
      for (const sp of monster.specialAttacks) {
        attacksByID[sp.id].monsters.push(monster.id)
      }
    }
  }
 
   var txt = JSON.stringify(attacksByID)
   var txt = JSON.stringify(attacksByID)
   txt = txt.replace(/\'/g, "\\\'")
   txt = txt.replace(/\'/g, "\\\'")
Line 34: Line 52:
})()
})()
--]]
--]]
-- Version: Alpha v0.22.1


local attackData = {}
local attackData = {}


attackData
attackData


return attackData
return attackData