Skip to content

Commit

Permalink
Select all ships with default hyperdrive
Browse files Browse the repository at this point in the history
Remove equipment to increase hyperspace range
  • Loading branch information
robothauler authored and Web-eWorks committed Nov 10, 2020
1 parent eeada66 commit b1c284b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions data/modules/Combat/Combat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -427,17 +427,14 @@ local onEnterSystem = function (player)
if mission.complete or Game.time > mission.due then
local shipdefs = utils.build_array(utils.filter(
function (k,def)
return def.tag == "SHIP" and def.hyperdriveClass > 1 and (def.shipClass == "medium_fighter" or def.shipClass == "medium_courier" or def.shipClass == "light_freighter")
return def.tag == "SHIP" and def.hyperdriveClass > 0
end,
pairs(ShipDef)))
local shipdef = shipdefs[Engine.rand:Integer(1, #shipdefs)]

local ship = Space.SpawnShipNear(shipdef.id, Game.player, 50, 100)
ship:SetLabel(Ship.MakeRandomLabel())
ship:AddEquip(Equipment.hyperspace["hyperdrive_" .. tostring(shipdef.hyperdriveClass)])
ship:AddEquip(Equipment.cargo.hydrogen, 5)
ship:AddEquip(Equipment.laser.pulsecannon_2mw)
ship:AddEquip(Equipment.misc.shield_generator)

local path = mission.location:GetStarSystem().path
finishMission(ref, mission)
Expand Down

0 comments on commit b1c284b

Please sign in to comment.