31
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
package ProjectileDismemberment
{
function ProjectileData::damage(%this, %obj, %col, %fade, %pos, %normal)
{
parent::damage(%this, %obj, %col, %fade, %pos, %normal);
if(%col.gettype() & $TypeMasks::PlayerObjectType && fileName(%col.dataBlock.shapeFile) $= "m.dts")
{
%fvec = %col.getForwardVector();
%vec1 = -getWord(%fvec,1) SPC getWord(%fvec,0) SPC 0;
%vec2 = vectorNormalize(%obj.initialVelocity);
%damloc = (vectorDot(%vec1,%vec2) > 0);
%scale = getWord(%col.getScale(),2);
if(getword(%pos, 2) > getword(%col.getWorldBoxCenter(), 2) - 3.3*%scale)
{
%client.player.setNodeColor(headskin, "0.6, 0, 0 1");
%col.kill();
if(!%col.disHead)
{
%col.dishead = 1;
%proj = new Projectile()
{
scale = %col.getScale();
here is a little snip from the code, i have used %client.player.setNodeColor(headskin, "0.6, 0, 0 1");
but it doesn't want to work, help?
%client.player.setNodeColor(lhand, "0.6, 0, 0 1");
except it's like client player setplayertype or idk
stateName[0] = "Ready";
stateSequence[0] = "root";
stateTimeoutValue[0] = 0.3;
stateTransitionOnTimeout[0] = "Idle";
stateName[1] = "Idle";
stateTransitionOnNotLoaded[1] = "UnloadA";
stateTransitionOnTriggerDown[1] = "Trigger";
stateName[2] = "Trigger";
stateScript[2] = "onTrigger";
stateTimeoutValue[2] = 0.02;
stateSequence[2] = "trig";
stateTransitionOnTimeout[2] = "FireCheckA";
stateName[3] = "FireCheckA";
stateScript[3] = "onFireCheck";
stateTimeoutValue[3] = 0.01;
stateTransitionOnTimeout[3] = "FireCheckB";
stateName[4] = "FireCheckB";
stateTransitionOnAmmo[4] = "Fire";
stateTransitionOnNoAmmo[4] = "DryFire";
stateName[5] = "Fire";
stateScript[5] = "onFire";
stateEmitterTime[5] = 0.1;
stateEmitter[5] = RaygunFlashEmitter;
stateFire[5] = true;
stateSequence[5] = "fire";
stateEmitterNode[5] = "muzzlePoint";
stateTransitionOnTimeout[5] = "Release";
stateTimeoutValue[5] = 0.12;
stateName[6] = "Release";
stateScript[6] = "onRelease";
stateTransitionOnTriggerUp[6] = "Wait";
stateName[7] = "Wait";
stateTimeoutValue[7] = 0.07;
stateTransitionOnTimeout[7] = "Idle";
stateName[8] = "UnloadA";
stateSequence[8] = "unload";
stateTimeoutValue[8] = 0.45;
stateScript[8] = "onUnload";
stateTransitionOnTimeout[8] = "UnloadB";
stateName[9] = "UnloadB";
stateTimeoutValue[9] = 0.6;
stateEjectShell[9] = true;
stateTransitionOnTimeout[9] = "BatteryLoadA";
stateName[10] = "BatteryLoadA";
stateTimeoutValue[10] = 0.61;
stateTransitionOnTimeout[10] = "BatteryLoadB";
stateName[11] = "BatteryLoadB";
stateTimeoutValue[11] = 0.54;
stateTransitionOnTimeout[11] = "ReloadA";
stateName[12] = "ReloadA";
stateSequence[12] = "reload";
stateTimeoutValue[12] = 0.01;
stateScript[12] = "onReloadA";
stateTransitionOnTimeout[12] = "ReloadB";
stateName[13] = "ReloadB";
stateTimeoutValue[13] = 0.9;
stateTransitionOnTimeout[13] = "ReloadC";
stateName[14] = "ReloadC";
stateScript[14] = "onReloadB";
stateTimeoutValue[14] = 0.01;
stateTransitionOnTimeout[14] = "Idle";
stateName[15] = "DryFire";
stateSequence[15] = "dryfire";
stateScript[15] = "onDryFire";
stateTransitionOnTimeout[15] = "Release";
stateTimeoutValue[15] = 0.12;
};
function RaygunImage::onFire(%db,%pl,%slot)
{
if(%pl.getDamagePercent() >= 1)
return;
%pl.playThread(2, shiftRight);
%pl.playThread(3, shiftLeft);
serverPlay3D(RaygunFire @ getRandom(1,3) @ Sound,%pl.getPosition());
%pl.sAmmo_heat[%db] = mClamp(%pl.sAmmo_heat[%db]+1,0,%db.item.sHeat);
sAmmo_fire(%db,%pl,%slot,0.005+((%pl.sAmmo_heat[%db]/%db.item.sHeat)*0.035),180,1);
cancel(%pl.sAmmoCooldownHeatSched[%db]);
%pl.sAmmoCooldownHeatSched[%db] = %pl.schedule(200,sAmmo_heatCooldown,%db,%slot);
%val = sAmmo_dec(%db,%pl,%slot);
if(!sAmmo_check(%db,%pl,%slot))
serverPlay3D(mac10LastRoundSound,%pl.getPosition());
if(getSimTime()-%pl.lastShellSound > 400 || getRandom(0,1) == 0)
{
%pl.lastShellSound = getSimTime();
schedule(getRandom(200,300),0,serverPlay3D,small_ignorethis @ getRandom(1,5) @ Sound,%pl.getPosition());
}
if(%val == 0)
%pl.setImageAmmo(%slot,0);
}
function RaygunImage::onFireCheck(%db,%pl,%slot)
{
%pl.setImageAmmo(%slot,sAmmo_check(%db,%pl,%slot));
}
function RaygunImage::onBatteryLoadA(%db,%pl,%slot)
{
%pl.playThread(2, shiftRight);
%pl.playThread(3, shiftLeft);
schedule(20,0,serverPlay3D,RaygunPutASound,%pl.getPosition());
}
function RaygunImage::onBatteryLoadB(%db,%pl,%slot)
{
%pl.playThread(2, shiftRight);
%pl.playThread(3, shiftLeft);
schedule(20,0,serverPlay3D,RaygunPutBSound,%pl.getPosition());
}
function RaygunImage::onUnload(%db,%pl,%slot)
{
sAmmo_display(%pl,0);
%up = %pl.getUpVectorHack();
%forward = %pl.getEyeVectorHack();
%p.explode();
%pl.playThread(2,plant);
serverPlay3D(RaygunUnloadSound,%pl.getPosition());
}
function RaygunImage::onReloadA(%db,%pl,%slot)
{
%pl.playThread(2, shiftAway);
schedule(20,0,serverPlay3D,RaygunLoadSound,%pl.getPosition());
}
function RaygunImage::onReloadB(%db,%pl,%slot)
{
//%pl.playThread(2,shiftLeft);
%pl.setImageLoaded(%slot,1);
sAmmo_reload(%db,%pl,%slot);
}