19 protected static bool s_bIsUsingSights;
22 static bool IsUsingSights()
24 return s_bIsUsingSights;
55 super.HandleSightActivation();
66 s_bIsUsingSights =
true;
76 if (
data &&
data.ShouldHideParentObject())
79 if (parent &&
data.ShouldHideParentParentObject())
95 if (m_ParentCharacter)
111 if (
data.ShouldHideParentObject() && owner && !owner.
IsDeleted())
115 if (parent &&
data.ShouldHideParentParentObject())
119 if (
data.ShouldHideParentCharacter() && m_ParentCharacter)
121 if (!m_ParentCharacter.IsDeleted())
122 m_ParentCharacter.SetFlags(
EntityFlags.VISIBLE,
false);
124 m_ParentCharacter = null;
127 s_bIsUsingSights =
false;
129 super.HandleSightDeactivation();
135 super.OnSightADSActivated();
143 super.OnSightADSDeactivated();
157 vector weaponAnglesMat[3];
158 Math3D.AnglesToMatrix(aimModAngles, weaponAnglesMat);
159 Math3D.MatrixMultiply3(pOutCameraTransform, weaponAnglesMat, pOutCameraTransform);
174 int zoomCount = zooms.Count();
176 for (
int i; i < zoomCount; i++)
179 float zoom = zooms[i];
228 SCR_ChimeraCharacter pParentCharacter = null;
238 SCR_ChimeraCharacter character = SCR_ChimeraCharacter.Cast(parentParent);
241 pParentCharacter = character;
250 if (value > 0 && m_iSelectedZoomLevel <
m_SightsFovInfo.GetStepsCount())
252 m_iSelectedZoomLevel++;
255 if (parent && pParentCharacter)
260 if (value < 0 && m_iSelectedZoomLevel > 0)
262 m_iSelectedZoomLevel--;
265 if (parent && pParentCharacter)
274 m_bIsIlluminationOn = !m_bIsIlluminationOn;
281 if (!
Turret.Cast(soundSource))
289 soundSource = parent;
294 if (!parentCharacter || !soundSource)
301 parentCharacter.SetIllumination(m_bIsIlluminationOn, wpnRplComp.Id());
313 SCR_BaseCompartmentManagerComponent compartmentManager = SCR_BaseCompartmentManagerComponent.Cast(owner.
FindComponent(SCR_BaseCompartmentManagerComponent));
314 if (!compartmentManager || !compartmentManager.AnyCompartmentsOccupiedOrLocked())
317 array<BaseCompartmentSlot> outCompartments = {};
318 if (compartmentManager.GetCompartments(outCompartments) < 1)
324 return SCR_ChimeraCharacter.Cast(compartment.GetOccupant());
330 SCR_ChimeraCharacter character;
333 character = SCR_ChimeraCharacter.Cast(parent);
351 if (
data.GetZeroType() == SCR_EPIPZeroingType.EPZ_RETICLE_OFFSET)
352 return m_fReticleOffsetY + GetCurrentSightsRange()[0];
354 return m_fReticleOffsetY;
ArmaReforgerScripted GetGame()
void ToggleIllumination(float value, EActionTrigger trigger)
Action for toggling illumination.
override void ApplyRecoilToCamera(inout vector pOutCameraTransform[4], vector aimModAngles)
SCR_2DSightsComponentClass m_SightsFovInfo
SCR_SightsZoomFOVInfo GetSightsFovInfo()
void SelectZoomLevel(int id)
Switch betweem zoom levels from sights.
void AdjustZoom(float value)
Move zoom level up and down based on mouse wheel value.
void ActionZoomOut(float value=0.0, EActionTrigger reason=0)
Move zoom level up and down based on mouse wheel value.
void ActionZoomIn(float value=0.0, EActionTrigger reason=0)
Move zoom level up and down based on mouse wheel value.
override bool CanFreelook()
SCR_CharacterSoundComponentClass GetComponentData()
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
Get all prefabs that have the spawner data
SCR_ChimeraCharacter GetCharacterOwner()
Returns the top most owner of this object or the operator of this turret.
proto external Managed FindComponent(typename typeName)
proto external EntityFlags SetFlags(EntityFlags flags, bool recursively=false)
proto external IEntity GetParent()
proto external EntityFlags ClearFlags(EntityFlags flags, bool recursively=false)
proto external bool IsDeleted()
void HandleSightActivation()
float GetReticleOffsetYTarget()
override void OnSightADSActivated()
override void OnSightADSDeactivated()
void HandleSightDeactivation()
static float CalculateZoomFOV(float magnification)
Return camera FOV for given magnification. Focus FOV is used as reference 1x magnification.
void EnableReticleIllumination(bool enable)
Toggle between illumination modes.
bool m_bShouldHideParentParentObject
bool ShouldHideParentParentObject()
static RplComponent GetEntityRplComponent(notnull IEntity entity)
IEntity GetOwner()
Owner entity of the fuel tank.
SCR_FieldOfViewSettings Attribute
EntityFlags
Various entity flags.