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

U2Weapons.WeaponInvAssaultRifle


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
//=============================================================================
// $Workfile: WeaponInvAssaultRifle.uc $
// Created By: Jess Crable, Mark Poesch
// Created On: 1/14/00
// $Author: Mfox $
// $Date: 10/23/02 4:07p $
// $Revision: 46 $
//=============================================================================
class WeaponInvAssaultRifle extends U2Weapon;

#exec OBJ LOAD FILE=..\Sounds\U2WeaponsA.uax
#exec OBJ LOAD File=..\Meshes\GlmWeaponsG.ugx
#exec OBJ LOAD File=..\Textures\GlmWeaponsT.utx
#exec OBJ LOAD File=..\Textures\WeaponFXT.utx
#exec OBJ LOAD File=..\System\ParticleRes\AssaultFX.u

var float Angle;
var int RotationIndex;

simulated function HandleTargetDetails( Actor A, Canvas Canvas, vector ViewLoc, rotator ViewRot )
{
	if( A!=None && LevelInfo(A) == None )
	{
//			ScreenLoc = (A.Location - ViewLoc) << ViewRot;
//			Angle = ATan2( ScreenLoc.Z, -ScreenLoc.Y ) * DegreesToRadians;
		Angle = VSize(A.Location - ViewLoc) * 0.3;
	}
}

simulated function float GetCrosshairAngle90(){ return Angle + 90; }
simulated function float GetCrosshairAngle210(){ return Angle + 210; }
simulated function float GetCrosshairAngle330(){ return Angle + 330; }


function ProcessTraceHitEx( vector HitDirection, CheckResult Hit, float EffectiveDamage )
{
	//ARL compute damage vs. position of hit on collision cylinder -- kill randomness
	EffectiveDamage = 9 + Rand( 6 );
	if( FRand() < 0.2 )
	{
		HitDirection *= 2.5;
	}
	Super.ProcessTraceHitEx( HitDirection, Hit, EffectiveDamage );
}

simulated function ClientTraceImpact( CheckResult Hit )
{
	UpdateTracer(Hit);
}

simulated function UpdateTracer( CheckResult Hit )
{
	local PulseLineGenerator Tracer;
	Tracer = PulseLineGenerator(DecoEffects[1].Effect);
	if (!Tracer) return;
/*
	// Only actually draw every 5th bullet.
	if (RotationIndex==0)
		Tracer.SetDrawType(DT_Custom);
	else
		Tracer.SetDrawType(DT_None);
*/
	if (Tracer.Connections.length!=1)
		Tracer.Connections.length = 1;

	Tracer.Connections[0].StartActor = Tracer;
	Tracer.Connections[0].End = Hit.Location;
}

simulated function PlayFiring()
{
	HandleLastRound();
	RotationIndex = (RotationIndex+1) % 16;
	UpdateRotationThing();
	Super.PlayFiring();
}

simulated function PlayAltFiring()
{
	RotationIndex = (RotationIndex+8) % 16;
	UpdateRotationThing();
	Super.PlayAltFiring();
}

simulated function UpdateRotationThing()
{
	switch(RotationIndex+1)
	{
	case  1: MeshAgentSetInputCurValueEx('RotationThing','A'); break;
	case  2: MeshAgentSetInputCurValueEx('RotationThing','B'); break;
	case  3: MeshAgentSetInputCurValueEx('RotationThing','C'); break;
	case  4: MeshAgentSetInputCurValueEx('RotationThing','D'); break;
	case  5: MeshAgentSetInputCurValueEx('RotationThing','E'); break;
	case  6: MeshAgentSetInputCurValueEx('RotationThing','F'); break;
	case  7: MeshAgentSetInputCurValueEx('RotationThing','G'); break;
	case  8: MeshAgentSetInputCurValueEx('RotationThing','H'); break;
	case  9: MeshAgentSetInputCurValueEx('RotationThing','I'); break;
	case 10: MeshAgentSetInputCurValueEx('RotationThing','J'); break;
	case 11: MeshAgentSetInputCurValueEx('RotationThing','K'); break;
	case 12: MeshAgentSetInputCurValueEx('RotationThing','L'); break;
	case 13: MeshAgentSetInputCurValueEx('RotationThing','M'); break;
	case 14: MeshAgentSetInputCurValueEx('RotationThing','N'); break;
	case 15: MeshAgentSetInputCurValueEx('RotationThing','O'); break;
	case 16: MeshAgentSetInputCurValueEx('RotationThing','P'); break;
	}
}


simulated function int GetAltFireAmmoUsed() { return 5; }


// Follows, is a big nasty hack just to get viewshake to work correctly with the AR's unusual requirements.

simulated function HandleLastRound()
{
	local bool bLastRound;
	local pawn Pawn;
	local playercontroller P;

	bLastRound = U2Ammo(AmmoType)? && U2Ammo(AmmoType).ReloadRequired(1);
	if( bLastRound )
	{
		// turn off view shake.
		Pawn = Pawn(Owner);
		if( Pawn!=None )
		{
			P = PlayerController(Pawn.Controller);
			if( P!=None )
				P.ShakeView(7.0,0.2);
		}

		AmbientSound = default.AmbientSound;
	}
}

