Welcome to the Kancolle Wiki!
If you have any questions regarding site content, account registration, etc., please visit the
KanColle Wiki Discord
Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
Module:Calc
(view source)
Revision as of 05:42, 14 March 2018
178 bytes added
,
6 years ago
hue
Line 160:
Line 160:
return args.format == "table" and ("|" .. arg .. "\n") or arg
return args.format == "table" and ("|" .. arg .. "\n") or arg
end
end
+
+
local env = {}
function interpret_setter(s)
function interpret_setter(s)
Line 165:
Line 167:
local k = kv[1]
local k = kv[1]
local v = kv[2]
local v = kv[2]
−
if k and v then
+
local c = kv[3]
+
if
k and v and c then
+
env[c] = env[c] or require("Module:" .. c)
+
env[k] = env[c](v)
+
return true
+
elseif
k and v then
if k == "_equipment" then
if k == "_equipment" then
local equipment = {}
local equipment = {}
Line 184:
Line 191:
end
end
else
else
−
if v ~= "nil" then
+
if v ~= "nil"
and ship
then
ship[k] = tonumber(v)
ship[k] = tonumber(v)
+
else
+
env[k] = v
end
end
end
end
Line 239:
Line 248:
return format_arg(format_value(string.sub(arg, 3), target, ship))
return format_arg(format_value(string.sub(arg, 3), target, ship))
elseif prefix2 == "?#" then
elseif prefix2 == "?#" then
−
return frame:preprocess(format{
'{{${template}|${ship}}}', template =
string.sub(arg, 3),
ship
=
ship:name('/')
})
+
return frame:preprocess(format{string.sub(arg, 3),
this
=
env[this] or ""
})
else
else
return format_arg(format_value(string.sub(arg, 2), ship, target))
return format_arg(format_value(string.sub(arg, 2), ship, target))
がか
cssedit, gkautomate
7,060
edits
Navigation menu
Personal tools
Log in
Request account
Namespaces
Module
Discussion
Variants
Views
Read
View source
View history
More
Search
Content Navigation
Kancolle Wiki
Random page
Recent changes
Batch Uploading
Previous Event
Summer 2024 Event
Sortie
Sortie
World 1 (Naval Base Waters)
World 2 (Nansei Island Waters)
World 3 (Northern Waters)
World 7 (South Western Waters)
World 4 (Western Waters)
World 5 (Southern Waters)
World 6 (Central Waters)
Events
Shortcuts
Expeditions
Quests
Ships Maximum Status
Equipment
Construction
Development
Akashi's Improvement Arsenal
Shop
Inventory
Combat Mechanics
Glossary
Drop List
Interviews
Tutorials
How to Register
How To Play
Leveling
Resource Farming
Ship Priority
Equipment Setup
Akashi Upgrades
Event Preparation
Troubleshooting
FAQ
Community
Help
Sandbox
Tools
Upload file
Special pages
Printable version