//------------------------------------------------------------------------------ // DiscPack.cs // - by defender // a disc launcher weapon - shots a fast rate of discs.. // should be used by heavys only- // original pack code I used is made by -DynaBlade.. //------------------------------------------------------------------------------ datablock ShapeBaseImageData(DiscDecalImage) { mountPoint = 1; shapeFile = "pack_deploy_turreti.dts"; offset = "0.16 0 0"; rotation = "0 1 0 180"; }; datablock ShapeBaseImageData(DiscPackImage) { shapeFile = "pack_deploy_turreti.dts"; item = DiscPack; mountPoint = 1; offset = "-0.16 0 0"; rotation = "0 1 0 180"; emap = true; gun = DiscGunImage; stateName[0] = "Idle"; stateTransitionOnTriggerDown[0] = "Activate"; stateName[1] = "Activate"; stateScript[1] = "onActivate"; stateSequence[1] = "fire"; stateSound[1] = DiscSwitchSound; stateTransitionOnTriggerUp[1] = "Deactivate"; stateName[2] = "Deactivate"; stateScript[2] = "onDeactivate"; stateTransitionOnTimeout[2] = "Idle"; }; datablock ItemData(DiscPack) { className = Pack; catagory = "Packs"; shapeFile = "pack_deploy_turreti.dts"; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; rotate = true; image = "DiscPackImage"; pickUpName = "a Disc Cannon pack"; emap = true; }; //-------------------------------------------------------------------------- // Projectile //-------------------------------------- // uses the disc launcher projectile //-------------------------------------- datablock ShapeBaseImageData(DiscGunImage) { className = WeaponImage; //shapeFile = "turret_tank_barrelchain.dts"; shapeFile = "TR2weapon_disc.dts"; rotation = "0 1 0 -90"; item = Plasma; usesEnergy = true; minEnergy = 4; fireEnergy = 4; projectile = DiscProjectile; projectileType = LinearProjectile; // State Data stateName[0] = "Preactivate"; stateTransitionOnLoaded[0] = "Activate"; stateTransitionOnNoAmmo[0] = "NoAmmo"; stateName[1] = "Activate"; stateTransitionOnTimeout[1] = "Ready"; stateTimeoutValue[1] = 0.5; stateSequence[1] = "Activated"; stateSound[1] = DiscSwitchSound; stateName[2] = "Ready"; stateTransitionOnNoAmmo[2] = "NoAmmo"; stateTransitionOnTriggerDown[2] = "Fire"; stateSequence[2] = "DiscSpin"; stateSound[2] = DiscLoopSound; stateName[3] = "Fire"; stateTransitionOnTimeout[3] = "Reload"; stateTimeoutValue[3] = 0.09; stateFire[3] = true; stateRecoil[3] = LightRecoil; stateAllowImageChange[3] = false; stateSequence[3] = "Fire"; stateScript[3] = "onFire"; stateSound[3] = DiscFireSound; stateName[4] = "Reload"; stateTransitionOnNoAmmo[4] = "NoAmmo"; stateTransitionOnTimeout[4] = "Ready"; stateTimeoutValue[4] = 0.09; // 0.25 load, 0.25 spinup stateAllowImageChange[4] = false; stateSequence[4] = "Reload"; stateSound[4] = DiscReloadSound; stateName[5] = "NoAmmo"; stateTransitionOnAmmo[5] = "Reload"; stateSequence[5] = "NoAmmo"; stateTransitionOnTriggerDown[5] = "DryFire"; stateName[6] = "DryFire"; stateSound[6] = DiscDryFireSound; stateTimeoutValue[6] = 0.1; stateTransitionOnTimeout[6] = "NoAmmo"; }; function DiscPackImage::onMount(%data, %obj, %node) { %obj.mountImage(DiscDecalImage, 7); } function DiscPackImage::onUnmount(%data, %obj, %node) { %obj.unmountImage(7); // dismount the Disc gun if the player had it mounted // need the extra "if" statement to avoid a console error message if(%obj.getMountedImage($WeaponSlot)) if(%obj.getMountedImage($WeaponSlot).getName() $= "DiscGunImage") %obj.unmountImage($WeaponSlot); } function DiscPackImage::onActivate(%data, %obj, %slot) { // don't activate the pack if player is piloting a vehicle if(%obj.isPilot()) { %obj.setImageTrigger(%slot, false); return; } if(!isObject(%obj.getMountedImage($WeaponSlot)) || %obj.getMountedImage($WeaponSlot).getName() !$= "DiscGunImage") { // unmount any weapon the player may have been holding if(%obj.getMountedImage($WeaponSlot)) %obj.unmountImage($WeaponSlot); // make sure player's arm thread is "look" %obj.setArmThread(look); // mount the Gauss gun %obj.mountImage(DiscGunImage, $WeaponSlot); commandToClient(%obj.client, 'setRepairReticle'); } } function DiscPackImage::onDeactivate(%data, %obj, %slot) { //called when the player hits the "pack" key again (toggle) %obj.setImageTrigger(%slot, false); if(%obj.getMountedImage($WeaponSlot).getName() $= "DiscGunImage") %obj.unmountImage($WeaponSlot); } function DiscGunImage::onMount(%this,%obj,%slot) { %obj.setImageAmmo(%slot,true); } function DiscGunImage::onUnmount(%this,%obj,%slot) { %obj.setImageTrigger(%slot, false); %obj.setImageTrigger($BackpackSlot, false); } function DiscPack::onPickup(%this, %obj, %shape, %amount) { // created to prevent console errors }