New mission: Scanner
Posted: Sat May 18, 2013 7:23 am
I have been thinking about this mission type for quiet some time. I really think 90 % of this can be accomplished with code reused from other missions, mainly Assassination. The goal is to scan another ship for illegal goods. I do not know Lua or C otherwise I would have done it myself. Even so here is the pseudo-code if anyone wants to take a shot at this. Like I said most of this can be done using code from other missions to generate the mission, spawn the target ship + cargo and the police. Have fun
Mission type : Cargo Scanner Generate Mission, messages and GUI; ((using the same code for other mission, Assassination as a template?))Test if scanner equipment is present; ((using the same code for Delivery or Taxi to check if player has free space or enough cabins, but this time if scanner is part of the player's ship))If { scanner is not present; then Message "You are not equipped for this mission"; Aborts mission; Else Mission details are added as other mission;}Once in Target system generate Target ship to be scanned and cargo ((or this is done when the mission is accepted??)Commence scanning;If { cargo == legal; then Message "Mission Completed"; credits added; End Of mission;}Commence scanning;If { cargo == illegal; then spawn police; (( using the same script as when player fires near a station, but now police hostile to the smuggler, not to the player)) smuggler hostile to police; police hostile to smuggler; policed neutral to player; Message "Mission Completed"; credits added; End Of mission;}=================================================================================***Another variant of the mission Cargo Scanner**** *** The difference is that this mission is given by the Police from the Police screen only , has a higher probability that cargo is illegal and leads to a bigger reward if smuggler ship is destroyed. Smuggler ship should also be better equipped for combat or perhaps have more shields, better hull**** Generate Mission, messages and GUI __from the Police Screen__;Reward can be money OR clean criminal record OR police will pay/clean a fine;Test if scanner equipment is present;If { scanner is not present; then Message "You are not equipped for this mission"; Aborts mission; Else Mission details are added as other mission;}Once in Target system generate ship to be scanned and cargo __with 80 % changes cargo is illegal__ or perhaps cargo is always illegal ;Commence scanning;If { cargo == legal; then Message "Mission Completed"; credits added; End Of mission;}Commence scanning;If { cargo == illegal; then spawn police; smuggler hostile to police; smuggler hostile to player; police friendly OR neutral to the player; credits added or clean police record or fine is paid; Message "Mission Completed"; End Of mission;} (im not sure if the below can be already implemented in the game, it forces combat and player must hang around to collect more money)If { cargo == illegal AND player destroys smuggler ; or police destroys smuggler while player in system (not hyperdriving) ; Message " We have stopped the flow of illegal goods. Thanks for your help. Here is a bonus: Mission Credits = Mission Credits*2" Police returns to base; End Of mission;}