mirror of
https://github.com/PhantomGamesDevelopment/TWM2.git
synced 2026-07-13 07:24:51 +00:00
Initial Commit
This commit is contained in:
commit
bd51490b14
316 changed files with 150033 additions and 0 deletions
169
scripts/weapons/Grenades/cameraGrenade.cs
Normal file
169
scripts/weapons/Grenades/cameraGrenade.cs
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
// ------------------------------------------------------------------
|
||||
// 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
|
||||
// ------------------------------------------
|
||||
|
||||
// ------------------------------------------
|
||||
// sound datablocks
|
||||
// ------------------------------------------
|
||||
|
||||
datablock AudioProfile(CameraGrenadeActivateSound)
|
||||
{
|
||||
filename = "fx/weapons/grenade_camera_activate.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(CameraGrenadeAttachSound)
|
||||
{
|
||||
filename = "fx/weapons/grenade_camera_attach.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(CameraGrenadeExplosionSound)
|
||||
{
|
||||
filename = "fx/explosions/explosion.xpl10.wav";
|
||||
description = AudioExplosion3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// 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 = 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 = 150;
|
||||
cameraMinFov = 150;
|
||||
cameraMaxFov = 150;
|
||||
|
||||
neverUpdateControl = true;
|
||||
|
||||
canControl = true;
|
||||
canObserve = true;
|
||||
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...
|
||||
}
|
||||
|
||||
174
scripts/weapons/Grenades/concussionGrenade.cs
Normal file
174
scripts/weapons/Grenades/concussionGrenade.cs
Normal file
|
|
@ -0,0 +1,174 @@
|
|||
// grenade (thrown by hand) script
|
||||
// ------------------------------------------------------------------------
|
||||
datablock AudioProfile(ConcussionGrenadeExplosionSound)
|
||||
{
|
||||
filename = "fx/weapons/grenade_explode.wav";
|
||||
description = AudioExplosion3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Sparks
|
||||
//--------------------------------------------------------------------------
|
||||
datablock ParticleData(ConcussionGrenadeSparks)
|
||||
{
|
||||
dragCoefficient = 1;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.2;
|
||||
constantAcceleration = 0.0;
|
||||
lifetimeMS = 500;
|
||||
lifetimeVarianceMS = 350;
|
||||
textureName = "special/bigSpark";
|
||||
colors[0] = "0.56 0.36 1.0 1.0";
|
||||
colors[1] = "0.56 0.36 1.0 1.0";
|
||||
colors[2] = "1.0 0.36 1.0 0.0";
|
||||
sizes[0] = 0.5;
|
||||
sizes[1] = 0.25;
|
||||
sizes[2] = 0.25;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(ConcussionGrenadeSparkEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 1;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 12;
|
||||
velocityVariance = 6.75;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 180;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
orientParticles = true;
|
||||
lifetimeMS = 100;
|
||||
particles = "ConcussionGrenadeSparks";
|
||||
};
|
||||
|
||||
datablock ParticleData( ConcussionGrenadeCrescentParticle )
|
||||
{
|
||||
dragCoefficient = 2;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.2;
|
||||
constantAcceleration = -0.0;
|
||||
lifetimeMS = 600;
|
||||
lifetimeVarianceMS = 000;
|
||||
textureName = "special/crescent3";
|
||||
colors[0] = "0.8 0.8 1.0 1.00";
|
||||
colors[1] = "0.8 0.5 1.0 0.20";
|
||||
colors[2] = "0.2 0.8 1.0 0.0";
|
||||
sizes[0] = 2.0;
|
||||
sizes[1] = 4.0;
|
||||
sizes[2] = 5.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData( ConcussionGrenadeCrescentEmitter )
|
||||
{
|
||||
ejectionPeriodMS = 15;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 20;
|
||||
velocityVariance = 10.0;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 80;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
orientParticles = true;
|
||||
lifetimeMS = 200;
|
||||
particles = "ConcussionGrenadeCrescentParticle";
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Shockwave
|
||||
//--------------------------------------------------------------------------
|
||||
datablock ShockwaveData(ConcussionGrenadeShockwave)
|
||||
{
|
||||
width = 4.0;
|
||||
numSegments = 20;
|
||||
numVertSegments = 2;
|
||||
velocity = 5;
|
||||
acceleration = 10.0;
|
||||
lifetimeMS = 1000;
|
||||
height = 1.0;
|
||||
is2D = true;
|
||||
|
||||
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.8 0.8 1.0 1.00";
|
||||
colors[1] = "0.8 0.5 1.0 0.20";
|
||||
colors[2] = "0.2 0.8 1.0 0.0";
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Explosion
|
||||
//--------------------------------------------------------------------------
|
||||
datablock ExplosionData(ConcussionGrenadeExplosion)
|
||||
{
|
||||
soundProfile = ConcussionGrenadeExplosionSound;
|
||||
shockwave = ConcussionGrenadeShockwave;
|
||||
|
||||
emitter[0] = ConcussionGrenadeSparkEmitter;
|
||||
emitter[1] = ConcussionGrenadeCrescentEmitter;
|
||||
|
||||
shakeCamera = true;
|
||||
camShakeFreq = "4.0 5.0 4.5";
|
||||
camShakeAmp = "140.0 140.0 140.0";
|
||||
camShakeDuration = 1.0;
|
||||
camShakeRadius = 15.0;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Item Data
|
||||
//--------------------------------------------------------------------------
|
||||
datablock ItemData(ConcussionGrenadeThrown)
|
||||
{
|
||||
shapeFile = "grenade.dts";
|
||||
mass = 0.7;
|
||||
elasticity = 0.2;
|
||||
friction = 1;
|
||||
pickupRadius = 2;
|
||||
maxDamage = 0.5;
|
||||
explosion = ConcussionGrenadeExplosion;
|
||||
damageRadius = 15.0;
|
||||
radiusDamageType = $DamageType::Grenade;
|
||||
kickBackStrength = 3500;
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ItemData(ConcussionGrenade)
|
||||
{
|
||||
className = HandInventory;
|
||||
catagory = "Handheld";
|
||||
shapeFile = "grenade.dts";
|
||||
mass = 0.7;
|
||||
elasticity = 0.2;
|
||||
friction = 1;
|
||||
pickupRadius = 2;
|
||||
thrownItem = ConcussionGrenadeThrown;
|
||||
pickUpName = "some concussion grenades";
|
||||
isGrenade = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Functions:
|
||||
//--------------------------------------------------------------------------
|
||||
function ConcussionGrenadeThrown::onCollision( %data, %obj, %col )
|
||||
{
|
||||
// Do nothing...
|
||||
}
|
||||
|
||||
145
scripts/weapons/Grenades/flareGrenade.cs
Normal file
145
scripts/weapons/Grenades/flareGrenade.cs
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
// grenade (thrown by hand) script
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
datablock AudioProfile(FlareGrenadeBurnSound)
|
||||
{
|
||||
filename = "fx/weapons/grenade_flare_burn.wav";
|
||||
description = CloseLooping3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(FlareGrenadeExplosionSound)
|
||||
{
|
||||
filename = "fx/weapons/grenade_flare_burn.wav";
|
||||
description = CloseLooping3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Particle effects
|
||||
//--------------------------------------
|
||||
datablock ParticleData(FlareParticle)
|
||||
{
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = 0.15;
|
||||
inheritedVelFactor = 0.5;
|
||||
|
||||
lifetimeMS = 1800;
|
||||
lifetimeVarianceMS = 200;
|
||||
|
||||
textureName = "special/flareSpark";
|
||||
|
||||
colors[0] = "1.0 1.0 1.0 1.0";
|
||||
colors[1] = "1.0 1.0 1.0 1.0";
|
||||
colors[2] = "1.0 1.0 1.0 0.0";
|
||||
|
||||
sizes[0] = 0.6;
|
||||
sizes[1] = 0.3;
|
||||
sizes[2] = 0.1;
|
||||
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(FlareEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 10;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 1.0;
|
||||
velocityVariance = 0.0;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 90.0;
|
||||
|
||||
orientParticles = true;
|
||||
orientOnVelocity = false;
|
||||
|
||||
particles = "FlareParticle";
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Explosion - Flare Grenade
|
||||
//--------------------------------------
|
||||
datablock ExplosionData(FlareGrenadeExplosion)
|
||||
{
|
||||
explosionShape = "energy_explosion.dts";
|
||||
soundProfile = FlareGrenadeExplosionSound;
|
||||
faceViewer = true;
|
||||
explosionScale = "0.1 0.1 0.1";
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Projectile - Flare Grenade
|
||||
//--------------------------------------
|
||||
datablock FlareProjectileData(FlareGrenadeProj)
|
||||
{
|
||||
projectileShapeName = "grenade_projectile.dts";
|
||||
emitterDelay = -1;
|
||||
directDamage = 0.0;
|
||||
hasDamageRadius = false;
|
||||
kickBackStrength = 1500;
|
||||
useLensFlare = false;
|
||||
|
||||
sound = FlareGrenadeBurnSound;
|
||||
explosion = FlareGrenadeExplosion;
|
||||
velInheritFactor = 0.5;
|
||||
|
||||
texture[0] = "special/flare3";
|
||||
texture[1] = "special/LensFlare/flare00";
|
||||
size = 4.0;
|
||||
|
||||
baseEmitter = FlareEmitter;
|
||||
|
||||
grenadeElasticity = 0.35;
|
||||
grenadeFriction = 0.2;
|
||||
armingDelayMS = 6000;
|
||||
muzzleVelocity = 15.0;
|
||||
drag = 0.1;
|
||||
gravityMod = 0.15;
|
||||
};
|
||||
|
||||
datablock ItemData(FlareGrenadeThrown)
|
||||
{
|
||||
shapeFile = "grenade.dts";
|
||||
mass = 0.7;
|
||||
elasticity = 0.2;
|
||||
friction = 1;
|
||||
pickupRadius = 2;
|
||||
maxDamage = 0.4;
|
||||
|
||||
sticky = false;
|
||||
gravityMod = 0.15;
|
||||
maxVelocity = 10;
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ItemData(FlareGrenade)
|
||||
{
|
||||
className = HandInventory;
|
||||
catagory = "Handheld";
|
||||
shapeFile = "grenade.dts";
|
||||
mass = 0.7;
|
||||
elasticity = 0.2;
|
||||
friction = 1;
|
||||
pickupRadius = 2;
|
||||
thrownItem = FlareGrenadeThrown;
|
||||
pickUpName = "some flare grenades";
|
||||
isGrenade = true;
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Functions:
|
||||
//------------------------------------------------------------------------------
|
||||
function FlareGrenadeThrown::onCollision( %data, %obj, %col )
|
||||
{
|
||||
// Do nothing...
|
||||
}
|
||||
|
||||
61
scripts/weapons/Grenades/flashGrenade.cs
Normal file
61
scripts/weapons/Grenades/flashGrenade.cs
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
// grenade (thrown by hand) script
|
||||
// ------------------------------------------------------------------------
|
||||
datablock AudioProfile(FlashGrenadeExplosionSound)
|
||||
{
|
||||
filename = "fx/explosions/grenade_flash_explode.wav";
|
||||
description = AudioExplosion3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
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 = 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...
|
||||
}
|
||||
|
||||
407
scripts/weapons/Grenades/grenade.cs
Normal file
407
scripts/weapons/Grenades/grenade.cs
Normal file
|
|
@ -0,0 +1,407 @@
|
|||
// ------------------------------------------------------------------------
|
||||
// grenade (thrown by hand) script
|
||||
// ------------------------------------------------------------------------
|
||||
datablock AudioProfile(GrenadeThrowSound)
|
||||
{
|
||||
filename = "fx/weapons/throw_grenade.wav";
|
||||
description = AudioClose3D;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(GrenadeSwitchSound)
|
||||
{
|
||||
filename = "fx/weapons/generic_switch.wav";
|
||||
description = AudioClosest3D;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
//**************************************************************************
|
||||
// Hand Grenade underwater fx
|
||||
//**************************************************************************
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Underwater Hand Grenade Particle effects
|
||||
//--------------------------------------------------------------------------
|
||||
datablock ParticleData(HandGrenadeExplosionBubbleParticle)
|
||||
{
|
||||
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] = 0.75;
|
||||
sizes[1] = 0.75;
|
||||
sizes[2] = 0.75;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
datablock ParticleEmitterData(HandGrenadeExplosionBubbleEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 7;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 1.0;
|
||||
ejectionOffset = 2.0;
|
||||
velocityVariance = 0.5;
|
||||
thetaMin = 0;
|
||||
thetaMax = 80;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
particles = "HandGrenadeExplosionBubbleParticle";
|
||||
};
|
||||
|
||||
datablock ParticleData(UnderwaterHandGrenadeExplosionSmoke)
|
||||
{
|
||||
dragCoeffiecient = 105.0;
|
||||
gravityCoefficient = -0.0; // rises slowly
|
||||
inheritedVelFactor = 0.025;
|
||||
|
||||
constantAcceleration = -1.0;
|
||||
|
||||
lifetimeMS = 1250;
|
||||
lifetimeVarianceMS = 0;
|
||||
|
||||
textureName = "particleTest";
|
||||
|
||||
useInvAlpha = false;
|
||||
spinRandomMin = -200.0;
|
||||
spinRandomMax = 200.0;
|
||||
|
||||
textureName = "special/Smoke/smoke_001";
|
||||
|
||||
colors[0] = "0.4 0.4 1.0 1.0";
|
||||
colors[1] = "0.4 0.4 1.0 0.5";
|
||||
colors[2] = "0.0 0.0 0.0 0.0";
|
||||
sizes[0] = 1.0;
|
||||
sizes[1] = 3.0;
|
||||
sizes[2] = 5.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.2;
|
||||
times[2] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(UnderwaterHandGrenadeExplosionSmokeEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 10;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 5.25;
|
||||
velocityVariance = 0.25;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 180.0;
|
||||
|
||||
lifetimeMS = 250;
|
||||
|
||||
particles = "UnderwaterHandGrenadeExplosionSmoke";
|
||||
};
|
||||
|
||||
|
||||
|
||||
datablock ParticleData(UnderwaterHandGrenadeSparks)
|
||||
{
|
||||
dragCoefficient = 1;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.2;
|
||||
constantAcceleration = 0.0;
|
||||
lifetimeMS = 500;
|
||||
lifetimeVarianceMS = 350;
|
||||
textureName = "special/droplet";
|
||||
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.25;
|
||||
sizes[2] = 0.25;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(UnderwaterHandGrenadeSparkEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 3;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 10;
|
||||
velocityVariance = 6.75;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 180;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
orientParticles = true;
|
||||
lifetimeMS = 100;
|
||||
particles = "UnderwaterHandGrenadeSparks";
|
||||
};
|
||||
|
||||
|
||||
|
||||
datablock ExplosionData(UnderwaterHandGrenadeSubExplosion1)
|
||||
{
|
||||
offset = 1.0;
|
||||
emitter[0] = UnderwaterHandGrenadeExplosionSmokeEmitter;
|
||||
emitter[1] = UnderwaterHandGrenadeSparkEmitter;
|
||||
};
|
||||
|
||||
datablock ExplosionData(UnderwaterHandGrenadeSubExplosion2)
|
||||
{
|
||||
offset = 1.0;
|
||||
emitter[0] = UnderwaterHandGrenadeExplosionSmokeEmitter;
|
||||
emitter[1] = UnderwaterHandGrenadeSparkEmitter;
|
||||
};
|
||||
|
||||
datablock ExplosionData(UnderwaterHandGrenadeExplosion)
|
||||
{
|
||||
soundProfile = GrenadeExplosionSound;
|
||||
|
||||
emitter[0] = UnderwaterHandGrenadeExplosionSmokeEmitter;
|
||||
emitter[1] = UnderwaterHandGrenadeSparkEmitter;
|
||||
emitter[2] = HandGrenadeExplosionBubbleEmitter;
|
||||
|
||||
subExplosion[0] = UnderwaterHandGrenadeSubExplosion1;
|
||||
subExplosion[1] = UnderwaterHandGrenadeSubExplosion2;
|
||||
|
||||
shakeCamera = true;
|
||||
camShakeFreq = "12.0 13.0 11.0";
|
||||
camShakeAmp = "35.0 35.0 35.0";
|
||||
camShakeDuration = 1.0;
|
||||
camShakeRadius = 15.0;
|
||||
};
|
||||
|
||||
//**************************************************************************
|
||||
// Hand Grenade effects
|
||||
//**************************************************************************
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Grenade Particle effects
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
datablock ParticleData(HandGrenadeExplosionSmoke)
|
||||
{
|
||||
dragCoeffiecient = 105.0;
|
||||
gravityCoefficient = -0.0; // rises slowly
|
||||
inheritedVelFactor = 0.025;
|
||||
|
||||
constantAcceleration = -0.80;
|
||||
|
||||
lifetimeMS = 1250;
|
||||
lifetimeVarianceMS = 0;
|
||||
|
||||
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] = 5.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.2;
|
||||
times[2] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(HandGrenadeExplosionSmokeEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 10;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 10.25;
|
||||
velocityVariance = 0.25;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 180.0;
|
||||
|
||||
lifetimeMS = 250;
|
||||
|
||||
particles = "HandGrenadeExplosionSmoke";
|
||||
};
|
||||
|
||||
|
||||
|
||||
datablock ParticleData(HandGrenadeSparks)
|
||||
{
|
||||
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.25;
|
||||
sizes[2] = 0.25;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(HandGrenadeSparkEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 3;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 18;
|
||||
velocityVariance = 6.75;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 180;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
orientParticles = true;
|
||||
lifetimeMS = 100;
|
||||
particles = "HandGrenadeSparks";
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------
|
||||
// Explosion
|
||||
//----------------------------------------------------
|
||||
|
||||
datablock ExplosionData(HandGrenadeSubExplosion1)
|
||||
{
|
||||
offset = 2.0;
|
||||
emitter[0] = HandGrenadeExplosionSmokeEmitter;
|
||||
emitter[1] = HandGrenadeSparkEmitter;
|
||||
};
|
||||
|
||||
datablock ExplosionData(HandGrenadeSubExplosion2)
|
||||
{
|
||||
offset = 2.0;
|
||||
emitter[0] = HandGrenadeExplosionSmokeEmitter;
|
||||
emitter[1] = HandGrenadeSparkEmitter;
|
||||
};
|
||||
|
||||
datablock ExplosionData(HandGrenadeExplosion)
|
||||
{
|
||||
soundProfile = GrenadeExplosionSound;
|
||||
|
||||
emitter[0] = HandGrenadeExplosionSmokeEmitter;
|
||||
emitter[1] = HandGrenadeSparkEmitter;
|
||||
|
||||
subExplosion[0] = HandGrenadeSubExplosion1;
|
||||
subExplosion[1] = HandGrenadeSubExplosion2;
|
||||
|
||||
shakeCamera = true;
|
||||
camShakeFreq = "12.0 13.0 11.0";
|
||||
camShakeAmp = "35.0 35.0 35.0";
|
||||
camShakeDuration = 1.0;
|
||||
camShakeRadius = 15.0;
|
||||
};
|
||||
|
||||
datablock TracerProjectileData(GrenadeShrapnel)
|
||||
{
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.2;
|
||||
directDamageType = $DamageType::Grenade;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
HeadMultiplier = 1.25;
|
||||
LegsMultiplier = 0.75;
|
||||
|
||||
ImageSource = "Grenade";
|
||||
|
||||
kickBackStrength = 100.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
dryVelocity = 200.0;
|
||||
wetVelocity = 100.0;
|
||||
velInheritFactor = 0.0;
|
||||
fizzleTimeMS = 500;
|
||||
lifetimeMS = 500;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 1.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 1;
|
||||
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.0;
|
||||
crossSize = 0.0;
|
||||
crossViewAng = 0.0;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
};
|
||||
|
||||
datablock ItemData(GrenadeThrown)
|
||||
{
|
||||
className = Weapon;
|
||||
shapeFile = "grenade.dts";
|
||||
mass = 0.6;
|
||||
elasticity = 0.3;
|
||||
friction = 1;
|
||||
pickupRadius = 2;
|
||||
maxDamage = 0.5;
|
||||
explosion = HandGrenadeExplosion;
|
||||
underwaterExplosion = UnderwaterHandGrenadeExplosion;
|
||||
indirectDamage = 0.6;
|
||||
damageRadius = 8.0;
|
||||
radiusDamageType = $DamageType::Grenade;
|
||||
kickBackStrength = 3500;
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
hasShrapnel = 1;
|
||||
shrapnelNumber = 36;
|
||||
minshrapnelSpread = 160;
|
||||
maxshrapnelSpread = 180;
|
||||
shrapnelProjectileType = TracerProjectile;
|
||||
shrapnelProjectile = GrenadeShrapnel;
|
||||
};
|
||||
|
||||
datablock ItemData(Grenade)
|
||||
{
|
||||
className = HandInventory;
|
||||
catagory = "Handheld";
|
||||
shapeFile = "grenade.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.5;
|
||||
friction = 1;
|
||||
pickupRadius = 2;
|
||||
thrownItem = GrenadeThrown;
|
||||
pickUpName = "some grenades";
|
||||
isGrenade = true;
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
54
scripts/weapons/Grenades/staticGrenade.cs
Normal file
54
scripts/weapons/Grenades/staticGrenade.cs
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
datablock ItemData(StaticGrenadeThrown)
|
||||
{
|
||||
className = Weapon;
|
||||
shapeFile = "ammo_plasma.dts";
|
||||
mass = 0.4;
|
||||
elasticity = 0.2;
|
||||
friction = 1;
|
||||
pickupRadius = 2;
|
||||
maxDamage = 0.5;
|
||||
explosion = PlasmaBarrelBoltExplosion;
|
||||
underwaterExplosion = PlasmaBarrelBoltExplosion;
|
||||
indirectDamage = 0.4;
|
||||
damageRadius = 10.0;
|
||||
radiusDamageType = $DamageType::Grenade;
|
||||
kickBackStrength = 2000;
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ItemData(StaticGrenade)
|
||||
{
|
||||
className = HandInventory;
|
||||
catagory = "Handheld";
|
||||
shapeFile = "ammo_plasma.dts";
|
||||
mass = 0.4;
|
||||
elasticity = 0.2;
|
||||
friction = 1;
|
||||
pickupRadius = 2;
|
||||
thrownItem = StaticGrenadeThrown;
|
||||
pickUpName = "some static grenades";
|
||||
isGrenade = true;
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
function StaticGrenadeThrown::onThrow(%this, %gren) {
|
||||
AIGrenadeThrown(%gren);
|
||||
%gren.detThread = schedule(3000, %gren, "detonateGrenade", %gren);
|
||||
}
|
||||
|
||||
function StaticGrenadeThrown::onCollision(%data, %obj, %col) {
|
||||
%cn = %col.getDatablock().getClassName();
|
||||
if(%cn $= "PlayerData" || strstr(%cn, "Vehicle") != -1) {
|
||||
//BOOM!
|
||||
detonateGrenade(%obj);
|
||||
//Die now...
|
||||
if(!%col.isBoss && !%col.isGOF) {
|
||||
RadiusExplosion( %obj, %obj.getPosition(), 1, 100, 1000,
|
||||
%obj.sourceObject, $DamageType::Grenade);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue