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

Onslaught.ONSDamagedEffect


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
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
class ONSDamagedEffect extends Emitter
    native;

#exec OBJ LOAD FILE=..\Textures\AW-2004Particles.utx
#exec OBJ LOAD FILE=..\Textures\EpicParticles.utx

simulated function PostBeginPlay()
{
    local ONSVehicle V;

    Super.PostBeginPlay();

    V = ONSVehicle(Owner);
    if (V != None)
    {
        SetEffectScale(V.DamagedEffectScale);
        UpdateDamagedEffect(false, 0);
    }
}

simulated function SetEffectScale(float Scaling)
{
    Emitters[0].SizeScale[0].RelativeSize = Scaling * default.Emitters[0].SizeScale[0].RelativeSize;
    Emitters[0].SizeScale[1].RelativeSize = Scaling * default.Emitters[0].SizeScale[1].RelativeSize;


    Emitters[1].SizeScale[0].RelativeSize = Scaling * default.Emitters[1].SizeScale[0].RelativeSize;
    Emitters[1].SizeScale[1].RelativeSize = Scaling * default.Emitters[1].SizeScale[1].RelativeSize;
    Emitters[1].SizeScale[2].RelativeSize = Scaling * default.Emitters[1].SizeScale[2].RelativeSize;

    Emitters[1].StartLocationRange.X.Min = Scaling * default.Emitters[1].StartLocationRange.X.Min;
    Emitters[1].StartLocationRange.X.Max = Scaling * default.Emitters[1].StartLocationRange.X.Max;
    Emitters[1].StartLocationRange.Y.Min = Scaling * default.Emitters[1].StartLocationRange.Y.Min;
    Emitters[1].StartLocationRange.Y.Max = Scaling * default.Emitters[1].StartLocationRange.Y.Max;


    Emitters[2].StartSizeRange.X.Min = Scaling * default.Emitters[2].StartSizeRange.X.Min;
    Emitters[2].StartSizeRange.X.Max = Scaling * default.Emitters[2].StartSizeRange.X.Max;
    Emitters[2].StartSizeRange.Y.Min = Scaling * default.Emitters[2].StartSizeRange.Y.Min;
    Emitters[2].StartSizeRange.Y.Max = Scaling * default.Emitters[2].StartSizeRange.Y.Max;

    Emitters[2].StartLocationRange.X.Min = Scaling * default.Emitters[2].StartLocationRange.X.Min;
    Emitters[2].StartLocationRange.X.Max = Scaling * default.Emitters[2].StartLocationRange.X.Max;
    Emitters[2].StartLocationRange.Y.Min = Scaling * default.Emitters[2].StartLocationRange.Y.Min;
    Emitters[2].StartLocationRange.Y.Max = Scaling * default.Emitters[2].StartLocationRange.Y.Max;
}

//Called from ONSVehicle native code when significant changes in vehicle's health or velocity occur
simulated event UpdateDamagedEffect(bool bFlame, float VelMag)
{
    local float SmokeLifeScale;

    if(bFlame)
    {
        Emitters[1].ParticlesPerSecond = default.Emitters[1].ParticlesPerSecond;
        Emitters[1].InitialParticlesPerSecond = default.Emitters[1].InitialParticlesPerSecond;
        Emitters[1].AllParticlesDead = false;

        Emitters[2].ParticlesPerSecond = default.Emitters[2].ParticlesPerSecond;
        Emitters[2].InitialParticlesPerSecond = default.Emitters[2].InitialParticlesPerSecond;
        Emitters[2].AllParticlesDead = false;
    } 
    else
    {
        Emitters[1].ParticlesPerSecond = 0;
        Emitters[1].InitialParticlesPerSecond = 0;

        Emitters[2].ParticlesPerSecond = 0;
        Emitters[2].InitialParticlesPerSecond = 0;
    }

    SmokeLifeScale = 1.0 - ( 0.55 * ((VelMag-500)/2000) );
    SmokeLifeScale = FClamp(SmokeLifeScale, 0.45, 1.0);

    Emitters[0].InitialParticlesPerSecond = 7.5/SmokeLifeScale;
    Emitters[0].ParticlesPerSecond = 7.5/SmokeLifeScale;
    Emitters[0].LifetimeRange.Min = 2.0 * SmokeLifeScale;
    Emitters[0].LifetimeRange.Max = 2.0 * SmokeLifeScale;
}

