-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathStatlist-fullevo.lua
More file actions
86 lines (66 loc) · 2.08 KB
/
Statlist-fullevo.lua
File metadata and controls
86 lines (66 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
--[[
This module prints a list of all fully evolved Pokémon base statistics.
Generation I has a separate table because it has different statistics, while
the other are merged into one.
--]]
local s = {}
-- stylua: ignore start
local oop = require('Wikilib-oop')
local list = require('Wikilib-lists')
local gamesUtil = require('Wikilib-games')
local evo = require('Wikilib-evos')
local evodata = require("Evo-data")
local stats = require('PokéStats-data')
local stl = require('Statlist')
-- stylua: ignore end
--[[
Class representing an entry for the base statistics list. By subclassing
Statlist.Entry is almost ready to go.
--]]
local Entry = oop.makeClass(stl.Entry)
--[[
Constructor: inherits from its superclass, only adding a filter for Pokémon
not fully evolved. Parameters are as the superclass.
--]]
Entry.new = function(stat, poke, gen)
if gen and not gamesUtil.isInGen(poke, gen) then
return nil
end
if evodata[poke] and not evo.isFullyEvolved(poke) then
return nil
end
local this = Entry.super.new(stat, poke, gen)
return setmetatable(this, Entry)
end
--[[
Wiki interface function: called with no argument, returns the list of all
fully evolved Pokémon statistics for all generations but the first, which
has a separate table.
Example:
{{#invoke: Statlist/fullevo | statlist }}
--]]
s.statlist = function(_)
return table.concat({
[[===Dalla seconda generazione in poi===]],
list.makeCollapsedList({
source = stats,
makeEntry = Entry.new,
iterator = list.pokeNames,
header = stl.headers.header,
fullGroupLabel = "Tutte le forme",
noEmptyLabel = true,
}),
[[===Nella prima generazione===]],
list.makeCollapsedList({
source = stats,
makeEntry = Entry.new,
entryArgs = 1,
iterator = list.pokeNames,
header = stl.headers.firstGenHeader,
fullGroupLabel = "Tutte le forme",
noEmptyLabel = true,
}),
}, "\n")
end
s.Statlist = s.statlist
return s