Aller au contenu

« Module:Liste d'objets de Fallout 76 » : différence entre les versions

aucun résumé des modifications
Kharmitch (discussion | contributions)
mAucun résumé des modifications
Kharmitch (discussion | contributions)
Aucun résumé des modifications
Ligne 41 : Ligne 41 :
local itemType = item.type
local itemType = item.type
local itemMin = item.min or 1
local itemMax = item.max or 1
if itemMin > itemMax then
return "<error> item : propriété 'min' > 'max'"
end
     local itemChance
     local itemChance


     if isAuto == true then
     if isAuto == true then
         itemChance = ( (item.max or 1) - (item.min or 1) + 1 ) / numberOfItems
         itemChance = ( itemMax - itemMin + 1 ) / numberOfItems
     else
     else
         itemChance = item.chance * globalChance
         itemChance = item.chance
     end
     end
   
    itemChance =  itemChance * globalChance


     local itemQuantity = item.quantity
     local itemQuantity = item.quantity
Ligne 54 : Ligne 63 :
     if itemQuantity then
     if itemQuantity then
         suffix = suffix .. itemQuantity .. ', '
         suffix = suffix .. itemQuantity .. ', '
    elseif itemMax > 1 then
    suffix = suffix .. itemMin .. '-' .. itemMax .. ', '
     end
     end


Bureaucrate, commentadmin, emailconfirmed, Administrateurs d’interface, staff, Administrateur
62 734

modifications