Exemple #1
0
        // Token: 0x060001E8 RID: 488 RVA: 0x00011CB8 File Offset: 0x0000FEB8
        public override void InheritData(Gun source)
        {
            base.InheritData(source);
            MultiActiveReloadController component = source.GetComponent <MultiActiveReloadController>();
            bool flag = component;

            if (flag)
            {
                this.reloads             = component.reloads;
                this.activeReloadEnabled = component.activeReloadEnabled;
            }
        }
Exemple #2
0
        // Token: 0x060001DE RID: 478 RVA: 0x00011794 File Offset: 0x0000F994
        public static void OnActiveReloadPressedHook(Action <Gun, PlayerController, Gun, bool> orig, Gun self, PlayerController p, Gun g, bool actualPress)
        {
            orig(self, p, g, actualPress);
            bool flag = self.IsReloading || self.reloadTime < 0f;

            if (flag)
            {
                PlayerController exists = self.CurrentOwner as PlayerController;
                bool             flag2  = exists && (actualPress || true);
                if (flag2)
                {
                    MultiActiveReloadController component = self.GetComponent <MultiActiveReloadController>();
                    bool flag3 = component != null && component.activeReloadEnabled && component.canAttemptActiveReload && !GameUIRoot.Instance.GetReloadBarForPlayer(self.CurrentOwner as PlayerController).IsActiveReloadGracePeriod();
                    if (flag3)
                    {
                        bool flag4 = GameUIRoot.Instance.AttemptActiveReloadOnlyMultireload(self.CurrentOwner as PlayerController);
                        MultiActiveReload multiActiveReloadForController = GameUIRoot.Instance.GetReloadBarForPlayer(self.CurrentOwner as PlayerController).GetMultiActiveReloadForController();
                        bool flag5 = flag4;
                        if (flag5)
                        {
                            component.OnActiveReloadSuccess(multiActiveReloadForController);
                            GunFormeSynergyProcessor component2 = self.GetComponent <GunFormeSynergyProcessor>();
                            bool flag6 = component2;
                            if (flag6)
                            {
                                component2.JustActiveReloaded = true;
                            }
                            ChamberGunProcessor component3 = self.GetComponent <ChamberGunProcessor>();
                            bool flag7 = component3;
                            if (flag7)
                            {
                                component3.JustActiveReloaded = true;
                            }
                        }
                        else
                        {
                            component.OnActiveReloadFailure(multiActiveReloadForController);
                        }
                        bool flag8 = multiActiveReloadForController == null || !multiActiveReloadForController.canAttemptActiveReloadAfterwards;
                        if (flag8)
                        {
                            ETGModConsole.Log("yes", false);
                            component.canAttemptActiveReload = false;
                            Action <PlayerController, Gun, bool> value = (Action <PlayerController, Gun, bool>)MultiActiveReloadManager.info2.CreateDelegate <Action <PlayerController, Gun, bool> >();
                            self.OnReloadPressed = (Action <PlayerController, Gun, bool>)Delegate.Remove(self.OnReloadPressed, value);
                        }
                    }
                }
            }
        }