Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- addDamageType("Requiem6", '', '%2 <bitmap:base/client/ui/ci/> %1', 0.2, 1);
- addDamageType("Requiem6", '', '%2 <bitmap:base/client/ui/ci/skull> <bitmap:base/client/ui/ci/> %1', 0.2, 1);
- datablock AudioProfile(Requiem6Fire1Sound)
- {
- filename = "./res/sounds/revolver/revolver_fire01.wav";
- description = AudioClose3d;
- preload = true;
- };
- datablock AudioProfile(Requiem6Fire2Sound)
- {
- filename = "./res/sounds/revolver/revolver_fire02.wav";
- description = AudioClose3d;
- preload = true;
- };
- datablock AudioProfile(Requiem6Fire3Sound)
- {
- filename = "./res/sounds/revolver/revolver_fire03.wav";
- description = AudioClose3d;
- preload = true;
- };
- datablock AudioProfile(Requiem6ReloadSound)
- {
- filename = "./res/sounds/pistol/pistol_reload.wav";
- description = AudioClosest3d;
- preload = true;
- };
- datablock AudioProfile(Requiem6ActivateSound)
- {
- filename = "./res/sounds/pistol/pistol_activate.wav";
- description = AudioClosest3d;
- preload = true;
- };
- datablock ItemData(Requiem6Item)
- {
- category = "Weapon";
- className = "Weapon";
- shapeFile = "./res/shapes/SMAGNUM.dts";
- mass = 1;
- density = 0.2;
- elasticity = 0.2;
- friction = 0.6;
- emap = true;
- uiName = "Requiem Six";
- image = Requiem6Image;
- canDrop = true;
- maxmag = 6;
- ammotype = "R6 Ammo";
- reload = true;
- };
- datablock ShapeBaseImageData(Requiem6Image)
- {
- shapeFile = "./res/shapes/SMAGNUM.dts";
- emap = true;
- mountPoint = 0;
- offset = "0 0 0";
- eyeOffset = "0.9 1.6 -0.8";
- rotation = eulerToMatrix( "0 0 0" );
- correctMuzzleVector = true;
- className = "WeaponImage";
- item = Requiem6Item;
- raycastEnabled = 1;
- raycastRange = 200;
- raycastHitExplosion = Projectile;
- raycastHitPlayerExplosion = PlayerImpactProjectile;
- directDamage = 30;
- // directDamageType = ...;
- raycastSpread = 1.5;
- raycastCount = 1;
- raycastTracer = TracerShapeData;
- raycastTracerTime = 64;
- raycastTracerSize = 0.5;
- raycastTracerColor = "0.9 0.5 0.1 1";
- casing = PistolShellDebris;
- shellExitDir = "0.5 -1.3 0.5";
- shellExitOffset = "0 0 0";
- shellExitVariance = 15.0;
- shellVelocity = 7.0;
- melee = false;
- armReady = true;
- doColorShift = 0.25;
- colorShiftColor = "0.25 0.25 0.25 1.000";
- stateName[0] = "Activate";
- stateSequence[0] = "Activate";
- stateTimeoutValue[0] = 0.35;
- stateTransitionOnTimeout[0] = "AmmoCheck";
- stateName[1] = "Ready";
- stateTransitionOnTriggerDown[1] = "Fire";
- stateTransitionOnNoAmmo[1] = "Empty";
- stateAllowImageChange[1] = true;
- stateSequence[1] = "root";
- stateName[2] = "Fire";
- stateTransitionOnTriggerUp[2] = "Delay";
- stateTimeoutValue[2] = 0.18;
- stateFire[2] = true;
- stateAllowImageChange[2] = false;
- stateSequence[2] = "Fire";
- stateScript[2] = "onFire";
- stateWaitForTimeout[2] = true;
- stateEmitter[2] = PistolFlashEmitter;
- stateEmitterTime[2] = 0.05;
- stateEmitterNode[2] = "muzzleNode";
- stateEjectShell[2] = false;
- stateName[3] = "AmmoCheck";
- stateTransitionOnTimeout[3] = "Ready";
- stateAllowImageChange[3] = true;
- stateScript[3] = "onAmmoCheck";
- stateName[4] = "Reload";
- stateTransitionOnTimeout[4] = "ejectShell1";
- stateTimeoutValue[4] = 0.8;
- stateAllowImageChange[4] = true;
- stateSequence[4] = "reloadStart";
- stateScript[4] = "onReloadStart";
- stateName[5] = "ReloadMid";
- stateTransitionOnTimeout[5] = "ReloadReady";
- stateTimeoutValue[5] = 1;
- stateAllowImageChange[5] = true;
- stateSequence[5] = "reloadEnd";
- stateScript[5] = "onReloadMid";
- stateName[6] = "ReloadReady";
- stateTransitionOnTimeout[6] = "CheckChamber";
- stateTimeoutValue[6] = 0.5;
- stateAllowImageChange[6] = true;
- stateSequence[6] = "rollChamber";
- stateScript[6] = "onReload";
- stateName[7] = "Empty";
- stateTransitionOnTriggerDown[7] = "EmptyFire";
- stateAllowImageChange[7] = true;
- stateScript[7] = "onEmpty";
- stateTransitionOnAmmo[7] = "Reload";
- stateSequence[7] = "noammo";
- stateName[8] = "EmptyFire";
- stateTransitionOnTriggerUp[8] = "Empty";
- stateTimeoutValue[8] = 0.13;
- stateAllowImageChange[8] = false;
- stateWaitForTimeout[8] = true;
- stateSound[8] = EmptySound;
- stateSequence[8] = "noammo_fire";
- stateName[9] = "CheckChamber";
- stateTransitionOnTimeOut[9] = "Ready";
- stateTransitionOnNoAmmo[9] = "Cocking";
- stateAllowImageChange[9] = true;
- stateName[10] = "Cocking";
- stateTransitionOnTimeOut[10] = "Ready";
- stateTimeoutValue[10] = 0.1;
- stateAllowImageChange[10] = true;
- stateWaitForTimeout[10] = true;
- stateSound[10] = "";
- stateScript[10] = "onCock";
- stateName[11] = "Delay";
- stateTimeoutValue[11] = 0.35;
- stateTransitionOnTimeout[11] = "AmmoCheck";
- stateEmitter[11] = PistolSmokeEmitter;
- stateName[12] = "ejectShell1";
- stateTransitionOnTimeout[12] = "ejectShell2";
- stateEjectShell[12] = true;
- stateName[13] = "ejectShell2";
- stateTransitionOnTimeout[13] = "ejectShell3";
- stateEjectShell[13] = true;
- stateName[14] = "ejectShell3";
- stateTransitionOnTimeout[14] = "ejectShell4";
- stateEjectShell[14] = true;
- stateName[15] = "ejectShell4";
- stateTransitionOnTimeout[15] = "ejectShell5";
- stateEjectShell[15] = true;
- stateName[16] = "ejectShell5";
- stateTransitionOnTimeout[16] = "ejectShell6";
- stateEjectShell[16] = true;
- stateName[17] = "ejectShell6";
- stateTransitionOnTimeout[17] = "ReloadMid";
- stateEjectShell[17] = true;
- };
- function Requiem6Image::onReloadStart( %this, %obj, %slot )
- {
- %pos = %obj.getHackPosition();
- %obj.playThread(2,shiftLeft);
- %rnd = getRandom(1,3);
- %sound = PistolReloadSound;
- serverPlay3d(%sound, %pos);
- DisplayAmmo(%this,%obj,%slot);
- }
- function Requiem6Image::onReloadMid( %this, %obj, %slot )
- {
- %pos = %obj.getHackPosition();
- %rnd = getRandom(1,3);
- %sound = PistolReloadSound;
- serverPlay3d(%sound, %pos);
- %obj.playThread(2, plant);
- //DisplayAmmo(%this,%obj,%slot);
- }
- function Requiem6Image::onAmmoCheck( %this, %obj, %slot )
- {
- AmmoCheck(%this,%obj,%slot);
- DisplayAmmo(%this,%obj,%slot);
- }
- function Requiem6Image::onReload( %this, %obj, %slot )
- {
- // %obj.playThread(2,rotCCW);
- //serverPlay3d(MagnumSpinSound, %obj.getHackPosition());
- AmmoOnReload(%this,%obj,%slot);
- DisplayAmmo(%this,%obj,%slot);
- }
- function Requiem6Image::onCock( %this, %obj, %slot )
- {
- %obj.setImageAmmo(0,1);
- DisplayAmmo(%this,%obj,%slot);
- }
- function Requiem6Image::onMount( %this, %obj, %slot )
- {
- parent::onMount(%this,%obj,%slot);
- DisplayAmmo(%this,%obj,%slot,0);
- }
- function Requiem6Image::onUnMount( %this, %obj, %slot )
- {
- parent::onUnMount(%this,%obj,%slot);
- DisplayAmmo(%this,%obj,%slot,-1);
- }
- function Requiem6Image::onFire(%this,%obj,%slot)
- {
- if(%obj.getDamagePercent() > 1.0)
- {
- return;
- }
- if (isObject(%obj.client))
- {
- %x = getRandom() * 3 - 1.5;
- %y = 4 + getRandom() * 6.5;
- commandToClient(%obj.client, 'AimRecoil', %x, -%y, 15);
- }
- if($Weapons::ammoSystem)
- {
- %obj.toolMag[%obj.currTool] -= 1;
- if(%obj.toolMag[%obj.currTool] < 1)
- {
- %obj.toolMag[%obj.currTool] = 0;
- %obj.setImageAmmo(0,0);
- }
- DisplayAmmo(%this,%obj,%slot);
- }
- Parent::onFire(%this,%obj,%slot);
- %obj.playThread(2, shiftAway);
- %sound = nameToID("Requiem6Fire" @ getRandom(1, 2) @ "Sound");
- serverplay3d(%sound, %obj.gethackposition());
- }
- function Requiem6Image::onEmpty(%this,%obj,%slot)
- {
- if( $Weapons::Ammo && %obj.toolAmmo[%this.item.ammotype] < 1 )
- {
- return;
- }
- if(%obj.toolMag[%obj.currTool] < 1)
- {
- serverCmdLight(%obj.client);
- }
- }
- function Requiem6Image::onRaycastCollision(%this, %obj, %col, %pos, %normal, %vec)
- {
- if( !( %col.getType() & $typeMasks::playerObjectType || %col.getType() & $typeMasks::corpseObjectType ) )
- {
- %rnd = getRandom( 1, 4 );
- serverPlay3d( BulletHitSound @ %rnd, %pos );
- }
- else
- {
- %rnd = getRandom( 1, 4 );
- serverPlay3d( FleshHitSound @ %rnd, %pos );
- }
- if( !(%col.getType() & $typeMasks::playerObjectType) && !(%col.getType & $TypeMasks::vehicleObjectType) )
- {
- spawnDecal(gunShotShapeData, vectorAdd(%pos, vectorScale(%normal, 0.02)), %normal, 1);
- }
- parent::onRaycastCollision( %this, %obj, %col, %pos, %normal, %vec);
- }
- function Requiem6Image::damage(%this, %obj, %col, %pos, %normal, %vec)
- {
- %damage = 45;
- %type = $DamageType::Requiem6;
- %z = getWord(%col.getScale(), 2);
- if (getWord(%pos, 2) > getword(%col.getWorldBoxCenter(), 2) - 3.3 * %z)
- {
- %damage = 75;
- %type = $DamageType::Requiem6Crit;
- if (isObject(CritProjectile))
- {
- %col.spawnExplosion(CritProjectile, %z);
- if (isObject(%col.client))
- {
- %col.client.play2D(CritRecieveSound);
- }
- if (%obj.getType() & $TypeMasks::PlayerObjectType)
- {
- serverPlay3D(CritFireSound, %obj.getHackPosition());
- if (isObject(%obj.client))
- {
- %obj.client.play2d(CritHitSound);
- }
- }
- }
- }
- %col.damage(%obj, %pos, %damage * %obj.getSize(), %type);
- if (%this.raycastImpactImpulse)
- {
- %col.applyImpulse(%pos, vectorScale(%vec, %this.impactImpulse));
- }
- if (%this.raycastVerticalImpulse)
- {
- %col.applyImpulse(%pos, vectorScale("0 0 1", %this.verticalImpulse));
- }
- }
- datablock ShapeBaseImageData(Requiem6SightsImage : Requiem6Image)
- {
- zoom = 0.6;
- eyeOffset = "0.00536 0.003 -0.7";
- raycastSpread = 0.3;
- stateSound[0] = SightsInSound;
- stateSequence[0] = "Sights";
- };
- function Requiem6SightsImage::onReloadStart( %this, %obj, %slot )
- {
- Requiem6Image::onReloadStart( %this, %obj, %slot );
- }
- function Requiem6SightsImage::onAmmoCheck( %this, %obj, %slot )
- {
- Requiem6Image::onAmmoCheck( %this, %obj, %slot );
- }
- function Requiem6SightsImage::onReload( %this, %obj, %slot )
- {
- Requiem6Image::onReload( %this, %obj, %slot );
- }
- function Requiem6SightsImage::onCock( %this, %obj, %slot )
- {
- Requiem6Image::onCock( %this, %obj, %slot );
- }
- function Requiem6SightsImage::onMount( %this, %obj, %slot )
- {
- parent::onMount(%this,%obj,%slot);
- DisplayAmmo(%this,%obj,%slot,0);
- // serverPlay3D(%sound, %obj.getHackPosition());
- }
- function Requiem6SightsImage::onUnMount( %this, %obj, %slot )
- {
- parent::onUnMount(%this,%obj,%slot);
- DisplayAmmo(%this,%obj,%slot,-1);
- }
- function Requiem6SightsImage::onEmpty(%this,%obj,%slot)
- {
- Requiem6Image::onEmpty(%this,%obj,%slot);
- }
- function Requiem6SightsImage::onFire( %this, %obj, %slot )
- {
- Requiem6Image::onFire( %this, %obj, %slot );
- }
- function Requiem6SightsImage::onRaycastCollision( %this, %obj, %col, %pos, %normal, %vec)
- {
- Requiem6Image::onRaycastCollision( %this, %obj, %col, %pos, %normal, %vec);
- }
- function Requiem6SightsImage::onRaycastDamage(%this,%obj,%slot,%col,%pos,%normal,%shotVec,%crit)
- {
- Requiem6Image::onRaycastDamage(%this,%obj,%slot,%col,%pos,%normal,%shotVec,%crit);
- }
- function Requiem6SightsImage::onEmptyFire(%this,%obj,%slot)
- {
- Requiem6Image::onEmptyFire(%this,%obj,%slot);
- }
- function Requiem6SightsImage::damage(%this, %obj, %col, %pos, %normal, %vec)
- {
- Requiem6Image::damage(%this, %obj, %col, %pos, %normal, %vec);
- }
- package Requiem6package
- {
- function Armor::onTrigger(%this, %obj, %slot, %state)
- {
- Parent::onTrigger(%this, %obj, %slot, %state);
- if(%obj.getMountedImage(0) != nameToID(Requiem6Image) && %obj.getMountedImage(0) != nameToID(Requiem6SightsImage))
- {
- return;
- }
- if(%this.canJet)
- {
- return;
- }
- if(%slot == 4)
- {
- if(%state) {
- %obj.playThread(3, shiftLeft);
- %obj.mountImage(Requiem6SightsImage, 0);
- }
- else {
- // %obj.playThread(3, shiftRight);
- %obj.mountImage(Requiem6Image, 0);
- }
- }
- }
- function serverCmdUnuseTool(%this)
- {
- if(isObject(%this.player) && %this.player.getMountedImage(0) == nameToID(Requiem6SightsImage)) {
- return;
- }
- parent::serverCmdUnuseTool(%this);
- }
- };
- activatepackage(Requiem6package);
Advertisement
Add Comment
Please, Sign In to add comment