Class FireWindFiring extends Effects; #exec AUDIO IMPORT FILE="Sounds\firewind\FWFireStartEQ.wav" NAME="FWFireStart" GROUP="FireWind" #exec AUDIO IMPORT FILE="Sounds\firewind\FWFireLoopEQ.wav" NAME="FWFireLoop" GROUP="FireWind" #exec AUDIO IMPORT FILE="Sounds\firewind\FWFireLoopBEQ.wav" NAME="FWFireLoopB" GROUP="FireWind" #exec AUDIO IMPORT FILE="Sounds\firewind\FWFireEndEQ.wav" NAME="FWFireEnd" GROUP="FireWind" var transient vector RepFiringPos; var transient float FlameTimer; var PlayerPawn LocalPlayer; var Weapon WeaponOwner; #if GAMEVER==227 var FSFXFireWind FireEmitter; var transient float BubbleTimer; #endif replication { reliable if( Role==ROLE_Authority && !bNetOwner) RepFiringPos; } simulated function PostBeginPlay() { if( Level.NetMode!=NM_DedicatedServer ) { PlaySound(Sound'FWFireStart',SLOT_Misc); SetTimer(0.65,false); } } simulated function Timer() { if( FRand()<0.5f ) AmbientSound = Sound'FWFireLoop'; else AmbientSound = Sound'FWFireLoopB'; } simulated function Destroyed() { if( Level.NetMode!=NM_DedicatedServer ) { if( Owner!=None ) Owner.PlaySound(Sound'FWFireEnd',SLOT_Misc,TransientSoundVolume,,TransientSoundRadius); else PlaySound(Sound'FWFireEnd',SLOT_Misc); } #if GAMEVER==227 if( FireEmitter!=None ) { FireEmitter.DestroyMe(); FireEmitter = None; } #endif } simulated final function bool FindLocalPlayer() { #if GAMEVER==227 LocalPlayer = Level.GetLocalPlayerPawn(); return (LocalPlayer!=None); #else foreach AllActors(Class'PlayerPawn',LocalPlayer) { if( Viewport(LocalPlayer.Player)!=None ) return true; } return false; #endif } #if GAMEVER==227 simulated final function bool IsViewingSelf() { return ((LocalPlayer.ViewTarget==Owner || (LocalPlayer==Owner && LocalPlayer.ViewTarget==None)) && !LocalPlayer.bBehindView); } #endif simulated function Tick( float Delta ) { local vector Start; local rotator R; #if GAMEVER==227 if( Level.NetMode!=NM_DedicatedServer && LocalPlayer==None && !FindLocalPlayer() ) return; #else if( (Level.NetMode!=NM_DedicatedServer && LocalPlayer==None && !FindLocalPlayer()) || FlameTimer>Level.TimeSeconds ) return; FlameTimer = Level.TimeSeconds+0.1f; #endif if( Level.NetMode==NM_Client ) { if( Owner==None || Pawn(Owner).Weapon==None ) return; WeaponOwner = Pawn(Owner).Weapon; #if GAMEVER==227 if( IsViewingSelf() ) Start = Owner.Location+WeaponOwner.CalcDrawOffset()+vector(WeaponOwner.Rotation)*20.f; else if( WeaponOwner.Attachment!=None && (Level.TimeSeconds-WeaponOwner.Attachment.LastRenderedTime)<0.6f ) Start = WeaponOwner.Attachment.Location+vector(WeaponOwner.Attachment.Rotation)*26.f; else Start = Owner.Location+vector(Owner.Rotation)*Owner.CollisionRadius; #else if( (LocalPlayer.ViewTarget==Owner || (LocalPlayer==Owner && LocalPlayer.ViewTarget==None)) && !LocalPlayer.bBehindView ) Start = Owner.Location+Pawn(Owner).Weapon.CalcDrawOffset(); else Start = Owner.Location+vector(Owner.Rotation)*Owner.CollisionRadius; #endif if( LocalPlayer==Owner ) R = Pawn(Owner).ViewRotation; else R = rotator(RepFiringPos-Start); Instigator = Pawn(Owner); } else { if( Owner==None || Owner.bDeleteMe || WeaponOwner==None ) { Destroy(); return; } #if GAMEVER==227 if( Level.NetMode!=NM_DedicatedServer && !IsViewingSelf() && WeaponOwner.Attachment!=None && (Level.TimeSeconds-WeaponOwner.Attachment.LastRenderedTime)<0.6f ) Start = WeaponOwner.Attachment.Location+vector(WeaponOwner.Attachment.Rotation)*26.f; else Start = Owner.Location+WeaponOwner.CalcDrawOffset()+vector(WeaponOwner.Rotation)*20.f; #else Start = Owner.Location+WeaponOwner.CalcDrawOffset(); #endif R = Pawn(Owner).AdjustAim(Class'FSFireBitch'.Default.Speed, Start, 0, True, (FRand() < 0.2)); if( Level.NetMode!=NM_StandAlone ) RepFiringPos = Start+vector(R)*800.f; #if GAMEVER==227 if( FlameTimerLevel.TimeSeconds ) return; BubbleTimer = Level.TimeSeconds+0.1f; #endif b = Spawn(Class'Bubble1',,,Start,Dir); if( b!=None ) { b.RemoteRole = ROLE_None; b.LifeSpan = 3; b.Drawscale = FRand()*0.1+0.05; b.Velocity += (Owner.Velocity+vector(Dir)*100.f); } } #if GAMEVER==227 else if( FireEmitter==None ) FireEmitter = Spawn(Class'FSFXFireWind',,,Start,Dir); else { FireEmitter.SetLocation(Start); FireEmitter.SetRotation(Dir); FireEmitter.SetAccel(Owner.Velocity); } #else else Spawn(class'FlameEffectz',,,Start,Dir); #endif } defaultproperties { RemoteRole=ROLE_SimulatedProxy bCarriedItem=true DrawType=DT_None LifeSpan=0 bNetTemporary=false SoundVolume=255 SoundRadius=36 Physics=PHYS_Trailer TransientSoundVolume=2 }