// Function from file: mecha.dm
        public override void Activate(int?forced_state = null)
        {
            Obj_Mecha M = null;


            if (!Lang13.Bool(this.owner) || !(this.chassis != null) || this.chassis.occupant != this.owner)
            {
                return;
            }
            M = this.chassis;

            if (Lang13.Bool(forced_state))
            {
                M.defence_mode = forced_state;
            }
            else
            {
                M.defence_mode = !Lang13.Bool(M.defence_mode) ?1:0;
            }
            this.button_icon_state = "mech_defense_mode_" + (Lang13.Bool(M.defence_mode) ? "on" : "off");

            if (Lang13.Bool(M.defence_mode))
            {
                M.deflect_chance = M.defence_mode_deflect_chance;
                M.occupant_message("<span class='notice'>You enable " + M + " defence mode.</span>");
            }
            else
            {
                M.deflect_chance = Lang13.Initial(M, "deflect_chance");
                M.occupant_message("<span class='danger'>You disable " + M + " defence mode.</span>");
            }
            M.log_message("Toggled defence mode.");
            return;
        }
        // Function from file: mecha.dm
        public override void Activate(int?forced_state = null)
        {
            Obj_Mecha M           = null;
            string    new_damtype = null;


            if (!Lang13.Bool(this.owner) || !(this.chassis != null) || this.chassis.occupant != this.owner)
            {
                return;
            }
            M = this.chassis;

            dynamic _a = M.damtype;             // Was a switch-case, sorry for the mess.

            if (_a == "tox")
            {
                new_damtype = "brute";
                M.occupant_message("Your exosuit's hands form into fists.");
            }
            else if (_a == "brute")
            {
                new_damtype = "fire";
                M.occupant_message("A torch tip extends from your exosuit's hand, glowing red.");
            }
            else if (_a == "fire")
            {
                new_damtype = "tox";
                M.occupant_message("A bone-chillingly thick plasteel needle protracts from the exosuit's palm.");
            }
            M.damtype = new_damtype;
            this.button_icon_state = "mech_damtype_" + new_damtype;
            GlobalFuncs.playsound(this, "sound/mecha/mechmove01.ogg", 50, 1);
            return;
        }
        // Function from file: mecha.dm
        public override void Activate(int?forced_state = null)
        {
            Obj_Mecha M = null;


            if (!Lang13.Bool(this.owner) || !(this.chassis != null) || this.chassis.occupant != this.owner)
            {
                return;
            }
            M = this.chassis;

            if (Lang13.Bool(this.owner.client))
            {
                M.zoom_mode            = !M.zoom_mode;
                this.button_icon_state = "mech_zoom_" + (M.zoom_mode ? "on" : "off");
                M.log_message("Toggled zoom mode.");
                M.occupant_message("<font color='" + (M.zoom_mode ? "blue" : "red") + "'>Zoom mode " + (M.zoom_mode ? "en" : "dis") + "abled.</font>");

                if (M.zoom_mode)
                {
                    this.owner.client.view = 12;
                    this.owner.WriteMsg(new Sound("sound/mecha/imag_enh.ogg", null, null, null, 50));
                }
                else
                {
                    this.owner.client.view = Convert.ToInt32(Game13.view);
                }
            }
            return;
        }
        // Function from file: mecha.dm
        public override void Activate(int?forced_state = null)
        {
            Obj_Mecha M = null;


            if (!Lang13.Bool(this.owner) || !(this.chassis != null) || this.chassis.occupant != this.owner)
            {
                return;
            }
            M = this.chassis;

            if (Lang13.Bool(forced_state))
            {
                M.leg_overload_mode = forced_state;
            }
            else
            {
                M.leg_overload_mode = !Lang13.Bool(M.leg_overload_mode) ?1:0;
            }
            this.button_icon_state = "mech_overload_" + (Lang13.Bool(M.leg_overload_mode) ? "on" : "off");
            M.log_message("Toggled leg actuators overload.");

            if (Lang13.Bool(M.leg_overload_mode))
            {
                M.leg_overload_mode = 1;
                M.step_in           = Num13.MinInt(1, Num13.Floor(Convert.ToDouble(M.step_in / 2)));
                M.step_energy_drain = M.step_energy_drain * M.leg_overload_coeff;
                M.occupant_message("<span class='danger'>You enable leg actuators overload.</span>");
            }
            else
            {
                M.leg_overload_mode = 0;
                M.step_in           = Lang13.Initial(M, "step_in");
                M.step_energy_drain = Lang13.Initial(M, "step_energy_drain");
                M.occupant_message("<span class='notice'>You disable leg actuators overload.</span>");
            }
            return;
        }
        // Function from file: mecha.dm
        public override void Activate(int?forced_state = null)
        {
            Obj_Mecha M = null;


            if (!Lang13.Bool(this.owner) || !(this.chassis != null) || this.chassis.occupant != this.owner)
            {
                return;
            }
            M         = this.chassis;
            M.phasing = !M.phasing;
            this.button_icon_state = "mech_phasing_" + (M.phasing ? "on" : "off");
            M.occupant_message("<font color=\"" + (M.phasing ? "#00f\">En" : "#f00\">Dis") + "abled phasing.</font>");
            return;
        }
        // Function from file: mecha.dm
        public override void Activate(int?forced_state = null)
        {
            Obj_Mecha M = null;


            if (!Lang13.Bool(this.owner) || !(this.chassis != null) || this.chassis.occupant != this.owner)
            {
                return;
            }
            M = this.chassis;

            if (M.get_charge() > 0)
            {
                M.thrusters_active     = !M.thrusters_active;
                this.button_icon_state = "mech_thrusters_" + (M.thrusters_active ? "on" : "off");
                M.log_message("Toggled thrusters.");
                M.occupant_message("<font color='" + (M.thrusters_active ? "blue" : "red") + "'>Thrusters " + (M.thrusters_active ? "en" : "dis") + "abled.");
            }
            return;
        }