[Add] Transport mission type, also increased missions displayed at computer.
This commit is contained in:
parent
41e2174c64
commit
3a8a9028d3
@ -11,7 +11,7 @@
|
|||||||
<mission name="Cargo">
|
<mission name="Cargo">
|
||||||
<lua>cargo</lua>
|
<lua>cargo</lua>
|
||||||
<avail>
|
<avail>
|
||||||
<chance>750</chance>
|
<chance>960</chance>
|
||||||
<location>Computer</location>
|
<location>Computer</location>
|
||||||
<alliance>Neutral</alliance>
|
<alliance>Neutral</alliance>
|
||||||
<alliance>Empire United</alliance>
|
<alliance>Empire United</alliance>
|
||||||
|
@ -1,17 +1,20 @@
|
|||||||
lang = lephisto.lang()
|
lang = lephisto.lang()
|
||||||
if lang == "es" then
|
if lang == "es" then
|
||||||
-- Not translated atm
|
-- Not translated atm.
|
||||||
else -- Default english
|
else -- Default english.
|
||||||
misn_desc = {}
|
misn_desc = {}
|
||||||
misn_desc[1] = "%s in the %s system needs a delivery of %d tons of %s."
|
misn_desc[1] = "%s in the %s system needs a delivery of %d tons of %s."
|
||||||
misn_desc[2] = "%s in the %s system needs a rush delivery of %d tons of %s before %s (%s left)."
|
misn_desc[11] = "%s in the %s system needs a rush delivery of %d tons of %s before %s (%s left)."
|
||||||
|
misn_desc[21] = "A group of %s needs to travel to %s in the %s system."
|
||||||
misn_reward = "%d credits"
|
misn_reward = "%d credits"
|
||||||
title = {}
|
title = {}
|
||||||
title[1] = "Cargo delivery to %s"
|
title[1] = "Cargo delivery to %s"
|
||||||
title[2] = "Freight delivery to %s"
|
title[2] = "Freight delivery to %s"
|
||||||
title[3] = "Transport to %s"
|
title[3] = "Transport to %s"
|
||||||
title[4] = "Delivery to %s"
|
title[4] = "Delivery to %s"
|
||||||
title[5] = "Rush Delivery to %s"
|
title[11] = "Rush Delivery to %s"
|
||||||
|
title[21] = "Transport %s to %s"
|
||||||
|
title[22] = "Ferry %s to %s"
|
||||||
full_title = "Ship is full"
|
full_title = "Ship is full"
|
||||||
full_msg = "Your ship is too full. You need to make room for %d more tons if you want to be able to accept the mission."
|
full_msg = "Your ship is too full. You need to make room for %d more tons if you want to be able to accept the mission."
|
||||||
accept_title = "Mission Accepted"
|
accept_title = "Mission Accepted"
|
||||||
@ -25,45 +28,59 @@ else -- Default english
|
|||||||
misn_time_msg = "MISSION FAILED: You have failed to delivery the goods on time!"
|
misn_time_msg = "MISSION FAILED: You have failed to delivery the goods on time!"
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Create the mission
|
-- Create the mission.
|
||||||
function create()
|
function create()
|
||||||
-- Target destination
|
-- Target destination.
|
||||||
local i = 0
|
local i = 0
|
||||||
repeat
|
repeat
|
||||||
planet = space.getPlanet( misn.factions() )
|
planet = space.getPlanet( misn.factions() )
|
||||||
i = i + 1
|
i = i + 1
|
||||||
until planet ~= space.landName() or i > 10
|
until planet ~= space.landName() or i > 10
|
||||||
-- Infinite loop protection
|
-- Infinite loop protection.
|
||||||
if i > 10 then
|
if i > 10 then
|
||||||
misn.finish(false)
|
misn.finish(false)
|
||||||
end
|
end
|
||||||
system = space.getSystem( planet )
|
system = space.getSystem( planet )
|
||||||
misn_dist = space.jumpDist( system )
|
misn_dist = space.jumpDist( system )
|
||||||
|
|
||||||
-- Mission generics
|
-- Mission generics.
|
||||||
i = rnd.int(4)
|
i = rnd.int(6)
|
||||||
if i < 3 then -- Cargo delivery
|
if i < 4 then -- Cargo delivery.
|
||||||
misn_type = "Cargo"
|
misn_type = "Cargo"
|
||||||
i = rnd.int(3)
|
i = rnd.int(3)
|
||||||
misn.setTitle( string.format(title[i+1], planet) )
|
misn.setTitle(string.format(title[i+1], planet))
|
||||||
else -- Rush delivery
|
elseif i < 6 then-- Rush delivery.
|
||||||
misn_type = "Rush"
|
misn_type = "Rush"
|
||||||
misn.setTitle( string.format(title[5], planet) )
|
misn.setTitle(string.format(title[11], planet))
|
||||||
|
else -- People delivery :P
|
||||||
|
misn_type = "People"
|
||||||
|
i = rnd.int(5)
|
||||||
|
if i < 2 then
|
||||||
|
carg_type = "Colonists"
|
||||||
|
elseif i < 4 then
|
||||||
|
carg_type = "Tourists"
|
||||||
|
else
|
||||||
|
carg_type = "Pilgrims"
|
||||||
|
end
|
||||||
|
i = rnd.int(1)
|
||||||
|
misn_setTitle(string.format(title[i+21], carg_type, planet))
|
||||||
end
|
end
|
||||||
|
|
||||||
-- More mission specifics
|
-- More mission specifics
|
||||||
carg_mass = rnd.int( 10, 30 )
|
if misn_type == "Cargo" or misn_type == "Rush" then
|
||||||
i = rnd.int(12) -- Set the goods
|
carg_mass = rnd.int(10, 30)
|
||||||
if i < 5 then
|
i = rnd.int(12) -- Set the goods.
|
||||||
carg_type = "Food"
|
if i < 5 then
|
||||||
elseif i < 8 then
|
carg_type = "Food"
|
||||||
carg_type = "Ore"
|
elseif i < 8 then
|
||||||
elseif i < 10 then
|
carg_type = "Ore"
|
||||||
carg_type = "Industrial Goods"
|
elseif i < 10 then
|
||||||
elseif i < 12 then
|
carg_type = "Industrial Goods"
|
||||||
carg_type = "Luxury Goods"
|
elseif i < 12 then
|
||||||
else
|
carg_type = "Luxury Goods"
|
||||||
carg_type = "Medicine"
|
else
|
||||||
|
carg_type = "Medicine"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if misn_type == "Cargo" then
|
if misn_type == "Cargo" then
|
||||||
@ -74,12 +91,15 @@ function create()
|
|||||||
elseif misn_type == "Rush" then
|
elseif misn_type == "Rush" then
|
||||||
misn_time = time.get() + time.units(2) +
|
misn_time = time.get() + time.units(2) +
|
||||||
rnd.int(time.units(2), time.units(4)) * misn_dist
|
rnd.int(time.units(2), time.units(4)) * misn_dist
|
||||||
misn.setDesc( string.format( misn_desc[2], planet, system,
|
misn.setDesc( string.format( misn_desc[11], planet, system,
|
||||||
carg_mass, carg_type,
|
carg_mass, carg_type,
|
||||||
time.str(misn_time), time.str(misn_time-time.get()) ) )
|
time.str(misn_time), time.str(misn_time-time.get()) ) )
|
||||||
reward = misn_dist * carg_mass * (450+rnd.int(250)) +
|
reward = misn_dist * carg_mass * (450+rnd.int(250)) +
|
||||||
carg_mass * (250+rnd.int(125)) +
|
carg_mass * (250+rnd.int(125)) +
|
||||||
rnd.int(2500)
|
rnd.int(2500)
|
||||||
|
else -- People.
|
||||||
|
misn.setDesc(string.format(misn_desc[21], carg_type, planet, system))
|
||||||
|
reward = misn_dist * (1000 + rnd.int(500)) + rnd.int(2000)
|
||||||
end
|
end
|
||||||
misn.setReward( string.format( misn_reward, reward ) )
|
misn.setReward( string.format( misn_reward, reward ) )
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user