Changes

fix (not) remodel items
Line 271: Line 271:  
     end
 
     end
   −
    -- Remodel info
  −
    local remodelsteel = '[[File:IcoSteel.png|18px|Steel]]'
  −
    local remodelammo = '[[File:IcoAmmo.png|18px|Ammo]]'
  −
    local remodelblueprint = shipmodule.data[shipNum]["remodelreq"][3]
   
     local remodelinfo = ''
 
     local remodelinfo = ''
 
     if shipmodule.data[shipNum]["remodelreq"] ~= "" then
 
     if shipmodule.data[shipNum]["remodelreq"] ~= "" then
         remodelsteel = remodelsteel .. ' ' .. shipmodule.data[shipNum]["remodelreq"][1]
+
         local steel = '[[File:IcoSteel.png|18px|Steel]] ' .. shipmodule.data[shipNum]["remodelreq"][1]
         remodelammo = remodelammo .. ' ' .. shipmodule.data[shipNum]["remodelreq"][2]
+
         local ammo = '[[File:IcoAmmo.png|18px|Ammo]] ' .. shipmodule.data[shipNum]["remodelreq"][2]
         remodelinfo = remodelsteel .. ' ' .. remodelammo
+
         remodelinfo = steel .. ' ' .. ammo
         if shipmodule.data[shipNum]["remodelreq"][3] ~= nil then
+
         local items = shipmodule.RemodelBlueprintChk(shipmodule.data[shipNum]["remodelreq"][3], shipNum)
             remodelinfo = remodelinfo .. ' ' .. shipmodule.RemodelBlueprintChk(remodelblueprint)
+
        if items then
 +
             remodelinfo = remodelinfo .. ' ' .. items
 
         end
 
         end
 
     end
 
     end
Line 370: Line 367:  
end
 
end
   −
function shipmodule.RemodelBlueprintChk(blueprint) -- Remodel value check
+
local remodelItems = {
    --Hardcoded Musashi K2 requirements for sake of time.
+
  [1] = '[[File:IcoBlueprint.png|25px|Blueprint|link=Blueprints]]',
    local blueprinttext = ''
+
  [2] = '[[File:IcoBlueprint.png|25px|Blueprint|link=Blueprints]] [[File:IcoCatapult.png|25px|Prototype Flight Deck Catapult]]',
    if blueprint == 1 then
+
  [3] = '[[File:IcoActionReport.png|25px|Action Report]]',
        blueprinttext = '[[File:IcoBlueprint.png|25px|Blueprint|link=Blueprints]]'
+
  [4] = '[[File:IcoBlueprint.png|25px|Blueprint|link=Blueprints]] [[File:IcoActionReport.png|25px|Action Report]]',
    elseif blueprint == 2 then
+
  -- Musashi Kai Ni
        blueprinttext = '[[File:IcoBlueprint.png|25px|Blueprint|link=Blueprints]] [[File:IcoCatapult.png|25px|Prototype Flight Deck Catapult]]'
+
  [346] = '[[File:IcoBlueprint.png|25px|Blueprint|link=Blueprints]]x3 [[File:New Type Artillery Armament Materials.png|25px|New Type Artillery Armament Materials]]x3 [[File:IcoActionReport.png|25px|Action Report]]',
    elseif blueprint == 3 then
+
  -- Ise Kai Ni
        blueprinttext = '[[File:IcoActionReport.png|25px|Action Report]]'
+
  [353] = '[[File:IcoBlueprint.png|25px|Blueprint|link=Blueprints]]x2 [[File:IcoCatapult.png|25px|Prototype Flight Deck Catapult]] [[File:IcoActionReport.png|25px|Action Report]]',
    elseif blueprint == 4 then
+
  -- Hyuuga Kai Ni
        blueprinttext = '[[File:IcoBlueprint.png|25px|Blueprint|link=Blueprints]] [[File:IcoActionReport.png|25px|Action Report]]'
+
  [354] = '[[File:IcoBlueprint.png|25px|Blueprint|link=Blueprints]]x2 [[File:IcoCatapult.png|25px|Prototype Flight Deck Catapult]] [[File:IcoActionReport.png|25px|Action Report]]',
    elseif blueprint == 11 then
+
}
        --Musashi K2
+
 
        blueprinttext = '[[File:IcoBlueprint.png|25px|Blueprint|link=Blueprints]]x3 [[File:New Type Artillery Armament Materials.png|25px|New Type Artillery Armament Materials]]x3 [[File:IcoActionReport.png|25px|Action Report]]'
+
function shipmodule.RemodelBlueprintChk(blueprint, shipNum)
    elseif blueprint == 12 then
+
  return remodelItems[tonumber(shipNum)] or remodelItems[tonumber(blueprint)]
        --Ise K2
  −
        blueprinttext = '[[File:IcoBlueprint.png|25px|Blueprint|link=Blueprints]]x2 [[File:IcoCatapult.png|25px|Prototype Flight Deck Catapult]] [[File:IcoActionReport.png|25px|Action Report]]'
  −
    end
  −
    return blueprinttext
   
end
 
end
  
cssedit, gkautomate
7,064

edits