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 |
//============================================================================= // ZEDMKIIFire //============================================================================= // Secondary fire class for the Zed Gun Mark II Weapon //============================================================================= // Killing Floor Source // Copyright (C) 2013 Tripwire Interactive LLC // - John "Ramm-Jaeger" Gibson //============================================================================= class ZEDMKIIAltFire extends KFShotgunFire; // Overridden to prevent firing from working for this mode if you don't have enough ammo simulated function bool AllowFire() { if(KFWeapon(Weapon).bIsReloading) return false; if(KFPawn(Instigator).SecondaryItem!=none) return false; if(KFPawn(Instigator).bThrowingNade) return false; if(KFWeapon(Weapon).MagAmmoRemaining < AmmoPerFire) { if( Level.TimeSeconds - LastClickTime>FireRate ) { LastClickTime = Level.TimeSeconds; } if( AIController(Instigator.Controller)!=None ) KFWeapon(Weapon).ReloadMeNow(); return false; } return super(WeaponFire).AllowFire(); } // Overridden to force just 1 projectile, while using more ammo per shot function DoFireEffect() { local Vector StartProj, StartTrace, X,Y,Z; local Rotator R, Aim; local Vector HitLocation, HitNormal; local Actor Other; local int p; local int SpawnCount; local float theta; Instigator.MakeNoise(1.0); Weapon.GetViewAxes(X,Y,Z); StartTrace = Instigator.Location + Instigator.EyePosition();// + X*Instigator.CollisionRadius; StartProj = StartTrace + X*ProjSpawnOffset.X; if ( !Weapon.WeaponCentered() && !KFWeap.bAimingRifle ) StartProj = StartProj + Weapon.Hand * Y*ProjSpawnOffset.Y + Z*ProjSpawnOffset.Z; // check if projectile would spawn through a wall and adjust start location accordingly Other = Weapon.Trace(HitLocation, HitNormal, StartProj, StartTrace, false); // Collision attachment debugging /* if( Other.IsA('ROCollisionAttachment')) { log(self$"'s trace hit "$Other.Base$" Collision attachment"); }*/ if (Other != None) { StartProj = HitLocation; } Aim = AdjustAim(StartProj, AimError); SpawnCount = ProjPerFire; switch (SpreadStyle) { case SS_Random: X = Vector(Aim); for (p = 0; p < SpawnCount; p++) { R.Yaw = Spread * (FRand()-0.5); R.Pitch = Spread * (FRand()-0.5); R.Roll = Spread * (FRand()-0.5); SpawnProjectile(StartProj, Rotator(X >> R)); } break; case SS_Line: for (p = 0; p < SpawnCount; p++) { theta = Spread*PI/32768*(p - float(SpawnCount-1)/2.0); X.X = Cos(theta); X.Y = Sin(theta); X.Z = 0.0; SpawnProjectile(StartProj, Rotator(X >> Aim)); } break; default: SpawnProjectile(StartProj, Aim); } if (Instigator != none ) { if( Instigator.Physics != PHYS_Falling ) { Instigator.AddVelocity(KickMomentum >> Instigator.GetViewRotation()); } // Really boost the momentum for low grav else if( Instigator.Physics == PHYS_Falling && Instigator.PhysicsVolume.Gravity.Z > class'PhysicsVolume'.default.Gravity.Z) { Instigator.AddVelocity((KickMomentum * LowGravKickMomentumScale) >> Instigator.GetViewRotation()); } } } defaultproperties { RecoilRate=0.100000 maxVerticalRecoilAngle=1500 maxHorizontalRecoilAngle=400 FireAimedAnim="Alt_Fire_Iron" FireSoundRef="KF_FY_ZEDV2SND.WEP_ZEDV2_Secondary_Fire_M" StereoFireSoundRef="KF_FY_ZEDV2SND.WEP_ZEDV2_Secondary_Fire_S" NoAmmoSoundRef="KF_ZEDGunSnd.KF_WEP_ZED_Dryfire" ProjPerFire=1 ProjSpawnOffset=(X=50.000000,Y=18.000000,Z=-14.500000) bWaitForRelease=True bModeExclusive=False TransientSoundVolume=2.000000 TransientSoundRadius=500.000000 FireAnim="Alt_Fire" TweenTime=0.025000 FireForce="AssaultRifleFire" FireRate=0.750000 AmmoClass=Class'KFMod.ZEDMKIIAmmo' AmmoPerFire=15 ShakeRotMag=(X=50.000000,Y=50.000000,Z=400.000000) ShakeRotRate=(X=12500.000000,Y=12500.000000,Z=12500.000000) ShakeRotTime=3.000000 ShakeOffsetMag=(X=6.000000,Y=2.000000,Z=10.000000) ShakeOffsetRate=(X=1000.000000,Y=1000.000000,Z=1000.000000) ShakeOffsetTime=2.000000 ProjectileClass=Class'KFMod.ZEDMKIISecondaryProjectile' BotRefireRate=0.250000 FlashEmitterClass=Class'KFMod.ZEDMKIIPrimaryMuzzleFlash1P' aimerror=42.000000 Spread=0.017500 } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |