Wiki Warframe

Utilisation du Wiki

Pour une meilleure utilisation du Wiki Warframe FR, merci d'activer les scripts Javascript lors de la consultation de certains pages, pour assurer le fonctionnement de certaines fonctionnalités.
Si vous souhaitez contribuer au Wiki, rejoignez-nous sur le Discord Warframe FR (espace wiki)

- Yazu 17:00 01/10/2022

EN SAVOIR PLUS

Wiki Warframe
Aucun résumé des modifications
Aucun résumé des modifications
Ligne 64 : Ligne 64 :
 
local primeParts = {}
 
local primeParts = {}
 
local foundryTable = '{| class="foundrytable" style="float:left;margin:auto"'
 
local foundryTable = '{| class="foundrytable" style="float:left;margin:auto"'
foundryTable = foundryTable..'\n!colspan=6|[[Foundry|Manufacturing]] Requirements'
+
foundryTable = foundryTable..'\n!colspan=6|[[Fonderie|Fabrication]] Requis'
 
foundryTable = foundryTable..'\n|-'
 
foundryTable = foundryTable..'\n|-'
 
foundryTable = foundryTable..rowStart
 
foundryTable = foundryTable..rowStart

Version du 5 septembre 2019 à 03:51

Erreur Lua dans Module:Docbunto à la ligne 922 : Documentation markup pour Docbunto introuvable dans Module:Cost.
Documentation automatique créée à l'aide de Docbuntu (-> Modèle automatique)

Voir aussi

Code


--Source: https://warframe.fandom.com/wiki/Module:Cost
 
local p = {}
 
local WeaponModule = require( 'Module:Weapons' )
local Icon = require( "Module:Icon" )
local Shared = require( "Module:Shared" )
local Void = require( "Module:Void" )
local ResearchData = mw.loadData( "Module:Research/data" )
 
function p.getLabLink(factionName)
    if(ResearchData["Labs"][factionName] == nil) then
       return "[[Recherche]]"
    else
        local labName = ResearchData["Labs"][factionName].Name
        return "[[Recherche#"..labName.."|Recherche "..labName.."]]"
    end
end
 
function p.isResearch(itemName)
    for i, val in pairs(ResearchData["Recherche"]) do
        if(val.Name ~= nil and val.Name == itemName) then
            return true, val
        end
    end
    return false, nil
end
 
local function buildItemText(Item)
    if(Item == nil) then
        return " "
    end
 
    if(Item.Type == "Ressource" or Item.Type == nil) then
        return Icon._Resource(Item.Name, nil, 'x32').."<br/>"..Shared.formatnum(Item.Count)
    elseif(Item.Type == "Objet") then
        return Icon._Item(Item.Name, nil, 'x32').."<br/>"..Shared.formatnum(Item.Count)
    elseif(Item.Type == "PrimePart") then
        return Icon._Item("Prime "..Item.Name, nil, 'x32').."<br/>"..Shared.formatnum(Item.Count)
    elseif(Item.Type == "Arme") then
        local itemWeapon = WeaponModule.getWeapon(Item.Name)
        if(itemWeapon.Image ~= nil) then
            return '[[File:'..itemWeapon.Image..'|36px|link='..itemWeapon.Name..']]<br/>'..Shared.formatnum(Item.Count)
        else
            return "[MISSING IMAGE: "..Item.Name.."]<br/>"..Shared.formatnum(Item.Count)
        end
    end
end
 