defaultproperties
{
     Begin Object Class=SpriteEmitter Name=SpriteEmitter0
         UseColorScale=Wahr
         SpinParticles=Wahr
         UseSizeScale=Wahr
         UseRegularSizeScale=Falsch
         UniformSize=Wahr
         AutomaticInitialSpawning=Falsch
         UseRandomSubdivision=Wahr
         UseVelocityScale=Wahr
         Acceleration=(Z=175.000000)
         ColorScale(0)=(Color=(B=192,G=192,R=192))
         ColorScale(1)=(RelativeTime=0.100000,Color=(B=160,G=160,R=160,A=255))
         ColorScale(2)=(RelativeTime=0.800000,Color=(B=128,G=128,R=128,A=192))
         ColorScale(3)=(RelativeTime=1.000000,Color=(B=128,G=128,R=128))
         MaxParticles=50
         StartLocationRange=(Z=(Max=20.000000))
         SizeScale(0)=(RelativeSize=0.500000)
         SizeScale(1)=(RelativeTime=1.000000,RelativeSize=1.500000)
         StartSizeRange=(X=(Min=50.000000,Max=50.000000))
         ParticlesPerSecond=25.000000
         InitialParticlesPerSecond=25.000000
         DrawStyle=PTDS_AlphaBlend
         Texture=Texture'AW-2004Particles.Weapons.DustSmoke'
         TextureUSubdivisions=4
         TextureVSubdivisions=4
         LifetimeRange=(Min=2.500000,Max=1.500000)
         StartVelocityRange=(X=(Min=-100.000000,Max=100.000000),Y=(Min=-100.000000,Max=100.000000),Z=(Min=200.000000,Max=200.000000))
         VelocityScale(0)=(RelativeVelocity=(Z=0.500000))
         VelocityScale(1)=(RelativeTime=0.500000,RelativeVelocity=(X=0.200000,Y=0.200000,Z=0.200000))
         VelocityScale(2)=(RelativeTime=1.000000,RelativeVelocity=(X=1.000000,Y=1.000000,Z=0.200000))
     End Object
     Emitters(0)=SpriteEmitter'Onslaught.ONSDamagedEffect.SpriteEmitter0'

     Begin Object Class=SpriteEmitter Name=SpriteEmitter1
         UseColorScale=Wahr
         RespawnDeadParticles=Falsch
         SpinParticles=Wahr
         UseSizeScale=Wahr
         UseRegularSizeScale=Falsch
         UniformSize=Wahr
         AutomaticInitialSpawning=Falsch
         Acceleration=(Z=50.000000)
         ColorScale(1)=(RelativeTime=0.500000,Color=(B=34,G=135,R=210,A=255))
         ColorScale(2)=(RelativeTime=0.600000,Color=(B=255,G=255,R=255,A=64))
         ColorScale(3)=(RelativeTime=1.000000)
         Opacity=0.500000
         CoordinateSystem=PTCS_Relative
         MaxParticles=4
         StartLocationRange=(X=(Min=-10.000000,Max=10.000000),Y=(Min=-10.000000,Max=10.000000))
         StartLocationShape=PTLS_All
         SpinsPerSecondRange=(X=(Max=0.200000))
         StartSpinRange=(X=(Max=1.000000))
         SizeScale(0)=(RelativeSize=1.000000)
         SizeScale(1)=(RelativeTime=0.500000,RelativeSize=1.200000)
         SizeScale(2)=(RelativeTime=1.000000,RelativeSize=1.500000)
         StartSizeRange=(X=(Min=10.000000,Max=20.000000))
         ParticlesPerSecond=8.000000
         InitialParticlesPerSecond=8.000000
         Texture=Texture'AW-2004Particles.Fire.NapalmSpot'
         LifetimeRange=(Min=0.500000,Max=0.500000)
         StartVelocityRange=(Z=(Min=4.000000,Max=4.000000))
     End Object
     Emitters(1)=SpriteEmitter'Onslaught.ONSDamagedEffect.SpriteEmitter1'

     Begin Object Class=SpriteEmitter Name=SpriteEmitter2
         UseColorScale=Wahr
         SpinParticles=Wahr
         UseSizeScale=Wahr
         UseRegularSizeScale=Falsch
         UniformSize=Wahr
         AutomaticInitialSpawning=Falsch
         ColorScale(1)=(RelativeTime=0.200000,Color=(B=9,G=175,R=255))
         ColorScale(2)=(RelativeTime=0.400000,Color=(B=13,G=122,R=242))
         ColorScale(3)=(RelativeTime=1.000000)
         StartLocationRange=(X=(Min=-10.000000,Max=10.000000),Y=(Min=-10.000000,Max=10.000000))
         SpinsPerSecondRange=(X=(Max=0.200000))
         StartSpinRange=(X=(Max=1.000000))
         SizeScale(0)=(RelativeSize=0.750000)
         SizeScale(1)=(RelativeTime=1.000000,RelativeSize=1.000000)
         StartSizeRange=(X=(Min=20.000000,Max=30.000000))
         ParticlesPerSecond=25.000000
         InitialParticlesPerSecond=25.000000
         Texture=Texture'AW-2004Particles.Fire.SmokeFragment'
         LifetimeRange=(Min=0.150000,Max=0.150000)
         StartVelocityRange=(Z=(Min=140.000000,Max=180.000000))
     End Object
     Emitters(2)=SpriteEmitter'Onslaught.ONSDamagedEffect.SpriteEmitter2'

     AutoDestroy=Wahr
     bNoDelete=Falsch
     bHardAttach=Wahr
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Fr 30.3.2007 08:43:52.000 - Creation time: Mo 16.4.2007 11:20:50.890 - Created with UnCodeX