Exemplo n.º 1
0
        // Prevent call to checkForHeatDamage
        private void setState(EmergencyShutdownState newState)
        {
            Mod.Log.Info?.Write($"MESS - Setting state to: {newState} for actor: {CombatantUtils.Label(this.OwningMech)}");
            if (this.state == newState)
            {
                return;
            }
            this.state = newState;
            this.timeInCurrentState = 0f;
            if (newState == EmergencyShutdownState.ShuttingDown)
            {
                if (this.OwningMech.GameRep != null)
                {
                    this.OwningMech.GameRep.PlayShutdownAnim();
                }
                this.OwningMech.CancelCreatedEffects();
                return;
            }
            if (newState != EmergencyShutdownState.Finished)
            {
                return;
            }

            Mech.heatLogger.Log("Mech " + this.OwningMech.DisplayName + " shuts down from overheating");
            this.OwningMech.IsShutDown = true;
            this.OwningMech.DumpAllEvasivePips();
        }
Exemplo n.º 2
0
        private void UpdateState()
        {
            this.timeInCurrentState += Time.deltaTime;
            EmergencyShutdownState shutdownState = this.state;

            if (shutdownState != EmergencyShutdownState.Rising)
            {
                if (shutdownState != EmergencyShutdownState.ShuttingDown)
                {
                    return;
                }
                if (this.timeInCurrentState > TimeToShutdown)
                {
                    this.setState(EmergencyShutdownState.Finished);
                }
            }
            else if (this.timeInCurrentState > TimeToRise)
            {
                this.setState(EmergencyShutdownState.ShuttingDown);
                return;
            }
        }