Here is how I currently have it implemented.
Code: Select all
Blood = String.Format("%sBlood%s",Clr,Size);
Double DPitch;
Double DHeight;
Vector2 VAngle;
Vector3 Position;
Vector3 Direction;
For (Int I = 0; I < Num; I++)
{
If (Inflictor)
{
VAngle = AngleToVector(FRandom(Inflictor.Angle - 15.0,Inflictor.Angle + 15.0));
DPitch = Clamp(FRandom(Inflictor.Pitch - 7.5,Inflictor.Pitch + 7.5),-89.0,89.0);
DHeight = Clamp(Inflictor.Pos.Z - Pos.Z,Pos.Z,Pos.Z + Height);
}
Else If (Source)
{
VAngle = AngleToVector(FRandom(Source.Angle - 15.0,Source.Angle + 15.0));
DPitch = Clamp(FRandom(Source.Pitch - 7.5,Source.Pitch + 7.5),-89.0,89.0);
DHeight = Pos.Z + (Height / 2);
}
Else
{
VAngle = AngleToVector(FRandom(0.0,360.0));
DPitch = FRandom(-30.0,30.0);
DHeight = Pos.Z + (Height / 2);
}
Position = (0.0,0.0,DHeight);
Direction = (VAngle.X,VAngle.Y,Sin(-DPitch));
A_SprayDecal(Blood,172.0,Position,Direction);
}