Oops, didn't mean to make a link.
//ExplodeBall.cs
//based off of gun and changed into a rocket launcher style blast cannon ball
//after 16 edits it was done, thusly it is the ExplodeBall
//audio
datablock AudioProfile(ExplodeBallShotSound)
{
filename = "base/data/sound/printFire.wav";
description = AudioClose3d;
preload = true;
};
datablock AudioProfile(ExplodeBallExplodeSound)
{
filename = "./sound/jeepExplosion.wav";
description = AudioClose3d;
preload = true;
};
//bullet trail effects
datablock ParticleData(ExplodeBallTrailParticle)
{
dragCoefficient = 3;
gravityCoefficient = -0.0;
inheritedVelFactor = 1.0;
constantAcceleration = 0.0;
lifetimeMS = 1000;
lifetimeVarianceMS = 25;
textureName = "base/data/particles/dot";
spinSpeed = 10.0;
spinRandomMin = -500.0;
spinRandomMax = 500.0;
colors[0] = "0.0 0.8 0.8 0.4";
colors[1] = "0.0 0.9 0.9 0.0";
sizes[0] = 9.0;
sizes[1] = 9.5;
useInvAlpha = false;
};
datablock ParticleEmitterData(ExplodeBallTrailEmitter)
{
ejectionPeriodMS = 0.01;
periodVarianceMS = 0;
ejectionVelocity = 0.0;
velocityVariance = 0.0;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 90;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvance = false;
particles = "ExplodeBallTrailParticle";
};
datablock ParticleData(ExplodeBallParticle)
{
dragCoefficient = 3;
gravityCoefficient = -0.5;
inheritedVelFactor = 0.2;
constantAcceleration = 0.0;
lifetimeMS = 700;
lifetimeVarianceMS = 400;
textureName = "base/data/particles/cloud";
spinSpeed = 10.0;
spinRandomMin = -50.0;
spinRandomMax = 50.0;
colors[0] = "0 0.9 0.9 0.9";
colors[1] = "0 0.7 0.7 0.0";
sizes[0] = 10.0;
sizes[1] = 15.0;
useInvAlpha = true;
};
datablock ParticleEmitterData(ExplodeBallExplosionEmitter)
{
ejectionPeriodMS = 3;
periodVarianceMS = 0;
ejectionVelocity = 10;
velocityVariance = 1.0;
ejectionOffset = 3.0;
thetaMin = 89;
thetaMax = 90;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvance = false;
particles = "ExplodeBallExplosionParticle";
};
datablock ParticleData(ExplodeBallExplosionRingParticle)
{
dragCoefficient = 8;
gravityCoefficient = -0.5;
inheritedVelFactor = 0.2;
constantAcceleration = 0.0;
lifetimeMS = 40;
lifetimeVarianceMS = 10;
textureName = "base/data/particles/chunk";
spinSpeed = 10.0;
spinRandomMin = -500.0;
spinRandomMax = 500.0;
colors[0] = "0 1 1 0.5";
colors[1] = "0.0 0.5 0.5 0.0";
sizes[0] = 8;
sizes[1] = 13;
useInvAlpha = false;
};
datablock ParticleEmitterData(ExplodeBallRingEmitter)
{
lifeTimeMS = 50;
ejectionPeriodMS = 1;
periodVarianceMS = 0;
ejectionVelocity = 5;
velocityVariance = 0.0;
ejectionOffset = 3.0;
thetaMin = 0;
thetaMax = 180;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvance = false;
particles = "ExplodeBallExplosionRingParticle";
};
datablock ExplosionData(ExplodeBallExplosion)
{
explosionShape = "./shapes/explosionSphere1.dts";
soundProfile = ExplodeBallExplodeSound;
lifeTimeMS = 150;
particleEmitter = ExplodeBallExplosionEmitter;
particleDensity = 10;
particleRadius = 0.2;
emitter[0] = ExplodeBallExplosionRingEmitter;
faceViewer = true;
explosionScale = "10 10 10";
shakeCamera = true;
camShakeFreq = "10.0 11.0 10.0";
camShakeAmp = "3.0 10.0 3.0";
camShakeDuration = 0.5;
camShakeRadius = 20.0;
// Dynamic light
lightStartRadius = 5;
lightEndRadius = 20;
lightStartColor = "0 1 1 1";
lightEndColor = "0 0 0 0";
damageRadius = 10;
radiusDamage = 100;
impulseRadius = 15;
impulseForce = 2000;
};
AddDamageType("ExplodeBall", '<bitmap:add-ons/ci/ExplodeBall> %1', '%2 <bitmap:add-ons/ci/ExplodeBall> %1',0.5,1);
datablock ProjectileData(ExplodeBallProjectile)
{
projectileShapeName = "base/data/shapes/empty.dts";
directDamage = 200;
directDamageType = $DamageType::ExplodeBall;
radiusDamageType = $DamageType::ExplodeBall;
brickExplosionRadius = 10;
brickExplosionImpact = true; //destroy a brick if we hit it directly?
brickExplosionForce = 20;
brickExplosionMaxVolume = 20; //max volume of bricks that we can destroy
brickExplosionMaxVolumeFloating = 40; //max volume of bricks that we can destroy if they aren't connected to the ground
impactImpulse = 3000;
verticalImpulse = 3000;
explosion = ExplodeBallExplosion;
particleEmitter = ExplodeBallTrailEmitter;
muzzleVelocity = 150;
velInheritFactor = 1;
armingDelay = 00;
lifetime = 4000;
fadeDelay = 3500;
bounceElasticity = 0.5;
bounceFriction = 0.20;
isBallistic = true;
gravityMod = 0.0;
hasLight = True;
lightRadius = 6.0;
lightColor = "0.0 0.9 0.9";
};
//////////
// item //
//////////
datablock ItemData(ExplodeBallItem)
{
category = "Weapon"; // Mission editor category
className = "Weapon"; // For inventory system
// Basic Item Properties
shapeFile = "./shapes/ExplodeBall.dts";
rotate = true;
mass = 1;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;
//gui stuff
uiName = "ExplodeBall";
iconName = "./ItemIcons/ExplodeBall";
doColorShift = true;
colorShiftColor = "1 1 1 1.000";
// Dynamic properties defined by the scripts
image = ExplodeBallImage;
canDrop = true;
};
////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(ExplodeBallImage)
{
// Basic Item properties
shapeFile = "./shapes/ExplodeBall.dts";
emap = true;
// Specify mount point & offset for 3rd person, and eye offset
// for first person rendering.
mountPoint = 0;
offset = "0 0 0";
eyeOffset = 0; //"0.7 1.2 -0.5";
rotation = eulerToMatrix( "0 0 0" );
// When firing from a point offset from the eye, muzzle correction
// will adjust the muzzle vector to point to the eye LOS point.
// Since this weapon doesn't actually fire from the muzzle point,
// we need to turn this off.
correctMuzzleVector = true;
// Add the WeaponImage namespace as a parent, WeaponImage namespace
// provides some hooks into the inventory system.
className = "WeaponImage";
// Projectile && Ammo.
item = BowItem;
ammo = " ";
projectile = ExplodeBallProjectile;
projectileType = Projectile;
casing = ExplodeBallShellDebris;
shellExitDir = "1.0 -1.3 1.0";
shellExitOffset = "0 0 0";
shellExitVariance = 15.0;
shellVelocity = 7.0;
//melee particles shoot from eye node for consistancy
melee = true;
//raise your arm up or not
armReady = true;
doColorShift = true;
colorShiftColor = ExplodeBallItem.colorShiftColor;//"0 0.5 0.5 1.000";
//casing = " ";
// Images have a state system which controls how the animations
// are run, which sounds are played, script callbacks, etc. This
// state system is downloaded to the client so that clients can
// predict state changes and animate accordingly. The following
// system supports basic ready->fire->reload transitions as
// well as a no-ammo->dryfire idle state.
// Initial start up state
stateName[0] = "Activate";
stateTimeoutValue[0] = 2.0;
stateTransitionOnTimeout[0] = "Ready";
stateSound[0] = weaponSwitchSound;
stateName[1] = "Ready";
stateTransitionOnTriggerDown[1] = "Fire";
stateAllowImageChange[1] = true;
stateSequence[1] = "Ready";
stateName[2] = "Fire";
stateTransitionOnTimeout[2] = "Smoke";
stateTimeoutValue[2] = 0.05;
stateFire[2] = true;
stateAllowImageChange[2] = false;
stateSequence[2] = "Fire";
stateScript[2] = "onFire";
stateWaitForTimeout[2] = true;
stateEmitterTime[2] = 0.15;
stateEmitterNode[2] = "muzzleNode";
stateSound[2] = ExplodeBallShotSound;
stateEjectShell[2] = true;
stateName[3] = "Smoke";
stateEmitterTime[3] = 1.0;
stateEmitterNode[3] = "muzzleNode";
stateTimeoutValue[3] = 2.00;
stateTransitionOnTimeout[3] = "Reload";
stateName[4] = "Reload";
stateSequence[4] = "Reload";
stateTransitionOnTriggerUp[4] = "Ready";
stateSequence[4] = "Ready";
};