Modification de Module:Infobox/Arme gamebryo

Attention : vous n’êtes pas connecté(e). Votre adresse IP sera visible de tout le monde si vous faites des modifications. Si vous vous connectez ou créez un compte, vos modifications seront attribuées à votre propre nom d’utilisateur(rice) et vous aurez d’autres avantages.

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' )
local explosionIcon = icon._build({ 'explosion' })
local effectIcon = icon._build({ 'effet' })
local tooltip = require( 'Module:Infobulle' )
local tooltipDmgAllPerks = 'Dégâts avec toutes les aptitudes mentionnées'
local tooltipDmgPerk = 'Dégâts supplémentaires par attaque avec cette aptitude'
local tooltipAttsecAllPerks = 'Attaques par seconde avec toutes les aptitudes mentionnées'
local tooltipAttsecPerk = 'Attaques supplémentaires par seconde avec cette aptitude'
local tooltipReloadAllPerks = 'Durée du rechargement avec toutes les aptitudes mentionnées'
local tooltipReloadPerk = 'Diminution de la durée de rechargement avec cette aptitude'
local tooltipStyle = 'color:#51E527;'


--------------------------------------------------------
--------------------------------------------------------
Ligne 18 : Ligne 6 :
--------------------------------------------------------
--------------------------------------------------------


-- Récupère un paramètre au format number
-- Récupère un paramètre en forçant à 0
-- Force à 0 si nil ou s'il n'est pas un nombre
-- si nil ou n'est pas nombre
function forceNumber(data)
function forceNumber(data)
return tonumber(data) or 0
if not data or type(data) ~= 'number' then
return 0
end
return data
end
end


-- Formatage du nombre pour l'affichage
function formatData(data, round)
function formatNumber(data, round)
-- local formattedData
-- if data and data > 0 then
-- formattedData = string.format(round, data)
-- end
return string.format(round or "%.1f", data)
return string.format(round or "%.1f", data)
end
-- Formatage des infobulles
function formatTooltip(text, title)
    return tooltip._build({ text, title, style = tooltipStyle })
end
end


--------------------------------------------------------
--------------------------------------------------------
-----             Calcul des dégâts               -----
-----           Calcul des dégâts et              -----
-----      et création des tables de stats        -----
--------------------------------------------------------
--------------------------------------------------------


-- Type d'arme
function buildStatsTables(localdata)
local weaponCompletType = (localdata['type'] or ''):lower()
    -- Type d'arme
local weaponType = weaponCompletType:gsub(' unique', '')
    local weaponCompletType = localdata["type"] or ""
local isUnique = weaponCompletType:find(' unique') ~= nil
    local weaponType = weaponCompletType:gsub(" unique", "")
    local isUnique = weaponCompletType:find(' unique')
   
    -- Dégâts
    local attacksPerSec = forceNumber(localdata["attack shots/sec"])
   
    -- Augmentation des dégâts via les aptitudes
    -- Les aptitudes agissent comme un coefficient multiplicateur
    local perksAttacksPerSec = 0
   
    for i = 1, 9 do
        local perkAttsecMult = forceNumber(localdata["perk" .. i .. " attsec mult"])
        if perkAttsecMult > 0 then
            perksAttacksPerSec = perksAttacksPerSec + (attacksPerSec * perkAttsecMult)
        else
            break
        end
    end
   
    local perksAttacksPerSecTotal = attacksPerSec + perksAttacksPerSec
   
    -- Multiplicateur de critique
    local critChance = forceNumber(localdata["crit % mult"])


-- Nombre d'attaques par seconde
    local critChanceModified = 0
local attacksPerSec = forceNumber(localdata["attack shots/sec"])
    if weaponType == 'gunautomatic' and perksAttacksPerSecTotal > 0 then
        critChanceModified = critChance / perksAttacksPerSecTotal
    end


-- Durée du rechargement
     -- Nombre de projectiles
local reloadTime = 0
    local proj = 1
if weaponType == "gun" or weaponType == "gunautomatic" or weaponType == "gunhandload" then
    if weaponType == "gun" or weaponType == "gunautomatic" or weaponType == "gunhandload" then
     reloadTime = forceNumber(localdata["reload time"])
        proj = forceNumber(localdata["projectiles"])
end
        if proj == 0 then proj = 1 end
 
    end
