Modification de Module:Infobox/Arme gamebryo
La modification peut être annulée. Veuillez vérifier les différences ci-dessous pour voir si c’est bien ce que vous voulez faire, puis publier ces changements pour finaliser l’annulation de cette modification.
Version actuelle | Votre texte | ||
Ligne 1 : | Ligne 1 : | ||
local localdata = require( 'Module:Infobox/Localdata' ) | local localdata = require( 'Module:Infobox/Localdata' ) | ||
local icon = require( 'Module:Icône' ) | local icon = require( 'Module:Icône' ) | ||
-------------------------------------------------------- | -------------------------------------------------------- | ||
Ligne 27 : | Ligne 15 : | ||
function formatNumber(data, round) | function formatNumber(data, round) | ||
return string.format(round or "%.1f", data) | return string.format(round or "%.1f", data) | ||
end | end | ||
Ligne 109 : | Ligne 92 : | ||
if perkAttacksPerSec > 0 then | if perkAttacksPerSec > 0 then | ||
perksAttacksPerSec = perksAttacksPerSec + perkAttacksPerSec | perksAttacksPerSec = perksAttacksPerSec + perkAttacksPerSec | ||
perksAttacksPerSecItems = perksAttacksPerSecItems .. '<li>' .. perk .. '<div style="float:right;">+ ' .. | perksAttacksPerSecItems = perksAttacksPerSecItems .. '<li>' .. perk .. '<div style="float:right;">+ ' .. formatNumber(perkAttacksPerSec) .. '</div></li>' | ||
end | end | ||
if perkDmgNorm > 0 or perkDmgEff > 0 or perkDmgExpl > 0 then | if perkDmgNorm > 0 or perkDmgEff > 0 or perkDmgExpl > 0 then | ||
perksAttacksPerSecItems = perksAttacksPerSecItems .. '<li>' .. perk .. '<div style="float:right;">' | |||
if perkDmgNorm > 0 then | if perkDmgNorm > 0 then | ||
perksDmgNorm = perksDmgNorm + perkDmgNorm | perksDmgNorm = perksDmgNorm + perkDmgNorm | ||
perksAttacksPerSecItems = perksAttacksPerSecItems .. ' + ' .. formatNumber(perkDmgNorm) | |||
end | end | ||
if perkDmgExpl > 0 then | if perkDmgExpl > 0 then | ||
perksDmgExpl = perksDmgExpl + perkDmgExpl | perksDmgExpl = perksDmgExpl + perkDmgExpl | ||
perksAttacksPerSecItems = perksAttacksPerSecItems .. ' + ' .. formatNumber(perkDmgExpl) .. ' ' .. icon.build( 'explosion' ) | |||
end | end | ||
if perkDmgEff > 0 then | if perkDmgEff > 0 then | ||
perksDmgEff = perksDmgEff + perkDmgEff | perksDmgEff = perksDmgEff + perkDmgEff | ||
perksAttacksPerSecItems = perksAttacksPerSecItems .. ' + ' .. formatNumber(perkDmgEff) .. ' ' .. icon.build( 'effect' ) | |||
end | end | ||
perksDmgItems = perksDmgItems | perksDmgItems = perksDmgItems .. '</div></li>' | ||
end | end | ||
if perkReloadTime > 0 then | if perkReloadTime > 0 then | ||
perksReloadTime = perksReloadTime + perkReloadTime | perksReloadTime = perksReloadTime + perkReloadTime | ||
perksAttacksPerSecItems = perksAttacksPerSecItems .. '<li>' .. perk .. '<div style="float:right;">- ' .. formatNumber(perkReloadTime) .. ' s</div></li>' | |||
end | end | ||
else | else | ||
Ligne 196 : | Ligne 177 : | ||
-------------------------------------------------------- | -------------------------------------------------------- | ||
local dmgPerAttackCell = formatNumber(dmgNormTotal) | local dmgPerAttackCell = formatNumber(dmgNormTotal) | ||
if perksDmgNorm > 0 then | if perksDmgNorm > 0 then dmgPerAttackCell = dmgPerAttackCell .. ' (' .. formatNumber(perksDmgNormTotal) .. ')' end | ||
end | |||
if dmgExplTotal > 0 then | if dmgExplTotal > 0 then | ||
dmgPerAttackCell = dmgPerAttackCell .. ' + ' .. formatNumber(dmgExplTotal) | dmgPerAttackCell = dmgPerAttackCell .. ' + ' .. formatNumber(dmgExplTotal) | ||
if perksDmgExpl > 0 then | if perksDmgExpl > 0 then dmgPerAttackCell = dmgPerAttackCell .. ' (' .. formatNumber(perksDmgExplTotal) .. ')' end | ||
dmgPerAttackCell = dmgPerAttackCell .. ' ' .. icon.build({ 'explosion' }) | |||
dmgPerAttackCell = dmgPerAttackCell .. ' ' .. | |||
end | end | ||
if dmgEffTotal > 0 then | if dmgEffTotal > 0 then | ||
local effectDuration = localdata["effect duration"] or "1" | local effectDuration = localdata["effect duration"] or "1" | ||
dmgPerAttackCell = dmgPerAttackCell .. ' + ' .. formatNumber(dmgEffTotal) | dmgPerAttackCell = dmgPerAttackCell .. ' + ' .. formatNumber(dmgEffTotal) | ||
if perksDmgEff > 0 then | if perksDmgEff > 0 then dmgPerAttackCell = dmgPerAttackCell .. ' (' .. formatNumber(perksDmgEffTotal) .. ')' end | ||
dmgPerAttackCell = dmgPerAttackCell .. ' sur ' .. effectDuration .. ' s ' .. icon.build({ 'effet' }) | |||
dmgPerAttackCell = dmgPerAttackCell .. ' sur ' .. effectDuration .. ' s ' .. | |||
end | end | ||
local dmgPerProjCell = formatNumber(dmgNormProj) | local dmgPerProjCell = formatNumber(dmgNormProj) | ||
if perksDmgNormProj > 0 then | if perksDmgNormProj > 0 then dmgPerProjCell = dmgPerProjCell .. ' (' .. formatNumber(perksDmgNormProj) .. ')' end | ||
end | |||
if dmgExplProj > 0 then | if dmgExplProj > 0 then | ||
dmgPerProjCell = dmgPerProjCell .. ' + ' .. formatNumber(dmgExplProj) | dmgPerProjCell = dmgPerProjCell .. ' + ' .. formatNumber(dmgExplProj) | ||
if perksDmgExplProj > 0 then | if perksDmgExplProj > 0 then dmgPerProjCell = dmgPerProjCell .. ' (' .. formatNumber(perksDmgExplProjTotal) .. ')' end | ||
dmgPerProjCell = dmgPerProjCell .. ' ' .. icon.build({ 'explosion' }) | |||
dmgPerProjCell = dmgPerProjCell .. ' ' .. | |||
end | end | ||
if dmgEffProj > 0 then | if dmgEffProj > 0 then | ||
local effectDuration = localdata["effect duration"] or "1" | local effectDuration = localdata["effect duration"] or "1" | ||
dmgPerProjCell = dmgPerProjCell .. ' + ' .. formatNumber(dmgEffProj) | dmgPerProjCell = dmgPerProjCell .. ' + ' .. formatNumber(dmgEffProj) | ||
if perksDmgEffProj > 0 then | if perksDmgEffProj > 0 then dmgPerProjCell = dmgPerProjCell .. ' (' .. formatNumber(perksDmgEffProjTotal) .. ')' end | ||
dmgPerProjCell = dmgPerProjCell .. ' sur ' .. effectDuration .. ' s ' .. icon.build({ 'effet' }) | |||
dmgPerProjCell = dmgPerProjCell .. ' sur ' .. effectDuration .. ' s ' .. | |||
end | end | ||
local dpsCell = formatNumber(dps) | local dpsCell = formatNumber(dps) | ||
if perksDps > | if perksDps > 0 then dpsCell = dpsCell .. ' ('.. formatNumber(perksDps) .. ')' end | ||
end | |||
if dmgEffTotal > 0 then | if dmgEffTotal > 0 then | ||
dpsCell = dpsCell .. ' + ' .. formatNumber(dmgEffTotal) | dpsCell = dpsCell .. ' + ' .. formatNumber(dmgEffTotal) | ||
if perksDmgEff > 0 then | if perksDmgEff > 0 then dpsCell = dpsCell .. ' (' .. perksDmgEffTotal .. ')' end | ||
dpsCell = dpsCell .. ' ' .. icon.build({ 'effet' }) | |||
dpsCell = dpsCell .. ' ' .. | |||
end | end | ||
local dpsReloadCell = formatNumber(dpsReload) | local dpsReloadCell = formatNumber(dpsReload) | ||
if perksDpsReload > | if perksDpsReload > 0 then dpsReloadCell = dpsReloadCell .. ' ('.. formatNumber(perksDpsReload) .. ')' end | ||
end | |||
if dmgEffTotal > 0 then | if dmgEffTotal > 0 then | ||
dpsReloadCell = dpsReloadCell .. ' + ' .. formatNumber(dmgEffTotal) | dpsReloadCell = dpsReloadCell .. ' + ' .. formatNumber(dmgEffTotal) | ||
if perksDmgEff > 0 then | if perksDmgEff > 0 then dpsReloadCell = dpsReloadCell .. ' (' .. formatNumber(perksDmgEffTotal) .. ')' end | ||
dpsReloadCell = dpsReloadCell .. ' ' .. icon.build({ 'effet' }) | |||
dpsReloadCell = dpsReloadCell .. ' ' .. | |||
end | end | ||
local critMultCell = 'x ' .. formatNumber(critChanceMult, "%.2f") | local critMultCell = 'x ' .. formatNumber(critChanceMult, "%.2f") | ||
local attackPerSecCell = formatNumber(attacksPerSec) | local attackPerSecCell = formatNumber(attacksPerSec) | ||
if perksAttacksPerSec > 0 then | if perksAttacksPerSec > 0 then attackPerSecCell = attackPerSecCell .. ' (' .. formatNumber(perksAttacksPerSecTotal) .. ')' end | ||
end | |||
local reloadTimeCell = formatNumber(reloadTime) | local reloadTimeCell = formatNumber(reloadTime) | ||
if perksReloadTime > 0 then | if perksReloadTime > 0 then reloadTimeCell = reloadTimeCell .. ' (' .. formatNumber(perksReloadTimeTotal) .. ')' end | ||
end | |||
-- Effets des aptitudes | -- Effets des aptitudes | ||
if #perksAttacksPerSecItems > 0 then | |||
perksAttacksPerSecItems = '<ul class="avt-simple-list">' .. perksAttacksPerSecItems .. '</ul>' | |||
else | |||
perksAttacksPerSecItems = nil | |||
end | |||
if #perksDmgItems > 0 then | if #perksDmgItems > 0 then | ||
perksDmgItems = '<ul class="avt-simple-list">' .. perksDmgItems .. '</ul>' | perksDmgItems = '<ul class="avt-simple-list">' .. perksDmgItems .. '</ul>' | ||
else | else | ||
perksDmgItems = nil | perksDmgItems = nil | ||
end | end | ||
if #perksReloadTimeItems > 0 then | if #perksReloadTimeItems > 0 then | ||
Ligne 325 : | Ligne 276 : | ||
{ type = 'row', label = 'Type de munitions', value = 'ammo' }, | { type = 'row', label = 'Type de munitions', value = 'ammo' }, | ||
{ type = 'row', label = 'Projectiles par tir', value = 'ammo use' }, | { type = 'row', label = 'Projectiles par tir', value = 'ammo use' }, | ||
{ type = 'row', label = 'Tirs par magasin', | { type = 'row', label = 'Tirs par magasin', function() return formatNumber(shotsPerReload) end }, | ||
{ type = 'row', label = 'Capacité', value = 'clip rounds' }, | { type = 'row', label = 'Capacité', value = 'clip rounds' }, | ||
{ type = 'row', label = 'Durée de rechargement', value = function() return reloadTimeCell end } | { type = 'row', label = 'Durée de rechargement', value = function() return reloadTimeCell end } | ||
}}, | }}, | ||
{ type = 'table', title = 'Effets des aptitudes' | { type = 'table', title = 'Effets des aptitudes', rows = { | ||
{ type = 'row', label = 'Dégâts', value = function() return perksDmgItems end }, | { type = 'row', label = 'Dégâts', value = function() return perksDmgItems end }, | ||
{ type = 'row', label = 'Attaques par seconde', value = function() return perksAttacksPerSecItems end }, | { type = 'row', label = 'Attaques par seconde', value = function() return perksAttacksPerSecItems end }, | ||
Ligne 342 : | Ligne 293 : | ||
}}, | }}, | ||
{ type = 'table', title = 'Technique', collapseparameters = { collapsible = true, collapsed = true }, rows = { | { type = 'table', title = 'Technique', collapseparameters = { collapsible = true, collapsed = true }, rows = { | ||
{ type = 'row', label = '[[Form ID]]', value = ' | { type = 'row', label = '[[Form ID|Base ID]]', value = 'baseid' }, | ||
{ type = 'row', label = ' | { type = 'row', label = 'Editor ID', value = 'editorid' } | ||
}}, | }}, | ||
{ type = 'text', value = 'pied' } | { type = 'text', value = 'pied' } | ||
} | } | ||
} | } |