977 {
980
981 Weapon_Base weapon;
982 Class.CastTo(weapon, pInHands);
983 ItemOptics optic = weapon.GetAttachedOptics();
984
987
989
990
992 {
994 }
995 else
996 {
998 }
999
1001 {
1003 }
1005 {
1007 {
1009 }
1010 else
1011 {
1012 weapon.StepZeroingUpAllMuzzles();
1013 }
1014 }
1016 {
1018 {
1020 }
1021 else
1022 {
1023 weapon.StepZeroingDownAllMuzzles();
1024 }
1025 }
1026
1028 {
1029 if (optic)
1030 HandleOptic(optic,
false, pInputs, pExitIronSights);
1031 }
1032
1034 {
1036 if (weapon && weapon.IsInOptics())
1037 {
1038 weapon.ExitOptics();
1039 }
1040
1042
1043 return;
1044 }
1045 else
1046 {
1049 {
1051 }
1052
1054 {
1056 }
1057 }
1058
1061 {
1062 bool autofire = weapon.GetCurrentModeAutoFire(weapon.GetCurrentMuzzle()) && weapon.IsChamberEjectable(weapon.GetCurrentMuzzle());
1063 int burst = weapon.GetCurrentModeBurstSize(weapon.GetCurrentMuzzle());
1064 int burst_count = weapon.GetBurstCount();
1065 if (!autofire && (burst < 2 || burst_count < 1))
1066 {
1067 if (pInputs.
IsAttackButtonDown() && GetInputInterface().SyncedValue(
"UAWeaponMeleeAttack") == 0 && GetInputInterface().SyncedValue(
"UAHeavyMeleeAttack") == 0)
1068 {
1070 }
1071 }
1072 else if (autofire || burst > 1)
1073 {
1074#ifdef DIAG_DEVELOPER
1076 if (burst_option == 0)
1077 {
1078#endif
1079 if (pInputs.
IsAttackButton() && GetInputInterface().SyncedValue(
"UAWeaponMeleeAttack") == 0 && GetInputInterface().SyncedValue(
"UAHeavyMeleeAttack") == 0)
1080 {
1081 if (autofire || burst_count < burst)
1082 {
1084 }
1085 }
1086 else
1087 {
1088 weapon.ResetBurstCount();
1089 }
1090#ifdef DIAG_DEVELOPER
1091 }
1092 else if (burst_option == 1)
1093 {
1094 if (burst > 1 && burst_count == burst)
1095 {
1096 weapon.ResetBurstCount();
1097 }
1098 else if (burst > 1 && burst_count < burst)
1099 {
1101 }
1102 else
1103 {
1104
1106 {
1108 }
1109 }
1110 }
1111#endif
1112 }
1113 }
1114
1115 #ifdef PLATFORM_CONSOLE
1117 {
1118 if (!weapon.IsWaitingForActionFinish() && !
IsFighting())
1119 {
1120 int muzzle_index = weapon.GetCurrentMuzzle();
1121
1122 if (weapon.IsChamberFiredOut(muzzle_index))
1123 {
1124 if (weapon.CanProcessWeaponEvents())
1125 {
1127 {
1129 pExitIronSights = true;
1131 }
1132 }
1133 }
1134 }
1135 else
1136 {
1138 }
1139 }
1140 #endif
1141 }
void ResetWeaponRaiseProgress()
WeaponManager GetWeaponManager()
bool IsWeaponRaiseCompleted()
void CompleteWeaponRaise()
bool m_IsFireWeaponRaised
ref HumanMovementState m_MovementState
time step for gradual update of dead screen visibilibty up to full visbility [s]
bool m_IsTryingHoldBreath
DayZPlayerInventory GetDayZPlayerInventory()
void HandleOptic(notnull ItemOptics optic, bool inHands, HumanInputController pInputs, out bool pExitOptics)
proto native bool StepZeroingUp()
sets zeroing to next defined (respective to current) value in zeroing config array
proto native bool IsInOptics()
is weapon in optics mode or not
proto native bool IsUsingWeaponIronsightsOverride()
is optics using ironsights override settings or not
proto native bool StepZeroingDown()
sets zeroing to previous (respective to current) defined value in zeroing config array
void Fire(Weapon_Base wpn)
bool EjectBullet(ActionBase control_action=NULL)
proto native CGame GetGame()
void HumanCommandWeapons()