-- Nombre de projectiles par attaque
local proj = 1
if weaponType == "gun" or weaponType == "gunautomatic" or weaponType == "gunhandload" then
    proj = forceNumber(localdata["projectiles"])
    if proj == 0 then proj = 1 end -- on force à 1 si projectile non renseigné
end


-- Taille du magasin
    local clipRounds = forceNumber(localdata["clip rounds"])
local clipRounds = forceNumber(localdata["clip rounds"])  
    local ammoUse = forceNumber(localdata["ammo use"])


-- Nombre de cartouches par attaque
    local shotsPerReload = 0
local ammoUse = forceNumber(localdata["ammo use"])  
    if ammoUse > 0 then
        shotsPerReload = math.floor(clipRounds / ammoUse)
    end


-- Nombre d'attaques par rechargement
    -- Durée de rechargement
local shotsPerReload = 0
    local reloadTime = 0
if ammoUse > 0 then
    if weaponType == "gun" or weaponType == "gunautomatic" or weaponType == "gunhandload" then
    shotsPerReload = math.floor(clipRounds / ammoUse)
        reloadTime = forceNumber(localdata["reload time"])
end
    end


-- Dégâts par type : balistique, explosif, effet
    -- Durée de rechargement en prenant en compte les aptitudes
    local perksReloadTime = 0


local dmgNormTotal = forceNumber(localdata["damage"])
    for i = 1, 9 do
local dmgNormProj = dmgNormTotal / proj
        local perkReloadTime = localdata["perk" .. i .. " reload mult"]
 
        if perkReloadTime and type(perkReloadTime) == "number" then
local dmgEffProj = forceNumber(localdata["effect damage"])
            perksReloadTime = perksReloadTime + (reloadTime * perkReloadTime)
local dmgEffTotal = dmgEffProj * proj
        else
            break
        end
    end


local dmgExplProj = forceNumber(localdata["explosion damage"])
    local perksReloadTimeTotal = reloadTime - perksReloadTime
local dmgExplTotal = dmgExplProj * proj


-- Effets des aptitudes sur les dégâts
    -- Dégâts par type (simple, explosif, poison)
local perksAttacksPerSec = 0
local perksDmgNorm = 0
local perksDmgEff = 0
local perksDmgExpl = 0
local perksReloadTime = 0


local perksAttacksPerSecItems = ''
    local damNormTotal = forceNumber(localdata["damage"])
local perksDmgItems = ''
    local damNormProj = damNormTotal / proj
local perksReloadTimeItems = ''


