7 protected ChimeraCharacter m_Character;
8 protected CharacterControllerComponent m_CharacterController;
9 protected SCR_InventoryStorageManagerComponent m_StorageManager;
12 protected bool m_bIsValid;
19 protected bool m_bIsCharacterADS;
21 protected bool m_bIsCharacterInVehicle;
23 protected bool m_bIsCharacterGettingIn;
25 protected bool m_bIsCharacterGettingOut;
27 protected bool m_bIsCharacterSprinting;
29 protected bool m_bIsCharacterSwimming;
31 protected bool m_bIsCharacterFalling;
33 protected bool m_bIsCharacterReloading;
35 protected bool m_bCanCharacterGetOutVehicle;
37 protected bool m_bIsCharacterWeaponRaised;
39 protected bool m_bCanCharacterFireWeapon;
41 protected bool m_bIsCharacterUsingItem;
43 protected bool m_bIsCharacterBleeding;
45 protected bool m_bIsInventoryOpen;
47 protected bool m_bIsQuickSlotAvailable;
49 protected bool m_bIsQuickSlotShown;
51 protected bool m_bIsGadgetSelection;
53 protected bool m_bIsWeaponManipulation;
55 protected float m_fFocusMode;
57 protected float m_fBleedingTime;
59 protected float m_fSprintingTime;
61 protected int m_iAdditionalMagazines;
63 protected int m_iMedicalItemCount;
65 protected int m_iMedicalItemCountInQuickSlots;
67 protected IEntity m_CurrentItemEntity;
69 protected IEntity m_CurrentWeaponEntity;
75 protected BaseMagazineComponent m_CurrentMagazine;
78 protected IEntity m_CurrentVehicle;
80 protected float m_fTurboTime;
82 protected BaseControllerComponent m_CurrentVehicleController;
84 protected SignalsManagerComponent m_CurrentVehicleSignals;
90 protected bool m_bIsCharacterConscious;
91 protected bool m_bHasBleedingLimbs;
92 protected bool m_bHasTourniquetLimb;
95 protected SCR_VoNComponent m_VON;
96 protected SCR_VONController m_VONController;
99 protected bool m_bCharacterIsUsingRadio;
101 protected bool m_bCharacterRadiosCount;
102 bool m_bIsRadioLongRange;
103 bool m_bOwnsLongRangeRadio;
106 protected bool m_bCanFetchInventory =
true;
110 bool m_bCanRotateMapElement;
111 bool m_bCanActivateMapElement;
112 bool m_bCanDragMapElement;
115 private void OnItemAddedListener(IEntity item, BaseInventoryStorageComponent storage)
117 m_bCanFetchInventory =
true;
120 private void OnItemRemovedListener(IEntity item, BaseInventoryStorageComponent storage)
122 m_bCanFetchInventory =
true;
125 private void OnInventoryOpen(
bool open)
131 m_bIsInventoryOpen = open;
134 private void OnQuickSlotOpen(
bool open)
140 m_bIsQuickSlotAvailable = open;
141 m_bIsQuickSlotShown = open;
151 m_bIsCharacterADS =
false;
152 m_bIsCharacterInVehicle =
false;
153 m_bIsCharacterGettingIn =
false;
154 m_bIsCharacterGettingOut =
false;
155 m_bIsCharacterSwimming =
false;
156 m_bIsCharacterSprinting =
false;
157 m_bIsCharacterFalling =
false;
158 m_bIsCharacterReloading =
false;
159 m_bIsCharacterWeaponRaised =
false;
160 m_bCanCharacterFireWeapon =
false;
161 m_bIsCharacterUsingItem =
false;
162 m_bIsGadgetSelection =
false;
163 m_bIsWeaponManipulation =
false;
166 m_CurrentItemEntity =
null;
167 m_CurrentWeaponEntity =
null;
168 m_CurrentWeapon =
null;
169 m_CurrentMuzzle =
null;
170 m_CurrentMagazine =
null;
171 m_CurrentVehicleWeapon =
null;
174 m_CharacterDamageComponent =
null;
175 m_bIsCharacterConscious =
false;
176 m_bHasBleedingLimbs =
false;
177 m_bHasTourniquetLimb =
false;
190 ChimeraCharacter GetCharacter()
197 IEntity GetHeldGadget()
206 SCR_GadgetComponent GetHeldGadgetComponent()
215 bool GetGadgetRaised()
224 IEntity GetGadget(EGadgetType
type)
233 BaseMagazineComponent GetCurrentMagazine()
235 return m_CurrentMagazine;
242 return m_CurrentMuzzle;
249 return m_CurrentWeapon;
256 return m_eCharacterStance;
263 return m_eCompartmentType;
268 float GetFocusModeAmount()
275 float GetCharacterBleedingTime()
277 return m_fBleedingTime;
282 float GetCharacterSprintingTime()
284 return m_fSprintingTime;
290 int GetAdditionalMagazinesCount()
292 return m_iAdditionalMagazines;
297 int GetMedicalItemCount()
299 return m_iMedicalItemCount;
303 int GetMedicalItemCountInQuickSlots()
305 return m_iMedicalItemCountInQuickSlots;
310 bool GetIsCharacterInVehicle()
312 return m_bIsCharacterInVehicle;
317 bool GetIsCharacterGettingIn()
319 return m_bIsCharacterGettingIn;
324 bool GetIsCharacterGettingOut()
326 return m_bIsCharacterGettingOut;
331 bool GetIsCharacterSprinting()
333 return m_bIsCharacterSprinting;
338 bool GetIsCharacterSwimming()
340 return m_bIsCharacterSwimming;
345 bool GetIsCharacterFalling()
347 return m_bIsCharacterFalling;
352 bool GetIsCharacterReloading()
354 return m_bIsCharacterReloading;
359 bool GetIsCharacterADS()
361 return m_bIsCharacterADS;
366 bool GetIsCharacterWeaponRaised()
368 return m_bIsCharacterWeaponRaised;
373 bool GetCanCharacterFireWeapon() {
return m_bCanCharacterFireWeapon; }
377 bool GetIsCharacterUsingItem()
379 return m_bIsCharacterUsingItem;
384 bool GetCanCharacterGetOutVehicle()
386 return m_bCanCharacterGetOutVehicle;
391 bool GetIsCharacterBleeding()
393 return m_bIsCharacterBleeding;
397 bool GetIsCharacterUsingRadio()
399 return m_bCharacterIsUsingRadio;
403 int GetCharacterRadiosCount()
405 return m_bCharacterRadiosCount;
409 bool IsInventoryOpen()
411 return m_bIsInventoryOpen;
415 bool IsQuickSlotAvailable()
417 return m_bIsQuickSlotAvailable;
421 bool IsQuickSlotShown()
423 return m_bIsQuickSlotShown;
427 bool IsGadgetSelection()
429 return m_bIsGadgetSelection;
433 bool IsWeaponManipulation()
435 return m_bIsWeaponManipulation;
440 IEntity GetCurrentItemEntity()
442 return m_CurrentItemEntity;
447 IEntity GetCurrentWeaponEntity()
449 return m_CurrentWeaponEntity;
454 IEntity GetCurrentVehicle()
456 return m_CurrentVehicle;
461 BaseControllerComponent GetCurrentVehicleController()
463 return m_CurrentVehicleController;
468 SignalsManagerComponent GetCurrentVehicleSignals()
470 return m_CurrentVehicleSignals;
477 return m_CurrentVehicleWeapon;
482 float GetCurrentVehicleTurboTime()
489 CharacterAnimationComponent GetAnimationComponent()
492 return m_Character.GetAnimationComponent();
500 return m_CharacterDamageComponent;
504 bool GetIsCharacterConscious()
506 return m_bIsCharacterConscious;
510 bool GetHasBleedingLimbs()
512 return m_bHasBleedingLimbs;
516 bool GetHasTourniquetLimb()
518 return m_bHasTourniquetLimb;
534 void FetchData(IEntity controlledEntity,
float timeSlice)
537 ChimeraCharacter character = ChimeraCharacter.Cast(controlledEntity);
538 if (character != m_Character)
540 m_Character = character;
546 m_VON = SCR_VoNComponent.Cast(character.FindComponent(SCR_VoNComponent));
567 SCR_InventoryStorageManagerComponent storageManager = SCR_InventoryStorageManagerComponent.Cast(
m_CharacterController.GetInventoryStorageManager());
568 if (storageManager != m_StorageManager)
570 if (m_StorageManager)
572 m_StorageManager.m_OnItemAddedInvoker.Remove(OnItemAddedListener);
573 m_StorageManager.m_OnItemRemovedInvoker.Remove(OnItemRemovedListener);
574 m_StorageManager.m_OnInventoryOpenInvoker.Remove(OnInventoryOpen);
575 m_StorageManager.m_OnQuickBarOpenInvoker.Remove(OnQuickSlotOpen);
578 m_StorageManager = storageManager;
580 if (m_StorageManager)
582 m_StorageManager.m_OnItemAddedInvoker.Insert(OnItemAddedListener);
583 m_StorageManager.m_OnItemRemovedInvoker.Insert(OnItemRemovedListener);
584 m_StorageManager.m_OnInventoryOpenInvoker.Insert(OnInventoryOpen);
585 m_StorageManager.m_OnQuickBarOpenInvoker.Insert(OnQuickSlotOpen);
603 m_bIsCharacterInVehicle = m_Character.IsInVehicle();
617 m_fSprintingTime += timeSlice;
619 m_fSprintingTime = 0;
622 CompartmentAccessComponent compartmentAccess = m_Character.GetCompartmentAccessComponent();
624 if (compartmentAccess)
626 m_bCanCharacterGetOutVehicle = m_bCanCharacterGetOutVehicle && compartmentAccess.CanGetOutVehicle();
627 m_bIsCharacterGettingIn = compartmentAccess.IsGettingIn();
628 m_bIsCharacterGettingOut = compartmentAccess.IsGettingOut();
631 BaseCompartmentSlot slot = compartmentAccess.GetCompartment();
635 IEntity vehicle = slot.GetOwner();
638 vehicle = GetVehicle(vehicle);
640 if (vehicle != m_CurrentVehicle)
642 m_CurrentVehicle = vehicle;
646 m_CurrentVehicleSignals = SignalsManagerComponent.Cast(vehicle.FindComponent(SignalsManagerComponent));
652 m_eCompartmentType = slot.GetType();
654 m_fTurboTime += timeSlice;
659 m_CurrentVehicleController = slot.GetController();
661 if (turretController)
663 BaseWeaponManagerComponent weaponManager = turretController.GetWeaponManager();
665 m_CurrentVehicleWeapon = weaponManager.GetCurrentWeapon();
670 m_CurrentVehicle =
null;
675 if (!m_CurrentVehicle)
677 m_CurrentVehicleSignals =
null;
678 m_CurrentVehicleController =
null;
689 m_CurrentWeaponEntity = currentSlot.GetWeaponEntity();
693 if (currentWeapon != m_CurrentWeapon)
695 m_CurrentWeapon = currentWeapon;
696 m_bCanFetchInventory =
true;
702 m_CurrentMuzzle = m_CurrentWeapon.GetCurrentMuzzle();
703 m_CurrentMagazine = m_CurrentWeapon.GetCurrentMagazine();
711 if (m_bCanFetchInventory && m_StorageManager)
714 m_iAdditionalMagazines = m_StorageManager.GetMagazineCountByWeapon(m_CurrentWeapon);
716 m_iMedicalItemCount = m_StorageManager.GetHealthComponentCount();
719 SCR_CharacterInventoryStorageComponent characterStorage = m_StorageManager.GetCharacterStorage();
720 if (characterStorage)
722 m_iMedicalItemCountInQuickSlots = 0;
724 array<IEntity> items = characterStorage.GetQuickSlotItems();
725 foreach (IEntity item : items)
727 if (item && item.FindComponent(SCR_ConsumableItemComponent))
728 m_iMedicalItemCountInQuickSlots++;
732 m_bCanFetchInventory =
false;
738 m_fFocusMode = cameraHandler.GetFocusMode();
741 m_bIsGadgetSelection =
GetGame().GetInputManager().GetActionTriggered(
"GadgetSelection");
742 m_bIsWeaponManipulation =
GetGame().GetInputManager().GetActionTriggered(
"WeaponManipulation");
751 m_bCharacterIsUsingRadio = m_VON.IsTransmitingRadio();
752 if (m_bCharacterIsUsingRadio)
759 FetchHealthData(timeSlice);
763 FetchMapData(timeSlice);
768 protected IEntity GetVehicle(IEntity vehicle)
772 if (vehicle.Type() != Vehicle)
773 parent = vehicle.GetParent();
776 vehicle = GetVehicle(parent);
783 protected void FetchHealthData(
float timeSlice)
786 if (!m_CharacterDamageComponent)
788 Print(
"[SCR_AvailableActionsConditionData] - can't fetch health data!", LogLevel.WARNING);
793 if (m_CharacterDamageComponent)
794 m_bIsCharacterBleeding = m_CharacterDamageComponent.IsDamagedOverTime(
EDamageType.BLEEDING);
797 if (m_bIsCharacterBleeding)
798 m_fBleedingTime += timeSlice;
806 array<ECharacterHitZoneGroup> limbs = {};
807 m_CharacterDamageComponent.GetAllExtremities(limbs);
809 for (
int i = 0, count = limbs.Count(); i < count; i++)
811 m_bHasTourniquetLimb = m_CharacterDamageComponent.GetGroupTourniquetted(limbs[i]);
812 if (m_bHasTourniquetLimb)
819 protected void FetchMapData(
float timeSlice)
821 m_bCanRotateMapElement =
false;
822 m_bCanDragMapElement =
false;
823 m_bCanActivateMapElement =
false;
828 foreach (Widget widget : mapWidgetsUnderCursor)
837 if (moveComp.m_bCanRotate)
838 m_bCanRotateMapElement =
true;
840 if (moveComp.m_bCanDrag)
841 m_bCanDragMapElement =
true;
843 if (moveComp.m_bCanActivate)
844 m_bCanActivateMapElement =
true;