UserFunction; Player_NumberOfShips - HWRM/KarosGraveyard GitHub Wiki

-------------------------------------------------------------------------------
-- counts the total number of ships in a player's fleet
--
function Player_NumberOfShips(iPlayer)
    local iRace = Player_GetRace(iPlayer) + 1
    local ShipCount = 0
    dofilepath([data:scripts/race.lua](/HWRM/KarosGraveyard/wiki/data:scripts/race.lua))
    dofilepath([data:scripts/building and research/](/HWRM/KarosGraveyard/wiki/data:scripts/building-and-research/) .. races[iRace][1] .. [/build.lua](/HWRM/KarosGraveyard/wiki//build.lua))
    for i, iCount in build do
        if (iCount.Type ~= 1) then
            ShipCount = ShipCount + Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping(iPlayer, iCount.ThingToBuild)
        end
    end
    return ShipCount
end

Comments

Page Status

Updated Formatting? Initial
Updated for HWRM? Initial