Back to Index Page generated: Dec 20, 2024, 7:22:09 AM

Expansion WOOT-Attack!

Content

Warnings

  1. Author mismatch between OXP Manifest and Expansion Manager string length at character position 0

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description Acquiring a target with weapons online or switching weapons online while a target is locked is interpreted as a hostile move by NPCs. Acquiring a target with weapons online or switching weapons online while a target is locked is interpreted as a hostile move by NPCs.
Identifier oolite.oxp.another_commander.WOOT_Attack oolite.oxp.another_commander.WOOT_Attack
Title WOOT-Attack! WOOT-Attack!
Category Mechanics Mechanics
Author
Version 0.2 0.2
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL https://wiki.alioth.net/index.php/WOOT-Attack! n/a
Download URL https://wiki.alioth.net/img_auth.php/0/0c/WOOT_Attack.oxz n/a
License CC BY-NC-SA 4.0 CC BY-NC-SA 4.0
File Size n/a
Upload date 1712747342

Documentation

Also read http://wiki.alioth.net/index.php/WOOT-Attack!

Equipment

This expansion declares no equipment. This may be related to warnings.

Ships

This expansion declares no ships. This may be related to warnings.

Models

This expansion declares no models. This may be related to warnings.

Scripts

Path
Scripts/woot_attack.js
/*
woot_attack.js
Acquiring a target with weapons online or switching weapons online
while a target is locked is interpreted as a hostile move by NPCs
*/


"use strict";


this.name			= "woot_attack.js";
this.author			= "another_commander";
this.copyright		= "© 2024 another_commander";
this.description	= "Acquiring a target with weapons online or switching weapons online while a target is locked is interpreted as a hostile move by NPCs.";
this.license		= "CC BY-NC-SA 4.0";


this.weaponsSystemsToggled = function (weaponsAreOnline)
{
	if (weaponsAreOnline)
	{
		var playerShipTarget = player.ship.target;
		if (playerShipTarget && playerShipTarget.isShip && playerShipTarget.isPiloted)
		{
			playerShipTarget.addDefenseTarget(player.ship);
			if (!playerShipTarget.target)
			{
				playerShipTarget.AIPrimaryAggressor = player.ship;
				playerShipTarget.reactToAIMessage("ATTACKED");
			}
		}
	}
}


this.shipTargetAcquired = function (shipTarget)
{
	this.weaponsSystemsToggled (player.ship.weaponsOnline);
}