for i = 1, 9 do
     local damEffProj = forceNumber(localdata["effect damage"])
     local perk = localdata["perk" .. i]
    local damEffTotal = damEffProj * proj


     if perk then
     local damExplProj = forceNumber(localdata["explosion damage"])
        -- Calcul de chaque donnée
    local damExplTotal = damExplProj * proj
        local perkAttacksPerSec = attacksPerSec * forceNumber(localdata["perk" .. i .. " attsec mult"])
        local perkDmgNorm = (dmgNormTotal * forceNumber(localdata["perk" .. i .. " mult"])) + forceNumber(localdata["perk" .. i .. " add"])
        local perkDmgEff = (dmgEffTotal * forceNumber(localdata["perk" .. i .. " eff mult"])) + forceNumber(localdata["perk" .. i .. " eff add"])
        local perkDmgExpl = (dmgExplTotal * forceNumber(localdata["perk" .. i .. " expl mult"])) + forceNumber(localdata["perk" .. i .. " expl add"])
        local perkReloadTime = reloadTime * forceNumber(localdata["perk" .. i .. " reload mult"])


        -- Somme des effets et gestion
    local perksDamNorm = 0
        -- de l'affichage de la table Effets des aptitudes


        if perkAttacksPerSec > 0 then
    for i = 1, 9 do
            perksAttacksPerSec = perksAttacksPerSec + perkAttacksPerSec
        local perkDamNormMult = localdata["perk" .. i .. " mult"] or 0
            perksAttacksPerSecItems = perksAttacksPerSecItems .. '<li>' .. perk .. '<div style="float:right;">+ ' .. formatTooltip(formatNumber(perkAttacksPerSec), tooltipAttsecPerk) .. '</div></li>'
        local perkDamNormAdd  = localdata["perk" .. i .. " add"] or 0
        if type(perkDamNormMult) == "number" and type(perkDamNormAdd) == "number" then
            perksDamNorm = perksDamNorm + (damNormTotal * perkDamNormMult) + perkDamNormAdd
        else
            break
         end
         end
    end


        if perkDmgNorm > 0 or perkDmgEff > 0 or perkDmgExpl > 0 then
    local perksDamNormProj = perksDamNorm / proj
            perksDmgItems = perksDmgItems .. '<li>' .. perk .. '<div style="float:right;">'
    local perksDamNormTotal = damNormTotal + perksDamNorm
    local perksDamNormProjTotal = damNormProj + perksDamNormProj


            local addDmg = ''
    local perksDamEff = 0


            if perkDmgNorm > 0 then
    for i = 1, 9 do
                perksDmgNorm = perksDmgNorm + perkDmgNorm
        local perkDamEffMult = localdata["perk" .. i .. " eff mult"] or 0
                addDmg = addDmg .. ' + ' .. formatNumber(perkDmgNorm)
        local perkDamEffAdd  = localdata["perk" .. i .. " eff add"] or 0
             end
        if type(perkDamEffMult) == "number" and type(perkDamEffAdd) == "number" then
 
             perksDamEff = perksDamEff + (damEffProj * perkDamEffMult) + perkDamEffAdd
            if perkDmgExpl > 0 then
        else
                perksDmgExpl = perksDmgExpl + perkDmgExpl
             break
                addDmg = addDmg .. ' + ' .. formatNumber(perkDmgExpl) .. ' ' .. explosionIcon
        end
             end
    end


            if perkDmgEff > 0 then
    local perksDamEffProj = perksDamEff / proj
                perksDmgEff = perksDmgEff + perkDmgEff
    local perksDamEffTotal = damEffTotal + perksDamEff
                addDmg = addDmg .. ' + ' .. formatNumber(perkDmgEff) .. ' ' .. effectIcon
    local perksDamEffProjTotal = damEffProj + perksDamEffProj
            end


            perksDmgItems = perksDmgItems .. formatTooltip(addDmg, tooltipDmgPerk) .. '</div></li>'
    local perksDamExpl = 0
        end


        if perkReloadTime > 0 then
    for i = 1, 9 do
            perksReloadTime = perksReloadTime + perkReloadTime
        local perkDamExplMult = localdata["perk" .. i .. " eff mult"] or 0
            perksReloadTimeItems = perksReloadTimeItems .. '<li>' .. perk .. '<div style="float:right;">- ' .. formatTooltip(formatNumber(perkReloadTime), tooltipReloadPerk)  .. ' s</div></li>'
        local perkDamExplAdd  = localdata["perk" .. i .. " eff add"] or 0
        if type(perkDamExplMult) == "number" and type(perkDamExplAdd) == "number" then
            perksDamExpl = perksDamExpl + (damExplTotal * perkDamExplMult) + perkDamExplAdd
        else
            break
         end
         end
    else
        break
     end
     end
end


local perksAttacksPerSecTotal = attacksPerSec + perksAttacksPerSec
    local perksDamExplProj = perksDamExpl / proj
    local perksDamExplTotal = damExplTotal + perksDamExpl
    local perksDamExplProjTotal = damExplTotal + perksDamExplProj


local perksDmgNormProj = perksDmgNorm / proj
    -- Calcul du DPS
local perksDmgNormTotal = dmgNormTotal + perksDmgNorm
    local DPS = (damNormTotal + damExplTotal) * attacksPerSec
local perksDmgNormProjTotal = dmgNormProj + perksDmgNormProj
    local DPSPerks = (perksDamNormTotal + perksDamExplTotal) * perksAttacksPerSecTotal


local perksDmgEffProj = perksDmgEff / proj
    -- Calcul du DPS en prenant en compte la durée de rechargement
local perksDmgEffTotal = dmgEffTotal + perksDmgEff
    local DPSReload = 0
local perksDmgEffProjTotal = dmgEffProj + perksDmgEffProj
    local DPSReloadPerks = 0


local perksDmgExplProj = perksDmgExpl / proj
    local coeff = 1
local perksDmgExplTotal = dmgExplTotal + perksDmgExpl
    if weaponType == "gunhandload" then
local perksDmgExplProjTotal = dmgExplTotal + perksDmgExplProj
        coeff = shotsPerReload
    end


