Merge pull request #328 from thecelloman/removeunusedwpnscripts

Remove unused weapon scripts in Full Template
This commit is contained in:
SilentMike 2013-04-11 08:57:33 -07:00
commit ab228f0faa
4 changed files with 1 additions and 252 deletions

View file

@ -1,117 +0,0 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
function enableManualDetonation(%obj)
{
%obj.detonadeEnabled = true;
}
function doManualDetonation(%obj)
{
%nade = new Item()
{
dataBlock = Detonade;
};
MissionCleanup.add(%nade);
%nade.setTransform(%obj.getTransform());
%nade.sourceObject = %obj.sourceObject;
%nade.schedule(50, "setDamageState", "Destroyed"); // Why must we schedule?!
//%nade.setDamageState(Destroyed);
%obj.delete();
}
function Detonade::onDestroyed(%this, %object, %lastState)
{
radiusDamage(%object, %object.getPosition(), 10, 25, "DetonadeDamage", 2000);
}
function GrenadeLauncherImage::onMount(%this, %obj, %slot)
{
// Make it ready
%obj.detonadeEnabled = true;
Parent::onMount(%this, %obj, %slot);
}
function GrenadeLauncherImage::onAltFire(%this, %obj, %slot)
{
/*
//echo("\c4GrenadeLauncherImage::onFire("@ %this.getName() @", "@ %obj.client.nameBase @", "@ %slot@")");
// It's not ready yet
if(!%obj.detonadeEnabled)
return;
// If we already have one of these... blow it up!!!
if(isObject(%obj.lastProj))
{
doManualDetonation(%obj.lastProj);
if(%obj.lastNade)
{
// We remove the ammo of the last projectile fired only after it has
// been triggered, otherwise we wouldn't be able to set it off.
%obj.lastNade = "";
%obj.decInventory(%this.ammo, 1);
}
return;
}
// We fire our weapon using the straight ahead aiming point of the gun.
%muzzleVector = %obj.getMuzzleVector(%slot);
// Get the player's velocity, we'll then add it to that of the projectile
%objectVelocity = %obj.getVelocity();
%muzzleVelocity = VectorAdd(
VectorScale(%muzzleVector, %this.projectile.muzzleVelocity),
VectorScale(%objectVelocity, %this.projectile.velInheritFactor));
%p = new (%this.projectileType)()
{
dataBlock = %this.projectile;
initialVelocity = %muzzleVelocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
%obj.lastProj = %p;
MissionCleanup.add(%p);
// Decrement inventory ammo.
//%obj.decInventory(%this.ammo, 1);
// Must do some trickiness with reducing the ammo count to account for the
// very last shot. If we don't you wouldn't be able to trigger it.
%currentAmmo = %obj.getInventory(%this.ammo);
if(%currentAmmo == 1)
%obj.lastNade = 1;
else
%obj.decInventory(%this.ammo, 1);
// We don't want to detonate it in our face now do we? Give it a little time.
%obj.detonadeEnabled = false;
schedule(250, 0, "enableManualDetonation", %obj);
*/
}

View file

@ -1,99 +0,0 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// Support methods used to track our number of ready shells for a charged shot.
// ----------------------------------------------------------------------------
function RocketLauncherImage::readyLoad(%this)
{
//echo("\c4RocketLauncherImage::readyLoad("@ %this.getName()@")");
%this.loadCount = 1;
//echo("\c4 loadCount = "@ %this.loadCount);
}
function RocketLauncherImage::incLoad(%this)
{
//echo("\c4RocketLauncherImage::incLoad("@ %this.getName()@")");
%this.loadCount++;
//echo("\c4 loadCount = "@ %this.loadCount);
}
// ----------------------------------------------------------------------------
// The fire method that does all of the work
// ----------------------------------------------------------------------------
function RocketLauncherImage::onAltFire(%this, %obj, %slot)
{
//echo("\c4RocketLauncherImage::onFire("@ %this.getName() @", "@ %obj.client.nameBase @", "@ %slot@")");
//echo("\c4 #in the pipe = "@ %this.loadCount);
//echo("");
// Let's check amount of ammo, if it's less than the loadCount then only
// fire the number of shots equal to the ammount of remaining ammo.
%currentAmmo = %obj.getInventory(%this.ammo);
if(%currentAmmo < %this.loadCount)
%this.loadCount = %currentAmmo;
for(%shotCount = 0; %shotCount < %this.loadCount; %shotCount++)
{
// Decrement inventory ammo. The image's ammo state is updated
// automatically by the ammo inventory hooks.
%obj.decInventory(%this.ammo, 1);
// We fire our weapon using the straight ahead aiming point of the gun
//%muzzleVector = %obj.getMuzzleVector(%slot);
// We'll need to "skew" the projectile a little bit. We start by getting
// the straight ahead aiming point of the gun
%vec = %obj.getMuzzleVector(%slot);
// Then we'll create a spread matrix by randomly generating x, y, and z
// points in a circle
%matrix = "";
for(%i = 0; %i < 3; %i++)
%matrix = %matrix @ (getRandom() - 0.5) * 2 * 3.1415926 * 0.008 @ " ";
%mat = MatrixCreateFromEuler(%matrix);
// Which we'll use to alter the projectile's initial vector with
%muzzleVector = MatrixMulVector(%mat, %vec);
// Get the player's velocity, we'll then add it to that of the projectile
%objectVelocity = %obj.getVelocity();
%muzzleVelocity = VectorAdd(
VectorScale(%muzzleVector, %this.projectile.muzzleVelocity),
VectorScale(%objectVelocity, %this.projectile.velInheritFactor));
// Create the projectile object
%p = new (%this.projectileType)()
{
dataBlock = %this.projectile;
initialVelocity = %muzzleVelocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
MissionCleanup.add(%p);
}
return %p;
}

View file

@ -37,10 +37,7 @@ exec("./weapon.cs");
// Load our weapon scripts
// We only need weapon scripts for those weapons that work differently from the
// "generic" methods defined in weapon.cs
exec("./rocketLauncher.cs");
exec("./soldierGun.cs");
exec("./grenadeLauncher.cs");
// class methods defined in weapon.cs
exec("./proximityMine.cs");
// Load our default player script

View file

@ -1,32 +0,0 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
function Soldier_gunImage::onMount(%this, %obj, %slot)
{
// Make it ready
Parent::onMount(%this, %obj, %slot);
}
function Soldier_gunImage::onAltFire(%this, %obj, %slot)
{
echo("Fire Grenade!");
}