Adjust missile detonation for better compatibility with 1.76 code

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5604 127b21dd-08f5-0310-b4b7-95ae10353056
master
Chris Morris 2013-01-05 16:28:11 +00:00
parent 98a743e374
commit 3d6ceaf44e
6 changed files with 11 additions and 55 deletions

View File

@ -42,7 +42,7 @@
};
DETONATE =
{
ENTER = ("sendScriptMessage: detonate");
ENTER = ("sendScriptMessage: ooliteDetonateAsStandardMissile");
};
EXPLODE =
{

View File

@ -38,7 +38,7 @@
};
DETONATE =
{
ENTER = ("sendScriptMessage: detonate");
ENTER = ("sendScriptMessage: ooliteDetonateAsStandardMissile");
};
EXPLODE =
{

View File

@ -109,3 +109,11 @@ if (this.legacy_setupActions !== undefined)
*/
this.ship.__runLegacyScriptActions(this.ship, this.legacy_setupActions);
}
// function for missiles and other entities using missile AI
this.ooliteDetonateAsStandardMissile = function()
{
this.ship.dealEnergyDamage(170, 32.5, 0.25);
this.ship.explode();
}

View File

@ -1,45 +0,0 @@
/*
oolite-missile.js
Ship script for Missiles and Hardheads.
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.
*/
/*jslint white: true, undef: true, eqeqeq: true, bitwise: true, regexp: true, newcap: true, immed: true */
/*global missionVariables, player*/
"use strict";
this.name = "oolite-missile";
this.author = "cim";
this.copyright = "© 2008-2013 the Oolite team.";
this.version = "1.77";
this.detonate = function()
{
this.ship.dealEnergyDamage(170, 32.5, 0.25);
this.ship.explode();
}

View File

@ -10609,13 +10609,6 @@ Vector positionOffsetForShipInRotationToAlignment(ShipEntity* ship, Quaternion q
// end special cases
// set the default missile script if none is assigned
// harmless if it's an OXP missile that doesn't need it
if ([[[missile shipScript] name] isEqualToString:@"oolite-default-ship-script"])
{
[missile setShipScript:@"oolite-missile.js"];
}
[missile setPosition:origin];
[missile addTarget:target];
[missile setOrientation:q1];

View File

@ -74,7 +74,7 @@ static NSString * const kCacheKeyCaches = @"caches";
enum
{
kEndianTagValue = 0x0123456789ABCDEFULL,
kFormatVersionValue = 209
kFormatVersionValue = 210
};