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

XEffects.IonEffect


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
class IonEffect extends Actor;

#exec OBJ LOAD FILE=XEffectMat.utx

var Vector HitLocation, HitNormal;
var IonShaft IonShaft;
var IonLightBeam IonLightBeam;
var IonCore IonCore;
var float StartTime;
var() float DropTime;

replication
{
    reliable if (bNetInitial && Role == ROLE_Authority)
        HitLocation, HitNormal;
}

function AimAt(Vector hl, Vector hn)
{
    HitLocation = hl;
    HitNormal = hn;
    if (Level.NetMode != NM_DedicatedServer)
        SpawnEffects();
}

simulated function PostNetBeginPlay()
{
    if (Role < ROLE_Authority)
        SpawnEffects();
}

simulated function SpawnEffects()
{
    IonCore = Spawn(class'IonCore',,, Location, Rotation);
    IonShaft = Spawn(class'IonShaft',,, Location, Rotation);
    IonShaft.mSpawnVecA = Location;
    IonLightBeam = Spawn(class'IonLightBeam',,, Location, Rotation);
    IonLightBeam.mSpawnVecA = HitLocation;
    GotoState('Drop');
}

state Drop
{
    simulated function BeginState()
    {
        StartTime = Level.TimeSeconds;
        SetTimer(DropTime, false);
    }

    simulated function Tick(float dt)
    {
        local float Delta;
        Delta = FMin((Level.TimeSeconds - StartTime) / DropTime, 1.0);
        IonCore.SetLocation(Location*(1.0-Delta) + HitLocation*delta);
        IonShaft.SetLocation(IonCore.Location);
    }

    simulated function Timer()
    {
        local Rotator NormalRot;
        local Actor A;
		
        IonShaft.SetLocation(IonCore.Location);
        IonCore.Destroy();
        IonShaft.mAttenuate = true;
        IonLightBeam.mAttenuate = true;

        if (Abs(HitNormal.Z) < 0.8)
            NormalRot = Rotator(HitLocation - Location);
        else
            NormalRot = Rotator(HitNormal);

       A = Spawn(class'NewIonEffect',,, HitLocation+Vect(0,0,100), Rot(0,16384,0));
       A.RemoteRole = ROLE_None;
       GotoState('');
    }
}

defaultproperties
{
     DropTime=0.500000
     LightType=LT_Steady
     LightEffect=LE_QuadraticNonIncidence
     LightHue=160
     LightSaturation=140
     LightBrightness=255.000000
     LightRadius=12.000000
     DrawType=DT_None
     bDynamicLight=True
     bNetTemporary=True
     bAlwaysRelevant=True
     bReplicateMovement=False
     bSkipActorPropertyReplication=True
     RemoteRole=ROLE_SimulatedProxy
     LifeSpan=2.000000
     TransientSoundVolume=1.000000
     TransientSoundRadius=5000.000000
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: pr 5-2-2018 12:35:50.000 - Creation time: sk 18-3-2018 09:50:11.471 - Created with UnCodeX