simulated state Firing
{
ignores Fire, AltFire;
	simulated event EndState()
	{
		local bool bLastRound;
		local pawn Pawn;
		local playercontroller P;

		Super.EndState();

		bLastRound = U2Ammo(AmmoType)? && U2Ammo(AmmoType).ReloadRequired(1);
		if( !bLastRound )
		{
			// turn off view shake.
			Pawn = Pawn(Owner);
			if( Pawn!=None )
			{
				P = PlayerController(Pawn.Controller);
				if( P!=None )
					P.ShakeView(7.0,0.2);
			}
		}
	}
}

defaultproperties
{
	FireTime=0.100000
	AltFireTime=1.000000
	FireLastDownTime=1.125000
	AltFireLastDownTime=1.600000
	FireLastReloadTime=2.166000
	AltFireLastReloadTime=2.800000
	ReloadTime=2.166000
	FlashSkin=Shader'WeaponFXT.CAR.AR_SKIN2FX'
	FireLastRoundSound=Sound'U2WeaponsA.AssaultRifle.AR_FireLastRound'
	AltFireLastRoundSound=Sound'U2WeaponsA.AssaultRifle.AR_AltFireLastRound'
	ReloadUnloadedSound=Sound'U2WeaponsA.AssaultRifle.AR_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'
     DecoEffects(0)=(AnimSequence=Fire,DecoClass=Class'U2Weapons.AR_LightEffect',MountNode="#Muzzleflash",MountOffset=(X=15.000000,Z=15.000000))
     DecoEffects(1)=(AnimSequence=Fire,DecoClass=Class'ParticleSystems.PulseLineGenerator',Particles=PulseLineGenerator'AssaultFX.PulseLineGenerator1',MountNode="#Muzzleflash",bRequiresWorldZBuffer=true)
	FirstPersonOffset=(Y=4.000000,Z=6.000000)
	bAmbientFireSound=true
	bCrosshairGlows=true
	WeaponAnimationType=AT_Large
	ImpactHandlerClass=Class'U2Weapons.impactAssaultRifle'
	Damage=12.000000
	TraceRange=4800.000000
	TraceSpreadFire=3.000000
	TraceSpreadAltFire=3.000000
	AltShakeMag=10.000000
	AltShakeTime=0.300000
     TargetableTypes(0)='Pawn'
	CrosshairName="AR_Cross"
	RangeMinFire=0.000000
	RangeIdealFire=2048.000000
	RangeMaxFire=4096.000000
	RangeLimitFire=32767.000000
	RatingRangeMinFire=0.800000
	RatingRangeIdealFire=0.800000
	RatingRangeMaxFire=0.200000
	RatingRangeLimitFire=0.010000
	AIRatingFire=0.800000
	RangeMinAltFire=196.000000
	RangeIdealAltFire=512.000000
	RangeMaxAltFire=2048.000000
	RangeLimitAltFire=32767.000000
	RatingRangeMinAltFire=0.900000
	RatingRangeIdealAltFire=0.900000
	RatingRangeMaxAltFire=0.100000
	RatingRangeLimitAltFire=0.010000
	AIRatingAltFire=0.700000
	AmmoName=Class'U2Weapons.ammoInvAssaultRifle'
	PickupAmmoCount=75
	AutoSwitchPriority=15
	bInstantHit=true
	PreferCrouchingMultiplier=1.500000
	PreferProneMultiplier=2.000000
	bRapidFire=true
	FireOffset=(X=40.000000,Y=12.000000,Z=-32.000000)
	AltProjectileClass=Class'U2Weapons.projectileAssaultRoundAlt'
	MyDamageType=Class'U2.DamageTypePhysicalInstant'
	ShakeMag=3.000000
	ShakeTime=1.500000
	bAltSplashDamage=true
	bRecommendAltSplashDamage=true
	AIRating=0.800000
	RefireRate=0.020000
	AltRefireRate=1.000000
	FireSound=Sound'U2WeaponsA.AssaultRifle.AR_Fire'
	AltFireSound=Sound'U2WeaponsA.AssaultRifle.AR_AltFire'
	CockingSound=Sound'U2WeaponsA.AssaultRifle.AR_Reload'
	SelectSound=Sound'U2WeaponsA.AssaultRifle.AR_Select'
	InventoryGroup=2
	GroupOffset=2
	PickupClass=Class'U2Weapons.weaponAssaultRifle'
	PlayerViewOffset=(X=0.000000,Z=0.000000)
	BobDamping=0.975000
	ThirdPersonMesh=LegendMesh'GlmWeaponsG.AR_TP'
	ItemName="Assault Rifle"
	ItemID="AR"
	IconIndex=3
	Mesh=LegendMesh'GlmWeaponsG.AR_FP'
	SoundRadius=400.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.862 - Created with UnCodeX