Editing Module:UnitData
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 10: | Line 10: | ||
return string.format("%.0f", amount * 100) .. "%" | return string.format("%.0f", amount * 100) .. "%" | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
end | end | ||
Line 56: | Line 42: | ||
u.weaponIDs = nil | u.weaponIDs = nil | ||
u.shieldIDs = nil | u.shieldIDs = nil | ||
− | |||
return tbl | return tbl | ||
Line 68: | Line 53: | ||
local result = '' | local result = '' | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
if ud.buildSpeed then | if ud.buildSpeed then | ||
result = result .. frame:expandTemplate(unit.getAbilityInfoboxTemplate("construction", {buildpower = ud.buildSpeed})) | result = result .. frame:expandTemplate(unit.getAbilityInfoboxTemplate("construction", {buildpower = ud.buildSpeed})) | ||
end | end | ||
− | if ud. | + | if ud.transportCapacity then |
local light = ud.transportLightSpeed | local light = ud.transportLightSpeed | ||
− | local medium = | + | local medium = cp.transportMediumSpeed |
− | local heavy = | + | local heavy = cp.transportHeavySpeed |
local args = {} | local args = {} | ||
− | if light then args.light = light | + | if light then args.light = toPercent(light) end |
− | if medium then args.medium = medium | + | if medium then args.medium = toPercent(medium) end |
− | if heavy then args.heavy = heavy | + | if heavy then args.heavy = toPercent(heavy) end |
result = result .. frame:expandTemplate(unit.getAbilityInfoboxTemplate("transport", args)) | result = result .. frame:expandTemplate(unit.getAbilityInfoboxTemplate("transport", args)) | ||
end | end | ||
− | if ud. | + | if ud.cloakCost or ud.idleCloak then |
local args = {} | local args = {} | ||
if (ud.cloakCost or 0) > 0 then | if (ud.cloakCost or 0) > 0 then | ||
args.upkeepidle = ud.cloakCost | args.upkeepidle = ud.cloakCost | ||
− | args.upkeepmobile = | + | args.upkeepmobile = ud.cloakCostMoving |
− | elseif ud. | + | elseif ud.idle_cloak then |
args.customdata1 = "Only when idle" | args.customdata1 = "Only when idle" | ||
args.customdata2 = "Free and automated" | args.customdata2 = "Free and automated" | ||
Line 130: | Line 100: | ||
if ud.radarDistance or ud.jammerDistance then | if ud.radarDistance or ud.jammerDistance then | ||
local args = {} | local args = {} | ||
− | if ud. | + | if ud.radardistancejam then |
− | if not ud. | + | if not ud.radardistance then |
args.name = "Radar Jammer" | args.name = "Radar Jammer" | ||
end | end | ||
args.jam = ud.jammerDistance | args.jam = ud.jammerDistance | ||
end | end | ||
− | if ud. | + | if ud.radardistance then |
args.radar = ud.radarDistance | args.radar = ud.radarDistance | ||
end | end | ||
Line 142: | Line 112: | ||
end | end | ||
if ud.jumpRange then | if ud.jumpRange then | ||
− | local args = {range = ud.jumpRange, reload = ud.jumpReload, speed = ud.jumpSpeed, midairjump = ud.midairJump | + | local args = {range = ud.jumpRange, reload = ud.jumpReload, speed = ud.jumpSpeed, midairjump = ud.midairJump} |
result = result .. frame:expandTemplate(unit.getAbilityInfoboxTemplate("jump", args)) | result = result .. frame:expandTemplate(unit.getAbilityInfoboxTemplate("jump", args)) | ||
end | end | ||
Line 148: | Line 118: | ||
local args = {} | local args = {} | ||
if ud.idleRegenTime then | if ud.idleRegenTime then | ||
− | args.idleregen = ud.idleRegen | + | if unitDef.idletime > 0 then |
− | + | args.idleregen = ud.idleRegen | |
− | + | args.timetoenable = ud.idleRegenTime | |
− | + | else | |
+ | args.combatregen = ud.combatRegen | ||
+ | end | ||
end | end | ||
if ud.waterRegen then | if ud.waterRegen then | ||
Line 169: | Line 141: | ||
if ud.armorDamageReduction then | if ud.armorDamageReduction then | ||
local args = {reduction = ud.armorDamageReduction .. '%'} | local args = {reduction = ud.armorDamageReduction .. '%'} | ||
+ | abilities = abilities .. "\n\t" .. writeHeaderLine("Infobox zkability armored") | ||
if ud.armorForceClose then | if ud.armorForceClose then | ||
args.special1 = "Forced for " .. ud.armorForceClose .. "s on damage" | args.special1 = "Forced for " .. ud.armorForceClose .. "s on damage" | ||
Line 220: | Line 193: | ||
end | end | ||
− | + | return result or '' | |
− | |||
− | |||
− | |||
− | |||
− | |||
end | end | ||