mirror of
https://github.com/PhantomGamesDevelopment/TWM2.git
synced 2026-07-10 14:04:38 +00:00
Initial Commit
This commit is contained in:
commit
bd51490b14
316 changed files with 150033 additions and 0 deletions
637
scripts/weapons/Construction/EditGun.cs
Normal file
637
scripts/weapons/Construction/EditGun.cs
Normal file
|
|
@ -0,0 +1,637 @@
|
|||
//Editing Tool(s) By Phantom139
|
||||
//This Tool Contains Many Useful Modes For Players To Quickly Modify Objects
|
||||
|
||||
//Weapon Modes:
|
||||
|
||||
// - Texture Swapping
|
||||
// - FF Swappings
|
||||
// - Turret Barrel Swapping
|
||||
// - Object Cloak / Fade
|
||||
// - Object Deletion
|
||||
|
||||
//Texture Swapping Vars
|
||||
$EditTool::PadModeCount = 20;
|
||||
$EditTool::PadModes[0] = "DeployedSpine";
|
||||
$EditTool::PadModes[1] = "DeployedMSpine";
|
||||
$EditTool::PadModes[2] = "DeployedwWall";
|
||||
$EditTool::PadModes[3] = "DeployedWall";
|
||||
$EditTool::PadModes[4] = "DeployedSpine2";
|
||||
$EditTool::PadModes[5] = "DeployedSpine3";
|
||||
$EditTool::PadModes[6] = "DeployedCrate0";
|
||||
$EditTool::PadModes[7] = "DeployedCrate1";
|
||||
$EditTool::PadModes[8] = "DeployedCrate2";
|
||||
$EditTool::PadModes[9] = "DeployedCrate3";
|
||||
$EditTool::PadModes[10] = "DeployedCrate4";
|
||||
$EditTool::PadModes[11] = "DeployedCrate5";
|
||||
$EditTool::PadModes[12] = "DeployedCrate6";
|
||||
$EditTool::PadModes[13] = "DeployedCrate7";
|
||||
$EditTool::PadModes[14] = "DeployedCrate8";
|
||||
$EditTool::PadModes[15] = "DeployedCrate9";
|
||||
$EditTool::PadModes[16] = "DeployedCrate10";
|
||||
$EditTool::PadModes[17] = "DeployedCrate11";
|
||||
$EditTool::PadModes[18] = "DeployedCrate12";
|
||||
$EditTool::PadModes[19] = "DeployedDecoration6";
|
||||
$EditTool::PadModes[20] = "DeployedDecoration16";
|
||||
|
||||
|
||||
datablock LinearFlareProjectileData(EditorBolt)
|
||||
{
|
||||
emitterDelay = -1;
|
||||
directDamage = 0;
|
||||
directDamageType = $DamageType::Default;
|
||||
kickBackStrength = 0.0;
|
||||
bubbleEmitTime = 1.0;
|
||||
|
||||
sound = PlasmaProjectileSound;
|
||||
velInheritFactor = 0.5;
|
||||
|
||||
explosion = "BlasterExplosion";
|
||||
splash = BlasterSplash;
|
||||
|
||||
grenadeElasticity = 0.998;
|
||||
grenadeFriction = 0.0;
|
||||
armingDelayMS = 500;
|
||||
|
||||
muzzleVelocity = 100.0;
|
||||
|
||||
drag = 0.05;
|
||||
|
||||
gravityMod = 0.0;
|
||||
|
||||
dryVelocity = 100.0;
|
||||
wetVelocity = 80.0;
|
||||
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 6000;
|
||||
|
||||
lifetimeMS = 6000;
|
||||
|
||||
scale = "1 1 1";
|
||||
numFlares = 48;
|
||||
flareColor = "1 0 0";
|
||||
flareModTexture = "special/shrikeBoltCross";
|
||||
flareBaseTexture = "special/shrikeBolt";
|
||||
};
|
||||
|
||||
datablock ItemData(EditTool)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_disc.dts";
|
||||
image = EditGunImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a Editing Tool";
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(EditGunImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_disc.dts";
|
||||
item = EditTool;
|
||||
offset = "0 0 0";
|
||||
emap = true;
|
||||
usesEnergy = true;
|
||||
minEnergy = 0.01;
|
||||
|
||||
projectile = EditorBolt;
|
||||
projectileType = LinearFlareProjectile;
|
||||
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = BlasterSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.2;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateSound[3] = GrenadeLauncherFireSound;
|
||||
stateScript[3] = "onFire";
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateSound[4] = SoulTakerReloadSound;
|
||||
stateEjectShell[4] = true;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateTimeoutValue[6] = 0.3;
|
||||
stateSound[6] = ChaingunDryFireSound;
|
||||
stateTransitionOnTimeout[6] = "Ready";
|
||||
};
|
||||
|
||||
function EditGunImage::onMount(%this, %obj, %slot) {
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
DispEditorToolInfo(%obj);
|
||||
if(!isSet(%obj.EditPMode)) {
|
||||
%obj.EditPMode = 0;
|
||||
}
|
||||
if(!isSet(%obj.EditSMode)) {
|
||||
%obj.EditSMode = 0;
|
||||
}
|
||||
%obj.UsingEditTool = true;
|
||||
}
|
||||
|
||||
function EditGunImage::onunmount(%this,%obj,%slot)
|
||||
{
|
||||
Parent::onUnmount(%this, %obj, %slot);
|
||||
%obj.UsingEditTool = false;
|
||||
}
|
||||
|
||||
function DispEditorToolInfo(%obj) {
|
||||
switch(%obj.EditPMode) {
|
||||
case 0:
|
||||
%primary = "Pad Swapping";
|
||||
switch(%obj.EditSMode) {
|
||||
case 0:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: [Pad Swap] - FF Swap - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Blue Pad - [LSB] - MSB<spop>", 5, 3);
|
||||
case 1:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: [Pad Swap] - FF Swap - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: LSB - [MSB] - Walkway<spop>", 5, 3);
|
||||
case 2:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: [Pad Swap] - FF Swap - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: MSB - [Walkway] - Medium Floor <spop>", 5, 3);
|
||||
case 3:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: [Pad Swap] - FF Swap - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Walkway - [Medium Floor] - Dark Pad<spop>", 5, 3);
|
||||
case 4:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: [Pad Swap] - FF Swap - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Medium Floor - [Dark Pad] - V-Pad<spop>", 5, 3);
|
||||
case 5:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: [Pad Swap] - FF Swap - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Dark Pad - [V-Pad] - C.1 Backpack<spop>", 5, 3);
|
||||
case 6:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: [Pad Swap] - FF Swap - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: V-Pad - [C.1 Backpack] - C.2 Small Containment<spop>", 5, 3);
|
||||
case 7:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: [Pad Swap] - FF Swap - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: C.1 Backpack - [C.2 Small Containment] - C.3 Large Containment<spop>", 5, 3);
|
||||
case 8:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: [Pad Swap] - FF Swap - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: C.2 Small Containment - [C.3 Large Containment] - C.4 Compressor<spop>", 5, 3);
|
||||
case 9:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: [Pad Swap] - FF Swap - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: C.3 Large Containment - [C.4 Compressor] - C.5 Tubes<spop>", 5, 3);
|
||||
case 10:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: [Pad Swap] - FF Swap - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: C.4 Compressor - [C.5 Tubes] - C.6 Quantium Bat.<spop>", 5, 3);
|
||||
case 11:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: [Pad Swap] - FF Swap - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: C.5 Tubes - [C.6 Quantium Bat.] - C.7 Proton Acc.<spop>", 5, 3);
|
||||
case 12:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: [Pad Swap] - FF Swap - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: C.6 Quantium Bat. - [C.7 Proton Acc.] - C.8 Cargo Crate<spop>", 5, 3);
|
||||
case 13:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: [Pad Swap] - FF Swap - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: C.7 Proton Acc. - [C.8 Cargo Crate] - C.9 Mag Cooler<spop>", 5, 3);
|
||||
case 14:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: [Pad Swap] - FF Swap - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: C.8 Cargo Crate - [C.9 Mag Cooler] - C.10 Recycle Unit<spop>", 5, 3);
|
||||
case 15:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: [Pad Swap] - FF Swap - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: C.9 Mag Cooler - [C.10 Recycle Unit] - C.11 Fuel Canister<spop>", 5, 3);
|
||||
case 16:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: [Pad Swap] - FF Swap - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: C.10 Recycle Unit - [C.11 Fuel Canister] - C.12 Wooden Box<spop>", 5, 3);
|
||||
case 17:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: [Pad Swap] - FF Swap - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: C.11 Fuel Canister - [C.12 Wooden Box] - C.13 Plasma Router<spop>", 5, 3);
|
||||
case 18:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: [Pad Swap] - FF Swap - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: C.12 Wooden Box - [C.13 Plasma Router] - Statue Base<spop>", 5, 3);
|
||||
case 19:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: [Pad Swap] - FF Swap - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: C.13 Plasma Router - [Statue Base] - Blue Pad<spop>", 5, 3);
|
||||
case 20:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: [Pad Swap] - FF Swap - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Statue Base - [Blue Pad] - LSB<spop>", 5, 3);
|
||||
}
|
||||
case 1:
|
||||
%primary = "Force-Field Swapping";
|
||||
switch(%obj.EditSMode) {
|
||||
case 0:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - [FF Swap] - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: All Pass Yellow - [Solid White] - Solid Red<spop>", 5, 3);
|
||||
case 1:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - [FF Swap] - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Solid White - [Solid Red] - Solid Green<spop>", 5, 3);
|
||||
case 2:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - [FF Swap] - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Solid Red - [Solid Green] - Solid Blue<spop>", 5, 3);
|
||||
case 3:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - [FF Swap] - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Solid Green - [Solid Blue] - Solid Cyan<spop>", 5, 3);
|
||||
case 4:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - [FF Swap] - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Solid Blue - [Solid Cyan] - Solid Magenta<spop>", 5, 3);
|
||||
case 5:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - [FF Swap] - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Solid Cyan - [Solid Magenta] - Solid Yellow<spop>", 5, 3);
|
||||
case 6:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - [FF Swap] - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Solid Magenta - [Solid Yellow] - Team Pass White<spop>", 5, 3);
|
||||
case 7:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - [FF Swap] - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Solid Yellow - [Team Pass White] - Team Pass Red<spop>", 5, 3);
|
||||
case 8:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - [FF Swap] - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Team Pass White - [Team Pass Red] - Team Pass Green<spop>", 5, 3);
|
||||
case 9:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - [FF Swap] - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Team Pass Red - [Team Pass Green] - Team Pass Blue<spop>", 5, 3);
|
||||
case 10:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - [FF Swap] - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Team Pass Green - [Team Pass Blue] - Team Pass Cyan<spop>", 5, 3);
|
||||
case 11:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - [FF Swap] - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Team Pass Blue - [Team Pass Cyan] - Team Pass Magenta<spop>", 5, 3);
|
||||
case 12:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - [FF Swap] - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Team Pass Cyan - [Team Pass Magenta] - Team Pass Yellow<spop>", 5, 3);
|
||||
case 13:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - [FF Swap] - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Team Pass Magenta - [Team Pass Yellow] - All Pass White<spop>", 5, 3);
|
||||
case 14:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - [FF Swap] - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Team Pass Yellow - [All Pass White] - All Pass Red<spop>", 5, 3);
|
||||
case 15:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - [FF Swap] - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: All Pass White - [All Pass Red] - All Pass Green<spop>", 5, 3);
|
||||
case 16:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - [FF Swap] - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: All Pass Red - [All Pass Green] - All Pass Blue<spop>", 5, 3);
|
||||
case 17:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - [FF Swap] - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: All Pass Green - [All Pass Blue] - All Pass Cyan<spop>", 5, 3);
|
||||
case 18:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - [FF Swap] - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: All Pass Blue - [All Pass Cyan] - All Pass Magenta<spop>", 5, 3);
|
||||
case 19:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - [FF Swap] - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: All Pass Cyan - [All Pass Magenta] - All Pass Yellow<spop>", 5, 3);
|
||||
case 20:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - [FF Swap] - Barrel Swap - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: All Pass Magenta - [All Pass Yellow] - Solid White<spop>", 5, 3);
|
||||
}
|
||||
case 2:
|
||||
%primary = "Turret Barrel Swapping";
|
||||
switch(%obj.EditSMode) {
|
||||
case 0:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - FF Swap - [Barrel Swap] - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Mortar - [Anti Air] - Missile<spop>", 5, 3);
|
||||
case 1:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - FF Swap - [Barrel Swap] - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Anti Air - [Missile] - Plasma<spop>", 5, 3);
|
||||
case 2:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - FF Swap - [Barrel Swap] - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Missile - [Plasma] - ELF<spop>", 5, 3);
|
||||
case 3:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - FF Swap - [Barrel Swap] - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Plasma - [ELF] - Mortar<spop>", 5, 3);
|
||||
case 4:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - FF Swap - [Barrel Swap] - Cloak/Fade - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: ELF - [Mortar] - Anti Air<spop>", 5, 3);
|
||||
}
|
||||
case 3:
|
||||
switch(%obj.EditSMode) {
|
||||
case 0:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - FF Swap - Barrel Swap - [Cloak/Fade] - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: [Cloak] - UnCloak - Fade - UnFade <spop>", 5, 3);
|
||||
case 1:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - FF Swap - Barrel Swap - [Cloak/Fade] - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Cloak - [UnCloak] - Fade - UnFade <spop>", 5, 3);
|
||||
case 2:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - FF Swap - Barrel Swap - [Cloak/Fade] - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Cloak - UnCloak - [Fade] - UnFade <spop>", 5, 3);
|
||||
case 3:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - FF Swap - Barrel Swap - [Cloak/Fade] - Delete Objects \n <font:Tempus Sans ITC:18> Grenade: Cloak - UnCloak - Fade - [UnFade] <spop>", 5, 3);
|
||||
}
|
||||
case 4:
|
||||
switch(%obj.EditSMode) {
|
||||
case 0:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - FF Swap - Barrel Swap - Cloak/Fade - [Delete Objects] \n <font:Tempus Sans ITC:18> Grenade: [Single] - Cascade <spop>", 5, 3);
|
||||
case 1:
|
||||
commandToClient( %obj.client, 'BottomPrint', "<spush><font:Tempus Sans ITC:20>[{Manipulator Tool}] - Phantom139 \n Mine: Pad Swap - FF Swap - Barrel Swap - Cloak/Fade - [Delete Objects] \n <font:Tempus Sans ITC:18> Grenade: Single - [Cascade] <spop>", 5, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function ChangeEditGunMode(%this, %data, %PriSec) { //This Is Easier To use
|
||||
if(%PriSec == 1) { //Primary
|
||||
if (!(getSimTime() > (%this.mineModeTime + 100)))
|
||||
return;
|
||||
%this.mineModeTime = getSimTime();
|
||||
%this.EditPMode++;
|
||||
%this.EditSMode = 0; //Reset Secondary Mode TO Prevent Errors
|
||||
if (%this.EditPMode > 4) {
|
||||
%this.EditPMode = 0;
|
||||
}
|
||||
DispEditorToolInfo(%this);
|
||||
return;
|
||||
}
|
||||
else { //Secondary
|
||||
if (!(getSimTime() > (%this.grenadeModeTime + 100)))
|
||||
return;
|
||||
%this.grenadeModeTime = getSimTime();
|
||||
%this.EditSMode++;
|
||||
//Check Primaries
|
||||
if(%this.EditPMode == 0 && %this.EditSMode > 20) {
|
||||
%this.EditSMode = 0;
|
||||
}
|
||||
else if(%this.EditPMode == 1 && %this.EditSMode > 20) {
|
||||
%this.EditSMode = 0;
|
||||
}
|
||||
else if(%this.EditPMode == 2 && %this.EditSMode > 4) {
|
||||
%this.EditSMode = 0;
|
||||
}
|
||||
else if(%this.EditPMode == 3 && %this.EditSMode > 3) {
|
||||
%this.EditSMode = 0;
|
||||
}
|
||||
else if(%this.EditPMode == 4 && %this.EditSMode > 1) {
|
||||
%this.EditSMode = 0;
|
||||
}
|
||||
DispEditorToolInfo(%this);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function EditorBolt::onCollision(%data,%projectile,%targetObject,%modifier,%position,%normal) {
|
||||
switch$(%projectile.sourceObject.EditPMode) {
|
||||
case 0:
|
||||
EToolswaping(%targetObject,%projectile.sourceObject,0,%projectile.sourceObject.EditSMode);
|
||||
case 1:
|
||||
EToolswaping(%targetObject,%projectile.sourceObject,1,%projectile.sourceObject.EditSMode);
|
||||
case 2:
|
||||
EToolTurrets(%targetObject,%projectile.sourceObject,%projectile.sourceObject.EditSMode);
|
||||
case 3:
|
||||
EToolCloakandFade(%targetObject,%projectile.sourceObject,%projectile.sourceObject.EditSMode);
|
||||
case 4:
|
||||
EToolDeleting(%targetObject,%projectile.sourceObject,%projectile.sourceObject.EditSMode);
|
||||
}
|
||||
}
|
||||
|
||||
//Editor Tool Functioning
|
||||
//
|
||||
//
|
||||
//
|
||||
function EToolDeleting(%tobj,%plyr,%Mode) {
|
||||
%cl=%plyr.client;
|
||||
if ( %tobj.ownerGUID != %cl.guid){
|
||||
if (!%cl.isadmin && !%cl.issuperadmin){
|
||||
if (%tobj.ownerGUID !$=""){
|
||||
messageclient(%cl, 'MsgClient', "\c2TextureTool: Error, You Do Not Own This Piece.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (%tobj.squaresize !$="") {
|
||||
messageclient(%cl, 'MsgClient', "\c2TextureTool: Error, Unknown Object Selected.");
|
||||
return;
|
||||
}
|
||||
if (!Deployables.isMember(%tobj)) {
|
||||
messageclient(%cl, 'MsgClient', "\c2TextureTool: Error, Map Object Selected.");
|
||||
return;
|
||||
}
|
||||
switch(%Mode) {
|
||||
case 0:
|
||||
messageclient(%cl, 'MsgClient', "\c2TextureTool: Deleting Object.");
|
||||
%tobj.getDataBlock().disassemble(%plyr, %tobj); //this found in constructionTool.cs
|
||||
case 1:
|
||||
messageclient(%cl, 'MsgClient', "\c2TextureTool: Cascade Deleting Object (All Conective Objects).");
|
||||
cascade(%tobj,true);
|
||||
}
|
||||
}
|
||||
//
|
||||
function EToolCloakandFade(%tobj,%plyr,%Mode) {
|
||||
%cl=%plyr.client;
|
||||
if ( %tobj.ownerGUID != %cl.guid){
|
||||
if (!%cl.isadmin && !%cl.issuperadmin){
|
||||
if (%tobj.ownerGUID !$=""){
|
||||
messageclient(%cl, 'MsgClient', "\c2TextureTool: Error, You Do Not Own This Piece.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (%tobj.squaresize !$="") {
|
||||
messageclient(%cl, 'MsgClient', "\c2TextureTool: Error, Unknown Object Selected.");
|
||||
return;
|
||||
}
|
||||
if (!Deployables.isMember(%tobj)) {
|
||||
messageclient(%cl, 'MsgClient', "\c2TextureTool: Error, Map Object Selected.");
|
||||
return;
|
||||
}
|
||||
switch(%Mode) {
|
||||
case 0:
|
||||
messageclient(%cl, 'MsgClient', "\c2TextureTool: Object Cloaked");
|
||||
%tobj.setCloaked(true);
|
||||
%tobj.cloaked = 1;
|
||||
case 1:
|
||||
messageclient(%cl, 'MsgClient', "\c2TextureTool: Object Un-Cloaked");
|
||||
%tobj.setCloaked(false);
|
||||
%tobj.cloaked = 0;
|
||||
case 2:
|
||||
messageclient(%cl, 'MsgClient', "\c2TextureTool: Object Faded");
|
||||
%tobj.startfade(1,0,1);
|
||||
case 3:
|
||||
messageclient(%cl, 'MsgClient', "\c2TextureTool: Object Un-Faded");
|
||||
%tobj.startfade(1,0,0);
|
||||
}
|
||||
}
|
||||
//
|
||||
function EToolTurrets(%tobj,%plyr,%Mode) {
|
||||
%cl=%plyr.client;
|
||||
if ( %tobj.ownerGUID != %cl.guid){
|
||||
if (!%cl.isadmin && !%cl.issuperadmin){
|
||||
if (%tobj.ownerGUID !$=""){
|
||||
messageclient(%cl, 'MsgClient', "\c2TextureTool: Error, You Do Not Own This Piece.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (%tobj.squaresize !$="") {
|
||||
messageclient(%cl, 'MsgClient', "\c2TextureTool: Error, Unknown Object Selected.");
|
||||
return;
|
||||
}
|
||||
%classname= %tobj.getDataBlock().getName();
|
||||
if(%classname $= "TurretBaseLarge" || %classname $= "TurretDeployedBase") {
|
||||
switch$(%mode) { //Thanks for help on this Krash..
|
||||
case 0:
|
||||
%tobj.mountImage("AABarrelLarge", 0);
|
||||
messageclient(%cl, 'MsgClient', '\c5TextureTool: Swapping Barrel with AA Barrel.');
|
||||
case 1:
|
||||
%tobj.mountImage("MissileBarrelLarge", 0);
|
||||
messageclient(%cl, 'MsgClient', '\c5TextureTool: Swapping Barrel with Missile Barrel.');
|
||||
case 2:
|
||||
%tobj.mountImage("PlasmaBarrelLarge", 0);
|
||||
messageclient(%cl, 'MsgClient', '\c5TextureTool: Swapping Barrel with Plasma Barrel.');
|
||||
case 3:
|
||||
%tobj.mountImage("ELFBarrelLarge", 0);
|
||||
messageclient(%cl, 'MsgClient', '\c5TextureTool: Swapping Barrel with ELF Barrel.');
|
||||
case 4:
|
||||
%tobj.mountImage("MortarBarrelLarge", 0);
|
||||
messageclient(%cl, 'MsgClient', '\c5TextureTool: Swapping Barrel with Mortar Barrel.');
|
||||
}
|
||||
}
|
||||
else {
|
||||
messageclient(%cl, 'MsgClient', "\c2TextureTool: Error, Object not a base turret.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function EToolswaping(%tobj,%plyr,%PMode,%SMode){
|
||||
//Could be cleaned up a bit later, but it works.
|
||||
%sender=%plyr.client;
|
||||
if ( %tobj.ownerGUID != %sender.guid){
|
||||
if (!%sender.isadmin && !%sender.issuperadmin){
|
||||
if (%tobj.ownerGUID !$=""){
|
||||
messageclient(%sender, 'MsgClient', '\c2You do not own this.');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (%tobj.squaresize !$="")
|
||||
return;
|
||||
%classname= %tobj.getDataBlock().classname;
|
||||
%objscale = %tobj.scale;
|
||||
%grounded = %tobj.grounded;
|
||||
%pwrfreq = %tobj.powerFreq;
|
||||
%Transform = %tobj.getTransform();
|
||||
|
||||
//////////////
|
||||
//forcefeild//
|
||||
//////////////
|
||||
if (%classname$="forcefield" && %pmode==1){
|
||||
%db="DeployedForceField"@%SMode;
|
||||
%deplObj = new ("ForceFieldBare")() {
|
||||
dataBlock = %db;
|
||||
scale = %objscale;
|
||||
};
|
||||
%deplObj.setTransform(%Transform);
|
||||
if (%tobj.noSlow == true){
|
||||
%deplObj.noSlow = true;
|
||||
%deplObj.pzone.delete();
|
||||
%deplObj.pzone = "";
|
||||
}
|
||||
if (%tobj.pzone !$= "")
|
||||
%tobj.pzone.delete();
|
||||
%tobj.delete();
|
||||
|
||||
// misc info
|
||||
addDSurface(%item.surface,%deplObj);
|
||||
|
||||
// [[Settings]]:
|
||||
|
||||
%deplObj.grounded = %grounded;
|
||||
%deplObj.needsFit = 1;
|
||||
|
||||
// [[Normal Stuff]]:
|
||||
|
||||
// set team, owner, and handle
|
||||
%deplObj.team = %plyr.client.team;
|
||||
%deplObj.setOwner(%plyr);
|
||||
|
||||
// set power frequency
|
||||
%deplObj.powerFreq = %pwrfreq;
|
||||
|
||||
// set the sensor group if it needs one
|
||||
if (%deplObj.getTarget() != -1)
|
||||
setTargetSensorGroup(%deplObj.getTarget(), %plyr.client.team);
|
||||
|
||||
// place the deployable in the MissionCleanup/Deployables group (AI reasons)
|
||||
addToDeployGroup(%deplObj);
|
||||
|
||||
//let the AI know as well...
|
||||
AIDeployObject(%plyr.client, %deplObj);
|
||||
|
||||
// increment the team count for this deployed object
|
||||
$TeamDeployedCount[%plyr.team, %item.item]++;
|
||||
|
||||
// Power object
|
||||
checkPowerObject(%deplObj);
|
||||
|
||||
return %deplObj;
|
||||
}
|
||||
///////////%objscale = %tobj.scale;
|
||||
//pads //%oldpos = %tobj.position;
|
||||
///////////%oldrot = %tobj.rotation;
|
||||
else if (%pmode==0 && ((%classname $= "decoration" && %tobj.getDataBlock().getname() $="DeployedDecoration6") || %classname $= "crate" || %classname $= "floor" || %classname $= "spine" || %classname $= "mspine" || %classname $= "wall" || %classname $= "wwall" || %classname $= "Wspine" || %classname $= "Sspine" || %classname $= "floor" || %classname $= "door"))
|
||||
{
|
||||
%tobj.setCloaked(true);
|
||||
%tobj.schedule(290, "setCloaked", false);
|
||||
if (%tobj.isdoor == 1 || %tobj.getdatablock().getname() $="DeployedTdoor"){
|
||||
if (%tobj.canmove == false) //if it cant move
|
||||
return;
|
||||
if (%tobj.state !$="closed" && %tobj.state !$="")
|
||||
return;
|
||||
}
|
||||
if (%tobj.isobjective > 0)
|
||||
return;
|
||||
|
||||
%db = getword($EditTool::PadModes[%SMode],0);
|
||||
if (%tobj.getdatablock().getname() $="DeployedFloor")
|
||||
%datablock="DeployedwWall";
|
||||
else if (%tobj.getdatablock().getname() $="DeployedMSpinering")
|
||||
%datablock="DeployedMSpine";
|
||||
else if (%tobj.getdatablock().getname() $="DeployedTdoor"){
|
||||
%datablock="DeployedMSpine";
|
||||
}
|
||||
else
|
||||
%datablock=%tobj.getdatablock().getname();
|
||||
|
||||
|
||||
%team = %tobj.team;
|
||||
%owner = %tobj.owner;
|
||||
if (%tobj.ownerGUID>0)
|
||||
%ownerGUID = %tobj.ownerGUID;
|
||||
else
|
||||
%ownerGUID = "";
|
||||
|
||||
if (%tobj.isdoor == 1 || %tobj.getdatablock().getname() $="DeployedTdoor"){
|
||||
%issliding = %tobj.issliding;
|
||||
%state = %tobj.state;
|
||||
%canmove = %tobj.canmove;
|
||||
%closedscale = %tobj.closedscale;
|
||||
%openedscale = %tobj.openedscale;
|
||||
%oldscale = %tobj.oldscale;
|
||||
%moving = %tobj.moving;
|
||||
%toggletype = %tobj.toggletype;
|
||||
%powercontrol = %tobj.powercontrol;
|
||||
%Collision = %tobj.Collision;
|
||||
%lv = %tobj.lv;
|
||||
}
|
||||
|
||||
%scale = %tobj.GetRealSize();
|
||||
|
||||
%deplObj = new ("StaticShape")() {
|
||||
dataBlock = %db;
|
||||
};
|
||||
%deplObj.SetRealSize(%scale);
|
||||
%deplObj.setTransform(%Transform);
|
||||
//////////////////////////Apply settings//////////////////////////////
|
||||
|
||||
// misc info
|
||||
addDSurface(%item.surface,%deplObj);
|
||||
|
||||
// [[Settings]]:
|
||||
|
||||
%deplObj.grounded = %grounded;
|
||||
%deplObj.needsFit = 1;
|
||||
|
||||
// set team, owner, and handle
|
||||
%deplObj.team = %team;
|
||||
%deplObj.Ownerguid=%ownerGUID;
|
||||
%deplObj.Owner=%owner;
|
||||
|
||||
// set power frequency
|
||||
%deplObj.powerFreq = %pwrfreq;
|
||||
%deplObj.OriginalPos = %tobj.OriginalPos;
|
||||
// set the sensor group if it needs one
|
||||
if (%deplObj.getTarget() != -1)
|
||||
setTargetSensorGroup(%deplObj.getTarget(), %plyr.client.team);
|
||||
|
||||
// place the deployable in the MissionCleanup/Deployables group (AI reasons)
|
||||
addToDeployGroup(%deplObj);
|
||||
|
||||
//let the AI know as well...
|
||||
AIDeployObject(%plyr.client, %deplObj);
|
||||
|
||||
// increment the team count for this deployed object
|
||||
$TeamDeployedCount[%plyr.team, %item.item]++;
|
||||
|
||||
%deplObj.deploy();
|
||||
|
||||
// Power object
|
||||
checkPowerObject(%deplObj);
|
||||
|
||||
if (%tobj.isdoor == 1 || %tobj.getdatablock().getname() $="DeployedTdoor"){
|
||||
%deplObj.closedscale = %deplObj.getScale();
|
||||
%deplObj.openedscale = getwords(%deplObj.getScale(),0,1) SPC 0.1;
|
||||
%deplObj.isdoor = 1;
|
||||
%deplObj.state = %state ;
|
||||
%deplObj.canmove = %canmove ;
|
||||
%deplObj.moving = %moving ;
|
||||
%deplObj.toggletype = %toggletype ;
|
||||
%deplObj.powercontrol = %powercontrol;
|
||||
%deplObj.Collision = %Collision ;
|
||||
%deplObj.lv = %lv ;
|
||||
}
|
||||
%tobj.delete();
|
||||
return %deplObj;
|
||||
}
|
||||
}
|
||||
1104
scripts/weapons/Construction/constructionTool.cs
Normal file
1104
scripts/weapons/Construction/constructionTool.cs
Normal file
File diff suppressed because it is too large
Load diff
953
scripts/weapons/Construction/modifiertool.cs
Normal file
953
scripts/weapons/Construction/modifiertool.cs
Normal file
|
|
@ -0,0 +1,953 @@
|
|||
// Merge Tool v006
|
||||
// Coded by Electricutioner
|
||||
// Last modified: 6:22 PM 5/21/2006
|
||||
// Idea by the T2 Construction Community
|
||||
|
||||
// * * Public Source Release * *
|
||||
// Terms of Use:
|
||||
// 1) You must agree to all terms of use before inclusion of this tool as aggregation or linked component
|
||||
// in any software component.
|
||||
// 2) You acknowledge the author of this tool is Electricutioner.
|
||||
// 3) You will not remove the author's name (Electricutioner) from any location in the source.
|
||||
// 4) You will not deactivate or remove the bottom-print notification with the author's name (Electricutioner).
|
||||
// 5) All derivative works from this tool must be open source and the source for functioning versions
|
||||
// of the derivative works must be available on request.
|
||||
// 6) The author (Electricutioner) must be credited in the software/mod credits for contribution
|
||||
// of the MIST.
|
||||
// 7) You will make no attempt to reverse engineer the two proprietary functions (PointToEdge and MTCarbonCopier)
|
||||
// nor attempt to reverse engineer the loader used to initialize those functions.
|
||||
// 8) You will not make use of the two proprietary functions (PointToEdge and MTCarbonCopier) anywhere
|
||||
// beyond their current use in the split subroutines.
|
||||
|
||||
// Installation notes are on the bottom of the file.
|
||||
|
||||
//Description:
|
||||
//The merge tool is a weapon. You shoot it at two pieces you wish to merge, and if the two pieces
|
||||
//are sufficiently compatable, their size will be analyzed, the first selected piece will be resized
|
||||
//and repositioned to take up the volume of both, and then the second selected piece will be deconstructed.
|
||||
|
||||
//Isometric rotate is a mode. You shoot at a piece and it will rotate the piece 90 degrees on an axis.
|
||||
//It will then resize and reposition the piece. The result is a piece taking up the exact same space, but
|
||||
//with the "stretched" effect.
|
||||
|
||||
//Split is yet another mode. You shoot this at a piece, and it will cut the piece in half/on crosshair.
|
||||
//It is not the exact "undo" of the merge operation, but it might allow correction of some mistakes, or
|
||||
//quick fortification of structures. The piece that is split is duplicated identically, with all
|
||||
//attributes maintained. Note: this uses a temporary file that can be safely deleted later.
|
||||
|
||||
//Variables:
|
||||
$ElecMod::MergeTool::Tolerance = 0.05; //how many meters of tolerance do we give the pieces that we merge.
|
||||
$ElecMod::MergeTool::HighTolerance = 0.25; //used for "high tolerance" mode on stubborn pieces
|
||||
$ElecMod::MergeTool::Timeout = 2; //how many seconds until a selection times out when using the tool
|
||||
|
||||
//split portion
|
||||
$ElecMod::MergeTool::MinimumPieceVolume = 0.125; //50 cm cube is smallest, consider revising this to 16
|
||||
|
||||
//Functions:
|
||||
|
||||
//this function rotates and rescales pieces to create the stretch effect
|
||||
function MTIsometric(%client, %piece)
|
||||
{
|
||||
if (!isObject(%piece))
|
||||
return;
|
||||
|
||||
if (!%client.isAdmin)
|
||||
{
|
||||
if (%client.guid != %piece.ownerguid)
|
||||
{
|
||||
messageClient(%client, 'MsgClient', "\c2MIST: That piece isn't yours.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!%piece.isForcefield())
|
||||
{
|
||||
%piece.setCloaked(true);
|
||||
%piece.schedule(290, "setCloaked", false);
|
||||
}
|
||||
|
||||
%center = %piece.getEdge("0 0 0");
|
||||
%currentSize = %piece.getRealSize();
|
||||
|
||||
//this used to be one operation, but it ceased to work properly (?)
|
||||
%piece.setTransform(remoteRotate(%piece,"0 1 0 1.570796", %piece,"0 0 0"));
|
||||
%piece.setRealSize(getWord(%currentSize, 2) SPC getWord(%currentSize, 1) SPC getWord(%currentSize, 0));
|
||||
%piece.setEdge(%center, "0 0 0");
|
||||
%currentSize = %piece.getRealSize();
|
||||
|
||||
%piece.setTransform(remoteRotate(%piece,"0 0 1 1.570796", %piece,"0 0 0"));
|
||||
%piece.setRealSize(getWord(%currentSize, 1) SPC getWord(%currentSize, 0) SPC getWord(%currentSize, 2));
|
||||
%piece.setEdge(%center, "0 0 0");
|
||||
|
||||
}
|
||||
|
||||
//thnx krash
|
||||
function MTIsometricZ(%client, %piece) {
|
||||
if (!isObject(%piece))
|
||||
return;
|
||||
|
||||
if (!%client.isAdmin) {
|
||||
if (%client.guid != %piece.ownerguid) {
|
||||
messageClient(%client, 'MsgClient', "\c2MIST: That piece isn't yours.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!%piece.isForcefield()) {
|
||||
%piece.setCloaked(true);
|
||||
%piece.schedule(290, "setCloaked", false);
|
||||
}
|
||||
|
||||
%center = %piece.getEdge("0 0 0");
|
||||
%piece.setTransform(remoteRotate(%piece,"1 0 0 3.141593", %piece,"0 0 0"));
|
||||
%piece.setEdge(%center, "0 0 0");
|
||||
}
|
||||
|
||||
//This is the basic initiator function. If the piece called are compatable, nothing further needs to be called.
|
||||
function MTMerge(%client, %piece1, %piece2, %hiTol)
|
||||
{
|
||||
if (!MTCheckCompatability(%client, %piece1, %piece2, %hiTol))
|
||||
{
|
||||
%piece1.setCloaked(false);
|
||||
%piece2.setCloaked(false);
|
||||
MTClearClientSelection();
|
||||
return;
|
||||
}
|
||||
if (!%piece1.isForcefield())
|
||||
%piece1.setCloaked(true);
|
||||
if (!%piece2.isForcefield())
|
||||
%piece2.setCloaked(true);
|
||||
schedule(100, 0, "MTScaleShiftMerge", %piece1, %piece2);
|
||||
|
||||
if (isEventPending(%client.mergeschedule))
|
||||
{
|
||||
cancel(%client.mergeschedule);
|
||||
MTClearClientSelection();
|
||||
}
|
||||
}
|
||||
|
||||
//This function checks if 4 corners of the objects are compatable. If an error is encountered it returns a 0 and
|
||||
//terminates the merge. Otherwise, it returns a 1, and continues the merge process.
|
||||
function MTCheckCompatability(%client, %piece1, %piece2, %hiTol)
|
||||
{
|
||||
//do the pieces exist?
|
||||
if (!isObject(%piece1) || !isObject(%piece2))
|
||||
{
|
||||
messageClient(%client, 'MsgClient', "\c2MIST: A piece appears to be missing.");
|
||||
return;
|
||||
}
|
||||
//check if the owners are the same
|
||||
if (%piece1.owner != %client || %piece2.owner != %client)
|
||||
{
|
||||
//with an exemption of admins
|
||||
if (!%client.isAdmin)
|
||||
{
|
||||
//fix for when players leave the server and come back
|
||||
if (%piece1.ownerGUID != %client.guid || %piece2.ownerGUID != %client.guid)
|
||||
{
|
||||
messageClient(%client, 'MsgClient', "\c2MIST: One or more of those pieces do not belong to you.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//now we need to determine if at least 4 of the pieces axies match
|
||||
//get all the 8 points of both pieces
|
||||
%pos1[0] = %piece1.getEdge("1 1 -1");
|
||||
%pos1[1] = %piece1.getEdge("-1 1 -1");
|
||||
%pos1[2] = %piece1.getEdge("1 -1 -1");
|
||||
%pos1[3] = %piece1.getEdge("-1 -1 -1");
|
||||
%pos1[4] = %piece1.getEdge("1 1 1");
|
||||
%pos1[5] = %piece1.getEdge("-1 1 1");
|
||||
%pos1[6] = %piece1.getEdge("1 -1 1");
|
||||
%pos1[7] = %piece1.getEdge("-1 -1 1");
|
||||
|
||||
%pos2[0] = %piece2.getEdge("1 1 -1");
|
||||
%pos2[1] = %piece2.getEdge("-1 1 -1");
|
||||
%pos2[2] = %piece2.getEdge("1 -1 -1");
|
||||
%pos2[3] = %piece2.getEdge("-1 -1 -1");
|
||||
%pos2[4] = %piece2.getEdge("1 1 1");
|
||||
%pos2[5] = %piece2.getEdge("-1 1 1");
|
||||
%pos2[6] = %piece2.getEdge("1 -1 1");
|
||||
%pos2[7] = %piece2.getEdge("-1 -1 1");
|
||||
//then we compare them to see which ones match
|
||||
%k = 0;
|
||||
for (%i = 0; %i < 8; %i++)
|
||||
{
|
||||
for (%j = 0; %j < 8; %j++)
|
||||
{
|
||||
if (!%hiTol && $ElecMod::MergeTool::Tolerance >= vectorDist(%pos1[%i], %pos2[%j]))
|
||||
{
|
||||
%k++;
|
||||
}
|
||||
else if (%hiTol && $ElecMod::MergeTool::HighTolerance >= vectorDist(%pos1[%i], %pos2[%j]))
|
||||
{
|
||||
%k++;
|
||||
}
|
||||
}
|
||||
}
|
||||
//if less then 4 match, they can't be compatable (if more then 4 match... something odd is going on)
|
||||
if (%k < 4)
|
||||
{
|
||||
if (%k == 0)
|
||||
messageClient(%client, 'MsgClient', "\c2MIST: None of the corners are shared on those objects. Cannot merge.");
|
||||
else
|
||||
messageClient(%client, 'MsgClient', "\c2MIST: Only " @ %k @ " corners of the required 4 are shared. Cannot merge.");
|
||||
|
||||
return;
|
||||
}
|
||||
else if (%k > 4)
|
||||
{
|
||||
messageClient(%client, 'MsgClient', "\c2MIST: Warning: Detected match of over 4 corners (" @ %k @ "). Merging may fail to produce desired results.");
|
||||
}
|
||||
//if the check survived that, we continue...
|
||||
return 1;
|
||||
}
|
||||
|
||||
//this function, after the pieces are confirmed, checks to see which of the 6 sides is in contact, refers to another
|
||||
//function to find the alter side, determines distance between them to find a new "real" scale, and determines the
|
||||
//new world box center for the object. Piece 1 is resized and moved, piece 2 is deconstructed.
|
||||
function MTScaleShiftMerge(%piece1, %piece2)
|
||||
{
|
||||
//find which axis is touching for a "this is the side we scale" discovery
|
||||
//table:
|
||||
//0: X
|
||||
//1: -X
|
||||
//2: Y
|
||||
//3: -Y
|
||||
//4: Z
|
||||
//5: -Z
|
||||
|
||||
%p1S[0] = %piece1.getEdge("1 0 0");
|
||||
%p1S[1] = %piece1.getEdge("-1 0 0");
|
||||
%p1S[2] = %piece1.getEdge("0 1 0");
|
||||
%p1S[3] = %piece1.getEdge("0 -1 0");
|
||||
%p1S[4] = %piece1.getEdge("0 0 1");
|
||||
%p1S[5] = %piece1.getEdge("0 0 -1");
|
||||
|
||||
%p2S[0] = %piece2.getEdge("1 0 0");
|
||||
%p2S[1] = %piece2.getEdge("-1 0 0");
|
||||
%p2S[2] = %piece2.getEdge("0 1 0");
|
||||
%p2S[3] = %piece2.getEdge("0 -1 0");
|
||||
%p2S[4] = %piece2.getEdge("0 0 1");
|
||||
%p2S[5] = %piece2.getEdge("0 0 -1");
|
||||
|
||||
for (%i = 0; %i < 6; %i++)
|
||||
{
|
||||
for (%j = 0; %j < 8; %j++)
|
||||
{
|
||||
if ($ElecMod::MergeTool::Tolerance >= vectorDist(%p1S[%i], %p2S[%j]))
|
||||
{
|
||||
%side1 = %i;
|
||||
%side2 = %j;
|
||||
}
|
||||
}
|
||||
}
|
||||
//echo("Sides:" SPC %i SPC %j);
|
||||
//at this point %side1/2 will contain one of the numbers in the table above
|
||||
//we get the non-shared side at this point
|
||||
%ops1 = MTFindOpSide(%side1);
|
||||
%ops2 = MTFindOpSide(%side2);
|
||||
|
||||
//this variable contains the new axis length that we are scaling on...
|
||||
%newaxis = VectorDist(%p1S[%ops1], %p2S[%ops2]);
|
||||
%currsize = %piece1.getRealSize();
|
||||
|
||||
if (%side1 == 0 || %side1 == 1)
|
||||
%axis = "x";
|
||||
if (%side1 == 2 || %side1 == 3)
|
||||
%axis = "y";
|
||||
if (%side1 == 4 || %side1 == 5)
|
||||
%axis = "z";
|
||||
|
||||
//echo("Axis:" SPC %axis);
|
||||
if (%axis $= "x")
|
||||
{
|
||||
%piece1.setRealSize(%newaxis SPC getWords(%currsize, 1, 2));
|
||||
if (isObject(%piece1.pzone))
|
||||
%piece1.pzone.setScale(%newaxis SPC getWords(%currsize, 1, 2));
|
||||
}
|
||||
if (%axis $= "y")
|
||||
{
|
||||
%piece1.setRealSize(getWord(%currsize, 0) SPC %newaxis SPC getWord(%currsize, 2));
|
||||
if (isObject(%piece1.pzone))
|
||||
%piece1.pzone.setScale(getWord(%currsize, 0) SPC %newaxis SPC getWord(%currsize, 2));
|
||||
}
|
||||
if (%axis $= "z")
|
||||
{
|
||||
%piece1.setRealSize(getWords(%currsize, 0, 1) SPC %newaxis);
|
||||
if (isObject(%piece1.pzone))
|
||||
%piece1.pzone.setScale(getWords(%currsize, 0, 1) SPC %newaxis);
|
||||
}
|
||||
if (%axis !$= "x" && %axis !$= "y" && %axis !$= "z")
|
||||
{
|
||||
error("MT: A scaling error has occured.");
|
||||
return;
|
||||
}
|
||||
%newpos = VectorScale(VectorAdd(%p1S[%ops1], %p2S[%ops2]), 0.5);
|
||||
%piece1.SetWorldBoxCenter(%newpos);
|
||||
|
||||
if (isObject(%piece1.pzone))
|
||||
%piece1.pzone.setPosition(%piece1.getPosition());
|
||||
|
||||
if (!%piece1.isForcefield())
|
||||
%piece1.setCloaked(false);
|
||||
if (!%piece2.isForcefield())
|
||||
%piece2.setCloaked(false);
|
||||
|
||||
//%piece2.delete(); //deleting is bad
|
||||
//%piece2.getDataBlock().disassemble(0, %piece2.owner, %piece2); //disassemble is cleaner
|
||||
//fixed disassemble to use object specific disassemble functions
|
||||
//disassemble(0, %piece2.owner, %piece2);
|
||||
%piece2.getDatablock().disassemble(0, %piece2);
|
||||
}
|
||||
|
||||
//this function does something very simple, it finds whether a number is even or odd, and then adds or subracts
|
||||
//and returns the initial input with that modification. I can't imagine where else this could be useful.
|
||||
function MTFindOpSide(%side)
|
||||
{
|
||||
%evencheck = %side / 2;
|
||||
if (%evencheck == mFloor(%evencheck))
|
||||
%even = 1;
|
||||
else
|
||||
%even = 0;
|
||||
|
||||
if (%even)
|
||||
return (%side + 1);
|
||||
else
|
||||
return (%side - 1);
|
||||
}
|
||||
|
||||
//simply clears a client variable... woohoo...
|
||||
function MTClearClientSelection(%client)
|
||||
{
|
||||
%client.mergePiece1 = "";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//"weapon" datablocks and such
|
||||
datablock ItemData(MergeTool)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
image = MergeToolImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a MIST, by Electricutioner.";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(MergeToolImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
item = MergeTool;
|
||||
|
||||
RankReqName = "NoRequire"; //Called By TWMFuncitons.cs & Weapons.cs
|
||||
|
||||
usesEnergy = true;
|
||||
minEnergy = 0;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateSound[0] = SniperRifleSwitchSound;
|
||||
stateTimeoutValue[0] = 0.1;
|
||||
stateSequence[0] = "Activate";
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.2; //reload timeout here
|
||||
stateFire[3] = true;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateScript[3] = "onFire";
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 0.1;
|
||||
stateAllowImageChange[4] = false;
|
||||
|
||||
stateName[5] = "CheckWet";
|
||||
stateTransitionOnWet[5] = "Fire";
|
||||
stateTransitionOnNotWet[5] = "Fire";
|
||||
|
||||
stateName[6] = "NoAmmo";
|
||||
stateTransitionOnAmmo[6] = "Reload";
|
||||
stateTransitionOnTriggerDown[6] = "DryFire";
|
||||
stateSequence[6] = "NoAmmo";
|
||||
|
||||
stateName[7] = "DryFire";
|
||||
stateSound[7] = SniperRifleDryFireSound;
|
||||
stateTimeoutValue[7] = 0.1;
|
||||
stateTransitionOnTimeout[7] = "Ready";
|
||||
};
|
||||
|
||||
function MergeToolImage::onFire(%data,%obj,%slot)
|
||||
{
|
||||
serverPlay3D(SniperRifleFireSound, %obj.getTransform());
|
||||
%client = %obj.client;
|
||||
|
||||
%pos = getWords(%obj.getEyeTransform(), 0, 2);
|
||||
%vec = %obj.getEyeVector();
|
||||
%targetpos = VectorAdd(%pos, VectorScale(%vec, 2000));
|
||||
%piece = containerRaycast(%pos, %targetpos, $TypeMasks::StaticShapeObjectType | $TypeMasks::ForceFieldObjectType, %obj);
|
||||
%cast = %piece;
|
||||
%piece = getWord(%piece, 0);
|
||||
|
||||
if (!isObject(%piece))
|
||||
return;
|
||||
|
||||
if (!Deployables.isMember(%piece))
|
||||
{
|
||||
messageClient(%client, 'MsgClient', "\c2MIST: That piece is part of the map and cannot be manipulated.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!%client.isAdmin)
|
||||
{
|
||||
if (%piece.ownerGUID != %client.guid)
|
||||
{
|
||||
messageClient(%client, 'MsgClient', "\c2MIST: That piece isn't yours.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (%client.MTMode == 0)
|
||||
{
|
||||
if (!isObject(%client.mergePiece1))
|
||||
{
|
||||
%client.mergePiece1 = %piece;
|
||||
|
||||
if (!%piece.isForcefield())
|
||||
{
|
||||
%piece.setCloaked(true);
|
||||
%piece.schedule(290, "setCloaked", false);
|
||||
}
|
||||
|
||||
%client.mergeschedule = schedule($ElecMod::MergeTool::Timeout * 1000, 0, "MTClearClientSelection", %client);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (%piece != %client.mergePiece1)
|
||||
{
|
||||
if (%client.MTSubMode == 1)
|
||||
{
|
||||
MTMerge(%client, %client.mergePiece1, %piece, 1);
|
||||
%client.MTSubMode = 0;
|
||||
MTShowStatus(%client);
|
||||
}
|
||||
else
|
||||
{
|
||||
MTMerge(%client, %client.mergePiece1, %piece, 0);
|
||||
}
|
||||
MTClearClientSelection(%client);
|
||||
}
|
||||
else
|
||||
{
|
||||
messageClient(%client, 'MsgClient', "\c2MIST: You cannot merge a piece with itself.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (%client.MTMode == 1)
|
||||
{
|
||||
if (%client.MTSubMode == 1)
|
||||
MTIsometricZ(%client, %piece);
|
||||
else
|
||||
MTIsometric(%client, %piece);
|
||||
}
|
||||
if (%client.MTMode == 2)
|
||||
{
|
||||
if (%client.MTSubMode > 4 || %client.MTSubMode == 1)
|
||||
{
|
||||
%client.MTSplitMode = 1; //crosshair split
|
||||
}
|
||||
else
|
||||
{
|
||||
%client.MTSplitMode = 0; //half split
|
||||
}
|
||||
if (%client.MTSubMode == 0)
|
||||
%axis = "a";
|
||||
if (%client.MTSubMode == 1)
|
||||
%axis = "a";
|
||||
if (%client.MTSubMode == 2)
|
||||
%axis = "x";
|
||||
if (%client.MTSubMode == 3)
|
||||
%axis = "y";
|
||||
if (%client.MTSubMode == 4)
|
||||
%axis = "z";
|
||||
if (%client.MTSubMode == 5)
|
||||
%axis = "x";
|
||||
if (%client.MTSubMode == 6)
|
||||
%axis = "y";
|
||||
if (%client.MTSubMode == 7)
|
||||
%axis = "z";
|
||||
|
||||
MTSplit(%client, %cast, %axis);
|
||||
}
|
||||
if (%client.MTMode == 3) {
|
||||
if(%client.MTSubMode == 0) {
|
||||
%axis = "+x";
|
||||
}
|
||||
if(%client.MTSubMode == 1) {
|
||||
%axis = "-x";
|
||||
}
|
||||
if(%client.MTSubMode == 2) {
|
||||
%axis = "+y";
|
||||
}
|
||||
if(%client.MTSubMode == 3) {
|
||||
%axis = "-y";
|
||||
}
|
||||
if(%client.MTSubMode == 4) {
|
||||
%axis = "+z";
|
||||
}
|
||||
if(%client.MTSubMode == 5) {
|
||||
%axis = "-z";
|
||||
}
|
||||
MTMovePieces(%client, %cast, %axis);
|
||||
}
|
||||
if (%client.MTMode == 4) {
|
||||
if(%client.MTSubMode == 0) {
|
||||
%scale = 0.01;
|
||||
}
|
||||
if(%client.MTSubMode == 1) {
|
||||
%scale = -0.01;
|
||||
}
|
||||
if(%client.MTSubMode == 2) {
|
||||
%scale = 0.1;
|
||||
}
|
||||
if(%client.MTSubMode == 3) {
|
||||
%scale = -0.1;
|
||||
}
|
||||
if(%client.MTSubMode == 4) {
|
||||
%scale = 1;
|
||||
}
|
||||
if(%client.MTSubMode == 5) {
|
||||
%scale = -1;
|
||||
}
|
||||
MTFullScalePiece(%client, %cast, %scale);
|
||||
}
|
||||
}
|
||||
|
||||
function MergeToolImage::onMount(%this,%obj,%slot)
|
||||
{
|
||||
%obj.usingMTelec = 1;
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
%obj.mountImage(MergeToolImage, 0);
|
||||
MTShowStatus(%obj.client);
|
||||
}
|
||||
|
||||
function MergeToolImage::onUnmount(%this,%obj,%slot)
|
||||
{
|
||||
Parent::onUnmount(%this, %obj, %slot);
|
||||
%obj.usingMTelec = 0;
|
||||
}
|
||||
|
||||
function MTShowStatus(%client)
|
||||
{
|
||||
if (%client.MTMode $= "")
|
||||
%client.MTMode = 0;
|
||||
if (%client.MTSubMode $= "")
|
||||
%client.MTSubMode = 0;
|
||||
|
||||
switch (%client.MTMode)
|
||||
{
|
||||
case 0:
|
||||
switch (%client.MTSubMode)
|
||||
{
|
||||
case 0:
|
||||
%status = "<font:Arial:14>Mode: Merge. Fire the tool at two pieces. If possible, they will merge. Tolerance: " @ $ElecMod::MergeTool::Tolerance @ " meters.";
|
||||
case 1:
|
||||
%status = "<font:Arial:14>Mode: Merge. Fire the tool at two pieces. If possible, they will merge. Tolerance: " @ $ElecMod::MergeTool::HighTolerance @ " meters.";
|
||||
}
|
||||
case 1:
|
||||
switch (%client.MTSubMode)
|
||||
{
|
||||
case 0:
|
||||
%status = "<font:Arial:14>Mode: Isometric. Fire the tool at a piece to isometrically rotate them. Rotate: Default.";
|
||||
case 1:
|
||||
%status = "<font:Arial:14>Mode: Isometric. Fire the tool at a piece to isometrically rotate them. Rotate: Z Axis.";
|
||||
}
|
||||
case 2:
|
||||
switch (%client.MTSubMode)
|
||||
{
|
||||
case 0:
|
||||
%status = "<font:Arial:14>Mode: Split. Fire at a piece to split it in half. Axis: Automatic.";
|
||||
case 1:
|
||||
%status = "<font:Arial:14>Mode: Split. Fire at a piece to split it on crosshair. Axis: Automatic.";
|
||||
case 2:
|
||||
%status = "<font:Arial:14>Mode: Split. Fire at a piece to split it in half. Axis: X.";
|
||||
case 3:
|
||||
%status = "<font:Arial:14>Mode: Split. Fire at a piece to split it in half. Axis: Y.";
|
||||
case 4:
|
||||
%status = "<font:Arial:14>Mode: Split. Fire at a piece to split it in half. Axis: Z.";
|
||||
case 5:
|
||||
%status = "<font:Arial:14>Mode: Split. Fire at a piece to split it on crosshair. Axis: X.";
|
||||
case 6:
|
||||
%status = "<font:Arial:14>Mode: Split. Fire at a piece to split it on crosshair. Axis: Y.";
|
||||
case 7:
|
||||
%status = "<font:Arial:14>Mode: Split. Fire at a piece to split it on crosshair. Axis: Z.";
|
||||
}
|
||||
case 3:
|
||||
if(%client.MoveSetting $= "") {
|
||||
%client.MoveSetting = 0.1;
|
||||
}
|
||||
switch (%client.MTSubMode) {
|
||||
case 0:
|
||||
%status = "<font:Arial:14>Mode: Nudge. Fire at a piece to move it. Nudge "@%client.MoveSetting@"M +X Axis.";
|
||||
case 1:
|
||||
%status = "<font:Arial:14>Mode: Nudge. Fire at a piece to move it. Nudge "@%client.MoveSetting@"M -X Axis.";
|
||||
case 2:
|
||||
%status = "<font:Arial:14>Mode: Nudge. Fire at a piece to move it. Nudge "@%client.MoveSetting@"M +Y Axis.";
|
||||
case 3:
|
||||
%status = "<font:Arial:14>Mode: Nudge. Fire at a piece to move it. Nudge "@%client.MoveSetting@"M -Y Axis.";
|
||||
case 4:
|
||||
%status = "<font:Arial:14>Mode: Nudge. Fire at a piece to move it. Nudge "@%client.MoveSetting@"M +Z Axis.";
|
||||
case 5:
|
||||
%status = "<font:Arial:14>Mode: Nudge. Fire at a piece to move it. Nudge "@%client.MoveSetting@"M -Z Axis.";
|
||||
}
|
||||
case 4:
|
||||
switch (%client.MTSubMode) {
|
||||
case 0:
|
||||
%status = "<font:Arial:14>Mode: Full Scale. Fire at a piece to scale it. Grow .01M.";
|
||||
case 1:
|
||||
%status = "<font:Arial:14>Mode: Full Scale. Fire at a piece to scale it. Shrink .01M.";
|
||||
}
|
||||
}
|
||||
CommandToClient(%client, 'BottomPrint', "<font:Sui Generis:14>>>>M/I/S Tool<<<\n<font:Arial:14>" @ %status @ "\nCoded by Electricutioner.", 3, 3 );
|
||||
}
|
||||
|
||||
//Split code begins here.
|
||||
//The goal of this is to be a semi-inverse of the merge...
|
||||
//The tool will be set to split mode, and aimed at an object. The object axies are checked, and if there is one that is
|
||||
//disproportionally larger then the rest, it will be split on that axis. If two or more axies are similar, it does
|
||||
//a check to determine the face where the raycast hits (reducing split possibilities by one axis) and either
|
||||
//spliting on the remaining axis or using position points to find out in which quadrant of the face, the raycast hit.
|
||||
//Once the axis is determined, the split axis has the difference halved, a "dominant" piece rescaled and repositioned
|
||||
//in steps similar to the merge, and a new (nearly-identical) piece is created in the resulting void.
|
||||
|
||||
//startup function, the calling client, and the raycasted piece. Note: %piece contains all raycast operations.
|
||||
function MTSplit(%client, %piece, %axis)
|
||||
{
|
||||
if(!MTSplitValidate(%client, %piece, %axis)) //validates the client selected piece as valid
|
||||
return;
|
||||
|
||||
if (!%piece.isForcefield())
|
||||
getWord(%piece, 0).setCloaked(true);
|
||||
|
||||
MTSplitScaleShift(%client, %piece, %axis); //split it up
|
||||
}
|
||||
|
||||
//
|
||||
function MTFullScalePiece(%client, %piece, %scale) {
|
||||
if (!isObject(getWord(%piece, 0))) {
|
||||
messageClient(%client, 'MsgClient', "\c2MIST: The piece to scale is missing. You should not see this error.");
|
||||
return;
|
||||
}
|
||||
%cscale = %piece.getrealsize();
|
||||
%x = getWord(%cscale, 0);
|
||||
%y = getWord(%cscale, 1);
|
||||
%z = getWord(%cscale, 2);
|
||||
//scale check stuff...
|
||||
if((%x + %scale) <= 0.01) {
|
||||
%pass = 0;
|
||||
}
|
||||
else if((%y + %scale) <= 0.01) {
|
||||
%pass = 0;
|
||||
}
|
||||
else if((%z + %scale) <= 0.01) {
|
||||
%pass = 0;
|
||||
}
|
||||
else {
|
||||
%pass = 1;
|
||||
}
|
||||
//
|
||||
if(!%pass) {
|
||||
messageClient(%client, 'MsgClient', "\c2MIST: The piece cannot be scaled any smaller.");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
%newx = %x + %scale;
|
||||
%newy = %y + %scale;
|
||||
%newz = %z + %scale;
|
||||
%fullscale = %newx SPC %newy SPC %newz;
|
||||
|
||||
%className = %piece.getDatablock().className;
|
||||
if(%classname $= "spine" || %classname $= "mspine" || %classname $= "spine2" || %classname $= "wall" || %classname $= "wwall" || %classname $= "floor" || %classname $= "door") {
|
||||
%fullscale = VectorMultiply(%fullscale, "0.250 0.333333 2"); //thanks krash.
|
||||
}
|
||||
|
||||
%piece.setCloaked(true);
|
||||
%piece.schedule(150, "setCloaked", false);
|
||||
//
|
||||
%piece.SetRealSize(%fullscale);
|
||||
%piece.scale = %fullscale;
|
||||
%piece.settransform(%piece.gettransform());
|
||||
|
||||
PostOperationCheck(%piece);
|
||||
}
|
||||
}
|
||||
|
||||
//makes sure that the object can be split
|
||||
function MTSplitValidate(%client, %piece, %axis)
|
||||
{
|
||||
if (!isObject(getWord(%piece, 0)))
|
||||
{
|
||||
messageClient(%client, 'MsgClient', "\c2MIST: The piece to split is missing. You should not see this error.");
|
||||
return;
|
||||
}
|
||||
|
||||
//restricting to cubics and forcefields.
|
||||
if (!isCubic(%piece) && !%piece.isForceField())
|
||||
{
|
||||
messageClient(%client, 'MsgClient', "\c2MIST: That object is not cubic and it cannot be split.");
|
||||
return;
|
||||
}
|
||||
|
||||
%size = %piece.getRealSize();
|
||||
%volume = 2 * getWord(%size, 0) * 2 * getWord(%size, 1) * 2 * getWord(%size, 2);
|
||||
if (%client.MTSplitMode == 0) //half split
|
||||
{
|
||||
if ((%volume / 2) < ($ElecMod::MergeTool::MinimumPieceVolume))
|
||||
{
|
||||
messageClient(%client, 'MsgClient', "\c2MIST: That piece is too small to split.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
%hitPos = getWord(%piece, 1) SPC getWord(%piece, 2) SPC getWord(%piece, 3);
|
||||
%edge = PointToEdge(getWord(%piece, 0), %hitPos);
|
||||
|
||||
//auto-axis determiner
|
||||
if (%axis $= "a")
|
||||
%axis = CalculateSplitAxis(PointToEdge(%piece, %hitPos));
|
||||
|
||||
switch$ (%axis)
|
||||
{
|
||||
case "x":
|
||||
%ratio = getWord(%edge, 0);
|
||||
%ratio = (%ratio + 1) / 2;
|
||||
case "y":
|
||||
%ratio = getWord(%edge, 1);
|
||||
%ratio = (%ratio + 1) / 2;
|
||||
case "z":
|
||||
%ratio = getWord(%edge, 2);
|
||||
%ratio = (%ratio + 1) / 2;
|
||||
}
|
||||
|
||||
%masterSize = %volume * %ratio;
|
||||
%slaveSize = %volume * (1 - %ratio);
|
||||
|
||||
//echo(%ratio SPC %axis SPC %masterSize SPC %slaveSize);
|
||||
|
||||
if (%masterSize < $ElecMod::MergeTool::MinimumPieceVolume || %slaveSize < $ElecMod::MergeTool::MinimumPieceVolume)
|
||||
{
|
||||
messageClient(%client, 'MsgClient', "\c2MIST: A resultant piece from that split is too small. Aborting.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
return 1; //we survived, thus we continue
|
||||
}
|
||||
|
||||
//does the actual splitting
|
||||
function MTSplitScaleShift(%client, %cast, %axis)
|
||||
{
|
||||
%piece = getWord(%cast, 0);
|
||||
%copy = MTCarbonCopy(%piece); //Merge Tool Support functions
|
||||
|
||||
if (!%piece.isForcefield())
|
||||
{
|
||||
%piece.setCloaked(true);
|
||||
%copy.setCloaked(true);
|
||||
}
|
||||
|
||||
%hitPos = getWord(%cast, 1) SPC getWord(%cast, 2) SPC getWord(%cast, 3);
|
||||
|
||||
%size = %piece.getRealSize();
|
||||
|
||||
//auto axis determiner
|
||||
if (%axis $= "a")
|
||||
{
|
||||
%axis = CalculateSplitAxis(PointToEdge(%piece, %hitPos));
|
||||
//echo(%hitPos);
|
||||
}
|
||||
|
||||
if (%client.MTSplitMode == 0) //split in half
|
||||
{
|
||||
%center = %piece.getWorldBoxCenter();
|
||||
%sizeFactorMaster = 2;
|
||||
%sizeFactorSlave = 2;
|
||||
|
||||
switch$ (%axis)
|
||||
{
|
||||
case "x":
|
||||
%piece.setRealSize((getWord(%size, 0) / %sizeFactorMaster) SPC getWords(%size, 1, 2));
|
||||
%copy.setRealSize((getWord(%size, 0) / %sizeFactorSlave) SPC getWords(%size, 1, 2));
|
||||
%piece.setEdge(%center, "1 0 0");
|
||||
%copy.setEdge(%center, "-1 0 0");
|
||||
case "y":
|
||||
%piece.setRealSize(getWord(%size, 0) SPC getWord(%size, 1) / %sizeFactorMaster SPC getWord(%size, 2));
|
||||
%copy.setRealSize(getWord(%size, 0) SPC getWord(%size, 1) / %sizeFactorSlave SPC getWord(%size, 2));
|
||||
%piece.setEdge(%center, "0 1 0");
|
||||
%copy.setEdge(%center, "0 -1 0");
|
||||
case "z":
|
||||
%piece.setRealSize(getWords(%size, 0, 1) SPC getWord(%size, 2) / %sizeFactorMaster);
|
||||
%copy.setRealSize(getWords(%size, 0, 1) SPC getWord(%size, 2) / %sizeFactorSlave);
|
||||
%piece.setEdge(%center, "0 0 1");
|
||||
%copy.setEdge(%center, "0 0 -1");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
%edge = PointToEdge(%piece, %hitPos); //PointToEdge is in the Merge Tool support functions
|
||||
|
||||
switch$ (%axis)
|
||||
{
|
||||
case "x":
|
||||
%ratio = getWord(%edge, 0);
|
||||
%ratio = (%ratio + 1) / 2;
|
||||
%center = %piece.getEdge("-1 0 0");
|
||||
%piece.setRealSize(getWord(%size, 0) * %ratio SPC getWords(%size, 1, 2));
|
||||
%copy.setRealSize(getWord(%size, 0) * (1 - %ratio) SPC getWords(%size, 1, 2));
|
||||
%piece.setEdge(%center, "-1 0 0");
|
||||
%copy.setEdge(%piece.getEdge("1 0 0"), "-1 0 0");
|
||||
case "y":
|
||||
%ratio = getWord(%edge, 1);
|
||||
%ratio = (%ratio + 1) / 2;
|
||||
%center = %piece.getEdge("0 -1 0");
|
||||
%piece.setRealSize(getWord(%size, 0) SPC getWord(%size, 1) * %ratio SPC getWord(%size, 2));
|
||||
%copy.setRealSize(getWord(%size, 0) SPC getWord(%size, 1) * (1 - %ratio) SPC getWord(%size, 2));
|
||||
%piece.setEdge(%center, "0 -1 0");
|
||||
%copy.setEdge(%piece.getEdge("0 1 0"), "0 -1 0");
|
||||
case "z":
|
||||
%ratio = getWord(%edge, 2);
|
||||
%ratio = (%ratio + 1) / 2;
|
||||
%center = %piece.getEdge("0 0 -1");
|
||||
%piece.setRealSize(getWords(%size, 0, 1) SPC getWord(%size, 2) * %ratio);
|
||||
%copy.setRealSize(getWords(%size, 0, 1) SPC getWord(%size, 2) * (1 - %ratio));
|
||||
%piece.setEdge(%center, "0 0 -1");
|
||||
%copy.setEdge(%piece.getEdge("0 0 1"), "0 0 -1");
|
||||
}
|
||||
}
|
||||
|
||||
if (isObject(%piece.pzone))
|
||||
{
|
||||
%piece.pzone.setScale(%piece.getScale());
|
||||
%piece.pzone.setPosition(%piece.getPosition());
|
||||
}
|
||||
if (isObject(%copy.pzone))
|
||||
{
|
||||
%copy.pzone.setScale(%copy.getScale());
|
||||
%copy.pzone.setPosition(%copy.getPosition());
|
||||
}
|
||||
|
||||
if (!%piece.isForcefield())
|
||||
{
|
||||
%piece.schedule(290, "setCloaked", false);
|
||||
%copy.schedule(290, "setCloaked", false);
|
||||
}
|
||||
}
|
||||
|
||||
function CalculateSplitAxis(%edge)
|
||||
{
|
||||
//echo("Calculating split axis from edge: " @ %edge);
|
||||
%edge = mAbs(getWord(%edge, 0)) SPC mAbs(getWord(%edge, 1)) SPC mAbs(getWord(%edge, 2));
|
||||
if (getWord(%edge, 0) < getWord(%edge, 1) && getWord(%edge, 0) < getWord(%edge, 2))
|
||||
return "x";
|
||||
if (getWord(%edge, 1) < getWord(%edge, 0) && getWord(%edge, 1) < getWord(%edge, 2))
|
||||
return "y";
|
||||
if (getWord(%edge, 2) < getWord(%edge, 0) && getWord(%edge, 2) < getWord(%edge, 1))
|
||||
return "z";
|
||||
}
|
||||
|
||||
//Made By Phantom139 For TWM2
|
||||
function MTMovePieces(%client, %cast, %axis) {
|
||||
%piece = getWord(%cast, 0);
|
||||
|
||||
%piece.setCloaked(true);
|
||||
%piece.schedule(320, SetCloaked, false);
|
||||
|
||||
if(%client.MoveSetting $= "") {
|
||||
%client.MoveSetting = 0.1;
|
||||
MessageClient(%client, 'MsgMISTSET', "\c2MIST: Move Scale set to 0.1, Modify with /setNudge.");
|
||||
}
|
||||
|
||||
%current = %piece.getPosition();
|
||||
|
||||
switch$ (%axis) {
|
||||
case "+x":
|
||||
%np = VectorAdd(%current, ""@%client.MoveSetting@" 0 0");
|
||||
%piece.setPosition(%np);
|
||||
case "-x":
|
||||
%np = VectorAdd(%current, ""@%client.MoveSetting * -1@" 0 0");
|
||||
%piece.setPosition(%np);
|
||||
case "+y":
|
||||
%np = VectorAdd(%current, "0 "@%client.MoveSetting@" 0");
|
||||
%piece.setPosition(%np);
|
||||
case "-y":
|
||||
%np = VectorAdd(%current, "0 "@%client.MoveSetting * -1@" 0");
|
||||
%piece.setPosition(%np);
|
||||
case "+z":
|
||||
%np = VectorAdd(%current, "0 0 "@%client.MoveSetting@"");
|
||||
%piece.setPosition(%np);
|
||||
case "-z":
|
||||
%np = VectorAdd(%current, "0 0 "@%client.MoveSetting * -1@"");
|
||||
%piece.setPosition(%np);
|
||||
}
|
||||
|
||||
PostOperationCheck(%piece);
|
||||
}
|
||||
|
||||
// Installation notes:
|
||||
// To install the MIST v6, follow these instructions:
|
||||
// - In player.cs, navigate to the Pure armor datablock and add the line:
|
||||
// max[MergeTool] = 1;
|
||||
// Within the datablock.
|
||||
// - In inventoryhud.cs, add the tool as a weapon to the inventory list.
|
||||
// - Add to inventory.cs to grenade selection of the function ShapeBase::use
|
||||
// if (%this.getMountedImage(0).getname() $= "MergeToolImage")
|
||||
// {
|
||||
// %this.client.MTSubMode++;
|
||||
// if (%this.client.MTMode == 0 && %this.client.MTSubMode == 2)
|
||||
// %this.client.MTSubMode = 0;
|
||||
// if (%this.client.MTMode == 1 && %this.client.MTSubMode == 1)
|
||||
// %this.client.MTSubMode = 0;
|
||||
// if (%this.client.MTMode == 2 && %this.client.MTSubMode == 8)
|
||||
// %this.client.MTSubMode = 0;
|
||||
//
|
||||
// MTShowStatus(%this.client);
|
||||
// return;
|
||||
// }
|
||||
// and add this too, in mine selection of the same function
|
||||
// if (%this.getMountedImage(0).getname() $= "MergeToolImage")
|
||||
// {
|
||||
// %this.client.MTMode++;
|
||||
// %this.client.MTSubMode = 0;
|
||||
// if (%this.client.MTMode >= 3)
|
||||
// %this.client.MTMode = 0;
|
||||
//
|
||||
// MTShowStatus(%this.client);
|
||||
// return;
|
||||
// }
|
||||
// add the following line to the function ShapeBase::clearInventory
|
||||
// %this.setInventory(MergeTool,0);
|
||||
// - Ensure that this file is executed by adding an exec() call to weapons.cs, server.cs, or any other
|
||||
// location that is executed on startup.
|
||||
// - Make sure that MergeToolSupport.cs is executed by adjusting the path below.
|
||||
exec("scripts/do_not_delete/MergeToolSupport.cs");
|
||||
241
scripts/weapons/Construction/superChaingun.cs
Normal file
241
scripts/weapons/Construction/superChaingun.cs
Normal file
|
|
@ -0,0 +1,241 @@
|
|||
//--------------------------------------
|
||||
// SuperChaingun
|
||||
//--------------------------------------
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Projectile
|
||||
//--------------------------------------
|
||||
|
||||
datablock TracerProjectileData(SuperChaingunBullet)
|
||||
{
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.125 * 4;
|
||||
directDamageType = $DamageType::SuperChaingun;
|
||||
explosion = ChaingunExplosion;
|
||||
splash = ChaingunSplash;
|
||||
|
||||
hasDamageRadius = true;
|
||||
indirectDamage = 0.45 * 400;
|
||||
damageRadius = 4.0 * 2;
|
||||
radiusDamageType = $DamageType::SuperChaingun;
|
||||
|
||||
kickBackStrength = 1750;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
dryVelocity = 425.0;
|
||||
wetVelocity = 100.0;
|
||||
velInheritFactor = 1.0;
|
||||
fizzleTimeMS = 3000;
|
||||
lifetimeMS = 3000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 15.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
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.10;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
|
||||
hasLight = true;
|
||||
lightRadius = 5.0;
|
||||
lightColor = "0.5 0.5 0.175";
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(SuperChaingunImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_chaingun.dts";
|
||||
item = SuperChaingun;
|
||||
|
||||
projectile = SuperChaingunBullet;
|
||||
projectileType = TracerProjectile;
|
||||
usesEnergy = 1;
|
||||
|
||||
emap = true;
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "0.3 0.5 1.0";
|
||||
shellExitOffset = "0.15 -0.56 -0.1";
|
||||
shellExitVariance = 15.0;
|
||||
shellVelocity = 4.0;
|
||||
|
||||
projectileSpread = 1.0 / 1000.0;
|
||||
|
||||
//--------------------------------------
|
||||
stateName[0] = "Activate";
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
stateAllowImageChange[0] = false;
|
||||
//
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateTransitionOnTimeout[0] = "Ready";
|
||||
stateTransitionOnNoAmmo[0] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[1] = "Ready";
|
||||
stateSpinThread[1] = Stop;
|
||||
//
|
||||
stateTransitionOnTriggerDown[1] = "Spinup";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[2] = "NoAmmo";
|
||||
stateTransitionOnAmmo[2] = "Ready";
|
||||
stateSpinThread[2] = Stop;
|
||||
stateTransitionOnTriggerDown[2] = "DryFire";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[3] = "Spinup";
|
||||
stateSpinThread[3] = SpinUp;
|
||||
stateSound[3] = ChaingunSpinupSound;
|
||||
//
|
||||
stateTimeoutValue[3] = 0.0;
|
||||
stateWaitForTimeout[3] = false;
|
||||
stateTransitionOnTimeout[3] = "Fire";
|
||||
stateTransitionOnTriggerUp[3] = "Spindown";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[4] = "Fire";
|
||||
stateSequence[4] = "Fire";
|
||||
stateSequenceRandomFlash[4] = true;
|
||||
stateSpinThread[4] = FullSpeed;
|
||||
stateSound[4] = ChaingunFireSound;
|
||||
//stateRecoil[4] = LightRecoil;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateScript[4] = "onFire";
|
||||
stateFire[4] = true;
|
||||
stateEjectShell[4] = true;
|
||||
//
|
||||
stateTimeoutValue[4] = 0.01;
|
||||
stateTransitionOnTimeout[4] = "Fire";
|
||||
stateTransitionOnTriggerUp[4] = "Spindown";
|
||||
stateTransitionOnNoAmmo[4] = "EmptySpindown";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[5] = "Spindown";
|
||||
stateSound[5] = ChaingunSpinDownSound;
|
||||
stateSpinThread[5] = SpinDown;
|
||||
//
|
||||
stateTimeoutValue[5] = 0.0;
|
||||
stateWaitForTimeout[5] = true;
|
||||
stateTransitionOnTimeout[5] = "Ready";
|
||||
stateTransitionOnTriggerDown[5] = "Spinup";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[6] = "EmptySpindown";
|
||||
stateSound[6] = ChaingunSpinDownSound;
|
||||
stateSpinThread[6] = SpinDown;
|
||||
//
|
||||
stateTimeoutValue[6] = 0.5;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[7] = "DryFire";
|
||||
stateSound[7] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[7] = 0.5;
|
||||
stateTransitionOnTimeout[7] = "NoAmmo";
|
||||
};
|
||||
|
||||
datablock ItemData(SuperChaingun)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_chaingun.dts";
|
||||
image = SuperChaingunImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a super chaingun";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function SuperChaingunImage::onFire(%data,%obj,%slot) {
|
||||
if (%obj.superChaingunMode == 1) {
|
||||
%pos = %obj.getMuzzlePoint(%slot);
|
||||
%vec = %obj.getMuzzleVector(%slot);
|
||||
%res = containerRayCast(%pos,vectorAdd(%pos,vectorScale(%vec,2000)), $TypeMasks::PlayerObjectType | $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::StaticObjectType,%obj);
|
||||
if (%res)
|
||||
%hitLoc = getWords(%res,1,3);
|
||||
else
|
||||
%hitLoc = vectorAdd(%pos,vectorScale(%vec,2000));
|
||||
%p = discharge(%pos,%vec);
|
||||
%p.setEnergyPercentage(1);
|
||||
createLifeLight(%hitLoc,1,1000);
|
||||
addToShock(%p);
|
||||
%p.schedule(1000,"delete");
|
||||
zap(0,25,%hitLoc);
|
||||
%obj.decInventory(%data.ammo,1);
|
||||
}
|
||||
else if (%obj.superChaingunMode > 1)
|
||||
{
|
||||
if (!(%obj.lasteffectpulse+2000 < getSimTime()))
|
||||
return;
|
||||
%obj.lasteffectpulse = GetSimTime();
|
||||
%pos = %obj.getMuzzlePoint(%slot);
|
||||
%vec = %obj.getMuzzleVector(%slot);
|
||||
%res = containerRayCast(%pos,vectorAdd(%pos,vectorScale(%vec,2000)), $TypeMasks::PlayerObjectType | $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::StaticObjectType| $TypeMasks::ForceFieldObjectType ,%obj);
|
||||
if (%res)
|
||||
Aidpulse(getWords(%res,1,3),%obj.client,%obj.superChaingunMode-2);
|
||||
|
||||
}
|
||||
else
|
||||
//for (%i = 0; %i < 1; %i++)
|
||||
//{
|
||||
Parent::onFire(%data, %obj, %slot);
|
||||
//}
|
||||
}
|
||||
|
||||
function SuperChaingunImage::onMount(%this,%obj,%slot) {
|
||||
%obj.usingSuperChaingun = true;
|
||||
if (!%obj.superChaingunMode)
|
||||
%obj.superChaingunMode = 0;
|
||||
if (!%obj.superChaingunMode2)
|
||||
%obj.superChaingunMode2 = 0;
|
||||
displaySCGStatus(%obj);
|
||||
WeaponImage::onMount(%this,%obj,%slot);
|
||||
}
|
||||
|
||||
function SuperChaingunImage::onUnmount(%data, %obj, %slot) {
|
||||
%obj.usingSuperChaingun = false;
|
||||
WeaponImage::onUnmount(%data, %obj, %slot);
|
||||
}
|
||||
|
||||
function displaySCGStatus(%obj) {
|
||||
if (%obj.superChaingunMode == 1)
|
||||
bottomPrint(%obj.client,"<spush><font:Sui Generis:14>>>>Super Chain Gun<<<<spop>\n<spush><font:Arial:14>Ions. Progression: " @ ($Ion::StopIon ? "disabled" : "enabled") @ ".<spop>",2,2);
|
||||
else if (%obj.superChaingunMode == 2)
|
||||
bottomPrint(%obj.client,"<spush><font:Sui Generis:14>>>>Super Chain Gun<<<<spop>\n<spush><font:Arial:14>Repair Pulse.<spop>",2,2);
|
||||
else if (%obj.superChaingunMode == 3)
|
||||
bottomPrint(%obj.client,"<spush><font:Sui Generis:14>>>>Super Chain Gun<<<<spop>\n<spush><font:Arial:14>Cloak Pulse.<spop>",2,2);
|
||||
else if (%obj.superChaingunMode == 4)
|
||||
bottomPrint(%obj.client,"<spush><font:Sui Generis:14>>>>Super Chain Gun<<<<spop>\n<spush><font:Arial:14>Deconstruction Pulse<spop>",2,2);
|
||||
else if (%obj.superChaingunMode == 5)
|
||||
bottomPrint(%obj.client,"<spush><font:Sui Generis:14>>>>Super Chain Gun<<<<spop>\n<spush><font:Arial:14>Electro-static Pulse.<spop>",2,2);
|
||||
else if (%obj.superChaingunMode == 6)
|
||||
bottomPrint(%obj.client,"<spush><font:Sui Generis:14>>>>Super Chain Gun<<<<spop>\n<spush><font:Arial:14>Morph Pulse.<spop>",2,2);
|
||||
else
|
||||
bottomPrint(%obj.client,"<spush><font:Sui Generis:14>>>>Super Chain Gun<<<<spop>\n<spush><font:Arial:14>Rapid fire bullets.<spop>",2,2);
|
||||
}
|
||||
66
scripts/weapons/Equipment/C4.cs
Normal file
66
scripts/weapons/Equipment/C4.cs
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
datablock ItemData(C4Deployed) {
|
||||
shapeFile = "pack_upgrade_satchel.dts";
|
||||
explosion = SatchelMainExplosion;
|
||||
underwaterExplosion = UnderwaterSatchelMainExplosion;
|
||||
mass = 1;
|
||||
elasticity = 0.1;
|
||||
friction = 0.9;
|
||||
rotate = false;
|
||||
pickupRadius = 0;
|
||||
noTimeout = true;
|
||||
maxDamage = 0.6;
|
||||
|
||||
kickBackStrength = 4000;
|
||||
|
||||
computeCRC = true;
|
||||
};
|
||||
|
||||
|
||||
datablock ItemData(C4) {
|
||||
className = HandInventory;
|
||||
catagory = "Handheld";
|
||||
shapeFile = "ammo_mine.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.7;
|
||||
pickupRadius = 2;
|
||||
|
||||
thrownItem = C4Deployed;
|
||||
pickUpName = "some C4 Explosives";
|
||||
|
||||
computeCRC = true;
|
||||
};
|
||||
|
||||
function C4GoBoom(%C4) {
|
||||
%C4.setDamageState(Destroyed);
|
||||
}
|
||||
|
||||
function C4Deployed::onThrow(%this, %mine, %thrower) {
|
||||
if($TWM2::PlayingSabo) {
|
||||
MessageClient(%thrower.client, 'MsgC4IsBanned', "\c5C4 Mines are banned in this game mode");
|
||||
%mine.delete();
|
||||
return;
|
||||
}
|
||||
%mine.armed = false;
|
||||
%mine.damaged = 0;
|
||||
%mine.detonated = false;
|
||||
%mine.depCount = 0;
|
||||
%mine.theClient = %thrower.client;
|
||||
%time = 10;
|
||||
if(%thrower.client.IsActivePerk("3 Second C4")) {
|
||||
%time = 3;
|
||||
}
|
||||
schedule(%time * 1000, 0, "C4GoBoom", %mine);
|
||||
MessageClient(%thrower.client, 'MsgBoom', "\c5C4 Deployed, "@%time@" Seconds to Detonate.");
|
||||
}
|
||||
|
||||
function C4Deployed::onDestroyed(%data, %obj, %lastState) {
|
||||
%dmgRadius = 20 * $SatchelChargeMultiplier;
|
||||
%dmgMod = 1.0 * $SatchelChargeMultiplier;
|
||||
%expImpulse = limitSatchelImpulse(2500 * $SatchelChargeMultiplier);
|
||||
%dmgType = $DamageType::SatchelCharge;
|
||||
if(!%obj.isFalse) {
|
||||
RadiusExplosion(%obj, %obj.getPosition(), %dmgRadius, %dmgMod, %expImpulse, %obj.sourceObject, %dmgType);
|
||||
}
|
||||
%obj.schedule(500, "Delete");
|
||||
}
|
||||
243
scripts/weapons/Equipment/Javelin.cs
Normal file
243
scripts/weapons/Equipment/Javelin.cs
Normal file
|
|
@ -0,0 +1,243 @@
|
|||
datablock SeekerProjectileData(JavelinMissile) {
|
||||
casingShapeName = "weapon_missile_casement.dts";
|
||||
projectileShapeName = "weapon_missile_projectile.dts";
|
||||
hasDamageRadius = true;
|
||||
indirectDamage = 1.8; //Requires Lock
|
||||
damageRadius = 18.0;
|
||||
radiusDamageType = $DamageType::Missile;
|
||||
kickBackStrength = 2000;
|
||||
|
||||
ImageSource = "JavelinImage";
|
||||
|
||||
explosion = "SatchelMainExplosion";
|
||||
splash = MissileSplash;
|
||||
velInheritFactor = 1.0; // to compensate for slow starting velocity, this value
|
||||
// is cranked up to full so the missile doesn't start
|
||||
// out behind the player when the player is moving
|
||||
// very quickly - bramage
|
||||
|
||||
baseEmitter = MissileSmokeEmitter;
|
||||
delayEmitter = MissileFireEmitter;
|
||||
puffEmitter = MissilePuffEmitter;
|
||||
bubbleEmitter = GrenadeBubbleEmitter;
|
||||
bubbleEmitTime = 1.0;
|
||||
|
||||
exhaustEmitter = MissileLauncherExhaustEmitter;
|
||||
exhaustTimeMs = 300;
|
||||
exhaustNodeName = "muzzlePoint1";
|
||||
|
||||
lifetimeMS = 30000;
|
||||
muzzleVelocity = 10.0;
|
||||
maxVelocity = 150.0;
|
||||
turningSpeed = 110.0;
|
||||
acceleration = 350.0;
|
||||
|
||||
proximityRadius = 3;
|
||||
|
||||
terrainAvoidanceSpeed = 180;
|
||||
terrainScanAhead = 25;
|
||||
terrainHeightFail = 12;
|
||||
terrainAvoidanceRadius = 100;
|
||||
|
||||
flareDistance = 200;
|
||||
flareAngle = 30;
|
||||
|
||||
sound = MissileProjectileSound;
|
||||
|
||||
hasLight = true;
|
||||
lightRadius = 5.0;
|
||||
lightColor = "0.2 0.05 0";
|
||||
|
||||
useFlechette = true;
|
||||
flechetteDelayMs = 550;
|
||||
casingDeb = FlechetteDebris;
|
||||
|
||||
explodeOnWaterImpact = false;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Ammo
|
||||
//--------------------------------------
|
||||
|
||||
datablock ItemData(JavelinAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_missile.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some javelin rockets";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ItemData(Javelin)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_mortar.dts";
|
||||
image = JavelinImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a javelin launcher";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(JavelinImage) {
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_mortar.dts";
|
||||
item = Javelin;
|
||||
ammo = JavelinAmmo;
|
||||
offset = "0 0 0";
|
||||
armThread = lookms;
|
||||
emap = true;
|
||||
|
||||
projectile = JavelinMissile;
|
||||
projectileType = SeekerProjectile;
|
||||
|
||||
isSeeker = true;
|
||||
seekRadius = 700;
|
||||
maxSeekAngle = 8;
|
||||
seekTime = 0.5;
|
||||
minSeekHeat = 0.01; // the heat that must be present on a target to lock it.
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "JavelinClip";
|
||||
ClipPickupName["JavelinClip"] = "A Few Javelin Missiles";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 6;
|
||||
ClipReturn = 1;
|
||||
InitialClips = 2;
|
||||
//
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 7;
|
||||
Challenge[1] = "Javelin Hunter\t100\t500\tLaser";
|
||||
Challenge[2] = "Javelin Expert\t250\t1000\tNone";
|
||||
Challenge[3] = "Javelin Mastery\t500\t2500\tNone";
|
||||
Challenge[4] = "Javelin Bronze Commendation\t1000\t10000\tNone";
|
||||
Challenge[5] = "Javelin Silver Commendation\t2500\t25000\tNone";
|
||||
Challenge[6] = "Javelin Gold Commendation\t5000\t50000\tNone";
|
||||
Challenge[7] = "Javelin Titan Commendation\t10000\t75000\tNone";
|
||||
Upgrade[1] = "Laser";
|
||||
GunName = "Javelin";
|
||||
|
||||
RankRequire = $TWM2::RankRequire["Javelin"];
|
||||
|
||||
// only target objects outside this range
|
||||
minTargetingDistance = 80;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = MissileSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.4;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateScript[3] = "onFire";
|
||||
stateSound[3] = MissileFireSound;
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 2.5;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
stateSound[4] = MissileReloadSound;
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = MissileDryFireSound;
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateTransitionOnTimeout[6] = "ActivateReady";
|
||||
|
||||
stateName[7] = "CheckTarget";
|
||||
stateTransitionOnNoTarget[7] = "DryFire";
|
||||
stateTransitionOnTarget[7] = "Fire";
|
||||
|
||||
stateName[8] = "CheckWet";
|
||||
stateTransitionOnWet[8] = "WetFire";
|
||||
stateTransitionOnNotWet[8] = "CheckTarget";
|
||||
|
||||
stateName[9] = "WetFire";
|
||||
stateTransitionOnNoAmmo[9] = "NoAmmo";
|
||||
stateTransitionOnTimeout[9] = "Reload";
|
||||
stateSound[9] = MissileFireSound;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateTimeoutValue[9] = 0.4;
|
||||
stateScript[9] = "onWetFire";
|
||||
stateAllowImageChange[9] = false;
|
||||
};
|
||||
|
||||
function JavelinImage::onFire(%data,%obj,%slot) {
|
||||
%obj.decInventory(%data.ammo,1);
|
||||
if(%obj.inv[%data.ammo] == 0) { //Added Phantom139, TWM2
|
||||
AttemptReload(%data, %obj, %slot);
|
||||
}
|
||||
|
||||
%p = new (SeekerProjectile)() {
|
||||
dataBlock = JavelinMissile;
|
||||
initialDirection = "0 0 10";
|
||||
initialPosition = %obj.getPosition();
|
||||
damageFactor = 1;
|
||||
sourceObject = %obj;
|
||||
};
|
||||
%p.WeaponImageSource = %data.getName();
|
||||
|
||||
MissileSet.add(%p);
|
||||
|
||||
%target = %obj.getLockedTarget();
|
||||
if(%target) {
|
||||
//go up first!!!
|
||||
//%p.setPositionTarget(vectorAdd(%obj.getPosition(), "0 0 200"));
|
||||
%p.schedule(3500, "setObjectTarget", %target);
|
||||
schedule(3501, 0, "SetMissileTargeted", %target, %p);
|
||||
}
|
||||
else if(%obj.isLocked()) {
|
||||
//%p.setPositionTarget(vectorAdd(%obj.getPosition(), "0 0 200"));
|
||||
//echo("Javelin Lock: "@%obj.getLockedPosition()@"");
|
||||
%p.JavBeac = new BeaconObject() {
|
||||
dataBlock = "BomberBeacon";
|
||||
beaconType = "vehicle";
|
||||
position = %obj.getLockedPosition();
|
||||
};
|
||||
%p.schedule(3500, "setObjectTarget", %p.JavBeac);
|
||||
schedule(3500, 0, "SetMissileTargeted", %p.JavBeac, %p);
|
||||
%p.JavBeac.schedule(10000, "Delete");
|
||||
}
|
||||
else {
|
||||
//no lock, this missile must self destruct...
|
||||
%p.setNoTarget();
|
||||
%p.getDatablock().onExplode(%p, %p.getPosition(), 1);
|
||||
}
|
||||
}
|
||||
|
||||
236
scripts/weapons/Equipment/RPG7.cs
Normal file
236
scripts/weapons/Equipment/RPG7.cs
Normal file
|
|
@ -0,0 +1,236 @@
|
|||
datablock SeekerProjectileData(RPGMissile) {
|
||||
casingShapeName = "weapon_missile_casement.dts";
|
||||
projectileShapeName = "grenade.dts";
|
||||
hasDamageRadius = true;
|
||||
indirectDamage = 1.3; //TWM2 2.1, Increased to 1.3 from 0.8
|
||||
damageRadius = 8.0;
|
||||
radiusDamageType = $DamageType::RPG;
|
||||
kickBackStrength = 3500;
|
||||
|
||||
ImageSource = "RPGImage";
|
||||
|
||||
explosion = "HandGrenadeExplosion";
|
||||
splash = MissileSplash;
|
||||
velInheritFactor = 1.0; // to compensate for slow starting velocity, this value
|
||||
// is cranked up to full so the missile doesn't start
|
||||
// out behind the player when the player is moving
|
||||
// very quickly - bramage
|
||||
|
||||
baseEmitter = MissileSmokeEmitter;
|
||||
delayEmitter = MissileFireEmitter;
|
||||
puffEmitter = MissilePuffEmitter;
|
||||
bubbleEmitter = GrenadeBubbleEmitter;
|
||||
bubbleEmitTime = 1.0;
|
||||
|
||||
exhaustEmitter = MissileLauncherExhaustEmitter;
|
||||
exhaustTimeMs = 300;
|
||||
exhaustNodeName = "muzzlePoint1";
|
||||
|
||||
lifetimeMS = 5000; // z0dd - ZOD, 4/14/02. Was 6000
|
||||
muzzleVelocity = 100.0;
|
||||
maxVelocity = 350.0; // z0dd - ZOD, 4/14/02. Was 80.0
|
||||
turningSpeed = 54.0;
|
||||
acceleration = 50.0;
|
||||
|
||||
explodeOnDeath = true;
|
||||
|
||||
proximityRadius = 3;
|
||||
|
||||
sound = MissileProjectileSound;
|
||||
|
||||
hasLight = true;
|
||||
lightRadius = 3.0;
|
||||
lightColor = "0.2 0.05 0";
|
||||
|
||||
useFlechette = true;
|
||||
flechetteDelayMs = 10;
|
||||
casingDeb = FlechetteDebris;
|
||||
|
||||
explodeOnWaterImpact = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Ammo
|
||||
//--------------------------------------
|
||||
|
||||
datablock ItemData(RPGAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_missile.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "Some RPGs";
|
||||
|
||||
computeCRC = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ItemData(RPG)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_grenade_launcher.dts";
|
||||
image = RPGImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "an RPG";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(RPGImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_grenade_launcher.dts";
|
||||
item = RPG;
|
||||
ammo = RPGAmmo;
|
||||
offset = "0 -1 0";
|
||||
armThread = lookms;
|
||||
emap = true;
|
||||
|
||||
projectile = RPGMissile;
|
||||
projectileType = seekerprojectile;
|
||||
projectileSpread = 1.0 / 1000.0;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "RPGClip";
|
||||
ClipPickupName["RPGClip"] = "A Few RPGs";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 5;
|
||||
ClipReturn = 1;
|
||||
InitialClips = 7;
|
||||
//
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 9;
|
||||
Challenge[1] = "RPG Killer\t50\t100\tNone";
|
||||
Challenge[2] = "RPG Extremist\t100\t150\tNone";
|
||||
Challenge[3] = "RPG Expert\t250\t250\tNone";
|
||||
Challenge[4] = "RPG Master\t500\t500\tEnhanced Explosives";
|
||||
Challenge[5] = "RPG Legend\t1000\t1000\tSpread Neutralizer";
|
||||
Challenge[6] = "RPG Bronze Commendation\t2500\t10000\tNone";
|
||||
Challenge[7] = "RPG Silver Commendation\t5000\t25000\tNone";
|
||||
Challenge[8] = "RPG Gold Commendation\t10000\t50000\tNone";
|
||||
Challenge[9] = "RPG Titan Commendation\t25000\t75000\tNone";
|
||||
Upgrade[1] = "RPG Explosives";
|
||||
Upgrade[2] = "Spread Neutralizer";
|
||||
GunName = "RPG-7";
|
||||
|
||||
RankRequire = $TWM2::RankRequire["RPG7"];
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 2.0;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = MissileSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.4;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateScript[3] = "onFire";
|
||||
stateSound[3] = MissileFireSound;
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 0.1;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
stateSound[4] = MissileReloadSound;
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = MissileDryFireSound;
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateTransitionOnTimeout[6] = "ActivateReady";
|
||||
|
||||
stateName[7] = "CheckTarget";
|
||||
stateTransitionOnNoTarget[7] = "Fire";
|
||||
stateTransitionOnTarget[7] = "Fire";
|
||||
|
||||
stateName[8] = "CheckWet";
|
||||
stateTransitionOnWet[8] = "DryFire";
|
||||
stateTransitionOnNotWet[8] = "CheckTarget";
|
||||
|
||||
stateName[9] = "WetFire";
|
||||
stateTransitionOnNoAmmo[9] = "NoAmmo";
|
||||
stateTransitionOnTimeout[9] = "Reload";
|
||||
stateTimeoutValue[9] = 0.4;
|
||||
stateScript[9] = "onWetFire";
|
||||
stateAllowImageChange[9] = false;
|
||||
};
|
||||
|
||||
function RPGImage::OnFire(%data, %obj, %slot) {
|
||||
// if($TWM2::PlayingSabo) { Inv. Ban lifted TWM2 1.8
|
||||
// MessageClient(%thrower.client, 'MsgC4IsBanned', "\c5RPGs are banned in this game mode");
|
||||
// return;
|
||||
// }
|
||||
%p = Parent::OnFire(%data, %obj, %slot);
|
||||
if(!%obj.client.UpgradeOn("Spread Neutralizer", %data.getName())) {
|
||||
schedule(500, 0, "RPGRandomMovement", %p);
|
||||
}
|
||||
if(%obj.client.UpgradeOn("Enhanced Explosives", %data.getName())) {
|
||||
%p.damageFactor = 5; //heh
|
||||
}
|
||||
%p.ticksleft = 10;
|
||||
}
|
||||
|
||||
function RPGRandomMovement(%p) {
|
||||
if(!isObject(%p)) {
|
||||
return;
|
||||
}
|
||||
%fw = %p.initialDirection; //current direction
|
||||
%x = (getRandom() - 0.5) * 2 * 3.1415926 * (25/1000);
|
||||
%y = (getRandom() - 0.5) * 2 * 3.1415926 * (25/1000);
|
||||
%z = (getRandom() - 0.5) * 2 * 3.1415926 * (10/1000);
|
||||
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
|
||||
%newvector = MatrixMulVector(%mat, %fw);
|
||||
//now lets use basic torque operations to spawn a new RPG missile going the new direction
|
||||
%pnew = new (SeekerProjectile)() {
|
||||
dataBlock = RPGMissile;
|
||||
initialDirection = %newvector;
|
||||
initialPosition = %p.getPosition();
|
||||
damageFactor = %p.damageFactor;
|
||||
//sourceObject = %p.sourceObject; // <-- done below to prevent spawning suicidal missiles
|
||||
};
|
||||
MissionCleanup.add(%pnew);
|
||||
%pnew.sourceObject = %p.sourceObject;
|
||||
%pnew.WeaponImageSource = %p.WeaponImageSource;
|
||||
%pnew.ticksleft = %p.ticksleft - 1;
|
||||
%pnew.ImageSource = "RPGImage";
|
||||
//echo(%pnew.ticksleft);
|
||||
if(%pnew.ticksleft <= 0) { //time up!
|
||||
%pnew.getDatablock().onExplode(%pnew, %pnew.getPosition(), 1);
|
||||
%p.delete();
|
||||
%pnew.delete();
|
||||
//echo("end");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
%p.delete();
|
||||
schedule(500, 0, "RPGRandomMovement", %pnew);
|
||||
}
|
||||
}
|
||||
2987
scripts/weapons/Equipment/SWBeaconer.cs
Normal file
2987
scripts/weapons/Equipment/SWBeaconer.cs
Normal file
File diff suppressed because it is too large
Load diff
230
scripts/weapons/Equipment/Stinger.cs
Normal file
230
scripts/weapons/Equipment/Stinger.cs
Normal file
|
|
@ -0,0 +1,230 @@
|
|||
datablock SeekerProjectileData(StingerMissile) {
|
||||
casingShapeName = "weapon_missile_casement.dts";
|
||||
projectileShapeName = "weapon_missile_projectile.dts";
|
||||
hasDamageRadius = true;
|
||||
indirectDamage = 1.4; //Requires Lock
|
||||
damageRadius = 18.0;
|
||||
radiusDamageType = $DamageType::Missile;
|
||||
kickBackStrength = 1000;
|
||||
|
||||
ImageSource = "StingerImage";
|
||||
|
||||
explosion = "SatchelMainExplosion";
|
||||
splash = MissileSplash;
|
||||
velInheritFactor = 1.0; // to compensate for slow starting velocity, this value
|
||||
// is cranked up to full so the missile doesn't start
|
||||
// out behind the player when the player is moving
|
||||
// very quickly - bramage
|
||||
|
||||
baseEmitter = MissileSmokeEmitter;
|
||||
delayEmitter = MissileFireEmitter;
|
||||
puffEmitter = MissilePuffEmitter;
|
||||
bubbleEmitter = GrenadeBubbleEmitter;
|
||||
bubbleEmitTime = 1.0;
|
||||
|
||||
exhaustEmitter = MissileLauncherExhaustEmitter;
|
||||
exhaustTimeMs = 300;
|
||||
exhaustNodeName = "muzzlePoint1";
|
||||
|
||||
lifetimeMS = 30000;
|
||||
muzzleVelocity = 10.0;
|
||||
maxVelocity = 150.0;
|
||||
turningSpeed = 110.0;
|
||||
acceleration = 350.0;
|
||||
|
||||
proximityRadius = 3;
|
||||
|
||||
terrainAvoidanceSpeed = 180;
|
||||
terrainScanAhead = 25;
|
||||
terrainHeightFail = 12;
|
||||
terrainAvoidanceRadius = 100;
|
||||
|
||||
flareDistance = 200;
|
||||
flareAngle = 30;
|
||||
|
||||
sound = MissileProjectileSound;
|
||||
|
||||
hasLight = true;
|
||||
lightRadius = 5.0;
|
||||
lightColor = "0.2 0.05 0";
|
||||
|
||||
useFlechette = true;
|
||||
flechetteDelayMs = 550;
|
||||
casingDeb = FlechetteDebris;
|
||||
|
||||
explodeOnWaterImpact = false;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Ammo
|
||||
//--------------------------------------
|
||||
|
||||
datablock ItemData(StingerAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_missile.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some Stinger rockets";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ItemData(Stinger)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_mortar.dts";
|
||||
image = StingerImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a Stinger launcher";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(StingerImage) {
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_grenade_launcher.dts";
|
||||
item = Stinger;
|
||||
ammo = StingerAmmo;
|
||||
offset = "0 0 0";
|
||||
armThread = lookms;
|
||||
emap = true;
|
||||
|
||||
projectile = StingerMissile;
|
||||
projectileType = SeekerProjectile;
|
||||
|
||||
isSeeker = true;
|
||||
seekRadius = 700;
|
||||
maxSeekAngle = 8;
|
||||
seekTime = 0.5;
|
||||
minSeekHeat = 0.01; // the heat that must be present on a target to lock it.
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "StingerClip";
|
||||
ClipPickupName["StingerClip"] = "A Few Stinger Missiles";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 4;
|
||||
ClipReturn = 1;
|
||||
InitialClips = 4;
|
||||
//
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 7;
|
||||
Challenge[1] = "Stinger Hunter\t100\t500\tNone";
|
||||
Challenge[2] = "Stinger Expert\t250\t1000\tNone";
|
||||
Challenge[3] = "Stinger Mastery\t500\t2500\tNone";
|
||||
Challenge[4] = "Stinger Bronze Commendation\t1000\t10000\tNone";
|
||||
Challenge[5] = "Stinger Silver Commendation\t2500\t25000\tNone";
|
||||
Challenge[6] = "Stinger Gold Commendation\t5000\t50000\tNone";
|
||||
Challenge[7] = "Stinger Titan Commendation\t10000\t75000\tNone";
|
||||
GunName = "Stinger";
|
||||
|
||||
RankRequire = $TWM2::RankRequire["Stinger"];
|
||||
|
||||
// only target objects outside this range
|
||||
minTargetingDistance = 80;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = MissileSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.4;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateScript[3] = "onFire";
|
||||
stateSound[3] = MissileFireSound;
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 2.5;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
stateSound[4] = MissileReloadSound;
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = MissileDryFireSound;
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateTransitionOnTimeout[6] = "ActivateReady";
|
||||
|
||||
stateName[7] = "CheckTarget";
|
||||
stateTransitionOnNoTarget[7] = "DryFire";
|
||||
stateTransitionOnTarget[7] = "Fire";
|
||||
|
||||
stateName[8] = "CheckWet";
|
||||
stateTransitionOnWet[8] = "WetFire";
|
||||
stateTransitionOnNotWet[8] = "CheckTarget";
|
||||
|
||||
stateName[9] = "WetFire";
|
||||
stateTransitionOnNoAmmo[9] = "NoAmmo";
|
||||
stateTransitionOnTimeout[9] = "Reload";
|
||||
stateSound[9] = MissileFireSound;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateTimeoutValue[9] = 0.4;
|
||||
stateScript[9] = "onWetFire";
|
||||
stateAllowImageChange[9] = false;
|
||||
};
|
||||
|
||||
function StingerImage::onFire(%data,%obj,%slot) {
|
||||
%obj.decInventory(%data.ammo,1);
|
||||
if(%obj.inv[%data.ammo] == 0) { //Added Phantom139, TWM2
|
||||
AttemptReload(%data, %obj, %slot);
|
||||
}
|
||||
|
||||
%target = %obj.getLockedTarget();
|
||||
//requires lock
|
||||
if(%target) {
|
||||
%p = new (SeekerProjectile)() {
|
||||
dataBlock = StingerMissile;
|
||||
initialDirection = "0 0 10";
|
||||
initialPosition = %obj.getPosition();
|
||||
damageFactor = 1;
|
||||
sourceObject = %obj;
|
||||
};
|
||||
%p.WeaponImageSource = %data.getName();
|
||||
|
||||
MissileSet.add(%p);
|
||||
|
||||
%p.schedule(500, "setObjectTarget", %target);
|
||||
schedule(501, 0, "SetMissileTargeted", %target, %p);
|
||||
}
|
||||
else if(%obj.isLocked()) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
229
scripts/weapons/MGs/MG42.cs
Normal file
229
scripts/weapons/MGs/MG42.cs
Normal file
|
|
@ -0,0 +1,229 @@
|
|||
datablock TracerProjectileData(MG42Bullet) {
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.063;
|
||||
directDamageType = $DamageType::MG42;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
HeadMultiplier = 1.5;
|
||||
LegsMultiplier = 0.5;
|
||||
|
||||
ImageSource = "MG42Image";
|
||||
|
||||
kickBackStrength = 50.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
dryVelocity = 3000.0;
|
||||
wetVelocity = 1000.0;
|
||||
velInheritFactor = 1.0;
|
||||
fizzleTimeMS = 3000;
|
||||
lifetimeMS = 3000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 40.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
tracerColor = 10.0/255.0 @ " " @ 30.0/255.0 @ " " @ 240.0/255.0 @ " 0.75";
|
||||
tracerTex[0] = "special/tracer00";
|
||||
tracerTex[1] = "special/tracercross";
|
||||
tracerWidth = 0.2;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Ammo
|
||||
//--------------------------------------
|
||||
datablock ItemData(MG42Ammo) {
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 3;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some PCT ammo";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(MG42Image) {
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
item = MG42;
|
||||
ammo = MG42Ammo;
|
||||
projectile = MG42Bullet;
|
||||
projectileType = TracerProjectile;
|
||||
emap = true;
|
||||
mass = 26;
|
||||
|
||||
offset = "0.08 0.22 0.15"; // L/R - F/B - T/B
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "0.5 0 1";
|
||||
shellExitOffset = "0.0 0.75 0.0";
|
||||
shellExitVariance = 5.0;
|
||||
shellVelocity = 4.5;
|
||||
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "MG42Clip";
|
||||
ClipPickupName["MG42Clip"] = "Some MG42 Clip Boxes";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 7;
|
||||
ClipReturn = 200;
|
||||
InitialClips = 4;
|
||||
//
|
||||
//Challenges
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 8;
|
||||
Challenge[1] = "MG42 Hunter\t100\t250\tNone";
|
||||
Challenge[2] = "MG42 Expert\t250\t500\tGrip";
|
||||
Challenge[3] = "MG42 Master\t750\t1000\tNone";
|
||||
Challenge[4] = "MG42 God\t1500\t2000\tSilencer";
|
||||
Challenge[5] = "MG42 Bronze Commendation\t3000\t10000\tNone";
|
||||
Challenge[6] = "MG42 Silver Commendation\t6000\t25000\tNone";
|
||||
Challenge[7] = "MG42 Gold Commendation\t12500\t50000\tNone";
|
||||
Challenge[8] = "MG42 Titan Commendation\t35000\t75000\tNone";
|
||||
Upgrade[1] = "Grip";
|
||||
Upgrade[2] = "Silencer";
|
||||
GunName = "MG42 Machine Gun";
|
||||
//
|
||||
|
||||
RankRequire = $TWM2::RankRequire["MG42"];
|
||||
|
||||
projectileSpread = 12.5 / 1000.0;
|
||||
|
||||
//--------------------------------------
|
||||
stateName[0] = "Activate";
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
stateAllowImageChange[0] = false;
|
||||
//
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateTransitionOnTimeout[0] = "Ready";
|
||||
stateTransitionOnNoAmmo[0] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[1] = "Ready";
|
||||
stateSpinThread[1] = Stop;
|
||||
//
|
||||
stateTransitionOnTriggerDown[1] = "Spinup";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[2] = "NoAmmo";
|
||||
stateTransitionOnAmmo[2] = "Ready";
|
||||
stateSpinThread[2] = Stop;
|
||||
stateTransitionOnTriggerDown[2] = "DryFire";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[3] = "Spinup";
|
||||
stateSpinThread[3] = SpinUp;
|
||||
stateSound[3] = ChaingunSpinupSound;
|
||||
//
|
||||
stateTimeoutValue[3] = 0.1;
|
||||
stateWaitForTimeout[3] = false;
|
||||
stateTransitionOnTimeout[3] = "Fire";
|
||||
stateTransitionOnTriggerUp[3] = "Spindown";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[4] = "Fire";
|
||||
stateSequence[4] = "Fire";
|
||||
stateSequenceRandomFlash[4] = true;
|
||||
stateSpinThread[4] = FullSpeed;
|
||||
//stateSound[4] = ChaingunFireSound;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateScript[4] = "onFire";
|
||||
stateFire[4] = true;
|
||||
stateEjectShell[4] = true;
|
||||
stateTimeoutValue[4] = 0.02;
|
||||
stateTransitionOnTimeout[4] = "Fire";
|
||||
stateTransitionOnTriggerUp[4] = "Spindown";
|
||||
stateTransitionOnNoAmmo[4] = "EmptySpindown";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[5] = "Spindown";
|
||||
stateSound[5] = ChaingunSpinDownSound;
|
||||
stateSpinThread[5] = SpinDown;
|
||||
//
|
||||
stateTimeoutValue[5] = 0.1;
|
||||
stateWaitForTimeout[5] = true;
|
||||
stateTransitionOnTimeout[5] = "Ready";
|
||||
stateTransitionOnTriggerDown[5] = "Spinup";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[6] = "EmptySpindown";
|
||||
stateSound[6] = ChaingunSpinDownSound;
|
||||
stateSpinThread[6] = SpinDown;
|
||||
//
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[7] = "DryFire";
|
||||
stateSound[7] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[7] = 0.5;
|
||||
stateTransitionOnTimeout[7] = "NoAmmo";
|
||||
};
|
||||
|
||||
datablock ItemData(MG42) {
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "turret_tank_barrelchain.dts";
|
||||
image = MG42Image;
|
||||
mass = 1.0;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a Portible Chaingun Turret";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(MG42Image1) : MG42Image {
|
||||
className = WeaponImage;
|
||||
|
||||
shapeFile = "weapon_missile.dts";
|
||||
rotation = "0 0 1 180";
|
||||
offset = "0.01 0.04 0.0"; // L/R - F/B - T/B
|
||||
};
|
||||
|
||||
function MG42Image::onMount(%this,%obj,%slot) {
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
%obj.mountImage(MG42Image1, 3);
|
||||
|
||||
}
|
||||
|
||||
function MG42Image::onUnmount(%this,%obj,%slot) {
|
||||
Parent::onUnmount(%this, %obj, %slot);
|
||||
%obj.unmountImage(3);
|
||||
}
|
||||
|
||||
function MG42Image::onFire(%data, %obj, %slot) {
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
|
||||
//zero sound :p
|
||||
}
|
||||
else {
|
||||
ServerPlay3d(ChaingunFireSound, %obj.getPosition());
|
||||
}
|
||||
}
|
||||
|
||||
204
scripts/weapons/MGs/MRXX.cs
Normal file
204
scripts/weapons/MGs/MRXX.cs
Normal file
|
|
@ -0,0 +1,204 @@
|
|||
datablock TracerProjectileData(MRXXBullet) {
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.043;
|
||||
directDamageType = $DamageType::MRXX;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
HeadMultiplier = 1.25;
|
||||
LegsMultiplier = 0.75;
|
||||
|
||||
ImageSource = "MRXXImage";
|
||||
|
||||
kickBackStrength = 15.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
dryVelocity = 1750.0;
|
||||
wetVelocity = 1500.0;
|
||||
velInheritFactor = 0.0;
|
||||
fizzleTimeMS = 3000;
|
||||
lifetimeMS = 3000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 9.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
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.09;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
};
|
||||
|
||||
datablock ItemData(MRXXAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 3;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some MRXX ammo";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(MRXXImage) {
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_mortar.dts";
|
||||
item = MRXX;
|
||||
ammo = MRXXAmmo;
|
||||
projectile = MRXXBullet;
|
||||
projectileType = TracerProjectile;
|
||||
emap = true;
|
||||
mass = 26;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "MRXXClip";
|
||||
ClipPickupName["MRXXClip"] = "some MRXX Clip Boxes";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 9;
|
||||
ClipReturn = 150;
|
||||
InitialClips = 5;
|
||||
//
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 8;
|
||||
Challenge[1] = "MRXX ZC4 Killer\t50\t100\tNone";
|
||||
Challenge[2] = "MRXX ZC4 Expert\t100\t250\tNone";
|
||||
Challenge[3] = "MRXX ZC4 Master\t250\t500\tGrip";
|
||||
Challenge[4] = "MRXX ZC4 God\t500\t1000\tSilencer";
|
||||
Challenge[5] = "MRXX ZC4 Bronze Commendation\t1500\t10000\tNone";
|
||||
Challenge[6] = "MRXX ZC4 Silver Commendation\t5000\t25000\tNone";
|
||||
Challenge[7] = "MRXX ZC4 Gold Commendation\t10000\t50000\tNone";
|
||||
Challenge[8] = "MRXX ZC4 Titan Commendation\t25000\t75000\tNone";
|
||||
Upgrade[1] = "Grip";
|
||||
Upgrade[2] = "Silencer";
|
||||
GunName = "MRXX ZC4 Machine Gun";
|
||||
|
||||
RankRequire = $TWM2::RankRequire["MRXX"];
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "0.5 0 1";
|
||||
shellExitOffset = "0.0 0.75 0.0";
|
||||
shellExitVariance = 5.0;
|
||||
shellVelocity = 4.5;
|
||||
|
||||
projectileSpread = 10.0 / 1000.0;
|
||||
|
||||
|
||||
//--------------------------------------
|
||||
stateName[0] = "Activate";
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
stateAllowImageChange[0] = false;
|
||||
//
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateTransitionOnTimeout[0] = "Ready";
|
||||
stateTransitionOnNoAmmo[0] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[1] = "Ready";
|
||||
stateSpinThread[1] = Stop;
|
||||
//
|
||||
stateTransitionOnTriggerDown[1] = "Spinup";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[2] = "NoAmmo";
|
||||
stateTransitionOnAmmo[2] = "Ready";
|
||||
stateSpinThread[2] = Stop;
|
||||
stateTransitionOnTriggerDown[2] = "DryFire";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[3] = "Spinup";
|
||||
stateSpinThread[3] = SpinUp;
|
||||
stateSound[3] = ChaingunSpinupSound;
|
||||
//
|
||||
stateTimeoutValue[3] = 0.1;
|
||||
stateWaitForTimeout[3] = false;
|
||||
stateTransitionOnTimeout[3] = "Fire";
|
||||
stateTransitionOnTriggerUp[3] = "Spindown";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[4] = "Fire";
|
||||
stateSequence[4] = "Fire";
|
||||
stateSequenceRandomFlash[4] = true;
|
||||
stateSpinThread[4] = FullSpeed;
|
||||
//stateSound[4] = MRXXFireSound;
|
||||
|
||||
stateAllowImageChange[4] = false;
|
||||
stateScript[4] = "onFire";
|
||||
stateFire[4] = true;
|
||||
stateEjectShell[4] = true;
|
||||
stateTimeoutValue[4] = 0.02;
|
||||
stateTransitionOnTimeout[4] = "Fire";
|
||||
stateTransitionOnTriggerUp[4] = "Spindown";
|
||||
stateTransitionOnNoAmmo[4] = "EmptySpindown";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[5] = "Spindown";
|
||||
stateSound[5] = ChaingunSpinDownSound;
|
||||
stateSpinThread[5] = SpinDown;
|
||||
//
|
||||
stateTimeoutValue[5] = 0.1;
|
||||
stateWaitForTimeout[5] = true;
|
||||
stateTransitionOnTimeout[5] = "Ready";
|
||||
stateTransitionOnTriggerDown[5] = "Spinup";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[6] = "EmptySpindown";
|
||||
stateSound[6] = ChaingunSpinDownSound;
|
||||
stateSpinThread[6] = SpinDown;
|
||||
//
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[7] = "DryFire";
|
||||
stateSound[7] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[7] = 0.5;
|
||||
stateTransitionOnTimeout[7] = "NoAmmo";
|
||||
};
|
||||
|
||||
datablock ItemData(MRXX) {
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "turret_tank_barrelchain.dts";
|
||||
image = MRXXImage;
|
||||
mass = 1.0;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a MRXX ZC4 MG";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function MRXXImage::onFire(%data, %obj, %slot) {
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
|
||||
//zero sound :p
|
||||
}
|
||||
else {
|
||||
ServerPlay3d(ChaingunFireSound, %obj.getPosition());
|
||||
}
|
||||
}
|
||||
212
scripts/weapons/MGs/RP432.cs
Normal file
212
scripts/weapons/MGs/RP432.cs
Normal file
|
|
@ -0,0 +1,212 @@
|
|||
datablock AudioProfile(Rp432FireSound) {
|
||||
filename = "fx/weapons/cg_metal1.wav";
|
||||
description = AudioDefault3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock TracerProjectileData(RP432Bullet)
|
||||
{
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.044;
|
||||
directDamageType = $DamageType::RP432;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
HeadMultiplier = 1.25;
|
||||
LegsMultiplier = 0.75;
|
||||
|
||||
ImageSource = "RP432Image";
|
||||
|
||||
kickBackStrength = 15.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
dryVelocity = 1750.0;
|
||||
wetVelocity = 1500.0;
|
||||
velInheritFactor = 0.0;
|
||||
fizzleTimeMS = 3000;
|
||||
lifetimeMS = 3000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 9.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
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.09;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
};
|
||||
|
||||
datablock ItemData(RP432Ammo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 3;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some RP432 ammo";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(RP432Image) {
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_missile.dts";
|
||||
item = RP432;
|
||||
ammo = RP432Ammo;
|
||||
projectile = RP432Bullet;
|
||||
projectileType = TracerProjectile;
|
||||
emap = true;
|
||||
mass = 26;
|
||||
|
||||
armThread = lookms;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "RP432Clip";
|
||||
ClipPickupName["RP432Clip"] = "some RP432 Clip Boxes";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 9;
|
||||
ClipReturn = 75;
|
||||
InitialClips = 5;
|
||||
//
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 8;
|
||||
Challenge[1] = "RP-432 Killer\t50\t100\tNone";
|
||||
Challenge[2] = "RP-432 Expert\t100\t250\tNone";
|
||||
Challenge[3] = "RP-432 Master\t250\t500\tGrip";
|
||||
Challenge[4] = "RP-432 God\t500\t1000\tSilencer";
|
||||
Challenge[5] = "RP-432 Bronze Commendation\t1500\t10000\tNone";
|
||||
Challenge[6] = "RP-432 Silver Commendation\t5000\t25000\tNone";
|
||||
Challenge[7] = "RP-432 Gold Commendation\t10000\t50000\tNone";
|
||||
Challenge[8] = "RP-432 Titan Commendation\t25000\t75000\tNone";
|
||||
Upgrade[1] = "Grip";
|
||||
Upgrade[2] = "Silencer";
|
||||
GunName = "RP-432 Machine Gun";
|
||||
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "0.5 0 1";
|
||||
shellExitOffset = "0.0 0.75 0.0";
|
||||
shellExitVariance = 5.0;
|
||||
shellVelocity = 4.5;
|
||||
|
||||
projectileSpread = 10.0 / 1000.0;
|
||||
|
||||
|
||||
//--------------------------------------
|
||||
stateName[0] = "Activate";
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
stateAllowImageChange[0] = false;
|
||||
//
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateTransitionOnTimeout[0] = "Ready";
|
||||
stateTransitionOnNoAmmo[0] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[1] = "Ready";
|
||||
stateSpinThread[1] = Stop;
|
||||
//
|
||||
stateTransitionOnTriggerDown[1] = "Spinup";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[2] = "NoAmmo";
|
||||
stateTransitionOnAmmo[2] = "Ready";
|
||||
stateSpinThread[2] = Stop;
|
||||
stateTransitionOnTriggerDown[2] = "DryFire";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[3] = "Spinup";
|
||||
stateSpinThread[3] = SpinUp;
|
||||
stateSound[3] = ChaingunSpinupSound;
|
||||
//
|
||||
stateTimeoutValue[3] = 0.1;
|
||||
stateWaitForTimeout[3] = false;
|
||||
stateTransitionOnTimeout[3] = "Fire";
|
||||
stateTransitionOnTriggerUp[3] = "Spindown";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[4] = "Fire";
|
||||
stateSequence[4] = "Fire";
|
||||
stateSequenceRandomFlash[4] = true;
|
||||
stateSpinThread[4] = FullSpeed;
|
||||
//stateSound[4] = Rp432FireSound;
|
||||
|
||||
stateAllowImageChange[4] = false;
|
||||
stateScript[4] = "onFire";
|
||||
stateFire[4] = true;
|
||||
stateEjectShell[4] = true;
|
||||
stateTimeoutValue[4] = 0.02;
|
||||
stateTransitionOnTimeout[4] = "Fire";
|
||||
stateTransitionOnTriggerUp[4] = "Spindown";
|
||||
stateTransitionOnNoAmmo[4] = "EmptySpindown";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[5] = "Spindown";
|
||||
stateSound[5] = ChaingunSpinDownSound;
|
||||
stateSpinThread[5] = SpinDown;
|
||||
//
|
||||
stateTimeoutValue[5] = 0.1;
|
||||
stateWaitForTimeout[5] = true;
|
||||
stateTransitionOnTimeout[5] = "Ready";
|
||||
stateTransitionOnTriggerDown[5] = "Spinup";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[6] = "EmptySpindown";
|
||||
stateSound[6] = ChaingunSpinDownSound;
|
||||
stateSpinThread[6] = SpinDown;
|
||||
//
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[7] = "DryFire";
|
||||
stateSound[7] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[7] = 0.5;
|
||||
stateTransitionOnTimeout[7] = "NoAmmo";
|
||||
};
|
||||
|
||||
datablock ItemData(RP432) {
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "turret_tank_barrelchain.dts";
|
||||
image = RP432Image;
|
||||
mass = 1.0;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a RP432 MG";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function RP432Image::onFire(%data, %obj, %slot) {
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
|
||||
//zero sound :p
|
||||
}
|
||||
else {
|
||||
ServerPlay3d(Rp432FireSound, %obj.getPosition());
|
||||
}
|
||||
}
|
||||
294
scripts/weapons/Melee/BOV.cs
Normal file
294
scripts/weapons/Melee/BOV.cs
Normal file
|
|
@ -0,0 +1,294 @@
|
|||
datablock AudioProfile(BOVHitSound) {
|
||||
filename = "fx/misc/flag_snatch.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(BOVButt)
|
||||
{
|
||||
shapeFile = "weapon_disc.dts";
|
||||
mountPoint = 1;
|
||||
|
||||
offset = "0.0 0.8 0.55"; // L/R - F/B - T/B
|
||||
rotation = "2.0 -2.0 3.0 45"; // L/R - F/B - T/B
|
||||
};
|
||||
|
||||
function swingbackbov(%obj) {
|
||||
%obj.unmountImage(6);
|
||||
%obj.mountImage(BOVButt, 5);
|
||||
}
|
||||
|
||||
datablock LinearProjectileData(BOVhit) {
|
||||
projectileShapeName = "disc.dts";
|
||||
emitterDelay = -1;
|
||||
directDamage = 100.0;
|
||||
radiusDamageType = $DamageType::Admin;
|
||||
kickBackStrength = 1750;
|
||||
|
||||
ImageSource = "BOVImage";
|
||||
|
||||
sound = discProjectileSound;
|
||||
explosion = "ChaingunExplosion";
|
||||
underwaterExplosion = "ChaingunExplosion";
|
||||
splash = DiscSplash;
|
||||
|
||||
dryVelocity = 50;
|
||||
wetVelocity = 30;
|
||||
velInheritFactor = 0.5;
|
||||
fizzleTimeMS = 100;
|
||||
lifetimeMS = 100;
|
||||
explodeOnDeath = true;
|
||||
reflectOnWaterImpactAngle = 15.0;
|
||||
explodeOnWaterImpact = true;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 5000;
|
||||
|
||||
activateDelayMS = 200;
|
||||
|
||||
hasLight = true;
|
||||
lightRadius = 6.0;
|
||||
lightColor = "0.175 0.175 0.5";
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(BOVImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "turret_muzzlepoint.dts";
|
||||
item = BOV;
|
||||
projectile = BOVhit;
|
||||
projectileType = LinearProjectile;
|
||||
|
||||
usesEnergy = true;
|
||||
fireEnergy = 20;
|
||||
minEnergy = 30;
|
||||
|
||||
MedalRequire = 1;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 1.0;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = BlasterSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.5;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = NoRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateScript[3] = "onFire";
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateSound[6] = BlasterDryFireSound;
|
||||
stateTransitionOnTimeout[6] = "Ready";
|
||||
};
|
||||
|
||||
datablock ItemData(BOV)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_disc.dts";
|
||||
image = BOVImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a blade of vengance";
|
||||
};
|
||||
|
||||
function BOVImage::onMount(%data, %obj, %node)
|
||||
{
|
||||
%obj.meleeIMG = %obj.mountImage(BOVButt, 5);
|
||||
}
|
||||
|
||||
function BOVImage::onUnMount(%data, %obj, %node)
|
||||
{
|
||||
%obj.unmountImage(5);
|
||||
}
|
||||
|
||||
datablock ShapeBaseImageData(BoVSwing)
|
||||
{
|
||||
shapeFile = "weapon_disc.dts";
|
||||
mountPoint = 1;
|
||||
|
||||
offset = "0.0 1.45 -0.4"; // L/R - F/B - T/B
|
||||
rotation = "0 0 1 180"; // L/R - F/B - T/B
|
||||
};
|
||||
|
||||
function BOVImage::onFire(%data, %obj, %node) {
|
||||
//dumbass use
|
||||
//Person without the medal
|
||||
if(!%obj.client.hasMedal(11) && !%obj.client.isAiControlled()) {
|
||||
messageClient(%obj.client, 'MsgClient', "\c3You must aquire the 'Revenge Avoided Again' Medal to use this.");
|
||||
messageall('MsgDummy', "\c0In an effort to use the blade of vengance, "@ %obj.client.namebase@" stabbed himself!");
|
||||
%obj.scriptKill($DamageType::Admin);
|
||||
return;
|
||||
}
|
||||
if(%obj.cannotuseBOV) { //in the kill anim?
|
||||
return;
|
||||
}
|
||||
//
|
||||
%obj.unmountImage(5);
|
||||
%obj.meleeIMG = %obj.mountImage(BoVSwing, 6);
|
||||
%obj.backswing = schedule(300, 0, "swingbackbov", %obj);
|
||||
|
||||
if(!%obj.client.IsActivePerk("Blade Sweep")) {
|
||||
%p = new (LinearProjectile)() {
|
||||
dataBlock = BOVhit;
|
||||
initialDirection = %obj.getMuzzleVector(%slot);
|
||||
initialPosition = %obj.getMuzzlePoint(%slot);
|
||||
sourceObject = %obj;
|
||||
sourceSlot = %slot;
|
||||
};
|
||||
MissionCleanup.add(%p);
|
||||
}
|
||||
else {
|
||||
for (%i = 0; %i < 7; %i++) {
|
||||
%x = (getRandom() - 0.5) * 2 * 3.1415926 * (6/1000);
|
||||
%y = (getRandom() - 0.5) * 2 * 3.1415926 * (6/1000);
|
||||
%z = 0;
|
||||
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
|
||||
%newvector = MatrixMulVector(%mat, %vector);
|
||||
|
||||
%p = new (LinearProjectile)() {
|
||||
dataBlock = BOVhit;
|
||||
initialDirection = %newvector;
|
||||
initialPosition = %obj.getMuzzlePoint(%slot);
|
||||
sourceObject = %obj;
|
||||
damageFactor = 1;
|
||||
sourceSlot = %slot;
|
||||
};
|
||||
%p.WeaponImageSource = %data.getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function BOVhit::onCollision(%data, %projectile, %targetObject, %modifier, %position, %normal) {
|
||||
if(%targetObject.isBoss) {
|
||||
%targetObject.playShieldEffect("1 1 1");
|
||||
MessageClient(%projectile.sourceObject.client, 'MsgDeflect', "The Boss Deflects The Swipe");
|
||||
return;
|
||||
}
|
||||
if(%targetObject.rapierShield) {
|
||||
MessageClient(%projectile.sourceObject.client, 'MsgDeflect', "The Target Is Immortal.");
|
||||
return;
|
||||
}
|
||||
%source = %projectile.SourceObject;
|
||||
%hitObj = %targetObject;
|
||||
|
||||
%muzzlePos = %source.getMuzzlePoint(0);
|
||||
%muzzleVec = %source.getMuzzleVector(0);
|
||||
|
||||
// extra damage for head shot or less for close range shots
|
||||
if(!(%hitObj.getType() & ($TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType)) && (%hitObj.getDataBlock().getClassName() $= "PlayerData")) {
|
||||
if(%hitObj.getDataBlock().getClassName() $= "PlayerData") {
|
||||
// Now we see if we hit from behind...
|
||||
%forwardVec = %hitobj.getForwardVector();
|
||||
%objDir2D = getWord(%forwardVec, 0) @ " " @ getWord(%forwardVec,1) @ " " @ "0.0";
|
||||
%objPos = %hitObj.getPosition();
|
||||
%dif = VectorSub(%objPos, %muzzlePos);
|
||||
%dif = getWord(%dif, 0) @ " " @ getWord(%dif, 1) @ " 0";
|
||||
%dif = VectorNormalize(%dif);
|
||||
%dot = VectorDot(%dif, %objDir2D);
|
||||
// 120 Deg angle test...
|
||||
// 1.05 == 60 degrees in radians
|
||||
if (%dot >= mCos(1.05)) {
|
||||
// Rear hit
|
||||
if(%source.isAlive()) {
|
||||
%source.applyRepair("0.45"); //we get a bonus repair for rear
|
||||
}
|
||||
if(%source.team == %hitObj.team && !$TeamDamage) {
|
||||
ServerPlay3d(BOVHitSound, %targetObject.getPosition());
|
||||
return; //stops shredding
|
||||
}
|
||||
%source.cannotuseBOV = 1;
|
||||
if(!%hitObj.IsinvincibleC) {
|
||||
DoBOVRearKill(%source, %hitObj, 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
ServerPlay3d(BOVHitSound, %targetObject.getPosition());
|
||||
//The Blade Only Works On Players
|
||||
%targetObject.damage(%projectile.sourceObject, %position, %data.directDamage, %data.directDamageType);
|
||||
if(%source.isAlive()) {
|
||||
%source.applyRepair("0.15"); //15%
|
||||
}
|
||||
if(%targetObject.client !$= "") { //a Player.. goodie
|
||||
if(%targetObject.getState() $= "dead") {
|
||||
MessageAll('MessageAll', "\c0"@%targetObject.client.namebase@" was stabbed by "@%source.client.namebase@"'s Sword.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function DoBOVRearKill(%source, %target, %count) {
|
||||
%count++;
|
||||
if(!isObject(%source) || %source.getState() $= "dead") {
|
||||
%target.setMoveState(false);
|
||||
return;
|
||||
}
|
||||
%source.setMoveState(true);
|
||||
%target.setMoveState(true);
|
||||
%target.clearInventory(); //ha, no guns for You!
|
||||
//lift
|
||||
if(%count <= 15) {
|
||||
%ZPos = %count * 0.025;
|
||||
%newpos = vectoradd(%target.getPosition(),"0 0 "@%ZPos@"");
|
||||
%target.setTransform(%newpos);
|
||||
%target.setvelocity("0 0 0");
|
||||
}
|
||||
else if(%count == 16) {
|
||||
//MessageAll('MsgDIE', "\c4"@%source.client.namebase@": You're so.... weak...");
|
||||
%newpos = vectoradd(%target.getPosition(),"0 0 "@%ZPos * -1@"");
|
||||
%target.setTransform(%newpos);
|
||||
%target.setvelocity("0 0 0");
|
||||
}
|
||||
else if(%count == 17) {
|
||||
//%target.blowup();//BAM!
|
||||
ServerPlay3d(BOVHitSound, %target.getPosition());
|
||||
ServerPlay3d(BOVHitSound, %target.getPosition());
|
||||
ServerPlay3d(BOVHitSound, %target.getPosition());
|
||||
%target.damage(%source, %target.getposition(), 9999, $DamageType::BladeOfVengance);
|
||||
//
|
||||
if(%target.isZombie) {
|
||||
recordAction(%source.client, "BACK", "zombie");
|
||||
}
|
||||
else {
|
||||
recordAction(%source.client, "BACK", "player");
|
||||
}
|
||||
//
|
||||
if(%target.client !$= "") { //a Player.. goodie
|
||||
MessageAll('MessageAll', "\c0"@%target.client.namebase@" was assassinated by "@%source.client.namebase@".");
|
||||
}
|
||||
%source.cannotuseBOV = 0;
|
||||
%source.setMoveState(false);
|
||||
return;
|
||||
}
|
||||
schedule(100,0,"DoBOVRearKill", %source, %target, %count);
|
||||
}
|
||||
245
scripts/weapons/Melee/Plasmasabre.cs
Normal file
245
scripts/weapons/Melee/Plasmasabre.cs
Normal file
|
|
@ -0,0 +1,245 @@
|
|||
//ALL CREDIT TO THE HALO MOD
|
||||
// ORIGINALLY CODED BY: SoldierOfLight
|
||||
|
||||
datablock AudioProfile(BeamExpSound)
|
||||
{
|
||||
filename = "fx/vehicles/shrike_blaster_projectile_impact.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock ExplosionData(PlasmasaberExplosion)
|
||||
{
|
||||
explosionShape = "disc_explosion.dts";
|
||||
faceViewer = true;
|
||||
explosionscale = 0.1;
|
||||
scale = 0.1;
|
||||
soundProfile = BeamExpSound;
|
||||
|
||||
playSpeed = 2;
|
||||
|
||||
sizes[0] = 0.1;
|
||||
sizes[1] = 0.1;
|
||||
times[0] = 0.0;
|
||||
times[1] = 1.0;
|
||||
};
|
||||
|
||||
datablock TracerProjectileData(PlasmasaberExpCreater)
|
||||
{
|
||||
className = "TracerProjectileData";
|
||||
Explosion = "PlasmasaberExplosion";
|
||||
dryVelocity = "0.1";
|
||||
wetVelocity = "0.1";
|
||||
fizzleTimeMS = "32";
|
||||
lifetimeMS = "32";
|
||||
explodeOnDeath = "1";
|
||||
crossSize = "0.1";
|
||||
renderCross = "0";
|
||||
isFXUnit = "1";
|
||||
};
|
||||
|
||||
datablock TargetProjectileData(PlasmasaberBeam)
|
||||
{
|
||||
directDamage = 0.0;
|
||||
hasDamageRadius = false;
|
||||
indirectDamage = 0.0;
|
||||
damageRadius = 0.0;
|
||||
velInheritFactor = 1.0;
|
||||
|
||||
maxRifleRange = 1.5;
|
||||
beamColor = "0 1 1";
|
||||
|
||||
startBeamWidth = 0.1;
|
||||
pulseBeamWidth = 0.1;
|
||||
beamFlareAngle = 3.0;
|
||||
minFlareSize = 0.0;
|
||||
maxFlareSize = 0.0;
|
||||
pulseSpeed = 0.0;
|
||||
pulseLength = 0.0;
|
||||
|
||||
textureName[0] = "special/nonlingradient";
|
||||
textureName[1] = "special/flare";
|
||||
textureName[2] = "special/pulse";
|
||||
textureName[3] = "skins/glow_Red";
|
||||
};
|
||||
|
||||
PlasmasaberBeam.maxRifleRange = 1.5;
|
||||
|
||||
datablock ItemData(Plasmasaber)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
//$$ TODO - real shape file
|
||||
shapeFile = "stackable4m.dts";
|
||||
image = PlasmasaberImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a beam sword";
|
||||
|
||||
computeCRC = true;
|
||||
emap=true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(PlasmasaberImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "turret_muzzlepoint.dts";
|
||||
offset = "0.1 0.7 0.2";
|
||||
item = Plasmasaber;
|
||||
emap = true;
|
||||
projectile = EnergyBolt;
|
||||
projectileType = EnergyProjectile;
|
||||
|
||||
MedalRequire = 1;
|
||||
|
||||
// State Data
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.2;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTimeoutValue[1] = 0.01;
|
||||
stateScript[1] = "onActivateReady";
|
||||
stateTransitionOnTimeout[1] = "Ready";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateScript[2] = "onReady";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateFire[3] = true;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 1.5;
|
||||
stateAllowImageChange[4] = false;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(PlasmasaberImage2)
|
||||
{
|
||||
shapeFile = "weapon_energy_vehicle.dts";
|
||||
offset = "0.1 0.2 0";
|
||||
rotation = "1 0 0 -10";
|
||||
};
|
||||
|
||||
function PlasmasaberImage::onMount(%data,%obj,%slot)
|
||||
{
|
||||
if(%obj.isZombie || %obj.isBoss) {
|
||||
%obj.setInventory(Plasmasaber, 0, true);
|
||||
}
|
||||
Parent::onMount(%data,%obj,%slot);
|
||||
%obj.mountImage(PlasmasaberImage2,4);
|
||||
%obj.usingPlasmasaber = 1;
|
||||
}
|
||||
|
||||
function PlasmasaberImage::onUnmount(%data,%obj,%slot)
|
||||
{
|
||||
Parent::onUnmount(%data,%obj,%slot);
|
||||
%obj.unMountImage(4);
|
||||
%obj.usingPlasmasaber = 0;
|
||||
cancel(%obj.Plasmasaberloop);
|
||||
if(isObject(%obj.beam1))
|
||||
{
|
||||
%obj.beam1.delete();
|
||||
%obj.beam1 = "";
|
||||
}
|
||||
}
|
||||
|
||||
function PlasmasaberImage::onActivateReady(%data,%obj,%slot) //small explosion
|
||||
{
|
||||
%p = new TracerProjectile()
|
||||
{
|
||||
datablock = "PlasmasaberExpCreater";
|
||||
initialPosition = %obj.getMuzzlePoint(%slot);
|
||||
initialDirection = %obj.getMuzzleVector(%slot);
|
||||
sourceObject = %obj;
|
||||
};
|
||||
}
|
||||
|
||||
function PlasmasaberImage::onReady(%data,%obj,%slot) //create beams
|
||||
{
|
||||
Plasmasaberloop(%obj);
|
||||
}
|
||||
|
||||
function PlasmasaberLoop(%obj)
|
||||
{
|
||||
if(!isObject(%obj) || %obj.getState() $= "dead") {
|
||||
return;
|
||||
}
|
||||
if(%obj.usingPlasmasaber == 0)
|
||||
{
|
||||
if(isObject(%obj.beam1))
|
||||
%obj.beam1.delete();
|
||||
return;
|
||||
}
|
||||
%vec1 = %obj.getMuzzleVector(4);
|
||||
%vec = %obj.getMuzzleVector(0);
|
||||
%vec2d = getWords(%vec,0,1) SPC "0";
|
||||
%left = vectorCross(%vec2d,"0 0 1");
|
||||
%up = vectorCross(%vec,%left);
|
||||
%up = vectorScale(%up,0.2);
|
||||
%down = vectorScale(%up,-1);
|
||||
%pos1 = %obj.getMuzzlePoint(5);
|
||||
%dir1 = vectorAdd(%vec1,%down);
|
||||
if(!isObject(%obj.beam1) && !%obj.isCloaked())
|
||||
{
|
||||
%obj.beam1 = new TargetProjectile()
|
||||
{
|
||||
datablock = "PlasmasaberBeam";
|
||||
initialPosition = %pos1;
|
||||
initialDirection = %dir1;
|
||||
sourceSlot = 4;
|
||||
sourceObject = %obj;
|
||||
};
|
||||
}
|
||||
%obj.Plasmasaberloop = schedule(25,0,Plasmasaberloop,%obj);
|
||||
}
|
||||
|
||||
function PlasmasaberImage::onFire(%data,%obj,%slot) //apply damage
|
||||
{
|
||||
%vec = %obj.getMuzzleVector(%slot);
|
||||
%pos = %obj.getMuzzlePoint(%slot);
|
||||
%vec = vectorScale(%vec,1.5);
|
||||
%end = vectorAdd(%pos,%vec);
|
||||
%mask = $TypeMasks::VehicleObjectType | $TypeMasks::PlayerObjectType | $TypeMasks::StaticShapeObjectType;
|
||||
initContainerRadiusSearch(%end,1.0,%mask);
|
||||
while((%target = containerSearchNext()) != 0) {
|
||||
if(%target == %obj) //you can never be too careful
|
||||
return;
|
||||
if(!%target.isBoss) {
|
||||
%target.damage(%obj,%target.getWorldBoxCenter(), 10.4, $DamageType::Plasmasaber);
|
||||
}
|
||||
else {
|
||||
%target.damage(%obj,%target.getWorldBoxCenter(), 0.4, $DamageType::Plasmasaber);
|
||||
}
|
||||
%p = new TracerProjectile()
|
||||
{
|
||||
datablock = "PlasmasaberExpCreater";
|
||||
initialPosition = %target.getPosition();
|
||||
initialDirection = %obj.getMuzzleVector(%slot); //who cares?
|
||||
sourceObject = %obj;
|
||||
};
|
||||
}
|
||||
//play anim
|
||||
// %obj.disableMove(true); //don't screw up the kewl animation ;)
|
||||
// %obj.schedule(500,disableMove,false);
|
||||
}
|
||||
|
||||
function Plasmasaber::onThrow(%data,%obj,%plyr)
|
||||
{
|
||||
%pos = %obj.getPosition();
|
||||
%p = new TracerProjectile()
|
||||
{
|
||||
datablock = "PlasmasaberExpCreater";
|
||||
initialPosition = %pos;
|
||||
initialDirection = "0 0 1";
|
||||
sourceObject = %obj;
|
||||
};
|
||||
}
|
||||
191
scripts/weapons/Melee/melee.cs
Normal file
191
scripts/weapons/Melee/melee.cs
Normal file
|
|
@ -0,0 +1,191 @@
|
|||
//--------------------------------------------------------------------------
|
||||
// Projectile
|
||||
//--------------------------------------
|
||||
|
||||
datablock TracerProjectileData(meleehit)
|
||||
{
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.45;
|
||||
directDamageType = $DamageType::melee;
|
||||
explosion = ChaingunExplosion;
|
||||
splash = ChaingunSplash;
|
||||
HeadMultiplier = 5.0;
|
||||
|
||||
hasDamageRadius = true;
|
||||
indirectDamage = 0.001;
|
||||
damageRadius = 0.1;
|
||||
radiusDamageType = $DamageType::melee;
|
||||
|
||||
kickBackStrength = 1500;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
ImageSource = "MeleeImage";
|
||||
|
||||
dryVelocity = 50.0; // z0dd - ZOD, 8-12-02. Was 425.0
|
||||
wetVelocity = 50.0;
|
||||
velInheritFactor = 1.0;
|
||||
fizzleTimeMS = 6;
|
||||
lifetimeMS = 60;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 0.1;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
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.01;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(MeleeImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "turret_muzzlepoint.dts";
|
||||
item = melee;
|
||||
projectile = meleehit;
|
||||
projectileType = TracerProjectile;
|
||||
|
||||
usesEnergy = true;
|
||||
fireEnergy = 20;
|
||||
minEnergy = 30;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 1.0;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = BlasterSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.5;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = NoRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateScript[3] = "onFire";
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateSound[6] = BlasterDryFireSound;
|
||||
stateTransitionOnTimeout[6] = "Ready";
|
||||
};
|
||||
|
||||
datablock ItemData(melee)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_energy.dts";
|
||||
image = meleeImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a gun butt";
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(MeleeButt)
|
||||
{
|
||||
shapeFile = "weapon_targeting.dts";
|
||||
mountPoint = 1;
|
||||
|
||||
offset = "0.0 0.8 0.55"; // L/R - F/B - T/B
|
||||
rotation = "2.0 -2.0 3.0 45"; // L/R - F/B - T/B
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(MeleeButtSwing)
|
||||
{
|
||||
shapeFile = "weapon_targeting.dts";
|
||||
mountPoint = 1;
|
||||
|
||||
offset = "0.0 1.45 -0.4"; // L/R - F/B - T/B
|
||||
rotation = "0 0 1 180"; // L/R - F/B - T/B
|
||||
};
|
||||
|
||||
function MeleeImage::onMount(%data, %obj, %node) {
|
||||
%obj.mountImage(MeleeButt, 5);
|
||||
}
|
||||
|
||||
function MeleeImage::onUnMount(%data, %obj, %node) {
|
||||
%obj.unmountImage(5);
|
||||
}
|
||||
|
||||
function MeleeImage::onFire(%data, %obj, %node) {
|
||||
%obj.unmountImage(5);
|
||||
%obj.mountImage(MeleeButtSwing, 6);
|
||||
%obj.backswing = schedule(300, 0, "swingback", %obj);
|
||||
|
||||
%p = new (TracerProjectile)() {
|
||||
dataBlock = meleehit;
|
||||
initialDirection = %obj.getMuzzleVector(%slot);
|
||||
initialPosition = %obj.getMuzzlePoint(%slot);
|
||||
sourceObject = %obj;
|
||||
sourceSlot = %slot;
|
||||
vehicleObject = %vehicle;
|
||||
};
|
||||
MissionCleanup.add(%p);
|
||||
}
|
||||
|
||||
function swingback(%obj) {
|
||||
%obj.unmountImage(6);
|
||||
%obj.mountImage(MeleeButt, 5);
|
||||
}
|
||||
|
||||
function meleehit::onCollision(%data, %projectile, %targetObject, %modifier, %position, %normal)
|
||||
{
|
||||
// extra damage for head shot or less for close range shots
|
||||
if(!(%targetObject.getType() & ($TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType)) &&
|
||||
(%targetObject.getDataBlock().getClassName() $= "PlayerData"))
|
||||
{
|
||||
%damLoc = firstWord(%targetObject.getDamageLocation(%position));
|
||||
if(%damLoc $= "head")
|
||||
{
|
||||
%targetObject.getOwnerClient().headShot = 1;
|
||||
%modifier *= %data.HeadMultiplier;
|
||||
}
|
||||
else
|
||||
{
|
||||
%modifier = 1;
|
||||
%targetObject.getOwnerClient().headShot = 0;
|
||||
}
|
||||
}
|
||||
|
||||
%targetObject.damage(%projectile.sourceObject, %position, %modifier * %data.directDamage, %data.directDamageType);
|
||||
}
|
||||
333
scripts/weapons/Mines/mine.cs
Normal file
333
scripts/weapons/Mines/mine.cs
Normal file
|
|
@ -0,0 +1,333 @@
|
|||
// ----------------------------------------------
|
||||
// mine script
|
||||
// ----------------------------------------------
|
||||
|
||||
$TeamDeployableMax[MineDeployed] = 20;
|
||||
|
||||
// ----------------------------------------------
|
||||
// force-feedback datablocks
|
||||
// ----------------------------------------------
|
||||
|
||||
|
||||
// ----------------------------------------------
|
||||
// audio datablocks
|
||||
// ----------------------------------------------
|
||||
|
||||
datablock AudioProfile(MineDeploySound)
|
||||
{
|
||||
filename = "fx/weapons/mine_deploy.wav";
|
||||
description = AudioClose3D;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(MineExplosionSound)
|
||||
{
|
||||
filename = "fx/weapons/mine_detonate.wav";
|
||||
description = AudioBIGExplosion3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(UnderwaterMineExplosionSound)
|
||||
{
|
||||
filename = "fx/weapons/mine_detonate_UW.wav";
|
||||
description = AudioBIGExplosion3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Mine Particle effects
|
||||
//--------------------------------------------------------------------------
|
||||
datablock ParticleData(MineExplosionBubbleParticle)
|
||||
{
|
||||
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] = 1.0;
|
||||
sizes[1] = 1.0;
|
||||
sizes[2] = 1.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.3;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
datablock ParticleEmitterData(MineExplosionBubbleEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 7;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 1.0;
|
||||
ejectionOffset = 2.0;
|
||||
velocityVariance = 0.5;
|
||||
thetaMin = 0;
|
||||
thetaMax = 80;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
particles = "MineExplosionBubbleParticle";
|
||||
};
|
||||
datablock ParticleData( UnderwaterMineCrescentParticle )
|
||||
{
|
||||
dragCoefficient = 2;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.2;
|
||||
constantAcceleration = -0.0;
|
||||
lifetimeMS = 600;
|
||||
lifetimeVarianceMS = 000;
|
||||
textureName = "special/crescent3";
|
||||
colors[0] = "0.5 0.5 1.0 1.0";
|
||||
colors[1] = "0.5 0.5 1.0 1.0";
|
||||
colors[2] = "0.5 0.5 1.0 0.0";
|
||||
sizes[0] = 0.5;
|
||||
sizes[1] = 1.0;
|
||||
sizes[2] = 2.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData( UnderwaterMineCrescentEmitter )
|
||||
{
|
||||
ejectionPeriodMS = 10;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 10;
|
||||
velocityVariance = 5.0;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 80;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
orientParticles = true;
|
||||
lifetimeMS = 200;
|
||||
particles = "UnderwaterMineCrescentParticle";
|
||||
};
|
||||
|
||||
datablock ParticleData(UnderwaterMineExplosionSmoke)
|
||||
{
|
||||
dragCoeffiecient = 105.0;
|
||||
gravityCoefficient = -0.0;
|
||||
inheritedVelFactor = 0.025;
|
||||
constantAcceleration = -1.0;
|
||||
|
||||
lifetimeMS = 1200;
|
||||
lifetimeVarianceMS = 00;
|
||||
|
||||
textureName = "particleTest";
|
||||
|
||||
useInvAlpha = false;
|
||||
spinRandomMin = -200.0;
|
||||
spinRandomMax = 200.0;
|
||||
|
||||
textureName = "special/Smoke/smoke_001";
|
||||
|
||||
colors[0] = "0.7 0.7 1.0 1.0";
|
||||
colors[1] = "0.3 0.3 1.0 1.0";
|
||||
colors[2] = "0.0 0.0 1.0 0.0";
|
||||
sizes[0] = 1.0;
|
||||
sizes[1] = 3.0;
|
||||
sizes[2] = 1.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(UnderwaterMineExplosionSmokeEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 8;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 4.25;
|
||||
velocityVariance = 1.25;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 80.0;
|
||||
|
||||
lifetimeMS = 250;
|
||||
|
||||
particles = "UnderwaterMineExplosionSmoke";
|
||||
};
|
||||
|
||||
datablock ExplosionData(UnderwaterMineExplosion)
|
||||
{
|
||||
explosionShape = "disc_explosion.dts";
|
||||
playSpeed = 1.0;
|
||||
sizes[0] = "0.4 0.4 0.4";
|
||||
sizes[1] = "0.4 0.4 0.4";
|
||||
soundProfile = UnderwaterMineExplosionSound;
|
||||
faceViewer = true;
|
||||
|
||||
emitter[0] = UnderwaterMineExplosionSmokeEmitter;
|
||||
emitter[1] = UnderwaterMineCrescentEmitter;
|
||||
emitter[2] = MineExplosionBubbleEmitter;
|
||||
|
||||
shakeCamera = true;
|
||||
camShakeFreq = "8.0 7.0 9.0";
|
||||
camShakeAmp = "50.0 50.0 50.0";
|
||||
camShakeDuration = 1.0;
|
||||
camShakeRadius = 10.0;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Mine Particle effects
|
||||
//--------------------------------------------------------------------------
|
||||
datablock ParticleData( MineCrescentParticle )
|
||||
{
|
||||
dragCoefficient = 2;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.2;
|
||||
constantAcceleration = -0.0;
|
||||
lifetimeMS = 600;
|
||||
lifetimeVarianceMS = 000;
|
||||
textureName = "special/crescent3";
|
||||
colors[0] = "1.0 0.8 0.2 1.0";
|
||||
colors[1] = "1.0 0.4 0.2 1.0";
|
||||
colors[2] = "1.0 0.0 0.0 0.0";
|
||||
sizes[0] = 0.5;
|
||||
sizes[1] = 1.0;
|
||||
sizes[2] = 2.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData( MineCrescentEmitter )
|
||||
{
|
||||
ejectionPeriodMS = 10;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 10;
|
||||
velocityVariance = 5.0;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 80;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
orientParticles = true;
|
||||
lifetimeMS = 200;
|
||||
particles = "MineCrescentParticle";
|
||||
};
|
||||
|
||||
datablock ParticleData(MineExplosionSmoke)
|
||||
{
|
||||
dragCoeffiecient = 105.0;
|
||||
gravityCoefficient = -0.0;
|
||||
inheritedVelFactor = 0.025;
|
||||
|
||||
lifetimeMS = 1200;
|
||||
lifetimeVarianceMS = 00;
|
||||
|
||||
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] = 1.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(MineExplosionSmokeEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 8;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 4.25;
|
||||
velocityVariance = 1.25;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 80.0;
|
||||
|
||||
lifetimeMS = 250;
|
||||
|
||||
particles = "MineExplosionSmoke";
|
||||
};
|
||||
|
||||
|
||||
|
||||
datablock ExplosionData(MineExplosion)
|
||||
{
|
||||
explosionShape = "effect_plasma_explosion.dts";
|
||||
playSpeed = 1.0;
|
||||
sizes[0] = "0.5 0.5 0.5";
|
||||
sizes[1] = "0.5 0.5 0.5";
|
||||
soundProfile = MineExplosionSound;
|
||||
faceViewer = true;
|
||||
|
||||
emitter[0] = MineExplosionSmokeEmitter;
|
||||
emitter[1] = MineCrescentEmitter;
|
||||
|
||||
shakeCamera = true;
|
||||
camShakeFreq = "8.0 7.0 9.0";
|
||||
camShakeAmp = "50.0 50.0 50.0";
|
||||
camShakeDuration = 1.0;
|
||||
camShakeRadius = 10.0;
|
||||
};
|
||||
|
||||
// ----------------------------------------------
|
||||
// Item datablocks
|
||||
// ----------------------------------------------
|
||||
|
||||
datablock ItemData(MineDeployed)
|
||||
{
|
||||
className = Weapon;
|
||||
shapeFile = "mine.dts";
|
||||
mass = 0.75;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 3;
|
||||
maxDamage = 0.2;
|
||||
explosion = MineExplosion;
|
||||
underwaterExplosion = UnderwaterMineExplosion;
|
||||
indirectDamage = 0.55;
|
||||
damageRadius = 6.0;
|
||||
radiusDamageType = $DamageType::Mine;
|
||||
kickBackStrength = 1500;
|
||||
aiAvoidThis = true;
|
||||
dynamicType = $TypeMasks::DamagableItemObjectType;
|
||||
spacing = 6.0; // how close together mines can be
|
||||
proximity = 2.5; // how close causes a detonation (by player/vehicle)
|
||||
armTime = 2200; // 2.2 seconds to arm a mine after it comes to rest
|
||||
maxDepCount = 9; // try to deploy this many times before detonating
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ItemData(Mine)
|
||||
{
|
||||
className = HandInventory;
|
||||
catagory = "Handheld";
|
||||
shapeFile = "ammo_mine.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.7;
|
||||
pickupRadius = 2;
|
||||
|
||||
thrownItem = MineDeployed;
|
||||
pickUpName = "some mines";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
365
scripts/weapons/Other/AcidCannon.cs
Normal file
365
scripts/weapons/Other/AcidCannon.cs
Normal file
|
|
@ -0,0 +1,365 @@
|
|||
// Acid Cannon
|
||||
datablock AudioProfile(AcidCannonPreFireSound) {
|
||||
filename = "fx/weapons/targetinglaser_paint.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(NerfBallExplosionSound) {
|
||||
filename = "fx/weapons/cg_water2.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
//acid bomb
|
||||
datablock ParticleData(ZAcidBombParticle) {
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = 0.5;
|
||||
inheritedVelFactor = 0.5;
|
||||
|
||||
lifetimeMS = 4000;
|
||||
lifetimeVarianceMS = 500;
|
||||
|
||||
spinRandomMin = -200.0;
|
||||
spinRandomMax = 200.0;
|
||||
|
||||
textureName = "special/bubbles";
|
||||
|
||||
colors[0] = "0.0 1.0 0.5 0.3";
|
||||
colors[1] = "0.0 1.0 0.4 0.2";
|
||||
colors[2] = "0.0 1.0 0.3 0.1";
|
||||
|
||||
sizes[0] = 3.0;
|
||||
sizes[1] = 2.3;
|
||||
sizes[2] = 2.1;
|
||||
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(ZAcidBombExplosionEmitter) {
|
||||
lifetimeMS = 2000;
|
||||
|
||||
ejectionPeriodMS = 1;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 3.0;
|
||||
velocityVariance = 0.5;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 90.0;
|
||||
|
||||
orientParticles = false;
|
||||
orientOnVelocity = false;
|
||||
|
||||
particles = "ZAcidBombParticle";
|
||||
};
|
||||
|
||||
datablock ExplosionData(ZAcidBombExplosion) {
|
||||
emitter[0] = ZAcidBombExplosionEmitter;
|
||||
soundProfile = NerfBallExplosionSound;
|
||||
};
|
||||
//
|
||||
|
||||
datablock ParticleData(ZAcidBallParticle) {
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = 0.5;
|
||||
inheritedVelFactor = 0.5;
|
||||
|
||||
lifetimeMS = 2000;
|
||||
lifetimeVarianceMS = 200;
|
||||
|
||||
spinRandomMin = -200.0;
|
||||
spinRandomMax = 200.0;
|
||||
|
||||
textureName = "special/bubbles";
|
||||
|
||||
colors[0] = "0.0 1.0 0.5 0.3";
|
||||
colors[1] = "0.0 1.0 0.4 0.2";
|
||||
colors[2] = "0.0 1.0 0.3 0.1";
|
||||
|
||||
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(ZAcidBallExplosionEmitter) {
|
||||
lifetimeMS = 200;
|
||||
|
||||
ejectionPeriodMS = 1;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 3.0;
|
||||
velocityVariance = 0.5;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 90.0;
|
||||
|
||||
orientParticles = false;
|
||||
orientOnVelocity = false;
|
||||
|
||||
particles = "ZAcidBallParticle";
|
||||
};
|
||||
|
||||
datablock ExplosionData(ZAcidBallExplosion) {
|
||||
emitter[0] = ZAcidBallExplosionEmitter;
|
||||
soundProfile = NerfBallExplosionSound;
|
||||
};
|
||||
|
||||
datablock TracerProjectileData(LZombieAcidBall) {
|
||||
doDynamicClientHits = true;
|
||||
|
||||
projectileShapeName = "";
|
||||
directDamage = 0.0;
|
||||
directDamageType = $DamageType::ZAcid;
|
||||
hasDamageRadius = true;
|
||||
indirectDamage = 0.24;
|
||||
damageRadius = 4.0;
|
||||
kickBackStrength = 0.0;
|
||||
radiusDamageType = $DamageType::ZAcid;
|
||||
sound = BlasterProjectileSound;
|
||||
explosion = ZAcidBallExplosion;
|
||||
|
||||
ImageSource = "AcidCannonImage";
|
||||
|
||||
dryVelocity = 100.0;
|
||||
wetVelocity = 100.0;
|
||||
velInheritFactor = 1.0;
|
||||
fizzleTimeMS = 4000;
|
||||
lifetimeMS = 1000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = true;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = -1;
|
||||
|
||||
activateDelayMS = 100;
|
||||
|
||||
tracerLength = 5;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 3;
|
||||
tracerColor = "0 1 0 1";
|
||||
tracerTex[0] = "special/landSpikeBolt";
|
||||
tracerTex[1] = "special/landSpikeBoltCross";
|
||||
tracerWidth = 0.5;
|
||||
crossSize = 0.79;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
datablock TracerProjectileData(EliteRapierAcidBomb) {
|
||||
doDynamicClientHits = true;
|
||||
|
||||
projectileShapeName = "";
|
||||
directDamage = 0.0;
|
||||
directDamageType = $DamageType::ZAcid;
|
||||
hasDamageRadius = true;
|
||||
indirectDamage = 0.6;
|
||||
damageRadius = 7.5;
|
||||
kickBackStrength = 0.0;
|
||||
radiusDamageType = $DamageType::ZAcid;
|
||||
sound = BlasterProjectileSound;
|
||||
explosion = ZAcidBombExplosion;
|
||||
|
||||
ImageSource = "AcidCannonImage";
|
||||
|
||||
dryVelocity = 100.0;
|
||||
wetVelocity = 100.0;
|
||||
velInheritFactor = 1.0;
|
||||
fizzleTimeMS = 4000;
|
||||
lifetimeMS = 1000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = true;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = -1;
|
||||
|
||||
activateDelayMS = 100;
|
||||
|
||||
tracerLength = 10;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
tracerColor = "0 1 0 1";
|
||||
tracerTex[0] = "special/landSpikeBolt";
|
||||
tracerTex[1] = "special/landSpikeBoltCross";
|
||||
tracerWidth = 0.8;
|
||||
crossSize = 0.79;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
|
||||
datablock TracerProjectileData(SSZombieAcidBall) {
|
||||
doDynamicClientHits = true;
|
||||
|
||||
projectileShapeName = "";
|
||||
directDamage = 0.0;
|
||||
directDamageType = $DamageType::ZAcid;
|
||||
hasDamageRadius = true;
|
||||
indirectDamage = 0.4;
|
||||
damageRadius = 7.0;
|
||||
kickBackStrength = 0.0;
|
||||
radiusDamageType = $DamageType::ZAcid;
|
||||
sound = BlasterProjectileSound;
|
||||
explosion = ZAcidBallExplosion;
|
||||
|
||||
dryVelocity = 400.0;
|
||||
wetVelocity = 400.0;
|
||||
velInheritFactor = 1.0;
|
||||
fizzleTimeMS = 4000;
|
||||
lifetimeMS = 4000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = true;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = -1;
|
||||
|
||||
activateDelayMS = 100;
|
||||
|
||||
tracerLength = 5;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 3;
|
||||
tracerColor = "0 1 0 1";
|
||||
tracerTex[0] = "special/landSpikeBolt";
|
||||
tracerTex[1] = "special/landSpikeBoltCross";
|
||||
tracerWidth = 0.5;
|
||||
crossSize = 0.79;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(AcidCannonImage) {
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_energy.dts";
|
||||
item = AcidCannon;
|
||||
projectile = LZombieAcidBall;
|
||||
projectileType = TracerProjectile;
|
||||
|
||||
HasChallenges = 0;
|
||||
//RankRequire = $TWM2::RankRequire["PulsePhaser"];
|
||||
//No rank required, this weapon is picked up from killed zombies
|
||||
|
||||
usesEnergy = true;
|
||||
fireEnergy = 4;
|
||||
minEnergy = 4;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = BlasterSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.3;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = NoRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
//stateSound[3] = PPWFireSound;
|
||||
stateScript[3] = "onFire";
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 4.2;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateTimeoutValue[6] = 0.3;
|
||||
stateSound[6] = BlasterDryFireSound;
|
||||
stateTransitionOnTimeout[6] = "Ready";
|
||||
};
|
||||
|
||||
datablock ItemData(AcidCannon) {
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_energy.dts";
|
||||
image = AcidCannonImage;
|
||||
mass = 1;
|
||||
alwaysAllowPickup = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "an Acid Cannon";
|
||||
};
|
||||
|
||||
function AcidCannonImage::onMount(%this, %obj, %slot) {
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
}
|
||||
|
||||
function AcidCannonImage::onUnmount(%this,%obj,%slot) {
|
||||
Parent::onUnmount(%this, %obj, %slot);
|
||||
}
|
||||
|
||||
function AcidCannonImage::onFire(%data,%obj,%slot) {
|
||||
AcidCannonAttack(%obj, %slot, 0);
|
||||
}
|
||||
|
||||
function AcidCannonAttack(%object, %slot, %chargecount) {
|
||||
%muzzleVec = %object.getMuzzleVector(%slot);
|
||||
%muzzlePt = %object.getMuzzlePoint(%slot);
|
||||
if(%chargecount <= 5) {
|
||||
if(%chargecount == 1) {
|
||||
serverPlay3D(AcidCannonPreFireSound, %muzzlePt);
|
||||
}
|
||||
%charge = new ParticleEmissionDummy() {
|
||||
position = %muzzlePt;
|
||||
dataBlock = "defaultEmissionDummy";
|
||||
emitter = "BurnEmitter";
|
||||
};
|
||||
MissionCleanup.add(%charge);
|
||||
%charge.schedule(100, "delete");
|
||||
}
|
||||
if(%chargecount == 7) {
|
||||
%p = new TracerProjectile() {
|
||||
dataBlock = LZombieAcidBall;
|
||||
initialDirection = %muzzleVec;
|
||||
initialPosition = %muzzlePt;
|
||||
sourceObject = %object;
|
||||
sourceSlot = 0;
|
||||
};
|
||||
MissionCleanup.add(%p);
|
||||
serverPlay3D(CentaurArtilleryFireSound, %muzzlePt);
|
||||
}
|
||||
if(%chargecount == 9) {
|
||||
%p = new TracerProjectile() {
|
||||
dataBlock = LZombieAcidBall;
|
||||
initialDirection = %muzzleVec;
|
||||
initialPosition = %muzzlePt;
|
||||
sourceObject = %object;
|
||||
sourceSlot = 0;
|
||||
};
|
||||
MissionCleanup.add(%p);
|
||||
serverPlay3D(CentaurArtilleryFireSound, %muzzlePt);
|
||||
}
|
||||
//
|
||||
if(%chargecount <= 9) {
|
||||
%chargecount++;
|
||||
schedule(100, 0, "AcidCannonAttack", %object, %slot, %chargecount);
|
||||
}
|
||||
}
|
||||
202
scripts/weapons/Other/ConcussionGun.cs
Normal file
202
scripts/weapons/Other/ConcussionGun.cs
Normal file
|
|
@ -0,0 +1,202 @@
|
|||
//IDEA By Signal360
|
||||
datablock ParticleData(ConcGunSmokeParticle) {
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = -0.2; // rises slowly
|
||||
inheritedVelFactor = 0.00;
|
||||
|
||||
lifetimeMS = 700; // lasts 2 second
|
||||
lifetimeVarianceMS = 150; // ...more or less
|
||||
|
||||
textureName = "special/Lightning2Frame2";
|
||||
|
||||
useInvAlpha = false;
|
||||
spinRandomMin = -30.0;
|
||||
spinRandomMax = 30.0;
|
||||
|
||||
colors[0] = "0 0 1 1.0";
|
||||
colors[1] = "0 1 1 1.0";
|
||||
colors[2] = "0 1 1 0.0";
|
||||
|
||||
sizes[0] = 0.25;
|
||||
sizes[1] = 1.0;
|
||||
sizes[2] = 3.0;
|
||||
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.2;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(ConcGunSmokeEmitter) {
|
||||
ejectionPeriodMS = 15;
|
||||
periodVarianceMS = 5;
|
||||
|
||||
ejectionVelocity = 1.25;
|
||||
velocityVariance = 0.50;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 90.0;
|
||||
|
||||
particles = "ConcGunSmokeParticle";
|
||||
};
|
||||
|
||||
datablock GrenadeProjectileData(ConcGunGrenade) {
|
||||
projectileShapeName = "grenade_projectile.dts";
|
||||
emitterDelay = -1;
|
||||
directDamage = 0.0;
|
||||
hasDamageRadius = true;
|
||||
indirectDamage = 0.1;
|
||||
damageRadius = 10.0;
|
||||
radiusDamageType = $DamageType::Grenade;
|
||||
kickBackStrength = 1500;
|
||||
bubbleEmitTime = 1.0;
|
||||
|
||||
ImageSource = "ConcussionGunImage";
|
||||
|
||||
sound = GrenadeProjectileSound;
|
||||
explosion = "ConcussionGrenadeExplosion";
|
||||
underwaterExplosion = "ConcussionGrenadeExplosion";
|
||||
velInheritFactor = 0.5;
|
||||
splash = GrenadeSplash;
|
||||
|
||||
baseEmitter = ConcGunSmokeEmitter;
|
||||
bubbleEmitter = ConcGunSmokeEmitter;
|
||||
|
||||
grenadeElasticity = 0.35;
|
||||
grenadeFriction = 0.2;
|
||||
armingDelayMS = 1000;
|
||||
muzzleVelocity = 47.00;
|
||||
drag = 0.1;
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Ammo
|
||||
//--------------------------------------
|
||||
|
||||
datablock ItemData(ConcussionGunAmmo) {
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_grenade.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some grenade launcher ammo";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ItemData(ConcussionGun) {
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_mortar.dts";
|
||||
image = ConcussionGunImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a concussion gun";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(ConcussionGunImage) {
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_mortar.dts";
|
||||
item = ConcussionGun;
|
||||
ammo = ConcussionGunAmmo;
|
||||
offset = "0 0 0";
|
||||
emap = true;
|
||||
|
||||
projectile = ConcGunGrenade;
|
||||
projectileType = GrenadeProjectile;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "ConcussionGunClip";
|
||||
ClipPickupName["ConcussionGunClip"] = "some Concussion Shells";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 8;
|
||||
ClipReturn = 1;
|
||||
InitialClips = 4;
|
||||
|
||||
GunName = "Concussion Gun";
|
||||
//
|
||||
RankRequire = $TWM2::RankRequire["ConcussionGun"];
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = MortarSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.4;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateScript[3] = "onFire";
|
||||
stateSound[3] = MortarFireSound;
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 0.5;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
stateSound[4] = GrenadeReloadSound;
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = GrenadeDryFireSound;
|
||||
stateTimeoutValue[6] = 1.5;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
};
|
||||
|
||||
function ConcGunGrenade::onExplode(%data, %proj, %pos, %mod) {
|
||||
Parent::OnExplode(%data, %proj, %pos, %mod);
|
||||
%TargetSearchMask = $TypeMasks::PlayerObjectType;
|
||||
InitContainerRadiusSearch(%pos, %data.damageRadius, %TargetSearchMask);
|
||||
while ((%potentialTarget = ContainerSearchNext()) != 0) {
|
||||
if(%potentialTarget.isAlive()) {
|
||||
if(((%potentialTarget.client.team == %proj.sourceObject.client.team) && $TeamDamage) || %potentialTarget.client.team != %proj.sourceObject.client.team) {
|
||||
%potentialTarget.throwWeapon(1);
|
||||
%potentialTarget.throwWeapon(0);
|
||||
%potentialTarget.setWhiteout(4.0);
|
||||
%potentialTarget.setMoveState(true);
|
||||
%potentialTarget.schedule(4000, "SetMoveState", false);
|
||||
%potentialTarget.setActionThread("death4",true);
|
||||
ZappyLoop(%potentialTarget, 0, 7);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function ZappyLoop(%potentialTarget, %time, %maxTime) {
|
||||
if(%time > %maxTime) {
|
||||
return;
|
||||
}
|
||||
if(%potentialTarget.isAlive()) {
|
||||
%time++;
|
||||
%potentialTarget.zapObject();
|
||||
schedule(750, 0, "ZappyLoop", %potentialTarget, %time, %maxTime);
|
||||
}
|
||||
}
|
||||
247
scripts/weapons/Other/Flamethrower.cs
Normal file
247
scripts/weapons/Other/Flamethrower.cs
Normal file
|
|
@ -0,0 +1,247 @@
|
|||
datablock AudioProfile(FlamethrowerFireSound) {
|
||||
filename = "fx/Bonuses/Nouns/snake.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
//Muzzle Emmiter
|
||||
datablock ParticleData(ThrowerMuzzleParticle) {
|
||||
dragCoeffiecient = 0.4;
|
||||
gravityCoefficient = -0.0; // rises slowly
|
||||
inheritedVelFactor = 0.125;
|
||||
|
||||
lifetimeMS = 800;
|
||||
lifetimeVarianceMS = 500;
|
||||
useInvAlpha = false;
|
||||
spinRandomMin = 500.0;
|
||||
spinRandomMax = 700.0;
|
||||
|
||||
textureName = "special/cloudFlash";
|
||||
|
||||
|
||||
colors[0] = "1.0 0.2 0.0 0.5";
|
||||
colors[1] = "1.0 0.2 0.0 0.8";
|
||||
colors[2] = "1.0 0.2 0.0 0.0";
|
||||
colors[3] = "1.0 0.2 0.0 0.0";
|
||||
|
||||
sizes[0] = 0.2;
|
||||
sizes[1] = 0.3;
|
||||
sizes[2] = 0.5;
|
||||
sizes[3] = 0.6;
|
||||
|
||||
times[0] = 0.2; //.2
|
||||
times[1] = 0.5; //.5
|
||||
times[2] = 0.7; //.7
|
||||
times[3] = 1.0; //1.0
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(ThrowerMuzzleEmitter) {
|
||||
ejectionPeriodMS = 3;
|
||||
periodVarianceMS = 1;
|
||||
|
||||
ejectionVelocity = 0.0;
|
||||
velocityVariance = 0.0;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 45.0;
|
||||
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
|
||||
particles = "ThrowerMuzzleParticle";
|
||||
};
|
||||
//
|
||||
|
||||
datablock ParticleData(ThrowerExplosionParticle) {
|
||||
dragCoefficient = 2;
|
||||
gravityCoefficient = 0.2;
|
||||
inheritedVelFactor = 0.2;
|
||||
constantAcceleration = 0.0;
|
||||
lifetimeMS = 500;
|
||||
lifetimeVarianceMS = 0;
|
||||
textureName = "special/cloudflash";
|
||||
colors[0] = "1 0.18 0.03 0.6";
|
||||
colors[1] = "1 0.18 0.03 0.0";
|
||||
sizes[0] = 2;
|
||||
sizes[1] = 2.5;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(ThrowerExplosionEmitter) {
|
||||
ejectionPeriodMS = 1;
|
||||
periodVarianceMS = 0;
|
||||
ejectionOffset = 2.0;
|
||||
ejectionVelocity = 4.0;
|
||||
velocityVariance = 0.0;
|
||||
thetaMin = 60.0;
|
||||
thetaMax = 90.0;
|
||||
lifetimeMS = 250;
|
||||
|
||||
particles = "ThrowerExplosionParticle";
|
||||
};
|
||||
|
||||
datablock ExplosionData(ThrowerExplosion) {
|
||||
particleEmitter = ThrowerExplosionEmitter;
|
||||
particleDensity = 75;
|
||||
particleRadius = 1.25;
|
||||
faceViewer = true;
|
||||
};
|
||||
|
||||
datablock LinearFlareProjectileData(FlamethrowerBolt) {
|
||||
projectileShapeName = "turret_muzzlepoint.dts";
|
||||
scale = "1.0 1.0 1.0";
|
||||
faceViewer = true;
|
||||
directDamage = 0.02;
|
||||
hasDamageRadius = true;
|
||||
indirectDamage = 0.02;
|
||||
damageRadius = 4.0;
|
||||
kickBackStrength = 0.0;
|
||||
radiusDamageType = $DamageType::Fire;
|
||||
|
||||
ImageSource = "flamerImage";
|
||||
|
||||
explosion = "ThrowerExplosion";
|
||||
splash = PlasmaSplash;
|
||||
|
||||
baseEmitter = ThrowerBaseEmitter;
|
||||
|
||||
dryVelocity = 50.0; // z0dd - ZOD, 7/20/02. Faster plasma projectile. was 55
|
||||
wetVelocity = -1;
|
||||
velInheritFactor = 0.3;
|
||||
fizzleTimeMS = 250;
|
||||
lifetimeMS = 745;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = true;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = -1;
|
||||
|
||||
//activateDelayMS = 100;
|
||||
activateDelayMS = -1;
|
||||
|
||||
size[0] = 0.2;
|
||||
size[1] = 0.5;
|
||||
size[2] = 0.1;
|
||||
|
||||
|
||||
numFlares = 35;
|
||||
flareColor = "1 0.18 0.03";
|
||||
flareModTexture = "flaremod";
|
||||
flareBaseTexture = "flarebase";
|
||||
|
||||
sound = PlasmaProjectileSound;
|
||||
fireSound = FlamethrowerFireSound;
|
||||
wetFireSound = PlasmaFireWetSound;
|
||||
|
||||
hasLight = true;
|
||||
lightRadius = 10.0;
|
||||
lightColor = "0.94 0.03 0.12";
|
||||
};
|
||||
|
||||
//THE GUN
|
||||
datablock ItemData(flamerAmmo) {
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_plasma.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some flame thrower fuel";
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ItemData(flamer) {
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_plasma.dts";
|
||||
image = flamerImage;
|
||||
mass = 1.0;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a flame thrower";
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(flamerImage) {
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_grenade_launcher.dts";
|
||||
mass = 10;
|
||||
item = flamer;
|
||||
ammo = flamerAmmo;
|
||||
offset = "0 0 0"; // L/R - F/B - T/B
|
||||
rotation = "0 1 0 180"; // L/R - F/B - T/B
|
||||
|
||||
projectileSpread = 5.0 / 1000.0;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "FlamerClip";
|
||||
ClipPickupName["FlamerClip"] = "some flamethrower fuel canisters";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 5;
|
||||
ClipReturn = 100;
|
||||
InitialClips = 6;
|
||||
|
||||
GunName = "A|V|X Flamethrower";
|
||||
//
|
||||
MedalRequire = 1;
|
||||
|
||||
projectile = FlamethrowerBolt;
|
||||
projectileType = LinearFlareProjectile;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = PlasmaSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateEmitter[2] = "ThrowerMuzzleEmitter";
|
||||
stateEmitterNode[2] = "muzzlepoint1";
|
||||
stateEmitterTime[2] = 10000;
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.02;
|
||||
stateFire[3] = true;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
stateSound[3] = FlamethrowerFireSound;
|
||||
stateEmitterTime[3] = 0.02;
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 0.02;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
stateSound[4] = PlasmaReloadSound;
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = PlasmaDryFireSound;
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
stateName[7] = "WetFire";
|
||||
stateSound[7] = PlasmaFireWetSound;
|
||||
stateTimeoutValue[7] = 1.0;
|
||||
stateTransitionOnTimeout[7] = "Ready";
|
||||
|
||||
stateName[8] = "CheckWet";
|
||||
stateTransitionOnWet[8] = "WetFire";
|
||||
stateTransitionOnNotWet[8] = "Fire";
|
||||
};
|
||||
|
||||
146
scripts/weapons/Other/IonLauncher.cs
Normal file
146
scripts/weapons/Other/IonLauncher.cs
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
datablock ItemData(IonLauncherAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_missile.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "Some Ion Launcher Missiles";
|
||||
|
||||
computeCRC = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ItemData(IonLauncher)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_grenade_launcher.dts";
|
||||
image = IonLauncherImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "an Ion Launcher";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(IonLauncherImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_grenade_launcher.dts";
|
||||
item = IonLauncher;
|
||||
ammo = IonLauncherAmmo;
|
||||
offset = "0 -1 0";
|
||||
armThread = lookms;
|
||||
emap = true;
|
||||
|
||||
projectile = IonMissile;
|
||||
projectileType = seekerprojectile;
|
||||
projectileSpread = 1.0 / 1000.0;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "IonLauncherClip";
|
||||
ClipPickupName["IonLauncherClip"] = "A Few Ion Missile boxes";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 6;
|
||||
ClipReturn = 2;
|
||||
InitialClips = 7;
|
||||
|
||||
GunName = "LUX-4 Ion Launcher";
|
||||
//
|
||||
|
||||
MedalRequire = 1;
|
||||
|
||||
isSeeker = true;
|
||||
seekRadius = 1000;
|
||||
maxSeekAngle = 8;
|
||||
seekTime = 0.5;
|
||||
minSeekHeat = 0.1; // the heat that must be present on a target to lock it.
|
||||
|
||||
// only target objects outside this range
|
||||
minTargetingDistance = 40;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 2.0;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = MissileSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.4;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateScript[3] = "onFire";
|
||||
stateSound[3] = MissileFireSound;
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 4.5;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
stateSound[4] = MissileReloadSound;
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = MissileDryFireSound;
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateTransitionOnTimeout[6] = "ActivateReady";
|
||||
|
||||
stateName[7] = "CheckTarget";
|
||||
stateTransitionOnNoTarget[7] = "Fire";
|
||||
stateTransitionOnTarget[7] = "Fire";
|
||||
|
||||
stateName[8] = "CheckWet";
|
||||
stateTransitionOnWet[8] = "DryFire";
|
||||
stateTransitionOnNotWet[8] = "CheckTarget";
|
||||
|
||||
stateName[9] = "WetFire";
|
||||
stateTransitionOnNoAmmo[9] = "NoAmmo";
|
||||
stateTransitionOnTimeout[9] = "Reload";
|
||||
stateTimeoutValue[9] = 0.4;
|
||||
stateScript[9] = "onWetFire";
|
||||
stateAllowImageChange[9] = false;
|
||||
};
|
||||
|
||||
function IonLauncherImage::onFire(%data,%obj,%slot) {
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
MissileSet.add(%p);
|
||||
|
||||
%target = %obj.getLockedTarget();
|
||||
if(%target)
|
||||
%p.setObjectTarget(%target);
|
||||
else if(%obj.isLocked())
|
||||
%p.setPositionTarget(%obj.getLockedPosition());
|
||||
else
|
||||
%p.setNoTarget();
|
||||
}
|
||||
|
||||
function IonLauncherImage::onWetFire(%data, %obj, %slot) {
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
MissileSet.add(%p);
|
||||
|
||||
%p.setObjectTarget(0);
|
||||
}
|
||||
96
scripts/weapons/Other/IonRifle.cs
Normal file
96
scripts/weapons/Other/IonRifle.cs
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
datablock ItemData(IonRifle) {
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
image = IonRifleImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a sniper rifle";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(IonRifleImage) {
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
item = IonRifle;
|
||||
projectile = ShockBeam;
|
||||
projectileType = SniperProjectile;
|
||||
armThread = looksn;
|
||||
|
||||
MedalRequire = 1;
|
||||
|
||||
usesEnergy = true;
|
||||
minEnergy = 6;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateSound[0] = SniperRifleSwitchSound;
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.5;
|
||||
stateFire[3] = true;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateScript[3] = "onFire";
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 0.5;
|
||||
stateAllowImageChange[4] = false;
|
||||
|
||||
stateName[5] = "CheckWet";
|
||||
stateTransitionOnWet[5] = "DryFire";
|
||||
stateTransitionOnNotWet[5] = "Fire";
|
||||
|
||||
stateName[6] = "NoAmmo";
|
||||
stateTransitionOnAmmo[6] = "Reload";
|
||||
stateTransitionOnTriggerDown[6] = "DryFire";
|
||||
stateSequence[6] = "NoAmmo";
|
||||
|
||||
stateName[7] = "DryFire";
|
||||
stateSound[7] = SniperRifleDryFireSound;
|
||||
stateTimeoutValue[7] = 0.5;
|
||||
stateTransitionOnTimeout[7] = "Ready";
|
||||
};
|
||||
|
||||
function IonRifleImage::OnFire(%data, %obj, %slot) {
|
||||
ServerPlay3D(thunderCrash2, %obj.getPosition());
|
||||
%pos = %obj.getMuzzlePoint(%slot);
|
||||
%vec = %obj.getMuzzleVector(%slot);
|
||||
%res = containerRayCast(%pos,vectorAdd(%pos,vectorScale(%vec,2000)), $TypeMasks::PlayerObjectType | $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::StaticObjectType,%obj);
|
||||
%HObj = getWord(%res, 0);
|
||||
if(%HObj !$= "" && %HObj != 0) {
|
||||
if(!(%HObj.getType() & ($TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType))) {
|
||||
%cn = %HObj.getDatablock().getClassName();
|
||||
if(%cn $= "PlayerData" || strstr(%cn, "Vehicle") != -1) {
|
||||
%HObj.getDataBlock().damageObject(%HObj, %obj, %HObj.getPosition(), 0.45, $DamageType::Lightning);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (%res)
|
||||
%hitLoc = getWords(%res,1,3);
|
||||
else
|
||||
%hitLoc = vectorAdd(%pos,vectorScale(%vec,2000));
|
||||
%p = discharge(%pos,%vec);
|
||||
%p.setEnergyPercentage(1);
|
||||
createLifeLight(%hitLoc,1,1000);
|
||||
addToShock(%p);
|
||||
%p.schedule(1000,"delete");
|
||||
zap(0,25,%hitLoc);
|
||||
ServerPlay3D(thunderCrash2, %hitLoc);
|
||||
}
|
||||
111
scripts/weapons/Other/MiniCollider.cs
Normal file
111
scripts/weapons/Other/MiniCollider.cs
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
datablock ShapeBaseImageData(MiniColliderCannonImage) {
|
||||
className = WeaponImage;
|
||||
shapeFile = "turret_mortar_large.dts";
|
||||
item = MiniColliderCannon;
|
||||
usesenergy = true;
|
||||
|
||||
projectile = MiniColliderShell;
|
||||
projectileType = GrenadeProjectile;
|
||||
|
||||
emap = true;
|
||||
|
||||
MedalRequire = 1;
|
||||
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 8;
|
||||
Challenge[1] = "Collider Hunter\t100\t100\tNone";
|
||||
Challenge[2] = "Collider Expert\t250\t500\tNone";
|
||||
Challenge[3] = "Collider Master\t500\t1000\tDouble Burst";
|
||||
Challenge[4] = "Collider God\t1000\t2000\tTriple Burst";
|
||||
Challenge[5] = "Collider Bronze Commendation\t2500\t10000\tNone";
|
||||
Challenge[6] = "Collider Silver Commendation\t5000\t25000\tNone";
|
||||
Challenge[7] = "Collider Gold Commendation\t10000\t50000\tNone";
|
||||
Challenge[8] = "Collider Titan Commendation\t25000\t75000\tNone";
|
||||
Upgrade[1] = "Double Burst";
|
||||
Upgrade[2] = "Triple Burst";
|
||||
GunName = "PRTCL-995 MCC";
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = MortarReloadSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 4.6;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateSound[3] = CentaurArtilleryFireSound;
|
||||
stateScript[3] = "onFire";
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateSound[4] = MortarSwitchSound;
|
||||
stateEjectShell[4] = true;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateTimeoutValue[6] = 0.3;
|
||||
stateSound[6] = ChaingunDryFireSound;
|
||||
stateTransitionOnTimeout[6] = "Ready";
|
||||
};
|
||||
|
||||
//item//
|
||||
datablock ItemData(MiniColliderCannon) {
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "turret_mortar_large.dts";
|
||||
image = MiniColliderCannonImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a PRTCL-995 Mini Collider Cannon";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function MiniColliderCannonImage::onFire(%data, %obj, %slot) {
|
||||
%vector = %obj.getMuzzleVector(%slot);
|
||||
%mp = %obj.getMuzzlePoint(%slot);
|
||||
if(%obj.client.UpgradeOn("Double Burst", %data.getName())) {
|
||||
%p1 = Parent::OnFire(%data, %obj, %slot);
|
||||
%p2 = Schedule(100, 0, "spawnprojectile", %data.Projectile, %data.ProjectileType,
|
||||
%obj.getMuzzlePoint(%slot), %vector, %obj);
|
||||
%p2.WeaponImageSource = "MiniColliderCannonImage";
|
||||
schedule(100, 0, "ServerPlay3D", "CentaurArtilleryFireSound", %obj.getPosition());
|
||||
}
|
||||
else if(%obj.client.UpgradeOn("Triple Burst", %data.getName())) {
|
||||
%p1 = Parent::OnFire(%data, %obj, %slot);
|
||||
%p2 = Schedule(100, 0, "spawnprojectile", %data.Projectile, %data.ProjectileType,
|
||||
%obj.getMuzzlePoint(%slot), %vector, %obj);
|
||||
%p2.WeaponImageSource = "MiniColliderCannonImage";
|
||||
schedule(100, 0, "ServerPlay3D", "CentaurArtilleryFireSound", %obj.getPosition());
|
||||
%p3 = Schedule(200, 0, "spawnprojectile", %data.Projectile, %data.ProjectileType,
|
||||
%obj.getMuzzlePoint(%slot), %vector, %obj);
|
||||
%p3.WeaponImageSource = "MiniColliderCannonImage";
|
||||
schedule(100, 0, "ServerPlay3D", "CentaurArtilleryFireSound", %obj.getPosition());
|
||||
}
|
||||
else {
|
||||
%p = Parent::OnFire(%data, %obj, %slot);
|
||||
}
|
||||
}
|
||||
117
scripts/weapons/Other/NapalmLauncher.cs
Normal file
117
scripts/weapons/Other/NapalmLauncher.cs
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
datablock ItemData(NapalmAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_grenade.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some Napalm";
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
|
||||
datablock ShapeBaseImageData(NapalmImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "ammo_grenade.dts";
|
||||
item = Napalm;
|
||||
ammo = NapalmAmmo;
|
||||
offset = "0 0 0";
|
||||
armThread = lookms;
|
||||
emap = true;
|
||||
|
||||
projectileSpread = 0;
|
||||
|
||||
projectile = NapalmShot;
|
||||
projectileType = LinearProjectile;
|
||||
|
||||
RankRequire = $TWM2::RankRequire["NapalmLauncher"];
|
||||
MedalRequire = 1;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "NapalmClip";
|
||||
ClipPickupName["NapalmClip"] = "some napalm fuel clusters";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 5;
|
||||
ClipReturn = 1;
|
||||
InitialClips = 6;
|
||||
|
||||
//Challenges
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 9;
|
||||
Challenge[1] = "Napalm Novice\t25\t100\tNone";
|
||||
Challenge[2] = "Napalm Hunter\t50\t150\tNone";
|
||||
Challenge[3] = "Napalm Expert\t100\t250\tNone";
|
||||
Challenge[4] = "Napalm Master\t250\t500\tNone";
|
||||
Challenge[5] = "Napalm God\t500\t1000\tNone";
|
||||
Challenge[6] = "Napalm Bronze Commendation\t2500\t10000\tNone";
|
||||
Challenge[7] = "Napalm Silver Commendation\t5000\t25000\tNone";
|
||||
Challenge[8] = "Napalm Gold Commendation\t10000\t50000\tNone";
|
||||
Challenge[9] = "Napalm Titan Commendation\t25000\t75000\tNone";
|
||||
GunName = "ZH7C8 Napalm Launcher";
|
||||
//
|
||||
|
||||
// State Data
|
||||
stateName[0] = "ActivateReady";
|
||||
stateTransitionOnLoaded[0] = "Activate";
|
||||
stateTransitionOnNoAmmo[0] = "NoAmmo";
|
||||
|
||||
stateName[1] = "Activate";
|
||||
stateTransitionOnTimeout[1] = "Ready";
|
||||
stateTimeoutValue[1] = 0.5;
|
||||
stateSequence[1] = "Activated";
|
||||
stateSound[1] = PlasmaSwitchSound;
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
stateSequence[2] = "DiscSpin";
|
||||
// stateSound[2] = DiscLoopSound;
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.3;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateScript[3] = "onFire";
|
||||
stateSound[3] = MortarFireSound;
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 2.2; // 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] = GrenadeDryFireSound;
|
||||
stateTimeoutValue[6] = 0.3;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
};
|
||||
|
||||
datablock ItemData(Napalm)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "ammo_grenade.dts";
|
||||
image = NapalmImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a Napalm Gun";
|
||||
emap = true;
|
||||
};
|
||||
126
scripts/weapons/Other/PlasmaTorpedo.cs
Normal file
126
scripts/weapons/Other/PlasmaTorpedo.cs
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
datablock TracerProjectileData(PlasmaTorpedoProjectile) {
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.0;
|
||||
hasDamageRadius = true;
|
||||
indirectDamage = 1.5;
|
||||
damageRadius = 25.0;
|
||||
kickBackStrength = 4000;
|
||||
radiusDamageType = $DamageType::PTorpdeo; //obviously change this
|
||||
|
||||
ImageSource = "PlasmaTorpedoImage";
|
||||
|
||||
explosion = "SatchelMainExplosion";
|
||||
splash = ChaingunSplash;
|
||||
|
||||
sound = ShrikeBlasterProjectileSound;
|
||||
|
||||
dryVelocity = 425.0;
|
||||
wetVelocity = 100.0;
|
||||
velInheritFactor = 1.0;
|
||||
fizzleTimeMS = 1000;
|
||||
lifetimeMS = 1000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 45.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
tracerColor = "1.0 0.0 0.0 0.0";
|
||||
tracerTex[0] = "special/shrikeBolt";
|
||||
tracerTex[1] = "special/shrikeBoltCross";
|
||||
tracerWidth = 0.55;
|
||||
crossSize = 0.99;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(PlasmaTorpedoImage) {
|
||||
className = WeaponImage;
|
||||
shapeFile = "turret_fusion_large.dts";
|
||||
item = PlasmaTorpedo;
|
||||
usesenergy = true;
|
||||
|
||||
projectile = PlasmaTorpedoProjectile;
|
||||
projectileType = TracerProjectile;
|
||||
|
||||
emap = true;
|
||||
|
||||
RankRequire = $TWM2::RankRequire["SCD343"];
|
||||
PrestigeRequire = 4;
|
||||
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 8;
|
||||
Challenge[1] = "PTC Hunter\t100\t100\tNone";
|
||||
Challenge[2] = "PTC Expert\t250\t500\tNone";
|
||||
Challenge[3] = "PTC Master\t500\t1000\tNone";
|
||||
Challenge[4] = "PTC God\t1000\t2000\tNone";
|
||||
Challenge[5] = "PTC Bronze Commendation\t2500\t10000\tNone";
|
||||
Challenge[6] = "PTC Silver Commendation\t5000\t25000\tNone";
|
||||
Challenge[7] = "PTC Gold Commendation\t10000\t50000\tNone";
|
||||
Challenge[8] = "PTC Titan Commendation\t25000\t75000\tNone";
|
||||
GunName = "Plasma Torpedo Cannon";
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = MortarReloadSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 7.6;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateSound[3] = CentaurArtilleryFireSound;
|
||||
stateScript[3] = "onFire";
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateSound[4] = MortarSwitchSound;
|
||||
stateEjectShell[4] = true;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateTimeoutValue[6] = 0.3;
|
||||
stateSound[6] = ChaingunDryFireSound;
|
||||
stateTransitionOnTimeout[6] = "Ready";
|
||||
};
|
||||
|
||||
//item//
|
||||
datablock ItemData(PlasmaTorpedo) {
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "turret_mortar_large.dts";
|
||||
image = PlasmaTorpedoImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a Plasma Torpedo Cannon";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
210
scripts/weapons/Other/ShadowRifle.cs
Normal file
210
scripts/weapons/Other/ShadowRifle.cs
Normal file
|
|
@ -0,0 +1,210 @@
|
|||
datablock ParticleData(NMMissileBaseParticle) {
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = -0.2;
|
||||
inheritedVelFactor = 0.0;
|
||||
|
||||
lifetimeMS = 800;
|
||||
lifetimeVarianceMS = 500;
|
||||
|
||||
useInvAlpha = false;
|
||||
spinRandomMin = -160.0;
|
||||
spinRandomMax = 160.0;
|
||||
|
||||
animateTexture = true;
|
||||
framesPerSec = 15;
|
||||
|
||||
textureName = "special/cloudflash";
|
||||
|
||||
colors[0] = "0.5 0.1 0.9 1.0";
|
||||
colors[1] = "0.5 0.1 0.9 1.0";
|
||||
colors[2] = "0.5 0.1 0.9 1.0";
|
||||
|
||||
sizes[0] = 2.5;
|
||||
sizes[1] = 2.7;
|
||||
sizes[2] = 3.0;
|
||||
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.7;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(NMMissileBaseEmitter) {
|
||||
ejectionPeriodMS = 10;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 1.5;
|
||||
velocityVariance = 0.3;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 30.0;
|
||||
|
||||
particles = "NMMissileBaseParticle";
|
||||
};
|
||||
|
||||
datablock LinearFlareProjectileData(ShadowRifleBolt) {
|
||||
projectileShapeName = "turret_muzzlepoint.dts";
|
||||
scale = "1.0 1.0 1.0";
|
||||
faceViewer = true;
|
||||
directDamage = 0.02;
|
||||
hasDamageRadius = true;
|
||||
indirectDamage = 0.1;
|
||||
damageRadius = 4.0;
|
||||
kickBackStrength = 0.0;
|
||||
radiusDamageType = $DamageType::Shadow;
|
||||
|
||||
explosion = "BlasterExplosion";
|
||||
splash = PlasmaSplash;
|
||||
|
||||
baseEmitter = NMMissileBaseEmitter;
|
||||
|
||||
ImageSource = "ShadowRifleImage";
|
||||
|
||||
dryVelocity = 120.0; // z0dd - ZOD, 7/20/02. Faster plasma projectile. was 55
|
||||
wetVelocity = -1;
|
||||
velInheritFactor = 0.3;
|
||||
fizzleTimeMS = 250;
|
||||
lifetimeMS = 8000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = true;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = -1;
|
||||
|
||||
//activateDelayMS = 100;
|
||||
activateDelayMS = -1;
|
||||
|
||||
size[0] = 0.2;
|
||||
size[1] = 0.5;
|
||||
size[2] = 0.1;
|
||||
|
||||
|
||||
numFlares = 35;
|
||||
flareColor = "1 0.18 0.03";
|
||||
flareModTexture = "flaremod";
|
||||
flareBaseTexture = "flarebase";
|
||||
|
||||
sound = PlasmaProjectileSound;
|
||||
fireSound = FlamethrowerFireSound;
|
||||
wetFireSound = PlasmaFireWetSound;
|
||||
|
||||
hasLight = true;
|
||||
lightRadius = 10.0;
|
||||
lightColor = "0.94 0.03 0.12";
|
||||
};
|
||||
|
||||
datablock ItemData(ShadowRifle) {
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
image = ShadowRifleImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a shadow rifle";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(ShadowRifleImage) {
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
item = ShadowRifle;
|
||||
projectile = ShadowRifleBolt;
|
||||
projectileType = LinearFlareProjectile;
|
||||
|
||||
MedalRequire = 1;
|
||||
|
||||
usesEnergy = true;
|
||||
minEnergy = 6;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateSound[0] = SniperRifleSwitchSound;
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.5;
|
||||
stateFire[3] = true;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateScript[3] = "onFire";
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 2.5;
|
||||
stateAllowImageChange[4] = false;
|
||||
|
||||
stateName[5] = "CheckWet";
|
||||
stateTransitionOnWet[5] = "DryFire";
|
||||
stateTransitionOnNotWet[5] = "Fire";
|
||||
|
||||
stateName[6] = "NoAmmo";
|
||||
stateTransitionOnAmmo[6] = "Reload";
|
||||
stateTransitionOnTriggerDown[6] = "DryFire";
|
||||
stateSequence[6] = "NoAmmo";
|
||||
|
||||
stateName[7] = "DryFire";
|
||||
stateSound[7] = SniperRifleDryFireSound;
|
||||
stateTimeoutValue[7] = 0.5;
|
||||
stateTransitionOnTimeout[7] = "Ready";
|
||||
};
|
||||
|
||||
function ShadowRifleBolt::onCollision(%data,%projectile,%targetObject,%modifier,%position,%normal) {
|
||||
Parent::OnCollision(%data,%projectile,%targetObject,%modifier,%position,%normal);
|
||||
%cn = %targetObject.getClassName();
|
||||
if(%cn $= "Player") {
|
||||
if($Host::TeamDamageOn == 0) {
|
||||
if(%targetObject.team == %projectile.sourceObject.team) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(%targetObject.beingSapped) {
|
||||
return;
|
||||
}
|
||||
if(%targetObject.isBoss) {
|
||||
%targetObject.playShieldEffect("1 1 1");
|
||||
%vec = vectorsub(%projectile.sourceObject.getworldboxcenter(),vectorAdd(%targetObject.getPosition(), "0 0 1"));
|
||||
%vec = vectoradd(%vec, vectorscale(%projectile.sourceObject.getvelocity(),vectorlen(%vec)/100));
|
||||
%p = new LinearFlareProjectile() {
|
||||
dataBlock = ShadowRifleBolt; //burn :)
|
||||
initialDirection = %vec;
|
||||
initialPosition = vectorAdd(%targetObject.getPosition(), "0 0 1");
|
||||
sourceObject = %targetObject;
|
||||
sourceSlot = 0;
|
||||
};
|
||||
messageClient(%projectile.sourceObject.client, 'MsgWarn', "WARNING: The boss deflects the pulse back at you!");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
%targetObject.beingSapped = 1;
|
||||
SapLoop(%projectile.sourceObject, %targetObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function SapLoop(%source, %target) {
|
||||
if(!%source.isAlive()) {
|
||||
return;
|
||||
}
|
||||
if(!%target.isAlive()) {
|
||||
createBlood(%target);
|
||||
return;
|
||||
}
|
||||
%target.zapObject();
|
||||
%target.getDatablock().damageObject(%target, %source, %source.getPosition, 0.05, $DamageType::Shadow);
|
||||
%target.lastDamagedImage = "ShadowRifleImage";
|
||||
%source.applyRepair(0.05);
|
||||
schedule(500, 0, "SapLoop", %source, %target);
|
||||
}
|
||||
226
scripts/weapons/Pistols/Colt.cs
Normal file
226
scripts/weapons/Pistols/Colt.cs
Normal file
|
|
@ -0,0 +1,226 @@
|
|||
datablock AudioProfile(PistolFireSound)
|
||||
{
|
||||
filename = "fx/vehicles/tank_chaingun.wav";
|
||||
description = AudioDefault3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Projectile
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
datablock TracerProjectileData(coltBullet) {
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.15; // z0dd - ZOD, 9-27-02. Was 0.0825
|
||||
directDamageType = $DamageType::pistol;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
HeadMultiplier = 1.5;
|
||||
LegsMultiplier = 0.5;
|
||||
|
||||
ImageSource = "PistolImage";
|
||||
|
||||
kickBackStrength = 5.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
//dryVelocity = 425.0;
|
||||
dryVelocity = 2000.0; // z0dd - ZOD, 8-12-02. Was 425.0
|
||||
wetVelocity = 1750.0;
|
||||
velInheritFactor = 0.0;
|
||||
fizzleTimeMS = 3000;
|
||||
lifetimeMS = 3000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 25.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
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.09;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
};
|
||||
|
||||
datablock ItemData(pistolAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some .77mm bullets";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ItemData(pistol) {
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_energy_vehicle.dts";
|
||||
image = pistolImage;
|
||||
mass = 2;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a Colt Pistol";
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(PistolImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_energy_vehicle.dts";
|
||||
item = pistol;
|
||||
offset = "0 0 0";
|
||||
rotation = "0 1 0 180";
|
||||
mass = 4;
|
||||
|
||||
ammo = pistolAmmo;
|
||||
|
||||
projectile = coltbullet;
|
||||
projectileType = tracerProjectile;
|
||||
projectileSpread = 10.0 / 1000.0;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "ColtClip";
|
||||
ClipPickupName["ColtClip"] = "Some .77MM Clips";
|
||||
ShowsClipInHud = 0;
|
||||
ClipReloadTime = 2;
|
||||
ClipReturn = 10;
|
||||
InitialClips = 950;
|
||||
HellClipCount = 10;
|
||||
//
|
||||
//Challenges
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 9;
|
||||
Challenge[1] = "Coltee\t25\t100\tGrip";
|
||||
Challenge[2] = "Coltist\t50\t150\tLaser";
|
||||
Challenge[3] = "Colt Expert\t100\t250\tSilencer";
|
||||
Challenge[4] = "Colt Master\t250\t500\tExcessive Duality";
|
||||
Challenge[5] = "Colt God\t500\t1000\tHSBullets";
|
||||
Challenge[6] = "Colt Bronze Commendation\t1000\t10000\tNone";
|
||||
Challenge[7] = "Colt Silver Commendation\t2500\t25000\tNone";
|
||||
Challenge[8] = "Colt Gold Commendation\t5000\t50000\tNone";
|
||||
Challenge[9] = "Colt Titan Commendation\t15000\t75000\tNone";
|
||||
Upgrade[1] = "Grip";
|
||||
Upgrade[2] = "Laser";
|
||||
Upgrade[3] = "Silencer";
|
||||
Upgrade[4] = "Excessive Duality";
|
||||
Upgrade[5] = "HSBullets";
|
||||
GunName = "Colt Pistol";
|
||||
//
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = PlasmaSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.1;
|
||||
stateFire[3] = true;
|
||||
stateEmitter[3] = "GunFireEffectEmitter";
|
||||
stateEmitterNode[3] = "muzzlepoint1";
|
||||
stateEmitterTime[3] = 1;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
stateEmitterTime[3] = 0.2;
|
||||
//stateSound[3] = PistolFireSound;
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 0.1;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[6] = 1.5;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(PistolImage2) : PistolImage {
|
||||
offset = "-0.5 0 0";
|
||||
};
|
||||
|
||||
function PistolImage::onMount(%this,%obj,%slot) {
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
if(%obj.client.UpgradeOn("Excessive Duality", %this.getName())) {
|
||||
%obj.mountImage(PistolImage2, 5);
|
||||
}
|
||||
}
|
||||
|
||||
function PistolImage::onUnmount(%this,%obj,%slot) {
|
||||
%obj.unmountImage(5);
|
||||
Parent::onUnmount(%this, %obj, %slot);
|
||||
}
|
||||
|
||||
function PistolImage::onFire(%data, %obj, %slot) {
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
|
||||
//zero sound :p
|
||||
}
|
||||
else if(%obj.client.UpgradeOn("Excessive Duality", %data.getName())) {
|
||||
schedule(200, 0, "FirePistolShot", %data, %obj, %slot);
|
||||
ServerPlay3d(PistolFireSound, %obj.getPosition());
|
||||
}
|
||||
else {
|
||||
ServerPlay3d(PistolFireSound, %obj.getPosition());
|
||||
}
|
||||
}
|
||||
|
||||
function FirePistolShot(%data, %obj, %slot) {
|
||||
serverPlay3d("PistolFireSound", %obj.getPosition());
|
||||
|
||||
%vector = %obj.getMuzzleVector(%slot);
|
||||
%mp = %obj.getMuzzlePoint(%slot);
|
||||
|
||||
%x = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
|
||||
%y = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
|
||||
%z = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
|
||||
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
|
||||
%newvector = MatrixMulVector(%mat, %vector);
|
||||
|
||||
%p = new (%data.projectileType)() {
|
||||
dataBlock = %data.projectile;
|
||||
initialDirection = %newvector;
|
||||
initialPosition = %mp;
|
||||
sourceObject = %obj;
|
||||
damageFactor = 1;
|
||||
sourceSlot = %slot;
|
||||
};
|
||||
%p.ImageSource = "PistolImage";
|
||||
%p.WeaponImageSource = "PistolImage";
|
||||
}
|
||||
204
scripts/weapons/Pistols/CrimsonHawk.cs
Normal file
204
scripts/weapons/Pistols/CrimsonHawk.cs
Normal file
|
|
@ -0,0 +1,204 @@
|
|||
//--------------------------------------------------------------------------
|
||||
// Projectile
|
||||
//--------------------------------------------------------------------------
|
||||
datablock TracerProjectileData(CHawkBullet) {
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.23; //reduced 0.5
|
||||
directDamageType = $DamageType::Hawk; //obviously change this
|
||||
|
||||
explosion = "BlasterExplosion";
|
||||
splash = ChaingunSplash;
|
||||
|
||||
sound = ShrikeBlasterProjectileSound;
|
||||
|
||||
dryVelocity = 425.0;
|
||||
wetVelocity = 100.0;
|
||||
velInheritFactor = 1.0;
|
||||
fizzleTimeMS = 1000;
|
||||
lifetimeMS = 1000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
ImageSource = "CrimsonHawkImage";
|
||||
|
||||
tracerLength = 45.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
tracerColor = "1.0 0.0 0.0 1.0";
|
||||
tracerTex[0] = "special/shrikeBolt";
|
||||
tracerTex[1] = "special/shrikeBoltCross";
|
||||
tracerWidth = 0.55;
|
||||
crossSize = 0.99;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ItemData(CrimsonHawkAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some .77mm bullets";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ItemData(CrimsonHawk) {
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_energy_vehicle.dts";
|
||||
image = CrimsonHawkImage;
|
||||
mass = 2;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a CrimsonHawk Pistol";
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(CrimsonHawkImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_energy_vehicle.dts";
|
||||
item = CrimsonHawk;
|
||||
offset = "0 0 0";
|
||||
rotation = "0 1 0 180";
|
||||
mass = 4;
|
||||
|
||||
ammo = CrimsonHawkAmmo;
|
||||
|
||||
projectile = CHawkBullet;
|
||||
projectileType = tracerProjectile;
|
||||
projectileSpread = 5.0 / 1000.0;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "CrimsonHawkClip";
|
||||
ClipPickupName["CrimsonHawkClip"] = "Some .77MM Clips";
|
||||
ShowsClipInHud = 0;
|
||||
ClipReloadTime = 4;
|
||||
ClipReturn = 15;
|
||||
InitialClips = 950;
|
||||
HellClipCount = 10;
|
||||
//
|
||||
|
||||
RankRequire = $TWM2::RankRequire["CrimsonHawk"];
|
||||
PrestigeRequire = 5;
|
||||
|
||||
//Challenges
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 9;
|
||||
Challenge[1] = "Crimson Hawk Novice\t25\t100\tNone";
|
||||
Challenge[2] = "Crimson Hawk Hunter\t50\t150\tGrip";
|
||||
Challenge[3] = "Crimson Hawk Expert\t100\t250\tLaser";
|
||||
Challenge[4] = "Crimson Hawk Master\t250\t500\tSilencer";
|
||||
Challenge[5] = "Crimson Hawk God\t500\t1000\tNone";
|
||||
Challenge[6] = "Crimson Hawk Bronze Commendation\t2500\t10000\tNone";
|
||||
Challenge[7] = "Crimson Hawk Silver Commendation\t7500\t25000\tNone";
|
||||
Challenge[8] = "Crimson Hawk Gold Commendation\t25000\t50000\tNone";
|
||||
Challenge[9] = "Crimson Hawk Titan Commendation\t50000\t75000\tNone";
|
||||
Upgrade[1] = "Grip";
|
||||
Upgrade[2] = "Laser";
|
||||
Upgrade[3] = "Silencer";
|
||||
GunName = "Crimson Hawk";
|
||||
//
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = PlasmaSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Fire2";
|
||||
stateTimeoutValue[3] = 0.1;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
stateEmitterTime[3] = 0.1;
|
||||
|
||||
stateName[4] = "Fire2";
|
||||
stateTransitionOnTimeout[4] = "Fire3";
|
||||
stateTimeoutValue[4] = 0.1;
|
||||
stateFire[4] = true;
|
||||
stateRecoil[4] = LightRecoil;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateScript[4] = "onFire";
|
||||
stateEmitterTime[4] = 0.1;
|
||||
|
||||
stateName[5] = "Fire3";
|
||||
stateTransitionOnTimeout[5] = "Fire4";
|
||||
stateTimeoutValue[5] = 0.1;
|
||||
stateFire[5] = true;
|
||||
stateRecoil[5] = LightRecoil;
|
||||
stateAllowImageChange[5] = false;
|
||||
stateScript[5] = "onFire";
|
||||
stateEmitterTime[5] = 0.1;
|
||||
|
||||
stateName[6] = "Fire4";
|
||||
stateTransitionOnTimeout[6] = "Fire5";
|
||||
stateTimeoutValue[6] = 0.1;
|
||||
stateFire[6] = true;
|
||||
stateRecoil[6] = LightRecoil;
|
||||
stateAllowImageChange[6] = false;
|
||||
stateScript[6] = "onFire";
|
||||
stateEmitterTime[6] = 0.1;
|
||||
|
||||
stateName[7] = "Fire5";
|
||||
stateTransitionOnTimeout[7] = "Reload";
|
||||
stateTimeoutValue[7] = 0.1;
|
||||
stateFire[7] = true;
|
||||
stateRecoil[7] = LightRecoil;
|
||||
stateAllowImageChange[7] = false;
|
||||
stateScript[7] = "onFire";
|
||||
stateEmitterTime[7] = 0.1;
|
||||
//stateSound[3] = PistolFireSound;
|
||||
|
||||
stateName[8] = "Reload";
|
||||
stateTransitionOnNoAmmo[8] = "NoAmmo";
|
||||
stateTransitionOnTimeout[8] = "Ready";
|
||||
stateTimeoutValue[8] = 0.1;
|
||||
stateAllowImageChange[8] = false;
|
||||
stateSequence[8] = "Reload";
|
||||
|
||||
stateName[9] = "NoAmmo";
|
||||
stateTransitionOnAmmo[9] = "Reload";
|
||||
stateSequence[9] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[9] = "DryFire";
|
||||
|
||||
stateName[10] = "DryFire";
|
||||
stateSound[10] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[10] = 1.5;
|
||||
stateTransitionOnTimeout[10] = "NoAmmo";
|
||||
};
|
||||
|
||||
function CrimsonHawkImage::onMount(%this,%obj,%slot) {
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
}
|
||||
|
||||
function CrimsonHawkImage::onFire(%data, %obj, %slot) {
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
|
||||
//zero sound :p
|
||||
}
|
||||
else {
|
||||
ServerPlay3d(PistolFireSound, %obj.getPosition());
|
||||
}
|
||||
}
|
||||
192
scripts/weapons/Pistols/DesertEagle.cs
Normal file
192
scripts/weapons/Pistols/DesertEagle.cs
Normal file
|
|
@ -0,0 +1,192 @@
|
|||
datablock AudioProfile(DeagleFireSound) {
|
||||
filename = "fx/weapons/cg_hard4.wav";
|
||||
description = AudioDefault3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock TracerProjectileData(DeagleBullet)
|
||||
{
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.3; //reduced .6
|
||||
directDamageType = $DamageType::deserteagle;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
|
||||
kickBackStrength = 5.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
ImageSource = "DeagleImage";
|
||||
|
||||
//dryVelocity = 425.0;
|
||||
dryVelocity = 2000.0; // z0dd - ZOD, 8-12-02. Was 425.0
|
||||
wetVelocity = 1750.0;
|
||||
velInheritFactor = 0.0;
|
||||
fizzleTimeMS = 3000;
|
||||
lifetimeMS = 3000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 25.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
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.09;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(DeagleImage2)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
offset = "0 0 0"; // L/R - F/B - T/B
|
||||
rotation = "0 0 0 0"; // L/R - F/B - T/B
|
||||
emap = true;
|
||||
};
|
||||
|
||||
datablock ItemData(DeagleAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some 4mm bullets";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ItemData(Deagle)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_energy_vehicle.dts";
|
||||
image = DeagleImage;
|
||||
mass = 2;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a Desert Eagle";
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(DeagleImage) {
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_energy_vehicle.dts";
|
||||
item = Deagle;
|
||||
offset = "0 0 0";
|
||||
rotation = "0 1 0 180";
|
||||
mass = 6;
|
||||
|
||||
ammo = DeagleAmmo;
|
||||
|
||||
projectile = DeagleBullet;
|
||||
projectileType = tracerProjectile;
|
||||
|
||||
ProjectileSpread = 6.0 / 1000.0; //2.5 spread added
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "DesertEagleClip";
|
||||
ClipPickupName["DesertEagleClip"] = "Some 4MM Clips";
|
||||
ShowsClipInHud = 0;
|
||||
ClipReloadTime = 5;
|
||||
ClipReturn = 7;
|
||||
InitialClips = 950;
|
||||
//
|
||||
//Challenges
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 9;
|
||||
Challenge[1] = "Eagle Trainee\t25\t100\tNone";
|
||||
Challenge[2] = "Eagle Recruit\t50\t150\tNone";
|
||||
Challenge[3] = "Eagle Expert\t100\t250\tLaser";
|
||||
Challenge[4] = "Eagle Master\t250\t500\tSilencer";
|
||||
Challenge[5] = "Eagle Legend\t500\t1000\tScope";
|
||||
Challenge[6] = "Eagle Bronze Commendation\t1000\t10000\tNone";
|
||||
Challenge[7] = "Eagle Silver Commendation\t2500\t25000\tNone";
|
||||
Challenge[8] = "Eagle Gold Commendation\t5000\t50000\tNone";
|
||||
Challenge[9] = "Eagle Titan Commendation\t15000\t75000\tNone";
|
||||
Upgrade[1] = "Laser";
|
||||
Upgrade[2] = "Silencer";
|
||||
Upgrade[3] = "Scope";
|
||||
GunName = "Desert Eagle Pistol";
|
||||
//
|
||||
|
||||
RankRequire = $TWM2::RankRequire["DesertEagle"];
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = PlasmaSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.1;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
stateEmitterTime[3] = 0.2;
|
||||
//stateSound[3] = DeagleFireSound;
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 0.1;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[6] = 1.5;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
};
|
||||
|
||||
function DeagleImage::onMount(%this,%obj,%slot) {
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
%obj.mountImage(DeagleImage2, 5);
|
||||
}
|
||||
|
||||
function DeagleImage::onUnmount(%this,%obj,%slot) {
|
||||
Parent::onUnmount(%this, %obj, %slot);
|
||||
%obj.unmountImage(5);
|
||||
}
|
||||
|
||||
function DeagleImage::onFire(%data,%obj,%slot) {
|
||||
%p = Parent::onFire(%data,%obj,%slot);
|
||||
if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
|
||||
//zero sound :p
|
||||
}
|
||||
else {
|
||||
ServerPlay3d(DeagleFireSound, %obj.getPosition());
|
||||
}
|
||||
}
|
||||
280
scripts/weapons/Pistols/GrappleHook.cs
Normal file
280
scripts/weapons/Pistols/GrappleHook.cs
Normal file
|
|
@ -0,0 +1,280 @@
|
|||
//--------------------------------------------------------------------------
|
||||
// Grapling Hook
|
||||
// Function Credits: Xenolith
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
//--------------------------------------
|
||||
// Rifle and item...
|
||||
//--------------------------------------
|
||||
datablock TargetProjectileData(GrappleRope) {
|
||||
directDamage = 0.0;
|
||||
hasDamageRadius = false;
|
||||
indirectDamage = 0.0;
|
||||
damageRadius = 0.0;
|
||||
velInheritFactor = 1.0;
|
||||
|
||||
maxRifleRange = 1000;
|
||||
beamColor = "0.0 0.1 0.0";
|
||||
|
||||
startBeamWidth = 0.20;
|
||||
pulseBeamWidth = 0.15;
|
||||
beamFlareAngle = 3.0;
|
||||
minFlareSize = 0.0;
|
||||
maxFlareSize = 400.0;
|
||||
pulseSpeed = 6.0;
|
||||
pulseLength = 0.150;
|
||||
|
||||
textureName[0] = "special/nonlingradient";
|
||||
textureName[1] = "special/flare";
|
||||
textureName[2] = "special/pulse";
|
||||
textureName[3] = "special/expFlare";
|
||||
beacon = true;
|
||||
};
|
||||
|
||||
datablock SeekerProjectileData(GrappleShot) {
|
||||
casingShapeName = "weapon_missile_casement.dts";
|
||||
projectileShapeName = "weapon_missile_projectile.dts";
|
||||
directDamage = 0.0;
|
||||
radiusDamageType = $DamageType::RPG;
|
||||
kickBackStrength = 3500;
|
||||
|
||||
explosion = "BlasterExplosion";
|
||||
splash = MissileSplash;
|
||||
velInheritFactor = 1.0; // to compensate for slow starting velocity, this value
|
||||
// is cranked up to full so the missile doesn't start
|
||||
// out behind the player when the player is moving
|
||||
// very quickly - bramage
|
||||
|
||||
lifetimeMS = 500; // z0dd - ZOD, 4/14/02. Was 6000
|
||||
muzzleVelocity = 250.0;
|
||||
maxVelocity = 350.0; // z0dd - ZOD, 4/14/02. Was 80.0
|
||||
turningSpeed = 54.0;
|
||||
acceleration = 50.0;
|
||||
|
||||
explodeOnDeath = false;
|
||||
|
||||
proximityRadius = 3;
|
||||
|
||||
sound = MissileProjectileSound;
|
||||
|
||||
hasLight = true;
|
||||
lightRadius = 3.0;
|
||||
lightColor = "0.2 0.05 0";
|
||||
|
||||
useFlechette = true;
|
||||
flechetteDelayMs = 10;
|
||||
casingDeb = FlechetteDebris;
|
||||
|
||||
explodeOnWaterImpact = true;
|
||||
};
|
||||
|
||||
datablock ItemData(GrappleHook) {
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_targeting.dts";
|
||||
image = GrappleHookImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a grapling hook";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(GrappleHookImage) {
|
||||
className = WeaponImage;
|
||||
|
||||
shapeFile = "weapon_targeting.dts";
|
||||
item = GrappleHook;
|
||||
offset = "0 0 0";
|
||||
|
||||
projectile = GrappleShot;
|
||||
projectileType = SeekerProjectile;
|
||||
|
||||
usesEnergy = true;
|
||||
minEnergy = 3;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.5;
|
||||
stateFire[3] = true;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateScript[3] = "onFire";
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateSound[4] = MortarReloadSound;
|
||||
stateEjectShell[4] = true;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
stateScript[4] = "onReload";
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateTimeoutValue[6] = 0.3;
|
||||
stateSound[6] = ChaingunDryFireSound;
|
||||
stateTransitionOnTimeout[6] = "Ready";
|
||||
};
|
||||
|
||||
function GrappleHookImage::onFire(%data, %obj, %slot) {
|
||||
if($TWM::PlayingWarTower) {
|
||||
%obj.client.beamer = 0;
|
||||
if(isObject(%obj.beamproj)) {
|
||||
%obj.beamproj.schedule(100, "delete");
|
||||
}
|
||||
messageClient(%obj.client, 'MsgBeamerStatus', "\c5Cannot Grapple in this game mode.~wfx/weapons/ELF_underwater.wav");
|
||||
return;
|
||||
}
|
||||
if($TWM2::PlayingSabo) {
|
||||
if(%obj == Game.bomb.Carrier) {
|
||||
%obj.client.beamer = 0;
|
||||
if(isObject(%obj.beamproj)) {
|
||||
%obj.beamproj.schedule(100, "delete");
|
||||
}
|
||||
messageClient(%obj.client, 'MsgBeamerStatus', "\c5Cannot Grapple With The Bomb.~wfx/weapons/ELF_underwater.wav");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(%obj.client.beamer == 1) {
|
||||
%obj.client.beamer = 0;
|
||||
if(isObject(%obj.beamproj)) {
|
||||
%obj.beamproj.schedule(100, "delete");
|
||||
}
|
||||
messageClient(%obj.client, 'MsgBeamerStatus', '~wfx/weapons/ELF_underwater.wav');
|
||||
}
|
||||
else {
|
||||
%p = Parent::OnFire(%data, %obj, %slot);
|
||||
}
|
||||
}
|
||||
|
||||
function GrappleShot::onExplode(%data, %proj, %pos, %mod) {
|
||||
%obj = %proj.sourceObject;
|
||||
%continue = 0;
|
||||
if (%obj.client.beamer == 0 || %obj.client.beamer $= "") {
|
||||
%obj.client.beamer = 1;
|
||||
messageClient(%obj.client, 'MsgBeamerStatus', '~wfx/weapons/cg_metal2.wav');
|
||||
%theight = getTerrainHeight(%pos);
|
||||
%maxHeight = %tHeight + 75;
|
||||
if(getWord(%pos, 2) > %maxHeight) {
|
||||
%TargetSearchMask = $AllObjMask;
|
||||
InitContainerRadiusSearch(%pos, 1, %TargetSearchMask); //small distance
|
||||
while ((%potentialTarget = ContainerSearchNext()) != 0){
|
||||
if (%potentialTarget.getPosition() != %pos) {
|
||||
%continue = 1;
|
||||
}
|
||||
}
|
||||
if(!%continue) {
|
||||
messageClient(%obj.client, 'MsgBeamerStatus', '~wfx/weapons/ELF_underwater.wav');
|
||||
messageClient(%obj.client, 'MsgBeamerStatus', "Grapples cannot fire this high.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
beamerOn(%data, %obj, %pos);
|
||||
}
|
||||
}
|
||||
|
||||
//Functions By: Xenolith
|
||||
//Modified to suit my needs
|
||||
function beamerOn(%data, %obj, %hit) {
|
||||
%beamtime = 100;
|
||||
if(isObject(%obj.beamproj)) {
|
||||
%obj.beamproj.schedule(%beamtime, "delete");
|
||||
}
|
||||
if (%obj.client.beamer != 1) {
|
||||
return;
|
||||
}
|
||||
%obj.setHeat(1.0); //max out the heat signature
|
||||
%hitobj = getWord(%hit, 0);
|
||||
%hitpos = getWord(%hit, 0) @ " " @ getWord(%hit, 1) @ " " @ getWord(%hit, 2);
|
||||
|
||||
%xhit = getword(%hitpos, 0);
|
||||
%yhit = getword(%hitpos, 1);
|
||||
%zhit = getword(%hitpos, 2);
|
||||
%xobj = getword(%obj.position, 0);
|
||||
%yobj = getword(%obj.position, 1);
|
||||
%zobj = getword(%obj.position, 2);
|
||||
|
||||
%x = %xhit - %xobj;
|
||||
%y = %yhit - %yobj;
|
||||
%z = %zhit - %zobj;
|
||||
%displacement = %x @ " " @ %y @ " " @ %z;
|
||||
|
||||
%x = getword(%displacement, 0);
|
||||
%y = getword(%displacement, 1);
|
||||
%z = getword(%displacement, 2);
|
||||
|
||||
%distance = mSqrt(%x * %x + %y * %y + %z * %z);
|
||||
|
||||
%x = %x / %distance;
|
||||
%y = %y / %distance;
|
||||
%z = %z / %distance;
|
||||
%displacement = %x @ " " @ %y @ " " @ %z;
|
||||
|
||||
if (%distance < 5 || %obj.client.beamer == 0) {
|
||||
%obj.client.beamer = 0;
|
||||
messageClient(%obj.client, 'MsgBeamerStatus', '~wfx/weapons/ELF_underwater.wav');
|
||||
if(isObject(%obj.beamproj)) {
|
||||
%obj.beamproj.schedule(%beamtime, "delete");
|
||||
}
|
||||
%velocity = VectorScale(%displacement, 5);
|
||||
%obj.setVelocity(%velocity);
|
||||
return;
|
||||
}
|
||||
%z = %z + 0.25;
|
||||
%fix = %x @ " " @ %y @ " " @ %z;
|
||||
|
||||
if (%distance < 55) {
|
||||
%velocity = VectorScale(%fix, (%distance * 2));
|
||||
}
|
||||
else {
|
||||
%velocity = VectorScale(%fix, 110); //was 500
|
||||
}
|
||||
%obj.setVelocity(%velocity);
|
||||
|
||||
%muzzlePos = %obj.getMuzzlePoint(0);
|
||||
%obj.beamproj = new (TargetProjectile)() {
|
||||
dataBlock = GrappleRope;
|
||||
initialDirection = %displacement;
|
||||
initialPosition = %muzzlePos;
|
||||
damageFactor = 0;
|
||||
sourceSlot = 0; //%slot
|
||||
fadeTime = 0.2;
|
||||
};
|
||||
schedule(%beamtime, 0, "beamerOn", %data, %obj, %hit);
|
||||
}
|
||||
|
||||
function GrappleHookImage::onUnmount(%this, %obj, %slot) {
|
||||
Parent::onUnmount(%this, %obj, %slot);
|
||||
if(isObject(%obj.lastProjectile)) {
|
||||
%obj.lastProjectile.delete();
|
||||
}
|
||||
if(%obj.client.beamer == 1) {
|
||||
%obj.client.beamer = 0;
|
||||
if(isObject(%obj.beamproj)) {
|
||||
%obj.beamproj.schedule(100, "delete");
|
||||
}
|
||||
messageClient(%obj.client, 'MsgBeamerStatus', '~wfx/weapons/ELF_underwater.wav');
|
||||
}
|
||||
}
|
||||
163
scripts/weapons/Pistols/LD06Savager.cs
Normal file
163
scripts/weapons/Pistols/LD06Savager.cs
Normal file
|
|
@ -0,0 +1,163 @@
|
|||
datablock ItemData(LD06SavagerAmmo) {
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some LD06Savager rounds";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(LD06SavagerImage) {
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_plasma.dts";
|
||||
item = LD06Savager;
|
||||
ammo = LD06SavagerAmmo;
|
||||
projectile = Wp400Pellet;
|
||||
projectileType = TracerProjectile;
|
||||
emap = true;
|
||||
mass = 20;
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "0.5 0.0 1.0"; // L/R - F/B - T/B
|
||||
shellExitOffset = "0.15 -0.51 -0.1"; // L/R - F/B - T/B
|
||||
shellExitVariance = 10.0;
|
||||
shellVelocity = 4.0;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "LD06SavagerClip";
|
||||
ClipPickupName["LD06SavagerClip"] = "some LD06Savager Clip Boxes";
|
||||
ShowsClipInHud = 0;
|
||||
ClipReloadTime = 5;
|
||||
ClipReturn = 10;
|
||||
InitialClips = 999;
|
||||
HellClipCount = 7;
|
||||
//
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 8;
|
||||
Challenge[1] = "LD06 Killer\t50\t100\tNone";
|
||||
Challenge[2] = "LD06 Expert\t100\t250\tNone";
|
||||
Challenge[3] = "LD06 Master\t250\t500\tNone";
|
||||
Challenge[4] = "LD06 God\t500\t1000\tSilencer";
|
||||
Challenge[5] = "LD06 Bronze Commendation\t1000\t10000\tNone";
|
||||
Challenge[6] = "LD06 Silver Commendation\t2500\t25000\tNone";
|
||||
Challenge[7] = "LD06 Gold Commendation\t5000\t50000\tNone";
|
||||
Challenge[8] = "LD06 Titan Commendation\t15000\t75000\tNone";
|
||||
Upgrade[1] = "Silencer";
|
||||
GunName = "LD06 Savager";
|
||||
|
||||
|
||||
MedalRequire = 1;
|
||||
|
||||
|
||||
projectileSpread = 10.0 / 1000.0;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.3;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.0001;
|
||||
stateFire[3] = true;
|
||||
stateEjectShell[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
stateSound[3] = SniperFireSound;
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 0.6;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
stateName[7] = "WetFire";
|
||||
stateSound[7] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[7] = 1.0;
|
||||
stateTransitionOnTimeout[7] = "Ready";
|
||||
|
||||
stateName[8] = "CheckWet";
|
||||
stateTransitionOnWet[8] = "WetFire";
|
||||
stateTransitionOnNotWet[8] = "Fire";
|
||||
};
|
||||
|
||||
datablock ItemData(LD06Savager)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_plasma.dts";
|
||||
image = LD06SavagerImage;
|
||||
mass = 1.0;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a LD06Savager";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function LD06SavagerImage::onMount(%this,%obj,%slot) {
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
}
|
||||
|
||||
function LD06SavagerImage::onFire(%data,%obj,%slot) {
|
||||
%obj.applyKick(-250);
|
||||
%obj.decInventory(%data.ammo,1);
|
||||
|
||||
serverPlay3D(ShotgunFireSound, %obj.getPosition());
|
||||
|
||||
%vector = %obj.getMuzzleVector(%slot);
|
||||
%mp = %obj.getMuzzlePoint(%slot);
|
||||
|
||||
for (%i=0; %i < 5; %i++) {
|
||||
%x = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
|
||||
%y = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
|
||||
%z = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
|
||||
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
|
||||
%newvector = MatrixMulVector(%mat, %vector);
|
||||
|
||||
%p = new (%data.projectileType)() {
|
||||
dataBlock = %data.projectile;
|
||||
initialDirection = %newvector;
|
||||
initialPosition = %mp;
|
||||
sourceObject = %obj;
|
||||
damageFactor = 1;
|
||||
sourceSlot = %slot;
|
||||
};
|
||||
%p.WeaponImageSource = %data.getName();
|
||||
%p.ImageSource = "LD06SavagerImage";
|
||||
}
|
||||
if(%obj.inv[LD06SavagerAmmo] == 0) { //Added Phantom139, TWM2
|
||||
AttemptReload(%data, %obj, %slot);
|
||||
}
|
||||
}
|
||||
197
scripts/weapons/Pistols/M93.cs
Normal file
197
scripts/weapons/Pistols/M93.cs
Normal file
|
|
@ -0,0 +1,197 @@
|
|||
//--------------------------------------------------------------------------
|
||||
// Projectile
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
datablock TracerProjectileData(m93Bullet) {
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.22; // reduced .26
|
||||
directDamageType = $DamageType::m93;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
HeadMultiplier = 1.5;
|
||||
LegsMultiplier = 0.5;
|
||||
|
||||
kickBackStrength = 5.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
ImageSource = "m93Image";
|
||||
|
||||
//dryVelocity = 425.0;
|
||||
dryVelocity = 2000.0; // z0dd - ZOD, 8-12-02. Was 425.0
|
||||
wetVelocity = 1750.0;
|
||||
velInheritFactor = 0.0;
|
||||
fizzleTimeMS = 3000;
|
||||
lifetimeMS = 3000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 25.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
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.09;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
};
|
||||
|
||||
datablock ItemData(m93Ammo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some .77mm bullets";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ItemData(m93) {
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_energy_vehicle.dts";
|
||||
image = m93Image;
|
||||
mass = 2;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a m93 Pistol";
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(m93Image)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_energy_vehicle.dts";
|
||||
item = m93;
|
||||
offset = "0 0 0";
|
||||
rotation = "0 1 0 180";
|
||||
mass = 4;
|
||||
|
||||
ammo = m93Ammo;
|
||||
|
||||
projectile = m93bullet;
|
||||
projectileType = tracerProjectile;
|
||||
projectileSpread = 6.0 / 1000.0;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "m93Clip";
|
||||
ClipPickupName["m93Clip"] = "Some .77MM Clips";
|
||||
ShowsClipInHud = 0;
|
||||
ClipReloadTime = 4;
|
||||
ClipReturn = 15;
|
||||
InitialClips = 950;
|
||||
HellClipCount = 10;
|
||||
//
|
||||
|
||||
RankRequire = $TWM2::RankRequire["ALSWP"];
|
||||
PrestigeRequire = 2;
|
||||
|
||||
//Challenges
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 9;
|
||||
Challenge[1] = "m93 Novice\t25\t100\tNone";
|
||||
Challenge[2] = "m93 Hunter\t50\t150\tGrip";
|
||||
Challenge[3] = "m93 Expert\t100\t250\tLaser";
|
||||
Challenge[4] = "m93 Master\t250\t500\tSilencer";
|
||||
Challenge[5] = "m93 God\t500\t1000\tHSBullets";
|
||||
Challenge[6] = "m93 Bronze Commendation\t1000\t10000\tNone";
|
||||
Challenge[7] = "m93 Silver Commendation\t2500\t25000\tNone";
|
||||
Challenge[8] = "m93 Gold Commendation\t5000\t50000\tNone";
|
||||
Challenge[9] = "m93 Titan Commendation\t15000\t75000\tNone";
|
||||
Upgrade[1] = "Grip";
|
||||
Upgrade[2] = "Laser";
|
||||
Upgrade[3] = "Silencer";
|
||||
Upgrade[4] = "HSBullets";
|
||||
GunName = "M93 Pistol";
|
||||
//
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = PlasmaSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Fire2";
|
||||
stateTimeoutValue[3] = 0.1;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
stateEmitterTime[3] = 0.1;
|
||||
|
||||
stateName[4] = "Fire2";
|
||||
stateTransitionOnTimeout[4] = "Fire3";
|
||||
stateTimeoutValue[4] = 0.1;
|
||||
stateFire[4] = true;
|
||||
stateRecoil[4] = LightRecoil;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateScript[4] = "onFire";
|
||||
stateEmitterTime[4] = 0.1;
|
||||
|
||||
stateName[5] = "Fire3";
|
||||
stateTransitionOnTimeout[5] = "Reload";
|
||||
stateTimeoutValue[5] = 0.1;
|
||||
stateFire[5] = true;
|
||||
stateRecoil[5] = LightRecoil;
|
||||
stateAllowImageChange[5] = false;
|
||||
stateScript[5] = "onFire";
|
||||
stateEmitterTime[5] = 0.1;
|
||||
//stateSound[3] = PistolFireSound;
|
||||
|
||||
stateName[6] = "Reload";
|
||||
stateTransitionOnNoAmmo[6] = "NoAmmo";
|
||||
stateTransitionOnTimeout[6] = "Ready";
|
||||
stateTimeoutValue[6] = 0.1;
|
||||
stateAllowImageChange[6] = false;
|
||||
stateSequence[6] = "Reload";
|
||||
|
||||
stateName[7] = "NoAmmo";
|
||||
stateTransitionOnAmmo[7] = "Reload";
|
||||
stateSequence[7] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[7] = "DryFire";
|
||||
|
||||
stateName[8] = "DryFire";
|
||||
stateSound[8] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[8] = 1.5;
|
||||
stateTransitionOnTimeout[8] = "NoAmmo";
|
||||
};
|
||||
|
||||
function m93Image::onMount(%this,%obj,%slot) {
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
}
|
||||
|
||||
function m93Image::onFire(%data, %obj, %slot) {
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
|
||||
//zero sound :p
|
||||
}
|
||||
else {
|
||||
ServerPlay3d(PistolFireSound, %obj.getPosition());
|
||||
}
|
||||
}
|
||||
247
scripts/weapons/Pistols/PulsePhaser.cs
Normal file
247
scripts/weapons/Pistols/PulsePhaser.cs
Normal file
|
|
@ -0,0 +1,247 @@
|
|||
// Pulse Phaser Weapon
|
||||
datablock AudioProfile(PPWFireSound)
|
||||
{
|
||||
filename = "fx/powered/turret_outdoor_fire.wav";
|
||||
description = AudioDefault3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock LinearFlareProjectileData(phaserBolt) {
|
||||
directDamage = 0.2; //reduced 0.45
|
||||
directDamageType = $DamageType::Phaser;
|
||||
explosion = "BlasterExplosion";
|
||||
kickBackStrength = 0.0;
|
||||
|
||||
dryVelocity = 120.0;
|
||||
wetVelocity = 40.0;
|
||||
velInheritFactor = 0.5;
|
||||
fizzleTimeMS = 2000;
|
||||
lifetimeMS = 3000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
ImageSource = "PulsePhaserImage";
|
||||
|
||||
numFlares = 20;
|
||||
size = 0.10;
|
||||
flareColor = "0 1 0";
|
||||
flareModTexture = "flaremod";
|
||||
flareBaseTexture = "flarebase";
|
||||
|
||||
sound = BlasterProjectileSound;
|
||||
|
||||
hasLight = true;
|
||||
lightRadius = 3.0;
|
||||
lightColor = "1 1 1";
|
||||
};
|
||||
|
||||
datablock LinearFlareProjectileData(TrevorPhaserBolt) {
|
||||
directDamage = 0.21; //reduced .485
|
||||
directDamageType = $DamageType::Phaser;
|
||||
explosion = "BlasterExplosion";
|
||||
kickBackStrength = 0.0;
|
||||
|
||||
dryVelocity = 120.0;
|
||||
wetVelocity = 40.0;
|
||||
velInheritFactor = 0.5;
|
||||
fizzleTimeMS = 2000;
|
||||
lifetimeMS = 3000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
ImageSource = "PulsePhaserImage";
|
||||
|
||||
numFlares = 20;
|
||||
size = 0.10;
|
||||
flareColor = "0.5 0.1 0.9";
|
||||
flareModTexture = "flaremod";
|
||||
flareBaseTexture = "flarebase";
|
||||
|
||||
sound = BlasterProjectileSound;
|
||||
|
||||
hasLight = true;
|
||||
lightRadius = 3.0;
|
||||
lightColor = "1 1 1";
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(PulsePhaserImage) {
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_energy.dts";
|
||||
item = PulsePhaser;
|
||||
projectile = phaserBolt;
|
||||
projectileType = LinearFlareProjectile;
|
||||
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 10;
|
||||
Challenge[1] = "Phaser Killer\t50\t100\tNone";
|
||||
Challenge[2] = "Phaser Hunter\t150\t250\tNone";
|
||||
Challenge[3] = "Phaser Expert\t250\t500\tLaser";
|
||||
Challenge[4] = "Phaser Master\t500\t1000\tTriple Burst";
|
||||
Challenge[5] = "Phaser God\t1000\t2000\tShotgun";
|
||||
Challenge[6] = "Phaser Legend\t1500\t5000\tPhaser Blades";
|
||||
Challenge[7] = "Phaser Bronze Commendation\t3000\t10000\tNone";
|
||||
Challenge[8] = "Phaser Silver Commendation\t6000\t25000\tNone";
|
||||
Challenge[9] = "Phaser Gold Commendation\t12500\t50000\tNone";
|
||||
Challenge[10] = "Phaser Titan Commendation\t35000\t75000\tNone";
|
||||
Upgrade[1] = "Laser";
|
||||
Upgrade[2] = "Triple Burst";
|
||||
Upgrade[3] = "Shotgun";
|
||||
Upgrade[4] = "Phaser Blades";
|
||||
GunName = "ES-77 Pulse Phaser";
|
||||
|
||||
RankRequire = $TWM2::RankRequire["PulsePhaser"];
|
||||
|
||||
usesEnergy = true;
|
||||
fireEnergy = 4;
|
||||
minEnergy = 4;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = BlasterSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.3;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = NoRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateSound[3] = PPWFireSound;
|
||||
stateScript[3] = "onFire";
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateTimeoutValue[6] = 0.3;
|
||||
stateSound[6] = BlasterDryFireSound;
|
||||
stateTransitionOnTimeout[6] = "Ready";
|
||||
};
|
||||
|
||||
datablock ItemData(PulsePhaser) {
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_energy.dts";
|
||||
image = PulsePhaserImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a Pulse Phaser";
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(Phaser2Image) : PulsePhaserImage {
|
||||
shapeFile = "weapon_ELF.dts";
|
||||
offset = "0 0.3 0.2";
|
||||
rotation = "0 1 0 180";
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(Phaser3Image) : PulsePhaserImage {
|
||||
shapeFile = "weapon_ELF.dts";
|
||||
offset = "0 .5 0";
|
||||
};
|
||||
|
||||
function PulsePhaserImage::onMount(%this, %obj, %slot) {
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
if(%obj.client.UpgradeOn("Phaser Blades", %this.getName())) {
|
||||
%obj.mountImage(Phaser2Image, 5);
|
||||
%obj.mountImage(Phaser3Image, 6);
|
||||
}
|
||||
}
|
||||
|
||||
function PulsePhaserImage::onUnmount(%this,%obj,%slot) {
|
||||
%obj.unmountImage(5);
|
||||
%obj.unmountImage(6);
|
||||
Parent::onUnmount(%this, %obj, %slot);
|
||||
}
|
||||
|
||||
|
||||
function PulsePhaserImage::onFire(%data,%obj,%slot) {
|
||||
if(%obj.cannotFire) {
|
||||
return;
|
||||
}
|
||||
%vector = %obj.getMuzzleVector(%slot);
|
||||
%mp = %obj.getMuzzlePoint(%slot);
|
||||
if(%obj.client.UpgradeOn("Triple Burst", %data.getName())) {
|
||||
%p1 = Parent::OnFire(%data, %obj, %slot);
|
||||
|
||||
%p2 = Schedule(100, 0, "spawnprojectile", %data.Projectile, %data.ProjectileType,
|
||||
vectorAdd(%obj.getPosition(), "-.45 0 1.4"), %vector, %obj);
|
||||
%p2.WeaponImageSource = "PulsePhaserImage";
|
||||
schedule(100, 0, "ServerPlay3D", "PPWFireSound", %obj.getPosition());
|
||||
|
||||
%p3 = Schedule(250, 0, "spawnprojectile", %data.Projectile, %data.ProjectileType,
|
||||
vectorAdd(%obj.getPosition(), "-.45 0 1.4"), %vector, %obj);
|
||||
%p3.WeaponImageSource = "PulsePhaserImage";
|
||||
schedule(250, 0, "ServerPlay3D", "PPWFireSound", %obj.getPosition());
|
||||
|
||||
ResetFireRestrict(%obj, 1);
|
||||
schedule(1350, 0, "ResetFireRestrict", %obj, 0);
|
||||
}
|
||||
else if(%obj.client.UpgradeOn("Shotgun", %data.getName())) {
|
||||
for (%i=0; %i < 3; %i++) {
|
||||
%x = (getRandom() - 0.5) * 2 * 3.1415926 * (11/1000);
|
||||
%y = (getRandom() - 0.5) * 2 * 3.1415926 * (11/1000);
|
||||
%z = (getRandom() - 0.5) * 2 * 3.1415926 * (11/1000);
|
||||
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
|
||||
%newvector = MatrixMulVector(%mat, %vector);
|
||||
|
||||
%p = new (%data.projectileType)() {
|
||||
dataBlock = %data.projectile;
|
||||
initialDirection = %newvector;
|
||||
initialPosition = %mp;
|
||||
sourceObject = %obj;
|
||||
damageFactor = 1;
|
||||
sourceSlot = %slot;
|
||||
};
|
||||
|
||||
%p.WeaponImageSource = "PulsePhaserImage";
|
||||
}
|
||||
ResetFireRestrict(%obj, 1);
|
||||
schedule(1200, 0, "ResetFireRestrict", %obj, 0);
|
||||
}
|
||||
else if(%obj.client.UpgradeOn("Phaser Blades", %data.getName())) {
|
||||
serverPlay3D("BomberTurretFireSound", %obj.getPosition());
|
||||
%p = new (%data.projectileType)() {
|
||||
dataBlock = TrevorPhaserBolt;
|
||||
initialDirection = %vector;
|
||||
initialPosition = %mp;
|
||||
sourceObject = %obj;
|
||||
damageFactor = 1;
|
||||
sourceSlot = %slot;
|
||||
};
|
||||
|
||||
%p.WeaponImageSource = "PulsePhaserImage";
|
||||
}
|
||||
else {
|
||||
%p = Parent::OnFire(%data,%obj,%slot);
|
||||
}
|
||||
}
|
||||
|
||||
function ResetFireRestrict(%plyr, %onOff) {
|
||||
%plyr.cannotFire = %onOff;
|
||||
}
|
||||
286
scripts/weapons/Pistols/shocklance.cs
Normal file
286
scripts/weapons/Pistols/shocklance.cs
Normal file
|
|
@ -0,0 +1,286 @@
|
|||
//--------------------------------------------------------------------------
|
||||
// Shock Lance
|
||||
//
|
||||
//
|
||||
//--------------------------------------------------------------------------
|
||||
datablock AudioProfile(ShockLanceSwitchSound)
|
||||
{
|
||||
filename = "fx/weapons/shocklance_activate.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Explosion
|
||||
//--------------------------------------
|
||||
datablock AudioProfile(ShockLanceHitSound)
|
||||
{
|
||||
filename = "fx/weapons/shocklance_fire.WAV";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(ShockLanceReloadSound)
|
||||
{
|
||||
filename = "fx/weapons/shocklance_reload.WAV";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(ShockLanceDryFireSound)
|
||||
{
|
||||
filename = "fx/weapons/shocklance_dryfire.WAV";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(ShockLanceMissSound)
|
||||
{
|
||||
filename = "fx/weapons/shocklance_miss.WAV";
|
||||
description = AudioExplosion3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Particle data
|
||||
//--------------------------------------------------------------------------
|
||||
datablock ParticleData(ShockParticle)
|
||||
{
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = -0.0;
|
||||
inheritedVelFactor = 0.0;
|
||||
|
||||
lifetimeMS = 1000;
|
||||
lifetimeVarianceMS = 0;
|
||||
|
||||
textureName = "particleTest";
|
||||
|
||||
useInvAlpha = false;
|
||||
spinRandomMin = -100.0;
|
||||
spinRandomMax = 100.0;
|
||||
|
||||
numParts = 50;
|
||||
|
||||
animateTexture = true;
|
||||
framesPerSec = 26;
|
||||
|
||||
animTexName[00] = "special/Explosion/exp_0002";
|
||||
animTexName[01] = "special/Explosion/exp_0004";
|
||||
animTexName[02] = "special/Explosion/exp_0006";
|
||||
animTexName[03] = "special/Explosion/exp_0008";
|
||||
animTexName[04] = "special/Explosion/exp_0010";
|
||||
animTexName[05] = "special/Explosion/exp_0012";
|
||||
animTexName[06] = "special/Explosion/exp_0014";
|
||||
animTexName[07] = "special/Explosion/exp_0016";
|
||||
animTexName[08] = "special/Explosion/exp_0018";
|
||||
animTexName[09] = "special/Explosion/exp_0020";
|
||||
animTexName[10] = "special/Explosion/exp_0022";
|
||||
animTexName[11] = "special/Explosion/exp_0024";
|
||||
animTexName[12] = "special/Explosion/exp_0026";
|
||||
animTexName[13] = "special/Explosion/exp_0028";
|
||||
animTexName[14] = "special/Explosion/exp_0030";
|
||||
animTexName[15] = "special/Explosion/exp_0032";
|
||||
animTexName[16] = "special/Explosion/exp_0034";
|
||||
animTexName[17] = "special/Explosion/exp_0036";
|
||||
animTexName[18] = "special/Explosion/exp_0038";
|
||||
animTexName[19] = "special/Explosion/exp_0040";
|
||||
animTexName[20] = "special/Explosion/exp_0042";
|
||||
animTexName[21] = "special/Explosion/exp_0044";
|
||||
animTexName[22] = "special/Explosion/exp_0046";
|
||||
animTexName[23] = "special/Explosion/exp_0048";
|
||||
animTexName[24] = "special/Explosion/exp_0050";
|
||||
animTexName[25] = "special/Explosion/exp_0052";
|
||||
|
||||
|
||||
colors[0] = "0.5 0.5 1.0 1.0";
|
||||
colors[1] = "0.5 0.5 1.0 0.5";
|
||||
colors[2] = "0.25 0.25 1.0 0.0";
|
||||
sizes[0] = 0.5;
|
||||
sizes[1] = 0.5;
|
||||
sizes[2] = 0.5;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(ShockParticleEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 1;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 0.25;
|
||||
velocityVariance = 0.0;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 30.0;
|
||||
|
||||
particles = "ShockParticle";
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Shockwave
|
||||
//--------------------------------------------------------------------------
|
||||
datablock ShockwaveData( ShocklanceHit )
|
||||
{
|
||||
width = 0.5;
|
||||
numSegments = 20;
|
||||
numVertSegments = 1;
|
||||
velocity = 0.25;
|
||||
acceleration = 1.0;
|
||||
lifetimeMS = 600;
|
||||
height = 0.1;
|
||||
verticalCurve = 0.5;
|
||||
|
||||
mapToTerrain = false;
|
||||
renderBottom = false;
|
||||
orientToNormal = true;
|
||||
|
||||
texture[0] = "special/shocklanceHit";
|
||||
texture[1] = "special/gradient";
|
||||
texWrap = 3.0;
|
||||
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
|
||||
colors[0] = "1.0 1.0 1.0 1.0";
|
||||
colors[1] = "1.0 1.0 1.0 0.5";
|
||||
colors[2] = "1.0 1.0 1.0 0.0";
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------
|
||||
// Projectile
|
||||
//--------------------------------------
|
||||
datablock ShockLanceProjectileData(BasicShocker)
|
||||
{
|
||||
directDamage = 0.45;
|
||||
radiusDamageType = $DamageType::ShockLance;
|
||||
kickBackStrength = 2600; // z0dd - ZOD, 3/30/02. More lance kick. was 2500
|
||||
velInheritFactor = 0;
|
||||
sound = "";
|
||||
|
||||
zapDuration = 1.0;
|
||||
impulse = 1800;
|
||||
boltLength = 16.0; // z0dd - ZOD, 3/30/02. was 14.0
|
||||
extension = 16.0; // script variable indicating distance you can shock people from. // z0dd - ZOD, 3/30/02. Was 14.0
|
||||
lightningFreq = 25.0;
|
||||
lightningDensity = 3.0;
|
||||
lightningAmp = 0.25;
|
||||
lightningWidth = 0.05;
|
||||
|
||||
ImageSource = "ShockLanceImage";
|
||||
|
||||
shockwave = ShocklanceHit;
|
||||
|
||||
boltSpeed[0] = 2.0;
|
||||
boltSpeed[1] = -0.5;
|
||||
|
||||
texWrap[0] = 1.5;
|
||||
texWrap[1] = 1.5;
|
||||
|
||||
startWidth[0] = 0.3;
|
||||
endWidth[0] = 0.6;
|
||||
startWidth[1] = 0.3;
|
||||
endWidth[1] = 0.6;
|
||||
|
||||
texture[0] = "special/shockLightning01";
|
||||
texture[1] = "special/shockLightning02";
|
||||
texture[2] = "special/shockLightning03";
|
||||
texture[3] = "special/ELFBeam";
|
||||
|
||||
emitter[0] = ShockParticleEmitter;
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------
|
||||
// Rifle and item...
|
||||
//--------------------------------------
|
||||
datablock ItemData(ShockLance)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_shocklance.dts";
|
||||
image = ShockLanceImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a shocklance";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(ShockLanceImage)
|
||||
{
|
||||
classname = WeaponImage;
|
||||
shapeFile = "weapon_shocklance.dts";
|
||||
item = ShockLance;
|
||||
offset = "0 0 0";
|
||||
emap = true;
|
||||
|
||||
projectile = BasicShocker;
|
||||
|
||||
RankRequire = 0;
|
||||
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 7;
|
||||
Challenge[1] = "Shocklance Expert\t50\t100\tNone";
|
||||
Challenge[2] = "Shocklance Master\t500\t1000\tNone";
|
||||
Challenge[3] = "Shocklance God\t1000\t2000\tNone";
|
||||
Challenge[4] = "Shocklance Bronze Commendation\t2500\t10000\tNone";
|
||||
Challenge[5] = "Shocklance Silver Commendation\t5000\t25000\tNone";
|
||||
Challenge[6] = "Shocklance Gold Commendation\t10000\t50000\tNone";
|
||||
Challenge[7] = "Shocklance Titan Commendation\t25000\t75000\tNone";
|
||||
GunName = "X-81 Shocklance";
|
||||
|
||||
usesEnergy = true;
|
||||
missEnergy = 0;
|
||||
hitEnergy = 3; // z0dd - ZOD, 8/20/02. Was 15.
|
||||
minEnergy = 3; // z0dd - ZOD, 8/20/02. Was 15. // needs to change to be datablock's energy drain for a hit
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateSound[0] = ShockLanceSwitchSound;
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.5;
|
||||
stateFire[3] = true;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateScript[3] = "onFire";
|
||||
stateSound[3] = ShockLanceDryFireSound;
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 2.0;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
stateSound[4] = ShockLanceReloadSound;
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Ready";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = ShockLanceDryFireSound;
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateTransitionOnTimeout[6] = "Ready";
|
||||
|
||||
stateName[7] = "CheckWet";
|
||||
stateTransitionOnWet[7] = "DryFire";
|
||||
stateTransitionOnNotWet[7] = "Fire";
|
||||
};
|
||||
|
||||
210
scripts/weapons/Rifles/ALSWPSniper.cs
Normal file
210
scripts/weapons/Rifles/ALSWPSniper.cs
Normal file
|
|
@ -0,0 +1,210 @@
|
|||
datablock AudioProfile(ALSWPFireSound) {
|
||||
filename = "fx/weapons/cg_hard1.wav";
|
||||
description = AudioDefault3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock TracerProjectileData(ALSWPBullet){
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.5;
|
||||
directDamageType = $DamageType::ALSWP;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
HeadMultiplier = 1.5;
|
||||
LegsMultiplier = 0.35;
|
||||
|
||||
HeadShotKill = 0;
|
||||
|
||||
ImageSource = "ALSWPSniperRifleImage";
|
||||
|
||||
kickBackStrength = 15.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
dryVelocity = 3000.0;
|
||||
wetVelocity = 2000.0;
|
||||
velInheritFactor = 1.0;
|
||||
fizzleTimeMS = 1000;
|
||||
lifetimeMS = 1000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 20.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
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.09;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
};
|
||||
|
||||
datablock ItemData(ALSWPSniperRifleAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "Some ALSWP Sniper Rifle Ammo";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(ALSWPSniperRifleImage) {
|
||||
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
mass = 10;
|
||||
item = ALSWPSniperRifle;
|
||||
ammo = ALSWPSniperRifleAmmo;
|
||||
projectile = ALSWPBullet;
|
||||
projectileType = TracerProjectile;
|
||||
emap = true;
|
||||
|
||||
armThread = looksn;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "ALSWPClip";
|
||||
ClipPickupName["ALSWPClip"] = "A Few Boxes Of ALSWP Sniper Bullets";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 5;
|
||||
ClipReturn = 10;
|
||||
InitialClips = 6;
|
||||
//
|
||||
//Challenges
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 8;
|
||||
Challenge[1] = "ALSWP Hunter\t100\t150\tNone";
|
||||
Challenge[2] = "ALSWP Expert\t200\t250\tNone";
|
||||
Challenge[3] = "ALSWP Master\t500\t500\tLaser";
|
||||
Challenge[4] = "ALSWP God\t1000\t1000\tSilencer";
|
||||
Challenge[5] = "ALSWP Bronze Commendation\t2500\t10000\tNone";
|
||||
Challenge[6] = "ALSWP Silver Commendation\t5000\t25000\tNone";
|
||||
Challenge[7] = "ALSWP Gold Commendation\t10000\t50000\tNone";
|
||||
Challenge[8] = "ALSWP Titan Commendation\t25000\t75000\tNone";
|
||||
Upgrade[1] = "Laser";
|
||||
Upgrade[2] = "Silencer";
|
||||
GunName = "ALSWP Sniper Rifle";
|
||||
//
|
||||
|
||||
RankRequire = $TWM2::RankRequire["ALSWP"];
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "1.0 0.3 1.0";
|
||||
shellExitOffset = "0.15 -0.56 -0.1";
|
||||
shellExitVariance = 15.0;
|
||||
shellVelocity = 3.0;
|
||||
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.01;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
//stateSound[3] = "ALSWPFireSound";
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 0.6;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
stateName[7] = "WetFire";
|
||||
stateSound[7] = PlasmaFireWetSound;
|
||||
stateTimeoutValue[7] = 1.0;
|
||||
stateTransitionOnTimeout[7] = "Ready";
|
||||
|
||||
stateName[8] = "CheckWet";
|
||||
stateTransitionOnWet[8] = "WetFire";
|
||||
stateTransitionOnNotWet[8] = "Fire";
|
||||
};
|
||||
|
||||
datablock ItemData(ALSWPSniperRifle)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
image = ALSWPSniperRifleImage;
|
||||
mass = 1.0;
|
||||
elasticity = 0.0;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a ALSWP Sniper Rifle";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function ALSWPSniperRifleImage::onMount(%this,%obj,%slot) {
|
||||
if(!$TWM2::AllowSnipers) {
|
||||
bottomPrint(%obj.client, "The host has disabled sniper weapons.", 2, 2);
|
||||
%obj.throwweapon(1);
|
||||
%obj.throwweapon(0);
|
||||
}
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
}
|
||||
|
||||
function ALSWPSniperRifleImage::onUnmount(%this,%obj,%slot) {
|
||||
Parent::onUnmount(%this, %obj, %slot);
|
||||
}
|
||||
|
||||
function ALSWPSniperRifleImage::onFire(%data, %obj, %slot) {
|
||||
if(!$TWM2::AllowSnipers) {
|
||||
bottomPrint(%obj.client, "The host has disabled sniper weapons.", 2, 2);
|
||||
%obj.throwweapon(1);
|
||||
%obj.throwweapon(0);
|
||||
}
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
|
||||
//zero sound :p
|
||||
}
|
||||
else {
|
||||
ServerPlay3d(ALSWPFireSound, %obj.getPosition());
|
||||
}
|
||||
}
|
||||
225
scripts/weapons/Rifles/G17Sniper.cs
Normal file
225
scripts/weapons/Rifles/G17Sniper.cs
Normal file
|
|
@ -0,0 +1,225 @@
|
|||
datablock AudioProfile(G17FireSound) {
|
||||
filename = "fx/weapons/cg_metal4.wav";
|
||||
description = AudioDefault3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock TracerProjectileData(G17Bullet){
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.25;
|
||||
directDamageType = $DamageType::G17;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
HeadMultiplier = 1.5;
|
||||
LegsMultiplier = 0.35;
|
||||
|
||||
HeadShotKill = 1;
|
||||
|
||||
ImageSource = "G17SniperRifleImage";
|
||||
|
||||
kickBackStrength = 15.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
dryVelocity = 3000.0;
|
||||
wetVelocity = 2000.0;
|
||||
velInheritFactor = 1.0;
|
||||
fizzleTimeMS = 1000;
|
||||
lifetimeMS = 1000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 20.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
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.09;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
};
|
||||
|
||||
datablock ItemData(G17SniperRifleAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "Some G17 Sniper Rifle Ammo";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(G17SniperRifleImage) {
|
||||
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
mass = 10;
|
||||
item = G17SniperRifle;
|
||||
ammo = G17SniperRifleAmmo;
|
||||
projectile = G17Bullet;
|
||||
projectileType = TracerProjectile;
|
||||
emap = true;
|
||||
|
||||
armThread = looksn;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "G17Clip";
|
||||
ClipPickupName["G17Clip"] = "A Few Boxes Of G17 Sniper Bullets";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 4;
|
||||
ClipReturn = 1;
|
||||
InitialClips = 10;
|
||||
//
|
||||
//Challenges
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 8;
|
||||
Challenge[1] = "G17 Hunter\t100\t150\tNone";
|
||||
Challenge[2] = "G17 Expert\t200\t250\tNone";
|
||||
Challenge[3] = "G17 Master\t500\t500\tLaser";
|
||||
Challenge[4] = "G17 God\t1000\t1000\tSilencer";
|
||||
Challenge[5] = "G17 Bronze Commendation\t2500\t10000\tNone";
|
||||
Challenge[6] = "G17 Silver Commendation\t5000\t25000\tNone";
|
||||
Challenge[7] = "G17 Gold Commendation\t10000\t50000\tNone";
|
||||
Challenge[8] = "G17 Titan Commendation\t25000\t75000\tNone";
|
||||
Upgrade[1] = "Laser";
|
||||
Upgrade[2] = "Silencer";
|
||||
GunName = "G17 Sniper Rifle";
|
||||
//
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "1.0 0.3 1.0";
|
||||
shellExitOffset = "0.15 -0.56 -0.1";
|
||||
shellExitVariance = 15.0;
|
||||
shellVelocity = 3.0;
|
||||
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.01;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
//stateSound[3] = "G17FireSound";
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 1.1;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
stateName[7] = "WetFire";
|
||||
stateSound[7] = PlasmaFireWetSound;
|
||||
stateTimeoutValue[7] = 1.0;
|
||||
stateTransitionOnTimeout[7] = "Ready";
|
||||
|
||||
stateName[8] = "CheckWet";
|
||||
stateTransitionOnWet[8] = "WetFire";
|
||||
stateTransitionOnNotWet[8] = "Fire";
|
||||
};
|
||||
|
||||
datablock ItemData(G17SniperRifle)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
image = G17SniperRifleImage;
|
||||
mass = 1.0;
|
||||
elasticity = 0.0;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a G17 Sniper Rifle";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
//Two images make the scope
|
||||
datablock ShapeBaseImageData(G17ScopeImage) : G17SniperRifleImage {
|
||||
shapeFile = "turret_belly_barrell.dts";
|
||||
offset = "0 0.25 0.25";
|
||||
rotation = "1 0 0 180";
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(G17ScopeImage2) : G17SniperRifleImage {
|
||||
shapeFile = "turret_belly_barrell.dts";
|
||||
offset = "0 0.3 0.25";
|
||||
rotation = "1 0 0 0";
|
||||
};
|
||||
|
||||
function G17SniperRifleImage::onMount(%this,%obj,%slot) {
|
||||
if(!$TWM2::AllowSnipers) {
|
||||
bottomPrint(%obj.client, "The host has disabled sniper weapons.", 2, 2);
|
||||
%obj.throwweapon(1);
|
||||
%obj.throwweapon(0);
|
||||
}
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
%obj.mountImage(G17ScopeImage, 5);
|
||||
%obj.mountImage(G17ScopeImage2, 6);
|
||||
}
|
||||
|
||||
function G17SniperRifleImage::onUnmount(%this,%obj,%slot) {
|
||||
Parent::onUnmount(%this, %obj, %slot);
|
||||
%obj.unmountImage(5);
|
||||
%obj.unmountImage(6);
|
||||
}
|
||||
|
||||
function G17SniperRifleImage::onFire(%data, %obj, %slot) {
|
||||
if(!$TWM2::AllowSnipers) {
|
||||
bottomPrint(%obj.client, "The host has disabled sniper weapons.", 2, 2);
|
||||
%obj.throwweapon(1);
|
||||
%obj.throwweapon(0);
|
||||
}
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
|
||||
//zero sound :p
|
||||
}
|
||||
else {
|
||||
ServerPlay3d(G17FireSound, %obj.getPosition());
|
||||
}
|
||||
}
|
||||
183
scripts/weapons/Rifles/G41.cs
Normal file
183
scripts/weapons/Rifles/G41.cs
Normal file
|
|
@ -0,0 +1,183 @@
|
|||
datablock TracerProjectileData(G41Bullet)
|
||||
{
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.3;
|
||||
directDamageType = $DamageType::G41;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
HeadMultiplier = 1.1;
|
||||
LegsMultiplier = 0.35;
|
||||
|
||||
ImageSource = "G41RifleImage";
|
||||
|
||||
kickBackStrength = 15.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
dryVelocity = 3000.0;
|
||||
wetVelocity = 2000.0;
|
||||
velInheritFactor = 1.0;
|
||||
fizzleTimeMS = 1000;
|
||||
lifetimeMS = 1000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 20.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
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.09;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
};
|
||||
|
||||
datablock ItemData(G41RifleAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "Some G41 Rifle Bullets";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(G41RifleImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
mass = 10;
|
||||
item = G41Rifle;
|
||||
ammo = G41RifleAmmo;
|
||||
projectile = G41Bullet;
|
||||
projectileType = TracerProjectile;
|
||||
emap = true;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "G41RifleClip";
|
||||
ClipPickupName["G41RifleClip"] = "some G41 Clip Cartons";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 5;
|
||||
ClipReturn = 20;
|
||||
InitialClips = 7;
|
||||
//
|
||||
//Challenges
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 8;
|
||||
Challenge[1] = "G41 Hunter\t75\t150\tNone";
|
||||
Challenge[2] = "G41 Expert\t150\t250\tGrip";
|
||||
Challenge[3] = "G41 Master\t350\t500\tLaser";
|
||||
Challenge[4] = "G41 God\t600\t1000\tSilencer";
|
||||
Challenge[5] = "G41 Bronze Commendation\t2500\t10000\tNone";
|
||||
Challenge[6] = "G41 Silver Commendation\t5000\t25000\tNone";
|
||||
Challenge[7] = "G41 Gold Commendation\t10000\t50000\tNone";
|
||||
Challenge[8] = "G41 Titan Commendation\t25000\t75000\tNone";
|
||||
Upgrade[1] = "Grip";
|
||||
Upgrade[2] = "Laser";
|
||||
Upgrade[3] = "Silencer";
|
||||
GunName = "G41 Semi-Automatic Rifle";
|
||||
//
|
||||
|
||||
RankRequire = $TWM2::RankRequire["G41"];
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "1.0 0.3 1.0";
|
||||
shellExitOffset = "0.15 -0.56 -0.1";
|
||||
shellExitVariance = 15.0;
|
||||
shellVelocity = 3.0;
|
||||
|
||||
projectileSpread = 3.0 / 1000.0;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.01;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
stateEmitterTime[3] = 0.2;
|
||||
//stateSound[3] = S3FireSound;
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 0.3;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
stateName[7] = "WetFire";
|
||||
stateSound[7] = PlasmaFireWetSound;
|
||||
stateTimeoutValue[7] = 1.0;
|
||||
stateTransitionOnTimeout[7] = "Ready";
|
||||
|
||||
stateName[8] = "CheckWet";
|
||||
stateTransitionOnWet[8] = "WetFire";
|
||||
stateTransitionOnNotWet[8] = "Fire";
|
||||
};
|
||||
|
||||
datablock ItemData(G41Rifle)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
image = G41RifleImage;
|
||||
mass = 1.0;
|
||||
elasticity = 0.0;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "an G41 Semi-Automatic Rifle";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function G41RifleImage::onFire(%data, %obj, %slot) {
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
|
||||
//zero sound :p
|
||||
}
|
||||
else {
|
||||
ServerPlay3d(S3FireSound, %obj.getPosition());
|
||||
}
|
||||
}
|
||||
227
scripts/weapons/Rifles/M1Sniper.cs
Normal file
227
scripts/weapons/Rifles/M1Sniper.cs
Normal file
|
|
@ -0,0 +1,227 @@
|
|||
datablock AudioProfile(M1FireSound) {
|
||||
filename = "fx/weapons/cg_metal2.wav";
|
||||
description = AudioDefault3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock TracerProjectileData(M1Bullet){
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.3;
|
||||
directDamageType = $DamageType::M1;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
HeadMultiplier = 1.5;
|
||||
LegsMultiplier = 0.35;
|
||||
|
||||
HeadShotKill = 1;
|
||||
|
||||
ImageSource = "M1SniperRifleImage";
|
||||
|
||||
kickBackStrength = 15.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
dryVelocity = 3000.0;
|
||||
wetVelocity = 2000.0;
|
||||
velInheritFactor = 1.0;
|
||||
fizzleTimeMS = 1000;
|
||||
lifetimeMS = 1000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 20.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
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.09;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
};
|
||||
|
||||
datablock ItemData(M1SniperRifleAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "Some M1 Sniper Rifle Ammo";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(M1SniperRifleImage) {
|
||||
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
mass = 10;
|
||||
item = M1SniperRifle;
|
||||
ammo = M1SniperRifleAmmo;
|
||||
projectile = M1Bullet;
|
||||
projectileType = TracerProjectile;
|
||||
emap = true;
|
||||
|
||||
armThread = looksn;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "M1Clip";
|
||||
ClipPickupName["M1Clip"] = "A Few Boxes Of M1 Sniper Bullets";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 5;
|
||||
ClipReturn = 5;
|
||||
InitialClips = 5;
|
||||
//
|
||||
//Challenges
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 8;
|
||||
Challenge[1] = "M1 Hunter\t100\t150\tNone";
|
||||
Challenge[2] = "M1 Expert\t200\t250\tNone";
|
||||
Challenge[3] = "M1 Master\t500\t500\tLaser";
|
||||
Challenge[4] = "M1 God\t1000\t1000\tSilencer";
|
||||
Challenge[5] = "M1 Bronze Commendation\t2500\t10000\tNone";
|
||||
Challenge[6] = "M1 Silver Commendation\t5000\t25000\tNone";
|
||||
Challenge[7] = "M1 Gold Commendation\t10000\t50000\tNone";
|
||||
Challenge[8] = "M1 Titan Commendation\t25000\t75000\tNone";
|
||||
Upgrade[1] = "Laser";
|
||||
Upgrade[2] = "Silencer";
|
||||
GunName = "M1 Sniper Rifle";
|
||||
//
|
||||
|
||||
RankRequire = $TWM2::RankRequire["M1"];
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "1.0 0.3 1.0";
|
||||
shellExitOffset = "0.15 -0.56 -0.1";
|
||||
shellExitVariance = 15.0;
|
||||
shellVelocity = 3.0;
|
||||
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.01;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
//stateSound[3] = "M1FireSound";
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 1.1;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
stateName[7] = "WetFire";
|
||||
stateSound[7] = PlasmaFireWetSound;
|
||||
stateTimeoutValue[7] = 1.0;
|
||||
stateTransitionOnTimeout[7] = "Ready";
|
||||
|
||||
stateName[8] = "CheckWet";
|
||||
stateTransitionOnWet[8] = "WetFire";
|
||||
stateTransitionOnNotWet[8] = "Fire";
|
||||
};
|
||||
|
||||
datablock ItemData(M1SniperRifle)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
image = M1SniperRifleImage;
|
||||
mass = 1.0;
|
||||
elasticity = 0.0;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a M1 Sniper Rifle";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
//Two images make the scope
|
||||
datablock ShapeBaseImageData(M1ScopeImage) : M1SniperRifleImage {
|
||||
shapeFile = "turret_belly_barrell.dts";
|
||||
offset = "0 0.25 0.25";
|
||||
rotation = "1 0 0 180";
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(M1ScopeImage2) : M1SniperRifleImage {
|
||||
shapeFile = "turret_belly_barrell.dts";
|
||||
offset = "0 0.3 0.25";
|
||||
rotation = "1 0 0 0";
|
||||
};
|
||||
|
||||
function M1SniperRifleImage::onMount(%this,%obj,%slot) {
|
||||
if(!$TWM2::AllowSnipers) {
|
||||
bottomPrint(%obj.client, "The host has disabled sniper weapons.", 2, 2);
|
||||
%obj.throwweapon(1);
|
||||
%obj.throwweapon(0);
|
||||
}
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
%obj.mountImage(M1ScopeImage, 5);
|
||||
%obj.mountImage(M1ScopeImage2, 6);
|
||||
}
|
||||
|
||||
function M1SniperRifleImage::onUnmount(%this,%obj,%slot) {
|
||||
Parent::onUnmount(%this, %obj, %slot);
|
||||
%obj.unmountImage(5);
|
||||
%obj.unmountImage(6);
|
||||
}
|
||||
|
||||
function M1SniperRifleImage::onFire(%data, %obj, %slot) {
|
||||
if(!$TWM2::AllowSnipers) {
|
||||
bottomPrint(%obj.client, "The host has disabled sniper weapons.", 2, 2);
|
||||
%obj.throwweapon(1);
|
||||
%obj.throwweapon(0);
|
||||
}
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
|
||||
//zero sound :p
|
||||
}
|
||||
else {
|
||||
ServerPlay3d(M1FireSound, %obj.getPosition());
|
||||
}
|
||||
}
|
||||
267
scripts/weapons/Rifles/M4A1.cs
Normal file
267
scripts/weapons/Rifles/M4A1.cs
Normal file
|
|
@ -0,0 +1,267 @@
|
|||
datablock TracerProjectileData(M4A1Bullet) {
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.09;
|
||||
directDamageType = $DamageType::M4A1;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
HeadMultiplier = 1.25;
|
||||
LegsMultiplier = 0.75;
|
||||
|
||||
kickBackStrength = 15.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
ImageSource = "M4A1Image";
|
||||
|
||||
dryVelocity = 1750.0;
|
||||
wetVelocity = 1500.0;
|
||||
velInheritFactor = 0.0;
|
||||
fizzleTimeMS = 3000;
|
||||
lifetimeMS = 3000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 9.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
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.09;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Ammo
|
||||
//--------------------------------------
|
||||
|
||||
datablock ItemData(M4A1Ammo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some M4A1 ammo";
|
||||
|
||||
computeCRC = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(M4A1Image)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_energy_vehicle.dts";
|
||||
item = M4A1;
|
||||
ammo = M4A1Ammo;
|
||||
projectile = M4A1Bullet;
|
||||
projectileType = TracerProjectile;
|
||||
emap = true;
|
||||
offset = "0 0.5 0"; // L/R - F/B - T/B
|
||||
rotation = "0 1 0 180";
|
||||
mass = 11;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "M4A1Clip";
|
||||
ClipPickupName["M4A1Clip"] = "some M4A1 Magazines";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 4;
|
||||
ClipReturn = 30;
|
||||
InitialClips = 7;
|
||||
//
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 11;
|
||||
Challenge[1] = "M4A1 Killer\t50\t100\tGrip";
|
||||
Challenge[2] = "M4A1 Hunter\t100\t250\tLaser";
|
||||
Challenge[3] = "M4A1 Expert\t250\t500\tShotgun Attachment";
|
||||
Challenge[4] = "M4A1 Master\t500\t1000\tGrenade Launcher Attachment";
|
||||
Challenge[5] = "M4A1 Legend\t750\t1500\tMini-Launcher Attachment";
|
||||
Challenge[6] = "M4A1 God\t1000\t2000\tSilencer";
|
||||
Challenge[7] = "M4A1 Supremacy\t2500\t5000\tUnlimited Attachment Ammo";
|
||||
Challenge[8] = "M4A1 Bronze Commendation\t5000\t10000\tNone";
|
||||
Challenge[9] = "M4A1 Silver Commendation\t12500\t25000\tNone";
|
||||
Challenge[10] = "M4A1 Gold Commendation\t25000\t50000\tNone";
|
||||
Challenge[11] = "M4A1 Titan Commendation\t50000\t75000\tNone";
|
||||
Upgrade[1] = "Grip";
|
||||
Upgrade[2] = "Laser";
|
||||
Upgrade[3] = "Shotgun Attachment";
|
||||
Upgrade[4] = "Grenade Launcher Attachment";
|
||||
Upgrade[5] = "Mini-Launcher Attachment";
|
||||
Upgrade[6] = "Silencer";
|
||||
GunName = "M4A1 Assault Rifle";
|
||||
|
||||
RankRequire = $TWM2::RankRequire["M4A1"];
|
||||
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "1.0 0.3 1.0";
|
||||
shellExitOffset = "0.15 -0.56 -0.1";
|
||||
shellExitVariance = 15.0;
|
||||
shellVelocity = 3.0;
|
||||
|
||||
projectileSpread = 8.0 / 1000.0;
|
||||
|
||||
//--------------------------------------
|
||||
stateName[0] = "Activate";
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
stateAllowImageChange[0] = false;
|
||||
//
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateTransitionOnTimeout[0] = "Ready";
|
||||
stateTransitionOnNoAmmo[0] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[1] = "Ready";
|
||||
stateSpinThread[1] = Stop;
|
||||
//
|
||||
stateTransitionOnTriggerDown[1] = "Spinup";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[2] = "NoAmmo";
|
||||
stateTransitionOnAmmo[2] = "Ready";
|
||||
stateSpinThread[2] = Stop;
|
||||
stateTransitionOnTriggerDown[2] = "DryFire";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[3] = "Spinup";
|
||||
stateSpinThread[3] = SpinUp;
|
||||
stateSound[3] = ChaingunSpinupSound;
|
||||
//
|
||||
stateTimeoutValue[3] = 0.01;
|
||||
stateWaitForTimeout[3] = false;
|
||||
stateTransitionOnTimeout[3] = "Fire";
|
||||
stateTransitionOnTriggerUp[3] = "Spindown";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[4] = "Fire";
|
||||
stateSequence[4] = "Fire";
|
||||
stateSequenceRandomFlash[4] = true;
|
||||
stateSpinThread[4] = FullSpeed;
|
||||
//stateSound[4] = ChaingunFireSound;
|
||||
stateRecoil[4] = LightRecoil;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateScript[4] = "onFire";
|
||||
stateFire[4] = true;
|
||||
stateEjectShell[4] = true;
|
||||
//
|
||||
stateTimeoutValue[4] = 0.08;
|
||||
stateTransitionOnTimeout[4] = "Fire";
|
||||
stateTransitionOnTriggerUp[4] = "Spindown";
|
||||
stateTransitionOnNoAmmo[4] = "EmptySpindown";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[5] = "Spindown";
|
||||
stateSound[5] = ChaingunSpinDownSound;
|
||||
stateSpinThread[5] = SpinDown;
|
||||
//
|
||||
stateTimeoutValue[5] = 0.05;
|
||||
stateWaitForTimeout[5] = true;
|
||||
stateTransitionOnTimeout[5] = "Ready";
|
||||
stateTransitionOnTriggerDown[5] = "Spinup";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[6] = "EmptySpindown";
|
||||
stateSound[6] = ChaingunSpinDownSound;
|
||||
stateSpinThread[6] = SpinDown;
|
||||
//
|
||||
stateTimeoutValue[6] = 0.5;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[7] = "DryFire";
|
||||
stateSound[7] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[7] = 0.5;
|
||||
stateTransitionOnTimeout[7] = "NoAmmo";
|
||||
};
|
||||
|
||||
datablock ItemData(M4A1)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_energy_vehicle.dts";
|
||||
image = M4A1Image;
|
||||
mass = 1.0;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "an M4A1";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function M4A1::onInventory(%this,%obj,%amount) {
|
||||
Parent::onInventory(%this, %obj, %amount);
|
||||
%obj.canUseM4A1Attachment = 1;
|
||||
if(%obj.client.UpgradeOn("Shotgun Attachment", M4A1Image)) {
|
||||
%obj.M4A1ShotgunClip = 5;
|
||||
}
|
||||
if(%obj.client.UpgradeOn("Grenade Launcher Attachment", M4A1Image)) {
|
||||
%obj.M4A1GLClip = 3;
|
||||
}
|
||||
if(%obj.client.UpgradeOn("Mini-Launcher Attachment", M4A1Image)) {
|
||||
%obj.M4A1MLClip = 3;
|
||||
}
|
||||
}
|
||||
|
||||
datablock ShapeBaseImageData(M4A1BarrelImage) {
|
||||
ammo = M4A1Ammo;
|
||||
shapeFile = "weapon_targeting.dts";
|
||||
offset = "0.0 0.0 0.0";
|
||||
emap = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(M4A1ScopeImage) {
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_targeting.dts";
|
||||
offset = "0.0 1.4 0.4";
|
||||
rotation = "180 0 0 90";
|
||||
|
||||
ammo = M4A1Ammo;
|
||||
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function M4A1Image::onMount(%this,%obj,%slot) {
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
%obj.mountImage(M4A1BarrelImage, 3);
|
||||
%obj.mountImage(M4A1ScopeImage, 4);
|
||||
}
|
||||
|
||||
function M4A1Image::onUnmount(%this,%obj,%slot) {
|
||||
Parent::onUnmount(%this, %obj, %slot);
|
||||
%obj.unmountImage(3);
|
||||
%obj.unmountImage(4);
|
||||
}
|
||||
|
||||
function M4A1Image::onFire(%data, %obj, %slot) {
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
|
||||
//zero sound :p
|
||||
}
|
||||
else {
|
||||
ServerPlay3d(ChaingunFireSound, %obj.getPosition());
|
||||
}
|
||||
}
|
||||
|
||||
function M4A1RefreshAttachment(%obj) {
|
||||
%obj.canUseM4A1Attachment = 1;
|
||||
}
|
||||
176
scripts/weapons/Rifles/PulseRifle.cs
Normal file
176
scripts/weapons/Rifles/PulseRifle.cs
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
datablock TracerProjectileData(PulseRifleBullet) {
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.2;
|
||||
explosion = "BlasterExplosion";
|
||||
splash = ChaingunSplash;
|
||||
|
||||
directDamageType = $DamageType::ShrikeBlaster;
|
||||
kickBackStrength = 0.0;
|
||||
|
||||
sound = ShrikeBlasterProjectileSound;
|
||||
|
||||
ImageSource = "PulseRifleImage";
|
||||
|
||||
dryVelocity = 425.0;
|
||||
wetVelocity = 100.0;
|
||||
velInheritFactor = 1.0;
|
||||
fizzleTimeMS = 1000;
|
||||
lifetimeMS = 1000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 45.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
tracerColor = "1.0 0.0 0.0 0.0";
|
||||
tracerTex[0] = "special/shrikeBolt";
|
||||
tracerTex[1] = "special/shrikeBoltCross";
|
||||
tracerWidth = 0.55;
|
||||
crossSize = 0.99;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ItemData(PulseRifleAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "Some Pulse Rifle Bullets";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(PulseRifleImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
mass = 10;
|
||||
item = PulseRifle;
|
||||
ammo = PulseRifleAmmo;
|
||||
projectile = PulseRifleBullet;
|
||||
projectileType = TracerProjectile;
|
||||
emap = true;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "PulseRifleClip";
|
||||
ClipPickupName["PulseRifleClip"] = "some Pulse Clip Cartons";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 5;
|
||||
ClipReturn = 20;
|
||||
InitialClips = 7;
|
||||
//
|
||||
//Challenges
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 8;
|
||||
Challenge[1] = "Pulse Hunter\t75\t150\tNone";
|
||||
Challenge[2] = "Pulse Expert\t150\t250\tGrip";
|
||||
Challenge[3] = "Pulse Master\t350\t500\tLaser";
|
||||
Challenge[4] = "Pulse God\t600\t1000\tSilencer";
|
||||
Challenge[5] = "Pulse Bronze Commendation\t2500\t10000\tNone";
|
||||
Challenge[6] = "Pulse Silver Commendation\t5000\t25000\tNone";
|
||||
Challenge[7] = "Pulse Gold Commendation\t10000\t50000\tNone";
|
||||
Challenge[8] = "Pulse Titan Commendation\t25000\t75000\tNone";
|
||||
Upgrade[1] = "Grip";
|
||||
Upgrade[2] = "Laser";
|
||||
Upgrade[3] = "Silencer";
|
||||
GunName = "Pulse Semi-Automatic Rifle";
|
||||
//
|
||||
|
||||
RankRequire = $TWM2::RankRequire["G41"];
|
||||
PrestigeRequire = 2;
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "1.0 0.3 1.0";
|
||||
shellExitOffset = "0.15 -0.56 -0.1";
|
||||
shellExitVariance = 15.0;
|
||||
shellVelocity = 3.0;
|
||||
|
||||
projectileSpread = 2.0 / 1000.0;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.01;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
stateEmitterTime[3] = 0.2;
|
||||
//stateSound[3] = S3FireSound;
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 0.3;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
stateName[7] = "WetFire";
|
||||
stateSound[7] = PlasmaFireWetSound;
|
||||
stateTimeoutValue[7] = 1.0;
|
||||
stateTransitionOnTimeout[7] = "Ready";
|
||||
|
||||
stateName[8] = "CheckWet";
|
||||
stateTransitionOnWet[8] = "WetFire";
|
||||
stateTransitionOnNotWet[8] = "Fire";
|
||||
};
|
||||
|
||||
datablock ItemData(PulseRifle)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
image = PulseRifleImage;
|
||||
mass = 1.0;
|
||||
elasticity = 0.0;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "an Pulse Semi-Automatic Rifle";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function PulseRifleImage::onFire(%data, %obj, %slot) {
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
|
||||
//zero sound :p
|
||||
}
|
||||
else {
|
||||
ServerPlay3d(S3FireSound, %obj.getPosition());
|
||||
}
|
||||
}
|
||||
268
scripts/weapons/Rifles/R700Sniper.cs
Normal file
268
scripts/weapons/Rifles/R700Sniper.cs
Normal file
|
|
@ -0,0 +1,268 @@
|
|||
datablock AudioProfile(R700FireSound) {
|
||||
filename = "fx/weapons/cg_metal3.wav";
|
||||
description = AudioDefault3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock ParticleData(R700SmokeParticle)
|
||||
{
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = -0.02;
|
||||
inheritedVelFactor = 0.1;
|
||||
|
||||
lifetimeMS = 1200;
|
||||
lifetimeVarianceMS = 100;
|
||||
|
||||
textureName = "particleTest";
|
||||
|
||||
useInvAlpha = false;
|
||||
spinRandomMin = -90.0;
|
||||
spinRandomMax = 90.0;
|
||||
|
||||
colors[0] = "1 1 1";
|
||||
colors[1] = "1 1 1";
|
||||
colors[2] = "1 1 1";
|
||||
sizes[0] = 1;
|
||||
sizes[1] = 1.2;
|
||||
sizes[2] = 1.4;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.1;
|
||||
times[2] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(R700SmokeEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 10;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 1.5;
|
||||
velocityVariance = 0.3;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 50.0;
|
||||
|
||||
particles = "R700SmokeParticle";
|
||||
};
|
||||
|
||||
datablock LinearFlareProjectileData(R700Bullet)
|
||||
{
|
||||
projectileShapeName = "weapon_missile_projectile.dts";
|
||||
scale = "1.0 1.0 1.0";
|
||||
faceViewer = true;
|
||||
directDamage = 0.62;
|
||||
kickBackStrength = 6400;
|
||||
radiusDamageType = $DamageType::R700;
|
||||
|
||||
HeadMultiplier = 1.5;
|
||||
LegsMultiplier = 0.35;
|
||||
|
||||
HeadShotKill = 1;
|
||||
|
||||
ImageSource = "R700SniperRifleImage";
|
||||
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
|
||||
baseEmitter = R700SmokeEmitter;
|
||||
|
||||
dryVelocity = 2000.0;
|
||||
wetVelocity = 2000.0;
|
||||
velInheritFactor = 1.0;
|
||||
fizzleTimeMS = 1000;
|
||||
lifetimeMS = 1000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
//activateDelayMS = 100;
|
||||
activateDelayMS = -1;
|
||||
|
||||
size[0] = 0.2;
|
||||
size[1] = 0.5;
|
||||
size[2] = 0.1;
|
||||
|
||||
numFlares = 5; //less flares = less lag
|
||||
flareColor = "1 0.18 0.03";
|
||||
flareModTexture = "flaremod";
|
||||
flareBaseTexture = "flarebase";
|
||||
|
||||
hasLight = true;
|
||||
lightRadius = 10.0;
|
||||
lightColor = "0.94 0.03 0.12";
|
||||
};
|
||||
|
||||
datablock ItemData(R700SniperRifleAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "Some R700 Sniper Rifle Ammo";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(R700SniperRifleImage) {
|
||||
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
mass = 10;
|
||||
item = R700SniperRifle;
|
||||
ammo = R700SniperRifleAmmo;
|
||||
projectile = R700Bullet;
|
||||
projectileType = LinearFlareProjectile;
|
||||
emap = true;
|
||||
|
||||
armThread = looksn;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "R700Clip";
|
||||
ClipPickupName["R700Clip"] = "A Few Boxes Of R700 Sniper Bullets";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 7;
|
||||
ClipReturn = 4;
|
||||
InitialClips = 6;
|
||||
//
|
||||
//Challenges
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 8;
|
||||
Challenge[1] = "R700 Hunter\t100\t150\tNone";
|
||||
Challenge[2] = "R700 Expert\t200\t250\tNone";
|
||||
Challenge[3] = "R700 Master\t500\t500\tLaser";
|
||||
Challenge[4] = "R700 God\t1000\t1000\tSilencer";
|
||||
Challenge[5] = "R700 Bronze Commendation\t2500\t10000\tNone";
|
||||
Challenge[6] = "R700 Silver Commendation\t5000\t25000\tNone";
|
||||
Challenge[7] = "R700 Gold Commendation\t10000\t50000\tNone";
|
||||
Challenge[8] = "R700 Titan Commendation\t25000\t75000\tNone";
|
||||
Upgrade[1] = "Laser";
|
||||
Upgrade[2] = "Silencer";
|
||||
GunName = "R700 Sniper Rifle";
|
||||
//
|
||||
|
||||
RankRequire = $TWM2::RankRequire["R700"];
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "1.0 0.3 1.0";
|
||||
shellExitOffset = "0.15 -0.56 -0.1";
|
||||
shellExitVariance = 15.0;
|
||||
shellVelocity = 3.0;
|
||||
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.01;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
//stateSound[3] = "R700FireSound";
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 1.2;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
stateName[7] = "WetFire";
|
||||
stateSound[7] = PlasmaFireWetSound;
|
||||
stateTimeoutValue[7] = 1.0;
|
||||
stateTransitionOnTimeout[7] = "Ready";
|
||||
|
||||
stateName[8] = "CheckWet";
|
||||
stateTransitionOnWet[8] = "WetFire";
|
||||
stateTransitionOnNotWet[8] = "Fire";
|
||||
};
|
||||
|
||||
datablock ItemData(R700SniperRifle)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
image = R700SniperRifleImage;
|
||||
mass = 1.0;
|
||||
elasticity = 0.0;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a R700 Sniper Rifle";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(R700ScopeImage) {
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_targeting.dts";
|
||||
offset = "0.0 1.0 0.4";
|
||||
rotation = "180 0 0 90";
|
||||
|
||||
ammo = R700SniperRifleAmmo;
|
||||
armThread = looksn;
|
||||
|
||||
emap = true;
|
||||
};
|
||||
|
||||
|
||||
function R700SniperRifleImage::onMount(%this,%obj,%slot) {
|
||||
if(!$TWM2::AllowSnipers) {
|
||||
bottomPrint(%obj.client, "The host has disabled sniper weapons.", 2, 2);
|
||||
%obj.throwweapon(1);
|
||||
%obj.throwweapon(0);
|
||||
}
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
%obj.mountImage(R700ScopeImage, 5);
|
||||
}
|
||||
|
||||
function R700SniperRifleImage::onUnmount(%this,%obj,%slot) {
|
||||
Parent::onUnmount(%this, %obj, %slot);
|
||||
%obj.unmountImage(5);
|
||||
}
|
||||
|
||||
function R700SniperRifleImage::onFire(%data, %obj, %slot) {
|
||||
if(!$TWM2::AllowSnipers) {
|
||||
bottomPrint(%obj.client, "The host has disabled sniper weapons.", 2, 2);
|
||||
%obj.throwweapon(1);
|
||||
%obj.throwweapon(0);
|
||||
}
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
|
||||
//zero sound :p
|
||||
}
|
||||
else {
|
||||
ServerPlay3d(R700FireSound, %obj.getPosition());
|
||||
}
|
||||
}
|
||||
248
scripts/weapons/Rifles/RSALaserRifle.cs
Normal file
248
scripts/weapons/Rifles/RSALaserRifle.cs
Normal file
|
|
@ -0,0 +1,248 @@
|
|||
datablock AudioProfile(LaserRifleFireSound)
|
||||
{
|
||||
filename = "fx/weapons/sniper_fire.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock ParticleData(RedFlareParticle)
|
||||
{
|
||||
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(RedFlareemmiter)
|
||||
{
|
||||
ejectionPeriodMS = 10;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 1.0;
|
||||
velocityVariance = 0.0;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 90.0;
|
||||
|
||||
orientParticles = true;
|
||||
orientOnVelocity = false;
|
||||
|
||||
particles = "RedFlareParticle";
|
||||
};
|
||||
|
||||
datablock LinearFlareProjectileData(LaserShot)
|
||||
{
|
||||
scale = "1.0 1.0 1.0";
|
||||
faceViewer = false;
|
||||
directDamage = 0.6;
|
||||
kickBackStrength = 100.0;
|
||||
directDamageType = $DamageType::LaserRifle;
|
||||
|
||||
explosion = "BlasterExplosion";
|
||||
splash = PlasmaSplash;
|
||||
|
||||
ImageSource = "lasergunImage";
|
||||
|
||||
dryVelocity = 200.0;
|
||||
wetVelocity = 10;
|
||||
velInheritFactor = 0.5;
|
||||
fizzleTimeMS = 30000;
|
||||
lifetimeMS = 30000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = true;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = -1;
|
||||
|
||||
baseEmitter = RedFlareemmiter;
|
||||
delayEmitter = RedFlareemmiter;
|
||||
bubbleEmitter = RedFlareemmiter;
|
||||
|
||||
//activateDelayMS = 100;
|
||||
activateDelayMS = -1;
|
||||
|
||||
size[0] = 0.2;
|
||||
size[1] = 0.2;
|
||||
size[2] = 0.2;
|
||||
|
||||
|
||||
numFlares = 15;
|
||||
flareColor = "1 0 0";
|
||||
flareModTexture = "flaremod";
|
||||
flareBaseTexture = "flarebase";
|
||||
|
||||
sound = MissileProjectileSound;
|
||||
fireSound = PlasmaFireSound;
|
||||
wetFireSound = PlasmaFireWetSound;
|
||||
|
||||
hasLight = true;
|
||||
lightRadius = 3.0;
|
||||
lightColor = "1 0 0";
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Ammo
|
||||
//--------------------------------------
|
||||
|
||||
datablock ItemData(lasergunAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some laser rifle ammo";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(lasergunImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
item = lasergun;
|
||||
ammo = lasergunAmmo;
|
||||
projectile = LaserShot;
|
||||
projectileType = LinearFlareProjectile;
|
||||
emap = true;
|
||||
armThread = looksn;
|
||||
mass = 10;
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "1.0 0.3 1.0";
|
||||
shellExitOffset = "0.15 -0.56 -0.1";
|
||||
shellExitVariance = 15.0;
|
||||
shellVelocity = 3.0;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "lasergunClip";
|
||||
ClipPickupName["lasergunClip"] = "A Photonic Laser Battery";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 6;
|
||||
ClipReturn = 10;
|
||||
InitialClips = 5;
|
||||
//
|
||||
//Challenges
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 8;
|
||||
Challenge[1] = "Laser Rifle Blaster\t100\t250\tNone";
|
||||
Challenge[2] = "Laser Rifle Expert\t250\t500\tGrip";
|
||||
Challenge[3] = "Laser Rifle Master\t750\t1000\tLaser";
|
||||
Challenge[4] = "Laser Rifle God\t1500\t2000\tSilencer";
|
||||
Challenge[5] = "Laser Rifle Bronze Commendation\t5000\t10000\tNone";
|
||||
Challenge[6] = "Laser Rifle Silver Commendation\t10000\t25000\tNone";
|
||||
Challenge[7] = "Laser Rifle Gold Commendation\t25000\t50000\tNone";
|
||||
Challenge[8] = "Laser Rifle Titan Commendation\t50000\t75000\tNone";
|
||||
Upgrade[1] = "Grip";
|
||||
Upgrade[2] = "Laser";
|
||||
Upgrade[3] = "Silencer";
|
||||
GunName = "RSA Laser Rifle";
|
||||
//
|
||||
|
||||
RankRequire = $TWM2::RankRequire["RSALaserRifle"];
|
||||
|
||||
maxSpread = 10.0 / 1000.0;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.0001;
|
||||
stateFire[3] = true;
|
||||
stateEmitter[3] = "GunFireEffectEmitter";
|
||||
stateEmitterNode[3] = "muzzlepoint1";
|
||||
stateEmitterTime[3] = 1;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
stateEmitterTime[3] = 0.1;
|
||||
//stateSound[3] = LaserRifleFireSound;
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 0.7;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[6] = 0.2;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
stateName[7] = "WetFire";
|
||||
stateSound[7] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[7] = 0.2;
|
||||
stateTransitionOnTimeout[7] = "Ready";
|
||||
|
||||
stateName[8] = "CheckWet";
|
||||
stateTransitionOnWet[8] = "WetFire";
|
||||
stateTransitionOnNotWet[8] = "Fire";
|
||||
};
|
||||
|
||||
datablock ItemData(lasergun)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_chaingun.dts";
|
||||
image = lasergunImage;
|
||||
mass = 1.0;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a Laser Rifle";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function lasergunImage::onFire(%data, %obj, %slot) {
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
|
||||
//zero sound :p
|
||||
}
|
||||
else {
|
||||
ServerPlay3d(LaserRifleFireSound, %obj.getPosition());
|
||||
}
|
||||
}
|
||||
225
scripts/weapons/Rifles/S3.cs
Normal file
225
scripts/weapons/Rifles/S3.cs
Normal file
|
|
@ -0,0 +1,225 @@
|
|||
datablock AudioProfile(S3FireSound)
|
||||
{
|
||||
filename = "fx/vehicles/tank_chaingun.wav";
|
||||
description = AudioDefault3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock TracerProjectileData(S3Bullet)
|
||||
{
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.7;
|
||||
directDamageType = $DamageType::S3;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
HeadMultiplier = 1.5;
|
||||
LegsMultiplier = 0.35;
|
||||
|
||||
HeadShotKill = 1;
|
||||
|
||||
kickBackStrength = 15.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
dryVelocity = 3000.0;
|
||||
wetVelocity = 2000.0;
|
||||
velInheritFactor = 1.0;
|
||||
fizzleTimeMS = 1000;
|
||||
lifetimeMS = 1000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
ImageSource = "S3RifleImage";
|
||||
|
||||
tracerLength = 20.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
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.09;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
};
|
||||
|
||||
datablock ItemData(S3RifleAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "Some S3 Rifle Bullets";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(S3RifleImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
mass = 10;
|
||||
item = S3Rifle;
|
||||
ammo = S3RifleAmmo;
|
||||
projectile = S3Bullet;
|
||||
projectileType = TracerProjectile;
|
||||
emap = true;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "S3RifleClip";
|
||||
ClipPickupName["S3RifleClip"] = "some S3 Clip Cartridges";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 4;
|
||||
ClipReturn = 10;
|
||||
InitialClips = 6;
|
||||
//
|
||||
//Challenges
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 9;
|
||||
Challenge[1] = "S3 Killer\t50\t100\tNone";
|
||||
Challenge[2] = "S3 Extremist\t100\t150\tGrip";
|
||||
Challenge[3] = "S3 Expert\t250\t250\tLaser";
|
||||
Challenge[4] = "S3 Master\t500\t500\tSilencer";
|
||||
Challenge[5] = "S3 God\t1500\t1000\tBurst Clip";
|
||||
Challenge[6] = "S3 Bronze Commendation\t5000\t10000\tNone";
|
||||
Challenge[7] = "S3 Silver Commendation\t10000\t25000\tNone";
|
||||
Challenge[8] = "S3 Gold Commendation\t25000\t50000\tNone";
|
||||
Challenge[9] = "S3 Titan Commendation\t50000\t75000\tNone";
|
||||
Upgrade[1] = "Grip";
|
||||
Upgrade[2] = "Laser";
|
||||
Upgrade[3] = "Silencer";
|
||||
Upgrade[4] = "Burst Clip";
|
||||
GunName = "S3 Combat Rifle";
|
||||
//
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "1.0 0.3 1.0";
|
||||
shellExitOffset = "0.15 -0.56 -0.1";
|
||||
shellExitVariance = 15.0;
|
||||
shellVelocity = 3.0;
|
||||
|
||||
projectileSpread = 3.0 / 1000.0;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.01;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
stateEmitterTime[3] = 0.2;
|
||||
//stateSound[3] = S3FireSound;
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 0.9;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
stateName[7] = "WetFire";
|
||||
stateSound[7] = PlasmaFireWetSound;
|
||||
stateTimeoutValue[7] = 1.0;
|
||||
stateTransitionOnTimeout[7] = "Ready";
|
||||
|
||||
stateName[8] = "CheckWet";
|
||||
stateTransitionOnWet[8] = "WetFire";
|
||||
stateTransitionOnNotWet[8] = "Fire";
|
||||
};
|
||||
|
||||
datablock ItemData(S3Rifle)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
image = S3RifleImage;
|
||||
mass = 1.0;
|
||||
elasticity = 0.0;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "an S3 Combat Rifle";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function S3RifleImage::OnFire(%data, %obj, %slot) {
|
||||
if(%obj.client.UpgradeOn("Burst Clip", %data.getName())) {
|
||||
|
||||
%spread = %data.projectileSpread;
|
||||
if(%obj.client !$= "") {
|
||||
if(%obj.client.IsActivePerk("Advanced Grip")) {
|
||||
%spread = %spread / 2.5;
|
||||
}
|
||||
}
|
||||
|
||||
%vec2 = %obj.getMuzzleVector(%slot);
|
||||
%x = (getRandom() - 0.5) * 2 * 3.1415926 * %spread;
|
||||
%y = (getRandom() - 0.5) * 2 * 3.1415926 * %spread;
|
||||
%z = (getRandom() - 0.5) * 2 * 3.1415926 * %spread;
|
||||
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
|
||||
%vector2 = MatrixMulVector(%mat, %vec2);
|
||||
|
||||
%vec3 = %obj.getMuzzleVector(%slot);
|
||||
%x = (getRandom() - 0.5) * 2 * 3.1415926 * %spread;
|
||||
%y = (getRandom() - 0.5) * 2 * 3.1415926 * %spread;
|
||||
%z = (getRandom() - 0.5) * 2 * 3.1415926 * %spread;
|
||||
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
|
||||
%vector3 = MatrixMulVector(%mat, %vec3);
|
||||
|
||||
%p1 = Parent::OnFire(%data, %obj, %slot);
|
||||
|
||||
%p2 = Schedule(100, 0, "spawnprojectile", %data.Projectile, %data.ProjectileType, vectorAdd(%obj.getPosition(), "-.45 0 1.4"), %vector2, %obj);
|
||||
%p2.WeaponImageSource = "S3RifleImage";
|
||||
schedule(100, 0, "ServerPlay3D", "S3FireSound", %obj.getPosition());
|
||||
|
||||
%p3 = Schedule(250, 0, "spawnprojectile", %data.Projectile, %data.ProjectileType, vectorAdd(%obj.getPosition(), "-.45 0 1.4"), %vector3, %obj);
|
||||
%p3.WeaponImageSource = "S3RifleImage";
|
||||
schedule(250, 0, "ServerPlay3D", "S3FireSound", %obj.getPosition());
|
||||
}
|
||||
else if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
|
||||
%p = Parent::OnFire(%data, %obj, %slot);
|
||||
}
|
||||
else {
|
||||
%p = Parent::OnFire(%data, %obj, %slot);
|
||||
serverPlay3d(S3FireSound, %obj.getPosition());
|
||||
}
|
||||
}
|
||||
176
scripts/weapons/Rifles/S3S.cs
Normal file
176
scripts/weapons/Rifles/S3S.cs
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
datablock TracerProjectileData(S3SBullet) {
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.45;
|
||||
directDamageType = $DamageType::S3;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
HeadMultiplier = 1.5;
|
||||
LegsMultiplier = 0.35;
|
||||
|
||||
HeadShotKill = 1;
|
||||
|
||||
kickBackStrength = 15.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
ImageSource = "S3SRifleImage";
|
||||
|
||||
dryVelocity = 3000.0;
|
||||
wetVelocity = 2000.0;
|
||||
velInheritFactor = 1.0;
|
||||
fizzleTimeMS = 1000;
|
||||
lifetimeMS = 1000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 20.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
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.09;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
};
|
||||
|
||||
datablock ItemData(S3SRifleAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "Some S3S Rifle Bullets";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(S3SRifleImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
mass = 10;
|
||||
item = S3SRifle;
|
||||
ammo = S3SRifleAmmo;
|
||||
projectile = S3SBullet;
|
||||
projectileType = TracerProjectile;
|
||||
emap = true;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "S3SRifleClip";
|
||||
ClipPickupName["S3SRifleClip"] = "some S3S Clip Cartridges";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 4;
|
||||
ClipReturn = 30;
|
||||
InitialClips = 6;
|
||||
//
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "1.0 0.3 1.0";
|
||||
shellExitOffset = "0.15 -0.56 -0.1";
|
||||
shellExitVariance = 15.0;
|
||||
shellVelocity = 3.0;
|
||||
|
||||
projectileSpread = 2.0 / 1000.0;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Fire2";
|
||||
stateTimeoutValue[3] = 0.04;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
stateEmitterTime[3] = 0.2;
|
||||
stateSound[3] = S3FireSound;
|
||||
|
||||
stateName[4] = "Fire2";
|
||||
stateTransitionOnTimeout[4] = "Fire3";
|
||||
stateTimeoutValue[4] = 0.04;
|
||||
stateFire[4] = true;
|
||||
stateRecoil[4] = LightRecoil;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateScript[4] = "onFire";
|
||||
stateEmitterTime[4] = 0.2;
|
||||
stateSound[4] = S3FireSound;
|
||||
|
||||
stateName[5] = "Fire3";
|
||||
stateTransitionOnTimeout[5] = "Reload";
|
||||
stateTimeoutValue[5] = 0.04;
|
||||
stateFire[5] = true;
|
||||
stateRecoil[5] = LightRecoil;
|
||||
stateAllowImageChange[5] = false;
|
||||
stateScript[5] = "onFire";
|
||||
stateEmitterTime[5] = 0.2;
|
||||
stateSound[5] = S3FireSound;
|
||||
|
||||
stateName[6] = "Reload";
|
||||
stateTransitionOnNoAmmo[6] = "NoAmmo";
|
||||
stateTransitionOnTimeout[6] = "Ready";
|
||||
stateTimeoutValue[6] = 0.9;
|
||||
stateAllowImageChange[6] = false;
|
||||
stateSequence[6] = "Reload";
|
||||
|
||||
stateName[7] = "NoAmmo";
|
||||
stateTransitionOnAmmo[7] = "Reload";
|
||||
stateSequence[7] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[7] = "DryFire";
|
||||
|
||||
stateName[8] = "DryFire";
|
||||
stateSound[8] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[8] = 1.0;
|
||||
stateTransitionOnTimeout[8] = "NoAmmo";
|
||||
|
||||
stateName[9] = "WetFire";
|
||||
stateSound[9] = PlasmaFireWetSound;
|
||||
stateTimeoutValue[9] = 1.0;
|
||||
stateTransitionOnTimeout[9] = "Ready";
|
||||
|
||||
stateName[10] = "CheckWet";
|
||||
stateTransitionOnWet[10] = "WetFire";
|
||||
stateTransitionOnNotWet[10] = "Fire";
|
||||
};
|
||||
|
||||
datablock ItemData(S3SRifle)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
image = S3SRifleImage;
|
||||
mass = 1.0;
|
||||
elasticity = 0.0;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "an S3S Combat Rifle";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
230
scripts/weapons/SMGs/MP26.cs
Normal file
230
scripts/weapons/SMGs/MP26.cs
Normal file
|
|
@ -0,0 +1,230 @@
|
|||
datablock TracerProjectileData(Mp26Bullet)
|
||||
{
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.17;
|
||||
directDamageType = $DamageType::MP26;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
HeadMultiplier = 1.25;
|
||||
LegsMultiplier = 0.75;
|
||||
|
||||
kickBackStrength = 15.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
ImageSource = "Mp26Image";
|
||||
|
||||
dryVelocity = 1750.0;
|
||||
wetVelocity = 1500.0;
|
||||
velInheritFactor = 0.0;
|
||||
fizzleTimeMS = 3000;
|
||||
lifetimeMS = 3000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 9.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
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.09;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Ammo
|
||||
//--------------------------------------
|
||||
|
||||
datablock ItemData(Mp26Ammo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some MP26 ammo";
|
||||
|
||||
computeCRC = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(Mp26Image)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_energy_vehicle.dts";
|
||||
item = Mp26;
|
||||
ammo = Mp26Ammo;
|
||||
projectile = Mp26Bullet;
|
||||
projectileType = TracerProjectile;
|
||||
emap = true;
|
||||
offset = "0 0.5 0"; // L/R - F/B - T/B
|
||||
rotation = "0 1 0 180";
|
||||
mass = 11;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "MP26Clip";
|
||||
ClipPickupName["MP26Clip"] = "some MP26 Magazines";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 4;
|
||||
ClipReturn = 30;
|
||||
InitialClips = 6;
|
||||
//
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 9;
|
||||
Challenge[1] = "MP26 Killer\t50\t100\tNone";
|
||||
Challenge[2] = "MP26 Hunter\t100\t250\tNone";
|
||||
Challenge[3] = "MP26 Expert\t250\t500\tGrip";
|
||||
Challenge[4] = "MP26 Master\t500\t1000\tLaser";
|
||||
Challenge[5] = "MP26 God\t1000\t2000\tSilencer";
|
||||
Challenge[6] = "MP26 Bronze Commendation\t2500\t10000\tNone";
|
||||
Challenge[7] = "MP26 Silver Commendation\t5000\t25000\tNone";
|
||||
Challenge[8] = "MP26 Gold Commendation\t10000\t50000\tNone";
|
||||
Challenge[9] = "MP26 Titan Commendation\t25000\t75000\tNone";
|
||||
Upgrade[1] = "Grip";
|
||||
Upgrade[2] = "Laser";
|
||||
Upgrade[3] = "Silencer";
|
||||
GunName = "MP26 Sub Machine Gun";
|
||||
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "1.0 0.3 1.0";
|
||||
shellExitOffset = "0.15 -0.56 -0.1";
|
||||
shellExitVariance = 15.0;
|
||||
shellVelocity = 3.0;
|
||||
|
||||
projectileSpread = 4.0 / 1000.0;
|
||||
|
||||
//--------------------------------------
|
||||
stateName[0] = "Activate";
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
stateAllowImageChange[0] = false;
|
||||
//
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateTransitionOnTimeout[0] = "Ready";
|
||||
stateTransitionOnNoAmmo[0] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[1] = "Ready";
|
||||
stateSpinThread[1] = Stop;
|
||||
//
|
||||
stateTransitionOnTriggerDown[1] = "Spinup";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[2] = "NoAmmo";
|
||||
stateTransitionOnAmmo[2] = "Ready";
|
||||
stateSpinThread[2] = Stop;
|
||||
stateTransitionOnTriggerDown[2] = "DryFire";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[3] = "Spinup";
|
||||
stateSpinThread[3] = SpinUp;
|
||||
stateSound[3] = ChaingunSpinupSound;
|
||||
//
|
||||
stateTimeoutValue[3] = 0.01;
|
||||
stateWaitForTimeout[3] = false;
|
||||
stateTransitionOnTimeout[3] = "Fire";
|
||||
stateTransitionOnTriggerUp[3] = "Spindown";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[4] = "Fire";
|
||||
stateSequence[4] = "Fire";
|
||||
stateSequenceRandomFlash[4] = true;
|
||||
stateSpinThread[4] = FullSpeed;
|
||||
//stateSound[4] = ChaingunFireSound;
|
||||
stateRecoil[4] = LightRecoil;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateScript[4] = "onFire";
|
||||
stateFire[4] = true;
|
||||
stateEjectShell[4] = true;
|
||||
//
|
||||
stateTimeoutValue[4] = 0.13;
|
||||
stateTransitionOnTimeout[4] = "Fire";
|
||||
stateTransitionOnTriggerUp[4] = "Spindown";
|
||||
stateTransitionOnNoAmmo[4] = "EmptySpindown";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[5] = "Spindown";
|
||||
stateSound[5] = ChaingunSpinDownSound;
|
||||
stateSpinThread[5] = SpinDown;
|
||||
//
|
||||
stateTimeoutValue[5] = 0.05;
|
||||
stateWaitForTimeout[5] = true;
|
||||
stateTransitionOnTimeout[5] = "Ready";
|
||||
stateTransitionOnTriggerDown[5] = "Spinup";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[6] = "EmptySpindown";
|
||||
stateSound[6] = ChaingunSpinDownSound;
|
||||
stateSpinThread[6] = SpinDown;
|
||||
//
|
||||
stateTimeoutValue[6] = 0.5;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[7] = "DryFire";
|
||||
stateSound[7] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[7] = 0.5;
|
||||
stateTransitionOnTimeout[7] = "NoAmmo";
|
||||
};
|
||||
|
||||
datablock ItemData(Mp26)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_energy_vehicle.dts";
|
||||
image = Mp26Image;
|
||||
mass = 1.0;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a MP26 SMG";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(Mp26BarrelImage) {
|
||||
ammo = Mp26Ammo;
|
||||
shapeFile = "weapon_targeting.dts";
|
||||
offset = "0.0 0.0 0.0";
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function Mp26Image::onMount(%this,%obj,%slot) {
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
%obj.mountImage(Mp26BarrelImage, 3);
|
||||
}
|
||||
|
||||
function Mp26Image::onUnmount(%this,%obj,%slot) {
|
||||
Parent::onUnmount(%this, %obj, %slot);
|
||||
%obj.unmountImage(3);
|
||||
}
|
||||
|
||||
function Mp26Image::onFire(%data, %obj, %slot) {
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
|
||||
//zero sound :p
|
||||
}
|
||||
else {
|
||||
ServerPlay3d(ChaingunFireSound, %obj.getPosition());
|
||||
}
|
||||
}
|
||||
214
scripts/weapons/SMGs/MP26CMDO.cs
Normal file
214
scripts/weapons/SMGs/MP26CMDO.cs
Normal file
|
|
@ -0,0 +1,214 @@
|
|||
datablock AudioProfile(MP26CMDOFireSound)
|
||||
{
|
||||
filename = "fx/vehicles/tank_chaingun.wav";
|
||||
description = AudioDefault3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock TracerProjectileData(Mp26CMDOBullet) {
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.22;
|
||||
directDamageType = $DamageType::Mp26;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
HeadMultiplier = 1.25;
|
||||
LegsMultiplier = 0.75;
|
||||
|
||||
kickBackStrength = 15.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
ImageSource = "Mp26CMDOImage";
|
||||
|
||||
dryVelocity = 1750.0;
|
||||
wetVelocity = 1500.0;
|
||||
velInheritFactor = 0.0;
|
||||
fizzleTimeMS = 3000;
|
||||
lifetimeMS = 3000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 9.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
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.09;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Ammo
|
||||
//--------------------------------------
|
||||
|
||||
datablock ItemData(Mp26CMDOAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some Mp26CMDO ammo";
|
||||
|
||||
computeCRC = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(Mp26CMDOImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_energy_vehicle.dts";
|
||||
item = Mp26CMDO;
|
||||
ammo = Mp26CMDOAmmo;
|
||||
projectile = Mp26CMDOBullet;
|
||||
projectileType = TracerProjectile;
|
||||
emap = true;
|
||||
offset = "0 0.5 0"; // L/R - F/B - T/B
|
||||
rotation = "0 1 0 180";
|
||||
mass = 11;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "MP26CMDOClip";
|
||||
ClipPickupName["MP26CMDOClip"] = "some MP26 CMDO Magazines";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 3;
|
||||
ClipReturn = 50;
|
||||
InitialClips = 6;
|
||||
//
|
||||
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "1.0 0.3 1.0";
|
||||
shellExitOffset = "0.15 -0.56 -0.1";
|
||||
shellExitVariance = 15.0;
|
||||
shellVelocity = 3.0;
|
||||
|
||||
projectileSpread = 3.2 / 1000.0;
|
||||
|
||||
//--------------------------------------
|
||||
stateName[0] = "Activate";
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
stateAllowImageChange[0] = false;
|
||||
//
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateTransitionOnTimeout[0] = "Ready";
|
||||
stateTransitionOnNoAmmo[0] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[1] = "Ready";
|
||||
stateSpinThread[1] = Stop;
|
||||
//
|
||||
stateTransitionOnTriggerDown[1] = "Spinup";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[2] = "NoAmmo";
|
||||
stateTransitionOnAmmo[2] = "Ready";
|
||||
stateSpinThread[2] = Stop;
|
||||
stateTransitionOnTriggerDown[2] = "DryFire";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[3] = "Spinup";
|
||||
stateSpinThread[3] = SpinUp;
|
||||
stateSound[3] = ChaingunSpinupSound;
|
||||
//
|
||||
stateTimeoutValue[3] = 0.01;
|
||||
stateWaitForTimeout[3] = false;
|
||||
stateTransitionOnTimeout[3] = "Fire";
|
||||
stateTransitionOnTriggerUp[3] = "Spindown";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[4] = "Fire";
|
||||
stateSequence[4] = "Fire";
|
||||
stateSequenceRandomFlash[4] = true;
|
||||
stateSpinThread[4] = FullSpeed;
|
||||
stateSound[4] = MP26CMDOFireSound;
|
||||
stateRecoil[4] = LightRecoil;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateScript[4] = "onFire";
|
||||
stateFire[4] = true;
|
||||
stateEjectShell[4] = true;
|
||||
//
|
||||
stateTimeoutValue[4] = 0.08;
|
||||
stateTransitionOnTimeout[4] = "Fire";
|
||||
stateTransitionOnTriggerUp[4] = "Spindown";
|
||||
stateTransitionOnNoAmmo[4] = "EmptySpindown";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[5] = "Spindown";
|
||||
stateSound[5] = ChaingunSpinDownSound;
|
||||
stateSpinThread[5] = SpinDown;
|
||||
//
|
||||
stateTimeoutValue[5] = 0.05;
|
||||
stateWaitForTimeout[5] = true;
|
||||
stateTransitionOnTimeout[5] = "Ready";
|
||||
stateTransitionOnTriggerDown[5] = "Spinup";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[6] = "EmptySpindown";
|
||||
stateSound[6] = ChaingunSpinDownSound;
|
||||
stateSpinThread[6] = SpinDown;
|
||||
//
|
||||
stateTimeoutValue[6] = 0.5;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[7] = "DryFire";
|
||||
stateSound[7] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[7] = 0.5;
|
||||
stateTransitionOnTimeout[7] = "NoAmmo";
|
||||
};
|
||||
|
||||
datablock ItemData(Mp26CMDO)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_energy_vehicle.dts";
|
||||
image = Mp26CMDOImage;
|
||||
mass = 1.0;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a Mp26 CMDO SMG";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(Mp26CMDOBarrelImage) {
|
||||
ammo = Mp26CMDOAmmo;
|
||||
shapeFile = "weapon_targeting.dts";
|
||||
offset = "0.0 0.0 0.0";
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function Mp26CMDOImage::onMount(%this,%obj,%slot) {
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
%obj.mountImage(Mp26CMDOBarrelImage, 3);
|
||||
%obj.client.ActivateUpgrade(Mp26CMDOImage, "Laser");
|
||||
}
|
||||
|
||||
function Mp26CMDOImage::onUnmount(%this,%obj,%slot) {
|
||||
Parent::onUnmount(%this, %obj, %slot);
|
||||
%obj.unmountImage(3);
|
||||
PerformUpgradeDisable(Mp26CMDOImage, %obj);
|
||||
}
|
||||
|
||||
233
scripts/weapons/SMGs/P90.cs
Normal file
233
scripts/weapons/SMGs/P90.cs
Normal file
|
|
@ -0,0 +1,233 @@
|
|||
datablock TracerProjectileData(P90Bullet)
|
||||
{
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.08;
|
||||
directDamageType = $DamageType::P90;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
HeadMultiplier = 1.25;
|
||||
LegsMultiplier = 0.75;
|
||||
|
||||
kickBackStrength = 15.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
ImageSource = "P90Image";
|
||||
|
||||
dryVelocity = 1750.0;
|
||||
wetVelocity = 1500.0;
|
||||
velInheritFactor = 0.0;
|
||||
fizzleTimeMS = 3000;
|
||||
lifetimeMS = 3000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 9.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
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.09;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Ammo
|
||||
//--------------------------------------
|
||||
|
||||
datablock ItemData(P90Ammo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some P90 ammo";
|
||||
|
||||
computeCRC = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(P90Image)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_energy_vehicle.dts";
|
||||
item = P90;
|
||||
ammo = P90Ammo;
|
||||
projectile = P90Bullet;
|
||||
projectileType = TracerProjectile;
|
||||
emap = true;
|
||||
offset = "0 0.5 0"; // L/R - F/B - T/B
|
||||
rotation = "0 1 0 180";
|
||||
mass = 11;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "P90Clip";
|
||||
ClipPickupName["P90Clip"] = "some P90 Magazines";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 5;
|
||||
ClipReturn = 65;
|
||||
InitialClips = 7;
|
||||
//
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 9;
|
||||
Challenge[1] = "P90 Killer\t50\t100\tNone";
|
||||
Challenge[2] = "P90 Hunter\t100\t250\tNone";
|
||||
Challenge[3] = "P90 Expert\t250\t500\tGrip";
|
||||
Challenge[4] = "P90 Master\t500\t1000\tLaser";
|
||||
Challenge[5] = "P90 God\t1000\t2000\tSilencer";
|
||||
Challenge[6] = "P90 Bronze Commendation\t2500\t10000\tNone";
|
||||
Challenge[7] = "P90 Silver Commendation\t5000\t25000\tNone";
|
||||
Challenge[8] = "P90 Gold Commendation\t10000\t50000\tNone";
|
||||
Challenge[9] = "P90 Titan Commendation\t25000\t75000\tNone";
|
||||
Upgrade[1] = "Grip";
|
||||
Upgrade[2] = "Laser";
|
||||
Upgrade[3] = "Silencer";
|
||||
GunName = "P90 SMG";
|
||||
|
||||
RankRequire = $TWM2::RankRequire["P90"];
|
||||
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "1.0 0.3 1.0";
|
||||
shellExitOffset = "0.15 -0.56 -0.1";
|
||||
shellExitVariance = 15.0;
|
||||
shellVelocity = 3.0;
|
||||
|
||||
projectileSpread = 4.0 / 1000.0;
|
||||
|
||||
//--------------------------------------
|
||||
stateName[0] = "Activate";
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
stateAllowImageChange[0] = false;
|
||||
//
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateTransitionOnTimeout[0] = "Ready";
|
||||
stateTransitionOnNoAmmo[0] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[1] = "Ready";
|
||||
stateSpinThread[1] = Stop;
|
||||
//
|
||||
stateTransitionOnTriggerDown[1] = "Spinup";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[2] = "NoAmmo";
|
||||
stateTransitionOnAmmo[2] = "Ready";
|
||||
stateSpinThread[2] = Stop;
|
||||
stateTransitionOnTriggerDown[2] = "DryFire";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[3] = "Spinup";
|
||||
stateSpinThread[3] = SpinUp;
|
||||
stateSound[3] = ChaingunSpinupSound;
|
||||
//
|
||||
stateTimeoutValue[3] = 0.01;
|
||||
stateWaitForTimeout[3] = false;
|
||||
stateTransitionOnTimeout[3] = "Fire";
|
||||
stateTransitionOnTriggerUp[3] = "Spindown";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[4] = "Fire";
|
||||
stateSequence[4] = "Fire";
|
||||
stateSequenceRandomFlash[4] = true;
|
||||
stateSpinThread[4] = FullSpeed;
|
||||
//stateSound[4] = ChaingunFireSound;
|
||||
stateRecoil[4] = LightRecoil;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateScript[4] = "onFire";
|
||||
stateFire[4] = true;
|
||||
stateEjectShell[4] = true;
|
||||
//
|
||||
stateTimeoutValue[4] = 0.05;
|
||||
stateTransitionOnTimeout[4] = "Fire";
|
||||
stateTransitionOnTriggerUp[4] = "Spindown";
|
||||
stateTransitionOnNoAmmo[4] = "EmptySpindown";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[5] = "Spindown";
|
||||
stateSound[5] = ChaingunSpinDownSound;
|
||||
stateSpinThread[5] = SpinDown;
|
||||
//
|
||||
stateTimeoutValue[5] = 0.03;
|
||||
stateWaitForTimeout[5] = true;
|
||||
stateTransitionOnTimeout[5] = "Ready";
|
||||
stateTransitionOnTriggerDown[5] = "Spinup";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[6] = "EmptySpindown";
|
||||
stateSound[6] = ChaingunSpinDownSound;
|
||||
stateSpinThread[6] = SpinDown;
|
||||
//
|
||||
stateTimeoutValue[6] = 0.5;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[7] = "DryFire";
|
||||
stateSound[7] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[7] = 0.5;
|
||||
stateTransitionOnTimeout[7] = "NoAmmo";
|
||||
};
|
||||
|
||||
datablock ItemData(P90)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_energy_vehicle.dts";
|
||||
image = P90Image;
|
||||
mass = 1.0;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a P90 SMG";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(P90BarrelImage) {
|
||||
ammo = P90Ammo;
|
||||
shapeFile = "weapon_targeting.dts";
|
||||
offset = "0.0 0.0 0.0";
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function P90Image::onMount(%this,%obj,%slot) {
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
%obj.mountImage(P90BarrelImage, 3);
|
||||
}
|
||||
|
||||
function P90Image::onUnmount(%this,%obj,%slot) {
|
||||
Parent::onUnmount(%this, %obj, %slot);
|
||||
%obj.unmountImage(3);
|
||||
%obj.unmountImage(4);
|
||||
}
|
||||
|
||||
function P90Image::onFire(%data, %obj, %slot) {
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
|
||||
//zero sound :p
|
||||
}
|
||||
else {
|
||||
ServerPlay3d(ChaingunFireSound, %obj.getPosition());
|
||||
}
|
||||
}
|
||||
250
scripts/weapons/SMGs/Pg700.cs
Normal file
250
scripts/weapons/SMGs/Pg700.cs
Normal file
|
|
@ -0,0 +1,250 @@
|
|||
datablock TracerProjectileData(Pg700Bullet)
|
||||
{
|
||||
doDynamicClientHits = true;
|
||||
|
||||
isBullet = true;
|
||||
isPistol = false;
|
||||
isAntiAir = false;
|
||||
isAntiArmor = false;
|
||||
|
||||
directDamage = 0.09;
|
||||
directDamageType = $DamageType::Pg700;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
HeadMultiplier = 1.25;
|
||||
LegsMultiplier = 0.75;
|
||||
|
||||
kickBackStrength = 15.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
ImageSource = "Pg700Image";
|
||||
|
||||
dryVelocity = 1750.0;
|
||||
wetVelocity = 1500.0;
|
||||
velInheritFactor = 0.0;
|
||||
fizzleTimeMS = 3000;
|
||||
lifetimeMS = 3000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 9.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
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.09;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Ammo
|
||||
//--------------------------------------
|
||||
|
||||
datablock ItemData(Pg700Ammo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some Pg700 ammo";
|
||||
|
||||
computeCRC = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(Pg700Image)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_energy_vehicle.dts";
|
||||
item = Pg700;
|
||||
ammo = Pg700Ammo;
|
||||
projectile = Pg700Bullet;
|
||||
projectileType = TracerProjectile;
|
||||
emap = true;
|
||||
offset = "0 0.5 0"; // L/R - F/B - T/B
|
||||
rotation = "0 1 0 180";
|
||||
mass = 11;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "Pg700Clip";
|
||||
ClipPickupName["Pg700Clip"] = "some Pg700 Magazines";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 4;
|
||||
ClipReturn = 45;
|
||||
InitialClips = 7;
|
||||
//
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 9;
|
||||
Challenge[1] = "Pg700 Killer\t50\t100\tNone";
|
||||
Challenge[2] = "Pg700 Hunter\t100\t250\tNone";
|
||||
Challenge[3] = "Pg700 Expert\t250\t500\tGrip";
|
||||
Challenge[4] = "Pg700 Master\t500\t1000\tLaser";
|
||||
Challenge[5] = "Pg700 God\t1000\t2000\tSilencer";
|
||||
Challenge[6] = "Pg700 Bronze Commendation\t2500\t10000\tNone";
|
||||
Challenge[7] = "Pg700 Silver Commendation\t5000\t25000\tNone";
|
||||
Challenge[8] = "Pg700 Gold Commendation\t10000\t50000\tNone";
|
||||
Challenge[9] = "Pg700 Titan Commendation\t25000\t75000\tNone";
|
||||
Upgrade[1] = "Grip";
|
||||
Upgrade[2] = "Laser";
|
||||
Upgrade[3] = "Silencer";
|
||||
GunName = "Pg700 Assault Rifle";
|
||||
|
||||
RankRequire = $TWM2::RankRequire["Pg700"];
|
||||
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "1.0 0.3 1.0";
|
||||
shellExitOffset = "0.15 -0.56 -0.1";
|
||||
shellExitVariance = 15.0;
|
||||
shellVelocity = 3.0;
|
||||
|
||||
projectileSpread = 3.0 / 1000.0;
|
||||
|
||||
//--------------------------------------
|
||||
stateName[0] = "Activate";
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
stateAllowImageChange[0] = false;
|
||||
//
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateTransitionOnTimeout[0] = "Ready";
|
||||
stateTransitionOnNoAmmo[0] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[1] = "Ready";
|
||||
stateSpinThread[1] = Stop;
|
||||
//
|
||||
stateTransitionOnTriggerDown[1] = "Spinup";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[2] = "NoAmmo";
|
||||
stateTransitionOnAmmo[2] = "Ready";
|
||||
stateSpinThread[2] = Stop;
|
||||
stateTransitionOnTriggerDown[2] = "DryFire";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[3] = "Spinup";
|
||||
stateSpinThread[3] = SpinUp;
|
||||
stateSound[3] = ChaingunSpinupSound;
|
||||
//
|
||||
stateTimeoutValue[3] = 0.01;
|
||||
stateWaitForTimeout[3] = false;
|
||||
stateTransitionOnTimeout[3] = "Fire";
|
||||
stateTransitionOnTriggerUp[3] = "Spindown";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[4] = "Fire";
|
||||
stateSequence[4] = "Fire";
|
||||
stateSequenceRandomFlash[4] = true;
|
||||
stateSpinThread[4] = FullSpeed;
|
||||
//stateSound[4] = ChaingunFireSound;
|
||||
stateRecoil[4] = LightRecoil;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateScript[4] = "onFire";
|
||||
stateFire[4] = true;
|
||||
stateEjectShell[4] = true;
|
||||
//
|
||||
stateTimeoutValue[4] = 0.08;
|
||||
stateTransitionOnTimeout[4] = "Fire";
|
||||
stateTransitionOnTriggerUp[4] = "Spindown";
|
||||
stateTransitionOnNoAmmo[4] = "EmptySpindown";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[5] = "Spindown";
|
||||
stateSound[5] = ChaingunSpinDownSound;
|
||||
stateSpinThread[5] = SpinDown;
|
||||
//
|
||||
stateTimeoutValue[5] = 0.05;
|
||||
stateWaitForTimeout[5] = true;
|
||||
stateTransitionOnTimeout[5] = "Ready";
|
||||
stateTransitionOnTriggerDown[5] = "Spinup";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[6] = "EmptySpindown";
|
||||
stateSound[6] = ChaingunSpinDownSound;
|
||||
stateSpinThread[6] = SpinDown;
|
||||
//
|
||||
stateTimeoutValue[6] = 0.5;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[7] = "DryFire";
|
||||
stateSound[7] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[7] = 0.5;
|
||||
stateTransitionOnTimeout[7] = "NoAmmo";
|
||||
};
|
||||
|
||||
datablock ItemData(Pg700)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_energy_vehicle.dts";
|
||||
image = Pg700Image;
|
||||
mass = 1.0;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a Pg700 SMG";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(Pg700BarrelImage) {
|
||||
ammo = Pg700Ammo;
|
||||
shapeFile = "weapon_targeting.dts";
|
||||
offset = "0.0 0.0 0.0";
|
||||
emap = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(Pg700ScopeImage) {
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_targeting.dts";
|
||||
offset = "0.0 1.4 0.4";
|
||||
rotation = "180 0 0 90";
|
||||
|
||||
ammo = Pg700Ammo;
|
||||
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function Pg700Image::onMount(%this,%obj,%slot) {
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
%obj.mountImage(Pg700BarrelImage, 3);
|
||||
%obj.mountImage(Pg700ScopeImage, 4);
|
||||
}
|
||||
|
||||
function Pg700Image::onUnmount(%this,%obj,%slot) {
|
||||
Parent::onUnmount(%this, %obj, %slot);
|
||||
%obj.unmountImage(3);
|
||||
%obj.unmountImage(4);
|
||||
}
|
||||
|
||||
function Pg700Image::onFire(%data, %obj, %slot) {
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
|
||||
//zero sound :p
|
||||
}
|
||||
else {
|
||||
ServerPlay3d(ChaingunFireSound, %obj.getPosition());
|
||||
}
|
||||
}
|
||||
225
scripts/weapons/SMGs/PulseSMG.cs
Normal file
225
scripts/weapons/SMGs/PulseSMG.cs
Normal file
|
|
@ -0,0 +1,225 @@
|
|||
datablock TracerProjectileData(PulseSMGBullet) {
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.08;
|
||||
explosion = "BlasterExplosion";
|
||||
splash = ChaingunSplash;
|
||||
|
||||
directDamageType = $DamageType::ShrikeBlaster;
|
||||
kickBackStrength = 0.0;
|
||||
|
||||
sound = ShrikeBlasterProjectileSound;
|
||||
|
||||
ImageSource = "PulseSMGImage";
|
||||
|
||||
dryVelocity = 425.0;
|
||||
wetVelocity = 100.0;
|
||||
velInheritFactor = 1.0;
|
||||
fizzleTimeMS = 1000;
|
||||
lifetimeMS = 1000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 30.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
tracerColor = "1.0 1.0 1.0 1.0";
|
||||
tracerTex[0] = "special/shrikeBolt";
|
||||
tracerTex[1] = "special/shrikeBoltCross";
|
||||
tracerWidth = 0.55;
|
||||
crossSize = 0.99;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Ammo
|
||||
//--------------------------------------
|
||||
|
||||
datablock ItemData(PulseSMGAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some PulseSMG ammo";
|
||||
|
||||
computeCRC = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(PulseSMGImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_energy_vehicle.dts";
|
||||
item = PulseSMG;
|
||||
ammo = PulseSMGAmmo;
|
||||
projectile = PulseSMGBullet;
|
||||
projectileType = TracerProjectile;
|
||||
emap = true;
|
||||
offset = "0 0.5 0"; // L/R - F/B - T/B
|
||||
rotation = "0 1 0 180";
|
||||
mass = 11;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "PulseSMGClip";
|
||||
ClipPickupName["PulseSMGClip"] = "some PulseSMG Magazines";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 4;
|
||||
ClipReturn = 45;
|
||||
InitialClips = 7;
|
||||
//
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 9;
|
||||
Challenge[1] = "Pulse SMG Killer\t50\t100\tNone";
|
||||
Challenge[2] = "Pulse SMG Hunter\t100\t250\tNone";
|
||||
Challenge[3] = "Pulse SMG Expert\t250\t500\tGrip";
|
||||
Challenge[4] = "Pulse SMG Master\t500\t1000\tLaser";
|
||||
Challenge[5] = "Pulse SMG God\t1000\t2000\tSilencer";
|
||||
Challenge[6] = "Pulse SMG Bronze Commendation\t2500\t10000\tNone";
|
||||
Challenge[7] = "Pulse SMG Silver Commendation\t5000\t25000\tNone";
|
||||
Challenge[8] = "Pulse SMG Gold Commendation\t10000\t50000\tNone";
|
||||
Challenge[9] = "Pulse SMG Titan Commendation\t25000\t75000\tNone";
|
||||
Upgrade[1] = "Grip";
|
||||
Upgrade[2] = "Laser";
|
||||
Upgrade[3] = "Silencer";
|
||||
GunName = "Pulse SMG";
|
||||
|
||||
RankRequire = $TWM2::RankRequire["Pg700"];
|
||||
PrestigeRequire = 3;
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "1.0 0.3 1.0";
|
||||
shellExitOffset = "0.15 -0.56 -0.1";
|
||||
shellExitVariance = 15.0;
|
||||
shellVelocity = 3.0;
|
||||
|
||||
projectileSpread = 3.0 / 1000.0;
|
||||
|
||||
//--------------------------------------
|
||||
stateName[0] = "Activate";
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
stateAllowImageChange[0] = false;
|
||||
//
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateTransitionOnTimeout[0] = "Ready";
|
||||
stateTransitionOnNoAmmo[0] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[1] = "Ready";
|
||||
stateSpinThread[1] = Stop;
|
||||
//
|
||||
stateTransitionOnTriggerDown[1] = "Spinup";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[2] = "NoAmmo";
|
||||
stateTransitionOnAmmo[2] = "Ready";
|
||||
stateSpinThread[2] = Stop;
|
||||
stateTransitionOnTriggerDown[2] = "DryFire";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[3] = "Spinup";
|
||||
stateSpinThread[3] = SpinUp;
|
||||
stateSound[3] = ChaingunSpinupSound;
|
||||
//
|
||||
stateTimeoutValue[3] = 0.01;
|
||||
stateWaitForTimeout[3] = false;
|
||||
stateTransitionOnTimeout[3] = "Fire";
|
||||
stateTransitionOnTriggerUp[3] = "Spindown";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[4] = "Fire";
|
||||
stateSequence[4] = "Fire";
|
||||
stateSequenceRandomFlash[4] = true;
|
||||
stateSpinThread[4] = FullSpeed;
|
||||
//stateSound[4] = ChaingunFireSound;
|
||||
stateRecoil[4] = LightRecoil;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateScript[4] = "onFire";
|
||||
stateFire[4] = true;
|
||||
stateEjectShell[4] = true;
|
||||
//
|
||||
stateTimeoutValue[4] = 0.08;
|
||||
stateTransitionOnTimeout[4] = "Fire";
|
||||
stateTransitionOnTriggerUp[4] = "Spindown";
|
||||
stateTransitionOnNoAmmo[4] = "EmptySpindown";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[5] = "Spindown";
|
||||
stateSound[5] = ChaingunSpinDownSound;
|
||||
stateSpinThread[5] = SpinDown;
|
||||
//
|
||||
stateTimeoutValue[5] = 0.05;
|
||||
stateWaitForTimeout[5] = true;
|
||||
stateTransitionOnTimeout[5] = "Ready";
|
||||
stateTransitionOnTriggerDown[5] = "Spinup";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[6] = "EmptySpindown";
|
||||
stateSound[6] = ChaingunSpinDownSound;
|
||||
stateSpinThread[6] = SpinDown;
|
||||
//
|
||||
stateTimeoutValue[6] = 0.5;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[7] = "DryFire";
|
||||
stateSound[7] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[7] = 0.5;
|
||||
stateTransitionOnTimeout[7] = "NoAmmo";
|
||||
};
|
||||
|
||||
datablock ItemData(PulseSMG)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_energy_vehicle.dts";
|
||||
image = PulseSMGImage;
|
||||
mass = 1.0;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a Pulse SMG";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(PulseSMGBarrelImage) {
|
||||
ammo = PulseSMGAmmo;
|
||||
shapeFile = "weapon_targeting.dts";
|
||||
offset = "0.0 0.0 0.0";
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function PulseSMGImage::onMount(%this,%obj,%slot) {
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
%obj.mountImage(PulseSMGBarrelImage, 3);
|
||||
}
|
||||
|
||||
function PulseSMGImage::onUnmount(%this,%obj,%slot) {
|
||||
Parent::onUnmount(%this, %obj, %slot);
|
||||
%obj.unmountImage(3);
|
||||
%obj.unmountImage(4);
|
||||
}
|
||||
|
||||
function PulseSMGImage::onFire(%data, %obj, %slot) {
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
|
||||
//zero sound :p
|
||||
}
|
||||
else {
|
||||
ServerPlay3d(ChaingunFireSound, %obj.getPosition());
|
||||
}
|
||||
}
|
||||
600
scripts/weapons/SMGs/chaingun.cs
Normal file
600
scripts/weapons/SMGs/chaingun.cs
Normal file
|
|
@ -0,0 +1,600 @@
|
|||
//--------------------------------------
|
||||
// Chaingun
|
||||
//--------------------------------------
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Sounds
|
||||
//--------------------------------------
|
||||
datablock AudioProfile(ChaingunSwitchSound)
|
||||
{
|
||||
filename = "fx/weapons/chaingun_activate.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(ChaingunFireSound)
|
||||
{
|
||||
filename = "fx/weapons/chaingun_fire.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(ChaingunProjectile)
|
||||
{
|
||||
filename = "fx/weapons/chaingun_projectile.wav";
|
||||
description = ProjectileLooping3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(ChaingunImpact)
|
||||
{
|
||||
filename = "fx/weapons/chaingun_impact.WAV";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(ChaingunSpinDownSound)
|
||||
{
|
||||
filename = "fx/weapons/chaingun_spindown.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(ChaingunSpinUpSound)
|
||||
{
|
||||
filename = "fx/weapons/chaingun_spinup.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(ChaingunDryFireSound)
|
||||
{
|
||||
filename = "fx/weapons/chaingun_dryfire.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(ShrikeBlasterProjectileSound)
|
||||
{
|
||||
filename = "fx/vehicles/shrike_blaster_projectile.wav";
|
||||
description = ProjectileLooping3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Splash
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
datablock ParticleData( ChaingunSplashParticle )
|
||||
{
|
||||
dragCoefficient = 1;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.2;
|
||||
constantAcceleration = -1.4;
|
||||
lifetimeMS = 300;
|
||||
lifetimeVarianceMS = 0;
|
||||
textureName = "special/droplet";
|
||||
colors[0] = "0.7 0.8 1.0 1.0";
|
||||
colors[1] = "0.7 0.8 1.0 0.5";
|
||||
colors[2] = "0.7 0.8 1.0 0.0";
|
||||
sizes[0] = 0.05;
|
||||
sizes[1] = 0.2;
|
||||
sizes[2] = 0.2;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData( ChaingunSplashEmitter )
|
||||
{
|
||||
ejectionPeriodMS = 4;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 3;
|
||||
velocityVariance = 1.0;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 50;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
orientParticles = true;
|
||||
lifetimeMS = 100;
|
||||
particles = "ChaingunSplashParticle";
|
||||
};
|
||||
|
||||
|
||||
datablock SplashData(ChaingunSplash)
|
||||
{
|
||||
numSegments = 10;
|
||||
ejectionFreq = 10;
|
||||
ejectionAngle = 20;
|
||||
ringLifetime = 0.4;
|
||||
lifetimeMS = 400;
|
||||
velocity = 3.0;
|
||||
startRadius = 0.0;
|
||||
acceleration = -3.0;
|
||||
texWrap = 5.0;
|
||||
|
||||
texture = "special/water2";
|
||||
|
||||
emitter[0] = ChaingunSplashEmitter;
|
||||
|
||||
colors[0] = "0.7 0.8 1.0 0.0";
|
||||
colors[1] = "0.7 0.8 1.0 1.0";
|
||||
colors[2] = "0.7 0.8 1.0 0.0";
|
||||
colors[3] = "0.7 0.8 1.0 0.0";
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.4;
|
||||
times[2] = 0.8;
|
||||
times[3] = 1.0;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Particle Effects
|
||||
//--------------------------------------
|
||||
datablock ParticleData(ChaingunFireParticle)
|
||||
{
|
||||
dragCoefficient = 2.75;
|
||||
gravityCoefficient = 0.1;
|
||||
inheritedVelFactor = 0.0;
|
||||
constantAcceleration = 0.0;
|
||||
lifetimeMS = 550;
|
||||
lifetimeVarianceMS = 0;
|
||||
textureName = "particleTest";
|
||||
colors[0] = "0.46 0.36 0.26 1.0";
|
||||
colors[1] = "0.46 0.36 0.26 0.0";
|
||||
sizes[0] = 0.25;
|
||||
sizes[1] = 0.20;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(ChaingunFireEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 6;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 10;
|
||||
velocityVariance = 1.0;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 12;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvance = true;
|
||||
particles = "ChaingunFireParticle";
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Explosions
|
||||
//--------------------------------------
|
||||
datablock ParticleData(ChaingunExplosionParticle1)
|
||||
{
|
||||
dragCoefficient = 0.65;
|
||||
gravityCoefficient = 0.3;
|
||||
inheritedVelFactor = 0.0;
|
||||
constantAcceleration = 0.0;
|
||||
lifetimeMS = 500;
|
||||
lifetimeVarianceMS = 150;
|
||||
textureName = "particleTest";
|
||||
colors[0] = "0.56 0.36 0.26 1.0";
|
||||
colors[1] = "0.56 0.36 0.26 0.0";
|
||||
sizes[0] = 0.0625;
|
||||
sizes[1] = 0.2;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(ChaingunExplosionEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 10;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 0.75;
|
||||
velocityVariance = 0.25;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 60;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
particles = "ChaingunExplosionParticle1";
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
datablock ParticleData(ChaingunImpactSmokeParticle)
|
||||
{
|
||||
dragCoefficient = 0.0;
|
||||
gravityCoefficient = -0.2;
|
||||
inheritedVelFactor = 0.0;
|
||||
constantAcceleration = 0.0;
|
||||
lifetimeMS = 1000;
|
||||
lifetimeVarianceMS = 200;
|
||||
useInvAlpha = true;
|
||||
spinRandomMin = -90.0;
|
||||
spinRandomMax = 90.0;
|
||||
textureName = "particleTest";
|
||||
colors[0] = "0.7 0.7 0.7 0.0";
|
||||
colors[1] = "0.7 0.7 0.7 0.4";
|
||||
colors[2] = "0.7 0.7 0.7 0.0";
|
||||
sizes[0] = 0.5;
|
||||
sizes[1] = 0.5;
|
||||
sizes[2] = 1.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(ChaingunImpactSmoke)
|
||||
{
|
||||
ejectionPeriodMS = 8;
|
||||
periodVarianceMS = 1;
|
||||
ejectionVelocity = 1.0;
|
||||
velocityVariance = 0.5;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 35;
|
||||
overrideAdvances = false;
|
||||
particles = "ChaingunImpactSmokeParticle";
|
||||
lifetimeMS = 50;
|
||||
};
|
||||
|
||||
|
||||
datablock ParticleData(ChaingunSparks)
|
||||
{
|
||||
dragCoefficient = 1;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.2;
|
||||
constantAcceleration = 0.0;
|
||||
lifetimeMS = 300;
|
||||
lifetimeVarianceMS = 0;
|
||||
textureName = "special/spark00";
|
||||
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.6;
|
||||
sizes[1] = 0.2;
|
||||
sizes[2] = 0.05;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.2;
|
||||
times[2] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(ChaingunSparkEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 4;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 4;
|
||||
velocityVariance = 2.0;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 50;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
orientParticles = true;
|
||||
lifetimeMS = 100;
|
||||
particles = "ChaingunSparks";
|
||||
};
|
||||
|
||||
|
||||
datablock ExplosionData(ChaingunExplosion)
|
||||
{
|
||||
soundProfile = ChaingunImpact;
|
||||
|
||||
emitter[0] = ChaingunImpactSmoke;
|
||||
emitter[1] = ChaingunSparkEmitter;
|
||||
|
||||
faceViewer = false;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Particle effects
|
||||
//--------------------------------------
|
||||
|
||||
|
||||
datablock DebrisData( ShellDebris )
|
||||
{
|
||||
shapeName = "weapon_chaingun_ammocasing.dts";
|
||||
|
||||
lifetime = 3.0;
|
||||
|
||||
minSpinSpeed = 300.0;
|
||||
maxSpinSpeed = 400.0;
|
||||
|
||||
elasticity = 0.5;
|
||||
friction = 0.2;
|
||||
|
||||
numBounces = 3;
|
||||
|
||||
fade = true;
|
||||
staticOnMaxBounce = true;
|
||||
snapOnMaxBounce = true;
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Projectile
|
||||
//--------------------------------------
|
||||
datablock DecalData(ChaingunDecal1)
|
||||
{
|
||||
sizeX = 0.05;
|
||||
sizeY = 0.05;
|
||||
textureName = "special/bullethole1";
|
||||
};
|
||||
datablock DecalData(ChaingunDecal2) : ChaingunDecal1
|
||||
{
|
||||
textureName = "special/bullethole2";
|
||||
};
|
||||
|
||||
datablock DecalData(ChaingunDecal3) : ChaingunDecal1
|
||||
{
|
||||
textureName = "special/bullethole3";
|
||||
};
|
||||
datablock DecalData(ChaingunDecal4) : ChaingunDecal1
|
||||
{
|
||||
textureName = "special/bullethole4";
|
||||
};
|
||||
datablock DecalData(ChaingunDecal5) : ChaingunDecal1
|
||||
{
|
||||
textureName = "special/bullethole5";
|
||||
};
|
||||
datablock DecalData(ChaingunDecal6) : ChaingunDecal1
|
||||
{
|
||||
textureName = "special/bullethole6";
|
||||
};
|
||||
|
||||
|
||||
datablock TracerProjectileData(ChaingunBullet)
|
||||
{
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.06;
|
||||
directDamageType = $DamageType::Bullet;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
|
||||
kickBackStrength = 0.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
dryVelocity = 425.0;
|
||||
wetVelocity = 100.0;
|
||||
velInheritFactor = 1.0;
|
||||
fizzleTimeMS = 3000;
|
||||
lifetimeMS = 3000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 15.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
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.10;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
ImageSource = "MiniChaingunImage";
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
};
|
||||
|
||||
datablock LinearFlareProjectileData(MCGPhaserBolt) {
|
||||
directDamage = 0.07;
|
||||
directDamageType = $DamageType::Phaser;
|
||||
explosion = "BlasterExplosion";
|
||||
kickBackStrength = 0.0;
|
||||
|
||||
dryVelocity = 120.0;
|
||||
wetVelocity = 40.0;
|
||||
velInheritFactor = 0.5;
|
||||
fizzleTimeMS = 2000;
|
||||
lifetimeMS = 3000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
ImageSource = "MiniChaingunImage";
|
||||
|
||||
numFlares = 5;
|
||||
size = 0.04;
|
||||
flareColor = "1 1 1";
|
||||
flareModTexture = "flaremod";
|
||||
flareBaseTexture = "flarebase";
|
||||
|
||||
sound = BlasterProjectileSound;
|
||||
|
||||
hasLight = true;
|
||||
lightRadius = 3.0;
|
||||
lightColor = "1 1 1";
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Ammo
|
||||
//--------------------------------------
|
||||
|
||||
datablock ItemData(MiniChaingunAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some chaingun ammo";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(MiniChaingunImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_chaingun.dts";
|
||||
item = MiniChaingun;
|
||||
ammo = MiniChaingunAmmo;
|
||||
projectile = ChaingunBullet;
|
||||
projectileType = TracerProjectile;
|
||||
emap = true;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "MiniChaingunClip";
|
||||
ClipPickupName["MiniChaingunClip"] = "some mini-chaingun belts";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 6;
|
||||
ClipReturn = 100;
|
||||
InitialClips = 4;
|
||||
//
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 9;
|
||||
Challenge[1] = "MCG Killer\t50\t100\tNone";
|
||||
Challenge[2] = "MCG Hunter\t100\t250\tGrip";
|
||||
Challenge[3] = "MCG Expert\t250\t500\tLaser";
|
||||
Challenge[4] = "MCG Master\t500\t1000\tSilencer";
|
||||
Challenge[5] = "MCG God\t1000\t2000\tFusion Core";
|
||||
Challenge[6] = "MCG Bronze Commendation\t2500\t10000\tNone";
|
||||
Challenge[7] = "MCG Silver Commendation\t5000\t25000\tNone";
|
||||
Challenge[8] = "MCG Gold Commendation\t10000\t50000\tNone";
|
||||
Challenge[9] = "MCG Titan Commendation\t25000\t75000\tNone";
|
||||
Upgrade[1] = "Grip";
|
||||
Upgrade[2] = "Laser";
|
||||
Upgrade[3] = "Silencer";
|
||||
Upgrade[4] = "Fusion Core";
|
||||
GunName = "Mini-Chaingun";
|
||||
|
||||
|
||||
RankRequire = $TWM2::RankRequire["MiniChaingun"];
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "1.0 0.3 1.0";
|
||||
shellExitOffset = "0.15 -0.56 -0.1";
|
||||
shellExitVariance = 15.0;
|
||||
shellVelocity = 3.0;
|
||||
|
||||
projectileSpread = 8.0 / 1000.0;
|
||||
|
||||
//--------------------------------------
|
||||
stateName[0] = "Activate";
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
stateAllowImageChange[0] = false;
|
||||
//
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateTransitionOnTimeout[0] = "Ready";
|
||||
stateTransitionOnNoAmmo[0] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[1] = "Ready";
|
||||
stateSpinThread[1] = Stop;
|
||||
//
|
||||
stateTransitionOnTriggerDown[1] = "Spinup";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[2] = "NoAmmo";
|
||||
stateTransitionOnAmmo[2] = "Ready";
|
||||
stateSpinThread[2] = Stop;
|
||||
stateTransitionOnTriggerDown[2] = "DryFire";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[3] = "Spinup";
|
||||
stateSpinThread[3] = SpinUp;
|
||||
stateSound[3] = ChaingunSpinupSound;
|
||||
//
|
||||
stateTimeoutValue[3] = 0.5;
|
||||
stateWaitForTimeout[3] = false;
|
||||
stateTransitionOnTimeout[3] = "Fire";
|
||||
stateTransitionOnTriggerUp[3] = "Spindown";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[4] = "Fire";
|
||||
stateSequence[4] = "Fire";
|
||||
stateSequenceRandomFlash[4] = true;
|
||||
stateSpinThread[4] = FullSpeed;
|
||||
//stateSound[4] = ChaingunFireSound;
|
||||
//stateRecoil[4] = LightRecoil;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateScript[4] = "onFire";
|
||||
stateFire[4] = true;
|
||||
stateEjectShell[4] = true;
|
||||
//
|
||||
stateTimeoutValue[4] = 0.02;
|
||||
stateTransitionOnTimeout[4] = "Fire";
|
||||
stateTransitionOnTriggerUp[4] = "Spindown";
|
||||
stateTransitionOnNoAmmo[4] = "EmptySpindown";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[5] = "Spindown";
|
||||
stateSound[5] = ChaingunSpinDownSound;
|
||||
stateSpinThread[5] = SpinDown;
|
||||
//
|
||||
stateTimeoutValue[5] = 1.0;
|
||||
stateWaitForTimeout[5] = true;
|
||||
stateTransitionOnTimeout[5] = "Ready";
|
||||
stateTransitionOnTriggerDown[5] = "Spinup";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[6] = "EmptySpindown";
|
||||
stateSound[6] = ChaingunSpinDownSound;
|
||||
stateSpinThread[6] = SpinDown;
|
||||
//
|
||||
stateTimeoutValue[6] = 0.5;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
//--------------------------------------
|
||||
stateName[7] = "DryFire";
|
||||
stateSound[7] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[7] = 0.5;
|
||||
stateTransitionOnTimeout[7] = "NoAmmo";
|
||||
};
|
||||
|
||||
datablock ItemData(MiniChaingun)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_chaingun.dts";
|
||||
image = MiniChaingunImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a mini-chaingun";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function MiniChaingunImage::onFire(%data, %obj, %slot) {
|
||||
if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
|
||||
//zero sound :p
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
}
|
||||
else if(%obj.client.UpgradeOn("Fusion Core", %data.getName())) {
|
||||
ServerPlay3d(ChaingunFireSound, %obj.getPosition());
|
||||
%p = spawnprojectile(MCGPhaserBolt, LinearFlareProjectile,
|
||||
%obj.getMuzzlePoint(%slot), %obj.getMuzzleVector(%slot), %obj);
|
||||
%p.WeaponImageSource = "MiniChaingunImage";
|
||||
%obj.decInventory(%data.ammo, 1);
|
||||
if(%obj.inv[%data.ammo] == 0) { //Added Phantom139, TWM2
|
||||
AttemptReload(%data, %obj, %slot);
|
||||
}
|
||||
}
|
||||
else {
|
||||
ServerPlay3d(ChaingunFireSound, %obj.getPosition());
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
}
|
||||
}
|
||||
224
scripts/weapons/Shotguns/M1700.cs
Normal file
224
scripts/weapons/Shotguns/M1700.cs
Normal file
|
|
@ -0,0 +1,224 @@
|
|||
datablock AudioProfile(ShotgunFireSound) {
|
||||
filename = "fx/weapons/TR2spinfusor_fire.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock TracerProjectileData(M1700Pellet)
|
||||
{
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = (0.075 * 1.5);
|
||||
directDamageType = $DamageType::M1700;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
HeadMultiplier = 1.2;
|
||||
LegsMultiplier = 0.75;
|
||||
|
||||
ImageSource = "M1700Image";
|
||||
|
||||
longRangeMultiplier = 0.75;
|
||||
kickBackStrength = 0.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
dryVelocity = 1500.0;
|
||||
wetVelocity = 1000.0;
|
||||
velInheritFactor = 0.0;
|
||||
fizzleTimeMS = 1000;
|
||||
lifetimeMS = 1000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 5.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
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.09;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Ammo
|
||||
//--------------------------------------
|
||||
|
||||
datablock ItemData(M1700Ammo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some M1700 rounds";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(M1700Image)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_plasma.dts";
|
||||
item = M1700;
|
||||
ammo = M1700Ammo;
|
||||
projectile = M1700Pellet;
|
||||
projectileType = TracerProjectile;
|
||||
emap = true;
|
||||
mass = 20;
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "0.5 0.0 1.0"; // L/R - F/B - T/B
|
||||
shellExitOffset = "0.15 -0.51 -0.1"; // L/R - F/B - T/B
|
||||
shellExitVariance = 10.0;
|
||||
shellVelocity = 4.0;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "M1700Clip";
|
||||
ClipPickupName["M1700Clip"] = "some M1700 Clip Boxes";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 2;
|
||||
ClipReturn = 1;
|
||||
InitialClips = 15;
|
||||
//
|
||||
|
||||
//Challenges
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 9;
|
||||
Challenge[1] = "M1700 Killer\t50\t100\tNone";
|
||||
Challenge[2] = "M1700 Extremist\t100\t150\tNone";
|
||||
Challenge[3] = "M1700 Expert\t250\t250\tNone";
|
||||
Challenge[4] = "M1700 Master\t500\t500\tNone";
|
||||
Challenge[5] = "M1700 God\t1000\t1000\tNone";
|
||||
Challenge[6] = "M1700 Bronze Commendation\t2500\t10000\tNone";
|
||||
Challenge[7] = "M1700 Silver Commendation\t5000\t25000\tNone";
|
||||
Challenge[8] = "M1700 Gold Commendation\t10000\t50000\tNone";
|
||||
Challenge[9] = "M1700 Titan Commendation\t25000\t75000\tNone";
|
||||
GunName = "M1700 Shotgun";
|
||||
//
|
||||
|
||||
projectileSpread = 11.0 / 1000.0;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.0001;
|
||||
stateFire[3] = true;
|
||||
stateEjectShell[3] = true;
|
||||
stateEmitter[3] = "GunFireEffectEmitter";
|
||||
stateEmitterNode[3] = "muzzlepoint1";
|
||||
stateEmitterTime[3] = 1;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
stateEmitterTime[3] = 0.2;
|
||||
stateSound[3] = SniperFireSound;
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 0.5;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
stateName[7] = "WetFire";
|
||||
stateSound[7] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[7] = 1.0;
|
||||
stateTransitionOnTimeout[7] = "Ready";
|
||||
|
||||
stateName[8] = "CheckWet";
|
||||
stateTransitionOnWet[8] = "WetFire";
|
||||
stateTransitionOnNotWet[8] = "Fire";
|
||||
};
|
||||
|
||||
datablock ItemData(M1700)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_plasma.dts";
|
||||
image = M1700Image;
|
||||
mass = 1.0;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a M1700";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function M1700Image::onMount(%this,%obj,%slot) {
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
}
|
||||
|
||||
function M1700Image::onFire(%data,%obj,%slot) {
|
||||
serverPlay3D(ShotgunFireSound, %obj.getPosition());
|
||||
|
||||
%obj.applyKick(-250);
|
||||
%obj.decInventory(%data.ammo,1);
|
||||
|
||||
%vector = %obj.getMuzzleVector(%slot);
|
||||
%mp = %obj.getMuzzlePoint(%slot);
|
||||
|
||||
for (%i=0; %i < 12; %i++) {
|
||||
%x = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
|
||||
%y = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
|
||||
%z = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
|
||||
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
|
||||
%newvector = MatrixMulVector(%mat, %vector);
|
||||
|
||||
%p = new (%data.projectileType)() {
|
||||
dataBlock = %data.projectile;
|
||||
initialDirection = %newvector;
|
||||
initialPosition = %mp;
|
||||
sourceObject = %obj;
|
||||
damageFactor = 1;
|
||||
sourceSlot = %slot;
|
||||
};
|
||||
|
||||
%p.WeaponImageSource = %data.getName();
|
||||
}
|
||||
if(%obj.inv[M1700Ammo] == 0) { //Added Phantom139, TWM2
|
||||
AttemptReload(%data, %obj, %slot);
|
||||
}
|
||||
}
|
||||
218
scripts/weapons/Shotguns/Model1887.cs
Normal file
218
scripts/weapons/Shotguns/Model1887.cs
Normal file
|
|
@ -0,0 +1,218 @@
|
|||
datablock TracerProjectileData(Model1887Pellet)
|
||||
{
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = (0.064 * 1.5);
|
||||
directDamageType = $DamageType::Model1887;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
HeadMultiplier = 1.2;
|
||||
LegsMultiplier = 0.75;
|
||||
|
||||
longRangeMultiplier = 0.75;
|
||||
kickBackStrength = 0.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
ImageSource = "Model1887Image";
|
||||
|
||||
dryVelocity = 1500.0;
|
||||
wetVelocity = 1000.0;
|
||||
velInheritFactor = 0.0;
|
||||
fizzleTimeMS = 500;
|
||||
lifetimeMS = 500;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 5.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
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.09;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Ammo
|
||||
//--------------------------------------
|
||||
|
||||
datablock ItemData(Model1887Ammo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some Model 1887 rounds";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(Model1887Image)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_disc.dts";
|
||||
item = Model1887;
|
||||
ammo = Model1887Ammo;
|
||||
projectile = Model1887Pellet;
|
||||
projectileType = TracerProjectile;
|
||||
emap = true;
|
||||
mass = 20;
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "0.5 0.0 1.0"; // L/R - F/B - T/B
|
||||
shellExitOffset = "0.15 -0.51 -0.1"; // L/R - F/B - T/B
|
||||
shellExitVariance = 10.0;
|
||||
shellVelocity = 4.0;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "Model1887Clip";
|
||||
ClipPickupName["Model1887Clip"] = "some Model 1887 Clip Boxes";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 9;
|
||||
ClipReturn = 7;
|
||||
InitialClips = 3;
|
||||
|
||||
ReloadSingle = 1;
|
||||
SingleShotAdd = 1;
|
||||
//
|
||||
RankRequire = $TWM2::RankRequire["RSALaserRifle"];
|
||||
PrestigeRequire = 1;
|
||||
|
||||
//Challenges
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 9;
|
||||
Challenge[1] = "Model 1887 Killer\t50\t100\tNone";
|
||||
Challenge[2] = "Model 1887 Extremist\t100\t150\tNone";
|
||||
Challenge[3] = "Model 1887 Expert\t250\t250\tNone";
|
||||
Challenge[4] = "Model 1887 Master\t500\t500\tNone";
|
||||
Challenge[5] = "Model 1887 God\t1000\t1000\tNone";
|
||||
Challenge[6] = "Model 1887 Bronze Commendation\t2500\t10000\tNone";
|
||||
Challenge[7] = "Model 1887 Silver Commendation\t5000\t25000\tNone";
|
||||
Challenge[8] = "Model 1887 Gold Commendation\t10000\t50000\tNone";
|
||||
Challenge[9] = "Model 1887 Titan Commendation\t25000\t75000\tNone";
|
||||
GunName = "Model 1887 Shotgun";
|
||||
//
|
||||
|
||||
projectileSpread = 7.0 / 1000.0;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.0001;
|
||||
stateFire[3] = true;
|
||||
stateEjectShell[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 1.0;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
stateName[7] = "WetFire";
|
||||
stateSound[7] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[7] = 1.0;
|
||||
stateTransitionOnTimeout[7] = "Ready";
|
||||
|
||||
stateName[8] = "CheckWet";
|
||||
stateTransitionOnWet[8] = "WetFire";
|
||||
stateTransitionOnNotWet[8] = "Fire";
|
||||
};
|
||||
|
||||
datablock ItemData(Model1887)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_plasma.dts";
|
||||
image = Model1887Image;
|
||||
mass = 1.0;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a Model 1887";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function Model1887Image::onMount(%this,%obj,%slot) {
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
}
|
||||
|
||||
function Model1887Image::onFire(%data,%obj,%slot) {
|
||||
serverPlay3D(ShotgunFireSound, %obj.getPosition());
|
||||
|
||||
%obj.applyKick(-250);
|
||||
%obj.decInventory(%data.ammo,1);
|
||||
|
||||
%vector = %obj.getMuzzleVector(%slot);
|
||||
%mp = %obj.getMuzzlePoint(%slot);
|
||||
|
||||
for (%i = 0; %i < 14; %i++) {
|
||||
%x = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
|
||||
%y = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
|
||||
%z = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
|
||||
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
|
||||
%newvector = MatrixMulVector(%mat, %vector);
|
||||
|
||||
%p = new (%data.projectileType)() {
|
||||
dataBlock = %data.projectile;
|
||||
initialDirection = %newvector;
|
||||
initialPosition = %mp;
|
||||
sourceObject = %obj;
|
||||
damageFactor = 1;
|
||||
sourceSlot = %slot;
|
||||
};
|
||||
|
||||
%p.WeaponImageSource = %data.getName();
|
||||
}
|
||||
if(%obj.inv[Model1887Ammo] == 0) { //Added Phantom139, TWM2
|
||||
AttemptReload(%data, %obj, %slot);
|
||||
}
|
||||
}
|
||||
326
scripts/weapons/Shotguns/SA2400.cs
Normal file
326
scripts/weapons/Shotguns/SA2400.cs
Normal file
|
|
@ -0,0 +1,326 @@
|
|||
//--------------------------------------
|
||||
// Semi-Automatic Shotgun (SA2400)
|
||||
// By. DarknessOfLight
|
||||
//--------------------------------------
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Particle effects
|
||||
//--------------------------------------
|
||||
|
||||
|
||||
datablock DebrisData( SemiAutoShellDebris )
|
||||
{
|
||||
shapeName = "weapon_chaingun_ammocasing.dts";
|
||||
|
||||
lifetime = 7.0;
|
||||
|
||||
minSpinSpeed = 600.0;
|
||||
maxSpinSpeed = 800.0;
|
||||
|
||||
elasticity = 0.8;
|
||||
friction = 0.3;
|
||||
|
||||
numBounces = 5;
|
||||
|
||||
fade = true;
|
||||
staticOnMaxBounce = true;
|
||||
snapOnMaxBounce = true;
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Projectile
|
||||
//--------------------------------------
|
||||
|
||||
datablock TracerProjectileData( SA2400Slug )
|
||||
{
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.3;
|
||||
directDamageType = $DamageType::SA2400;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
|
||||
HeadMultiplier = 1.9;
|
||||
|
||||
kickBackStrength = 428.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
ImageSource = "SA2400Image";
|
||||
|
||||
dryVelocity = 2561.0;
|
||||
wetVelocity = 586.0;
|
||||
velInheritFactor = 1.0;
|
||||
fizzleTimeMS = 3000;
|
||||
lifetimeMS = 3000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 40.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 40.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 37.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
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.10;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal1;
|
||||
decalData[2] = ChaingunDecal1;
|
||||
decalData[3] = ChaingunDecal1;
|
||||
decalData[4] = ChaingunDecal1;
|
||||
decalData[5] = ChaingunDecal1;
|
||||
};
|
||||
//--------------------------------------------------------------------------
|
||||
// Ammo
|
||||
//--------------------------------------
|
||||
|
||||
datablock ItemData( SA2400Ammo )
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some chaingun ammo";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData( SA2400Image )
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_grenade_launcher.dts";
|
||||
item = SA2400;
|
||||
ammo = SA2400Ammo;
|
||||
|
||||
offset = "0 0 0";
|
||||
emap = true;
|
||||
|
||||
casing = SemiAutoShellDebris;
|
||||
shellExitDir = "1.0 0.3 1.0";
|
||||
shellExitOffset = "0.15 -0.56 -0.1";
|
||||
shellExitVariance = 15.0;
|
||||
shellVelocity = 30.0;
|
||||
|
||||
projectile = SA2400Slug;
|
||||
projectileType = TracerProjectile;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "SA2400Clip";
|
||||
ClipPickupName["SA2400Clip"] = "some SA2400 Slugs";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 6;
|
||||
ClipReturn = 21;
|
||||
InitialClips = 8;
|
||||
ReloadSingle = 1;
|
||||
SingleShotAdd = 7;
|
||||
//
|
||||
RankRequire = $TWM2::RankRequire["SA2400"];
|
||||
|
||||
//Challenges
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 9;
|
||||
Challenge[1] = "SA2400 Killer\t50\t100\tNone";
|
||||
Challenge[2] = "SA2400 Extremist\t100\t150\tNone";
|
||||
Challenge[3] = "SA2400 Expert\t250\t250\tNone";
|
||||
Challenge[4] = "SA2400 Master\t500\t500\tNone";
|
||||
Challenge[5] = "SA2400 God\t1000\t1000\tNone";
|
||||
Challenge[6] = "SA2400 Bronze Commendation\t2500\t10000\tNone";
|
||||
Challenge[7] = "SA2400 Silver Commendation\t5000\t25000\tNone";
|
||||
Challenge[8] = "SA2400 Gold Commendation\t10000\t50000\tNone";
|
||||
Challenge[9] = "SA2400 Titan Commendation\t25000\t75000\tNone";
|
||||
GunName = "SA2400 Shotgun";
|
||||
//
|
||||
|
||||
projectileSpread = 3.0 / 1000.0;
|
||||
//----------------------------------------------------------------------------\\
|
||||
//State Data\\
|
||||
//----------------------------------------------------------------------------\\
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateSequence[0] = "Activate";
|
||||
stateTimeoutValue[0] = 0.2;
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
//----------------------------------------------------\\
|
||||
stateName[1] = "Ready";
|
||||
stateSequence[1] = "Ready";
|
||||
stateTimeoutValue[1] = 0.2;
|
||||
stateTransitionOnTriggerDown[1] = "FireFirstRound";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
//----------------------------------------------------\\
|
||||
stateName[2] = "Reload";
|
||||
stateSequence[2] = "Reload";
|
||||
stateTransitionOnTimeout[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTimeoutValue[2] = 4.0;
|
||||
stateAllowImageChange[2] = false;
|
||||
stateSound[2] = DiscDryFireSound;
|
||||
//----------------------------------------------------\\
|
||||
stateName[3] = "NoAmmo";
|
||||
stateSequence[3] = "NoAmmo";
|
||||
stateTimeoutValue[3] = 0.2;
|
||||
stateTransitionOnTriggerDown[3] = "DryFire";
|
||||
stateTransitionOnAmmo[3] = "Reload";
|
||||
//----------------------------------------------------\\
|
||||
stateName[4] = "DryFire";
|
||||
stateSequence[4] = "DryFire";
|
||||
stateTransitionOnTimeout[4] = "NoAmmo";
|
||||
stateTimeoutValue[4] = 0.5;
|
||||
stateSound[4] = DiscSwitchSound;
|
||||
//----------------------------------------------------\\
|
||||
stateName[5] = "FireFirstRound";
|
||||
stateSequence[5] = "Fire";
|
||||
stateRecoil[5] = LightRecoil;
|
||||
stateTransitionOnTimeout[5] = "FireSecondRound";
|
||||
stateTransitionOnTriggerUp[5] = "ReadySecondRound";
|
||||
stateTransitionOnNoAmmo[5] = "NoAmmo";
|
||||
stateTimeoutValue[5] = 0.2;
|
||||
stateFire[5] = true;
|
||||
stateEjectShell[5] = true;
|
||||
stateAllowImageChange[5] = false;
|
||||
stateSound[5] = ShotgunFireSound;
|
||||
stateScript[5] = "onFire";
|
||||
//----------------------------------------------------\\
|
||||
stateName[6] = "FireSecondRound";
|
||||
stateSequence[6] = "Fire";
|
||||
stateRecoil[6] = LightRecoil;
|
||||
stateTransitionOnTimeout[6] = "FireThirdRound";
|
||||
stateTransitionOnTriggerUp[6] = "ReadyThirdRound";
|
||||
stateTransitionOnNoAmmo[6] = "NoAmmo";
|
||||
stateTimeoutValue[6] = 0.2;
|
||||
stateFire[6] = true;
|
||||
stateEjectShell[6] = true;
|
||||
stateAllowImageChange[6] = false;
|
||||
stateSound[6] = ShotgunFireSound;
|
||||
stateScript[6] = "onFire";
|
||||
//----------------------------------------------------\\
|
||||
stateName[7] = "FireThirdRound";
|
||||
stateSequence[7] = "Fire";
|
||||
stateRecoil[7] = LightRecoil;
|
||||
stateTransitionOnTimeout[7] = "FireFourthRound";
|
||||
stateTransitionOnTriggerUp[7] = "ReadyFourthRound";
|
||||
stateTransitionOnNoAmmo[7] = "NoAmmo";
|
||||
stateTimeoutValue[7] = 0.2;
|
||||
stateFire[7] = true;
|
||||
stateEjectShell[7] = true;
|
||||
stateAllowImageChange[7] = false;
|
||||
stateSound[7] = ShotgunFireSound;
|
||||
stateScript[7] = "onFire";
|
||||
//----------------------------------------------------\\
|
||||
stateName[8] = "FireFourthRound";
|
||||
stateSequence[8] = "Fire";
|
||||
stateRecoil[8] = LightRecoil;
|
||||
stateTransitionOnTimeout[8] = "FireFifthRound";
|
||||
stateTransitionOnTriggerUp[8] = "ReadyFifthRound";
|
||||
stateTransitionOnNoAmmo[8] = "NoAmmo";
|
||||
stateTimeoutValue[8] = 0.2;
|
||||
stateFire[8] = true;
|
||||
stateEjectShell[8] = true;
|
||||
stateAllowImageChange[8] = false;
|
||||
stateSound[8] = ShotgunFireSound;
|
||||
stateScript[8] = "onFire";
|
||||
//----------------------------------------------------\\
|
||||
stateName[9] = "FireFifthRound";
|
||||
stateSequence[9] = "Fire";
|
||||
stateRecoil[9] = LightRecoil;
|
||||
stateTransitionOnTimeout[9] = "FireSixthRound";
|
||||
stateTransitionOnTriggerUp[9] = "ReadySixthRound";
|
||||
stateTransitionOnNoAmmo[9] = "NoAmmo";
|
||||
stateTimeoutValue[9] = 0.2;
|
||||
stateFire[9] = true;
|
||||
stateEjectShell[9] = true;
|
||||
stateAllowImageChange[9] = false;
|
||||
stateSound[9] = ShotgunFireSound;
|
||||
stateScript[9] = "onFire";
|
||||
//----------------------------------------------------\\
|
||||
stateName[10] = "FireSixthRound";
|
||||
stateSequence[10] = "Fire";
|
||||
stateRecoil[10] = LightRecoil;
|
||||
stateTransitionOnTimeout[10] = "FireSeventhRound";
|
||||
stateTransitionOnTriggerUp[10] = "ReadySeventhRound";
|
||||
stateTransitionOnNoAmmo[10] = "NoAmmo";
|
||||
stateTimeoutValue[10] = 0.2;
|
||||
stateFire[10] = true;
|
||||
stateEjectShell[10] = true;
|
||||
stateAllowImageChange[10] = false;
|
||||
stateSound[10] = ShotgunFireSound;
|
||||
stateScript[10] = "onFire";
|
||||
//----------------------------------------------------\\
|
||||
stateName[11] = "FireSeventhRound";
|
||||
stateSequence[11] = "Fire";
|
||||
stateRecoil[11] = LightRecoil;
|
||||
stateTransitionOnTimeout[11] = "Reload";
|
||||
stateTransitionOnTriggerUp[11] = "Reload";
|
||||
stateTransitionOnNoAmmo[11] = "NoAmmo";
|
||||
stateTimeoutValue[11] = 0.2;
|
||||
stateFire[11] = true;
|
||||
stateEjectShell[11] = true;
|
||||
stateAllowImageChange[11] = false;
|
||||
stateSound[11] = ShotgunFireSound;
|
||||
stateScript[11] = "onFire";
|
||||
//----------------------------------------------------\\
|
||||
stateName[12] = "ReadySecondRound";
|
||||
stateSequence[12] = "ReadySecondRound";
|
||||
stateTransitionOnTriggerDown[12] = "FireSecondRound";
|
||||
stateTransitionOnNoAmmo[12] = "NoAmmo";
|
||||
//----------------------------------------------------\\
|
||||
stateName[13] = "ReadyThirdRound";
|
||||
stateSequence[13] = "ReadyThirdRound";
|
||||
stateTransitionOnTriggerDown[13] = "FireThirdRound";
|
||||
stateTransitionOnNoAmmo[13] = "NoAmmo";
|
||||
//----------------------------------------------------\\
|
||||
stateName[14] = "ReadyFourthRound";
|
||||
stateSequence[14] = "ReadyFourthRound";
|
||||
stateTransitionOnTriggerDown[14] = "FireFourthRound";
|
||||
stateTransitionOnNoAmmo[14] = "NoAmmo";
|
||||
//----------------------------------------------------\\
|
||||
stateName[15] = "ReadyFifthRound";
|
||||
stateSequence[15] = "ReadyFifthRound";
|
||||
stateTransitionOnTriggerDown[15] = "FireFifthRound";
|
||||
stateTransitionOnNoAmmo[15] = "NoAmmo";
|
||||
//----------------------------------------------------\\
|
||||
stateName[16] = "ReadySixthRound";
|
||||
stateSequence[16] = "ReadySixthRound";
|
||||
stateTransitionOnTriggerDown[16] = "FireSixthRound";
|
||||
stateTransitionOnNoAmmo[16] = "NoAmmo";
|
||||
//----------------------------------------------------\\
|
||||
stateName[17] = "ReadySeventhRound";
|
||||
stateSequence[17] = "ReadySeventhRound";
|
||||
stateTransitionOnTriggerDown[17] = "FireSeventhRound";
|
||||
stateTransitionOnNoAmmo[17] = "NoAmmo";
|
||||
//----------------------------------------------------\\
|
||||
stateName[18] = "ActivateReady";
|
||||
stateTransitionOnLoaded[18] = "Ready";
|
||||
stateTransitionOnNoAmmo[18] = "NoAmmo";
|
||||
//----------------------------------------------------------------------------\\
|
||||
//----------------------------------------------------------------------------\\
|
||||
};
|
||||
|
||||
datablock ItemData( SA2400 )
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_grenade_launcher.dts";
|
||||
image = SA2400Image;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a Semi-Automatic Shotgun";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
219
scripts/weapons/Shotguns/SCD343.cs
Normal file
219
scripts/weapons/Shotguns/SCD343.cs
Normal file
|
|
@ -0,0 +1,219 @@
|
|||
datablock TracerProjectileData(SCD343Pellet)
|
||||
{
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = (0.075 * 1.4);
|
||||
directDamageType = $DamageType::SCD343;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
HeadMultiplier = 1.2;
|
||||
LegsMultiplier = 0.75;
|
||||
|
||||
ImageSource = "SCD343Image";
|
||||
|
||||
longRangeMultiplier = 0.75;
|
||||
kickBackStrength = 0.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
dryVelocity = 1500.0;
|
||||
wetVelocity = 1000.0;
|
||||
velInheritFactor = 0.0;
|
||||
fizzleTimeMS = 1000;
|
||||
lifetimeMS = 1000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 5.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
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.09;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Ammo
|
||||
//--------------------------------------
|
||||
|
||||
datablock ItemData(SCD343Ammo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some SCD343 rounds";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(SCD343Image)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_plasma.dts";
|
||||
item = SCD343;
|
||||
ammo = SCD343Ammo;
|
||||
projectile = SCD343Pellet;
|
||||
projectileType = TracerProjectile;
|
||||
emap = true;
|
||||
mass = 20;
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "0.5 0.0 1.0"; // L/R - F/B - T/B
|
||||
shellExitOffset = "0.15 -0.51 -0.1"; // L/R - F/B - T/B
|
||||
shellExitVariance = 10.0;
|
||||
shellVelocity = 4.0;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "SCD343Clip";
|
||||
ClipPickupName["SCD343Clip"] = "some SCD343 Clip Boxes";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 4;
|
||||
ClipReturn = 1;
|
||||
InitialClips = 8;
|
||||
//
|
||||
RankRequire = $TWM2::RankRequire["SCD343"];
|
||||
|
||||
//Challenges
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 9;
|
||||
Challenge[1] = "SCD343 Killer\t50\t100\tNone";
|
||||
Challenge[2] = "SCD343 Extremist\t100\t150\tNone";
|
||||
Challenge[3] = "SCD343 Expert\t250\t250\tNone";
|
||||
Challenge[4] = "SCD343 Master\t500\t500\tNone";
|
||||
Challenge[5] = "SCD343 God\t1000\t1000\tNone";
|
||||
Challenge[6] = "SCD343 Bronze Commendation\t2500\t10000\tNone";
|
||||
Challenge[7] = "SCD343 Silver Commendation\t5000\t25000\tNone";
|
||||
Challenge[8] = "SCD343 Gold Commendation\t10000\t50000\tNone";
|
||||
Challenge[9] = "SCD343 Titan Commendation\t25000\t75000\tNone";
|
||||
GunName = "SCD343 Shotgun";
|
||||
//
|
||||
|
||||
projectileSpread = 6.0 / 1000.0;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.0001;
|
||||
stateFire[3] = true;
|
||||
stateEjectShell[3] = true;
|
||||
stateEmitter[3] = "GunFireEffectEmitter";
|
||||
stateEmitterNode[3] = "muzzlepoint1";
|
||||
stateEmitterTime[3] = 1;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
stateEmitterTime[3] = 0.2;
|
||||
stateSound[3] = SniperFireSound;
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 0.5;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
stateName[7] = "WetFire";
|
||||
stateSound[7] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[7] = 1.0;
|
||||
stateTransitionOnTimeout[7] = "Ready";
|
||||
|
||||
stateName[8] = "CheckWet";
|
||||
stateTransitionOnWet[8] = "WetFire";
|
||||
stateTransitionOnNotWet[8] = "Fire";
|
||||
};
|
||||
|
||||
datablock ItemData(SCD343)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_plasma.dts";
|
||||
image = SCD343Image;
|
||||
mass = 1.0;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a SCD343";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function SCD343Image::onMount(%this,%obj,%slot) {
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
}
|
||||
|
||||
function SCD343Image::onFire(%data,%obj,%slot) {
|
||||
serverPlay3D(ShotgunFireSound, %obj.getPosition());
|
||||
|
||||
%obj.applyKick(-250);
|
||||
%obj.decInventory(%data.ammo,1);
|
||||
|
||||
%vector = %obj.getMuzzleVector(%slot);
|
||||
%mp = %obj.getMuzzlePoint(%slot);
|
||||
|
||||
for (%i=0; %i < 16; %i++) {
|
||||
%x = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
|
||||
%y = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
|
||||
%z = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
|
||||
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
|
||||
%newvector = MatrixMulVector(%mat, %vector);
|
||||
|
||||
%p = new (%data.projectileType)() {
|
||||
dataBlock = %data.projectile;
|
||||
initialDirection = %newvector;
|
||||
initialPosition = %mp;
|
||||
sourceObject = %obj;
|
||||
damageFactor = 1;
|
||||
sourceSlot = %slot;
|
||||
};
|
||||
|
||||
%p.WeaponImageSource = %data.getName();
|
||||
}
|
||||
if(%obj.inv[SCD343Ammo] == 0) { //Added Phantom139, TWM2
|
||||
AttemptReload(%data, %obj, %slot);
|
||||
}
|
||||
}
|
||||
213
scripts/weapons/Shotguns/Wp400.cs
Normal file
213
scripts/weapons/Shotguns/Wp400.cs
Normal file
|
|
@ -0,0 +1,213 @@
|
|||
datablock TracerProjectileData(Wp400Pellet)
|
||||
{
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = (0.075 * 1.5);
|
||||
directDamageType = $DamageType::Wp400;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
HeadMultiplier = 1.2;
|
||||
LegsMultiplier = 0.75;
|
||||
|
||||
longRangeMultiplier = 0.75;
|
||||
kickBackStrength = 0.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
ImageSource = "Wp400Image";
|
||||
|
||||
dryVelocity = 1500.0;
|
||||
wetVelocity = 1000.0;
|
||||
velInheritFactor = 0.0;
|
||||
fizzleTimeMS = 1000;
|
||||
lifetimeMS = 1000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 5.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
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.09;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = ChaingunDecal1;
|
||||
decalData[1] = ChaingunDecal2;
|
||||
decalData[2] = ChaingunDecal3;
|
||||
decalData[3] = ChaingunDecal4;
|
||||
decalData[4] = ChaingunDecal5;
|
||||
decalData[5] = ChaingunDecal6;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Ammo
|
||||
//--------------------------------------
|
||||
|
||||
datablock ItemData(Wp400Ammo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some Wp400 rounds";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(Wp400Image)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_plasma.dts";
|
||||
item = Wp400;
|
||||
ammo = Wp400Ammo;
|
||||
projectile = Wp400Pellet;
|
||||
projectileType = TracerProjectile;
|
||||
emap = true;
|
||||
mass = 20;
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "0.5 0.0 1.0"; // L/R - F/B - T/B
|
||||
shellExitOffset = "0.15 -0.51 -0.1"; // L/R - F/B - T/B
|
||||
shellExitVariance = 10.0;
|
||||
shellVelocity = 4.0;
|
||||
|
||||
//ClipStuff
|
||||
ClipName = "Wp400Clip";
|
||||
ClipPickupName["Wp400Clip"] = "some Wp400 Clip Boxes";
|
||||
ShowsClipInHud = 1;
|
||||
ClipReloadTime = 4;
|
||||
ClipReturn = 5;
|
||||
InitialClips = 6;
|
||||
//
|
||||
RankRequire = $TWM2::RankRequire["Wp400"];
|
||||
|
||||
//Challenges
|
||||
HasChallenges = 1;
|
||||
ChallengeCt = 9;
|
||||
Challenge[1] = "Wp400 Killer\t50\t100\tNone";
|
||||
Challenge[2] = "Wp400 Extremist\t100\t150\tNone";
|
||||
Challenge[3] = "Wp400 Expert\t250\t250\tNone";
|
||||
Challenge[4] = "Wp400 Master\t500\t500\tNone";
|
||||
Challenge[5] = "Wp400 God\t1000\t1000\tNone";
|
||||
Challenge[6] = "Wp400 Bronze Commendation\t2500\t10000\tNone";
|
||||
Challenge[7] = "Wp400 Silver Commendation\t5000\t25000\tNone";
|
||||
Challenge[8] = "Wp400 Gold Commendation\t10000\t50000\tNone";
|
||||
Challenge[9] = "Wp400 Titan Commendation\t25000\t75000\tNone";
|
||||
GunName = "Wp400 Shotgun";
|
||||
//
|
||||
|
||||
projectileSpread = 10.0 / 1000.0;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.3;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ChaingunSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.0001;
|
||||
stateFire[3] = true;
|
||||
stateEjectShell[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
stateSound[3] = SniperFireSound;
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 0.9;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
stateName[7] = "WetFire";
|
||||
stateSound[7] = ChaingunDryFireSound;
|
||||
stateTimeoutValue[7] = 1.0;
|
||||
stateTransitionOnTimeout[7] = "Ready";
|
||||
|
||||
stateName[8] = "CheckWet";
|
||||
stateTransitionOnWet[8] = "WetFire";
|
||||
stateTransitionOnNotWet[8] = "Fire";
|
||||
};
|
||||
|
||||
datablock ItemData(Wp400)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_plasma.dts";
|
||||
image = Wp400Image;
|
||||
mass = 1.0;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a Wp400";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function Wp400Image::onMount(%this,%obj,%slot) {
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
}
|
||||
|
||||
function Wp400Image::onFire(%data,%obj,%slot) {
|
||||
serverPlay3D(ShotgunFireSound, %obj.getPosition());
|
||||
%obj.applyKick(-250);
|
||||
%obj.decInventory(%data.ammo,1);
|
||||
|
||||
%vector = %obj.getMuzzleVector(%slot);
|
||||
%mp = %obj.getMuzzlePoint(%slot);
|
||||
|
||||
for (%i=0; %i < 9; %i++) {
|
||||
%x = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
|
||||
%y = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
|
||||
%z = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
|
||||
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
|
||||
%newvector = MatrixMulVector(%mat, %vector);
|
||||
|
||||
%p = new (%data.projectileType)() {
|
||||
dataBlock = %data.projectile;
|
||||
initialDirection = %newvector;
|
||||
initialPosition = %mp;
|
||||
sourceObject = %obj;
|
||||
damageFactor = 1;
|
||||
sourceSlot = %slot;
|
||||
};
|
||||
%p.WeaponImageSource = %data.getName();
|
||||
}
|
||||
if(%obj.inv[Wp400Ammo] == 0) { //Added Phantom139, TWM2
|
||||
AttemptReload(%data, %obj, %slot);
|
||||
}
|
||||
}
|
||||
180
scripts/weapons/T2Guns/ELFGun.cs
Normal file
180
scripts/weapons/T2Guns/ELFGun.cs
Normal file
|
|
@ -0,0 +1,180 @@
|
|||
//--------------------------------------------------------------------------
|
||||
// ELF Gun
|
||||
//--------------------------------------------------------------------------
|
||||
datablock AudioProfile(ELFGunSwitchSound)
|
||||
{
|
||||
filename = "fx/weapons/generic_switch.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(ELFGunFireSound)
|
||||
{
|
||||
filename = "fx/weapons/ELF_fire.wav";
|
||||
description = CloseLooping3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(ElfFireWetSound)
|
||||
{
|
||||
filename = "fx/weapons/ELF_underwater.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(ELFHitTargetSound)
|
||||
{
|
||||
filename = "fx/weapons/ELF_hit.wav";
|
||||
description = CloseLooping3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
//--------------------------------------
|
||||
// Sparks
|
||||
//--------------------------------------
|
||||
datablock ParticleData(ELFSparks)
|
||||
{
|
||||
dragCoefficient = 1;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.2;
|
||||
constantAcceleration = 0.0;
|
||||
lifetimeMS = 200;
|
||||
lifetimeVarianceMS = 0;
|
||||
textureName = "special/blueSpark";
|
||||
colors[0] = "0.8 0.8 1.0 1.0";
|
||||
colors[1] = "0.8 0.8 1.0 1.0";
|
||||
colors[2] = "0.8 0.8 1.0 0.0";
|
||||
sizes[0] = 0.35;
|
||||
sizes[1] = 0.15;
|
||||
sizes[2] = 0.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(ELFSparksEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 5;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 4;
|
||||
velocityVariance = 2;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 180;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
orientParticles = true;
|
||||
// lifetimeMS = 100;
|
||||
particles = "ELFSparks";
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------
|
||||
// Projectile
|
||||
//--------------------------------------
|
||||
datablock ELFProjectileData(BasicELF)
|
||||
{
|
||||
beamRange = 30;
|
||||
numControlPoints = 8;
|
||||
restorativeFactor = 3.75;
|
||||
dragFactor = 4.5;
|
||||
endFactor = 2.25;
|
||||
randForceFactor = 2;
|
||||
randForceTime = 0.125;
|
||||
drainEnergy = 1.0;
|
||||
drainHealth = 0.0;
|
||||
directDamageType = $DamageType::ELF;
|
||||
mainBeamWidth = 0.1; // width of blue wave beam
|
||||
mainBeamSpeed = 9.0; // speed that the beam travels forward
|
||||
mainBeamRepeat = 0.25; // number of times the texture repeats
|
||||
lightningWidth = 0.1;
|
||||
lightningDist = 0.15; // distance of lightning from main beam
|
||||
|
||||
fireSound = ElfGunFireSound;
|
||||
wetFireSound = ElfFireWetSound;
|
||||
|
||||
textures[0] = "special/ELFBeam";
|
||||
textures[1] = "special/ELFLightning";
|
||||
textures[2] = "special/BlueImpact";
|
||||
|
||||
emitter = ELFSparksEmitter;
|
||||
};
|
||||
|
||||
//--------------------------------------
|
||||
// Rifle and item...
|
||||
//--------------------------------------
|
||||
datablock ItemData(ELFGun)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_elf.dts";
|
||||
image = ELFGunImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "an ELF gun";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(ELFGunImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
|
||||
shapeFile = "weapon_elf.dts";
|
||||
item = ELFGun;
|
||||
offset = "0 0 0";
|
||||
|
||||
projectile = BasicELF;
|
||||
projectileType = ELFProjectile;
|
||||
deleteLastProjectile = true;
|
||||
emap = true;
|
||||
|
||||
|
||||
usesEnergy = true;
|
||||
minEnergy = 3;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ELFGunSwitchSound;
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnAmmo[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateEnergyDrain[3] = 5;
|
||||
stateFire[3] = true;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
stateTransitionOnTriggerUp[3] = "Deconstruction";
|
||||
stateTransitionOnNoAmmo[3] = "Deconstruction";
|
||||
//stateSound[3] = ElfFireWetSound;
|
||||
|
||||
stateName[4] = "NoAmmo";
|
||||
stateTransitionOnAmmo[4] = "Ready";
|
||||
|
||||
stateName[5] = "Deconstruction";
|
||||
stateScript[5] = "deconstruct";
|
||||
stateTransitionOnTimeout[5] = "Ready";
|
||||
stateTransitionOnNoAmmo[6] = "NoAmmo";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = ElfFireWetSound;
|
||||
stateTimeoutValue[6] = 0.5;
|
||||
stateTransitionOnTimeout[6] = "Ready";
|
||||
|
||||
stateName[7] = "CheckWet";
|
||||
stateTransitionOnWet[7] = "DryFire";
|
||||
stateTransitionOnNotWet[7] = "Fire";
|
||||
};
|
||||
318
scripts/weapons/T2Guns/blaster.cs
Normal file
318
scripts/weapons/T2Guns/blaster.cs
Normal file
|
|
@ -0,0 +1,318 @@
|
|||
//--------------------------------------
|
||||
// Default blaster
|
||||
//--------------------------------------
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Sounds
|
||||
//--------------------------------------
|
||||
datablock AudioProfile(BlasterSwitchSound)
|
||||
{
|
||||
filename = "fx/weapons/blaster_activate.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(BlasterFireSound)
|
||||
{
|
||||
filename = "fx/weapons/blaster_fire.WAV";
|
||||
description = AudioDefault3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(BlasterProjectileSound)
|
||||
{
|
||||
filename = "fx/weapons/blaster_projectile.WAV";
|
||||
description = ProjectileLooping3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(blasterExpSound)
|
||||
{
|
||||
filename = "fx/weapons/blaster_impact.WAV";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(BlasterDryFireSound)
|
||||
{
|
||||
filename = "fx/weapons/chaingun_dryfire.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Splash
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
datablock ParticleData( BlasterSplashParticle )
|
||||
{
|
||||
dragCoefficient = 1;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.2;
|
||||
constantAcceleration = -1.4;
|
||||
lifetimeMS = 300;
|
||||
lifetimeVarianceMS = 0;
|
||||
textureName = "special/droplet";
|
||||
colors[0] = "0.7 0.8 1.0 1.0";
|
||||
colors[1] = "0.7 0.8 1.0 0.5";
|
||||
colors[2] = "0.7 0.8 1.0 0.0";
|
||||
sizes[0] = 0.05;
|
||||
sizes[1] = 0.2;
|
||||
sizes[2] = 0.2;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData( BlasterSplashEmitter )
|
||||
{
|
||||
ejectionPeriodMS = 4;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 4;
|
||||
velocityVariance = 1.0;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 50;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
orientParticles = true;
|
||||
lifetimeMS = 100;
|
||||
particles = "BlasterSplashParticle";
|
||||
};
|
||||
|
||||
datablock SplashData(BlasterSplash)
|
||||
{
|
||||
numSegments = 15;
|
||||
ejectionFreq = 15;
|
||||
ejectionAngle = 40;
|
||||
ringLifetime = 0.35;
|
||||
lifetimeMS = 300;
|
||||
velocity = 3.0;
|
||||
startRadius = 0.0;
|
||||
acceleration = -3.0;
|
||||
texWrap = 5.0;
|
||||
|
||||
texture = "special/water2";
|
||||
|
||||
emitter[0] = BlasterSplashEmitter;
|
||||
|
||||
colors[0] = "0.7 0.8 1.0 1.0";
|
||||
colors[1] = "0.7 0.8 1.0 1.0";
|
||||
colors[2] = "0.7 0.8 1.0 0.0";
|
||||
colors[3] = "0.7 0.8 1.0 0.0";
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.4;
|
||||
times[2] = 0.8;
|
||||
times[3] = 1.0;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Explosion
|
||||
//--------------------------------------
|
||||
datablock ParticleData(BlasterExplosionParticle1)
|
||||
{
|
||||
dragCoefficient = 2;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.2;
|
||||
constantAcceleration = -0.0;
|
||||
lifetimeMS = 600;
|
||||
lifetimeVarianceMS = 000;
|
||||
textureName = "special/crescent4";
|
||||
colors[0] = "1.0 0.8 0.2 1.0";
|
||||
colors[1] = "1.0 0.4 0.2 1.0";
|
||||
colors[2] = "1.0 0.0 0.0 0.0";
|
||||
sizes[0] = 0.25;
|
||||
sizes[1] = 0.5;
|
||||
sizes[2] = 1.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(BlasterExplosionEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 7;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 2;
|
||||
velocityVariance = 1.5;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 70;
|
||||
thetaMax = 80;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
orientParticles = true;
|
||||
lifetimeMS = 200;
|
||||
particles = "BlasterExplosionParticle1";
|
||||
};
|
||||
|
||||
datablock ParticleData(BlasterExplosionParticle2)
|
||||
{
|
||||
dragCoefficient = 2;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.2;
|
||||
constantAcceleration = -0.0;
|
||||
lifetimeMS = 600;
|
||||
lifetimeVarianceMS = 000;
|
||||
textureName = "special/blasterHit";
|
||||
colors[0] = "1.0 0.2 0.2 1.0";
|
||||
colors[1] = "1.0 0.2 0.2 0.5";
|
||||
colors[2] = "1.0 0.0 0.0 0.0";
|
||||
sizes[0] = 0.3;
|
||||
sizes[1] = 0.90;
|
||||
sizes[2] = 1.50;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(BlasterExplosionEmitter2)
|
||||
{
|
||||
ejectionPeriodMS = 30;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 1;
|
||||
velocityVariance = 0.0;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 80;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
orientParticles = false;
|
||||
lifetimeMS = 200;
|
||||
particles = "BlasterExplosionParticle2";
|
||||
};
|
||||
|
||||
datablock ExplosionData(BlasterExplosion)
|
||||
{
|
||||
soundProfile = blasterExpSound;
|
||||
emitter[0] = BlasterExplosionEmitter;
|
||||
emitter[1] = BlasterExplosionEmitter2;
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Projectile
|
||||
//--------------------------------------
|
||||
|
||||
datablock EnergyProjectileData(EnergyBolt)
|
||||
{
|
||||
emitterDelay = -1;
|
||||
directDamage = 0.3;
|
||||
directDamageType = $DamageType::Blaster;
|
||||
kickBackStrength = 0.0;
|
||||
bubbleEmitTime = 1.0;
|
||||
|
||||
sound = BlasterProjectileSound;
|
||||
velInheritFactor = 0.5;
|
||||
|
||||
explosion = "BlasterExplosion";
|
||||
splash = BlasterSplash;
|
||||
|
||||
|
||||
grenadeElasticity = 0.998;
|
||||
grenadeFriction = 0.0;
|
||||
armingDelayMS = 500;
|
||||
|
||||
muzzleVelocity = 90.0;
|
||||
|
||||
drag = 0.05;
|
||||
|
||||
gravityMod = 0.0;
|
||||
|
||||
dryVelocity = 200.0;
|
||||
wetVelocity = 150.0;
|
||||
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
hasLight = true;
|
||||
lightRadius = 3.0;
|
||||
lightColor = "0.5 0.175 0.175";
|
||||
|
||||
scale = "0.25 20.0 1.0";
|
||||
crossViewAng = 0.99;
|
||||
crossSize = 0.55;
|
||||
|
||||
lifetimeMS = 3000;
|
||||
blurLifetime = 0.2;
|
||||
blurWidth = 0.25;
|
||||
blurColor = "0.4 0.0 0.0 1.0";
|
||||
|
||||
texture[0] = "special/blasterBolt";
|
||||
texture[1] = "special/blasterBoltCross";
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(BlasterImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_energy.dts";
|
||||
item = Blaster;
|
||||
projectile = EnergyBolt;
|
||||
projectileType = EnergyProjectile;
|
||||
|
||||
usesEnergy = true;
|
||||
fireEnergy = 4;
|
||||
minEnergy = 4;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = BlasterSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.3;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = NoRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateSound[3] = BlasterFireSound;
|
||||
stateScript[3] = "onFire";
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateTimeoutValue[6] = 0.3;
|
||||
stateSound[6] = BlasterDryFireSound;
|
||||
stateTransitionOnTimeout[6] = "Ready";
|
||||
};
|
||||
|
||||
datablock ItemData(Blaster)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_energy.dts";
|
||||
image = BlasterImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a blaster";
|
||||
};
|
||||
|
||||
431
scripts/weapons/T2Guns/disc.cs
Normal file
431
scripts/weapons/T2Guns/disc.cs
Normal file
|
|
@ -0,0 +1,431 @@
|
|||
//--------------------------------------
|
||||
// Disc launcher
|
||||
//--------------------------------------
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Sounds
|
||||
//--------------------------------------
|
||||
datablock AudioProfile(DiscSwitchSound)
|
||||
{
|
||||
filename = "fx/weapons/blaster_activate.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(DiscLoopSound)
|
||||
{
|
||||
filename = "fx/weapons/spinfusor_idle.wav";
|
||||
description = ClosestLooping3d;
|
||||
};
|
||||
|
||||
|
||||
datablock AudioProfile(DiscFireSound)
|
||||
{
|
||||
filename = "fx/weapons/spinfusor_fire.wav";
|
||||
description = AudioDefault3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(DiscReloadSound)
|
||||
{
|
||||
filename = "fx/weapons/spinfusor_reload.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(discExpSound)
|
||||
{
|
||||
filename = "fx/weapons/spinfusor_impact.wav";
|
||||
description = AudioExplosion3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(underwaterDiscExpSound)
|
||||
{
|
||||
filename = "fx/weapons/spinfusor_impact_UW.wav";
|
||||
description = AudioExplosion3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(discProjectileSound)
|
||||
{
|
||||
filename = "fx/weapons/spinfusor_projectile.wav";
|
||||
description = ProjectileLooping3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(DiscDryFireSound)
|
||||
{
|
||||
filename = "fx/weapons/spinfusor_dryfire.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Explosion
|
||||
//--------------------------------------
|
||||
datablock ParticleData(DiscExplosionBubbleParticle)
|
||||
{
|
||||
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] = 1.0;
|
||||
sizes[1] = 1.0;
|
||||
sizes[2] = 1.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.3;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
datablock ParticleEmitterData(DiscExplosionBubbleEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 7;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 1.0;
|
||||
ejectionOffset = 3.0;
|
||||
velocityVariance = 0.5;
|
||||
thetaMin = 0;
|
||||
thetaMax = 80;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
particles = "DiscExplosionBubbleParticle";
|
||||
};
|
||||
|
||||
datablock ExplosionData(UnderwaterDiscExplosion)
|
||||
{
|
||||
explosionShape = "disc_explosion.dts";
|
||||
soundProfile = underwaterDiscExpSound;
|
||||
|
||||
faceViewer = true;
|
||||
|
||||
sizes[0] = "1.3 1.3 1.3";
|
||||
sizes[1] = "0.75 0.75 0.75";
|
||||
sizes[2] = "0.4 0.4 0.4";
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
|
||||
emitter[0] = "DiscExplosionBubbleEmitter";
|
||||
|
||||
shakeCamera = true;
|
||||
camShakeFreq = "10.0 11.0 10.0";
|
||||
camShakeAmp = "20.0 20.0 20.0";
|
||||
camShakeDuration = 0.5;
|
||||
camShakeRadius = 10.0;
|
||||
};
|
||||
|
||||
datablock ExplosionData(DiscExplosion)
|
||||
{
|
||||
explosionShape = "disc_explosion.dts";
|
||||
soundProfile = discExpSound;
|
||||
|
||||
faceViewer = true;
|
||||
explosionScale = "1 1 1";
|
||||
|
||||
shakeCamera = true;
|
||||
camShakeFreq = "10.0 11.0 10.0";
|
||||
camShakeAmp = "20.0 20.0 20.0";
|
||||
camShakeDuration = 0.5;
|
||||
camShakeRadius = 10.0;
|
||||
|
||||
sizes[0] = "1.0 1.0 1.0";
|
||||
sizes[1] = "1.0 1.0 1.0";
|
||||
times[0] = 0.0;
|
||||
times[1] = 1.0;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Splash
|
||||
//--------------------------------------------------------------------------
|
||||
datablock ParticleData(DiscMist)
|
||||
{
|
||||
dragCoefficient = 2.0;
|
||||
gravityCoefficient = -0.05;
|
||||
inheritedVelFactor = 0.0;
|
||||
constantAcceleration = 0.0;
|
||||
lifetimeMS = 400;
|
||||
lifetimeVarianceMS = 100;
|
||||
useInvAlpha = false;
|
||||
spinRandomMin = -90.0;
|
||||
spinRandomMax = 500.0;
|
||||
textureName = "particleTest";
|
||||
colors[0] = "0.7 0.8 1.0 1.0";
|
||||
colors[1] = "0.7 0.8 1.0 0.5";
|
||||
colors[2] = "0.7 0.8 1.0 0.0";
|
||||
sizes[0] = 0.5;
|
||||
sizes[1] = 0.5;
|
||||
sizes[2] = 0.8;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(DiscMistEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 5;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 3.0;
|
||||
velocityVariance = 2.0;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 85;
|
||||
thetaMax = 85;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
lifetimeMS = 250;
|
||||
particles = "DiscMist";
|
||||
};
|
||||
|
||||
datablock ParticleData( DiscSplashParticle2 )
|
||||
{
|
||||
|
||||
dragCoeffiecient = 0.4;
|
||||
gravityCoefficient = -0.03; // rises slowly
|
||||
inheritedVelFactor = 0.025;
|
||||
|
||||
lifetimeMS = 600;
|
||||
lifetimeVarianceMS = 300;
|
||||
|
||||
textureName = "particleTest";
|
||||
|
||||
useInvAlpha = false;
|
||||
spinRandomMin = -200.0;
|
||||
spinRandomMax = 200.0;
|
||||
|
||||
|
||||
colors[0] = "0.7 0.8 1.0 1.0";
|
||||
colors[1] = "0.7 0.8 1.0 0.5";
|
||||
colors[2] = "0.7 0.8 1.0 0.0";
|
||||
sizes[0] = 0.5;
|
||||
sizes[1] = 1.0;
|
||||
sizes[2] = 2.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData( DiscSplashEmitter2 )
|
||||
{
|
||||
ejectionPeriodMS = 25;
|
||||
ejectionOffset = 0.2;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 2.25;
|
||||
velocityVariance = 0.50;
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 30.0;
|
||||
lifetimeMS = 250;
|
||||
|
||||
particles = "DiscSplashParticle2";
|
||||
};
|
||||
|
||||
|
||||
datablock ParticleData( DiscSplashParticle )
|
||||
{
|
||||
dragCoefficient = 1;
|
||||
gravityCoefficient = 0.2;
|
||||
inheritedVelFactor = 0.2;
|
||||
constantAcceleration = -0.0;
|
||||
lifetimeMS = 600;
|
||||
lifetimeVarianceMS = 0;
|
||||
textureName = "special/droplet";
|
||||
colors[0] = "0.7 0.8 1.0 1.0";
|
||||
colors[1] = "0.7 0.8 1.0 0.5";
|
||||
colors[2] = "0.7 0.8 1.0 0.0";
|
||||
sizes[0] = 0.5;
|
||||
sizes[1] = 0.5;
|
||||
sizes[2] = 0.5;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData( DiscSplashEmitter )
|
||||
{
|
||||
ejectionPeriodMS = 1;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 3;
|
||||
velocityVariance = 1.0;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 60;
|
||||
thetaMax = 80;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
orientParticles = true;
|
||||
lifetimeMS = 100;
|
||||
particles = "DiscSplashParticle";
|
||||
};
|
||||
|
||||
|
||||
datablock SplashData(DiscSplash)
|
||||
{
|
||||
numSegments = 15;
|
||||
ejectionFreq = 0.0001;
|
||||
ejectionAngle = 45;
|
||||
ringLifetime = 0.5;
|
||||
lifetimeMS = 400;
|
||||
velocity = 5.0;
|
||||
startRadius = 0.0;
|
||||
acceleration = -3.0;
|
||||
texWrap = 5.0;
|
||||
|
||||
texture = "special/water2";
|
||||
|
||||
emitter[0] = DiscSplashEmitter;
|
||||
emitter[1] = DiscMistEmitter;
|
||||
|
||||
colors[0] = "0.7 0.8 1.0 0.0";
|
||||
colors[1] = "0.7 0.8 1.0 1.0";
|
||||
colors[2] = "0.7 0.8 1.0 0.0";
|
||||
colors[3] = "0.7 0.8 1.0 0.0";
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.4;
|
||||
times[2] = 0.8;
|
||||
times[3] = 1.0;
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Projectile
|
||||
//--------------------------------------
|
||||
datablock LinearProjectileData(DiscProjectile)
|
||||
{
|
||||
projectileShapeName = "disc.dts";
|
||||
emitterDelay = -1;
|
||||
directDamage = 0.0;
|
||||
hasDamageRadius = true;
|
||||
indirectDamage = 0.50;
|
||||
damageRadius = 7.5;
|
||||
radiusDamageType = $DamageType::Disc;
|
||||
kickBackStrength = 1750;
|
||||
|
||||
sound = discProjectileSound;
|
||||
explosion = "DiscExplosion";
|
||||
underwaterExplosion = "UnderwaterDiscExplosion";
|
||||
splash = DiscSplash;
|
||||
|
||||
dryVelocity = 90;
|
||||
wetVelocity = 50;
|
||||
velInheritFactor = 0.5;
|
||||
fizzleTimeMS = 5000;
|
||||
lifetimeMS = 5000;
|
||||
explodeOnDeath = true;
|
||||
reflectOnWaterImpactAngle = 15.0;
|
||||
explodeOnWaterImpact = true;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 5000;
|
||||
|
||||
activateDelayMS = 200;
|
||||
|
||||
hasLight = true;
|
||||
lightRadius = 6.0;
|
||||
lightColor = "0.175 0.175 0.5";
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Ammo
|
||||
//--------------------------------------
|
||||
|
||||
datablock ItemData(DiscAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_disc.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some spinfusor discs";
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
|
||||
datablock ShapeBaseImageData(DiscImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_disc.dts";
|
||||
item = Disc;
|
||||
ammo = DiscAmmo;
|
||||
offset = "0 0 0";
|
||||
emap = true;
|
||||
|
||||
projectileSpread = 0;
|
||||
|
||||
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] = 1.25;
|
||||
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.5; // 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] = 1.0;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
};
|
||||
|
||||
datablock ItemData(Disc)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_disc.dts";
|
||||
image = DiscImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a spinfusor";
|
||||
emap = true;
|
||||
};
|
||||
742
scripts/weapons/T2Guns/grenadeLauncher.cs
Normal file
742
scripts/weapons/T2Guns/grenadeLauncher.cs
Normal file
|
|
@ -0,0 +1,742 @@
|
|||
//--------------------------------------
|
||||
// Grenade launcher
|
||||
//--------------------------------------
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Sounds
|
||||
//--------------------------------------
|
||||
datablock AudioProfile(GrenadeSwitchSound)
|
||||
{
|
||||
filename = "fx/weapons/generic_switch.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(GrenadeFireSound)
|
||||
{
|
||||
filename = "fx/weapons/grenadelauncher_fire.wav";
|
||||
description = AudioDefault3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(GrenadeProjectileSound)
|
||||
{
|
||||
filename = "fx/weapons/grenadelauncher_projectile.wav";
|
||||
description = ProjectileLooping3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(GrenadeReloadSound)
|
||||
{
|
||||
filename = "fx/weapons/generic_switch.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(GrenadeExplosionSound)
|
||||
{
|
||||
filename = "fx/weapons/grenade_explode.wav";
|
||||
description = AudioExplosion3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(UnderwaterGrenadeExplosionSound)
|
||||
{
|
||||
filename = "fx/weapons/grenade_explode_UW.wav";
|
||||
description = AudioExplosion3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(GrenadeDryFireSound)
|
||||
{
|
||||
filename = "fx/weapons/grenadelauncher_dryfire.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Underwater fx
|
||||
//----------------------------------------------------------------------------
|
||||
datablock ParticleData(GrenadeExplosionBubbleParticle)
|
||||
{
|
||||
dragCoefficient = 0.0;
|
||||
gravityCoefficient = -0.25;
|
||||
inheritedVelFactor = 0.0;
|
||||
constantAcceleration = 0.0;
|
||||
lifetimeMS = 1500;
|
||||
lifetimeVarianceMS = 600;
|
||||
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] = 1.0;
|
||||
sizes[1] = 1.0;
|
||||
sizes[2] = 1.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
datablock ParticleEmitterData(GrenadeExplosionBubbleEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 5;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 1.0;
|
||||
ejectionOffset = 3.0;
|
||||
velocityVariance = 0.5;
|
||||
thetaMin = 0;
|
||||
thetaMax = 80;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
particles = "GrenadeExplosionBubbleParticle";
|
||||
};
|
||||
|
||||
datablock ParticleData(UnderwaterGrenadeDust)
|
||||
{
|
||||
dragCoefficient = 1.0;
|
||||
gravityCoefficient = -0.01;
|
||||
inheritedVelFactor = 0.0;
|
||||
constantAcceleration = -1.1;
|
||||
lifetimeMS = 1000;
|
||||
lifetimeVarianceMS = 100;
|
||||
useInvAlpha = false;
|
||||
spinRandomMin = -90.0;
|
||||
spinRandomMax = 500.0;
|
||||
textureName = "particleTest";
|
||||
colors[0] = "0.6 0.6 1.0 0.5";
|
||||
colors[1] = "0.6 0.6 1.0 0.5";
|
||||
colors[2] = "0.6 0.6 1.0 0.0";
|
||||
sizes[0] = 3.0;
|
||||
sizes[1] = 3.0;
|
||||
sizes[2] = 3.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.7;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(UnderwaterGrenadeDustEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 15;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 15.0;
|
||||
velocityVariance = 0.0;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 70;
|
||||
thetaMax = 70;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
lifetimeMS = 250;
|
||||
particles = "UnderwaterGrenadeDust";
|
||||
};
|
||||
|
||||
|
||||
datablock ParticleData(UnderwaterGrenadeExplosionSmoke)
|
||||
{
|
||||
dragCoeffiecient = 0.4;
|
||||
gravityCoefficient = -0.25; // rises slowly
|
||||
inheritedVelFactor = 0.025;
|
||||
constantAcceleration = -1.1;
|
||||
|
||||
lifetimeMS = 1250;
|
||||
lifetimeVarianceMS = 0;
|
||||
|
||||
textureName = "particleTest";
|
||||
|
||||
useInvAlpha = false;
|
||||
spinRandomMin = -200.0;
|
||||
spinRandomMax = 200.0;
|
||||
|
||||
textureName = "special/Smoke/smoke_001";
|
||||
|
||||
colors[0] = "0.1 0.1 1.0 1.0";
|
||||
colors[1] = "0.4 0.4 1.0 1.0";
|
||||
colors[2] = "0.4 0.4 1.0 0.0";
|
||||
sizes[0] = 2.0;
|
||||
sizes[1] = 6.0;
|
||||
sizes[2] = 2.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(UnderwaterGExplosionSmokeEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 15;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 6.25;
|
||||
velocityVariance = 0.25;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 90.0;
|
||||
|
||||
lifetimeMS = 250;
|
||||
|
||||
particles = "UnderwaterGrenadeExplosionSmoke";
|
||||
};
|
||||
|
||||
|
||||
|
||||
datablock ParticleData(UnderwaterGrenadeSparks)
|
||||
{
|
||||
dragCoefficient = 1;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.2;
|
||||
constantAcceleration = 0.0;
|
||||
lifetimeMS = 500;
|
||||
lifetimeVarianceMS = 350;
|
||||
textureName = "special/underwaterSpark";
|
||||
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.5;
|
||||
sizes[2] = 0.75;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(UnderwaterGrenadeSparksEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 2;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 12;
|
||||
velocityVariance = 6.75;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 60;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
orientParticles = true;
|
||||
lifetimeMS = 100;
|
||||
particles = "UnderwaterGrenadeSparks";
|
||||
};
|
||||
|
||||
datablock ExplosionData(UnderwaterGrenadeExplosion)
|
||||
{
|
||||
soundProfile = UnderwaterGrenadeExplosionSound;
|
||||
|
||||
faceViewer = true;
|
||||
explosionScale = "0.8 0.8 0.8";
|
||||
|
||||
emitter[0] = UnderwaterGrenadeDustEmitter;
|
||||
emitter[1] = UnderwaterGExplosionSmokeEmitter;
|
||||
emitter[2] = UnderwaterGrenadeSparksEmitter;
|
||||
emitter[3] = GrenadeExplosionBubbleEmitter;
|
||||
|
||||
shakeCamera = true;
|
||||
camShakeFreq = "10.0 6.0 9.0";
|
||||
camShakeAmp = "20.0 20.0 20.0";
|
||||
camShakeDuration = 0.5;
|
||||
camShakeRadius = 20.0;
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Bubbles
|
||||
//----------------------------------------------------------------------------
|
||||
datablock ParticleData(GrenadeBubbleParticle)
|
||||
{
|
||||
dragCoefficient = 0.0;
|
||||
gravityCoefficient = -0.25;
|
||||
inheritedVelFactor = 0.0;
|
||||
constantAcceleration = 0.0;
|
||||
lifetimeMS = 1500;
|
||||
lifetimeVarianceMS = 600;
|
||||
useInvAlpha = false;
|
||||
textureName = "special/bubbles";
|
||||
|
||||
spinRandomMin = -100.0;
|
||||
spinRandomMax = 100.0;
|
||||
|
||||
colors[0] = "0.7 0.8 1.0 0.4";
|
||||
colors[1] = "0.7 0.8 1.0 0.4";
|
||||
colors[2] = "0.7 0.8 1.0 0.0";
|
||||
sizes[0] = 0.5;
|
||||
sizes[1] = 0.5;
|
||||
sizes[2] = 0.5;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(GrenadeBubbleEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 5;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 1.0;
|
||||
ejectionOffset = 0.1;
|
||||
velocityVariance = 0.5;
|
||||
thetaMin = 0;
|
||||
thetaMax = 80;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
particles = "GrenadeBubbleParticle";
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Debris
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
datablock ParticleData( GDebrisSmokeParticle )
|
||||
{
|
||||
dragCoeffiecient = 1.0;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.2;
|
||||
|
||||
lifetimeMS = 1000;
|
||||
lifetimeVarianceMS = 100;
|
||||
|
||||
textureName = "particleTest";
|
||||
|
||||
useInvAlpha = true;
|
||||
|
||||
spinRandomMin = -60.0;
|
||||
spinRandomMax = 60.0;
|
||||
|
||||
colors[0] = "0.4 0.4 0.4 1.0";
|
||||
colors[1] = "0.3 0.3 0.3 0.5";
|
||||
colors[2] = "0.0 0.0 0.0 0.0";
|
||||
sizes[0] = 0.0;
|
||||
sizes[1] = 1.0;
|
||||
sizes[2] = 1.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData( GDebrisSmokeEmitter )
|
||||
{
|
||||
ejectionPeriodMS = 7;
|
||||
periodVarianceMS = 1;
|
||||
|
||||
ejectionVelocity = 1.0; // A little oomph at the back end
|
||||
velocityVariance = 0.2;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 40.0;
|
||||
|
||||
particles = "GDebrisSmokeParticle";
|
||||
};
|
||||
|
||||
|
||||
datablock DebrisData( GrenadeDebris )
|
||||
{
|
||||
emitters[0] = GDebrisSmokeEmitter;
|
||||
|
||||
explodeOnMaxBounce = true;
|
||||
|
||||
elasticity = 0.4;
|
||||
friction = 0.2;
|
||||
|
||||
lifetime = 0.3;
|
||||
lifetimeVariance = 0.02;
|
||||
|
||||
numBounces = 1;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Splash
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
datablock ParticleData( GrenadeSplashParticle )
|
||||
{
|
||||
dragCoefficient = 1;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.2;
|
||||
constantAcceleration = -1.4;
|
||||
lifetimeMS = 300;
|
||||
lifetimeVarianceMS = 0;
|
||||
textureName = "special/droplet";
|
||||
colors[0] = "0.7 0.8 1.0 1.0";
|
||||
colors[1] = "0.7 0.8 1.0 0.5";
|
||||
colors[2] = "0.7 0.8 1.0 0.0";
|
||||
sizes[0] = 0.05;
|
||||
sizes[1] = 0.2;
|
||||
sizes[2] = 0.2;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData( GrenadeSplashEmitter )
|
||||
{
|
||||
ejectionPeriodMS = 4;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 4;
|
||||
velocityVariance = 1.0;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 50;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
orientParticles = true;
|
||||
lifetimeMS = 100;
|
||||
particles = "BlasterSplashParticle";
|
||||
};
|
||||
|
||||
|
||||
datablock SplashData(GrenadeSplash)
|
||||
{
|
||||
numSegments = 15;
|
||||
ejectionFreq = 15;
|
||||
ejectionAngle = 40;
|
||||
ringLifetime = 0.35;
|
||||
lifetimeMS = 300;
|
||||
velocity = 3.0;
|
||||
startRadius = 0.0;
|
||||
acceleration = -3.0;
|
||||
texWrap = 5.0;
|
||||
|
||||
texture = "special/water2";
|
||||
|
||||
emitter[0] = BlasterSplashEmitter;
|
||||
|
||||
colors[0] = "0.7 0.8 1.0 1.0";
|
||||
colors[1] = "0.7 0.8 1.0 1.0";
|
||||
colors[2] = "0.7 0.8 1.0 1.0";
|
||||
colors[3] = "0.7 0.8 1.0 1.0";
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.4;
|
||||
times[2] = 0.8;
|
||||
times[3] = 1.0;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Particle effects
|
||||
//--------------------------------------
|
||||
datablock ParticleData(GrenadeSmokeParticle)
|
||||
{
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = -0.2; // rises slowly
|
||||
inheritedVelFactor = 0.00;
|
||||
|
||||
lifetimeMS = 700; // lasts 2 second
|
||||
lifetimeVarianceMS = 150; // ...more or less
|
||||
|
||||
textureName = "particleTest";
|
||||
|
||||
useInvAlpha = true;
|
||||
spinRandomMin = -30.0;
|
||||
spinRandomMax = 30.0;
|
||||
|
||||
colors[0] = "0.9 0.9 0.9 1.0";
|
||||
colors[1] = "0.6 0.6 0.6 1.0";
|
||||
colors[2] = "0.4 0.4 0.4 0.0";
|
||||
|
||||
sizes[0] = 0.25;
|
||||
sizes[1] = 1.0;
|
||||
sizes[2] = 3.0;
|
||||
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.2;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(GrenadeSmokeEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 15;
|
||||
periodVarianceMS = 5;
|
||||
|
||||
ejectionVelocity = 1.25;
|
||||
velocityVariance = 0.50;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 90.0;
|
||||
|
||||
particles = "GrenadeSmokeParticle";
|
||||
};
|
||||
|
||||
|
||||
datablock ParticleData(GrenadeDust)
|
||||
{
|
||||
dragCoefficient = 1.0;
|
||||
gravityCoefficient = -0.01;
|
||||
inheritedVelFactor = 0.0;
|
||||
constantAcceleration = 0.0;
|
||||
lifetimeMS = 1000;
|
||||
lifetimeVarianceMS = 100;
|
||||
useInvAlpha = true;
|
||||
spinRandomMin = -90.0;
|
||||
spinRandomMax = 500.0;
|
||||
textureName = "particleTest";
|
||||
colors[0] = "0.3 0.3 0.3 0.5";
|
||||
colors[1] = "0.3 0.3 0.3 0.5";
|
||||
colors[2] = "0.3 0.3 0.3 0.0";
|
||||
sizes[0] = 3.2;
|
||||
sizes[1] = 4.6;
|
||||
sizes[2] = 5.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.7;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(GrenadeDustEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 5;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 15.0;
|
||||
velocityVariance = 0.0;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 85;
|
||||
thetaMax = 85;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
lifetimeMS = 250;
|
||||
particles = "GrenadeDust";
|
||||
};
|
||||
|
||||
|
||||
datablock ParticleData(GrenadeExplosionSmoke)
|
||||
{
|
||||
dragCoeffiecient = 0.4;
|
||||
gravityCoefficient = -0.5; // rises slowly
|
||||
inheritedVelFactor = 0.025;
|
||||
|
||||
lifetimeMS = 1250;
|
||||
lifetimeVarianceMS = 0;
|
||||
|
||||
textureName = "particleTest";
|
||||
|
||||
useInvAlpha = true;
|
||||
spinRandomMin = -200.0;
|
||||
spinRandomMax = 200.0;
|
||||
|
||||
textureName = "special/Smoke/smoke_001";
|
||||
|
||||
colors[0] = "0.7 0.7 0.7 1.0";
|
||||
colors[1] = "0.2 0.2 0.2 1.0";
|
||||
colors[2] = "0.1 0.1 0.1 0.0";
|
||||
sizes[0] = 2.0;
|
||||
sizes[1] = 6.0;
|
||||
sizes[2] = 2.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(GExplosionSmokeEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 5;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 6.25;
|
||||
velocityVariance = 0.25;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 90.0;
|
||||
|
||||
lifetimeMS = 250;
|
||||
|
||||
particles = "GrenadeExplosionSmoke";
|
||||
};
|
||||
|
||||
|
||||
|
||||
datablock ParticleData(GrenadeSparks)
|
||||
{
|
||||
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.5;
|
||||
sizes[2] = 0.75;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(GrenadeSparksEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 2;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 12;
|
||||
velocityVariance = 6.75;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 60;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
orientParticles = true;
|
||||
lifetimeMS = 100;
|
||||
particles = "GrenadeSparks";
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------
|
||||
// Explosion
|
||||
//----------------------------------------------------
|
||||
datablock ExplosionData(GrenadeExplosion)
|
||||
{
|
||||
soundProfile = GrenadeExplosionSound;
|
||||
|
||||
faceViewer = true;
|
||||
explosionScale = "0.8 0.8 0.8";
|
||||
|
||||
debris = GrenadeDebris;
|
||||
debrisThetaMin = 10;
|
||||
debrisThetaMax = 50;
|
||||
debrisNum = 8;
|
||||
debrisVelocity = 26.0;
|
||||
debrisVelocityVariance = 7.0;
|
||||
|
||||
emitter[0] = GrenadeDustEmitter;
|
||||
emitter[1] = GExplosionSmokeEmitter;
|
||||
emitter[2] = GrenadeSparksEmitter;
|
||||
|
||||
shakeCamera = true;
|
||||
camShakeFreq = "10.0 6.0 9.0";
|
||||
camShakeAmp = "20.0 20.0 20.0";
|
||||
camShakeDuration = 0.5;
|
||||
camShakeRadius = 20.0;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Projectile
|
||||
//--------------------------------------
|
||||
datablock GrenadeProjectileData(BasicGrenade)
|
||||
{
|
||||
projectileShapeName = "grenade_projectile.dts";
|
||||
emitterDelay = -1;
|
||||
directDamage = 0.0;
|
||||
hasDamageRadius = true;
|
||||
indirectDamage = 0.40;
|
||||
damageRadius = 15.0;
|
||||
radiusDamageType = $DamageType::Grenade;
|
||||
kickBackStrength = 1500;
|
||||
bubbleEmitTime = 1.0;
|
||||
|
||||
sound = GrenadeProjectileSound;
|
||||
explosion = "GrenadeExplosion";
|
||||
underwaterExplosion = "UnderwaterGrenadeExplosion";
|
||||
velInheritFactor = 0.5;
|
||||
splash = GrenadeSplash;
|
||||
|
||||
baseEmitter = GrenadeSmokeEmitter;
|
||||
bubbleEmitter = GrenadeBubbleEmitter;
|
||||
|
||||
grenadeElasticity = 0.35;
|
||||
grenadeFriction = 0.2;
|
||||
armingDelayMS = 1000;
|
||||
muzzleVelocity = 47.00;
|
||||
drag = 0.1;
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Ammo
|
||||
//--------------------------------------
|
||||
|
||||
datablock ItemData(GrenadeLauncherAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_grenade.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some grenade launcher ammo";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ItemData(GrenadeLauncher)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_grenade_launcher.dts";
|
||||
image = GrenadeLauncherImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a grenade launcher";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(GrenadeLauncherImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_grenade_launcher.dts";
|
||||
item = GrenadeLauncher;
|
||||
ammo = GrenadeLauncherAmmo;
|
||||
offset = "0 0 0";
|
||||
emap = true;
|
||||
|
||||
projectile = BasicGrenade;
|
||||
projectileType = GrenadeProjectile;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = GrenadeSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.4;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateScript[3] = "onFire";
|
||||
stateSound[3] = GrenadeFireSound;
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 0.5;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
stateSound[4] = GrenadeReloadSound;
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = GrenadeDryFireSound;
|
||||
stateTimeoutValue[6] = 1.5;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
};
|
||||
763
scripts/weapons/T2Guns/missileLauncher.cs
Normal file
763
scripts/weapons/T2Guns/missileLauncher.cs
Normal file
|
|
@ -0,0 +1,763 @@
|
|||
//--------------------------------------
|
||||
// Missile launcher
|
||||
//--------------------------------------
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Sounds
|
||||
//--------------------------------------
|
||||
datablock AudioProfile(MissileSwitchSound)
|
||||
{
|
||||
filename = "fx/weapons/missile_launcher_activate.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(MissileFireSound)
|
||||
{
|
||||
filename = "fx/weapons/missile_fire.WAV";
|
||||
description = AudioDefault3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(MissileProjectileSound)
|
||||
{
|
||||
filename = "fx/weapons/missile_projectile.wav";
|
||||
description = ProjectileLooping3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(MissileReloadSound)
|
||||
{
|
||||
filename = "fx/weapons/weapon.missilereload.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(MissileLockSound)
|
||||
{
|
||||
filename = "fx/weapons/missile_launcher_searching.WAV";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(MissileExplosionSound)
|
||||
{
|
||||
filename = "fx/explosions/explosion.xpl23.wav";
|
||||
description = AudioBIGExplosion3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(MissileDryFireSound)
|
||||
{
|
||||
filename = "fx/weapons/missile_launcher_dryfire.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
effect = MissileDryFireEffect;
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Splash Debris
|
||||
//----------------------------------------------------------------------------
|
||||
datablock ParticleData( MDebrisSmokeParticle )
|
||||
{
|
||||
dragCoeffiecient = 1.0;
|
||||
gravityCoefficient = 0.10;
|
||||
inheritedVelFactor = 0.1;
|
||||
|
||||
lifetimeMS = 1000;
|
||||
lifetimeVarianceMS = 100;
|
||||
|
||||
textureName = "particleTest";
|
||||
|
||||
// useInvAlpha = true;
|
||||
|
||||
spinRandomMin = -60.0;
|
||||
spinRandomMax = 60.0;
|
||||
|
||||
colors[0] = "0.7 0.8 1.0 1.0";
|
||||
colors[1] = "0.7 0.8 1.0 0.5";
|
||||
colors[2] = "0.7 0.8 1.0 0.0";
|
||||
sizes[0] = 0.0;
|
||||
sizes[1] = 0.8;
|
||||
sizes[2] = 0.8;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData( MDebrisSmokeEmitter )
|
||||
{
|
||||
ejectionPeriodMS = 10;
|
||||
periodVarianceMS = 1;
|
||||
|
||||
ejectionVelocity = 1.0; // A little oomph at the back end
|
||||
velocityVariance = 0.2;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 40.0;
|
||||
|
||||
particles = "MDebrisSmokeParticle";
|
||||
};
|
||||
|
||||
|
||||
datablock DebrisData( MissileSplashDebris )
|
||||
{
|
||||
emitters[0] = MDebrisSmokeEmitter;
|
||||
|
||||
explodeOnMaxBounce = true;
|
||||
|
||||
elasticity = 0.4;
|
||||
friction = 0.2;
|
||||
|
||||
lifetime = 0.3;
|
||||
lifetimeVariance = 0.1;
|
||||
|
||||
numBounces = 1;
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Missile smoke spike (for debris)
|
||||
//----------------------------------------------------------------------------
|
||||
datablock ParticleData( MissileSmokeSpike )
|
||||
{
|
||||
dragCoeffiecient = 1.0;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.2;
|
||||
|
||||
lifetimeMS = 1000;
|
||||
lifetimeVarianceMS = 100;
|
||||
|
||||
textureName = "particleTest";
|
||||
|
||||
useInvAlpha = true;
|
||||
|
||||
spinRandomMin = -60.0;
|
||||
spinRandomMax = 60.0;
|
||||
|
||||
colors[0] = "0.6 0.6 0.6 1.0";
|
||||
colors[1] = "0.4 0.4 0.4 0.5";
|
||||
colors[2] = "0.4 0.4 0.4 0.0";
|
||||
sizes[0] = 0.0;
|
||||
sizes[1] = 1.0;
|
||||
sizes[2] = 0.5;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData( MissileSmokeSpikeEmitter )
|
||||
{
|
||||
ejectionPeriodMS = 7;
|
||||
periodVarianceMS = 1;
|
||||
|
||||
ejectionVelocity = 1.0; // A little oomph at the back end
|
||||
velocityVariance = 0.2;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 40.0;
|
||||
|
||||
particles = "MissileSmokeSpike";
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Explosion smoke particles
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
datablock ParticleData(MissileExplosionSmoke)
|
||||
{
|
||||
dragCoeffiecient = 0.3;
|
||||
gravityCoefficient = -0.2;
|
||||
inheritedVelFactor = 0.025;
|
||||
|
||||
lifetimeMS = 1250;
|
||||
lifetimeVarianceMS = 0;
|
||||
|
||||
textureName = "particleTest";
|
||||
|
||||
useInvAlpha = true;
|
||||
spinRandomMin = -100.0;
|
||||
spinRandomMax = 100.0;
|
||||
|
||||
textureName = "special/Smoke/bigSmoke";
|
||||
|
||||
colors[0] = "1.0 0.7 0.0 1.0";
|
||||
colors[1] = "0.4 0.4 0.4 0.5";
|
||||
colors[2] = "0.4 0.4 0.4 0.0";
|
||||
sizes[0] = 1.0;
|
||||
sizes[1] = 3.0;
|
||||
sizes[2] = 1.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(MissileExplosionSmokeEMitter)
|
||||
{
|
||||
ejectionOffset = 0.0;
|
||||
ejectionPeriodMS = 5;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 3.25;
|
||||
velocityVariance = 0.25;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 180.0;
|
||||
|
||||
lifetimeMS = 250;
|
||||
|
||||
particles = "MissileExplosionSmoke";
|
||||
};
|
||||
|
||||
|
||||
|
||||
datablock DebrisData( MissileSpikeDebris )
|
||||
{
|
||||
emitters[0] = MissileSmokeSpikeEmitter;
|
||||
explodeOnMaxBounce = true;
|
||||
elasticity = 0.4;
|
||||
friction = 0.2;
|
||||
lifetime = 0.3;
|
||||
lifetimeVariance = 0.02;
|
||||
};
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Explosions
|
||||
//---------------------------------------------------------------------------
|
||||
datablock ExplosionData(MissileExplosion)
|
||||
{
|
||||
explosionShape = "effect_plasma_explosion.dts";
|
||||
playSpeed = 1.5;
|
||||
soundProfile = MissileExplosionSound;
|
||||
faceViewer = true;
|
||||
|
||||
sizes[0] = "0.5 0.5 0.5";
|
||||
sizes[1] = "0.5 0.5 0.5";
|
||||
sizes[2] = "0.5 0.5 0.5";
|
||||
|
||||
emitter[0] = MissileExplosionSmokeEmitter;
|
||||
|
||||
debris = MissileSpikeDebris;
|
||||
debrisThetaMin = 10;
|
||||
debrisThetaMax = 170;
|
||||
debrisNum = 8;
|
||||
debrisNumVariance = 6;
|
||||
debrisVelocity = 15.0;
|
||||
debrisVelocityVariance = 2.0;
|
||||
|
||||
shakeCamera = true;
|
||||
camShakeFreq = "6.0 7.0 7.0";
|
||||
camShakeAmp = "70.0 70.0 70.0";
|
||||
camShakeDuration = 1.0;
|
||||
camShakeRadius = 7.0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
datablock ExplosionData(MissileSplashExplosion)
|
||||
{
|
||||
explosionShape = "disc_explosion.dts";
|
||||
|
||||
faceViewer = true;
|
||||
explosionScale = "1.0 1.0 1.0";
|
||||
|
||||
debris = MissileSplashDebris;
|
||||
debrisThetaMin = 10;
|
||||
debrisThetaMax = 80;
|
||||
debrisNum = 10;
|
||||
debrisVelocity = 10.0;
|
||||
debrisVelocityVariance = 4.0;
|
||||
|
||||
sizes[0] = "0.35 0.35 0.35";
|
||||
sizes[1] = "0.15 0.15 0.15";
|
||||
sizes[2] = "0.15 0.15 0.15";
|
||||
sizes[3] = "0.15 0.15 0.15";
|
||||
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.333;
|
||||
times[2] = 0.666;
|
||||
times[3] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Splash
|
||||
//--------------------------------------------------------------------------
|
||||
datablock ParticleData(MissileMist)
|
||||
{
|
||||
dragCoefficient = 2.0;
|
||||
gravityCoefficient = -0.05;
|
||||
inheritedVelFactor = 0.0;
|
||||
constantAcceleration = 0.0;
|
||||
lifetimeMS = 400;
|
||||
lifetimeVarianceMS = 100;
|
||||
useInvAlpha = false;
|
||||
spinRandomMin = -90.0;
|
||||
spinRandomMax = 500.0;
|
||||
textureName = "particleTest";
|
||||
colors[0] = "0.7 0.8 1.0 1.0";
|
||||
colors[1] = "0.7 0.8 1.0 0.5";
|
||||
colors[2] = "0.7 0.8 1.0 0.0";
|
||||
sizes[0] = 0.5;
|
||||
sizes[1] = 0.5;
|
||||
sizes[2] = 0.8;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(MissileMistEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 5;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 6.0;
|
||||
velocityVariance = 4.0;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 85;
|
||||
thetaMax = 85;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
lifetimeMS = 250;
|
||||
particles = "MissileMist";
|
||||
};
|
||||
|
||||
|
||||
|
||||
datablock ParticleData( MissileSplashParticle )
|
||||
{
|
||||
dragCoefficient = 1;
|
||||
gravityCoefficient = 0.2;
|
||||
inheritedVelFactor = 0.2;
|
||||
constantAcceleration = -0.0;
|
||||
lifetimeMS = 600;
|
||||
lifetimeVarianceMS = 0;
|
||||
textureName = "special/droplet";
|
||||
colors[0] = "0.7 0.8 1.0 1.0";
|
||||
colors[1] = "0.7 0.8 1.0 0.5";
|
||||
colors[2] = "0.7 0.8 1.0 0.0";
|
||||
sizes[0] = 0.5;
|
||||
sizes[1] = 0.5;
|
||||
sizes[2] = 0.5;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData( MissileSplashEmitter )
|
||||
{
|
||||
ejectionPeriodMS = 1;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 6;
|
||||
velocityVariance = 3.0;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 60;
|
||||
thetaMax = 80;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
orientParticles = true;
|
||||
lifetimeMS = 100;
|
||||
particles = "MissileSplashParticle";
|
||||
};
|
||||
|
||||
|
||||
datablock SplashData(MissileSplash)
|
||||
{
|
||||
numSegments = 15;
|
||||
ejectionFreq = 0.0001;
|
||||
ejectionAngle = 45;
|
||||
ringLifetime = 0.5;
|
||||
lifetimeMS = 400;
|
||||
velocity = 5.0;
|
||||
startRadius = 0.0;
|
||||
acceleration = -3.0;
|
||||
texWrap = 5.0;
|
||||
|
||||
explosion = MissileSplashExplosion;
|
||||
|
||||
texture = "special/water2";
|
||||
|
||||
emitter[0] = MissileSplashEmitter;
|
||||
emitter[1] = MissileMistEmitter;
|
||||
|
||||
colors[0] = "0.7 0.8 1.0 0.0";
|
||||
colors[1] = "0.7 0.8 1.0 1.0";
|
||||
colors[2] = "0.7 0.8 1.0 0.0";
|
||||
colors[3] = "0.7 0.8 1.0 0.0";
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.4;
|
||||
times[2] = 0.8;
|
||||
times[3] = 1.0;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Particle effects
|
||||
//--------------------------------------
|
||||
datablock ParticleData(MissileSmokeParticle)
|
||||
{
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = -0.02;
|
||||
inheritedVelFactor = 0.1;
|
||||
|
||||
lifetimeMS = 1200;
|
||||
lifetimeVarianceMS = 100;
|
||||
|
||||
textureName = "particleTest";
|
||||
|
||||
useInvAlpha = true;
|
||||
spinRandomMin = -90.0;
|
||||
spinRandomMax = 90.0;
|
||||
|
||||
colors[0] = "1.0 0.75 0.0 0.0";
|
||||
colors[1] = "0.5 0.5 0.5 1.0";
|
||||
colors[2] = "0.3 0.3 0.3 0.0";
|
||||
sizes[0] = 1;
|
||||
sizes[1] = 2;
|
||||
sizes[2] = 3;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.1;
|
||||
times[2] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(MissileSmokeEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 10;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 1.5;
|
||||
velocityVariance = 0.3;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 50.0;
|
||||
|
||||
particles = "MissileSmokeParticle";
|
||||
};
|
||||
|
||||
|
||||
datablock ParticleData(MissileFireParticle)
|
||||
{
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 1.0;
|
||||
|
||||
lifetimeMS = 300;
|
||||
lifetimeVarianceMS = 000;
|
||||
|
||||
textureName = "particleTest";
|
||||
|
||||
spinRandomMin = -135;
|
||||
spinRandomMax = 135;
|
||||
|
||||
colors[0] = "1.0 0.75 0.2 1.0";
|
||||
colors[1] = "1.0 0.5 0.0 1.0";
|
||||
colors[2] = "1.0 0.40 0.0 0.0";
|
||||
sizes[0] = 0;
|
||||
sizes[1] = 1;
|
||||
sizes[2] = 1.5;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.3;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(MissileFireEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 15;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 15.0;
|
||||
velocityVariance = 0.0;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 0.0;
|
||||
|
||||
particles = "MissileFireParticle";
|
||||
};
|
||||
|
||||
|
||||
|
||||
datablock ParticleData(MissilePuffParticle)
|
||||
{
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.0;
|
||||
|
||||
lifetimeMS = 500;
|
||||
lifetimeVarianceMS = 300;
|
||||
|
||||
textureName = "particleTest";
|
||||
|
||||
spinRandomMin = -135;
|
||||
spinRandomMax = 135;
|
||||
|
||||
colors[0] = "1.0 1.0 1.0 0.5";
|
||||
colors[1] = "0.7 0.7 0.7 0.0";
|
||||
sizes[0] = 0.25;
|
||||
sizes[1] = 1.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(MissilePuffEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 50;
|
||||
periodVarianceMS = 3;
|
||||
|
||||
ejectionVelocity = 0.5;
|
||||
velocityVariance = 0.0;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 90.0;
|
||||
|
||||
particles = "MissilePuffParticle";
|
||||
};
|
||||
|
||||
|
||||
datablock ParticleData(MissileLauncherExhaustParticle)
|
||||
{
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = 0.01;
|
||||
inheritedVelFactor = 1.0;
|
||||
|
||||
lifetimeMS = 500;
|
||||
lifetimeVarianceMS = 300;
|
||||
|
||||
textureName = "particleTest";
|
||||
|
||||
useInvAlpha = true;
|
||||
spinRandomMin = -135;
|
||||
spinRandomMax = 135;
|
||||
|
||||
colors[0] = "1.0 1.0 1.0 0.5";
|
||||
colors[1] = "0.7 0.7 0.7 0.0";
|
||||
sizes[0] = 0.25;
|
||||
sizes[1] = 1.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(MissileLauncherExhaustEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 15;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 3.0;
|
||||
velocityVariance = 0.0;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 20.0;
|
||||
|
||||
particles = "MissileLauncherExhaustParticle";
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Debris
|
||||
//--------------------------------------
|
||||
datablock DebrisData( FlechetteDebris )
|
||||
{
|
||||
shapeName = "weapon_missile_fleschette.dts";
|
||||
|
||||
lifetime = 5.0;
|
||||
|
||||
minSpinSpeed = -320.0;
|
||||
maxSpinSpeed = 320.0;
|
||||
|
||||
elasticity = 0.2;
|
||||
friction = 0.3;
|
||||
|
||||
numBounces = 3;
|
||||
|
||||
gravModifier = 0.40;
|
||||
|
||||
staticOnMaxBounce = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Projectile
|
||||
//--------------------------------------
|
||||
datablock SeekerProjectileData(ShoulderMissile)
|
||||
{
|
||||
casingShapeName = "weapon_missile_casement.dts";
|
||||
projectileShapeName = "weapon_missile_projectile.dts";
|
||||
hasDamageRadius = true;
|
||||
indirectDamage = 0.8;
|
||||
damageRadius = 8.0;
|
||||
radiusDamageType = $DamageType::Missile;
|
||||
kickBackStrength = 2000;
|
||||
|
||||
explosion = "MissileExplosion";
|
||||
splash = MissileSplash;
|
||||
velInheritFactor = 1.0; // to compensate for slow starting velocity, this value
|
||||
// is cranked up to full so the missile doesn't start
|
||||
// out behind the player when the player is moving
|
||||
// very quickly - bramage
|
||||
|
||||
baseEmitter = MissileSmokeEmitter;
|
||||
delayEmitter = MissileFireEmitter;
|
||||
puffEmitter = MissilePuffEmitter;
|
||||
bubbleEmitter = GrenadeBubbleEmitter;
|
||||
bubbleEmitTime = 1.0;
|
||||
|
||||
exhaustEmitter = MissileLauncherExhaustEmitter;
|
||||
exhaustTimeMs = 300;
|
||||
exhaustNodeName = "muzzlePoint1";
|
||||
|
||||
ImageSource = "MissileLauncherImage";
|
||||
|
||||
lifetimeMS = 30000;
|
||||
muzzleVelocity = 10.0;
|
||||
maxVelocity = 150.0;
|
||||
turningSpeed = 110.0;
|
||||
acceleration = 350.0;
|
||||
|
||||
proximityRadius = 3;
|
||||
|
||||
terrainAvoidanceSpeed = 180;
|
||||
terrainScanAhead = 25;
|
||||
terrainHeightFail = 12;
|
||||
terrainAvoidanceRadius = 100;
|
||||
|
||||
flareDistance = 200;
|
||||
flareAngle = 30;
|
||||
|
||||
sound = MissileProjectileSound;
|
||||
|
||||
hasLight = true;
|
||||
lightRadius = 5.0;
|
||||
lightColor = "0.2 0.05 0";
|
||||
|
||||
useFlechette = true;
|
||||
flechetteDelayMs = 550;
|
||||
casingDeb = FlechetteDebris;
|
||||
|
||||
explodeOnWaterImpact = false;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Ammo
|
||||
//--------------------------------------
|
||||
|
||||
datablock ItemData(MissileLauncherAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_missile.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some missiles";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ItemData(MissileLauncher)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_missile.dts";
|
||||
image = MissileLauncherImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a missile launcher";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(MissileLauncherImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_missile.dts";
|
||||
item = MissileLauncher;
|
||||
ammo = MissileLauncherAmmo;
|
||||
offset = "0 0 0";
|
||||
armThread = lookms;
|
||||
emap = true;
|
||||
|
||||
projectile = ShoulderMissile;
|
||||
projectileType = SeekerProjectile;
|
||||
|
||||
isSeeker = true;
|
||||
seekRadius = 400;
|
||||
maxSeekAngle = 8;
|
||||
seekTime = 0.5;
|
||||
minSeekHeat = 0.7; // the heat that must be present on a target to lock it.
|
||||
|
||||
// only target objects outside this range
|
||||
minTargetingDistance = 40;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = MissileSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.4;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateScript[3] = "onFire";
|
||||
stateSound[3] = MissileFireSound;
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 2.5;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
stateSound[4] = MissileReloadSound;
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = MissileDryFireSound;
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateTransitionOnTimeout[6] = "ActivateReady";
|
||||
|
||||
stateName[7] = "CheckTarget";
|
||||
stateTransitionOnNoTarget[7] = "DryFire";
|
||||
stateTransitionOnTarget[7] = "Fire";
|
||||
|
||||
stateName[8] = "CheckWet";
|
||||
stateTransitionOnWet[8] = "WetFire";
|
||||
stateTransitionOnNotWet[8] = "CheckTarget";
|
||||
|
||||
stateName[9] = "WetFire";
|
||||
stateTransitionOnNoAmmo[9] = "NoAmmo";
|
||||
stateTransitionOnTimeout[9] = "Reload";
|
||||
stateSound[9] = MissileFireSound;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateTimeoutValue[9] = 0.4;
|
||||
stateSequence[3] = "Fire";
|
||||
stateScript[9] = "onWetFire";
|
||||
stateAllowImageChange[9] = false;
|
||||
};
|
||||
745
scripts/weapons/T2Guns/mortar.cs
Normal file
745
scripts/weapons/T2Guns/mortar.cs
Normal file
|
|
@ -0,0 +1,745 @@
|
|||
//--------------------------------------
|
||||
// Mortar
|
||||
//--------------------------------------
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Sounds
|
||||
//--------------------------------------
|
||||
datablock AudioProfile(MortarSwitchSound)
|
||||
{
|
||||
filename = "fx/weapons/mortar_activate.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(MortarReloadSound)
|
||||
{
|
||||
filename = "fx/weapons/mortar_reload.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(MortarFireSound)
|
||||
{
|
||||
filename = "fx/weapons/mortar_fire.wav";
|
||||
description = AudioDefault3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(MortarProjectileSound)
|
||||
{
|
||||
filename = "fx/weapons/mortar_projectile.wav";
|
||||
description = ProjectileLooping3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(MortarExplosionSound)
|
||||
{
|
||||
filename = "fx/weapons/mortar_explode.wav";
|
||||
description = AudioBIGExplosion3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(UnderwaterMortarExplosionSound)
|
||||
{
|
||||
filename = "fx/weapons/mortar_explode_UW.wav";
|
||||
description = AudioBIGExplosion3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(MortarDryFireSound)
|
||||
{
|
||||
filename = "fx/weapons/mortar_dryfire.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Bubbles
|
||||
//----------------------------------------------------------------------------
|
||||
datablock ParticleData(MortarBubbleParticle)
|
||||
{
|
||||
dragCoefficient = 0.0;
|
||||
gravityCoefficient = -0.25;
|
||||
inheritedVelFactor = 0.0;
|
||||
constantAcceleration = 0.0;
|
||||
lifetimeMS = 1500;
|
||||
lifetimeVarianceMS = 600;
|
||||
useInvAlpha = false;
|
||||
textureName = "special/bubbles";
|
||||
|
||||
spinRandomMin = -100.0;
|
||||
spinRandomMax = 100.0;
|
||||
|
||||
colors[0] = "0.7 0.8 1.0 0.4";
|
||||
colors[1] = "0.7 0.8 1.0 0.4";
|
||||
colors[2] = "0.7 0.8 1.0 0.0";
|
||||
sizes[0] = 0.8;
|
||||
sizes[1] = 0.8;
|
||||
sizes[2] = 0.8;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(MortarBubbleEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 9;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 1.0;
|
||||
ejectionOffset = 0.1;
|
||||
velocityVariance = 0.5;
|
||||
thetaMin = 0;
|
||||
thetaMax = 80;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
particles = "MortarBubbleParticle";
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Splash
|
||||
//--------------------------------------------------------------------------
|
||||
datablock ParticleData( MortarSplashParticle )
|
||||
{
|
||||
dragCoefficient = 1;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.2;
|
||||
constantAcceleration = -1.4;
|
||||
lifetimeMS = 300;
|
||||
lifetimeVarianceMS = 0;
|
||||
textureName = "special/droplet";
|
||||
colors[0] = "0.7 0.8 1.0 1.0";
|
||||
colors[1] = "0.7 0.8 1.0 0.5";
|
||||
colors[2] = "0.7 0.8 1.0 0.0";
|
||||
sizes[0] = 0.05;
|
||||
sizes[1] = 0.2;
|
||||
sizes[2] = 0.2;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData( MortarSplashEmitter )
|
||||
{
|
||||
ejectionPeriodMS = 4;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 3;
|
||||
velocityVariance = 1.0;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 50;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
orientParticles = true;
|
||||
lifetimeMS = 100;
|
||||
particles = "MortarSplashParticle";
|
||||
};
|
||||
|
||||
|
||||
datablock SplashData(MortarSplash)
|
||||
{
|
||||
numSegments = 10;
|
||||
ejectionFreq = 10;
|
||||
ejectionAngle = 20;
|
||||
ringLifetime = 0.4;
|
||||
lifetimeMS = 400;
|
||||
velocity = 3.0;
|
||||
startRadius = 0.0;
|
||||
acceleration = -3.0;
|
||||
texWrap = 5.0;
|
||||
|
||||
texture = "special/water2";
|
||||
|
||||
emitter[0] = MortarSplashEmitter;
|
||||
|
||||
colors[0] = "0.7 0.8 1.0 0.0";
|
||||
colors[1] = "0.7 0.8 1.0 1.0";
|
||||
colors[2] = "0.7 0.8 1.0 0.0";
|
||||
colors[3] = "0.7 0.8 1.0 0.0";
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.4;
|
||||
times[2] = 0.8;
|
||||
times[3] = 1.0;
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Mortar Shockwaves
|
||||
//---------------------------------------------------------------------------
|
||||
datablock ShockwaveData(UnderwaterMortarShockwave)
|
||||
{
|
||||
width = 6.0;
|
||||
numSegments = 32;
|
||||
numVertSegments = 6;
|
||||
velocity = 10;
|
||||
acceleration = 20.0;
|
||||
lifetimeMS = 900;
|
||||
height = 1.0;
|
||||
verticalCurve = 0.5;
|
||||
is2D = false;
|
||||
|
||||
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.4 0.4 1.0 0.50";
|
||||
colors[1] = "0.4 0.4 1.0 0.25";
|
||||
colors[2] = "0.4 0.4 1.0 0.0";
|
||||
|
||||
mapToTerrain = true;
|
||||
orientToNormal = false;
|
||||
renderBottom = false;
|
||||
};
|
||||
|
||||
datablock ShockwaveData(MortarShockwave)
|
||||
{
|
||||
width = 6.0;
|
||||
numSegments = 32;
|
||||
numVertSegments = 6;
|
||||
velocity = 15;
|
||||
acceleration = 20.0;
|
||||
lifetimeMS = 500;
|
||||
height = 1.0;
|
||||
verticalCurve = 0.5;
|
||||
is2D = false;
|
||||
|
||||
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.4 1.0 0.4 0.50";
|
||||
colors[1] = "0.4 1.0 0.4 0.25";
|
||||
colors[2] = "0.4 1.0 0.4 0.0";
|
||||
|
||||
mapToTerrain = true;
|
||||
orientToNormal = false;
|
||||
renderBottom = false;
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Mortar Explosion Particle effects
|
||||
//--------------------------------------
|
||||
datablock ParticleData( MortarCrescentParticle )
|
||||
{
|
||||
dragCoefficient = 2;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.2;
|
||||
constantAcceleration = -0.0;
|
||||
lifetimeMS = 600;
|
||||
lifetimeVarianceMS = 000;
|
||||
textureName = "special/crescent3";
|
||||
colors[0] = "0.7 1.0 0.7 1.0";
|
||||
colors[1] = "0.7 1.0 0.7 0.5";
|
||||
colors[2] = "0.7 1.0 0.7 0.0";
|
||||
sizes[0] = 4.0;
|
||||
sizes[1] = 8.0;
|
||||
sizes[2] = 9.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData( MortarCrescentEmitter )
|
||||
{
|
||||
ejectionPeriodMS = 25;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 40;
|
||||
velocityVariance = 5.0;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 80;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
orientParticles = true;
|
||||
lifetimeMS = 200;
|
||||
particles = "MortarCrescentParticle";
|
||||
};
|
||||
|
||||
|
||||
datablock ParticleData(MortarExplosionSmoke)
|
||||
{
|
||||
dragCoeffiecient = 0.4;
|
||||
gravityCoefficient = -0.30; // rises slowly
|
||||
inheritedVelFactor = 0.025;
|
||||
|
||||
lifetimeMS = 1250;
|
||||
lifetimeVarianceMS = 500;
|
||||
|
||||
textureName = "particleTest";
|
||||
|
||||
useInvAlpha = true;
|
||||
spinRandomMin = -100.0;
|
||||
spinRandomMax = 100.0;
|
||||
|
||||
textureName = "special/Smoke/bigSmoke";
|
||||
|
||||
colors[0] = "0.7 0.7 0.7 0.0";
|
||||
colors[1] = "0.4 0.4 0.4 0.5";
|
||||
colors[2] = "0.4 0.4 0.4 0.5";
|
||||
colors[3] = "0.4 0.4 0.4 0.0";
|
||||
sizes[0] = 5.0;
|
||||
sizes[1] = 6.0;
|
||||
sizes[2] = 10.0;
|
||||
sizes[3] = 12.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.333;
|
||||
times[2] = 0.666;
|
||||
times[3] = 1.0;
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(MortarExplosionSmokeEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 10;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionOffset = 8.0;
|
||||
|
||||
|
||||
ejectionVelocity = 1.25;
|
||||
velocityVariance = 1.2;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 90.0;
|
||||
|
||||
lifetimeMS = 500;
|
||||
|
||||
particles = "MortarExplosionSmoke";
|
||||
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Underwater Explosion
|
||||
//---------------------------------------------------------------------------
|
||||
datablock ParticleData(UnderwaterExplosionSparks)
|
||||
{
|
||||
dragCoefficient = 0;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.2;
|
||||
constantAcceleration = 0.0;
|
||||
lifetimeMS = 500;
|
||||
lifetimeVarianceMS = 350;
|
||||
textureName = "special/crescent3";
|
||||
colors[0] = "0.4 0.4 1.0 1.0";
|
||||
colors[1] = "0.4 0.4 1.0 1.0";
|
||||
colors[2] = "0.4 0.4 1.0 0.0";
|
||||
sizes[0] = 3.5;
|
||||
sizes[1] = 3.5;
|
||||
sizes[2] = 3.5;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(UnderwaterExplosionSparksEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 2;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 17;
|
||||
velocityVariance = 4;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 60;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
orientParticles = true;
|
||||
lifetimeMS = 100;
|
||||
particles = "UnderwaterExplosionSparks";
|
||||
};
|
||||
|
||||
datablock ParticleData(MortarExplosionBubbleParticle)
|
||||
{
|
||||
dragCoefficient = 0.0;
|
||||
gravityCoefficient = -0.25;
|
||||
inheritedVelFactor = 0.0;
|
||||
constantAcceleration = 0.0;
|
||||
lifetimeMS = 1500;
|
||||
lifetimeVarianceMS = 600;
|
||||
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] = 2.0;
|
||||
sizes[1] = 2.0;
|
||||
sizes[2] = 2.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.8;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
datablock ParticleEmitterData(MortarExplosionBubbleEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 5;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 1.0;
|
||||
ejectionOffset = 7.0;
|
||||
velocityVariance = 0.5;
|
||||
thetaMin = 0;
|
||||
thetaMax = 80;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
particles = "MortarExplosionBubbleParticle";
|
||||
};
|
||||
|
||||
datablock DebrisData( UnderwaterMortarDebris )
|
||||
{
|
||||
emitters[0] = MortarExplosionBubbleEmitter;
|
||||
|
||||
explodeOnMaxBounce = true;
|
||||
|
||||
elasticity = 0.4;
|
||||
friction = 0.2;
|
||||
|
||||
lifetime = 1.5;
|
||||
lifetimeVariance = 0.2;
|
||||
|
||||
numBounces = 1;
|
||||
};
|
||||
|
||||
datablock ExplosionData(UnderwaterMortarSubExplosion1)
|
||||
{
|
||||
explosionShape = "disc_explosion.dts";
|
||||
faceViewer = true;
|
||||
delayMS = 100;
|
||||
offset = 3.0;
|
||||
playSpeed = 1.5;
|
||||
|
||||
sizes[0] = "0.75 0.75 0.75";
|
||||
sizes[1] = "1.0 1.0 1.0";
|
||||
sizes[2] = "0.5 0.5 0.5";
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
datablock ExplosionData(UnderwaterMortarSubExplosion2)
|
||||
{
|
||||
explosionShape = "disc_explosion.dts";
|
||||
faceViewer = true;
|
||||
delayMS = 50;
|
||||
offset = 3.0;
|
||||
playSpeed = 0.75;
|
||||
|
||||
sizes[0] = "1.5 1.5 1.5";
|
||||
sizes[1] = "1.5 1.5 1.5";
|
||||
sizes[2] = "1.0 1.0 1.0";
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ExplosionData(UnderwaterMortarSubExplosion3)
|
||||
{
|
||||
explosionShape = "disc_explosion.dts";
|
||||
faceViewer = true;
|
||||
delayMS = 0;
|
||||
offset = 0.0;
|
||||
playSpeed = 0.5;
|
||||
|
||||
sizes[0] = "1.0 1.0 1.0";
|
||||
sizes[1] = "2.0 2.0 2.0";
|
||||
sizes[2] = "1.5 1.5 1.5";
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
datablock ExplosionData(UnderwaterMortarExplosion)
|
||||
{
|
||||
soundProfile = UnderwaterMortarExplosionSound;
|
||||
|
||||
shockwave = UnderwaterMortarShockwave;
|
||||
shockwaveOnTerrain = true;
|
||||
|
||||
subExplosion[0] = UnderwaterMortarSubExplosion1;
|
||||
subExplosion[1] = UnderwaterMortarSubExplosion2;
|
||||
subExplosion[2] = UnderwaterMortarSubExplosion3;
|
||||
|
||||
emitter[0] = MortarExplosionBubbleEmitter;
|
||||
emitter[1] = UnderwaterExplosionSparksEmitter;
|
||||
|
||||
shakeCamera = true;
|
||||
camShakeFreq = "8.0 9.0 7.0";
|
||||
camShakeAmp = "100.0 100.0 100.0";
|
||||
camShakeDuration = 1.3;
|
||||
camShakeRadius = 25.0;
|
||||
};
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Explosion
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
datablock ExplosionData(MortarSubExplosion1)
|
||||
{
|
||||
explosionShape = "mortar_explosion.dts";
|
||||
faceViewer = true;
|
||||
|
||||
delayMS = 100;
|
||||
|
||||
offset = 5.0;
|
||||
|
||||
playSpeed = 1.5;
|
||||
|
||||
sizes[0] = "0.5 0.5 0.5";
|
||||
sizes[1] = "0.5 0.5 0.5";
|
||||
times[0] = 0.0;
|
||||
times[1] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
datablock ExplosionData(MortarSubExplosion2)
|
||||
{
|
||||
explosionShape = "mortar_explosion.dts";
|
||||
faceViewer = true;
|
||||
|
||||
delayMS = 50;
|
||||
|
||||
offset = 5.0;
|
||||
|
||||
playSpeed = 1.0;
|
||||
|
||||
sizes[0] = "1.0 1.0 1.0";
|
||||
sizes[1] = "1.0 1.0 1.0";
|
||||
times[0] = 0.0;
|
||||
times[1] = 1.0;
|
||||
};
|
||||
|
||||
datablock ExplosionData(MortarSubExplosion3)
|
||||
{
|
||||
explosionShape = "mortar_explosion.dts";
|
||||
faceViewer = true;
|
||||
delayMS = 0;
|
||||
offset = 0.0;
|
||||
playSpeed = 0.7;
|
||||
|
||||
sizes[0] = "1.0 1.0 1.0";
|
||||
sizes[1] = "2.0 2.0 2.0";
|
||||
times[0] = 0.0;
|
||||
times[1] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
datablock ExplosionData(MortarExplosion)
|
||||
{
|
||||
soundProfile = MortarExplosionSound;
|
||||
|
||||
shockwave = MortarShockwave;
|
||||
shockwaveOnTerrain = true;
|
||||
|
||||
subExplosion[0] = MortarSubExplosion1;
|
||||
subExplosion[1] = MortarSubExplosion2;
|
||||
subExplosion[2] = MortarSubExplosion3;
|
||||
|
||||
emitter[0] = MortarExplosionSmokeEmitter;
|
||||
emitter[1] = MortarCrescentEmitter;
|
||||
|
||||
shakeCamera = true;
|
||||
camShakeFreq = "8.0 9.0 7.0";
|
||||
camShakeAmp = "100.0 100.0 100.0";
|
||||
camShakeDuration = 1.3;
|
||||
camShakeRadius = 25.0;
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Smoke particles
|
||||
//---------------------------------------------------------------------------
|
||||
datablock ParticleData(MortarSmokeParticle)
|
||||
{
|
||||
dragCoeffiecient = 0.4;
|
||||
gravityCoefficient = -0.3; // rises slowly
|
||||
inheritedVelFactor = 0.125;
|
||||
|
||||
lifetimeMS = 1200;
|
||||
lifetimeVarianceMS = 200;
|
||||
useInvAlpha = true;
|
||||
spinRandomMin = -100.0;
|
||||
spinRandomMax = 100.0;
|
||||
|
||||
animateTexture = false;
|
||||
|
||||
textureName = "special/Smoke/bigSmoke";
|
||||
|
||||
colors[0] = "0.7 1.0 0.7 0.5";
|
||||
colors[1] = "0.3 0.7 0.3 0.8";
|
||||
colors[2] = "0.0 0.0 0.0 0.0";
|
||||
sizes[0] = 1.0;
|
||||
sizes[1] = 2.0;
|
||||
sizes[2] = 4.5;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
datablock ParticleEmitterData(MortarSmokeEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 10;
|
||||
periodVarianceMS = 3;
|
||||
|
||||
ejectionVelocity = 2.25;
|
||||
velocityVariance = 0.55;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 40.0;
|
||||
|
||||
particles = "MortarSmokeParticle";
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Projectile
|
||||
//--------------------------------------
|
||||
datablock GrenadeProjectileData(MortarShot)
|
||||
{
|
||||
projectileShapeName = "mortar_projectile.dts";
|
||||
emitterDelay = -1;
|
||||
directDamage = 0.0;
|
||||
hasDamageRadius = true;
|
||||
indirectDamage = 1.0;
|
||||
damageRadius = 20.0;
|
||||
radiusDamageType = $DamageType::Mortar;
|
||||
kickBackStrength = 2500;
|
||||
|
||||
explosion = "MortarExplosion";
|
||||
underwaterExplosion = "UnderwaterMortarExplosion";
|
||||
velInheritFactor = 0.5;
|
||||
splash = MortarSplash;
|
||||
depthTolerance = 10.0; // depth at which it uses underwater explosion
|
||||
|
||||
baseEmitter = MortarSmokeEmitter;
|
||||
bubbleEmitter = MortarBubbleEmitter;
|
||||
|
||||
grenadeElasticity = 0.15;
|
||||
grenadeFriction = 0.4;
|
||||
armingDelayMS = 2000;
|
||||
muzzleVelocity = 63.7;
|
||||
drag = 0.1;
|
||||
|
||||
sound = MortarProjectileSound;
|
||||
|
||||
hasLight = true;
|
||||
lightRadius = 4;
|
||||
lightColor = "0.05 0.2 0.05";
|
||||
|
||||
hasLightUnderwaterColor = true;
|
||||
underWaterLightColor = "0.05 0.075 0.2";
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Ammo
|
||||
//--------------------------------------
|
||||
|
||||
datablock ItemData(MortarAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_mortar.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some mortar ammo";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ItemData(Mortar)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_mortar.dts";
|
||||
image = MortarImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a mortar gun";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(MortarImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_mortar.dts";
|
||||
item = Mortar;
|
||||
ammo = MortarAmmo;
|
||||
offset = "0 0 0";
|
||||
emap = true;
|
||||
|
||||
projectile = MortarShot;
|
||||
projectileType = GrenadeProjectile;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = MortarSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
//stateSound[2] = MortarIdleSound;
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateSequence[3] = "Recoil";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.8;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
stateSound[3] = MortarFireSound;
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 2.0;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
stateSound[4] = MortarReloadSound;
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = MortarDryFireSound;
|
||||
stateTimeoutValue[6] = 1.5;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
};
|
||||
443
scripts/weapons/T2Guns/plasma.cs
Normal file
443
scripts/weapons/T2Guns/plasma.cs
Normal file
|
|
@ -0,0 +1,443 @@
|
|||
//--------------------------------------
|
||||
// Plasma rifle
|
||||
//--------------------------------------
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Sounds
|
||||
//--------------------------------------
|
||||
datablock AudioProfile(PlasmaSwitchSound)
|
||||
{
|
||||
filename = "fx/weapons/plasma_rifle_activate.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(PlasmaFireSound)
|
||||
{
|
||||
filename = "fx/weapons/plasma_rifle_fire.wav";
|
||||
description = AudioDefault3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(PlasmaIdleSound)
|
||||
{
|
||||
filename = "fx/weapons/plasma_rifle_idle.wav";
|
||||
description = ClosestLooping3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(PlasmaReloadSound)
|
||||
{
|
||||
filename = "fx/weapons/plasma_rifle_reload.wav";
|
||||
description = Audioclosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(plasmaExpSound)
|
||||
{
|
||||
filename = "fx/explosions/explosion.xpl10.wav";
|
||||
description = AudioExplosion3d;
|
||||
};
|
||||
|
||||
datablock AudioProfile(PlasmaProjectileSound)
|
||||
{
|
||||
filename = "fx/weapons/plasma_rifle_projectile.WAV";
|
||||
description = ProjectileLooping3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(PlasmaDryFireSound)
|
||||
{
|
||||
filename = "fx/weapons/plasma_dryfire.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(PlasmaFireWetSound)
|
||||
{
|
||||
filename = "fx/weapons/plasma_fizzle.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
//--------------------------------------------------------------------------
|
||||
// Explosion
|
||||
//--------------------------------------
|
||||
datablock ParticleData(PlasmaExplosionParticle)
|
||||
{
|
||||
dragCoefficient = 2;
|
||||
gravityCoefficient = 0.2;
|
||||
inheritedVelFactor = 0.2;
|
||||
constantAcceleration = 0.0;
|
||||
lifetimeMS = 750;
|
||||
lifetimeVarianceMS = 150;
|
||||
textureName = "particleTest";
|
||||
colors[0] = "0.56 0.36 0.26 1.0";
|
||||
colors[1] = "0.56 0.36 0.26 0.0";
|
||||
sizes[0] = 0.5;
|
||||
sizes[1] = 2;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(PlasmaExplosionEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 7;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 5;
|
||||
velocityVariance = 1.0;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 60;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
particles = "PlasmaExplosionParticle";
|
||||
};
|
||||
|
||||
datablock ExplosionData(PlasmaBoltExplosion)
|
||||
{
|
||||
explosionShape = "effect_plasma_explosion.dts";
|
||||
soundProfile = plasmaExpSound;
|
||||
particleEmitter = PlasmaExplosionEmitter;
|
||||
particleDensity = 150;
|
||||
particleRadius = 1.25;
|
||||
faceViewer = true;
|
||||
|
||||
sizes[0] = "1.0 1.0 1.0";
|
||||
sizes[1] = "1.0 1.0 1.0";
|
||||
times[0] = 0.0;
|
||||
times[1] = 1.5;
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Splash
|
||||
//--------------------------------------------------------------------------
|
||||
datablock ParticleData(PlasmaMist)
|
||||
{
|
||||
dragCoefficient = 2.0;
|
||||
gravityCoefficient = -0.05;
|
||||
inheritedVelFactor = 0.0;
|
||||
constantAcceleration = 0.0;
|
||||
lifetimeMS = 400;
|
||||
lifetimeVarianceMS = 100;
|
||||
useInvAlpha = false;
|
||||
spinRandomMin = -90.0;
|
||||
spinRandomMax = 500.0;
|
||||
textureName = "particleTest";
|
||||
colors[0] = "0.7 0.8 1.0 1.0";
|
||||
colors[1] = "0.7 0.8 1.0 0.5";
|
||||
colors[2] = "0.7 0.8 1.0 0.0";
|
||||
sizes[0] = 0.5;
|
||||
sizes[1] = 0.5;
|
||||
sizes[2] = 0.8;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(PlasmaMistEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 5;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 3.0;
|
||||
velocityVariance = 2.0;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 85;
|
||||
thetaMax = 85;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
lifetimeMS = 250;
|
||||
particles = "PlasmaMist";
|
||||
};
|
||||
|
||||
datablock ParticleData( PlasmaSplashParticle2 )
|
||||
{
|
||||
|
||||
dragCoeffiecient = 0.4;
|
||||
gravityCoefficient = -0.03; // rises slowly
|
||||
inheritedVelFactor = 0.025;
|
||||
|
||||
lifetimeMS = 600;
|
||||
lifetimeVarianceMS = 300;
|
||||
|
||||
textureName = "particleTest";
|
||||
|
||||
useInvAlpha = false;
|
||||
spinRandomMin = -200.0;
|
||||
spinRandomMax = 200.0;
|
||||
|
||||
|
||||
colors[0] = "0.7 0.8 1.0 1.0";
|
||||
colors[1] = "0.7 0.8 1.0 0.5";
|
||||
colors[2] = "0.7 0.8 1.0 0.0";
|
||||
sizes[0] = 0.5;
|
||||
sizes[1] = 1.0;
|
||||
sizes[2] = 2.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData( PlasmaSplashEmitter2 )
|
||||
{
|
||||
ejectionPeriodMS = 25;
|
||||
ejectionOffset = 0.2;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 2.25;
|
||||
velocityVariance = 0.50;
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 30.0;
|
||||
lifetimeMS = 250;
|
||||
|
||||
particles = "PlasmaSplashParticle2";
|
||||
};
|
||||
|
||||
|
||||
datablock ParticleData( PlasmaSplashParticle )
|
||||
{
|
||||
dragCoefficient = 1;
|
||||
gravityCoefficient = 0.2;
|
||||
inheritedVelFactor = 0.2;
|
||||
constantAcceleration = -0.0;
|
||||
lifetimeMS = 600;
|
||||
lifetimeVarianceMS = 0;
|
||||
textureName = "special/droplet";
|
||||
colors[0] = "0.7 0.8 1.0 1.0";
|
||||
colors[1] = "0.7 0.8 1.0 0.5";
|
||||
colors[2] = "0.7 0.8 1.0 0.0";
|
||||
sizes[0] = 0.5;
|
||||
sizes[1] = 0.5;
|
||||
sizes[2] = 0.5;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData( PlasmaSplashEmitter )
|
||||
{
|
||||
ejectionPeriodMS = 1;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 3;
|
||||
velocityVariance = 1.0;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 60;
|
||||
thetaMax = 80;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
orientParticles = true;
|
||||
lifetimeMS = 100;
|
||||
particles = "PlasmaSplashParticle";
|
||||
};
|
||||
|
||||
|
||||
datablock SplashData(PlasmaSplash)
|
||||
{
|
||||
numSegments = 15;
|
||||
ejectionFreq = 0.0001;
|
||||
ejectionAngle = 45;
|
||||
ringLifetime = 0.5;
|
||||
lifetimeMS = 400;
|
||||
velocity = 5.0;
|
||||
startRadius = 0.0;
|
||||
acceleration = -3.0;
|
||||
texWrap = 5.0;
|
||||
|
||||
texture = "special/water2";
|
||||
|
||||
emitter[0] = PlasmaSplashEmitter;
|
||||
emitter[1] = PlasmaSplashEmitter2;
|
||||
emitter[2] = PlasmaMistEmitter;
|
||||
|
||||
colors[0] = "0.7 0.8 1.0 0.0";
|
||||
colors[1] = "0.7 0.8 1.0 1.0";
|
||||
colors[2] = "0.7 0.8 1.0 0.0";
|
||||
colors[3] = "0.7 0.8 1.0 0.0";
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.4;
|
||||
times[2] = 0.8;
|
||||
times[3] = 1.0;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Projectile
|
||||
//--------------------------------------
|
||||
datablock ParticleData(PlasmaRifleParticle)
|
||||
{
|
||||
dragCoefficient = 2.75;
|
||||
gravityCoefficient = 0.1;
|
||||
inheritedVelFactor = 0.2;
|
||||
constantAcceleration = 0.0;
|
||||
lifetimeMS = 550;
|
||||
lifetimeVarianceMS = 0;
|
||||
textureName = "particleTest";
|
||||
colors[0] = "0.46 0.36 0.26 1.0";
|
||||
colors[1] = "0.46 0.36 0.26 0.0";
|
||||
sizes[0] = 0.25;
|
||||
sizes[1] = 0.20;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(PlasmaRifleEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 3;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 10;
|
||||
velocityVariance = 1.0;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 12;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvance = true;
|
||||
particles = "PlasmaRifleParticle";
|
||||
};
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Projectile
|
||||
//--------------------------------------
|
||||
datablock LinearFlareProjectileData(PlasmaBolt)
|
||||
{
|
||||
projectileShapeName = "plasmabolt.dts";
|
||||
scale = "2.0 2.0 2.0";
|
||||
faceViewer = true;
|
||||
directDamage = 0.0;
|
||||
hasDamageRadius = true;
|
||||
indirectDamage = 0.45;
|
||||
damageRadius = 4.0;
|
||||
kickBackStrength = 0.0;
|
||||
radiusDamageType = $DamageType::Plasma;
|
||||
|
||||
explosion = "PlasmaBoltExplosion";
|
||||
splash = PlasmaSplash;
|
||||
|
||||
dryVelocity = 55.0;
|
||||
wetVelocity = -1;
|
||||
velInheritFactor = 0.3;
|
||||
fizzleTimeMS = 2000;
|
||||
lifetimeMS = 3000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = true;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = -1;
|
||||
|
||||
//activateDelayMS = 100;
|
||||
activateDelayMS = -1;
|
||||
|
||||
size[0] = 0.2;
|
||||
size[1] = 0.5;
|
||||
size[2] = 0.1;
|
||||
|
||||
|
||||
numFlares = 35;
|
||||
flareColor = "1 0.75 0.25";
|
||||
flareModTexture = "flaremod";
|
||||
flareBaseTexture = "flarebase";
|
||||
|
||||
sound = PlasmaProjectileSound;
|
||||
fireSound = PlasmaFireSound;
|
||||
wetFireSound = PlasmaFireWetSound;
|
||||
|
||||
hasLight = true;
|
||||
lightRadius = 3.0;
|
||||
lightColor = "1 0.75 0.25";
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Ammo
|
||||
//--------------------------------------
|
||||
|
||||
datablock ItemData(PlasmaAmmo)
|
||||
{
|
||||
className = Ammo;
|
||||
catagory = "Ammo";
|
||||
shapeFile = "ammo_plasma.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "some plasma gun ammo";
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ItemData(Plasma)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_plasma.dts";
|
||||
image = PlasmaImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a plasma gun";
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(PlasmaImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_plasma.dts";
|
||||
item = Plasma;
|
||||
ammo = PlasmaAmmo;
|
||||
offset = "0 0 0";
|
||||
|
||||
projectile = PlasmaBolt;
|
||||
projectileType = LinearFlareProjectile;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = PlasmaSwitchSound;
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.1;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
stateEmitterTime[3] = 0.2;
|
||||
stateSound[3] = PlasmaFireSound;
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 0.6;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
stateSound[4] = PlasmaReloadSound;
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = PlasmaDryFireSound;
|
||||
stateTimeoutValue[6] = 1.5;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
stateName[7] = "WetFire";
|
||||
stateSound[7] = PlasmaFireWetSound;
|
||||
stateTimeoutValue[7] = 1.5;
|
||||
stateTransitionOnTimeout[7] = "Ready";
|
||||
|
||||
stateName[8] = "CheckWet";
|
||||
stateTransitionOnWet[8] = "WetFire";
|
||||
stateTransitionOnNotWet[8] = "Fire";
|
||||
};
|
||||
|
||||
203
scripts/weapons/T2Guns/shockLance.cs
Normal file
203
scripts/weapons/T2Guns/shockLance.cs
Normal file
|
|
@ -0,0 +1,203 @@
|
|||
//--------------------------------------------------------------------------
|
||||
// Shock Lance
|
||||
//
|
||||
//
|
||||
//--------------------------------------------------------------------------
|
||||
datablock AudioProfile(ShockLanceSwitchSound)
|
||||
{
|
||||
filename = "fx/weapons/shocklance_activate.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Explosion
|
||||
//--------------------------------------
|
||||
datablock AudioProfile(ShockLanceHitSound)
|
||||
{
|
||||
filename = "fx/weapons/shocklance_fire.WAV";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(ShockLanceReloadSound)
|
||||
{
|
||||
filename = "fx/weapons/shocklance_reload.WAV";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(ShockLanceDryFireSound)
|
||||
{
|
||||
filename = "fx/weapons/shocklance_dryfire.WAV";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(ShockLanceMissSound)
|
||||
{
|
||||
filename = "fx/weapons/shocklance_miss.WAV";
|
||||
description = AudioExplosion3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Particle data
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
//--------------------------------------
|
||||
// Projectile
|
||||
//--------------------------------------
|
||||
datablock ShockLanceProjectileData(BasicShocker)
|
||||
{
|
||||
directDamage = 0.45;
|
||||
radiusDamageType = $DamageType::ShockLance;
|
||||
kickBackStrength = 2500;
|
||||
velInheritFactor = 0;
|
||||
sound = "";
|
||||
|
||||
zapDuration = 1.0;
|
||||
impulse = 1800;
|
||||
boltLength = 14.0;
|
||||
extension = 14.0; // script variable indicating distance you can shock people from
|
||||
lightningFreq = 25.0;
|
||||
lightningDensity = 3.0;
|
||||
lightningAmp = 0.25;
|
||||
lightningWidth = 0.05;
|
||||
|
||||
shockwave = ShocklanceHit;
|
||||
|
||||
boltSpeed[0] = 2.0;
|
||||
boltSpeed[1] = -0.5;
|
||||
|
||||
texWrap[0] = 1.5;
|
||||
texWrap[1] = 1.5;
|
||||
|
||||
startWidth[0] = 0.3;
|
||||
endWidth[0] = 0.6;
|
||||
startWidth[1] = 0.3;
|
||||
endWidth[1] = 0.6;
|
||||
|
||||
texture[0] = "special/shockLightning01";
|
||||
texture[1] = "special/shockLightning02";
|
||||
texture[2] = "special/shockLightning03";
|
||||
texture[3] = "special/ELFBeam";
|
||||
|
||||
emitter[0] = ShockParticleEmitter;
|
||||
};
|
||||
|
||||
datablock ShockLanceProjectileData(S3Shocker) {
|
||||
directDamage = 0.50;
|
||||
radiusDamageType = $DamageType::ShockLance;
|
||||
kickBackStrength = 2500;
|
||||
velInheritFactor = 0;
|
||||
sound = "";
|
||||
|
||||
zapDuration = 1.0;
|
||||
impulse = 1800;
|
||||
boltLength = 30.0;
|
||||
extension = 30.0; // script variable indicating distance you can shock people from
|
||||
lightningFreq = 25.0;
|
||||
lightningDensity = 3.0;
|
||||
lightningAmp = 0.25;
|
||||
lightningWidth = 0.05;
|
||||
|
||||
shockwave = ShocklanceHit;
|
||||
|
||||
boltSpeed[0] = 2.0;
|
||||
boltSpeed[1] = -0.5;
|
||||
|
||||
texWrap[0] = 1.5;
|
||||
texWrap[1] = 1.5;
|
||||
|
||||
startWidth[0] = 0.3;
|
||||
endWidth[0] = 0.6;
|
||||
startWidth[1] = 0.3;
|
||||
endWidth[1] = 0.6;
|
||||
|
||||
texture[0] = "special/shockLightning01";
|
||||
texture[1] = "special/shockLightning02";
|
||||
texture[2] = "special/shockLightning03";
|
||||
texture[3] = "special/ELFBeam";
|
||||
|
||||
emitter[0] = ShockParticleEmitter;
|
||||
};
|
||||
|
||||
//--------------------------------------
|
||||
// Rifle and item...
|
||||
//--------------------------------------
|
||||
datablock ItemData(ShockLance)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_shocklance.dts";
|
||||
image = ShockLanceImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a shocklance";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(ShockLanceImage)
|
||||
{
|
||||
classname = WeaponImage;
|
||||
shapeFile = "weapon_shocklance.dts";
|
||||
item = ShockLance;
|
||||
offset = "0 0 0";
|
||||
emap = true;
|
||||
|
||||
projectile = BasicShocker;
|
||||
|
||||
usesEnergy = true;
|
||||
missEnergy = 0;
|
||||
hitEnergy = 15;
|
||||
minEnergy = 15; // needs to change to be datablock's energy drain for a hit
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateSound[0] = ShockLanceSwitchSound;
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.5;
|
||||
stateFire[3] = true;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateScript[3] = "onFire";
|
||||
stateSound[3] = ShockLanceDryFireSound;
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 2.0;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
stateSound[4] = ShockLanceReloadSound;
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Ready";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = ShockLanceDryFireSound;
|
||||
stateTimeoutValue[6] = 1.0;
|
||||
stateTransitionOnTimeout[6] = "Ready";
|
||||
|
||||
stateName[7] = "CheckWet";
|
||||
stateTransitionOnWet[7] = "DryFire";
|
||||
stateTransitionOnNotWet[7] = "Fire";
|
||||
};
|
||||
|
||||
285
scripts/weapons/T2Guns/sniperRifle.cs
Normal file
285
scripts/weapons/T2Guns/sniperRifle.cs
Normal file
|
|
@ -0,0 +1,285 @@
|
|||
//--------------------------------------------------------------------------
|
||||
// Sniper rifle
|
||||
//
|
||||
//
|
||||
//--------------------------------------------------------------------------
|
||||
datablock AudioProfile(SniperRifleSwitchSound)
|
||||
{
|
||||
filename = "fx/weapons/sniper_activate.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(SniperRifleFireSound)
|
||||
{
|
||||
filename = "fx/weapons/sniper_fire.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(SniperRifleFireWetSound)
|
||||
{
|
||||
filename = "fx/weapons/sniper_underwater.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(SniperRifleDryFireSound)
|
||||
{
|
||||
filename = "fx/weapons/chaingun_dryfire.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(SniperRifleProjectileSound)
|
||||
{
|
||||
filename = "fx/weapons/sniper_miss.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Splash
|
||||
//--------------------------------------------------------------------------
|
||||
datablock ParticleData( SniperSplashParticle )
|
||||
{
|
||||
|
||||
dragCoeffiecient = 0.4;
|
||||
gravityCoefficient = -0.03; // rises slowly
|
||||
inheritedVelFactor = 0.025;
|
||||
|
||||
lifetimeMS = 600;
|
||||
lifetimeVarianceMS = 300;
|
||||
|
||||
textureName = "particleTest";
|
||||
|
||||
useInvAlpha = false;
|
||||
spinRandomMin = -200.0;
|
||||
spinRandomMax = 200.0;
|
||||
|
||||
|
||||
colors[0] = "0.7 0.8 1.0 1.0";
|
||||
colors[1] = "0.7 0.8 1.0 0.5";
|
||||
colors[2] = "0.7 0.8 1.0 0.0";
|
||||
sizes[0] = 0.5;
|
||||
sizes[1] = 1.0;
|
||||
sizes[2] = 2.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData( SniperSplashEmitter )
|
||||
{
|
||||
ejectionPeriodMS = 25;
|
||||
ejectionOffset = 0.2;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 2.25;
|
||||
velocityVariance = 0.50;
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 30.0;
|
||||
lifetimeMS = 250;
|
||||
|
||||
particles = "SniperSplashParticle";
|
||||
};
|
||||
|
||||
datablock SplashData( SniperSplash )
|
||||
{
|
||||
numSegments = 5;
|
||||
ejectionFreq = 0.0001;
|
||||
ejectionAngle = 45;
|
||||
ringLifetime = 0.5;
|
||||
lifetimeMS = 400;
|
||||
velocity = 5.0;
|
||||
startRadius = 0.0;
|
||||
acceleration = -3.0;
|
||||
texWrap = 5.0;
|
||||
|
||||
texture = "special/water2";
|
||||
|
||||
emitter[0] = SniperSplashEmitter;
|
||||
|
||||
colors[0] = "0.7 0.8 1.0 0.0";
|
||||
colors[1] = "0.7 0.8 1.0 1.0";
|
||||
colors[2] = "0.7 0.8 1.0 0.0";
|
||||
colors[3] = "0.7 0.8 1.0 0.0";
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.4;
|
||||
times[2] = 0.8;
|
||||
times[3] = 1.0;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Explosion
|
||||
//--------------------------------------
|
||||
datablock AudioProfile(sniperExpSound)
|
||||
{
|
||||
filename = "fx/weapons/sniper_impact.WAV";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock ParticleData(SniperExplosionParticle1)
|
||||
{
|
||||
dragCoefficient = 0.65;
|
||||
gravityCoefficient = 0.3;
|
||||
inheritedVelFactor = 0.0;
|
||||
constantAcceleration = 0.0;
|
||||
lifetimeMS = 500;
|
||||
lifetimeVarianceMS = 150;
|
||||
textureName = "particleTest";
|
||||
colors[0] = "0.56 0.36 0.26 1.0";
|
||||
colors[1] = "0.56 0.36 0.26 0.0";
|
||||
sizes[0] = 0.0625;
|
||||
sizes[1] = 0.2;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(SniperExplosionEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 10;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 0.75;
|
||||
velocityVariance = 0.25;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 60;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
particles = "SniperExplosionParticle1";
|
||||
};
|
||||
|
||||
datablock ExplosionData(SniperExplosion)
|
||||
{
|
||||
explosionShape = "energy_explosion.dts";
|
||||
soundProfile = sniperExpSound;
|
||||
|
||||
particleEmitter = SniperExplosionEmitter;
|
||||
particleDensity = 150;
|
||||
particleRadius = 0.25;
|
||||
|
||||
faceViewer = false;
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------
|
||||
// Projectile
|
||||
//--------------------------------------
|
||||
datablock SniperProjectileData(BasicSniperShot)
|
||||
{
|
||||
directDamage = 0.4;
|
||||
hasDamageRadius = false;
|
||||
indirectDamage = 0.0;
|
||||
damageRadius = 0.0;
|
||||
velInheritFactor = 1.0;
|
||||
sound = SniperRifleProjectileSound;
|
||||
explosion = "SniperExplosion";
|
||||
splash = SniperSplash;
|
||||
directDamageType = $DamageType::Laser;
|
||||
|
||||
maxRifleRange = 1000;
|
||||
rifleHeadMultiplier = 1.3;
|
||||
beamColor = "1 0.1 0.1";
|
||||
fadeTime = 1.0;
|
||||
|
||||
startBeamWidth = 0.145;
|
||||
endBeamWidth = 0.25;
|
||||
pulseBeamWidth = 0.5;
|
||||
beamFlareAngle = 3.0;
|
||||
minFlareSize = 0.0;
|
||||
maxFlareSize = 400.0;
|
||||
pulseSpeed = 6.0;
|
||||
pulseLength = 0.150;
|
||||
|
||||
lightRadius = 1.0;
|
||||
lightColor = "0.3 0.0 0.0";
|
||||
|
||||
textureName[0] = "special/flare";
|
||||
textureName[1] = "special/nonlingradient";
|
||||
textureName[2] = "special/laserrip01";
|
||||
textureName[3] = "special/laserrip02";
|
||||
textureName[4] = "special/laserrip03";
|
||||
textureName[5] = "special/laserrip04";
|
||||
textureName[6] = "special/laserrip05";
|
||||
textureName[7] = "special/laserrip06";
|
||||
textureName[8] = "special/laserrip07";
|
||||
textureName[9] = "special/laserrip08";
|
||||
textureName[10] = "special/laserrip09";
|
||||
textureName[11] = "special/sniper00";
|
||||
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------
|
||||
// Rifle and item...
|
||||
//--------------------------------------
|
||||
datablock ItemData(SniperRifle)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
image = SniperRifleImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a sniper rifle";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(SniperRifleImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
item = SniperRifle;
|
||||
projectile = BasicSniperShot;
|
||||
projectileType = SniperProjectile;
|
||||
armThread = looksn;
|
||||
|
||||
usesEnergy = true;
|
||||
minEnergy = 6;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateSound[0] = SniperRifleSwitchSound;
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.5;
|
||||
stateFire[3] = true;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateScript[3] = "onFire";
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 0.5;
|
||||
stateAllowImageChange[4] = false;
|
||||
|
||||
stateName[5] = "CheckWet";
|
||||
stateTransitionOnWet[5] = "DryFire";
|
||||
stateTransitionOnNotWet[5] = "Fire";
|
||||
|
||||
stateName[6] = "NoAmmo";
|
||||
stateTransitionOnAmmo[6] = "Reload";
|
||||
stateTransitionOnTriggerDown[6] = "DryFire";
|
||||
stateSequence[6] = "NoAmmo";
|
||||
|
||||
stateName[7] = "DryFire";
|
||||
stateSound[7] = SniperRifleDryFireSound;
|
||||
stateTimeoutValue[7] = 0.5;
|
||||
stateTransitionOnTimeout[7] = "Ready";
|
||||
};
|
||||
|
||||
143
scripts/weapons/T2Guns/targetingLaser.cs
Normal file
143
scripts/weapons/T2Guns/targetingLaser.cs
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
//--------------------------------------------------------------------------
|
||||
// Targeting laser
|
||||
//
|
||||
//--------------------------------------------------------------------------
|
||||
datablock AudioProfile(TargetingLaserSwitchSound)
|
||||
{
|
||||
filename = "fx/weapons/generic_switch.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(TargetingLaserPaintSound)
|
||||
{
|
||||
filename = "fx/weapons/targetinglaser_paint.wav";
|
||||
description = CloseLooping3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------
|
||||
// Projectile
|
||||
//--------------------------------------
|
||||
datablock TargetProjectileData(BasicTargeter)
|
||||
{
|
||||
directDamage = 0.0;
|
||||
hasDamageRadius = false;
|
||||
indirectDamage = 0.0;
|
||||
damageRadius = 0.0;
|
||||
velInheritFactor = 1.0;
|
||||
|
||||
maxRifleRange = 1000;
|
||||
beamColor = "1.0 0.1 0.1";
|
||||
|
||||
startBeamWidth = 0.1;
|
||||
pulseBeamWidth = 0.15;
|
||||
beamFlareAngle = 3.0;
|
||||
minFlareSize = 0.0;
|
||||
maxFlareSize = 400.0;
|
||||
pulseSpeed = 6.0;
|
||||
pulseLength = 0.150;
|
||||
|
||||
textureName[0] = "special/nonlingradient";
|
||||
textureName[1] = "special/flare";
|
||||
textureName[2] = "special/pulse";
|
||||
textureName[3] = "special/expFlare";
|
||||
beacon = true;
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------
|
||||
// Rifle and item...
|
||||
//--------------------------------------
|
||||
datablock ItemData(TargetingLaser)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_targeting.dts";
|
||||
image = TargetingLaserImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a targeting laser rifle";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(TargetingLaserImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
|
||||
shapeFile = "weapon_targeting.dts";
|
||||
item = TargetingLaser;
|
||||
offset = "0 0 0";
|
||||
|
||||
projectile = BasicTargeter;
|
||||
projectileType = TargetProjectile;
|
||||
deleteLastProjectile = true;
|
||||
|
||||
usesEnergy = true;
|
||||
minEnergy = 3;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = TargetingLaserSwitchSound;
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnAmmo[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateEnergyDrain[3] = 3;
|
||||
stateFire[3] = true;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
stateTransitionOnTriggerUp[3] = "Deconstruction";
|
||||
stateTransitionOnNoAmmo[3] = "Deconstruction";
|
||||
stateSound[3] = TargetingLaserPaintSound;
|
||||
|
||||
stateName[4] = "NoAmmo";
|
||||
stateTransitionOnAmmo[4] = "Ready";
|
||||
|
||||
stateName[5] = "Deconstruction";
|
||||
stateScript[5] = "deconstruct";
|
||||
stateTransitionOnTimeout[5] = "Ready";
|
||||
};
|
||||
|
||||
function TargetingLaserImage::onFire(%data,%obj,%slot) {
|
||||
if(%obj.TagBeac) {
|
||||
%obj.TagBeac.delete();
|
||||
%obj.TagBeac = "";
|
||||
}
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
%p.setTarget(%obj.team);
|
||||
}
|
||||
|
||||
function TargetingLaserImage::deconstruct(%data, %obj, %slot) {
|
||||
%pos = %obj.lastProjectile.getTargetPoint();
|
||||
if(%obj.client.TagBeac) {
|
||||
%obj.client.TagBeac.delete();
|
||||
%obj.client.TagBeac = "";
|
||||
}
|
||||
%obj.client.TagBeac = new BeaconObject() {
|
||||
dataBlock = "BomberBeacon";
|
||||
beaconType = "vehicle";
|
||||
position = %pos;
|
||||
};
|
||||
%obj.client.TagBeac.playThread($AmbientThread, "ambient");
|
||||
%obj.client.TagBeac.team = %obj.team;
|
||||
%obj.client.TagBeac.sourceObject = %obj;
|
||||
%obj.client.TagBeac.setTarget(%obj.team);
|
||||
MissionCleanup.add(%obj.client.TagBeac);
|
||||
|
||||
Parent::deconstruct(%data, %obj, %slot);
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue