public void WiresUpdate(WiresUpdateEventArgs args)
        {
            var wire  = (Wires)args.Identifier;
            var value = args.Action != SharedWiresComponent.WiresAction.Mend;

            switch (wire)
            {
            case Wires.Overflow:
                _overflowFlag = value;
                break;

            case Wires.PlayerInvincible:
                _playerInvincibilityFlag = value;
                break;

            case Wires.EnemyInvincible:
                _enemyInvincibilityFlag = value;
                break;
            }

            IndicatorUpdate();
        }
Beispiel #2
0
        public void WiresUpdate(WiresUpdateEventArgs args)
        {
            switch (args.Identifier)
            {
            case ParticleAcceleratorControlBoxWires.Toggle:
                if (args.Action == WiresAction.Pulse)
                {
                    if (_isEnabled)
                    {
                        SwitchOff();
                    }
                    else
                    {
                        SwitchOn();
                    }
                }
                else
                {
                    _wirePowerBlocked = args.Action == WiresAction.Cut;
                    if (_isEnabled)
                    {
                        SwitchOff();
                    }
                }

                break;

            case ParticleAcceleratorControlBoxWires.Strength:
                if (args.Action == WiresAction.Pulse)
                {
                    SetStrength(_selectedStrength + 1);
                }
                else
                {
                    _wireStrengthCut = args.Action == WiresAction.Cut;
                }

                break;

            case ParticleAcceleratorControlBoxWires.Interface:
                if (args.Action == WiresAction.Pulse)
                {
                    _wireInterfaceBlocked ^= true;
                }
                else
                {
                    _wireInterfaceBlocked = args.Action == WiresAction.Cut;
                }

                break;

            case ParticleAcceleratorControlBoxWires.Limiter:
                if (args.Action == WiresAction.Pulse)
                {
                    Owner.PopupMessageEveryone(Loc.GetString("particle-accelerator-control-box-component-wires-update-limiter-on-pulse"));
                }
                else
                {
                    _wireLimiterCut = args.Action == WiresAction.Cut;
                    if (_selectedStrength == ParticleAcceleratorPowerState.Level3 && !_wireLimiterCut)
                    {
                        // Yes, it's a feature that mending this wire WON'T WORK if the strength wire is also cut.
                        // Since that blocks SetStrength().
                        SetStrength(ParticleAcceleratorPowerState.Level2);
                    }
                }

                break;
            }

            UpdateUI();
            UpdateWireStatus();
        }