local perksReloadTimeTotal = reloadTime - perksReloadTime
    if shotsPerReload > 0 then
        if attacksPerSec > 0 then
            DPSReload = ((damNormTotal + damExplTotal) * shotsPerReload) /
                ((shotsPerReload / attacksPerSec) + reloadTime * coef)
        end
       
        if perksAttacksPerSecTotal > 0 then
            DPSReloadPerks = ((perksDamNormTotal + perksDamExplTotal) * shotsPerReload) /
                ((shotsPerReload / perksAttacksPerSecTotal) + perksReloadTimeTotal * coef)
        end
    end


-- Dégâts par seconde
    --------------------------------------------------------
local dps = (dmgNormTotal + dmgExplTotal) * attacksPerSec
    -----            Formatage des données            -----
local perksDps = (perksDmgNormTotal + perksDmgExplTotal) * perksAttacksPerSecTotal
    --------------------------------------------------------


-- Dégâts par seconde en prenant en compte la durée du rechargement
    local damagePerAttackCell = formatData(damNormTotal)
local dpsReload = 0
    if perksDamNormTotal > 0 then damagePerAttackCell = damagePerAttackCell .. ' (' .. formatData(perksDamNormTotal) .. ')' end
local perksDpsReload = 0
    if damExplTotal > 0 then
        damagePerAttackCell = damagePerAttackCell .. ' + ' .. formatData(damExplTotal)
        if perksDamExplTotal > 0 then damagePerAttackCell = damagePerAttackCell .. ' (' .. formatData(perksDamExplTotal) .. ')' end
        damagePerAttackCell = damagePerAttackCell .. ' ' .. icon.build({ 'explosion' })
    end


local coeff = 1
    if damEffTotal > 0 then
if weaponType == "gunhandload" then
        local effectDuration = localdata["effect duration"] or "1"
     coeff = shotsPerReload
        damagePerAttackCell = damagePerAttackCell .. ' + ' .. formatData(damEffTotal)
end
        if perksDamEffTotal > 0 then damagePerAttackCell = damagePerAttackCell .. ' (' .. formatData(perksDamEffTotal) .. ')' end
        damagePerAttackCell = damagePerAttackCell .. ' sur ' .. effectDuration .. ' s ' .. icon.build({ 'effet' })
     end


if shotsPerReload > 0 then
    local damagePerProjCell = formatData(damNormProj)
     if attacksPerSec > 0 then
    if perksDamNormProj > 0 then damagePerProjCell = damagePerProjCell .. ' (' .. formatData(perksDamNormProj) .. ')' end
         dpsReload = ((dmgNormTotal + dmgExplTotal) * shotsPerReload) /
     if damExplProj > 0 then
            ((shotsPerReload / attacksPerSec) + reloadTime * coeff)
         damagePerProjCell = damagePerProjCell .. ' + ' .. formatData(damExplProj)
    end
        if perksDamExplProjTotal > 0 then damagePerProjCell = damagePerProjCell .. ' (' .. formatData(perksDamExplProjTotal) .. ')' end
   
        damagePerProjCell = damagePerProjCell .. ' ' .. icon.build({ 'explosion' })
    if perksAttacksPerSecTotal > 0 then
        perksDpsReload = ((perksDmgNormTotal + perksDmgExplTotal) * shotsPerReload) /
            ((shotsPerReload / perksAttacksPerSecTotal) + perksReloadTimeTotal * coeff)
     end
     end
end


-- Multiplicateur des chances de critique
    if damEffProj > 0 then
local critChanceMult = forceNumber(localdata["crit % mult"])
        local effectDuration = localdata["effect duration"] or "1"
if weaponType == 'gunautomatic' and perksAttacksPerSecTotal > 0 then
        damagePerProjCell = damagePerProjCell .. ' + ' .. formatData(damEffProj)
    -- Pour les armes automatiques, on divise par le nombre d'attaques par seconde
        if perksDamEffProjTotal > 0 then damagePerProjCell = damagePerProjCell .. ' (' .. formatData(perksDamEffProjTotal) .. ')' end
    critChanceMult = critChanceMult / perksAttacksPerSecTotal
        damagePerProjCell = damagePerProjCell .. ' sur ' .. effectDuration .. ' s ' .. icon.build({ 'effet' })
end
 
--------------------------------------------------------
-----            Formatage des données            -----
--------------------------------------------------------
 
-- Dégâts par attaque
local dmgPerAttackCell = formatNumber(dmgNormTotal)
if perksDmgNorm > 0 then
    dmgPerAttackCell = dmgPerAttackCell .. ' (' .. formatTooltip(formatNumber(perksDmgNormTotal), tooltipDmgAllPerks) .. ')'
