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

Engine.xPickUpBase


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
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
//=============================================================================
// xPickUpBase.
// This is the base class of all pickup-spawners.  When placing pickups in
// levels, place pickup bases instead since these will spawn the actual
// pickups.
//=============================================================================
class xPickUpBase extends Actor
    abstract
    placeable
    native;

var(PickUpBase) class<PickUp>   PowerUp;        // pick-up class to spawn with this base
var(PickUpBase) float           SpawnHeight;    // height above this base at which the power up will spawn
var(PickUpBase) class<Emitter>  SpiralEmitter;  // emitter which spawns particles when myPickup is available
var(PickUpBase) float           ExtraPathCost;  // assigned to the inventory spot
var PickUp                      myPickUp;       // reference to the pick up spawned with this base
var Emitter                     myEmitter;      // reference to the emitter spawned with this base
var InventorySpot               myMarker;       // inventory spot marker associated with this pick-up base
var(PickUpBase) bool            bDelayedSpawn;

/* The UnrealEd console command "NewPickupBases" will apply the following properties to this pickup base
 * Used to apply UT2004's new pickup base staticmeshes because we can't just universally change StaticMesh
 * as that would cause them to be unlit in all old maps
 */
var StaticMesh NewStaticMesh;
var vector NewPrePivot;
var float NewDrawScale;

simulated event PostBeginPlay()
{
    Super.PostBeginPlay();

    if ( PowerUp != None )
    {
        if( Level.NetMode != NM_Client )
        {
            SpawnPickup();
            if ( bDelayedSpawn && (myPickup != None) )
            {
                if ( myPickup.IsInState('Pickup') )
                    myPickup.GotoState( 'WaitingForMatch' );
                if ( myPickup.myMarker != None )
                    myPickup.myMarker.bSuperPickup = true;
            }
        }
        if ( Level.NetMode != NM_DedicatedServer )
            PowerUp.static.StaticPrecache(Level);
    }

    if( !bHidden && (Level.NetMode != NM_DedicatedServer) )
    {
        myEmitter = Spawn(SpiralEmitter,,,Location + vect(0,0,40));
        SetDrawScale(Default.DrawScale);
    }
}


function bool CheckForErrors()
{
    local Actor HitActor;
    local vector HitLocation, HitNormal;

    HitActor = Trace(HitLocation, HitNormal,Location - Vect(0,0,10), Location,false);
    if ( HitActor == None )
    {
        log(self$" FLOATING");
        return true;
    }
    return Super.CheckForErrors();
}

function byte GetInventoryGroup()
{
    return 0;
}

function TurnOn();

function SpawnPickup()
{
    if( PowerUp == None )
        return;

    myPickUp = Spawn(PowerUp,,,Location + SpawnHeight * vect(0,0,1), rot(0,0,0));

    if (myPickUp != None)
    {
        myPickUp.PickUpBase = self;
        myPickup.Event = event;
    }

    if (myMarker != None)
    {
        myMarker.markedItem = myPickUp;
        myMarker.ExtraCost = ExtraPathCost;
        if (myPickUp != None)
            myPickup.MyMarker = MyMarker;
    }
    else log("No marker for "$self);
}

defaultproperties
{
     SpawnHeight=50.000000
     DrawType=DT_Mesh
     CullDistance=7000.000000
     bStatic=True
     RemoteRole=ROLE_None
     AmbientGlow=64
     CollisionRadius=35.000000
     CollisionHeight=35.000000
     bProjTarget=True
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Mon 23/10/2006 20:25:18.000 - Creation time: Wed 7/2/2007 19:16:59.703 - Created with UnCodeX