This file is indexed.

/usr/share/oolite/AIs/oolite-missileAI.js is in oolite-data 1.82-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
/*

missileAI.js

Priority-based AI for missiles

Oolite
Copyright © 2004-2013 Giles C Williams and contributors

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.

*/

"use strict";

this.name = "Oolite Missile AI";

this.aiStarted = function() {
	var ai = new worldScripts["oolite-libPriorityAI"].PriorityAIController(this.ship);

	/* This is probably too effective for standard missile AI, but
	 * might be worth setting separately on ships that use missile
	 * swarms as their main weapon. It makes the missiles avoid each
	 * other a bit, so that the detonation of the first missile won't
	 * destroy the remainder. */
	// ai.setParameter("oolite_flag_autoSpreadMissiles",true);

	/* Launch correction when fired at target in aft arc */ 
	if (this.ship.target && this.ship.target.position.subtract(this.ship.position).direction().dot(this.ship.vectorForward) < -0.8)
	{
		this.oolite_priorityai.setParameter("oolite_flag_launchAdjustMissile",true);
	}


	ai.setPriorities([
		{
			condition: ai.conditionMissileOutOfFuel,
			behaviour: ai.behaviourMissileSelfDestruct
		},
		{
			preconfiguration: ai.configurationCheckScanner,
			condition: ai.conditionScannerContainsUnspreadMissile,
			configuration: ai.configurationMissileAdjustSpread,
			behaviour: ai.behaviourApproachDestination,
			reconsider: 2
		},
		{
			condition: ai.conditionMissileNeedsLaunchEvasion,
			configuration: ai.configurationMissileAdjustLaunch,
			behaviour: ai.behaviourApproachDestination,
			reconsider: 2
		},
		{
			condition: ai.conditionHasTarget,
			behaviour: ai.behaviourMissileInterceptTarget,
			reconsider: 5
		},
		/* If target cloaks, go to last known location */
		{
			condition: ai.conditionHasInterceptCoordinates,
			behaviour: ai.behaviourMissileInterceptCoordinates,
			reconsider: 1
		},
		/* Target lost. Self-destruct */
		{
			behaviour: ai.behaviourMissileSelfDestruct
		}
	]);
}


/* ECM response function */
this._ecmProofMissileResponse = function()
{
	if (Math.random() < 0.1) //10% chance per pulse
	{
		if (Math.random() < 0.5)
		{
			// 50% chance responds by detonation
			this.ship.AIScript.shipAchievedDesiredRange();
			return;
		}
		// otherwise explode as normal below
	}
	else // 90% chance unaffected
	{
		return;
	}	
	this.ship.explode();
}