Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

OnslaughtBP.ONSDecoy


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
//-----------------------------------------------------------
//  When out in the world, this can be used to decoy an avril.
//-----------------------------------------------------------
class ONSDecoy extends Projectile;

var class<emitter>  DecoyFlightSFXClass;    // Class of the emitter to spawn for the effect
var class<emitter>  DecoyLaunchSFXClass;    // Class of the emitter to spawn when launched
var emitter         DecoyFlightSFX;         // The actual effect
var float           DecoyRange;             // Much much range before the decoy says look at me

var ONSDualAttackCraft  ProtectedTarget;    // Protect this vehicle

simulated function PostBeginPlay()
{
    super.PostBeginPlay();
    Velocity = Speed * Vector(Rotation);
}

simulated function PostNetBeginPlay()
{
    super.PostNetBeginPlay();

    if ( EffectIsRelevant(Location, false) )
        Spawn(DecoyLaunchSFXClass,,,location,Rotation);

    if ( (Level.NetMode != NM_DedicatedServer) && (DecoyFlightSFXClass != None) )
    {
        DecoyFlightSFX = spawn(DecoyFlightSFXClass);
        if (DecoyFlightSFX!=None)
            DecoyFlightSFX.SetBase(self);
    }
}

function bool CheckRange(actor Aggressor)
{
    return vsize(Aggressor.Location - location) <= DecoyRange;
}

simulated event Destroyed() // Remove it from the Dual Attack craft's array
{
    local int i;

    super.Destroyed();

    if (ProtectedTarget!=None)
    {
        for (i=0;i<ProtectedTarget.Decoys.Length;i++)
        {
            if (ProtectedTarget.Decoys[i]!=none && ProtectedTarget.Decoys[i] == self)
            {
                ProtectedTarget.Decoys.Remove(i,1);
                return;
            }
        }
    }

    if (DecoyFlightSFX!=None)
        DecoyFlightSFX.Destroy();
}


simulated function Landed( vector HitNormal )
{
    super.Landed(HitNormal);
    Destroy();
}

defaultproperties
{
     DecoyFlightSFXClass=Class'OnslaughtBP.ONSDecoyFlight'
     DecoyLaunchSFXClass=Class'OnslaughtBP.ONSDecoyLaunch'
     DecoyRange=2048.000000
     Speed=1000.000000
     MaxSpeed=1500.000000
     Damage=50.000000
     DamageRadius=250.000000
     MomentumTransfer=10000.000000
     Physics=PHYS_Falling
     AmbientSound=Sound'CicadaSnds.Decoy.DecoyFlight'
     LifeSpan=5.000000
     bBounce=True
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Wed 7/2/2007 19:12:36.000 - Creation time: Wed 7/2/2007 19:16:46.265 - Created with UnCodeX