Initial commit.

This commit is contained in:
Robert MacGregor 2012-07-27 17:22:05 -04:00
commit 9a05e8d86c
652 changed files with 154587 additions and 0 deletions

View file

@ -0,0 +1,356 @@
//--------------------------------------
// Draakan Flame "Breath" - Is CCM's flameThrower edited to suit the mod
//--------------------------------------
//color tent for EVERYTHING its red really red
//1 r
//0.18 g
//0.03 b
//--------------------------------------
// Trail
//--------------------------------------
datablock ParticleData(flameParticle)
{
dragCoeffiecient = 0.0;
gravityCoefficient = -0.1;
inheritedVelFactor = 0.1;
lifetimeMS = 500;
lifetimeVarianceMS = 50;
textureName = "ParticleTest";
spinRandomMin = -10.0;
spinRandomMax = 10.0;
colors[0] = "1 0.18 0.03 0.4";
colors[1] = "1 0.18 0.03 0.3";
colors[2] = "1 0.18 0.03 0.0";
sizes[0] = 2.0;
sizes[1] = 1.0;
sizes[2] = 0.8;
times[0] = 0.0;
times[1] = 0.6;
times[2] = 1.0;
};
datablock ParticleEmitterData(flameEmitter)
{
ejectionPeriodMS = 3;
periodVarianceMS = 0;
ejectionOffset = 0.2;
ejectionVelocity = 10.0;
velocityVariance = 0.0;
thetaMin = 0.0;
thetaMax = 10.0;
particles = "flameParticle";
};
//--------------------------------------------------------------------------
// Sounds
//--------------------------------------
//This will eventually be some "choking" sound
//datablock AudioProfile(FlamerDryFireSound)
//{
// filename = "fx/weapons/plasma_dryfire.wav";
// description = AudioClose3d;
// preload = true;
// effect = PlasmaDryFireEffect;
//};
//--------------------------------------------------------------------------
// Explosion
//--------------------------------------------------------------------------
datablock ParticleData(flameExplosionParticle)
{
dragCoefficient = 2;
gravityCoefficient = 0.2;
inheritedVelFactor = 0.2;
constantAcceleration = 0.0;
lifetimeMS = 500;
lifetimeVarianceMS = 0;
textureName = "ParticleTest";
colors[0] = "1 0.18 0.03 0.6";
colors[1] = "1 0.18 0.03 0.0";
sizes[0] = 2;
sizes[1] = 2.5;
};
datablock ParticleEmitterData(flameExplosionEmitter)
{
ejectionPeriodMS = 1;
periodVarianceMS = 0;
ejectionOffset = 2.0;
ejectionVelocity = 4.0;
velocityVariance = 0.0;
thetaMin = 60.0;
thetaMax = 90.0;
lifetimeMS = 250;
particles = "flameExplosionParticle";
};
datablock ExplosionData(flameBoltExplosion)
{
particleEmitter = flameExplosionEmitter;
particleDensity = 150;
particleRadius = 1.25;
faceViewer = true;
};
//--------------------------------------------------------------------------
// Projectiles
//--------------------------------------------------------------------------
datablock LinearFlareProjectileData(FlameboltMain)
{
projectileShapeName = "turret_muzzlepoint.dts";
scale = "1.0 1.0 1.0";
faceViewer = true;
directDamage = 0.1;
hasDamageRadius = true;
indirectDamage = 0.08;
damageRadius = 4.0;
kickBackStrength = 0.0;
radiusDamageType = $DamageType::Flame;
directDamageType = $DamageType::Flame;
explosion = "flameBoltExplosion";
splash = PlasmaSplash;
baseEmitter = FlameEmitter;
dryVelocity = 50.0; // z0dd - ZOD, 7/20/02. Faster plasma projectile. was 55
wetVelocity = -1;
velInheritFactor = 0.3;
fizzleTimeMS = 250;
lifetimeMS = 2000;
explodeOnDeath = false;
reflectOnWaterImpactAngle = 0.0;
explodeOnWaterImpact = true;
deflectionOnWaterImpact = 0.0;
fizzleUnderwaterMS = -1;
//activateDelayMS = 100;
activateDelayMS = -1;
size[0] = 0.2;
size[1] = 0.5;
size[2] = 0.1;
numFlares = 35;
flareColor = "1 0.18 0.03";
flareModTexture = "flaremod";
flareBaseTexture = "flarebase";
sound = PlasmaProjectileSound;
fireSound = PlasmaFireSound;
wetFireSound = PlasmaFireWetSound;
hasLight = true;
lightRadius = 10.0;
lightColor = "0.94 0.03 0.12";
};
//--------------------------------------------------------------------------
// Weapon
//--------------------------------------------------------------------------
datablock ItemData(flamer)
{
className = Weapon;
catagory = "Spawn Items";
shapeFile = "weapon_plasma.dts";
image = flamerImage;
mass = 1.0;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "you should not see this"; //Players should never be able to pick this up..
};
datablock ShapeBaseImageData(flamerImage)
{
className = WeaponImage;
shapeFile = "turret_muzzlepoint.dts";
mass = 10;
item = flamer;
offset = "-0.45 1 0.5"; // L/R - F/B - T/B
rotation = "0 1 0 180"; // L/R - F/B - T/B
// armThread = looknw; -- For some odd reason, this adds a little tiny white triangle next to the reticle
UsesEnergy = true;
MinEnergy = 1; //At least one point of energy to fire
fireEnergy = 5.5; //The Draakan Flame uses a fuck load of energy to keep the armor & body cool
HasTimeout = true;
TimeoutMS = 6000;
projectileSpread = 7.0 / 1000.0;
projectile = flameBoltmain;
projectileType = LinearFlareProjectile;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateSound[0] = PlasmaSwitchSound;
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateEmitterTime[2] = 10000;
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "CheckWet"; //Drakes can't use flames underwater. :)
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.05;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateScript[3] = "onFire";
stateEmitterTime[3] = 0.05;
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 0.05;
stateAllowImageChange[4] = false;
stateSequence[4] = "Reload";
stateSound[4] = PlasmaReloadSound;
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
stateName[6] = "DryFire";
stateSound[6] = PlasmaDryFireSound; //I should make this some 'choking' sound
stateTimeoutValue[6] = 1.0;
stateTransitionOnTimeout[6] = "NoAmmo";
stateName[7] = "WetFire";
stateSound[7] = PlasmaFireWetSound;
stateTimeoutValue[7] = 1.0;
stateTransitionOnTimeout[7] = "Ready";
stateName[8] = "CheckWet";
stateTransitionOnWet[8] = "WetFire";
stateTransitionOnNotWet[8] = "Fire";
};
//--------------------------------------------------------------------------
// Bound Functions
//--------------------------------------------------------------------------
function flamerImage::OnFire(%this,%obj,%slot)
{
%p = parent::onfire(%this,%obj,%slot);
}
function flamerImage::onMount(%this,%obj,%slot)
{
if (%obj.client.race !$= "Draakan") //If we're not a Drake
%obj.setInventory("Flamer",0,true);
else
Parent::onMount(%this,%obj,%slot);
}
function flamerImage::onUnmount(%this,%obj,%slot)
{
Parent::onUnmount(%this,%obj,%slot);
}
//--------------------------------------------------------------------------
// Functions
//--------------------------------------------------------------------------
function burnloop(%obj,%sourceObj, %DMG, %DmgTpe) //TODO: Organize this entire weapon file..
{
cancel(%obj.burnloop);
if(!isobject(%obj) || %obj.client.race $= "draakan" || %obj.getclassname() !$= "player" || !%obj.shouldburn)
{
%obj.isburning = false;
%obj.client.shouldscream = false; //Only applies to AI clients.
return;
}
if (%obj.client.shouldscream $="") //Used for bots..
%obj.client.shouldscream = true;
if (%obj.client.shouldscream)
{
%rnd = getrandom(0,1);
switch(%rnd)
{
case 0: schedule(250, %obj.client, "AIPlayAnimSound", %obj.client, "0 0 0", "vqk.help", $AIAnimWave, $AIAnimWave, 0);
case 1: schedule(250, %obj.client, "AIPlayAnimSound", %obj.client, "0 0 0", "gbl.shazbot", $AIAnimWave, $AIAnimWave, 0);
}
%obj.client.shouldscream = false;
}
%obj.damage(%sourceObj, %obj.getposition(), %DMG, %DmgTpe);
if (%obj.getstate() $="dead")
%fire = new ParticleEmissionDummy(){
position = vectoradd(%obj.getPosition(),"0 0 0.2");
dataBlock = "defaultEmissionDummy";
emitter = "FlameEmitter";
};
else
%fire = new ParticleEmissionDummy(){
position = vectoradd(%obj.getPosition(),"0 0 0.5");
dataBlock = "defaultEmissionDummy";
emitter = "FlameEmitter";
};
if (IsObject(%obj.client) && %obj.client.isaicontrolled())
%obj.client.setblinded(1);
if (%obj.burntime $="")
%obj.burntime = 0;
%time = %obj.burntime * 1000;
if (%time == $Host::BurnTime || %time > $Host::BurnTime)
{
%obj.burntime = 0;
Cancel(%obj.burnloop);
if (IsObject(%fire))
%fire.delete();
return;
}
else
{
%obj.burntime++;
}
MissionCleanup.add(%fire);
%fire.schedule(100, "delete");
%obj.burnloop = schedule(100, 0, "burnloop", %obj, %sourceObj.client, 0.007, %DmgTpe);
%obj.isburning = true;
}
function flamer::onadd(%this,%obj) //Move the object to 0 0 0 as soon as it's created - .delete likes to crash.
{
schedule(1,0,"delete",%obj);
}
function settransform(%obj,%trans)
{
%obj.settransform(%trans);
}
function delete(%obj)
{
%obj.delete();
}

204
scripts/weapons/ELFGun.cs Normal file
View file

