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 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
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
Current Mini-event
Naval District Saury Festival
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