function p.buildWeaponCostBox(frame)
    local WeaponName = frame.args ~= nil and frame.args[1] or frame
    local Weapon = WeaponModule.getWeapon(WeaponName)
 
    if(Weapon == nil) then
        return "ERROR: "..WeaponName.." not found"
    elseif(Weapon.Cost == nil) then
        return "ERROR: "..WeaponName.." does not have Cost data"
    end
 
    local rowStart = '\n| rowspan="2" style="height:50px; width:50px;" |'
    local smallPart = '\n| style="text-align:left; padding: 0em 0.25em;" |'
    local lowRow = '\n| colspan="3" |<small>'
    if(Weapon.Cost.Parts ~= nil) then
        local primeParts = {}
        local foundryTable = '{| class="foundrytable" style="float:left;margin:auto"'
        foundryTable = foundryTable..'\n!colspan=6|[[Fonderie|Fabrication]] Requis'
        foundryTable = foundryTable..'\n|-'
        foundryTable = foundryTable..rowStart
        --Adding Credit costs
        if(Weapon.Cost.Credits ~= nil) then
            foundryTable = foundryTable..Icon._Item("Crédits").."<br/>"..Shared.formatnum(Weapon.Cost.Credits)
        else
            foundryTable = foundryTable..'N/A'
        end
 
        --Adding part costs
        for i=1, 4 do
            foundryTable = foundryTable..rowStart..buildItemText(Weapon.Cost.Parts[i])
            if(Weapon.Cost.Parts[i] ~= nil and Weapon.Cost.Parts[i].Type == "PrimePart") then
                if(primeParts[Weapon.Cost.Parts[i].Name] == nil) then
                    primeParts[Weapon.Cost.Parts[i].Name] = 1
                end 
            end
        end
 
        --Adding the time, market, and rush cost
        foundryTable = foundryTable..smallPart
        if(Weapon.Cost.Time ~= nil) then
            foundryTable = foundryTable.."Temps : "..Weapon.Cost.Time.." h"
        else
            foundryTable = foundryTable..'N/A'
        end
        foundryTable = foundryTable..'\n|-'..smallPart
        if(Weapon.Cost.Rush ~= nil) then
            foundryTable = foundryTable..'Accélerer: '..Icon._Item("Platinum",nil, 20)..' '..Weapon.Cost.Rush
        else
            foundryTable = foundryTable..'N/A'
        end
        foundryTable = foundryTable..'\n|-'..lowRow..Icon._Item("Marché", "text", 22)..' Price: '..Icon._Item("Platinum", nil, 20)..' '
        if(Weapon.Cost.MarketCost ~= nil) then
            foundryTable = foundryTable..Weapon.Cost.MarketCost
        else
            foundryTable = foundryTable.."N/A"
        end
        foundryTable = foundryTable..'</small>'..lowRow..Icon._Item("Schéma", "text", 22)..' Prix:'
        if(Weapon.Cost.BPCost ~= nil) then
            foundryTable = foundryTable..Icon._Item("Crédits", nil, 22)
            foundryTable = foundryTable..Shared.formatnum(Weapon.Cost.BPCost)
        --This is for Heliocor and Simulor
        elseif
            (Weapon.Cost.BPStanding ~= nil) then
                foundryTable = foundryTable..Icon._Item("Réputation", nil, 22)
                foundryTable = foundryTable..Shared.formatnum(Weapon.Cost.BPStanding)
                else
            foundryTable = foundryTable.."N/A"
        end
        foundryTable = foundryTable..'</small>'
 
        --Adding Prime drop locations if needed
        if(Shared.tableCount(primeParts) > 0) then
            local itemName = string.gsub(Weapon.Name, " Prime", "")
            foundryTable = foundryTable..'\n|-\n| colspan="6" | '
            foundryTable = foundryTable..'<div class="mw-collapsible mw-collapsed" style="width:100%;text-align:center;">'
            foundryTable = foundryTable.."'''Drop Locations'''"
            foundryTable = foundryTable..'\n<div class="mw-collapsible-content">'
            foundryTable = foundryTable..'\n{| style="width:100%;"\n|-\n|Blueprint||'..Void.item({args = {"PC", itemName, "Blueprint"}})
            for partName, i in Shared.skpairs(primeParts) do
                foundryTable = foundryTable..'\n|-\n|'..Icon._Item("Prime "..partName, "text")..'||'..Void.item({args = {"PC", itemName, partName}})
            end
            foundryTable = foundryTable..'\n|}'
            foundryTable = foundryTable..'\nLith/Meso/Neo/Axi refer to [[Void Relic]]s<br />([[Prime Vault|V]]) Denotes [[Prime Vault|Vaulted]] Void Relics<br />([[Baro Ki%27Teer|B]]) Denotes [[Baro Ki%27Teer]] Exclusive Void Relic</div></div>'
        end
 
        --Adding Research costs if needed
        local isResearch, weapRes = p.isResearch(Weapon.Name)
        if(isResearch) then
            foundryTable = foundryTable..'\n|-\n! colspan=6| '..p.getLabLink(weapRes.Lab)
            if(weapRes.Affinity ~= nil) then
                foundryTable = foundryTable..' '..Icon._Affinity("Clan").." "..Shared.formatnum(weapRes.Affinity)
            end
 
            foundryTable = foundryTable..'\n|-'..rowStart
            --Adding Credit costs
            if(weapRes.Credits ~= nil) then
                foundryTable = foundryTable..Icon._Item("Crédits").."<br/>"..Shared.formatnum(weapRes.Credits)
            else
                foundryTable = foundryTable..'N/A'
            end
 
            --Adding part costs
            for i=1, 4 do
                foundryTable = foundryTable..rowStart..buildItemText(weapRes.Resources[i])
            end
 
            --Adding the time, market, and rush cost
            foundryTable = foundryTable..smallPart
            if(weapRes.Time ~= nil) then
                foundryTable = foundryTable.."Temps: "..Shared.formatnum(weapRes.Time).." hrs"
            else
                foundryTable = foundryTable..'N/A'
            end
            foundryTable = foundryTable..'\n|-'..smallPart
            if(weapRes.Prereq ~= nil) then
                foundryTable = foundryTable..'Prereq: [['..weapRes.Prereq..']]'
            else
                foundryTable = foundryTable..'Prereq: N/A'
            end
 
            --Adding notes about clan sizes
            foundryTable = foundryTable..'\n|-\n| colspan = 6 |<small>'
            foundryTable = foundryTable..'[[File:LeaderBadgeFantômeHolo.png|x26px|link=Clan#Niveaux de Clan|Clan Fantôme]] [[Clan#Multiplicateur de Niveau de Clan|<span title="Multiplicateur de Niveau de Clan">x1</span>]] &nbsp; '
            foundryTable = foundryTable..'[[File:LeaderBadgeOmbreHolo.png|x26px|link=Clan#Niveaux de Clan|Clan Ombre]] [[Clan#Multiplicateur de Niveau de Clan|<span title="Multiplicateur de Niveau de Clan">x3</span>]] &nbsp; '
            foundryTable = foundryTable..'[[File:LeaderBadgeTempêteHolo.png|x26px|link=Clan#Niveaux de Clan|Clan Tempête]] [[Clan#Multiplicateur de Niveau de Clan|<span title="Multiplicateur de Niveau de Clan">x10</span>]] &nbsp; '
            foundryTable = foundryTable..'[[File:LeaderBadgeMontagneHolo.png|x26px|link=Clan#Niveaux de Clan|Clan Montagne]] [[Clan#Multiplicateur de Niveau de Clan|<span title="Multiplicateur de Niveau de Clan">x30</span>]] &nbsp; '
            foundryTable = foundryTable..'[[File:LeaderBadgeLuneHolo.png|x26px|link=Clan#Niveaux de Clan|Clan Lune]] [[Clan#Multiplicateur de Niveau de Clan|<span title="Multiplicateur de Niveau de Clan">x100</span>]]'
            foundryTable = foundryTable..'</small>'
        end
 
        foundryTable = foundryTable..'\n|}<div style="clear:left; margin:0; padding:0;"></div>'--[[Category:Automatic Cost Table]]
        return foundryTable
    end
end
 
function p.getResourceCostRows(frame)
    local ResName = frame.args ~= nil and frame.args[1] or frame
    local Weapons = WeaponModule.getWeapons(function() return true end)
    local result = ""
 
    for key, weap in Shared.skpairs(Weapons) do
        --Adding Research costs if needed
        local resNum = 0
        local mainNum = 0
        if(weap.Cost ~= nil and weap.Cost.Parts ~= nil) then
            for i, val in pairs(weap.Cost.Parts) do
                if(val.Name == ResName) then
                    mainNum = val.Count
                end
            end
        end
        local isResearch, weapRes = p.isResearch(weap.Name)
        if(isResearch and weapRes.Resources ~= nil) then
            for i, val in pairs(weapRes.Resources) do
                if(val.Name == ResName) then
                    resNum = val.Count
                end
            end
        end
        if(resNum > 0 or mainNum > 0) then
            result = result..'\n|-\n| [['..weap.Name..']] || '..weap.Type..' || '
            if(mainNum > 0) then
                result = result..Shared.formatnum(mainNum)
            end
            if(resNum > 0) then
                result = result..' ('..Shared.formatnum(resNum)..')'
            end
        end
    end
 
    return result
end
 
return p