Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
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 |
//============================================================================= // WeaponInvLeechGun.uc // $Author: Mfox $ // $Date: 11/19/02 2:02a $ // $Revision: 34 $ //============================================================================= class WeaponInvLeechGun extends U2Weapon; #exec OBJ LOAD File=..\Meshes\GlmWeaponsG.ugx #exec OBJ LOAD File=..\System\ParticleRes\LG_FX.u var() float FertilizedChargeThreshold; var float BeginChargeTime; var int NumTicks; var int bShouldFertilize; function int ShouldFertilize(){ return bShouldFertilize; } simulated function NotifyPlaySoundSlot( string Slot ) { if( ShouldFertilize()!=0 ) { AltFireSound = sound'U2WeaponsA.LeechGun.LG_AltFireFirst'; AltFireLastRoundSound = sound'U2WeaponsA.LeechGun.LG_AltFireLastRoundFirst'; } else { AltFireSound = sound'U2WeaponsA.LeechGun.LG_AltFireSecond'; AltFireLastRoundSound = sound'U2WeaponsA.LeechGun.LG_AltFireLastRoundSecond'; } Super.NotifyPlaySoundSlot(Slot); } simulated function int GetAltFireAmmoUsed() { return 5; } function float GetProjSpeed( bool bAlt ) { if(bAlt) return AltProjectileSpeed; else return ProjectileSpeed; } // double duty primary fire support for contact and timed grenades. function bool PreSetAimingParameters( bool bAltFire, bool bInstant, float FireSpread, class<projectile> ProjClass, bool bWarnTarget, bool bTrySplash ) { if( bAltFire ) { // so NPCs fire in the direction they are facing by default if( Instigator? && Instigator.Controller? && Instigator.Controller.Pawn? && !Instigator.Controller.Pawn.bIsRealPlayer ) { if( Instigator.Controller.Pawn? ) Instigator.Controller.SetRotation( Instigator.Controller.Pawn.Rotation ); Instigator.Controller.AimRotation = Instigator.Controller.Rotation; } return true; } else { return Super.PreSetAimingParameters( bAltFire, bInstant, FireSpread, ProjClass, bWarnTarget, bTrySplash ); } } function PostSetAimingParameters( bool bAltFire, bool bInstant, float FireSpread, class<projectile> ProjClass, bool bWarnTarget, bool bTrySplash ) { if( bAltFire ) { // NOTE: call to Super.*Pre*SetAimingParameters is intentional Super.PreSetAimingParameters( bAltFire, bInstant, FireSpread, ProjClass, bWarnTarget, bTrySplash ); } } function AuthorityAltFire(){} simulated function EverywhereAltFire() { GotoState('Charging'); } simulated state Charging { ignores Fire, AltFire; simulated event BeginState() { BeginChargeTime = Level.TimeSeconds; NumTicks = 0; Enable('Tick'); } simulated event EndState() { Disable('Tick'); } simulated event Tick( float DeltaSeconds ) { NumTicks++; //Global.Tick(DeltaSeconds); if( !Pawn(Owner).PressingAltFire() ) { bShouldFertilize=0; if( Level.TimeSeconds - BeginChargeTime >= FertilizedChargeThreshold ) if( NumTicks > 1 ) // don't punish people with slow framerates by not allowing them to fire contact grenades. bShouldFertilize=1; if (Role == ROLE_Authority) Super.AuthorityAltFire(); Super.EverywhereAltFire(); } } } event PreBeginPlay() { Super.PreBeginPlay(); NotifyHideSplat(); } simulated function NotifyShowSplat() { MeshSetStaticMeshAttachmentOffset(3,vect(-120,0,0)); MeshSetStaticMeshAttachmentOffset(4,vect(0,0,0)); } simulated function NotifyHideSplat() { MeshSetStaticMeshAttachmentOffset(3,vect(0,0,0)); MeshSetStaticMeshAttachmentOffset(4,vect(-120,0,0)); } simulated function NotifyAmbientSoundStart() { AmbientSound = sound'U2WeaponsA.LeechGun.LG_Ambient'; } simulated function NotifyAmbientSoundStop() { AmbientSound = None; } defaultproperties { FertilizedChargeThreshold=0.250000 FireTime=0.428000 AltFireTime=0.722000 FireLastDownTime=2.500000 AltFireLastDownTime=2.687000 FireLastReloadTime=4.916000 AltFireLastReloadTime=5.062000 ReloadTime=2.875000 FireLastRoundSound=Sound'U2WeaponsA.LeechGun.LG_FireLastRound' ReloadUnloadedSound=Sound'U2WeaponsA.LeechGun.LG_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=1800.000000 AltProjectileSpeed=1200.000000 DecoEffects(0)=(AnimSequence=Fire,DecoClass=Class'ParticleSystems.ParticleSalamander',Particles=ParticleSalamander'LG_FX.ParticleSalamander3',MountNode="#Muzzleflash",MountRot=(Pitch=32768),bWorldFOV=true,bRequiresWorldZBuffer=true,AutoAim=true,AIAim=1800) DecoEffects(1)=(AnimSequence=AltFire,DecoClass=Class'ParticleSystems.ParticleSalamander',Particles=ParticleSalamander'LG_FX.ParticleSalamander2',MountNode="#Muzzleflash",MountRot=(Pitch=32768),bWorldFOV=true,bRequiresWorldZBuffer=true,AutoAim=true,AIAim=1200) FirstPersonOffset=(X=4.000000,Y=10.000000) bRepeatAltFire=false bCrosshairGlows=true WeaponAnimationType=AT_Large AltShakeMag=2.000000 AltShakeTime=0.170000 TargetableTypes(0)='Pawn' CrosshairName="LG_Cross" RangeMinFire=0.000000 RangeIdealFire=600.000000 RangeMaxFire=1024.000000 RangeLimitFire=2048.000000 RatingRangeMinFire=0.200000 RatingRangeIdealFire=0.400000 RatingRangeMaxFire=0.100000 RatingRangeLimitFire=0.050000 AIRatingFire=0.300000 RangeMinAltFire=0.000000 RangeIdealAltFire=600.000000 RangeMaxAltFire=1024.000000 RangeLimitAltFire=2450.000000 RatingRangeMinAltFire=0.200000 RatingRangeIdealAltFire=0.400000 RatingRangeMaxAltFire=0.100000 RatingRangeLimitAltFire=0.050000 AIRatingAltFire=0.350000 AmmoName=Class'U2Weapons.ammoInvLeechGun' PickupAmmoCount=45 AutoSwitchPriority=6 PreferCrouchingMultiplier=1.500000 PreferProneMultiplier=0.000000 FireOffset=(X=28.000000,Y=18.000000,Z=-20.000000) ShakeMag=2.000000 ShakeTime=0.170000 bWarnTarget=true bAltWarnTarget=true AIRating=0.350000 FireSound=Sound'U2WeaponsA.LeechGun.LG_Fire' CockingSound=Sound'U2WeaponsA.LeechGun.LG_Reload' SelectSound=Sound'U2WeaponsA.LeechGun.LG_Select' InventoryGroup=3 GroupOffset=3 PickupClass=Class'U2Weapons.weaponLeechGun' PlayerViewOffset=(X=40.599998,Y=14.600000,Z=-16.600000) ThirdPersonMesh=LegendMesh'GlmWeaponsG.LG_TP' ItemName="Leech Gun" ItemID="LG" IconIndex=13 Mesh=LegendMesh'GlmWeaponsG.LG_FP' SoundVolume=255 UseReticleOnEvents(0)="UseReticleText" UseReticleOnEvents(1)="UseReticleCorners" UseReticleOnEvents(2)="UseReticleTopBars" ProximityReticleOnEvents(0)="ProximityReticleCorners" ProximityReticleOnEvents(1)="ProximityReticleTopBars" } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |