Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //audio
- datablock AudioProfile(HotShotLasgunFireSound)
- {
- filename = "./Hotshot_shot.wav";
- description = AudioClose3d;
- preload = true;
- };
- datablock ParticleData(RED_HotShotLasgunTrailParticle)
- {
- dragCoefficient = 0.0;
- windCoefficient = 0.0;
- gravityCoefficient = 0.0;
- inheritedVelFactor = 0.0625;
- constantAcceleration = 0.0;
- lifetimeMS = 360;
- lifetimeVarianceMS = 0;
- spinSpeed = 10.0;
- spinRandomMin = -50.0;
- spinRandomMax = 50.0;
- useInvAlpha = false;
- animateTexture = false;
- //framesPerSec = 1;
- textureName = "base/data/particles/dot";
- //animTexName = "~/data/particles/dot";
- // Interpolation variables
- colors[0] = "1 0.0 0 1";
- colors[1] = "1 0.25 0.25 1";
- sizes[0] = 0.2;
- sizes[1] = 0.15;
- times[0] = 0.0;
- times[1] = 1.0;
- };
- datablock ParticleEmitterData(RED_HotShotLasgunTrailEmitter)
- {
- ejectionPeriodMS = 1;
- periodVarianceMS = 0;
- ejectionVelocity = 0; //0.25;
- velocityVariance = 0; //0.10;
- ejectionOffset = 0;
- thetaMin = 0.0;
- thetaMax = 90.0;
- particles = RED_HotShotLasgunTrailParticle;
- useEmitterColors = true;
- };
- datablock ParticleData(BLU_HotShotLasgunTrailParticle : RED_HotShotLasgunTrailParticle)
- {
- colors[0] = "0 0.0 1 1";
- colors[1] = "0.25 0.25 1 1";
- };
- datablock ParticleEmitterData(BLU_HotShotLasgunTrailEmitter : RED_HotShotLasgunTrailEmitter)
- {
- particles = BLU_HotShotLasgunTrailParticle;
- };
- datablock ProjectileData(RED_HotShotLasgunTracerProjectile)
- {
- directDamage = 5;
- directDamageType = $DamageType::Gun;
- radiusDamageType = $DamageType::Gun;
- brickExplosionRadius = 0;
- brickExplosionImpact = true; //destroy a brick if we hit it directly?
- brickExplosionForce = 10;
- brickExplosionMaxVolume = 1; //max volume of bricks that we can destroy
- brickExplosionMaxVolumeFloating = 2; //max volume of bricks that we can destroy if they aren't connected to the ground
- impactImpulse = 100;
- verticalImpulse = 50;
- //explosion = gunExplosion;
- particleEmitter = "RED_HotShotLasgunTrailEmitter";
- muzzleVelocity = 200;
- velInheritFactor = 0;
- armingDelay = 0;
- lifetime = 1000;
- fadeDelay = 700;
- bounceElasticity = 0.5;
- bounceFriction = 0.10;
- isBallistic = true;
- gravityMod = 0.0;
- hasLight = false;
- lightRadius = 3.0;
- lightColor = "0 0 0.5";
- };
- datablock ProjectileData(BLU_HotShotLasgunTracerProjectile : RED_HotShotLasgunTracerProjectile)
- {
- particleEmitter = "BLU_HotShotLasgunTrailEmitter";
- };
- datablock ParticleData(RED_HotShotLasgunExplosionParticle)
- {
- dragCoefficient = 4;
- gravityCoefficient = 0;
- inheritedVelFactor = 0.2;
- constantAcceleration = 0.0;
- lifetimeMS = 250;
- lifetimeVarianceMS = 125;
- textureName = "base/data/particles/dot";
- spinSpeed = 10.0;
- spinRandomMin = -50.0;
- spinRandomMax = 50.0;
- colors[0] = "1.0 0.25 0.25 1";
- colors[1] = "1.0 0.75 0.75 0.0";
- sizes[0] = 1;
- sizes[1] = 0.25;
- useInvAlpha = false;
- };
- datablock ParticleEmitterData(RED_HotShotLasgunExplosionEmitter)
- {
- ejectionPeriodMS = 4;
- periodVarianceMS = 0;
- ejectionVelocity = 4;
- velocityVariance = 1.0;
- ejectionOffset = 0.0;
- thetaMin = 89;
- thetaMax = 90;
- phiReferenceVel = 0;
- phiVariance = 360;
- overrideAdvance = false;
- particles = "RED_HotShotLasgunExplosionParticle";
- useEmitterColors = false;
- uiName = "";
- };
- datablock ParticleData(BLU_HotShotLasgunExplosionParticle : RED_HotShotLasgunExplosionParticle)
- {
- dragCoefficient = 4;
- gravityCoefficient = 0;
- inheritedVelFactor = 0.2;
- constantAcceleration = 0.0;
- lifetimeMS = 250;
- lifetimeVarianceMS = 125;
- textureName = "base/data/particles/dot";
- spinSpeed = 10.0;
- spinRandomMin = -50.0;
- spinRandomMax = 50.0;
- colors[0] = "0.25 0.25 1 1";
- colors[1] = "0.75 0.75 1 0.0";
- sizes[0] = 1;
- sizes[1] = 0.25;
- useInvAlpha = false;
- };
- datablock ParticleEmitterData(BLU_HotShotLasgunExplosionEmitter : RED_HotShotLasgunExplosionEmitter)
- {
- particles = "BLU_HotShotLasgunExplosionParticle";
- };
- datablock ParticleData(RED_HotShotLasgunExplosionRingParticle)
- {
- dragCoefficient = 8;
- gravityCoefficient = 0;
- inheritedVelFactor = 0.2;
- constantAcceleration = 0.0;
- lifetimeMS = 100;
- lifetimeVarianceMS = 50;
- textureName = "base/data/particles/dot";
- spinSpeed = 500.0;
- spinRandomMin = -500.0;
- spinRandomMax = 500.0;
- colors[0] = "1.0 0.25 0.25 1";
- colors[1] = "1.0 0.5 0.5 0.0";
- sizes[0] = 1.5;
- sizes[1] = 3;
- useInvAlpha = false;
- };
- datablock ParticleEmitterData(RED_HotShotLasgunExplosionRingEmitter)
- {
- lifeTimeMS = 200;
- ejectionPeriodMS = 12;
- periodVarianceMS = 0;
- ejectionVelocity = 0;
- velocityVariance = 0.0;
- ejectionOffset = 0.0;
- thetaMin = 89;
- thetaMax = 90;
- phiReferenceVel = 0;
- phiVariance = 360;
- overrideAdvance = false;
- particles = "RED_HotShotLasgunExplosionRingParticle";
- useEmitterColors = true;
- uiName = "";
- };
- datablock ParticleData(BLU_HotShotLasgunExplosionRingParticle : RED_HotShotLasgunExplosionRingParticle)
- {
- colors[0] = "0.25 0.25 1 1";
- colors[1] = "0.5 0.5 1 0.0";
- };
- datablock ParticleEmitterData(BLU_HotShotLasgunExplosionRingEmitter : RED_HotShotLasgunExplosionRingEmitter)
- {
- particles = "BLU_HotShotLasgunExplosionRingParticle";
- };
- datablock ExplosionData(RED_HotShotLasgunExplosion)
- {
- //explosionShape = "";
- soundProfile = bulletHitSound;
- lifeTimeMS = 100;
- particleEmitter = RED_HotShotLasgunExplosionEmitter;
- particleDensity = 5;
- particleRadius = 0.2;
- emitter[0] = RED_HotShotLasgunExplosionRingEmitter;
- faceViewer = true;
- explosionScale = "1 1 1";
- shakeCamera = true;
- camShakeFreq = "1.0 1.0 1.0";
- camShakeAmp = "1.0 1.0 1.0";
- camShakeDuration = 0.25;
- camShakeRadius = 1.25;
- // Dynamic light
- lightStartRadius = 4;
- lightEndRadius = 0;
- lightStartColor = "1.0 0.25 0.25";
- lightEndColor = "0 0 0";
- };
- datablock ExplosionData(BLU_HotShotLasgunExplosion : RED_HotShotLasgunExplosion)
- {
- particleEmitter = BLU_HotShotLasgunExplosionEmitter;
- emitter[0] = BLU_HotShotLasgunExplosionRingEmitter;
- lightStartColor = "0.25 0.25 1";
- };
- datablock ProjectileData(RED_HotShotLasgunExplosionProjectile)
- {
- directDamage = 0;
- directDamageType = $DamageType::Gun;
- radiusDamageType = $DamageType::Gun;
- brickExplosionRadius = 0;
- brickExplosionImpact = true; //destroy a brick if we hit it directly?
- brickExplosionForce = 10;
- brickExplosionMaxVolume = 1; //max volume of bricks that we can destroy
- brickExplosionMaxVolumeFloating = 2; //max volume of bricks that we can destroy if they aren't connected to the ground
- impactImpulse = 100;
- verticalImpulse = 50;
- explosion = RED_HotShotLasgunExplosion;
- particleEmitter = "RED_HotShotLasgunExplosionRingEmitter";
- muzzleVelocity = 200;
- velInheritFactor = 0;
- armingDelay = 0;
- lifetime = 1000;
- fadeDelay = 700;
- bounceElasticity = 0.5;
- bounceFriction = 0.10;
- isBallistic = true;
- gravityMod = 0.0;
- hasLight = false;
- lightRadius = 3.0;
- lightColor = "0 0 0.5";
- };
- datablock ProjectileData(BLU_HotShotLasgunExplosionProjectile : RED_HotShotLasgunExplosionProjectile)
- {
- explosion = BLU_HotShotLasgunExplosion;
- particleEmitter = "BLU_HotShotLasgunExplosionRingEmitter";
- };
- //////////
- // item //
- //////////
- datablock ItemData(RED_HotShotLasgunItem)
- {
- category = "Weapon"; // Mission editor category
- className = "Weapon"; // For inventory system
- // Basic Item Properties
- shapeFile = "./HotShotLasgun.dts";
- rotate = false;
- mass = 1;
- density = 0.2;
- elasticity = 0.2;
- friction = 0.6;
- emap = true;
- //gui stuff
- uiName = "Hot-shot Lasgun R";
- iconName = "./HotshotLasgun";
- doColorShift = false;
- colorShiftColor = "1 1 1 1.000";
- // Dynamic properties defined by the scripts
- image = RED_HotShotLasgunImage;
- canDrop = true;
- //Ammo Guns Parameters
- maxmag = 18;
- ammotype = "rifle";
- reload = true;
- };
- datablock ItemData(BLU_HotShotLasgunItem : RED_HotShotLasgunItem)
- {
- uiName = "Hot-shot Lasgun B";
- image = BLU_HotShotLasgunImage;
- };
- AddDamageType("HotShotLasgun", '<bitmap:add-ons/Weapon_RedvBlu40kV3/CI_HotshotLasgun> %1', '%2 <bitmap:add-ons/Weapon_RedvBlu40kV3/CI_HotshotLasgun> %1',0.75,1);
- ////////////////
- //weapon image//
- ////////////////
- datablock ShapeBaseImageData(RED_HotShotLasgunImage)
- {
- // Basic Item properties
- shapeFile = "./HotShotLasgun.dts";
- emap = true;
- // Specify mount point & offset for 3rd person, and eye offset
- // for first person rendering.
- mountPoint = 0;
- offset = "0 0 0";
- eyeOffset = 0; //"0.7 1.2 -0.5";
- rotation = eulerToMatrix( "0 0 0" );
- // 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.
- className = "WeaponImage";
- // Projectile && Ammo.
- item = RED_HotShotLasgunItem;
- ammo = " ";
- projectile = RED_HotShotLasgunTracerProjectile;
- projectileType = Projectile;
- casing = GunShellDebris;
- shellExitDir = "1.0 0.1 1.0";
- shellExitOffset = "0 0 0";
- shellExitVariance = 10.0;
- shellVelocity = 5.0;
- //melee particles shoot from eye node for consistancy
- melee = false;
- //raise your arm up or not
- armReady = true;
- doColorShift = true;
- colorShiftColor = RED_HotShotLasgunItem.colorShiftColor;
- // 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.
- raycastWeaponRange = 100; //varies
- raycastWeaponTargets =
- $TypeMasks::PlayerObjectType | //AI/Players
- $TypeMasks::StaticObjectType | //Static Shapes
- $TypeMasks::TerrainObjectType | //Terrain
- $TypeMasks::VehicleObjectType | //Terrain
- $TypeMasks::FXBrickObjectType; //Bricks
- raycastExplosionProjectile = RED_HotShotLasgunExplosionProjectile;
- raycastExplosionBrickSound = bulletHitSound;
- raycastExplosionPlayerSound = bulletHitSound;
- raycastDirectDamage = 15; //10
- raycastDirectDamageType = $DamageType::HotShotLasgun;
- raycastSpreadAmt = 0.0012; //varies
- raycastSpreadCount = 1;
- raycastTracerProjectile = RED_HotShotLasgunTracerProjectile;
- raycastFromMuzzle = true;
- // Initial start up state
- stateName[0] = "Activate";
- stateTimeoutValue[0] = 0.15;
- stateTransitionOnTimeout[0] = "AmmoCheck";
- stateScript[0] = "onActivate";
- stateSound[0] = "";
- stateName[1] = "Ready";
- stateTransitionOnTriggerDown[1] = "Fire";
- stateTransitionOnNoAmmo[1] = "Empty";
- stateAllowImageChange[1] = true;
- stateSequence[1] = "root";
- stateScript[1] = "onReady";
- stateName[2] = "Fire";
- stateTransitionOnTimeOut[2] = "AmmoCheck";
- stateTimeoutValue[2] = 0.07;
- stateFire[2] = true;
- stateAllowImageChange[2] = false;
- stateSequence[2] = "Fire";
- stateScript[2] = "onFire";
- stateWaitForTimeout[2] = true;
- stateEmitter[2] = gunFlashEmitter;
- stateSound[2] = HotShotLasgunFireSound;
- stateEmitterTime[2] = 0.05;
- stateEmitterNode[2] = "muzzleNode";
- stateEjectShell[2] = true;
- stateName[3] = "AmmoCheck";
- stateTimeoutValue[3] = 0.04;
- stateTransitionOnTimeout[3] = "Fire";
- stateTransitionOnTriggerUp[3] = "Ready";
- stateTransitionOnNoAmmo[3] = "Empty";
- stateAllowImageChange[3] = true;
- //stateSequence[3] = "Empty";
- stateScript[3] = "onAmmoCheck";
- stateName[4] = "Reload";
- stateTransitionOnTimeout[4] = "ReloadReady";
- stateTimeoutValue[4] = 1.3;
- stateAllowImageChange[4] = true;
- stateSound[4] = LAS_magin;
- stateSequence[4] = "Arm";
- stateScript[4] = "onReloadStart";
- stateName[5] = "ReloadReady";
- stateTransitionOnTimeout[5] = "CheckChamber";
- stateTimeoutValue[5] = 0.5;
- stateAllowImageChange[5] = true;
- stateSound[5] = LAS_magout;
- stateSequence[5] = "Reload";
- stateScript[5] = "onReload";
- stateName[6] = "Empty";
- stateTransitionOnTriggerDown[6] = "EmptyFire";
- stateAllowImageChange[6] = true;
- stateTransitionOnAmmo[6] = "Reload";
- stateSequence[6] = "Empty";
- stateScript[6] = "Empty";
- stateName[7] = "EmptyFire";
- stateTransitionOnTriggerUp[7] = "AmmoCheck";
- stateScript[7] = "onEmpty";
- stateTimeoutValue[7] = 0.13;
- stateAllowImageChange[7] = false;
- stateWaitForTimeout[7] = true;
- stateSound[7] = LAS_empty;
- stateSequence[7] = "Empty";
- stateName[8] = "CheckChamber";
- stateTransitionOnTimeOut[8] = "Ready";
- stateTransitionOnNoAmmo[8] = "Cocking";
- stateAllowImageChange[8] = true;
- stateScript[8] = "CheckChamber";
- stateName[9] = "Cocking";
- stateTransitionOnTimeOut[9] = "Ready";
- stateTimeoutValue[9] = 0.1;
- stateAllowImageChange[9] = true;
- stateWaitForTimeout[9] = true;
- stateSound[9] = "";
- stateScript[9] = "onCock";
- };
- // //
- // //
- // //
- //RED //
- // //
- // //
- // //
- function RED_HotShotLasgunImage::onActivate( %this, %obj, %slot )
- {
- announce("activated");
- }
- function RED_HotShotLasgunImage::onReloadStart( %this, %obj, %slot )
- {
- %obj.playThread(2,shiftleft);
- announce("onReloadStart");
- LAS_DisplayAmmo(%this,%obj,%slot);
- serverPlay3d( RED_HotShotLasgunReloadSound, %obj.getHackPosition() );
- }
- function RED_HotShotLasgunImage::onAmmoCheck( %this, %obj, %slot )
- {
- announce("onAmmoCheck");
- LAS_AmmoCheck(%this,%obj,%slot);
- LAS_DisplayAmmo(%this,%obj,%slot);
- }
- function RED_HotShotLasgunImage::onReload( %this, %obj, %slot )
- {
- announce("onReload");
- %obj.playThread(2,plant);
- LAS_AmmoOnReload(%this,%obj,%slot);
- LAS_DisplayAmmo(%this,%obj,%slot);
- %rnd = getRandom(1,2);
- }
- function RED_HotShotLasgunImage::onCock( %this, %obj, %slot )
- {
- //%obj.playThread(2,shiftLeft);
- %obj.setImageAmmo(0,1);
- announce("onCock");
- }
- function RED_HotShotLasgunImage::onMount( %this, %obj, %slot )
- {
- parent::onMount(%this,%obj,%slot);
- announce("mounted");
- LAS_DisplayAmmo(%this,%obj,%slot,0);
- %obj.lastFireTime = getSimTime() - 500;
- }
- function RED_HotShotLasgunImage::onUnMount( %this, %obj, %slot )
- {
- parent::onUnMount(%this,%obj,%slot);
- announce("unMounted");
- LAS_DisplayAmmo(%this,%obj,%slot,-1);
- %obj.lastFireTime = getSimTime() - 500;
- }
- function RED_HotShotLasgunImage::onEmpty(%this,%obj,%slot)
- {
- announce("onEmpty");
- if( $LAS_Weapons::Ammo && %obj.toolAmmo[%this.item.ammotype] < 1 )
- {
- return;
- }
- if(%obj.toolMag[%obj.currTool] < 1)
- {
- serverCmdLight(%obj.client);
- }
- }
- function RED_HotShotLasgunImage::Empty(%this,%obj,%slot)
- {
- announce("empty");
- //serverCmdLight(%obj.client);
- }
- function RED_HotShotLasgunImage::onReady(%this,%obj,%slot)
- {
- announce("ready");
- }
- function RED_HotShotLasgunImage::CheckChamber(%this,%obj,%slot)
- {
- announce("CheckChamber");
- }
- function RED_HotShotLasgunImage::onFire(%this,%obj,%slot)
- {
- %obj.spawnExplosion(TTRecoilProjectile,"1 1 1");
- if(%obj.getDamagePercent() >= 1.0)
- return;
- if(vectorLen(%obj.getVelocity()) > 0.1)
- {
- %this.raycastSpreadAmt = 0.0018;
- %this.raycastWeaponRange = 300;
- }
- else
- {
- %this.raycastSpreadAmt = 0.0018;
- %this.raycastWeaponRange = 300;
- }
- %obj.playThread(2, plant);
- if($LAS_Weapons::ammoSystem)
- {
- %obj.toolMag[%obj.currTool] -= 1;
- if(%obj.toolMag[%obj.currTool] < 1)
- {
- %obj.toolMag[%obj.currTool] = 0;
- %obj.setImageAmmo(0,0);
- }
- LAS_DisplayAmmo(%this,%obj,%slot);
- }
- Parent::onFire(%this,%obj,%slot);
- }
- // //
- // //
- // //
- //BLU //
- // //
- // //
- // //
- datablock ShapeBaseImageData(BLU_HotShotLasgunImage : RED_HotShotLasgunImage)
- {
- item = BLU_HotShotLasgunItem;
- projectile = BLU_HotShotLasgunTracerProjectile;
- colorShiftColor = BLU_HotShotLasgunItem.colorShiftColor;
- raycastExplosionProjectile = BLU_HotShotLasgunExplosionProjectile;
- raycastTracerProjectile = BLU_HotShotLasgunTracerProjectile;
- };
- function BLU_HotShotLasgunImage::onFire(%this,%obj,%slot)
- {
- %obj.spawnExplosion(TTRecoilProjectile,"1 1 1");
- if(%obj.getDamagePercent() >= 1.0)
- return;
- if(vectorLen(%obj.getVelocity()) > 0.1)
- {
- %this.raycastSpreadAmt = 0.0018;
- %this.raycastWeaponRange = 300;
- }
- else
- {
- %this.raycastSpreadAmt = 0.0018;
- %this.raycastWeaponRange = 300;
- }
- %obj.playThread(2, plant);
- Parent::onFire(%this,%obj,%slot);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement