Aller au contenu

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

m
aucun résumé des modifications
Kharmitch (discussion | contributions)
Aucun résumé des modifications
Kharmitch (discussion | contributions)
mAucun résumé des modifications
Ligne 31 : Ligne 31 :
function addItem(item, isAuto, numberOfItems, globalChance)
function addItem(item, isAuto, numberOfItems, globalChance)
if type(item) ~= 'table' then
if type(item) ~= 'table' then
return "<error> item: pas une table"
return "<error> item : pas une table"
end
end
Ligne 37 : Ligne 37 :
if not itemValue then
if not itemValue then
return "<error> item: propriété 'value' non renseignée"
return "<error> item : propriété 'value' non renseignée"
end
end
Ligne 46 : Ligne 46 :
         itemChance = ( (item.max or 1) - (item.min or 1) + 1 ) / numberOfItems
         itemChance = ( (item.max or 1) - (item.min or 1) + 1 ) / numberOfItems
     else
     else
         itemChance = item.chance
         itemChance = item.chance * globalChance
     end
     end
if isAuto == false then
    itemChance = itemChance * globalChance
end


     local itemQuantity = item.quantity
     local itemQuantity = item.quantity
Ligne 82 : Ligne 78 :
return sublist
return sublist
else
else
return "<error> item: propriété 'type' non reconnu"
return "<error> item : propriété 'type' non reconnue"
end
end
end
end
Bureaucrate, commentadmin, emailconfirmed, Administrateurs d’interface, staff, Administrateur
62 734

modifications