Open main menu
Home
Random
Nearby
Log in
Settings
About Kancolle Wiki
Disclaimers
Kancolle Wiki
Search
Changes
← Older edit
Newer edit →
Module:Calc
(view source)
Revision as of 09:52, 5 November 2017
857 bytes added
,
7 years ago
m
no edit summary
Line 6:
Line 6:
local ShipCapabilities = require("Module:ShipCapabilities")
local ShipCapabilities = require("Module:ShipCapabilities")
local ShipBattleCardKai = require("Module:ShipBattleCardKai")
local ShipBattleCardKai = require("Module:ShipBattleCardKai")
+
local FitData = require("Module:FitData")
local args = nil
local args = nil
Line 78:
Line 79:
card = function(ship)
card = function(ship)
return ShipBattleCardKai:Asset({ ship:name("/") })
return ShipBattleCardKai:Asset({ ship:name("/") })
+
end,
+
+
format_morale = function(ship)
+
local morale = ship:morale() or 49
+
return morale <= 19 and "Red" or morale <= 29 and "Orange" or morale <= 49 and "Normal" or "Sparkle"
end,
end,
Line 85:
Line 91:
}
}
+
+
function addFormattingFunctions(name, table)
+
for k, v in pairs(table) do
+
formatting_functions[name .. "." .. k] = v
+
end
+
end
+
+
addFormattingFunctions("FitData", FitData)
function format_lua(lua)
function format_lua(lua)
Line 149:
Line 163:
if v ~= "nil" then
if v ~= "nil" then
ship[k] = tonumber(v)
ship[k] = tonumber(v)
+
--[[
+
local kv = mw.text.split(k, "%.")
+
local k1 = kv[1]
+
local k2 = kv[2]
+
if k1 and k2 then
+
if not ship[k1] then
+
ship[k1] = {}
+
end
+
ship[k1][k2] = tonumber(v)
+
else
+
ship[k] = tonumber(v)
+
end
+
]]--
end
end
end
end
Line 267:
Line 294:
"!_luck ~ nil",
"!_luck ~ nil",
"!_morale ~ 25",
"!_morale ~ 25",
−
"!
FitData.
cl0 ~ 56",
+
"!cl0 ~ 56",
−
"!
FitData.
cl1 ~ 807",
+
"!cl1 ~ 807",
−
"!
FitData.
cl2 ~ 137",
+
"!cl2 ~ 137",
"!!Destroyer Ro-Class",
"!!Destroyer Ro-Class",
"?card",
"?card",
Line 278:
Line 305:
"?luck",
"?luck",
"??card",
"??card",
−
"?
FitData.
cl0",
+
"?cl0",
−
"?
FitData.
cl1",
+
"?cl1",
−
"?
FitData.
cl2",
+
"?cl2",
"?FitData.crit",
"?FitData.crit",
"?FitData.hit",
"?FitData.hit",
"?FitData.error",
"?FitData.error",
−
"?
accuracy
",
+
"?
hit_rate
",
−
"?FitData.
fifference
",
+
"?FitData.
difference
",
})
})
)
)
がか
cssedit, gkautomate
7,064
edits