class fmk4ball extends Decoration;
#exec obj load file=..\Textures\fmkdeco4.utx package=fmkdeco4
#exec mesh import mesh=fmk4ball anivfile=Models\fmk4ball_a.3d datafile=Models\fmk4ball_d.3d x=0 y=0 z=0 mlod=0
#exec mesh origin mesh=fmk4ball x=0 y=0 z=0
#exec mesh sequence mesh=fmk4ball seq=All startframe=0 numframes=1
#exec meshmap new meshmap=fmk4ball mesh=fmk4ball
#exec meshmap scale meshmap=fmk4ball x=0.03125 y=0.03125 z=0.06250
var bool bFirstHit;
var() bool bkickable;
var int kickspeed;
Auto State Animate
{
function HitWall (vector HitNormal, actor Wall)
{
local float speed;
Velocity = 0.7*(( Velocity dot HitNormal ) * HitNormal * (-2.0) + Velocity); // Reflect off Wall w/damping
speed = VSize(Velocity);
if (bFirstHit && speed<400)
{
bFirstHit=False;
}
RotationRate.Yaw = RotationRate.Yaw*0.75;
RotationRate.Roll = RotationRate.Roll*0.75;
RotationRate.Pitch = RotationRate.Pitch*0.75;
If (speed < 60)
{
bBounce = false;
bBlockPlayers = true;
bRotatetoDesired=True;
bFixedRotationDir=False;
DesiredRotation.Pitch=0;
DesiredRotation.Yaw=FRand()*65536;
DesiredRotation.Roll=0;
};
If (speed > 90)
playsound(sound'DoorsAnc.adend59',SLOT_Misc,0.3);
}
function bekicked( int NDamage, Pawn instigatedBy, Vector hitlocation,
Vector momentum, name damageType)
{
bBlockPlayers = false;
SetPhysics(PHYS_Falling);
bBounce = True;
DesiredRotation = RotRand();
bRotateToDesired=False;
bFixedRotationDir=True;
bFirstHit=True;
if (momentum.x < 60)
{
Momentum.Z = abs(Momentum.x+momentum.y*0.15);
Velocity=Momentum*1.0;
RotationRate.Yaw = 8500*FRand() - 125000;
RotationRate.Pitch = 8500*FRand() - 125000;
RotationRate.Roll = 8500*FRand() - 125000;
}
else
{
if (momentum.y < 60)
{
Momentum.Z = abs(Momentum.x+momentum.y*0.15);
Velocity=Momentum*1.0;
RotationRate.Yaw = 8500*FRand() - 125000;
RotationRate.Pitch = 8500*FRand() - 125000;
RotationRate.Roll = 8500*FRand() - 125000;
}
else
{
if (momentum.x > 120)
{
Momentum.Z = abs(Momentum.x+momentum.y*0.25);
Velocity=Momentum*1.0;
RotationRate.Yaw = 850000*FRand() - 125000;
RotationRate.Pitch = 850000*FRand() - 125000;
RotationRate.Roll = 850000*FRand() - 125000;
}
else
{
if (momentum.y > 120)
{
Momentum.Z = abs(Momentum.x+momentum.y*0.25);
Velocity=Momentum*1.3;
RotationRate.Yaw = 850000*FRand() - 125000;
RotationRate.Pitch = 850000*FRand() - 125000;
RotationRate.Roll = 850000*FRand() - 125000;
}
else
{
if (momentum.x > -60)
{
Momentum.Z = abs(Momentum.x+momentum.y*0.15);
Velocity=Momentum*1.0;
RotationRate.Yaw = 8500*FRand() - 125000;
RotationRate.Pitch = 8500*FRand() - 125000;
RotationRate.Roll = 8500*FRand() - 125000;
}
else
{
if (momentum.y > -60)
{
Momentum.Z = abs(Momentum.x+momentum.y*0.15);
Velocity=Momentum*1.0;
RotationRate.Yaw = 8500*FRand() - 125000;
RotationRate.Pitch = 8500*FRand() - 125000;
RotationRate.Roll = 8500*FRand() - 125000;
}
else
{
if (momentum.x < -120)
{
Momentum.Z = abs(Momentum.x+momentum.y*0.25);
Velocity=Momentum*1.0;
RotationRate.Yaw = 850000*FRand() - 125000;
RotationRate.Pitch = 850000*FRand() - 125000;
RotationRate.Roll = 850000*FRand() - 125000;
}
else
{
if (momentum.y < -120)
{
Momentum.Z = abs(Momentum.x+momentum.y*0.25);
Velocity=Momentum*1.3;
RotationRate.Yaw = 850000*FRand() - 125000;
RotationRate.Pitch = 850000*FRand() - 125000;
RotationRate.Roll = 850000*FRand() - 125000;
}
else
{
Momentum.Z = abs(Momentum.x + Momentum.y*0.3);
Velocity=Momentum*1.9;
RotationRate.Yaw = 85000*FRand() - 125000;
RotationRate.Pitch = 85000*FRand() - 125000;
RotationRate.Roll = 85000*FRand() - 125000;
}
}
}
}
}
}
}
}
bWasCarried = false;
}
function Bump( actor Other )
{
local float speed, oldZ;
if( bkickable && (Pawn(Other)!=None) && (Other.Mass > 40) )
{
bekicked( (0),pawn(other),Location, Other.Velocity*1.7 , 'kicked');
}
}
// function Landed(vector HitNormall)
// {
// local actor other;
// if( bWasCarried)
// bekicked( (0),pawn(other),Location, vect(100,0,20) , 'kicked');
// bBobbing = false;
// }
function TakeDamage( int NDamage, Pawn instigatedBy, Vector hitlocation,
Vector momentum, name damageType)
{
}
}