// Function from file: mecha_pilot.dm public bool exit_mecha(Obj_Mecha M = null) { int search_aggressiveness = 0; Obj_Mecha_Combat C = null; if (!(M != null)) { return(false); } this.mecha.aimob_exit_mech(this); this.allow_movement_on_non_turfs = GlobalVars.FALSE; this.targets_from = this; this.wanted_objects = Lang13.GetTypes(typeof(Obj_Mecha_Combat)) - typeof(Obj_Mecha_Combat); search_aggressiveness = 2; foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInRange(this, this.vision_range), typeof(Obj_Mecha_Combat))) { C = _a; if (this.is_valid_mecha(C)) { this.target = C; search_aggressiveness = 3; break; } } this.search_objects = search_aggressiveness; this.ranged = false; this.minimum_distance = 1; return(false); }
// 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_equipment.dm public override dynamic Destroy( ) { if (this.chassis != null) { this.chassis.equipment.Remove(this); if (this.chassis.selected == this) { this.chassis.selected = null; } this.update_chassis_page(); this.chassis.occupant_message("<span class='danger'>The " + this + " is destroyed!</span>"); this.chassis.log_append_to_last("" + this + " is destroyed.", true); if (this is Obj_Item_MechaParts_MechaEquipment_Weapon) { ((dynamic)this.chassis.occupant).WriteMsg(new Sound("sound/mecha/weapdestr.ogg", null, null, null, 50)); } else { ((dynamic)this.chassis.occupant).WriteMsg(new Sound("sound/mecha/critdestr.ogg", null, null, null, 50)); } this.chassis = null; } return(base.Destroy()); }
// 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: turf.dm public void phase_damage_creatures(int damage = 0, dynamic U = null) { Mob_Living M = null; Obj_Mecha M2 = null; foreach (dynamic _a in Lang13.Enumerate(this, typeof(Mob_Living))) { M = _a; if (M == U) { continue; } M.adjustBruteLoss(damage); M.Paralyse(damage / 5); } foreach (dynamic _b in Lang13.Enumerate(this, typeof(Obj_Mecha))) { M2 = _b; M2.take_damage(damage * 2, "brute"); } return; }
// Function from file: other_tools.dm public override void attach(Obj_Mecha M = null) { base.attach(M); this.droid_overlay = new Icon(this.icon, "repair_droid"); M.overlays.Add(this.droid_overlay); 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.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: tables_racks.dm public override bool mech_melee_attack(Obj_Mecha M = null) { this.visible_message("<span class='danger'>" + M.name + " smashes " + this + " apart!</span>"); GlobalFuncs.playsound(this.loc, "sound/weapons/punch4.ogg", 50, 1); this.table_destroy(1); return(false); }
// Function from file: window.dm public override bool mech_melee_attack(Obj_Mecha M = null) { if (base.mech_melee_attack(M)) { this.hit(M.force, true); } return(false); }
// Function from file: medical_tools.dm public override bool can_attach(Obj_Mecha M = null) { if (base.can_attach(M) && M is Obj_Mecha_Medical) { return(true); } return(false); }
// Function from file: mecha_equipment.dm public virtual bool can_attach(Obj_Mecha M = null) { if (M.equipment.len < M.max_equip) { return(true); } return(false); }
// Function from file: structures.dm public override bool mech_melee_attack(Obj_Mecha M = null) { if (M.damtype == "brute") { this.visible_message("<span class='danger'>" + M.name + " has hit " + this + ".</span>"); return(true); } return(false); }
// Function from file: windowdoor.dm public override bool mech_melee_attack(Obj_Mecha M = null) { if (M.damtype == "brute") { GlobalFuncs.playsound(this.loc, "sound/effects/Glasshit.ogg", 75, 1); this.visible_message("<span class='danger'>" + M.name + " has hit " + this + ".</span>"); this.take_damage(M.force); } return(false); }
// Function from file: grille.dm public override bool mech_melee_attack(Obj_Mecha M = null) { if (base.mech_melee_attack(M)) { GlobalFuncs.playsound(this.loc, "sound/effects/grillehit.ogg", 80, 1); this.health -= Convert.ToDouble(M.force * 0.5); this.healthcheck(); } return(false); }
// Function from file: weapons.dm public override bool can_attach(Obj_Mecha M = null) { if (base.can_attach(M)) { if (M is Obj_Mecha_Combat_Honker) { return(true); } } return(false); }
// Function from file: mining_tools.dm public override void attach(Obj_Mecha M = null) { base.attach(M); M.occupant_sight_flags |= GlobalVars.SEE_TURFS; if (M.occupant != null) { ((dynamic)M.occupant).update_sight(); } return; }
// Function from file: work_tools.dm public override bool can_attach(Obj_Mecha M = null) { if (base.can_attach(M)) { if (M is Obj_Mecha_Working_Ripley) { return(true); } } return(false); }
// Function from file: weapons.dm public override bool can_attach(Obj_Mecha M = null) { if (base.can_attach(M)) { return(true); } else if (M.equipment.len < M.max_equip && M is Obj_Mecha_Working) { return(true); } return(false); }
// Function from file: mecha_equipment.dm public virtual void attach(Obj_Mecha M = null) { M.equipment.Add(this); this.chassis = M; this.loc = M; M.log_message("" + this + " initialized."); if (!Lang13.Bool(M.selected)) { M.selected = this; } this.update_chassis_page(); 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: door.dm public void crush( ) { Mob_Living L = null; Ent_Static location = null; Obj_Mecha M = null; foreach (dynamic _a in Lang13.Enumerate(GlobalFuncs.get_turf(this), typeof(Mob_Living))) { L = _a; if (L is Mob_Living_Carbon_Alien) { L.adjustBruteLoss(22.5); L.emote("roar"); } else if (L is Mob_Living_Carbon_Human) { L.adjustBruteLoss(15); L.emote("scream"); L.Weaken(5); } else if (L is Mob_Living_Carbon_Monkey) { L.adjustBruteLoss(15); L.Weaken(5); } else { L.adjustBruteLoss(15); } location = this.loc; if (location is Tile_Simulated) { location.add_blood_floor(L); } } foreach (dynamic _b in Lang13.Enumerate(GlobalFuncs.get_turf(this), typeof(Obj_Mecha))) { M = _b; M.take_damage(15); } return; }
// Function from file: walls.dm public override bool mech_melee_attack(Obj_Mecha M = null) { if (M.damtype == "brute") { GlobalFuncs.playsound(this, "sound/weapons/punch4.ogg", 50, 1); this.visible_message("<span class='danger'>" + M.name + " has hit " + this + "!</span>"); if (Rand13.PercentChance(this.hardness) && Convert.ToDouble(M.force) > 20) { this.dismantle_wall(true); this.visible_message("<span class='warning'>" + this.name + " smashes through the wall!</span>"); GlobalFuncs.playsound(this, "sound/effects/meteorimpact.ogg", 100, 1); } } return(false); }
// Function from file: mecha_equipment.dm public virtual void detach(dynamic moveto = null) { moveto = Lang13.Bool(moveto) || Lang13.Bool(GlobalFuncs.get_turf(this.chassis)); if (this.Move(moveto)) { this.chassis.equipment.Remove(this); if (this.chassis.selected == this) { this.chassis.selected = null; } this.update_chassis_page(); this.chassis.log_message("" + this + " removed from equipment."); this.chassis = null; this.set_ready_state(true); } 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; }
// 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; if (M.smoke_ready && M.smoke > 0) { M.smoke_system.start(); M.smoke--; M.smoke_ready = false; Task13.Schedule(M.smoke_cooldown, (Task13.Closure)(() => { M.smoke_ready = true; return; })); } return; }
// Function from file: statue.dm public Ent_Static can_be_seen(dynamic destination = null) { dynamic T = null; ByTable check_list = null; Ent_Static check = null; Mob_Living M = null; Obj_Mecha M2 = null; if (!this.cannot_be_seen) { return(null); } T = GlobalFuncs.get_turf(this.loc); if (Lang13.Bool(T) && Lang13.Bool(destination) && Lang13.Bool(T.lighting_object)) { if (T.lighting_lumcount < 1 && destination.lighting_lumcount < 1) { return(null); } if (T == destination) { destination = null; } } check_list = new ByTable(new object [] { this }); if (Lang13.Bool(destination)) { check_list.Add(destination); } foreach (dynamic _c in Lang13.Enumerate(check_list, typeof(Ent_Static))) { check = _c; foreach (dynamic _a in Lang13.Enumerate(Map13.FetchViewers(check, Game13.view + 1) - this, typeof(Mob_Living))) { M = _a; if (M.client != null && this.CanAttack(M) && !M.has_unlimited_silicon_privilege) { if (!(M.eye_blind != 0)) { return(M); } } } foreach (dynamic _b in Lang13.Enumerate(Map13.FetchInView(check, Game13.view + 1), typeof(Obj_Mecha))) { M2 = _b; if (M2.occupant != null && Lang13.Bool(((dynamic)M2.occupant).client)) { if (!Lang13.Bool(((dynamic)M2.occupant).eye_blind)) { return(M2.occupant); } } } } return(null); }
// Function from file: work_tools.dm public override void attach(Obj_Mecha M = null) { base.attach(M); this.cargo_holder = M; return; }
// Function from file: work_tools.dm public override void detach(dynamic moveto = null) { base.detach((object)(moveto)); this.cargo_holder = null; return; }
// Function from file: work_tools.dm public override void attach(Obj_Mecha M = null) { base.attach(M); this.v_event = this.chassis.events.addEvent("onMove", this, "layCable"); return; }