~harrison-rt/+junk/jaguar_company

« back to all changes in this revision

Viewing changes to tags/2.0/jaguar_company_2.0.oxp/Scripts/jaguar_company_blackbox.js

  • Committer: Richard Harrison
  • Date: 2013-01-19 22:54:57 UTC
  • Revision ID: harrison.rt@gmail.com-20130119225457-ymm3tf03jao7b3lp
Tags: 2.1
* Thargoids and tharglets always returns true in $isHostile check.
* There is a safe zone of 30km around the base.
** NB: The safe zone does not extend to known attackers.
* Took out some ship script event handlers and AI sendScriptMessage functions from the base, buoy, miner and tug ship scripts that is inserted by $addFriendly.
* Fixed colour bug with the tracker. Didn't start off red if the target was behind the player.
* Fixed name error for $performJaguarCompanyAttackTarget in $addFriendly.
* Fixed sun check error if no sun exists.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*jslint indent: 4, maxlen: 120, maxerr: 50, white: true, es5: true, undef: true, bitwise: true, regexp: true,
 
2
newcap: 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 worldScripts */
 
6
 
 
7
/* jaguar_company_blackbox.js
 
8
 *
 
9
 * Copyright © 2012 Richard Thomas Harrison (Tricky)
 
10
 *
 
11
 * This work is licensed under the Creative Commons
 
12
 * Attribution-Noncommercial-Share Alike 3.0 Unported License.
 
13
 *
 
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.
 
18
 *
 
19
 * Jaguar Company Black Box equipment activation script.
 
20
 */
 
21
 
 
22
(function () {
 
23
    "use strict";
 
24
 
 
25
    /* Standard public variables for OXP scripts. */
 
26
    this.name = "jaguar_company_blackbox.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 Black Box equipment activation script.";
 
31
    this.version = "1.0";
 
32
 
 
33
    this.activated = function() {
 
34
        var p_mainScript = worldScripts["Jaguar Company"];
 
35
 
 
36
        if (!p_mainScript.$tracker || !p_mainScript.$tracker.isValid) {
 
37
            this.$jaguar_company_blackbox_activated = false;
 
38
        }
 
39
 
 
40
        if (!this.$jaguar_company_blackbox_activated) {
 
41
            this.$jaguar_company_blackbox_activated = p_mainScript.$activateJaguarCompanyBlackbox();
 
42
        } else {
 
43
            this.$jaguar_company_blackbox_activated = p_mainScript.$deactivateJaguarCompanyBlackbox();
 
44
        }
 
45
    };
 
46
}).call(this);