Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*******************************************************************************
- * KFWeapon generated by Eliot.UELib using UE Explorer.
- * Eliot.UELib © 2009-2013 Eliot van Uytfanghe. All rights reserved.
- * http://eliotvu.com
- *
- * All rights belong to their respective owners.
- *******************************************************************************/
- class KFWeapon extends Weapon
- hidecategories(SmartObject,Navigation,Advanced,Collision,Mobile,Movement,Object,Physics,Attachment,Debug)
- native
- nativereplication
- config(Game);
- const DEFAULT_FIREMODE = 0;
- const ALTFIRE_FIREMODE = 1;
- const RELOAD_FIREMODE = 2;
- const BASH_FIREMODE = 3;
- const GRENADE_FIREMODE = 4;
- const FIREMODE_NONE = 255;
- const PRIMARY_AMMO = 0;
- const SECONDARY_AMMO = 1;
- const ReloadEmptyMagAnim = 'Reload_Empty';
- const ReloadNonEmptyMagAnim = 'Reload_Half';
- const ReloadEmptyMagEliteAnim = 'Reload_Empty_Elite';
- const ReloadNonEmptyMagEliteAnim = 'Reload_Half_Elite';
- const ReloadOpenAnim = 'Reload_Open';
- const ReloadSingleAnim = 'Reload_Insert';
- const ReloadCloseAnim = 'Reload_Close';
- const ReloadOpenEliteAnim = 'Reload_Open_Elite';
- const ReloadSingleEliteAnim = 'Reload_Insert_Elite';
- const ReloadCloseEliteAnim = 'Reload_Close_Elite';
- const GrenadeThrowAnim = 'Nade_Throw';
- const SprintStartAnim = 'Sprint_In';
- const SprintLoopAnim = 'Sprint_Loop';
- const SprintEndAnim = 'Sprint_Out';
- const BloodParamName = 'Scalar_Blood_Contrast';
- const MinBloodParamValue = 0.20f;
- const MaxAimAdjust_Angle = 0.1f;
- const MaxAimAdjust_Cos = 0.995f;
- enum EInventoryGroup
- {
- IG_Primary,
- IG_Secondary,
- IG_Melee,
- IG_Equipment,
- IG_MAX
- };
- enum EFilterTypeUI
- {
- FT_Pistol,
- FT_Shotgun,
- FT_Rifle,
- FT_Projectile,
- FT_Flame,
- FT_Electric,
- FT_Explosive,
- FT_Assault,
- FT_Melee,
- FT_SMG,
- FT_MAX
- };
- enum EReloadStatus
- {
- RS_None,
- RS_OpeningBolt,
- RS_Reloading,
- RS_ClosingBolt,
- RS_Complete,
- RS_MAX
- };
- enum EWeaponImpactType
- {
- ECIT_InstantHit,
- ECIT_Projectile,
- ECIT_HurtRadius,
- ECIT_Melee,
- ECIT_MAX
- };
- struct native WeaponFireSndInfo
- {
- var() AkEvent DefaultCue;
- var() AkEvent FirstPersonCue;
- structdefaultproperties
- {
- DefaultCue=none
- FirstPersonCue=none
- }
- };
- struct native ImpactRepInfo
- {
- var Actor HitActor;
- var Vector HitLocation;
- var Vector RayDir;
- var name HitInfo_BoneName;
- structdefaultproperties
- {
- HitActor=none
- HitLocation=(X=0.0,Y=0.0,Z=0.0)
- RayDir=(X=0.0,Y=0.0,Z=0.0)
- HitInfo_BoneName=None
- }
- };
- var protected export editinline MeshComponent OverlayMesh;
- var export editinline KFSkeletalMeshComponent MySkelMesh;
- /** The Archetype of the Projectile to spawn */
- var(Weapon) array<KFProjectile> ProjectileArchetypes;
- var array<Texture2D> FireModeIconPaths;
- var byte SingleFireMode;
- /** Determines which group a weapon falls into in weapon select */
- var(Inventory) const KFWeapon.EInventoryGroup InventoryGroup;
- /** Determine which group a weapon will show up for the weapon type filter */
- var(Inventory) const KFWeapon.EFilterTypeUI FilterTypeUI;
- /** Inventory (In blocks) cost */
- var(Inventory) byte InventorySize;
- var byte AmmoCount[2];
- var KFWeapon.EReloadStatus ReloadStatus;
- var byte ReloadAmountLeft;
- var bool bUseAltFireMode;
- /** Target friction enabled? */
- var() bool bTargetFrictionEnabled;
- var() bool bTargetAdhesionEnabled;
- var bool bUsingSights;
- /** This weapon has sights to aim */
- var(IronSight) bool bHasIronSights;
- var bool bIronSightOnBringUp;
- var bool bForceHidden;
- var bool bZoomingIn;
- var bool bZoomingOut;
- /** Doing a "quick down" zoom */
- var(IronSight) bool bDoingQuickDownZoom;
- /** Don't use the ZoomInRotation for this zoom */
- var(IronSight) bool bSkipZoomInRotation;
- var bool bZoomInInterrupted;
- var bool bZoomOutInterrupted;
- var bool bFastZoomOut;
- var bool bHasScopePosition;
- var bool bUsingScopePosition;
- /** Determines whether the weapon's ironsights DOF blurs beyond the focal plane */
- var(DepthOfField) bool ISFarDoFEnabled;
- /** The weapon is using the sights to aim */
- var(Positioning) bool bWeaponNeedsServerPosition;
- /** If true, weapon position should follow camera anims played on the weapon AnimSeq */
- var(Positioning) bool bFollowAnimSeqCamera;
- /** The path that locates the image for this weapon */
- var(Inventory) bool bCanRefillSecondaryAmmo;
- var bool bGivenAtStart;
- /** Is this a no magazine/clip weapon e.g. the hunting shotgun? */
- var(Inventory) bool bNoMagazine;
- var(Inventory) bool bCanBeReloaded;
- var(Inventory) bool bReloadFromMagazine;
- var const bool bInfiniteSpareAmmo;
- var bool bInfiniteAmmo;
- var const bool bAllowClientAmmoTracking;
- var bool bPlayingCameraAnim;
- var bool bPlayingLoopingFireSnd;
- var bool bPlayingLoopingFireAnim;
- /** Use the animation sequence length to get equip times */
- var(Animations) bool bUseAnimLenEquipTime;
- /** If set, this weapon has unique shoot anims for the last round */
- var(Animations) bool bHasFireLastAnims;
- /** Special idle anims */
- var(Animations) bool bUseAdditiveMoveAnim;
- var bool bEnableTiltSkelControl;
- var transient bool bIsBoltLockedBack;
- /** @name Sounds */
- var(Sounds) bool bSuppressSounds;
- /** If set to true, attempting to reload will switch to best available weapon */
- var() bool bPendingAutoSwitchOnDryFire;
- var bool bPendingShow;
- var(Attachments) bool bHasFlashlight;
- var bool bIsBackupWeapon;
- var config bool bLogAnimation;
- var config bool bLogStates;
- var bool bPauseWithPlayersOnly;
- var bool bDebugRecoilPosition;
- var float MinFiringPutDownPct;
- /** How much penetration power does this fire mode have */
- var(Weapon) array<float> PenetrationPower;
- /** How scale the penetration power this fire mode loses based on the percentage of penetration power left */
- var(Weapon) array<InterpCurveFloat> PenetrationDamageReductionCurve;
- var transient float PenetrationPowerRemaining;
- var const transient float ZedTimeResistance;
- /**
- *How long after we toss a grenade before a zed can grab us.
- * Prevents us from blowing ourselves up on grenades that we
- * were in the middle of tossing when we got grabbed
- */
- var(Weapon) float GrenadeTossWeakZedGrabCooldown;
- /** Time after we are grabbed by a zed to prevent nade throwing so we don't blow ourselvs up */
- var(Weapon) float ZedGrabGrenadeTossCooldown;
- /** Min distance for friction */
- var() float TargetFrictionDistanceMin;
- /** Peak distance for friction */
- var() float TargetFrictionDistancePeak;
- /** Max distance allow for friction */
- var() float TargetFrictionDistanceMax;
- /** Interp curve that allows for piece wise functions for the TargetFrictionDistance amount at different ranges */
- var() InterpCurveFloat TargetFrictionDistanceCurve;
- /** Min/Max friction multiplier applied when target acquired */
- var() Vector2D TargetFrictionMultiplierRange;
- /** Amount of additional radius/height given to target cylinder when at peak distance */
- var() float TargetFrictionPeakRadiusScale;
- var() float TargetFrictionPeakHeightScale;
- /** Offset to apply to friction target location (aim for the chest, etc) */
- var() Vector TargetFrictionOffset;
- /** Boost the Target Friction by this much when zoomed in */
- var() float TargetFrictionZoomedBoostValue;
- /** Max time to attempt adhesion to the friction target */
- var() float TargetAdhesionTimeMax;
- /** Max distance to allow adhesion to still kick in */
- var() float TargetAdhesionDistanceMax;
- /** Max distance from edge of cylinder for adhesion to be valid */
- var() float TargetAdhesionAimDistY;
- var() float TargetAdhesionAimDistZ;
- /** Min/Max amount to scale for adhesive purposes */
- var() Vector2D TargetAdhesionScaleRange;
- /** Min amount to scale for adhesive purposes */
- var() float TargetAdhesionScaleAmountMin;
- /** Require the target to be moving for adhesion to kick in? */
- var() float TargetAdhesionTargetVelocityMin;
- /** Require the player to be moving for adhesion to kick in? */
- var() float TargetAdhesionPlayerVelocityMin;
- /** Boost the Target Adhesion by this much when zoomed in */
- var() float TargetAdhesionZoomedBoostValue;
- var Vector HiddenWeaponsOffset;
- /** The default FOV to use for this weapon when not in ironsights */
- var(Camera) float MeshFOV;
- /** The fov to use for this weapon when in ironsights */
- var(Camera) float MeshIronSightFOV;
- /** The fov to use for the player when in ironsights */
- var(Camera) float PlayerIronSightFOV;
- /** The fov to use while in the weapon sprinting state */
- var(Camera) float PlayerSprintFOV;
- /** The position of the weapon when in standard ironsights position */
- var(Positioning) Vector IronSightPosition;
- var float ZoomTime;
- /** How long the transition to iron sights should take */
- var(IronSight) float ZoomInTime;
- /** How long the transition from iron sights should take */
- var(IronSight) float ZoomOutTime;
- /** Amount to rotate to when zooming in to give the feeling of an animation playing */
- var(IronSight) Rotator ZoomInRotation;
- /** Amount to rotate to when doing a quick weapon put down */
- var(IronSight) Rotator QuickWeaponDownRotation;
- /** How long the transition to quick weapon down should take */
- var(IronSight) float QuickWeaponDownTime;
- /** How long the transition from quick weapon down should take */
- var(IronSight) float QuickWeaponDownFinishTime;
- var Rotator ZoomRotInterp;
- var Vector ZoomStartOffset;
- var float ZoomPartialTime;
- var Rotator ZoomRotStartOffset;
- var float ZoomWeaponFOVStart;
- var float LastZoomOutTime;
- /** How long to take to zoom out when we're doing a fast zoom out (i.e. when an action like reloading interupts ironsights) */
- var(IronSight) float FastZoomOutTime;
- var Vector ZoomTargetOffset;
- /** The position of the weapon when looking through the scope */
- var(Positioning) Vector ScopePosition;
- /** Distance of the in-focus point for foreground (i.e. weapon) depth-of-field */
- var(DepthOfField) float ISFocalDepth;
- /** Controls the amount of blur for foreground (larger values = more blur) */
- var(DepthOfField) float ISFocalAperture;
- /** Holds an offest for spawning grenades. */
- var(Positioning) Vector GrenadeFireOffset;
- /** Used to place this weapon in the inventory */
- var(Inventory) float GroupPriority;
- /** The UI image for this weapon */
- var(Inventory) Texture2D UITexture;
- /** The path that locates the image for this weapon */
- var(Inventory) Texture2D SecondaryAmmoTexture;
- var float EquipAbortTime;
- /** Size of the active weapon magazine */
- var(Inventory) int MagazineCapacity[2];
- var int SpareAmmoCount[2];
- /** Maximum amount of amount that can be carried for this gun */
- var(Inventory) int MaxSpareAmmo[2];
- /** Number of magazines to start with */
- var(Inventory) int InitialSpareMags[2];
- var const float ReloadBlendOutTime;
- var array<CameraAnim> FireCameraAnim;
- /** How much to scale the FireCameraAnim when in ironsights */
- var(Camera) float ShakeScaleSighted;
- /** How much to scale the FireCameraAnim by default (Hipped/Shouldered) */
- var(Camera) float ShakeScaleStandard;
- var array<name> EffectSockets;
- var ForceFeedbackWaveform WeaponFireWaveForm;
- /** This is the camera shake that we play when we hit a melee attack */
- var(Camera) const CameraShake MeleeImpactCamShake;
- var KFAnimSeq_Tween WeaponAnimSeqNode;
- var AnimNodeAdditiveBlending IdleBobBlendNode;
- /** Loop settings per firemode */
- var(Animations) array<bool> bLoopingFireAnim;
- var(Sounds) array<bool> bLoopingFireSnd;
- /** How much tweening to use on fire animations */
- var(Animations) float FireTweenTime;
- /** Animations to play when the weapon is fired */
- var(Animations) const editconst name FireAnim;
- /** Animation to play when the weapon is fired and bLoopingFireAnim is true */
- var(Animations) const editconst name FireLoopAnim;
- /** Animation to play when the last shot if fired */
- var(Animations) const editconst name FireLastAnim;
- /** Animation to play when the weapon is Put Down */
- var(Animations) const editconst name PutDownAnim;
- /** Animation to play when the weapon is Equipped */
- var(Animations) const editconst name EquipAnim;
- /** Animation to play when the weapon is idle */
- var(Animations) const editconst array<editconst name> IdleAnims;
- var(Animations) const editconst array<editconst name> IdleFidgetAnims;
- var transient float LastIdleFidgetAnimTime;
- /** Animation to play when the weapon is fired */
- var(Animations) const editconst array<editconst name> FireSightedAnims;
- /** Animation to play when the weapon is fired and bLoopingFireAnim is true */
- var(Animations) const editconst name FireLoopSightedAnim;
- /** Animation to play when the last shot if fired */
- var(Animations) const editconst name FireLastSightedAnim;
- /** Animation to play when the weapon is Put Down */
- var(Animations) const editconst name PutDownSightedAnim;
- /** Animation to play when idling */
- var(Animations) editconst array<editconst name> IdleSightedAnims;
- /** Animation to play for ironsight zooming if needed */
- var(Animations) const editconst name ISZoomInAnim;
- var(Animations) const editconst name ISZoomOutAnim;
- /** Animation to play at the end of a looping fire anim */
- var(Animations) const editconst name FireLoopStartAnim;
- /** Animation to play at the end of a looping fire anim */
- var(Animations) const editconst name FireLoopStartSightedAnim;
- /** Animation to play at the end of a looping fire anim */
- var(Animations) const editconst name FireLoopEndAnim;
- /** Animation to play at the end of a looping fire anim */
- var(Animations) const editconst name FireLoopEndSightedAnim;
- /** Animation to play when the weapon is fired */
- var(Animations) const editconst name FireScopedAnim;
- /** Animation to play when the weapon is fired and bLoopingFireAnim is true */
- var(Animations) const editconst name FireLoopScopedAnim;
- /** Animation to play when the last shot if fired */
- var(Animations) const editconst name FireLastScopedAnim;
- /** Animation to play when performing a manual bolting */
- var(Animations) const editconst name ManualBoltScopedAnim;
- var array<name> MeleeAttackAnims;
- /** Camera anim played when sprinting */
- var(Camera) CameraAnim SprintCameraAnim;
- var transient CameraAnimInst SprintCameraAnimInst;
- var transient float SprintAnimRate;
- /** Sound to play when the weapon is fired */
- var(Sounds) array<WeaponFireSndInfo> WeaponFireSnd;
- /** sound to play when the weapon stops fired. Used for high ROF weapons that have a looping fire sound */
- var(Sounds) array<WeaponFireSndInfo> WeaponFireLoopEndSnd;
- /** sound to play when the weapon is dry fired */
- var(Sounds) array<AkBaseSoundObject> WeaponDryFireSnd;
- /** How much to damp view bob */
- var(Motion) float BobDamping;
- /** How much to damp jump and land bob */
- var(Motion) float JumpDamping;
- /** Offset from view center */
- var(Positioning) Vector PlayerViewOffset;
- var MaterialInstanceConstant WeaponMIC;
- var float BloodParamValue;
- var Vector WeaponLag;
- var float LagHorizontal;
- var float LagVertical;
- var float LagVelocityHorizontal;
- var float LagVelocityVertical;
- /** Weapon Lag calculations for when the pawn's accelleration changes, or the pawn turns. Affects spring LagTensionHorizontal and dampening. */
- var(Motion) float LagTensionHorizontal;
- var(Motion) float LagVerticalTension;
- /** Weapon LagResistanceHorizontal/Vertical represents how much the gun does not want to move at all, affects dampening. */
- var(Motion) float LagResistanceHorizontal;
- var(Motion) float LagResistanceVertical;
- /** the maximum offset/lag that the weapon should lag when moving around */
- var(Motion) float LagLimit;
- /** A constant that converts yaw velocity to linear velocity to be used in calculating weapon-lag */
- var(Motion) float LagYawCoefficient;
- /** Weapon Lag State Properties Dynamic Lag tension modifiers. Effectively, these Strength values are multiplied into the tension based on the pawn's state. */
- var(Motion) float LagStrengthIronSights;
- var(Motion) float LagStrengthCrouch;
- var(Motion) float LagStrengthWalk;
- var(Motion) float LagStrengthJog;
- var(Motion) float LagStrengthSprint;
- var float StrafeLag;
- var float StrafeLagVelocity;
- /** The maximum horizontal offset from center */
- var(Motion) float StrafeLagLimit;
- /** Rate at which momentum changes should affect Strafe lagging */
- var(Motion) float StrafeLagRate;
- /** Rate at which weapon should return to normal after straffing. */
- var(Motion) float StrafeLagReturnRate;
- var int AimYawSpeed;
- var int AimPitchSpeed;
- /** The class of the third person attachment to spawn */
- var(Attachments) KFWeaponAttachment AttachmentArchetype;
- /** Object within weapon that manages melee attacks */
- var(Weapon) export editinline KFMeleeHelperWeapon MeleeAttackHelper;
- var KFMuzzleFlash MuzzleFlash;
- /** A reference to the muzzle flash template */
- var(Attachments) const KFMuzzleFlash MuzzleFlashTemplate;
- var transient KFFlashlightAttachment FlashLight;
- /** A reference to the muzzle flash template */
- var(Attachments) const KFFlashlightAttachment FlashLightTemplate;
- var float ProjectileSpawnOffset;
- /** 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 */
- var(Weapon) float MovingSpreadMod;
- /** Amount to scale spread when using ironsights */
- var(Weapon) float IronSightsSpreadMod;
- /** Amount to scale spread when Crouched */
- var(Weapon) float CrouchSpreadMod;
- /** max vertical units a weapon muzzle will climb from recoil */
- var(Recoil) int maxRecoilPitch;
- /** max vertical units a weapon muzzle will climb from recoil */
- var(Recoil) int minRecoilPitch;
- /** max horizontal units a weapon muzzle will move from recoil */
- var(Recoil) int maxRecoilYaw;
- /** min horizontal units a weapon muzzle will move from recoil */
- var(Recoil) int minRecoilYaw;
- /** Time in seconds each recoil should take to be applied. Must be less than the fire rate or the full recoil wont be applied */
- var(Recoil) float RecoilRate;
- /** What percentage of the RecoilSpeed it will take to blend recoil out */
- var(Recoil) float RecoilBlendOutRatio;
- /** What percentage of recoil to apply to the view rotation when firing */
- var(Recoil) float RecoilViewRotationScale;
- /** Scales how much effect the players rotation input (from mouse/gamepad) has on reducing the total recoil (the first person weapon model's recoil) */
- var(Recoil) float RecoilCompensationScale;
- /** At what percentage the weapon is recoiled torwards the Max or Min Pitch limit to start blending to full view rotation recoil */
- var(Recoil) float FullRecoilPitchPct;
- /** At what percentage the weapon is recoiled torwards the Max or Min Yaw limit to start blending to full view rotation recoil */
- var(Recoil) float FullRecoilYawPct;
- /** Maximum yaw rotation of the weapon from recoil before the player's view moves */
- var(Recoil) int RecoilMaxYawLimit;
- /** Minimum yaw rotation of the weapon from recoil before the player's view moves */
- var(Recoil) int RecoilMinYawLimit;
- /** Maximum pitch rotation of the weapon from recoil before the player's view moves */
- var(Recoil) int RecoilMaxPitchLimit;
- /** Minimum pitch rotation of the weapon from recoil before the player's view moves */
- var(Recoil) int RecoilMinPitchLimit;
- /** Maximum yaw rotation of the weapon from recoil before the player's view moves when using Iron sights */
- var(Recoil) int RecoilISMaxYawLimit;
- /** Minimum yaw rotation of the weapon from recoil before the player's view moves when using Iron sights */
- var(Recoil) int RecoilISMinYawLimit;
- /** Maximum pitch rotation of the weapon from recoil before the player's view moves when using Iron sights */
- var(Recoil) int RecoilISMaxPitchLimit;
- /** Minimum pitch rotation of the weapon from recoil before the player's view moves when using Iron sights */
- var(Recoil) int RecoilISMinPitchLimit;
- var Rotator RecoilRotator;
- var Rotator TotalRecoilRotator;
- var float RecoilTimeLeft;
- var float RecoilSpeed;
- var int RecoilYawBlendOutRate;
- var int RecoilPitchBlendOutRate;
- var float RecoilPitchPercentage;
- var float RecoilYawPercentage;
- var Rotator SuppressRecoilRotator;
- var float SuppressRecoilTimeLeft;
- /** The amount of time it will take to process this suppression recoil */
- var(Recoil) float SuppressRecoilSpeed;
- /** The percentage of the suppression recoil to apply to the player's view */
- var(Recoil) float SuppressRecoilViewRotationScale;
- /** Recoil modifier for when the player is holding the weapon in the hipped position */
- var(Recoil) float HippedRecoilModifier;
- /** Recoil modifier for when the player is jogging and shooting */
- var(Recoil) float JoggingRecoilModifier;
- /** Recoil modifier for when the player is walking and shooting */
- var(Recoil) float WalkingRecoilModifier;
- /** Recoil modifier for falling player stance */
- var(Recoil) float FallingRecoilModifier;
- /** Recoil modifier for crouched */
- var(Recoil) float StanceCrouchedRecoilModifier;
- var float LastRecoilModifier;
- /**
- *Used to compensate for weapons that have an ironsight mesh FOV that is different
- * Than the player's world FOV. When these mismatch, it causes the recoil
- * rotation to mismatch as well. Use this value to get them back in sync.
- */
- var(Recoil) float IronSightMeshFOVCompensationScale;
- var(Weapon) class<KFPerk> AssociatedPerkClass;
- replication
- {
- // Pos:0x000
- if(bNetDirty && bNetInitial || !bAllowClientAmmoTracking)
- AmmoCount
- // Pos:0x02A
- if(bNetDirty)
- SpareAmmoCount, bGivenAtStart
- // Pos:0x034
- if(bNetDirty && bNetInitial)
- MagazineCapacity, MaxSpareAmmo
- }
- // Export UKFWeapon::execEnsureWeaponOverlayComponentLast(FFrame&, void* const)
- native function EnsureWeaponOverlayComponentLast();
- // Export UKFWeapon::execWeaponProcessViewRotation(FFrame&, void* const)
- native function WeaponProcessViewRotation(PlayerController PC, float DeltaTime, out Rotator DeltaRot);
- // Export UKFWeapon::execGetPerk(FFrame&, void* const)
- native function KFPerk GetPerk();
- // Export UKFWeapon::execSetZedTimeResist(FFrame&, void* const)
- native function SetZedTimeResist(float ResistPct);
- // Export UKFWeapon::execSetZedTimeResistByTime(FFrame&, void* const)
- native function SetZedTimeResistByTime(float DesiredTimeDilation, optional float ZedTimeDilation)
- {
- ZedTimeDilation = 0.20;
- }
- // Export UKFWeapon::execSetZedTimeResistBySpeed(FFrame&, void* const)
- native function SetZedTimeResistBySpeed(float SpeedMultiplier, optional float ZedTimeDilation)
- {
- ZedTimeDilation = 0.20;
- }
- // Export UKFWeapon::execClearZedTimeResist(FFrame&, void* const)
- native function ClearZedTimeResist();
- simulated event PreBeginPlay()
- {
- super(Actor).PreBeginPlay();
- MySkelMesh = KFSkeletalMeshComponent(Mesh);
- // End:0x68
- if(MySkelMesh == none)
- {
- WarnInternal("A Invalid KFSkeletalMeshComponent(Mesh) cast!!!");
- }
- WeaponAnimSeqNode = KFAnimSeq_Tween(GetWeaponAnimNodeSeq());
- InitializeAmmo();
- InitializeEquipTime();
- // End:0x117
- if((RecoilRate > float(0)) && RecoilBlendOutRatio > float(0))
- {
- RecoilYawBlendOutRate = int((float(maxRecoilYaw) / RecoilRate) * RecoilBlendOutRatio);
- RecoilPitchBlendOutRate = int((float(maxRecoilPitch) / RecoilRate) * RecoilBlendOutRatio);
- }
- // End:0x12E
- if(bHasFlashlight)
- {
- AttachFlashlight();
- }
- //return;
- }
- simulated event PostInitAnimTree(SkeletalMeshComponent SkelComp)
- {
- WeaponAnimSeqNode = KFAnimSeq_Tween(SkelComp.FindAnimNode('WeaponSeq'));
- // End:0x67
- if(WeaponAnimSeqNode == none)
- {
- WeaponAnimSeqNode = KFAnimSeq_Tween(GetWeaponAnimNodeSeq());
- }
- IdleBobBlendNode = AnimNodeAdditiveBlending(SkelComp.FindAnimNode('IdleBobAdditiveBlend'));
- ToggleAdditiveBobAnim(false, 0.0);
- //return;
- }
- simulated function InitializeEquipTime()
- {
- EquipTime = ((EquipTime > float(0)) ? EquipTime : 0.010);
- PutDownTime = ((PutDownTime > float(0)) ? PutDownTime : 0.010);
- // End:0xC7
- if(bUseAnimLenEquipTime)
- {
- EquipTime = MySkelMesh.GetAnimInterruptTime(EquipAnim);
- PutDownTime = MySkelMesh.GetAnimLength(PutDownAnim);
- }
- //return;
- }
- simulated function InitFOV(float SizeX, float SizeY, float DefaultPlayerFOV)
- {
- MeshFOV = class'KFPlayerController'.static.CalcFOVForAspectRatio(default.MeshFOV, SizeX, SizeY);
- MeshIronSightFOV = class'KFPlayerController'.static.CalcFOVForAspectRatio(default.MeshIronSightFOV, SizeX, SizeY);
- PlayerIronSightFOV = class'KFPlayerController'.static.CalcFOVForAspectRatio(default.PlayerIronSightFOV, SizeX, SizeY);
- PlayerSprintFOV = class'KFPlayerController'.static.CalcFOVForAspectRatio(default.PlayerSprintFOV, SizeX, SizeY);
- // End:0x13A
- if(DefaultPlayerFOV > PlayerSprintFOV)
- {
- PlayerSprintFOV = DefaultPlayerFOV;
- }
- // End:0x15D
- if(bUsingSights)
- {
- SetFOV(MeshIronSightFOV);
- }
- // End:0x170
- else
- {
- SetFOV(MeshFOV);
- }
- // End:0x1C4
- if(bLogAnimation)
- {
- LogInternal((("PlayerIronSightFOV = " $ string(PlayerIronSightFOV)) $ " default POV = ") $ string(default.PlayerIronSightFOV));
- }
- // End:0x20F
- if(bLogAnimation)
- {
- LogInternal((("SprintFOV = " $ string(PlayerSprintFOV)) $ " default POV = ") $ string(default.PlayerSprintFOV));
- }
- //return;
- }
- simulated event Destroyed()
- {
- // End:0x63
- if(((Instigator != none) && Instigator.IsHumanControlled()) && Instigator.IsLocallyControlled())
- {
- PreloadTextures(false);
- }
- super.Destroyed();
- //return;
- }
- simulated function PreloadTextures(bool bForcePreload)
- {
- // End:0x5C
- if(MySkelMesh != none)
- {
- MySkelMesh.PreloadTextures(bForcePreload, WorldInfo.TimeSeconds + float(2));
- }
- //return;
- }
- function GivenTo(Pawn thisPawn, optional bool bDoNotActivate)
- {
- super(Inventory).GivenTo(thisPawn, bDoNotActivate);
- KFInventoryManager(InvManager).CurrentCarryBlocks += InventorySize;
- KFPawn(Instigator).NotifyInventoryWeightChanged();
- //return;
- }
- function ItemRemovedFromInvManager()
- {
- super.ItemRemovedFromInvManager();
- KFInventoryManager(InvManager).CurrentCarryBlocks -= InventorySize;
- KFPawn(Instigator).NotifyInventoryWeightChanged();
- //return;
- }
- reliable client simulated function ClientWeaponSet(bool bOptionalSet, optional bool bDoNotActivate)
- {
- local PlayerController PC;
- // End:0x119
- if(Instigator != none)
- {
- PC = PlayerController(Instigator.Controller);
- // End:0x119
- if((Instigator.Controller != none) && PC.myHUD != none)
- {
- InitFOV(PC.myHUD.SizeX, PC.myHUD.SizeY, PC.DefaultFOV);
- }
- }
- super.ClientWeaponSet(bOptionalSet, bDoNotActivate);
- //return;
- }
- simulated function AttachWeaponTo(SkeletalMeshComponent MeshCpnt, optional name SocketName)
- {
- local KFPawn KFP;
- KFP = KFPawn(Instigator);
- // End:0xE1
- if((KFP != none) && KFP.ArmsMesh != none)
- {
- KFP.ArmsMesh.SetParentAnimComponent(MySkelMesh);
- KFP.ArmsMesh.SetFOV(MySkelMesh.FOV);
- }
- // End:0x261
- if(Instigator.IsFirstPerson())
- {
- // End:0x149
- if(KFP.AllowFirstPersonPreshadows())
- {
- Mesh.bAllowPerObjectShadows = true;
- }
- // End:0x16A
- else
- {
- Mesh.bAllowPerObjectShadows = false;
- }
- AttachComponent(Mesh);
- EnsureWeaponOverlayComponentLast();
- SetHidden(true);
- bPendingShow = true;
- // End:0x25E
- if(KFP != none)
- {
- SetMeshLightingChannels(KFP.PawnLightingChannel);
- // End:0x25E
- if(KFP.ArmsMesh != none)
- {
- Mesh.SetShadowParent(KFP.ArmsMesh);
- AttachComponent(KFP.ArmsMesh);
- }
- }
- }
- // End:0x370
- else
- {
- // End:0x321
- if(bWeaponNeedsServerPosition && (WorldInfo.NetMode == NM_DedicatedServer) || (WorldInfo.NetMode == NM_ListenServer) && !Instigator.IsLocallyControlled())
- {
- AttachComponent(Mesh);
- EnsureWeaponOverlayComponentLast();
- SetHidden(true);
- bPendingShow = true;
- }
- // End:0x370
- else
- {
- SetHidden(true);
- // End:0x370
- if(KFP != none)
- {
- KFP.ArmsMesh.SetHidden(true);
- }
- }
- }
- // End:0x406
- if((Role == ROLE_Authority) && KFP != none)
- {
- KFP.WeaponAttachmentTemplate = AttachmentArchetype;
- // End:0x406
- if(WorldInfo.NetMode != NM_DedicatedServer)
- {
- KFP.WeaponAttachmentChanged();
- }
- }
- //return;
- }
- simulated function DetachWeapon()
- {
- local KFPawn KFP;
- DetachComponent(Mesh);
- // End:0x35
- if(OverlayMesh != none)
- {
- DetachComponent(OverlayMesh);
- }
- KFP = KFPawn(Instigator);
- // End:0x10B
- if((Role == ROLE_Authority) && KFP != none)
- {
- // End:0x10B
- if(KFP.WeaponAttachmentTemplate == AttachmentArchetype)
- {
- KFP.WeaponAttachmentTemplate = none;
- // End:0x10B
- if(WorldInfo.NetMode != NM_DedicatedServer)
- {
- KFP.WeaponAttachmentChanged();
- }
- }
- }
- // End:0x168
- if((KFP != none) && KFP.ArmsMesh != none)
- {
- DetachComponent(KFP.ArmsMesh);
- }
- SetBase(none);
- SetHidden(true);
- DetachMuzzleFlash();
- //return;
- }
- simulated function DetachMuzzleFlash()
- {
- // End:0x53
- if((MySkelMesh != none) && MuzzleFlash != none)
- {
- MuzzleFlash.DetachMuzzleFlash(MySkelMesh);
- MuzzleFlash = none;
- }
- //return;
- }
- simulated function CreateOverlayMesh()
- {
- //return;
- }
- simulated function AttachFlashlight()
- {
- // End:0x78
- if(((MySkelMesh != none) && FlashLight == none) && bHasFlashlight)
- {
- FlashLight = new (self) class'KFFlashlightAttachment' (FlashLightTemplate);
- FlashLight.AttachFlashlight(MySkelMesh);
- }
- //return;
- }
- function DropFrom(Vector StartLocation, Vector StartVelocity)
- {
- local DroppedPickup P;
- StartLocation.Z += (Instigator.BaseEyeHeight / float(2));
- // End:0x53
- if(!CanThrow())
- {
- return;
- }
- // End:0x78
- if((DroppedPickupClass == none) || DroppedPickupMesh == none)
- {
- Destroy();
- return;
- }
- P = Spawn(DroppedPickupClass, StartLocation, true);
- // End:0xFF
- if(P == none)
- {
- PlayerController(Instigator.Controller).ReceiveLocalizedMessage(class'KFLocalMessage_Game', 15);
- return;
- }
- // End:0x2B1
- if((Instigator != none) && Instigator.InvManager != none)
- {
- Instigator.InvManager.RemoveFromInventory(self);
- // End:0x2B1
- if(Instigator.IsAliveAndWell() && !Instigator.InvManager.bPendingDelete)
- {
- // End:0x2B1
- if(((Role == ROLE_Authority) && KFGameInfo(WorldInfo.Game) != none) && KFGameInfo(WorldInfo.Game).DialogManager != none)
- {
- KFGameInfo(WorldInfo.Game).DialogManager.PlayDropWeaponDialog(KFPawn(Instigator));
- }
- }
- }
- P.SetPhysics(2);
- P.Inventory = self;
- P.InventoryClass = Class;
- P.Velocity = StartVelocity;
- P.Instigator = Instigator;
- P.SetPickupMesh(DroppedPickupMesh);
- P.SetPickupParticles(DroppedPickupParticles);
- Instigator = none;
- GotoState('None');
- AIController = none;
- //return;
- }
- function bool DenyPickupQuery(class<Inventory> ItemClass, Actor Pickup)
- {
- // End:0x78
- if(ItemClass == Class)
- {
- // End:0x5F
- if(CanRefillSecondaryAmmo())
- {
- return (SpareAmmoCount[0] >= MaxSpareAmmo[0]) && AmmoCount[1] >= MagazineCapacity[1];
- }
- // End:0x78
- else
- {
- return SpareAmmoCount[0] >= MaxSpareAmmo[0];
- }
- }
- return false;
- //return ReturnValue;
- }
- static simulated function bool IsInventoryWeapon()
- {
- return default.InventoryGroup == 3;
- //return ReturnValue;
- }
- static simulated function bool IsMeleeWeapon()
- {
- return default.bMeleeWeapon;
- //return ReturnValue;
- }
- simulated function float GetWeaponRating()
- {
- // End:0x41
- if(!Instigator.IsHumanControlled() || !HasAnyAmmo())
- {
- return super.GetWeaponRating();
- }
- return GroupPriority;
- //return ReturnValue;
- }
- simulated event SetFOV(float NewFOV)
- {
- local KFPawn KFP;
- // End:0x37
- if(MySkelMesh != none)
- {
- MySkelMesh.super(KFWeapon).SetFOV(NewFOV);
- }
- // End:0x6E
- if(MuzzleFlash != none)
- {
- MuzzleFlash.SetFOV(NewFOV);
- }
- KFP = KFPawn(Instigator);
- // End:0x13D
- if((KFP != none) && KFP.ArmsMesh.ParentAnimComponent == MySkelMesh)
- {
- // End:0x13D
- if(KFP.ArmsMesh != none)
- {
- KFP.ArmsMesh.super(KFWeapon).SetFOV(NewFOV);
- }
- }
- //return;
- }
- simulated function SetIronSights(bool bNewIronSights)
- {
- // End:0x1B
- if(bUsingSights == bNewIronSights)
- {
- return;
- }
- // End:0x41
- if(!Instigator.IsLocallyControlled())
- {
- return;
- }
- // End:0x5D
- if(bUsingSights)
- {
- PerformZoom(false);
- }
- // End:0x76
- else
- {
- // End:0x76
- if(AllowIronSights())
- {
- PerformZoom(true);
- }
- }
- //return;
- }
- simulated function bool AllowIronSights()
- {
- // End:0x11
- if(!bHasIronSights)
- {
- return false;
- }
- return true;
- //return ReturnValue;
- }
- simulated function EnableIronSightsDoF(bool bEnableDOF)
- {
- local KFPlayerController PC;
- // End:0x7A
- if(Instigator != none)
- {
- PC = KFPlayerController(Instigator.Controller);
- // End:0x7A
- if(PC != none)
- {
- PC.EnableDepthOfField(bEnableDOF);
- }
- }
- //return;
- }
- simulated function EnablePlayerZoom(bool bEnableZoom)
- {
- local KFPlayerController PC;
- // End:0xF5
- if(Instigator != none)
- {
- PC = KFPlayerController(Instigator.Controller);
- // End:0xF5
- if(PC != none)
- {
- // End:0xAF
- if(bEnableZoom)
- {
- PC.StartAutoTargeting();
- PC.HandleTransitionFOV(PlayerIronSightFOV, ZoomTime);
- }
- // End:0xF5
- else
- {
- PC.HandleTransitionFOV(PC.DefaultFOV, ZoomTime);
- }
- }
- }
- //return;
- }
- simulated function PerformZoom(bool bZoomStatus, optional bool bAnimateTransition)
- {
- bAnimateTransition = true;
- // End:0x85
- if(bZoomStatus)
- {
- // End:0x3D
- if(Instigator.Physics == 2)
- {
- return;
- }
- ZoomIn(bAnimateTransition, default.ZoomInTime);
- // End:0x82
- if(Role < ROLE_Authority)
- {
- ServerZoomIn(bAnimateTransition);
- }
- }
- // End:0xCA
- else
- {
- ZoomOut(bAnimateTransition, default.ZoomOutTime);
- // End:0xCA
- if(Role < ROLE_Authority)
- {
- ServerZoomOut(bAnimateTransition);
- }
- }
- //return;
- }
- simulated function ZoomIn(bool bAnimateTransition, float ZoomTimeToGo)
- {
- // End:0x163
- if(bAnimateTransition)
- {
- ZoomInTime = ZoomTimeToGo;
- // End:0x9F
- if(bZoomingOut)
- {
- bZoomingOut = false;
- bZoomOutInterrupted = true;
- ZoomTime = ZoomInTime - ZoomTime;
- ZoomPartialTime = ZoomTime;
- ZoomStartOffset = PlayerViewOffset;
- ZoomRotStartOffset = ZoomRotInterp;
- }
- // End:0xC5
- else
- {
- ZoomTime = ZoomInTime;
- ZoomStartOffset = PlayerViewOffset;
- }
- // End:0xF7
- if(bHasScopePosition && bUsingScopePosition)
- {
- ZoomTargetOffset = ScopePosition;
- }
- // End:0x10A
- else
- {
- ZoomTargetOffset = IronSightPosition;
- }
- // End:0x144
- if(MySkelMesh != none)
- {
- ZoomWeaponFOVStart = MySkelMesh.FOV;
- }
- // End:0x157
- else
- {
- ZoomWeaponFOVStart = MeshFOV;
- }
- bZoomingIn = true;
- }
- // End:0x1B3
- if((WorldInfo.NetMode != NM_DedicatedServer) && Instigator != none)
- {
- EnablePlayerZoom(true);
- EnableIronSightsDoF(true);
- }
- bUsingSights = true;
- // End:0x2AA
- if(((Role == ROLE_Authority) && KFGameInfo(WorldInfo.Game) != none) && KFGameInfo(WorldInfo.Game).DialogManager != none)
- {
- KFGameInfo(WorldInfo.Game).DialogManager.PlayIronsightsDialog(KFPawn(Instigator));
- }
- //return;
- }
- private reliable server final function ServerZoomIn(bool bAnimateTransition)
- {
- ZoomIn(bAnimateTransition, default.ZoomInTime);
- //return;
- }
- simulated function ZoomOut(bool bAnimateTransition, float ZoomTimeToGo)
- {
- // End:0xD4
- if(bAnimateTransition)
- {
- ZoomOutTime = ZoomTimeToGo;
- // End:0x9F
- if(bZoomingIn)
- {
- bZoomingIn = false;
- bZoomInInterrupted = true;
- ZoomTime = ZoomOutTime - ZoomTime;
- ZoomPartialTime = ZoomTime;
- ZoomStartOffset = PlayerViewOffset;
- ZoomRotStartOffset = ZoomRotInterp;
- }
- // End:0xC5
- else
- {
- ZoomTime = ZoomOutTime;
- ZoomStartOffset = PlayerViewOffset;
- }
- bZoomingOut = true;
- }
- // End:0x1C4
- else
- {
- bFastZoomOut = true;
- // End:0x15F
- if(bZoomingIn)
- {
- bZoomingIn = false;
- bZoomInInterrupted = true;
- ZoomTime = default.ZoomOutTime - ZoomTime;
- ZoomPartialTime = ZoomTime;
- ZoomStartOffset = PlayerViewOffset;
- ZoomRotStartOffset = ZoomRotInterp;
- }
- // End:0x185
- else
- {
- ZoomTime = FastZoomOutTime;
- ZoomStartOffset = PlayerViewOffset;
- }
- bZoomingOut = true;
- LastZoomOutTime = WorldInfo.TimeSeconds + ZoomTime;
- }
- ZoomTargetOffset = default.PlayerViewOffset;
- // End:0x211
- if(MySkelMesh != none)
- {
- ZoomWeaponFOVStart = MySkelMesh.FOV;
- }
- // End:0x224
- else
- {
- ZoomWeaponFOVStart = MeshIronSightFOV;
- }
- // End:0x274
- if((WorldInfo.NetMode != NM_DedicatedServer) && Instigator != none)
- {
- EnableIronSightsDoF(false);
- EnablePlayerZoom(false);
- }
- bUsingSights = false;
- //return;
- }
- private reliable server final function ServerZoomOut(bool bAnimateTransition)
- {
- ZoomOut(bAnimateTransition, default.ZoomOutTime);
- //return;
- }
- private reliable server final function ServerZoomOutModified(bool bAnimateTransition, float NewZoomOutTime)
- {
- ZoomOut(bAnimateTransition, NewZoomOutTime);
- //return;
- }
- simulated event OnZoomInFinished()
- {
- OnAnimEnd(none, 0.0, 0.0);
- //return;
- }
- simulated event OnZoomOutFinished()
- {
- OnAnimEnd(none, 0.0, 0.0);
- //return;
- }
- simulated function bool ShouldOwnerWalk()
- {
- return bUsingSights;
- //return ReturnValue;
- }
- function bool IsGrappleBlocked(Pawn InstigatedBy)
- {
- return false;
- //return ReturnValue;
- }
- function AdjustDamage(out int InDamage, class<DamageType> DamageType, Actor DamageCauser)
- {
- //return;
- }
- simulated function PlayTakeHitEffects(Vector HitLocation, Actor DamageCauser)
- {
- //return;
- }
- simulated function SetWeaponSprint(bool bNewSprintStatus)
- {
- // End:0x77
- if(bNewSprintStatus)
- {
- // End:0x26
- if(bUsingSights)
- {
- PerformZoom(false);
- }
- // End:0x6D
- if((CurrentFireMode < GetPendingFireLength()) && PendingFire(CurrentFireMode))
- {
- StopFire(CurrentFireMode);
- }
- GotoWeaponSprinting();
- }
- //return;
- }
- simulated function StopPawnSprint(bool bClearPlayerInput)
- {
- local KFPawn KFP;
- local PlayerController PC;
- local KFPlayerInput Input;
- KFP = KFPawn(Instigator);
- // End:0x183
- if(KFP != none)
- {
- KFP.SetSprinting(false);
- // End:0x183
- if(KFP.IsLocallyControlled())
- {
- PC = PlayerController(Instigator.Controller);
- // End:0xDD
- if((PC != none) && bClearPlayerInput)
- {
- PC.bRun = 0;
- }
- Input = KFPlayerInput(PC.PlayerInput);
- // End:0x183
- if((Input != none) && Input.bExtendedSprinting)
- {
- PC.bRun = 0;
- Input.bExtendedSprinting = false;
- }
- }
- }
- //return;
- }
- simulated function bool AllowSprinting()
- {
- return true;
- //return ReturnValue;
- }
- simulated function GotoWeaponSprinting()
- {
- //return;
- }
- simulated function PlayAnimation(name Sequence, optional float fDesiredDuration, optional bool bLoop, optional float BlendInTime, optional float BlendOutTime)
- {
- BlendInTime = 0.10;
- BlendOutTime = 0.0;
- // End:0x3E
- if((Sequence == 'None') || Instigator == none)
- {
- return;
- }
- // End:0xA4
- if(bLogAnimation)
- {
- LogInternal((((("PlayAnimation Sequence=" @ string(Sequence)) @ "Length=") @ string(fDesiredDuration)) @ "bLoop=") @ string(bLoop));
- }
- // End:0x122
- if(Instigator.IsFirstPerson())
- {
- BlendInTime *= (WorldInfo.TimeDilation * CustomTimeDilation);
- WeaponAnimSeqNode.SetTweenTime(BlendInTime);
- }
- PlayWeaponAnimation(Sequence, fDesiredDuration, bLoop);
- // End:0x1DD
- if(!bLoop)
- {
- // End:0x18E
- if(fDesiredDuration > float(0))
- {
- SetTimer(fDesiredDuration - BlendOutTime, false, 'OnAnimEnd');
- }
- // End:0x1DA
- else
- {
- SetTimer((MySkelMesh.GetAnimLength(Sequence) * DefaultAnimSpeed) - BlendOutTime, false, 'OnAnimEnd');
- }
- }
- // End:0x1F1
- else
- {
- ClearTimer('OnAnimEnd');
- }
- //return;
- }
- simulated function PlayWeaponAnimation(name Sequence, float fDesiredDuration, optional bool bLoop, optional SkeletalMeshComponent SkelMesh)
- {
- local float DesiredRate;
- // End:0x231
- if(((Mesh != none) && Instigator != none) && WorldInfo.NetMode != NM_DedicatedServer)
- {
- // End:0x9A
- if(!Mesh.bAttached)
- {
- AttachWeaponTo(Instigator.Mesh);
- }
- // End:0x231
- if(WeaponAnimSeqNode != none)
- {
- // End:0x138
- if((WeaponAnimSeqNode.AnimSeq == none) || WeaponAnimSeqNode.AnimSeq.SequenceName != Sequence)
- {
- WeaponAnimSeqNode.SetAnim(Sequence);
- }
- // End:0x1FE
- if(fDesiredDuration > 0.0)
- {
- DesiredRate = WeaponAnimSeqNode.AnimSeq.SequenceLength / (fDesiredDuration * WeaponAnimSeqNode.AnimSeq.RateScale);
- WeaponAnimSeqNode.PlayAnim(bLoop, DesiredRate);
- }
- // End:0x231
- else
- {
- WeaponAnimSeqNode.PlayAnim(bLoop, DefaultAnimSpeed);
- }
- }
- }
- //return;
- }
- simulated function AnimNodeSequence GetWeaponAnimNodeSeq()
- {
- // End:0x19
- if(WeaponAnimSeqNode != none)
- {
- return WeaponAnimSeqNode;
- }
- return super.GetWeaponAnimNodeSeq();
- //return ReturnValue;
- }
- simulated function ChangeAnimationRate(name Sequence, float NewRate)
- {
- local AnimNodeSequence WeapNode;
- WeapNode = GetWeaponAnimNodeSeq();
- // End:0x79
- if((WeapNode != none) && WeapNode.AnimSeqName == Sequence)
- {
- WeapNode.Rate = NewRate;
- }
- //return;
- }
- simulated function bool WeaponIsAnimating()
- {
- // End:0x23
- if((MySkelMesh == none) || (GetWeaponAnimNodeSeq()) == none)
- {
- return false;
- }
- return WeaponAnimSeqNode.bPlaying;
- //return ReturnValue;
- }
- 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)
- {
- local PlayerController PC;
- local CameraAnimInst AnimInst;
- Scale = 1.0;
- Rate = 1.0;
- Space = 0;
- PC = PlayerController(Instigator.Controller);
- // End:0x149
- if(PC.PlayerCamera != none)
- {
- AnimInst = PC.PlayerCamera.PlayCameraAnim(AnimToPlay, Rate, Scale, BlendInTime, BlendOutTime, bLoop, bRandomStartTime);
- // End:0x149
- if((AnimInst != none) && Space != 0)
- {
- AnimInst.SetPlaySpace(Space, CustomPlaySpace);
- }
- }
- return AnimInst;
- //return ReturnValue;
- }
- simulated function bool ShouldPlayFireLast(byte FireModeNum)
- {
- // End:0xAD
- if(bHasFireLastAnims)
- {
- // End:0xAD
- if(((!bAllowClientAmmoTracking && Role < ROLE_Authority) && AmmoCount[GetAmmoType(FireModeNum)] <= 1) || (bAllowClientAmmoTracking || Role == ROLE_Authority) && AmmoCount[GetAmmoType(FireModeNum)] == 0)
- {
- return true;
- }
- }
- return false;
- //return ReturnValue;
- }
- simulated function name GetWeaponFireAnim(byte FireModeNum)
- {
- local bool bPlayFireLast;
- bPlayFireLast = ShouldPlayFireLast(FireModeNum);
- // End:0x6B
- if(bUsingScopePosition)
- {
- // End:0x5E
- if(bPlayFireLast && FireLastScopedAnim != 'None')
- {
- return FireLastScopedAnim;
- }
- // End:0x68
- else
- {
- return FireScopedAnim;
- }
- }
- // End:0x102
- else
- {
- // End:0xC5
- if(bUsingSights)
- {
- // End:0xAB
- if(bPlayFireLast && FireLastSightedAnim != 'None')
- {
- return FireLastSightedAnim;
- }
- // End:0xC2
- else
- {
- return FireSightedAnims[Rand(FireSightedAnims.Length)];
- }
- }
- // End:0x102
- else
- {
- // End:0xF8
- if(bPlayFireLast && FireLastAnim != 'None')
- {
- return FireLastAnim;
- }
- // End:0x102
- else
- {
- return FireAnim;
- }
- }
- }
- //return ReturnValue;
- }
- simulated function name GetLoopingFireAnim(byte FireModeNum)
- {
- // End:0x1A
- if(bUsingScopePosition)
- {
- return FireLoopScopedAnim;
- }
- // End:0x31
- else
- {
- // End:0x31
- if(bUsingSights)
- {
- return FireLoopSightedAnim;
- }
- }
- return FireLoopAnim;
- //return ReturnValue;
- }
- simulated function name GetLoopStartFireAnim(byte FireModeNum)
- {
- // End:0x17
- if(bUsingSights)
- {
- return FireLoopStartSightedAnim;
- }
- return FireLoopStartAnim;
- //return ReturnValue;
- }
- simulated function name GetLoopEndFireAnim(byte FireModeNum)
- {
- // End:0x17
- if(bUsingSights)
- {
- return FireLoopEndSightedAnim;
- }
- return FireLoopEndAnim;
- //return ReturnValue;
- }
- simulated function name GetMeleeAnimName(KFPawn.EPawnOctant AtkDir, KFMeleeHelperWeapon.EMeleeAttackType AtkType)
- {
- local int Idx;
- // End:0x3A
- if(MeleeAttackAnims.Length > 0)
- {
- Idx = Rand(MeleeAttackAnims.Length);
- return MeleeAttackAnims[Idx];
- }
- //return ReturnValue;
- }
- simulated function WeaponPlaySound(AkBaseSoundObject Sound, optional float NoiseLoudness)
- {
- // End:0x60
- if(((Sound != none) && Instigator != none) && !bSuppressSounds)
- {
- Instigator.PlaySoundBase(Sound, false, true);
- }
- //return;
- }
- simulated function ChangeVisibility(bool bIsVisible)
- {
- local KFPawn KFP;
- local editinline SkeletalMeshComponent SkelMesh;
- local editinline PrimitiveComponent Primitive;
- // End:0x10B
- if(Mesh != none)
- {
- // End:0x69
- if(bIsVisible && !Mesh.bAttached)
- {
- AttachComponent(Mesh);
- EnsureWeaponOverlayComponentLast();
- PlayIdleAnim();
- }
- SetHidden(!bIsVisible);
- SkelMesh = SkeletalMeshComponent(Mesh);
- // End:0x10B
- if(SkelMesh != none)
- {
- // End:0x10A
- foreach SkelMesh.AttachedComponents(class'PrimitiveComponent', Primitive)
- {
- Primitive.SetHidden(!bIsVisible);
- }
- }
- }
- KFP = KFPawn(Instigator);
- // End:0x1FC
- if((KFP != none) && KFP.ArmsMesh != none)
- {
- // End:0x194
- if(bIsVisible)
- {
- AttachComponent(KFP.ArmsMesh);
- }
- // End:0x1BC
- else
- {
- DetachComponent(KFP.ArmsMesh);
- }
- KFP.ArmsMesh.SetHidden(!bIsVisible);
- }
- // End:0x236
- if(OverlayMesh != none)
- {
- OverlayMesh.SetHidden(!bIsVisible);
- }
- //return;
- }
- simulated function AnimNodeSequence GetArmAnimNodeSeq()
- {
- local KFPawn P;
- P = KFPawn(Instigator);
- // End:0x8E
- if((P != none) && P.ArmsMesh != none)
- {
- return AnimNodeSequence(P.ArmsMesh.Animations);
- }
- return none;
- //return ReturnValue;
- }
- simulated function ANIMNOTIFY_LockBolt()
- {
- // End:0x32
- if(bAllowClientAmmoTracking)
- {
- // End:0x2F
- if(AmmoCount[0] == 0)
- {
- bIsBoltLockedBack = true;
- }
- }
- // End:0x98
- else
- {
- // End:0x98
- if(((Role < ROLE_Authority) && AmmoCount[0] <= 1) || (Role == ROLE_Authority) && AmmoCount[0] == 0)
- {
- bIsBoltLockedBack = true;
- }
- }
- //return;
- }
- simulated function ANIMNOTIFY_UnLockBolt()
- {
- bIsBoltLockedBack = false;
- //return;
- }
- simulated function ToggleAdditiveBobAnim(bool bOn, optional float BlendTime)
- {
- BlendTime = 0.10;
- // End:0x68
- if(IdleBobBlendNode != none)
- {
- IdleBobBlendNode.SetBlendTarget(((bOn && bUseAdditiveMoveAnim) ? 1.0 : 0.0), BlendTime);
- }
- //return;
- }
- // Export UKFWeapon::execGetAnimSeqCameraPosition(FFrame&, void* const)
- native final function bool GetAnimSeqCameraPosition(out Vector OutPos, out Rotator OutRot);
- simulated event SetPosition(KFPawn Holder)
- {
- local Vector DrawOffset, ViewOffset, FinalLocation;
- local Rotator NewRotation, FinalRotation, SpecRotation;
- local PlayerController PC;
- local Vector SpecViewLoc;
- local Rotator DebugRotationOffset, UsedBufferRotation;
- local Vector CamLoc;
- local Rotator CamRot;
- // End:0x37
- if(!Holder.IsFirstPerson() && !bWeaponNeedsServerPosition)
- {
- return;
- }
- // End:0x118
- if(bForceHidden)
- {
- Mesh.SetHidden(true);
- Holder.ArmsMesh.SetHidden(true);
- NewRotation = Holder.GetViewRotation();
- SetLocation(Instigator.GetPawnViewLocation() + (HiddenWeaponsOffset >> NewRotation));
- SetRotation(NewRotation);
- SetBase(Instigator);
- return;
- }
- // End:0x13C
- if(bPendingShow)
- {
- SetHidden(false);
- bPendingShow = false;
- }
- Mesh.SetHidden(false);
- PC = GetALocalPlayerController();
- ViewOffset = PlayerViewOffset;
- // End:0x1C7
- if(class'Engine'.static.IsRealDStereoEnabled())
- {
- ViewOffset.X -= float(30);
- }
- // End:0x2D8
- if((Holder.Controller == none) && KFDemoRecSpectator(PC) != none)
- {
- PC.GetPlayerViewPoint(SpecViewLoc, SpecRotation);
- DrawOffset = ViewOffset >> SpecRotation;
- DrawOffset += Holder.WeaponBob(BobDamping, JumpDamping);
- FinalLocation = SpecViewLoc + DrawOffset;
- SetLocation(FinalLocation);
- SetBase(Holder);
- SetRotation(SpecRotation);
- return;
- }
- NewRotation = ((Holder.Controller == none) ? Holder.GetBaseAimRotation() : Holder.Controller.Rotation);
- NewRotation += ZoomRotInterp;
- // End:0x6EE
- if(KFPlayerController(Holder.Controller) != none)
- {
- // End:0x415
- if(bDebugRecoilPosition)
- {
- DebugRotationOffset.Pitch = RecoilISMaxPitchLimit;
- KFPlayerController(Holder.Controller).WeaponBufferRotation = DebugRotationOffset;
- }
- // End:0x4EC
- if(KFPlayerController(Holder.Controller).WeaponBufferRotation.Pitch < 32768)
- {
- UsedBufferRotation.Pitch = int(float(KFPlayerController(Holder.Controller).WeaponBufferRotation.Pitch) / IronSightMeshFOVCompensationScale);
- }
- // End:0x577
- else
- {
- UsedBufferRotation.Pitch = int(float(65535) - (float(65535 - KFPlayerController(Holder.Controller).WeaponBufferRotation.Pitch) / IronSightMeshFOVCompensationScale));
- }
- // End:0x64E
- if(KFPlayerController(Holder.Controller).WeaponBufferRotation.Yaw < 32768)
- {
- UsedBufferRotation.Yaw = int(float(KFPlayerController(Holder.Controller).WeaponBufferRotation.Yaw) / IronSightMeshFOVCompensationScale);
- }
- // End:0x6D9
- else
- {
- UsedBufferRotation.Yaw = int(float(65535) - (float(65535 - KFPlayerController(Holder.Controller).WeaponBufferRotation.Yaw) / IronSightMeshFOVCompensationScale));
- }
- NewRotation += UsedBufferRotation;
- }
- // End:0x745
- if(bFollowAnimSeqCamera && GetAnimSeqCameraPosition(CamLoc, CamRot))
- {
- ViewOffset += CamLoc;
- NewRotation += CamRot;
- }
- FinalRotation = NewRotation;
- DrawOffset.Z += Holder.GetEyeHeight();
- DrawOffset += Holder.WeaponBob(BobDamping, JumpDamping);
- DrawOffset += ((WeaponLag + ViewOffset) >> FinalRotation);
- FinalLocation = Holder.Location + DrawOffset;
- SetLocation(FinalLocation);
- SetRotation(FinalRotation);
- SetBase(Holder);
- //return;
- }
- simulated function PlayFireEffects(byte FireModeNum, optional Vector HitLocation)
- {
- local name WeaponFireAnimName;
- // End:0x59
- if(((FireModeNum < bLoopingFireSnd.Length) && bLoopingFireSnd[FireModeNum]) && !bPlayingLoopingFireSnd)
- {
- StartLoopingFireSound(FireModeNum);
- }
- PlayFiringSound(CurrentFireMode);
- // End:0x14F
- if((Instigator != none) && Instigator.IsFirstPerson())
- {
- // End:0x128
- if(!bPlayingLoopingFireAnim)
- {
- WeaponFireAnimName = GetWeaponFireAnim(FireModeNum);
- // End:0x128
- if(WeaponFireAnimName != 'None')
- {
- PlayAnimation(WeaponFireAnimName, MySkelMesh.GetAnimLength(WeaponFireAnimName), FireTweenTime);
- }
- }
- HandleRecoil();
- ShakeView();
- CauseMuzzleFlash(FireModeNum);
- }
- //return;
- }
- simulated function StopFireEffects(byte FireModeNum)
- {
- // End:0x61
- if(MuzzleFlash != none)
- {
- // End:0x42
- if(FireModeNum == 0)
- {
- MuzzleFlash.StopMuzzleFlash();
- }
- // End:0x61
- else
- {
- MuzzleFlash.StopMuzzleAltFlash();
- }
- }
- //return;
- }
- simulated function StartLoopingFireEffects(byte FireModeNum, optional bool bForceAnim)
- {
- local name WeaponFireAnimName;
- // End:0x134
- if(bForceAnim || (FireModeNum < bLoopingFireAnim.Length) && bLoopingFireAnim[FireModeNum])
- {
- WeaponFireAnimName = GetLoopStartFireAnim(FireModeNum);
- // End:0xC5
- if(WeaponFireAnimName != 'None')
- {
- PlayAnimation(WeaponFireAnimName, MySkelMesh.GetAnimLength(WeaponFireAnimName), false, FireTweenTime, 0.0);
- }
- // End:0x128
- else
- {
- WeaponFireAnimName = GetLoopingFireAnim(FireModeNum);
- PlayAnimation(WeaponFireAnimName, MySkelMesh.GetAnimLength(WeaponFireAnimName), true, FireTweenTime);
- }
- bPlayingLoopingFireAnim = true;
- }
- StartLoopingFireSound(FireModeNum);
- //return;
- }
- simulated function StopLoopingFireEffects(byte FireModeNum)
- {
- local name LoopEndFireAnim;
- // End:0xA2
- if(bPlayingLoopingFireAnim)
- {
- LoopEndFireAnim = GetLoopEndFireAnim(FireModeNum);
- // End:0x82
- if(LoopEndFireAnim != 'None')
- {
- PlayAnimation(LoopEndFireAnim, MySkelMesh.GetAnimLength(LoopEndFireAnim));
- }
- // End:0x96
- else
- {
- ClearTimer('OnAnimEnd');
- }
- bPlayingLoopingFireAnim = false;
- }
- StopLoopingFireSound(FireModeNum);
- //return;
- }
- simulated function bool ShouldForceSingleFireSound()
- {
- // End:0x4B
- if((self.WorldInfo.TimeDilation < 1.0) && SingleFireMode != 255)
- {
- return true;
- }
- return false;
- //return ReturnValue;
- }
- simulated function StartLoopingFireSound(byte FireModeNum)
- {
- // End:0xC9
- if(((FireModeNum < bLoopingFireSnd.Length) && bLoopingFireSnd[FireModeNum]) && !ShouldForceSingleFireSound())
- {
- bPlayingLoopingFireSnd = true;
- KFPawn(Instigator).SetWeaponAmbientSound(WeaponFireSnd[FireModeNum].DefaultCue, WeaponFireSnd[FireModeNum].FirstPersonCue);
- }
- //return;
- }
- simulated function StopLoopingFireSound(byte FireModeNum)
- {
- // End:0xB7
- if(bPlayingLoopingFireSnd)
- {
- KFPawn(Instigator).SetWeaponAmbientSound(none);
- // End:0xAB
- if(FireModeNum < WeaponFireLoopEndSnd.Length)
- {
- WeaponPlayFireSound(WeaponFireLoopEndSnd[FireModeNum].DefaultCue, WeaponFireLoopEndSnd[FireModeNum].FirstPersonCue);
- }
- bPlayingLoopingFireSnd = false;
- }
- //return;
- }
- simulated function PlayFiringSound(byte FireModeNum)
- {
- local byte UsedFireModeNum;
- MakeNoise(1.0, 'PlayerFiring');
- // End:0xFD
- if(!bPlayingLoopingFireSnd)
- {
- UsedFireModeNum = FireModeNum;
- // End:0x89
- if(((FireModeNum < bLoopingFireSnd.Length) && bLoopingFireSnd[FireModeNum]) && ShouldForceSingleFireSound())
- {
- UsedFireModeNum = SingleFireMode;
- }
- // End:0xFD
- if(UsedFireModeNum < WeaponFireSnd.Length)
- {
- WeaponPlayFireSound(WeaponFireSnd[UsedFireModeNum].DefaultCue, WeaponFireSnd[UsedFireModeNum].FirstPersonCue);
- }
- }
- //return;
- }
- simulated function WeaponPlayFireSound(AkBaseSoundObject DefaultSound, AkBaseSoundObject FirstPersonSound)
- {
- local Vector SoundLocation;
- // End:0x17E
- if((Instigator != none) && !bSuppressSounds)
- {
- SoundLocation = Instigator.GetPawnViewLocation();
- // End:0x139
- if(((FirstPersonSound != none) && Instigator.IsLocallyControlled()) && Instigator.IsFirstPerson())
- {
- Instigator.PlaySoundBase(FirstPersonSound, true, false, false);
- // End:0x136
- if(WorldInfo.NetMode == NM_ListenServer)
- {
- KFPawn(Instigator).ReplicateSound(DefaultSound, false, false, false, SoundLocation);
- }
- }
- // End:0x17E
- else
- {
- // End:0x17E
- if(DefaultSound != none)
- {
- Instigator.PlaySoundBase(DefaultSound, false, true, false, SoundLocation);
- }
- }
- }
- //return;
- }
- simulated function CauseMuzzleFlash(byte FireModeNum)
- {
- // End:0x19
- if(MuzzleFlash == none)
- {
- AttachMuzzleFlash();
- }
- // End:0x91
- if(MuzzleFlash != none)
- {
- MuzzleFlash.CauseMuzzleFlash(FireModeNum);
- // End:0x91
- if(MuzzleFlash.bAutoActivateShellEject)
- {
- MuzzleFlash.CauseShellEject();
- }
- }
- //return;
- }
- simulated function ANIMNOTIFY_ShellEject()
- {
- // End:0x19
- if(MuzzleFlash == none)
- {
- AttachMuzzleFlash();
- }
- // End:0x47
- if(MuzzleFlash != none)
- {
- MuzzleFlash.CauseShellEject();
- }
- //return;
- }
- simulated function AttachMuzzleFlash()
- {
- // End:0x68
- if(MySkelMesh != none)
- {
- // End:0x68
- if(MuzzleFlashTemplate != none)
- {
- MuzzleFlash = new (self) class'KFMuzzleFlash' (MuzzleFlashTemplate);
- MuzzleFlash.AttachMuzzleFlash(MySkelMesh);
- }
- }
- //return;
- }
- simulated function ShakeView()
- {
- local PlayerController PC;
- local float ShakeViewScale;
- PC = PlayerController(Instigator.Controller);
- // End:0x71
- if((PC == none) || LocalPlayer(PC.Player) == none)
- {
- return;
- }
- // End:0x12C
- if((CurrentFireMode < FireCameraAnim.Length) && FireCameraAnim[CurrentFireMode] != none)
- {
- ShakeViewScale = ShakeScaleStandard;
- // End:0xDC
- if(bUsingSights)
- {
- ShakeViewScale *= ShakeScaleSighted;
- }
- PC.ClientPlayCameraAnim(FireCameraAnim[CurrentFireMode], ShakeViewScale, 1.0, 0.0, 0.10);
- }
- PC.ClientPlayForceFeedbackWaveform(WeaponFireWaveForm);
- //return;
- }
- simulated function AddBlood(float MinAmount, float MaxAmount)
- {
- local float NewBlood;
- // End:0xB6
- if((WorldInfo.NetMode != NM_DedicatedServer) && WeaponMIC != none)
- {
- NewBlood = RandRange(MinAmount, MaxAmount);
- BloodParamValue = FMax(BloodParamValue + NewBlood, 0.20);
- WeaponMIC.SetScalarParameterValue('Scalar_Blood_Contrast', BloodParamValue);
- }
- //return;
- }
- simulated function StartFire(byte FireModeNum)
- {
- // End:0x46
- if((FireModeNum == 0) || FireModeNum == 1)
- {
- // End:0x46
- if(ShouldAutoReload(FireModeNum))
- {
- FireModeNum = 2;
- }
- }
- // End:0x72
- if((FireModeNum == 0) && bUseAltFireMode)
- {
- FireModeNum = 1;
- }
- // End:0x99
- if(FireModeNum == 2)
- {
- BeginFire(FireModeNum);
- return;
- }
- super.StartFire(FireModeNum);
- //return;
- }
- simulated function StopFire(byte FireModeNum)
- {
- // End:0x2C
- if((FireModeNum == 0) && bUseAltFireMode)
- {
- FireModeNum = 1;
- }
- super.StopFire(FireModeNum);
- //return;
- }
- simulated function AltFireMode()
- {
- // End:0x26
- if(!Instigator.IsLocallyControlled())
- {
- return;
- }
- // End:0x59
- if((FiringStatesArray[1] == 'None') || WeaponFireTypes[1] == 3)
- {
- return;
- }
- // End:0x81
- if(bUseAltFireMode)
- {
- StopFire(1);
- bUseAltFireMode = false;
- }
- // End:0x99
- else
- {
- StopFire(0);
- bUseAltFireMode = true;
- }
- Instigator.PlaySoundBase(KFInventoryManager(InvManager).SwitchFireModeEvent);
- //return;
- }
- simulated function AltFireModeRelease()
- {
- // End:0x1A
- if(PendingFire(1))
- {
- StopFire(1);
- }
- //return;
- }
- simulated function SendToFiringState(byte FireModeNum)
- {
- // End:0x82
- if((FireModeNum == 4) && !static.GetPerk().GetGrenadeClass().default.bAllowTossDuringZedGrabRotation)
- {
- // End:0x82
- if((WorldInfo.TimeSeconds - ZedGrabGrenadeTossCooldown) < float(0))
- {
- return;
- }
- }
- // End:0xC2
- if((FireModeNum == 2) && Instigator.IsLocallyControlled())
- {
- InitializeReload();
- }
- super.SendToFiringState(FireModeNum);
- //return;
- }
- simulated event Vector GetMuzzleLoc()
- {
- local Vector X, Y, Z;
- local Rotator ViewRotation;
- // End:0x202
- if(Instigator != none)
- {
- // End:0x12D
- if(bUsingSights)
- {
- ViewRotation = Instigator.GetViewRotation();
- // End:0xBA
- if(KFPlayerController(Instigator.Controller) != none)
- {
- ViewRotation += KFPlayerController(Instigator.Controller).WeaponBufferRotation;
- }
- GetAxes(ViewRotation, X, Y, Z);
- return Instigator.GetWeaponStartTraceLocation() + (X * FireOffset.X);
- }
- // End:0x202
- else
- {
- ViewRotation = Instigator.GetViewRotation();
- // End:0x1CB
- if(KFPlayerController(Instigator.Controller) != none)
- {
- ViewRotation += KFPlayerController(Instigator.Controller).WeaponBufferRotation;
- }
- return Instigator.GetPawnViewLocation() + (FireOffset >> ViewRotation);
- }
- }
- return Location;
- //return ReturnValue;
- }
- simulated function FireAmmunition()
- {
- switch(WeaponFireTypes[CurrentFireMode])
- {
- // End:0x90
- case 0:
- // End:0x83
- if((self.WorldInfo.TimeDilation < 1.0) && WeaponProjectiles[CurrentFireMode] != none)
- {
- ProjectileFire();
- }
- // End:0x8D
- else
- {
- InstantFireClient();
- }
- // End:0xB7
- break;
- // End:0xA2
- case 1:
- ProjectileFire();
- // End:0xB7
- break;
- // End:0xB4
- case 2:
- CustomFire();
- // End:0xB7
- break;
- // End:0xFFFF
- default:
- ConsumeAmmo(CurrentFireMode);
- NotifyWeaponFired(CurrentFireMode);
- PlayFireEffects(CurrentFireMode, vect(0.0, 0.0, 0.0));
- //return;
- }
- }
- simulated function ImpactInfo CalcWeaponFire(Vector StartTrace, Vector EndTrace, optional out array<ImpactInfo> ImpactList, optional Vector Extent)
- {
- local ImpactInfo CurrentImpact;
- CurrentImpact = super.CalcWeaponFire(StartTrace, EndTrace, ImpactList, Extent);
- // End:0xAA
- if(CurrentImpact.HitLocation == ImpactList[0].HitLocation)
- {
- TraceImpactHitZones(StartTrace, EndTrace, ImpactList);
- return ImpactList[0];
- }
- return CurrentImpact;
- //return ReturnValue;
- }
- simulated function TraceImpactHitZones(Vector StartTrace, Vector EndTrace, out array<ImpactInfo> ImpactList)
- {
- local int I;
- local array<ImpactInfo> HitZoneImpactList;
- I = 0;
- J0x0B:
- // End:0x18B [Loop If]
- if(I < ImpactList.Length)
- {
- // End:0x17D
- if((ImpactList[I].HitActor != none) && ImpactList[I].HitActor.IsA('KFPawn'))
- {
- TraceAllPhysicsAssetInteractions(SkeletalMeshComponent(ImpactList[I].HitInfo.HitComponent), EndTrace, StartTrace, HitZoneImpactList, vect(0.0, 0.0, 0.0), true);
- // End:0x17D
- if(HitZoneImpactList.Length > 0)
- {
- HitZoneImpactList[0].RayDir = ImpactList[I].RayDir;
- ImpactList[I] = HitZoneImpactList[0];
- J0x17D:
- }
- // End:0x17D
- else
- {
- }
- }
- ++ I;
- // [Loop Continue]
- goto J0x0B;
- }
- //return;
- }
- simulated function bool PassThroughDamage(Actor HitActor)
- {
- local KFPawn KFP;
- KFP = KFPawn(HitActor);
- // End:0x69
- if((PenetrationPowerRemaining > float(0)) && KFP != none)
- {
- PenetrationPowerRemaining -= KFP.PenetrationResistance;
- return true;
- }
- return (!HitActor.bBlockActors && HitActor.IsA('Trigger') || HitActor.IsA('TriggerVolume')) || HitActor.IsA('InteractiveFoliageActor');
- //return ReturnValue;
- }
- simulated function Rotator AddSpread(Rotator BaseAim)
- {
- local Vector X, Y, Z;
- local float CurrentSpread, RandY, RandZ;
- // End:0x24
- if(CurrentFireMode >= Spread.Length)
- {
- return BaseAim;
- }
- CurrentSpread = Spread[CurrentFireMode];
- // End:0x67
- if(bUsingSights)
- {
- CurrentSpread *= IronSightsSpreadMod;
- }
- // End:0xB8
- else
- {
- // End:0xB8
- if((MovingSpreadMod > 1.0) && VSizeSq(Instigator.Velocity) > float(0))
- {
- CurrentSpread *= MovingSpreadMod;
- }
- }
- // End:0xEE
- if(Instigator.bIsCrouched)
- {
- CurrentSpread *= CrouchSpreadMod;
- }
- // End:0x10C
- if(CurrentSpread == float(0))
- {
- return BaseAim;
- }
- // End:0x1F5
- else
- {
- // End:0x145
- if((GetPerk()) != none)
- {
- GetPerk().ModifySpread(CurrentSpread);
- }
- GetAxes(BaseAim, X, Y, Z);
- RandY = FRand() - 0.50;
- RandZ = Sqrt(0.50 - Square(RandY)) * (FRand() - 0.50);
- return rotator((X + ((RandY * CurrentSpread) * Y)) + ((RandZ * CurrentSpread) * Z));
- }
- //return ReturnValue;
- }
- simulated function ModifyRecoil(out float CurrentRecoilModifier)
- {
- GetPerk().ModifyRecoil(CurrentRecoilModifier);
- //return;
- }
- simulated event HandleRecoil()
- {
- local Rotator NewRecoilRotation;
- local float CurrentRecoilModifier;
- local KFPawn KFP;
- // End:0x37
- if((Instigator == none) || !Instigator.IsFirstPerson())
- {
- return;
- }
- CurrentRecoilModifier = 1.0;
- NewRecoilRotation.Pitch = int(RandRange(float(minRecoilPitch), float(maxRecoilPitch)));
- NewRecoilRotation.Yaw = int(RandRange(float(minRecoilYaw), float(maxRecoilYaw)));
- // End:0x101
- if(Instigator.Physics == 2)
- {
- CurrentRecoilModifier *= FallingRecoilModifier;
- }
- KFP = KFPawn(Instigator);
- // End:0x1FB
- if(KFP != none)
- {
- // End:0x1A2
- if(VSizeSq(Instigator.Velocity) > float(50))
- {
- // End:0x18E
- if(Instigator.bIsWalking)
- {
- CurrentRecoilModifier *= WalkingRecoilModifier;
- }
- // End:0x1A2
- else
- {
- CurrentRecoilModifier *= JoggingRecoilModifier;
- }
- }
- // End:0x1D8
- if(Instigator.bIsCrouched)
- {
- CurrentRecoilModifier *= StanceCrouchedRecoilModifier;
- }
- // End:0x1FB
- if(!bUsingSights)
- {
- CurrentRecoilModifier *= HippedRecoilModifier;
- }
- }
- ModifyRecoil(CurrentRecoilModifier);
- NewRecoilRotation *= CurrentRecoilModifier;
- LastRecoilModifier = CurrentRecoilModifier;
- SetRecoil(NewRecoilRotation, RecoilRate);
- //return;
- }
- simulated function SetRecoil(Rotator NewRecoilRotation, float NewRecoilSpeed)
- {
- local float UsedRecoilScale;
- // End:0x32
- if(RecoilTimeLeft > float(0))
- {
- UsedRecoilScale = RecoilTimeLeft / RecoilSpeed;
- }
- // End:0x41
- else
- {
- UsedRecoilScale = 0.0;
- }
- RecoilRotator *= UsedRecoilScale;
- RecoilRotator += NewRecoilRotation;
- RecoilSpeed = NewRecoilSpeed;
- RecoilTimeLeft = NewRecoilSpeed;
- //return;
- }
- simulated function SetSuppressionRecoil(Rotator NewRecoilRotation)
- {
- SetRecoil(NewRecoilRotation, SuppressRecoilSpeed);
- SuppressRecoilRotator += NewRecoilRotation;
- SuppressRecoilTimeLeft = SuppressRecoilSpeed;
- //return;
- }
- simulated function class<KFProjectile> GetKFProjectileClass()
- {
- // End:0x36
- if(CurrentFireMode == 4)
- {
- return GetPerk().GetGrenadeClass();
- }
- // End:0x72
- else
- {
- return ((CurrentFireMode < WeaponProjectiles.Length) ? class<KFProjectile>(WeaponProjectiles[CurrentFireMode]) : none);
- }
- //return ReturnValue;
- }
- simulated function Projectile ProjectileFire()
- {
- local Vector StartTrace, EndTrace, RealStartLoc, AimDir;
- local ImpactInfo TestImpact;
- local Vector DirA, DirB;
- local Quat Q;
- local class<KFProjectile> MyProjectileClass;
- // End:0x1C
- if(CurrentFireMode != 4)
- {
- IncrementFlashCount();
- }
- MyProjectileClass = GetKFProjectileClass();
- // End:0x282
- if((Role == ROLE_Authority) || ((MyProjectileClass.default.bUseClientSideHitDetection && MyProjectileClass.default.bNoReplicationToInstigator) && Instigator != none) && Instigator.IsLocallyControlled())
- {
- StartTrace = Instigator.GetWeaponStartTraceLocation();
- AimDir = vector(GetAdjustedAim(StartTrace));
- RealStartLoc = GetPhysicalFireStartLoc(AimDir);
- // End:0x25C
- if(StartTrace != RealStartLoc)
- {
- EndTrace = StartTrace + (AimDir * (GetTraceRange()));
- TestImpact = CalcWeaponFire(StartTrace, EndTrace);
- DirB = AimDir;
- AimDir = Normal(TestImpact.HitLocation - RealStartLoc);
- DirA = AimDir;
- // End:0x25C
- if((DirA Dot DirB) < 0.9950)
- {
- Q = QuatFromAxisAndAngle(Normal(DirB Cross DirA), 0.10);
- AimDir = QuatRotateVector(Q, DirB);
- }
- }
- return SpawnProjectile(MyProjectileClass, RealStartLoc, AimDir);
- }
- return none;
- //return ReturnValue;
- }
- simulated function KFProjectile SpawnProjectile(class<KFProjectile> KFProjClass, Vector RealStartLoc, Vector AimDir)
- {
- local KFProjectile SpawnedProjectile;
- local int ProjDamage;
- SpawnedProjectile = Spawn(KFProjClass, self, RealStartLoc);
- // End:0x1BB
- if((SpawnedProjectile != none) && !SpawnedProjectile.bDeleteMe)
- {
- // End:0x115
- if((InstantHitDamage.Length > CurrentFireMode) && InstantHitDamageTypes.Length > CurrentFireMode)
- {
- ProjDamage = int(InstantHitDamage[CurrentFireMode]);
- SpawnedProjectile.Damage = float(ProjDamage);
- SpawnedProjectile.MyDamageType = InstantHitDamageTypes[CurrentFireMode];
- }
- // End:0x193
- if(SpawnedProjectile != none)
- {
- SpawnedProjectile.InitialPenetrationPower = GetInitialPenetrationPower(CurrentFireMode);
- SpawnedProjectile.PenetrationPower = SpawnedProjectile.InitialPenetrationPower;
- }
- SpawnedProjectile.Init(AimDir);
- }
- return SpawnedProjectile;
- //return ReturnValue;
- }
- simulated event float GetInitialPenetrationPower(byte FiringMode)
- {
- local KFPerk InstigatorPerk;
- local float UsedPenetrationPower;
- local KFPlayerController KFPC;
- // End:0x58
- if((PenetrationPower.Length > FiringMode) && PenetrationPower[FiringMode] > float(0))
- {
- UsedPenetrationPower = default.PenetrationPower[FiringMode];
- }
- InstigatorPerk = GetPerk();
- // End:0x150
- if(((InstigatorPerk != none) && InstantHitDamageTypes.Length > FiringMode) && Instigator != none)
- {
- KFPC = KFPlayerController(Instigator.Controller);
- // End:0x150
- if(KFPC != none)
- {
- UsedPenetrationPower += InstigatorPerk.GetPenetrationModifier(KFPC.GetLevel(), class<KFDamageType>(InstantHitDamageTypes[FiringMode]));
- }
- }
- return UsedPenetrationPower;
- //return ReturnValue;
- }
- simulated function ProcessInstantHitEx(byte FiringMode, ImpactInfo Impact, optional int NumHits, optional out float out_PenetrationVal)
- {
- local int TotalDamage;
- local KActorFromStatic NewKActor;
- local editinline StaticMeshComponent HitStaticMesh;
- local InterpCurveFloat PenetrationCurve;
- local KFPawn KFP;
- // End:0x3D2
- if(Impact.HitActor != none)
- {
- NumHits = Max(NumHits, 1);
- TotalDamage = int(InstantHitDamage[CurrentFireMode] * float(NumHits));
- // End:0x1CE
- if(Impact.HitActor.bWorldGeometry)
- {
- HitStaticMesh = StaticMeshComponent(Impact.HitInfo.HitComponent);
- // End:0x1CB
- if(((!WorldInfo.bDropDetail && WorldInfo.GetDetailMode() != 0) && HitStaticMesh != none) && HitStaticMesh.CanBecomeDynamic())
- {
- NewKActor = class'KActorFromStatic'.static.MakeDynamic(HitStaticMesh);
- // End:0x1CB
- if(NewKActor != none)
- {
- Impact.HitActor = NewKActor;
- }
- }
- }
- // End:0x2F8
- else
- {
- // End:0x2F8
- if(Impact.HitActor.bCanBeDamaged && (GetInitialPenetrationPower(FiringMode)) > float(0))
- {
- // End:0x236
- if(out_PenetrationVal <= float(0))
- {
- return;
- }
- // End:0x2F8
- else
- {
- PenetrationCurve = PenetrationDamageReductionCurve[FiringMode];
- TotalDamage *= EvalInterpCurveFloat(PenetrationCurve, out_PenetrationVal / (GetInitialPenetrationPower(FiringMode)));
- KFP = KFPawn(Impact.HitActor);
- // End:0x2F8
- if(KFP != none)
- {
- out_PenetrationVal -= KFP.PenetrationResistance;
- }
- }
- }
- }
- Impact.HitActor.TakeDamage(TotalDamage, Instigator.Controller, Impact.HitLocation, InstantHitMomentum[FiringMode] * Impact.RayDir, InstantHitDamageTypes[FiringMode], Impact.HitInfo, self);
- }
- //return;
- }
- simulated function HandleProjectileImpact(ImpactInfo Impact, optional float PenetrationValue)
- {
- // End:0xA8
- if((Instigator != none) && Instigator.IsLocallyControlled())
- {
- // End:0x82
- if(Instigator.Role < ROLE_Authority)
- {
- SendClientProjectileImpact(CurrentFireMode, Impact, PenetrationValue);
- }
- ProcessInstantHitEx(CurrentFireMode, Impact, PenetrationValue);
- }
- //return;
- }
- event RecieveClientFragmentImpact(const out ImpactInfo Impact, class<KFProjectile> Fragment)
- {
- ProcessGrenadeProjectileImpact(Impact, Fragment);
- //return;
- }
- simulated function HandleGrenadeProjectileImpact(ImpactInfo Impact, class<KFProjectile> Fragment)
- {
- // End:0x94
- if((Instigator != none) && Instigator.IsLocallyControlled())
- {
- // End:0x78
- if(Instigator.Role < ROLE_Authority)
- {
- SendClientFragmentImpact(Impact, Fragment);
- }
- ProcessGrenadeProjectileImpact(Impact, Fragment);
- }
- //return;
- }
- simulated function ProcessGrenadeProjectileImpact(ImpactInfo Impact, class<KFProjectile> Fragment)
- {
- local int TotalDamage;
- local KActorFromStatic NewKActor;
- local editinline StaticMeshComponent HitStaticMesh;
- // End:0x251
- if(Impact.HitActor != none)
- {
- TotalDamage = int(Fragment.default.Damage);
- // End:0x15D
- if(Impact.HitActor.bWorldGeometry)
- {
- HitStaticMesh = StaticMeshComponent(Impact.HitInfo.HitComponent);
- // End:0x15D
- if((HitStaticMesh != none) && HitStaticMesh.CanBecomeDynamic())
- {
- NewKActor = class'KActorFromStatic'.static.MakeDynamic(HitStaticMesh);
- // End:0x15D
- if(NewKActor != none)
- {
- Impact.HitActor = NewKActor;
- }
- }
- }
- Impact.HitActor.TakeDamage(TotalDamage, Instigator.Controller, Impact.HitLocation, Fragment.default.MomentumTransfer * Impact.RayDir, Fragment.default.MyDamageType, Impact.HitInfo, Instigator);
- }
- //return;
- }
- // Export UKFWeapon::execServerRegisterImpact1(FFrame&, void* const)
- private reliable server native final event ServerRegisterImpact1(byte FiringMode, ImpactRepInfo NetImpact);
- // Export UKFWeapon::execServerRegisterImpact2(FFrame&, void* const)
- private reliable server native final event ServerRegisterImpact2(byte FiringMode, ImpactRepInfo NetImpacts[2]);
- // Export UKFWeapon::execServerRegisterImpact3(FFrame&, void* const)
- private reliable server native final event ServerRegisterImpact3(byte FiringMode, ImpactRepInfo NetImpacts[3]);
- // Export UKFWeapon::execServerRegisterImpact4(FFrame&, void* const)
- private reliable server native final event ServerRegisterImpact4(byte FiringMode, ImpactRepInfo NetImpacts[4]);
- // Export UKFWeapon::execServerRegisterImpact5(FFrame&, void* const)
- private reliable server native final event ServerRegisterImpact5(byte FiringMode, ImpactRepInfo NetImpacts[5]);
- // Export UKFWeapon::execServerRegisterImpact6(FFrame&, void* const)
- private reliable server native final event ServerRegisterImpact6(byte FiringMode, ImpactRepInfo NetImpacts[6]);
- // Export UKFWeapon::execServerRegisterImpact7(FFrame&, void* const)
- private reliable server native final event ServerRegisterImpact7(byte FiringMode, ImpactRepInfo NetImpacts[7]);
- // Export UKFWeapon::execServerRegisterImpact8(FFrame&, void* const)
- private reliable server native final event ServerRegisterImpact8(byte FiringMode, ImpactRepInfo NetImpacts[8]);
- // Export UKFWeapon::execServerRegisterProjectileImpact(FFrame&, void* const)
- private reliable server native final event ServerRegisterProjectileImpact(byte FiringMode, ImpactRepInfo NetImpact, optional byte PenetrationByte);
- // Export UKFWeapon::execSendClientImpactList(FFrame&, void* const)
- protected native simulated function int SendClientImpactList(byte FiringMode, const array<ImpactInfo> ImpactList);
- // Export UKFWeapon::execSendClientProjectileImpact(FFrame&, void* const)
- protected native simulated function int SendClientProjectileImpact(byte FiringMode, const out ImpactInfo Impact, float PenetrationFloat);
- // Export UKFWeapon::execSendClientFragmentImpact(FFrame&, void* const)
- protected native simulated function int SendClientFragmentImpact(const out ImpactInfo Impact, class<KFProjectile> FragmentClass);
- // Export UKFWeapon::execServerRegisterFragmentImpact(FFrame&, void* const)
- private reliable server native final event ServerRegisterFragmentImpact(ImpactRepInfo NetImpact, class<KFProjectile> FragmentClass);
- simulated function InstantFireClient_AddImpacts(Vector StartTrace, Rotator Aim, out array<ImpactInfo> ImpactList)
- {
- //return;
- }
- simulated function InstantFireClient()
- {
- local Vector StartTrace, EndTrace;
- local Rotator AimRot;
- local array<ImpactInfo> ImpactList;
- local int Idx;
- local ImpactInfo RealImpact;
- local float CurPenetrationValue;
- StartTrace = Instigator.GetWeaponStartTraceLocation();
- AimRot = GetAdjustedAim(StartTrace);
- EndTrace = StartTrace + (vector(AimRot) * (GetTraceRange()));
- PenetrationPowerRemaining = GetInitialPenetrationPower(CurrentFireMode);
- CurPenetrationValue = PenetrationPowerRemaining;
- RealImpact = CalcWeaponFire(StartTrace, EndTrace, ImpactList);
- // End:0x127
- if(Instigator != none)
- {
- Instigator.SetFlashLocation(self, CurrentFireMode, RealImpact.HitLocation);
- }
- // End:0x225
- if((Instigator != none) && Instigator.IsLocallyControlled())
- {
- InstantFireClient_AddImpacts(StartTrace, AimRot, ImpactList);
- Idx = 0;
- J0x18A:
- // End:0x1E0 [Loop If]
- if(Idx < ImpactList.Length)
- {
- ProcessInstantHitEx(CurrentFireMode, ImpactList[Idx], CurPenetrationValue);
- ++ Idx;
- // [Loop Continue]
- goto J0x18A;
- }
- // End:0x225
- if(Instigator.Role < ROLE_Authority)
- {
- SendClientImpactList(CurrentFireMode, ImpactList);
- }
- }
- //return;
- }
- event RecieveClientImpact(byte FiringMode, const out ImpactInfo Impact, optional out float PenetrationValue)
- {
- // End:0x47
- if(FiringMode == 3)
- {
- MeleeAttackHelper.ProcessMeleeHit(FiringMode, Impact);
- }
- // End:0x6D
- else
- {
- ProcessInstantHitEx(FiringMode, Impact, PenetrationValue);
- }
- //return;
- }
- event RecieveClientImpactList(byte FiringMode, array<ImpactInfo> ImpactList)
- {
- //return;
- }
- simulated function Vector EncodeDamageScale(Vector RayDir, float DamageScale)
- {
- // End:0x28
- if(DamageScale < 1.0)
- {
- return RayDir * DamageScale;
- }
- return RayDir;
- //return ReturnValue;
- }
- simulated function float DecodeDamageScale(Vector RayDir)
- {
- local float SizeSq;
- SizeSq = VSizeSq(RayDir);
- // End:0x34
- if(SizeSq < 1.0)
- {
- return Sqrt(SizeSq);
- }
- return 1.0;
- //return ReturnValue;
- }
- simulated function int GetAmmoType(byte FiringMode)
- {
- // End:0x25
- if((FiringMode == 1) && UsesSecondaryAmmo())
- {
- return 1;
- }
- // End:0x27
- else
- {
- return 0;
- }
- //return ReturnValue;
- }
- static simulated event bool UsesAmmo()
- {
- return default.MaxSpareAmmo[0] > 0;
- //return ReturnValue;
- }
- static simulated event bool UsesSecondaryAmmo()
- {
- return default.MagazineCapacity[1] > 0;
- //return ReturnValue;
- }
- static simulated event bool CanRefillSecondaryAmmo()
- {
- return (UsesSecondaryAmmo()) && default.bCanRefillSecondaryAmmo;
- //return ReturnValue;
- }
- function InitializeAmmo()
- {
- local KFPerk CurrentPerk;
- CurrentPerk = GetPerk();
- MagazineCapacity[0] = default.MagazineCapacity[0];
- MagazineCapacity[1] = default.MagazineCapacity[1];
- SpareAmmoCount[0] = default.SpareAmmoCount[0];
- MaxSpareAmmo[0] = default.MaxSpareAmmo[0] + default.MagazineCapacity[0];
- MaxSpareAmmo[1] = default.MaxSpareAmmo[1] + default.MagazineCapacity[1];
- // End:0x1A8
- if(CurrentPerk != none)
- {
- CurrentPerk.ModifyMagSizeAndNumber(self, MagazineCapacity[0]);
- CurrentPerk.ModifyMagSizeAndNumber(self, MagazineCapacity[1]);
- MaxSpareAmmo[0] = default.MaxSpareAmmo[0] + MagazineCapacity[0];
- MaxSpareAmmo[1] = default.MaxSpareAmmo[1] + MagazineCapacity[1];
- CurrentPerk.ModifyMaxSpareAmmoAmount(self, MaxSpareAmmo[0]);
- CurrentPerk.ModifyMaxSpareAmmoAmount(self, MaxSpareAmmo[1]);
- }
- AmmoCount[0] = byte(MagazineCapacity[0]);
- AmmoCount[1] = byte(MagazineCapacity[1]);
- AddAmmo(InitialSpareMags[0] * default.MagazineCapacity[0]);
- // End:0x237
- if(CurrentPerk != none)
- {
- CurrentPerk.ModifySpareAmmoAmount(self, SpareAmmoCount[0]);
- }
- bForceNetUpdate = true;
- //return;
- }
- function ReInitializeAmmoCounts()
- {
- local KFPerk CurrentPerk;
- CurrentPerk = GetPerk();
- // End:0x149
- if(CurrentPerk != none)
- {
- MagazineCapacity[0] = default.MagazineCapacity[0];
- MagazineCapacity[1] = default.MagazineCapacity[1];
- CurrentPerk.ModifyMagSizeAndNumber(self, MagazineCapacity[0]);
- CurrentPerk.ModifyMagSizeAndNumber(self, MagazineCapacity[1]);
- MaxSpareAmmo[0] = default.MaxSpareAmmo[0] + MagazineCapacity[0];
- MaxSpareAmmo[1] = default.MaxSpareAmmo[1] + MagazineCapacity[1];
- CurrentPerk.ModifyMaxSpareAmmoAmount(self, MaxSpareAmmo[0]);
- CurrentPerk.ModifyMaxSpareAmmoAmount(self, MaxSpareAmmo[1]);
- }
- //return;
- }
- simulated function ConsumeAmmo(byte FireModeNum)
- {
- local int AmmoGroup;
- // End:0x0F
- if(bInfiniteAmmo)
- {
- return;
- }
- // End:0x9D
- if((Role == ROLE_Authority) || bAllowClientAmmoTracking)
- {
- AmmoGroup = GetAmmoType(FireModeNum);
- // End:0x9D
- if((MagazineCapacity[AmmoGroup] > 0) && AmmoCount[AmmoGroup] > 0)
- {
- -- AmmoCount[AmmoGroup];
- }
- }
- //return;
- }
- function int AddAmmo(int Amount)
- {
- local int OldSpareAmmo;
- // End:0x13
- if(MaxSpareAmmo[0] <= 0)
- {
- return 0;
- }
- OldSpareAmmo = SpareAmmoCount[0];
- SpareAmmoCount[0] = Min(SpareAmmoCount[0] + Amount, MaxSpareAmmo[0] - AmmoCount[0]);
- bForceNetUpdate = true;
- return SpareAmmoCount[0] - OldSpareAmmo;
- //return ReturnValue;
- }
- function int AddSecondaryAmmo(int Amount)
- {
- local int OldAmmo;
- // End:0x11
- if(!CanRefillSecondaryAmmo())
- {
- return 0;
- }
- OldAmmo = AmmoCount[1];
- AmmoCount[1] = byte(Min(AmmoCount[1] + Amount, MagazineCapacity[1]));
- bForceNetUpdate = true;
- // End:0x89
- if(bAllowClientAmmoTracking)
- {
- ClientForceSecondaryAmmoUpdate(AmmoCount[1]);
- }
- return AmmoCount[1] - OldAmmo;
- //return ReturnValue;
- }
- reliable client simulated function ClientForceAmmoUpdate(byte NewAmmoCount, int NewSpareAmmoCount)
- {
- // End:0x224
- if(Role < ROLE_Authority)
- {
- // End:0xDB
- if(bDebug)
- {
- LogInternal((((((((string(self) @ "ClientForceAmmoUpdate ServerAmmo Primary:") $ string(NewAmmoCount)) @ "ClientAmmo Primary:") $ string(AmmoCount[0])) @ "ServerSpareAmmo Primary:") $ string(NewSpareAmmoCount)) @ "ClientSpareAmmo Primary:") $ string(SpareAmmoCount[0]));
- }
- // End:0x15C
- if(NewAmmoCount != AmmoCount[0])
- {
- LogInternal((((string(self) @ "ClientForceAmmoUpdate Primary Ammo mismatch Server:") $ string(NewAmmoCount)) @ "Client:") $ string(AmmoCount[0]));
- }
- // End:0x1DE
- if(NewSpareAmmoCount != SpareAmmoCount[0])
- {
- LogInternal((((string(self) @ "ClientForceAmmoUpdate Primary SpareAmmo mismatch Server:") $ string(NewSpareAmmoCount)) @ "Client:") $ string(SpareAmmoCount[0]));
- }
- AmmoCount[0] = NewAmmoCount;
- SpareAmmoCount[0] = NewSpareAmmoCount;
- NotifyHUDofWeapon(Pawn(Owner));
- }
- //return;
- }
- reliable client simulated function ClientForceSecondaryAmmoUpdate(byte NewSecondaryAmmoCount)
- {
- // End:0x13F
- if(Role < ROLE_Authority)
- {
- // End:0x8B
- if(bDebug)
- {
- LogInternal((((string(self) @ "ClientForceAmmoUpdate ServerAmmo Secondary:") $ string(NewSecondaryAmmoCount)) @ "ClientAmmo Secondary:") $ string(AmmoCount[1]));
- }
- // End:0x10E
- if(NewSecondaryAmmoCount != AmmoCount[1])
- {
- LogInternal((((string(self) @ "ClientForceAmmoUpdate Secondary Ammo mismatch Server:") $ string(NewSecondaryAmmoCount)) @ "Client:") $ string(AmmoCount[1]));
- }
- AmmoCount[1] = NewSecondaryAmmoCount;
- NotifyHUDofWeapon(Pawn(Owner));
- }
- //return;
- }
- unreliable client simulated function NotifyHUDofWeapon(Pawn P)
- {
- local KFPlayerController KFPC;
- // End:0xAE
- if(Role < ROLE_Authority)
- {
- KFPC = KFPlayerController(P.Owner);
- // End:0xAE
- if((KFPC != none) && KFPC.MyGFxHUD != none)
- {
- KFPC.MyGFxHUD.NotifyHUDofWeapon();
- }
- }
- //return;
- }
- simulated event bool HasAmmo(byte FireModeNum, optional int Amount)
- {
- Amount = 1;
- // End:0x1C
- if(FireModeNum == 3)
- {
- return true;
- }
- // End:0x98
- else
- {
- // End:0x3C
- if(FireModeNum == 2)
- {
- return CanReload();
- }
- // End:0x98
- else
- {
- // End:0x98
- if(FireModeNum == 4)
- {
- // End:0x98
- if(KFInventoryManager(InvManager) != none)
- {
- return KFInventoryManager(InvManager).HasGrenadeAmmo(Amount);
- }
- }
- }
- }
- // End:0xB2
- if(Amount == 0)
- {
- Amount = 1;
- }
- return (AmmoCount[GetAmmoType(FireModeNum)] - Amount) >= 0;
- //return ReturnValue;
- }
- simulated function bool HasAnyAmmo()
- {
- // End:0x21
- if(HasSpareAmmo() || HasAmmo(0))
- {
- return true;
- }
- // End:0x42
- if((UsesSecondaryAmmo()) && HasAmmo(1))
- {
- return true;
- }
- return false;
- //return ReturnValue;
- }
- final simulated event bool HasSpareAmmo()
- {
- return bInfiniteSpareAmmo || SpareAmmoCount[0] > 0;
- //return ReturnValue;
- }
- simulated event int GetTotalAmmoAmount(byte FiringMode)
- {
- return AmmoCount[GetAmmoType(FiringMode)] + SpareAmmoCount[GetAmmoType(FiringMode)];
- //return ReturnValue;
- }
- simulated event int GetMaxAmmoAmount(byte FiringMode)
- {
- return MaxSpareAmmo[GetAmmoType(FiringMode)] + MagazineCapacity[GetAmmoType(FiringMode)];
- //return ReturnValue;
- }
- simulated event int GetMissingSpareAmmoAmount(byte FiringMode)
- {
- return MaxSpareAmmo[GetAmmoType(FiringMode)] - SpareAmmoCount[GetAmmoType(FiringMode)];
- //return ReturnValue;
- }
- simulated function float GetAmmoPercentage(optional byte FiringMode)
- {
- // End:0x2A
- if(MaxSpareAmmo[GetAmmoType(FiringMode)] == 0)
- {
- return -1.0;
- }
- return float(GetTotalAmmoAmount(FiringMode)) / float(GetMaxAmmoAmount(FiringMode));
- //return ReturnValue;
- }
- simulated event float GetMagazineSizeForHUD(optional bool bPrimary)
- {
- bPrimary = true;
- // End:0x23
- if(bPrimary)
- {
- return float(MagazineCapacity[0]);
- }
- // End:0x31
- else
- {
- return float(MagazineCapacity[1]);
- }
- //return ReturnValue;
- }
- simulated event float GetRemainingAmmoForHUD(optional bool bPrimary)
- {
- bPrimary = true;
- // End:0x23
- if(bPrimary)
- {
- return float(AmmoCount[0]);
- }
- // End:0x31
- else
- {
- return float(AmmoCount[1]);
- }
- //return ReturnValue;
- }
- simulated function int GetSpareAmmoForHUD()
- {
- return SpareAmmoCount[0];
- //return ReturnValue;
- }
- simulated function bool ForceReload()
- {
- // End:0x4E
- if((Instigator != none) && Instigator.IsLocallyControlled())
- {
- // End:0x4E
- if(CanReload())
- {
- StartFire(2);
- return true;
- }
- }
- return false;
- //return ReturnValue;
- }
- simulated function bool CanReload()
- {
- local KFPawn P;
- local bool bInstigatorCanReload;
- P = KFPawn(Instigator);
- bInstigatorCanReload = (P != none) && P.CanReloadWeapon();
- return ((bCanBeReloaded && bInstigatorCanReload) && AmmoCount[0] < MagazineCapacity[0]) && HasSpareAmmo();
- //return ReturnValue;
- }
- simulated function bool ShouldAutoReload(byte FireModeNum)
- {
- local bool bHasAmmo;
- bHasAmmo = HasAmmo(FireModeNum);
- // End:0x12E
- if((!bHasAmmo && Instigator != none) && Instigator.IsLocallyControlled())
- {
- // End:0xD0
- if(bPendingAutoSwitchOnDryFire)
- {
- // End:0xC1
- if(CanSwitchWeapons())
- {
- // End:0xC1
- if(!HasSpareAmmo())
- {
- Instigator.Controller.ClientSwitchToBestWeapon(false);
- }
- }
- bPendingAutoSwitchOnDryFire = false;
- }
- // End:0x12E
- else
- {
- WeaponPlaySound(WeaponDryFireSnd[FireModeNum]);
- // End:0x117
- if(Role < ROLE_Authority)
- {
- ServerPlayDryFireSound(FireModeNum);
- }
- bPendingAutoSwitchOnDryFire = !HasSpareAmmo();
- }
- }
- return !bHasAmmo && CanReload();
- //return ReturnValue;
- }
- protected reliable server function ServerPlayDryFireSound(byte FireModeNum)
- {
- WeaponPlaySound(WeaponDryFireSnd[FireModeNum]);
- //return;
- }
- simulated function SetMeshLightingChannels(LightingChannelContainer NewLightingChannels)
- {
- Mesh.SetLightingChannels(NewLightingChannels);
- //return;
- }
- simulated function GetWeaponDebug(out array<string> DebugInfo)
- {
- super.GetWeaponDebug(DebugInfo);
- DebugInfo[DebugInfo.Length] = (("AmmoCount Primary:" $ string(AmmoCount[0])) @ "MagazineSize Primary:") $ string(MagazineCapacity[0]);
- DebugInfo[DebugInfo.Length] = (("SpareAmmoCount Primary:" $ string(SpareAmmoCount[0])) @ "MaxSpareAmmo Primary:") $ string(MaxSpareAmmo[0]);
- DebugInfo[DebugInfo.Length] = (("AmmoCount Secondary:" $ string(AmmoCount[1])) @ "MagazineSize Secondary:") $ string(MagazineCapacity[1]);
- // End:0x1D6
- if(KFInventoryManager(InvManager) != none)
- {
- DebugInfo[DebugInfo.Length] = (("GrenadeCount:" $ string(KFInventoryManager(InvManager).GrenadeCount)) @ "MaxGrenades:") $ string(GetPerk().MaxGrenadeCount);
- }
- //return;
- }
- simulated function DisplayDebug(HUD HUD, out float out_YL, out float out_YPos)
- {
- local string CurAnim, CurHandAnim;
- local Vector FADebugLineStart, FADebugLineEnd, FADebugLineUL, FADebugLineUR, FADebugLineLL, FADebugLineLR;
- local Rotator FADebugLineRot, FADebugViewRotation;
- local int UsedMaxYawLimit, UsedMaxPitchLimit, UsedMinYawLimit, UsedMinPitchLimit;
- local Rotator AimRotation, WeaponBufferRot;
- super.DisplayDebug(HUD, out_YL, out_YPos);
- // End:0x238
- if(HUD.ShouldDisplayDebug('Camera'))
- {
- HUD.Canvas.SetPos(4.0, out_YPos);
- HUD.Canvas.DrawText("---------- KFWeapon: Camera ----------");
- out_YPos += out_YL;
- HUD.Canvas.DrawText((((((("WEAPONCAMERA MeshFOV=" $ string(MeshFOV)) @ "MeshIronSightFOV=") $ string(MeshIronSightFOV)) @ "CameraIronSightFOV=") $ string(PlayerIronSightFOV)) @ " CurrentMeshFOV = ") $ string(MySkelMesh.FOV));
- out_YPos += out_YL;
- HUD.Canvas.SetPos(4.0, out_YPos);
- }
- // End:0x465
- if(HUD.ShouldDisplayDebug('Zooming'))
- {
- HUD.Canvas.SetPos(4.0, out_YPos);
- HUD.Canvas.DrawText("---------- KFWeapon: Zooming ----------");
- out_YPos += out_YL;
- HUD.Canvas.DrawText((((((((("ZOOMING ZoomRotInterp=" $ string(ZoomRotInterp)) @ "bDoingQuickDownZoom=") $ string(bDoingQuickDownZoom)) @ "QuickWeaponDownRotation=") $ string(QuickWeaponDownRotation)) @ " ZoomInRotation = ") $ string(ZoomInRotation)) $ " PlayerViewOffset= ") $ string(PlayerViewOffset));
- out_YPos += out_YL;
- HUD.Canvas.SetPos(4.0, out_YPos);
- }
- // End:0x769
- if(HUD.ShouldDisplayDebug('FireOffset'))
- {
- HUD.Canvas.SetPos(4.0, out_YPos);
- HUD.Canvas.DrawText("---------- KFWeapon: FireOffset ----------");
- out_YPos += out_YL;
- HUD.Canvas.DrawText("PROJECTILE SPAWNING FireOffset=" $ string(FireOffset));
- out_YPos += out_YL;
- HUD.Canvas.SetPos(4.0, out_YPos);
- // End:0x664
- if(Instigator.IsFirstPerson())
- {
- HUD.DrawDebugSphere(GetMuzzleLoc(), 3.0, 6, 255, 0, 0);
- }
- // End:0x769
- else
- {
- // End:0x6F1
- if(CurrentFireMode == 4)
- {
- HUD.DrawDebugSphere(Instigator.GetPawnViewLocation() + (GrenadeFireOffset >> Instigator.Rotation), 3.0, 6, 0, 255, 0);
- }
- // End:0x769
- else
- {
- HUD.DrawDebugSphere(Instigator.GetPawnViewLocation() + (FireOffset >> Instigator.Rotation), 3.0, 6, 255, 0, 0);
- }
- }
- }
- // End:0xADE
- if(HUD.ShouldDisplayDebug('animation'))
- {
- HUD.Canvas.SetPos(4.0, out_YPos);
- HUD.Canvas.DrawText("---------- KFWeapon: animation ----------");
- out_YPos += out_YL;
- // End:0x997
- if((GetWeaponAnimNodeSeq()) != none)
- {
- CurAnim = string(GetWeaponAnimNodeSeq().AnimSeqName);
- HUD.Canvas.DrawText((((("WEAPON WeaponAnim=" $ CurAnim) $ " Rate: ") $ string(GetWeaponAnimNodeSeq().Rate)) $ " Position: ") $ string(GetWeaponAnimNodeSeq().CurrentTime));
- out_YPos += out_YL;
- HUD.Canvas.SetPos(4.0, out_YPos);
- }
- // End:0xADE
- if((GetArmAnimNodeSeq()) != none)
- {
- CurHandAnim = string(GetArmAnimNodeSeq().AnimSeqName);
- HUD.Canvas.DrawText((((("WEAPON HandAnim=" $ CurHandAnim) $ " Rate: ") $ string(GetArmAnimNodeSeq().Rate)) $ " Position: ") $ string(GetArmAnimNodeSeq().CurrentTime));
- out_YPos += out_YL;
- HUD.Canvas.SetPos(4.0, out_YPos);
- }
- }
- // End:0xE23
- if(HUD.ShouldDisplayDebug('aim3d'))
- {
- HUD.Canvas.SetPos(4.0, out_YPos);
- HUD.Canvas.DrawText("---------- KFWeapon: aim3d ----------");
- out_YPos += out_YL;
- // End:0xC3B
- if(KFPlayerController(Instigator.Controller) != none)
- {
- KFPlayerController(Instigator.Controller).GetPlayerViewPoint(FADebugLineStart, AimRotation);
- }
- // End:0xCE5
- if(bDebugRecoilPosition)
- {
- WeaponBufferRot.Pitch = RecoilISMaxPitchLimit;
- WeaponBufferRot.Yaw += TotalRecoilRotator.Yaw;
- WeaponBufferRot.Pitch += TotalRecoilRotator.Pitch;
- }
- // End:0xD2B
- else
- {
- WeaponBufferRot = KFPlayerController(Instigator.Controller).WeaponBufferRotation;
- }
- FADebugLineRot.Yaw = AimRotation.Yaw + WeaponBufferRot.Yaw;
- FADebugLineRot.Pitch = AimRotation.Pitch + WeaponBufferRot.Pitch;
- FADebugLineEnd = FADebugLineStart + (float(400) * vector(FADebugLineRot));
- DrawDebugSphere(FADebugLineEnd, 5.0, 8, 0, 255, 0, false);
- }
- // End:0x19F9
- if(HUD.ShouldDisplayDebug('recoil3d'))
- {
- HUD.Canvas.SetPos(4.0, out_YPos);
- HUD.Canvas.DrawText("---------- KFWeapon: recoil3d ----------");
- out_YPos += out_YL;
- // End:0xF83
- if(KFPlayerController(Instigator.Controller) != none)
- {
- KFPlayerController(Instigator.Controller).GetPlayerViewPoint(FADebugLineStart, FADebugViewRotation);
- }
- FADebugLineRot.Yaw = FADebugViewRotation.Yaw + TotalRecoilRotator.Yaw;
- FADebugLineRot.Pitch = FADebugViewRotation.Pitch + TotalRecoilRotator.Pitch;
- FADebugLineEnd = FADebugLineStart + (float(20) * vector(FADebugLineRot));
- DrawDebugBox(FADebugLineEnd, vect(0.10, 0.10, 0.10), 255, 255, 0, false);
- FADebugLineRot.Yaw = FADebugViewRotation.Yaw;
- FADebugLineRot.Pitch = FADebugViewRotation.Pitch;
- FADebugLineEnd = FADebugLineStart + (float(20) * vector(FADebugLineRot));
- DrawDebugBox(FADebugLineEnd, vect(0.10, 0.10, 0.10), 255, 0, 128, false);
- // End:0x1199
- if(bUsingSights)
- {
- UsedMaxYawLimit = RecoilISMaxYawLimit;
- UsedMinYawLimit = RecoilISMinYawLimit;
- UsedMaxPitchLimit = RecoilISMaxPitchLimit;
- UsedMinPitchLimit = RecoilISMinPitchLimit;
- }
- // End:0x11E5
- else
- {
- UsedMaxYawLimit = RecoilMaxYawLimit;
- UsedMinYawLimit = RecoilMinYawLimit;
- UsedMaxPitchLimit = RecoilMaxPitchLimit;
- UsedMinPitchLimit = RecoilMinPitchLimit;
- }
- FADebugLineRot.Yaw = FADebugViewRotation.Yaw + UsedMinYawLimit;
- FADebugLineRot.Pitch = FADebugViewRotation.Pitch + UsedMaxPitchLimit;
- FADebugLineEnd = FADebugLineStart + (float(20) * vector(FADebugLineRot));
- FADebugLineUL = FADebugLineEnd;
- FADebugLineRot.Yaw = FADebugViewRotation.Yaw + UsedMaxYawLimit;
- FADebugLineRot.Pitch = FADebugViewRotation.Pitch + UsedMaxPitchLimit;
- FADebugLineEnd = FADebugLineStart + (float(20) * vector(FADebugLineRot));
- FADebugLineUR = FADebugLineEnd;
- FADebugLineRot.Yaw = FADebugViewRotation.Yaw + UsedMinYawLimit;
- FADebugLineRot.Pitch = FADebugViewRotation.Pitch + UsedMinPitchLimit;
- FADebugLineEnd = FADebugLineStart + (float(20) * vector(FADebugLineRot));
- FADebugLineLL = FADebugLineEnd;
- FADebugLineRot.Yaw = FADebugViewRotation.Yaw + UsedMaxYawLimit;
- FADebugLineRot.Pitch = FADebugViewRotation.Pitch + UsedMinPitchLimit;
- FADebugLineEnd = FADebugLineStart + (float(20) * vector(FADebugLineRot));
- FADebugLineLR = FADebugLineEnd;
- DrawDebugLine(FADebugLineUL, FADebugLineUR, 255, 0, 255, false);
- DrawDebugLine(FADebugLineUR, FADebugLineLR, 255, 0, 255, false);
- DrawDebugLine(FADebugLineLR, FADebugLineLL, 255, 0, 255, false);
- DrawDebugLine(FADebugLineLL, FADebugLineUL, 255, 0, 255, false);
- FADebugLineRot.Yaw = int(float(FADebugViewRotation.Yaw) + (float(UsedMinYawLimit) + (float(65535 - UsedMinYawLimit) * (1.0 - FullRecoilYawPct))));
- FADebugLineRot.Pitch = int(float(FADebugViewRotation.Pitch) + (float(UsedMaxPitchLimit) * FullRecoilPitchPct));
- FADebugLineEnd = FADebugLineStart + (float(20) * vector(FADebugLineRot));
- FADebugLineUL = FADebugLineEnd;
- FADebugLineRot.Yaw = int(float(FADebugViewRotation.Yaw) + (float(UsedMaxYawLimit) * FullRecoilYawPct));
- FADebugLineRot.Pitch = int(float(FADebugViewRotation.Pitch) + (float(UsedMaxPitchLimit) * FullRecoilPitchPct));
- FADebugLineEnd = FADebugLineStart + (float(20) * vector(FADebugLineRot));
- FADebugLineUR = FADebugLineEnd;
- FADebugLineRot.Yaw = int(float(FADebugViewRotation.Yaw) + (float(UsedMinYawLimit) + (float(65535 - UsedMinYawLimit) * (1.0 - FullRecoilYawPct))));
- FADebugLineRot.Pitch = int(float(FADebugViewRotation.Pitch) + (float(UsedMinPitchLimit) + (float(65535 - UsedMinPitchLimit) * (1.0 - FullRecoilYawPct))));
- FADebugLineEnd = FADebugLineStart + (float(20) * vector(FADebugLineRot));
- FADebugLineLL = FADebugLineEnd;
- FADebugLineRot.Yaw = int(float(FADebugViewRotation.Yaw) + (float(UsedMaxYawLimit) * FullRecoilYawPct));
- FADebugLineRot.Pitch = int(float(FADebugViewRotation.Pitch) + (float(UsedMinPitchLimit) + (float(65535 - UsedMinPitchLimit) * (1.0 - FullRecoilYawPct))));
- FADebugLineEnd = FADebugLineStart + (float(20) * vector(FADebugLineRot));
- FADebugLineLR = FADebugLineEnd;
- DrawDebugLine(FADebugLineUL, FADebugLineUR, 128, 255, 255, false);
- DrawDebugLine(FADebugLineUR, FADebugLineLR, 128, 255, 255, false);
- DrawDebugLine(FADebugLineLR, FADebugLineLL, 128, 255, 255, false);
- DrawDebugLine(FADebugLineLL, FADebugLineUL, 128, 255, 255, false);
- }
- //return;
- }
- event BeginState(name PreviousStateName)
- {
- //return;
- }
- event EndState(name NextStateName)
- {
- //return;
- }
- simulated function byte GetWeaponStateId()
- {
- return 0;
- //return ReturnValue;
- }
- simulated function NotifyBeginState()
- {
- KFPawn(Instigator).WeaponStateChanged(GetWeaponStateId());
- //return;
- }
- simulated function NotifyEndState()
- {
- KFPawn(Instigator).WeaponStateChanged(0);
- //return;
- }
- reliable server function ServerSyncReload(int ClientSpareAmmoCount)
- {
- local int ClientReloadAmount;
- // End:0x9E
- if(bAllowClientAmmoTracking && ClientSpareAmmoCount < SpareAmmoCount[0])
- {
- ClientReloadAmount = Min(SpareAmmoCount[0] - ClientSpareAmmoCount, SpareAmmoCount[0]);
- SpareAmmoCount[0] -= ClientReloadAmount;
- AmmoCount[0] = byte(Min(AmmoCount[0] + ClientReloadAmount, MagazineCapacity[0]));
- }
- //return;
- }
- simulated function Activate()
- {
- // End:0x18
- if(bUseAltFireMode)
- {
- ClearPendingFire(0);
- }
- AttachWeaponTo(Instigator.Mesh);
- super.Activate();
- //return;
- }
- simulated function PlayIdleAnim()
- {
- //return;
- }
- simulated function StartIdleFidgetTimer()
- {
- //return;
- }
- simulated function IdleFidgetTimer()
- {
- //return;
- }
- simulated function bool CanPlayIdleFidget(optional bool bOnReload)
- {
- //return ReturnValue;
- }
- simulated function bool PlayIdleFidgetAnim()
- {
- //return ReturnValue;
- }
- simulated function ANIMNOTIFY_EnableAdditiveBob()
- {
- //return;
- }
- simulated function TimeWeaponEquipping()
- {
- PlayWeaponEquip();
- SetTimer(EquipTime, false, 'WeaponEquipped');
- //return;
- }
- simulated function WeaponEquipped()
- {
- //return;
- }
- simulated function PlayWeaponEquip()
- {
- PlayAnimation(EquipAnim, 0.0, 0.0);
- //return;
- }
- simulated function SetSimplePutDown(bool bPutDownWeapon)
- {
- // End:0x1B
- if(bPutDownWeapon)
- {
- GotoState('WeaponDownSimple');
- }
- //return;
- }
- simulated function bool CanSwitchWeapons()
- {
- return true;
- //return ReturnValue;
- }
- simulated function TimeWeaponPutDown()
- {
- // End:0x2C
- if(Instigator.IsFirstPerson())
- {
- PlayWeaponPutDown();
- }
- super.TimeWeaponPutDown();
- //return;
- }
- simulated function PlayWeaponPutDown()
- {
- PlayAnimation(PutDownAnim, PutDownTime);
- //return;
- }
- simulated function bool TryPutDown()
- {
- local float MinTimerTarget, TimerCount;
- bWeaponPutDown = true;
- // End:0x32
- if(!IsTimerActive('RefireCheckTimer'))
- {
- PutDownWeapon();
- }
- // End:0xBF
- else
- {
- MinTimerTarget = GetTimerRate('RefireCheckTimer') * MinFiringPutDownPct;
- TimerCount = GetTimerCount('RefireCheckTimer');
- // End:0x9D
- if(TimerCount >= MinTimerTarget)
- {
- PutDownWeapon();
- }
- // End:0xBF
- else
- {
- SetTimer(MinTimerTarget - TimerCount, false, 'FiringPutDownWeapon');
- }
- }
- return true;
- //return ReturnValue;
- }
- simulated function FiringPutDownWeapon()
- {
- // End:0x17
- if(bWeaponPutDown)
- {
- PutDownWeapon();
- }
- //return;
- }
- simulated function TimeWeaponFiring(byte FireModeNum)
- {
- local float AdjustedFireInterval;
- local KFPerk CurrentPerk;
- // End:0x99
- if(!IsTimerActive('RefireCheckTimer'))
- {
- AdjustedFireInterval = GetFireInterval(FireModeNum);
- CurrentPerk = GetPerk();
- // End:0x82
- if(CurrentPerk != none)
- {
- GetPerk().ModifyRateOfFire(AdjustedFireInterval);
- }
- SetTimer(AdjustedFireInterval, true, 'RefireCheckTimer');
- }
- //return;
- }
- reliable server function ServerGotoGrenadeFiring()
- {
- SendToFiringState(4);
- //return;
- }
- function SetWeakZedGrabCooldownOnPawn(float WeakZedGrabCooldown)
- {
- local KFPawn KFP;
- // End:0x67
- if(Role == ROLE_Authority)
- {
- KFP = KFPawn(Instigator);
- // End:0x67
- if(KFP != none)
- {
- KFP.SetWeakGrabCoolDown(WeakZedGrabCooldown);
- }
- }
- //return;
- }
- simulated function PlayGrenadeThrow()
- {
- local name WeaponFireAnimName;
- PlayFiringSound(CurrentFireMode);
- // End:0xB6
- if((Instigator != none) && Instigator.IsFirstPerson())
- {
- WeaponFireAnimName = 'Nade_Throw';
- // End:0xB6
- if(WeaponFireAnimName != 'None')
- {
- PlayAnimation(WeaponFireAnimName, MySkelMesh.GetAnimLength(WeaponFireAnimName), FireTweenTime);
- }
- }
- //return;
- }
- simulated function ReloadStatusTimer()
- {
- //return;
- }
- simulated function ReloadAmmoTimer()
- {
- //return;
- }
- simulated function ReloadComplete()
- {
- //return;
- }
- simulated function AbortReload()
- {
- //return;
- }
- simulated function InitializeReload()
- {
- ReloadAmountLeft = byte(Min(MagazineCapacity[0] - AmmoCount[0], SpareAmmoCount[0]));
- // End:0x5A
- if(Role < ROLE_Authority)
- {
- ServerSendToReload(ReloadAmountLeft);
- }
- //return;
- }
- reliable server function ServerSendToReload(byte ClientReloadAmount)
- {
- ReloadAmountLeft = ClientReloadAmount;
- SendToFiringState(2);
- //return;
- }
- simulated function TimeWeaponReloading()
- {
- local name ReloadAnimName;
- local float ReloadDuration, GiveAmmoTime;
- local KFPerk InstigatorPerk;
- ReloadStatus = GetNextReloadStatus();
- // End:0x34
- if(ReloadStatus == 4)
- {
- ReloadComplete();
- return;
- }
- InstigatorPerk = GetPerk();
- ReloadAnimName = GetReloadAnimName(InstigatorPerk.GetUsingTactialReload(self));
- // End:0x120
- if(MySkelMesh != none)
- {
- ReloadDuration = MySkelMesh.GetAnimLength(ReloadAnimName);
- GiveAmmoTime = MySkelMesh.GetAnimInterruptTime(ReloadAnimName);
- InstigatorPerk.ModifyReloadTime(ReloadDuration, GiveAmmoTime);
- }
- // End:0x263
- if(ReloadDuration > 0.0)
- {
- MakeNoise(0.50, 'PlayerReload');
- // End:0x185
- if(Instigator.IsFirstPerson())
- {
- PlayAnimation(ReloadAnimName, ReloadDuration);
- }
- // End:0x222
- if(ReloadStatus == 2)
- {
- // End:0x208
- if((GiveAmmoTime >= ReloadDuration) && bReloadFromMagazine)
- {
- // End:0x208
- if(bLogAnimation)
- {
- LogInternal("TimeWeaponReloading: no anim interrupt for" @ string(ReloadAnimName));
- }
- }
- SetTimer(GiveAmmoTime, false, 'ReloadAmmoTimer');
- }
- // End:0x249
- else
- {
- // End:0x249
- if(ReloadStatus == 3)
- {
- ReloadDuration = GiveAmmoTime;
- }
- }
- SetTimer(ReloadDuration, false, 'ReloadStatusTimer');
- }
- // End:0x28A
- else
- {
- WarnInternal("ReloadDuration is zero!!!");
- ReloadComplete();
- }
- //return;
- }
- simulated function KFWeapon.EReloadStatus GetNextReloadStatus()
- {
- // End:0x27
- if(bReloadFromMagazine)
- {
- // End:0x24
- if(ReloadStatus < 2)
- {
- return 2;
- }
- return 4;
- }
- switch(ReloadStatus)
- {
- // End:0x42
- case 0:
- return 1;
- // End:0x4A
- case 1:
- return 2;
- // End:0x78
- case 2:
- // End:0x75
- if(HasSpareAmmo() && ReloadAmountLeft > 0)
- {
- return 2;
- }
- return 3;
- // End:0xFFFF
- default:
- return 4;
- }
- //return ReturnValue;
- }
- simulated function name GetReloadAnimName(bool bTacticalReload)
- {
- // End:0x95
- if(!bReloadFromMagazine)
- {
- switch(ReloadStatus)
- {
- // End:0x49
- case 1:
- return ((bTacticalReload) ? 'Reload_Open_Elite' : 'Reload_Open');
- // End:0x70
- case 3:
- return ((bTacticalReload) ? 'Reload_Close_Elite' : 'Reload_Close');
- // End:0xFFFF
- default:
- return ((bTacticalReload) ? 'Reload_Insert_Elite' : 'Reload_Insert');
- }
- }
- // End:0xD0
- if(AmmoCount[0] > 0)
- {
- return ((bTacticalReload) ? 'Reload_Half_Elite' : 'Reload_Half');
- }
- // End:0xF2
- else
- {
- return ((bTacticalReload) ? 'Reload_Empty_Elite' : 'Reload_Empty');
- }
- //return ReturnValue;
- }
- simulated function PerformReload()
- {
- local int ReloadAmount;
- // End:0x34
- if(bInfiniteSpareAmmo)
- {
- AmmoCount[0] = byte(MagazineCapacity[0]);
- ReloadAmountLeft = 0;
- return;
- }
- // End:0x136
- if(((Role == ROLE_Authority) && !bAllowClientAmmoTracking) || Instigator.IsLocallyControlled() && bAllowClientAmmoTracking)
- {
- // End:0x136
- if((MaxSpareAmmo[0] > 0) && SpareAmmoCount[0] > 0)
- {
- // End:0xE2
- if(bReloadFromMagazine)
- {
- ReloadAmount = Min(ReloadAmountLeft, SpareAmmoCount[0]);
- }
- // End:0xED
- else
- {
- ReloadAmount = 1;
- }
- AmmoCount[0] = byte(Min(AmmoCount[0] + ReloadAmount, MagazineCapacity[0]));
- SpareAmmoCount[0] -= ReloadAmount;
- }
- }
- // End:0x152
- if(bReloadFromMagazine)
- {
- ReloadAmountLeft = 0;
- }
- // End:0x171
- else
- {
- // End:0x171
- if(ReloadAmountLeft > 0)
- {
- -- ReloadAmountLeft;
- }
- }
- //return;
- }
- simulated function SprintLoopTimer()
- {
- //return;
- }
- simulated function SprintRetryTimer()
- {
- //return;
- }
- simulated function PlaySprintStart()
- {
- local KFPlayerController KFPC;
- local float AnimDuration;
- // End:0x22
- if(bZoomingOut)
- {
- SetTimer(0.10, false, 'SprintRetryTimer');
- return;
- }
- // End:0xC8
- if(Instigator.IsLocallyControlled())
- {
- KFPC = KFPlayerController(Instigator.Controller);
- // End:0xB1
- if(KFPC != none)
- {
- KFPC.HandleTransitionFOV(PlayerSprintFOV, 0.250);
- }
- PlayAnimation('Sprint_In');
- }
- AnimDuration = MySkelMesh.GetAnimLength('Sprint_In');
- // End:0x127
- if(AnimDuration > 0.0)
- {
- SetTimer(AnimDuration, false, 'SprintLoopTimer');
- }
- // End:0x131
- else
- {
- SprintLoopTimer();
- }
- //return;
- }
- simulated function PlaySprintLoop()
- {
- // End:0xFA
- if(Instigator.IsLocallyControlled())
- {
- SprintAnimRate = GetSprintAnimRate();
- // End:0x65
- if(SprintCameraAnimInst != none)
- {
- SprintCameraAnimInst.Stop(true);
- }
- // End:0xB1
- if(SprintCameraAnim != none)
- {
- SprintCameraAnimInst = PlayCameraAnim(SprintCameraAnim, SprintAnimRate, SprintAnimRate, 0.30, 0.50, true, true);
- }
- PlayAnimation('Sprint_Loop', MySkelMesh.GetAnimLength('Sprint_Loop') / SprintAnimRate, true);
- }
- //return;
- }
- simulated function PlaySprintEnd()
- {
- local KFPlayerController KFPC;
- // End:0xCC
- if(Instigator.IsLocallyControlled())
- {
- KFPC = KFPlayerController(Instigator.Controller);
- // End:0xB5
- if((KFPC != none) && !bUsingSights)
- {
- KFPC.HandleTransitionFOV(KFPC.DefaultFOV, 0.250);
- }
- PlayAnimation('Sprint_Out');
- }
- //return;
- }
- simulated function UpdateSprintAnimRate()
- {
- local float NewAnimRate;
- NewAnimRate = GetSprintAnimRate();
- // End:0x2D
- if(NewAnimRate ~= SprintAnimRate)
- {
- return;
- }
- SprintAnimRate = NewAnimRate;
- // End:0x8B
- if(SprintCameraAnimInst != none)
- {
- SprintCameraAnimInst.Update(SprintAnimRate, SprintAnimRate, 1.0, 0.50);
- }
- ChangeAnimationRate('Sprint_Loop', SprintAnimRate);
- //return;
- }
- simulated function float GetSprintAnimRate()
- {
- return 1.0;
- //return ReturnValue;
- }
- simulated function bool IsMeleeing()
- {
- //return ReturnValue;
- }
- simulated function bool ShouldContinueMelee(optional int ChainCount)
- {
- //return ReturnValue;
- }
- simulated function NotifyMeleeCollision(Actor HitActor, optional Vector HitLocation)
- {
- //return;
- }
- simulated function PlayMeleeAnimation(name AnimName, out float out_Rate, float BlendTime)
- {
- local KFPerk InstigatorPerk;
- local float Duration;
- InstigatorPerk = GetPerk();
- // End:0x4B
- if(InstigatorPerk != none)
- {
- InstigatorPerk.ModifyMeleeAttackSpeed(out_Rate);
- }
- Duration = MySkelMesh.GetAnimLength(AnimName);
- Duration *= out_Rate;
- PlayAnimation(AnimName, Duration, BlendTime);
- //return;
- }
- simulated function int GetMeleeDamage(byte FireModeNum, optional Vector RayDir)
- {
- return int(InstantHitDamage[FireModeNum]);
- //return ReturnValue;
- }
- auto simulated state Inactive
- {
- ignores ForceReload, ShouldAutoReload, AllowIronSights;
- simulated function BeginState(name PreviousStateName)
- {
- // End:0x3D
- if(bUsingSights)
- {
- // End:0x3A
- if(Instigator.IsLocallyControlled())
- {
- SetIronSights(false);
- }
- }
- // End:0x57
- else
- {
- // End:0x57
- if(!bHasIronSights)
- {
- ClearPendingFire(1);
- }
- }
- ClearPendingFire(2);
- // End:0xE9
- if((bAllowClientAmmoTracking && Role == ROLE_Authority) && WorldInfo.TimeSeconds > CreationTime)
- {
- ClientForceAmmoUpdate(AmmoCount[0], SpareAmmoCount[0]);
- ClientForceSecondaryAmmoUpdate(AmmoCount[1]);
- }
- bPendingAutoSwitchOnDryFire = false;
- super.BeginState(PreviousStateName);
- //return;
- }
- stop;
- }
- simulated state Active
- {
- simulated event OnAnimEnd(AnimNodeSequence SeqNode, float PlayedTime, float ExcessTime)
- {
- // End:0x33
- if(WorldInfo.NetMode != NM_DedicatedServer)
- {
- PlayIdleAnim();
- }
- //return;
- }
- simulated function PlayIdleAnim()
- {
- local int IdleIndex;
- // End:0xF3
- if(Instigator.IsFirstPerson())
- {
- // End:0x83
- if(bUsingSights && IdleSightedAnims.Length > 0)
- {
- IdleIndex = Rand(IdleSightedAnims.Length);
- PlayAnimation(IdleSightedAnims[IdleIndex], 0.0, true, 0.10);
- }
- // End:0xD2
- else
- {
- // End:0xD2
- if(IdleAnims.Length > 0)
- {
- IdleIndex = Rand(IdleAnims.Length);
- PlayAnimation(IdleAnims[IdleIndex], 0.0, true, 0.20);
- }
- }
- StartIdleFidgetTimer();
- ToggleAdditiveBobAnim(!bUsingSights);
- }
- //return;
- }
- simulated function GotoWeaponSprinting()
- {
- GotoState('WeaponSprinting');
- //return;
- }
- simulated event BeginState(name PreviousStateName)
- {
- bIronSightOnBringUp = false;
- // End:0x8A
- if((RecoilRate > float(0)) && RecoilBlendOutRatio > float(0))
- {
- RecoilYawBlendOutRate = int((float(maxRecoilYaw) / RecoilRate) * RecoilBlendOutRatio);
- RecoilPitchBlendOutRate = int((float(maxRecoilPitch) / RecoilRate) * RecoilBlendOutRatio);
- }
- // End:0xC9
- if(!WeaponIsAnimating() || !IsTimerActive('OnAnimEnd'))
- {
- OnAnimEnd(none, 0.0, 0.0);
- }
- bEnableTiltSkelControl = true;
- // End:0x184
- if((InvManager != none) && InvManager.LastAttemptedSwitchToWeapon != none)
- {
- // End:0x164
- if(InvManager.LastAttemptedSwitchToWeapon != self)
- {
- InvManager.LastAttemptedSwitchToWeapon.ClientWeaponSet(true);
- }
- InvManager.LastAttemptedSwitchToWeapon = none;
- }
- super.BeginState(PreviousStateName);
- //return;
- }
- simulated event EndState(name NextStateName)
- {
- ClearTimer('IdleFidgetTimer');
- ToggleAdditiveBobAnim(false);
- super(Object).EndState(NextStateName);
- //return;
- }
- simulated function StartIdleFidgetTimer()
- {
- // End:0x32
- if(IdleFidgetAnims.Length > 0)
- {
- SetTimer(RandRange(1.0, 10.0), false, 'IdleFidgetTimer');
- }
- //return;
- }
- simulated function IdleFidgetTimer()
- {
- local bool bIsPlaying;
- // End:0x23
- if(CanPlayIdleFidget())
- {
- bIsPlaying = PlayIdleFidgetAnim();
- }
- // End:0x45
- if(!bIsPlaying)
- {
- SetTimer(20.0, false, 'IdleFidgetTimer');
- }
- //return;
- }
- simulated function bool CanPlayIdleFidget(optional bool bOnReload)
- {
- local Pawn P;
- // End:0x24
- if(bCanBeReloaded && !HasAmmo(0))
- {
- return false;
- }
- // End:0x33
- if(bUsingSights)
- {
- return false;
- }
- // End:0x1E3
- if(!bOnReload)
- {
- // End:0x77
- if((WorldInfo.TimeSeconds - LastIdleFidgetAnimTime) < 20.0)
- {
- return false;
- }
- // End:0xC1
- if((WorldInfo.TimeSeconds - Instigator.LastPainTime) < 10.0)
- {
- return false;
- }
- // End:0x114
- if((WorldInfo.TimeSeconds - KFPawn(Instigator).LastWeaponFireTime) < 10.0)
- {
- return false;
- }
- // End:0x1DF
- foreach WorldInfo.AllPawns(class'Pawn', P)
- {
- // End:0x1DE
- if(((WorldInfo.TimeSeconds - P.LastRenderTime) < 1.0) && P.GetTeamNum() != Instigator.GetTeamNum())
- {
- return false;
- }
- }
- }
- // End:0x23E
- else
- {
- // End:0x218
- if((WorldInfo.TimeSeconds - LastIdleFidgetAnimTime) < 1.0)
- {
- return false;
- }
- // End:0x23E
- if(!Instigator.IsLocallyControlled())
- {
- return false;
- }
- }
- return true;
- //return ReturnValue;
- }
- simulated function bool PlayIdleFidgetAnim()
- {
- local name AnimName;
- AnimName = IdleFidgetAnims[Rand(IdleFidgetAnims.Length)];
- // End:0x9B
- if(MySkelMesh.FindAnimSequence(AnimName) != none)
- {
- ToggleAdditiveBobAnim(false);
- PlayAnimation(AnimName);
- LastIdleFidgetAnimTime = WorldInfo.TimeSeconds;
- return true;
- }
- return false;
- //return ReturnValue;
- }
- simulated function bool CanReload()
- {
- // End:0x0F
- if(global.CanReload())
- {
- return true;
- }
- // End:0x38
- if(PendingFire(2) && CanPlayIdleFidget(true))
- {
- PlayIdleFidgetAnim();
- }
- return false;
- //return ReturnValue;
- }
- simulated function ANIMNOTIFY_EnableAdditiveBob()
- {
- ToggleAdditiveBobAnim(true, 0.30);
- //return;
- }
- reliable server function ServerSyncReload(int ClientSpareAmmoCount)
- {
- local int I;
- global.ServerSyncReload(ClientSpareAmmoCount);
- I = 0;
- J0x1E:
- // End:0x6F [Loop If]
- if(I < GetPendingFireLength())
- {
- // End:0x61
- if(PendingFire(I))
- {
- BeginFire(byte(I));
- }
- ++ I;
- // [Loop Continue]
- goto J0x1E;
- }
- //return;
- }
- stop;
- }
- simulated state WeaponEquipping
- {
- simulated function byte GetWeaponStateId()
- {
- return 23;
- //return ReturnValue;
- }
- simulated function bool TryPutDown()
- {
- bWeaponPutDown = true;
- // End:0x32
- if(!IsTimerActive('WeaponEquipped'))
- {
- PutDownWeapon();
- }
- // End:0x7F
- else
- {
- EquipAbortTime = (PutDownTime * GetTimerCount('WeaponEquipped')) / GetTimerRate('WeaponEquipped');
- GotoState('WeaponAbortEquip');
- }
- return true;
- //return ReturnValue;
- }
- simulated function BeginState(name PreviousStateName)
- {
- local KFPerk InstigatorPerk;
- local float PerkZedTimeResist;
- super.BeginState(PreviousStateName);
- // End:0x46
- if(bIronSightOnBringUp && bHasIronSights)
- {
- bIronSightOnBringUp = false;
- SetIronSights(true);
- }
- InstigatorPerk = GetPerk();
- // End:0x95
- if(InstigatorPerk != none)
- {
- PerkZedTimeResist = InstigatorPerk.GetZedTimeModifier(GetStateName());
- }
- SetZedTimeResist(0.3750 + PerkZedTimeResist);
- NotifyBeginState();
- //return;
- }
- simulated function EndState(name NextStateName)
- {
- ClearTimer('WeaponEquipped');
- ClearZedTimeResist();
- NotifyEndState();
- //return;
- }
- stop;
- }
- simulated state WeaponPuttingDown
- {
- ignores Activate;
- simulated function byte GetWeaponStateId()
- {
- return 24;
- //return ReturnValue;
- }
- simulated function BeginState(name PreviousStateName)
- {
- local KFPerk InstigatorPerk;
- local float PerkZedTimeResist;
- // End:0x81
- if(((FlashLight != none) && FlashLight.bEnabled) && Instigator.IsLocallyControlled())
- {
- KFPawn_Human(Instigator).SetFlashlight(false, true);
- }
- TimeWeaponPutDown();
- bWeaponPutDown = false;
- InstigatorPerk = GetPerk();
- // End:0xE6
- if(InstigatorPerk != none)
- {
- PerkZedTimeResist = InstigatorPerk.GetZedTimeModifier(GetStateName());
- }
- SetZedTimeResist(0.3750 + PerkZedTimeResist);
- NotifyBeginState();
- //return;
- }
- simulated function EndState(name NextStateName)
- {
- super.EndState(NextStateName);
- ClearZedTimeResist();
- NotifyEndState();
- //return;
- }
- stop;
- }
- simulated state WeaponDownSimple
- {
- ignores CanThrow, SetIronSights, OnAnimEnd;
- simulated function bool CanTransitionToIronSights()
- {
- return false;
- //return ReturnValue;
- }
- simulated function bool DenyClientWeaponSet()
- {
- return true;
- //return ReturnValue;
- }
- simulated function bool CanReload()
- {
- return false;
- //return ReturnValue;
- }
- simulated function bool CanSwitchWeapons()
- {
- return false;
- //return ReturnValue;
- }
- exec function SimplePutDown()
- {
- SetSimplePutDown(false);
- //return;
- }
- simulated function BeginState(name PreviousStateName)
- {
- super(KFWeapon).BeginState(PreviousStateName);
- // End:0x94
- if(((FlashLight != none) && FlashLight.bEnabled) && Instigator.IsLocallyControlled())
- {
- KFPawn_Human(Instigator).SetFlashlight(false, true);
- }
- bDoingQuickDownZoom = true;
- // End:0xD6
- if(Instigator.IsLocallyControlled())
- {
- ZoomDown(true, QuickWeaponDownTime);
- }
- // End:0x119
- if(Instigator.IsFirstPerson())
- {
- PlayAnimation(IdleAnims[0], 0.0, true, 0.20);
- }
- StopFire(CurrentFireMode);
- //return;
- }
- simulated function ZoomDown(bool bAnimateTransition, float ZoomTimeToGo)
- {
- // End:0x181
- if(bAnimateTransition)
- {
- ZoomInTime = ZoomTimeToGo;
- // End:0x9F
- if(bZoomingOut)
- {
- bZoomingOut = false;
- bZoomOutInterrupted = true;
- ZoomTime = ZoomInTime - ZoomTime;
- ZoomPartialTime = ZoomTime;
- ZoomStartOffset = PlayerViewOffset;
- ZoomRotStartOffset = ZoomRotInterp;
- }
- // End:0xC5
- else
- {
- ZoomTime = ZoomInTime;
- ZoomStartOffset = PlayerViewOffset;
- }
- ZoomTargetOffset = default.PlayerViewOffset;
- // End:0x112
- if(MySkelMesh != none)
- {
- ZoomWeaponFOVStart = MySkelMesh.FOV;
- }
- // End:0x125
- else
- {
- ZoomWeaponFOVStart = MeshFOV;
- }
- // End:0x175
- if((WorldInfo.NetMode != NM_DedicatedServer) && Instigator != none)
- {
- EnableIronSightsDoF(false);
- EnablePlayerZoom(false);
- }
- bZoomingIn = true;
- }
- //return;
- }
- simulated function EndState(name NextStateName)
- {
- super(KFWeapon).EndState(NextStateName);
- ClearTimer('EndWeaponDownSimpleTimer');
- bDoingQuickDownZoom = false;
- //return;
- }
- simulated function EndWeaponDownSimpleTimer()
- {
- GotoState('Active');
- //return;
- }
- simulated function SetSimplePutDown(bool bPutDownWeapon)
- {
- // End:0xE6
- if(!bPutDownWeapon)
- {
- // End:0x96
- if((WorldInfo.NetMode == NM_DedicatedServer) || (WorldInfo.NetMode == NM_ListenServer) && !Instigator.IsLocallyControlled())
- {
- EndWeaponDownSimpleTimer();
- }
- // End:0xE3
- else
- {
- SetTimer(QuickWeaponDownFinishTime, false, 'EndWeaponDownSimpleTimer');
- // End:0xE3
- if(Instigator.IsLocallyControlled())
- {
- ZoomOut(true, QuickWeaponDownFinishTime);
- }
- }
- }
- // End:0x143
- else
- {
- ClearTimer('EndWeaponDownSimpleTimer');
- // End:0x130
- if(Instigator.IsLocallyControlled())
- {
- ZoomDown(true, QuickWeaponDownTime);
- }
- StopFire(CurrentFireMode);
- }
- //return;
- }
- stop;
- }
- simulated state WeaponAbortEquip extends WeaponPuttingDown
- {
- simulated function TimeWeaponPutDown()
- {
- local AnimNodeSequence AnimNode;
- local float Rate;
- SetTimer(FMax(EquipAbortTime, 0.010), 'WeaponIsDown');
- // End:0x172
- if(WorldInfo.NetMode != NM_DedicatedServer)
- {
- AnimNode = GetWeaponAnimNodeSeq();
- // End:0x172
- if((AnimNode != none) && AnimNode.AnimSeq != none)
- {
- AnimNode.SetAnim(PutDownAnim);
- Rate = AnimNode.AnimSeq.SequenceLength / PutDownTime;
- AnimNode.PlayAnim(false, Rate, AnimNode.AnimSeq.SequenceLength - (EquipAbortTime * Rate));
- }
- }
- //return;
- }
- stop;
- }
- simulated state WeaponFiring
- {
- ignores AllowSprinting;
- simulated function BeginState(name PrevStateName)
- {
- local KFPerk InstigatorPerk;
- InstigatorPerk = GetPerk();
- // End:0x4F
- if(InstigatorPerk != none)
- {
- SetZedTimeResist(InstigatorPerk.GetZedTimeModifier(GetStateName()));
- }
- // End:0x85
- if((bLoopingFireAnim.Length > 0) || bLoopingFireSnd.Length > 0)
- {
- StartLoopingFireEffects(CurrentFireMode);
- }
- super.BeginState(PrevStateName);
- //return;
- }
- simulated event Tick(float DeltaTime)
- {
- global.Tick(DeltaTime);
- // End:0x42
- if(bPlayingLoopingFireSnd && ShouldForceSingleFireSound())
- {
- StopLoopingFireSound(CurrentFireMode);
- }
- //return;
- }
- simulated function EndState(name NextStateName)
- {
- super.EndState(NextStateName);
- ClearZedTimeResist();
- // End:0x67
- if(WorldInfo.NetMode == NM_Client)
- {
- Instigator.WeaponStoppedFiring(self, false);
- }
- // End:0x96
- if(bPlayingLoopingFireAnim || bPlayingLoopingFireAnim)
- {
- StopLoopingFireEffects(CurrentFireMode);
- }
- //return;
- }
- simulated event OnAnimEnd(AnimNodeSequence SeqNode, float PlayedTime, float ExcessTime)
- {
- local name WeaponFireAnimName;
- // End:0xAC
- if(WorldInfo.NetMode != NM_DedicatedServer)
- {
- // End:0xAC
- if(bPlayingLoopingFireAnim)
- {
- WeaponFireAnimName = GetLoopingFireAnim(CurrentFireMode);
- // End:0xAC
- if(WeaponFireAnimName != 'None')
- {
- PlayAnimation(WeaponFireAnimName, MySkelMesh.GetAnimLength(WeaponFireAnimName), true, 0.0);
- }
- }
- }
- //return;
- }
- simulated function bool DenyClientWeaponSet()
- {
- return true;
- //return ReturnValue;
- }
- stop;
- }
- simulated state WeaponSingleFiring extends WeaponFiring
- {
- simulated function FireAmmunition()
- {
- super(KFWeapon).FireAmmunition();
- ClearPendingFire(CurrentFireMode);
- //return;
- }
- stop;
- }
- simulated state GrenadeFiring extends WeaponSingleFiring
- {
- simulated function byte GetWeaponStateId()
- {
- return 25;
- //return ReturnValue;
- }
- simulated event BeginState(name PreviousStateName)
- {
- LogInternal(((((((((string(WorldInfo.TimeSeconds) @ "Self:") @ string(self)) @ "Instigator:") @ string(Instigator)) @ string(GetStateName())) $ "::") $ string(GetFuncName())) @ "PreviousStateName:") @ string(PreviousStateName), 'Inventory');
- SetWeakZedGrabCooldownOnPawn(GrenadeTossWeakZedGrabCooldown);
- PlayGrenadeThrow();
- TimeWeaponFiring(CurrentFireMode);
- ClearPendingFire(CurrentFireMode);
- // End:0x28F
- if((Role == ROLE_Authority) && KFInventoryManager(InvManager) != none)
- {
- KFInventoryManager(InvManager).ConsumeGrenades();
- // End:0x28C
- if(((WorldInfo.Game != none) && KFGameInfo(WorldInfo.Game).GameplayEventsWriter != none) && KFGameInfo(WorldInfo.Game).GameplayEventsWriter.IsSessionInProgress())
- {
- KFGameInfo(WorldInfo.Game).GameplayEventsWriter.LogPlayerIntEvent(1102, Instigator.Controller, KFInventoryManager(InvManager).GrenadeCount);
- }
- }
- // End:0x2D1
- else
- {
- // End:0x2D1
- if((Role < ROLE_Authority) && Instigator.IsLocallyControlled())
- {
- ServerGotoGrenadeFiring();
- }
- }
- NotifyBeginState();
- //return;
- }
- simulated function EndState(name NextStateName)
- {
- super(WeaponFiring).EndState(NextStateName);
- NotifyEndState();
- ProjectileFire();
- //return;
- }
- simulated event Vector GetMuzzleLoc()
- {
- local Rotator ViewRotation;
- // End:0xE4
- if(Instigator != none)
- {
- ViewRotation = Instigator.GetViewRotation();
- // End:0xAD
- if(KFPlayerController(Instigator.Controller) != none)
- {
- ViewRotation += KFPlayerController(Instigator.Controller).WeaponBufferRotation;
- }
- return Instigator.GetPawnViewLocation() + (GrenadeFireOffset >> ViewRotation);
- }
- return Location;
- //return ReturnValue;
- }
- simulated function bool ShouldRefire()
- {
- return false;
- //return ReturnValue;
- }
- stop;
- }
- simulated state Reloading
- {
- ignores ForceReload, ShouldAutoReload, AllowIronSights, AllowSprinting;
- simulated function byte GetWeaponStateId()
- {
- local KFPerk Perk;
- local bool bTacticalReload;
- Perk = GetPerk();
- bTacticalReload = (Perk != none) && Perk.GetUsingTactialReload(self);
- // End:0xAD
- if(!bReloadFromMagazine)
- {
- // End:0x8B
- if(bTacticalReload)
- {
- return byte(((AmmoCount[0] > 0) ? 7 : 8));
- }
- return byte(((AmmoCount[0] > 0) ? 5 : 6));
- }
- // End:0xF7
- else
- {
- // End:0xD9
- if(bTacticalReload)
- {
- return byte(((AmmoCount[0] > 0) ? 3 : 4));
- }
- return byte(((AmmoCount[0] > 0) ? 1 : 2));
- }
- //return ReturnValue;
- }
- simulated function BeginState(name PreviousStateName)
- {
- local KFPerk InstigatorPerk;
- InstigatorPerk = GetPerk();
- // End:0x4F
- if(InstigatorPerk != none)
- {
- SetZedTimeResist(InstigatorPerk.GetZedTimeModifier(GetStateName()));
- }
- // End:0x70
- if(bUsingSights)
- {
- ZoomOut(false, default.ZoomOutTime);
- }
- bEnableTiltSkelControl = false;
- bPendingAutoSwitchOnDryFire = false;
- ReloadStatus = 0;
- TimeWeaponReloading();
- NotifyBeginState();
- // End:0x1D8
- if(((WorldInfo.Game != none) && KFGameInfo(WorldInfo.Game).GameplayEventsWriter != none) && KFGameInfo(WorldInfo.Game).GameplayEventsWriter.IsSessionInProgress())
- {
- KFGameInfo(WorldInfo.Game).GameplayEventsWriter.LogPlayerWeaponReload(self, Instigator.Controller);
- }
- // End:0x2C3
- if(((Role == ROLE_Authority) && KFGameInfo(WorldInfo.Game) != none) && KFGameInfo(WorldInfo.Game).DialogManager != none)
- {
- KFGameInfo(WorldInfo.Game).DialogManager.PlayReloadDialog(KFPawn(Instigator));
- }
- //return;
- }
- simulated function EndState(name NextStateName)
- {
- ClearZedTimeResist();
- ClearTimer('ReloadStatusTimer');
- ClearTimer('ReloadAmmoTimer');
- ClearPendingFire(2);
- // End:0x76
- if(bAllowClientAmmoTracking && Role < ROLE_Authority)
- {
- ServerSyncReload(SpareAmmoCount[0]);
- }
- NotifyEndState();
- // End:0x187
- if(((Role == ROLE_Authority) && KFGameInfo(WorldInfo.Game) != none) && KFGameInfo(WorldInfo.Game).DialogManager != none)
- {
- KFGameInfo(WorldInfo.Game).DialogManager.PlayAmmoDialog(KFPawn(Instigator), float(SpareAmmoCount[0]) / float(MaxSpareAmmo[0]));
- }
- //return;
- }
- simulated function BeginFire(byte FireModeNum)
- {
- global.BeginFire(FireModeNum);
- // End:0x85
- if((!bReloadFromMagazine || FireModeNum == 3) && FireModeNum != 2)
- {
- // End:0x85
- if(PendingFire(FireModeNum) && HasAmmo(FireModeNum))
- {
- AbortReload();
- }
- }
- //return;
- }
- simulated function bool TryPutDown()
- {
- PutDownWeapon();
- return true;
- //return ReturnValue;
- }
- simulated function ReloadStatusTimer()
- {
- // End:0x4B
- if((ReloadStatus == 2) && IsTimerActive('ReloadAmmoTimer'))
- {
- PerformReload();
- ClearTimer('ReloadAmmoTimer');
- }
- TimeWeaponReloading();
- //return;
- }
- simulated function ReloadAmmoTimer()
- {
- PerformReload();
- // End:0x2D
- if(bReloadFromMagazine)
- {
- ReloadStatus = 4;
- ReloadComplete();
- }
- //return;
- }
- simulated function ReloadComplete()
- {
- GotoState('Active');
- //return;
- }
- simulated function AbortReload()
- {
- GotoState('Active');
- //return;
- }
- stop;
- }
- simulated state WeaponSprinting
- {
- ignores ForceReload;
- simulated function BeginState(name PreviousStateName)
- {
- PlaySprintStart();
- //return;
- }
- simulated function EndState(name NextStateName)
- {
- PlaySprintEnd();
- //return;
- }
- simulated function SprintLoopTimer()
- {
- PlaySprintLoop();
- //return;
- }
- simulated function SprintRetryTimer()
- {
- PlaySprintStart();
- //return;
- }
- simulated function SetWeaponSprint(bool bNewSprintStatus)
- {
- // End:0x1D
- if(!bNewSprintStatus)
- {
- GotoState('Active');
- }
- //return;
- }
- simulated function SetIronSights(bool bNewIronSights)
- {
- global.SetIronSights(bNewIronSights);
- // End:0x2C
- if(bUsingSights)
- {
- StopPawnSprint(true);
- }
- //return;
- }
- simulated function BeginFire(byte FireModeNum)
- {
- // End:0x6F
- if(!bDeleteMe && Instigator != none)
- {
- global.BeginFire(FireModeNum);
- // End:0x6F
- if(PendingFire(FireModeNum) && HasAmmo(FireModeNum))
- {
- StopPawnSprint(false);
- }
- }
- //return;
- }
- stop;
- }
- simulated state MeleeAttackBasic
- {
- ignores AllowSprinting, AllowIronSights;
- simulated function bool IsMeleeing()
- {
- return true;
- //return ReturnValue;
- }
- simulated function BeginState(name PreviousStateName)
- {
- // End:0x21
- if(bUsingSights)
- {
- ZoomOut(false, default.ZoomOutTime);
- }
- TimeWeaponFiring(CurrentFireMode);
- NotifyBeginState();
- //return;
- }
- simulated function EndState(name NextStateName)
- {
- ClearTimer('RefireCheckTimer');
- NotifyEndState();
- //return;
- }
- simulated function TimeWeaponFiring(byte FireModeNum)
- {
- MeleeAttackHelper.BeginMeleeAttack();
- // End:0x5F
- if(PendingFire(CurrentFireMode) && !ShouldContinueMelee())
- {
- ClearPendingFire(CurrentFireMode);
- }
- //return;
- }
- simulated function byte GetWeaponStateId()
- {
- return 10;
- //return ReturnValue;
- }
- stop;
- }
- defaultproperties
- {
- FireModeIconPaths(0)=Texture2D'ui_firemodes_tex.UI_FireModeSelect_BulletSingle'
- FireModeIconPaths(1)=none
- SingleFireMode=255
- FilterTypeUI=EFilterTypeUI.FT_Assault
- bTargetFrictionEnabled=true
- bTargetAdhesionEnabled=true
- bCanRefillSecondaryAmmo=true
- bAllowClientAmmoTracking=true
- bUseAnimLenEquipTime=true
- bUseAdditiveMoveAnim=true
- MinFiringPutDownPct=0.80
- PenetrationPower(0)=0.0
- PenetrationPower(1)=0.0
- PenetrationDamageReductionCurve(0)=(Points=/* Array type was not detected. */,InVal=0.0,OutVal=0.0,ArriveTangent=0.0,LeaveTangent=0.0,InterpMode=EInterpCurveMode.CIM_Linear)
- PenetrationDamageReductionCurve(1)=(InVal=1.0,OutVal=1.0,ArriveTangent=0.0,LeaveTangent=0.0,InterpMode=EInterpCurveMode.CIM_Linear)
- GrenadeTossWeakZedGrabCooldown=1.0
- TargetFrictionDistanceMin=320.0
- TargetFrictionDistancePeak=200.0
- TargetFrictionDistanceMax=4000.0
- TargetFrictionDistanceCurve=(Points=/* Array type was not detected. */,InVal=0.0,OutVal=0.0,ArriveTangent=0.0,LeaveTangent=0.0,InterpMode=EInterpCurveMode.CIM_Linear)
- TargetFrictionMultiplierRange=(X=0.30,Y=0.40)
- TargetFrictionPeakRadiusScale=1.0
- TargetFrictionPeakHeightScale=0.20
- TargetFrictionOffset=(X=0.0,Y=0.0,Z=32.0)
- TargetFrictionZoomedBoostValue=0.250
- TargetAdhesionDistanceMax=2000.0
- TargetAdhesionAimDistY=128.0
- TargetAdhesionAimDistZ=96.0
- TargetAdhesionScaleRange=(X=0.30,Y=2.850)
- TargetAdhesionZoomedBoostValue=0.250
- MeshFOV=86.0
- MeshIronSightFOV=75.0
- PlayerIronSightFOV=75.0
- PlayerSprintFOV=95.0
- ZoomInTime=0.150
- ZoomOutTime=0.150
- ZoomInRotation=(Pitch=-910,Yaw=0,Roll=2910)
- QuickWeaponDownRotation=(Pitch=-8192,Yaw=0,Roll=16384)
- QuickWeaponDownTime=0.40
- QuickWeaponDownFinishTime=0.20
- FastZoomOutTime=0.10
- ISFocalDepth=50.0
- ISFocalAperture=0.350
- GrenadeFireOffset=(X=25.0,Y=-15.0,Z=0.0)
- UITexture=Texture2D'ui_weaponselect_tex.UI_WeaponSelect_AR15'
- SecondaryAmmoTexture=Texture2D'UI_SecondaryAmmo_TEX.GasTank'
- ReloadBlendOutTime=0.20
- ShakeScaleSighted=0.40
- ShakeScaleStandard=1.0
- WeaponFireWaveForm=ForceFeedbackWaveform'FX_ForceFeedback_ARCH.Gunfire.Default_Recoil'
- MeleeImpactCamShake=KFCameraShake'FX_CameraShake_Arch.Melee.Default_Melee'
- FireTweenTime=0.050
- FireAnim=Shoot
- FireLoopAnim=ShootLoop
- FireLastAnim=Shoot_Last
- PutDownAnim=PutAway
- EquipAnim=Equip
- IdleAnims(0)=Idle
- IdleFidgetAnims(0)=Guncheck_v1
- IdleFidgetAnims(1)=Guncheck_v2
- IdleFidgetAnims(2)=Guncheck_v3
- FireSightedAnims(0)=Shoot_Iron
- FireLoopSightedAnim=ShootLoop_Iron
- FireLastSightedAnim=Shoot_Iron_Last
- IdleSightedAnims(0)=Idle_Iron
- FireLoopStartAnim=ShootLoop_Start
- FireLoopStartSightedAnim=ShootLoop_Iron_Start
- FireLoopEndAnim=ShootLoop_End
- FireLoopEndSightedAnim=ShootLoop_Iron_End
- MeleeAttackAnims(0)=Bash
- WeaponFireSnd(0)=(DefaultCue=none,FirstPersonCue=none)
- BobDamping=0.850
- JumpDamping=1.0
- PlayerViewOffset=(X=1.0,Y=9.0,Z=-3.0)
- LagTensionHorizontal=0.80
- LagVerticalTension=0.80
- LagResistanceHorizontal=0.20
- LagResistanceVertical=0.20
- LagLimit=5.0
- LagYawCoefficient=0.000050
- LagStrengthIronSights=3.0
- LagStrengthCrouch=1.50
- LagStrengthWalk=0.70
- LagStrengthJog=0.60
- LagStrengthSprint=0.50
- StrafeLagLimit=4.0
- StrafeLagRate=0.0250
- StrafeLagReturnRate=10.0
- begin object name=MeleeHelper class=KFMeleeHelperWeapon
- MaxHitRange=175.0
- object end
- // Reference: KFMeleeHelperWeapon'Default__KFWeapon.MeleeHelper'
- MeleeAttackHelper=MeleeHelper
- FlashLightTemplate=KFFlashlightAttachment'FX_Flashlight_ARCH.Default_Flashlight_1P'
- MovingSpreadMod=1.0
- IronSightsSpreadMod=0.50
- CrouchSpreadMod=0.750
- RecoilRate=0.090
- RecoilBlendOutRatio=1.250
- RecoilViewRotationScale=0.40
- RecoilCompensationScale=1.50
- FullRecoilPitchPct=0.750
- FullRecoilYawPct=0.750
- RecoilMaxYawLimit=2000
- RecoilMinYawLimit=63535
- RecoilMaxPitchLimit=1500
- RecoilMinPitchLimit=64035
- RecoilISMaxYawLimit=500
- RecoilISMinYawLimit=65035
- RecoilISMaxPitchLimit=350
- RecoilISMinPitchLimit=65185
- SuppressRecoilSpeed=0.080
- SuppressRecoilViewRotationScale=0.50
- HippedRecoilModifier=1.750
- JoggingRecoilModifier=1.50
- WalkingRecoilModifier=1.250
- FallingRecoilModifier=3.0
- StanceCrouchedRecoilModifier=0.750
- LastRecoilModifier=1.0
- IronSightMeshFOVCompensationScale=1.0
- FiringStatesArray=/* Array type was not detected. */
- WeaponFireTypes=/* Array type was not detected. */
- FireInterval=/* Array type was not detected. */
- InstantHitDamage=/* Array type was not detected. */
- InstantHitMomentum=/* Array type was not detected. */
- InstantHitDamageTypes=/* Array type was not detected. */
- EquipTime=0.450
- begin object name=FirstPersonMesh class=KFSkeletalMeshComponent
- AnimTreeTemplate=AnimTree'CHR_1P_Arms_ARCH.WEP_1stP_Animtree_Master'
- bOverrideAttachmentOwnerVisibility=true
- bAllowBooleanPreshadows=false
- ReplacementPrimitive=none
- DepthPriorityGroup=ESceneDepthPriorityGroup.SDPG_Foreground
- bOnlyOwnerSee=true
- LightingChannels=(bInitialized=true,Outdoor=true)
- bAllowPerObjectShadows=true
- object end
- // Reference: KFSkeletalMeshComponent'Default__KFWeapon.FirstPersonMesh'
- Mesh=FirstPersonMesh
- bDropOnDeath=true
- DroppedPickupClass=class'KFDroppedPickup'
- begin object name=StaticPickupComponent class=StaticMeshComponent
- StaticMesh=StaticMesh'EngineMeshes.Cube'
- ReplacementPrimitive=none
- CastShadow=false
- object end
- // Reference: StaticMeshComponent'Default__KFWeapon.StaticPickupComponent'
- DroppedPickupMesh=StaticPickupComponent
- begin object name=StaticPickupComponent class=StaticMeshComponent
- StaticMesh=StaticMesh'EngineMeshes.Cube'
- ReplacementPrimitive=none
- CastShadow=false
- object end
- // Reference: StaticMeshComponent'Default__KFWeapon.StaticPickupComponent'
- PickupFactoryMesh=StaticPickupComponent
- bIgnoreBaseRotation=true
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement