Code: Select all
ItemData GasserAmmo
{
description = "Spears";
className = "Ammo";
shapeFile = "mortarammo";
heading = "xAmmunition";
shadowDetailMask = 4;
price = 1;
};
ItemImageData GasserImage
{
shapeFile = "grenadeL";
mountPoint = 0;
weaponType = 0; // Single Shot
projectileType = GasserGrenade;
ammoType = GasserAmmo;
accuFire = True;
reloadTime = 0.25;
fireTime = 1.25;
lightType = 3; // Weapon Fire
lightRadius = 5;
lightTime = 2;
lightColor = { 0, 0, 1 };
sfxFire = debrisMediumExplosion;
sfxActivate = SoundPickUpWeapon;
sfxReload = SoundMortarReload;
};
ItemData Gasser
{
description = "Speargun";
className = "PriWeapon";
shapeFile = "grenadeL";
hudIcon = "plasma";
heading = "bPrimary Weapons";
shadowDetailMask = 4;
imageType = GasserImage;
price = 250;
showWeaponBar = true;
};
function Gasser::onUse(%player,%item)
{
%clientId = Player::getClient(%player);
Weapon::onUse(%player,%item);
bottomprint(Player::getClient(%player), "<jc><f2>\nSpeargun - fires Slow, but lethal spears. <f1> Identical in fire speed to the classic disc launcher.\n", 5);
}
ItemImageData GasserScopeImage
{
shapeFile = "discammo";
mountPoint = 0;
mountRotation = { 1.5, 0, 0 };
weaponType = 0; // Single Shot
mountOffset = { -0.0, 0.0, -0.1 };
ammoType = GasserAmmo;
reloadTime = 0.1;
fireTime = 0.1;
projectileType = DEBullet;
accuFire = false;
sfxFire = turretexplosion;
sfxActivate = SoundPickUpWeapon;
};
ItemData GasserScope
{
heading = "cSecondary Weapons";
description = "GasserScope";
className = "Weapon";
shapeFile = "force";
hudIcon = "blaster";
shadowDetailMask = 4;
imageType = GasserScopeImage;
price = 50;
showWeaponBar = true;
};
ItemImageData GasserClipImage
{
shapeFile = "grenadel";
mountPoint = 0;
mountRotation = {3.1, 0, 0 };
weaponType = 0; // Single Shot
mountOffset = { -0.0, -0.0, 0.0 };
ammoType = EagleAmmo;
reloadTime = 0.1;
fireTime = 0.1;
projectileType = DEBullet;
accuFire = false;
sfxFire = turretexplosion;
sfxActivate = SoundPickUpWeapon;
};
ItemData GasserClip
{
heading = "cSecondary Weapons";
description = "GasserClip";
className = "Weapon";
shapeFile = "grenadel";
hudIcon = "blaster";
shadowDetailMask = 4;
imageType = GasserClipImage;
price = 50;
showWeaponBar = true;
};
function Gasser::onMount(%player,%item)
{
Player::MountItem(%player,GasserScope,7);
Player::MountItem(%player,GasserClip,6);
}
function Gasser::onUnMount(%player,%item)
{
Player::UnMountItem(%player,7);
Player::UnMountItem(%player,6);
}
SeekingMissileData TossedSpear
{
bulletShapeName = "tracer.dts";
explosionTag = SpearExp;
collisionRadius = 0.0;
mass = 2.0;
damageClass = 0;
damageValue = 2;
damageType = $BulletDmgType36;
explosionRadius = 0.5;
kickBackStrength = 1.0;
muzzleVelocity = 40.0;
totalTime = 20.0;
liveTime = 21.0;
lightRange = 5.0;
lightColor = { 1.0, 0.7, 0.5 };
inheritedVelocityScale = 0.5;
seekingTurningRadius = 55.0;
nonSeekingTurningRadius = 50.0;
proximityDist = 1.5;
lightRange = 5.0;
lightColor = { 0.4, 0.4, 1.0 };
trailType = 2;
trailString = "plasmatrail.dts";
smokeDist = 2.5;
inheritedVelocityScale = 0.5;
soundId = SoundJetHeavy;
};
function TossedSpear::onAdd(%this)
{
%this.isAlive = true;
schedule("trackTossed(" @ %this @ ");", 0.1);
}
function TossedSpear::onremove(%this)
{
%this.isAlive = false;
}
function trackTossed(%this)
{
if(%this.isAlive == true)
{
if($spearPos[%this] == gamebase::getposition(%this))
{
%this.isAlive = false;
if(!$someoneSpeared)
{
%camera = newObject("Spear","StaticShape",StuckSpear,true);
addToSet("MissionCleanup", %camera);
%myrot = $spearRot[%this];
%mypos = $spearPos[%this];
GameBase::setRotation(%camera, %myrot);
GameBase::setPosition(%camera,%mypos);
schedule("GameBase::setposition(" @ %camera @ ",'0 0 -1000');", 360);
schedule("removeSpear(" @ %camera @ ");",300);
}
return;
}
$spearPos[%this] = gamebase::getposition(%this);
$spearRot[%this] = gamebase::getrotation(%this);
schedule("trackTossed(" @ %this @ ");", 0.1);
}
}
RocketData MiniSpearProj
{
bulletShapeName = "tracer.dts";
explosionTag = SpearExp;
collisionRadius = 0.0;
mass = 2.0;
damageClass = 0; // 0 impact, 1, radius
damageValue = 0.5;
damageType = $BulletDmgType36;
//type 35 = lance
explosionRadius = 2.1;
kickBackStrength = 10.0;
muzzleVelocity = 65.0;
terminalVelocity = 80.0;
acceleration = 5.0;
totalTime = 6.5;
liveTime = 8.0;
lightRange = 5.0;
lightColor = { 0.4, 0.4, 1.0 };
inheritedVelocityScale = 0.5;
// rocket specific
trailType = 2; // smoke trail
trailString = "breath.dts";
smokeDist = 0.5;
soundId = SoundJetHeavy;
};
function removeSpear(%this)
{
if(%this.isSpear == true)
deleteObject(%this);
}