1
/*jslint indent: 4, maxlen: 120, maxerr: 50, white: true, es5: true, undef: true, bitwise: true, regexp: true,
3
/*jshint es5: true, undef: true, bitwise: true, eqnull: true, noempty: true, eqeqeq: true, boss: true, loopfunc: true,
4
laxbreak: true, strict: true, curly: true */
5
/*global randomName, randomInhabitantsDescription, missionVariables, player */
7
/* jaguar_company_pilot.js
9
* Copyright © 2012 Richard Thomas Harrison (Tricky)
11
* This work is licensed under the Creative Commons
12
* Attribution-Noncommercial-Share Alike 3.0 Unported License.
14
* To view a copy of this license, visit
15
* http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter
16
* to Creative Commons, 171 Second Street, Suite 300, San Francisco,
17
* California, 94105, USA.
19
* Jaguar Company Pilot script for delivering escape-pods to a station.
25
/* Standard public variables for OXP scripts. */
26
this.name = "jaguar_company_pilot.js";
27
this.author = "Tricky";
28
this.copyright = "© 2012 Richard Thomas Harrison (Tricky)";
29
this.license = "CC BY-NC-SA 3.0";
30
this.description = "Jaguar Company Pilot script for delivering escape-pods to a station.";
33
this.unloadCharacter = function() {
37
dockedPersonality = player.ship.dockedStation.entityPersonality,
38
basePersonality = worldScripts["Jaguar Company"].$jaguarCompanyBase.entityPersonality;
40
/* Multiple of 5 Cr for insurance. */
41
insurance = 500 + (Math.floor(Math.random() * 40) * 5);
42
/* Create the message for the arrival report. */
43
message = "For rescuing " + randomName() + " " + randomName() +
44
", a " + randomInhabitantsDescription(false) +
45
" and member of Jaguar Company, their insurance pays " + insurance + " ₢.";
47
if (dockedPersonality === basePersonality) {
48
/* Give a bonus for bringing the pilot back to one of their base's. Multiple of 5Cr. */
49
bonus = 100 + (Math.floor(Math.random() * 20) * 5);
50
message += " Jaguar Company has also added a bonus of " + bonus + " ₢ for bringing back the pilot.";
53
/* Add on the insurance and bonus to the player's credits. */
54
player.credits += (insurance + bonus);
55
/* Increase the reputation of the player with Jaguar Company *after* launching.
56
* You don't want to be in the base when it swaps roles.
58
missionVariables.jaguar_company_reputation_post_launch += 5;
60
player.addMessageToArrivalReport(expandDescription(message));