// Function from file: machine_interactions.dm public override void Options_Topic(string href = null, ByTable href_list = null) { dynamic newfreq = null; if (Lang13.Bool(href_list["change_freq"])) { newfreq = Interface13.Input(Task13.User, "Specify a new frequency for new signals to change to. Enter null to turn off frequency changing. Decimals assigned automatically.", this, this.network, null, InputType.Num | InputType.Null); if (this.canAccess(Task13.User)) { if (Lang13.Bool(newfreq)) { if (String13.FindIgnoreCase(String13.NumberToString(Convert.ToDouble(newfreq)), ".", 1, 0) != 0) { newfreq *= 10; } if (Convert.ToDouble(newfreq) < 10000) { this.change_frequency = newfreq; this.temp = "<font color = #666633>-% New frequency to change to assigned: \"" + newfreq + " GHz\" %-</font color>"; } } else { this.change_frequency = 0; this.temp = "<font color = #666633>-% Frequency changing deactivated %-</font color>"; } } } return; }
// Function from file: atmosmachinery.dm public Image getpipeimage(string iconset = null, string iconstate = null, dynamic direction = null, dynamic col = null) { col = col ?? "#ffffff"; dynamic identifier = null; Image img = null; if (GlobalVars.iconsetids[iconset] == null) { GlobalVars.iconsetids[iconset] = String13.NumberToString(GlobalVars.iconsetids.len + 1); } identifier = GlobalVars.iconsetids[iconset] + ("_" + iconstate + "_" + direction + "_" + col); if (GlobalVars.pipeimages[identifier] == null) { img = new Image(iconset, null, iconstate, null, direction); img.color = col; GlobalVars.pipeimages[identifier] = img; } else { img = GlobalVars.pipeimages[identifier]; } return(img); }
// Function from file: projectile.dm public virtual dynamic on_hit(Ent_Static target = null, double?blocked = null, dynamic hit_zone = null) { blocked = blocked ?? 0; Ent_Static L = null; string organ_hit_text = null; int? volume = null; string reagent_note = null; Reagent R = null; if (!(target is Mob_Living)) { return(0); } L = target; if (blocked != 100) { organ_hit_text = ""; if (Lang13.Bool(((dynamic)L).has_limbs)) { organ_hit_text = new Txt(" in ").the(GlobalFuncs.parse_zone(this.def_zone)).item().ToString(); } if (this.suppressed) { GlobalFuncs.playsound(this.loc, this.hitsound, 5, 1, -1); ((dynamic)L).WriteMsg(new Txt("<span class='userdanger'>You're shot by ").a(this).item().item(organ_hit_text).str("!</span>").ToString()); } else { if (Lang13.Bool(this.hitsound)) { volume = this.vol_by_damage(); GlobalFuncs.playsound(this.loc, this.hitsound, volume, 1, -1); } L.visible_message(new Txt("<span class='danger'>").item(L).str(" is hit by ").a(this).item().item(organ_hit_text).str("!</span>").ToString(), new Txt("<span class='userdanger'>").item(L).str(" is hit by ").a(this).item().item(organ_hit_text).str("!</span>").ToString()); } ((dynamic)L).on_hit(this.type); } if (this.reagents != null && this.reagents.reagent_list != null) { reagent_note = " REAGENTS:"; foreach (dynamic _a in Lang13.Enumerate(this.reagents.reagent_list, typeof(Reagent))) { R = _a; reagent_note += R.id + " ("; reagent_note += String13.NumberToString(R.volume) + ") "; } } GlobalFuncs.add_logs(this.firer, L, "shot", this, reagent_note); return(((dynamic)L).apply_effects(this.stun, this.weaken, this.paralyze, this.irradiate, this.slur, this.stutter, this.eyeblur, this.drowsy, blocked, this.stamina, this.jitter)); }
// Function from file: server.dm public override void receive_information(Signal signal = null, Obj_Machinery_Telecomms machine_from = null) { CommLogEntry log = null; string identifier = null; int? can_send = null; if (Lang13.Bool(signal.data["message"])) { if (this.is_freq_listening(signal)) { if (this.traffic > 0) { this.totaltraffic += this.traffic; } if (Convert.ToInt32(signal.data["type"]) != 4) { this.update_logs(); log = new CommLogEntry(); log.parameters["mobtype"] = signal.data["mobtype"]; log.parameters["job"] = signal.data["job"]; log.parameters["key"] = signal.data["key"]; log.parameters["message"] = signal.data["message"]; log.parameters["name"] = signal.data["name"]; log.parameters["realname"] = signal.data["realname"]; log.parameters["uspeech"] = signal.data["languages"] & 1; if (Convert.ToDouble(signal.data["compression"]) > 0) { log.parameters["message"] = GlobalFuncs.Gibberish(signal.data["message"], Convert.ToInt32(signal.data["compression"] + 50)); log.parameters["job"] = GlobalFuncs.Gibberish(signal.data["job"], Convert.ToInt32(signal.data["compression"] + 50)); log.parameters["name"] = GlobalFuncs.Gibberish(signal.data["name"], Convert.ToInt32(signal.data["compression"] + 50)); log.parameters["realname"] = GlobalFuncs.Gibberish(signal.data["realname"], Convert.ToInt32(signal.data["compression"] + 50)); log.input_type = "Corrupt File"; } this.log_entries.Add(log); if (!this.stored_names.Contains(signal.data["name"])) { this.stored_names.Add(signal.data["name"]); } this.logs++; signal.data["server"] = this; identifier = String13.NumberToString(Rand13.Int(-1000, 1000) + Game13.time); log.name = "data packet (" + Num13.Md5(identifier) + ")"; } can_send = this.relay_information(signal, "/obj/machinery/telecomms/hub"); if (!Lang13.Bool(can_send)) { this.relay_information(signal, "/obj/machinery/telecomms/broadcaster"); } } } return; }
// Function from file: vent_pump.dm public Obj_Machinery_Atmospherics_Components_Unary_VentPump(dynamic loc = null, int?process = null) : base((object)(loc), process) { // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!; if (!Lang13.Bool(this.id_tag)) { this.assign_uid(); this.id_tag = String13.NumberToString(this.uid); } return; }
// Function from file: reagent_containers.dm public override bool throw_impact(dynamic target = null, Mob_Living_Carbon thrower = null) { bool _default = false; dynamic M = null; dynamic R = null; Reagent A = null; _default = base.throw_impact((object)(target), thrower); if (!(this.reagents != null) || !Lang13.Bool(this.reagents.total_volume) || !this.spillable) { return(_default); } if (target is Mob && Lang13.Bool(target.reagents)) { this.reagents.total_volume *= Rand13.Int(5, 10) * 0.1; M = target; ((Ent_Static)target).visible_message("<span class='danger'>" + M + " has been splashed with something!</span>", "<span class='userdanger'>" + M + " has been splashed with something!</span>"); foreach (dynamic _a in Lang13.Enumerate(this.reagents.reagent_list, typeof(Reagent))) { A = _a; R += A.id + " ("; R += String13.NumberToString(A.volume) + "),"; } if (Lang13.Bool(this.thrownby)) { GlobalFuncs.add_logs(this.thrownby, M, "splashed", R); } this.reagents.reaction(target, GlobalVars.TOUCH); } else if (((Ent_Static)target).CanPass(this, GlobalFuncs.get_turf(this)) && Lang13.Bool(this.thrownby) && Lang13.Bool(this.thrownby.mind) && this.thrownby.mind.assigned_role == "Bartender") { this.visible_message("<span class='notice'>" + this + " lands onto the " + target.name + " without spilling a single drop.</span>"); return(_default); } else { this.visible_message("<span class='notice'>" + this + " spills its contents all over " + target + ".</span>"); this.reagents.reaction(target, GlobalVars.TOUCH); if (Lang13.Bool(GlobalFuncs.qdeleted(this))) { return(_default); } } this.reagents.clear_reagents(); return(_default); }
// Function from file: status_display.dm public string get_shuttle_timer( ) { double timeleft = 0; timeleft = GlobalVars.SSshuttle.emergency.timeLeft(); if (timeleft > 0) { return("" + GlobalFuncs.add_zero(String13.NumberToString(timeleft / 60 % 60), 2) + ":" + GlobalFuncs.add_zero(String13.NumberToString(timeleft % 60), 2)); } return("00:00"); }
// Function from file: server.dm public void add_entry(dynamic content = null, dynamic input = null) { CommLogEntry log = null; string identifier = null; log = new CommLogEntry(); identifier = String13.NumberToString(Rand13.Int(-1000, 1000) + Game13.time); log.name = "" + input + " (" + Num13.Md5(identifier) + ")"; log.input_type = input; log.parameters["message"] = content; this.log_entries.Add(log); this.update_logs(); return; }
// Function from file: radio.dm public RadioFrequency return_frequency(dynamic new_frequency = null) { string f_text = null; RadioFrequency frequency = null; f_text = String13.NumberToString(Convert.ToDouble(new_frequency)); frequency = this.frequencies[f_text]; if (!(frequency != null)) { frequency = new RadioFrequency(); frequency.frequency = new_frequency; this.frequencies[f_text] = frequency; } return(frequency); }
// Function from file: radio.dm public RadioFrequency add_object(Obj device = null, double new_frequency = 0, string filter = null) { string f_text = null; RadioFrequency frequency = null; f_text = String13.NumberToString(new_frequency); frequency = this.frequencies[f_text]; if (!(frequency != null)) { frequency = new RadioFrequency(); frequency.frequency = new_frequency; this.frequencies[f_text] = frequency; } frequency.add_listener(device, filter); return(frequency); }
// Function from file: radio.dm public bool remove_object(Obj device = null, double old_frequency = 0) { string f_text = null; RadioFrequency frequency = null; f_text = String13.NumberToString(old_frequency); frequency = this.frequencies[f_text]; if (frequency != null) { frequency.remove_listener(device); if (frequency.devices.len == 0) { GlobalFuncs.qdel(frequency); this.frequencies.Remove(f_text); } } return(true); }
// Function from file: airlock_control.dm public override int?process(dynamic seconds = null) { Signal signal = null; GasMixture air_sample = null; double pressure = 0; if (this.on) { signal = new Signal(); signal.transmission_method = 1; signal.data["tag"] = this.id_tag; signal.data["timestamp"] = Game13.time; air_sample = this.return_air(); pressure = Num13.Round(air_sample.return_pressure(), 0.1); this.alert = pressure < 81.51; signal.data["pressure"] = String13.NumberToString(pressure); this.radio_connection.post_signal(this, signal, GlobalVars.RADIO_AIRLOCK, 5); } this.update_icon(); return(null); }
// Function from file: brigdoors.dm public override bool update_icon(dynamic new_state = null, dynamic new_icon = null, int?new_px = null, int?new_py = null) { string disp1 = null; double time_left = 0; string disp2 = null; if ((this.stat & 2) != 0) { this.icon_state = "frame"; return(false); } if ((this.stat & 1) != 0) { this.set_picture("ai_bsod"); return(false); } if (Lang13.Bool(this.timing)) { disp1 = this.id; time_left = this.time_left(GlobalVars.TRUE); disp2 = "" + GlobalFuncs.add_zero(String13.NumberToString(time_left / 60 % 60), 2) + "~" + GlobalFuncs.add_zero(String13.NumberToString(time_left % 60), 2); if (Lang13.Length(disp2) > 5) { disp2 = "Error"; } this.update_display(disp1, disp2); } else if (Lang13.Bool(this.maptext)) { this.maptext = ""; } return(false); }
// Function from file: supermatter.dm public override int?process(dynamic seconds = null) { Ent_Static L = null; string stability = null; Mob_Living mob = null; Mob_Living H = null; double rads = 0; GasMixture env = null; GasMixture removed = null; bool removed_nitrogen = false; int temp_factor = 0; double device_energy = 0; Mob_Living_Carbon_Human l = null; Mob_Living l2 = null; double rads2 = 0; L = this.loc; if (L == null) { return(26); } if (!(L is Tile)) { return(null); } if (L is Tile_Space) { return(null); } if (this.damage > this.warning_point) { if ((Game13.timeofday - this.lastwarning) / 10 >= 30) { stability = String13.NumberToString(Num13.Floor(this.damage / this.explosion_point * 100)); if (this.damage > this.emergency_point) { this.radio.talk_into(this, "" + this.emergency_alert + " Instability: " + stability + "%"); this.lastwarning = Game13.timeofday; if (!this.has_reached_emergency) { this.investigate_log("has reached the emergency point for the first time.", "supermatter"); GlobalFuncs.message_admins("" + this + " has reached the emergency point <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=" + this.x + ";Y=" + this.y + ";Z=" + this.z + "'>(JMP)</a>."); this.has_reached_emergency = true; } } else if (this.damage >= this.damage_archived) { this.radio.talk_into(this, "" + this.warning_alert + " Instability: " + stability + "%"); this.lastwarning = Game13.timeofday - 150; } else { this.radio.talk_into(this, "" + this.safe_alert); this.lastwarning = Game13.timeofday; } } if (this.damage > this.explosion_point) { foreach (dynamic _a in Lang13.Enumerate(GlobalVars.living_mob_list, typeof(Mob_Living))) { mob = _a; if (mob is Mob_Living_Carbon_Human) { H = mob; H.hallucination += Num13.MaxInt(50, Num13.MinInt(300, ((int)(Math.Sqrt(1 / (Map13.GetDistance(mob, this) + 1)) * 600)))); } rads = Math.Sqrt(1 / (Map13.GetDistance(mob, this) + 1)) * 200; mob.rad_act(rads); } this.explode(); } } env = L.return_air(); removed = env.remove(this.gasefficency * env.total_moles()); if (!(removed != null) || !(removed.total_moles() != 0)) { this.damage += Num13.MaxInt(((int)((this.power - 1600) / 10)), 0); this.power = Num13.MinInt(((int)(this.power)), 1600); return(1); } this.damage_archived = this.damage; this.damage = Num13.MaxInt(((int)(this.damage + Convert.ToDouble((removed.temperature - 800) / 150))), 0); removed_nitrogen = false; if (Lang13.Bool(removed.gases["n2"])) { removed_nitrogen = Lang13.Bool(removed.gases["n2"][1] * 2); } removed.assert_gases("o2", "plasma"); this.oxygen = Num13.MaxInt(Num13.MinInt(Convert.ToInt32((removed.gases["o2"][1] - removed_nitrogen) / 103.98379516601562), 1), 0); temp_factor = 50; if (this.oxygen > 0.8) { this.icon_state = "" + this.base_icon_state + "_glow"; } else { temp_factor = 30; this.icon_state = this.base_icon_state; } this.power = Num13.MaxInt(Convert.ToInt32(removed.temperature * temp_factor / 273.41 * this.oxygen + this.power), 0); this.transfer_energy(); device_energy = this.power * 0.55; removed.temperature += device_energy / 5; removed.temperature = Num13.MaxInt(0, Num13.MinInt(Convert.ToInt32(removed.temperature), 2500)); removed.gases["plasma"][1] += Num13.MaxInt(((int)(device_energy / 750)), 0); removed.gases["o2"][1] += Num13.MaxInt(((int)((device_energy + Convert.ToDouble(removed.temperature) - 273.41) / 325)), 0); env.merge(removed); foreach (dynamic _b in Lang13.Enumerate(Map13.FetchInView(Num13.MinInt(7, Num13.Floor(Math.Pow(this.power, 0.25))), this), typeof(Mob_Living_Carbon_Human))) { l = _b; if (!(l.glasses is Obj_Item_Clothing_Glasses_Meson)) { l.hallucination = Num13.MaxInt(0, Num13.MinInt(200, ((int)(l.hallucination + this.power * this.config_hallucination_power * Math.Sqrt(1 / Num13.MaxInt(1, Map13.GetDistance(l, this))))))); } } foreach (dynamic _c in Lang13.Enumerate(Map13.FetchInRange(Num13.Floor(Math.Pow(this.power / 100, 0.25)), this), typeof(Mob_Living))) { l2 = _c; rads2 = this.power / 10 * Math.Sqrt(1 / Num13.MaxInt(Map13.GetDistance(l2, this), 1)); l2.rad_act(rads2); } this.power -= Math.Pow(this.power / 500, 3); return(1); }
// Function from file: cart.dm public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null) { Ent_Static pda = null; Obj_Item_Radio_Integrated_Signal S = null; Obj_Item_Radio_Integrated_Signal S2 = null; double new_frequency = 0; Obj_Item_Radio_Integrated_Signal S3 = null; double?pnum = null; string pda_owner_name = null; string message = null; Newscaster_FeedChannel current = null; Newscaster_FeedChannel chan = null; base.Topic(href, href_list, (object)(hsrc)); if (!Task13.User.canmove || Task13.User.stat != 0 || Task13.User.restrained() || !(Map13.GetDistance(this.loc, Task13.User) <= 1)) { Task13.User.unset_machine(); Interface13.Browse(Task13.User, null, "window=pda"); return(null); } pda = this.loc; dynamic _c = href_list["choice"]; // Was a switch-case, sorry for the mess. if (_c == "Medical Records") { this.active1 = GlobalFuncs.find_record("id", href_list["target"], GlobalVars.data_core.general); if (this.active1 != null) { this.active2 = GlobalFuncs.find_record("id", href_list["target"], GlobalVars.data_core.medical); } ((dynamic)pda).mode = 441; this.mode = 441; if (!(this.active2 != null)) { this.active1 = null; } } else if (_c == "Security Records") { this.active1 = GlobalFuncs.find_record("id", href_list["target"], GlobalVars.data_core.general); if (this.active1 != null) { this.active3 = GlobalFuncs.find_record("id", href_list["target"], GlobalVars.data_core.security); } ((dynamic)pda).mode = 451; this.mode = 451; if (!(this.active3 != null)) { this.active1 = null; } } else if (_c == "Send Signal") { Task13.Schedule(0, (Task13.Closure)(() => { S = this.radio; S.send_signal("ACTIVATE"); return; return; })); } else if (_c == "Signal Frequency") { S2 = this.radio; new_frequency = GlobalFuncs.sanitize_frequency(S2.frequency + (String13.ParseNumber(href_list["sfreq"]) ?? 0)); S2.set_frequency(new_frequency); } else if (_c == "Signal Code") { S3 = this.radio; S3.code += String13.ParseNumber(href_list["scode"]) ?? 0; S3.code = Num13.Floor(S3.code); S3.code = Num13.MinInt(100, ((int)(S3.code))); S3.code = Num13.MaxInt(1, ((int)(S3.code))); } else if (_c == "Status") { dynamic _a = href_list["statdisp"]; // Was a switch-case, sorry for the mess. if (_a == "message") { this.post_status("message", this.message1, this.message2); } else if (_a == "alert") { this.post_status("alert", href_list["alert"]); } else if (_a == "setmsg1") { this.message1 = GlobalFuncs.reject_bad_text(Interface13.Input("Line 1", "Enter Message Text", this.message1, null, null, InputType.Str | InputType.Null), 40); this.updateSelfDialog(); } else if (_a == "setmsg2") { this.message2 = GlobalFuncs.reject_bad_text(Interface13.Input("Line 2", "Enter Message Text", this.message2, null, null, InputType.Str | InputType.Null), 40); this.updateSelfDialog(); } else { this.post_status(href_list["statdisp"]); } } else if (_c == "Power Select") { pnum = String13.ParseNumber(href_list["target"]); this.powmonitor = this.powermonitors[pnum]; ((dynamic)pda).mode = 433; this.mode = 433; } else if (_c == "Supply Orders") { ((dynamic)pda).mode = 47; this.mode = 47; } else if (_c == "Newscaster Access") { this.mode = 53; } else if (_c == "Newscaster Message") { pda_owner_name = (Lang13.Bool(((dynamic)pda).id) ? "" + ((dynamic)pda).id.registered_name + " (" + ((dynamic)pda).id.assignment + ")" : "Unknown"); message = ((Obj_Item_Device_Pda)pda).msg_input(); current = null; foreach (dynamic _b in Lang13.Enumerate(GlobalVars.news_network.network_channels, typeof(Newscaster_FeedChannel))) { chan = _b; if (chan.channel_name == this.current_channel) { current = chan; } } if (current.locked && current.author != pda_owner_name) { ((dynamic)pda).cart += "<h5> ERROR : NOT AUTHORIZED " + (Lang13.Bool(((dynamic)pda).id) ? "" : "- ID SLOT EMPTY") + " </h5>"; pda.Topic(null, new ByTable().Set("choice", "Refresh")); return(null); } GlobalVars.news_network.SubmitArticle(message, ((dynamic)pda).owner, this.current_channel); pda.Topic(null, new ByTable().Set("choice", String13.NumberToString(this.mode))); return(null); } else if (_c == "Newscaster Switch Channel") { this.current_channel = ((Obj_Item_Device_Pda)pda).msg_input(); pda.Topic(null, new ByTable().Set("choice", String13.NumberToString(this.mode))); return(null); } if (Lang13.Bool(href_list["op"])) { dynamic _d = href_list["op"]; // Was a switch-case, sorry for the mess. if (_d == "control") { this.active_bot = Lang13.FindObj(href_list["bot"]); } else if (_d == "botlist") { this.active_bot = null; } else if (_d == "summon") { ((Mob_Living_SimpleAnimal_Bot)this.active_bot).bot_control("summon", null, GlobalFuncs.get_turf(Task13.User), ((dynamic)pda).GetAccess()); } else { ((Mob_Living_SimpleAnimal_Bot)this.active_bot).bot_control(href_list["op"], Task13.User); } } if (Lang13.Bool(href_list["mule"])) { ((Mob_Living_SimpleAnimal_Bot)this.active_bot).bot_control(href_list["mule"], Task13.User); } this.generate_menu(Task13.User); this.print_to_host(this.menu); return(null); }
// Function from file: cart.dm public void generate_menu(Mob user = null) { Obj_Item_Radio_Integrated_Signal S = null; Data_Record t = null; int powercount = 0; Obj_Machinery_Computer_Monitor pMon = null; int count = 0; Obj_Machinery_Computer_Monitor pMon2 = null; ByTable L = null; Obj_Machinery_Power_Terminal term = null; Obj_Machinery_Power A = null; ByTable S2 = null; ByTable chg = null; Obj_Machinery_Power_Apc A2 = null; Data_Record R = null; Data_Record R2 = null; Data_Crime c = null; Data_Crime c2 = null; dynamic S3 = null; dynamic SO = null; dynamic S4 = null; dynamic SO2 = null; dynamic cl = null; dynamic ldat = null; Obj_Item_Weapon_Mop M = null; dynamic ml = null; double?direction = null; Obj_Structure_Janitorialcart B = null; dynamic bl = null; double? direction2 = null; Mob_Living_SimpleAnimal_Bot_Cleanbot B2 = null; dynamic bl2 = null; double? direction3 = null; Newscaster_FeedChannel current = null; Newscaster_FeedChannel chan = null; int i = 0; Newscaster_FeedMessage msg = null; Newscaster_FeedComment comment = null; switch ((int)(this.mode)) { case 40: S = this.radio; this.menu = "<h4><img src=pda_signaler.png> Remote Signaling System</h4>"; this.menu += new Txt("\n<a href='byond://?src=").Ref(this).str(";choice=Send Signal'>Send Signal</A><BR>\nFrequency:\n<a href='byond://?src=").Ref(this).str(";choice=Signal Frequency;sfreq=-10'>-</a>\n<a href='byond://?src=").Ref(this).str(";choice=Signal Frequency;sfreq=-2'>-</a>\n").item(GlobalFuncs.format_frequency(S.frequency)).str("\n<a href='byond://?src=").Ref(this).str(";choice=Signal Frequency;sfreq=2'>+</a>\n<a href='byond://?src=").Ref(this).str(";choice=Signal Frequency;sfreq=10'>+</a><br>\n<br>\nCode:\n<a href='byond://?src=").Ref(this).str(";choice=Signal Code;scode=-5'>-</a>\n<a href='byond://?src=").Ref(this).str(";choice=Signal Code;scode=-1'>-</a>\n").item(S.code).str("\n<a href='byond://?src=").Ref(this).str(";choice=Signal Code;scode=1'>+</a>\n<a href='byond://?src=").Ref(this).str(";choice=Signal Code;scode=5'>+</a><br>").ToString(); break; case 41: this.menu = "<h4><img src=pda_notes.png> Crew Manifest</h4>"; this.menu += "Entries cannot be modified from this terminal.<br><br>"; if (GlobalVars.data_core.general != null) { foreach (dynamic _a in Lang13.Enumerate(GlobalFuncs.sortRecord(GlobalVars.data_core.general), typeof(Data_Record))) { t = _a; this.menu += "" + t.fields["name"] + " - " + t.fields["rank"] + "<br>"; } } this.menu += "<br>"; break; case 42: this.menu = "<h4><img src=pda_status.png> Station Status Display Interlink</h4>"; this.menu += new Txt("[ <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=blank'>Clear</A> ]<BR>").ToString(); this.menu += new Txt("[ <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=shuttle'>Shuttle ETA</A> ]<BR>").ToString(); this.menu += new Txt("[ <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=message'>Message</A> ]").ToString(); this.menu += new Txt("<ul><li> Line 1: <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=setmsg1'>").item((Lang13.Bool(this.message1) ? this.message1 : ((dynamic)("(none)")))).str("</A>").ToString(); this.menu += new Txt("<li> Line 2: <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=setmsg2'>").item((Lang13.Bool(this.message2) ? this.message2 : ((dynamic)("(none)")))).str("</A></ul><br>").ToString(); this.menu += new Txt("[ Alert: <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=alert;alert=default'>None</A> |").ToString(); this.menu += new Txt(" <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=alert;alert=redalert'>Red Alert</A> |").ToString(); this.menu += new Txt(" <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=alert;alert=lockdown'>Lockdown</A> |").ToString(); this.menu += new Txt(" <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=alert;alert=biohazard'>Biohazard</A> ]<BR>").ToString(); break; case 43: this.menu = "<h4><img src=pda_power.png> Power Monitors - Please select one</h4><BR>"; this.powmonitor = null; this.powermonitors = new ByTable(); powercount = 0; foreach (dynamic _b in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_Computer_Monitor))) { pMon = _b; if (!((pMon.stat & 3) != 0)) { powercount++; this.powermonitors.Add(pMon); } } if (!(powercount != 0)) { this.menu += "<span class='danger'>No connection<BR></span>"; } else { this.menu += "<FONT SIZE=-1>"; count = 0; foreach (dynamic _c in Lang13.Enumerate(this.powermonitors, typeof(Obj_Machinery_Computer_Monitor))) { pMon2 = _c; count++; this.menu += new Txt("<a href='byond://?src=").Ref(this).str(";choice=Power Select;target=").item(count).str("'>").item(pMon2).str(" </a><BR>").ToString(); } this.menu += "</FONT>"; } break; case 433: this.menu = "<h4><img src=pda_power.png> Power Monitor </h4><BR>"; if (!Lang13.Bool(this.powmonitor)) { this.menu += "<span class='danger'>No connection<BR></span>"; } else { L = new ByTable(); foreach (dynamic _d in Lang13.Enumerate(this.powmonitor.attached.powernet.nodes, typeof(Obj_Machinery_Power_Terminal))) { term = _d; if (term.master is Obj_Machinery_Power_Apc) { A = term.master; L.Add(A); } } this.menu += "<PRE>Total power: " + this.powmonitor.attached.powernet.viewavail + " W<BR>Total load: " + String13.NumberToString(this.powmonitor.attached.powernet.viewload, 10) + " W<BR>"; this.menu += "<FONT SIZE=-1>"; if (L.len > 0) { this.menu += "Area Eqp./Lgt./Env. Load Cell<HR>"; S2 = new ByTable(new object [] { " Off", "AOff", " On", " AOn" }); chg = new ByTable(new object [] { "N", "C", "F" }); foreach (dynamic _e in Lang13.Enumerate(L, typeof(Obj_Machinery_Power_Apc))) { A2 = _e; this.menu += String13.SubStr(GlobalFuncs.add_tspace(A2.area.name, 30), 1, 30); this.menu += " " + S2[(A2.equipment ?? 0) + 1] + " " + S2[(A2.lighting ?? 0) + 1] + " " + S2[(A2.environ ?? 0) + 1] + " " + GlobalFuncs.add_lspace(A2.lastused_total, 6) + " " + (Lang13.Bool(A2.cell) ? "" + GlobalFuncs.add_lspace(Num13.Floor(((Obj_Item_Weapon_StockParts_Cell)A2.cell).percent()), 3) + "% " + chg[A2.charging + 1] : " N/C") + "<BR>"; } } this.menu += "</FONT></PRE>"; } break; case 44: this.menu = "<h4><img src=pda_medical.png> Medical Record List</h4>"; if (GlobalVars.data_core.general != null) { foreach (dynamic _f in Lang13.Enumerate(GlobalFuncs.sortRecord(GlobalVars.data_core.general), typeof(Data_Record))) { R = _f; this.menu += new Txt("<a href='byond://?src=").Ref(this).str(";choice=Medical Records;target=").item(R.fields["id"]).str("'>").item(R.fields["id"]).str(": ").item(R.fields["name"]).str("<br>").ToString(); } } this.menu += "<br>"; break; case 441: this.menu = "<h4><img src=pda_medical.png> Medical Record</h4>"; if (GlobalVars.data_core.general.Contains(this.active1)) { this.menu += "Name: " + this.active1.fields["name"] + " ID: " + this.active1.fields["id"] + "<br>"; this.menu += "Sex: " + this.active1.fields["sex"] + "<br>"; this.menu += "Age: " + this.active1.fields["age"] + "<br>"; this.menu += "Rank: " + this.active1.fields["rank"] + "<br>"; this.menu += "Fingerprint: " + this.active1.fields["fingerprint"] + "<br>"; this.menu += "Physical Status: " + this.active1.fields["p_stat"] + "<br>"; this.menu += "Mental Status: " + this.active1.fields["m_stat"] + "<br>"; } else { this.menu += "<b>Record Lost!</b><br>"; } this.menu += "<br>"; this.menu += "<h4><img src=pda_medical.png> Medical Data</h4>"; if (GlobalVars.data_core.medical.Contains(this.active2)) { this.menu += "Blood Type: " + this.active2.fields["blood_type"] + "<br><br>"; this.menu += "Minor Disabilities: " + this.active2.fields["mi_dis"] + "<br>"; this.menu += "Details: " + this.active2.fields["mi_dis_d"] + "<br><br>"; this.menu += "Major Disabilities: " + this.active2.fields["ma_dis"] + "<br>"; this.menu += "Details: " + this.active2.fields["ma_dis_d"] + "<br><br>"; this.menu += "Allergies: " + this.active2.fields["alg"] + "<br>"; this.menu += "Details: " + this.active2.fields["alg_d"] + "<br><br>"; this.menu += "Current Diseases: " + this.active2.fields["cdi"] + "<br>"; this.menu += "Details: " + this.active2.fields["cdi_d"] + "<br><br>"; this.menu += "Important Notes: " + this.active2.fields["notes"] + "<br>"; } else { this.menu += "<b>Record Lost!</b><br>"; } this.menu += "<br>"; break; case 45: this.menu = "<h4><img src=pda_cuffs.png> Security Record List</h4>"; if (GlobalVars.data_core.general != null) { foreach (dynamic _g in Lang13.Enumerate(GlobalFuncs.sortRecord(GlobalVars.data_core.general), typeof(Data_Record))) { R2 = _g; this.menu += new Txt("<a href='byond://?src=").Ref(this).str(";choice=Security Records;target=").item(R2.fields["id"]).str("'>").item(R2.fields["id"]).str(": ").item(R2.fields["name"]).str("<br>").ToString(); } } this.menu += "<br>"; break; case 451: this.menu = "<h4><img src=pda_cuffs.png> Security Record</h4>"; if (GlobalVars.data_core.general.Contains(this.active1)) { this.menu += "Name: " + this.active1.fields["name"] + " ID: " + this.active1.fields["id"] + "<br>"; this.menu += "Sex: " + this.active1.fields["sex"] + "<br>"; this.menu += "Age: " + this.active1.fields["age"] + "<br>"; this.menu += "Rank: " + this.active1.fields["rank"] + "<br>"; this.menu += "Fingerprint: " + this.active1.fields["fingerprint"] + "<br>"; this.menu += "Physical Status: " + this.active1.fields["p_stat"] + "<br>"; this.menu += "Mental Status: " + this.active1.fields["m_stat"] + "<br>"; } else { this.menu += "<b>Record Lost!</b><br>"; } this.menu += "<br>"; this.menu += "<h4><img src=pda_cuffs.png> Security Data</h4>"; if (GlobalVars.data_core.security.Contains(this.active3)) { this.menu += "Criminal Status: " + this.active3.fields["criminal"] + "<br>"; this.menu += "<BR>\nMinor Crimes:"; this.menu += @"<table style=""text-align:center;"" border=""1"" cellspacing=""0"" width=""100%""> <tr> <th>Crime</th> <th>Details</th> <th>Author</th> <th>Time Added</th> </tr>"; foreach (dynamic _h in Lang13.Enumerate(this.active3.fields["mi_crim"], typeof(Data_Crime))) { c = _h; this.menu += "<tr><td>" + c.crimeName + "</td>"; this.menu += "<td>" + c.crimeDetails + "</td>"; this.menu += "<td>" + c.author + "</td>"; this.menu += "<td>" + c.time + "</td>"; this.menu += "</tr>"; } this.menu += "</table>"; this.menu += "<BR>\nMajor Crimes:"; this.menu += @"<table style=""text-align:center;"" border=""1"" cellspacing=""0"" width=""100%""> <tr> <th>Crime</th> <th>Details</th> <th>Author</th> <th>Time Added</th> </tr>"; foreach (dynamic _i in Lang13.Enumerate(this.active3.fields["ma_crim"], typeof(Data_Crime))) { c2 = _i; this.menu += "<tr><td>" + c2.crimeName + "</td>"; this.menu += "<td>" + c2.crimeDetails + "</td>"; this.menu += "<td>" + c2.author + "</td>"; this.menu += "<td>" + c2.time + "</td>"; this.menu += "</tr>"; } this.menu += "</table>"; this.menu += "<BR>\nImportant Notes:<br>"; this.menu += "" + this.active3.fields["notes"]; } else { this.menu += "<b>Record Lost!</b><br>"; } this.menu += "<br>"; break; case 47: this.menu = "<h4><img src=pda_crate.png> Supply Record Interlink</h4>"; this.menu += "<BR><B>Supply shuttle</B><BR>"; this.menu += "Location: "; switch ((int)(GlobalVars.SSshuttle.supply.mode)) { case 2: this.menu += "Moving to "; if (GlobalVars.SSshuttle.supply.z != 1) { this.menu += "station"; } else { this.menu += "centcomm"; } this.menu += " (" + GlobalVars.SSshuttle.supply.timeLeft(600) + " Mins)"; break; default: this.menu += "At "; if (GlobalVars.SSshuttle.supply.z != 1) { this.menu += "centcomm"; } else { this.menu += "station"; } break; } this.menu += "<BR>Current approved orders: <BR><ol>"; foreach (dynamic _k in Lang13.Enumerate(GlobalVars.SSshuttle.shoppinglist)) { S3 = _k; SO = S3; this.menu += "<li>#" + SO.id + " - " + SO.pack.name + " approved by " + SO.orderer + " " + (Lang13.Bool(SO.reason) ? "(" + SO.reason + ")" : "") + "</li>"; } this.menu += "</ol>"; this.menu += "Current requests: <BR><ol>"; foreach (dynamic _l in Lang13.Enumerate(GlobalVars.SSshuttle.requestlist)) { S4 = _l; SO2 = S4; this.menu += "<li>#" + SO2.id + " - " + SO2.pack.name + " requested by " + SO2.orderer + "</li>"; } this.menu += "</ol><font size=\"-3\">Upgrade NOW to Space Parts & Space Vendors PLUS for full remote order control and inventory management."; break; case 49: this.menu = "<h4><img src=pda_bucket.png> Persistent Custodial Object Locator</h4>"; cl = GlobalFuncs.get_turf(this); if (Lang13.Bool(cl)) { this.menu += "Current Orbital Location: <b>[" + cl.x + "," + cl.y + "]</b>"; this.menu += "<h4>Located Mops:</h4>"; ldat = null; foreach (dynamic _m in Lang13.Enumerate(typeof(Game13), typeof(Obj_Item_Weapon_Mop))) { M = _m; ml = GlobalFuncs.get_turf(M); if (Lang13.Bool(ml)) { if (ml.z != cl.z) { continue; } direction = Map13.GetDistance(this, M); ldat += "Mop - <b>[" + ml.x + "," + ml.y + " (" + String13.ToUpper(GlobalFuncs.dir2text(direction)) + ")]</b> - " + (Lang13.Bool(M.reagents.total_volume) ? "Wet" : "Dry") + "<br>"; } } if (!Lang13.Bool(ldat)) { this.menu += "None"; } else { this.menu += "" + ldat; } this.menu += "<h4>Located Janitorial Cart:</h4>"; ldat = null; foreach (dynamic _n in Lang13.Enumerate(typeof(Game13), typeof(Obj_Structure_Janitorialcart))) { B = _n; bl = GlobalFuncs.get_turf(B); if (Lang13.Bool(bl)) { if (bl.z != cl.z) { continue; } direction2 = Map13.GetDistance(this, B); ldat += "Cart - <b>[" + bl.x + "," + bl.y + " (" + String13.ToUpper(GlobalFuncs.dir2text(direction2)) + ")]</b> - Water level: " + B.reagents.total_volume + "/100<br>"; } } if (!Lang13.Bool(ldat)) { this.menu += "None"; } else { this.menu += "" + ldat; } this.menu += "<h4>Located Cleanbots:</h4>"; ldat = null; foreach (dynamic _o in Lang13.Enumerate(GlobalVars.living_mob_list, typeof(Mob_Living_SimpleAnimal_Bot_Cleanbot))) { B2 = _o; bl2 = GlobalFuncs.get_turf(B2); if (Lang13.Bool(bl2)) { if (bl2.z != cl.z) { continue; } direction3 = Map13.GetDistance(this, B2); ldat += "Cleanbot - <b>[" + bl2.x + "," + bl2.y + " (" + String13.ToUpper(GlobalFuncs.dir2text(direction3)) + ")]</b> - " + (Lang13.Bool(B2.on) ? "Online" : "Offline") + "<br>"; } } if (!Lang13.Bool(ldat)) { this.menu += "None"; } else { this.menu += "" + ldat; } } else { this.menu += "ERROR: Unable to determine current location."; } this.menu += new Txt("<br><br><A href='byond://?src=").Ref(this).str(";choice=49'>Refresh GPS Locator</a>").ToString(); break; case 53: this.menu = "<h4><img src=pda_notes.png> Newscaster Access</h4>"; this.menu += new Txt("<br> Current Newsfeed: <A href='byond://?src=").Ref(this).str(";choice=Newscaster Switch Channel'>").item((Lang13.Bool(this.current_channel) ? this.current_channel : "None")).str("</a> <br>").ToString(); current = null; foreach (dynamic _p in Lang13.Enumerate(GlobalVars.news_network.network_channels, typeof(Newscaster_FeedChannel))) { chan = _p; if (chan.channel_name == this.current_channel) { current = chan; } } if (!(current != null)) { this.menu += "<h5> ERROR : NO CHANNEL FOUND </h5>"; return; } i = 1; foreach (dynamic _r in Lang13.Enumerate(current.messages, typeof(Newscaster_FeedMessage))) { msg = _r; this.menu += "-" + msg.returnBody(-1) + " <BR><FONT SIZE=1>[Story by <FONT COLOR='maroon'>" + msg.returnAuthor(-1) + "</FONT>]</FONT><BR>"; this.menu += "<b><font size=1>" + msg.comments.len + " comment" + (msg.comments.len > 1 ? "s" : "") + "</font></b><br>"; if (msg.img != null) { Interface13.CacheBrowseResource(user, msg.img, "tmp_photo" + i + ".png"); this.menu += "<img src='tmp_photo" + i + ".png' width = '180'><BR>"; } i++; foreach (dynamic _q in Lang13.Enumerate(msg.comments, typeof(Newscaster_FeedComment))) { comment = _q; this.menu += "<font size=1><small>" + comment.body + "</font><br><font size=1><small><small><small>" + comment.author + " " + comment.time_stamp + "</small></small></small></small></font><br>"; } } this.menu += new Txt("<br> <A href='byond://?src=").Ref(this).str(";choice=Newscaster Message'>Post Message</a>").ToString(); break; case 54: this.menu = "<h4><img src=pda_medbot.png> Bots Interlink</h4>"; this.bot_control(); break; } return; }
public override bool f_action(dynamic target = null) { Obj_Item_Weapon_ReagentContainers_Syringe S = null; dynamic trg = null; Ent_Dynamic mechsyringe = null; Ent_Static originaloccupant = null; int? i = null; ByTable mobs = null; Mob_Living_Carbon M = null; dynamic M2 = null; dynamic R = null; Reagent A = null; if (!this.action_checks(target)) { return(false); } if (target is Obj_Item_Weapon_ReagentContainers_Syringe) { return(this.load_syringe(target)); } if (target is Obj_Item_Weapon_Storage) { foreach (dynamic _a in Lang13.Enumerate(target.contents, typeof(Obj_Item_Weapon_ReagentContainers_Syringe))) { S = _a; this.load_syringe(S); } return(false); } if (this.mode) { return(this.analyze_reagents(target)); } if (!(this.syringes.len != 0)) { this.occupant_message("<span class=\"alert\">No syringes loaded.</span>"); return(false); } if ((this.reagents.total_volume ?? 0) <= 0) { this.occupant_message("<span class=\"alert\">No available reagents to load syringe with.</span>"); return(false); } trg = GlobalFuncs.get_turf(target); mechsyringe = this.syringes[1]; mechsyringe.forceMove(GlobalFuncs.get_turf(this.chassis)); this.reagents.trans_to(mechsyringe, Num13.MinInt(Convert.ToInt32(((dynamic)mechsyringe).volume), ((int)(this.reagents.total_volume ?? 0)))); this.syringes.Remove(mechsyringe); mechsyringe.icon = "icons/obj/chemical.dmi"; mechsyringe.icon_state = "syringeproj"; GlobalFuncs.playsound(this.chassis, "sound/items/syringeproj.ogg", 50, 1); this.log_message("Launched " + mechsyringe + " from " + this + ", targeting " + target + "."); originaloccupant = this.chassis.occupant; Task13.Schedule(0, (Task13.Closure)(() => { Task13.Source = null; i = null; i = 0; while ((i ?? 0) < 6) { if (!(mechsyringe != null)) { break; } Map13.StepTowardsSimple(mechsyringe, trg); if (!(mechsyringe != null)) { mobs = new ByTable(); foreach (dynamic _b in Lang13.Enumerate(mechsyringe.loc, typeof(Mob_Living_Carbon))) { M = _b; mobs.Add(M); } M2 = GlobalFuncs.safepick(mobs); if (Lang13.Bool(M2)) { R = null; mechsyringe.visible_message("<span class=\"attack\"> " + M2 + " was hit by the syringe!</span>"); if (((Mob_Living)M2).can_inject(null, true)) { if (mechsyringe.reagents != null) { foreach (dynamic _c in Lang13.Enumerate(mechsyringe.reagents.reagent_list, typeof(Reagent))) { A = _c; R += A.id + " ("; R += String13.NumberToString(A.volume) + "),"; } } mechsyringe.icon_state = Lang13.Initial(mechsyringe, "icon_state"); mechsyringe.icon = Lang13.Initial(mechsyringe, "icon"); mechsyringe.reagents.trans_to(M2, mechsyringe.reagents.total_volume); ((Mob_Living)M2).take_organ_damage(2); GlobalFuncs.add_logs(originaloccupant, M2, "shot", "syringegun"); } break; } else if (mechsyringe.loc == trg) { mechsyringe.icon_state = Lang13.Initial(mechsyringe, "icon_state"); mechsyringe.icon = Lang13.Initial(mechsyringe, "icon"); ((dynamic)mechsyringe).update_icon(); break; } } else { mechsyringe.icon_state = Lang13.Initial(mechsyringe, "icon_state"); mechsyringe.icon = Lang13.Initial(mechsyringe, "icon"); ((dynamic)mechsyringe).update_icon(); break; } Task13.Sleep(1); i++; } return; })); return(true); }
// Function from file: reagentgrinder.dm public override bool update_icon( dynamic new_state = null, dynamic new_icon = null, int? new_px = null, int? new_py = null ) { this.icon_state = "juicer" + String13.NumberToString( !( this.beaker == null ) ?1:0 ); return false; }
// Function from file: communications.dm public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null) { string dat = null; double timeleft = 0; Browser popup = null; string dat2 = null; int? i = null; if (Lang13.Bool(base.attack_hand((object)(a), b, c))) { return(null); } if (this.z > 6) { a.WriteMsg("<span class='boldannounce'>Unable to establish a connection</span>: ÿ\"You're too far away from the station!"); return(null); } ((Mob)a).set_machine(this); dat = ""; if (GlobalVars.SSshuttle.emergency.mode == 2) { timeleft = GlobalVars.SSshuttle.emergency.timeLeft(); dat += "<B>Emergency shuttle</B>\n<BR>\nETA: " + timeleft / 60 % 60 + ":" + GlobalFuncs.add_zero(String13.NumberToString(timeleft % 60), 2); } popup = new Browser(a, "communications", "Communications Console", 400, 500); popup.set_title_image(((Mob)a).browse_rsc_icon(this.icon, this.icon_state)); if (a is Mob_Living_Silicon) { dat2 = this.interact_ai(a); if (Lang13.Bool(dat2)) { dat += dat2; popup.set_content(dat); popup.open(); } return(null); } switch ((int)(this.state)) { case 1: if (this.authenticated != 0) { if (Lang13.Bool(GlobalVars.SSshuttle.emergencyLastCallLoc)) { dat += "<BR>Most recent shuttle call/recall traced to: <b>" + GlobalFuncs.format_text(GlobalVars.SSshuttle.emergencyLastCallLoc.name) + "</b>"; } else { dat += "<BR>Unable to trace most recent shuttle call/recall signal."; } dat += "<BR>Logged in as: " + this.auth_id; dat += "<BR>"; dat += new Txt("<BR>[ <A HREF='?src=").Ref(this).str(";operation=logout'>Log Out</A> ]<BR>").ToString(); dat += "<BR><B>General Functions</B>"; dat += new Txt("<BR>[ <A HREF='?src=").Ref(this).str(";operation=messagelist'>Message List</A> ]").ToString(); switch ((int)(GlobalVars.SSshuttle.emergency.mode)) { case 0: case 1: dat += new Txt("<BR>[ <A HREF='?src=").Ref(this).str(";operation=callshuttle'>Call Emergency Shuttle</A> ]").ToString(); break; default: dat += new Txt("<BR>[ <A HREF='?src=").Ref(this).str(";operation=cancelshuttle'>Cancel Shuttle Call</A> ]").ToString(); break; } dat += new Txt("<BR>[ <A HREF='?src=").Ref(this).str(";operation=status'>Set Status Display</A> ]").ToString(); if (this.authenticated == 2) { dat += "<BR><BR><B>Captain Functions</B>"; dat += new Txt("<BR>[ <A HREF='?src=").Ref(this).str(";operation=announce'>Make a Captain's Announcement</A> ]").ToString(); dat += new Txt("<BR>[ <A HREF='?src=").Ref(this).str(";operation=changeseclevel'>Change Alert Level</A> ]").ToString(); dat += new Txt("<BR>[ <A HREF='?src=").Ref(this).str(";operation=emergencyaccess'>Emergency Maintenance Access</A> ]").ToString(); dat += new Txt("<BR>[ <A HREF='?src=").Ref(this).str(";operation=nukerequest'>Request Nuclear Authentication Codes</A> ]").ToString(); if (this.emagged == 0) { dat += new Txt("<BR>[ <A HREF='?src=").Ref(this).str(";operation=MessageCentcomm'>Send Message to Centcom</A> ]").ToString(); } else { dat += new Txt("<BR>[ <A HREF='?src=").Ref(this).str(";operation=MessageSyndicate'>Send Message to [UNKNOWN]</A> ]").ToString(); dat += new Txt("<BR>[ <A HREF='?src=").Ref(this).str(";operation=RestoreBackup'>Restore Backup Routing Data</A> ]").ToString(); } } } else { dat += new Txt("<BR>[ <A HREF='?src=").Ref(this).str(";operation=login'>Log In</A> ]").ToString(); } break; case 2: dat += this.get_call_shuttle_form(); break; case 3: dat += this.get_cancel_shuttle_form(); break; case 4: dat += "Messages:"; i = null; i = 1; while ((i ?? 0) <= this.messagetitle.len) { dat += new Txt("<BR><A HREF='?src=").Ref(this).str(";operation=viewmessage;message-num=").item(i).str("'>").item(this.messagetitle[i]).str("</A>").ToString(); i++; } break; case 5: if (Lang13.Bool(this.currmsg)) { dat += "<B>" + this.messagetitle[this.currmsg] + "</B><BR><BR>" + this.messagetext[this.currmsg]; if (this.authenticated != 0) { dat += new Txt("<BR><BR>[ <A HREF='?src=").Ref(this).str(";operation=delmessage'>Delete ]").ToString(); } } else { this.state = GlobalVars.STATE_MESSAGELIST; this.attack_hand(a); return(null); } break; case 6: if (Lang13.Bool(this.currmsg)) { dat += new Txt("Are you sure you want to delete this message? [ <A HREF='?src=").Ref(this).str(";operation=delmessage2'>OK</A> | <A HREF='?src=").Ref(this).str(";operation=viewmessage'>Cancel</A> ]").ToString(); } else { this.state = GlobalVars.STATE_MESSAGELIST; this.attack_hand(a); return(null); } break; case 7: dat += "Set Status Displays<BR>"; dat += new Txt("[ <A HREF='?src=").Ref(this).str(";operation=setstat;statdisp=blank'>Clear</A> ]<BR>").ToString(); dat += new Txt("[ <A HREF='?src=").Ref(this).str(";operation=setstat;statdisp=shuttle'>Shuttle ETA</A> ]<BR>").ToString(); dat += new Txt("[ <A HREF='?src=").Ref(this).str(";operation=setstat;statdisp=message'>Message</A> ]").ToString(); dat += new Txt("<ul><li> Line 1: <A HREF='?src=").Ref(this).str(";operation=setmsg1'>").item((Lang13.Bool(this.stat_msg1) ? this.stat_msg1 : ((dynamic)("(none)")))).str("</A>").ToString(); dat += new Txt("<li> Line 2: <A HREF='?src=").Ref(this).str(";operation=setmsg2'>").item((Lang13.Bool(this.stat_msg2) ? this.stat_msg2 : ((dynamic)("(none)")))).str("</A></ul><br>").ToString(); dat += new Txt("[ Alert: <A HREF='?src=").Ref(this).str(";operation=setstat;statdisp=alert;alert=default'>None</A> |").ToString(); dat += new Txt(" <A HREF='?src=").Ref(this).str(";operation=setstat;statdisp=alert;alert=redalert'>Red Alert</A> |").ToString(); dat += new Txt(" <A HREF='?src=").Ref(this).str(";operation=setstat;statdisp=alert;alert=lockdown'>Lockdown</A> |").ToString(); dat += new Txt(" <A HREF='?src=").Ref(this).str(";operation=setstat;statdisp=alert;alert=biohazard'>Biohazard</A> ]<BR><HR>").ToString(); break; case 8: dat += "Current alert level: " + GlobalFuncs.get_security_level() + "<BR>"; if (GlobalVars.security_level == 3) { dat += "<font color='red'><b>The self-destruct mechanism is active. Find a way to deactivate the mechanism to lower the alert level or evacuate.</b></font>"; } else { dat += new Txt("<A HREF='?src=").Ref(this).str(";operation=securitylevel;newalertlevel=").item(1).str("'>Blue</A><BR>").ToString(); dat += new Txt("<A HREF='?src=").Ref(this).str(";operation=securitylevel;newalertlevel=").item(0).str("'>Green</A>").ToString(); } break; case 9: dat += "Current alert level: " + GlobalFuncs.get_security_level() + "<BR>"; dat += "Confirm the change to: " + GlobalFuncs.num2seclevel(this.tmp_alertlevel) + "<BR>"; dat += new Txt("<A HREF='?src=").Ref(this).str(";operation=swipeidseclevel'>Swipe ID</A> to confirm change.<BR>").ToString(); break; case 10: if (GlobalVars.emergency_access) { dat += "<b>Emergency Maintenance Access is currently <font color='red'>ENABLED</font></b>"; dat += new Txt("<BR>Restore maintenance access restrictions? <BR>[ <A HREF='?src=").Ref(this).str(";operation=disableemergency'>OK</A> | <A HREF='?src=").Ref(this).str(";operation=viewmessage'>Cancel</A> ]").ToString(); } else { dat += "<b>Emergency Maintenance Access is currently <font color='green'>DISABLED</font></b>"; dat += new Txt("<BR>Lift access restrictions on maintenance and external airlocks? <BR>[ <A HREF='?src=").Ref(this).str(";operation=enableemergency'>OK</A> | <A HREF='?src=").Ref(this).str(";operation=viewmessage'>Cancel</A> ]").ToString(); } break; } dat += new Txt("<BR><BR>[ ").item((this.state != (GlobalVars.STATE_DEFAULT ?1:0) ? new Txt("<A HREF='?src=").Ref(this).str(";operation=main'>Main Menu</A> | ").ToString() : "")).str("<A HREF='?src=").Ref(a).str(";mach_close=communications'>Close</A> ]").ToString(); popup.set_content(dat); popup.open(); return(null); }
// Function from file: dropper.dm public override bool afterattack(dynamic target = null, dynamic user = null, bool?proximity_flag = null, string click_parameters = null) { dynamic trans = null; double? fraction = null; dynamic victim = null; dynamic safe_thing = null; dynamic M = null; dynamic R = null; Reagent A = null; dynamic trans2 = null; if (!(proximity_flag == true)) { return(false); } if (!Lang13.Bool(target.reagents)) { return(false); } if ((this.reagents.total_volume ?? 0) > 0) { if ((target.reagents.total_volume ?? 0) >= Convert.ToDouble(target.reagents.maximum_volume)) { user.WriteMsg("<span class='notice'>" + target + " is full.</span>"); return(false); } if (!Lang13.Bool(((Ent_Static)target).is_open_container()) && !(target is Mob) && !(target is Obj_Item_Weapon_ReagentContainers_Food) && !(target is Obj_Item_Clothing_Mask_Cigarette)) { user.WriteMsg("<span class='warning'>You cannot directly fill " + target + "!</span>"); return(false); } trans = 0; fraction = Num13.MinInt(((int)((this.amount_per_transfer_from_this ?? 0) / (this.reagents.total_volume ?? 0))), 1); if (target is Mob) { if (target is Mob_Living_Carbon_Human) { victim = target; safe_thing = null; if (Lang13.Bool(victim.wear_mask)) { if (Lang13.Bool(victim.wear_mask.flags_cover & 2)) { safe_thing = victim.wear_mask; } } if (Lang13.Bool(victim.head)) { if (Lang13.Bool(victim.head.flags_cover & 2)) { safe_thing = victim.head; } } if (Lang13.Bool(victim.glasses)) { if (!Lang13.Bool(safe_thing)) { safe_thing = victim.glasses; } } if (Lang13.Bool(safe_thing)) { if (!Lang13.Bool(safe_thing.reagents)) { ((Ent_Static)safe_thing).create_reagents(100); } this.reagents.reaction(safe_thing, GlobalVars.TOUCH, fraction); trans = this.reagents.trans_to(safe_thing, this.amount_per_transfer_from_this); ((Ent_Static)target).visible_message("<span class='danger'>" + user + " tries to squirt something into " + target + "'s eyes, but fails!</span>", "<span class='userdanger'>" + user + " tries to squirt something into " + target + "'s eyes, but fails!</span>"); user.WriteMsg(new Txt("<span class='notice'>You transfer ").item(trans).str(" unit").s().str(" of the solution.</span>").ToString()); this.update_icon(); return(false); } } ((Ent_Static)target).visible_message("<span class='danger'>" + user + " squirts something into " + target + "'s eyes!</span>", "<span class='userdanger'>" + user + " squirts something into " + target + "'s eyes!</span>"); this.reagents.reaction(target, GlobalVars.TOUCH, fraction); M = target; if (this.reagents != null) { foreach (dynamic _a in Lang13.Enumerate(this.reagents.reagent_list, typeof(Reagent))) { A = _a; R += A.id + " ("; R += String13.NumberToString(A.volume) + "),"; } } GlobalFuncs.add_logs(user, M, "squirted", R); } trans = this.reagents.trans_to(target, this.amount_per_transfer_from_this); user.WriteMsg(new Txt("<span class='notice'>You transfer ").item(trans).str(" unit").s().str(" of the solution.</span>").ToString()); this.update_icon(); } else { if (!Lang13.Bool(((Ent_Static)target).is_open_container()) && !(target is Obj_Structure_ReagentDispensers)) { user.WriteMsg("<span class='notice'>You cannot directly remove reagents from " + target + ".</span>"); return(false); } if (!Lang13.Bool(target.reagents.total_volume)) { user.WriteMsg("<span class='warning'>" + target + " is empty!</span>"); return(false); } trans2 = ((Reagents)target.reagents).trans_to(this, this.amount_per_transfer_from_this); user.WriteMsg(new Txt("<span class='notice'>You fill ").item(this).str(" with ").item(trans2).str(" unit").s().str(" of the solution.</span>").ToString()); this.update_icon(); } return(false); }
// Function from file: machine_interactions.dm public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null) { dynamic P = null; string newid = null; string newnet = null; Obj_Machinery_Telecomms T = null; dynamic newfreq = null; double? x = null; Obj_Machinery_Telecomms T2 = null; Obj_Machinery_Telecomms T3 = null; if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc)))) { return(null); } if (!(Task13.User is Mob_Living_Silicon)) { if (!(Task13.User.get_active_hand() is Obj_Item_Device_Multitool)) { return(null); } } P = this.get_multitool(Task13.User); if (Lang13.Bool(href_list["input"])) { dynamic _b = href_list["input"]; // Was a switch-case, sorry for the mess. if (_b == "toggle") { this.toggled = !this.toggled; this.temp = "<font color = #666633>-% " + this + " has been " + (this.toggled ? "activated" : "deactivated") + ".</font color>"; this.update_power(); } else if (_b == "id") { newid = String13.SubStr(GlobalFuncs.reject_bad_text(Interface13.Input(Task13.User, "Specify the new ID for this machine", this, this.id, null, InputType.Str | InputType.Null)), 1, 1024); if (Lang13.Bool(newid) && this.canAccess(Task13.User)) { this.id = newid; this.temp = "<font color = #666633>-% New ID assigned: \"" + this.id + "\" %-</font color>"; } } else if (_b == "network") { newnet = GlobalFuncs.stripped_input(Task13.User, "Specify the new network for this machine. This will break all current links.", this, this.network); if (Lang13.Bool(newnet) && this.canAccess(Task13.User)) { if (Lang13.Length(newnet) > 15) { this.temp = "<font color = #666633>-% Too many characters in new network tag %-</font color>"; } else { foreach (dynamic _a in Lang13.Enumerate(this.links, typeof(Obj_Machinery_Telecomms))) { T = _a; T.links.Remove(this); } this.network = newnet; this.links = new ByTable(); this.temp = "<font color = #666633>-% New network tag assigned: \"" + this.network + "\" %-</font color>"; } } } else if (_b == "freq") { newfreq = Interface13.Input(Task13.User, "Specify a new frequency to filter (GHz). Decimals assigned automatically.", this, this.network, null, InputType.Num | InputType.Null); if (Lang13.Bool(newfreq) && this.canAccess(Task13.User)) { if (String13.FindIgnoreCase(String13.NumberToString(Convert.ToDouble(newfreq)), ".", 1, 0) != 0) { newfreq *= 10; } if (newfreq == GlobalVars.SYND_FREQ) { this.temp = "<font color = #FF0000>-% Error: Interference preventing filtering frequency: \"" + newfreq + " GHz\" %-</font color>"; } else if (!this.freq_listening.Contains(newfreq) && Convert.ToDouble(newfreq) < 10000) { this.freq_listening.Add(newfreq); this.temp = "<font color = #666633>-% New frequency filter assigned: \"" + newfreq + " GHz\" %-</font color>"; } } } } if (Lang13.Bool(href_list["delete"])) { x = String13.ParseNumber(href_list["delete"]); this.temp = "<font color = #666633>-% Removed frequency filter " + x + " %-</font color>"; this.freq_listening.Remove(x); } if (Lang13.Bool(href_list["unlink"])) { if ((String13.ParseNumber(href_list["unlink"]) ?? 0) <= Lang13.Length(this.links)) { T2 = this.links[String13.ParseNumber(href_list["unlink"])]; if (T2 != null) { this.temp = new Txt("<font color = #666633>-% Removed ").Ref(T2).str(" ").item(T2.name).str(" from linked entities. %-</font color>").ToString(); if (T2.links != null) { T2.links.Remove(this); } this.links.Remove(T2); } else { this.temp = "<font color = #666633>-% Unable to locate machine to unlink from, try again. %-</font color>"; } } } if (Lang13.Bool(href_list["link"])) { if (Lang13.Bool(P)) { T3 = P.buffer; if (T3 is Obj_Machinery_Telecomms && T3 != this) { if (!T3.links.Contains(this)) { T3.links.Add(this); } if (!this.links.Contains(T3)) { this.links.Add(T3); } this.temp = new Txt("<font color = #666633>-% Successfully linked with ").Ref(T3).str(" ").item(T3.name).str(" %-</font color>").ToString(); } else { this.temp = "<font color = #666633>-% Unable to acquire buffer %-</font color>"; } } } if (Lang13.Bool(href_list["buffer"])) { P.buffer = this; this.temp = new Txt("<font color = #666633>-% Successfully stored ").Ref(P.buffer).str(" ").item(P.buffer.name).str(" in buffer %-</font color>").ToString(); } if (Lang13.Bool(href_list["flush"])) { this.temp = "<font color = #666633>-% Buffer successfully flushed. %-</font color>"; P.buffer = null; } this.Options_Topic(href, href_list); Task13.User.set_machine(this); this.updateUsrDialog(); return(null); }
// Function from file: glass.dm public override bool attack(dynamic M = null, dynamic user = null, bool?def_zone = null) { dynamic R = null; Reagent A = null; double? fraction = null; if (!this.canconsume(M, user)) { return(false); } if (!this.spillable) { return(false); } if (!(this.reagents != null) || !Lang13.Bool(this.reagents.total_volume)) { user.WriteMsg("<span class='warning'>" + this + " is empty!</span>"); return(false); } if (M is Mob) { if (user.a_intent == "harm") { ((Ent_Static)M).visible_message("<span class='danger'>" + user + " splashes the contents of " + this + " onto " + M + "!</span>", "<span class='userdanger'>" + user + " splashes the contents of " + this + " onto " + M + "!</span>"); if (this.reagents != null) { foreach (dynamic _a in Lang13.Enumerate(this.reagents.reagent_list, typeof(Reagent))) { A = _a; R += A.id + " ("; R += String13.NumberToString(A.volume) + "),"; } } this.reagents.reaction(M, GlobalVars.TOUCH); GlobalFuncs.add_logs(user, M, "splashed", R); this.reagents.clear_reagents(); } else { if (M != user) { ((Ent_Static)M).visible_message("<span class='danger'>" + user + " attempts to feed something to " + M + ".</span>", "<span class='userdanger'>" + user + " attempts to feed something to you.</span>"); if (!GlobalFuncs.do_mob(user, M)) { return(false); } if (!(this.reagents != null) || !Lang13.Bool(this.reagents.total_volume)) { return(false); } ((Ent_Static)M).visible_message("<span class='danger'>" + user + " feeds something to " + M + ".</span>", "<span class='userdanger'>" + user + " feeds something to you.</span>"); GlobalFuncs.add_logs(user, M, "fed", this.reagentlist(this)); } else { user.WriteMsg("<span class='notice'>You swallow a gulp of " + this + ".</span>"); } fraction = Num13.MinInt(((int)(5 / (this.reagents.total_volume ?? 0))), 1); this.reagents.reaction(M, GlobalVars.INGEST, fraction); Task13.Schedule(5, (Task13.Closure)(() => { this.reagents.trans_to(M, 5); return; })); GlobalFuncs.playsound(M.loc, "sound/items/drink.ogg", Rand13.Int(10, 50), 1); } } return(false); }