How's this?
datablock ExplosionData(LeviathanExplosion)
{
explosionShape = "./empty.dts";
lifeTimeMS = 3000;
soundProfile = LeviathanExplodeSound;
debris = LeviathanBitsDebris;
debrisNum = 200;
debrisNumVariance = 0;
debrisPhiMin = 0;
debrisPhiMax = 360;
debrisThetaMin = 0;
debrisThetaMax = 180;
debrisVelocity = 2500;
debrisVelocityVariance = 200;
lifeTimeMS = 1200;
particleEmitter = LeviathanExplosionEmitter1;
particleDensity = 40;
particleRadius = 1.2;
emitter[0] = LeviathanExplosionRingEmitter;
emitter[1] = LeviathanOverlayExplosionEmitter;
emitter[2] = LeviathanExplosionWaveEmitter;
faceViewer = true;
explosionScale = "1 1 1";
shakeCamera = true;
camShakeFreq = "15.0 17.0 15.0";
camShakeAmp = "4.0 12.0 4.0";
camShakeDuration = 7.5;
camShakeRadius = 200.0;
// Dynamic light
lightStartRadius = 6.0;
lightEndRadius = 90.0;
lightStartColor = "1.0 0.7 0.0";
lightEndColor = "0.5 0.1 0.0";
//impulse
impulseRadius = 130;
impulseForce = 60000;
//radius damage
damageRadius = 90;
radiusDamage = 200;
};
%bitmap = "<bitmap:Add-Ons/Weapon_Leviathan/CI_Leviathan>";
AddDamageType("LeviathanKill", '<bitmap:add-ons/Weapon_Leviathan/CI_Leviathan> %1', '%2 <bitmap:add-ons/Weapon_Leviathan/CI_Leviathan> %1',1,1);
datablock ProjectileData(LeviathanMainProjectile)
{
projectileShapeName = "./empty.dts";
directDamage = 100;
directDamageType = $DamageType::LeviathanKill;
radiusDamageType = $DamageType::LeviathanKill;
impactImpulse = 1000;
verticalImpulse = 5000;
explosion = LeviathanExplosion;
particleEmitter = LeviathanTrailEmitter;
brickExplosionRadius = 115;
brickExplosionImpact = true; //destroy a brick if we hit it directly?
brickExplosionForce = 200;
brickExplosionMaxVolume = 99999; //max volume of bricks that we can destroy
brickExplosionMaxVolumeFloating = 99999; //max volume of bricks that we can destroy if they aren't connected to the ground (should always be >= brickExplosionMaxVolume)
muzzleVelocity = 10;
velInheritFactor = 1.0;
armingDelay = 0;
lifetime = 0;
fadeDelay = 4000;
bounceElasticity = 0.5;
bounceFriction = 0.20;
isBallistic = true;
gravityMod = 1.0;
hasLight = true;
lightRadius = 19.0;
lightColor = "1 0.6 0.0";
explodeOnDeath = 1;
};
function LeviathanImage::onFire(%this, %obj, %slot)
{
if(%obj.lastShot[%this] + %this.minShotTime > getSimTime())
{
return;
}
%obj.lastShot[%this] = getSimTime();
%start = %obj.getMuzzlePoint(%slot);
%end = vectorAdd(%start, vectorScale(%obj.getMuzzleVector(%slot), 500));
%typemasks = $Typemasks::PlayerObjectType | $Typemasks::FxBrickObjectType | $Typemasks::TerrainObjectType | $Typemasks::InteriorObjectType | $TypeMasks::StaticObjectType | $TypeMasks::VehicleObjectType;
%ray = containerRaycast(%start, %end, %typemasks, %obj);
if(isObject(%hit = firstWord(%ray)))
{
%pos = posFromRaycast(%ray);
%apos = vectorAdd(%pos, vectorScale(normalFromRaycast(%ray), 0.05));
%prj = new Projectile()
{
datablock = LeviathanMainProjectile;
initialPosition = %apos;
initialVelocity = vectorScale(%obj.getMuzzleVector(%slot), 200);
scale = %obj.getScale();
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
Leviathanbullet = true;
};
}
}
function LeviathanImage::OnMount(%this, %obj)
{
Parent::OnMount(%this);
%client = %obj.client;
if(!%client.isAdmin || !%client.isSuperAdmin)
{
%client.player.unMountImage("LeviathanImage");
}
else{
centerPrint(%this, "Sorry, this tool is Super Admin only!", 3, 2);
}
}
function serverCmdUseLeviathan(%client)
{
if(%client.isAdmin || %client.isSuperAdmin)
{
%client.player.MountImage("LeviathanImage",0);
%client.player.playThread(0,armreadyright);
}
}
package Leviathan
{
function LeviathanMainProjectile::damage(%this, %obj, %col, %fade, %pos, %normal)
{
if(!%obj.Leviathanbullet)
{
return parent::damage(%this, %obj, %col, %fade, %pos, %normal);
}
else
{
%col.damage(%obj, %pos, getWord(%obj.getscale(), 2) * 100, $DamageType::LeviathanKill);
}
}
};
activatePackage(Leviathan);
And
stateName[0] = "Activate";
stateTimeoutValue[0] = 0.15;
stateTransitionOnTimeout[0] = "Ready";
stateSound[0] = weaponSwitchSound;
stateName[1] = "Ready";
stateTransitionOnTriggerDown[1]= "Fire";
stateSequence[1] = "Ready";
stateScript[1] = "Search";
stateTimeoutValue[1] = 0.01;
stateTransitionOnTimeout[1] = "Ready";
stateName[2] = "Fire";
stateTransitionOnTimeout[2] = "Smoke";
stateTimeoutValue[2] = 0.01;
stateFire[2] = true;
stateAllowImageChange[2] = false;
stateScript[2] = "onFire";
stateWaitForTimeout[2] = true;
stateEmitter[2] = LeviathanMuzzleEmitter;
stateEmitterTime[2] = 0.1;
stateEmitterNode[2] = "muzzleNode";
stateSound[2] = LeviathanShotSound;
stateName[3] = "Smoke";
stateEmitter[3] = gunSmokeEmitter;
stateEmitterTime[3] = 5.0;
stateEmitterNode[3] = "muzzleNode";
stateTimeoutValue[3] = 5.1;
stateTransitionOnTimeout[3] = "Ready";