// Function from file: shuttles.dm public void initial_move( ) { Obj_DockingPort_Mobile M = null; Obj_DockingPort_Stationary S = null; foreach (dynamic _b in Lang13.Enumerate(this.mobile, typeof(Obj_DockingPort_Mobile))) { M = _b; if (!Lang13.Bool(M.roundstart_move)) { continue; } foreach (dynamic _a in Lang13.Enumerate(this.stationary, typeof(Obj_DockingPort_Stationary))) { S = _a; if (S.z != 1 && String13.FindIgnoreCase(S.id, M.id, 1, 0) != 0) { S.width = M.width; S.height = M.height; S.dwidth = M.dwidth; S.dheight = M.dheight; } } this.moveShuttle(M.id, "" + M.roundstart_move, 0); } return; }
// Function from file: shuttles.dm public int toggleShuttle(string shuttleId = null, string dockHome = null, string dockAway = null, dynamic timed = null) { Obj_DockingPort_Mobile M = null; dynamic dockedAt = null; string destination = null; M = this.getShuttle(shuttleId); if (!(M != null)) { return(1); } dockedAt = M.get_docked(); destination = dockHome; if (Lang13.Bool(dockedAt) && dockedAt.id == dockHome) { destination = dockAway; } if (Lang13.Bool(timed)) { if (M.request(this.getDock(destination)) != 0) { return(2); } } else if (M.dock(this.getDock(destination)) != 0) { return(2); } return(0); }
// Function from file: laborshuttle.dm public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null) { Obj_DockingPort_Mobile M = null; dynamic S = null; if (Lang13.Bool(href_list["move"])) { M = GlobalVars.SSshuttle.getShuttle("laborcamp"); if (!(M != null)) { Task13.User.WriteMsg("<span class='warning'>Cannot locate shuttle!</span>"); return(0); } S = M.get_docked(); if (Lang13.Bool(S) && S.name == "laborcamp_away") { Task13.User.WriteMsg("<span class='warning'>Shuttle is already at the outpost!</span>"); return(0); } } base.Topic(href, href_list, (object)(hsrc)); return(null); }
// Function from file: computer.dm public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null) { ByTable options = null; Obj_DockingPort_Mobile M = null; string dat = null; bool destination_found = false; Obj_DockingPort_Stationary S = null; Browser popup = null; if (Lang13.Bool(base.attack_hand((object)(a), b, c))) { return(null); } this.add_fingerprint(Task13.User); options = String13.ParseUrlParams(this.possible_destinations); M = GlobalVars.SSshuttle.getShuttle(this.shuttleId); dat = "Status: " + (M != null ? M.getStatusText() : "*Missing*") + "<br><br>"; if (M != null) { foreach (dynamic _a in Lang13.Enumerate(GlobalVars.SSshuttle.stationary, typeof(Obj_DockingPort_Stationary))) { S = _a; if (!(options.Find(S.id) != 0)) { continue; } if (M.canDock(S) != 0) { continue; } destination_found = true; dat += new Txt("<A href='?src=").Ref(this).str(";move=").item(S.id).str("'>Send to ").item(S.name).str("</A><br>").ToString(); } if (!destination_found) { dat += "<B>Shuttle Locked</B><br>"; if (this.admin_controlled) { dat += "Authorized personnel only<br>"; dat += new Txt("<A href='?src=").Ref(this).str(";request=1]'>Request Authorization</A><br>").ToString(); } } } dat += new Txt("<a href='?src=").Ref(a).str(";mach_close=computer'>Close</a>").ToString(); popup = new Browser(a, "computer", (M != null ? M.name : "shuttle"), 300, 200); popup.set_content("<center>" + dat + "</center>"); popup.set_title_image(Task13.User.browse_rsc_icon(this.icon, this.icon_state)); popup.open(); return(null); }
// Function from file: computer.dm public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null) { Obj_DockingPort_Mobile M = null; if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc)))) { return(null); } Task13.User.set_machine(this); this.add_fingerprint(Task13.User); if (!this.allowed(Task13.User)) { Task13.User.WriteMsg("<span class='danger'>Access denied.</span>"); return(null); } if (Lang13.Bool(href_list["move"])) { M = GlobalVars.SSshuttle.getShuttle(this.shuttleId); if (M.launch_status == 1) { Task13.User.WriteMsg("<span class='warning'>You've already escaped. Never going back to that place again!</span>"); return(null); } if (this.no_destination_swap) { if (M.mode != 0) { Task13.User.WriteMsg("<span class='warning'>Shuttle already in transit.</span>"); return(null); } } switch ((int)(GlobalVars.SSshuttle.moveShuttle(this.shuttleId, href_list["move"], 1))) { case 0: Task13.User.WriteMsg("<span class='notice'>Shuttle received message and will be sent shortly.</span>"); break; case 1: Task13.User.WriteMsg("<span class='warning'>Invalid shuttle requested.</span>"); break; default: Task13.User.WriteMsg("<span class='notice'>Unable to comply.</span>"); break; } } return(null); }
// Function from file: shuttles.dm public Obj_DockingPort_Mobile getShuttle(string id = null) { Obj_DockingPort_Mobile M = null; foreach (dynamic _a in Lang13.Enumerate(this.mobile, typeof(Obj_DockingPort_Mobile))) { M = _a; if (M.id == id) { return(M); } } GlobalFuncs.warning("" + ("couldn't find shuttle with id: " + id) + " in " + "code/controllers/subsystem/shuttles.dm" + " at line " + 78 + " src: " + this + " usr: "******"."); return(null); }
// Function from file: shuttles.dm public int moveShuttle(string shuttleId = null, string dockId = null, int?timed = null) { Obj_DockingPort_Mobile M = null; M = this.getShuttle(shuttleId); if (!(M != null)) { return(1); } if (Lang13.Bool(timed)) { if (M.request(this.getDock(dockId)) != 0) { return(2); } } else if (M.dock(this.getDock(dockId)) != 0) { return(2); } return(0); }
// Function from file: nuclearbomb.dm public void explode( ) { dynamic M = null; int off_station = 0; dynamic bomb_location = null; Obj_DockingPort_Mobile Shuttle = null; if (this.safety) { this.timing = 0; return; } this.timing = -1; this.yes_code = false; this.safety = true; this.update_icon(); foreach (dynamic _a in Lang13.Enumerate(GlobalVars.player_list)) { M = _a; M.WriteMsg("sound/machines/Alarm.ogg"); } if (GlobalVars.ticker != null && Lang13.Bool(GlobalVars.ticker.mode)) { GlobalVars.ticker.mode.explosion_in_progress = true; } Task13.Sleep(100); if (!(this.core != null)) { GlobalVars.ticker.station_explosion_cinematic(3, "no_core"); GlobalVars.ticker.mode.explosion_in_progress = false; return; } GlobalVars.enter_allowed = false; off_station = 0; bomb_location = GlobalFuncs.get_turf(this); if (Lang13.Bool(bomb_location) && Lang13.Bool(bomb_location.z) == true) { if (Convert.ToDouble(bomb_location.x) < 48 || Convert.ToDouble(bomb_location.x) > 208 || Convert.ToDouble(bomb_location.y) < 48 || Convert.ToDouble(bomb_location.y) > 208) { off_station = 1; } } else { off_station = 2; } if (Lang13.Bool(GlobalVars.ticker.mode) && GlobalVars.ticker.mode.name == "nuclear emergency") { Shuttle = GlobalVars.SSshuttle.getShuttle("syndicate"); GlobalVars.ticker.mode.syndies_didnt_escape = (Shuttle != null && Shuttle.z == 2 ? false : true); GlobalVars.ticker.mode.nuke_off_station = off_station; } GlobalVars.ticker.station_explosion_cinematic(off_station, null); if (Lang13.Bool(GlobalVars.ticker.mode)) { GlobalVars.ticker.mode.explosion_in_progress = false; if (GlobalVars.ticker.mode.name == "nuclear emergency") { GlobalVars.ticker.mode.nukes_left--; } else { Game13.WriteMsg("<B>The station was destoyed by the nuclear blast!</B>"); } GlobalVars.ticker.mode.station_was_nuked = off_station < 2; if (!((GameMode)GlobalVars.ticker.mode).check_finished()) { Task13.Schedule(0, (Task13.Closure)(() => { Game13.Reboot("Station destroyed by Nuclear Device.", "end_error", "nuke - unhandled ending"); return; })); return; } } return; }
// Function from file: pinpointer.dm public void worklocation( ) { if (!this.active) { return; } if (!this.mode) { this.workdisk(); return; } if (!GlobalVars.bomb_set) { this.mode = false; this.workdisk(); GlobalFuncs.playsound(this.loc, "sound/machines/twobeep.ogg", 50, 1); this.visible_message("<span class='notice'>Authentication Disk Locator mode actived.</span>"); return; } if (!(this.home != null)) { this.home = GlobalVars.SSshuttle.getShuttle("syndicate"); if (!(this.home != null)) { this.icon_state = "pinonnull"; return; } } if (this.loc.z != this.home.z) { this.icon_state = "pinonnull"; } else { this.dir = Map13.GetDistance(this, this.home); dynamic _a = Map13.GetDistance(this, this.home); // Was a switch-case, sorry for the mess. if (1 <= _a && _a <= 8) { this.icon_state = "pinonclose"; } else if (9 <= _a && _a <= 16) { this.icon_state = "pinonmedium"; } else if (16 <= _a && _a <= Double.PositiveInfinity) { this.icon_state = "pinonfar"; } else if (_a == 0) { this.icon_state = "pinondirect"; } } Task13.Schedule(5, (Task13.Closure)(() => { this.worklocation(); return; })); return; }