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

OnslaughtBP.CicadaLockBeamEffect


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
//-----------------------------------------------------------
//
//-----------------------------------------------------------
class CicadaLockBeamEffect extends PainterBeamEffect;

simulated function Tick(float dt)
{
    if (Level.NetMode == NM_DedicatedServer)
    {
        return;
    }

	UpdateEffect(dt);

    if (TargetState == PTS_Marked)
    {
        if (Brightness == 40.0)
            PlaySound(MarkSound);
        SetBrightness( FMax(FMin(Brightness+dt*100.0, 250.0), 100.0) );
    }
    else
        SetBrightness( 40.0 );

    if (TargetState == PTS_Aquired)
        GotoState('Aquired');
    else if (TargetState == PTS_Cancelled)
        GotoState('Cancelled');

}

simulated function UpdateEffect(float dt)
{
    local Vector BeamDir;

	if (Owner!=None && ONSDualACSideGun(Owner)!=None)
	{
		StartEffect = ONSDualACSideGun(Owner).Location;
	}

    SetLocation(StartEffect);
    BeamDir = Normal(EndEffect - Location);
    SetRotation(Rotator(BeamDir));

    mSpawnVecA = EndEffect;

    if (Spot != None)
    {
        Spot.SetLocation(EndEffect - BeamDir*10.0);
    }
}

state Aquired
{
    simulated function Tick(float dt)
    {
        if (Level.NetMode != NM_DedicatedServer)
        {
        	UpdateEffect(dt);
            SetBrightness( 250.0 );
            mSizeRange[0] = FMin(mSizeRange[0]+dt*40.0, 16.0);
        }
		else
			disable('Tick');
    }

}

defaultproperties
{
}

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