コード例 #1
0
        public override void InheritData(Gun source)
        {
            base.InheritData(source);
            MultiActiveReloadController component = source.GetComponent <MultiActiveReloadController>();

            if (component)
            {
                this.reloads             = component.reloads;
                this.activeReloadEnabled = component.activeReloadEnabled;
            }
        }
コード例 #2
0
 public static void OnActiveReloadPressedHook(Action <Gun, PlayerController, Gun, bool> orig, Gun self, PlayerController p, Gun g, bool actualPress)
 {
     orig(self, p, g, actualPress);
     if (self.IsReloading || self.reloadTime < 0f)
     {
         PlayerController playerController = self.CurrentOwner as PlayerController;
         if (playerController && (actualPress || true))
         {
             MultiActiveReloadController controller = self.GetComponent <MultiActiveReloadController>();
             if (controller != null && controller.activeReloadEnabled && controller.canAttemptActiveReload && !GameUIRoot.Instance.GetReloadBarForPlayer(self.CurrentOwner as PlayerController).IsActiveReloadGracePeriod())
             {
                 bool flag2 = GameUIRoot.Instance.AttemptActiveReloadOnlyMultireload(self.CurrentOwner as PlayerController);
                 MultiActiveReload reload = GameUIRoot.Instance.GetReloadBarForPlayer(self.CurrentOwner as PlayerController).GetMultiActiveReloadForController();
                 if (flag2)
                 {
                     controller.OnActiveReloadSuccess(reload);
                     GunFormeSynergyProcessor component = self.GetComponent <GunFormeSynergyProcessor>();
                     if (component)
                     {
                         component.JustActiveReloaded = true;
                     }
                     ChamberGunProcessor component2 = self.GetComponent <ChamberGunProcessor>();
                     if (component2)
                     {
                         component2.JustActiveReloaded = true;
                     }
                 }
                 else
                 {
                     controller.OnActiveReloadFailure(reload);
                 }
                 if (reload == null || !reload.canAttemptActiveReloadAfterwards)
                 {
                     ETGModConsole.Log("yes");
                     controller.canAttemptActiveReload = false;
                     Action <PlayerController, Gun, bool> act = (Action <PlayerController, Gun, bool>)info2.CreateDelegate <Action <PlayerController, Gun, bool> >();
                     self.OnReloadPressed -= act;
                 }
             }
         }
     }
 }