end
if dmgExplTotal > 0 then
    dmgPerAttackCell = dmgPerAttackCell .. ' + ' .. formatNumber(dmgExplTotal)
    if perksDmgExpl > 0 then
        dmgPerAttackCell = dmgPerAttackCell .. ' (' .. formatTooltip(formatNumber(perksDmgExplTotal), tooltipDmgAllPerks) .. ')'
    end
    dmgPerAttackCell = dmgPerAttackCell .. ' ' .. explosionIcon
end
if dmgEffTotal > 0 then
    local effectDuration = localdata["effect duration"] or "1"
    dmgPerAttackCell = dmgPerAttackCell .. ' + ' .. formatNumber(dmgEffTotal)
    if perksDmgEff > 0 then
        dmgPerAttackCell = dmgPerAttackCell .. ' (' .. formatTooltip(formatNumber(perksDmgEffTotal), tooltipDmgAllPerks) .. ')'
     end
     end
    dmgPerAttackCell = dmgPerAttackCell .. ' sur ' .. effectDuration .. ' s ' .. effectIcon
end


-- Dégâts par projectile
    local dpsCell = formatData(DPS)
local dmgPerProjCell = formatNumber(dmgNormProj)
    if DPSPerks > 0 then dpsCell = dpsCell .. ' ('.. formatData(DPSPerks) .. ')' end
if perksDmgNormProj > 0 then
    if damEffTotal > 0 then
    dmgPerProjCell = dmgPerProjCell .. ' (' .. formatTooltip(formatNumber(perksDmgNormProjTotal), tooltipDmgAllPerks) .. ')'
        dpsCell = dpsCell .. ' + ' .. formatData(damEffTotal)
end
        if perksDamEffTotal > 0 then dpsCell = dpsCell .. ' (' .. perksDamEffTotal .. ')' end
if dmgExplProj > 0 then
        dpsCell = dpsCell .. ' ' .. icon.build({ 'effet' })
    dmgPerProjCell = dmgPerProjCell .. ' + ' .. formatNumber(dmgExplProj)
    if perksDmgExplProj > 0 then
        dmgPerProjCell = dmgPerProjCell .. ' (' .. formatTooltip(formatNumber(perksDmgExplProjTotal), tooltipDmgAllPerks) .. ')'
    end
    dmgPerProjCell = dmgPerProjCell .. ' ' .. explosionIcon
end
if dmgEffProj > 0 then
    local effectDuration = localdata["effect duration"] or "1"
    dmgPerProjCell = dmgPerProjCell .. ' + ' .. formatNumber(dmgEffProj)
    if perksDmgEffProj > 0 then
        dmgPerProjCell = dmgPerProjCell .. ' (' .. formatTooltip(formatNumber(perksDmgEffProjTotal), tooltipDmgAllPerks) .. ')'
     end
     end
    dmgPerProjCell = dmgPerProjCell .. ' sur ' .. effectDuration .. ' s ' .. effectIcon
end


-- Dégâts par seconde
    local dpsReloadCell = formatData(DPSReload)
local dpsCell = formatNumber(dps)
    if DPSReloadPerks > 0 then dpsReloadCell = dpsReloadCell .. ' ('.. formatData(DPSReloadPerks) .. ')' end
if perksDps > dps then
    if damEffTotal > 0 then
    dpsCell = dpsCell .. ' ('.. formatTooltip(formatNumber(perksDps), tooltipDmgAllPerks) .. ')'
        dpsReloadCell = dpsReloadCell .. ' + ' .. formatData(damEffTotal)
end
        if perksDamEffTotal > 0 then dpsReloadCell = dpsReloadCell .. ' (' .. formatData(perksDamEffTotal) .. ')' end
if dmgEffTotal > 0 then
        dpsReloadCell = dpsReloadCell .. ' ' .. icon.build({ 'effet' })
    dpsCell = dpsCell .. ' + ' .. formatNumber(dmgEffTotal)
    if perksDmgEff > 0 then
        dpsCell = dpsCell .. ' (' .. formatTooltip(formatNumber(perksDmgEffTotal), tooltipDmgAllPerks) .. ')'
     end
     end
    dpsCell = dpsCell .. ' ' .. effectIcon
end


-- Dégâts par seconde (avec rechargement)
    local critMultCell = critChance
