Advertisement
Guest User

Untitled

a guest
Apr 24th, 2015
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 151.21 KB | None | 0 0
  1. /*******************************************************************************
  2. * KFWeapon generated by Eliot.UELib using UE Explorer.
  3. * Eliot.UELib © 2009-2013 Eliot van Uytfanghe. All rights reserved.
  4. * http://eliotvu.com
  5. *
  6. * All rights belong to their respective owners.
  7. *******************************************************************************/
  8. class KFWeapon extends Weapon
  9. hidecategories(SmartObject,Navigation,Advanced,Collision,Mobile,Movement,Object,Physics,Attachment,Debug)
  10. native
  11. nativereplication
  12. config(Game);
  13.  
  14. const DEFAULT_FIREMODE = 0;
  15. const ALTFIRE_FIREMODE = 1;
  16. const RELOAD_FIREMODE = 2;
  17. const BASH_FIREMODE = 3;
  18. const GRENADE_FIREMODE = 4;
  19. const FIREMODE_NONE = 255;
  20. const PRIMARY_AMMO = 0;
  21. const SECONDARY_AMMO = 1;
  22. const ReloadEmptyMagAnim = 'Reload_Empty';
  23. const ReloadNonEmptyMagAnim = 'Reload_Half';
  24. const ReloadEmptyMagEliteAnim = 'Reload_Empty_Elite';
  25. const ReloadNonEmptyMagEliteAnim = 'Reload_Half_Elite';
  26. const ReloadOpenAnim = 'Reload_Open';
  27. const ReloadSingleAnim = 'Reload_Insert';
  28. const ReloadCloseAnim = 'Reload_Close';
  29. const ReloadOpenEliteAnim = 'Reload_Open_Elite';
  30. const ReloadSingleEliteAnim = 'Reload_Insert_Elite';
  31. const ReloadCloseEliteAnim = 'Reload_Close_Elite';
  32. const GrenadeThrowAnim = 'Nade_Throw';
  33. const SprintStartAnim = 'Sprint_In';
  34. const SprintLoopAnim = 'Sprint_Loop';
  35. const SprintEndAnim = 'Sprint_Out';
  36. const BloodParamName = 'Scalar_Blood_Contrast';
  37. const MinBloodParamValue = 0.20f;
  38. const MaxAimAdjust_Angle = 0.1f;
  39. const MaxAimAdjust_Cos = 0.995f;
  40.  
  41. enum EInventoryGroup
  42. {
  43. IG_Primary,
  44. IG_Secondary,
  45. IG_Melee,
  46. IG_Equipment,
  47. IG_MAX
  48. };
  49.  
  50. enum EFilterTypeUI
  51. {
  52. FT_Pistol,
  53. FT_Shotgun,
  54. FT_Rifle,
  55. FT_Projectile,
  56. FT_Flame,
  57. FT_Electric,
  58. FT_Explosive,
  59. FT_Assault,
  60. FT_Melee,
  61. FT_SMG,
  62. FT_MAX
  63. };
  64.  
  65. enum EReloadStatus
  66. {
  67. RS_None,
  68. RS_OpeningBolt,
  69. RS_Reloading,
  70. RS_ClosingBolt,
  71. RS_Complete,
  72. RS_MAX
  73. };
  74.  
  75. enum EWeaponImpactType
  76. {
  77. ECIT_InstantHit,
  78. ECIT_Projectile,
  79. ECIT_HurtRadius,
  80. ECIT_Melee,
  81. ECIT_MAX
  82. };
  83.  
  84. struct native WeaponFireSndInfo
  85. {
  86. var() AkEvent DefaultCue;
  87. var() AkEvent FirstPersonCue;
  88.  
  89. structdefaultproperties
  90. {
  91. DefaultCue=none
  92. FirstPersonCue=none
  93. }
  94. };
  95.  
  96. struct native ImpactRepInfo
  97. {
  98. var Actor HitActor;
  99. var Vector HitLocation;
  100. var Vector RayDir;
  101. var name HitInfo_BoneName;
  102.  
  103. structdefaultproperties
  104. {
  105. HitActor=none
  106. HitLocation=(X=0.0,Y=0.0,Z=0.0)
  107. RayDir=(X=0.0,Y=0.0,Z=0.0)
  108. HitInfo_BoneName=None
  109. }
  110. };
  111.  
  112. var protected export editinline MeshComponent OverlayMesh;
  113. var export editinline KFSkeletalMeshComponent MySkelMesh;
  114. /** The Archetype of the Projectile to spawn */
  115. var(Weapon) array<KFProjectile> ProjectileArchetypes;
  116. var array<Texture2D> FireModeIconPaths;
  117. var byte SingleFireMode;
  118. /** Determines which group a weapon falls into in weapon select */
  119. var(Inventory) const KFWeapon.EInventoryGroup InventoryGroup;
  120. /** Determine which group a weapon will show up for the weapon type filter */
  121. var(Inventory) const KFWeapon.EFilterTypeUI FilterTypeUI;
  122. /** Inventory (In blocks) cost */
  123. var(Inventory) byte InventorySize;
  124. var byte AmmoCount[2];
  125. var KFWeapon.EReloadStatus ReloadStatus;
  126. var byte ReloadAmountLeft;
  127. var bool bUseAltFireMode;
  128. /** Target friction enabled? */
  129. var() bool bTargetFrictionEnabled;
  130. var() bool bTargetAdhesionEnabled;
  131. var bool bUsingSights;
  132. /** This weapon has sights to aim */
  133. var(IronSight) bool bHasIronSights;
  134. var bool bIronSightOnBringUp;
  135. var bool bForceHidden;
  136. var bool bZoomingIn;
  137. var bool bZoomingOut;
  138. /** Doing a "quick down" zoom */
  139. var(IronSight) bool bDoingQuickDownZoom;
  140. /** Don't use the ZoomInRotation for this zoom */
  141. var(IronSight) bool bSkipZoomInRotation;
  142. var bool bZoomInInterrupted;
  143. var bool bZoomOutInterrupted;
  144. var bool bFastZoomOut;
  145. var bool bHasScopePosition;
  146. var bool bUsingScopePosition;
  147. /** Determines whether the weapon's ironsights DOF blurs beyond the focal plane */
  148. var(DepthOfField) bool ISFarDoFEnabled;
  149. /** The weapon is using the sights to aim */
  150. var(Positioning) bool bWeaponNeedsServerPosition;
  151. /** If true, weapon position should follow camera anims played on the weapon AnimSeq */
  152. var(Positioning) bool bFollowAnimSeqCamera;
  153. /** The path that locates the image for this weapon */
  154. var(Inventory) bool bCanRefillSecondaryAmmo;
  155. var bool bGivenAtStart;
  156. /** Is this a no magazine/clip weapon e.g. the hunting shotgun? */
  157. var(Inventory) bool bNoMagazine;
  158. var(Inventory) bool bCanBeReloaded;
  159. var(Inventory) bool bReloadFromMagazine;
  160. var const bool bInfiniteSpareAmmo;
  161. var bool bInfiniteAmmo;
  162. var const bool bAllowClientAmmoTracking;
  163. var bool bPlayingCameraAnim;
  164. var bool bPlayingLoopingFireSnd;
  165. var bool bPlayingLoopingFireAnim;
  166. /** Use the animation sequence length to get equip times */
  167. var(Animations) bool bUseAnimLenEquipTime;
  168. /** If set, this weapon has unique shoot anims for the last round */
  169. var(Animations) bool bHasFireLastAnims;
  170. /** Special idle anims */
  171. var(Animations) bool bUseAdditiveMoveAnim;
  172. var bool bEnableTiltSkelControl;
  173. var transient bool bIsBoltLockedBack;
  174. /** @name Sounds */
  175. var(Sounds) bool bSuppressSounds;
  176. /** If set to true, attempting to reload will switch to best available weapon */
  177. var() bool bPendingAutoSwitchOnDryFire;
  178. var bool bPendingShow;
  179. var(Attachments) bool bHasFlashlight;
  180. var bool bIsBackupWeapon;
  181. var config bool bLogAnimation;
  182. var config bool bLogStates;
  183. var bool bPauseWithPlayersOnly;
  184. var bool bDebugRecoilPosition;
  185. var float MinFiringPutDownPct;
  186. /** How much penetration power does this fire mode have */
  187. var(Weapon) array<float> PenetrationPower;
  188. /** How scale the penetration power this fire mode loses based on the percentage of penetration power left */
  189. var(Weapon) array<InterpCurveFloat> PenetrationDamageReductionCurve;
  190. var transient float PenetrationPowerRemaining;
  191. var const transient float ZedTimeResistance;
  192. /**
  193. *How long after we toss a grenade before a zed can grab us.
  194. * Prevents us from blowing ourselves up on grenades that we
  195. * were in the middle of tossing when we got grabbed
  196. */
  197. var(Weapon) float GrenadeTossWeakZedGrabCooldown;
  198. /** Time after we are grabbed by a zed to prevent nade throwing so we don't blow ourselvs up */
  199. var(Weapon) float ZedGrabGrenadeTossCooldown;
  200. /** Min distance for friction */
  201. var() float TargetFrictionDistanceMin;
  202. /** Peak distance for friction */
  203. var() float TargetFrictionDistancePeak;
  204. /** Max distance allow for friction */
  205. var() float TargetFrictionDistanceMax;
  206. /** Interp curve that allows for piece wise functions for the TargetFrictionDistance amount at different ranges */
  207. var() InterpCurveFloat TargetFrictionDistanceCurve;
  208. /** Min/Max friction multiplier applied when target acquired */
  209. var() Vector2D TargetFrictionMultiplierRange;
  210. /** Amount of additional radius/height given to target cylinder when at peak distance */
  211. var() float TargetFrictionPeakRadiusScale;
  212. var() float TargetFrictionPeakHeightScale;
  213. /** Offset to apply to friction target location (aim for the chest, etc) */
  214. var() Vector TargetFrictionOffset;
  215. /** Boost the Target Friction by this much when zoomed in */
  216. var() float TargetFrictionZoomedBoostValue;
  217. /** Max time to attempt adhesion to the friction target */
  218. var() float TargetAdhesionTimeMax;
  219. /** Max distance to allow adhesion to still kick in */
  220. var() float TargetAdhesionDistanceMax;
  221. /** Max distance from edge of cylinder for adhesion to be valid */
  222. var() float TargetAdhesionAimDistY;
  223. var() float TargetAdhesionAimDistZ;
  224. /** Min/Max amount to scale for adhesive purposes */
  225. var() Vector2D TargetAdhesionScaleRange;
  226. /** Min amount to scale for adhesive purposes */
  227. var() float TargetAdhesionScaleAmountMin;
  228. /** Require the target to be moving for adhesion to kick in? */
  229. var() float TargetAdhesionTargetVelocityMin;
  230. /** Require the player to be moving for adhesion to kick in? */
  231. var() float TargetAdhesionPlayerVelocityMin;
  232. /** Boost the Target Adhesion by this much when zoomed in */
  233. var() float TargetAdhesionZoomedBoostValue;
  234. var Vector HiddenWeaponsOffset;
  235. /** The default FOV to use for this weapon when not in ironsights */
  236. var(Camera) float MeshFOV;
  237. /** The fov to use for this weapon when in ironsights */
  238. var(Camera) float MeshIronSightFOV;
  239. /** The fov to use for the player when in ironsights */
  240. var(Camera) float PlayerIronSightFOV;
  241. /** The fov to use while in the weapon sprinting state */
  242. var(Camera) float PlayerSprintFOV;
  243. /** The position of the weapon when in standard ironsights position */
  244. var(Positioning) Vector IronSightPosition;
  245. var float ZoomTime;
  246. /** How long the transition to iron sights should take */
  247. var(IronSight) float ZoomInTime;
  248. /** How long the transition from iron sights should take */
  249. var(IronSight) float ZoomOutTime;
  250. /** Amount to rotate to when zooming in to give the feeling of an animation playing */
  251. var(IronSight) Rotator ZoomInRotation;
  252. /** Amount to rotate to when doing a quick weapon put down */
  253. var(IronSight) Rotator QuickWeaponDownRotation;
  254. /** How long the transition to quick weapon down should take */
  255. var(IronSight) float QuickWeaponDownTime;
  256. /** How long the transition from quick weapon down should take */
  257. var(IronSight) float QuickWeaponDownFinishTime;
  258. var Rotator ZoomRotInterp;
  259. var Vector ZoomStartOffset;
  260. var float ZoomPartialTime;
  261. var Rotator ZoomRotStartOffset;
  262. var float ZoomWeaponFOVStart;
  263. var float LastZoomOutTime;
  264. /** How long to take to zoom out when we're doing a fast zoom out (i.e. when an action like reloading interupts ironsights) */
  265. var(IronSight) float FastZoomOutTime;
  266. var Vector ZoomTargetOffset;
  267. /** The position of the weapon when looking through the scope */
  268. var(Positioning) Vector ScopePosition;
  269. /** Distance of the in-focus point for foreground (i.e. weapon) depth-of-field */
  270. var(DepthOfField) float ISFocalDepth;
  271. /** Controls the amount of blur for foreground (larger values = more blur) */
  272. var(DepthOfField) float ISFocalAperture;
  273. /** Holds an offest for spawning grenades. */
  274. var(Positioning) Vector GrenadeFireOffset;
  275. /** Used to place this weapon in the inventory */
  276. var(Inventory) float GroupPriority;
  277. /** The UI image for this weapon */
  278. var(Inventory) Texture2D UITexture;
  279. /** The path that locates the image for this weapon */
  280. var(Inventory) Texture2D SecondaryAmmoTexture;
  281. var float EquipAbortTime;
  282. /** Size of the active weapon magazine */
  283. var(Inventory) int MagazineCapacity[2];
  284. var int SpareAmmoCount[2];
  285. /** Maximum amount of amount that can be carried for this gun */
  286. var(Inventory) int MaxSpareAmmo[2];
  287. /** Number of magazines to start with */
  288. var(Inventory) int InitialSpareMags[2];
  289. var const float ReloadBlendOutTime;
  290. var array<CameraAnim> FireCameraAnim;
  291. /** How much to scale the FireCameraAnim when in ironsights */
  292. var(Camera) float ShakeScaleSighted;
  293. /** How much to scale the FireCameraAnim by default (Hipped/Shouldered) */
  294. var(Camera) float ShakeScaleStandard;
  295. var array<name> EffectSockets;
  296. var ForceFeedbackWaveform WeaponFireWaveForm;
  297. /** This is the camera shake that we play when we hit a melee attack */
  298. var(Camera) const CameraShake MeleeImpactCamShake;
  299. var KFAnimSeq_Tween WeaponAnimSeqNode;
  300. var AnimNodeAdditiveBlending IdleBobBlendNode;
  301. /** Loop settings per firemode */
  302. var(Animations) array<bool> bLoopingFireAnim;
  303. var(Sounds) array<bool> bLoopingFireSnd;
  304. /** How much tweening to use on fire animations */
  305. var(Animations) float FireTweenTime;
  306. /** Animations to play when the weapon is fired */
  307. var(Animations) const editconst name FireAnim;
  308. /** Animation to play when the weapon is fired and bLoopingFireAnim is true */
  309. var(Animations) const editconst name FireLoopAnim;
  310. /** Animation to play when the last shot if fired */
  311. var(Animations) const editconst name FireLastAnim;
  312. /** Animation to play when the weapon is Put Down */
  313. var(Animations) const editconst name PutDownAnim;
  314. /** Animation to play when the weapon is Equipped */
  315. var(Animations) const editconst name EquipAnim;
  316. /** Animation to play when the weapon is idle */
  317. var(Animations) const editconst array<editconst name> IdleAnims;
  318. var(Animations) const editconst array<editconst name> IdleFidgetAnims;
  319. var transient float LastIdleFidgetAnimTime;
  320. /** Animation to play when the weapon is fired */
  321. var(Animations) const editconst array<editconst name> FireSightedAnims;
  322. /** Animation to play when the weapon is fired and bLoopingFireAnim is true */
  323. var(Animations) const editconst name FireLoopSightedAnim;
  324. /** Animation to play when the last shot if fired */
  325. var(Animations) const editconst name FireLastSightedAnim;
  326. /** Animation to play when the weapon is Put Down */
  327. var(Animations) const editconst name PutDownSightedAnim;
  328. /** Animation to play when idling */
  329. var(Animations) editconst array<editconst name> IdleSightedAnims;
  330. /** Animation to play for ironsight zooming if needed */
  331. var(Animations) const editconst name ISZoomInAnim;
  332. var(Animations) const editconst name ISZoomOutAnim;
  333. /** Animation to play at the end of a looping fire anim */
  334. var(Animations) const editconst name FireLoopStartAnim;
  335. /** Animation to play at the end of a looping fire anim */
  336. var(Animations) const editconst name FireLoopStartSightedAnim;
  337. /** Animation to play at the end of a looping fire anim */
  338. var(Animations) const editconst name FireLoopEndAnim;
  339. /** Animation to play at the end of a looping fire anim */
  340. var(Animations) const editconst name FireLoopEndSightedAnim;
  341. /** Animation to play when the weapon is fired */
  342. var(Animations) const editconst name FireScopedAnim;
  343. /** Animation to play when the weapon is fired and bLoopingFireAnim is true */
  344. var(Animations) const editconst name FireLoopScopedAnim;
  345. /** Animation to play when the last shot if fired */
  346. var(Animations) const editconst name FireLastScopedAnim;
  347. /** Animation to play when performing a manual bolting */
  348. var(Animations) const editconst name ManualBoltScopedAnim;
  349. var array<name> MeleeAttackAnims;
  350. /** Camera anim played when sprinting */
  351. var(Camera) CameraAnim SprintCameraAnim;
  352. var transient CameraAnimInst SprintCameraAnimInst;
  353. var transient float SprintAnimRate;
  354. /** Sound to play when the weapon is fired */
  355. var(Sounds) array<WeaponFireSndInfo> WeaponFireSnd;
  356. /** sound to play when the weapon stops fired. Used for high ROF weapons that have a looping fire sound */
  357. var(Sounds) array<WeaponFireSndInfo> WeaponFireLoopEndSnd;
  358. /** sound to play when the weapon is dry fired */
  359. var(Sounds) array<AkBaseSoundObject> WeaponDryFireSnd;
  360. /** How much to damp view bob */
  361. var(Motion) float BobDamping;
  362. /** How much to damp jump and land bob */
  363. var(Motion) float JumpDamping;
  364. /** Offset from view center */
  365. var(Positioning) Vector PlayerViewOffset;
  366. var MaterialInstanceConstant WeaponMIC;
  367. var float BloodParamValue;
  368. var Vector WeaponLag;
  369. var float LagHorizontal;
  370. var float LagVertical;
  371. var float LagVelocityHorizontal;
  372. var float LagVelocityVertical;
  373. /** Weapon Lag calculations for when the pawn's accelleration changes, or the pawn turns. Affects spring LagTensionHorizontal and dampening. */
  374. var(Motion) float LagTensionHorizontal;
  375. var(Motion) float LagVerticalTension;
  376. /** Weapon LagResistanceHorizontal/Vertical represents how much the gun does not want to move at all, affects dampening. */
  377. var(Motion) float LagResistanceHorizontal;
  378. var(Motion) float LagResistanceVertical;
  379. /** the maximum offset/lag that the weapon should lag when moving around */
  380. var(Motion) float LagLimit;
  381. /** A constant that converts yaw velocity to linear velocity to be used in calculating weapon-lag */
  382. var(Motion) float LagYawCoefficient;
  383. /** Weapon Lag State Properties Dynamic Lag tension modifiers. Effectively, these Strength values are multiplied into the tension based on the pawn's state. */
  384. var(Motion) float LagStrengthIronSights;
  385. var(Motion) float LagStrengthCrouch;
  386. var(Motion) float LagStrengthWalk;
  387. var(Motion) float LagStrengthJog;
  388. var(Motion) float LagStrengthSprint;
  389. var float StrafeLag;
  390. var float StrafeLagVelocity;
  391. /** The maximum horizontal offset from center */
  392. var(Motion) float StrafeLagLimit;
  393. /** Rate at which momentum changes should affect Strafe lagging */
  394. var(Motion) float StrafeLagRate;
  395. /** Rate at which weapon should return to normal after straffing. */
  396. var(Motion) float StrafeLagReturnRate;
  397. var int AimYawSpeed;
  398. var int AimPitchSpeed;
  399. /** The class of the third person attachment to spawn */
  400. var(Attachments) KFWeaponAttachment AttachmentArchetype;
  401. /** Object within weapon that manages melee attacks */
  402. var(Weapon) export editinline KFMeleeHelperWeapon MeleeAttackHelper;
  403. var KFMuzzleFlash MuzzleFlash;
  404. /** A reference to the muzzle flash template */
  405. var(Attachments) const KFMuzzleFlash MuzzleFlashTemplate;
  406. var transient KFFlashlightAttachment FlashLight;
  407. /** A reference to the muzzle flash template */
  408. var(Attachments) const KFFlashlightAttachment FlashLightTemplate;
  409. var float ProjectileSpawnOffset;
  410. /** Amount to scale spread when moving and shooting. Set this to something greater than 1.0 if you want to have added spread while moving. KF1 did not have this */
  411. var(Weapon) float MovingSpreadMod;
  412. /** Amount to scale spread when using ironsights */
  413. var(Weapon) float IronSightsSpreadMod;
  414. /** Amount to scale spread when Crouched */
  415. var(Weapon) float CrouchSpreadMod;
  416. /** max vertical units a weapon muzzle will climb from recoil */
  417. var(Recoil) int maxRecoilPitch;
  418. /** max vertical units a weapon muzzle will climb from recoil */
  419. var(Recoil) int minRecoilPitch;
  420. /** max horizontal units a weapon muzzle will move from recoil */
  421. var(Recoil) int maxRecoilYaw;
  422. /** min horizontal units a weapon muzzle will move from recoil */
  423. var(Recoil) int minRecoilYaw;
  424. /** Time in seconds each recoil should take to be applied. Must be less than the fire rate or the full recoil wont be applied */
  425. var(Recoil) float RecoilRate;
  426. /** What percentage of the RecoilSpeed it will take to blend recoil out */
  427. var(Recoil) float RecoilBlendOutRatio;
  428. /** What percentage of recoil to apply to the view rotation when firing */
  429. var(Recoil) float RecoilViewRotationScale;
  430. /** Scales how much effect the players rotation input (from mouse/gamepad) has on reducing the total recoil (the first person weapon model's recoil) */
  431. var(Recoil) float RecoilCompensationScale;
  432. /** At what percentage the weapon is recoiled torwards the Max or Min Pitch limit to start blending to full view rotation recoil */
  433. var(Recoil) float FullRecoilPitchPct;
  434. /** At what percentage the weapon is recoiled torwards the Max or Min Yaw limit to start blending to full view rotation recoil */
  435. var(Recoil) float FullRecoilYawPct;
  436. /** Maximum yaw rotation of the weapon from recoil before the player's view moves */
  437. var(Recoil) int RecoilMaxYawLimit;
  438. /** Minimum yaw rotation of the weapon from recoil before the player's view moves */
  439. var(Recoil) int RecoilMinYawLimit;
  440. /** Maximum pitch rotation of the weapon from recoil before the player's view moves */
  441. var(Recoil) int RecoilMaxPitchLimit;
  442. /** Minimum pitch rotation of the weapon from recoil before the player's view moves */
  443. var(Recoil) int RecoilMinPitchLimit;
  444. /** Maximum yaw rotation of the weapon from recoil before the player's view moves when using Iron sights */
  445. var(Recoil) int RecoilISMaxYawLimit;
  446. /** Minimum yaw rotation of the weapon from recoil before the player's view moves when using Iron sights */
  447. var(Recoil) int RecoilISMinYawLimit;
  448. /** Maximum pitch rotation of the weapon from recoil before the player's view moves when using Iron sights */
  449. var(Recoil) int RecoilISMaxPitchLimit;
  450. /** Minimum pitch rotation of the weapon from recoil before the player's view moves when using Iron sights */
  451. var(Recoil) int RecoilISMinPitchLimit;
  452. var Rotator RecoilRotator;
  453. var Rotator TotalRecoilRotator;
  454. var float RecoilTimeLeft;
  455. var float RecoilSpeed;
  456. var int RecoilYawBlendOutRate;
  457. var int RecoilPitchBlendOutRate;
  458. var float RecoilPitchPercentage;
  459. var float RecoilYawPercentage;
  460. var Rotator SuppressRecoilRotator;
  461. var float SuppressRecoilTimeLeft;
  462. /** The amount of time it will take to process this suppression recoil */
  463. var(Recoil) float SuppressRecoilSpeed;
  464. /** The percentage of the suppression recoil to apply to the player's view */
  465. var(Recoil) float SuppressRecoilViewRotationScale;
  466. /** Recoil modifier for when the player is holding the weapon in the hipped position */
  467. var(Recoil) float HippedRecoilModifier;
  468. /** Recoil modifier for when the player is jogging and shooting */
  469. var(Recoil) float JoggingRecoilModifier;
  470. /** Recoil modifier for when the player is walking and shooting */
  471. var(Recoil) float WalkingRecoilModifier;
  472. /** Recoil modifier for falling player stance */
  473. var(Recoil) float FallingRecoilModifier;
  474. /** Recoil modifier for crouched */
  475. var(Recoil) float StanceCrouchedRecoilModifier;
  476. var float LastRecoilModifier;
  477. /**
  478. *Used to compensate for weapons that have an ironsight mesh FOV that is different
  479. * Than the player's world FOV. When these mismatch, it causes the recoil
  480. * rotation to mismatch as well. Use this value to get them back in sync.
  481. */
  482. var(Recoil) float IronSightMeshFOVCompensationScale;
  483. var(Weapon) class<KFPerk> AssociatedPerkClass;
  484.  
  485. replication
  486. {
  487. // Pos:0x000
  488. if(bNetDirty && bNetInitial || !bAllowClientAmmoTracking)
  489. AmmoCount
  490.  
  491. // Pos:0x02A
  492. if(bNetDirty)
  493. SpareAmmoCount, bGivenAtStart
  494.  
  495. // Pos:0x034
  496. if(bNetDirty && bNetInitial)
  497. MagazineCapacity, MaxSpareAmmo
  498. }
  499.  
  500. // Export UKFWeapon::execEnsureWeaponOverlayComponentLast(FFrame&, void* const)
  501. native function EnsureWeaponOverlayComponentLast();
  502.  
  503. // Export UKFWeapon::execWeaponProcessViewRotation(FFrame&, void* const)
  504. native function WeaponProcessViewRotation(PlayerController PC, float DeltaTime, out Rotator DeltaRot);
  505.  
  506. // Export UKFWeapon::execGetPerk(FFrame&, void* const)
  507. native function KFPerk GetPerk();
  508.  
  509. // Export UKFWeapon::execSetZedTimeResist(FFrame&, void* const)
  510. native function SetZedTimeResist(float ResistPct);
  511.  
  512. // Export UKFWeapon::execSetZedTimeResistByTime(FFrame&, void* const)
  513. native function SetZedTimeResistByTime(float DesiredTimeDilation, optional float ZedTimeDilation)
  514. {
  515. ZedTimeDilation = 0.20;
  516. }
  517.  
  518. // Export UKFWeapon::execSetZedTimeResistBySpeed(FFrame&, void* const)
  519. native function SetZedTimeResistBySpeed(float SpeedMultiplier, optional float ZedTimeDilation)
  520. {
  521. ZedTimeDilation = 0.20;
  522. }
  523.  
  524. // Export UKFWeapon::execClearZedTimeResist(FFrame&, void* const)
  525. native function ClearZedTimeResist();
  526.  
  527. simulated event PreBeginPlay()
  528. {
  529. super(Actor).PreBeginPlay();
  530. MySkelMesh = KFSkeletalMeshComponent(Mesh);
  531. // End:0x68
  532. if(MySkelMesh == none)
  533. {
  534. WarnInternal("A Invalid KFSkeletalMeshComponent(Mesh) cast!!!");
  535. }
  536. WeaponAnimSeqNode = KFAnimSeq_Tween(GetWeaponAnimNodeSeq());
  537. InitializeAmmo();
  538. InitializeEquipTime();
  539. // End:0x117
  540. if((RecoilRate > float(0)) && RecoilBlendOutRatio > float(0))
  541. {
  542. RecoilYawBlendOutRate = int((float(maxRecoilYaw) / RecoilRate) * RecoilBlendOutRatio);
  543. RecoilPitchBlendOutRate = int((float(maxRecoilPitch) / RecoilRate) * RecoilBlendOutRatio);
  544. }
  545. // End:0x12E
  546. if(bHasFlashlight)
  547. {
  548. AttachFlashlight();
  549. }
  550. //return;
  551. }
  552.  
  553. simulated event PostInitAnimTree(SkeletalMeshComponent SkelComp)
  554. {
  555. WeaponAnimSeqNode = KFAnimSeq_Tween(SkelComp.FindAnimNode('WeaponSeq'));
  556. // End:0x67
  557. if(WeaponAnimSeqNode == none)
  558. {
  559. WeaponAnimSeqNode = KFAnimSeq_Tween(GetWeaponAnimNodeSeq());
  560. }
  561. IdleBobBlendNode = AnimNodeAdditiveBlending(SkelComp.FindAnimNode('IdleBobAdditiveBlend'));
  562. ToggleAdditiveBobAnim(false, 0.0);
  563. //return;
  564. }
  565.  
  566. simulated function InitializeEquipTime()
  567. {
  568. EquipTime = ((EquipTime > float(0)) ? EquipTime : 0.010);
  569. PutDownTime = ((PutDownTime > float(0)) ? PutDownTime : 0.010);
  570. // End:0xC7
  571. if(bUseAnimLenEquipTime)
  572. {
  573. EquipTime = MySkelMesh.GetAnimInterruptTime(EquipAnim);
  574. PutDownTime = MySkelMesh.GetAnimLength(PutDownAnim);
  575. }
  576. //return;
  577. }
  578.  
  579. simulated function InitFOV(float SizeX, float SizeY, float DefaultPlayerFOV)
  580. {
  581. MeshFOV = class'KFPlayerController'.static.CalcFOVForAspectRatio(default.MeshFOV, SizeX, SizeY);
  582. MeshIronSightFOV = class'KFPlayerController'.static.CalcFOVForAspectRatio(default.MeshIronSightFOV, SizeX, SizeY);
  583. PlayerIronSightFOV = class'KFPlayerController'.static.CalcFOVForAspectRatio(default.PlayerIronSightFOV, SizeX, SizeY);
  584. PlayerSprintFOV = class'KFPlayerController'.static.CalcFOVForAspectRatio(default.PlayerSprintFOV, SizeX, SizeY);
  585. // End:0x13A
  586. if(DefaultPlayerFOV > PlayerSprintFOV)
  587. {
  588. PlayerSprintFOV = DefaultPlayerFOV;
  589. }
  590. // End:0x15D
  591. if(bUsingSights)
  592. {
  593. SetFOV(MeshIronSightFOV);
  594. }
  595. // End:0x170
  596. else
  597. {
  598. SetFOV(MeshFOV);
  599. }
  600. // End:0x1C4
  601. if(bLogAnimation)
  602. {
  603. LogInternal((("PlayerIronSightFOV = " $ string(PlayerIronSightFOV)) $ " default POV = ") $ string(default.PlayerIronSightFOV));
  604. }
  605. // End:0x20F
  606. if(bLogAnimation)
  607. {
  608. LogInternal((("SprintFOV = " $ string(PlayerSprintFOV)) $ " default POV = ") $ string(default.PlayerSprintFOV));
  609. }
  610. //return;
  611. }
  612.  
  613. simulated event Destroyed()
  614. {
  615. // End:0x63
  616. if(((Instigator != none) && Instigator.IsHumanControlled()) && Instigator.IsLocallyControlled())
  617. {
  618. PreloadTextures(false);
  619. }
  620. super.Destroyed();
  621. //return;
  622. }
  623.  
  624. simulated function PreloadTextures(bool bForcePreload)
  625. {
  626. // End:0x5C
  627. if(MySkelMesh != none)
  628. {
  629. MySkelMesh.PreloadTextures(bForcePreload, WorldInfo.TimeSeconds + float(2));
  630. }
  631. //return;
  632. }
  633.  
  634. function GivenTo(Pawn thisPawn, optional bool bDoNotActivate)
  635. {
  636. super(Inventory).GivenTo(thisPawn, bDoNotActivate);
  637. KFInventoryManager(InvManager).CurrentCarryBlocks += InventorySize;
  638. KFPawn(Instigator).NotifyInventoryWeightChanged();
  639. //return;
  640. }
  641.  
  642. function ItemRemovedFromInvManager()
  643. {
  644. super.ItemRemovedFromInvManager();
  645. KFInventoryManager(InvManager).CurrentCarryBlocks -= InventorySize;
  646. KFPawn(Instigator).NotifyInventoryWeightChanged();
  647. //return;
  648. }
  649.  
  650. reliable client simulated function ClientWeaponSet(bool bOptionalSet, optional bool bDoNotActivate)
  651. {
  652. local PlayerController PC;
  653.  
  654. // End:0x119
  655. if(Instigator != none)
  656. {
  657. PC = PlayerController(Instigator.Controller);
  658. // End:0x119
  659. if((Instigator.Controller != none) && PC.myHUD != none)
  660. {
  661. InitFOV(PC.myHUD.SizeX, PC.myHUD.SizeY, PC.DefaultFOV);
  662. }
  663. }
  664. super.ClientWeaponSet(bOptionalSet, bDoNotActivate);
  665. //return;
  666. }
  667.  
  668. simulated function AttachWeaponTo(SkeletalMeshComponent MeshCpnt, optional name SocketName)
  669. {
  670. local KFPawn KFP;
  671.  
  672. KFP = KFPawn(Instigator);
  673. // End:0xE1
  674. if((KFP != none) && KFP.ArmsMesh != none)
  675. {
  676. KFP.ArmsMesh.SetParentAnimComponent(MySkelMesh);
  677. KFP.ArmsMesh.SetFOV(MySkelMesh.FOV);
  678. }
  679. // End:0x261
  680. if(Instigator.IsFirstPerson())
  681. {
  682. // End:0x149
  683. if(KFP.AllowFirstPersonPreshadows())
  684. {
  685. Mesh.bAllowPerObjectShadows = true;
  686. }
  687. // End:0x16A
  688. else
  689. {
  690. Mesh.bAllowPerObjectShadows = false;
  691. }
  692. AttachComponent(Mesh);
  693. EnsureWeaponOverlayComponentLast();
  694. SetHidden(true);
  695. bPendingShow = true;
  696. // End:0x25E
  697. if(KFP != none)
  698. {
  699. SetMeshLightingChannels(KFP.PawnLightingChannel);
  700. // End:0x25E
  701. if(KFP.ArmsMesh != none)
  702. {
  703. Mesh.SetShadowParent(KFP.ArmsMesh);
  704. AttachComponent(KFP.ArmsMesh);
  705. }
  706. }
  707. }
  708. // End:0x370
  709. else
  710. {
  711. // End:0x321
  712. if(bWeaponNeedsServerPosition && (WorldInfo.NetMode == NM_DedicatedServer) || (WorldInfo.NetMode == NM_ListenServer) && !Instigator.IsLocallyControlled())
  713. {
  714. AttachComponent(Mesh);
  715. EnsureWeaponOverlayComponentLast();
  716. SetHidden(true);
  717. bPendingShow = true;
  718. }
  719. // End:0x370
  720. else
  721. {
  722. SetHidden(true);
  723. // End:0x370
  724. if(KFP != none)
  725. {
  726. KFP.ArmsMesh.SetHidden(true);
  727. }
  728. }
  729. }
  730. // End:0x406
  731. if((Role == ROLE_Authority) && KFP != none)
  732. {
  733. KFP.WeaponAttachmentTemplate = AttachmentArchetype;
  734. // End:0x406
  735. if(WorldInfo.NetMode != NM_DedicatedServer)
  736. {
  737. KFP.WeaponAttachmentChanged();
  738. }
  739. }
  740. //return;
  741. }
  742.  
  743. simulated function DetachWeapon()
  744. {
  745. local KFPawn KFP;
  746.  
  747. DetachComponent(Mesh);
  748. // End:0x35
  749. if(OverlayMesh != none)
  750. {
  751. DetachComponent(OverlayMesh);
  752. }
  753. KFP = KFPawn(Instigator);
  754. // End:0x10B
  755. if((Role == ROLE_Authority) && KFP != none)
  756. {
  757. // End:0x10B
  758. if(KFP.WeaponAttachmentTemplate == AttachmentArchetype)
  759. {
  760. KFP.WeaponAttachmentTemplate = none;
  761. // End:0x10B
  762. if(WorldInfo.NetMode != NM_DedicatedServer)
  763. {
  764. KFP.WeaponAttachmentChanged();
  765. }
  766. }
  767. }
  768. // End:0x168
  769. if((KFP != none) && KFP.ArmsMesh != none)
  770. {
  771. DetachComponent(KFP.ArmsMesh);
  772. }
  773. SetBase(none);
  774. SetHidden(true);
  775. DetachMuzzleFlash();
  776. //return;
  777. }
  778.  
  779. simulated function DetachMuzzleFlash()
  780. {
  781. // End:0x53
  782. if((MySkelMesh != none) && MuzzleFlash != none)
  783. {
  784. MuzzleFlash.DetachMuzzleFlash(MySkelMesh);
  785. MuzzleFlash = none;
  786. }
  787. //return;
  788. }
  789.  
  790. simulated function CreateOverlayMesh()
  791. {
  792. //return;
  793. }
  794.  
  795. simulated function AttachFlashlight()
  796. {
  797. // End:0x78
  798. if(((MySkelMesh != none) && FlashLight == none) && bHasFlashlight)
  799. {
  800. FlashLight = new (self) class'KFFlashlightAttachment' (FlashLightTemplate);
  801. FlashLight.AttachFlashlight(MySkelMesh);
  802. }
  803. //return;
  804. }
  805.  
  806. function DropFrom(Vector StartLocation, Vector StartVelocity)
  807. {
  808. local DroppedPickup P;
  809.  
  810. StartLocation.Z += (Instigator.BaseEyeHeight / float(2));
  811. // End:0x53
  812. if(!CanThrow())
  813. {
  814. return;
  815. }
  816. // End:0x78
  817. if((DroppedPickupClass == none) || DroppedPickupMesh == none)
  818. {
  819. Destroy();
  820. return;
  821. }
  822. P = Spawn(DroppedPickupClass, StartLocation, true);
  823. // End:0xFF
  824. if(P == none)
  825. {
  826. PlayerController(Instigator.Controller).ReceiveLocalizedMessage(class'KFLocalMessage_Game', 15);
  827. return;
  828. }
  829. // End:0x2B1
  830. if((Instigator != none) && Instigator.InvManager != none)
  831. {
  832. Instigator.InvManager.RemoveFromInventory(self);
  833. // End:0x2B1
  834. if(Instigator.IsAliveAndWell() && !Instigator.InvManager.bPendingDelete)
  835. {
  836. // End:0x2B1
  837. if(((Role == ROLE_Authority) && KFGameInfo(WorldInfo.Game) != none) && KFGameInfo(WorldInfo.Game).DialogManager != none)
  838. {
  839. KFGameInfo(WorldInfo.Game).DialogManager.PlayDropWeaponDialog(KFPawn(Instigator));
  840. }
  841. }
  842. }
  843. P.SetPhysics(2);
  844. P.Inventory = self;
  845. P.InventoryClass = Class;
  846. P.Velocity = StartVelocity;
  847. P.Instigator = Instigator;
  848. P.SetPickupMesh(DroppedPickupMesh);
  849. P.SetPickupParticles(DroppedPickupParticles);
  850. Instigator = none;
  851. GotoState('None');
  852. AIController = none;
  853. //return;
  854. }
  855.  
  856. function bool DenyPickupQuery(class<Inventory> ItemClass, Actor Pickup)
  857. {
  858. // End:0x78
  859. if(ItemClass == Class)
  860. {
  861. // End:0x5F
  862. if(CanRefillSecondaryAmmo())
  863. {
  864. return (SpareAmmoCount[0] >= MaxSpareAmmo[0]) && AmmoCount[1] >= MagazineCapacity[1];
  865. }
  866. // End:0x78
  867. else
  868. {
  869. return SpareAmmoCount[0] >= MaxSpareAmmo[0];
  870. }
  871. }
  872. return false;
  873. //return ReturnValue;
  874. }
  875.  
  876. static simulated function bool IsInventoryWeapon()
  877. {
  878. return default.InventoryGroup == 3;
  879. //return ReturnValue;
  880. }
  881.  
  882. static simulated function bool IsMeleeWeapon()
  883. {
  884. return default.bMeleeWeapon;
  885. //return ReturnValue;
  886. }
  887.  
  888. simulated function float GetWeaponRating()
  889. {
  890. // End:0x41
  891. if(!Instigator.IsHumanControlled() || !HasAnyAmmo())
  892. {
  893. return super.GetWeaponRating();
  894. }
  895. return GroupPriority;
  896. //return ReturnValue;
  897. }
  898.  
  899. simulated event SetFOV(float NewFOV)
  900. {
  901. local KFPawn KFP;
  902.  
  903. // End:0x37
  904. if(MySkelMesh != none)
  905. {
  906. MySkelMesh.super(KFWeapon).SetFOV(NewFOV);
  907. }
  908. // End:0x6E
  909. if(MuzzleFlash != none)
  910. {
  911. MuzzleFlash.SetFOV(NewFOV);
  912. }
  913. KFP = KFPawn(Instigator);
  914. // End:0x13D
  915. if((KFP != none) && KFP.ArmsMesh.ParentAnimComponent == MySkelMesh)
  916. {
  917. // End:0x13D
  918. if(KFP.ArmsMesh != none)
  919. {
  920. KFP.ArmsMesh.super(KFWeapon).SetFOV(NewFOV);
  921. }
  922. }
  923. //return;
  924. }
  925.  
  926. simulated function SetIronSights(bool bNewIronSights)
  927. {
  928. // End:0x1B
  929. if(bUsingSights == bNewIronSights)
  930. {
  931. return;
  932. }
  933. // End:0x41
  934. if(!Instigator.IsLocallyControlled())
  935. {
  936. return;
  937. }
  938. // End:0x5D
  939. if(bUsingSights)
  940. {
  941. PerformZoom(false);
  942. }
  943. // End:0x76
  944. else
  945. {
  946. // End:0x76
  947. if(AllowIronSights())
  948. {
  949. PerformZoom(true);
  950. }
  951. }
  952. //return;
  953. }
  954.  
  955. simulated function bool AllowIronSights()
  956. {
  957. // End:0x11
  958. if(!bHasIronSights)
  959. {
  960. return false;
  961. }
  962. return true;
  963. //return ReturnValue;
  964. }
  965.  
  966. simulated function EnableIronSightsDoF(bool bEnableDOF)
  967. {
  968. local KFPlayerController PC;
  969.  
  970. // End:0x7A
  971. if(Instigator != none)
  972. {
  973. PC = KFPlayerController(Instigator.Controller);
  974. // End:0x7A
  975. if(PC != none)
  976. {
  977. PC.EnableDepthOfField(bEnableDOF);
  978. }
  979. }
  980. //return;
  981. }
  982.  
  983. simulated function EnablePlayerZoom(bool bEnableZoom)
  984. {
  985. local KFPlayerController PC;
  986.  
  987. // End:0xF5
  988. if(Instigator != none)
  989. {
  990. PC = KFPlayerController(Instigator.Controller);
  991. // End:0xF5
  992. if(PC != none)
  993. {
  994. // End:0xAF
  995. if(bEnableZoom)
  996. {
  997. PC.StartAutoTargeting();
  998. PC.HandleTransitionFOV(PlayerIronSightFOV, ZoomTime);
  999. }
  1000. // End:0xF5
  1001. else
  1002. {
  1003. PC.HandleTransitionFOV(PC.DefaultFOV, ZoomTime);
  1004. }
  1005. }
  1006. }
  1007. //return;
  1008. }
  1009.  
  1010. simulated function PerformZoom(bool bZoomStatus, optional bool bAnimateTransition)
  1011. {
  1012. bAnimateTransition = true;
  1013. // End:0x85
  1014. if(bZoomStatus)
  1015. {
  1016. // End:0x3D
  1017. if(Instigator.Physics == 2)
  1018. {
  1019. return;
  1020. }
  1021. ZoomIn(bAnimateTransition, default.ZoomInTime);
  1022. // End:0x82
  1023. if(Role < ROLE_Authority)
  1024. {
  1025. ServerZoomIn(bAnimateTransition);
  1026. }
  1027. }
  1028. // End:0xCA
  1029. else
  1030. {
  1031. ZoomOut(bAnimateTransition, default.ZoomOutTime);
  1032. // End:0xCA
  1033. if(Role < ROLE_Authority)
  1034. {
  1035. ServerZoomOut(bAnimateTransition);
  1036. }
  1037. }
  1038. //return;
  1039. }
  1040.  
  1041. simulated function ZoomIn(bool bAnimateTransition, float ZoomTimeToGo)
  1042. {
  1043. // End:0x163
  1044. if(bAnimateTransition)
  1045. {
  1046. ZoomInTime = ZoomTimeToGo;
  1047. // End:0x9F
  1048. if(bZoomingOut)
  1049. {
  1050. bZoomingOut = false;
  1051. bZoomOutInterrupted = true;
  1052. ZoomTime = ZoomInTime - ZoomTime;
  1053. ZoomPartialTime = ZoomTime;
  1054. ZoomStartOffset = PlayerViewOffset;
  1055. ZoomRotStartOffset = ZoomRotInterp;
  1056. }
  1057. // End:0xC5
  1058. else
  1059. {
  1060. ZoomTime = ZoomInTime;
  1061. ZoomStartOffset = PlayerViewOffset;
  1062. }
  1063. // End:0xF7
  1064. if(bHasScopePosition && bUsingScopePosition)
  1065. {
  1066. ZoomTargetOffset = ScopePosition;
  1067. }
  1068. // End:0x10A
  1069. else
  1070. {
  1071. ZoomTargetOffset = IronSightPosition;
  1072. }
  1073. // End:0x144
  1074. if(MySkelMesh != none)
  1075. {
  1076. ZoomWeaponFOVStart = MySkelMesh.FOV;
  1077. }
  1078. // End:0x157
  1079. else
  1080. {
  1081. ZoomWeaponFOVStart = MeshFOV;
  1082. }
  1083. bZoomingIn = true;
  1084. }
  1085. // End:0x1B3
  1086. if((WorldInfo.NetMode != NM_DedicatedServer) && Instigator != none)
  1087. {
  1088. EnablePlayerZoom(true);
  1089. EnableIronSightsDoF(true);
  1090. }
  1091. bUsingSights = true;
  1092. // End:0x2AA
  1093. if(((Role == ROLE_Authority) && KFGameInfo(WorldInfo.Game) != none) && KFGameInfo(WorldInfo.Game).DialogManager != none)
  1094. {
  1095. KFGameInfo(WorldInfo.Game).DialogManager.PlayIronsightsDialog(KFPawn(Instigator));
  1096. }
  1097. //return;
  1098. }
  1099.  
  1100. private reliable server final function ServerZoomIn(bool bAnimateTransition)
  1101. {
  1102. ZoomIn(bAnimateTransition, default.ZoomInTime);
  1103. //return;
  1104. }
  1105.  
  1106. simulated function ZoomOut(bool bAnimateTransition, float ZoomTimeToGo)
  1107. {
  1108. // End:0xD4
  1109. if(bAnimateTransition)
  1110. {
  1111. ZoomOutTime = ZoomTimeToGo;
  1112. // End:0x9F
  1113. if(bZoomingIn)
  1114. {
  1115. bZoomingIn = false;
  1116. bZoomInInterrupted = true;
  1117. ZoomTime = ZoomOutTime - ZoomTime;
  1118. ZoomPartialTime = ZoomTime;
  1119. ZoomStartOffset = PlayerViewOffset;
  1120. ZoomRotStartOffset = ZoomRotInterp;
  1121. }
  1122. // End:0xC5
  1123. else
  1124. {
  1125. ZoomTime = ZoomOutTime;
  1126. ZoomStartOffset = PlayerViewOffset;
  1127. }
  1128. bZoomingOut = true;
  1129. }
  1130. // End:0x1C4
  1131. else
  1132. {
  1133. bFastZoomOut = true;
  1134. // End:0x15F
  1135. if(bZoomingIn)
  1136. {
  1137. bZoomingIn = false;
  1138. bZoomInInterrupted = true;
  1139. ZoomTime = default.ZoomOutTime - ZoomTime;
  1140. ZoomPartialTime = ZoomTime;
  1141. ZoomStartOffset = PlayerViewOffset;
  1142. ZoomRotStartOffset = ZoomRotInterp;
  1143. }
  1144. // End:0x185
  1145. else
  1146. {
  1147. ZoomTime = FastZoomOutTime;
  1148. ZoomStartOffset = PlayerViewOffset;
  1149. }
  1150. bZoomingOut = true;
  1151. LastZoomOutTime = WorldInfo.TimeSeconds + ZoomTime;
  1152. }
  1153. ZoomTargetOffset = default.PlayerViewOffset;
  1154. // End:0x211
  1155. if(MySkelMesh != none)
  1156. {
  1157. ZoomWeaponFOVStart = MySkelMesh.FOV;
  1158. }
  1159. // End:0x224
  1160. else
  1161. {
  1162. ZoomWeaponFOVStart = MeshIronSightFOV;
  1163. }
  1164. // End:0x274
  1165. if((WorldInfo.NetMode != NM_DedicatedServer) && Instigator != none)
  1166. {
  1167. EnableIronSightsDoF(false);
  1168. EnablePlayerZoom(false);
  1169. }
  1170. bUsingSights = false;
  1171. //return;
  1172. }
  1173.  
  1174. private reliable server final function ServerZoomOut(bool bAnimateTransition)
  1175. {
  1176. ZoomOut(bAnimateTransition, default.ZoomOutTime);
  1177. //return;
  1178. }
  1179.  
  1180. private reliable server final function ServerZoomOutModified(bool bAnimateTransition, float NewZoomOutTime)
  1181. {
  1182. ZoomOut(bAnimateTransition, NewZoomOutTime);
  1183. //return;
  1184. }
  1185.  
  1186. simulated event OnZoomInFinished()
  1187. {
  1188. OnAnimEnd(none, 0.0, 0.0);
  1189. //return;
  1190. }
  1191.  
  1192. simulated event OnZoomOutFinished()
  1193. {
  1194. OnAnimEnd(none, 0.0, 0.0);
  1195. //return;
  1196. }
  1197.  
  1198. simulated function bool ShouldOwnerWalk()
  1199. {
  1200. return bUsingSights;
  1201. //return ReturnValue;
  1202. }
  1203.  
  1204. function bool IsGrappleBlocked(Pawn InstigatedBy)
  1205. {
  1206. return false;
  1207. //return ReturnValue;
  1208. }
  1209.  
  1210. function AdjustDamage(out int InDamage, class<DamageType> DamageType, Actor DamageCauser)
  1211. {
  1212. //return;
  1213. }
  1214.  
  1215. simulated function PlayTakeHitEffects(Vector HitLocation, Actor DamageCauser)
  1216. {
  1217. //return;
  1218. }
  1219.  
  1220. simulated function SetWeaponSprint(bool bNewSprintStatus)
  1221. {
  1222. // End:0x77
  1223. if(bNewSprintStatus)
  1224. {
  1225. // End:0x26
  1226. if(bUsingSights)
  1227. {
  1228. PerformZoom(false);
  1229. }
  1230. // End:0x6D
  1231. if((CurrentFireMode < GetPendingFireLength()) && PendingFire(CurrentFireMode))
  1232. {
  1233. StopFire(CurrentFireMode);
  1234. }
  1235. GotoWeaponSprinting();
  1236. }
  1237. //return;
  1238. }
  1239.  
  1240. simulated function StopPawnSprint(bool bClearPlayerInput)
  1241. {
  1242. local KFPawn KFP;
  1243. local PlayerController PC;
  1244. local KFPlayerInput Input;
  1245.  
  1246. KFP = KFPawn(Instigator);
  1247. // End:0x183
  1248. if(KFP != none)
  1249. {
  1250. KFP.SetSprinting(false);
  1251. // End:0x183
  1252. if(KFP.IsLocallyControlled())
  1253. {
  1254. PC = PlayerController(Instigator.Controller);
  1255. // End:0xDD
  1256. if((PC != none) && bClearPlayerInput)
  1257. {
  1258. PC.bRun = 0;
  1259. }
  1260. Input = KFPlayerInput(PC.PlayerInput);
  1261. // End:0x183
  1262. if((Input != none) && Input.bExtendedSprinting)
  1263. {
  1264. PC.bRun = 0;
  1265. Input.bExtendedSprinting = false;
  1266. }
  1267. }
  1268. }
  1269. //return;
  1270. }
  1271.  
  1272. simulated function bool AllowSprinting()
  1273. {
  1274. return true;
  1275. //return ReturnValue;
  1276. }
  1277.  
  1278. simulated function GotoWeaponSprinting()
  1279. {
  1280. //return;
  1281. }
  1282.  
  1283. simulated function PlayAnimation(name Sequence, optional float fDesiredDuration, optional bool bLoop, optional float BlendInTime, optional float BlendOutTime)
  1284. {
  1285. BlendInTime = 0.10;
  1286. BlendOutTime = 0.0;
  1287. // End:0x3E
  1288. if((Sequence == 'None') || Instigator == none)
  1289. {
  1290. return;
  1291. }
  1292. // End:0xA4
  1293. if(bLogAnimation)
  1294. {
  1295. LogInternal((((("PlayAnimation Sequence=" @ string(Sequence)) @ "Length=") @ string(fDesiredDuration)) @ "bLoop=") @ string(bLoop));
  1296. }
  1297. // End:0x122
  1298. if(Instigator.IsFirstPerson())
  1299. {
  1300. BlendInTime *= (WorldInfo.TimeDilation * CustomTimeDilation);
  1301. WeaponAnimSeqNode.SetTweenTime(BlendInTime);
  1302. }
  1303. PlayWeaponAnimation(Sequence, fDesiredDuration, bLoop);
  1304. // End:0x1DD
  1305. if(!bLoop)
  1306. {
  1307. // End:0x18E
  1308. if(fDesiredDuration > float(0))
  1309. {
  1310. SetTimer(fDesiredDuration - BlendOutTime, false, 'OnAnimEnd');
  1311. }
  1312. // End:0x1DA
  1313. else
  1314. {
  1315. SetTimer((MySkelMesh.GetAnimLength(Sequence) * DefaultAnimSpeed) - BlendOutTime, false, 'OnAnimEnd');
  1316. }
  1317. }
  1318. // End:0x1F1
  1319. else
  1320. {
  1321. ClearTimer('OnAnimEnd');
  1322. }
  1323. //return;
  1324. }
  1325.  
  1326. simulated function PlayWeaponAnimation(name Sequence, float fDesiredDuration, optional bool bLoop, optional SkeletalMeshComponent SkelMesh)
  1327. {
  1328. local float DesiredRate;
  1329.  
  1330. // End:0x231
  1331. if(((Mesh != none) && Instigator != none) && WorldInfo.NetMode != NM_DedicatedServer)
  1332. {
  1333. // End:0x9A
  1334. if(!Mesh.bAttached)
  1335. {
  1336. AttachWeaponTo(Instigator.Mesh);
  1337. }
  1338. // End:0x231
  1339. if(WeaponAnimSeqNode != none)
  1340. {
  1341. // End:0x138
  1342. if((WeaponAnimSeqNode.AnimSeq == none) || WeaponAnimSeqNode.AnimSeq.SequenceName != Sequence)
  1343. {
  1344. WeaponAnimSeqNode.SetAnim(Sequence);
  1345. }
  1346. // End:0x1FE
  1347. if(fDesiredDuration > 0.0)
  1348. {
  1349. DesiredRate = WeaponAnimSeqNode.AnimSeq.SequenceLength / (fDesiredDuration * WeaponAnimSeqNode.AnimSeq.RateScale);
  1350. WeaponAnimSeqNode.PlayAnim(bLoop, DesiredRate);
  1351. }
  1352. // End:0x231
  1353. else
  1354. {
  1355. WeaponAnimSeqNode.PlayAnim(bLoop, DefaultAnimSpeed);
  1356. }
  1357. }
  1358. }
  1359. //return;
  1360. }
  1361.  
  1362. simulated function AnimNodeSequence GetWeaponAnimNodeSeq()
  1363. {
  1364. // End:0x19
  1365. if(WeaponAnimSeqNode != none)
  1366. {
  1367. return WeaponAnimSeqNode;
  1368. }
  1369. return super.GetWeaponAnimNodeSeq();
  1370. //return ReturnValue;
  1371. }
  1372.  
  1373. simulated function ChangeAnimationRate(name Sequence, float NewRate)
  1374. {
  1375. local AnimNodeSequence WeapNode;
  1376.  
  1377. WeapNode = GetWeaponAnimNodeSeq();
  1378. // End:0x79
  1379. if((WeapNode != none) && WeapNode.AnimSeqName == Sequence)
  1380. {
  1381. WeapNode.Rate = NewRate;
  1382. }
  1383. //return;
  1384. }
  1385.  
  1386. simulated function bool WeaponIsAnimating()
  1387. {
  1388. // End:0x23
  1389. if((MySkelMesh == none) || (GetWeaponAnimNodeSeq()) == none)
  1390. {
  1391. return false;
  1392. }
  1393. return WeaponAnimSeqNode.bPlaying;
  1394. //return ReturnValue;
  1395. }
  1396.  
  1397. function CameraAnimInst PlayCameraAnim(CameraAnim AnimToPlay, optional float Scale, optional float Rate, optional float BlendInTime, optional float BlendOutTime, optional bool bLoop, optional bool bRandomStartTime, optional Engine.Camera.ECameraAnimPlaySpace Space, optional Rotator CustomPlaySpace)
  1398. {
  1399. local PlayerController PC;
  1400. local CameraAnimInst AnimInst;
  1401.  
  1402. Scale = 1.0;
  1403. Rate = 1.0;
  1404. Space = 0;
  1405. PC = PlayerController(Instigator.Controller);
  1406. // End:0x149
  1407. if(PC.PlayerCamera != none)
  1408. {
  1409. AnimInst = PC.PlayerCamera.PlayCameraAnim(AnimToPlay, Rate, Scale, BlendInTime, BlendOutTime, bLoop, bRandomStartTime);
  1410. // End:0x149
  1411. if((AnimInst != none) && Space != 0)
  1412. {
  1413. AnimInst.SetPlaySpace(Space, CustomPlaySpace);
  1414. }
  1415. }
  1416. return AnimInst;
  1417. //return ReturnValue;
  1418. }
  1419.  
  1420. simulated function bool ShouldPlayFireLast(byte FireModeNum)
  1421. {
  1422. // End:0xAD
  1423. if(bHasFireLastAnims)
  1424. {
  1425. // End:0xAD
  1426. if(((!bAllowClientAmmoTracking && Role < ROLE_Authority) && AmmoCount[GetAmmoType(FireModeNum)] <= 1) || (bAllowClientAmmoTracking || Role == ROLE_Authority) && AmmoCount[GetAmmoType(FireModeNum)] == 0)
  1427. {
  1428. return true;
  1429. }
  1430. }
  1431. return false;
  1432. //return ReturnValue;
  1433. }
  1434.  
  1435. simulated function name GetWeaponFireAnim(byte FireModeNum)
  1436. {
  1437. local bool bPlayFireLast;
  1438.  
  1439. bPlayFireLast = ShouldPlayFireLast(FireModeNum);
  1440. // End:0x6B
  1441. if(bUsingScopePosition)
  1442. {
  1443. // End:0x5E
  1444. if(bPlayFireLast && FireLastScopedAnim != 'None')
  1445. {
  1446. return FireLastScopedAnim;
  1447. }
  1448. // End:0x68
  1449. else
  1450. {
  1451. return FireScopedAnim;
  1452. }
  1453. }
  1454. // End:0x102
  1455. else
  1456. {
  1457. // End:0xC5
  1458. if(bUsingSights)
  1459. {
  1460. // End:0xAB
  1461. if(bPlayFireLast && FireLastSightedAnim != 'None')
  1462. {
  1463. return FireLastSightedAnim;
  1464. }
  1465. // End:0xC2
  1466. else
  1467. {
  1468. return FireSightedAnims[Rand(FireSightedAnims.Length)];
  1469. }
  1470. }
  1471. // End:0x102
  1472. else
  1473. {
  1474. // End:0xF8
  1475. if(bPlayFireLast && FireLastAnim != 'None')
  1476. {
  1477. return FireLastAnim;
  1478. }
  1479. // End:0x102
  1480. else
  1481. {
  1482. return FireAnim;
  1483. }
  1484. }
  1485. }
  1486. //return ReturnValue;
  1487. }
  1488.  
  1489. simulated function name GetLoopingFireAnim(byte FireModeNum)
  1490. {
  1491. // End:0x1A
  1492. if(bUsingScopePosition)
  1493. {
  1494. return FireLoopScopedAnim;
  1495. }
  1496. // End:0x31
  1497. else
  1498. {
  1499. // End:0x31
  1500. if(bUsingSights)
  1501. {
  1502. return FireLoopSightedAnim;
  1503. }
  1504. }
  1505. return FireLoopAnim;
  1506. //return ReturnValue;
  1507. }
  1508.  
  1509. simulated function name GetLoopStartFireAnim(byte FireModeNum)
  1510. {
  1511. // End:0x17
  1512. if(bUsingSights)
  1513. {
  1514. return FireLoopStartSightedAnim;
  1515. }
  1516. return FireLoopStartAnim;
  1517. //return ReturnValue;
  1518. }
  1519.  
  1520. simulated function name GetLoopEndFireAnim(byte FireModeNum)
  1521. {
  1522. // End:0x17
  1523. if(bUsingSights)
  1524. {
  1525. return FireLoopEndSightedAnim;
  1526. }
  1527. return FireLoopEndAnim;
  1528. //return ReturnValue;
  1529. }
  1530.  
  1531. simulated function name GetMeleeAnimName(KFPawn.EPawnOctant AtkDir, KFMeleeHelperWeapon.EMeleeAttackType AtkType)
  1532. {
  1533. local int Idx;
  1534.  
  1535. // End:0x3A
  1536. if(MeleeAttackAnims.Length > 0)
  1537. {
  1538. Idx = Rand(MeleeAttackAnims.Length);
  1539. return MeleeAttackAnims[Idx];
  1540. }
  1541. //return ReturnValue;
  1542. }
  1543.  
  1544. simulated function WeaponPlaySound(AkBaseSoundObject Sound, optional float NoiseLoudness)
  1545. {
  1546. // End:0x60
  1547. if(((Sound != none) && Instigator != none) && !bSuppressSounds)
  1548. {
  1549. Instigator.PlaySoundBase(Sound, false, true);
  1550. }
  1551. //return;
  1552. }
  1553.  
  1554. simulated function ChangeVisibility(bool bIsVisible)
  1555. {
  1556. local KFPawn KFP;
  1557. local editinline SkeletalMeshComponent SkelMesh;
  1558. local editinline PrimitiveComponent Primitive;
  1559.  
  1560. // End:0x10B
  1561. if(Mesh != none)
  1562. {
  1563. // End:0x69
  1564. if(bIsVisible && !Mesh.bAttached)
  1565. {
  1566. AttachComponent(Mesh);
  1567. EnsureWeaponOverlayComponentLast();
  1568. PlayIdleAnim();
  1569. }
  1570. SetHidden(!bIsVisible);
  1571. SkelMesh = SkeletalMeshComponent(Mesh);
  1572. // End:0x10B
  1573. if(SkelMesh != none)
  1574. {
  1575. // End:0x10A
  1576. foreach SkelMesh.AttachedComponents(class'PrimitiveComponent', Primitive)
  1577. {
  1578. Primitive.SetHidden(!bIsVisible);
  1579. }
  1580. }
  1581. }
  1582. KFP = KFPawn(Instigator);
  1583. // End:0x1FC
  1584. if((KFP != none) && KFP.ArmsMesh != none)
  1585. {
  1586. // End:0x194
  1587. if(bIsVisible)
  1588. {
  1589. AttachComponent(KFP.ArmsMesh);
  1590. }
  1591. // End:0x1BC
  1592. else
  1593. {
  1594. DetachComponent(KFP.ArmsMesh);
  1595. }
  1596. KFP.ArmsMesh.SetHidden(!bIsVisible);
  1597. }
  1598. // End:0x236
  1599. if(OverlayMesh != none)
  1600. {
  1601. OverlayMesh.SetHidden(!bIsVisible);
  1602. }
  1603. //return;
  1604. }
  1605.  
  1606. simulated function AnimNodeSequence GetArmAnimNodeSeq()
  1607. {
  1608. local KFPawn P;
  1609.  
  1610. P = KFPawn(Instigator);
  1611. // End:0x8E
  1612. if((P != none) && P.ArmsMesh != none)
  1613. {
  1614. return AnimNodeSequence(P.ArmsMesh.Animations);
  1615. }
  1616. return none;
  1617. //return ReturnValue;
  1618. }
  1619.  
  1620. simulated function ANIMNOTIFY_LockBolt()
  1621. {
  1622. // End:0x32
  1623. if(bAllowClientAmmoTracking)
  1624. {
  1625. // End:0x2F
  1626. if(AmmoCount[0] == 0)
  1627. {
  1628. bIsBoltLockedBack = true;
  1629. }
  1630. }
  1631. // End:0x98
  1632. else
  1633. {
  1634. // End:0x98
  1635. if(((Role < ROLE_Authority) && AmmoCount[0] <= 1) || (Role == ROLE_Authority) && AmmoCount[0] == 0)
  1636. {
  1637. bIsBoltLockedBack = true;
  1638. }
  1639. }
  1640. //return;
  1641. }
  1642.  
  1643. simulated function ANIMNOTIFY_UnLockBolt()
  1644. {
  1645. bIsBoltLockedBack = false;
  1646. //return;
  1647. }
  1648.  
  1649. simulated function ToggleAdditiveBobAnim(bool bOn, optional float BlendTime)
  1650. {
  1651. BlendTime = 0.10;
  1652. // End:0x68
  1653. if(IdleBobBlendNode != none)
  1654. {
  1655. IdleBobBlendNode.SetBlendTarget(((bOn && bUseAdditiveMoveAnim) ? 1.0 : 0.0), BlendTime);
  1656. }
  1657. //return;
  1658. }
  1659.  
  1660. // Export UKFWeapon::execGetAnimSeqCameraPosition(FFrame&, void* const)
  1661. native final function bool GetAnimSeqCameraPosition(out Vector OutPos, out Rotator OutRot);
  1662.  
  1663. simulated event SetPosition(KFPawn Holder)
  1664. {
  1665. local Vector DrawOffset, ViewOffset, FinalLocation;
  1666. local Rotator NewRotation, FinalRotation, SpecRotation;
  1667. local PlayerController PC;
  1668. local Vector SpecViewLoc;
  1669. local Rotator DebugRotationOffset, UsedBufferRotation;
  1670. local Vector CamLoc;
  1671. local Rotator CamRot;
  1672.  
  1673. // End:0x37
  1674. if(!Holder.IsFirstPerson() && !bWeaponNeedsServerPosition)
  1675. {
  1676. return;
  1677. }
  1678. // End:0x118
  1679. if(bForceHidden)
  1680. {
  1681. Mesh.SetHidden(true);
  1682. Holder.ArmsMesh.SetHidden(true);
  1683. NewRotation = Holder.GetViewRotation();
  1684. SetLocation(Instigator.GetPawnViewLocation() + (HiddenWeaponsOffset >> NewRotation));
  1685. SetRotation(NewRotation);
  1686. SetBase(Instigator);
  1687. return;
  1688. }
  1689. // End:0x13C
  1690. if(bPendingShow)
  1691. {
  1692. SetHidden(false);
  1693. bPendingShow = false;
  1694. }
  1695. Mesh.SetHidden(false);
  1696. PC = GetALocalPlayerController();
  1697. ViewOffset = PlayerViewOffset;
  1698. // End:0x1C7
  1699. if(class'Engine'.static.IsRealDStereoEnabled())
  1700. {
  1701. ViewOffset.X -= float(30);
  1702. }
  1703. // End:0x2D8
  1704. if((Holder.Controller == none) && KFDemoRecSpectator(PC) != none)
  1705. {
  1706. PC.GetPlayerViewPoint(SpecViewLoc, SpecRotation);
  1707. DrawOffset = ViewOffset >> SpecRotation;
  1708. DrawOffset += Holder.WeaponBob(BobDamping, JumpDamping);
  1709. FinalLocation = SpecViewLoc + DrawOffset;
  1710. SetLocation(FinalLocation);
  1711. SetBase(Holder);
  1712. SetRotation(SpecRotation);
  1713. return;
  1714. }
  1715. NewRotation = ((Holder.Controller == none) ? Holder.GetBaseAimRotation() : Holder.Controller.Rotation);
  1716. NewRotation += ZoomRotInterp;
  1717. // End:0x6EE
  1718. if(KFPlayerController(Holder.Controller) != none)
  1719. {
  1720. // End:0x415
  1721. if(bDebugRecoilPosition)
  1722. {
  1723. DebugRotationOffset.Pitch = RecoilISMaxPitchLimit;
  1724. KFPlayerController(Holder.Controller).WeaponBufferRotation = DebugRotationOffset;
  1725. }
  1726. // End:0x4EC
  1727. if(KFPlayerController(Holder.Controller).WeaponBufferRotation.Pitch < 32768)
  1728. {
  1729. UsedBufferRotation.Pitch = int(float(KFPlayerController(Holder.Controller).WeaponBufferRotation.Pitch) / IronSightMeshFOVCompensationScale);
  1730. }
  1731. // End:0x577
  1732. else
  1733. {
  1734. UsedBufferRotation.Pitch = int(float(65535) - (float(65535 - KFPlayerController(Holder.Controller).WeaponBufferRotation.Pitch) / IronSightMeshFOVCompensationScale));
  1735. }
  1736. // End:0x64E
  1737. if(KFPlayerController(Holder.Controller).WeaponBufferRotation.Yaw < 32768)
  1738. {
  1739. UsedBufferRotation.Yaw = int(float(KFPlayerController(Holder.Controller).WeaponBufferRotation.Yaw) / IronSightMeshFOVCompensationScale);
  1740. }
  1741. // End:0x6D9
  1742. else
  1743. {
  1744. UsedBufferRotation.Yaw = int(float(65535) - (float(65535 - KFPlayerController(Holder.Controller).WeaponBufferRotation.Yaw) / IronSightMeshFOVCompensationScale));
  1745. }
  1746. NewRotation += UsedBufferRotation;
  1747. }
  1748. // End:0x745
  1749. if(bFollowAnimSeqCamera && GetAnimSeqCameraPosition(CamLoc, CamRot))
  1750. {
  1751. ViewOffset += CamLoc;
  1752. NewRotation += CamRot;
  1753. }
  1754. FinalRotation = NewRotation;
  1755. DrawOffset.Z += Holder.GetEyeHeight();
  1756. DrawOffset += Holder.WeaponBob(BobDamping, JumpDamping);
  1757. DrawOffset += ((WeaponLag + ViewOffset) >> FinalRotation);
  1758. FinalLocation = Holder.Location + DrawOffset;
  1759. SetLocation(FinalLocation);
  1760. SetRotation(FinalRotation);
  1761. SetBase(Holder);
  1762. //return;
  1763. }
  1764.  
  1765. simulated function PlayFireEffects(byte FireModeNum, optional Vector HitLocation)
  1766. {
  1767. local name WeaponFireAnimName;
  1768.  
  1769. // End:0x59
  1770. if(((FireModeNum < bLoopingFireSnd.Length) && bLoopingFireSnd[FireModeNum]) && !bPlayingLoopingFireSnd)
  1771. {
  1772. StartLoopingFireSound(FireModeNum);
  1773. }
  1774. PlayFiringSound(CurrentFireMode);
  1775. // End:0x14F
  1776. if((Instigator != none) && Instigator.IsFirstPerson())
  1777. {
  1778. // End:0x128
  1779. if(!bPlayingLoopingFireAnim)
  1780. {
  1781. WeaponFireAnimName = GetWeaponFireAnim(FireModeNum);
  1782. // End:0x128
  1783. if(WeaponFireAnimName != 'None')
  1784. {
  1785. PlayAnimation(WeaponFireAnimName, MySkelMesh.GetAnimLength(WeaponFireAnimName), FireTweenTime);
  1786. }
  1787. }
  1788. HandleRecoil();
  1789. ShakeView();
  1790. CauseMuzzleFlash(FireModeNum);
  1791. }
  1792. //return;
  1793. }
  1794.  
  1795. simulated function StopFireEffects(byte FireModeNum)
  1796. {
  1797. // End:0x61
  1798. if(MuzzleFlash != none)
  1799. {
  1800. // End:0x42
  1801. if(FireModeNum == 0)
  1802. {
  1803. MuzzleFlash.StopMuzzleFlash();
  1804. }
  1805. // End:0x61
  1806. else
  1807. {
  1808. MuzzleFlash.StopMuzzleAltFlash();
  1809. }
  1810. }
  1811. //return;
  1812. }
  1813.  
  1814. simulated function StartLoopingFireEffects(byte FireModeNum, optional bool bForceAnim)
  1815. {
  1816. local name WeaponFireAnimName;
  1817.  
  1818. // End:0x134
  1819. if(bForceAnim || (FireModeNum < bLoopingFireAnim.Length) && bLoopingFireAnim[FireModeNum])
  1820. {
  1821. WeaponFireAnimName = GetLoopStartFireAnim(FireModeNum);
  1822. // End:0xC5
  1823. if(WeaponFireAnimName != 'None')
  1824. {
  1825. PlayAnimation(WeaponFireAnimName, MySkelMesh.GetAnimLength(WeaponFireAnimName), false, FireTweenTime, 0.0);
  1826. }
  1827. // End:0x128
  1828. else
  1829. {
  1830. WeaponFireAnimName = GetLoopingFireAnim(FireModeNum);
  1831. PlayAnimation(WeaponFireAnimName, MySkelMesh.GetAnimLength(WeaponFireAnimName), true, FireTweenTime);
  1832. }
  1833. bPlayingLoopingFireAnim = true;
  1834. }
  1835. StartLoopingFireSound(FireModeNum);
  1836. //return;
  1837. }
  1838.  
  1839. simulated function StopLoopingFireEffects(byte FireModeNum)
  1840. {
  1841. local name LoopEndFireAnim;
  1842.  
  1843. // End:0xA2
  1844. if(bPlayingLoopingFireAnim)
  1845. {
  1846. LoopEndFireAnim = GetLoopEndFireAnim(FireModeNum);
  1847. // End:0x82
  1848. if(LoopEndFireAnim != 'None')
  1849. {
  1850. PlayAnimation(LoopEndFireAnim, MySkelMesh.GetAnimLength(LoopEndFireAnim));
  1851. }
  1852. // End:0x96
  1853. else
  1854. {
  1855. ClearTimer('OnAnimEnd');
  1856. }
  1857. bPlayingLoopingFireAnim = false;
  1858. }
  1859. StopLoopingFireSound(FireModeNum);
  1860. //return;
  1861. }
  1862.  
  1863. simulated function bool ShouldForceSingleFireSound()
  1864. {
  1865. // End:0x4B
  1866. if((self.WorldInfo.TimeDilation < 1.0) && SingleFireMode != 255)
  1867. {
  1868. return true;
  1869. }
  1870. return false;
  1871. //return ReturnValue;
  1872. }
  1873.  
  1874. simulated function StartLoopingFireSound(byte FireModeNum)
  1875. {
  1876. // End:0xC9
  1877. if(((FireModeNum < bLoopingFireSnd.Length) && bLoopingFireSnd[FireModeNum]) && !ShouldForceSingleFireSound())
  1878. {
  1879. bPlayingLoopingFireSnd = true;
  1880. KFPawn(Instigator).SetWeaponAmbientSound(WeaponFireSnd[FireModeNum].DefaultCue, WeaponFireSnd[FireModeNum].FirstPersonCue);
  1881. }
  1882. //return;
  1883. }
  1884.  
  1885. simulated function StopLoopingFireSound(byte FireModeNum)
  1886. {
  1887. // End:0xB7
  1888. if(bPlayingLoopingFireSnd)
  1889. {
  1890. KFPawn(Instigator).SetWeaponAmbientSound(none);
  1891. // End:0xAB
  1892. if(FireModeNum < WeaponFireLoopEndSnd.Length)
  1893. {
  1894. WeaponPlayFireSound(WeaponFireLoopEndSnd[FireModeNum].DefaultCue, WeaponFireLoopEndSnd[FireModeNum].FirstPersonCue);
  1895. }
  1896. bPlayingLoopingFireSnd = false;
  1897. }
  1898. //return;
  1899. }
  1900.  
  1901. simulated function PlayFiringSound(byte FireModeNum)
  1902. {
  1903. local byte UsedFireModeNum;
  1904.  
  1905. MakeNoise(1.0, 'PlayerFiring');
  1906. // End:0xFD
  1907. if(!bPlayingLoopingFireSnd)
  1908. {
  1909. UsedFireModeNum = FireModeNum;
  1910. // End:0x89
  1911. if(((FireModeNum < bLoopingFireSnd.Length) && bLoopingFireSnd[FireModeNum]) && ShouldForceSingleFireSound())
  1912. {
  1913. UsedFireModeNum = SingleFireMode;
  1914. }
  1915. // End:0xFD
  1916. if(UsedFireModeNum < WeaponFireSnd.Length)
  1917. {
  1918. WeaponPlayFireSound(WeaponFireSnd[UsedFireModeNum].DefaultCue, WeaponFireSnd[UsedFireModeNum].FirstPersonCue);
  1919. }
  1920. }
  1921. //return;
  1922. }
  1923.  
  1924. simulated function WeaponPlayFireSound(AkBaseSoundObject DefaultSound, AkBaseSoundObject FirstPersonSound)
  1925. {
  1926. local Vector SoundLocation;
  1927.  
  1928. // End:0x17E
  1929. if((Instigator != none) && !bSuppressSounds)
  1930. {
  1931. SoundLocation = Instigator.GetPawnViewLocation();
  1932. // End:0x139
  1933. if(((FirstPersonSound != none) && Instigator.IsLocallyControlled()) && Instigator.IsFirstPerson())
  1934. {
  1935. Instigator.PlaySoundBase(FirstPersonSound, true, false, false);
  1936. // End:0x136
  1937. if(WorldInfo.NetMode == NM_ListenServer)
  1938. {
  1939. KFPawn(Instigator).ReplicateSound(DefaultSound, false, false, false, SoundLocation);
  1940. }
  1941. }
  1942. // End:0x17E
  1943. else
  1944. {
  1945. // End:0x17E
  1946. if(DefaultSound != none)
  1947. {
  1948. Instigator.PlaySoundBase(DefaultSound, false, true, false, SoundLocation);
  1949. }
  1950. }
  1951. }
  1952. //return;
  1953. }
  1954.  
  1955. simulated function CauseMuzzleFlash(byte FireModeNum)
  1956. {
  1957. // End:0x19
  1958. if(MuzzleFlash == none)
  1959. {
  1960. AttachMuzzleFlash();
  1961. }
  1962. // End:0x91
  1963. if(MuzzleFlash != none)
  1964. {
  1965. MuzzleFlash.CauseMuzzleFlash(FireModeNum);
  1966. // End:0x91
  1967. if(MuzzleFlash.bAutoActivateShellEject)
  1968. {
  1969. MuzzleFlash.CauseShellEject();
  1970. }
  1971. }
  1972. //return;
  1973. }
  1974.  
  1975. simulated function ANIMNOTIFY_ShellEject()
  1976. {
  1977. // End:0x19
  1978. if(MuzzleFlash == none)
  1979. {
  1980. AttachMuzzleFlash();
  1981. }
  1982. // End:0x47
  1983. if(MuzzleFlash != none)
  1984. {
  1985. MuzzleFlash.CauseShellEject();
  1986. }
  1987. //return;
  1988. }
  1989.  
  1990. simulated function AttachMuzzleFlash()
  1991. {
  1992. // End:0x68
  1993. if(MySkelMesh != none)
  1994. {
  1995. // End:0x68
  1996. if(MuzzleFlashTemplate != none)
  1997. {
  1998. MuzzleFlash = new (self) class'KFMuzzleFlash' (MuzzleFlashTemplate);
  1999. MuzzleFlash.AttachMuzzleFlash(MySkelMesh);
  2000. }
  2001. }
  2002. //return;
  2003. }
  2004.  
  2005. simulated function ShakeView()
  2006. {
  2007. local PlayerController PC;
  2008. local float ShakeViewScale;
  2009.  
  2010. PC = PlayerController(Instigator.Controller);
  2011. // End:0x71
  2012. if((PC == none) || LocalPlayer(PC.Player) == none)
  2013. {
  2014. return;
  2015. }
  2016. // End:0x12C
  2017. if((CurrentFireMode < FireCameraAnim.Length) && FireCameraAnim[CurrentFireMode] != none)
  2018. {
  2019. ShakeViewScale = ShakeScaleStandard;
  2020. // End:0xDC
  2021. if(bUsingSights)
  2022. {
  2023. ShakeViewScale *= ShakeScaleSighted;
  2024. }
  2025. PC.ClientPlayCameraAnim(FireCameraAnim[CurrentFireMode], ShakeViewScale, 1.0, 0.0, 0.10);
  2026. }
  2027. PC.ClientPlayForceFeedbackWaveform(WeaponFireWaveForm);
  2028. //return;
  2029. }
  2030.  
  2031. simulated function AddBlood(float MinAmount, float MaxAmount)
  2032. {
  2033. local float NewBlood;
  2034.  
  2035. // End:0xB6
  2036. if((WorldInfo.NetMode != NM_DedicatedServer) && WeaponMIC != none)
  2037. {
  2038. NewBlood = RandRange(MinAmount, MaxAmount);
  2039. BloodParamValue = FMax(BloodParamValue + NewBlood, 0.20);
  2040. WeaponMIC.SetScalarParameterValue('Scalar_Blood_Contrast', BloodParamValue);
  2041. }
  2042. //return;
  2043. }
  2044.  
  2045. simulated function StartFire(byte FireModeNum)
  2046. {
  2047. // End:0x46
  2048. if((FireModeNum == 0) || FireModeNum == 1)
  2049. {
  2050. // End:0x46
  2051. if(ShouldAutoReload(FireModeNum))
  2052. {
  2053. FireModeNum = 2;
  2054. }
  2055. }
  2056. // End:0x72
  2057. if((FireModeNum == 0) && bUseAltFireMode)
  2058. {
  2059. FireModeNum = 1;
  2060. }
  2061. // End:0x99
  2062. if(FireModeNum == 2)
  2063. {
  2064. BeginFire(FireModeNum);
  2065. return;
  2066. }
  2067. super.StartFire(FireModeNum);
  2068. //return;
  2069. }
  2070.  
  2071. simulated function StopFire(byte FireModeNum)
  2072. {
  2073. // End:0x2C
  2074. if((FireModeNum == 0) && bUseAltFireMode)
  2075. {
  2076. FireModeNum = 1;
  2077. }
  2078. super.StopFire(FireModeNum);
  2079. //return;
  2080. }
  2081.  
  2082. simulated function AltFireMode()
  2083. {
  2084. // End:0x26
  2085. if(!Instigator.IsLocallyControlled())
  2086. {
  2087. return;
  2088. }
  2089. // End:0x59
  2090. if((FiringStatesArray[1] == 'None') || WeaponFireTypes[1] == 3)
  2091. {
  2092. return;
  2093. }
  2094. // End:0x81
  2095. if(bUseAltFireMode)
  2096. {
  2097. StopFire(1);
  2098. bUseAltFireMode = false;
  2099. }
  2100. // End:0x99
  2101. else
  2102. {
  2103. StopFire(0);
  2104. bUseAltFireMode = true;
  2105. }
  2106. Instigator.PlaySoundBase(KFInventoryManager(InvManager).SwitchFireModeEvent);
  2107. //return;
  2108. }
  2109.  
  2110. simulated function AltFireModeRelease()
  2111. {
  2112. // End:0x1A
  2113. if(PendingFire(1))
  2114. {
  2115. StopFire(1);
  2116. }
  2117. //return;
  2118. }
  2119.  
  2120. simulated function SendToFiringState(byte FireModeNum)
  2121. {
  2122. // End:0x82
  2123. if((FireModeNum == 4) && !static.GetPerk().GetGrenadeClass().default.bAllowTossDuringZedGrabRotation)
  2124. {
  2125. // End:0x82
  2126. if((WorldInfo.TimeSeconds - ZedGrabGrenadeTossCooldown) < float(0))
  2127. {
  2128. return;
  2129. }
  2130. }
  2131. // End:0xC2
  2132. if((FireModeNum == 2) && Instigator.IsLocallyControlled())
  2133. {
  2134. InitializeReload();
  2135. }
  2136. super.SendToFiringState(FireModeNum);
  2137. //return;
  2138. }
  2139.  
  2140. simulated event Vector GetMuzzleLoc()
  2141. {
  2142. local Vector X, Y, Z;
  2143. local Rotator ViewRotation;
  2144.  
  2145. // End:0x202
  2146. if(Instigator != none)
  2147. {
  2148. // End:0x12D
  2149. if(bUsingSights)
  2150. {
  2151. ViewRotation = Instigator.GetViewRotation();
  2152. // End:0xBA
  2153. if(KFPlayerController(Instigator.Controller) != none)
  2154. {
  2155. ViewRotation += KFPlayerController(Instigator.Controller).WeaponBufferRotation;
  2156. }
  2157. GetAxes(ViewRotation, X, Y, Z);
  2158. return Instigator.GetWeaponStartTraceLocation() + (X * FireOffset.X);
  2159. }
  2160. // End:0x202
  2161. else
  2162. {
  2163. ViewRotation = Instigator.GetViewRotation();
  2164. // End:0x1CB
  2165. if(KFPlayerController(Instigator.Controller) != none)
  2166. {
  2167. ViewRotation += KFPlayerController(Instigator.Controller).WeaponBufferRotation;
  2168. }
  2169. return Instigator.GetPawnViewLocation() + (FireOffset >> ViewRotation);
  2170. }
  2171. }
  2172. return Location;
  2173. //return ReturnValue;
  2174. }
  2175.  
  2176. simulated function FireAmmunition()
  2177. {
  2178. switch(WeaponFireTypes[CurrentFireMode])
  2179. {
  2180. // End:0x90
  2181. case 0:
  2182. // End:0x83
  2183. if((self.WorldInfo.TimeDilation < 1.0) && WeaponProjectiles[CurrentFireMode] != none)
  2184. {
  2185. ProjectileFire();
  2186. }
  2187. // End:0x8D
  2188. else
  2189. {
  2190. InstantFireClient();
  2191. }
  2192. // End:0xB7
  2193. break;
  2194. // End:0xA2
  2195. case 1:
  2196. ProjectileFire();
  2197. // End:0xB7
  2198. break;
  2199. // End:0xB4
  2200. case 2:
  2201. CustomFire();
  2202. // End:0xB7
  2203. break;
  2204. // End:0xFFFF
  2205. default:
  2206. ConsumeAmmo(CurrentFireMode);
  2207. NotifyWeaponFired(CurrentFireMode);
  2208. PlayFireEffects(CurrentFireMode, vect(0.0, 0.0, 0.0));
  2209. //return;
  2210. }
  2211. }
  2212.  
  2213. simulated function ImpactInfo CalcWeaponFire(Vector StartTrace, Vector EndTrace, optional out array<ImpactInfo> ImpactList, optional Vector Extent)
  2214. {
  2215. local ImpactInfo CurrentImpact;
  2216.  
  2217. CurrentImpact = super.CalcWeaponFire(StartTrace, EndTrace, ImpactList, Extent);
  2218. // End:0xAA
  2219. if(CurrentImpact.HitLocation == ImpactList[0].HitLocation)
  2220. {
  2221. TraceImpactHitZones(StartTrace, EndTrace, ImpactList);
  2222. return ImpactList[0];
  2223. }
  2224. return CurrentImpact;
  2225. //return ReturnValue;
  2226. }
  2227.  
  2228. simulated function TraceImpactHitZones(Vector StartTrace, Vector EndTrace, out array<ImpactInfo> ImpactList)
  2229. {
  2230. local int I;
  2231. local array<ImpactInfo> HitZoneImpactList;
  2232.  
  2233. I = 0;
  2234. J0x0B:
  2235. // End:0x18B [Loop If]
  2236. if(I < ImpactList.Length)
  2237. {
  2238. // End:0x17D
  2239. if((ImpactList[I].HitActor != none) && ImpactList[I].HitActor.IsA('KFPawn'))
  2240. {
  2241. TraceAllPhysicsAssetInteractions(SkeletalMeshComponent(ImpactList[I].HitInfo.HitComponent), EndTrace, StartTrace, HitZoneImpactList, vect(0.0, 0.0, 0.0), true);
  2242. // End:0x17D
  2243. if(HitZoneImpactList.Length > 0)
  2244. {
  2245. HitZoneImpactList[0].RayDir = ImpactList[I].RayDir;
  2246. ImpactList[I] = HitZoneImpactList[0];
  2247. J0x17D:
  2248. }
  2249. // End:0x17D
  2250. else
  2251. {
  2252. }
  2253. }
  2254. ++ I;
  2255. // [Loop Continue]
  2256. goto J0x0B;
  2257. }
  2258. //return;
  2259. }
  2260.  
  2261. simulated function bool PassThroughDamage(Actor HitActor)
  2262. {
  2263. local KFPawn KFP;
  2264.  
  2265. KFP = KFPawn(HitActor);
  2266. // End:0x69
  2267. if((PenetrationPowerRemaining > float(0)) && KFP != none)
  2268. {
  2269. PenetrationPowerRemaining -= KFP.PenetrationResistance;
  2270. return true;
  2271. }
  2272. return (!HitActor.bBlockActors && HitActor.IsA('Trigger') || HitActor.IsA('TriggerVolume')) || HitActor.IsA('InteractiveFoliageActor');
  2273. //return ReturnValue;
  2274. }
  2275.  
  2276. simulated function Rotator AddSpread(Rotator BaseAim)
  2277. {
  2278. local Vector X, Y, Z;
  2279. local float CurrentSpread, RandY, RandZ;
  2280.  
  2281. // End:0x24
  2282. if(CurrentFireMode >= Spread.Length)
  2283. {
  2284. return BaseAim;
  2285. }
  2286. CurrentSpread = Spread[CurrentFireMode];
  2287. // End:0x67
  2288. if(bUsingSights)
  2289. {
  2290. CurrentSpread *= IronSightsSpreadMod;
  2291. }
  2292. // End:0xB8
  2293. else
  2294. {
  2295. // End:0xB8
  2296. if((MovingSpreadMod > 1.0) && VSizeSq(Instigator.Velocity) > float(0))
  2297. {
  2298. CurrentSpread *= MovingSpreadMod;
  2299. }
  2300. }
  2301. // End:0xEE
  2302. if(Instigator.bIsCrouched)
  2303. {
  2304. CurrentSpread *= CrouchSpreadMod;
  2305. }
  2306. // End:0x10C
  2307. if(CurrentSpread == float(0))
  2308. {
  2309. return BaseAim;
  2310. }
  2311. // End:0x1F5
  2312. else
  2313. {
  2314. // End:0x145
  2315. if((GetPerk()) != none)
  2316. {
  2317. GetPerk().ModifySpread(CurrentSpread);
  2318. }
  2319. GetAxes(BaseAim, X, Y, Z);
  2320. RandY = FRand() - 0.50;
  2321. RandZ = Sqrt(0.50 - Square(RandY)) * (FRand() - 0.50);
  2322. return rotator((X + ((RandY * CurrentSpread) * Y)) + ((RandZ * CurrentSpread) * Z));
  2323. }
  2324. //return ReturnValue;
  2325. }
  2326.  
  2327. simulated function ModifyRecoil(out float CurrentRecoilModifier)
  2328. {
  2329. GetPerk().ModifyRecoil(CurrentRecoilModifier);
  2330. //return;
  2331. }
  2332.  
  2333. simulated event HandleRecoil()
  2334. {
  2335. local Rotator NewRecoilRotation;
  2336. local float CurrentRecoilModifier;
  2337. local KFPawn KFP;
  2338.  
  2339. // End:0x37
  2340. if((Instigator == none) || !Instigator.IsFirstPerson())
  2341. {
  2342. return;
  2343. }
  2344. CurrentRecoilModifier = 1.0;
  2345. NewRecoilRotation.Pitch = int(RandRange(float(minRecoilPitch), float(maxRecoilPitch)));
  2346. NewRecoilRotation.Yaw = int(RandRange(float(minRecoilYaw), float(maxRecoilYaw)));
  2347. // End:0x101
  2348. if(Instigator.Physics == 2)
  2349. {
  2350. CurrentRecoilModifier *= FallingRecoilModifier;
  2351. }
  2352. KFP = KFPawn(Instigator);
  2353. // End:0x1FB
  2354. if(KFP != none)
  2355. {
  2356. // End:0x1A2
  2357. if(VSizeSq(Instigator.Velocity) > float(50))
  2358. {
  2359. // End:0x18E
  2360. if(Instigator.bIsWalking)
  2361. {
  2362. CurrentRecoilModifier *= WalkingRecoilModifier;
  2363. }
  2364. // End:0x1A2
  2365. else
  2366. {
  2367. CurrentRecoilModifier *= JoggingRecoilModifier;
  2368. }
  2369. }
  2370. // End:0x1D8
  2371. if(Instigator.bIsCrouched)
  2372. {
  2373. CurrentRecoilModifier *= StanceCrouchedRecoilModifier;
  2374. }
  2375. // End:0x1FB
  2376. if(!bUsingSights)
  2377. {
  2378. CurrentRecoilModifier *= HippedRecoilModifier;
  2379. }
  2380. }
  2381. ModifyRecoil(CurrentRecoilModifier);
  2382. NewRecoilRotation *= CurrentRecoilModifier;
  2383. LastRecoilModifier = CurrentRecoilModifier;
  2384. SetRecoil(NewRecoilRotation, RecoilRate);
  2385. //return;
  2386. }
  2387.  
  2388. simulated function SetRecoil(Rotator NewRecoilRotation, float NewRecoilSpeed)
  2389. {
  2390. local float UsedRecoilScale;
  2391.  
  2392. // End:0x32
  2393. if(RecoilTimeLeft > float(0))
  2394. {
  2395. UsedRecoilScale = RecoilTimeLeft / RecoilSpeed;
  2396. }
  2397. // End:0x41
  2398. else
  2399. {
  2400. UsedRecoilScale = 0.0;
  2401. }
  2402. RecoilRotator *= UsedRecoilScale;
  2403. RecoilRotator += NewRecoilRotation;
  2404. RecoilSpeed = NewRecoilSpeed;
  2405. RecoilTimeLeft = NewRecoilSpeed;
  2406. //return;
  2407. }
  2408.  
  2409. simulated function SetSuppressionRecoil(Rotator NewRecoilRotation)
  2410. {
  2411. SetRecoil(NewRecoilRotation, SuppressRecoilSpeed);
  2412. SuppressRecoilRotator += NewRecoilRotation;
  2413. SuppressRecoilTimeLeft = SuppressRecoilSpeed;
  2414. //return;
  2415. }
  2416.  
  2417. simulated function class<KFProjectile> GetKFProjectileClass()
  2418. {
  2419. // End:0x36
  2420. if(CurrentFireMode == 4)
  2421. {
  2422. return GetPerk().GetGrenadeClass();
  2423. }
  2424. // End:0x72
  2425. else
  2426. {
  2427. return ((CurrentFireMode < WeaponProjectiles.Length) ? class<KFProjectile>(WeaponProjectiles[CurrentFireMode]) : none);
  2428. }
  2429. //return ReturnValue;
  2430. }
  2431.  
  2432. simulated function Projectile ProjectileFire()
  2433. {
  2434. local Vector StartTrace, EndTrace, RealStartLoc, AimDir;
  2435. local ImpactInfo TestImpact;
  2436. local Vector DirA, DirB;
  2437. local Quat Q;
  2438. local class<KFProjectile> MyProjectileClass;
  2439.  
  2440. // End:0x1C
  2441. if(CurrentFireMode != 4)
  2442. {
  2443. IncrementFlashCount();
  2444. }
  2445. MyProjectileClass = GetKFProjectileClass();
  2446. // End:0x282
  2447. if((Role == ROLE_Authority) || ((MyProjectileClass.default.bUseClientSideHitDetection && MyProjectileClass.default.bNoReplicationToInstigator) && Instigator != none) && Instigator.IsLocallyControlled())
  2448. {
  2449. StartTrace = Instigator.GetWeaponStartTraceLocation();
  2450. AimDir = vector(GetAdjustedAim(StartTrace));
  2451. RealStartLoc = GetPhysicalFireStartLoc(AimDir);
  2452. // End:0x25C
  2453. if(StartTrace != RealStartLoc)
  2454. {
  2455. EndTrace = StartTrace + (AimDir * (GetTraceRange()));
  2456. TestImpact = CalcWeaponFire(StartTrace, EndTrace);
  2457. DirB = AimDir;
  2458. AimDir = Normal(TestImpact.HitLocation - RealStartLoc);
  2459. DirA = AimDir;
  2460. // End:0x25C
  2461. if((DirA Dot DirB) < 0.9950)
  2462. {
  2463. Q = QuatFromAxisAndAngle(Normal(DirB Cross DirA), 0.10);
  2464. AimDir = QuatRotateVector(Q, DirB);
  2465. }
  2466. }
  2467. return SpawnProjectile(MyProjectileClass, RealStartLoc, AimDir);
  2468. }
  2469. return none;
  2470. //return ReturnValue;
  2471. }
  2472.  
  2473. simulated function KFProjectile SpawnProjectile(class<KFProjectile> KFProjClass, Vector RealStartLoc, Vector AimDir)
  2474. {
  2475. local KFProjectile SpawnedProjectile;
  2476. local int ProjDamage;
  2477.  
  2478. SpawnedProjectile = Spawn(KFProjClass, self, RealStartLoc);
  2479. // End:0x1BB
  2480. if((SpawnedProjectile != none) && !SpawnedProjectile.bDeleteMe)
  2481. {
  2482. // End:0x115
  2483. if((InstantHitDamage.Length > CurrentFireMode) && InstantHitDamageTypes.Length > CurrentFireMode)
  2484. {
  2485. ProjDamage = int(InstantHitDamage[CurrentFireMode]);
  2486. SpawnedProjectile.Damage = float(ProjDamage);
  2487. SpawnedProjectile.MyDamageType = InstantHitDamageTypes[CurrentFireMode];
  2488. }
  2489. // End:0x193
  2490. if(SpawnedProjectile != none)
  2491. {
  2492. SpawnedProjectile.InitialPenetrationPower = GetInitialPenetrationPower(CurrentFireMode);
  2493. SpawnedProjectile.PenetrationPower = SpawnedProjectile.InitialPenetrationPower;
  2494. }
  2495. SpawnedProjectile.Init(AimDir);
  2496. }
  2497. return SpawnedProjectile;
  2498. //return ReturnValue;
  2499. }
  2500.  
  2501. simulated event float GetInitialPenetrationPower(byte FiringMode)
  2502. {
  2503. local KFPerk InstigatorPerk;
  2504. local float UsedPenetrationPower;
  2505. local KFPlayerController KFPC;
  2506.  
  2507. // End:0x58
  2508. if((PenetrationPower.Length > FiringMode) && PenetrationPower[FiringMode] > float(0))
  2509. {
  2510. UsedPenetrationPower = default.PenetrationPower[FiringMode];
  2511. }
  2512. InstigatorPerk = GetPerk();
  2513. // End:0x150
  2514. if(((InstigatorPerk != none) && InstantHitDamageTypes.Length > FiringMode) && Instigator != none)
  2515. {
  2516. KFPC = KFPlayerController(Instigator.Controller);
  2517. // End:0x150
  2518. if(KFPC != none)
  2519. {
  2520. UsedPenetrationPower += InstigatorPerk.GetPenetrationModifier(KFPC.GetLevel(), class<KFDamageType>(InstantHitDamageTypes[FiringMode]));
  2521. }
  2522. }
  2523. return UsedPenetrationPower;
  2524. //return ReturnValue;
  2525. }
  2526.  
  2527. simulated function ProcessInstantHitEx(byte FiringMode, ImpactInfo Impact, optional int NumHits, optional out float out_PenetrationVal)
  2528. {
  2529. local int TotalDamage;
  2530. local KActorFromStatic NewKActor;
  2531. local editinline StaticMeshComponent HitStaticMesh;
  2532. local InterpCurveFloat PenetrationCurve;
  2533. local KFPawn KFP;
  2534.  
  2535. // End:0x3D2
  2536. if(Impact.HitActor != none)
  2537. {
  2538. NumHits = Max(NumHits, 1);
  2539. TotalDamage = int(InstantHitDamage[CurrentFireMode] * float(NumHits));
  2540. // End:0x1CE
  2541. if(Impact.HitActor.bWorldGeometry)
  2542. {
  2543. HitStaticMesh = StaticMeshComponent(Impact.HitInfo.HitComponent);
  2544. // End:0x1CB
  2545. if(((!WorldInfo.bDropDetail && WorldInfo.GetDetailMode() != 0) && HitStaticMesh != none) && HitStaticMesh.CanBecomeDynamic())
  2546. {
  2547. NewKActor = class'KActorFromStatic'.static.MakeDynamic(HitStaticMesh);
  2548. // End:0x1CB
  2549. if(NewKActor != none)
  2550. {
  2551. Impact.HitActor = NewKActor;
  2552. }
  2553. }
  2554. }
  2555. // End:0x2F8
  2556. else
  2557. {
  2558. // End:0x2F8
  2559. if(Impact.HitActor.bCanBeDamaged && (GetInitialPenetrationPower(FiringMode)) > float(0))
  2560. {
  2561. // End:0x236
  2562. if(out_PenetrationVal <= float(0))
  2563. {
  2564. return;
  2565. }
  2566. // End:0x2F8
  2567. else
  2568. {
  2569. PenetrationCurve = PenetrationDamageReductionCurve[FiringMode];
  2570. TotalDamage *= EvalInterpCurveFloat(PenetrationCurve, out_PenetrationVal / (GetInitialPenetrationPower(FiringMode)));
  2571. KFP = KFPawn(Impact.HitActor);
  2572. // End:0x2F8
  2573. if(KFP != none)
  2574. {
  2575. out_PenetrationVal -= KFP.PenetrationResistance;
  2576. }
  2577. }
  2578. }
  2579. }
  2580. Impact.HitActor.TakeDamage(TotalDamage, Instigator.Controller, Impact.HitLocation, InstantHitMomentum[FiringMode] * Impact.RayDir, InstantHitDamageTypes[FiringMode], Impact.HitInfo, self);
  2581. }
  2582. //return;
  2583. }
  2584.  
  2585. simulated function HandleProjectileImpact(ImpactInfo Impact, optional float PenetrationValue)
  2586. {
  2587. // End:0xA8
  2588. if((Instigator != none) && Instigator.IsLocallyControlled())
  2589. {
  2590. // End:0x82
  2591. if(Instigator.Role < ROLE_Authority)
  2592. {
  2593. SendClientProjectileImpact(CurrentFireMode, Impact, PenetrationValue);
  2594. }
  2595. ProcessInstantHitEx(CurrentFireMode, Impact, PenetrationValue);
  2596. }
  2597. //return;
  2598. }
  2599.  
  2600. event RecieveClientFragmentImpact(const out ImpactInfo Impact, class<KFProjectile> Fragment)
  2601. {
  2602. ProcessGrenadeProjectileImpact(Impact, Fragment);
  2603. //return;
  2604. }
  2605.  
  2606. simulated function HandleGrenadeProjectileImpact(ImpactInfo Impact, class<KFProjectile> Fragment)
  2607. {
  2608. // End:0x94
  2609. if((Instigator != none) && Instigator.IsLocallyControlled())
  2610. {
  2611. // End:0x78
  2612. if(Instigator.Role < ROLE_Authority)
  2613. {
  2614. SendClientFragmentImpact(Impact, Fragment);
  2615. }
  2616. ProcessGrenadeProjectileImpact(Impact, Fragment);
  2617. }
  2618. //return;
  2619. }
  2620.  
  2621. simulated function ProcessGrenadeProjectileImpact(ImpactInfo Impact, class<KFProjectile> Fragment)
  2622. {
  2623. local int TotalDamage;
  2624. local KActorFromStatic NewKActor;
  2625. local editinline StaticMeshComponent HitStaticMesh;
  2626.  
  2627. // End:0x251
  2628. if(Impact.HitActor != none)
  2629. {
  2630. TotalDamage = int(Fragment.default.Damage);
  2631. // End:0x15D
  2632. if(Impact.HitActor.bWorldGeometry)
  2633. {
  2634. HitStaticMesh = StaticMeshComponent(Impact.HitInfo.HitComponent);
  2635. // End:0x15D
  2636. if((HitStaticMesh != none) && HitStaticMesh.CanBecomeDynamic())
  2637. {
  2638. NewKActor = class'KActorFromStatic'.static.MakeDynamic(HitStaticMesh);
  2639. // End:0x15D
  2640. if(NewKActor != none)
  2641. {
  2642. Impact.HitActor = NewKActor;
  2643. }
  2644. }
  2645. }
  2646. Impact.HitActor.TakeDamage(TotalDamage, Instigator.Controller, Impact.HitLocation, Fragment.default.MomentumTransfer * Impact.RayDir, Fragment.default.MyDamageType, Impact.HitInfo, Instigator);
  2647. }
  2648. //return;
  2649. }
  2650.  
  2651. // Export UKFWeapon::execServerRegisterImpact1(FFrame&, void* const)
  2652. private reliable server native final event ServerRegisterImpact1(byte FiringMode, ImpactRepInfo NetImpact);
  2653.  
  2654. // Export UKFWeapon::execServerRegisterImpact2(FFrame&, void* const)
  2655. private reliable server native final event ServerRegisterImpact2(byte FiringMode, ImpactRepInfo NetImpacts[2]);
  2656.  
  2657. // Export UKFWeapon::execServerRegisterImpact3(FFrame&, void* const)
  2658. private reliable server native final event ServerRegisterImpact3(byte FiringMode, ImpactRepInfo NetImpacts[3]);
  2659.  
  2660. // Export UKFWeapon::execServerRegisterImpact4(FFrame&, void* const)
  2661. private reliable server native final event ServerRegisterImpact4(byte FiringMode, ImpactRepInfo NetImpacts[4]);
  2662.  
  2663. // Export UKFWeapon::execServerRegisterImpact5(FFrame&, void* const)
  2664. private reliable server native final event ServerRegisterImpact5(byte FiringMode, ImpactRepInfo NetImpacts[5]);
  2665.  
  2666. // Export UKFWeapon::execServerRegisterImpact6(FFrame&, void* const)
  2667. private reliable server native final event ServerRegisterImpact6(byte FiringMode, ImpactRepInfo NetImpacts[6]);
  2668.  
  2669. // Export UKFWeapon::execServerRegisterImpact7(FFrame&, void* const)
  2670. private reliable server native final event ServerRegisterImpact7(byte FiringMode, ImpactRepInfo NetImpacts[7]);
  2671.  
  2672. // Export UKFWeapon::execServerRegisterImpact8(FFrame&, void* const)
  2673. private reliable server native final event ServerRegisterImpact8(byte FiringMode, ImpactRepInfo NetImpacts[8]);
  2674.  
  2675. // Export UKFWeapon::execServerRegisterProjectileImpact(FFrame&, void* const)
  2676. private reliable server native final event ServerRegisterProjectileImpact(byte FiringMode, ImpactRepInfo NetImpact, optional byte PenetrationByte);
  2677.  
  2678. // Export UKFWeapon::execSendClientImpactList(FFrame&, void* const)
  2679. protected native simulated function int SendClientImpactList(byte FiringMode, const array<ImpactInfo> ImpactList);
  2680.  
  2681. // Export UKFWeapon::execSendClientProjectileImpact(FFrame&, void* const)
  2682. protected native simulated function int SendClientProjectileImpact(byte FiringMode, const out ImpactInfo Impact, float PenetrationFloat);
  2683.  
  2684. // Export UKFWeapon::execSendClientFragmentImpact(FFrame&, void* const)
  2685. protected native simulated function int SendClientFragmentImpact(const out ImpactInfo Impact, class<KFProjectile> FragmentClass);
  2686.  
  2687. // Export UKFWeapon::execServerRegisterFragmentImpact(FFrame&, void* const)
  2688. private reliable server native final event ServerRegisterFragmentImpact(ImpactRepInfo NetImpact, class<KFProjectile> FragmentClass);
  2689.  
  2690. simulated function InstantFireClient_AddImpacts(Vector StartTrace, Rotator Aim, out array<ImpactInfo> ImpactList)
  2691. {
  2692. //return;
  2693. }
  2694.  
  2695. simulated function InstantFireClient()
  2696. {
  2697. local Vector StartTrace, EndTrace;
  2698. local Rotator AimRot;
  2699. local array<ImpactInfo> ImpactList;
  2700. local int Idx;
  2701. local ImpactInfo RealImpact;
  2702. local float CurPenetrationValue;
  2703.  
  2704. StartTrace = Instigator.GetWeaponStartTraceLocation();
  2705. AimRot = GetAdjustedAim(StartTrace);
  2706. EndTrace = StartTrace + (vector(AimRot) * (GetTraceRange()));
  2707. PenetrationPowerRemaining = GetInitialPenetrationPower(CurrentFireMode);
  2708. CurPenetrationValue = PenetrationPowerRemaining;
  2709. RealImpact = CalcWeaponFire(StartTrace, EndTrace, ImpactList);
  2710. // End:0x127
  2711. if(Instigator != none)
  2712. {
  2713. Instigator.SetFlashLocation(self, CurrentFireMode, RealImpact.HitLocation);
  2714. }
  2715. // End:0x225
  2716. if((Instigator != none) && Instigator.IsLocallyControlled())
  2717. {
  2718. InstantFireClient_AddImpacts(StartTrace, AimRot, ImpactList);
  2719. Idx = 0;
  2720. J0x18A:
  2721. // End:0x1E0 [Loop If]
  2722. if(Idx < ImpactList.Length)
  2723. {
  2724. ProcessInstantHitEx(CurrentFireMode, ImpactList[Idx], CurPenetrationValue);
  2725. ++ Idx;
  2726. // [Loop Continue]
  2727. goto J0x18A;
  2728. }
  2729. // End:0x225
  2730. if(Instigator.Role < ROLE_Authority)
  2731. {
  2732. SendClientImpactList(CurrentFireMode, ImpactList);
  2733. }
  2734. }
  2735. //return;
  2736. }
  2737.  
  2738. event RecieveClientImpact(byte FiringMode, const out ImpactInfo Impact, optional out float PenetrationValue)
  2739. {
  2740. // End:0x47
  2741. if(FiringMode == 3)
  2742. {
  2743. MeleeAttackHelper.ProcessMeleeHit(FiringMode, Impact);
  2744. }
  2745. // End:0x6D
  2746. else
  2747. {
  2748. ProcessInstantHitEx(FiringMode, Impact, PenetrationValue);
  2749. }
  2750. //return;
  2751. }
  2752.  
  2753. event RecieveClientImpactList(byte FiringMode, array<ImpactInfo> ImpactList)
  2754. {
  2755. //return;
  2756. }
  2757.  
  2758. simulated function Vector EncodeDamageScale(Vector RayDir, float DamageScale)
  2759. {
  2760. // End:0x28
  2761. if(DamageScale < 1.0)
  2762. {
  2763. return RayDir * DamageScale;
  2764. }
  2765. return RayDir;
  2766. //return ReturnValue;
  2767. }
  2768.  
  2769. simulated function float DecodeDamageScale(Vector RayDir)
  2770. {
  2771. local float SizeSq;
  2772.  
  2773. SizeSq = VSizeSq(RayDir);
  2774. // End:0x34
  2775. if(SizeSq < 1.0)
  2776. {
  2777. return Sqrt(SizeSq);
  2778. }
  2779. return 1.0;
  2780. //return ReturnValue;
  2781. }
  2782.  
  2783. simulated function int GetAmmoType(byte FiringMode)
  2784. {
  2785. // End:0x25
  2786. if((FiringMode == 1) && UsesSecondaryAmmo())
  2787. {
  2788. return 1;
  2789. }
  2790. // End:0x27
  2791. else
  2792. {
  2793. return 0;
  2794. }
  2795. //return ReturnValue;
  2796. }
  2797.  
  2798. static simulated event bool UsesAmmo()
  2799. {
  2800. return default.MaxSpareAmmo[0] > 0;
  2801. //return ReturnValue;
  2802. }
  2803.  
  2804. static simulated event bool UsesSecondaryAmmo()
  2805. {
  2806. return default.MagazineCapacity[1] > 0;
  2807. //return ReturnValue;
  2808. }
  2809.  
  2810. static simulated event bool CanRefillSecondaryAmmo()
  2811. {
  2812. return (UsesSecondaryAmmo()) && default.bCanRefillSecondaryAmmo;
  2813. //return ReturnValue;
  2814. }
  2815.  
  2816. function InitializeAmmo()
  2817. {
  2818. local KFPerk CurrentPerk;
  2819.  
  2820. CurrentPerk = GetPerk();
  2821. MagazineCapacity[0] = default.MagazineCapacity[0];
  2822. MagazineCapacity[1] = default.MagazineCapacity[1];
  2823. SpareAmmoCount[0] = default.SpareAmmoCount[0];
  2824. MaxSpareAmmo[0] = default.MaxSpareAmmo[0] + default.MagazineCapacity[0];
  2825. MaxSpareAmmo[1] = default.MaxSpareAmmo[1] + default.MagazineCapacity[1];
  2826. // End:0x1A8
  2827. if(CurrentPerk != none)
  2828. {
  2829. CurrentPerk.ModifyMagSizeAndNumber(self, MagazineCapacity[0]);
  2830. CurrentPerk.ModifyMagSizeAndNumber(self, MagazineCapacity[1]);
  2831. MaxSpareAmmo[0] = default.MaxSpareAmmo[0] + MagazineCapacity[0];
  2832. MaxSpareAmmo[1] = default.MaxSpareAmmo[1] + MagazineCapacity[1];
  2833. CurrentPerk.ModifyMaxSpareAmmoAmount(self, MaxSpareAmmo[0]);
  2834. CurrentPerk.ModifyMaxSpareAmmoAmount(self, MaxSpareAmmo[1]);
  2835. }
  2836. AmmoCount[0] = byte(MagazineCapacity[0]);
  2837. AmmoCount[1] = byte(MagazineCapacity[1]);
  2838. AddAmmo(InitialSpareMags[0] * default.MagazineCapacity[0]);
  2839. // End:0x237
  2840. if(CurrentPerk != none)
  2841. {
  2842. CurrentPerk.ModifySpareAmmoAmount(self, SpareAmmoCount[0]);
  2843. }
  2844. bForceNetUpdate = true;
  2845. //return;
  2846. }
  2847.  
  2848. function ReInitializeAmmoCounts()
  2849. {
  2850. local KFPerk CurrentPerk;
  2851.  
  2852. CurrentPerk = GetPerk();
  2853. // End:0x149
  2854. if(CurrentPerk != none)
  2855. {
  2856. MagazineCapacity[0] = default.MagazineCapacity[0];
  2857. MagazineCapacity[1] = default.MagazineCapacity[1];
  2858. CurrentPerk.ModifyMagSizeAndNumber(self, MagazineCapacity[0]);
  2859. CurrentPerk.ModifyMagSizeAndNumber(self, MagazineCapacity[1]);
  2860. MaxSpareAmmo[0] = default.MaxSpareAmmo[0] + MagazineCapacity[0];
  2861. MaxSpareAmmo[1] = default.MaxSpareAmmo[1] + MagazineCapacity[1];
  2862. CurrentPerk.ModifyMaxSpareAmmoAmount(self, MaxSpareAmmo[0]);
  2863. CurrentPerk.ModifyMaxSpareAmmoAmount(self, MaxSpareAmmo[1]);
  2864. }
  2865. //return;
  2866. }
  2867.  
  2868. simulated function ConsumeAmmo(byte FireModeNum)
  2869. {
  2870. local int AmmoGroup;
  2871.  
  2872. // End:0x0F
  2873. if(bInfiniteAmmo)
  2874. {
  2875. return;
  2876. }
  2877. // End:0x9D
  2878. if((Role == ROLE_Authority) || bAllowClientAmmoTracking)
  2879. {
  2880. AmmoGroup = GetAmmoType(FireModeNum);
  2881. // End:0x9D
  2882. if((MagazineCapacity[AmmoGroup] > 0) && AmmoCount[AmmoGroup] > 0)
  2883. {
  2884. -- AmmoCount[AmmoGroup];
  2885. }
  2886. }
  2887. //return;
  2888. }
  2889.  
  2890. function int AddAmmo(int Amount)
  2891. {
  2892. local int OldSpareAmmo;
  2893.  
  2894. // End:0x13
  2895. if(MaxSpareAmmo[0] <= 0)
  2896. {
  2897. return 0;
  2898. }
  2899. OldSpareAmmo = SpareAmmoCount[0];
  2900. SpareAmmoCount[0] = Min(SpareAmmoCount[0] + Amount, MaxSpareAmmo[0] - AmmoCount[0]);
  2901. bForceNetUpdate = true;
  2902. return SpareAmmoCount[0] - OldSpareAmmo;
  2903. //return ReturnValue;
  2904. }
  2905.  
  2906. function int AddSecondaryAmmo(int Amount)
  2907. {
  2908. local int OldAmmo;
  2909.  
  2910. // End:0x11
  2911. if(!CanRefillSecondaryAmmo())
  2912. {
  2913. return 0;
  2914. }
  2915. OldAmmo = AmmoCount[1];
  2916. AmmoCount[1] = byte(Min(AmmoCount[1] + Amount, MagazineCapacity[1]));
  2917. bForceNetUpdate = true;
  2918. // End:0x89
  2919. if(bAllowClientAmmoTracking)
  2920. {
  2921. ClientForceSecondaryAmmoUpdate(AmmoCount[1]);
  2922. }
  2923. return AmmoCount[1] - OldAmmo;
  2924. //return ReturnValue;
  2925. }
  2926.  
  2927. reliable client simulated function ClientForceAmmoUpdate(byte NewAmmoCount, int NewSpareAmmoCount)
  2928. {
  2929. // End:0x224
  2930. if(Role < ROLE_Authority)
  2931. {
  2932. // End:0xDB
  2933. if(bDebug)
  2934. {
  2935. LogInternal((((((((string(self) @ "ClientForceAmmoUpdate ServerAmmo Primary:") $ string(NewAmmoCount)) @ "ClientAmmo Primary:") $ string(AmmoCount[0])) @ "ServerSpareAmmo Primary:") $ string(NewSpareAmmoCount)) @ "ClientSpareAmmo Primary:") $ string(SpareAmmoCount[0]));
  2936. }
  2937. // End:0x15C
  2938. if(NewAmmoCount != AmmoCount[0])
  2939. {
  2940. LogInternal((((string(self) @ "ClientForceAmmoUpdate Primary Ammo mismatch Server:") $ string(NewAmmoCount)) @ "Client:") $ string(AmmoCount[0]));
  2941. }
  2942. // End:0x1DE
  2943. if(NewSpareAmmoCount != SpareAmmoCount[0])
  2944. {
  2945. LogInternal((((string(self) @ "ClientForceAmmoUpdate Primary SpareAmmo mismatch Server:") $ string(NewSpareAmmoCount)) @ "Client:") $ string(SpareAmmoCount[0]));
  2946. }
  2947. AmmoCount[0] = NewAmmoCount;
  2948. SpareAmmoCount[0] = NewSpareAmmoCount;
  2949. NotifyHUDofWeapon(Pawn(Owner));
  2950. }
  2951. //return;
  2952. }
  2953.  
  2954. reliable client simulated function ClientForceSecondaryAmmoUpdate(byte NewSecondaryAmmoCount)
  2955. {
  2956. // End:0x13F
  2957. if(Role < ROLE_Authority)
  2958. {
  2959. // End:0x8B
  2960. if(bDebug)
  2961. {
  2962. LogInternal((((string(self) @ "ClientForceAmmoUpdate ServerAmmo Secondary:") $ string(NewSecondaryAmmoCount)) @ "ClientAmmo Secondary:") $ string(AmmoCount[1]));
  2963. }
  2964. // End:0x10E
  2965. if(NewSecondaryAmmoCount != AmmoCount[1])
  2966. {
  2967. LogInternal((((string(self) @ "ClientForceAmmoUpdate Secondary Ammo mismatch Server:") $ string(NewSecondaryAmmoCount)) @ "Client:") $ string(AmmoCount[1]));
  2968. }
  2969. AmmoCount[1] = NewSecondaryAmmoCount;
  2970. NotifyHUDofWeapon(Pawn(Owner));
  2971. }
  2972. //return;
  2973. }
  2974.  
  2975. unreliable client simulated function NotifyHUDofWeapon(Pawn P)
  2976. {
  2977. local KFPlayerController KFPC;
  2978.  
  2979. // End:0xAE
  2980. if(Role < ROLE_Authority)
  2981. {
  2982. KFPC = KFPlayerController(P.Owner);
  2983. // End:0xAE
  2984. if((KFPC != none) && KFPC.MyGFxHUD != none)
  2985. {
  2986. KFPC.MyGFxHUD.NotifyHUDofWeapon();
  2987. }
  2988. }
  2989. //return;
  2990. }
  2991.  
  2992. simulated event bool HasAmmo(byte FireModeNum, optional int Amount)
  2993. {
  2994. Amount = 1;
  2995. // End:0x1C
  2996. if(FireModeNum == 3)
  2997. {
  2998. return true;
  2999. }
  3000. // End:0x98
  3001. else
  3002. {
  3003. // End:0x3C
  3004. if(FireModeNum == 2)
  3005. {
  3006. return CanReload();
  3007. }
  3008. // End:0x98
  3009. else
  3010. {
  3011. // End:0x98
  3012. if(FireModeNum == 4)
  3013. {
  3014. // End:0x98
  3015. if(KFInventoryManager(InvManager) != none)
  3016. {
  3017. return KFInventoryManager(InvManager).HasGrenadeAmmo(Amount);
  3018. }
  3019. }
  3020. }
  3021. }
  3022. // End:0xB2
  3023. if(Amount == 0)
  3024. {
  3025. Amount = 1;
  3026. }
  3027. return (AmmoCount[GetAmmoType(FireModeNum)] - Amount) >= 0;
  3028. //return ReturnValue;
  3029. }
  3030.  
  3031. simulated function bool HasAnyAmmo()
  3032. {
  3033. // End:0x21
  3034. if(HasSpareAmmo() || HasAmmo(0))
  3035. {
  3036. return true;
  3037. }
  3038. // End:0x42
  3039. if((UsesSecondaryAmmo()) && HasAmmo(1))
  3040. {
  3041. return true;
  3042. }
  3043. return false;
  3044. //return ReturnValue;
  3045. }
  3046.  
  3047. final simulated event bool HasSpareAmmo()
  3048. {
  3049. return bInfiniteSpareAmmo || SpareAmmoCount[0] > 0;
  3050. //return ReturnValue;
  3051. }
  3052.  
  3053. simulated event int GetTotalAmmoAmount(byte FiringMode)
  3054. {
  3055. return AmmoCount[GetAmmoType(FiringMode)] + SpareAmmoCount[GetAmmoType(FiringMode)];
  3056. //return ReturnValue;
  3057. }
  3058.  
  3059. simulated event int GetMaxAmmoAmount(byte FiringMode)
  3060. {
  3061. return MaxSpareAmmo[GetAmmoType(FiringMode)] + MagazineCapacity[GetAmmoType(FiringMode)];
  3062. //return ReturnValue;
  3063. }
  3064.  
  3065. simulated event int GetMissingSpareAmmoAmount(byte FiringMode)
  3066. {
  3067. return MaxSpareAmmo[GetAmmoType(FiringMode)] - SpareAmmoCount[GetAmmoType(FiringMode)];
  3068. //return ReturnValue;
  3069. }
  3070.  
  3071. simulated function float GetAmmoPercentage(optional byte FiringMode)
  3072. {
  3073. // End:0x2A
  3074. if(MaxSpareAmmo[GetAmmoType(FiringMode)] == 0)
  3075. {
  3076. return -1.0;
  3077. }
  3078. return float(GetTotalAmmoAmount(FiringMode)) / float(GetMaxAmmoAmount(FiringMode));
  3079. //return ReturnValue;
  3080. }
  3081.  
  3082. simulated event float GetMagazineSizeForHUD(optional bool bPrimary)
  3083. {
  3084. bPrimary = true;
  3085. // End:0x23
  3086. if(bPrimary)
  3087. {
  3088. return float(MagazineCapacity[0]);
  3089. }
  3090. // End:0x31
  3091. else
  3092. {
  3093. return float(MagazineCapacity[1]);
  3094. }
  3095. //return ReturnValue;
  3096. }
  3097.  
  3098. simulated event float GetRemainingAmmoForHUD(optional bool bPrimary)
  3099. {
  3100. bPrimary = true;
  3101. // End:0x23
  3102. if(bPrimary)
  3103. {
  3104. return float(AmmoCount[0]);
  3105. }
  3106. // End:0x31
  3107. else
  3108. {
  3109. return float(AmmoCount[1]);
  3110. }
  3111. //return ReturnValue;
  3112. }
  3113.  
  3114. simulated function int GetSpareAmmoForHUD()
  3115. {
  3116. return SpareAmmoCount[0];
  3117. //return ReturnValue;
  3118. }
  3119.  
  3120. simulated function bool ForceReload()
  3121. {
  3122. // End:0x4E
  3123. if((Instigator != none) && Instigator.IsLocallyControlled())
  3124. {
  3125. // End:0x4E
  3126. if(CanReload())
  3127. {
  3128. StartFire(2);
  3129. return true;
  3130. }
  3131. }
  3132. return false;
  3133. //return ReturnValue;
  3134. }
  3135.  
  3136. simulated function bool CanReload()
  3137. {
  3138. local KFPawn P;
  3139. local bool bInstigatorCanReload;
  3140.  
  3141. P = KFPawn(Instigator);
  3142. bInstigatorCanReload = (P != none) && P.CanReloadWeapon();
  3143. return ((bCanBeReloaded && bInstigatorCanReload) && AmmoCount[0] < MagazineCapacity[0]) && HasSpareAmmo();
  3144. //return ReturnValue;
  3145. }
  3146.  
  3147. simulated function bool ShouldAutoReload(byte FireModeNum)
  3148. {
  3149. local bool bHasAmmo;
  3150.  
  3151. bHasAmmo = HasAmmo(FireModeNum);
  3152. // End:0x12E
  3153. if((!bHasAmmo && Instigator != none) && Instigator.IsLocallyControlled())
  3154. {
  3155. // End:0xD0
  3156. if(bPendingAutoSwitchOnDryFire)
  3157. {
  3158. // End:0xC1
  3159. if(CanSwitchWeapons())
  3160. {
  3161. // End:0xC1
  3162. if(!HasSpareAmmo())
  3163. {
  3164. Instigator.Controller.ClientSwitchToBestWeapon(false);
  3165. }
  3166. }
  3167. bPendingAutoSwitchOnDryFire = false;
  3168. }
  3169. // End:0x12E
  3170. else
  3171. {
  3172. WeaponPlaySound(WeaponDryFireSnd[FireModeNum]);
  3173. // End:0x117
  3174. if(Role < ROLE_Authority)
  3175. {
  3176. ServerPlayDryFireSound(FireModeNum);
  3177. }
  3178. bPendingAutoSwitchOnDryFire = !HasSpareAmmo();
  3179. }
  3180. }
  3181. return !bHasAmmo && CanReload();
  3182. //return ReturnValue;
  3183. }
  3184.  
  3185. protected reliable server function ServerPlayDryFireSound(byte FireModeNum)
  3186. {
  3187. WeaponPlaySound(WeaponDryFireSnd[FireModeNum]);
  3188. //return;
  3189. }
  3190.  
  3191. simulated function SetMeshLightingChannels(LightingChannelContainer NewLightingChannels)
  3192. {
  3193. Mesh.SetLightingChannels(NewLightingChannels);
  3194. //return;
  3195. }
  3196.  
  3197. simulated function GetWeaponDebug(out array<string> DebugInfo)
  3198. {
  3199. super.GetWeaponDebug(DebugInfo);
  3200. DebugInfo[DebugInfo.Length] = (("AmmoCount Primary:" $ string(AmmoCount[0])) @ "MagazineSize Primary:") $ string(MagazineCapacity[0]);
  3201. DebugInfo[DebugInfo.Length] = (("SpareAmmoCount Primary:" $ string(SpareAmmoCount[0])) @ "MaxSpareAmmo Primary:") $ string(MaxSpareAmmo[0]);
  3202. DebugInfo[DebugInfo.Length] = (("AmmoCount Secondary:" $ string(AmmoCount[1])) @ "MagazineSize Secondary:") $ string(MagazineCapacity[1]);
  3203. // End:0x1D6
  3204. if(KFInventoryManager(InvManager) != none)
  3205. {
  3206. DebugInfo[DebugInfo.Length] = (("GrenadeCount:" $ string(KFInventoryManager(InvManager).GrenadeCount)) @ "MaxGrenades:") $ string(GetPerk().MaxGrenadeCount);
  3207. }
  3208. //return;
  3209. }
  3210.  
  3211. simulated function DisplayDebug(HUD HUD, out float out_YL, out float out_YPos)
  3212. {
  3213. local string CurAnim, CurHandAnim;
  3214. local Vector FADebugLineStart, FADebugLineEnd, FADebugLineUL, FADebugLineUR, FADebugLineLL, FADebugLineLR;
  3215.  
  3216. local Rotator FADebugLineRot, FADebugViewRotation;
  3217. local int UsedMaxYawLimit, UsedMaxPitchLimit, UsedMinYawLimit, UsedMinPitchLimit;
  3218. local Rotator AimRotation, WeaponBufferRot;
  3219.  
  3220. super.DisplayDebug(HUD, out_YL, out_YPos);
  3221. // End:0x238
  3222. if(HUD.ShouldDisplayDebug('Camera'))
  3223. {
  3224. HUD.Canvas.SetPos(4.0, out_YPos);
  3225. HUD.Canvas.DrawText("---------- KFWeapon: Camera ----------");
  3226. out_YPos += out_YL;
  3227. HUD.Canvas.DrawText((((((("WEAPONCAMERA MeshFOV=" $ string(MeshFOV)) @ "MeshIronSightFOV=") $ string(MeshIronSightFOV)) @ "CameraIronSightFOV=") $ string(PlayerIronSightFOV)) @ " CurrentMeshFOV = ") $ string(MySkelMesh.FOV));
  3228. out_YPos += out_YL;
  3229. HUD.Canvas.SetPos(4.0, out_YPos);
  3230. }
  3231. // End:0x465
  3232. if(HUD.ShouldDisplayDebug('Zooming'))
  3233. {
  3234. HUD.Canvas.SetPos(4.0, out_YPos);
  3235. HUD.Canvas.DrawText("---------- KFWeapon: Zooming ----------");
  3236. out_YPos += out_YL;
  3237. HUD.Canvas.DrawText((((((((("ZOOMING ZoomRotInterp=" $ string(ZoomRotInterp)) @ "bDoingQuickDownZoom=") $ string(bDoingQuickDownZoom)) @ "QuickWeaponDownRotation=") $ string(QuickWeaponDownRotation)) @ " ZoomInRotation = ") $ string(ZoomInRotation)) $ " PlayerViewOffset= ") $ string(PlayerViewOffset));
  3238. out_YPos += out_YL;
  3239. HUD.Canvas.SetPos(4.0, out_YPos);
  3240. }
  3241. // End:0x769
  3242. if(HUD.ShouldDisplayDebug('FireOffset'))
  3243. {
  3244. HUD.Canvas.SetPos(4.0, out_YPos);
  3245. HUD.Canvas.DrawText("---------- KFWeapon: FireOffset ----------");
  3246. out_YPos += out_YL;
  3247. HUD.Canvas.DrawText("PROJECTILE SPAWNING FireOffset=" $ string(FireOffset));
  3248. out_YPos += out_YL;
  3249. HUD.Canvas.SetPos(4.0, out_YPos);
  3250. // End:0x664
  3251. if(Instigator.IsFirstPerson())
  3252. {
  3253. HUD.DrawDebugSphere(GetMuzzleLoc(), 3.0, 6, 255, 0, 0);
  3254. }
  3255. // End:0x769
  3256. else
  3257. {
  3258. // End:0x6F1
  3259. if(CurrentFireMode == 4)
  3260. {
  3261. HUD.DrawDebugSphere(Instigator.GetPawnViewLocation() + (GrenadeFireOffset >> Instigator.Rotation), 3.0, 6, 0, 255, 0);
  3262. }
  3263. // End:0x769
  3264. else
  3265. {
  3266. HUD.DrawDebugSphere(Instigator.GetPawnViewLocation() + (FireOffset >> Instigator.Rotation), 3.0, 6, 255, 0, 0);
  3267. }
  3268. }
  3269. }
  3270. // End:0xADE
  3271. if(HUD.ShouldDisplayDebug('animation'))
  3272. {
  3273. HUD.Canvas.SetPos(4.0, out_YPos);
  3274. HUD.Canvas.DrawText("---------- KFWeapon: animation ----------");
  3275. out_YPos += out_YL;
  3276. // End:0x997
  3277. if((GetWeaponAnimNodeSeq()) != none)
  3278. {
  3279. CurAnim = string(GetWeaponAnimNodeSeq().AnimSeqName);
  3280. HUD.Canvas.DrawText((((("WEAPON WeaponAnim=" $ CurAnim) $ " Rate: ") $ string(GetWeaponAnimNodeSeq().Rate)) $ " Position: ") $ string(GetWeaponAnimNodeSeq().CurrentTime));
  3281. out_YPos += out_YL;
  3282. HUD.Canvas.SetPos(4.0, out_YPos);
  3283. }
  3284. // End:0xADE
  3285. if((GetArmAnimNodeSeq()) != none)
  3286. {
  3287. CurHandAnim = string(GetArmAnimNodeSeq().AnimSeqName);
  3288. HUD.Canvas.DrawText((((("WEAPON HandAnim=" $ CurHandAnim) $ " Rate: ") $ string(GetArmAnimNodeSeq().Rate)) $ " Position: ") $ string(GetArmAnimNodeSeq().CurrentTime));
  3289. out_YPos += out_YL;
  3290. HUD.Canvas.SetPos(4.0, out_YPos);
  3291. }
  3292. }
  3293. // End:0xE23
  3294. if(HUD.ShouldDisplayDebug('aim3d'))
  3295. {
  3296. HUD.Canvas.SetPos(4.0, out_YPos);
  3297. HUD.Canvas.DrawText("---------- KFWeapon: aim3d ----------");
  3298. out_YPos += out_YL;
  3299. // End:0xC3B
  3300. if(KFPlayerController(Instigator.Controller) != none)
  3301. {
  3302. KFPlayerController(Instigator.Controller).GetPlayerViewPoint(FADebugLineStart, AimRotation);
  3303. }
  3304. // End:0xCE5
  3305. if(bDebugRecoilPosition)
  3306. {
  3307. WeaponBufferRot.Pitch = RecoilISMaxPitchLimit;
  3308. WeaponBufferRot.Yaw += TotalRecoilRotator.Yaw;
  3309. WeaponBufferRot.Pitch += TotalRecoilRotator.Pitch;
  3310. }
  3311. // End:0xD2B
  3312. else
  3313. {
  3314. WeaponBufferRot = KFPlayerController(Instigator.Controller).WeaponBufferRotation;
  3315. }
  3316. FADebugLineRot.Yaw = AimRotation.Yaw + WeaponBufferRot.Yaw;
  3317. FADebugLineRot.Pitch = AimRotation.Pitch + WeaponBufferRot.Pitch;
  3318. FADebugLineEnd = FADebugLineStart + (float(400) * vector(FADebugLineRot));
  3319. DrawDebugSphere(FADebugLineEnd, 5.0, 8, 0, 255, 0, false);
  3320. }
  3321. // End:0x19F9
  3322. if(HUD.ShouldDisplayDebug('recoil3d'))
  3323. {
  3324. HUD.Canvas.SetPos(4.0, out_YPos);
  3325. HUD.Canvas.DrawText("---------- KFWeapon: recoil3d ----------");
  3326. out_YPos += out_YL;
  3327. // End:0xF83
  3328. if(KFPlayerController(Instigator.Controller) != none)
  3329. {
  3330. KFPlayerController(Instigator.Controller).GetPlayerViewPoint(FADebugLineStart, FADebugViewRotation);
  3331. }
  3332. FADebugLineRot.Yaw = FADebugViewRotation.Yaw + TotalRecoilRotator.Yaw;
  3333. FADebugLineRot.Pitch = FADebugViewRotation.Pitch + TotalRecoilRotator.Pitch;
  3334. FADebugLineEnd = FADebugLineStart + (float(20) * vector(FADebugLineRot));
  3335. DrawDebugBox(FADebugLineEnd, vect(0.10, 0.10, 0.10), 255, 255, 0, false);
  3336. FADebugLineRot.Yaw = FADebugViewRotation.Yaw;
  3337. FADebugLineRot.Pitch = FADebugViewRotation.Pitch;
  3338. FADebugLineEnd = FADebugLineStart + (float(20) * vector(FADebugLineRot));
  3339. DrawDebugBox(FADebugLineEnd, vect(0.10, 0.10, 0.10), 255, 0, 128, false);
  3340. // End:0x1199
  3341. if(bUsingSights)
  3342. {
  3343. UsedMaxYawLimit = RecoilISMaxYawLimit;
  3344. UsedMinYawLimit = RecoilISMinYawLimit;
  3345. UsedMaxPitchLimit = RecoilISMaxPitchLimit;
  3346. UsedMinPitchLimit = RecoilISMinPitchLimit;
  3347. }
  3348. // End:0x11E5
  3349. else
  3350. {
  3351. UsedMaxYawLimit = RecoilMaxYawLimit;
  3352. UsedMinYawLimit = RecoilMinYawLimit;
  3353. UsedMaxPitchLimit = RecoilMaxPitchLimit;
  3354. UsedMinPitchLimit = RecoilMinPitchLimit;
  3355. }
  3356. FADebugLineRot.Yaw = FADebugViewRotation.Yaw + UsedMinYawLimit;
  3357. FADebugLineRot.Pitch = FADebugViewRotation.Pitch + UsedMaxPitchLimit;
  3358. FADebugLineEnd = FADebugLineStart + (float(20) * vector(FADebugLineRot));
  3359. FADebugLineUL = FADebugLineEnd;
  3360. FADebugLineRot.Yaw = FADebugViewRotation.Yaw + UsedMaxYawLimit;
  3361. FADebugLineRot.Pitch = FADebugViewRotation.Pitch + UsedMaxPitchLimit;
  3362. FADebugLineEnd = FADebugLineStart + (float(20) * vector(FADebugLineRot));
  3363. FADebugLineUR = FADebugLineEnd;
  3364. FADebugLineRot.Yaw = FADebugViewRotation.Yaw + UsedMinYawLimit;
  3365. FADebugLineRot.Pitch = FADebugViewRotation.Pitch + UsedMinPitchLimit;
  3366. FADebugLineEnd = FADebugLineStart + (float(20) * vector(FADebugLineRot));
  3367. FADebugLineLL = FADebugLineEnd;
  3368. FADebugLineRot.Yaw = FADebugViewRotation.Yaw + UsedMaxYawLimit;
  3369. FADebugLineRot.Pitch = FADebugViewRotation.Pitch + UsedMinPitchLimit;
  3370. FADebugLineEnd = FADebugLineStart + (float(20) * vector(FADebugLineRot));
  3371. FADebugLineLR = FADebugLineEnd;
  3372. DrawDebugLine(FADebugLineUL, FADebugLineUR, 255, 0, 255, false);
  3373. DrawDebugLine(FADebugLineUR, FADebugLineLR, 255, 0, 255, false);
  3374. DrawDebugLine(FADebugLineLR, FADebugLineLL, 255, 0, 255, false);
  3375. DrawDebugLine(FADebugLineLL, FADebugLineUL, 255, 0, 255, false);
  3376. FADebugLineRot.Yaw = int(float(FADebugViewRotation.Yaw) + (float(UsedMinYawLimit) + (float(65535 - UsedMinYawLimit) * (1.0 - FullRecoilYawPct))));
  3377. FADebugLineRot.Pitch = int(float(FADebugViewRotation.Pitch) + (float(UsedMaxPitchLimit) * FullRecoilPitchPct));
  3378. FADebugLineEnd = FADebugLineStart + (float(20) * vector(FADebugLineRot));
  3379. FADebugLineUL = FADebugLineEnd;
  3380. FADebugLineRot.Yaw = int(float(FADebugViewRotation.Yaw) + (float(UsedMaxYawLimit) * FullRecoilYawPct));
  3381. FADebugLineRot.Pitch = int(float(FADebugViewRotation.Pitch) + (float(UsedMaxPitchLimit) * FullRecoilPitchPct));
  3382. FADebugLineEnd = FADebugLineStart + (float(20) * vector(FADebugLineRot));
  3383. FADebugLineUR = FADebugLineEnd;
  3384. FADebugLineRot.Yaw = int(float(FADebugViewRotation.Yaw) + (float(UsedMinYawLimit) + (float(65535 - UsedMinYawLimit) * (1.0 - FullRecoilYawPct))));
  3385. FADebugLineRot.Pitch = int(float(FADebugViewRotation.Pitch) + (float(UsedMinPitchLimit) + (float(65535 - UsedMinPitchLimit) * (1.0 - FullRecoilYawPct))));
  3386. FADebugLineEnd = FADebugLineStart + (float(20) * vector(FADebugLineRot));
  3387. FADebugLineLL = FADebugLineEnd;
  3388. FADebugLineRot.Yaw = int(float(FADebugViewRotation.Yaw) + (float(UsedMaxYawLimit) * FullRecoilYawPct));
  3389. FADebugLineRot.Pitch = int(float(FADebugViewRotation.Pitch) + (float(UsedMinPitchLimit) + (float(65535 - UsedMinPitchLimit) * (1.0 - FullRecoilYawPct))));
  3390. FADebugLineEnd = FADebugLineStart + (float(20) * vector(FADebugLineRot));
  3391. FADebugLineLR = FADebugLineEnd;
  3392. DrawDebugLine(FADebugLineUL, FADebugLineUR, 128, 255, 255, false);
  3393. DrawDebugLine(FADebugLineUR, FADebugLineLR, 128, 255, 255, false);
  3394. DrawDebugLine(FADebugLineLR, FADebugLineLL, 128, 255, 255, false);
  3395. DrawDebugLine(FADebugLineLL, FADebugLineUL, 128, 255, 255, false);
  3396. }
  3397. //return;
  3398. }
  3399.  
  3400. event BeginState(name PreviousStateName)
  3401. {
  3402. //return;
  3403. }
  3404.  
  3405. event EndState(name NextStateName)
  3406. {
  3407. //return;
  3408. }
  3409.  
  3410. simulated function byte GetWeaponStateId()
  3411. {
  3412. return 0;
  3413. //return ReturnValue;
  3414. }
  3415.  
  3416. simulated function NotifyBeginState()
  3417. {
  3418. KFPawn(Instigator).WeaponStateChanged(GetWeaponStateId());
  3419. //return;
  3420. }
  3421.  
  3422. simulated function NotifyEndState()
  3423. {
  3424. KFPawn(Instigator).WeaponStateChanged(0);
  3425. //return;
  3426. }
  3427.  
  3428. reliable server function ServerSyncReload(int ClientSpareAmmoCount)
  3429. {
  3430. local int ClientReloadAmount;
  3431.  
  3432. // End:0x9E
  3433. if(bAllowClientAmmoTracking && ClientSpareAmmoCount < SpareAmmoCount[0])
  3434. {
  3435. ClientReloadAmount = Min(SpareAmmoCount[0] - ClientSpareAmmoCount, SpareAmmoCount[0]);
  3436. SpareAmmoCount[0] -= ClientReloadAmount;
  3437. AmmoCount[0] = byte(Min(AmmoCount[0] + ClientReloadAmount, MagazineCapacity[0]));
  3438. }
  3439. //return;
  3440. }
  3441.  
  3442. simulated function Activate()
  3443. {
  3444. // End:0x18
  3445. if(bUseAltFireMode)
  3446. {
  3447. ClearPendingFire(0);
  3448. }
  3449. AttachWeaponTo(Instigator.Mesh);
  3450. super.Activate();
  3451. //return;
  3452. }
  3453.  
  3454. simulated function PlayIdleAnim()
  3455. {
  3456. //return;
  3457. }
  3458.  
  3459. simulated function StartIdleFidgetTimer()
  3460. {
  3461. //return;
  3462. }
  3463.  
  3464. simulated function IdleFidgetTimer()
  3465. {
  3466. //return;
  3467. }
  3468.  
  3469. simulated function bool CanPlayIdleFidget(optional bool bOnReload)
  3470. {
  3471. //return ReturnValue;
  3472. }
  3473.  
  3474. simulated function bool PlayIdleFidgetAnim()
  3475. {
  3476. //return ReturnValue;
  3477. }
  3478.  
  3479. simulated function ANIMNOTIFY_EnableAdditiveBob()
  3480. {
  3481. //return;
  3482. }
  3483.  
  3484. simulated function TimeWeaponEquipping()
  3485. {
  3486. PlayWeaponEquip();
  3487. SetTimer(EquipTime, false, 'WeaponEquipped');
  3488. //return;
  3489. }
  3490.  
  3491. simulated function WeaponEquipped()
  3492. {
  3493. //return;
  3494. }
  3495.  
  3496. simulated function PlayWeaponEquip()
  3497. {
  3498. PlayAnimation(EquipAnim, 0.0, 0.0);
  3499. //return;
  3500. }
  3501.  
  3502. simulated function SetSimplePutDown(bool bPutDownWeapon)
  3503. {
  3504. // End:0x1B
  3505. if(bPutDownWeapon)
  3506. {
  3507. GotoState('WeaponDownSimple');
  3508. }
  3509. //return;
  3510. }
  3511.  
  3512. simulated function bool CanSwitchWeapons()
  3513. {
  3514. return true;
  3515. //return ReturnValue;
  3516. }
  3517.  
  3518. simulated function TimeWeaponPutDown()
  3519. {
  3520. // End:0x2C
  3521. if(Instigator.IsFirstPerson())
  3522. {
  3523. PlayWeaponPutDown();
  3524. }
  3525. super.TimeWeaponPutDown();
  3526. //return;
  3527. }
  3528.  
  3529. simulated function PlayWeaponPutDown()
  3530. {
  3531. PlayAnimation(PutDownAnim, PutDownTime);
  3532. //return;
  3533. }
  3534.  
  3535. simulated function bool TryPutDown()
  3536. {
  3537. local float MinTimerTarget, TimerCount;
  3538.  
  3539. bWeaponPutDown = true;
  3540. // End:0x32
  3541. if(!IsTimerActive('RefireCheckTimer'))
  3542. {
  3543. PutDownWeapon();
  3544. }
  3545. // End:0xBF
  3546. else
  3547. {
  3548. MinTimerTarget = GetTimerRate('RefireCheckTimer') * MinFiringPutDownPct;
  3549. TimerCount = GetTimerCount('RefireCheckTimer');
  3550. // End:0x9D
  3551. if(TimerCount >= MinTimerTarget)
  3552. {
  3553. PutDownWeapon();
  3554. }
  3555. // End:0xBF
  3556. else
  3557. {
  3558. SetTimer(MinTimerTarget - TimerCount, false, 'FiringPutDownWeapon');
  3559. }
  3560. }
  3561. return true;
  3562. //return ReturnValue;
  3563. }
  3564.  
  3565. simulated function FiringPutDownWeapon()
  3566. {
  3567. // End:0x17
  3568. if(bWeaponPutDown)
  3569. {
  3570. PutDownWeapon();
  3571. }
  3572. //return;
  3573. }
  3574.  
  3575. simulated function TimeWeaponFiring(byte FireModeNum)
  3576. {
  3577. local float AdjustedFireInterval;
  3578. local KFPerk CurrentPerk;
  3579.  
  3580. // End:0x99
  3581. if(!IsTimerActive('RefireCheckTimer'))
  3582. {
  3583. AdjustedFireInterval = GetFireInterval(FireModeNum);
  3584. CurrentPerk = GetPerk();
  3585. // End:0x82
  3586. if(CurrentPerk != none)
  3587. {
  3588. GetPerk().ModifyRateOfFire(AdjustedFireInterval);
  3589. }
  3590. SetTimer(AdjustedFireInterval, true, 'RefireCheckTimer');
  3591. }
  3592. //return;
  3593. }
  3594.  
  3595. reliable server function ServerGotoGrenadeFiring()
  3596. {
  3597. SendToFiringState(4);
  3598. //return;
  3599. }
  3600.  
  3601. function SetWeakZedGrabCooldownOnPawn(float WeakZedGrabCooldown)
  3602. {
  3603. local KFPawn KFP;
  3604.  
  3605. // End:0x67
  3606. if(Role == ROLE_Authority)
  3607. {
  3608. KFP = KFPawn(Instigator);
  3609. // End:0x67
  3610. if(KFP != none)
  3611. {
  3612. KFP.SetWeakGrabCoolDown(WeakZedGrabCooldown);
  3613. }
  3614. }
  3615. //return;
  3616. }
  3617.  
  3618. simulated function PlayGrenadeThrow()
  3619. {
  3620. local name WeaponFireAnimName;
  3621.  
  3622. PlayFiringSound(CurrentFireMode);
  3623. // End:0xB6
  3624. if((Instigator != none) && Instigator.IsFirstPerson())
  3625. {
  3626. WeaponFireAnimName = 'Nade_Throw';
  3627. // End:0xB6
  3628. if(WeaponFireAnimName != 'None')
  3629. {
  3630. PlayAnimation(WeaponFireAnimName, MySkelMesh.GetAnimLength(WeaponFireAnimName), FireTweenTime);
  3631. }
  3632. }
  3633. //return;
  3634. }
  3635.  
  3636. simulated function ReloadStatusTimer()
  3637. {
  3638. //return;
  3639. }
  3640.  
  3641. simulated function ReloadAmmoTimer()
  3642. {
  3643. //return;
  3644. }
  3645.  
  3646. simulated function ReloadComplete()
  3647. {
  3648. //return;
  3649. }
  3650.  
  3651. simulated function AbortReload()
  3652. {
  3653. //return;
  3654. }
  3655.  
  3656. simulated function InitializeReload()
  3657. {
  3658. ReloadAmountLeft = byte(Min(MagazineCapacity[0] - AmmoCount[0], SpareAmmoCount[0]));
  3659. // End:0x5A
  3660. if(Role < ROLE_Authority)
  3661. {
  3662. ServerSendToReload(ReloadAmountLeft);
  3663. }
  3664. //return;
  3665. }
  3666.  
  3667. reliable server function ServerSendToReload(byte ClientReloadAmount)
  3668. {
  3669. ReloadAmountLeft = ClientReloadAmount;
  3670. SendToFiringState(2);
  3671. //return;
  3672. }
  3673.  
  3674. simulated function TimeWeaponReloading()
  3675. {
  3676. local name ReloadAnimName;
  3677. local float ReloadDuration, GiveAmmoTime;
  3678. local KFPerk InstigatorPerk;
  3679.  
  3680. ReloadStatus = GetNextReloadStatus();
  3681. // End:0x34
  3682. if(ReloadStatus == 4)
  3683. {
  3684. ReloadComplete();
  3685. return;
  3686. }
  3687. InstigatorPerk = GetPerk();
  3688. ReloadAnimName = GetReloadAnimName(InstigatorPerk.GetUsingTactialReload(self));
  3689. // End:0x120
  3690. if(MySkelMesh != none)
  3691. {
  3692. ReloadDuration = MySkelMesh.GetAnimLength(ReloadAnimName);
  3693. GiveAmmoTime = MySkelMesh.GetAnimInterruptTime(ReloadAnimName);
  3694. InstigatorPerk.ModifyReloadTime(ReloadDuration, GiveAmmoTime);
  3695. }
  3696. // End:0x263
  3697. if(ReloadDuration > 0.0)
  3698. {
  3699. MakeNoise(0.50, 'PlayerReload');
  3700. // End:0x185
  3701. if(Instigator.IsFirstPerson())
  3702. {
  3703. PlayAnimation(ReloadAnimName, ReloadDuration);
  3704. }
  3705. // End:0x222
  3706. if(ReloadStatus == 2)
  3707. {
  3708. // End:0x208
  3709. if((GiveAmmoTime >= ReloadDuration) && bReloadFromMagazine)
  3710. {
  3711. // End:0x208
  3712. if(bLogAnimation)
  3713. {
  3714. LogInternal("TimeWeaponReloading: no anim interrupt for" @ string(ReloadAnimName));
  3715. }
  3716. }
  3717. SetTimer(GiveAmmoTime, false, 'ReloadAmmoTimer');
  3718. }
  3719. // End:0x249
  3720. else
  3721. {
  3722. // End:0x249
  3723. if(ReloadStatus == 3)
  3724. {
  3725. ReloadDuration = GiveAmmoTime;
  3726. }
  3727. }
  3728. SetTimer(ReloadDuration, false, 'ReloadStatusTimer');
  3729. }
  3730. // End:0x28A
  3731. else
  3732. {
  3733. WarnInternal("ReloadDuration is zero!!!");
  3734. ReloadComplete();
  3735. }
  3736. //return;
  3737. }
  3738.  
  3739. simulated function KFWeapon.EReloadStatus GetNextReloadStatus()
  3740. {
  3741. // End:0x27
  3742. if(bReloadFromMagazine)
  3743. {
  3744. // End:0x24
  3745. if(ReloadStatus < 2)
  3746. {
  3747. return 2;
  3748. }
  3749. return 4;
  3750. }
  3751. switch(ReloadStatus)
  3752. {
  3753. // End:0x42
  3754. case 0:
  3755. return 1;
  3756. // End:0x4A
  3757. case 1:
  3758. return 2;
  3759. // End:0x78
  3760. case 2:
  3761. // End:0x75
  3762. if(HasSpareAmmo() && ReloadAmountLeft > 0)
  3763. {
  3764. return 2;
  3765. }
  3766. return 3;
  3767. // End:0xFFFF
  3768. default:
  3769. return 4;
  3770. }
  3771. //return ReturnValue;
  3772. }
  3773.  
  3774. simulated function name GetReloadAnimName(bool bTacticalReload)
  3775. {
  3776. // End:0x95
  3777. if(!bReloadFromMagazine)
  3778. {
  3779. switch(ReloadStatus)
  3780. {
  3781. // End:0x49
  3782. case 1:
  3783. return ((bTacticalReload) ? 'Reload_Open_Elite' : 'Reload_Open');
  3784. // End:0x70
  3785. case 3:
  3786. return ((bTacticalReload) ? 'Reload_Close_Elite' : 'Reload_Close');
  3787. // End:0xFFFF
  3788. default:
  3789. return ((bTacticalReload) ? 'Reload_Insert_Elite' : 'Reload_Insert');
  3790. }
  3791. }
  3792. // End:0xD0
  3793. if(AmmoCount[0] > 0)
  3794. {
  3795. return ((bTacticalReload) ? 'Reload_Half_Elite' : 'Reload_Half');
  3796. }
  3797. // End:0xF2
  3798. else
  3799. {
  3800. return ((bTacticalReload) ? 'Reload_Empty_Elite' : 'Reload_Empty');
  3801. }
  3802. //return ReturnValue;
  3803. }
  3804.  
  3805. simulated function PerformReload()
  3806. {
  3807. local int ReloadAmount;
  3808.  
  3809. // End:0x34
  3810. if(bInfiniteSpareAmmo)
  3811. {
  3812. AmmoCount[0] = byte(MagazineCapacity[0]);
  3813. ReloadAmountLeft = 0;
  3814. return;
  3815. }
  3816. // End:0x136
  3817. if(((Role == ROLE_Authority) && !bAllowClientAmmoTracking) || Instigator.IsLocallyControlled() && bAllowClientAmmoTracking)
  3818. {
  3819. // End:0x136
  3820. if((MaxSpareAmmo[0] > 0) && SpareAmmoCount[0] > 0)
  3821. {
  3822. // End:0xE2
  3823. if(bReloadFromMagazine)
  3824. {
  3825. ReloadAmount = Min(ReloadAmountLeft, SpareAmmoCount[0]);
  3826. }
  3827. // End:0xED
  3828. else
  3829. {
  3830. ReloadAmount = 1;
  3831. }
  3832. AmmoCount[0] = byte(Min(AmmoCount[0] + ReloadAmount, MagazineCapacity[0]));
  3833. SpareAmmoCount[0] -= ReloadAmount;
  3834. }
  3835. }
  3836. // End:0x152
  3837. if(bReloadFromMagazine)
  3838. {
  3839. ReloadAmountLeft = 0;
  3840. }
  3841. // End:0x171
  3842. else
  3843. {
  3844. // End:0x171
  3845. if(ReloadAmountLeft > 0)
  3846. {
  3847. -- ReloadAmountLeft;
  3848. }
  3849. }
  3850. //return;
  3851. }
  3852.  
  3853. simulated function SprintLoopTimer()
  3854. {
  3855. //return;
  3856. }
  3857.  
  3858. simulated function SprintRetryTimer()
  3859. {
  3860. //return;
  3861. }
  3862.  
  3863. simulated function PlaySprintStart()
  3864. {
  3865. local KFPlayerController KFPC;
  3866. local float AnimDuration;
  3867.  
  3868. // End:0x22
  3869. if(bZoomingOut)
  3870. {
  3871. SetTimer(0.10, false, 'SprintRetryTimer');
  3872. return;
  3873. }
  3874. // End:0xC8
  3875. if(Instigator.IsLocallyControlled())
  3876. {
  3877. KFPC = KFPlayerController(Instigator.Controller);
  3878. // End:0xB1
  3879. if(KFPC != none)
  3880. {
  3881. KFPC.HandleTransitionFOV(PlayerSprintFOV, 0.250);
  3882. }
  3883. PlayAnimation('Sprint_In');
  3884. }
  3885. AnimDuration = MySkelMesh.GetAnimLength('Sprint_In');
  3886. // End:0x127
  3887. if(AnimDuration > 0.0)
  3888. {
  3889. SetTimer(AnimDuration, false, 'SprintLoopTimer');
  3890. }
  3891. // End:0x131
  3892. else
  3893. {
  3894. SprintLoopTimer();
  3895. }
  3896. //return;
  3897. }
  3898.  
  3899. simulated function PlaySprintLoop()
  3900. {
  3901. // End:0xFA
  3902. if(Instigator.IsLocallyControlled())
  3903. {
  3904. SprintAnimRate = GetSprintAnimRate();
  3905. // End:0x65
  3906. if(SprintCameraAnimInst != none)
  3907. {
  3908. SprintCameraAnimInst.Stop(true);
  3909. }
  3910. // End:0xB1
  3911. if(SprintCameraAnim != none)
  3912. {
  3913. SprintCameraAnimInst = PlayCameraAnim(SprintCameraAnim, SprintAnimRate, SprintAnimRate, 0.30, 0.50, true, true);
  3914. }
  3915. PlayAnimation('Sprint_Loop', MySkelMesh.GetAnimLength('Sprint_Loop') / SprintAnimRate, true);
  3916. }
  3917. //return;
  3918. }
  3919.  
  3920. simulated function PlaySprintEnd()
  3921. {
  3922. local KFPlayerController KFPC;
  3923.  
  3924. // End:0xCC
  3925. if(Instigator.IsLocallyControlled())
  3926. {
  3927. KFPC = KFPlayerController(Instigator.Controller);
  3928. // End:0xB5
  3929. if((KFPC != none) && !bUsingSights)
  3930. {
  3931. KFPC.HandleTransitionFOV(KFPC.DefaultFOV, 0.250);
  3932. }
  3933. PlayAnimation('Sprint_Out');
  3934. }
  3935. //return;
  3936. }
  3937.  
  3938. simulated function UpdateSprintAnimRate()
  3939. {
  3940. local float NewAnimRate;
  3941.  
  3942. NewAnimRate = GetSprintAnimRate();
  3943. // End:0x2D
  3944. if(NewAnimRate ~= SprintAnimRate)
  3945. {
  3946. return;
  3947. }
  3948. SprintAnimRate = NewAnimRate;
  3949. // End:0x8B
  3950. if(SprintCameraAnimInst != none)
  3951. {
  3952. SprintCameraAnimInst.Update(SprintAnimRate, SprintAnimRate, 1.0, 0.50);
  3953. }
  3954. ChangeAnimationRate('Sprint_Loop', SprintAnimRate);
  3955. //return;
  3956. }
  3957.  
  3958. simulated function float GetSprintAnimRate()
  3959. {
  3960. return 1.0;
  3961. //return ReturnValue;
  3962. }
  3963.  
  3964. simulated function bool IsMeleeing()
  3965. {
  3966. //return ReturnValue;
  3967. }
  3968.  
  3969. simulated function bool ShouldContinueMelee(optional int ChainCount)
  3970. {
  3971. //return ReturnValue;
  3972. }
  3973.  
  3974. simulated function NotifyMeleeCollision(Actor HitActor, optional Vector HitLocation)
  3975. {
  3976. //return;
  3977. }
  3978.  
  3979. simulated function PlayMeleeAnimation(name AnimName, out float out_Rate, float BlendTime)
  3980. {
  3981. local KFPerk InstigatorPerk;
  3982. local float Duration;
  3983.  
  3984. InstigatorPerk = GetPerk();
  3985. // End:0x4B
  3986. if(InstigatorPerk != none)
  3987. {
  3988. InstigatorPerk.ModifyMeleeAttackSpeed(out_Rate);
  3989. }
  3990. Duration = MySkelMesh.GetAnimLength(AnimName);
  3991. Duration *= out_Rate;
  3992. PlayAnimation(AnimName, Duration, BlendTime);
  3993. //return;
  3994. }
  3995.  
  3996. simulated function int GetMeleeDamage(byte FireModeNum, optional Vector RayDir)
  3997. {
  3998. return int(InstantHitDamage[FireModeNum]);
  3999. //return ReturnValue;
  4000. }
  4001.  
  4002. auto simulated state Inactive
  4003. {
  4004. ignores ForceReload, ShouldAutoReload, AllowIronSights;
  4005.  
  4006. simulated function BeginState(name PreviousStateName)
  4007. {
  4008. // End:0x3D
  4009. if(bUsingSights)
  4010. {
  4011. // End:0x3A
  4012. if(Instigator.IsLocallyControlled())
  4013. {
  4014. SetIronSights(false);
  4015. }
  4016. }
  4017. // End:0x57
  4018. else
  4019. {
  4020. // End:0x57
  4021. if(!bHasIronSights)
  4022. {
  4023. ClearPendingFire(1);
  4024. }
  4025. }
  4026. ClearPendingFire(2);
  4027. // End:0xE9
  4028. if((bAllowClientAmmoTracking && Role == ROLE_Authority) && WorldInfo.TimeSeconds > CreationTime)
  4029. {
  4030. ClientForceAmmoUpdate(AmmoCount[0], SpareAmmoCount[0]);
  4031. ClientForceSecondaryAmmoUpdate(AmmoCount[1]);
  4032. }
  4033. bPendingAutoSwitchOnDryFire = false;
  4034. super.BeginState(PreviousStateName);
  4035. //return;
  4036. }
  4037. stop;
  4038. }
  4039.  
  4040. simulated state Active
  4041. {
  4042. simulated event OnAnimEnd(AnimNodeSequence SeqNode, float PlayedTime, float ExcessTime)
  4043. {
  4044. // End:0x33
  4045. if(WorldInfo.NetMode != NM_DedicatedServer)
  4046. {
  4047. PlayIdleAnim();
  4048. }
  4049. //return;
  4050. }
  4051.  
  4052. simulated function PlayIdleAnim()
  4053. {
  4054. local int IdleIndex;
  4055.  
  4056. // End:0xF3
  4057. if(Instigator.IsFirstPerson())
  4058. {
  4059. // End:0x83
  4060. if(bUsingSights && IdleSightedAnims.Length > 0)
  4061. {
  4062. IdleIndex = Rand(IdleSightedAnims.Length);
  4063. PlayAnimation(IdleSightedAnims[IdleIndex], 0.0, true, 0.10);
  4064. }
  4065. // End:0xD2
  4066. else
  4067. {
  4068. // End:0xD2
  4069. if(IdleAnims.Length > 0)
  4070. {
  4071. IdleIndex = Rand(IdleAnims.Length);
  4072. PlayAnimation(IdleAnims[IdleIndex], 0.0, true, 0.20);
  4073. }
  4074. }
  4075. StartIdleFidgetTimer();
  4076. ToggleAdditiveBobAnim(!bUsingSights);
  4077. }
  4078. //return;
  4079. }
  4080.  
  4081. simulated function GotoWeaponSprinting()
  4082. {
  4083. GotoState('WeaponSprinting');
  4084. //return;
  4085. }
  4086.  
  4087. simulated event BeginState(name PreviousStateName)
  4088. {
  4089. bIronSightOnBringUp = false;
  4090. // End:0x8A
  4091. if((RecoilRate > float(0)) && RecoilBlendOutRatio > float(0))
  4092. {
  4093. RecoilYawBlendOutRate = int((float(maxRecoilYaw) / RecoilRate) * RecoilBlendOutRatio);
  4094. RecoilPitchBlendOutRate = int((float(maxRecoilPitch) / RecoilRate) * RecoilBlendOutRatio);
  4095. }
  4096. // End:0xC9
  4097. if(!WeaponIsAnimating() || !IsTimerActive('OnAnimEnd'))
  4098. {
  4099. OnAnimEnd(none, 0.0, 0.0);
  4100. }
  4101. bEnableTiltSkelControl = true;
  4102. // End:0x184
  4103. if((InvManager != none) && InvManager.LastAttemptedSwitchToWeapon != none)
  4104. {
  4105. // End:0x164
  4106. if(InvManager.LastAttemptedSwitchToWeapon != self)
  4107. {
  4108. InvManager.LastAttemptedSwitchToWeapon.ClientWeaponSet(true);
  4109. }
  4110. InvManager.LastAttemptedSwitchToWeapon = none;
  4111. }
  4112. super.BeginState(PreviousStateName);
  4113. //return;
  4114. }
  4115.  
  4116. simulated event EndState(name NextStateName)
  4117. {
  4118. ClearTimer('IdleFidgetTimer');
  4119. ToggleAdditiveBobAnim(false);
  4120. super(Object).EndState(NextStateName);
  4121. //return;
  4122. }
  4123.  
  4124. simulated function StartIdleFidgetTimer()
  4125. {
  4126. // End:0x32
  4127. if(IdleFidgetAnims.Length > 0)
  4128. {
  4129. SetTimer(RandRange(1.0, 10.0), false, 'IdleFidgetTimer');
  4130. }
  4131. //return;
  4132. }
  4133.  
  4134. simulated function IdleFidgetTimer()
  4135. {
  4136. local bool bIsPlaying;
  4137.  
  4138. // End:0x23
  4139. if(CanPlayIdleFidget())
  4140. {
  4141. bIsPlaying = PlayIdleFidgetAnim();
  4142. }
  4143. // End:0x45
  4144. if(!bIsPlaying)
  4145. {
  4146. SetTimer(20.0, false, 'IdleFidgetTimer');
  4147. }
  4148. //return;
  4149. }
  4150.  
  4151. simulated function bool CanPlayIdleFidget(optional bool bOnReload)
  4152. {
  4153. local Pawn P;
  4154.  
  4155. // End:0x24
  4156. if(bCanBeReloaded && !HasAmmo(0))
  4157. {
  4158. return false;
  4159. }
  4160. // End:0x33
  4161. if(bUsingSights)
  4162. {
  4163. return false;
  4164. }
  4165. // End:0x1E3
  4166. if(!bOnReload)
  4167. {
  4168. // End:0x77
  4169. if((WorldInfo.TimeSeconds - LastIdleFidgetAnimTime) < 20.0)
  4170. {
  4171. return false;
  4172. }
  4173. // End:0xC1
  4174. if((WorldInfo.TimeSeconds - Instigator.LastPainTime) < 10.0)
  4175. {
  4176. return false;
  4177. }
  4178. // End:0x114
  4179. if((WorldInfo.TimeSeconds - KFPawn(Instigator).LastWeaponFireTime) < 10.0)
  4180. {
  4181. return false;
  4182. }
  4183. // End:0x1DF
  4184. foreach WorldInfo.AllPawns(class'Pawn', P)
  4185. {
  4186. // End:0x1DE
  4187. if(((WorldInfo.TimeSeconds - P.LastRenderTime) < 1.0) && P.GetTeamNum() != Instigator.GetTeamNum())
  4188. {
  4189. return false;
  4190. }
  4191. }
  4192. }
  4193. // End:0x23E
  4194. else
  4195. {
  4196. // End:0x218
  4197. if((WorldInfo.TimeSeconds - LastIdleFidgetAnimTime) < 1.0)
  4198. {
  4199. return false;
  4200. }
  4201. // End:0x23E
  4202. if(!Instigator.IsLocallyControlled())
  4203. {
  4204. return false;
  4205. }
  4206. }
  4207. return true;
  4208. //return ReturnValue;
  4209. }
  4210.  
  4211. simulated function bool PlayIdleFidgetAnim()
  4212. {
  4213. local name AnimName;
  4214.  
  4215. AnimName = IdleFidgetAnims[Rand(IdleFidgetAnims.Length)];
  4216. // End:0x9B
  4217. if(MySkelMesh.FindAnimSequence(AnimName) != none)
  4218. {
  4219. ToggleAdditiveBobAnim(false);
  4220. PlayAnimation(AnimName);
  4221. LastIdleFidgetAnimTime = WorldInfo.TimeSeconds;
  4222. return true;
  4223. }
  4224. return false;
  4225. //return ReturnValue;
  4226. }
  4227.  
  4228. simulated function bool CanReload()
  4229. {
  4230. // End:0x0F
  4231. if(global.CanReload())
  4232. {
  4233. return true;
  4234. }
  4235. // End:0x38
  4236. if(PendingFire(2) && CanPlayIdleFidget(true))
  4237. {
  4238. PlayIdleFidgetAnim();
  4239. }
  4240. return false;
  4241. //return ReturnValue;
  4242. }
  4243.  
  4244. simulated function ANIMNOTIFY_EnableAdditiveBob()
  4245. {
  4246. ToggleAdditiveBobAnim(true, 0.30);
  4247. //return;
  4248. }
  4249.  
  4250. reliable server function ServerSyncReload(int ClientSpareAmmoCount)
  4251. {
  4252. local int I;
  4253.  
  4254. global.ServerSyncReload(ClientSpareAmmoCount);
  4255. I = 0;
  4256. J0x1E:
  4257. // End:0x6F [Loop If]
  4258. if(I < GetPendingFireLength())
  4259. {
  4260. // End:0x61
  4261. if(PendingFire(I))
  4262. {
  4263. BeginFire(byte(I));
  4264. }
  4265. ++ I;
  4266. // [Loop Continue]
  4267. goto J0x1E;
  4268. }
  4269. //return;
  4270. }
  4271. stop;
  4272. }
  4273.  
  4274. simulated state WeaponEquipping
  4275. {
  4276. simulated function byte GetWeaponStateId()
  4277. {
  4278. return 23;
  4279. //return ReturnValue;
  4280. }
  4281.  
  4282. simulated function bool TryPutDown()
  4283. {
  4284. bWeaponPutDown = true;
  4285. // End:0x32
  4286. if(!IsTimerActive('WeaponEquipped'))
  4287. {
  4288. PutDownWeapon();
  4289. }
  4290. // End:0x7F
  4291. else
  4292. {
  4293. EquipAbortTime = (PutDownTime * GetTimerCount('WeaponEquipped')) / GetTimerRate('WeaponEquipped');
  4294. GotoState('WeaponAbortEquip');
  4295. }
  4296. return true;
  4297. //return ReturnValue;
  4298. }
  4299.  
  4300. simulated function BeginState(name PreviousStateName)
  4301. {
  4302. local KFPerk InstigatorPerk;
  4303. local float PerkZedTimeResist;
  4304.  
  4305. super.BeginState(PreviousStateName);
  4306. // End:0x46
  4307. if(bIronSightOnBringUp && bHasIronSights)
  4308. {
  4309. bIronSightOnBringUp = false;
  4310. SetIronSights(true);
  4311. }
  4312. InstigatorPerk = GetPerk();
  4313. // End:0x95
  4314. if(InstigatorPerk != none)
  4315. {
  4316. PerkZedTimeResist = InstigatorPerk.GetZedTimeModifier(GetStateName());
  4317. }
  4318. SetZedTimeResist(0.3750 + PerkZedTimeResist);
  4319. NotifyBeginState();
  4320. //return;
  4321. }
  4322.  
  4323. simulated function EndState(name NextStateName)
  4324. {
  4325. ClearTimer('WeaponEquipped');
  4326. ClearZedTimeResist();
  4327. NotifyEndState();
  4328. //return;
  4329. }
  4330. stop;
  4331. }
  4332.  
  4333. simulated state WeaponPuttingDown
  4334. {
  4335. ignores Activate;
  4336.  
  4337. simulated function byte GetWeaponStateId()
  4338. {
  4339. return 24;
  4340. //return ReturnValue;
  4341. }
  4342.  
  4343. simulated function BeginState(name PreviousStateName)
  4344. {
  4345. local KFPerk InstigatorPerk;
  4346. local float PerkZedTimeResist;
  4347.  
  4348. // End:0x81
  4349. if(((FlashLight != none) && FlashLight.bEnabled) && Instigator.IsLocallyControlled())
  4350. {
  4351. KFPawn_Human(Instigator).SetFlashlight(false, true);
  4352. }
  4353. TimeWeaponPutDown();
  4354. bWeaponPutDown = false;
  4355. InstigatorPerk = GetPerk();
  4356. // End:0xE6
  4357. if(InstigatorPerk != none)
  4358. {
  4359. PerkZedTimeResist = InstigatorPerk.GetZedTimeModifier(GetStateName());
  4360. }
  4361. SetZedTimeResist(0.3750 + PerkZedTimeResist);
  4362. NotifyBeginState();
  4363. //return;
  4364. }
  4365.  
  4366. simulated function EndState(name NextStateName)
  4367. {
  4368. super.EndState(NextStateName);
  4369. ClearZedTimeResist();
  4370. NotifyEndState();
  4371. //return;
  4372. }
  4373. stop;
  4374. }
  4375.  
  4376. simulated state WeaponDownSimple
  4377. {
  4378. ignores CanThrow, SetIronSights, OnAnimEnd;
  4379.  
  4380. simulated function bool CanTransitionToIronSights()
  4381. {
  4382. return false;
  4383. //return ReturnValue;
  4384. }
  4385.  
  4386. simulated function bool DenyClientWeaponSet()
  4387. {
  4388. return true;
  4389. //return ReturnValue;
  4390. }
  4391.  
  4392. simulated function bool CanReload()
  4393. {
  4394. return false;
  4395. //return ReturnValue;
  4396. }
  4397.  
  4398. simulated function bool CanSwitchWeapons()
  4399. {
  4400. return false;
  4401. //return ReturnValue;
  4402. }
  4403.  
  4404. exec function SimplePutDown()
  4405. {
  4406. SetSimplePutDown(false);
  4407. //return;
  4408. }
  4409.  
  4410. simulated function BeginState(name PreviousStateName)
  4411. {
  4412. super(KFWeapon).BeginState(PreviousStateName);
  4413. // End:0x94
  4414. if(((FlashLight != none) && FlashLight.bEnabled) && Instigator.IsLocallyControlled())
  4415. {
  4416. KFPawn_Human(Instigator).SetFlashlight(false, true);
  4417. }
  4418. bDoingQuickDownZoom = true;
  4419. // End:0xD6
  4420. if(Instigator.IsLocallyControlled())
  4421. {
  4422. ZoomDown(true, QuickWeaponDownTime);
  4423. }
  4424. // End:0x119
  4425. if(Instigator.IsFirstPerson())
  4426. {
  4427. PlayAnimation(IdleAnims[0], 0.0, true, 0.20);
  4428. }
  4429. StopFire(CurrentFireMode);
  4430. //return;
  4431. }
  4432.  
  4433. simulated function ZoomDown(bool bAnimateTransition, float ZoomTimeToGo)
  4434. {
  4435. // End:0x181
  4436. if(bAnimateTransition)
  4437. {
  4438. ZoomInTime = ZoomTimeToGo;
  4439. // End:0x9F
  4440. if(bZoomingOut)
  4441. {
  4442. bZoomingOut = false;
  4443. bZoomOutInterrupted = true;
  4444. ZoomTime = ZoomInTime - ZoomTime;
  4445. ZoomPartialTime = ZoomTime;
  4446. ZoomStartOffset = PlayerViewOffset;
  4447. ZoomRotStartOffset = ZoomRotInterp;
  4448. }
  4449. // End:0xC5
  4450. else
  4451. {
  4452. ZoomTime = ZoomInTime;
  4453. ZoomStartOffset = PlayerViewOffset;
  4454. }
  4455. ZoomTargetOffset = default.PlayerViewOffset;
  4456. // End:0x112
  4457. if(MySkelMesh != none)
  4458. {
  4459. ZoomWeaponFOVStart = MySkelMesh.FOV;
  4460. }
  4461. // End:0x125
  4462. else
  4463. {
  4464. ZoomWeaponFOVStart = MeshFOV;
  4465. }
  4466. // End:0x175
  4467. if((WorldInfo.NetMode != NM_DedicatedServer) && Instigator != none)
  4468. {
  4469. EnableIronSightsDoF(false);
  4470. EnablePlayerZoom(false);
  4471. }
  4472. bZoomingIn = true;
  4473. }
  4474. //return;
  4475. }
  4476.  
  4477. simulated function EndState(name NextStateName)
  4478. {
  4479. super(KFWeapon).EndState(NextStateName);
  4480. ClearTimer('EndWeaponDownSimpleTimer');
  4481. bDoingQuickDownZoom = false;
  4482. //return;
  4483. }
  4484.  
  4485. simulated function EndWeaponDownSimpleTimer()
  4486. {
  4487. GotoState('Active');
  4488. //return;
  4489. }
  4490.  
  4491. simulated function SetSimplePutDown(bool bPutDownWeapon)
  4492. {
  4493. // End:0xE6
  4494. if(!bPutDownWeapon)
  4495. {
  4496. // End:0x96
  4497. if((WorldInfo.NetMode == NM_DedicatedServer) || (WorldInfo.NetMode == NM_ListenServer) && !Instigator.IsLocallyControlled())
  4498. {
  4499. EndWeaponDownSimpleTimer();
  4500. }
  4501. // End:0xE3
  4502. else
  4503. {
  4504. SetTimer(QuickWeaponDownFinishTime, false, 'EndWeaponDownSimpleTimer');
  4505. // End:0xE3
  4506. if(Instigator.IsLocallyControlled())
  4507. {
  4508. ZoomOut(true, QuickWeaponDownFinishTime);
  4509. }
  4510. }
  4511. }
  4512. // End:0x143
  4513. else
  4514. {
  4515. ClearTimer('EndWeaponDownSimpleTimer');
  4516. // End:0x130
  4517. if(Instigator.IsLocallyControlled())
  4518. {
  4519. ZoomDown(true, QuickWeaponDownTime);
  4520. }
  4521. StopFire(CurrentFireMode);
  4522. }
  4523. //return;
  4524. }
  4525. stop;
  4526. }
  4527.  
  4528. simulated state WeaponAbortEquip extends WeaponPuttingDown
  4529. {
  4530. simulated function TimeWeaponPutDown()
  4531. {
  4532. local AnimNodeSequence AnimNode;
  4533. local float Rate;
  4534.  
  4535. SetTimer(FMax(EquipAbortTime, 0.010), 'WeaponIsDown');
  4536. // End:0x172
  4537. if(WorldInfo.NetMode != NM_DedicatedServer)
  4538. {
  4539. AnimNode = GetWeaponAnimNodeSeq();
  4540. // End:0x172
  4541. if((AnimNode != none) && AnimNode.AnimSeq != none)
  4542. {
  4543. AnimNode.SetAnim(PutDownAnim);
  4544. Rate = AnimNode.AnimSeq.SequenceLength / PutDownTime;
  4545. AnimNode.PlayAnim(false, Rate, AnimNode.AnimSeq.SequenceLength - (EquipAbortTime * Rate));
  4546. }
  4547. }
  4548. //return;
  4549. }
  4550. stop;
  4551. }
  4552.  
  4553. simulated state WeaponFiring
  4554. {
  4555. ignores AllowSprinting;
  4556.  
  4557. simulated function BeginState(name PrevStateName)
  4558. {
  4559. local KFPerk InstigatorPerk;
  4560.  
  4561. InstigatorPerk = GetPerk();
  4562. // End:0x4F
  4563. if(InstigatorPerk != none)
  4564. {
  4565. SetZedTimeResist(InstigatorPerk.GetZedTimeModifier(GetStateName()));
  4566. }
  4567. // End:0x85
  4568. if((bLoopingFireAnim.Length > 0) || bLoopingFireSnd.Length > 0)
  4569. {
  4570. StartLoopingFireEffects(CurrentFireMode);
  4571. }
  4572. super.BeginState(PrevStateName);
  4573. //return;
  4574. }
  4575.  
  4576. simulated event Tick(float DeltaTime)
  4577. {
  4578. global.Tick(DeltaTime);
  4579. // End:0x42
  4580. if(bPlayingLoopingFireSnd && ShouldForceSingleFireSound())
  4581. {
  4582. StopLoopingFireSound(CurrentFireMode);
  4583. }
  4584. //return;
  4585. }
  4586.  
  4587. simulated function EndState(name NextStateName)
  4588. {
  4589. super.EndState(NextStateName);
  4590. ClearZedTimeResist();
  4591. // End:0x67
  4592. if(WorldInfo.NetMode == NM_Client)
  4593. {
  4594. Instigator.WeaponStoppedFiring(self, false);
  4595. }
  4596. // End:0x96
  4597. if(bPlayingLoopingFireAnim || bPlayingLoopingFireAnim)
  4598. {
  4599. StopLoopingFireEffects(CurrentFireMode);
  4600. }
  4601. //return;
  4602. }
  4603.  
  4604. simulated event OnAnimEnd(AnimNodeSequence SeqNode, float PlayedTime, float ExcessTime)
  4605. {
  4606. local name WeaponFireAnimName;
  4607.  
  4608. // End:0xAC
  4609. if(WorldInfo.NetMode != NM_DedicatedServer)
  4610. {
  4611. // End:0xAC
  4612. if(bPlayingLoopingFireAnim)
  4613. {
  4614. WeaponFireAnimName = GetLoopingFireAnim(CurrentFireMode);
  4615. // End:0xAC
  4616. if(WeaponFireAnimName != 'None')
  4617. {
  4618. PlayAnimation(WeaponFireAnimName, MySkelMesh.GetAnimLength(WeaponFireAnimName), true, 0.0);
  4619. }
  4620. }
  4621. }
  4622. //return;
  4623. }
  4624.  
  4625. simulated function bool DenyClientWeaponSet()
  4626. {
  4627. return true;
  4628. //return ReturnValue;
  4629. }
  4630. stop;
  4631. }
  4632.  
  4633. simulated state WeaponSingleFiring extends WeaponFiring
  4634. {
  4635. simulated function FireAmmunition()
  4636. {
  4637. super(KFWeapon).FireAmmunition();
  4638. ClearPendingFire(CurrentFireMode);
  4639. //return;
  4640. }
  4641. stop;
  4642. }
  4643.  
  4644. simulated state GrenadeFiring extends WeaponSingleFiring
  4645. {
  4646. simulated function byte GetWeaponStateId()
  4647. {
  4648. return 25;
  4649. //return ReturnValue;
  4650. }
  4651.  
  4652. simulated event BeginState(name PreviousStateName)
  4653. {
  4654. LogInternal(((((((((string(WorldInfo.TimeSeconds) @ "Self:") @ string(self)) @ "Instigator:") @ string(Instigator)) @ string(GetStateName())) $ "::") $ string(GetFuncName())) @ "PreviousStateName:") @ string(PreviousStateName), 'Inventory');
  4655. SetWeakZedGrabCooldownOnPawn(GrenadeTossWeakZedGrabCooldown);
  4656. PlayGrenadeThrow();
  4657. TimeWeaponFiring(CurrentFireMode);
  4658. ClearPendingFire(CurrentFireMode);
  4659. // End:0x28F
  4660. if((Role == ROLE_Authority) && KFInventoryManager(InvManager) != none)
  4661. {
  4662. KFInventoryManager(InvManager).ConsumeGrenades();
  4663. // End:0x28C
  4664. if(((WorldInfo.Game != none) && KFGameInfo(WorldInfo.Game).GameplayEventsWriter != none) && KFGameInfo(WorldInfo.Game).GameplayEventsWriter.IsSessionInProgress())
  4665. {
  4666. KFGameInfo(WorldInfo.Game).GameplayEventsWriter.LogPlayerIntEvent(1102, Instigator.Controller, KFInventoryManager(InvManager).GrenadeCount);
  4667. }
  4668. }
  4669. // End:0x2D1
  4670. else
  4671. {
  4672. // End:0x2D1
  4673. if((Role < ROLE_Authority) && Instigator.IsLocallyControlled())
  4674. {
  4675. ServerGotoGrenadeFiring();
  4676. }
  4677. }
  4678. NotifyBeginState();
  4679. //return;
  4680. }
  4681.  
  4682. simulated function EndState(name NextStateName)
  4683. {
  4684. super(WeaponFiring).EndState(NextStateName);
  4685. NotifyEndState();
  4686. ProjectileFire();
  4687. //return;
  4688. }
  4689.  
  4690. simulated event Vector GetMuzzleLoc()
  4691. {
  4692. local Rotator ViewRotation;
  4693.  
  4694. // End:0xE4
  4695. if(Instigator != none)
  4696. {
  4697. ViewRotation = Instigator.GetViewRotation();
  4698. // End:0xAD
  4699. if(KFPlayerController(Instigator.Controller) != none)
  4700. {
  4701. ViewRotation += KFPlayerController(Instigator.Controller).WeaponBufferRotation;
  4702. }
  4703. return Instigator.GetPawnViewLocation() + (GrenadeFireOffset >> ViewRotation);
  4704. }
  4705. return Location;
  4706. //return ReturnValue;
  4707. }
  4708.  
  4709. simulated function bool ShouldRefire()
  4710. {
  4711. return false;
  4712. //return ReturnValue;
  4713. }
  4714. stop;
  4715. }
  4716.  
  4717. simulated state Reloading
  4718. {
  4719. ignores ForceReload, ShouldAutoReload, AllowIronSights, AllowSprinting;
  4720.  
  4721. simulated function byte GetWeaponStateId()
  4722. {
  4723. local KFPerk Perk;
  4724. local bool bTacticalReload;
  4725.  
  4726. Perk = GetPerk();
  4727. bTacticalReload = (Perk != none) && Perk.GetUsingTactialReload(self);
  4728. // End:0xAD
  4729. if(!bReloadFromMagazine)
  4730. {
  4731. // End:0x8B
  4732. if(bTacticalReload)
  4733. {
  4734. return byte(((AmmoCount[0] > 0) ? 7 : 8));
  4735. }
  4736. return byte(((AmmoCount[0] > 0) ? 5 : 6));
  4737. }
  4738. // End:0xF7
  4739. else
  4740. {
  4741. // End:0xD9
  4742. if(bTacticalReload)
  4743. {
  4744. return byte(((AmmoCount[0] > 0) ? 3 : 4));
  4745. }
  4746. return byte(((AmmoCount[0] > 0) ? 1 : 2));
  4747. }
  4748. //return ReturnValue;
  4749. }
  4750.  
  4751. simulated function BeginState(name PreviousStateName)
  4752. {
  4753. local KFPerk InstigatorPerk;
  4754.  
  4755. InstigatorPerk = GetPerk();
  4756. // End:0x4F
  4757. if(InstigatorPerk != none)
  4758. {
  4759. SetZedTimeResist(InstigatorPerk.GetZedTimeModifier(GetStateName()));
  4760. }
  4761. // End:0x70
  4762. if(bUsingSights)
  4763. {
  4764. ZoomOut(false, default.ZoomOutTime);
  4765. }
  4766. bEnableTiltSkelControl = false;
  4767. bPendingAutoSwitchOnDryFire = false;
  4768. ReloadStatus = 0;
  4769. TimeWeaponReloading();
  4770. NotifyBeginState();
  4771. // End:0x1D8
  4772. if(((WorldInfo.Game != none) && KFGameInfo(WorldInfo.Game).GameplayEventsWriter != none) && KFGameInfo(WorldInfo.Game).GameplayEventsWriter.IsSessionInProgress())
  4773. {
  4774. KFGameInfo(WorldInfo.Game).GameplayEventsWriter.LogPlayerWeaponReload(self, Instigator.Controller);
  4775. }
  4776. // End:0x2C3
  4777. if(((Role == ROLE_Authority) && KFGameInfo(WorldInfo.Game) != none) && KFGameInfo(WorldInfo.Game).DialogManager != none)
  4778. {
  4779. KFGameInfo(WorldInfo.Game).DialogManager.PlayReloadDialog(KFPawn(Instigator));
  4780. }
  4781. //return;
  4782. }
  4783.  
  4784. simulated function EndState(name NextStateName)
  4785. {
  4786. ClearZedTimeResist();
  4787. ClearTimer('ReloadStatusTimer');
  4788. ClearTimer('ReloadAmmoTimer');
  4789. ClearPendingFire(2);
  4790. // End:0x76
  4791. if(bAllowClientAmmoTracking && Role < ROLE_Authority)
  4792. {
  4793. ServerSyncReload(SpareAmmoCount[0]);
  4794. }
  4795. NotifyEndState();
  4796. // End:0x187
  4797. if(((Role == ROLE_Authority) && KFGameInfo(WorldInfo.Game) != none) && KFGameInfo(WorldInfo.Game).DialogManager != none)
  4798. {
  4799. KFGameInfo(WorldInfo.Game).DialogManager.PlayAmmoDialog(KFPawn(Instigator), float(SpareAmmoCount[0]) / float(MaxSpareAmmo[0]));
  4800. }
  4801. //return;
  4802. }
  4803.  
  4804. simulated function BeginFire(byte FireModeNum)
  4805. {
  4806. global.BeginFire(FireModeNum);
  4807. // End:0x85
  4808. if((!bReloadFromMagazine || FireModeNum == 3) && FireModeNum != 2)
  4809. {
  4810. // End:0x85
  4811. if(PendingFire(FireModeNum) && HasAmmo(FireModeNum))
  4812. {
  4813. AbortReload();
  4814. }
  4815. }
  4816. //return;
  4817. }
  4818.  
  4819. simulated function bool TryPutDown()
  4820. {
  4821. PutDownWeapon();
  4822. return true;
  4823. //return ReturnValue;
  4824. }
  4825.  
  4826. simulated function ReloadStatusTimer()
  4827. {
  4828. // End:0x4B
  4829. if((ReloadStatus == 2) && IsTimerActive('ReloadAmmoTimer'))
  4830. {
  4831. PerformReload();
  4832. ClearTimer('ReloadAmmoTimer');
  4833. }
  4834. TimeWeaponReloading();
  4835. //return;
  4836. }
  4837.  
  4838. simulated function ReloadAmmoTimer()
  4839. {
  4840. PerformReload();
  4841. // End:0x2D
  4842. if(bReloadFromMagazine)
  4843. {
  4844. ReloadStatus = 4;
  4845. ReloadComplete();
  4846. }
  4847. //return;
  4848. }
  4849.  
  4850. simulated function ReloadComplete()
  4851. {
  4852. GotoState('Active');
  4853. //return;
  4854. }
  4855.  
  4856. simulated function AbortReload()
  4857. {
  4858. GotoState('Active');
  4859. //return;
  4860. }
  4861. stop;
  4862. }
  4863.  
  4864. simulated state WeaponSprinting
  4865. {
  4866. ignores ForceReload;
  4867.  
  4868. simulated function BeginState(name PreviousStateName)
  4869. {
  4870. PlaySprintStart();
  4871. //return;
  4872. }
  4873.  
  4874. simulated function EndState(name NextStateName)
  4875. {
  4876. PlaySprintEnd();
  4877. //return;
  4878. }
  4879.  
  4880. simulated function SprintLoopTimer()
  4881. {
  4882. PlaySprintLoop();
  4883. //return;
  4884. }
  4885.  
  4886. simulated function SprintRetryTimer()
  4887. {
  4888. PlaySprintStart();
  4889. //return;
  4890. }
  4891.  
  4892. simulated function SetWeaponSprint(bool bNewSprintStatus)
  4893. {
  4894. // End:0x1D
  4895. if(!bNewSprintStatus)
  4896. {
  4897. GotoState('Active');
  4898. }
  4899. //return;
  4900. }
  4901.  
  4902. simulated function SetIronSights(bool bNewIronSights)
  4903. {
  4904. global.SetIronSights(bNewIronSights);
  4905. // End:0x2C
  4906. if(bUsingSights)
  4907. {
  4908. StopPawnSprint(true);
  4909. }
  4910. //return;
  4911. }
  4912.  
  4913. simulated function BeginFire(byte FireModeNum)
  4914. {
  4915. // End:0x6F
  4916. if(!bDeleteMe && Instigator != none)
  4917. {
  4918. global.BeginFire(FireModeNum);
  4919. // End:0x6F
  4920. if(PendingFire(FireModeNum) && HasAmmo(FireModeNum))
  4921. {
  4922. StopPawnSprint(false);
  4923. }
  4924. }
  4925. //return;
  4926. }
  4927. stop;
  4928. }
  4929.  
  4930. simulated state MeleeAttackBasic
  4931. {
  4932. ignores AllowSprinting, AllowIronSights;
  4933.  
  4934. simulated function bool IsMeleeing()
  4935. {
  4936. return true;
  4937. //return ReturnValue;
  4938. }
  4939.  
  4940. simulated function BeginState(name PreviousStateName)
  4941. {
  4942. // End:0x21
  4943. if(bUsingSights)
  4944. {
  4945. ZoomOut(false, default.ZoomOutTime);
  4946. }
  4947. TimeWeaponFiring(CurrentFireMode);
  4948. NotifyBeginState();
  4949. //return;
  4950. }
  4951.  
  4952. simulated function EndState(name NextStateName)
  4953. {
  4954. ClearTimer('RefireCheckTimer');
  4955. NotifyEndState();
  4956. //return;
  4957. }
  4958.  
  4959. simulated function TimeWeaponFiring(byte FireModeNum)
  4960. {
  4961. MeleeAttackHelper.BeginMeleeAttack();
  4962. // End:0x5F
  4963. if(PendingFire(CurrentFireMode) && !ShouldContinueMelee())
  4964. {
  4965. ClearPendingFire(CurrentFireMode);
  4966. }
  4967. //return;
  4968. }
  4969.  
  4970. simulated function byte GetWeaponStateId()
  4971. {
  4972. return 10;
  4973. //return ReturnValue;
  4974. }
  4975. stop;
  4976. }
  4977.  
  4978. defaultproperties
  4979. {
  4980. FireModeIconPaths(0)=Texture2D'ui_firemodes_tex.UI_FireModeSelect_BulletSingle'
  4981. FireModeIconPaths(1)=none
  4982. SingleFireMode=255
  4983. FilterTypeUI=EFilterTypeUI.FT_Assault
  4984. bTargetFrictionEnabled=true
  4985. bTargetAdhesionEnabled=true
  4986. bCanRefillSecondaryAmmo=true
  4987. bAllowClientAmmoTracking=true
  4988. bUseAnimLenEquipTime=true
  4989. bUseAdditiveMoveAnim=true
  4990. MinFiringPutDownPct=0.80
  4991. PenetrationPower(0)=0.0
  4992. PenetrationPower(1)=0.0
  4993. PenetrationDamageReductionCurve(0)=(Points=/* Array type was not detected. */,InVal=0.0,OutVal=0.0,ArriveTangent=0.0,LeaveTangent=0.0,InterpMode=EInterpCurveMode.CIM_Linear)
  4994. PenetrationDamageReductionCurve(1)=(InVal=1.0,OutVal=1.0,ArriveTangent=0.0,LeaveTangent=0.0,InterpMode=EInterpCurveMode.CIM_Linear)
  4995. GrenadeTossWeakZedGrabCooldown=1.0
  4996. TargetFrictionDistanceMin=320.0
  4997. TargetFrictionDistancePeak=200.0
  4998. TargetFrictionDistanceMax=4000.0
  4999. TargetFrictionDistanceCurve=(Points=/* Array type was not detected. */,InVal=0.0,OutVal=0.0,ArriveTangent=0.0,LeaveTangent=0.0,InterpMode=EInterpCurveMode.CIM_Linear)
  5000. TargetFrictionMultiplierRange=(X=0.30,Y=0.40)
  5001. TargetFrictionPeakRadiusScale=1.0
  5002. TargetFrictionPeakHeightScale=0.20
  5003. TargetFrictionOffset=(X=0.0,Y=0.0,Z=32.0)
  5004. TargetFrictionZoomedBoostValue=0.250
  5005. TargetAdhesionDistanceMax=2000.0
  5006. TargetAdhesionAimDistY=128.0
  5007. TargetAdhesionAimDistZ=96.0
  5008. TargetAdhesionScaleRange=(X=0.30,Y=2.850)
  5009. TargetAdhesionZoomedBoostValue=0.250
  5010. MeshFOV=86.0
  5011. MeshIronSightFOV=75.0
  5012. PlayerIronSightFOV=75.0
  5013. PlayerSprintFOV=95.0
  5014. ZoomInTime=0.150
  5015. ZoomOutTime=0.150
  5016. ZoomInRotation=(Pitch=-910,Yaw=0,Roll=2910)
  5017. QuickWeaponDownRotation=(Pitch=-8192,Yaw=0,Roll=16384)
  5018. QuickWeaponDownTime=0.40
  5019. QuickWeaponDownFinishTime=0.20
  5020. FastZoomOutTime=0.10
  5021. ISFocalDepth=50.0
  5022. ISFocalAperture=0.350
  5023. GrenadeFireOffset=(X=25.0,Y=-15.0,Z=0.0)
  5024. UITexture=Texture2D'ui_weaponselect_tex.UI_WeaponSelect_AR15'
  5025. SecondaryAmmoTexture=Texture2D'UI_SecondaryAmmo_TEX.GasTank'
  5026. ReloadBlendOutTime=0.20
  5027. ShakeScaleSighted=0.40
  5028. ShakeScaleStandard=1.0
  5029. WeaponFireWaveForm=ForceFeedbackWaveform'FX_ForceFeedback_ARCH.Gunfire.Default_Recoil'
  5030. MeleeImpactCamShake=KFCameraShake'FX_CameraShake_Arch.Melee.Default_Melee'
  5031. FireTweenTime=0.050
  5032. FireAnim=Shoot
  5033. FireLoopAnim=ShootLoop
  5034. FireLastAnim=Shoot_Last
  5035. PutDownAnim=PutAway
  5036. EquipAnim=Equip
  5037. IdleAnims(0)=Idle
  5038. IdleFidgetAnims(0)=Guncheck_v1
  5039. IdleFidgetAnims(1)=Guncheck_v2
  5040. IdleFidgetAnims(2)=Guncheck_v3
  5041. FireSightedAnims(0)=Shoot_Iron
  5042. FireLoopSightedAnim=ShootLoop_Iron
  5043. FireLastSightedAnim=Shoot_Iron_Last
  5044. IdleSightedAnims(0)=Idle_Iron
  5045. FireLoopStartAnim=ShootLoop_Start
  5046. FireLoopStartSightedAnim=ShootLoop_Iron_Start
  5047. FireLoopEndAnim=ShootLoop_End
  5048. FireLoopEndSightedAnim=ShootLoop_Iron_End
  5049. MeleeAttackAnims(0)=Bash
  5050. WeaponFireSnd(0)=(DefaultCue=none,FirstPersonCue=none)
  5051. BobDamping=0.850
  5052. JumpDamping=1.0
  5053. PlayerViewOffset=(X=1.0,Y=9.0,Z=-3.0)
  5054. LagTensionHorizontal=0.80
  5055. LagVerticalTension=0.80
  5056. LagResistanceHorizontal=0.20
  5057. LagResistanceVertical=0.20
  5058. LagLimit=5.0
  5059. LagYawCoefficient=0.000050
  5060. LagStrengthIronSights=3.0
  5061. LagStrengthCrouch=1.50
  5062. LagStrengthWalk=0.70
  5063. LagStrengthJog=0.60
  5064. LagStrengthSprint=0.50
  5065. StrafeLagLimit=4.0
  5066. StrafeLagRate=0.0250
  5067. StrafeLagReturnRate=10.0
  5068. begin object name=MeleeHelper class=KFMeleeHelperWeapon
  5069. MaxHitRange=175.0
  5070. object end
  5071. // Reference: KFMeleeHelperWeapon'Default__KFWeapon.MeleeHelper'
  5072. MeleeAttackHelper=MeleeHelper
  5073. FlashLightTemplate=KFFlashlightAttachment'FX_Flashlight_ARCH.Default_Flashlight_1P'
  5074. MovingSpreadMod=1.0
  5075. IronSightsSpreadMod=0.50
  5076. CrouchSpreadMod=0.750
  5077. RecoilRate=0.090
  5078. RecoilBlendOutRatio=1.250
  5079. RecoilViewRotationScale=0.40
  5080. RecoilCompensationScale=1.50
  5081. FullRecoilPitchPct=0.750
  5082. FullRecoilYawPct=0.750
  5083. RecoilMaxYawLimit=2000
  5084. RecoilMinYawLimit=63535
  5085. RecoilMaxPitchLimit=1500
  5086. RecoilMinPitchLimit=64035
  5087. RecoilISMaxYawLimit=500
  5088. RecoilISMinYawLimit=65035
  5089. RecoilISMaxPitchLimit=350
  5090. RecoilISMinPitchLimit=65185
  5091. SuppressRecoilSpeed=0.080
  5092. SuppressRecoilViewRotationScale=0.50
  5093. HippedRecoilModifier=1.750
  5094. JoggingRecoilModifier=1.50
  5095. WalkingRecoilModifier=1.250
  5096. FallingRecoilModifier=3.0
  5097. StanceCrouchedRecoilModifier=0.750
  5098. LastRecoilModifier=1.0
  5099. IronSightMeshFOVCompensationScale=1.0
  5100. FiringStatesArray=/* Array type was not detected. */
  5101. WeaponFireTypes=/* Array type was not detected. */
  5102. FireInterval=/* Array type was not detected. */
  5103. InstantHitDamage=/* Array type was not detected. */
  5104. InstantHitMomentum=/* Array type was not detected. */
  5105. InstantHitDamageTypes=/* Array type was not detected. */
  5106. EquipTime=0.450
  5107. begin object name=FirstPersonMesh class=KFSkeletalMeshComponent
  5108. AnimTreeTemplate=AnimTree'CHR_1P_Arms_ARCH.WEP_1stP_Animtree_Master'
  5109. bOverrideAttachmentOwnerVisibility=true
  5110. bAllowBooleanPreshadows=false
  5111. ReplacementPrimitive=none
  5112. DepthPriorityGroup=ESceneDepthPriorityGroup.SDPG_Foreground
  5113. bOnlyOwnerSee=true
  5114. LightingChannels=(bInitialized=true,Outdoor=true)
  5115. bAllowPerObjectShadows=true
  5116. object end
  5117. // Reference: KFSkeletalMeshComponent'Default__KFWeapon.FirstPersonMesh'
  5118. Mesh=FirstPersonMesh
  5119. bDropOnDeath=true
  5120. DroppedPickupClass=class'KFDroppedPickup'
  5121. begin object name=StaticPickupComponent class=StaticMeshComponent
  5122. StaticMesh=StaticMesh'EngineMeshes.Cube'
  5123. ReplacementPrimitive=none
  5124. CastShadow=false
  5125. object end
  5126. // Reference: StaticMeshComponent'Default__KFWeapon.StaticPickupComponent'
  5127. DroppedPickupMesh=StaticPickupComponent
  5128. begin object name=StaticPickupComponent class=StaticMeshComponent
  5129. StaticMesh=StaticMesh'EngineMeshes.Cube'
  5130. ReplacementPrimitive=none
  5131. CastShadow=false
  5132. object end
  5133. // Reference: StaticMeshComponent'Default__KFWeapon.StaticPickupComponent'
  5134. PickupFactoryMesh=StaticPickupComponent
  5135. bIgnoreBaseRotation=true
  5136. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement