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

U2Weapons.WeaponInvFlameThrower


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
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
//=============================================================================
// $Workfile: WeaponInvFlamethrower.uc $ 
// Created By: Aaron Leiby, Mark Poesch, Sam Brown
// Created On:
// $Author: Aleiby $
// $Date: 12/08/02 7:01p $
// $Revision: 40 $
//=============================================================================
class WeaponInvFlameThrower extends U2Weapon;


#exec OBJ LOAD File=..\Meshes\GlmWeaponsG.ugx
#exec OBJ LOAD File=..\System\ParticleRes\Flamethrower_Effects.u
#exec OBJ LOAD File=..\System\ParticleRes\FlameAltFX.u
#exec OBJ LOAD File=..\Textures\WeaponFXT.utx

var bool bFiring;

var FT_Light FireLight[3];
//var ParticleGenerator Flamejet1,Flamejet2;

var float Pct;
var int CrossX,CrossY;
var() int MinCrossX,MinCrossY;
var() int MaxCrossX,MaxCrossY;

function Point GetCrossPosA(){ local Point P; P.X=-CrossX; P.Y=-CrossY; return P; }
function Point GetCrossPosB(){ local Point P; P.X= CrossX; P.Y=-CrossY; return P; }
function Point GetCrossPosC(){ local Point P; P.X=-CrossX; P.Y= CrossY; return P; }
function Point GetCrossPosD(){ local Point P; P.X= CrossX; P.Y= CrossY; return P; }

simulated function HandleTargetDetails( Actor A, Canvas Canvas, vector ViewLoc, rotator ViewRot )
{
	local float DesiredPct;
	local float Dist;

	DesiredPct = 0.5;

	if( A? && !LevelInfo(A) )
	{
		Dist = VSize(A.Location - ViewLoc);
		if( Dist < 768 )
		{
			DesiredPct = ABlend( 768, 256, Dist );
			DesiredPct = FClamp( DesiredPct, 0, 1 );
		}
	}

	Pct += (DesiredPct - Pct) * 0.1;	//!!arl framerate dependant

	CrossX = Blend( MinCrossX, MaxCrossX, Pct );
	CrossY = Blend( MinCrossY, MaxCrossY, Pct );
}

function float GetProjSpeed( bool bAlt )
{
	if( bAlt )
		return AltProjectileSpeed;
	else	
		return ProjectileSpeed;
}

simulated function PlayAnimEx( name Sequence )
{
	Super.PlayAnimEx(Sequence);
	if (Sequence=='FireEnd')
		TurnOff();
	if (LastTriggeredAnim=='Fire')
	{
		ParticleGenerator(DecoEffects[0].Effect).bOn = !PhysicsVolume.bWaterVolume;
		ParticleGenerator(DecoEffects[1].Effect).bOn = PhysicsVolume.bWaterVolume;
		if( PhysicsVolume.bWaterVolume )
			TurnOff();
	}
	else if (LastTriggeredAnim=='AltFire')
	{
		ParticleGenerator(DecoEffects[2].Effect).bOn = !PhysicsVolume.bWaterVolume;
		ParticleGenerator(DecoEffects[3].Effect).bOn = PhysicsVolume.bWaterVolume;
	}
}

event PhysicsVolumeChange( PhysicsVolume NewVolume )
{
	if (LastTriggeredAnim=='Fire')
	{
		ParticleGenerator(DecoEffects[0].Effect).bOn = !NewVolume.bWaterVolume;
		ParticleGenerator(DecoEffects[1].Effect).bOn = NewVolume.bWaterVolume;
		if( NewVolume.bWaterVolume )
			TurnOff();
	}
	else if (LastTriggeredAnim=='AltFire')
	{
		ParticleGenerator(DecoEffects[2].Effect).bOn = !NewVolume.bWaterVolume;
		ParticleGenerator(DecoEffects[3].Effect).bOn = NewVolume.bWaterVolume;
	}

	if( NewVolume.bWaterVolume )
		PilotsOff();
	else
		PilotsOn();
}

simulated function PilotsOff()
{
	local int i;
	local array<Actor> Attachments;
	MeshGetAttachments("Pilot",Attachments);
	for( i=0; i<Attachments.length; i++ )
		Attachments[i].bHidden = true;
}

