Module:Creatures: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
return { | return { | ||
{ | Griffin = { | ||
upgrade = "Royal Griffin", | |||
attack = 7, | attack = 7, | ||
defense = 5, | defense = 5, | ||
speed = 6, | speed = 6, | ||
}, | }, | ||
{ | Centaur = { | ||
upgrade = "Centaur Captain", | |||
attack = 5, | attack = 5, | ||
defense = 3, | defense = 3, | ||
Latest revision as of 21:16, 28 March 2025
This module is meant to be loaded by other modules. For example:
local p = {}
function p.test(frame)
return creatureTest()
end
function creatureTest(items)
local items = loadData("Creatures")
local result = ""
for k, v in pairs(items) do
result = result .. k .. "'s attack is " .. v["attack"] .. ", "
end
result = result:sub(1, -3)
return result
end
function loadData(name)
if mw.title.new(name, 828).exists then
return mw.loadData("Module:" .. name)
end
return nil
end
return p