local dpsReloadCell = formatNumber(dpsReload)
     if critChanceModified > 0 then critMultCell = critChanceModified end
if perksDpsReload > dpsReload then
     critMultCell = 'x ' .. formatData(critMultCell, "%.2f")
     dpsReloadCell = dpsReloadCell .. ' ('.. formatTooltip(formatNumber(perksDpsReload), tooltipDmgAllPerks) .. ')'
end
if dmgEffTotal > 0 then
    dpsReloadCell = dpsReloadCell .. ' + ' .. formatNumber(dmgEffTotal)
     if perksDmgEff > 0 then
        dpsReloadCell = dpsReloadCell .. ' (' .. formatTooltip(formatNumber(perksDmgEffTotal), tooltipDmgAllPerks) .. ')'
    end
    dpsReloadCell = dpsReloadCell .. ' ' .. effectIcon
end


-- Multiplicateur de critique
    local attackPerSecondCell = formatData(attacksPerSec)
local critMultCell = 'x ' .. formatNumber(critChanceMult, "%.2f")
    if perksAttacksPerSecTotal > 0 then attackPerSecondCell = attackPerSecondCell .. ' (' .. formatData(perksAttacksPerSecTotal) .. ')' end


-- Attaques par seconde
    local reloadTimeCell = formatData(reloadTime)
local attackPerSecCell = formatNumber(attacksPerSec)
    if perksReloadTimeTotal > 0 then reloadTimeCell = reloadTimeCell .. ' (' .. formatData(perksReloadTimeTotal) .. ')' end
if perksAttacksPerSec > 0 then
    attackPerSecCell = attackPerSecCell .. ' (' .. formatTooltip(formatNumber(perksAttacksPerSecTotal), tooltipAttsecAllPerks) .. ')'
end


-- Durée de rechargement
    --------------------------------------------------------
local reloadTimeCell = formatNumber(reloadTime)
    -----                    Retour                    -----
if perksReloadTime > 0 then
     --------------------------------------------------------
     reloadTimeCell = reloadTimeCell .. ' (' .. formatTooltip(formatNumber(perksReloadTimeTotal), tooltipReloadAllPerks)  .. ')'
end


-- Effets des aptitudes
    return { type = 'table', title = 'Statistiques de combat', collapseparameters = { collapsible = true, collapsed = true }, rows = {
if #perksDmgItems > 0 then
        { type = 'row', label = 'Dégâts par attaque', value = function() return damagePerAttackCell end },
    perksDmgItems = '<ul class="avt-simple-list">' .. perksDmgItems .. '</ul>'
        { type = 'row', label = 'Dégâts par projectile', value = function() return damagePerProjCell end },
else
        { type = 'row', label = 'Dégâts par seconde', value = function() return dpsCell end },
    perksDmgItems = nil
        { type = 'row', label = 'Dégâts par seconde (avec rechargement)', value = function() return dpsReloadCell end },
end
        { type = 'row', label = 'Dégâts critiques', value = 'crit dmg' },
if #perksAttacksPerSecItems > 0 then
        { type = 'row', label = 'Multiplicateur de critique', value = function() return critMultCell end },
    perksAttacksPerSecItems = '<ul class="avt-simple-list">' .. perksAttacksPerSecItems .. '</ul>'
        { type = 'row', label = 'Attaques par seconde', value = function() return attackPerSecondCell end },
else
        { type = 'row', label = 'Points d\'action', value = 'ap' },
     perksAttacksPerSecItems = nil
        { type = 'row', label = 'Projectiles', value = 'projectiles' },
end
        { type = 'row', label = 'Dispersion', value = 'min spread' },
if #perksReloadTimeItems > 0 then
        { type = 'row', label = 'Effet', value = 'other effect' },
    perksReloadTimeItems = '<ul class="avt-simple-list">' .. perksReloadTimeItems .. '</ul>'
        { type = 'row', label = 'Effet critique', value = 'crit effect' }
else
    }},
     perksReloadTimeItems = nil
     { type = 'table', title = 'Munitions et rechargement', collapseparameters = { collapsible = true, collapsed = true }, rows = {
        { type = 'row', label = 'Type de munitions', value = 'ammo' },
        { type = 'row', label = 'Projectiles par tir', value = 'ammo use' },
        { type = 'row', label = 'Tirs par magasin', function() return formatData(shotsPerReload) end },
        { type = 'row', label = 'Capacité', value = 'clip rounds' },
        { type = 'row', label = 'Durée de rechargement', value = function() return reloadTimeCell end }
     }}
