Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AISetBipod.c
Go to the documentation of this file.
1 class SCR_AISetBipod : AITaskScripted
2 {
3  [Attribute("true", UIWidgets.CheckBox, "When true, bipod will be unfolded, otherwise it will be folded")]
4  protected bool m_bUnfoldBipod;
5 
6  //------------------------------------------------------------------------------------------
7  override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
8  {
9  ChimeraCharacter character = ChimeraCharacter.Cast(owner.GetControlledEntity());
10  if (!character)
11  return ENodeResult.FAIL;
12 
13  CharacterControllerComponent controller = character.GetCharacterController();
14  if (!controller)
15  return ENodeResult.FAIL;
16 
17  BaseWeaponManagerComponent weaponManager = controller.GetWeaponManagerComponent();
18  if (!weaponManager)
19  return ENodeResult.FAIL;
20 
21  BaseWeaponComponent weapon = weaponManager.GetCurrentWeapon();
22  if (!weapon || !weapon.HasBipod())
23  return ENodeResult.FAIL;
24 
25  weapon.SetBipod(m_bUnfoldBipod);
26  return ENodeResult.SUCCESS;
27  }
28 
29  //------------------------------------------------------------------------------------------
30  override bool VisibleInPalette() { return true; }
31 
32  //------------------------------------------------------------------------------------------
33  override string GetOnHoverDescription() { return "Unfolds or folds a bipon on current weapon";}
34 }
SCR_AISetBipod
Definition: SCR_AISetBipod.c:1
Attribute
typedef Attribute
Post-process effect of scripted camera.
BaseWeaponComponent
Definition: BaseWeaponComponent.c:12