Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: Deiz/naev
...
head fork: Deiz/naev
  • 2 commits
  • 13 files changed
  • 0 commit comments
  • 1 contributor
View
6 dat/events/neutral/shipwreck.lua
@@ -40,9 +40,9 @@ function create ()
v:setFaction("Derelict")
v:disable()
v:rename("Shipwrecked " .. shipname)
- -- Added extra visibility for big systems (A.)
- v:setVisplayer( true )
- v:setHilight( true )
+ -- Added extra visibility for big systems (A.)
+ v:setVisplayer( true )
+ v:setHilight( true )
end
hook.timer(3000, "broadcast")
View
486 dat/events/sirius/preach.lua
@@ -99,312 +99,312 @@ dead={
--initialize the event
function create()
- curr=system.cur() --save the current system
-
- v = var.peek( "si_convert" ) -- Get the value
- if v == nil then -- Doesn't exist, so create
- var.push( "si_convert", 1 )
- else
- var.push( "si_convert", v+1 )
- end
-
- --start the fun when the player jumps
- hook.jumpin("funStartsSoon")
- hook.land("cleanup") --oops he landed
+ curr=system.cur() --save the current system
+
+ v = var.peek( "si_convert" ) -- Get the value
+ if v == nil then -- Doesn't exist, so create
+ var.push( "si_convert", 1 )
+ else
+ var.push( "si_convert", v+1 )
+ end
+
+ --start the fun when the player jumps
+ hook.jumpin("funStartsSoon")
+ hook.land("cleanup") --oops he landed
end
--Start the real mission after a short delay
function funStartsSoon()
- playerP=player.pilot() --save player's pilot
- rep=faction.playerStanding(faction.get("Sirius"))
- hook.timer(5000, "theFunBegins") --for effect, so that we can see them jumping in!
+ playerP=player.pilot() --save player's pilot
+ rep=faction.playerStanding(faction.get("Sirius"))
+ hook.timer(5000, "theFunBegins") --for effect, so that we can see them jumping in!
end
--the preaching's about to begin!
function theFunBegins()
- if rep < 0 then
- local dist = vec2.dist(jump.get(system.cur(),curr):pos(),player.pos()) --please note the order of system.cur() and curr matters!
- if dist < 6000 then
- hook.timer(5000,"theFunBegins") --wait some more time
- return
- end
- end
- --summon a preacher from the jump point and highlight him and take control and focus on him
- preacher=pilot.addRaw("Sirius Reverence", "sirius_norun", curr, "Sirius")[1]
- preacher:setHilight()
- preacher:setVisplayer()
- preacher:control()
- preacher:broadcast(followSirichana[rnd.rnd(1,#followSirichana)],true)
- preacher:hailPlayer()
- playerP:setInvincible()
-
- --set needed hooks
- hook.pilot(preacher,"attacked","violence")
- hook.pilot(preacher,"death","badCleanup")
- hook.pilot(preacher,"land","landCleanup")
- hook.pilot(preacher,"jump","jumpCleanup")
- hook.jumpout("cleanup")
-
- camera.set(preacher, true)
- player.cinematics(true,{gui=true, abort=presence[rnd.rnd(1,#presence)]})
-
- --you're hooked till you hear him out!
- playerP:control()
- player.msg(urge[rnd.rnd(1,#urge)])
-
- --create a random band of converted pirate followers
- local followerShips = {"Pirate Kestrel", "Pirate Admonisher", "Pirate Shark", "Pirate Vendetta", "Pirate Rhino"} --the types of followers allowed
- followers = {}
- local numships = rnd.rnd(2, 6) -- This is the total number of converted follower ships.
-
- for num=1, numships, 1 do
- followers[num] = followerShips[rnd.rnd(1, #followerShips)] -- Pick a follower ship at random.
- end
-
- followers = addRawShips(followers, "sirius_norun", curr, "Sirius") -- The table now contains pilots, not ship names.
- for _,j in ipairs(followers) do
- j:rename("Converted "..j:name())
- end
-
- --pick a random converted pirate and have him praise the Sirichana
- praiser=followers[rnd.rnd(1,#followers)]
-
- --add some sirian escorts too
- local sirianFollowers = {"Sirius Fidelity","Sirius Shaman"} --the types of followers allowed
- local sirianFollowerList = {}
-
- numships = rnd.rnd(2, 6) -- This is the total number of sirian escort ships.
- for num=1, numships, 1 do
- sirianFollowerList[num] = sirianFollowers[rnd.rnd(1, #sirianFollowers)] -- Pick a follower ship at random.
- end
-
- sirianFollowers = addRawShips(sirianFollowerList, "sirius_norun", curr, "Sirius") -- The table now contains pilots, not ship names.
-
- for _, j in ipairs(sirianFollowers) do
- followers[#followers + 1] = j
- end
-
- --set up a table to store attackers
- attackers={}
-
- --make these followers follow the Touched one
- --if Sirius is an enemy still keep these guys neutral... at first
- for _, j in ipairs(followers) do
- j:setFriendly()
- j:control()
- j:follow(preacher)
- hook.pilot(j,"attacked","violence")
- end
- preacher:setFriendly()
-
- --pick a random follower and have him praise Sirichana, after a delay
- hook.timer(4000,"praise")
-
- --have the preacher say something cool
- hook.timer(8000,"preacherSpeak")
-
- --add some normal pirates for fun :)
- hook.timer(12500,"pirateSpawn")
-
- --hook up timers for releasing cinematics (and you of course :P)
- hook.timer(17500,"release")
-
- --hook up timer for re-hailing player
- hailHook=hook.date(time.create(0, 0, 1000), "reHail") --hail every 1000 STU till player answers
-
- --when hailed, the preacher preaches to you
- hook.pilot(preacher, "hail", "hail")
+ if rep < 0 then
+ local dist = vec2.dist(jump.get(system.cur(),curr):pos(),player.pos()) --please note the order of system.cur() and curr matters!
+ if dist < 6000 then
+ hook.timer(5000,"theFunBegins") --wait some more time
+ return
+ end
+ end
+ --summon a preacher from the jump point and highlight him and take control and focus on him
+ preacher=pilot.addRaw("Sirius Reverence", "sirius_norun", curr, "Sirius")[1]
+ preacher:setHilight()
+ preacher:setVisplayer()
+ preacher:control()
+ preacher:broadcast(followSirichana[rnd.rnd(1,#followSirichana)],true)
+ preacher:hailPlayer()
+ playerP:setInvincible()
+
+ --set needed hooks
+ hook.pilot(preacher,"attacked","violence")
+ hook.pilot(preacher,"death","badCleanup")
+ hook.pilot(preacher,"land","landCleanup")
+ hook.pilot(preacher,"jump","jumpCleanup")
+ hook.jumpout("cleanup")
+
+ camera.set(preacher, true)
+ player.cinematics(true,{gui=true, abort=presence[rnd.rnd(1,#presence)]})
+
+ --you're hooked till you hear him out!
+ playerP:control()
+ player.msg(urge[rnd.rnd(1,#urge)])
+
+ --create a random band of converted pirate followers
+ local followerShips = {"Pirate Kestrel", "Pirate Admonisher", "Pirate Shark", "Pirate Vendetta", "Pirate Rhino"} --the types of followers allowed
+ followers = {}
+ local numships = rnd.rnd(2, 6) -- This is the total number of converted follower ships.
+
+ for num=1, numships, 1 do
+ followers[num] = followerShips[rnd.rnd(1, #followerShips)] -- Pick a follower ship at random.
+ end
+
+ followers = addRawShips(followers, "sirius_norun", curr, "Sirius") -- The table now contains pilots, not ship names.
+ for _,j in ipairs(followers) do
+ j:rename("Converted "..j:name())
+ end
+
+ --pick a random converted pirate and have him praise the Sirichana
+ praiser=followers[rnd.rnd(1,#followers)]
+
+ --add some sirian escorts too
+ local sirianFollowers = {"Sirius Fidelity","Sirius Shaman"} --the types of followers allowed
+ local sirianFollowerList = {}
+
+ numships = rnd.rnd(2, 6) -- This is the total number of sirian escort ships.
+ for num=1, numships, 1 do
+ sirianFollowerList[num] = sirianFollowers[rnd.rnd(1, #sirianFollowers)] -- Pick a follower ship at random.
+ end
+
+ sirianFollowers = addRawShips(sirianFollowerList, "sirius_norun", curr, "Sirius") -- The table now contains pilots, not ship names.
+
+ for _, j in ipairs(sirianFollowers) do
+ followers[#followers + 1] = j
+ end
+
+ --set up a table to store attackers
+ attackers={}
+
+ --make these followers follow the Touched one
+ --if Sirius is an enemy still keep these guys neutral... at first
+ for _, j in ipairs(followers) do
+ j:setFriendly()
+ j:control()
+ j:follow(preacher)
+ hook.pilot(j,"attacked","violence")
+ end
+ preacher:setFriendly()
+
+ --pick a random follower and have him praise Sirichana, after a delay
+ hook.timer(4000,"praise")
+
+ --have the preacher say something cool
+ hook.timer(8000,"preacherSpeak")
+
+ --add some normal pirates for fun :)
+ hook.timer(12500,"pirateSpawn")
+
+ --hook up timers for releasing cinematics (and you of course :P)
+ hook.timer(17500,"release")
+
+ --hook up timer for re-hailing player
+ hailHook=hook.date(time.create(0, 0, 1000), "reHail") --hail every 1000 STU till player answers
+
+ --when hailed, the preacher preaches to you
+ hook.pilot(preacher, "hail", "hail")
end
function preacherSpeak()
- camera.set(preacher,true)
- if rep < 0 then
- preacher:comm(string.format(althoughEnemy[rnd.rnd(1,#althoughEnemy)],player.name()), true)
- else
- preacher:comm(string.format(friend[rnd.rnd(1,#friend)],player.name()), true)
- end
+ camera.set(preacher,true)
+ if rep < 0 then
+ preacher:comm(string.format(althoughEnemy[rnd.rnd(1,#althoughEnemy)],player.name()), true)
+ else
+ preacher:comm(string.format(friend[rnd.rnd(1,#friend)],player.name()), true)
+ end
end
--re-hail the player
function reHail()
- if preacher:exists() then
- preacher:hailPlayer()
- end
+ if preacher:exists() then
+ preacher:hailPlayer()
+ end
end
--random praise for the Sirichana
function praise()
- camera.set(praiser,true)
- praiser:broadcast(praiseSirichana[rnd.rnd(1,#praiseSirichana)],true)
+ camera.set(praiser,true)
+ praiser:broadcast(praiseSirichana[rnd.rnd(1,#praiseSirichana)],true)
end
--spawn some enemy pirates for fun :P
--to add even more fun have them say something cool
function pirateSpawn()
- local numships=rnd.rnd(2,5)
- local curiousNumber=rnd.rnd(1,numships)
- local shiptype={"Pirate Shark","Pirate Vendetta"}
- local thepilot
- for num=1,numships,1 do
- thepilot = pilot.add(shiptype[rnd.rnd(1,#shiptype)], nil, curr)[1]
- if num==curiousNumber then
- thepilot:broadcast(whatHappened[rnd.rnd(1,#whatHappened)],true)
- camera.set(thepilot,true)
- end
- thepilot:control()
- thepilot:attack(followers[rnd.rnd(1,#followers)])
- end
+ local numships=rnd.rnd(2,5)
+ local curiousNumber=rnd.rnd(1,numships)
+ local shiptype={"Pirate Shark","Pirate Vendetta"}
+ local thepilot
+ for num=1,numships,1 do
+ thepilot = pilot.add(shiptype[rnd.rnd(1,#shiptype)], nil, curr)[1]
+ if num==curiousNumber then
+ thepilot:broadcast(whatHappened[rnd.rnd(1,#whatHappened)],true)
+ camera.set(thepilot,true)
+ end
+ thepilot:control()
+ thepilot:attack(followers[rnd.rnd(1,#followers)])
+ end
end
--called when a new attack happens
function violence(attacked,attacker)
- if #attackers == 0 then --we have to change the group to battle mode
- attacked:broadcast(startCombat[rnd.rnd(1,#startCombat)],true)
- preacher:control(false)
- for _, j in ipairs(followers) do
- if j:exists() then
- j:control(false)
- end
- end
- end
- local found=false
- for _,j in ipairs(attackers) do
- if j==attacker then
- found=true
- break
- end
- end
- if not found then --new attacker
- attackers[#attackers+1]=attacker
- hook.pilot(attacker,"exploded","anotherdead")
- hook.pilot(attacker,"land","anotherdead")
- hook.pilot(attacker,"jump","anotherdead")
- end
+ if #attackers == 0 then --we have to change the group to battle mode
+ attacked:broadcast(startCombat[rnd.rnd(1,#startCombat)],true)
+ preacher:control(false)
+ for _, j in ipairs(followers) do
+ if j:exists() then
+ j:control(false)
+ end
+ end
+ end
+ local found=false
+ for _,j in ipairs(attackers) do
+ if j==attacker then
+ found=true
+ break
+ end
+ end
+ if not found then --new attacker
+ attackers[#attackers+1]=attacker
+ hook.pilot(attacker,"exploded","anotherdead")
+ hook.pilot(attacker,"land","anotherdead")
+ hook.pilot(attacker,"jump","anotherdead")
+ end
end
--another enemy is dead
function anotherdead(enemy, attacker)
- if attacker==nil then --in case the pilot was blown up by an explosion
- attacker=preacher
- end
-
- if attacker:exists() then --in case the attacker was parallely killed
- attacker:broadcast(attackerPunished[rnd.rnd(1,#attackerPunished)],true)
- end
-
- --find and remove the enemy
- for i,j in ipairs(attackers) do
- if j==enemy then
- table.remove(attackers,i)
- break
- end
- end
-
- if #attackers == 0 then --last one was killed, restore idle mode
- attacker:broadcast(attackersDead[rnd.rnd(1,#attackersDead)],true)
- restoreControl()
- end
+ if attacker==nil then --in case the pilot was blown up by an explosion
+ attacker=preacher
+ end
+
+ if attacker:exists() then --in case the attacker was parallely killed
+ attacker:broadcast(attackerPunished[rnd.rnd(1,#attackerPunished)],true)
+ end
+
+ --find and remove the enemy
+ for i,j in ipairs(attackers) do
+ if j==enemy then
+ table.remove(attackers,i)
+ break
+ end
+ end
+
+ if #attackers == 0 then --last one was killed, restore idle mode
+ attacker:broadcast(attackersDead[rnd.rnd(1,#attackersDead)],true)
+ restoreControl()
+ end
end
--finds and set a new target for the preacher, when he is outta battle mode
function getPreacherTarget()
- local sirius=faction.get( "Sirius" )
-
- --look for nearby landable sirian planet to land
- for key, planet in ipairs( system.cur():planets() ) do
- if planet:faction()==sirius and planet:services()["land"] then
- target = planet
- break
- end
- end
-
- --if no landable sirian planets found, jump to random system
- --TODO: prevent jump back through the entry point
- if target then
- preacher:land(target)
- else
- preacher:hyperspace()
- end
+ local sirius=faction.get( "Sirius" )
+
+ --look for nearby landable sirian planet to land
+ for key, planet in ipairs( system.cur():planets() ) do
+ if planet:faction()==sirius and planet:services()["land"] then
+ target = planet
+ break
+ end
+ end
+
+ --if no landable sirian planets found, jump to random system
+ --TODO: prevent jump back through the entry point
+ if target then
+ preacher:land(target)
+ else
+ preacher:hyperspace()
+ end
end
--restores control to the idle mode
function restoreControl()
- preacher:control()
- for _, j in ipairs(followers) do
- if j:exists() then
- j:control()
- j:follow(preacher)
- end
- end
- getPreacherTarget()
+ preacher:control()
+ for _, j in ipairs(followers) do
+ if j:exists() then
+ j:control()
+ j:follow(preacher)
+ end
+ end
+ getPreacherTarget()
end
--releases the player after the cutscene
function release()
- camera.set(nil, true)
- player.cinematics(false)
- playerP:setInvincible(false)
- playerP:control(false)
- --if the attacks have already started, we shouldn't set a target yet
- if #attackers==0 then
- getPreacherTarget()
- end
+ camera.set(nil, true)
+ player.cinematics(false)
+ playerP:setInvincible(false)
+ playerP:control(false)
+ --if the attacks have already started, we shouldn't set a target yet
+ if #attackers==0 then
+ getPreacherTarget()
+ end
end
--when hailed back, show the message
function hail()
- tk.msg(commtitle,commtext)
- player.commClose()
- hook.rm(hailHook) --no more hailing
+ tk.msg(commtitle,commtext)
+ player.commClose()
+ hook.rm(hailHook) --no more hailing
end
--everything is done
function cleanup()
- player.pilot():setInvincible(false)
- evt.finish()
+ player.pilot():setInvincible(false)
+ evt.finish()
end
--oops, it seems the preacher died. End gracefully
function badCleanup()
- playerP:setInvincible(false)
- player.msg(dead[rnd.rnd(1,#dead)])
- preacher:broadcast(dyingMessage[rnd.rnd(1,#dyingMessage)])
- local survivors={}
- for _,j in ipairs(followers) do
- if j:exists() then
- j:control(false)
- survivors[#survivors+1]=j
- end
- end
- if #survivors > 0 then
- follower=survivors[rnd.rnd(1,#survivors)]
- follower:broadcast(preacherDead[rnd.rnd(1,#preacherDead)],true)
- end
- evt.finish()
+ playerP:setInvincible(false)
+ player.msg(dead[rnd.rnd(1,#dead)])
+ preacher:broadcast(dyingMessage[rnd.rnd(1,#dyingMessage)])
+ local survivors={}
+ for _,j in ipairs(followers) do
+ if j:exists() then
+ j:control(false)
+ survivors[#survivors+1]=j
+ end
+ end
+ if #survivors > 0 then
+ follower=survivors[rnd.rnd(1,#survivors)]
+ follower:broadcast(preacherDead[rnd.rnd(1,#preacherDead)],true)
+ end
+ evt.finish()
end
--the preacher has landed. Land all his followers too
function landCleanup()
- playerP:setInvincible(false)
- for _,j in ipairs(followers) do
- if j:exists() then
- j:taskClear()
- j:land(target)
- end
- end
- evt.finish()
+ playerP:setInvincible(false)
+ for _,j in ipairs(followers) do
+ if j:exists() then
+ j:taskClear()
+ j:land(target)
+ end
+ end
+ evt.finish()
end
--the preacher has jumped. Jump all his followers too
function jumpCleanup()
- playerP:setInvincible(false)
- for _,j in ipairs(followers) do
- if j:exists() then
- j:taskClear()
- j:control()
- j:hyperspace(target,true) --attack back as they move away?
- end
- end
- evt.finish()
+ playerP:setInvincible(false)
+ for _,j in ipairs(followers) do
+ if j:exists() then
+ j:taskClear()
+ j:control()
+ j:hyperspace(target,true) --attack back as they move away?
+ end
+ end
+ evt.finish()
end
View
2  dat/events/tutorial/tutorial-combat1.lua
@@ -250,7 +250,7 @@ end
-- Taunt function.
function taunt()
- armour, shield = captainTP:health()
+ armour, shield = captainTP:health()
if shield >= 40 then
captainTP:comm(shield30[rnd.rnd(1, #shield30)])
elseif armour >= 31 then
View
2  dat/events/tutorial/tutorial-combat2.lua
@@ -198,7 +198,7 @@ end
-- Taunt function.
function taunt()
- armour, shield = captainTP:health()
+ armour, shield = captainTP:health()
if shield >= 40 then
captainTP:comm(shield30[rnd.rnd(1, #shield30)])
elseif armour >= 31 then
View
14 dat/missions/empire/shipping/es02.lua
@@ -4,7 +4,7 @@
Author: bobbens
minor edits by Infiltrator
- - Mission fixed to suit big systems (Anatolis, 11/02/2011)
+ - Mission fixed to suit big systems (Anatolis, 11/02/2011)
Rescue a VIP stranded on a disabled ship in a system while FLF and Dvaered
are fighting.
@@ -100,8 +100,8 @@ function accept ()
hook.enter("enter")
hook.jumpout("jumpout")
- -- Initiate mission variables (A.)
- prevsys = system.cur()
+ -- Initiate mission variables (A.)
+ prevsys = system.cur()
end
@@ -171,7 +171,7 @@ function enter ()
p:setHostile()
p:attack( player.pilot() )
- -- Now Dvaered
+ -- Now Dvaered
-- They will jump together with you in the system at the jumppoint. (A.)
p = pilot.add( "Dvaered Med Force", nil, prevsys )
for k,v in ipairs(p) do
@@ -195,8 +195,8 @@ function enter ()
end
function jumpout ()
- -- Storing the system the player jumped from.
- prevsys = system.cur()
+ -- Storing the system the player jumped from.
+ prevsys = system.cur()
end
@@ -242,7 +242,7 @@ function death ()
end
function abort ()
- -- If aborted you'll also leave the VIP to fate. (A.)
+ -- If aborted you'll also leave the VIP to fate. (A.)
player.msg( msg[2] )
misn.finish(false)
end
View
6 dat/missions/empire/waste_dump.lua
@@ -5,9 +5,9 @@ include "scripts/jumpdist.lua"
   MISSION: Waste Dump (dat/empire/waste_dump.lua)
   DESCRIPTION: Take toxic waste and dump it over an uninhabited planet.
- Mission conceived for the Shakar system.
- It would begin at the mission computer on Zembla Shakar
- To change the system, just change the mission.xml entry.
+ Mission conceived for the Shakar system.
+ It would begin at the mission computer on Zembla Shakar
+ To change the system, just change the mission.xml entry.
NOTES: This mission requires balancing to make sure it works with all ship types, possibly normalisation of the fraction of the top speed required for mission success according to the top speed, turn, and acceleration of the player's ship.
--]]
View
24 dat/missions/neutral/cargo.lua
@@ -36,20 +36,20 @@ Travel distance: %d]]
full[1] = "No room in ship"
full[2] = "You don't have enough cargo space to accept this mission. You need %d tons of free space (you need %d more)."
- --=Landing=--
-
- cargo_land_title = "Delivery success!"
+ --=Landing=--
- cargo_land_p1 = {}
- cargo_land_p1[1] = "The crates of "
- cargo_land_p1[2] = "The drums of "
- cargo_land_p1[3] = "The containers of "
+ cargo_land_title = "Delivery success!"
- cargo_land_p2 = {}
- cargo_land_p2[1] = " are carried out of your ship by a sullen group of workers. The job takes inordinately long to complete, and the leader pays you without speaking a word."
- cargo_land_p2[2] = " are rushed out of your vessel by a team shortly after you land. Before you can even collect your thoughts, one of them presses a credit chip in your hand and departs."
- cargo_land_p2[3] = " are unloaded by an exhausted-looking bunch of dockworkers. Still, they make fairly good time, delivering your pay upon completion of the job."
- cargo_land_p2[4] = " are unloaded by a team of robotic drones supervised by a human overseer, who hands you your pay when they finish."
+ cargo_land_p1 = {}
+ cargo_land_p1[1] = "The crates of "
+ cargo_land_p1[2] = "The drums of "
+ cargo_land_p1[3] = "The containers of "
+
+ cargo_land_p2 = {}
+ cargo_land_p2[1] = " are carried out of your ship by a sullen group of workers. The job takes inordinately long to complete, and the leader pays you without speaking a word."
+ cargo_land_p2[2] = " are rushed out of your vessel by a team shortly after you land. Before you can even collect your thoughts, one of them presses a credit chip in your hand and departs."
+ cargo_land_p2[3] = " are unloaded by an exhausted-looking bunch of dockworkers. Still, they make fairly good time, delivering your pay upon completion of the job."
+ cargo_land_p2[4] = " are unloaded by a team of robotic drones supervised by a human overseer, who hands you your pay when they finish."
accept_title = "Mission Accepted"
View
36 dat/missions/neutral/cargo_rush.lua
@@ -43,24 +43,24 @@ Time limit: %s]]
Accept the mission anyway?]]
- --=Landing=--
-
- cargo_land_title = "Delivery success!"
-
- cargo_land_p1 = {}
- cargo_land_p1[1] = "The crates of " --<<-- paired with cargo_accept_p2, don't mix this up!!
- cargo_land_p1[2] = "The drums of "
- cargo_land_p1[3] = "The containers of "
-
- cargo_land_p2 = {}
- cargo_land_p2[1] = " are carried out of your ship by a sullen group of workers. The job takes inordinately long to complete, and the leader pays you without speaking a word."
- cargo_land_p2[2] = " are rushed out of your vessel by a team shortly after you land. Before you can even collect your thoughts, one of them presses a credit chip in your hand and departs."
- cargo_land_p2[3] = " are unloaded by an exhausted-looking bunch of dockworkers. Still, they make fairly good time, delivering your pay upon completion of the job."
-
- cargo_land_p3 = {}
- cargo_land_p3[1] = " are carried out of your ship by a sullen group of workers. They are not happy that they have to work overtime because you were late. You are paid only %d of the %d you were promised."
- cargo_land_p3[2] = " are rushed out of your vessel by a team shortly after you land. Your late arrival is stretching quite a few schedules! Your pay is only %d instead of %d because of that."
- cargo_land_p3[3] = " are unloaded by an exhausted-looking bunch of dockworkers. You missed the deadline, so your reward is only %d instead of the %d you were hoping for."
+ --=Landing=--
+
+ cargo_land_title = "Delivery success!"
+
+ cargo_land_p1 = {}
+ cargo_land_p1[1] = "The crates of " --<<-- paired with cargo_accept_p2, don't mix this up!!
+ cargo_land_p1[2] = "The drums of "
+ cargo_land_p1[3] = "The containers of "
+
+ cargo_land_p2 = {}
+ cargo_land_p2[1] = " are carried out of your ship by a sullen group of workers. The job takes inordinately long to complete, and the leader pays you without speaking a word."
+ cargo_land_p2[2] = " are rushed out of your vessel by a team shortly after you land. Before you can even collect your thoughts, one of them presses a credit chip in your hand and departs."
+ cargo_land_p2[3] = " are unloaded by an exhausted-looking bunch of dockworkers. Still, they make fairly good time, delivering your pay upon completion of the job."
+
+ cargo_land_p3 = {}
+ cargo_land_p3[1] = " are carried out of your ship by a sullen group of workers. They are not happy that they have to work overtime because you were late. You are paid only %d of the %d you were promised."
+ cargo_land_p3[2] = " are rushed out of your vessel by a team shortly after you land. Your late arrival is stretching quite a few schedules! Your pay is only %d instead of %d because of that."
+ cargo_land_p3[3] = " are unloaded by an exhausted-looking bunch of dockworkers. You missed the deadline, so your reward is only %d instead of the %d you were hoping for."
accept_title = "Mission Accepted"
View
598 dat/missions/neutral/diy-nerds.lua
@@ -1,21 +1,21 @@
- --[[
-    MISSION: diy-nerds
-    DESCRIPTION: Cart some nerds and their hardware to some DIY
- contest on a neighbouring planet. Wait until the contest is
- over, then cart them back. Receive either your payment or
- their hardware. The player can fail in multiple ways.
- AUTHOR: thilo <thilo@thiloernst.de>
- --]]
+ --[[
+    MISSION: diy-nerds
+    DESCRIPTION: Cart some nerds and their hardware to some DIY
+ contest on a neighbouring planet. Wait until the contest is
+ over, then cart them back. Receive either your payment or
+ their hardware. The player can fail in multiple ways.
+ AUTHOR: thilo <thilo@thiloernst.de>
+ --]]
lang = naev.lang()
if lang == "es" then
else
- -- Bar information, describes how the NPC appears in the bar
+ -- Bar information, describes how the NPC appears in the bar
bar_desc = "You see a bunch of guys and gals, excitedly whispering over some papers, which seem to contain column over column of raw numbers. Two of them don't participate in the babbling, but look at you expectantly."
- -- Mission details.
+ -- Mission details.
misn_title = "DIY Nerds"
misn_reward = "20000 credits"
misn_desc = "Cart some nerds to their contest, and back."
@@ -23,122 +23,122 @@ else
title = {}
text = {}
- -- The nerd's job proposal
+ -- The nerd's job proposal
title[1] = "A group of excited nerds"
text[1] = [[As you approach the group, the babbling ceases and the papers are quickly and jealously stashed away. One of the girls comes forward and introduces herself.
- "Hi, I'm Mia. We need transportation, and you look as if you could need some dough. Interested?"
- You reply that for a deal to be worked out, they better provide some detail.
- "Listen," she says, "there's this Homebrewn Processing Box Masters on %s. Right over there, this system. I'm sure our box will get us the first prize. You take us there, you take us back, you get 20000."
- You just start wondering at the boldness of so young a lady as she already signals her impatience. "What now, you do it?"]]
+ "Hi, I'm Mia. We need transportation, and you look as if you could need some dough. Interested?"
+ You reply that for a deal to be worked out, they better provide some detail.
+ "Listen," she says, "there's this Homebrewn Processing Box Masters on %s. Right over there, this system. I'm sure our box will get us the first prize. You take us there, you take us back, you get 20000."
+ You just start wondering at the boldness of so young a lady as she already signals her impatience. "What now, you do it?"]]
- -- you accept
+ -- you accept
title[2] = "We have a deal!"
text[2] = [[Upon accepting the task, you see the entire group relax visibly, and you can almost feel Mia's boldness fade away - to some extent, at least. It seems that the group is quite fond of the competition, but until now had no idea how to get there.
- As the others scramble to get up from their cramped table and start to gather their belongings, it is again up to Mia to address you:
+ As the others scramble to get up from their cramped table and start to gather their belongings, it is again up to Mia to address you:
"Really? You do it? Um, great. Fantastic. I just knew that eventually, someone desperate would turn up. Ok, we're set to go. We better take off immediately and go directly to %s, or we'll be late for the contest!"]]
- -- right planet, in time
- title[3] = "Happy nerds"
- text[3] = [["Good job, %s," Mia compliments you upon arrival. "We'll now go win the competition and celebrate a bit. You better stay in the system. We will hail you in about 4 or 5 STP, so you can pick us up an bring us back to %s."
- That said, the bunch of nerds shoulders the box and rushes towards a banner which reads "Admissions".]]
-
- -- right planet, late
- title[4] = "Angry nerds"
- text[4] = [[Mia fumes. "Great. Just great! We're late, you geek." She points to a crumpled banner reading "Admissions". The area below it is deserted. "No contest for us, no payment for you. Understand? Go and take your excuse of a ship into the corona of a suitable star. We will find someone else to take us back to %s. Someone reliable."
- As her emphasis on the last words is still ringing in your ears, the gang of nerds strolls toward an archway behind which, judging from the bustling atmosphere, the contest is already going on.]]
-
- -- right planet, in time
- title[5] = "Furious nerds"
- text[5] = [[The nerds quickly and quietly pack up their box and start to leave your ship. Finally, Mia turns to you. Her body language suggests that she's almost bursting with anger. Yet her voice is controlled when she starts talking:
- "You're a pity loser. The contest is almost over and we are stranded in some dump we never wanted to see. I'm sure you agree that this isn't worth any payment." She turns to leave, but then adds: "Are you sure that everything is in order with your ships core? You don't want it to melt down just in the middle of a fight, do you?" With this, she joins the rest of her combo, and they are gone.]]
-
- -- you are hailed to pick them up again
- title[6] = "In-system communication"
- text[6] = [[A nerdy beep from your communications equipment tells you that someone wants to talk to you. You realize it is the nerds, and return the hail. "Yo! This is Mia," comes from the speaker. "We're done here. Time to come back and pick us up, we have things to do on %s."]]
-
- title[7] = "In-system communication"
- text[7] = [[Your comm link comes up again. It is the nerds, whom you've almost forgotten. You hear Mia's voice: "Hey, what are you waiting for? Better be here within one STP, or we'll get another pilot and pay them, not you!"]]
-
- -- you pick up the nerds in time, they won
- title[8] = "Happy nerds"
- text[8] = [[As soon as you get of your ship, you are surrounded by the group of nerds, who are enthusiastic. "We won!", one of the dudes shouts at you. Surprisingly, the group seems to not completely be dependent on Mia when it comes to communicating with outsiders. Maybe the booze the group is obviously intoxicated with did help a little. "Take us back to %s," one of them says, "we'll continue to celebrate on the way."]]
-
- -- you pick up the nerds in time, they didn't win
- title[9] = "Sad nerds"
- text[9] = [[As you get of your ship, you do not immediately see the nerds. You finally find them in a dark corner of the landing pad quietly sitting on their box, obviously in no good mood. You greet them, but nobody speaks a word. "Hey, what's up? Come on, tell me!" you inquire. The nerds warily glance at each other, and finally Mia bursts out:
+ -- right planet, in time
+ title[3] = "Happy nerds"
+ text[3] = [["Good job, %s," Mia compliments you upon arrival. "We'll now go win the competition and celebrate a bit. You better stay in the system. We will hail you in about 4 or 5 STP, so you can pick us up an bring us back to %s."
+ That said, the bunch of nerds shoulders the box and rushes towards a banner which reads "Admissions".]]
+
+ -- right planet, late
+ title[4] = "Angry nerds"
+ text[4] = [[Mia fumes. "Great. Just great! We're late, you geek." She points to a crumpled banner reading "Admissions". The area below it is deserted. "No contest for us, no payment for you. Understand? Go and take your excuse of a ship into the corona of a suitable star. We will find someone else to take us back to %s. Someone reliable."
+ As her emphasis on the last words is still ringing in your ears, the gang of nerds strolls toward an archway behind which, judging from the bustling atmosphere, the contest is already going on.]]
+
+ -- right planet, in time
+ title[5] = "Furious nerds"
+ text[5] = [[The nerds quickly and quietly pack up their box and start to leave your ship. Finally, Mia turns to you. Her body language suggests that she's almost bursting with anger. Yet her voice is controlled when she starts talking:
+ "You're a pity loser. The contest is almost over and we are stranded in some dump we never wanted to see. I'm sure you agree that this isn't worth any payment." She turns to leave, but then adds: "Are you sure that everything is in order with your ships core? You don't want it to melt down just in the middle of a fight, do you?" With this, she joins the rest of her combo, and they are gone.]]
+
+ -- you are hailed to pick them up again
+ title[6] = "In-system communication"
+ text[6] = [[A nerdy beep from your communications equipment tells you that someone wants to talk to you. You realize it is the nerds, and return the hail. "Yo! This is Mia," comes from the speaker. "We're done here. Time to come back and pick us up, we have things to do on %s."]]
+
+ title[7] = "In-system communication"
+ text[7] = [[Your comm link comes up again. It is the nerds, whom you've almost forgotten. You hear Mia's voice: "Hey, what are you waiting for? Better be here within one STP, or we'll get another pilot and pay them, not you!"]]
+
+ -- you pick up the nerds in time, they won
+ title[8] = "Happy nerds"
+ text[8] = [[As soon as you get of your ship, you are surrounded by the group of nerds, who are enthusiastic. "We won!", one of the dudes shouts at you. Surprisingly, the group seems to not completely be dependent on Mia when it comes to communicating with outsiders. Maybe the booze the group is obviously intoxicated with did help a little. "Take us back to %s," one of them says, "we'll continue to celebrate on the way."]]
+
+ -- you pick up the nerds in time, they didn't win
+ title[9] = "Sad nerds"
+ text[9] = [[As you get of your ship, you do not immediately see the nerds. You finally find them in a dark corner of the landing pad quietly sitting on their box, obviously in no good mood. You greet them, but nobody speaks a word. "Hey, what's up? Come on, tell me!" you inquire. The nerds warily glance at each other, and finally Mia bursts out:
"That aristocratic ass of a bored teenager! He snatched the prize from us! It wasn't even fair play. His box wasn't home built. It was a brand new ship's processing unit, on which he banged his hammer until it looked acceptable. And the corrupt idiots in the jury pretended not to notice!"
"So no, we didn't win" she adds after taking a few breaths to calm down. "Take us back to %s.]]
- -- you do not pickup the nerds in time
- title[10] = "No more nerds"
- text[10] = [[You look around, but the nerds are nowhere to be found. That is not much of a surprise, seeing that you are way too late.
+ -- you do not pickup the nerds in time
+ title[10] = "No more nerds"
+ text[10] = [[You look around, but the nerds are nowhere to be found. That is not much of a surprise, seeing that you are way too late.
Suddenly, a guy approaches you. "Hi, are you %s? The nerds wanted you to know that, basically, they got another transport home. One of the girls said some more, in a particularly rude language, but I don't remember the details".]]
- -- you do not pickup the nerds in time, and don't even land on the right planet
- title[11] = "You forgot the nerds"
- text[11] = [[Seeing that it is already too late to pick up the nerds, and that you're quite far from %s, you decide to better forget about them completely.]]
+ -- you do not pickup the nerds in time, and don't even land on the right planet
+ title[11] = "You forgot the nerds"
+ text[11] = [[Seeing that it is already too late to pick up the nerds, and that you're quite far from %s, you decide to better forget about them completely.]]
- -- you return the nerds, who have won the contest
- title[12] = "The End"
- text[12] = [[The nerds, finally exhausted from all the partying, still smile as they pack up their prize-winning box and leave your ship. Mia beams as she turns to you. "Well done, %s. You see, since we got loads of prize money, we decided to give you a bonus. After all, we wouldn't have gotten there without your service. Here you have 30000. Good day to you."]]
+ -- you return the nerds, who have won the contest
+ title[12] = "The End"
+ text[12] = [[The nerds, finally exhausted from all the partying, still smile as they pack up their prize-winning box and leave your ship. Mia beams as she turns to you. "Well done, %s. You see, since we got loads of prize money, we decided to give you a bonus. After all, we wouldn't have gotten there without your service. Here you have 30000. Good day to you."]]
- -- you return the nerds, who did not win the contest
- title[13] = "Minor Complications"
- text[13] = [[With hanging shoulders, the nerds unload their box. Mia turns to address you. This time, not bold at all. "Um, we got a bit of a problem here. You know, we intended to pay the trip from our prize money. Now we don't have no prize money."
+ -- you return the nerds, who did not win the contest
+ title[13] = "Minor Complications"
+ text[13] = [[With hanging shoulders, the nerds unload their box. Mia turns to address you. This time, not bold at all. "Um, we got a bit of a problem here. You know, we intended to pay the trip from our prize money. Now we don't have no prize money."
As you still try to decide what to make of the situation, one of the other nerds creeps up behind Mia and cautiously gestures for her to join the group a few yards away, all the time avoiding your eyes. Strange guy, you think, as if he was not accustomed to be socializing with strangers. Mia joins the group, and some whispering ensues. Mia returns to you after a few minutes.
"Ok, we have just solved our problem. See, that ass of a champion won the contest with a ship's processing unit. We can do it the other way round. We'll modify our box so that it can be used as a ship's coprocessor, and you can have it as a compensation for your troubles. Interested?"]]
- title[14] = "So what?"
- text[14] = [["Honestly, there is nothing you can do about it," Mia says impatiently, as if you were a small child complaining about the finiteness of an ice cream cone." Just stand by while we rig the thing up."]]
+ title[14] = "So what?"
+ text[14] = [["Honestly, there is nothing you can do about it," Mia says impatiently, as if you were a small child complaining about the finiteness of an ice cream cone." Just stand by while we rig the thing up."]]
- title[15] = "The End"
- text[15] = [["You can wait for it, won't take longer than half a STP," Mia informs you. You stand by as the nerds start to mod their box. As they are going for it, you wonder if they're actually wrecking it and you'll maybe be left with a piece of worthless junk.
+ title[15] = "The End"
+ text[15] = [["You can wait for it, won't take longer than half a STP," Mia informs you. You stand by as the nerds start to mod their box. As they are going for it, you wonder if they're actually wrecking it and you'll maybe be left with a piece of worthless junk.
Finally, the modified box is set before you. "Here you are. Now you're the proud owner of the system's only home made coprocessing unit. It's gotten a bit bulkier than we thought, with all this rigging for energy and coolant supply, but it should work just fine. We must go now and think about something more advanced for the next competition. Have a nice day."
With that, the nerds leave. Having gotten nothing else out of this, you think you should visit an outfitter to see if the box may actually be of any use.]]
- -- for use in accept(), if any of the mission's preconditions are not met
- title[16] = "Not enough cargo space"
- text[16] = [["Aw, I forgot" she adds. "We would of course need 4 tons of free cargo space for our box."]]
- title[17] = "Young People"
- text[17] = [["Sorry, we're busy right now."]]
-
- -- additional text for stage 2 cargo space test
- title[18] = "Room for the box"
- text[18] = [["Aw %s," Mia complains, "as if you didn't know that our box needs 4 tons of free cargo space. Make room now, and pick us up at the bar."]]
-
- title[19] = "Departure"
- text[19] = [[The nerds follow you to your ship and finally stow away their box. Now, you're all set to go.]]
-
- title[20] = "No room, no job"
- text[20] = [[As you enter the bar, the nerds are immediately upon you. "What is it with you?" Mia asks. "Is it so hard to make some room for our box? I am fed up with you, consider our agreement nullified. I hope to never again have business with you." Some angry stares later, the nerds are gone, trying to find another pilot.]]
-
- -- OSD texts
- textosd = {}
- -- stage 1
- textosd[1] = "Bring the nerds and their box to %s before %s"
- textosd[2] = "You have %s remaining."
- textosd[3] = "You're late. Mia has started verbally abusing you and your ship. Better land to get rid of the nerds and their box."
- -- stage 2
- textosd[4] = "You are to wait several STP until hailed by the nerds for their return trip."
- textosd[5] = "Pick up the nerds on %s for their return trip to %s."
- textosd[6] = "The nerds are getting impatient."
- textosd[7] = "You didn't pick up the nerds in time."
- -- stage 3
- textosd[8] = "Return the nerds to %s."
-
- textmsg = {}
- -- displayed if you leave without the nerd's authorization
- textmsg[1] = "Have the nerds not told you to stay in the system? Mission failed!"
- textmsg[2] = "Have the nerds not told you to pick them up at the bar? Mission failed!"
-
- -- the mission cargo (names as in commodity.xml)
- misn_cargo1 = "Group of Nerds"
- misn_cargoamount1 = "0"
- misn_cargo2 = "Box"
- misn_cargoamount2 = "4"
-
- -- the outfit name as in outfit.xml
- outfit = "Auxiliary Processing Unit I"
+ -- for use in accept(), if any of the mission's preconditions are not met
+ title[16] = "Not enough cargo space"
+ text[16] = [["Aw, I forgot" she adds. "We would of course need 4 tons of free cargo space for our box."]]
+ title[17] = "Young People"
+ text[17] = [["Sorry, we're busy right now."]]
+
+ -- additional text for stage 2 cargo space test
+ title[18] = "Room for the box"
+ text[18] = [["Aw %s," Mia complains, "as if you didn't know that our box needs 4 tons of free cargo space. Make room now, and pick us up at the bar."]]
+
+ title[19] = "Departure"
+ text[19] = [[The nerds follow you to your ship and finally stow away their box. Now, you're all set to go.]]
+
+ title[20] = "No room, no job"
+ text[20] = [[As you enter the bar, the nerds are immediately upon you. "What is it with you?" Mia asks. "Is it so hard to make some room for our box? I am fed up with you, consider our agreement nullified. I hope to never again have business with you." Some angry stares later, the nerds are gone, trying to find another pilot.]]
+
+ -- OSD texts
+ textosd = {}
+ -- stage 1
+ textosd[1] = "Bring the nerds and their box to %s before %s"
+ textosd[2] = "You have %s remaining."
+ textosd[3] = "You're late. Mia has started verbally abusing you and your ship. Better land to get rid of the nerds and their box."
+ -- stage 2
+ textosd[4] = "You are to wait several STP until hailed by the nerds for their return trip."
+ textosd[5] = "Pick up the nerds on %s for their return trip to %s."
+ textosd[6] = "The nerds are getting impatient."
+ textosd[7] = "You didn't pick up the nerds in time."
+ -- stage 3
+ textosd[8] = "Return the nerds to %s."
+
+ textmsg = {}
+ -- displayed if you leave without the nerd's authorization
+ textmsg[1] = "Have the nerds not told you to stay in the system? Mission failed!"
+ textmsg[2] = "Have the nerds not told you to pick them up at the bar? Mission failed!"
+
+ -- the mission cargo (names as in commodity.xml)
+ misn_cargo1 = "Group of Nerds"
+ misn_cargoamount1 = "0"
+ misn_cargo2 = "Box"
+ misn_cargoamount2 = "4"
+
+ -- the outfit name as in outfit.xml
+ outfit = "Auxiliary Processing Unit I"
end
function create ()
@@ -147,45 +147,45 @@ function create ()
end
function accept ()
- local cp,s = planet.cur()
- srcPlanet = cp
- for i,p in ipairs(system.planets(system.cur())) do
- if planet.services(p)["land"] and p ~= cp and p:canLand() then
- destPlanet=p
- break -- atm, just take the first landable planet which is not the current one
- end
- end
-
- -- the mission cannot be started with less than two landable assets in the system
- if not system_hasAtLeast(2, "land") then
- tk.msg(title[17], text[17])
- misn.finish(false)
- end
-
- if not tk.yesno( title[1], string.format(text[1], planet.name(destPlanet) )) then
- misn.finish(false)
- else
- if pilot.cargoFree(player.pilot()) < 4 then
- tk.msg(title[16], text[16])
- misn.finish(false)
- end
-
- misn.accept()
- misn.setTitle( misn_title)
- misn.setReward( misn_reward)
- misn.setDesc( misn_desc)
- marker = misn.markerAdd( system.cur(), "low" )
-
- tk.msg(title[2], string.format(text[2], planet.name(destPlanet)))
- local distance = vec2.dist( planet.pos(srcPlanet), planet.pos(destPlanet) )
- local stuperpx = 1 / pilot.stats(player.pilot()).speed_max * 30 -- from cargo_common.lua
- expiryDate = time.get() + time.create(0, 0, 10010 + distance * stuperpx + 3300 ) -- takeoff + min travel time + leeway
-
- addNerdCargo()
- lhook = hook.land("nerds_land1", "land")
- misn.osdCreate( misn_title, {string.format(textosd[1], planet.name(destPlanet), time.str(expiryDate, 1)), string.format(textosd[2], time.str(expiryDate - time.get(), 1))})
- dhook = hook.date(time.create(0, 0, 100), "nerds_fly1")
- end
+ local cp,s = planet.cur()
+ srcPlanet = cp
+ for i,p in ipairs(system.planets(system.cur())) do
+ if planet.services(p)["land"] and p ~= cp and p:canLand() then
+ destPlanet=p
+ break -- atm, just take the first landable planet which is not the current one
+ end
+ end
+
+ -- the mission cannot be started with less than two landable assets in the system
+ if not system_hasAtLeast(2, "land") then
+ tk.msg(title[17], text[17])
+ misn.finish(false)
+ end
+
+ if not tk.yesno( title[1], string.format(text[1], planet.name(destPlanet) )) then
+ misn.finish(false)
+ else
+ if pilot.cargoFree(player.pilot()) < 4 then
+ tk.msg(title[16], text[16])
+ misn.finish(false)
+ end
+
+ misn.accept()
+ misn.setTitle( misn_title)
+ misn.setReward( misn_reward)
+ misn.setDesc( misn_desc)
+ marker = misn.markerAdd( system.cur(), "low" )
+
+ tk.msg(title[2], string.format(text[2], planet.name(destPlanet)))
+ local distance = vec2.dist( planet.pos(srcPlanet), planet.pos(destPlanet) )
+ local stuperpx = 1 / pilot.stats(player.pilot()).speed_max * 30 -- from cargo_common.lua
+ expiryDate = time.get() + time.create(0, 0, 10010 + distance * stuperpx + 3300 ) -- takeoff + min travel time + leeway
+
+ addNerdCargo()
+ lhook = hook.land("nerds_land1", "land")
+ misn.osdCreate( misn_title, {string.format(textosd[1], planet.name(destPlanet), time.str(expiryDate, 1)), string.format(textosd[2], time.str(expiryDate - time.get(), 1))})
+ dhook = hook.date(time.create(0, 0, 100), "nerds_fly1")
+ end
end
@@ -193,205 +193,205 @@ end
function nerds_land1()
local cp, s = planet.cur()
- if intime and cp ~= destPlanet then
- return
- end
-
- rmNerdCargo()
- hook.rm(lhook)
- hook.rm(dhook)
-
- if cp == destPlanet then
- if intime then
- -- in time, right planet
- tk.msg(title[3], string.format(text[3], player.name(), planet.name(srcPlanet) ))
- misn.osdCreate( misn_title, {textosd[4]} )
- expiryDate = time.get() + time.create(0, 0, 36000+rnd.rnd(-7500,7500), 0)
- hailed = false
- impatient = false
- dhook = hook.date(time.create(0, 0, 100), "nerds_fly2")
- lhook = hook.land("nerds_land2", "land")
- jhook = hook.jumpout("nerds_jump")
-
- else
- -- late, right planet
- tk.msg(title[4], string.format(text[4], planet.name(srcPlanet) ))
- misn.finish(true)
- end
- else
- if not intime then
- -- late, not even the right planet
- tk.msg(title[5], text[5])
- misn.finish(true)
- end
- end
+ if intime and cp ~= destPlanet then
+ return
+ end
+
+ rmNerdCargo()
+ hook.rm(lhook)
+ hook.rm(dhook)
+
+ if cp == destPlanet then
+ if intime then
+ -- in time, right planet
+ tk.msg(title[3], string.format(text[3], player.name(), planet.name(srcPlanet) ))
+ misn.osdCreate( misn_title, {textosd[4]} )
+ expiryDate = time.get() + time.create(0, 0, 36000+rnd.rnd(-7500,7500), 0)
+ hailed = false
+ impatient = false
+ dhook = hook.date(time.create(0, 0, 100), "nerds_fly2")
+ lhook = hook.land("nerds_land2", "land")
+ jhook = hook.jumpout("nerds_jump")
+
+ else
+ -- late, right planet
+ tk.msg(title[4], string.format(text[4], planet.name(srcPlanet) ))
+ misn.finish(true)
+ end
+ else
+ if not intime then
+ -- late, not even the right planet
+ tk.msg(title[5], text[5])
+ misn.finish(true)
+ end
+ end
end
-- date hooked to update the time in the mission osd in stage 1 (carting the nerds to the contest)
function nerds_fly1()
- intime = expiryDate >= time.get()
- if intime then
- misn.osdCreate( misn_title, {string.format(textosd[1], planet.name(destPlanet), time.str(expiryDate, 2)), string.format(textosd[2], time.str(expiryDate - time.get(), 1))})
- else
- misn.osdCreate( misn_title, {string.format(textosd[1], planet.name(destPlanet), time.str(expiryDate, 2)), textosd[3]})
- misn.osdActive(2)
- end
+ intime = expiryDate >= time.get()
+ if intime then
+ misn.osdCreate( misn_title, {string.format(textosd[1], planet.name(destPlanet), time.str(expiryDate, 2)), string.format(textosd[2], time.str(expiryDate - time.get(), 1))})
+ else
+ misn.osdCreate( misn_title, {string.format(textosd[1], planet.name(destPlanet), time.str(expiryDate, 2)), textosd[3]})
+ misn.osdActive(2)
+ end
end
-- hooked to 'land' in the second stage (wait for the nerds to hail you for the return trip)
function nerds_land2()
- function cleanup()
- hook.rm(dhook)
- hook.rm(lhook)
- hook.rm(jhook)
- end
-
- if not hailed then
- return
- end
-
- if intime and planet.cur() == destPlanet then
- -- you pickup the nerds in time
- nerdswon = rnd.rnd() >= 0.6
- if nerdswon then
- tk.msg(title[8], string.format(text[8], planet.name(srcPlanet)))
- else
- tk.msg(title[9], string.format(text[9], planet.name(srcPlanet)))
- end
- cleanup()
-
- if pilot.cargoFree(player.pilot()) >= 4 then
- -- player has enough free cargo
- nerds_return()
- else
- -- player has not enough free cargo space, give him last chance to make room
- tk.msg(title[18], string.format(text[18], player.name()))
- lhook = hook.land("nerds_bar", "bar")
- jhook = hook.takeoff("nerds_takeoff")
- end
-
- elseif not intime and planet.cur() == destPlanet then
- -- you're late for the pickup
- tk.msg(title[10], string.format(text[10], player.name()))
- cleanup()
- misn.finish(true)
-
- elseif not intime then
- -- you're late and far from the nerds
- tk.msg(title[11], string.format(text[11], planet.name(srcPlanet)))
- cleanup()
- misn.finish(true)
- end
+ function cleanup()
+ hook.rm(dhook)
+ hook.rm(lhook)
+ hook.rm(jhook)
+ end
+
+ if not hailed then
+ return
+ end
+
+ if intime and planet.cur() == destPlanet then
+ -- you pickup the nerds in time
+ nerdswon = rnd.rnd() >= 0.6
+ if nerdswon then
+ tk.msg(title[8], string.format(text[8], planet.name(srcPlanet)))
+ else
+ tk.msg(title[9], string.format(text[9], planet.name(srcPlanet)))
+ end
+ cleanup()
+
+ if pilot.cargoFree(player.pilot()) >= 4 then
+ -- player has enough free cargo
+ nerds_return()
+ else
+ -- player has not enough free cargo space, give him last chance to make room
+ tk.msg(title[18], string.format(text[18], player.name()))
+ lhook = hook.land("nerds_bar", "bar")
+ jhook = hook.takeoff("nerds_takeoff")
+ end
+
+ elseif not intime and planet.cur() == destPlanet then
+ -- you're late for the pickup
+ tk.msg(title[10], string.format(text[10], player.name()))
+ cleanup()
+ misn.finish(true)
+
+ elseif not intime then
+ -- you're late and far from the nerds
+ tk.msg(title[11], string.format(text[11], planet.name(srcPlanet)))
+ cleanup()
+ misn.finish(true)
+ end
end
-- date hooked in stage 2 (waiting for the nerds hail you for their return trip)
function nerds_fly2()
- if not hailed and time.get() > expiryDate then
- tk.msg(title[6], string.format(text[6], planet.name(srcPlanet)) )
- misn.osdCreate( misn_title, {string.format(textosd[5], planet.name(destPlanet), planet.name(srcPlanet))})
- hailed = true
- end
-
- intime = time.get() <= expiryDate + time.create(0,3,3000)
-
- -- no pickup since hail+2STP+1STP: mission failed (however, you must still land somewhere)
- if not intime then
- misn.osdCreate( misn_title, {string.format(textosd[5], planet.name(destPlanet), planet.name(srcPlanet)), textosd[7] })
- misn.osdActive(2)
- end
-
- -- no pickup since hail+2STP
- if hailed and intime and time.get() > expiryDate + time.create(0,2,0) then
- if not impatient then
- tk.msg(title[7], string.format(text[7], planet.name(srcPlanet)) )
- impatient = true
- end
- misn.osdCreate( misn_title, {string.format(textosd[5], planet.name(destPlanet), planet.name(srcPlanet)), textosd[6], string.format(textosd[2], time.str(expiryDate + time.create(0,3,0) - time.get(), 2)) })
- misn.osdActive(2)
- end
+ if not hailed and time.get() > expiryDate then
+ tk.msg(title[6], string.format(text[6], planet.name(srcPlanet)) )
+ misn.osdCreate( misn_title, {string.format(textosd[5], planet.name(destPlanet), planet.name(srcPlanet))})
+ hailed = true
+ end
+
+ intime = time.get() <= expiryDate + time.create(0,3,3000)
+
+ -- no pickup since hail+2STP+1STP: mission failed (however, you must still land somewhere)
+ if not intime then
+ misn.osdCreate( misn_title, {string.format(textosd[5], planet.name(destPlanet), planet.name(srcPlanet)), textosd[7] })
+ misn.osdActive(2)
+ end
+
+ -- no pickup since hail+2STP
+ if hailed and intime and time.get() > expiryDate + time.create(0,2,0) then
+ if not impatient then
+ tk.msg(title[7], string.format(text[7], planet.name(srcPlanet)) )
+ impatient = true
+ end
+ misn.osdCreate( misn_title, {string.format(textosd[5], planet.name(destPlanet), planet.name(srcPlanet)), textosd[6], string.format(textosd[2], time.str(expiryDate + time.create(0,3,0) - time.get(), 2)) })
+ misn.osdActive(2)
+ end
end
-- hooked to entering the bar in stage 2
function nerds_bar()
- hook.rm(jhook)
- hook.rm(lhook)
- if pilot.cargoFree(player.pilot()) >= 4 then
- tk.msg(title[19], text[19])
- nerds_return()
- else
- tk.msg(title[20], text[20])
- misn.finish(true)
- end
+ hook.rm(jhook)
+ hook.rm(lhook)
+ if pilot.cargoFree(player.pilot()) >= 4 then
+ tk.msg(title[19], text[19])
+ nerds_return()
+ else
+ tk.msg(title[20], text[20])
+ misn.finish(true)
+ end
end
-- hooked to leaving the system in stage 2
function nerds_jump()
- player.msg(textmsg[1])
- misn.finish(true)
+ player.msg(textmsg[1])
+ misn.finish(true)
end
-- hooked to inappropriately taking off in stage 2
function nerds_takeoff()
- hook.rm(jhook)
- hook.rm(lhook)
- player.msg(textmsg[2])
- misn.finish(true)
+ hook.rm(jhook)
+ hook.rm(lhook)
+ player.msg(textmsg[2])
+ misn.finish(true)
end
-- common prep for the final stage
function nerds_return()
- addNerdCargo()
- misn.osdCreate(misn_title, { string.format(textosd[8], planet.name(srcPlanet) ) })
- lhook = hook.land("nerds_land3", "land")
+ addNerdCargo()
+ misn.osdCreate(misn_title, { string.format(textosd[8], planet.name(srcPlanet) ) })
+ lhook = hook.land("nerds_land3", "land")
end
-- hooked to 'land' in the final stage (returning the nerds)
function nerds_land3()
- local cp,s = planet.cur()
- if cp == srcPlanet then
- if nerdswon then
- tk.msg(title[12], string.format(text[12], player.name()))
- player.pay(30000)
- else
- if not tk.yesno(title[13], text[13]) then
- tk.msg(title[14], text[14])
- end
- tk.msg(title[15], text[15])
- time.inc(time.create(0,0,5000))
- player.addOutfit(outfit)
- if planet.services(cp)["outfits"] then
- player.landWindow("equipment")
- end
- end
- rmNerdCargo()
- hook.rm(dhook)
- hook.rm(lhook)
- misn.markerRm(marker)
- misn.finish(true)
- end
+ local cp,s = planet.cur()
+ if cp == srcPlanet then
+ if nerdswon then
+ tk.msg(title[12], string.format(text[12], player.name()))
+ player.pay(30000)
+ else
+ if not tk.yesno(title[13], text[13]) then
+ tk.msg(title[14], text[14])
+ end
+ tk.msg(title[15], text[15])
+ time.inc(time.create(0,0,5000))
+ player.addOutfit(outfit)
+ if planet.services(cp)["outfits"] then
+ player.landWindow("equipment")
+ end
+ end
+ rmNerdCargo()
+ hook.rm(dhook)
+ hook.rm(lhook)
+ misn.markerRm(marker)
+ misn.finish(true)
+ end
end
-- to check if the assets in the current system have at least _amount_ of _service_
function system_hasAtLeast (amount, service)
- local p = {}
- for i,v in ipairs(system.planets(system.cur())) do
- if planet.services(v)[service] and v:canLand() then
- table.insert(p,v)
- end
- end
- return #p >= amount
+ local p = {}
+ for i,v in ipairs(system.planets(system.cur())) do
+ if planet.services(v)[service] and v:canLand() then
+ table.insert(p,v)
+ end
+ end
+ return #p >= amount
end
-- helper functions, used repeatedly
function addNerdCargo()
- cargo1 = misn.cargoAdd(misn_cargo1, misn_cargoamount1)
- cargo2 = misn.cargoAdd(misn_cargo2, misn_cargoamount2)
+ cargo1 = misn.cargoAdd(misn_cargo1, misn_cargoamount1)
+ cargo2 = misn.cargoAdd(misn_cargo2, misn_cargoamount2)
end
function rmNerdCargo()
- misn.cargoRm(cargo1)
- misn.cargoRm(cargo2)
+ misn.cargoRm(cargo1)
+ misn.cargoRm(cargo2)
end
View
2  dat/missions/neutral/kidnapped/traffic_00.lua
@@ -22,7 +22,7 @@ text = {}
osdmsg = {}
title[1] = "Help!"
-text[1] = [[ "Hello %s, thank you so much for answering our hail! We really could use your help." said a haggard sounding man's voice over the comm. The man continued, "It's about our children, my wife's and mine. We were out on a family vacation to Antica, you see, and we were attacked by a gang of pirates." A woman's voice pipes up, "And he thought he could out-fly them! My husband used to be a bit of a pilot, but that was back when we were still dating and he would fly all the way to the Apez system to see me. But that was before we had children..." The woman trailed off as you could hear her filling up with fresh sorrow.
+text[1] = [[ "Hello %s, thank you so much for answering our hail! We really could use your help." said a haggard sounding man's voice over the comm. The man continued, "It's about our children, my wife's and mine. We were out on a family vacation to Antica, you see, and we were attacked by a gang of pirates." A woman's voice pipes up, "And he thought he could out-fly them! My husband used to be a bit of a pilot, but that was back when we were still dating and he would fly all the way to the Apez system to see me. But that was before we had children..." The woman trailed off as you could hear her filling up with fresh sorrow.
The man quickly speaks up again, "Anyways, the pirates disabled our ship and we thought we were goners, but when they boarded us, they took our three children and left us! I tried to fight them, but they had my children, with knives to their necks... So we got a tow back to Brooks, and now we need to find someone who will rescue our children. We've heard of your skills; will you please help us?]]
title[2] = "Thank you!"
View
4 dat/missions/runaway/runaway_search.lua
@@ -126,8 +126,8 @@ function land ()
osd_text[4] = osdlie
tk.msg(title, misn_release)
else
- tk.msg(title, misn_capture)
- cargoID = misn.cargoAdd( cargoname, 0 )
+ tk.msg(title, misn_capture)
+ cargoID = misn.cargoAdd( cargoname, 0 )
end
--Update the osd
View
2  dat/missions/sirius/srs_ferry.lua
@@ -103,7 +103,7 @@ Accept the mission anyway?]]
change_ship[1] = "On landing, the passenger gives you a brief glare and remarks, \n\"I had paid for transportation in a Sirian ship; this alternate arrangement is quite disappointing.\"\nThey hand you %d credits, but it's definitely less than you were expecting."
change_ship[2] = "Since you were unexpectedly able to procure a Sirian ship for the journey, you find a few extra credits tucked in with the fare!"
- --=Landing=--
+ --=Landing=--
ferry_land_title = "Successful arrival!"
ferry_land_late = "Late arrival"
View
28 extras/win_installer/naev.nsi
@@ -94,9 +94,9 @@ Section "Naev Engine" BinarySection
File bin\naev.exe
File ..\logos\logo.ico
- IntOp $PortID $PortID & ${SF_SELECTED}
-
- ${If} $PortID = 0 ;this means that the section 'portable' was not selected
+ IntOp $PortID $PortID & ${SF_SELECTED}
+
+ ${If} $PortID = 0 ;this means that the section 'portable' was not selected
;Store installation folder
WriteRegStr SHCTX "Software\Naev" "" $INSTDIR
@@ -129,14 +129,14 @@ Section "Naev Engine" BinarySection
SectionEnd
Section "Naev Data (Download)" DataSection
- dwn:
+ dwn:
AddSize 202159 ;Size (kB) of Naev ndata
NSISdl::download "http://prdownloads.sourceforge.net/naev/naev-${VERSION}/ndata-${VERSION}" "ndata"
Pop $R0 ;Get the return value
StrCmp $R0 "success" skip
MessageBox MB_YESNO|MB_ICONEXCLAMATION "Download failed due to: $R0$\n$\nPlease note that naev wont work until you download ndata and put it in the same folder as naev.exe.$\n$\nRetry?" IDNO skip
- Goto dwn
- skip:
+ Goto dwn
+ skip:
SectionEnd
Section /o "Do a portable install" Portable
@@ -153,12 +153,12 @@ Function .onInit
ReadRegStr $INSTDIR SHCTX "Software\Naev" ""
${Unless} ${Errors}
;If we get here we're already installed
- MessageBox MB_YESNO|MB_ICONEXCLAMATION "Naev is already installed! Would you like to remove the old install first?$\n$\nNote: This is HIGHLY RECOMMENDED!" IDNO skip
- ExecWait '"$INSTDIR\Uninstall.exe"' $0
- ${Unless} $0 = 0 ;note: = not ==
- MessageBox MB_OK|MB_ICONSTOP "The uninstall failed!"
- ${EndUnless}
- skip:
+ MessageBox MB_YESNO|MB_ICONEXCLAMATION "Naev is already installed! Would you like to remove the old install first?$\n$\nNote: This is HIGHLY RECOMMENDED!" IDNO skip
+ ExecWait '"$INSTDIR\Uninstall.exe"' $0
+ ${Unless} $0 = 0 ;note: = not ==
+ MessageBox MB_OK|MB_ICONSTOP "The uninstall failed!"
+ ${EndUnless}
+ skip:
${EndUnless}
FunctionEnd
@@ -166,7 +166,7 @@ FunctionEnd
;TODO: someone please email me with a better way to do this
;--Sudarshan S
Function .onSelChange
- SectionGetFlags ${Portable} $PortID
+ SectionGetFlags ${Portable} $PortID
FunctionEnd
;--------------------------------
@@ -176,7 +176,7 @@ FunctionEnd
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${BinarySection} "Naev engine. Requires ndata to run."
!insertmacro MUI_DESCRIPTION_TEXT ${DataSection} "Provides all content and media."
- !insertmacro MUI_DESCRIPTION_TEXT ${Portable} "Perform a portable install. No uninstaller or registry entries are created and you can run off a pen drive"
+ !insertmacro MUI_DESCRIPTION_TEXT ${Portable} "Perform a portable install. No uninstaller or registry entries are created and you can run off a pen drive"
!insertmacro MUI_FUNCTION_DESCRIPTION_END
;--------------------------------

No commit comments for this range

Something went wrong with that request. Please try again.