end
end


Ligne 304 : Ligne 274 :
{ type = 'title', value = 'nom', subtitle = 'sous-titre', icon = 'icône', subhead = { games = 'jeux', subject = 'Arme', link = 'Armes' }},
{ type = 'title', value = 'nom', subtitle = 'sous-titre', icon = 'icône', subhead = { games = 'jeux', subject = 'Arme', link = 'Armes' }},
{ type = 'images', imageparameters = { 'image', 'image2', 'image3', 'image4', 'image5' }, captionparameter = { 'légende', 'image desc' }},
{ type = 'images', imageparameters = { 'image', 'image2', 'image3', 'image4', 'image5' }, captionparameter = { 'légende', 'image desc' }},
{ type = 'table', title = 'Conditions d\'utilisation', rows = {
buildStatsTables(localdata),
{ type = 'row', label = 'Compétence', value = 'skill' },
{ type = 'table', title = 'Effets des aptitudes', rows = {
{ type = 'row', label = 'Force', value = 'strength req' }
-- TODO
}},
{ type = 'table', title = 'Statistiques de combat', collapseparameters = { collapsible = true, collapsed = true }, rows = {
        { type = 'row', label = 'Dégâts par attaque', value = function() return dmgPerAttackCell end },
        { type = 'row', label = 'Dégâts par projectile', value = function() return dmgPerProjCell end },
        { type = 'row', label = 'Dégâts par seconde', value = function() return dpsCell end },
        { type = 'row', label = 'Dégâts par seconde (avec rechargement)', value = function() return dpsReloadCell end },
        { type = 'row', label = 'Dégâts critiques', value = 'crit dmg' },
        { type = 'row', label = 'Multiplicateur de critique', value = function() return critMultCell end },
        { type = 'row', label = 'Attaques par seconde', value = function() return attackPerSecCell end },
        { type = 'row', label = 'Points d\'action', value = 'ap' },
        { type = 'row', label = 'Projectiles', value = 'projectiles' },
        { type = 'row', label = 'Dispersion', value = 'min spread' },
        { type = 'row', label = 'Effet', value = 'other effect' },
        { type = 'row', label = 'Effet critique', value = 'crit effect' }
    }},
    { type = 'table', title = 'Munitions et rechargement', collapseparameters = { collapsible = true, collapsed = true }, rows = {
        { type = 'row', label = 'Type de munitions', value = 'ammo' },
        { type = 'row', label = 'Projectiles par tir', value = 'ammo use' },
        { type = 'row', label = 'Tirs par magasin', value = function() return formatNumber(shotsPerReload) end },
        { type = 'row', label = 'Capacité', value = 'clip rounds' },
        { type = 'row', label = 'Durée de rechargement', value = function() return reloadTimeCell end }
    }},
{ type = 'table', title = 'Effets des aptitudes', collapseparameters = { collapsible = true, collapsed = true }, rows = {
{ 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 = 'Rechargement', value = function() return perksReloadTimeItems end }
}},
}},
{ type = 'table', title = 'Autres propriétés', rows = {
{ type = 'table', title = 'Autres propriétés', rows = {
Ligne 342 : Ligne 286 :
}},
}},
{ 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 = 'formid' },
{ type = 'row', label = '[[Form ID|Base ID]]', value = 'baseid' },
{ type = 'row', label = '[[Editor ID]]', value = 'editorid' }
{ type = 'row', label = 'Editor ID', value = 'editorid' }
}},
}},
{ type = 'text', value = 'pied' }
{ type = 'text', value = 'pied' }
}
}
}
}
Notez bien que toutes les contributions à Les Archives de Vault-Tec sont considérées comme publiées sous les termes de la creative Commons - CC BY-NC-SA 3.0 (voir Les Archives de Vault-Tec:Copyrights pour plus de détails). Si vous ne désirez pas que vos écrits soient modifiés et distribués à volonté, merci de ne pas les soumettre ici.
Vous nous promettez aussi que vous avez écrit ceci vous-même, ou que vous l’avez copié d’une source placée dans le domaine public ou d’une ressource libre similaire. N’utilisez aucun travail sous droits d’auteur sans autorisation expresse !
Annuler Aide pour la modification (s’ouvre dans une nouvelle fenêtre)