mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-16 13:13:53 +00:00
820 lines
28 KiB
C#
820 lines
28 KiB
C#
|
|
//-----------------------------------------------------------------------------
|
||
|
|
// Copyright (c) 2012 GarageGames, LLC
|
||
|
|
//
|
||
|
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
|
|
// of this software and associated documentation files (the "Software"), to
|
||
|
|
// deal in the Software without restriction, including without limitation the
|
||
|
|
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||
|
|
// sell copies of the Software, and to permit persons to whom the Software is
|
||
|
|
// furnished to do so, subject to the following conditions:
|
||
|
|
//
|
||
|
|
// The above copyright notice and this permission notice shall be included in
|
||
|
|
// all copies or substantial portions of the Software.
|
||
|
|
//
|
||
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
|
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||
|
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||
|
|
// IN THE SOFTWARE.
|
||
|
|
//-----------------------------------------------------------------------------
|
||
|
|
|
||
|
|
//--------------------------------------------------------------------------
|
||
|
|
// Sounds
|
||
|
|
//--------------------------------------------------------------------------
|
||
|
|
datablock SFXProfile(LurkerFireSound)
|
||
|
|
{
|
||
|
|
filename = "data/FPSGameplay/sound/weapons/wpn_lurker_fire";
|
||
|
|
description = AudioClose3D;
|
||
|
|
preload = true;
|
||
|
|
};
|
||
|
|
|
||
|
|
datablock SFXProfile(LurkerReloadSound)
|
||
|
|
{
|
||
|
|
filename = "data/FPSGameplay/sound/weapons/wpn_lurker_reload";
|
||
|
|
description = AudioClose3D;
|
||
|
|
preload = true;
|
||
|
|
};
|
||
|
|
|
||
|
|
datablock SFXProfile(LurkerIdleSound)
|
||
|
|
{
|
||
|
|
filename = "data/FPSGameplay/sound/weapons/wpn_lurker_idle";
|
||
|
|
description = AudioClose3D;
|
||
|
|
preload = true;
|
||
|
|
};
|
||
|
|
|
||
|
|
datablock SFXProfile(LurkerSwitchinSound)
|
||
|
|
{
|
||
|
|
filename = "data/FPSGameplay/sound/weapons/wpn_lurker_switchin";
|
||
|
|
description = AudioClose3D;
|
||
|
|
preload = true;
|
||
|
|
};
|
||
|
|
|
||
|
|
datablock SFXProfile(LurkerGrenadeFireSound)
|
||
|
|
{
|
||
|
|
filename = "data/FPSGameplay/sound/weapons/wpn_lurker_grenadelaunch";
|
||
|
|
description = AudioClose3D;
|
||
|
|
preload = true;
|
||
|
|
};
|
||
|
|
|
||
|
|
datablock SFXPlayList(LurkerFireSoundList)
|
||
|
|
{
|
||
|
|
// Use a looped description so the list playback will loop.
|
||
|
|
description = AudioClose3D;
|
||
|
|
|
||
|
|
track[ 0 ] = LurkerFireSound;
|
||
|
|
};
|
||
|
|
|
||
|
|
/*datablock SFXProfile(BulletImpactSound)
|
||
|
|
{
|
||
|
|
filename = "data/FPSGameplay/sound/weapons/SCARFIRE";
|
||
|
|
description = AudioClose3D;
|
||
|
|
preload = true;
|
||
|
|
};*/
|
||
|
|
|
||
|
|
// ----------------------------------------------------------------------------
|
||
|
|
// Particles
|
||
|
|
// ----------------------------------------------------------------------------
|
||
|
|
datablock ParticleData(GunFireSmoke)
|
||
|
|
{
|
||
|
|
textureName = "data/FPSGameplay/art/particles/smoke";
|
||
|
|
dragCoefficient = 0;
|
||
|
|
gravityCoefficient = "-1";
|
||
|
|
windCoefficient = 0;
|
||
|
|
inheritedVelFactor = 0.0;
|
||
|
|
constantAcceleration = 0.0;
|
||
|
|
lifetimeMS = 500;
|
||
|
|
lifetimeVarianceMS = 200;
|
||
|
|
spinRandomMin = -180.0;
|
||
|
|
spinRandomMax = 180.0;
|
||
|
|
useInvAlpha = true;
|
||
|
|
|
||
|
|
colors[0] = "0.795276 0.795276 0.795276 0.692913";
|
||
|
|
colors[1] = "0.866142 0.866142 0.866142 0.346457";
|
||
|
|
colors[2] = "0.897638 0.834646 0.795276 0";
|
||
|
|
|
||
|
|
sizes[0] = "0.399805";
|
||
|
|
sizes[1] = "1.19941";
|
||
|
|
sizes[2] = "1.69993";
|
||
|
|
|
||
|
|
times[0] = 0.0;
|
||
|
|
times[1] = "0.498039";
|
||
|
|
times[2] = 1.0;
|
||
|
|
animTexName = "data/FPSGameplay/art/particles/smoke";
|
||
|
|
};
|
||
|
|
|
||
|
|
datablock ParticleEmitterData(GunFireSmokeEmitter)
|
||
|
|
{
|
||
|
|
ejectionPeriodMS = 20;
|
||
|
|
periodVarianceMS = 10;
|
||
|
|
ejectionVelocity = "0";
|
||
|
|
velocityVariance = "0";
|
||
|
|
thetaMin = "0";
|
||
|
|
thetaMax = "0";
|
||
|
|
lifetimeMS = 250;
|
||
|
|
particles = "GunFireSmoke";
|
||
|
|
blendStyle = "NORMAL";
|
||
|
|
softParticles = "0";
|
||
|
|
originalName = "GunFireSmokeEmitter";
|
||
|
|
alignParticles = "0";
|
||
|
|
orientParticles = "0";
|
||
|
|
};
|
||
|
|
|
||
|
|
datablock ParticleData(BulletDirtDust)
|
||
|
|
{
|
||
|
|
textureName = "data/FPSGameplay/art/particles/impact";
|
||
|
|
dragCoefficient = "1";
|
||
|
|
gravityCoefficient = "-0.100122";
|
||
|
|
windCoefficient = 0;
|
||
|
|
inheritedVelFactor = 0.0;
|
||
|
|
constantAcceleration = "-0.83";
|
||
|
|
lifetimeMS = 800;
|
||
|
|
lifetimeVarianceMS = 300;
|
||
|
|
spinRandomMin = -180.0;
|
||
|
|
spinRandomMax = 180.0;
|
||
|
|
useInvAlpha = true;
|
||
|
|
|
||
|
|
colors[0] = "0.496063 0.393701 0.299213 0.692913";
|
||
|
|
colors[1] = "0.692913 0.614173 0.535433 0.346457";
|
||
|
|
colors[2] = "0.897638 0.84252 0.795276 0";
|
||
|
|
|
||
|
|
sizes[0] = "0.997986";
|
||
|
|
sizes[1] = "2";
|
||
|
|
sizes[2] = "2.5";
|
||
|
|
|
||
|
|
times[0] = 0.0;
|
||
|
|
times[1] = "0.498039";
|
||
|
|
times[2] = 1.0;
|
||
|
|
animTexName = "data/FPSGameplay/art/particles/impact";
|
||
|
|
};
|
||
|
|
|
||
|
|
datablock ParticleEmitterData(BulletDirtDustEmitter)
|
||
|
|
{
|
||
|
|
ejectionPeriodMS = 20;
|
||
|
|
periodVarianceMS = 10;
|
||
|
|
ejectionVelocity = "1";
|
||
|
|
velocityVariance = 1.0;
|
||
|
|
thetaMin = 0.0;
|
||
|
|
thetaMax = 180.0;
|
||
|
|
lifetimeMS = 250;
|
||
|
|
particles = "BulletDirtDust";
|
||
|
|
blendStyle = "NORMAL";
|
||
|
|
};
|
||
|
|
|
||
|
|
//-----------------------------------------------------------------------------
|
||
|
|
// Explosion
|
||
|
|
//-----------------------------------------------------------------------------
|
||
|
|
datablock ExplosionData(BulletDirtExplosion)
|
||
|
|
{
|
||
|
|
soundProfile = BulletImpactSound;
|
||
|
|
lifeTimeMS = 65;
|
||
|
|
|
||
|
|
// Volume particles
|
||
|
|
particleEmitter = BulletDirtDustEmitter;
|
||
|
|
particleDensity = 4;
|
||
|
|
particleRadius = 0.3;
|
||
|
|
|
||
|
|
// Point emission
|
||
|
|
emitter[0] = BulletDirtSprayEmitter;
|
||
|
|
emitter[1] = BulletDirtSprayEmitter;
|
||
|
|
emitter[2] = BulletDirtRocksEmitter;
|
||
|
|
};
|
||
|
|
|
||
|
|
//--------------------------------------------------------------------------
|
||
|
|
// Shell ejected during reload.
|
||
|
|
//-----------------------------------------------------------------------------
|
||
|
|
datablock DebrisData(BulletShell)
|
||
|
|
{
|
||
|
|
shapeFile = "data/FPSGameplay/art/shapes/weapons/shared/RifleShell.DAE";
|
||
|
|
lifetime = 6.0;
|
||
|
|
minSpinSpeed = 300.0;
|
||
|
|
maxSpinSpeed = 400.0;
|
||
|
|
elasticity = 0.65;
|
||
|
|
friction = 0.05;
|
||
|
|
numBounces = 5;
|
||
|
|
staticOnMaxBounce = true;
|
||
|
|
snapOnMaxBounce = false;
|
||
|
|
ignoreWater = true;
|
||
|
|
fade = true;
|
||
|
|
};
|
||
|
|
|
||
|
|
//-----------------------------------------------------------------------------
|
||
|
|
// Projectile Object
|
||
|
|
//-----------------------------------------------------------------------------
|
||
|
|
datablock LightDescription( BulletProjectileLightDesc )
|
||
|
|
{
|
||
|
|
color = "0.0 0.5 0.7";
|
||
|
|
range = 3.0;
|
||
|
|
};
|
||
|
|
|
||
|
|
datablock ProjectileData( BulletProjectile )
|
||
|
|
{
|
||
|
|
projectileShapeName = "";
|
||
|
|
|
||
|
|
directDamage = 5;
|
||
|
|
radiusDamage = 0;
|
||
|
|
damageRadius = 0.5;
|
||
|
|
areaImpulse = 0.5;
|
||
|
|
impactForce = 1;
|
||
|
|
|
||
|
|
explosion = BulletDirtExplosion;
|
||
|
|
decal = BulletHoleDecal;
|
||
|
|
|
||
|
|
muzzleVelocity = 120;
|
||
|
|
velInheritFactor = 1;
|
||
|
|
|
||
|
|
armingDelay = 0;
|
||
|
|
lifetime = 992;
|
||
|
|
fadeDelay = 1472;
|
||
|
|
bounceElasticity = 0;
|
||
|
|
bounceFriction = 0;
|
||
|
|
isBallistic = false;
|
||
|
|
gravityMod = 1;
|
||
|
|
};
|
||
|
|
|
||
|
|
function BulletProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
|
||
|
|
{
|
||
|
|
// Apply impact force from the projectile.
|
||
|
|
|
||
|
|
// Apply damage to the object all shape base objects
|
||
|
|
if ( %col.getType() & $TypeMasks::GameBaseObjectType )
|
||
|
|
%col.damage(%obj,%pos,%this.directDamage,"BulletProjectile");
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
//-----------------------------------------------------------------------------
|
||
|
|
// Ammo Item
|
||
|
|
//-----------------------------------------------------------------------------
|
||
|
|
datablock ItemData(LurkerClip)
|
||
|
|
{
|
||
|
|
// Mission editor category
|
||
|
|
category = "AmmoClip";
|
||
|
|
|
||
|
|
// Add the Ammo namespace as a parent. The ammo namespace provides
|
||
|
|
// common ammo related functions and hooks into the inventory system.
|
||
|
|
className = "AmmoClip";
|
||
|
|
|
||
|
|
// Basic Item properties
|
||
|
|
shapeFile = "data/FPSGameplay/art/shapes/weapons/Lurker/TP_Lurker.DAE";
|
||
|
|
mass = 1;
|
||
|
|
elasticity = 0.2;
|
||
|
|
friction = 0.6;
|
||
|
|
|
||
|
|
// Dynamic properties defined by the scripts
|
||
|
|
pickUpName = "Lurker clip";
|
||
|
|
count = 1;
|
||
|
|
maxInventory = 10;
|
||
|
|
};
|
||
|
|
|
||
|
|
datablock ItemData(LurkerAmmo)
|
||
|
|
{
|
||
|
|
// Mission editor category
|
||
|
|
category = "Ammo";
|
||
|
|
|
||
|
|
// Add the Ammo namespace as a parent. The ammo namespace provides
|
||
|
|
// common ammo related functions and hooks into the inventory system.
|
||
|
|
className = "Ammo";
|
||
|
|
|
||
|
|
// Basic Item properties
|
||
|
|
shapeFile = "data/FPSGameplay/art/shapes/weapons/Lurker/TP_Lurker.DAE";
|
||
|
|
mass = 1;
|
||
|
|
elasticity = 0.2;
|
||
|
|
friction = 0.6;
|
||
|
|
|
||
|
|
// Dynamic properties defined by the scripts
|
||
|
|
pickUpName = "Lurker ammo";
|
||
|
|
maxInventory = 30;
|
||
|
|
clip = LurkerClip;
|
||
|
|
};
|
||
|
|
|
||
|
|
//--------------------------------------------------------------------------
|
||
|
|
// Weapon Item. This is the item that exists in the world, i.e. when it's
|
||
|
|
// been dropped, thrown or is acting as re-spawnable item. When the weapon
|
||
|
|
// is mounted onto a shape, the LurkerWeaponImage is used.
|
||
|
|
//-----------------------------------------------------------------------------
|
||
|
|
datablock ItemData(Lurker)
|
||
|
|
{
|
||
|
|
// Mission editor category
|
||
|
|
category = "Weapon";
|
||
|
|
|
||
|
|
// Hook into Item Weapon class hierarchy. The weapon namespace
|
||
|
|
// provides common weapon handling functions in addition to hooks
|
||
|
|
// into the inventory system.
|
||
|
|
className = "Weapon";
|
||
|
|
|
||
|
|
// Basic Item properties
|
||
|
|
shapeFile = "data/FPSGameplay/art/shapes/weapons/Lurker/TP_Lurker.DAE";
|
||
|
|
mass = 1;
|
||
|
|
elasticity = 0.2;
|
||
|
|
friction = 0.6;
|
||
|
|
emap = true;
|
||
|
|
|
||
|
|
// Dynamic properties defined by the scripts
|
||
|
|
PreviewImage = 'lurker.png';
|
||
|
|
pickUpName = "Lurker rifle";
|
||
|
|
description = "Lurker";
|
||
|
|
image = LurkerWeaponImage;
|
||
|
|
reticle = "crossHair";
|
||
|
|
};
|
||
|
|
|
||
|
|
|
||
|
|
datablock ShapeBaseImageData(LurkerWeaponImage)
|
||
|
|
{
|
||
|
|
// Basic Item properties
|
||
|
|
shapeFile = "data/FPSGameplay/art/shapes/weapons/Lurker/TP_Lurker.DAE";
|
||
|
|
shapeFileFP = "data/FPSGameplay/art/shapes/weapons/Lurker/FP_Lurker.DAE";
|
||
|
|
emap = true;
|
||
|
|
|
||
|
|
imageAnimPrefix = "Rifle";
|
||
|
|
imageAnimPrefixFP = "Rifle";
|
||
|
|
|
||
|
|
// Specify mount point & offset for 3rd person, and eye offset
|
||
|
|
// for first person rendering.
|
||
|
|
mountPoint = 0;
|
||
|
|
firstPerson = true;
|
||
|
|
useEyeNode = true;
|
||
|
|
animateOnServer = true;
|
||
|
|
|
||
|
|
// When firing from a point offset from the eye, muzzle correction
|
||
|
|
// will adjust the muzzle vector to point to the eye LOS point.
|
||
|
|
// Since this weapon doesn't actually fire from the muzzle point,
|
||
|
|
// we need to turn this off.
|
||
|
|
correctMuzzleVector = true;
|
||
|
|
|
||
|
|
// Add the WeaponImage namespace as a parent, WeaponImage namespace
|
||
|
|
// provides some hooks into the inventory system.
|
||
|
|
class = "WeaponImage";
|
||
|
|
className = "WeaponImage";
|
||
|
|
|
||
|
|
// Projectiles and Ammo.
|
||
|
|
item = Lurker;
|
||
|
|
ammo = LurkerAmmo;
|
||
|
|
clip = LurkerClip;
|
||
|
|
|
||
|
|
projectile = BulletProjectile;
|
||
|
|
projectileType = Projectile;
|
||
|
|
projectileSpread = "0.005";
|
||
|
|
|
||
|
|
altProjectile = GrenadeLauncherProjectile;
|
||
|
|
altProjectileSpread = "0.02";
|
||
|
|
|
||
|
|
casing = BulletShell;
|
||
|
|
shellExitDir = "1.0 0.3 1.0";
|
||
|
|
shellExitOffset = "0.15 -0.56 -0.1";
|
||
|
|
shellExitVariance = 15.0;
|
||
|
|
shellVelocity = 3.0;
|
||
|
|
|
||
|
|
// Weapon lights up while firing
|
||
|
|
lightType = "WeaponFireLight";
|
||
|
|
lightColor = "0.992126 0.968504 0.708661 1";
|
||
|
|
lightRadius = "4";
|
||
|
|
lightDuration = "100";
|
||
|
|
lightBrightness = 2;
|
||
|
|
|
||
|
|
// Shake camera while firing.
|
||
|
|
shakeCamera = false;
|
||
|
|
camShakeFreq = "0 0 0";
|
||
|
|
camShakeAmp = "0 0 0";
|
||
|
|
|
||
|
|
// Images have a state system which controls how the animations
|
||
|
|
// are run, which sounds are played, script callbacks, etc. This
|
||
|
|
// state system is downloaded to the client so that clients can
|
||
|
|
// predict state changes and animate accordingly. The following
|
||
|
|
// system supports basic ready->fire->reload transitions as
|
||
|
|
// well as a no-ammo->dryfire idle state.
|
||
|
|
|
||
|
|
useRemainderDT = true;
|
||
|
|
|
||
|
|
// Initial start up state
|
||
|
|
stateName[0] = "Preactivate";
|
||
|
|
stateTransitionOnLoaded[0] = "Activate";
|
||
|
|
stateTransitionOnNoAmmo[0] = "NoAmmo";
|
||
|
|
|
||
|
|
// Activating the gun. Called when the weapon is first
|
||
|
|
// mounted and there is ammo.
|
||
|
|
stateName[1] = "Activate";
|
||
|
|
stateTransitionGeneric0In[1] = "SprintEnter";
|
||
|
|
stateTransitionOnTimeout[1] = "Ready";
|
||
|
|
stateTimeoutValue[1] = 0.5;
|
||
|
|
stateSequence[1] = "switch_in";
|
||
|
|
stateSound[1] = LurkerSwitchinSound;
|
||
|
|
|
||
|
|
// Ready to fire, just waiting for the trigger
|
||
|
|
stateName[2] = "Ready";
|
||
|
|
stateTransitionGeneric0In[2] = "SprintEnter";
|
||
|
|
stateTransitionOnMotion[2] = "ReadyMotion";
|
||
|
|
stateTransitionOnTimeout[2] = "ReadyFidget";
|
||
|
|
stateTimeoutValue[2] = 10;
|
||
|
|
stateWaitForTimeout[2] = false;
|
||
|
|
stateScaleAnimation[2] = false;
|
||
|
|
stateScaleAnimationFP[2] = false;
|
||
|
|
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||
|
|
stateTransitionOnTriggerDown[2] = "Fire";
|
||
|
|
stateSequence[2] = "idle";
|
||
|
|
|
||
|
|
// Same as Ready state but plays a fidget sequence
|
||
|
|
stateName[3] = "ReadyFidget";
|
||
|
|
stateTransitionGeneric0In[3] = "SprintEnter";
|
||
|
|
stateTransitionOnMotion[3] = "ReadyMotion";
|
||
|
|
stateTransitionOnTimeout[3] = "Ready";
|
||
|
|
stateTimeoutValue[3] = 6;
|
||
|
|
stateWaitForTimeout[3] = false;
|
||
|
|
stateTransitionOnNoAmmo[3] = "NoAmmo";
|
||
|
|
stateTransitionOnTriggerDown[3] = "Fire";
|
||
|
|
stateSequence[3] = "idle_fidget1";
|
||
|
|
stateSound[3] = LurkerIdleSound;
|
||
|
|
|
||
|
|
// Ready to fire with player moving
|
||
|
|
stateName[4] = "ReadyMotion";
|
||
|
|
stateTransitionGeneric0In[4] = "SprintEnter";
|
||
|
|
stateTransitionOnNoMotion[4] = "Ready";
|
||
|
|
stateWaitForTimeout[4] = false;
|
||
|
|
stateScaleAnimation[4] = false;
|
||
|
|
stateScaleAnimationFP[4] = false;
|
||
|
|
stateSequenceTransitionIn[4] = true;
|
||
|
|
stateSequenceTransitionOut[4] = true;
|
||
|
|
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||
|
|
stateTransitionOnTriggerDown[4] = "Fire";
|
||
|
|
stateSequence[4] = "run";
|
||
|
|
|
||
|
|
// Fire the weapon. Calls the fire script which does
|
||
|
|
// the actual work.
|
||
|
|
stateName[5] = "Fire";
|
||
|
|
stateTransitionGeneric0In[5] = "SprintEnter";
|
||
|
|
stateTransitionOnTimeout[5] = "NewRound";
|
||
|
|
stateTimeoutValue[5] = 0.15;
|
||
|
|
stateFire[5] = true;
|
||
|
|
stateRecoil[5] = "";
|
||
|
|
stateAllowImageChange[5] = false;
|
||
|
|
stateSequence[5] = "fire";
|
||
|
|
stateScaleAnimation[5] = false;
|
||
|
|
stateSequenceNeverTransition[5] = true;
|
||
|
|
stateSequenceRandomFlash[5] = true; // use muzzle flash sequence
|
||
|
|
stateScript[5] = "onFire";
|
||
|
|
stateSound[5] = LurkerFireSoundList;
|
||
|
|
stateEmitter[5] = GunFireSmokeEmitter;
|
||
|
|
stateEmitterTime[5] = 0.025;
|
||
|
|
|
||
|
|
// Put another round into the chamber if one is available
|
||
|
|
stateName[6] = "NewRound";
|
||
|
|
stateTransitionGeneric0In[6] = "SprintEnter";
|
||
|
|
stateTransitionOnNoAmmo[6] = "NoAmmo";
|
||
|
|
stateTransitionOnTimeout[6] = "Ready";
|
||
|
|
stateWaitForTimeout[6] = "0";
|
||
|
|
stateTimeoutValue[6] = 0.05;
|
||
|
|
stateAllowImageChange[6] = false;
|
||
|
|
stateEjectShell[6] = true;
|
||
|
|
|
||
|
|
// No ammo in the weapon, just idle until something
|
||
|
|
// shows up. Play the dry fire sound if the trigger is
|
||
|
|
// pulled.
|
||
|
|
stateName[7] = "NoAmmo";
|
||
|
|
stateTransitionGeneric0In[7] = "SprintEnter";
|
||
|
|
stateTransitionOnMotion[7] = "NoAmmoMotion";
|
||
|
|
stateTransitionOnAmmo[7] = "ReloadClip";
|
||
|
|
stateTimeoutValue[7] = 0.1; // Slight pause to allow script to run when trigger is still held down from Fire state
|
||
|
|
stateScript[7] = "onClipEmpty";
|
||
|
|
stateSequence[7] = "idle";
|
||
|
|
stateScaleAnimation[7] = false;
|
||
|
|
stateScaleAnimationFP[7] = false;
|
||
|
|
stateTransitionOnTriggerDown[7] = "DryFire";
|
||
|
|
|
||
|
|
stateName[8] = "NoAmmoMotion";
|
||
|
|
stateTransitionGeneric0In[8] = "SprintEnter";
|
||
|
|
stateTransitionOnNoMotion[8] = "NoAmmo";
|
||
|
|
stateWaitForTimeout[8] = false;
|
||
|
|
stateScaleAnimation[8] = false;
|
||
|
|
stateScaleAnimationFP[8] = false;
|
||
|
|
stateSequenceTransitionIn[8] = true;
|
||
|
|
stateSequenceTransitionOut[8] = true;
|
||
|
|
stateTransitionOnTriggerDown[8] = "DryFire";
|
||
|
|
stateTransitionOnAmmo[8] = "ReloadClip";
|
||
|
|
stateSequence[8] = "run";
|
||
|
|
|
||
|
|
// No ammo dry fire
|
||
|
|
stateName[9] = "DryFire";
|
||
|
|
stateTransitionGeneric0In[9] = "SprintEnter";
|
||
|
|
stateTransitionOnAmmo[9] = "ReloadClip";
|
||
|
|
stateWaitForTimeout[9] = "0";
|
||
|
|
stateTimeoutValue[9] = 0.7;
|
||
|
|
stateTransitionOnTimeout[9] = "NoAmmo";
|
||
|
|
stateScript[9] = "onDryFire";
|
||
|
|
stateSound[9] = MachineGunDryFire;
|
||
|
|
|
||
|
|
// Play the reload clip animation
|
||
|
|
stateName[10] = "ReloadClip";
|
||
|
|
stateTransitionGeneric0In[10] = "SprintEnter";
|
||
|
|
stateTransitionOnTimeout[10] = "Ready";
|
||
|
|
stateWaitForTimeout[10] = true;
|
||
|
|
stateTimeoutValue[10] = 3.0;
|
||
|
|
stateReload[10] = true;
|
||
|
|
stateSequence[10] = "reload";
|
||
|
|
stateShapeSequence[10] = "Reload";
|
||
|
|
stateScaleShapeSequence[10] = true;
|
||
|
|
stateSound[10] = LurkerReloadSound;
|
||
|
|
|
||
|
|
// Start Sprinting
|
||
|
|
stateName[11] = "SprintEnter";
|
||
|
|
stateTransitionGeneric0Out[11] = "SprintExit";
|
||
|
|
stateTransitionOnTimeout[11] = "Sprinting";
|
||
|
|
stateWaitForTimeout[11] = false;
|
||
|
|
stateTimeoutValue[11] = 0.5;
|
||
|
|
stateWaitForTimeout[11] = false;
|
||
|
|
stateScaleAnimation[11] = false;
|
||
|
|
stateScaleAnimationFP[11] = false;
|
||
|
|
stateSequenceTransitionIn[11] = true;
|
||
|
|
stateSequenceTransitionOut[11] = true;
|
||
|
|
stateAllowImageChange[11] = false;
|
||
|
|
stateSequence[11] = "sprint";
|
||
|
|
|
||
|
|
// Sprinting
|
||
|
|
stateName[12] = "Sprinting";
|
||
|
|
stateTransitionGeneric0Out[12] = "SprintExit";
|
||
|
|
stateWaitForTimeout[12] = false;
|
||
|
|
stateScaleAnimation[12] = false;
|
||
|
|
stateScaleAnimationFP[12] = false;
|
||
|
|
stateSequenceTransitionIn[12] = true;
|
||
|
|
stateSequenceTransitionOut[12] = true;
|
||
|
|
stateAllowImageChange[12] = false;
|
||
|
|
stateSequence[12] = "sprint";
|
||
|
|
|
||
|
|
// Stop Sprinting
|
||
|
|
stateName[13] = "SprintExit";
|
||
|
|
stateTransitionGeneric0In[13] = "SprintEnter";
|
||
|
|
stateTransitionOnTimeout[13] = "Ready";
|
||
|
|
stateWaitForTimeout[13] = false;
|
||
|
|
stateTimeoutValue[13] = 0.5;
|
||
|
|
stateSequenceTransitionIn[13] = true;
|
||
|
|
stateSequenceTransitionOut[13] = true;
|
||
|
|
stateAllowImageChange[13] = false;
|
||
|
|
stateSequence[13] = "sprint";
|
||
|
|
};
|
||
|
|
|
||
|
|
//--------------------------------------------------------------------------
|
||
|
|
// Lurker Grenade Launcher
|
||
|
|
//--------------------------------------------------------------------------
|
||
|
|
|
||
|
|
datablock ItemData(LurkerGrenadeAmmo)
|
||
|
|
{
|
||
|
|
// Mission editor category
|
||
|
|
category = "Ammo";
|
||
|
|
|
||
|
|
// Add the Ammo namespace as a parent. The ammo namespace provides
|
||
|
|
// common ammo related functions and hooks into the inventory system.
|
||
|
|
className = "Ammo";
|
||
|
|
|
||
|
|
// Basic Item properties
|
||
|
|
shapeFile = "data/FPSGameplay/art/shapes/weapons/Lurker/TP_Lurker.DAE";
|
||
|
|
mass = 1;
|
||
|
|
elasticity = 0.2;
|
||
|
|
friction = 0.6;
|
||
|
|
|
||
|
|
// Dynamic properties defined by the scripts
|
||
|
|
pickUpName = "Lurker grenade ammo";
|
||
|
|
maxInventory = 20;
|
||
|
|
};
|
||
|
|
|
||
|
|
datablock ItemData(LurkerGrenadeLauncher)
|
||
|
|
{
|
||
|
|
// Mission editor category
|
||
|
|
category = "Weapon";
|
||
|
|
|
||
|
|
// Hook into Item Weapon class hierarchy. The weapon namespace
|
||
|
|
// provides common weapon handling functions in addition to hooks
|
||
|
|
// into the inventory system.
|
||
|
|
className = "Weapon";
|
||
|
|
|
||
|
|
// Basic Item properties
|
||
|
|
shapeFile = "data/FPSGameplay/art/shapes/weapons/Lurker/TP_Lurker.DAE";
|
||
|
|
mass = 1;
|
||
|
|
elasticity = 0.2;
|
||
|
|
friction = 0.6;
|
||
|
|
emap = true;
|
||
|
|
|
||
|
|
// Dynamic properties defined by the scripts
|
||
|
|
PreviewImage = 'lurker.png';
|
||
|
|
pickUpName = "a Lurker grenade launcher";
|
||
|
|
description = "Lurker Grenade Launcher";
|
||
|
|
image = LurkerGrenadeLauncherImage;
|
||
|
|
reticle = "crossHair";
|
||
|
|
};
|
||
|
|
|
||
|
|
datablock ShapeBaseImageData(LurkerGrenadeLauncherImage)
|
||
|
|
{
|
||
|
|
// Basic Item properties
|
||
|
|
shapeFile = "data/FPSGameplay/art/shapes/weapons/Lurker/TP_Lurker.DAE";
|
||
|
|
shapeFileFP = "data/FPSGameplay/art/shapes/weapons/Lurker/FP_Lurker.DAE";
|
||
|
|
emap = true;
|
||
|
|
|
||
|
|
imageAnimPrefix = "Rifle";
|
||
|
|
imageAnimPrefixFP = "Rifle";
|
||
|
|
|
||
|
|
// Specify mount point & offset for 3rd person, and eye offset
|
||
|
|
// for first person rendering.
|
||
|
|
mountPoint = 0;
|
||
|
|
firstPerson = true;
|
||
|
|
useEyeNode = true;
|
||
|
|
animateOnServer = true;
|
||
|
|
|
||
|
|
// When firing from a point offset from the eye, muzzle correction
|
||
|
|
// will adjust the muzzle vector to point to the eye LOS point.
|
||
|
|
// Since this weapon doesn't actually fire from the muzzle point,
|
||
|
|
// we need to turn this off.
|
||
|
|
correctMuzzleVector = true;
|
||
|
|
|
||
|
|
// Add the WeaponImage namespace as a parent, WeaponImage namespace
|
||
|
|
// provides some hooks into the inventory system.
|
||
|
|
class = "WeaponImage";
|
||
|
|
className = "WeaponImage";
|
||
|
|
|
||
|
|
// Projectiles and Ammo.
|
||
|
|
item = LurkerGrenadeLauncher;
|
||
|
|
ammo = LurkerGrenadeAmmo;
|
||
|
|
|
||
|
|
projectile = GrenadeLauncherProjectile;
|
||
|
|
projectileType = Projectile;
|
||
|
|
projectileSpread = "0.02";
|
||
|
|
|
||
|
|
// Weapon lights up while firing
|
||
|
|
lightType = "WeaponFireLight";
|
||
|
|
lightColor = "0.992126 0.968504 0.708661 1";
|
||
|
|
lightRadius = "4";
|
||
|
|
lightDuration = "100";
|
||
|
|
lightBrightness = 2;
|
||
|
|
|
||
|
|
// Shake camera while firing.
|
||
|
|
shakeCamera = false;
|
||
|
|
camShakeFreq = "0 0 0";
|
||
|
|
camShakeAmp = "0 0 0";
|
||
|
|
|
||
|
|
// Images have a state system which controls how the animations
|
||
|
|
// are run, which sounds are played, script callbacks, etc. This
|
||
|
|
// state system is downloaded to the client so that clients can
|
||
|
|
// predict state changes and animate accordingly. The following
|
||
|
|
// system supports basic ready->fire->reload transitions as
|
||
|
|
// well as a no-ammo->dryfire idle state.
|
||
|
|
|
||
|
|
useRemainderDT = true;
|
||
|
|
|
||
|
|
// Initial start up state
|
||
|
|
stateName[0] = "Preactivate";
|
||
|
|
stateTransitionOnLoaded[0] = "Activate";
|
||
|
|
stateTransitionOnNoAmmo[0] = "NoAmmo";
|
||
|
|
|
||
|
|
// Activating the gun. Called when the weapon is first
|
||
|
|
// mounted and there is ammo.
|
||
|
|
stateName[1] = "Activate";
|
||
|
|
stateTransitionGeneric0In[1] = "SprintEnter";
|
||
|
|
stateTransitionOnTimeout[1] = "Ready";
|
||
|
|
stateTimeoutValue[1] = 0.5;
|
||
|
|
stateSequence[1] = "switch_in";
|
||
|
|
stateSound[1] = LurkerSwitchinSound;
|
||
|
|
|
||
|
|
// Ready to fire, just waiting for the trigger
|
||
|
|
stateName[2] = "Ready";
|
||
|
|
stateTransitionGeneric0In[2] = "SprintEnter";
|
||
|
|
stateTransitionOnMotion[2] = "ReadyMotion";
|
||
|
|
stateTransitionOnTimeout[2] = "ReadyFidget";
|
||
|
|
stateTimeoutValue[2] = 10;
|
||
|
|
stateWaitForTimeout[2] = false;
|
||
|
|
stateScaleAnimation[2] = false;
|
||
|
|
stateScaleAnimationFP[2] = false;
|
||
|
|
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||
|
|
stateTransitionOnTriggerDown[2] = "Fire";
|
||
|
|
stateSequence[2] = "idle";
|
||
|
|
|
||
|
|
// Same as Ready state but plays a fidget sequence
|
||
|
|
stateName[3] = "ReadyFidget";
|
||
|
|
stateTransitionGeneric0In[3] = "SprintEnter";
|
||
|
|
stateTransitionOnMotion[3] = "ReadyMotion";
|
||
|
|
stateTransitionOnTimeout[3] = "Ready";
|
||
|
|
stateTimeoutValue[3] = 6;
|
||
|
|
stateWaitForTimeout[3] = false;
|
||
|
|
stateTransitionOnNoAmmo[3] = "NoAmmo";
|
||
|
|
stateTransitionOnTriggerDown[3] = "Fire";
|
||
|
|
stateSequence[3] = "idle_fidget1";
|
||
|
|
stateSound[3] = LurkerIdleSound;
|
||
|
|
|
||
|
|
// Ready to fire with player moving
|
||
|
|
stateName[4] = "ReadyMotion";
|
||
|
|
stateTransitionGeneric0In[4] = "SprintEnter";
|
||
|
|
stateTransitionOnNoMotion[4] = "Ready";
|
||
|
|
stateWaitForTimeout[4] = false;
|
||
|
|
stateScaleAnimation[4] = false;
|
||
|
|
stateScaleAnimationFP[4] = false;
|
||
|
|
stateSequenceTransitionIn[4] = true;
|
||
|
|
stateSequenceTransitionOut[4] = true;
|
||
|
|
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||
|
|
stateTransitionOnTriggerDown[4] = "Fire";
|
||
|
|
stateSequence[4] = "run";
|
||
|
|
|
||
|
|
// Fire the weapon. Calls the fire script which does
|
||
|
|
// the actual work.
|
||
|
|
stateName[5] = "Fire";
|
||
|
|
stateTransitionGeneric0In[5] = "SprintEnter";
|
||
|
|
stateTransitionOnTimeout[5] = "NewRound";
|
||
|
|
stateTimeoutValue[5] = 1.2;
|
||
|
|
stateFire[5] = true;
|
||
|
|
stateRecoil[5] = "";
|
||
|
|
stateAllowImageChange[5] = false;
|
||
|
|
stateSequence[5] = "fire_alt";
|
||
|
|
stateScaleAnimation[5] = true;
|
||
|
|
stateSequenceNeverTransition[5] = true;
|
||
|
|
stateSequenceRandomFlash[5] = true; // use muzzle flash sequence
|
||
|
|
stateScript[5] = "onFire";
|
||
|
|
stateSound[5] = LurkerGrenadeFireSound;
|
||
|
|
stateEmitter[5] = GunFireSmokeEmitter;
|
||
|
|
stateEmitterTime[5] = 0.025;
|
||
|
|
stateEjectShell[5] = true;
|
||
|
|
|
||
|
|
// Put another round into the chamber
|
||
|
|
stateName[6] = "NewRound";
|
||
|
|
stateTransitionGeneric0In[6] = "SprintEnter";
|
||
|
|
stateTransitionOnNoAmmo[6] = "NoAmmo";
|
||
|
|
stateTransitionOnTimeout[6] = "Ready";
|
||
|
|
stateWaitForTimeout[6] = "0";
|
||
|
|
stateTimeoutValue[6] = 0.05;
|
||
|
|
stateAllowImageChange[6] = false;
|
||
|
|
|
||
|
|
// No ammo in the weapon, just idle until something
|
||
|
|
// shows up. Play the dry fire sound if the trigger is
|
||
|
|
// pulled.
|
||
|
|
stateName[7] = "NoAmmo";
|
||
|
|
stateTransitionGeneric0In[7] = "SprintEnter";
|
||
|
|
stateTransitionOnMotion[7] = "NoAmmoReadyMotion";
|
||
|
|
stateTransitionOnAmmo[7] = "ReloadClip";
|
||
|
|
stateTimeoutValue[7] = 0.1; // Slight pause to allow script to run when trigger is still held down from Fire state
|
||
|
|
stateScript[7] = "onClipEmpty";
|
||
|
|
stateSequence[7] = "idle";
|
||
|
|
stateScaleAnimation[7] = false;
|
||
|
|
stateScaleAnimationFP[7] = false;
|
||
|
|
stateTransitionOnTriggerDown[7] = "DryFire";
|
||
|
|
|
||
|
|
stateName[8] = "NoAmmoReadyMotion";
|
||
|
|
stateTransitionGeneric0In[8] = "SprintEnter";
|
||
|
|
stateTransitionOnNoMotion[8] = "NoAmmo";
|
||
|
|
stateWaitForTimeout[8] = false;
|
||
|
|
stateScaleAnimation[8] = false;
|
||
|
|
stateScaleAnimationFP[8] = false;
|
||
|
|
stateSequenceTransitionIn[8] = true;
|
||
|
|
stateSequenceTransitionOut[8] = true;
|
||
|
|
stateTransitionOnAmmo[8] = "ReloadClip";
|
||
|
|
stateTransitionOnTriggerDown[8] = "DryFire";
|
||
|
|
stateSequence[8] = "run";
|
||
|
|
|
||
|
|
// No ammo dry fire
|
||
|
|
stateName[9] = "DryFire";
|
||
|
|
stateTransitionGeneric0In[9] = "SprintEnter";
|
||
|
|
stateTimeoutValue[9] = 1.0;
|
||
|
|
stateTransitionOnTimeout[9] = "NoAmmo";
|
||
|
|
stateScript[9] = "onDryFire";
|
||
|
|
|
||
|
|
// Play the reload clip animation
|
||
|
|
stateName[10] = "ReloadClip";
|
||
|
|
stateTransitionGeneric0In[10] = "SprintEnter";
|
||
|
|
stateTransitionOnTimeout[10] = "Ready";
|
||
|
|
stateWaitForTimeout[10] = true;
|
||
|
|
stateTimeoutValue[10] = 3.0;
|
||
|
|
stateReload[10] = true;
|
||
|
|
stateSequence[10] = "reload";
|
||
|
|
stateShapeSequence[10] = "Reload";
|
||
|
|
stateScaleShapeSequence[10] = true;
|
||
|
|
|
||
|
|
// Start Sprinting
|
||
|
|
stateName[11] = "SprintEnter";
|
||
|
|
stateTransitionGeneric0Out[11] = "SprintExit";
|
||
|
|
stateTransitionOnTimeout[11] = "Sprinting";
|
||
|
|
stateWaitForTimeout[11] = false;
|
||
|
|
stateTimeoutValue[11] = 0.5;
|
||
|
|
stateWaitForTimeout[11] = false;
|
||
|
|
stateScaleAnimation[11] = false;
|
||
|
|
stateScaleAnimationFP[11] = false;
|
||
|
|
stateSequenceTransitionIn[11] = true;
|
||
|
|
stateSequenceTransitionOut[11] = true;
|
||
|
|
stateAllowImageChange[11] = false;
|
||
|
|
stateSequence[11] = "sprint";
|
||
|
|
|
||
|
|
// Sprinting
|
||
|
|
stateName[12] = "Sprinting";
|
||
|
|
stateTransitionGeneric0Out[12] = "SprintExit";
|
||
|
|
stateWaitForTimeout[12] = false;
|
||
|
|
stateScaleAnimation[12] = false;
|
||
|
|
stateScaleAnimationFP[12] = false;
|
||
|
|
stateSequenceTransitionIn[12] = true;
|
||
|
|
stateSequenceTransitionOut[12] = true;
|
||
|
|
stateAllowImageChange[12] = false;
|
||
|
|
stateSequence[12] = "sprint";
|
||
|
|
|
||
|
|
// Stop Sprinting
|
||
|
|
stateName[13] = "SprintExit";
|
||
|
|
stateTransitionGeneric0In[13] = "SprintEnter";
|
||
|
|
stateTransitionOnTimeout[13] = "Ready";
|
||
|
|
stateWaitForTimeout[13] = false;
|
||
|
|
stateTimeoutValue[13] = 0.5;
|
||
|
|
stateSequenceTransitionIn[13] = true;
|
||
|
|
stateSequenceTransitionOut[13] = true;
|
||
|
|
stateAllowImageChange[13] = false;
|
||
|
|
stateSequence[13] = "sprint";
|
||
|
|
};
|