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

UnrealI.PeaceRocket


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
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
//=============================================================================
// PeaceRocket.
//=============================================================================
class PeaceRocket expands Projectile;

#exec MESH IMPORT MESH=perock ANIVFILE=MODELS\perock_a.3D DATAFILE=MODELS\perock_d.3D X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=perock X=0 Y=0 Z=0 YAW=0 ROLL=0 PITCH=-64
#exec MESH SEQUENCE MESH=perock SEQ=All       STARTFRAME=0   NUMFRAMES=16
#exec MESH SEQUENCE MESH=perock SEQ=Ignite    STARTFRAME=0   NUMFRAMES=3
#exec MESH SEQUENCE MESH=perock SEQ=Flying    STARTFRAME=3   NUMFRAMES=13
#exec TEXTURE IMPORT NAME=Jpeace1 FILE=MODELS\peaceg.PCX
#exec MESHMAP SCALE MESHMAP=perock  X=0.07 Y=0.07 Z=0.14
#exec MESHMAP SETTEXTURE MESHMAP=perock NUM=1 TEXTURE=Jpeace1

var vector X,Y,Z;
var pawn ClosestPawn;
var float ClosestDistance;
var int Count;

function PostBeginPlay()
{
    Super.PostBeginPlay();
    PlaySound(SpawnSound);  
    Velocity = Vector(Rotation) * 120.0;
    Acceleration = Velocity * 1.67; 
    Count = 0;
    Timer();
    SetTimer(1.0,True);
}

function Timer()
{
    local pawn Victims;
    local float thisDist;

    ClosestDistance = 100000;
    ClosestPawn = None; 
    Count++;
    if (Count==8)
    {
        Explode(Location, vect(0,0,0));
        return;
    }

    //FIXME - use the pawnlist for this
    foreach VisibleCollidingActors( class'Pawn', Victims, 500.0 )
    {
        thisDist = VSize(Victims.Location - Location); 
        if ( thisDist < ClosestDistance) 
        {
            ClosestPawn = Victims;
            ClosestDistance = thisDist;
        }       
    }           
}
function Tick( float DeltaTime )
{
    local float MagnitudeVel;
    if (ClosestPawn != None)
    {
        MagnitudeVel = VSize(Velocity);
        Velocity =  MagnitudeVel * Normal( Normal(ClosestPawn.Location - Location) 
            * MagnitudeVel * DeltaTime * 6 + Velocity);     
        SetRotation(rotator(Velocity));
    }
}
function ProcessTouch (Actor Other, Vector HitLocation)
{
    local int hitdamage;
    if ((PeaceRocket(Other) == none)) Explode(HitLocation, HitLocation);
}

function Explode(vector HitLocation, vector HitNormal)
{
    HurtRadius(damage, 200.0, 'exploded', MomentumTransfer, HitLocation);
    Spawn(class'BallExplosion');    
    Destroy();
}

defaultproperties
{
     MaxSpeed=600.000000
     Damage=100.000000
     MomentumTransfer=70000
     bNetTemporary=False
     LifeSpan=15.000000
     Mesh=Mesh'UnrealI.perock'
     AmbientGlow=96
     bMeshCurvy=False
     LightType=LT_Steady
     LightEffect=LE_NonIncidence
     LightBrightness=79
     LightHue=28
     LightSaturation=157
     LightRadius=6
     bBounce=True
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Sun 21/2/2010 23:48:40.000 - Creation time: Sun 21/2/2010 23:49:52.944 - Created with UnCodeX