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

JBToolbox.JBEmitterBurningPlayer


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
// ============================================================================
// JBEmitterBurningPlayer
// Copyright 2006 by Wormbo <wormbo@onlinehome.de>
// $Id: JBEmitterBurningPlayer.uc,v 1.4 2007-09-09 18:14:44 jrubzjeknf Exp $
//
// An emitter that sets a player on fire.
// ============================================================================

class JBEmitterBurningPlayer extends Emitter;


// ============================================================================
// Imports
// ============================================================================

#exec obj load file=..\Textures\EmitterTextures.utx
#exec obj load file=..\Sounds\GeneralAmbience.uax


// ============================================================================
// Variables
// ============================================================================

/** The victim these flames are attached to. (Owner doesn't replicate to all clients!) */
var Pawn Victim;
var float FlashTransparency;
var JBEmitter1stPersonFlames EmitterFP;


// ============================================================================
// Replication
// ============================================================================

replication
{
  reliable if (Role == ROLE_Authority)
    Victim;
}


// ============================================================================
// PostBeginPlay
//
// Set the owner as the victim (for replication) and set up the emitter on the
// serverside or offline.
// ============================================================================

function PostBeginPlay()
{
  Victim = Pawn(Owner);
}


// ============================================================================
// PostNetBeginPlay
//
// Set the mesh actor and proper scale. Make sure the emitter moves with the
// player. Spawn the first person version of the emitter.
// ============================================================================

simulated function PostNetBeginPlay()
{
  if (Victim != None) {
    Emitters[0].SkeletalScale = Emitters[0].SkeletalScale * Victim.DrawScale3D * Victim.DrawScale;
    Emitters[0].SkeletalMeshActor = Victim;
    SetLocation(Victim.Location);
    SetBase(Victim);

    if (Level.GetLocalPlayerController() != None &&
        Level.GetLocalPlayerController().Pawn == Victim) {
      EmitterFP = Spawn(class'JBEmitter1stPersonFlames', Victim,, Victim.Location, Victim.Rotation);
      EmitterFP.SetBase(Victim);
    }
  }
}


// ============================================================================
// TornOff
//
// Make sure the emitter goes away when the player died.
// ============================================================================

simulated function TornOff()
{
  Kill();
  LifeSpan = 0.6;
  AmbientSound = None;
  Disable('Tick');

  if (EmitterFP != None)
    EmitterFP.TornOff();
}


// ============================================================================
// Tick
//
// Update the emitter rotation offset (neccessary for actors that are not
// ragdolls). Display screen flashes that simulate heat.
// ============================================================================

simulated function Tick(float DeltaTime)
{
  if (Victim != None) {
    Emitters[0].RotationOffset = Victim.Rotation - rot(0,16384,0);

    if (PlayerController(Pawn(Owner).Controller) != None) {
      // Gradually increase the opacity.
      if (FlashTransparency > 0.5)
        FlashTransparency = FMax(0.5, FlashTransparency - DeltaTime/2);

      PlayerController(Pawn(Owner).Controller).ClientFlash(FlashTransparency, vect(1000,500,0));
    }
  }
}


// ============================================================================
// Default properties
// ============================================================================

defaultproperties
{
  FlashTransparency = 1.0

  Begin Object Class=SpriteEmitter Name=PlayerFlames
    FadeOut=True
    FadeIn=True
    SpinParticles=True
    UseSizeScale=True
    UseRegularSizeScale=False
    UniformSize=True
    UseRandomSubdivision=True
    AddVelocityFromOwner=True
    Acceleration=(Z=20.000000)
    Opacity=0.500000
    FadeOutStartTime=0.200000
    FadeInEndTime=0.200000
    MaxParticles=100
    StartLocationOffset=(Z=-48.000000)
    StartLocationShape=PTLS_Sphere
    SphereRadiusRange=(Max=5.000000)
    UseRotationFrom=PTRS_Offset
    RotationOffset=(Yaw=-16384)
    StartSpinRange=(X=(Min=0.375000,Max=0.375000))
    SizeScale(0)=(RelativeSize=0.300000)
    SizeScale(1)=(RelativeTime=0.700000,RelativeSize=2.000000)
    SizeScale(2)=(RelativeTime=1.000000,RelativeSize=3.000000)
    StartSizeRange=(X=(Min=10.000000,Max=15.000000),Y=(Min=10.000000,Max=15.000000),Z=(Min=10.000000,Max=15.000000))
    UseSkeletalLocationAs=PTSU_SpawnOffset
    SkeletalScale=(X=0.390000,Y=0.390000,Z=0.390000)
    Texture=Texture'EmitterTextures.MultiFrame.LargeFlames'
    TextureUSubdivisions=4
    TextureVSubdivisions=4
    SecondsBeforeInactive=0.000000
    LifetimeRange=(Min=0.500000,Max=0.500000)
    StartVelocityRange=(Z=(Min=10.000000,Max=20.000000))
    VelocityLossRange=(X=(Min=5.000000,Max=5.000000),Y=(Min=5.000000,Max=5.000000),Z=(Min=5.000000,Max=5.000000))
  End Object
  Emitters(0)=SpriteEmitter'PlayerFlames'

  bOwnerNoSee = True
  bNoDelete   = False
  bHardAttach = True
  RemoteRole  = ROLE_SimulatedProxy
  bReplicateMovement = False
  AmbientSound = Sound'GeneralAmbience.firefx9'
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: So 9.9.2007 20:17:16.000 - Creation time: Do 14.8.2014 09:58:42.051 - Created with UnCodeX