[Add] Added a small enter delay to ships when entering a system with no

planets.
This commit is contained in:
Allanis 2014-03-13 19:30:54 +00:00
parent e3e635c7f8
commit 213bb08385
2 changed files with 18 additions and 2 deletions

View File

@ -91,7 +91,8 @@ function idle()
planet = ai.landplanet() planet = ai.landplanet()
-- Planet must exist. -- Planet must exist.
if planet == nil or land_planet == false then if planet == nil or land_planet == false then
ai.pushtask(0, "hyperspace") ai.settimer(0, rnd.int(1000, 3000))
ai.pushtask(0, "enterdelay")
else else
mem.land = planet mem.land = planet
ai.pushtask(0, "hyperspace") ai.pushtask(0, "hyperspace")
@ -99,6 +100,13 @@ function idle()
end end
end end
-- Delays the ship when entering systems so that it doesn't leave right away.
function enterdelay()
if ai.timeup(0) then
ai.pushtask(0, "hyperspace")
end
end
function create() function create()
attack_choose() attack_choose()
end end

View File

@ -30,7 +30,8 @@ function control()
planet = ai.landplanet() planet = ai.landplanet()
-- Planet must exist. -- Planet must exist.
if planet == nil then if planet == nil then
ai.pushtask(0, "hyperspace") ai.settimer(0, rnd.int(1000, 3000))
ai.pushtask(0, "enterdelay")
else else
mem.land = planet mem.land = planet
ai.pushtask(0, "hyperspace") ai.pushtask(0, "hyperspace")
@ -39,6 +40,13 @@ function control()
end end
end end
-- Delay the ship when entering systems so that it doesn't leave right away.
function entedelay()
if ai.timeup(0) then
ai.pushtask(0, "hyperspace")
end
end
function sos() function sos()
end end