Aller au contenu

« Module:Infobox/Arme gamebryo » : différence entre les versions

m
aucun résumé des modifications
Kharmitch (discussion | contributions)
mAucun résumé des modifications
Kharmitch (discussion | contributions)
mAucun résumé des modifications
Ligne 15 : Ligne 15 :
end
end


function formatData(data, round)
function formatData(data)
-- local formattedData
-- local formattedData
-- if data and data > 0 then
-- if data and data > 0 then
-- formattedData = string.format(round, data)
-- formattedData = string.format(round, data)
-- end
-- end
return string.format(round or "%.1f", data)
return string.format("%.1f", data)
end
end
--------------------------------------------------------
-----            Calcul des dégâts                -----
--------------------------------------------------------


-- Type d'arme
-- Type d'arme
Ligne 46 : Ligne 50 :
local perksAttacksPerSecTotal = attacksPerSec + perksAttacksPerSec
local perksAttacksPerSecTotal = attacksPerSec + perksAttacksPerSec


-- Dégâts critiques
-- Multiplicateur de critique
 
local critChance = forceNumber(localdata["crit % mult"])
local critChance = forceNumber(localdata["crit % mult"])


Ligne 54 : Ligne 59 :
end
end


-- projectiles
-- Nombre de projectiles
local proj = 1
local proj = 1
if weaponType == "gun" or weaponType == "gunautomatic" or weaponType == "gunhandload" then
if weaponType == "gun" or weaponType == "gunautomatic" or weaponType == "gunhandload" then
Ligne 88 : Ligne 93 :


local perksReloadTimeTotal = reloadTime - perksReloadTime
local perksReloadTimeTotal = reloadTime - perksReloadTime
-- Dégâts par type (simple, explosif, poison)


local damNormTotal = forceNumber(localdata["damage"])
local damNormTotal = forceNumber(localdata["damage"])
Ligne 146 : Ligne 153 :
local perksDamExplProjTotal = damExplTotal + perksDamExplProj
local perksDamExplProjTotal = damExplTotal + perksDamExplProj


-- Calcul des DPS
-- Calcul du DPS
local DPS = (damNormTotal + damExplTotal) * attacksPerSec
local DPS = (damNormTotal + damExplTotal) * attacksPerSec
local DPSPerks = (perksDamNormTotal + perksDamExplTotal) * perksAttacksPerSecTotal
local DPSPerks = (perksDamNormTotal + perksDamExplTotal) * perksAttacksPerSecTotal


-- Calcul de la durée de rechargement
-- Calcul du DPS en prenant en compte la durée de rechargement
local DPSReload = 0
local DPSReload = 0
local DPSReloadPerks = 0
local DPSReloadPerks = 0
Ligne 177 : Ligne 184 :
local damagePerAttackCell = formatData(damNormTotal)
local damagePerAttackCell = formatData(damNormTotal)
if perksDamNormTotal > 0 then damagePerAttackCell = damagePerAttackCell .. ' (' .. formatData(perksDamNormTotal) .. ')' end
if perksDamNormTotal > 0 then damagePerAttackCell = damagePerAttackCell .. ' (' .. formatData(perksDamNormTotal) .. ')' end
if damExplTotal == '0' then
if damExplTotal > 0 then
damagePerAttackCell = damagePerAttackCell .. ' + ' .. formatData(damExplTotal)
damagePerAttackCell = damagePerAttackCell .. ' + ' .. formatData(damExplTotal)
if perksDamExplTotal > 0 then damagePerAttackCell = damagePerAttackCell .. ' (' .. formatData(perksDamExplTotal) .. ')' end
if perksDamExplTotal > 0 then damagePerAttackCell = damagePerAttackCell .. ' (' .. formatData(perksDamExplTotal) .. ')' end
Bureaucrate, commentadmin, emailconfirmed, Administrateurs d’interface, staff, Administrateur
62 734

modifications