2020-12-13 15:01:13 +00:00
//=============================================================================
// KFWeap_Bow_Crossbow
//=============================================================================
// A crossbow
//=============================================================================
// Killing Floor 2
// Copyright (C) 2015 Tripwire Interactive LLC
//=============================================================================
class KFWeap _Bow _Crossbow extends KFWeap _ScopedBase ;
/** Return true if this weapon should play the fire last animation for this shoot animation */
simulated function bool ShouldPlayFireLast ( byte FireModeNum )
{
if ( SpareAmmoCount [ GetAmmoType ( FireModeNum ) ] == 0 )
{
return true ;
}
return false ;
}
/** Returns animation to play based on reload type and status */
simulated function name GetReloadAnimName ( bool bTacticalReload )
{
if ( AmmoCount [ 0 ] > 0 )
{
// Disable half-reloads for now. This can happen if server gets out
// of sync, but choosing the wrong animation will just make it worse!
` warn("Grenade launcher reloading with non-empty mag");
}
return bTacticalReload ? ReloadEmptyMagEliteAnim : ReloadEmptyMagAnim ;
}
/** Returns trader filter index based on weapon type (copied from riflebase) */
static simulated event EFilterTypeUI GetTraderFilter ( )
{
return FT _Projectile ;
}
defaultproperties
{
// Inventory
InventorySize = 6
GroupPriority = 50
WeaponSelectTexture = Texture2D 'WEP_UI_Crossbow_TEX.UI_WeaponSelect_Crossbow'
AssociatedPerkClasses ( 0 ) = class 'KFPerk_Sharpshooter'
// FOV / Position
MeshFOV = 70
MeshIronSightFOV = 52
PlayerIronSightFOV = 70
PlayerViewOffset = ( X = 1 , Y = 8 , Z = - 5 )
2022-05-11 15:13:25 +00:00
IronSightPosition = ( X = - 13 , Y = 0 , Z = - 0.015 )
2020-12-13 15:01:13 +00:00
// AI warning system
bWarnAIWhenAiming = true
MaxAIWarningDistSQ = 4000000
AimWarningDelay = ( X = 0.4 f , Y = 0.8 f )
AimWarningCooldown = 0.0 f
// 2D scene capture
Begin Object Name = SceneCapture2DComponent0
TextureTarget = TextureRenderTarget2D 'Wep_Mat_Lib.WEP_ScopeLense_Target'
FieldOfView = 18.5 // "2.0X" = 37(our real world FOV determinant)/2.0
End Object
ScopedSensitivityMod = 12.0
ScopeLenseMICTemplate = MaterialInstanceConstant 'WEP_1P_Crossbow_MAT.WEP_1P_Crossbow_Scope_MAT'
// Depth of field
DOF _BlendInSpeed = 3.0
DOF _FG _FocalRadius = 0.0
DOF _FG _MaxNearBlurSize = 3.5
// Content
PackageKey = "Crossbow"
FirstPersonMeshName = "WEP_1P_Crossbow_MESH.Wep_1stP_Crossbow_Rig"
FirstPersonAnimSetNames ( 0 ) = "WEP_1P_Crossbow_ANIM.Wep_1stP_Crossbow_Anim"
PickupMeshName = "WEP_3P_Crossbow_MESH.Wep_Crossbow_Pickup"
AttachmentArchetypeName = "WEP_Crossbow_ARCH.Wep_Crossbow_3P"
MuzzleFlashTemplateName = "WEP_Crossbow_ARCH.Wep_Crossbow_MuzzleFlash"
// Ammo
MagazineCapacity [ 0 ] = 1
SpareAmmoCapacity [ 0 ] = 34
InitialSpareMags [ 0 ] = 13
AmmoPickupScale [ 0 ] = 3.0 // 3 arrows
bCanBeReloaded = true
bReloadFromMagazine = true // reloading from mag is one step, while NOT reloading from mag is multi-step (open bolt, load ammo, close bolt) and not applicable for bow
// Recoil
maxRecoilPitch = 200
minRecoilPitch = 150
maxRecoilYaw = 100
minRecoilYaw = - 100
RecoilRate = 0.06
RecoilMaxYawLimit = 500
RecoilMinYawLimit = 65035
RecoilMaxPitchLimit = 900
RecoilMinPitchLimit = 64785
RecoilISMaxYawLimit = 50
RecoilISMinYawLimit = 65485
RecoilISMaxPitchLimit = 375
RecoilISMinPitchLimit = 65460
// DEFAULT_FIREMODE
FireModeIconPaths ( DEFAULT _FIREMODE ) = Texture2D 'ui_firemodes_tex.UI_FireModeSelect_BulletArrow'
FiringStatesArray ( DEFAULT _FIREMODE ) = WeaponSingleFireAndReload
WeaponFireTypes ( DEFAULT _FIREMODE ) = EWFT _Projectile
WeaponProjectiles ( DEFAULT _FIREMODE ) = class 'KFProj_Bolt_Crossbow'
InstantHitDamage ( DEFAULT _FIREMODE ) = 350.0
InstantHitDamageTypes ( DEFAULT _FIREMODE ) = class 'KFDT_Piercing_Crossbow'
PenetrationPower ( DEFAULT _FIREMODE ) = 4.0
FireInterval ( DEFAULT _FIREMODE ) = 0.3 // For this weapon, this is not the fire rate, but the time when the auto reload anim kicks in
Spread ( DEFAULT _FIREMODE ) = 0.007 //0.007
FireOffset = ( X = 25 , Y = 3.0 , Z = - 4.0 )
// ALT_FIREMODE
FiringStatesArray ( ALTFIRE _FIREMODE ) = WeaponSingleFiring
WeaponFireTypes ( ALTFIRE _FIREMODE ) = EWFT _None
// Fire Effects
WeaponFireSnd ( DEFAULT _FIREMODE ) = ( DefaultCue = AkEvent 'WW_WEP_SA_Crossbow.Play_WEP_SA_Crossbow_Fire_3P' , FirstPersonCue = AkEvent 'WW_WEP_SA_Crossbow.Play_WEP_SA_Crossbow_Fire_1P' )
WeaponDryFireSnd ( DEFAULT _FIREMODE ) = AkEvent 'WW_WEP_SA_Crossbow.Play_WEP_SA_Crossbow_DryFire'
// BASH_FIREMODE
InstantHitDamageTypes ( BASH _FIREMODE ) = class 'KFDT_Bludgeon_Crossbow'
InstantHitDamage ( BASH _FIREMODE ) = 26
// Custom animations
FireSightedAnims = ( Shoot _Iron , Shoot _Iron2 , Shoot _Iron3 )
BonesToLockOnEmpty = ( RW _Cable _Parent )
// Attachments
bHasIronSights = true
bHasFlashlight = false
// Just like the launchers, this weapon has mag size of 1 and force reload which
// causes significant ammo sync issues. This fix is far from perfect, but it helps.
bAllowClientAmmoTracking = true
// Weapon Upgrade stat boosts
//WeaponUpgrades[1]=(IncrementDamage=1.2f,IncrementWeight=1)
//WeaponUpgrades[2]=(IncrementDamage=1.4f,IncrementWeight=2)
//WeaponUpgrades[3]=(IncrementDamage=1.6f,IncrementWeight=3)
WeaponUpgrades [ 1 ] = ( Stats = ( ( Stat = EWUS _Damage0 , Scale = 1.2 f ) , ( Stat = EWUS _Weight , Add = 1 ) ) )
WeaponUpgrades [ 2 ] = ( Stats = ( ( Stat = EWUS _Damage0 , Scale = 1.4 f ) , ( Stat = EWUS _Weight , Add = 2 ) ) )
WeaponUpgrades [ 3 ] = ( Stats = ( ( Stat = EWUS _Damage0 , Scale = 1.6 f ) , ( Stat = EWUS _Weight , Add = 3 ) ) )
}