@ -0,0 +1,204 @@
//--------------------------------------------------------------------------
// ELF Gun
//--------------------------------------------------------------------------
datablock EffectProfile(ELFGunSwitchEffect)
{
effectname = "weapons/generic_switch";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(ELFGunFireEffect)
{
effectname = "weapons/ELF_fire";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(ELFGunFireWetEffect)
{
effectname = "weapons/ELF_underwater";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock AudioProfile(ELFGunSwitchSound)
{
filename = "fx/weapons/generic_switch.wav";
description = AudioClosest3d;
preload = true;
effect = ELFGunSwitchEffect;
};
datablock AudioProfile(ELFGunFireSound)
{
filename = "fx/weapons/ELF_fire.wav";
description = CloseLooping3d;
preload = true;
effect = ELFGunFireEffect;
};
datablock AudioProfile(ElfFireWetSound)
{
filename = "fx/weapons/ELF_underwater.wav";
description = AudioClose3d;
preload = true;
};
datablock AudioProfile(ELFHitTargetSound)
{
filename = "fx/weapons/ELF_hit.wav";
description = CloseLooping3d;
preload = true;
effect = ELFGunFireEffect;
};
//--------------------------------------
// Sparks
//--------------------------------------
datablock ParticleData(ELFSparks)
{
dragCoefficient = 1;
gravityCoefficient = 0.0;
inheritedVelFactor = 0.2;
constantAcceleration = 0.0;
lifetimeMS = 200;
lifetimeVarianceMS = 0;
textureName = "special/blueSpark";
colors[0] = "0.8 0.8 1.0 1.0";
colors[1] = "0.8 0.8 1.0 1.0";
colors[2] = "0.8 0.8 1.0 0.0";
sizes[0] = 0.35;
sizes[1] = 0.15;
sizes[2] = 0.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(ELFSparksEmitter)
{
ejectionPeriodMS = 5;
periodVarianceMS = 0;
ejectionVelocity = 4;
velocityVariance = 2;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 180;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
orientParticles = true;
// lifetimeMS = 100;
particles = "ELFSparks";
};
//--------------------------------------
// Projectile
//--------------------------------------
datablock ELFProjectileData(BasicELF)
{
beamRange = 38; // z0dd - ZOD, 5/18/02. WHAT?? INCREASE ELF RANGE?!!? was 37
numControlPoints = 8;
restorativeFactor = 3.75;
dragFactor = 4.5;
endFactor = 2.25;
randForceFactor = 2;
randForceTime = 0.125;
drainEnergy = 1.0;
drainHealth = 0.0;
directDamageType = $DamageType::ELF;
mainBeamWidth = 0.1; // width of blue wave beam
mainBeamSpeed = 9.0; // speed that the beam travels forward
mainBeamRepeat = 0.25; // number of times the texture repeats
lightningWidth = 0.1;
lightningDist = 0.15; // distance of lightning from main beam
fireSound = ElfGunFireSound;
wetFireSound = ElfFireWetSound;
textures[0] = "special/ELFBeam";
textures[1] = "special/ELFLightning";
textures[2] = "special/BlueImpact";
emitter = ELFSparksEmitter;
};
//--------------------------------------
// Rifle and item...
//--------------------------------------
datablock ItemData(ELFGun)
{
className = Weapon;
catagory = "Spawn Items";
shapeFile = "weapon_elf.dts";
image = ELFGunImage;
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "an ELF gun";
computeCRC = true;
emap = true;
};
datablock ShapeBaseImageData(ELFGunImage)
{
className = WeaponImage;
shapeFile = "weapon_elf.dts";
item = ELFGun;
offset = "0 0 0";
projectile = BasicELF;
projectileType = ELFProjectile;
deleteLastProjectile = true;
emap = true;
usesEnergy = true;
minEnergy = 3;
stateName[0] = "Activate";
stateSequence[0] = "Activate";
stateSound[0] = ELFGunSwitchSound;
stateTimeoutValue[0] = 0.5;
stateTransitionOnTimeout[0] = "ActivateReady";
stateName[1] = "ActivateReady";
stateTransitionOnAmmo[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "CheckWet";
stateName[3] = "Fire";
stateEnergyDrain[3] = 5;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateScript[3] = "onFire";
stateTransitionOnTriggerUp[3] = "Deconstruction";
stateTransitionOnNoAmmo[3] = "Deconstruction";
//stateSound[3] = ElfFireWetSound;
stateName[4] = "NoAmmo";
stateTransitionOnAmmo[4] = "Ready";
stateName[5] = "Deconstruction";
stateScript[5] = "deconstruct";
stateTransitionOnTimeout[5] = "Ready";
stateTransitionOnNoAmmo[6] = "NoAmmo";
stateName[6] = "DryFire";
stateSound[6] = ElfFireWetSound;
stateTimeoutValue[6] = 0.5;
stateTransitionOnTimeout[6] = "Ready";
stateName[7] = "CheckWet";
stateTransitionOnWet[7] = "DryFire";
stateTransitionOnNotWet[7] = "Fire";
};

165
scripts/weapons/R700.cs Normal file
View file

@ -0,0 +1,165 @@
//--------------------------------------------------------------------------
// R700
//
//
//--------------------------------------------------------------------------
datablock AudioProfile(R700SwitchSound)
{
filename = "fx/weapons/sniper_activate.wav";
description = AudioClosest3d;
preload = true;
effect = SniperRifleSwitchEffect;
};
datablock AudioProfile(R700RifleFireSound)
{
filename = "fx/weapons/sniper_fire.wav";
description = AudioClose3d;
preload = true;
effect = SniperRifleFireEffect;
};
datablock AudioProfile(R700FireWetSound)
{
filename = "fx/weapons/sniper_underwater.wav";
description = AudioClose3d;
preload = true;
effect = SniperRifleFireWetEffect;
};
datablock AudioProfile(R700RifleDryFireSound)
{
filename = "fx/weapons/chaingun_dryfire.wav";
description = AudioClose3d;
preload = true;
};
datablock AudioProfile(R700RifleProjectileSound)
{
filename = "fx/weapons/sniper_miss.wav";
description = AudioClose3d;
preload = true;
};
//--------------------------------------
// Projectile
//--------------------------------------
datablock TracerProjectileData(R700Bullet)
{
doDynamicClientHits = true;
directDamage = 0.0842; // z0dd - ZOD, 9-27-02. Was 0.0825
directDamageType = $DamageType::Bullet;
explosion = "ChaingunExplosion";
splash = ChaingunSplash;
kickBackStrength = 0.0;
sound = ChaingunProjectile;
//dryVelocity = 425.0;
dryVelocity = 700.0; // z0dd - ZOD, 8-12-02. Was 425.0
wetVelocity = 100.0;
velInheritFactor = 1.0;
fizzleTimeMS = 3000;
lifetimeMS = 3000;
explodeOnDeath = false;
reflectOnWaterImpactAngle = 0.0;
explodeOnWaterImpact = false;
deflectionOnWaterImpact = 0.0;
fizzleUnderwaterMS = 3000;
tracerLength = 15.0;
tracerAlpha = false;
tracerMinPixels = 6;
tracerColor = 211.0/255.0 @ " " @ 215.0/255.0 @ " " @ 120.0/255.0 @ " 0.75";
tracerTex[0] = "special/tracer00";
tracerTex[1] = "special/tracercross";
tracerWidth = 0.10;
crossSize = 0.20;
crossViewAng = 0.990;
renderCross = true;
decalData[0] = ChaingunDecal1;
decalData[1] = ChaingunDecal2;
decalData[2] = ChaingunDecal3;
decalData[3] = ChaingunDecal4;
decalData[4] = ChaingunDecal5;
decalData[5] = ChaingunDecal6;
};
//--------------------------------------
// Rifle and item...
//--------------------------------------
datablock ItemData(R700)
{
className = Weapon;
catagory = "Spawn Items";
shapeFile = "weapon_sniper.dts";
image = R700Image;
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "an R700";
computeCRC = true;
};
datablock ShapeBaseImageData(R700Image)
{
className = WeaponImage;
shapeFile = "weapon_sniper.dts";
item = R700;
projectile = R700Bullet;
projectileType = TracerProjectile;
armThread = looksn;
usesEnergy = false;
minEnergy = 0;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateSound[0] = SniperRifleSwitchSound;
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "CheckWet";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.5;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateSequence[3] = "Fire";
stateScript[3] = "onFire";
stateName[4] = "Reload";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 0.5;
stateAllowImageChange[4] = false;
stateName[5] = "CheckWet";
stateTransitionOnWet[5] = "DryFire";
stateTransitionOnNotWet[5] = "Fire";
stateName[6] = "NoAmmo";
stateTransitionOnAmmo[6] = "Reload";
stateTransitionOnTriggerDown[6] = "DryFire";
stateSequence[6] = "NoAmmo";
stateName[7] = "DryFire";
stateSound[7] = SniperRifleDryFireSound;
stateTimeoutValue[7] = 0.5;
stateTransitionOnTimeout[7] = "Ready";
};

View file

@ -0,0 +1,193 @@
// ------------------------------------------------------------------
// Deployable camera script
//
// Cameras will occupy grenade slots vice backpack slots. The player
// will "throw" them like grenades, and they should stick to (and
// deploy on) interior surfaces and terrain.
// ------------------------------------------------------------------
$TeamDeployableMax[DeployedCamera] = 15;
// ------------------------------------------
// force-feedback effect datablocks
// ------------------------------------------
datablock EffectProfile(CameraGrenadeActivateEffect)
{
effectname = "weapons/grenade_camera_activate";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock EffectProfile(CameraGrenadeAttachEffect)
{
effectname = "weapons/grenade_camera_activate";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock EffectProfile(CameraGrenadeExplosionEffect)
{
effectname = "explosions/explosion.xpl10";
minDistance = 10;
maxDistance = 30;
};
// ------------------------------------------
// sound datablocks
// ------------------------------------------
datablock AudioProfile(CameraGrenadeActivateSound)
{
filename = "fx/weapons/grenade_camera_activate.wav";
description = AudioClosest3d;
preload = true;
effect = CameraGrenadeActivateEffect;
};
datablock AudioProfile(CameraGrenadeAttachSound)
{
filename = "fx/weapons/grenade_camera_attach.wav";
description = AudioClosest3d;
preload = true;
effect = CameraGrenadeAttachEffect;
};
datablock AudioProfile(CameraGrenadeExplosionSound)
{
filename = "fx/explosions/explosion.xpl10.wav";
description = AudioExplosion3d;
preload = true;
effect = CameraGrenadeExplosionEffect;
};
//--------------------------------------------------------------------------
// Camera explosion particle effects
//--------------------------------------------------------------------------
datablock ExplosionData(CameraGrenadeExplosion)
{
soundProfile = CameraGrenadeExplosionSound;
faceViewer = true;
explosionShape = "effect_plasma_explosion.dts";
playSpeed = 1.0;
sizes[0] = "0.2 0.2 0.2";
sizes[1] = "0.3 0.3 0.3";
};
// ------------------------------------------
// other datablocks
// ------------------------------------------
datablock ItemData(CameraGrenadeThrown)
{
shapeFile = "camera.dts";
mass = 0.7;
elasticity = 0.2;
friction = 1;
pickupRadius = 2;
maxDamage = 0.8;
sticky = true;
emap = true;
};
datablock ItemData(CameraGrenade)
{
className = HandInventory;
catagory = "Handheld";
shapeFile = "camera.dts";
mass = 0.7;
elasticity = 0.2;
friction = 1;
pickupRadius = 2;
thrownItem = CameraGrenadeThrown;
pickUpName = "a deployable camera";
computeCRC = true;
emap = true;
};
datablock SensorData(CameraSensorObject)
{
detects = true;
detectsUsingLOS = true;
detectionPings = false;
detectsPassiveJammed = true;
detectsActiveJammed = true; // z0dd - ZOD, 4/24/02. Was false
detectRadius = 40;
detectsFOVOnly = true;
useObjectFOV = true;
};
datablock TurretData(TurretDeployedCamera) : TurretDamageProfile
{
className = CameraTurret;
shapeFile = "camera.dts";
mass = 0.7;
maxDamage = 0.2;
destroyedLevel = 0.2;
disabledLevel = 0.2;
repairRate = 0;
explosion = CameraGrenadeExplosion;
thetaMin = 0;
thetaMax = 180;
//thetaNull = 90;
deployedObject = true;
isShielded = false;
energyPerDamagePoint = 40;
maxEnergy = 30;
renderWhenDestroyed = false;
rechargeRate = 0.05;
cameraDefaultFov = 90; // z0dd - ZOD, 4/24/02 Camera gren tweaks. was 150
cameraMinFov = 5; // z0dd - ZOD, 4/24/02. Camera gren tweaks. was 150
cameraMaxFov = 120; // z0dd - ZOD, 4/24/02. Camera gren tweaks. was 150
neverUpdateControl = false; // z0dd - ZOD, 4/24/02. Enable controllable camera view
canControl = true;
canObserve = false; // z0dd - ZOD, 4/24/02. Turned off 3rd person camera viewing.
observeThroughObject = true;
cmdCategory = "DSupport";
cmdIcon = CMDCameraIcon;
cmdMiniIconName = "commander/MiniIcons/com_camera_grey";
targetNameTag = 'Deployed';
targetTypeTag = 'Camera';
sensorData = CameraSensorObject;
sensorRadius = CameraSensorObject.detectRadius;
firstPersonOnly = true;
observeParameters = "0.5 4.5 4.5";
debrisShapeName = "debris_generic_small.dts";
debris = SmallShapeDebris;
};
datablock TurretImageData(DeployableCameraBarrel)
{
shapeFile = "turret_muzzlepoint.dts";
usesEnergy = false;
// Turret parameters
activationMS = 100;
deactivateDelayMS = 100;
thinkTimeMS = 100;
degPerSecTheta = 180;
degPerSecPhi = 360;
};
//------------------------------------------------------------------------------
// Functions:
//------------------------------------------------------------------------------
function CameraGrenadeThrown::onCollision( %data, %obj, %col )
{
// Do nothing...
}

676
scripts/weapons/chaingun.cs Normal file
View file

@ -0,0 +1,676 @@
//--------------------------------------
// Chaingun
//--------------------------------------
//--------------------------------------------------------------------------
// Force-Feedback Effects
//--------------------------------------
datablock EffectProfile(ChaingunSwitchEffect)
{
effectname = "weapons/chaingun_activate";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(ChaingunFireEffect)
{
effectname = "weapons/chaingun_fire";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(ChaingunSpinUpEffect)
{
effectname = "weapons/chaingun_spinup";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(ChaingunSpinDownEffect)
{
effectname = "weapons/chaingun_spindown";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(ChaingunDryFire)
{
effectname = "weapons/chaingun_dryfire";
minDistance = 2.5;
maxDistance = 2.5;
};
//--------------------------------------------------------------------------
// Sounds
//--------------------------------------
datablock AudioProfile(ChaingunSwitchSound)
{
filename = "fx/weapons/chaingun_activate.wav";
description = AudioClosest3d;
preload = true;
effect = ChaingunSwitchEffect;
};
datablock AudioProfile(ChaingunFireSound)
{
filename = "fx/weapons/chaingun_fire.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = ChaingunFireEffect;
};
datablock AudioProfile(ChaingunProjectile)
{
filename = "fx/weapons/chaingun_projectile.wav";
description = ProjectileLooping3d;
preload = true;
};
datablock AudioProfile(ChaingunImpact)
{
filename = "fx/weapons/chaingun_impact.WAV";
description = AudioClosest3d;
preload = true;
};
datablock AudioProfile(ChaingunSpinDownSound)
{
filename = "fx/weapons/chaingun_spindown.wav";
description = AudioClosest3d;
preload = true;
effect = ChaingunSpinDownEffect;
};
datablock AudioProfile(ChaingunSpinUpSound)
{
filename = "fx/weapons/chaingun_spinup.wav";
description = AudioClosest3d;
preload = true;
effect = ChaingunSpinUpEffect;
};
datablock AudioProfile(ChaingunDryFireSound)
{
filename = "fx/weapons/chaingun_dryfire.wav";
description = AudioClose3d;
preload = true;
effect = ChaingunDryFire;
};
datablock AudioProfile(ShrikeBlasterProjectileSound)
{
filename = "fx/vehicles/shrike_blaster_projectile.wav";
description = ProjectileLooping3d;
preload = true;
};
//--------------------------------------------------------------------------
// Splash
//--------------------------------------------------------------------------
datablock ParticleData( ChaingunSplashParticle )
{
dragCoefficient = 1;
gravityCoefficient = 0.0;
inheritedVelFactor = 0.2;
constantAcceleration = -1.4;
lifetimeMS = 300;
lifetimeVarianceMS = 0;
textureName = "special/droplet";
colors[0] = "0.7 0.8 1.0 1.0";
colors[1] = "0.7 0.8 1.0 0.5";
colors[2] = "0.7 0.8 1.0 0.0";
sizes[0] = 0.05;
sizes[1] = 0.2;
sizes[2] = 0.2;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData( ChaingunSplashEmitter )
{
ejectionPeriodMS = 4;
periodVarianceMS = 0;
ejectionVelocity = 3;
velocityVariance = 1.0;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 50;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
orientParticles = true;
lifetimeMS = 100;
particles = "ChaingunSplashParticle";
};
datablock SplashData(ChaingunSplash)
{
numSegments = 10;
ejectionFreq = 10;
ejectionAngle = 20;
ringLifetime = 0.4;
lifetimeMS = 400;
velocity = 3.0;
startRadius = 0.0;
acceleration = -3.0;
texWrap = 5.0;
texture = "special/water2";
emitter[0] = ChaingunSplashEmitter;
colors[0] = "0.7 0.8 1.0 0.0";
colors[1] = "0.7 0.8 1.0 1.0";
colors[2] = "0.7 0.8 1.0 0.0";
colors[3] = "0.7 0.8 1.0 0.0";
times[0] = 0.0;
times[1] = 0.4;
times[2] = 0.8;
times[3] = 1.0;
};
//--------------------------------------------------------------------------
// Particle Effects
//--------------------------------------
datablock ParticleData(ChaingunFireParticle)
{
dragCoefficient = 2.75;
gravityCoefficient = 0.1;
inheritedVelFactor = 0.0;
constantAcceleration = 0.0;
lifetimeMS = 550;
lifetimeVarianceMS = 0;
textureName = "particleTest";
colors[0] = "0.46 0.36 0.26 1.0";
colors[1] = "0.46 0.36 0.26 0.0";
sizes[0] = 0.25;
sizes[1] = 0.20;
};
datablock ParticleEmitterData(ChaingunFireEmitter)
{
ejectionPeriodMS = 6;
periodVarianceMS = 0;
ejectionVelocity = 10;
velocityVariance = 1.0;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 12;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvance = true;
particles = "ChaingunFireParticle";
};
//--------------------------------------------------------------------------
// Explosions
//--------------------------------------
datablock ParticleData(ChaingunExplosionParticle1)
{
dragCoefficient = 0.65;
gravityCoefficient = 0.3;
inheritedVelFactor = 0.0;
constantAcceleration = 0.0;
lifetimeMS = 500;
lifetimeVarianceMS = 150;
textureName = "particleTest";
colors[0] = "0.56 0.36 0.26 1.0";
colors[1] = "0.56 0.36 0.26 0.0";
sizes[0] = 0.0625;
sizes[1] = 0.2;
};
datablock ParticleEmitterData(ChaingunExplosionEmitter)
{
ejectionPeriodMS = 10;
periodVarianceMS = 0;
ejectionVelocity = 0.75;
velocityVariance = 0.25;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 60;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
particles = "ChaingunExplosionParticle1";
};
datablock ParticleData(ChaingunImpactSmokeParticle)
{
dragCoefficient = 0.0;
gravityCoefficient = -0.2;
inheritedVelFactor = 0.0;
constantAcceleration = 0.0;
lifetimeMS = 1000;
lifetimeVarianceMS = 200;
useInvAlpha = true;
spinRandomMin = -90.0;
spinRandomMax = 90.0;
textureName = "particleTest";
colors[0] = "0.7 0.7 0.7 0.0";
colors[1] = "0.7 0.7 0.7 0.4";
colors[2] = "0.7 0.7 0.7 0.0";
sizes[0] = 0.5;
sizes[1] = 0.5;
sizes[2] = 1.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(ChaingunImpactSmoke)
{
ejectionPeriodMS = 8;
periodVarianceMS = 1;
ejectionVelocity = 1.0;
velocityVariance = 0.5;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 35;
overrideAdvances = false;
particles = "ChaingunImpactSmokeParticle";
lifetimeMS = 50;
};
datablock ParticleData(ChaingunSparks)
{
dragCoefficient = 1;
gravityCoefficient = 0.0;
inheritedVelFactor = 0.2;
constantAcceleration = 0.0;
lifetimeMS = 300;
lifetimeVarianceMS = 0;
textureName = "special/spark00";
colors[0] = "0.56 0.36 0.26 1.0";
colors[1] = "0.56 0.36 0.26 1.0";
colors[2] = "1.0 0.36 0.26 0.0";
sizes[0] = 0.6;
sizes[1] = 0.2;
sizes[2] = 0.05;
times[0] = 0.0;
times[1] = 0.2;
times[2] = 1.0;
};
datablock ParticleEmitterData(ChaingunSparkEmitter)
{
ejectionPeriodMS = 4;
periodVarianceMS = 0;
ejectionVelocity = 4;
velocityVariance = 2.0;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 50;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
orientParticles = true;
lifetimeMS = 100;
particles = "ChaingunSparks";
};
datablock ExplosionData(ChaingunExplosion)
{
soundProfile = ChaingunImpact;
emitter[0] = ChaingunImpactSmoke;
emitter[1] = ChaingunSparkEmitter;
faceViewer = false;
};
datablock ShockwaveData(ScoutChaingunHit)
{
width = 0.5;
numSegments = 13;
numVertSegments = 1;
velocity = 0.5;
acceleration = 2.0;
lifetimeMS = 900;
height = 0.1;
verticalCurve = 0.5;
mapToTerrain = false;
renderBottom = false;
orientToNormal = true;
texture[0] = "special/shockwave5";
texture[1] = "special/gradient";
texWrap = 3.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
colors[0] = "0.6 0.6 1.0 1.0";
colors[1] = "0.6 0.3 1.0 0.5";
colors[2] = "0.0 0.0 1.0 0.0";
};
datablock ParticleData(ScoutChaingunExplosionParticle1)
{
dragCoefficient = 2;
gravityCoefficient = 0.0;
inheritedVelFactor = 0.2;
constantAcceleration = -0.0;
lifetimeMS = 600;
lifetimeVarianceMS = 000;
textureName = "special/crescent4";
colors[0] = "0.6 0.6 1.0 1.0";
colors[1] = "0.6 0.3 1.0 1.0";
colors[2] = "0.0 0.0 1.0 0.0";
sizes[0] = 0.25;
sizes[1] = 0.5;
sizes[2] = 1.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(ScoutChaingunExplosionEmitter)
{
ejectionPeriodMS = 10;
periodVarianceMS = 0;
ejectionVelocity = 2;
velocityVariance = 1.5;
ejectionOffset = 0.0;
thetaMin = 80;
thetaMax = 90;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
orientParticles = true;
lifetimeMS = 200;
particles = "ScoutChaingunExplosionParticle1";
};
datablock ExplosionData(ScoutChaingunExplosion)
{
soundProfile = blasterExpSound;
shockwave = ScoutChaingunHit;
emitter[0] = ScoutChaingunExplosionEmitter;
};
//--------------------------------------------------------------------------
// Particle effects
//--------------------------------------
datablock DebrisData( ShellDebris )
{
shapeName = "weapon_chaingun_ammocasing.dts";
lifetime = 3.0;
minSpinSpeed = 300.0;
maxSpinSpeed = 400.0;
elasticity = 0.5;
friction = 0.2;
numBounces = 3;
fade = true;
staticOnMaxBounce = true;
snapOnMaxBounce = true;
};
//--------------------------------------------------------------------------
// Projectile
//--------------------------------------
datablock DecalData(ChaingunDecal1)
{
sizeX = 0.05;
sizeY = 0.05;
textureName = "special/bullethole1";
};
datablock DecalData(ChaingunDecal2) : ChaingunDecal1
{
textureName = "special/bullethole2";
};
datablock DecalData(ChaingunDecal3) : ChaingunDecal1
{
textureName = "special/bullethole3";
};
datablock DecalData(ChaingunDecal4) : ChaingunDecal1
{
textureName = "special/bullethole4";
};
datablock DecalData(ChaingunDecal5) : ChaingunDecal1
{
textureName = "special/bullethole5";
};
datablock DecalData(ChaingunDecal6) : ChaingunDecal1
{
textureName = "special/bullethole6";
};
datablock TracerProjectileData(ChaingunBullet)
{
doDynamicClientHits = true;
directDamage = 0.0842; // z0dd - ZOD, 9-27-02. Was 0.0825
directDamageType = $DamageType::Bullet;
explosion = "ChaingunExplosion";
splash = ChaingunSplash;
kickBackStrength = 0.0;
sound = ChaingunProjectile;
//dryVelocity = 425.0;
dryVelocity = 700.0; // z0dd - ZOD, 8-12-02. Was 425.0
wetVelocity = 100.0;
velInheritFactor = 1.0;
fizzleTimeMS = 3000;
lifetimeMS = 3000;
explodeOnDeath = false;
reflectOnWaterImpactAngle = 0.0;
explodeOnWaterImpact = false;
deflectionOnWaterImpact = 0.0;
fizzleUnderwaterMS = 3000;
tracerLength = 15.0;
tracerAlpha = false;
tracerMinPixels = 6;
tracerColor = 211.0/255.0 @ " " @ 215.0/255.0 @ " " @ 120.0/255.0 @ " 0.75";
tracerTex[0] = "special/tracer00";
tracerTex[1] = "special/tracercross";
tracerWidth = 0.10;
crossSize = 0.20;
crossViewAng = 0.990;
renderCross = true;
decalData[0] = ChaingunDecal1;
decalData[1] = ChaingunDecal2;
decalData[2] = ChaingunDecal3;
decalData[3] = ChaingunDecal4;
decalData[4] = ChaingunDecal5;
decalData[5] = ChaingunDecal6;
};
//--------------------------------------------------------------------------
// Scout Projectile
//--------------------------------------
datablock TracerProjectileData(ScoutChaingunBullet)
{
doDynamicClientHits = true;
directDamage = 0.125;
explosion = "ScoutChaingunExplosion";
splash = ChaingunSplash;
directDamageType = $DamageType::ShrikeBlaster;
kickBackStrength = 0.0;
sound = ShrikeBlasterProjectileSound;
dryVelocity = 425.0;
wetVelocity = 100.0;
velInheritFactor = 1.0;
fizzleTimeMS = 1000;
lifetimeMS = 1000;
explodeOnDeath = false;
reflectOnWaterImpactAngle = 0.0;
explodeOnWaterImpact = false;
deflectionOnWaterImpact = 0.0;
fizzleUnderwaterMS = 3000;
tracerLength = 45.0;
tracerAlpha = false;
tracerMinPixels = 6;
tracerColor = "1.0 1.0 1.0 1.0";
tracerTex[0] = "special/shrikeBolt";
tracerTex[1] = "special/shrikeBoltCross";
tracerWidth = 0.55;
crossSize = 0.99;
crossViewAng = 0.990;
renderCross = true;
};
//--------------------------------------------------------------------------
// Ammo
//--------------------------------------
datablock ItemData(ChaingunAmmo)
{
className = Ammo;
catagory = "Ammo";
shapeFile = "ammo_chaingun.dts";
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "some chaingun ammo";
computeCRC = true;
};
//--------------------------------------------------------------------------
// Weapon
//--------------------------------------
datablock ShapeBaseImageData(ChaingunImage)
{
className = WeaponImage;
shapeFile = "weapon_chaingun.dts";
item = Chaingun;
ammo = ChaingunAmmo;
projectile = ChaingunBullet;
projectileType = TracerProjectile;
emap = true;
casing = ShellDebris;
shellExitDir = "1.0 0.3 1.0";
shellExitOffset = "0.15 -0.56 -0.1";
shellExitVariance = 15.0;
shellVelocity = 3.0;
projectileSpread = 7.0 / 1000.0; // z0dd - ZOD, 8/6/02. Was: 8.0 / 1000.0
//--------------------------------------
stateName[0] = "Activate";
stateSequence[0] = "Activate";
stateSound[0] = ChaingunSwitchSound;
stateAllowImageChange[0] = false;
//
stateTimeoutValue[0] = 0.5;
stateTransitionOnTimeout[0] = "Ready";
stateTransitionOnNoAmmo[0] = "NoAmmo";
//--------------------------------------
stateName[1] = "Ready";
stateSpinThread[1] = Stop;
//
stateTransitionOnTriggerDown[1] = "Spinup";
stateTransitionOnNoAmmo[1] = "NoAmmo";
//--------------------------------------
stateName[2] = "NoAmmo";
stateTransitionOnAmmo[2] = "Ready";
stateSpinThread[2] = Stop;
stateTransitionOnTriggerDown[2] = "DryFire";
//--------------------------------------
stateName[3] = "Spinup";
stateSpinThread[3] = SpinUp;
stateSound[3] = ChaingunSpinupSound;
//
stateTimeoutValue[3] = 0.5;
stateWaitForTimeout[3] = false;
stateTransitionOnTimeout[3] = "Fire";
stateTransitionOnTriggerUp[3] = "Spindown";
//--------------------------------------
stateName[4] = "Fire";
stateSequence[4] = "Fire";
stateSequenceRandomFlash[4] = true;
stateSpinThread[4] = FullSpeed;
stateSound[4] = ChaingunFireSound;
//stateRecoil[4] = LightRecoil;
stateAllowImageChange[4] = false;
stateScript[4] = "onFire";
stateFire[4] = true;
stateEjectShell[4] = true;
//
stateTimeoutValue[4] = 0.15;
stateTransitionOnTimeout[4] = "Fire";
stateTransitionOnTriggerUp[4] = "Spindown";
stateTransitionOnNoAmmo[4] = "EmptySpindown";
//--------------------------------------
stateName[5] = "Spindown";
stateSound[5] = ChaingunSpinDownSound;
stateSpinThread[5] = SpinDown;
//
stateTimeoutValue[5] = 1.0;
stateWaitForTimeout[5] = true;
stateTransitionOnTimeout[5] = "Ready";
stateTransitionOnTriggerDown[5] = "Spinup";
//--------------------------------------
stateName[6] = "EmptySpindown";
stateSound[6] = ChaingunSpinDownSound;
stateSpinThread[6] = SpinDown;
//
stateTimeoutValue[6] = 0.5;
stateTransitionOnTimeout[6] = "NoAmmo";
//--------------------------------------
stateName[7] = "DryFire";
stateSound[7] = ChaingunDryFireSound;
stateTimeoutValue[7] = 0.5;
stateTransitionOnTimeout[7] = "NoAmmo";
};
datablock ItemData(Chaingun)
{
className = Weapon;
catagory = "Spawn Items";
shapeFile = "weapon_chaingun.dts";
image = ChaingunImage;
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "a chaingun";
computeCRC = true;
emap = true;
};

483
scripts/weapons/disc.cs Normal file
View file

@ -0,0 +1,483 @@
//--------------------------------------
// Disc launcher
//--------------------------------------
//--------------------------------------------------------------------------
// Force-Feedback Effects
//--------------------------------------
datablock EffectProfile(DiscFireEffect)
{
effectname = "weapons/spinfusor_fire";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(DiscSwitchEffect)
{
effectname = "weapons/spinfusor_activate";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(DiscDryFireEffect)
{
effectname = "weapons/spinfusor_dryfire";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(DiscIdleEffect)
{
effectname = "weapons/spinfusor_idle";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(DiscReloadEffect)
{
effectname = "weapons/spinfusor_reload";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(DiscExpEffect)
{
effectname = "explosions/grenade_explode";
minDistance = 5;
maxDistance = 20;
};
//--------------------------------------------------------------------------
// Sounds
//--------------------------------------
datablock AudioProfile(DiscSwitchSound)
{
filename = "fx/weapons/blaster_activate.wav";
description = AudioClosest3d;
preload = true;
effect = DiscSwitchEffect;
};
datablock AudioProfile(DiscLoopSound)
{
filename = "fx/weapons/spinfusor_idle.wav";
description = ClosestLooping3d;
effect = DiscIdleEffect;
};
datablock AudioProfile(DiscFireSound)
{
filename = "fx/weapons/spinfusor_fire.wav";
description = AudioDefault3d;
preload = true;
effect = DiscFireEffect;
};
datablock AudioProfile(DiscReloadSound)
{
filename = "fx/weapons/spinfusor_reload.wav";
description = AudioClosest3d;
preload = true;
effect = DiscReloadEffect;
};
datablock AudioProfile(discExpSound)
{
filename = "fx/weapons/spinfusor_impact.wav";
description = AudioExplosion3d;
preload = true;
effect = DiscExpEffect;
};
datablock AudioProfile(underwaterDiscExpSound)
{
filename = "fx/weapons/spinfusor_impact_UW.wav";
description = AudioExplosion3d;
preload = true;
effect = DiscExpEffect;
};
datablock AudioProfile(discProjectileSound)
{
filename = "fx/weapons/spinfusor_projectile.wav";
description = ProjectileLooping3d;
preload = true;
};
datablock AudioProfile(DiscDryFireSound)
{
filename = "fx/weapons/spinfusor_dryfire.wav";
description = AudioClose3d;
preload = true;
effect = DiscDryFireEffect;
};
//--------------------------------------------------------------------------
// Explosion
//--------------------------------------
datablock ParticleData(DiscExplosionBubbleParticle)
{
dragCoefficient = 0.0;
gravityCoefficient = -0.25;
inheritedVelFactor = 0.0;
constantAcceleration = 0.0;
lifetimeMS = 2000;
lifetimeVarianceMS = 750;
useInvAlpha = false;
textureName = "special/bubbles";
spinRandomMin = -100.0;
spinRandomMax = 100.0;
colors[0] = "0.7 0.8 1.0 0.0";
colors[1] = "0.7 0.8 1.0 0.4";
colors[2] = "0.7 0.8 1.0 0.0";
sizes[0] = 1.0;
sizes[1] = 1.0;
sizes[2] = 1.0;
times[0] = 0.0;
times[1] = 0.3;
times[2] = 1.0;
};
datablock ParticleEmitterData(DiscExplosionBubbleEmitter)
{
ejectionPeriodMS = 7;
periodVarianceMS = 0;
ejectionVelocity = 1.0;
ejectionOffset = 3.0;
velocityVariance = 0.5;
thetaMin = 0;
thetaMax = 80;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
particles = "DiscExplosionBubbleParticle";
};
datablock ExplosionData(UnderwaterDiscExplosion)
{
explosionShape = "disc_explosion.dts";
soundProfile = underwaterDiscExpSound;
faceViewer = true;
sizes[0] = "1.3 1.3 1.3";
sizes[1] = "0.75 0.75 0.75";
sizes[2] = "0.4 0.4 0.4";
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
emitter[0] = "DiscExplosionBubbleEmitter";
shakeCamera = true;
camShakeFreq = "10.0 11.0 10.0";
camShakeAmp = "20.0 20.0 20.0";
camShakeDuration = 0.5;
camShakeRadius = 10.0;
};
datablock ExplosionData(DiscExplosion)
{
explosionShape = "disc_explosion.dts";
soundProfile = discExpSound;
faceViewer = true;
explosionScale = "1 1 1";
shakeCamera = true;
camShakeFreq = "10.0 11.0 10.0";
camShakeAmp = "20.0 20.0 20.0";
camShakeDuration = 0.5;
camShakeRadius = 10.0;
sizes[0] = "1.0 1.0 1.0";
sizes[1] = "1.0 1.0 1.0";
times[0] = 0.0;
times[1] = 1.0;
};
//--------------------------------------------------------------------------
// Splash
//--------------------------------------------------------------------------
datablock ParticleData(DiscMist)
{
dragCoefficient = 2.0;
gravityCoefficient = -0.05;
inheritedVelFactor = 0.0;
constantAcceleration = 0.0;
lifetimeMS = 400;
lifetimeVarianceMS = 100;
useInvAlpha = false;
spinRandomMin = -90.0;
spinRandomMax = 500.0;
textureName = "particleTest";
colors[0] = "0.7 0.8 1.0 1.0";
colors[1] = "0.7 0.8 1.0 0.5";
colors[2] = "0.7 0.8 1.0 0.0";
sizes[0] = 0.5;
sizes[1] = 0.5;
sizes[2] = 0.8;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(DiscMistEmitter)
{
ejectionPeriodMS = 5;
periodVarianceMS = 0;
ejectionVelocity = 3.0;
velocityVariance = 2.0;
ejectionOffset = 0.0;
thetaMin = 85;
thetaMax = 85;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
lifetimeMS = 250;
particles = "DiscMist";
};
datablock ParticleData( DiscSplashParticle2 )
{
dragCoeffiecient = 0.4;
gravityCoefficient = -0.03; // rises slowly
inheritedVelFactor = 0.025;
lifetimeMS = 600;
lifetimeVarianceMS = 300;
textureName = "particleTest";
useInvAlpha = false;
spinRandomMin = -200.0;
spinRandomMax = 200.0;
colors[0] = "0.7 0.8 1.0 1.0";
colors[1] = "0.7 0.8 1.0 0.5";
colors[2] = "0.7 0.8 1.0 0.0";
sizes[0] = 0.5;
sizes[1] = 1.0;
sizes[2] = 2.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData( DiscSplashEmitter2 )
{
ejectionPeriodMS = 25;
ejectionOffset = 0.2;
periodVarianceMS = 0;
ejectionVelocity = 2.25;
velocityVariance = 0.50;
thetaMin = 0.0;
thetaMax = 30.0;
lifetimeMS = 250;
particles = "DiscSplashParticle2";
};
datablock ParticleData( DiscSplashParticle )
{
dragCoefficient = 1;
gravityCoefficient = 0.2;
inheritedVelFactor = 0.2;
constantAcceleration = -0.0;
lifetimeMS = 600;
lifetimeVarianceMS = 0;
textureName = "special/droplet";
colors[0] = "0.7 0.8 1.0 1.0";
colors[1] = "0.7 0.8 1.0 0.5";
colors[2] = "0.7 0.8 1.0 0.0";
sizes[0] = 0.5;
sizes[1] = 0.5;
sizes[2] = 0.5;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData( DiscSplashEmitter )
{
ejectionPeriodMS = 1;
periodVarianceMS = 0;
ejectionVelocity = 3;
velocityVariance = 1.0;
ejectionOffset = 0.0;
thetaMin = 60;
thetaMax = 80;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
orientParticles = true;
lifetimeMS = 100;
particles = "DiscSplashParticle";
};
datablock SplashData(DiscSplash)
{
numSegments = 15;
ejectionFreq = 0.0001;
ejectionAngle = 45;
ringLifetime = 0.5;
lifetimeMS = 400;
velocity = 5.0;
startRadius = 0.0;
acceleration = -3.0;
texWrap = 5.0;
texture = "special/water2";
emitter[0] = DiscSplashEmitter;
emitter[1] = DiscMistEmitter;
colors[0] = "0.7 0.8 1.0 0.0";
colors[1] = "0.7 0.8 1.0 1.0";
colors[2] = "0.7 0.8 1.0 0.0";
colors[3] = "0.7 0.8 1.0 0.0";
times[0] = 0.0;
times[1] = 0.4;
times[2] = 0.8;
times[3] = 1.0;
};
//--------------------------------------------------------------------------
// Projectile
//--------------------------------------
datablock LinearProjectileData(DiscProjectile)
{
projectileShapeName = "disc.dts";
emitterDelay = -1;
directDamage = 0.0;
hasDamageRadius = true;
indirectDamage = 0.50;
damageRadius = 7.5;
radiusDamageType = $DamageType::Disc;
kickBackStrength = 2000; // z0dd - ZOD, 4/24/02. Was 1750
sound = discProjectileSound;
explosion = "DiscExplosion";
underwaterExplosion = "UnderwaterDiscExplosion";
splash = DiscSplash;
dryVelocity = 95; // z0dd - ZOD, 3/30/02. Slight disc speed up. was 90
wetVelocity = 55; // z0dd - ZOD, 3/30/02. Slight disc speed up. was 50
velInheritFactor = 0.75; // z0dd - ZOD, 3/30/02. was 0.5
fizzleTimeMS = 5000;
lifetimeMS = 5000;
explodeOnDeath = true;
reflectOnWaterImpactAngle = 15.0;
explodeOnWaterImpact = true;
deflectionOnWaterImpact = 20.0; // z0dd - ZOD, 4/24/02. Was 0.0. 20 degrees skips off water
fizzleUnderwaterMS = 5000;
activateDelayMS = 200;
hasLight = true;
lightRadius = 6.0;
lightColor = "0.175 0.175 0.5";
};
//--------------------------------------------------------------------------
// Ammo
//--------------------------------------
datablock ItemData(DiscAmmo)
{
className = Ammo;
catagory = "Ammo";
shapeFile = "ammo_disc.dts";
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "some spinfusor discs";
};
//--------------------------------------------------------------------------
// Weapon
//--------------------------------------
datablock ShapeBaseImageData(DiscImage)
{
className = WeaponImage;
shapeFile = "weapon_disc.dts";
item = Disc;
ammo = DiscAmmo;
offset = "0 0 0";
emap = true;
//projectileSpread = 1.0 / 1000.0; // z0dd - ZOD, 4/14/02. No disc spread.
projectile = DiscProjectile;
projectileType = LinearProjectile;
// State Data
stateName[0] = "Preactivate";
stateTransitionOnLoaded[0] = "Activate";
stateTransitionOnNoAmmo[0] = "NoAmmo";
stateName[1] = "Activate";
stateTransitionOnTimeout[1] = "Ready";
stateTimeoutValue[1] = 0.5;
stateSequence[1] = "Activated";
stateSound[1] = DiscSwitchSound;
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "Fire";
stateSequence[2] = "DiscSpin";
stateSound[2] = DiscLoopSound;
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 1.25;
stateFire[3] = true;
stateRecoil[3] = LightRecoil;
stateAllowImageChange[3] = false;
stateSequence[3] = "Fire";
stateScript[3] = "onFire";
stateSound[3] = DiscFireSound;
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 0.5; // 0.25 load, 0.25 spinup
stateAllowImageChange[4] = false;
stateSequence[4] = "Reload";
stateSound[4] = DiscReloadSound;
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
stateName[6] = "DryFire";
stateSound[6] = DiscDryFireSound;
stateTimeoutValue[6] = 1.0;
stateTransitionOnTimeout[6] = "NoAmmo";
};
datablock ItemData(Disc)
{
className = Weapon;
catagory = "Spawn Items";
shapeFile = "weapon_disc.dts";
image = DiscImage;
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "a spinfusor";
emap = true;
};

View file

@ -0,0 +1,69 @@
// grenade (thrown by hand) script
// ------------------------------------------------------------------------
datablock EffectProfile(FlashGrenadeExplosionEffect)
{
effectname = "explosions/grenade_flash_explode";
minDistance = 10;
maxDistance = 30;
};
datablock AudioProfile(FlashGrenadeExplosionSound)
{
filename = "fx/explosions/grenade_flash_explode.wav";
description = AudioExplosion3d;
preload = true;
effect = FlashGrenadeExplosionEffect;
};
datablock ExplosionData(FlashGrenadeExplosion)
{
explosionShape = "disc_explosion.dts";
soundProfile = FlashGrenadeExplosionSound;
faceViewer = true;
};
datablock ItemData(FlashGrenadeThrown)
{
shapeFile = "grenade.dts";
mass = 0.7;
elasticity = 0.2;
friction = 1;
pickupRadius = 2;
maxDamage = 0.4;
explosion = FlashGrenadeExplosion;
indirectDamage = 0.5;
damageRadius = 10.0;
radiusDamageType = $DamageType::Grenade;
kickBackStrength = 1000;
computeCRC = true;
maxWhiteout = 0.9; // z0dd - ZOD, 9/8/02. Was 1.2
};
datablock ItemData(FlashGrenade)
{
className = HandInventory;
catagory = "Handheld";
shapeFile = "grenade.dts";
mass = 0.7;
elasticity = 0.2;
friction = 1;
pickupRadius = 2;
thrownItem = FlashGrenadeThrown;
pickUpName = "some flash grenades";
isGrenade = true;
computeCRC = true;
};
//--------------------------------------------------------------------------
// Functions:
//--------------------------------------------------------------------------
function FlashGrenadeThrown::onCollision( %data, %obj, %col )
{
// Do nothing...
}

View file

@ -0,0 +1,787 @@
//--------------------------------------
// Grenade launcher
//--------------------------------------
//--------------------------------------------------------------------------
// Force-Feedback Effects
//--------------------------------------
datablock EffectProfile(GrenadeSwitchEffect)
{
effectname = "weapons/generic_switch";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(GrenadeFireEffect)
{
effectname = "weapons/grenadelauncher_fire";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(GrenadeDryFireEffect)
{
effectname = "weapons/grenadelauncher_dryfire";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(GrenadeReloadEffect)
{
effectname = "weapons/generic_switch";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(GrenadeExplosionEffect)
{
effectname = "explosions/grenade_explode";
minDistance = 10;
maxDistance = 35;
};
//--------------------------------------------------------------------------
// Sounds
//--------------------------------------
datablock AudioProfile(GrenadeSwitchSound)
{
filename = "fx/weapons/generic_switch.wav";
description = AudioClosest3d;
preload = true;
effect = GrenadeSwitchEffect;
};
datablock AudioProfile(GrenadeFireSound)
{
filename = "fx/weapons/grenadelauncher_fire.wav";
description = AudioDefault3d;
preload = true;
effect = GrenadeFireEffect;
};
datablock AudioProfile(GrenadeProjectileSound)
{
filename = "fx/weapons/grenadelauncher_projectile.wav";
description = ProjectileLooping3d;
preload = true;
};
datablock AudioProfile(GrenadeReloadSound)
{
filename = "fx/weapons/generic_switch.wav";
description = AudioClosest3d;
preload = true;
effect = GrenadeReloadEffect;
};
datablock AudioProfile(GrenadeExplosionSound)
{
filename = "fx/weapons/grenade_explode.wav";
description = AudioExplosion3d;
preload = true;
effect = GrenadeExplosionEffect;
};
datablock AudioProfile(UnderwaterGrenadeExplosionSound)
{
filename = "fx/weapons/grenade_explode_UW.wav";
description = AudioExplosion3d;
preload = true;
effect = GrenadeExplosionEffect;
};
datablock AudioProfile(GrenadeDryFireSound)
{
filename = "fx/weapons/grenadelauncher_dryfire.wav";
description = AudioClose3d;
preload = true;
effect = GrenadeDryFireEffect;
};
//----------------------------------------------------------------------------
// Underwater fx
//----------------------------------------------------------------------------
datablock ParticleData(GrenadeExplosionBubbleParticle)
{
dragCoefficient = 0.0;
gravityCoefficient = -0.25;
inheritedVelFactor = 0.0;
constantAcceleration = 0.0;
lifetimeMS = 1500;
lifetimeVarianceMS = 600;
useInvAlpha = false;
textureName = "special/bubbles";
spinRandomMin = -100.0;
spinRandomMax = 100.0;
colors[0] = "0.7 0.8 1.0 0.0";
colors[1] = "0.7 0.8 1.0 0.4";
colors[2] = "0.7 0.8 1.0 0.0";
sizes[0] = 1.0;
sizes[1] = 1.0;
sizes[2] = 1.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(GrenadeExplosionBubbleEmitter)
{
ejectionPeriodMS = 5;
periodVarianceMS = 0;
ejectionVelocity = 1.0;
ejectionOffset = 3.0;
velocityVariance = 0.5;
thetaMin = 0;
thetaMax = 80;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
particles = "GrenadeExplosionBubbleParticle";
};
datablock ParticleData(UnderwaterGrenadeDust)
{
dragCoefficient = 1.0;
gravityCoefficient = -0.01;
inheritedVelFactor = 0.0;
constantAcceleration = -1.1;
lifetimeMS = 1000;
lifetimeVarianceMS = 100;
useInvAlpha = false;
spinRandomMin = -90.0;
spinRandomMax = 500.0;
textureName = "particleTest";
colors[0] = "0.6 0.6 1.0 0.5";
colors[1] = "0.6 0.6 1.0 0.5";
colors[2] = "0.6 0.6 1.0 0.0";
sizes[0] = 3.0;
sizes[1] = 3.0;
sizes[2] = 3.0;
times[0] = 0.0;
times[1] = 0.7;
times[2] = 1.0;
};
datablock ParticleEmitterData(UnderwaterGrenadeDustEmitter)
{
ejectionPeriodMS = 15;
periodVarianceMS = 0;
ejectionVelocity = 15.0;
velocityVariance = 0.0;
ejectionOffset = 0.0;
thetaMin = 70;
thetaMax = 70;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
lifetimeMS = 250;
particles = "UnderwaterGrenadeDust";
};
datablock ParticleData(UnderwaterGrenadeExplosionSmoke)
{
dragCoeffiecient = 0.4;
gravityCoefficient = -0.25; // rises slowly
inheritedVelFactor = 0.025;
constantAcceleration = -1.1;
lifetimeMS = 1250;
lifetimeVarianceMS = 0;
textureName = "particleTest";
useInvAlpha = false;
spinRandomMin = -200.0;
spinRandomMax = 200.0;
textureName = "special/Smoke/smoke_001";
colors[0] = "0.1 0.1 1.0 1.0";
colors[1] = "0.4 0.4 1.0 1.0";
colors[2] = "0.4 0.4 1.0 0.0";
sizes[0] = 2.0;
sizes[1] = 6.0;
sizes[2] = 2.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(UnderwaterGExplosionSmokeEmitter)
{
ejectionPeriodMS = 15;
periodVarianceMS = 0;
ejectionVelocity = 6.25;
velocityVariance = 0.25;
thetaMin = 0.0;
thetaMax = 90.0;
lifetimeMS = 250;
particles = "UnderwaterGrenadeExplosionSmoke";
};
datablock ParticleData(UnderwaterGrenadeSparks)
{
dragCoefficient = 1;
gravityCoefficient = 0.0;
inheritedVelFactor = 0.2;
constantAcceleration = 0.0;
lifetimeMS = 500;
lifetimeVarianceMS = 350;
textureName = "special/underwaterSpark";
colors[0] = "0.6 0.6 1.0 1.0";
colors[1] = "0.6 0.6 1.0 1.0";
colors[2] = "0.6 0.6 1.0 0.0";
sizes[0] = 0.5;
sizes[1] = 0.5;
sizes[2] = 0.75;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(UnderwaterGrenadeSparksEmitter)
{
ejectionPeriodMS = 2;
periodVarianceMS = 0;
ejectionVelocity = 12;
velocityVariance = 6.75;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 60;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
orientParticles = true;
lifetimeMS = 100;
particles = "UnderwaterGrenadeSparks";
};
datablock ExplosionData(UnderwaterGrenadeExplosion)
{
soundProfile = UnderwaterGrenadeExplosionSound;
faceViewer = true;
explosionScale = "0.8 0.8 0.8";
emitter[0] = UnderwaterGrenadeDustEmitter;
emitter[1] = UnderwaterGExplosionSmokeEmitter;
emitter[2] = UnderwaterGrenadeSparksEmitter;
emitter[3] = GrenadeExplosionBubbleEmitter;
shakeCamera = true;
camShakeFreq = "10.0 6.0 9.0";
camShakeAmp = "20.0 20.0 20.0";
camShakeDuration = 0.5;
camShakeRadius = 20.0;
};
//----------------------------------------------------------------------------
// Bubbles
//----------------------------------------------------------------------------
datablock ParticleData(GrenadeBubbleParticle)
{
dragCoefficient = 0.0;
gravityCoefficient = -0.25;
inheritedVelFactor = 0.0;
constantAcceleration = 0.0;
lifetimeMS = 1500;
lifetimeVarianceMS = 600;
useInvAlpha = false;
textureName = "special/bubbles";
spinRandomMin = -100.0;
spinRandomMax = 100.0;
colors[0] = "0.7 0.8 1.0 0.4";
colors[1] = "0.7 0.8 1.0 0.4";
colors[2] = "0.7 0.8 1.0 0.0";
sizes[0] = 0.5;
sizes[1] = 0.5;
sizes[2] = 0.5;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(GrenadeBubbleEmitter)
{
ejectionPeriodMS = 5;
periodVarianceMS = 0;
ejectionVelocity = 1.0;
ejectionOffset = 0.1;
velocityVariance = 0.5;
thetaMin = 0;
thetaMax = 80;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
particles = "GrenadeBubbleParticle";
};
//----------------------------------------------------------------------------
// Debris
//----------------------------------------------------------------------------
datablock ParticleData( GDebrisSmokeParticle )
{
dragCoeffiecient = 1.0;
gravityCoefficient = 0.0;
inheritedVelFactor = 0.2;
lifetimeMS = 1000;
lifetimeVarianceMS = 100;
textureName = "particleTest";
useInvAlpha = true;
spinRandomMin = -60.0;
spinRandomMax = 60.0;
colors[0] = "0.4 0.4 0.4 1.0";
colors[1] = "0.3 0.3 0.3 0.5";
colors[2] = "0.0 0.0 0.0 0.0";
sizes[0] = 0.0;
sizes[1] = 1.0;
sizes[2] = 1.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData( GDebrisSmokeEmitter )
{
ejectionPeriodMS = 7;
periodVarianceMS = 1;
ejectionVelocity = 1.0; // A little oomph at the back end
velocityVariance = 0.2;
thetaMin = 0.0;
thetaMax = 40.0;
particles = "GDebrisSmokeParticle";
};
datablock DebrisData( GrenadeDebris )
{
emitters[0] = GDebrisSmokeEmitter;
explodeOnMaxBounce = true;
elasticity = 0.4;
friction = 0.2;
lifetime = 0.3;
lifetimeVariance = 0.02;
numBounces = 1;
};
//--------------------------------------------------------------------------
// Splash
//--------------------------------------------------------------------------
datablock ParticleData( GrenadeSplashParticle )
{
dragCoefficient = 1;
gravityCoefficient = 0.0;
inheritedVelFactor = 0.2;
constantAcceleration = -1.4;
lifetimeMS = 300;
lifetimeVarianceMS = 0;
textureName = "special/droplet";
colors[0] = "0.7 0.8 1.0 1.0";
colors[1] = "0.7 0.8 1.0 0.5";
colors[2] = "0.7 0.8 1.0 0.0";
sizes[0] = 0.05;
sizes[1] = 0.2;
sizes[2] = 0.2;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData( GrenadeSplashEmitter )
{
ejectionPeriodMS = 4;
periodVarianceMS = 0;
ejectionVelocity = 4;
velocityVariance = 1.0;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 50;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
orientParticles = true;
lifetimeMS = 100;
particles = "BlasterSplashParticle";
};
datablock SplashData(GrenadeSplash)
{
numSegments = 15;
ejectionFreq = 15;
ejectionAngle = 40;
ringLifetime = 0.35;
lifetimeMS = 300;
velocity = 3.0;
startRadius = 0.0;
acceleration = -3.0;
texWrap = 5.0;
texture = "special/water2";
emitter[0] = BlasterSplashEmitter;
colors[0] = "0.7 0.8 1.0 1.0";
colors[1] = "0.7 0.8 1.0 1.0";
colors[2] = "0.7 0.8 1.0 1.0";
colors[3] = "0.7 0.8 1.0 1.0";
times[0] = 0.0;
times[1] = 0.4;
times[2] = 0.8;
times[3] = 1.0;
};
//--------------------------------------------------------------------------
// Particle effects
//--------------------------------------
datablock ParticleData(GrenadeSmokeParticle)
{
dragCoeffiecient = 0.0;
gravityCoefficient = -0.2; // rises slowly
inheritedVelFactor = 0.00;
lifetimeMS = 700; // lasts 2 second
lifetimeVarianceMS = 150; // ...more or less
textureName = "particleTest";
useInvAlpha = true;
spinRandomMin = -30.0;
spinRandomMax = 30.0;
colors[0] = "0.9 0.9 0.9 1.0";
colors[1] = "0.6 0.6 0.6 1.0";
colors[2] = "0.4 0.4 0.4 0.0";
sizes[0] = 0.25;
sizes[1] = 1.0;
sizes[2] = 3.0;
times[0] = 0.0;
times[1] = 0.2;
times[2] = 1.0;
};
datablock ParticleEmitterData(GrenadeSmokeEmitter)
{
ejectionPeriodMS = 15;
periodVarianceMS = 5;
ejectionVelocity = 1.25;
velocityVariance = 0.50;
thetaMin = 0.0;
thetaMax = 90.0;
particles = "GrenadeSmokeParticle";
};
datablock ParticleData(GrenadeDust)
{
dragCoefficient = 1.0;
gravityCoefficient = -0.01;
inheritedVelFactor = 0.0;
constantAcceleration = 0.0;
lifetimeMS = 1000;
lifetimeVarianceMS = 100;
useInvAlpha = true;
spinRandomMin = -90.0;
spinRandomMax = 500.0;
textureName = "particleTest";
colors[0] = "0.3 0.3 0.3 0.5";
colors[1] = "0.3 0.3 0.3 0.5";
colors[2] = "0.3 0.3 0.3 0.0";
sizes[0] = 3.2;
sizes[1] = 4.6;
sizes[2] = 5.0;
times[0] = 0.0;
times[1] = 0.7;
times[2] = 1.0;
};
datablock ParticleEmitterData(GrenadeDustEmitter)
{
ejectionPeriodMS = 5;
periodVarianceMS = 0;
ejectionVelocity = 15.0;
velocityVariance = 0.0;
ejectionOffset = 0.0;
thetaMin = 85;
thetaMax = 85;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
lifetimeMS = 250;
particles = "GrenadeDust";
};
datablock ParticleData(GrenadeExplosionSmoke)
{
dragCoeffiecient = 0.4;
gravityCoefficient = -0.5; // rises slowly
inheritedVelFactor = 0.025;
lifetimeMS = 1250;
lifetimeVarianceMS = 0;
textureName = "particleTest";
useInvAlpha = true;
spinRandomMin = -200.0;
spinRandomMax = 200.0;
textureName = "special/Smoke/smoke_001";
colors[0] = "0.7 0.7 0.7 1.0";
colors[1] = "0.2 0.2 0.2 1.0";
colors[2] = "0.1 0.1 0.1 0.0";
sizes[0] = 2.0;
sizes[1] = 6.0;
sizes[2] = 2.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(GExplosionSmokeEmitter)
{
ejectionPeriodMS = 5;
periodVarianceMS = 0;
ejectionVelocity = 6.25;
velocityVariance = 0.25;
thetaMin = 0.0;
thetaMax = 90.0;
lifetimeMS = 250;
particles = "GrenadeExplosionSmoke";
};
datablock ParticleData(GrenadeSparks)
{
dragCoefficient = 1;
gravityCoefficient = 0.0;
inheritedVelFactor = 0.2;
constantAcceleration = 0.0;
lifetimeMS = 500;
lifetimeVarianceMS = 350;
textureName = "special/bigspark";
colors[0] = "0.56 0.36 0.26 1.0";
colors[1] = "0.56 0.36 0.26 1.0";
colors[2] = "1.0 0.36 0.26 0.0";
sizes[0] = 0.5;
sizes[1] = 0.5;
sizes[2] = 0.75;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(GrenadeSparksEmitter)
{
ejectionPeriodMS = 2;
periodVarianceMS = 0;
ejectionVelocity = 12;
velocityVariance = 6.75;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 60;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
orientParticles = true;
lifetimeMS = 100;
particles = "GrenadeSparks";
};
//----------------------------------------------------
// Explosion
//----------------------------------------------------
datablock ExplosionData(GrenadeExplosion)
{
soundProfile = GrenadeExplosionSound;
faceViewer = true;
explosionScale = "0.8 0.8 0.8";
debris = GrenadeDebris;
debrisThetaMin = 10;
debrisThetaMax = 50;
debrisNum = 8;
debrisVelocity = 26.0;
debrisVelocityVariance = 7.0;
emitter[0] = GrenadeDustEmitter;
emitter[1] = GExplosionSmokeEmitter;
emitter[2] = GrenadeSparksEmitter;
shakeCamera = true;
camShakeFreq = "10.0 6.0 9.0";
camShakeAmp = "20.0 20.0 20.0";
camShakeDuration = 0.5;
camShakeRadius = 20.0;
};
//--------------------------------------------------------------------------
// Projectile
//--------------------------------------
datablock GrenadeProjectileData(BasicGrenade)
{
projectileShapeName = "grenade_projectile.dts";
emitterDelay = -1;
directDamage = 0.0;
hasDamageRadius = true;
indirectDamage = 0.40;
damageRadius = 15.0;
radiusDamageType = $DamageType::Grenade;
kickBackStrength = 1500;
bubbleEmitTime = 1.0;
sound = GrenadeProjectileSound;
explosion = "GrenadeExplosion";
underwaterExplosion = "UnderwaterGrenadeExplosion";
velInheritFactor = 0.85; // z0dd - ZOD, 3/30/02. Was 0.5
splash = GrenadeSplash;
baseEmitter = GrenadeSmokeEmitter;
bubbleEmitter = GrenadeBubbleEmitter;
grenadeElasticity = 0.30; // z0dd - ZOD, 9/13/02. Was 0.35
grenadeFriction = 0.2;
armingDelayMS = 650; // z0dd - ZOD, 9/13/02. Was 1000
muzzleVelocity = 75.00; // z0dd - ZOD, 3/30/02. GL projectile is faster. Was 47.00
//drag = 0.1; // z0dd - ZOD, 3/30/02. No drag.
gravityMod = 1.9; // z0dd - ZOD, 5/18/02. Make GL projectile heavier, less floaty
};
//--------------------------------------------------------------------------
// Ammo
//--------------------------------------
datablock ItemData(GrenadeLauncherAmmo)
{
className = Ammo;
catagory = "Ammo";
shapeFile = "ammo_grenade.dts";
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "some grenade launcher ammo";
computeCRC = true;
emap = true;
};
//--------------------------------------------------------------------------
// Weapon
//--------------------------------------
datablock ItemData(GrenadeLauncher)
{
className = Weapon;
catagory = "Spawn Items";
shapeFile = "weapon_grenade_launcher.dts";
image = GrenadeLauncherImage;
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "a grenade launcher";
computeCRC = true;
};
datablock ShapeBaseImageData(GrenadeLauncherImage)
{
className = WeaponImage;
shapeFile = "weapon_grenade_launcher.dts";
item = GrenadeLauncher;
ammo = GrenadeLauncherAmmo;
offset = "0 0 0";
emap = true;
projectile = BasicGrenade;
projectileType = GrenadeProjectile;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateSound[0] = GrenadeSwitchSound;
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "Fire";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.4;
stateFire[3] = true;
stateRecoil[3] = LightRecoil;
stateAllowImageChange[3] = false;
stateSequence[3] = "Fire";
stateScript[3] = "onFire";
stateSound[3] = GrenadeFireSound;
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 0.5;
stateAllowImageChange[4] = false;
stateSequence[4] = "Reload";
stateSound[4] = GrenadeReloadSound;
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
stateName[6] = "DryFire";
stateSound[6] = GrenadeDryFireSound;
stateTimeoutValue[6] = 1.5;
stateTransitionOnTimeout[6] = "NoAmmo";
};

340
scripts/weapons/mine.cs Normal file
View file

@ -0,0 +1,340 @@
// ----------------------------------------------
// mine script
// ----------------------------------------------
$TeamDeployableMax[MineDeployed] = 25; // z0dd - ZOD, 6/10/02. Was 20.
// ----------------------------------------------
// force-feedback datablocks
// ----------------------------------------------
datablock EffectProfile(MineExplosionEffect)
{
effectname = "explosions/mine_detonate";
minDistance = 10;
maxDistance = 50;
};
// ----------------------------------------------
// audio datablocks
// ----------------------------------------------
datablock AudioProfile(MineDeploySound)
{
filename = "fx/weapons/mine_deploy.wav";
description = AudioClose3D;
preload = true;
};
datablock AudioProfile(MineExplosionSound)
{
filename = "fx/weapons/mine_detonate.wav";
description = AudioBIGExplosion3d;
preload = true;
effect = MineExplosionEffect;
};
datablock AudioProfile(UnderwaterMineExplosionSound)
{
filename = "fx/weapons/mine_detonate_UW.wav";
description = AudioBIGExplosion3d;
preload = true;
effect = MineExplosionEffect;
};
//--------------------------------------------------------------------------
// Mine Particle effects
//--------------------------------------------------------------------------
datablock ParticleData(MineExplosionBubbleParticle)
{
dragCoefficient = 0.0;
gravityCoefficient = -0.25;
inheritedVelFactor = 0.0;
constantAcceleration = 0.0;
lifetimeMS = 2000;
lifetimeVarianceMS = 750;
useInvAlpha = false;
textureName = "special/bubbles";
spinRandomMin = -100.0;
spinRandomMax = 100.0;
colors[0] = "0.7 0.8 1.0 0.0";
colors[1] = "0.7 0.8 1.0 0.4";
colors[2] = "0.7 0.8 1.0 0.0";
sizes[0] = 1.0;
sizes[1] = 1.0;
sizes[2] = 1.0;
times[0] = 0.0;
times[1] = 0.3;
times[2] = 1.0;
};
datablock ParticleEmitterData(MineExplosionBubbleEmitter)
{
ejectionPeriodMS = 7;
periodVarianceMS = 0;
ejectionVelocity = 1.0;
ejectionOffset = 2.0;
velocityVariance = 0.5;
thetaMin = 0;
thetaMax = 80;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
particles = "MineExplosionBubbleParticle";
};
datablock ParticleData( UnderwaterMineCrescentParticle )
{
dragCoefficient = 2;
gravityCoefficient = 0.0;
inheritedVelFactor = 0.2;
constantAcceleration = -0.0;
lifetimeMS = 600;
lifetimeVarianceMS = 000;
textureName = "special/crescent3";
colors[0] = "0.5 0.5 1.0 1.0";
colors[1] = "0.5 0.5 1.0 1.0";
colors[2] = "0.5 0.5 1.0 0.0";
sizes[0] = 0.5;
sizes[1] = 1.0;
sizes[2] = 2.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData( UnderwaterMineCrescentEmitter )
{
ejectionPeriodMS = 10;
periodVarianceMS = 0;
ejectionVelocity = 10;
velocityVariance = 5.0;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 80;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
orientParticles = true;
lifetimeMS = 200;
particles = "UnderwaterMineCrescentParticle";
};
datablock ParticleData(UnderwaterMineExplosionSmoke)
{
dragCoeffiecient = 105.0;
gravityCoefficient = -0.0;
inheritedVelFactor = 0.025;
constantAcceleration = -1.0;
lifetimeMS = 1200;
lifetimeVarianceMS = 00;
textureName = "particleTest";
useInvAlpha = false;
spinRandomMin = -200.0;
spinRandomMax = 200.0;
textureName = "special/Smoke/smoke_001";
colors[0] = "0.7 0.7 1.0 1.0";
colors[1] = "0.3 0.3 1.0 1.0";
colors[2] = "0.0 0.0 1.0 0.0";
sizes[0] = 1.0;
sizes[1] = 3.0;
sizes[2] = 1.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(UnderwaterMineExplosionSmokeEmitter)
{
ejectionPeriodMS = 8;
periodVarianceMS = 0;
ejectionVelocity = 4.25;
velocityVariance = 1.25;
thetaMin = 0.0;
thetaMax = 80.0;
lifetimeMS = 250;
particles = "UnderwaterMineExplosionSmoke";
};
datablock ExplosionData(UnderwaterMineExplosion)
{
explosionShape = "disc_explosion.dts";
playSpeed = 1.0;
sizes[0] = "0.4 0.4 0.4";
sizes[1] = "0.4 0.4 0.4";
soundProfile = UnderwaterMineExplosionSound;
faceViewer = true;
emitter[0] = UnderwaterMineExplosionSmokeEmitter;
emitter[1] = UnderwaterMineCrescentEmitter;
emitter[2] = MineExplosionBubbleEmitter;
shakeCamera = true;
camShakeFreq = "8.0 7.0 9.0";
camShakeAmp = "50.0 50.0 50.0";
camShakeDuration = 1.0;
camShakeRadius = 10.0;
};
//--------------------------------------------------------------------------
// Mine Particle effects
//--------------------------------------------------------------------------
datablock ParticleData( MineCrescentParticle )
{
dragCoefficient = 2;
gravityCoefficient = 0.0;
inheritedVelFactor = 0.2;
constantAcceleration = -0.0;
lifetimeMS = 600;
lifetimeVarianceMS = 000;
textureName = "special/crescent3";
colors[0] = "1.0 0.8 0.2 1.0";
colors[1] = "1.0 0.4 0.2 1.0";
colors[2] = "1.0 0.0 0.0 0.0";
sizes[0] = 0.5;
sizes[1] = 1.0;
sizes[2] = 2.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData( MineCrescentEmitter )
{
ejectionPeriodMS = 10;
periodVarianceMS = 0;
ejectionVelocity = 10;
velocityVariance = 5.0;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 80;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
orientParticles = true;
lifetimeMS = 200;
particles = "MineCrescentParticle";
};
datablock ParticleData(MineExplosionSmoke)
{
dragCoeffiecient = 105.0;
gravityCoefficient = -0.0;
inheritedVelFactor = 0.025;
lifetimeMS = 1200;
lifetimeVarianceMS = 00;
textureName = "particleTest";
useInvAlpha = true;
spinRandomMin = -200.0;
spinRandomMax = 200.0;
textureName = "special/Smoke/smoke_001";
colors[0] = "1.0 0.7 0.0 1.0";
colors[1] = "0.2 0.2 0.2 1.0";
colors[2] = "0.0 0.0 0.0 0.0";
sizes[0] = 1.0;
sizes[1] = 3.0;
sizes[2] = 1.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(MineExplosionSmokeEmitter)
{
ejectionPeriodMS = 8;
periodVarianceMS = 0;
ejectionVelocity = 4.25;
velocityVariance = 1.25;
thetaMin = 0.0;
thetaMax = 80.0;
lifetimeMS = 250;
particles = "MineExplosionSmoke";
};
datablock ExplosionData(MineExplosion)
{
explosionShape = "effect_plasma_explosion.dts";
playSpeed = 1.0;
sizes[0] = "0.5 0.5 0.5";
sizes[1] = "0.5 0.5 0.5";
soundProfile = MineExplosionSound;
faceViewer = true;
emitter[0] = MineExplosionSmokeEmitter;
emitter[1] = MineCrescentEmitter;
shakeCamera = true;
camShakeFreq = "8.0 7.0 9.0";
camShakeAmp = "50.0 50.0 50.0";
camShakeDuration = 1.0;
camShakeRadius = 10.0;
};
// ----------------------------------------------
// Item datablocks
// ----------------------------------------------
datablock ItemData(MineDeployed)
{
className = Weapon;
shapeFile = "mine.dts";
mass = 0.75;
elasticity = 0.2;
friction = 0.8; // z0dd - ZOD, 9/27/03. was 0.6
pickupRadius = 3;
maxDamage = 0.01; // z0dd - ZOD, 9/27/03. was 0.2
explosion = MineExplosion;
underwaterExplosion = UnderwaterMineExplosion;
indirectDamage = 0.57; // z0dd - ZOD, 7/14/03. Slight increase to dmg. Was 0.55
damageRadius = 10.0; // z0dd - ZOD, 7/14/03. Slight increase to det range. Was 6.0
radiusDamageType = $DamageType::Mine;
kickBackStrength = 1500;
aiAvoidThis = true;
dynamicType = $TypeMasks::DamagableItemObjectType;
spacing = 6.0; // how close together mines can be
proximity = 2.5; // how close causes a detonation (by player/vehicle)
armTime = 2200; // 2.2 seconds to arm a mine after it comes to rest
maxDepCount = 5; // try to deploy this many times before detonating. // z0dd - ZOD, 9/27/02. Was 9
computeCRC = true;
};
datablock ItemData(Mine)
{
className = HandInventory;
catagory = "Handheld";
shapeFile = "ammo_mine.dts";
mass = 1;
elasticity = 0.2;
friction = 0.7;
pickupRadius = 2;
thrownItem = MineDeployed;
pickUpName = "some mines";
computeCRC = true;
};

View file

@ -0,0 +1,795 @@
//--------------------------------------
// Missile launcher
//--------------------------------------
//--------------------------------------------------------------------------
// Force-Feedback Effects
//--------------------------------------
datablock EffectProfile(MissileSwitchEffect)
{
effectname = "weapons/missile_launcher_activate";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(MissileFireEffect)
{
effectname = "weapons/missile_fire";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock EffectProfile(MissileDryFireEffect)
{
effectname = "weapons/missile_launcher_dryfire";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(MissileExplosionEffect)
{
effectname = "explosions/explosion.xpl23";
minDistance = 10;
maxDistance = 30;
};
//--------------------------------------------------------------------------
// Sounds
//--------------------------------------
datablock AudioProfile(MissileSwitchSound)
{
filename = "fx/weapons/missile_launcher_activate.wav";
description = AudioClosest3d;
preload = true;
effect = MissileSwitchEffect;
};
datablock AudioProfile(MissileFireSound)
{
filename = "fx/weapons/missile_fire.WAV";
description = AudioDefault3d;
preload = true;
effect = MissileFireEffect;
};
datablock AudioProfile(MissileProjectileSound)
{
filename = "fx/weapons/missile_projectile.wav";
description = ProjectileLooping3d;
preload = true;
};
datablock AudioProfile(MissileReloadSound)
{
filename = "fx/weapons/weapon.missilereload.wav";
description = AudioClosest3d;
preload = true;
};
datablock AudioProfile(MissileLockSound)
{
filename = "fx/weapons/missile_launcher_searching.WAV";
description = AudioClosest3d;
preload = true;
};
datablock AudioProfile(MissileExplosionSound)
{
filename = "fx/explosions/explosion.xpl23.wav";
description = AudioBIGExplosion3d;
preload = true;
effect = MissileExplosionEffect;
};
datablock AudioProfile(MissileDryFireSound)
{
filename = "fx/weapons/missile_launcher_dryfire.wav";
description = AudioClose3d;
preload = true;
effect = MissileDryFireEffect;
};
//----------------------------------------------------------------------------
// Splash Debris
//----------------------------------------------------------------------------
datablock ParticleData( MDebrisSmokeParticle )
{
dragCoeffiecient = 1.0;
gravityCoefficient = 0.10;
inheritedVelFactor = 0.1;
lifetimeMS = 1000;
lifetimeVarianceMS = 100;
textureName = "particleTest";
// useInvAlpha = true;
spinRandomMin = -60.0;
spinRandomMax = 60.0;
colors[0] = "0.7 0.8 1.0 1.0";
colors[1] = "0.7 0.8 1.0 0.5";
colors[2] = "0.7 0.8 1.0 0.0";
sizes[0] = 0.0;
sizes[1] = 0.8;
sizes[2] = 0.8;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData( MDebrisSmokeEmitter )
{
ejectionPeriodMS = 10;
periodVarianceMS = 1;
ejectionVelocity = 1.0; // A little oomph at the back end
velocityVariance = 0.2;
thetaMin = 0.0;
thetaMax = 40.0;
particles = "MDebrisSmokeParticle";
};
datablock DebrisData( MissileSplashDebris )
{
emitters[0] = MDebrisSmokeEmitter;
explodeOnMaxBounce = true;
elasticity = 0.4;
friction = 0.2;
lifetime = 0.3;
lifetimeVariance = 0.1;
numBounces = 1;
};
//----------------------------------------------------------------------------
// Missile smoke spike (for debris)
//----------------------------------------------------------------------------
datablock ParticleData( MissileSmokeSpike )
{
dragCoeffiecient = 1.0;
gravityCoefficient = 0.0;
inheritedVelFactor = 0.2;
lifetimeMS = 1000;
lifetimeVarianceMS = 100;
textureName = "particleTest";
useInvAlpha = true;
spinRandomMin = -60.0;
spinRandomMax = 60.0;
colors[0] = "0.6 0.6 0.6 1.0";
colors[1] = "0.4 0.4 0.4 0.5";
colors[2] = "0.4 0.4 0.4 0.0";
sizes[0] = 0.0;
sizes[1] = 1.0;
sizes[2] = 0.5;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData( MissileSmokeSpikeEmitter )
{
ejectionPeriodMS = 7;
periodVarianceMS = 1;
ejectionVelocity = 1.0; // A little oomph at the back end
velocityVariance = 0.2;
thetaMin = 0.0;
thetaMax = 40.0;
particles = "MissileSmokeSpike";
};
//----------------------------------------------------------------------------
// Explosion smoke particles
//----------------------------------------------------------------------------
datablock ParticleData(MissileExplosionSmoke)
{
dragCoeffiecient = 0.3;
gravityCoefficient = -0.2;
inheritedVelFactor = 0.025;
lifetimeMS = 1250;
lifetimeVarianceMS = 0;
textureName = "particleTest";
useInvAlpha = true;
spinRandomMin = -100.0;
spinRandomMax = 100.0;
textureName = "special/Smoke/bigSmoke";
colors[0] = "1.0 0.7 0.0 1.0";
colors[1] = "0.4 0.4 0.4 0.5";
colors[2] = "0.4 0.4 0.4 0.0";
sizes[0] = 1.0;
sizes[1] = 3.0;
sizes[2] = 1.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(MissileExplosionSmokeEMitter)
{
ejectionOffset = 0.0;
ejectionPeriodMS = 5;
periodVarianceMS = 0;
ejectionVelocity = 3.25;
velocityVariance = 0.25;
thetaMin = 0.0;
thetaMax = 180.0;
lifetimeMS = 250;
particles = "MissileExplosionSmoke";
};
datablock DebrisData( MissileSpikeDebris )
{
emitters[0] = MissileSmokeSpikeEmitter;
explodeOnMaxBounce = true;
elasticity = 0.4;
friction = 0.2;
lifetime = 0.3;
lifetimeVariance = 0.02;
};
//---------------------------------------------------------------------------
// Explosions
//---------------------------------------------------------------------------
datablock ExplosionData(MissileExplosion)
{
explosionShape = "effect_plasma_explosion.dts";
playSpeed = 1.5;
soundProfile = MissileExplosionSound;
faceViewer = true;
sizes[0] = "0.5 0.5 0.5";
sizes[1] = "0.5 0.5 0.5";
sizes[2] = "0.5 0.5 0.5";
emitter[0] = MissileExplosionSmokeEmitter;
debris = MissileSpikeDebris;
debrisThetaMin = 10;
debrisThetaMax = 170;
debrisNum = 8;
debrisNumVariance = 6;
debrisVelocity = 15.0;
debrisVelocityVariance = 2.0;
shakeCamera = true;
camShakeFreq = "6.0 7.0 7.0";
camShakeAmp = "70.0 70.0 70.0";
camShakeDuration = 1.0;
camShakeRadius = 7.0;
};
datablock ExplosionData(MissileSplashExplosion)
{
explosionShape = "disc_explosion.dts";
faceViewer = true;
explosionScale = "1.0 1.0 1.0";
debris = MissileSplashDebris;
debrisThetaMin = 10;
debrisThetaMax = 80;
debrisNum = 10;
debrisVelocity = 10.0;
debrisVelocityVariance = 4.0;
sizes[0] = "0.35 0.35 0.35";
sizes[1] = "0.15 0.15 0.15";
sizes[2] = "0.15 0.15 0.15";
sizes[3] = "0.15 0.15 0.15";
times[0] = 0.0;
times[1] = 0.333;
times[2] = 0.666;
times[3] = 1.0;
};
//--------------------------------------------------------------------------
// Splash
//--------------------------------------------------------------------------
datablock ParticleData(MissileMist)
{
dragCoefficient = 2.0;
gravityCoefficient = -0.05;
inheritedVelFactor = 0.0;
constantAcceleration = 0.0;
lifetimeMS = 400;
lifetimeVarianceMS = 100;
useInvAlpha = false;
spinRandomMin = -90.0;
spinRandomMax = 500.0;
textureName = "particleTest";
colors[0] = "0.7 0.8 1.0 1.0";
colors[1] = "0.7 0.8 1.0 0.5";
colors[2] = "0.7 0.8 1.0 0.0";
sizes[0] = 0.5;
sizes[1] = 0.5;
sizes[2] = 0.8;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(MissileMistEmitter)
{
ejectionPeriodMS = 5;
periodVarianceMS = 0;
ejectionVelocity = 6.0;
velocityVariance = 4.0;
ejectionOffset = 0.0;
thetaMin = 85;
thetaMax = 85;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
lifetimeMS = 250;
particles = "MissileMist";
};
datablock ParticleData( MissileSplashParticle )
{
dragCoefficient = 1;
gravityCoefficient = 0.2;
inheritedVelFactor = 0.2;
constantAcceleration = -0.0;
lifetimeMS = 600;
lifetimeVarianceMS = 0;
textureName = "special/droplet";
colors[0] = "0.7 0.8 1.0 1.0";
colors[1] = "0.7 0.8 1.0 0.5";
colors[2] = "0.7 0.8 1.0 0.0";
sizes[0] = 0.5;
sizes[1] = 0.5;
sizes[2] = 0.5;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData( MissileSplashEmitter )
{
ejectionPeriodMS = 1;
periodVarianceMS = 0;
ejectionVelocity = 6;
velocityVariance = 3.0;
ejectionOffset = 0.0;
thetaMin = 60;
thetaMax = 80;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
orientParticles = true;
lifetimeMS = 100;
particles = "MissileSplashParticle";
};
datablock SplashData(MissileSplash)
{
numSegments = 15;
ejectionFreq = 0.0001;
ejectionAngle = 45;
ringLifetime = 0.5;
lifetimeMS = 400;
velocity = 5.0;
startRadius = 0.0;
acceleration = -3.0;
texWrap = 5.0;
explosion = MissileSplashExplosion;
texture = "special/water2";
emitter[0] = MissileSplashEmitter;
emitter[1] = MissileMistEmitter;
colors[0] = "0.7 0.8 1.0 0.0";
colors[1] = "0.7 0.8 1.0 1.0";
colors[2] = "0.7 0.8 1.0 0.0";
colors[3] = "0.7 0.8 1.0 0.0";
times[0] = 0.0;
times[1] = 0.4;
times[2] = 0.8;
times[3] = 1.0;
};
//--------------------------------------------------------------------------
// Particle effects
//--------------------------------------
datablock ParticleData(MissileSmokeParticle)
{
dragCoeffiecient = 0.0;
gravityCoefficient = -0.02;
inheritedVelFactor = 0.1;
lifetimeMS = 1200;
lifetimeVarianceMS = 100;
textureName = "particleTest";
useInvAlpha = true;
spinRandomMin = -90.0;
spinRandomMax = 90.0;
colors[0] = "1.0 0.75 0.0 0.0";
colors[1] = "0.5 0.5 0.5 1.0";
colors[2] = "0.3 0.3 0.3 0.0";
sizes[0] = 1;
sizes[1] = 2;
sizes[2] = 3;
times[0] = 0.0;
times[1] = 0.1;
times[2] = 1.0;
};
datablock ParticleEmitterData(MissileSmokeEmitter)
{
ejectionPeriodMS = 10;
periodVarianceMS = 0;
ejectionVelocity = 1.5;
velocityVariance = 0.3;
thetaMin = 0.0;
thetaMax = 50.0;
particles = "MissileSmokeParticle";
};
datablock ParticleData(MissileFireParticle)
{
dragCoeffiecient = 0.0;
gravityCoefficient = 0.0;
inheritedVelFactor = 1.0;
lifetimeMS = 300;
lifetimeVarianceMS = 000;
textureName = "particleTest";
spinRandomMin = -135;
spinRandomMax = 135;
colors[0] = "1.0 0.75 0.2 1.0";
colors[1] = "1.0 0.5 0.0 1.0";
colors[2] = "1.0 0.40 0.0 0.0";
sizes[0] = 0;
sizes[1] = 1;
sizes[2] = 1.5;
times[0] = 0.0;
times[1] = 0.3;
times[2] = 1.0;
};
datablock ParticleEmitterData(MissileFireEmitter)
{
ejectionPeriodMS = 15;
periodVarianceMS = 0;
ejectionVelocity = 15.0;
velocityVariance = 0.0;
thetaMin = 0.0;
thetaMax = 0.0;
particles = "MissileFireParticle";
};
datablock ParticleData(MissilePuffParticle)
{
dragCoeffiecient = 0.0;
gravityCoefficient = 0.0;
inheritedVelFactor = 0.0;
lifetimeMS = 500;
lifetimeVarianceMS = 300;
textureName = "particleTest";
spinRandomMin = -135;
spinRandomMax = 135;
colors[0] = "1.0 1.0 1.0 0.5";
colors[1] = "0.7 0.7 0.7 0.0";
sizes[0] = 0.25;
sizes[1] = 1.0;
times[0] = 0.0;
times[1] = 1.0;
};
datablock ParticleEmitterData(MissilePuffEmitter)
{
ejectionPeriodMS = 50;
periodVarianceMS = 3;
ejectionVelocity = 0.5;
velocityVariance = 0.0;
thetaMin = 0.0;
thetaMax = 90.0;
particles = "MissilePuffParticle";
};
datablock ParticleData(MissileLauncherExhaustParticle)
{
dragCoeffiecient = 0.0;
gravityCoefficient = 0.01;
inheritedVelFactor = 1.0;
lifetimeMS = 500;
lifetimeVarianceMS = 300;
textureName = "particleTest";
useInvAlpha = true;
spinRandomMin = -135;
spinRandomMax = 135;
colors[0] = "1.0 1.0 1.0 0.5";
colors[1] = "0.7 0.7 0.7 0.0";
sizes[0] = 0.25;
sizes[1] = 1.0;
times[0] = 0.0;
times[1] = 1.0;
};
datablock ParticleEmitterData(MissileLauncherExhaustEmitter)
{
ejectionPeriodMS = 15;
periodVarianceMS = 0;
ejectionVelocity = 3.0;
velocityVariance = 0.0;
thetaMin = 0.0;
thetaMax = 20.0;
particles = "MissileLauncherExhaustParticle";
};
//--------------------------------------------------------------------------
// Debris
//--------------------------------------
datablock DebrisData( FlechetteDebris )
{
shapeName = "weapon_missile_fleschette.dts";
lifetime = 5.0;
minSpinSpeed = -320.0;
maxSpinSpeed = 320.0;
elasticity = 0.2;
friction = 0.3;
numBounces = 3;
gravModifier = 0.40;
staticOnMaxBounce = true;
};
//--------------------------------------------------------------------------
// Projectile
//--------------------------------------
datablock SeekerProjectileData(ShoulderMissile)
{
casingShapeName = "weapon_missile_casement.dts";
projectileShapeName = "weapon_missile_projectile.dts";
hasDamageRadius = true;
indirectDamage = 0.8;
damageRadius = 8.0;
radiusDamageType = $DamageType::Missile;
kickBackStrength = 2000;
explosion = "MissileExplosion";
splash = MissileSplash;
velInheritFactor = 1.0; // to compensate for slow starting velocity, this value
// is cranked up to full so the missile doesn't start
// out behind the player when the player is moving
// very quickly - bramage
baseEmitter = MissileSmokeEmitter;
delayEmitter = MissileFireEmitter;
puffEmitter = MissilePuffEmitter;
bubbleEmitter = GrenadeBubbleEmitter;
bubbleEmitTime = 1.0;
exhaustEmitter = MissileLauncherExhaustEmitter;
exhaustTimeMs = 300;
exhaustNodeName = "muzzlePoint1";
lifetimeMS = 7000; // z0dd - ZOD, 4/14/02. Was 6000
muzzleVelocity = 10.0;
maxVelocity = 90.0; // z0dd - ZOD, 4/14/02. Was 80.0
turningSpeed = 110.0;
acceleration = 200.0;
proximityRadius = 3;
terrainAvoidanceSpeed = 180;
terrainScanAhead = 25;
terrainHeightFail = 12;
terrainAvoidanceRadius = 100;
flareDistance = 200;
flareAngle = 30;
sound = MissileProjectileSound;
hasLight = true;
lightRadius = 5.0;
lightColor = "0.2 0.05 0";
useFlechette = true;
flechetteDelayMs = 550;
casingDeb = FlechetteDebris;
explodeOnWaterImpact = false;
};
//--------------------------------------------------------------------------
// Ammo
//--------------------------------------
datablock ItemData(MissileLauncherAmmo)
{
className = Ammo;
catagory = "Ammo";
shapeFile = "ammo_missile.dts";
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "some missiles";
computeCRC = true;
};
//--------------------------------------------------------------------------
// Weapon
//--------------------------------------
datablock ItemData(MissileLauncher)
{
className = Weapon;
catagory = "Spawn Items";
shapeFile = "weapon_missile.dts";
image = MissileLauncherImage;
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "a missile launcher";
computeCRC = true;
emap = true;
};
datablock ShapeBaseImageData(MissileLauncherImage)
{
className = WeaponImage;
shapeFile = "weapon_missile.dts";
item = MissileLauncher;
ammo = MissileLauncherAmmo;
offset = "0 0 0";
armThread = lookms;
emap = true;
projectile = ShoulderMissile;
projectileType = SeekerProjectile;
isSeeker = true;
seekRadius = 400;
maxSeekAngle = 8;
seekTime = 0.5;
minSeekHeat = 0.6; // the heat that must be present on a target to lock it. // z0dd - ZOD, 8/22/02. Was 0.7
// only target objects outside this range
minTargetingDistance = 40;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateSound[0] = MissileSwitchSound;
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "CheckWet";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.4;
stateFire[3] = true;
stateRecoil[3] = LightRecoil;
stateAllowImageChange[3] = false;
stateSequence[3] = "Fire";
stateScript[3] = "onFire";
stateSound[3] = MissileFireSound;
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 2.5;
stateAllowImageChange[4] = false;
stateSequence[4] = "Reload";
stateSound[4] = MissileReloadSound;
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
stateName[6] = "DryFire";
stateSound[6] = MissileDryFireSound;
stateTimeoutValue[6] = 1.0;
stateTransitionOnTimeout[6] = "ActivateReady";
stateName[7] = "CheckTarget";
stateTransitionOnNoTarget[7] = "DryFire";
stateTransitionOnTarget[7] = "Fire";
stateName[8] = "CheckWet";
stateTransitionOnWet[8] = "WetFire";
stateTransitionOnNotWet[8] = "CheckTarget";
stateName[9] = "WetFire";
stateTransitionOnNoAmmo[9] = "NoAmmo";
stateTransitionOnTimeout[9] = "Reload";
stateSound[9] = MissileFireSound;
stateRecoil[3] = LightRecoil;
stateTimeoutValue[9] = 0.4;
stateSequence[3] = "Fire";
stateScript[9] = "onWetFire";
stateAllowImageChange[9] = false;
};

798
scripts/weapons/mortar.cs Normal file
View file

@ -0,0 +1,798 @@
//--------------------------------------
// Mortar
//--------------------------------------
//--------------------------------------------------------------------------
// Force-Feedback Effects
//--------------------------------------
datablock EffectProfile(MortarSwitchEffect)
{
effectname = "weapons/mortar_activate";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(MortarFireEffect)
{
effectname = "weapons/mortar_fire";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock EffectProfile(MortarReloadEffect)
{
effectname = "weapons/mortar_reload";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(MortarDryFireEffect)
{
effectname = "weapons/mortar_dryfire";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(MortarExplosionEffect)
{
effectname = "explosions/explosion.xpl03";
minDistance = 30;
maxDistance = 65;
};
//--------------------------------------------------------------------------
// Sounds
//--------------------------------------
datablock AudioProfile(MortarSwitchSound)
{
filename = "fx/weapons/mortar_activate.wav";
description = AudioClosest3d;
preload = true;
effect = MortarSwitchEffect;
};
datablock AudioProfile(MortarReloadSound)
{
filename = "fx/weapons/mortar_reload.wav";
description = AudioClosest3d;
preload = true;
effect = MortarReloadEffect;
};
// DELETE IF NOT NEEDED
//datablock AudioProfile(MortarIdleSound)
//{
// filename = "fx/weapons/weapon.mortarIdle.wav";
// description = ClosestLooping3d;
// preload = true;
//};
datablock AudioProfile(MortarFireSound)
{
filename = "fx/weapons/mortar_fire.wav";
description = AudioDefault3d;
preload = true;
effect = MortarFireEffect;
};
datablock AudioProfile(MortarProjectileSound)
{
filename = "fx/weapons/mortar_projectile.wav";
description = ProjectileLooping3d;
preload = true;
};
datablock AudioProfile(MortarExplosionSound)
{
filename = "fx/weapons/mortar_explode.wav";
description = AudioBIGExplosion3d;
preload = true;
effect = MortarExplosionEffect;
};
datablock AudioProfile(UnderwaterMortarExplosionSound)
{
filename = "fx/weapons/mortar_explode_UW.wav";
description = AudioBIGExplosion3d;
preload = true;
effect = MortarExplosionEffect;
};
datablock AudioProfile(MortarDryFireSound)
{
filename = "fx/weapons/mortar_dryfire.wav";
description = AudioClose3d;
preload = true;
effect = MortarDryFireEffect;
};
//----------------------------------------------------------------------------
// Bubbles
//----------------------------------------------------------------------------
datablock ParticleData(MortarBubbleParticle)
{
dragCoefficient = 0.0;
gravityCoefficient = -0.25;
inheritedVelFactor = 0.0;
constantAcceleration = 0.0;
lifetimeMS = 1500;
lifetimeVarianceMS = 600;
useInvAlpha = false;
textureName = "special/bubbles";
spinRandomMin = -100.0;
spinRandomMax = 100.0;
colors[0] = "0.7 0.8 1.0 0.4";
colors[1] = "0.7 0.8 1.0 0.4";
colors[2] = "0.7 0.8 1.0 0.0";
sizes[0] = 0.8;
sizes[1] = 0.8;
sizes[2] = 0.8;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(MortarBubbleEmitter)
{
ejectionPeriodMS = 9;
periodVarianceMS = 0;
ejectionVelocity = 1.0;
ejectionOffset = 0.1;
velocityVariance = 0.5;
thetaMin = 0;
thetaMax = 80;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
particles = "MortarBubbleParticle";
};
//--------------------------------------------------------------------------
// Splash
//--------------------------------------------------------------------------
datablock ParticleData( MortarSplashParticle )
{
dragCoefficient = 1;
gravityCoefficient = 0.0;
inheritedVelFactor = 0.2;
constantAcceleration = -1.4;
lifetimeMS = 300;
lifetimeVarianceMS = 0;
textureName = "special/droplet";
colors[0] = "0.7 0.8 1.0 1.0";
colors[1] = "0.7 0.8 1.0 0.5";
colors[2] = "0.7 0.8 1.0 0.0";
sizes[0] = 0.05;
sizes[1] = 0.2;
sizes[2] = 0.2;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData( MortarSplashEmitter )
{
ejectionPeriodMS = 4;
periodVarianceMS = 0;
ejectionVelocity = 3;
velocityVariance = 1.0;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 50;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
orientParticles = true;
lifetimeMS = 100;
particles = "MortarSplashParticle";
};
datablock SplashData(MortarSplash)
{
numSegments = 10;
ejectionFreq = 10;
ejectionAngle = 20;
ringLifetime = 0.4;
lifetimeMS = 400;
velocity = 3.0;
startRadius = 0.0;
acceleration = -3.0;
texWrap = 5.0;
texture = "special/water2";
emitter[0] = MortarSplashEmitter;
colors[0] = "0.7 0.8 1.0 0.0";
colors[1] = "0.7 0.8 1.0 1.0";
colors[2] = "0.7 0.8 1.0 0.0";
colors[3] = "0.7 0.8 1.0 0.0";
times[0] = 0.0;
times[1] = 0.4;
times[2] = 0.8;
times[3] = 1.0;
};
//---------------------------------------------------------------------------
// Mortar Shockwaves
//---------------------------------------------------------------------------
datablock ShockwaveData(UnderwaterMortarShockwave)
{
width = 6.0;
numSegments = 32;
numVertSegments = 6;
velocity = 10;
acceleration = 20.0;
lifetimeMS = 900;
height = 1.0;
verticalCurve = 0.5;
is2D = false;
texture[0] = "special/shockwave4";
texture[1] = "special/gradient";
texWrap = 6.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
colors[0] = "0.4 0.4 1.0 0.50";
colors[1] = "0.4 0.4 1.0 0.25";
colors[2] = "0.4 0.4 1.0 0.0";
mapToTerrain = true;
orientToNormal = false;
renderBottom = false;
};
datablock ShockwaveData(MortarShockwave)
{
width = 6.0;
numSegments = 32;
numVertSegments = 6;
velocity = 15;
acceleration = 20.0;
lifetimeMS = 500;
height = 1.0;
verticalCurve = 0.5;
is2D = false;
texture[0] = "special/shockwave4";
texture[1] = "special/gradient";
texWrap = 6.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
colors[0] = "0.4 1.0 0.4 0.50";
colors[1] = "0.4 1.0 0.4 0.25";
colors[2] = "0.4 1.0 0.4 0.0";
mapToTerrain = true;
orientToNormal = false;
renderBottom = false;
};
//--------------------------------------------------------------------------
// Mortar Explosion Particle effects
//--------------------------------------
datablock ParticleData( MortarCrescentParticle )
{
dragCoefficient = 2;
gravityCoefficient = 0.0;
inheritedVelFactor = 0.2;
constantAcceleration = -0.0;
lifetimeMS = 600;
lifetimeVarianceMS = 000;
textureName = "special/crescent3";
colors[0] = "0.7 1.0 0.7 1.0";
colors[1] = "0.7 1.0 0.7 0.5";
colors[2] = "0.7 1.0 0.7 0.0";
sizes[0] = 4.0;
sizes[1] = 8.0;
sizes[2] = 9.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData( MortarCrescentEmitter )
{
ejectionPeriodMS = 25;
periodVarianceMS = 0;
ejectionVelocity = 40;
velocityVariance = 5.0;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 80;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
orientParticles = true;
lifetimeMS = 200;
particles = "MortarCrescentParticle";
};
datablock ParticleData(MortarExplosionSmoke)
{
dragCoeffiecient = 0.4;
gravityCoefficient = -0.30; // rises slowly
inheritedVelFactor = 0.025;
lifetimeMS = 1250;
lifetimeVarianceMS = 500;
textureName = "particleTest";
useInvAlpha = true;
spinRandomMin = -100.0;
spinRandomMax = 100.0;
textureName = "special/Smoke/bigSmoke";
colors[0] = "0.7 0.7 0.7 0.0";
colors[1] = "0.4 0.4 0.4 0.5";
colors[2] = "0.4 0.4 0.4 0.5";
colors[3] = "0.4 0.4 0.4 0.0";
sizes[0] = 5.0;
sizes[1] = 6.0;
sizes[2] = 10.0;
sizes[3] = 12.0;
times[0] = 0.0;
times[1] = 0.333;
times[2] = 0.666;
times[3] = 1.0;
};
datablock ParticleEmitterData(MortarExplosionSmokeEmitter)
{
ejectionPeriodMS = 10;
periodVarianceMS = 0;
ejectionOffset = 8.0;
ejectionVelocity = 1.25;
velocityVariance = 1.2;
thetaMin = 0.0;
thetaMax = 90.0;
lifetimeMS = 500;
particles = "MortarExplosionSmoke";
};
//---------------------------------------------------------------------------
// Underwater Explosion
//---------------------------------------------------------------------------
datablock ParticleData(UnderwaterExplosionSparks)
{
dragCoefficient = 0;
gravityCoefficient = 0.0;
inheritedVelFactor = 0.2;
constantAcceleration = 0.0;
lifetimeMS = 500;
lifetimeVarianceMS = 350;
textureName = "special/crescent3";
colors[0] = "0.4 0.4 1.0 1.0";
colors[1] = "0.4 0.4 1.0 1.0";
colors[2] = "0.4 0.4 1.0 0.0";
sizes[0] = 3.5;
sizes[1] = 3.5;
sizes[2] = 3.5;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(UnderwaterExplosionSparksEmitter)
{
ejectionPeriodMS = 2;
periodVarianceMS = 0;
ejectionVelocity = 17;
velocityVariance = 4;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 60;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
orientParticles = true;
lifetimeMS = 100;
particles = "UnderwaterExplosionSparks";
};
datablock ParticleData(MortarExplosionBubbleParticle)
{
dragCoefficient = 0.0;
gravityCoefficient = -0.25;
inheritedVelFactor = 0.0;
constantAcceleration = 0.0;
lifetimeMS = 1500;
lifetimeVarianceMS = 600;
useInvAlpha = false;
textureName = "special/bubbles";
spinRandomMin = -100.0;
spinRandomMax = 100.0;
colors[0] = "0.7 0.8 1.0 0.0";
colors[1] = "0.7 0.8 1.0 0.4";
colors[2] = "0.7 0.8 1.0 0.0";
sizes[0] = 2.0;
sizes[1] = 2.0;
sizes[2] = 2.0;
times[0] = 0.0;
times[1] = 0.8;
times[2] = 1.0;
};
datablock ParticleEmitterData(MortarExplosionBubbleEmitter)
{
ejectionPeriodMS = 5;
periodVarianceMS = 0;
ejectionVelocity = 1.0;
ejectionOffset = 7.0;
velocityVariance = 0.5;
thetaMin = 0;
thetaMax = 80;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
particles = "MortarExplosionBubbleParticle";
};
datablock DebrisData( UnderwaterMortarDebris )
{
emitters[0] = MortarExplosionBubbleEmitter;
explodeOnMaxBounce = true;
elasticity = 0.4;
friction = 0.2;
lifetime = 1.5;
lifetimeVariance = 0.2;
numBounces = 1;
};
datablock ExplosionData(UnderwaterMortarSubExplosion1)
{
explosionShape = "disc_explosion.dts";
faceViewer = true;
delayMS = 100;
offset = 3.0;
playSpeed = 1.5;
sizes[0] = "0.75 0.75 0.75";
sizes[1] = "1.0 1.0 1.0";
sizes[2] = "0.5 0.5 0.5";
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ExplosionData(UnderwaterMortarSubExplosion2)
{
explosionShape = "disc_explosion.dts";
faceViewer = true;
delayMS = 50;
offset = 3.0;
playSpeed = 0.75;
sizes[0] = "1.5 1.5 1.5";
sizes[1] = "1.5 1.5 1.5";
sizes[2] = "1.0 1.0 1.0";
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ExplosionData(UnderwaterMortarSubExplosion3)
{
explosionShape = "disc_explosion.dts";
faceViewer = true;
delayMS = 0;
offset = 0.0;
playSpeed = 0.5;
sizes[0] = "1.0 1.0 1.0";
sizes[1] = "2.0 2.0 2.0";
sizes[2] = "1.5 1.5 1.5";
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ExplosionData(UnderwaterMortarExplosion)
{
soundProfile = UnderwaterMortarExplosionSound;
shockwave = UnderwaterMortarShockwave;
shockwaveOnTerrain = true;
subExplosion[0] = UnderwaterMortarSubExplosion1;
subExplosion[1] = UnderwaterMortarSubExplosion2;
subExplosion[2] = UnderwaterMortarSubExplosion3;
emitter[0] = MortarExplosionBubbleEmitter;
emitter[1] = UnderwaterExplosionSparksEmitter;
shakeCamera = true;
camShakeFreq = "8.0 9.0 7.0";
camShakeAmp = "100.0 100.0 100.0";
camShakeDuration = 1.3;
camShakeRadius = 25.0;
};
//---------------------------------------------------------------------------
// Explosion
//---------------------------------------------------------------------------
datablock ExplosionData(MortarSubExplosion1)
{
explosionShape = "mortar_explosion.dts";
faceViewer = true;
delayMS = 100;
offset = 5.0;
playSpeed = 1.5;
sizes[0] = "0.5 0.5 0.5";
sizes[1] = "0.5 0.5 0.5";
times[0] = 0.0;
times[1] = 1.0;
};
datablock ExplosionData(MortarSubExplosion2)
{
explosionShape = "mortar_explosion.dts";
faceViewer = true;
delayMS = 50;
offset = 5.0;
playSpeed = 1.0;
sizes[0] = "1.0 1.0 1.0";
sizes[1] = "1.0 1.0 1.0";
times[0] = 0.0;
times[1] = 1.0;
};
datablock ExplosionData(MortarSubExplosion3)
{
explosionShape = "mortar_explosion.dts";
faceViewer = true;
delayMS = 0;
offset = 0.0;
playSpeed = 0.7;
sizes[0] = "1.0 1.0 1.0";
sizes[1] = "2.0 2.0 2.0";
times[0] = 0.0;
times[1] = 1.0;
};
datablock ExplosionData(MortarExplosion)
{
soundProfile = MortarExplosionSound;
shockwave = MortarShockwave;
shockwaveOnTerrain = true;
subExplosion[0] = MortarSubExplosion1;
subExplosion[1] = MortarSubExplosion2;
subExplosion[2] = MortarSubExplosion3;
emitter[0] = MortarExplosionSmokeEmitter;
emitter[1] = MortarCrescentEmitter;
shakeCamera = true;
camShakeFreq = "8.0 9.0 7.0";
camShakeAmp = "100.0 100.0 100.0";
camShakeDuration = 1.3;
camShakeRadius = 25.0;
};
//---------------------------------------------------------------------------
// Smoke particles
//---------------------------------------------------------------------------
datablock ParticleData(MortarSmokeParticle)
{
dragCoeffiecient = 0.4;
gravityCoefficient = -0.3; // rises slowly
inheritedVelFactor = 0.125;
lifetimeMS = 1200;
lifetimeVarianceMS = 200;
useInvAlpha = true;
spinRandomMin = -100.0;
spinRandomMax = 100.0;
animateTexture = false;
textureName = "special/Smoke/bigSmoke";
colors[0] = "0.7 1.0 0.7 0.5";
colors[1] = "0.3 0.7 0.3 0.8";
colors[2] = "0.0 0.0 0.0 0.0";
sizes[0] = 1.0;
sizes[1] = 2.0;
sizes[2] = 4.5;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(MortarSmokeEmitter)
{
ejectionPeriodMS = 10;
periodVarianceMS = 3;
ejectionVelocity = 2.25;
velocityVariance = 0.55;
thetaMin = 0.0;
thetaMax = 40.0;
particles = "MortarSmokeParticle";
};
//--------------------------------------------------------------------------
// Projectile
//--------------------------------------
datablock GrenadeProjectileData(MortarShot)
{
projectileShapeName = "mortar_projectile.dts";
emitterDelay = -1;
directDamage = 0.0;
hasDamageRadius = true;
indirectDamage = 1.0;
damageRadius = 19.0; // z0dd - ZOD, 8/13/02. Was 20.0
radiusDamageType = $DamageType::Mortar;
kickBackStrength = 2500;
explosion = "MortarExplosion";
underwaterExplosion = "UnderwaterMortarExplosion";
velInheritFactor = 0.5;
splash = MortarSplash;
depthTolerance = 10.0; // depth at which it uses underwater explosion
baseEmitter = MortarSmokeEmitter;
bubbleEmitter = MortarBubbleEmitter;
grenadeElasticity = 0.15;
grenadeFriction = 0.4;
armingDelayMS = 1500; // z0dd - ZOD, 4/14/02. Was 2000
gravityMod = 1.1; // z0dd - ZOD, 5/18/02. Make mortar projectile heavier, less floaty
muzzleVelocity = 75.95; // z0dd - ZOD, 8/13/02. More velocity to compensate for higher gravity. Was 63.7
drag = 0.1;
sound = MortarProjectileSound;
hasLight = true;
lightRadius = 4;
lightColor = "0.05 0.2 0.05";
hasLightUnderwaterColor = true;
underWaterLightColor = "0.05 0.075 0.2";
};
//--------------------------------------------------------------------------
// Ammo
//--------------------------------------
datablock ItemData(MortarAmmo)
{
className = Ammo;
catagory = "Ammo";
shapeFile = "ammo_mortar.dts";
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "some mortar ammo";
computeCRC = true;
};
//--------------------------------------------------------------------------
// Weapon
//--------------------------------------
datablock ItemData(Mortar)
{
className = Weapon;
catagory = "Spawn Items";
shapeFile = "weapon_mortar.dts";
image = MortarImage;
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "a mortar gun";
computeCRC = true;
emap = true;
};
datablock ShapeBaseImageData(MortarImage)
{
className = WeaponImage;
shapeFile = "weapon_mortar.dts";
item = Mortar;
ammo = MortarAmmo;
offset = "0 0 0";
emap = true;
projectile = MortarShot;
projectileType = GrenadeProjectile;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateSound[0] = MortarSwitchSound;
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "Fire";
//stateSound[2] = MortarIdleSound;
stateName[3] = "Fire";
stateSequence[3] = "Recoil";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.8;
stateFire[3] = true;
stateRecoil[3] = LightRecoil;
stateAllowImageChange[3] = false;
stateScript[3] = "onFire";
stateSound[3] = MortarFireSound;
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 2.0;
stateAllowImageChange[4] = false;
stateSequence[4] = "Reload";
stateSound[4] = MortarReloadSound;
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
stateName[6] = "DryFire";
stateSound[6] = MortarDryFireSound;
stateTimeoutValue[6] = 1.5;
stateTransitionOnTimeout[6] = "NoAmmo";
};

493
scripts/weapons/plasma.cs Normal file
View file

@ -0,0 +1,493 @@
//--------------------------------------
// Plasma rifle
//--------------------------------------
//--------------------------------------------------------------------------
// Force-Feedback Effects
//--------------------------------------
datablock EffectProfile(PlasmaSwitchEffect)
{
effectname = "weapons/plasma_rifle_activate";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(PlasmaFireEffect)
{
effectname = "weapons/plasma_fire";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(PlasmaDryFireEffect)
{
effectname = "weapons/plasma_dryfire";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(PlasmaIdleEffect)
{
effectname = "weapons/plasma_rifle_idle";
minDistance = 2.5;
};
datablock EffectProfile(PlasmaReloadEffect)
{
effectname = "weapons/plasma_rifle_reload";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(PlasmaExpEffect)
{
effectname = "explosions/explosion.xpl10";
minDistance = 10;
maxDistance = 25;
};
//--------------------------------------------------------------------------
// Sounds
//--------------------------------------
datablock AudioProfile(PlasmaSwitchSound)
{
filename = "fx/weapons/plasma_rifle_activate.wav";
description = AudioClosest3d;
preload = true;
effect = PlasmaSwitchEffect;
};
datablock AudioProfile(PlasmaFireSound)
{
filename = "fx/weapons/plasma_rifle_fire.wav";
description = AudioDefault3d;
preload = true;
effect = PlasmaFireEffect;
};
datablock AudioProfile(PlasmaIdleSound)
{
filename = "fx/weapons/plasma_rifle_idle.wav";
description = ClosestLooping3d;
preload = true;
//effect = PlasmaIdleEffect;
};
datablock AudioProfile(PlasmaReloadSound)
{
filename = "fx/weapons/plasma_rifle_reload.wav";
description = Audioclosest3d;
preload = true;
effect = PlasmaReloadEffect;
};
datablock AudioProfile(plasmaExpSound)
{
filename = "fx/explosions/explosion.xpl10.wav";
description = AudioExplosion3d;
effect = PlasmaExpEffect;
};
datablock AudioProfile(PlasmaProjectileSound)
{
filename = "fx/weapons/plasma_rifle_projectile.WAV";
description = ProjectileLooping3d;
preload = true;
};
datablock AudioProfile(PlasmaDryFireSound)
{
filename = "fx/weapons/plasma_dryfire.wav";
description = AudioClose3d;
preload = true;
effect = PlasmaDryFireEffect;
};
datablock AudioProfile(PlasmaFireWetSound)
{
filename = "fx/weapons/plasma_fizzle.wav";
description = AudioClose3d;
preload = true;
};
//--------------------------------------------------------------------------
// Explosion
//--------------------------------------
datablock ParticleData(PlasmaExplosionParticle)
{
dragCoefficient = 2;
gravityCoefficient = 0.2;
inheritedVelFactor = 0.2;
constantAcceleration = 0.0;
lifetimeMS = 750;
lifetimeVarianceMS = 150;
textureName = "particleTest";
colors[0] = "0.56 0.36 0.26 1.0";
colors[1] = "0.56 0.36 0.26 0.0";
sizes[0] = 0.5;
sizes[1] = 2;
};
datablock ParticleEmitterData(PlasmaExplosionEmitter)
{
ejectionPeriodMS = 7;
periodVarianceMS = 0;
ejectionVelocity = 5;
velocityVariance = 1.0;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 60;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
particles = "PlasmaExplosionParticle";
};
datablock ExplosionData(PlasmaBoltExplosion)
{
explosionShape = "effect_plasma_explosion.dts";
soundProfile = plasmaExpSound;
particleEmitter = PlasmaExplosionEmitter;
particleDensity = 150;
particleRadius = 1.25;
faceViewer = true;
sizes[0] = "1.0 1.0 1.0";
sizes[1] = "1.0 1.0 1.0";
times[0] = 0.0;
times[1] = 1.5;
};
//--------------------------------------------------------------------------
// Splash
//--------------------------------------------------------------------------
datablock ParticleData(PlasmaMist)
{
dragCoefficient = 2.0;
gravityCoefficient = -0.05;
inheritedVelFactor = 0.0;
constantAcceleration = 0.0;
lifetimeMS = 400;
lifetimeVarianceMS = 100;
useInvAlpha = false;
spinRandomMin = -90.0;
spinRandomMax = 500.0;
textureName = "particleTest";
colors[0] = "0.7 0.8 1.0 1.0";
colors[1] = "0.7 0.8 1.0 0.5";
colors[2] = "0.7 0.8 1.0 0.0";
sizes[0] = 0.5;
sizes[1] = 0.5;
sizes[2] = 0.8;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(PlasmaMistEmitter)
{
ejectionPeriodMS = 5;
periodVarianceMS = 0;
ejectionVelocity = 3.0;
velocityVariance = 2.0;
ejectionOffset = 0.0;
thetaMin = 85;
thetaMax = 85;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
lifetimeMS = 250;
particles = "PlasmaMist";
};
datablock ParticleData( PlasmaSplashParticle2 )
{
dragCoeffiecient = 0.4;
gravityCoefficient = -0.03; // rises slowly
inheritedVelFactor = 0.025;
lifetimeMS = 600;
lifetimeVarianceMS = 300;
textureName = "particleTest";
useInvAlpha = false;
spinRandomMin = -200.0;
spinRandomMax = 200.0;
colors[0] = "0.7 0.8 1.0 1.0";
colors[1] = "0.7 0.8 1.0 0.5";
colors[2] = "0.7 0.8 1.0 0.0";
sizes[0] = 0.5;
sizes[1] = 1.0;
sizes[2] = 2.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData( PlasmaSplashEmitter2 )
{
ejectionPeriodMS = 25;
ejectionOffset = 0.2;
periodVarianceMS = 0;
ejectionVelocity = 2.25;
velocityVariance = 0.50;
thetaMin = 0.0;
thetaMax = 30.0;
lifetimeMS = 250;
particles = "PlasmaSplashParticle2";
};
datablock ParticleData( PlasmaSplashParticle )
{
dragCoefficient = 1;
gravityCoefficient = 0.2;
inheritedVelFactor = 0.2;
constantAcceleration = -0.0;
lifetimeMS = 600;
lifetimeVarianceMS = 0;
textureName = "special/droplet";
colors[0] = "0.7 0.8 1.0 1.0";
colors[1] = "0.7 0.8 1.0 0.5";
colors[2] = "0.7 0.8 1.0 0.0";
sizes[0] = 0.5;
sizes[1] = 0.5;
sizes[2] = 0.5;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData( PlasmaSplashEmitter )
{
ejectionPeriodMS = 1;
periodVarianceMS = 0;
ejectionVelocity = 3;
velocityVariance = 1.0;
ejectionOffset = 0.0;
thetaMin = 60;
thetaMax = 80;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
orientParticles = true;
lifetimeMS = 100;
particles = "PlasmaSplashParticle";
};
datablock SplashData(PlasmaSplash)
{
numSegments = 15;
ejectionFreq = 0.0001;
ejectionAngle = 45;
ringLifetime = 0.5;
lifetimeMS = 400;
velocity = 5.0;
startRadius = 0.0;
acceleration = -3.0;
texWrap = 5.0;
texture = "special/water2";
emitter[0] = PlasmaSplashEmitter;
emitter[1] = PlasmaSplashEmitter2;
emitter[2] = PlasmaMistEmitter;
colors[0] = "0.7 0.8 1.0 0.0";
colors[1] = "0.7 0.8 1.0 1.0";
colors[2] = "0.7 0.8 1.0 0.0";
colors[3] = "0.7 0.8 1.0 0.0";
times[0] = 0.0;
times[1] = 0.4;
times[2] = 0.8;
times[3] = 1.0;
};
//--------------------------------------------------------------------------
// Projectile
//--------------------------------------
datablock ParticleData(PlasmaRifleParticle)
{
dragCoefficient = 2.75;
gravityCoefficient = 0.1;
inheritedVelFactor = 0.2;
constantAcceleration = 0.0;
lifetimeMS = 550;
lifetimeVarianceMS = 0;
textureName = "particleTest";
colors[0] = "0.46 0.36 0.26 1.0";
colors[1] = "0.46 0.36 0.26 0.0";
sizes[0] = 0.25;
sizes[1] = 0.20;
};
datablock ParticleEmitterData(PlasmaRifleEmitter)
{
ejectionPeriodMS = 3;
periodVarianceMS = 0;
ejectionVelocity = 10;
velocityVariance = 1.0;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 12;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvance = true;
particles = "PlasmaRifleParticle";
};
//--------------------------------------------------------------------------
// Projectile
//--------------------------------------
datablock LinearFlareProjectileData(PlasmaBolt)
{
projectileShapeName = "plasmabolt.dts";
scale = "2.0 2.0 2.0";
faceViewer = true;
directDamage = 0.0;
hasDamageRadius = true;
indirectDamage = 0.45;
damageRadius = 4.0;
kickBackStrength = 0.0;
radiusDamageType = $DamageType::Plasma;
explosion = "PlasmaBoltExplosion";
splash = PlasmaSplash;
dryVelocity = 70.0; // z0dd - ZOD, 7/20/02. Faster plasma projectile. was 55
wetVelocity = -1;
velInheritFactor = 0.3;
fizzleTimeMS = 2000;
lifetimeMS = 3000;
explodeOnDeath = false;
reflectOnWaterImpactAngle = 0.0;
explodeOnWaterImpact = true;
deflectionOnWaterImpact = 0.0;
fizzleUnderwaterMS = -1;
//activateDelayMS = 100;
activateDelayMS = -1;
size[0] = 0.2;
size[1] = 0.5;
size[2] = 0.1;
numFlares = 35;
flareColor = "1 0.75 0.25";
flareModTexture = "flaremod";
flareBaseTexture = "flarebase";
sound = PlasmaProjectileSound;
fireSound = PlasmaFireSound;
wetFireSound = PlasmaFireWetSound;
hasLight = true;
lightRadius = 3.0;
lightColor = "1 0.75 0.25";
};
//--------------------------------------------------------------------------
// Ammo
//--------------------------------------
datablock ItemData(PlasmaAmmo)
{
className = Ammo;
catagory = "Ammo";
shapeFile = "ammo_plasma.dts";
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "some plasma gun ammo";
};
//--------------------------------------------------------------------------
// Weapon
//--------------------------------------
datablock ItemData(Plasma)
{
className = Weapon;
catagory = "Spawn Items";
shapeFile = "weapon_plasma.dts";
image = PlasmaImage;
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "a plasma gun";
};
datablock ShapeBaseImageData(PlasmaImage)
{
className = WeaponImage;
shapeFile = "weapon_plasma.dts";
item = Plasma;
ammo = PlasmaAmmo;
offset = "0 0 0";
projectile = PlasmaBolt;
projectileType = LinearFlareProjectile;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateSound[0] = PlasmaSwitchSound;
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "CheckWet";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.1;
stateFire[3] = true;
stateRecoil[3] = LightRecoil;
stateAllowImageChange[3] = false;
stateScript[3] = "onFire";
stateEmitterTime[3] = 0.2;
stateSound[3] = PlasmaFireSound;
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 0.6;
stateAllowImageChange[4] = false;
stateSequence[4] = "Reload";
stateSound[4] = PlasmaReloadSound;
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
stateName[6] = "DryFire";
stateSound[6] = PlasmaDryFireSound;
stateTimeoutValue[6] = 1.5;
stateTransitionOnTimeout[6] = "NoAmmo";
stateName[7] = "WetFire";
stateSound[7] = PlasmaFireWetSound;
stateTimeoutValue[7] = 1.5;
stateTransitionOnTimeout[7] = "Ready";
stateName[8] = "CheckWet";
stateTransitionOnWet[8] = "WetFire";
stateTransitionOnNotWet[8] = "Fire";
};

View file

@ -0,0 +1,297 @@
//--------------------------------------------------------------------------
// Shock Lance
//
//
//--------------------------------------------------------------------------
datablock EffectProfile(ShockLanceSwitchEffect)
{
effectname = "weapons/shocklance_activate";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(ShockLanceFireEffect)
{
effectname = "weapons/shocklance_fire";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(ShockLanceReloadEffect)
{
effectname = "weapons/shocklance_reload";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock AudioProfile(ShockLanceSwitchSound)
{
filename = "fx/weapons/shocklance_activate.wav";
description = AudioClosest3d;
preload = true;
effect = ShockLanceSwitchEffect;
};
//--------------------------------------------------------------------------
// Explosion
//--------------------------------------
datablock AudioProfile(ShockLanceHitSound)
{
filename = "fx/weapons/shocklance_fire.WAV";
description = AudioClose3d;
preload = true;
effect = ShockLanceFireEffect;
};
datablock AudioProfile(ShockLanceReloadSound)
{
filename = "fx/weapons/shocklance_reload.WAV";
description = AudioClosest3d;
preload = true;
effect = ShockLanceReloadEffect;
};
datablock AudioProfile(ShockLanceDryFireSound)
{
filename = "fx/weapons/shocklance_dryfire.WAV";
description = AudioClose3d;
preload = true;
effect = ShockLanceReloadEffect;
};
datablock AudioProfile(ShockLanceMissSound)
{
filename = "fx/weapons/shocklance_miss.WAV";
description = AudioExplosion3d;
preload = true;
};
//--------------------------------------------------------------------------
// Particle data
//--------------------------------------------------------------------------
datablock ParticleData(ShockParticle)
{
dragCoeffiecient = 0.0;
gravityCoefficient = -0.0;
inheritedVelFactor = 0.0;
lifetimeMS = 1000;
lifetimeVarianceMS = 0;
textureName = "particleTest";
useInvAlpha = false;
spinRandomMin = -100.0;
spinRandomMax = 100.0;
numParts = 50;
animateTexture = true;
framesPerSec = 26;
animTexName[00] = "special/Explosion/exp_0002";
animTexName[01] = "special/Explosion/exp_0004";
animTexName[02] = "special/Explosion/exp_0006";
animTexName[03] = "special/Explosion/exp_0008";
animTexName[04] = "special/Explosion/exp_0010";
animTexName[05] = "special/Explosion/exp_0012";
animTexName[06] = "special/Explosion/exp_0014";
animTexName[07] = "special/Explosion/exp_0016";
animTexName[08] = "special/Explosion/exp_0018";
animTexName[09] = "special/Explosion/exp_0020";
animTexName[10] = "special/Explosion/exp_0022";
animTexName[11] = "special/Explosion/exp_0024";
animTexName[12] = "special/Explosion/exp_0026";
animTexName[13] = "special/Explosion/exp_0028";
animTexName[14] = "special/Explosion/exp_0030";
animTexName[15] = "special/Explosion/exp_0032";
animTexName[16] = "special/Explosion/exp_0034";
animTexName[17] = "special/Explosion/exp_0036";
animTexName[18] = "special/Explosion/exp_0038";
animTexName[19] = "special/Explosion/exp_0040";
animTexName[20] = "special/Explosion/exp_0042";
animTexName[21] = "special/Explosion/exp_0044";
animTexName[22] = "special/Explosion/exp_0046";
animTexName[23] = "special/Explosion/exp_0048";
animTexName[24] = "special/Explosion/exp_0050";
animTexName[25] = "special/Explosion/exp_0052";
colors[0] = "0.5 0.5 1.0 1.0";
colors[1] = "0.5 0.5 1.0 0.5";
colors[2] = "0.25 0.25 1.0 0.0";
sizes[0] = 0.5;
sizes[1] = 0.5;
sizes[2] = 0.5;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(ShockParticleEmitter)
{
ejectionPeriodMS = 1;
periodVarianceMS = 0;
ejectionVelocity = 0.25;
velocityVariance = 0.0;
thetaMin = 0.0;
thetaMax = 30.0;
particles = "ShockParticle";
};
//--------------------------------------------------------------------------
// Shockwave
//--------------------------------------------------------------------------
datablock ShockwaveData( ShocklanceHit )
{
width = 0.5;
numSegments = 20;
numVertSegments = 1;
velocity = 0.25;
acceleration = 1.0;
lifetimeMS = 600;
height = 0.1;
verticalCurve = 0.5;
mapToTerrain = false;
renderBottom = false;
orientToNormal = true;
texture[0] = "special/shocklanceHit";
texture[1] = "special/gradient";
texWrap = 3.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
colors[0] = "1.0 1.0 1.0 1.0";
colors[1] = "1.0 1.0 1.0 0.5";
colors[2] = "1.0 1.0 1.0 0.0";
};
//--------------------------------------
// Projectile
//--------------------------------------
datablock ShockLanceProjectileData(BasicShocker)
{
directDamage = 0.45;
radiusDamageType = $DamageType::ShockLance;
kickBackStrength = 2600; // z0dd - ZOD, 3/30/02. More lance kick. was 2500
velInheritFactor = 0;
sound = "";
zapDuration = 1.0;
impulse = 1800;
boltLength = 16.0; // z0dd - ZOD, 3/30/02. was 14.0
extension = 16.0; // script variable indicating distance you can shock people from. // z0dd - ZOD, 3/30/02. Was 14.0
lightningFreq = 25.0;
lightningDensity = 3.0;
lightningAmp = 0.25;
lightningWidth = 0.05;
shockwave = ShocklanceHit;
boltSpeed[0] = 2.0;
boltSpeed[1] = -0.5;
texWrap[0] = 1.5;
texWrap[1] = 1.5;
startWidth[0] = 0.3;
endWidth[0] = 0.6;
startWidth[1] = 0.3;
endWidth[1] = 0.6;
texture[0] = "special/shockLightning01";
texture[1] = "special/shockLightning02";
texture[2] = "special/shockLightning03";
texture[3] = "special/ELFBeam";
emitter[0] = ShockParticleEmitter;
};
//--------------------------------------
// Rifle and item...
//--------------------------------------
datablock ItemData(ShockLance)
{
className = Weapon;
catagory = "Spawn Items";
shapeFile = "weapon_shocklance.dts";
image = ShockLanceImage;
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "a shocklance";
computeCRC = true;
emap = true;
};
datablock ShapeBaseImageData(ShockLanceImage)
{
classname = WeaponImage;
shapeFile = "weapon_shocklance.dts";
item = ShockLance;
offset = "0 0 0";
emap = true;
projectile = BasicShocker;
usesEnergy = true;
missEnergy = 0;
hitEnergy = 3; // z0dd - ZOD, 8/20/02. Was 15.
minEnergy = 3; // z0dd - ZOD, 8/20/02. Was 15. // needs to change to be datablock's energy drain for a hit
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateSound[0] = ShockLanceSwitchSound;
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "CheckWet";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.5;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateSequence[3] = "Fire";
stateScript[3] = "onFire";
stateSound[3] = ShockLanceDryFireSound;
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 2.0;
stateAllowImageChange[4] = false;
stateSequence[4] = "Reload";
stateSound[4] = ShockLanceReloadSound;
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Ready";
stateName[6] = "DryFire";
stateSound[6] = ShockLanceDryFireSound;
stateTimeoutValue[6] = 1.0;
stateTransitionOnTimeout[6] = "Ready";
stateName[7] = "CheckWet";
stateTransitionOnWet[7] = "DryFire";
stateTransitionOnNotWet[7] = "Fire";
};

View file

@ -0,0 +1,216 @@
//--------------------------------------------------------------------------
// Targeting laser
//
//--------------------------------------------------------------------------
datablock EffectProfile(TargetingLaserSwitchEffect)
{
effectname = "weapons/generic_switch";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(TargetingLaserPaintEffect)
{
effectname = "weapons/targetinglaser_paint";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock AudioProfile(TargetingLaserSwitchSound)
{
filename = "fx/weapons/generic_switch.wav";
description = AudioClosest3d;
preload = true;
effect = TargetingLaserSwitchEffect;
};
datablock AudioProfile(TargetingLaserPaintSound)
{
filename = "fx/weapons/targetinglaser_paint.wav";
description = CloseLooping3d;
preload = true;
effect = TargetingLaserPaintEffect;
};
//--------------------------------------
// Projectile
//--------------------------------------
datablock TargetProjectileData(BasicTargeter)
{
directDamage = 0.0;
hasDamageRadius = false;
indirectDamage = 0.0;
damageRadius = 0.0;
velInheritFactor = 1.0;
maxRifleRange = 1000;
beamColor = "0.1 1.0 0.1";
startBeamWidth = 0.20;
pulseBeamWidth = 0.15;
beamFlareAngle = 3.0;
minFlareSize = 0.0;
maxFlareSize = 400.0;
pulseSpeed = 6.0;
pulseLength = 0.150;
textureName[0] = "special/nonlingradient";
textureName[1] = "special/flare";
textureName[2] = "special/pulse";
textureName[3] = "special/expFlare";
beacon = true;
};
//--------------------------------------
// Rifle and item...
//--------------------------------------
datablock ItemData(TargetingLaser)
{
className = Weapon;
catagory = "Spawn Items";
shapeFile = "weapon_targeting.dts";
image = TargetingLaserImage;
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "a targeting laser rifle";
computeCRC = true;
};
datablock ItemData(Light)
{
className = Pack;
catagory = "Packs";
shapeFile = "turret_muzzlepoint.dts";
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
rotate = true;
image = "MiningToolImage";
pickUpName = "a light"; //if this shows up, then something went wrong
lightOnlyStatic = true;
lightType = "PulsingLight";
lightColor = "0.1 1.0 0.1";
lightTime = 1200;
lightRadius = 2.5; //It's just a mining tool folks..
computeCRC = true;
emap = true;
};
datablock ShapeBaseImageData(TargetingLaserImage)
{
className = WeaponImage;
shapeFile = "weapon_targeting.dts";
item = TargetingLaser;
offset = "0 0 0";
projectile = BasicTargeter;
projectileType = TargetProjectile;
deleteLastProjectile = true;
usesEnergy = true;
minEnergy = 3;
stateName[0] = "Activate";
stateSequence[0] = "Activate";
stateSound[0] = TargetingLaserSwitchSound;
stateTimeoutValue[0] = 0.5;
stateTransitionOnTimeout[0] = "ActivateReady";
stateName[1] = "ActivateReady";
stateTransitionOnAmmo[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "Fire";
stateName[3] = "Fire";
stateEnergyDrain[3] = 3;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateScript[3] = "onFire";
stateTransitionOnTriggerUp[3] = "Deconstruction";
stateTransitionOnNoAmmo[3] = "Deconstruction";
stateSound[3] = TargetingLaserPaintSound;
stateName[4] = "NoAmmo";
stateTransitionOnAmmo[4] = "Ready";
stateName[5] = "Deconstruction";
stateScript[5] = "deconstruct";
stateTransitionOnTimeout[5] = "Ready";
};
package TGLaser{
function TargetingLaserImage::OnFire(%this,%obj,%slot)
{
%obj.isfiringlaser = true;
LaserLoop(%obj);
Parent::OnFire(%this,%obj,%slot);
}
function TargetingLaserImage::Deconstruct(%this,%obj,%slot)
{
%obj.isfiringlaser = false;
Parent::Deconstruct(%This,%obj,%slot);
}
function TargetingLaserImage::onUnMount(%data,%obj,%slot)
{
%obj.isfiringlaser = false;
Parent::onUnmount(%data,%obj,%slot);
}
function TargetingLaserImage::onMount(%data,%obj,%slot)
{
%obj.isfiringlaser = false;
Parent::onMount(%data,%obj,%slot);
}
};
ActivatePackage(TGLaser);
function LaserLoop(%obj)
{
if (!IsObject(%obj))
return;
cancel(%obj.laserloop);
if (!%obj.isfiringlaser)
return;
%pos = %obj.getMuzzlePoint($WeaponSlot);
%vec = %obj.getMuzzleVector($WeaponSlot);
%targetpos = vectoradd(%pos,vectorscale(%vec,100));
%object = containerraycast(%pos,%targetpos,$TypeMasks::AllObjectType,%obj);
%pos = GetWord(%object, 1) SPC GetWord(%object, 2) SPC GetWord(%object, 3);
if (GetWord(%object, 1) !$= "")
{
%wp = new Item()
{
Datablock = Light;
Position = %pos;
};
schedule(50,0,"killit",%wp);
}
%obj.laserloop = schedule(50,0,"LaserLoop",%obj);
}
function killit(%obj)
{
%obj.delete();
}