simulated function PilotsOn()
{
	local int i;
	local array<Actor> Attachments;
	MeshGetAttachments("Pilot",Attachments);
	for( i=0; i<Attachments.length; i++ )
		Attachments[i].bHidden = false;
}

simulated function EverywhereFire()
{
	Super.EverywhereFire();
	TurnOn();
}

simulated function CreateEffects()
{
	local int i;
	if( Level.NetMode != NM_DedicatedServer )
		for( i=0; i<ArrayCount(FireLight); i++ )
		{
			FireLight[i] = Spawn( class'FT_Light', Self );
			if(i==0) FireLight[i].Offset.X=300; else
			if(i==1) FireLight[i].Offset.X=600; else
			if(i==2) FireLight[i].Offset.X=900;
		}
/*
		Flamejet1 = class'ParticleGenerator'.static.CreateNew( self, ParticleSalamander'Flamethrower_Effects.ParticleSalamander0', Location );
		Flamejet1.MountParentActor	= self;
		Flamejet1.MountParentTag	= Tag;
		Flamejet1.MountParentNode	= "#Flamejet1";
		Flamejet1.MountOrgLocation	= vect(0,0,0);
		Flamejet1.MountOrgRotation	= rot(0,0,0);
		Flamejet1.MountOldLocation	= Flamejet1.Location;
		Flamejet1.MountOldRotation	= Flamejet1.Rotation;

		Flamejet2 = class'ParticleGenerator'.static.CreateNew( self, ParticleSalamander'Flamethrower_Effects.ParticleSalamander0', Location );
		Flamejet2.MountParentActor	= self;
		Flamejet2.MountParentTag	= Tag;
		Flamejet2.MountParentNode	= "#Flamejet2";
		Flamejet2.MountOrgLocation	= vect(0,0,0);
		Flamejet2.MountOrgRotation	= rot(0,0,0);
		Flamejet2.MountOldLocation	= Flamejet2.Location;
		Flamejet2.MountOldRotation	= Flamejet2.Rotation;
*/
}

simulated function TurnOn()
{
	local int i;
	if( FireLight[0] == None )
		CreateEffects();
	if( Level.NetMode != NM_DedicatedServer )
		for( i=0; i<ArrayCount(FireLight); i++ )
			FireLight[i].TurnOn();
}

simulated function TurnOff()
{
	local int i;
	if( Level.NetMode != NM_DedicatedServer )
		for( i=0; i<ArrayCount(FireLight); i++ )
			FireLight[i].TurnOff();
}

simulated event Destroyed()
{
	local int i;
	for( i=0; i<ArrayCount(FireLight); i++ )
	{
		if( FireLight[i]? )
		{
			FireLight[i].TurnOff();
			FireLight[i].Destroy();
			FireLight[i] = None;
		}
	}
	Super.Destroyed();
}

//-----------------------------------------------------------------------------
// Kind of useless currently since NPCs won't fire weapon without an Enemy and
// I don't think that we'll even end up here if there is no Enemy anyway.

function float SuggestAttackStyleNoEnemy( bool bUseAltMode )
{
	if( bUseAltMode )
		return -0.4;	// alt fire -- tend to back away?
	else
		return 0.0;		// primary fire -- just stay neutral
}

state AltFiring
{
	simulated function SetFireSkin(){}
}

