mirror of
https://github.com/haydenmc/Krypton.git
synced 2026-01-20 12:04:48 +00:00
897 lines
22 KiB
C#
897 lines
22 KiB
C#
//--------------------------------------
|
|
// 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.5;
|
|
splash = GrenadeSplash;
|
|
|
|
baseEmitter = GrenadeSmokeEmitter;
|
|
bubbleEmitter = GrenadeBubbleEmitter;
|
|
|
|
grenadeElasticity = 0.35;
|
|
grenadeFriction = 0.2;
|
|
armingDelayMS = 1000;
|
|
muzzleVelocity = 47.00;
|
|
drag = 0.1;
|
|
};
|
|
|
|
|
|
//--------------------------------------------------------------------------
|
|
// 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";
|
|
};
|
|
|
|
function GrenadeLauncherImage::onMount(%this,%obj,%slot)
|
|
{
|
|
%obj.multinademode =0;
|
|
displaywepstat(%obj.client,"Krypton Multiple Grenade Launcher","","","Also known as the \"Multi-Nade\"\nSet to fire standard grenades.");
|
|
Parent::onMount(%this,%obj,%slot);
|
|
}
|
|
|
|
function GrenadeLauncherImage::onFire(%data, %obj, %slot)
|
|
{
|
|
|
|
if (%obj.multinademode == 0)
|
|
%data.projectile = BasicGrenade;
|
|
|
|
if (%obj.multinademode == 1)
|
|
%data.projectile = BasicConcGrenade;
|
|
|
|
if (%obj.multinademode == 2) {
|
|
if (isObject(%obj.lastProjectile))
|
|
%obj.lastProjectile.delete();
|
|
%data.projectile = BasicSmokeGrenade;
|
|
}
|
|
|
|
%data.lightStart = getSimTime();
|
|
|
|
if( %obj.station $= "" && %obj.isCloaked() )
|
|
{
|
|
if( %obj.respawnCloakThread !$= "" )
|
|
{
|
|
Cancel(%obj.respawnCloakThread);
|
|
%obj.setCloaked( false );
|
|
%obj.respawnCloakThread = "";
|
|
}
|
|
else
|
|
{
|
|
if( %obj.getEnergyLevel() > 20 )
|
|
{
|
|
%obj.setCloaked( false );
|
|
%obj.reCloak = %obj.schedule( 500, "setCloaked", true );
|
|
}
|
|
}
|
|
}
|
|
|
|
if( %obj.client > 0 )
|
|
{
|
|
%obj.setInvincibleMode(0 ,0.00);
|
|
%obj.setInvincible( false ); // fire your weapon and your invincibility goes away.
|
|
|
|
// Extra safety
|
|
if (%obj.inpeacesphere !$= "") {
|
|
|
|
return;
|
|
}
|
|
}
|
|
|
|
%vehicle = 0;
|
|
// ---------------------------------------------------------------------
|
|
// Code streamlining - ToS. z0ddm0d
|
|
if(%data.projectileSpread)
|
|
{
|
|
%vec = %obj.getMuzzleVector(%slot);
|
|
%x = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
|
|
%y = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
|
|
%z = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
|
|
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
|
|
%vector = MatrixMulVector(%mat, %vec);
|
|
}
|
|
else
|
|
{
|
|
%vector = %obj.getMuzzleVector(%slot);
|
|
}
|
|
%initialPos = %obj.getMuzzlePoint(%slot);
|
|
if (%data.muzzleSlots) {
|
|
%nrm = %vector;
|
|
%nrm2 = vectorNormalize(vectorCross("0 0 -1",%nrm));
|
|
%nrm3 = vectorNormalize(vectorCross(%nrm2,%nrm));
|
|
%offsetVec = %data.muzzleSlotOffset[%obj.currentMuzzleSlot];
|
|
|
|
%initialPos = vectorAdd(%initialPos,vectorScale(%nrm2,getWord(%offsetVec,0)));
|
|
%initialPos = vectorAdd(%initialPos,vectorScale(%nrm,getWord(%offsetVec,1)));
|
|
%initialPos = vectorAdd(%initialPos,vectorScale(%nrm3,getWord(%offsetVec,2)));
|
|
%obj.currentMuzzleSlot++;
|
|
if (%obj.currentMuzzleSlot > %data.muzzleSlots - 1)
|
|
%obj.currentMuzzleSlot = 0;
|
|
}
|
|
|
|
%p = new (%data.projectileType)() {
|
|
dataBlock = %data.projectile;
|
|
initialDirection = %vector;
|
|
initialPosition = %initialPos;
|
|
sourceObject = %obj;
|
|
sourceSlot = %slot;
|
|
vehicleObject = %vehicle;
|
|
};
|
|
// End streamlining
|
|
// ---------------------------------------------------------------------
|
|
|
|
%obj.lastProjectile = %p;
|
|
%obj.deleteLastProjectile = %data.deleteLastProjectile;
|
|
MissionCleanup.add(%p);
|
|
|
|
// AI hook
|
|
if(%obj.client)
|
|
%obj.client.projectile = %p;
|
|
|
|
|
|
%obj.decInventory(%data.ammo,1);
|
|
return %p;
|
|
|
|
|
|
} |