defaultproperties
{
	MinCrossX=24
	MinCrossY=12
	MaxCrossX=128
	MaxCrossY=64
	FireTime=0.100000
	AltFireTime=0.100000
	FireLastDownTime=1.066000
	AltFireLastDownTime=1.066000
	FireLastReloadTime=2.533000
	AltFireLastReloadTime=2.533000
	ReloadTime=2.600000
	FlashSkin=Shader'WeaponFXT.FlameThrower.FT_Skin2FX'
	FireEndSound=Sound'U2WeaponsA.FlameThrower.FT_FireEnd'
	FireLastRoundSound=Sound'U2WeaponsA.FlameThrower.FT_FireLastRound'
	AltFireLastRoundSound=Sound'U2WeaponsA.FlameThrower.FT_AltFireLastRound'
	ReloadUnloadedSound=Sound'U2WeaponsA.FlameThrower.FT_ReloadUnloaded'
     GunButtSounds(0)=Sound'U2WeaponsA.GunButt.GunButt01'
     GunButtSounds(1)=Sound'U2WeaponsA.GunButt.GunButt02'
     GunButtSounds(2)=Sound'U2WeaponsA.GunButt.GunButt03'
     GunButtSounds(3)=Sound'U2WeaponsA.GunButt.GunButt04'
	ProjectileSpeed=500.000000
	AltProjectileSpeed=500.000000
     DecoEffects(0)=(AnimSequence=Fire,DecoClass=Class'ParticleSystems.ParticleSalamander',Particles=ParticleSalamander'Flamethrower_Effects.ParticleSalamander1',MountNode="#Muzzleflash",bRequiresWorldZBuffer=true,PushBack=64.000000)
     DecoEffects(1)=(AnimSequence=Fire,DecoClass=Class'ParticleSystems.ParticleSalamander',Particles=ParticleSalamander'Flamethrower_Effects.ParticleSalamander4',MountNode="#Muzzleflash",bRequiresWorldZBuffer=true)
     DecoEffects(2)=(AnimSequence=AltFire,DecoClass=Class'ParticleSystems.ParticleSalamander',Particles=ParticleSalamander'FlameAltFX.ParticleSalamander0',MountNode="#Muzzleflash",bRequiresWorldZBuffer=true,PushBack=64.000000)
     DecoEffects(3)=(AnimSequence=AltFire,DecoClass=Class'ParticleSystems.ParticleSalamander',Particles=ParticleSalamander'Flamethrower_Effects.ParticleSalamander4',MountNode="#Muzzleflash",bRequiresWorldZBuffer=true)
	FirstPersonOffset=(X=-42.000000,Y=21.000000,Z=33.000000)
	bAmbientFireSound=true
	bAmbientAltFireSound=true
	bCrosshairGlows=true
	WeaponAnimationType=AT_Flamethrower
	AltShakeMag=0.000000
	AltShakeTime=0.000000
     TargetableTypes(0)='Pawn'
	CrosshairName="FT_Cross"
	RangeMinFire=30.000000
	RangeIdealFire=600.000000
	RangeMaxFire=925.000000
	RatingInsideMinFire=-20.000000
	RatingRangeMinFire=0.300000
	RatingRangeIdealFire=0.700000
	RatingRangeMaxFire=0.400000
	AIRatingFire=0.250000
	AIRatingAltFire=0.200000
	AmmoName=Class'U2Weapons.ammoInvFlamethrower'
	PickupAmmoCount=120
	AutoSwitchPriority=4
	PreferCrouchingMultiplier=2.000000
	PreferProneMultiplier=0.000000
	bOwnsCrosshair=true
	bRapidFire=true
	FireOffset=(X=42.000000,Y=21.000000,Z=-33.000000)
	ShakeMag=0.000000
	ShakeTime=0.000000
	AIRating=0.250000
	RefireRate=0.020000
	AltRefireRate=1.000000
	FireSound=Sound'U2WeaponsA.FlameThrower.FT_FireLoop'
	AltFireSound=Sound'U2WeaponsA.FlameThrower.FT_AltFire'
	CockingSound=Sound'U2WeaponsA.FlameThrower.FT_Reload'
	SelectSound=Sound'U2WeaponsA.FlameThrower.FT_Select'
	NameColor=(B=192,G=128,R=0)
	GroupOffset=2
	PickupClass=Class'U2Weapons.weaponFlamethrower'
	PlayerViewOffset=(X=0.000000,Z=0.000000)
	BobDamping=0.975000
	ThirdPersonMesh=LegendMesh'GlmWeaponsG.FT_TP'
	ItemName="Flame Thrower"
	ItemID="FT"
	IconIndex=4
	Texture=None
	Mesh=LegendMesh'GlmWeaponsG.FT_FP'
	ActorFOV=90.000000
     UseReticleOnEvents(0)="UseReticleText"
     UseReticleOnEvents(1)="UseReticleCorners"
     UseReticleOnEvents(2)="UseReticleTopBars"
     ProximityReticleOnEvents(0)="ProximityReticleCorners"
     ProximityReticleOnEvents(1)="ProximityReticleTopBars"
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: sk 3-1-2016 10:38:42.000 - Creation time: sk 3-1-2016 10:48:43.895 - Created with UnCodeX