// Function from file: machine_stacking.dm public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null) { Base_Data inp = null; dynamic _out = null; if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc)))) { return(null); } Task13.User.set_machine(this); this.add_fingerprint(Task13.User); if (Lang13.Bool(href_list["release"])) { if (!Lang13.Bool(this.machine.stack_list.Contains(Lang13.FindClass(href_list["release"])))) { return(null); } inp = this.machine.stack_list[Lang13.FindClass(href_list["release"])]; _out = Lang13.Call(inp.type); _out.amount = ((dynamic)inp).amount; ((dynamic)inp).amount = 0; ((Obj_Machinery_Mineral)this.machine).unload_mineral(_out); } this.updateUsrDialog(); return(null); }
// Function from file: walls_misc.dm public override Base_Data copyTurf( Base_Data T = null ) { Base_Data _default = null; _default = base.copyTurf( T ); ((dynamic)T).transform = this.transform; return _default; }
// Function from file: walls_misc.dm public override Base_Data copyTurf(Base_Data T = null) { if (T.type != this.type) { ((dynamic)T).ChangeTurf(this.type); if (this.underlays.len != 0) { ((dynamic)T).underlays = this.underlays; } } if (((dynamic)T).icon_state != this.icon_state) { ((dynamic)T).icon_state = this.icon_state; } if (((dynamic)T).icon != this.icon) { ((dynamic)T).icon = this.icon; } if (((dynamic)T).color != this.color) { ((dynamic)T).color = this.color; } if (Convert.ToInt32(((dynamic)T).dir) != this.dir) { ((dynamic)T).dir = this.dir; } ((dynamic)T).transform = this.transform; return(T); }
// Function from file: LINDA_turf_tile.dm public void copy_air_with_tile(Base_Data T = null) { if (T is Tile_Simulated && Lang13.Bool(((dynamic)T).air) && this.air != null) { this.air.copy_from(((dynamic)T).air); } return; }
// Function from file: equipment_locker.dm public override dynamic interact(dynamic user = null, bool?flag1 = null) { Base_Data s = null; dynamic dat = null; dynamic O = null; dynamic metalstack = null; dynamic plasmastack = null; Browser popup = null; dat += "This machine only accepts ore. Gibtonite and Slag are not accepted.<br><br>"; dat += "Current unclaimed points: " + this.points + "<br>"; if (this.inserted_id is Obj_Item_Weapon_Card_Id) { dat += new Txt("You have ").item(this.inserted_id.mining_points).str(" mining points collected. <A href='?src=").Ref(this).str(";choice=eject'>Eject ID.</A><br>").ToString(); dat += new Txt("<A href='?src=").Ref(this).str(";choice=claim'>Claim points.</A><br>").ToString(); } else { dat += new Txt("No ID inserted. <A href='?src=").Ref(this).str(";choice=insert'>Insert ID.</A><br>").ToString(); } foreach (dynamic _a in Lang13.Enumerate(this.stack_list)) { O = _a; s = this.stack_list[O]; if (Convert.ToDouble(((dynamic)s).amount) > 0) { if (O == this.stack_list[1]) { dat += "<br>"; } dat += new Txt().item(GlobalFuncs.capitalize(((dynamic)s).name)).str(": ").item(((dynamic)s).amount).str(" <A href='?src=").Ref(this).str(";release=").item(s.type).str("'>Release</A><br>").ToString(); } } if (this.stack_list.Contains(typeof(Obj_Item_Stack_Sheet_Metal)) && this.stack_list.Contains(typeof(Obj_Item_Stack_Sheet_Mineral_Plasma))) { metalstack = this.stack_list[typeof(Obj_Item_Stack_Sheet_Metal)]; plasmastack = this.stack_list[typeof(Obj_Item_Stack_Sheet_Mineral_Plasma)]; if (Num13.MinInt(Convert.ToInt32(metalstack.amount), Convert.ToInt32(plasmastack.amount)) != 0) { dat += new Txt("Plasteel Alloy (Metal + Plasma): <A href='?src=").Ref(this).str(";plasteel=1'>Smelt</A><BR>").ToString(); } } dat += "<br><div class='statusDisplay'><b>Mineral Value List:</b><BR>" + this.get_ore_values() + "</div>"; popup = new Browser(user, "console_stacking_machine", "Ore Redemption Machine", 400, 500); popup.set_content(dat); popup.open(); return(null); }
// Function from file: data_huds.dm public void update_suit_sensors(Base_Data H = null) { if (this.check_sensors(H)) { this.add_to_hud(H); } else { this.remove_from_hud(H); } return; }
// Function from file: air.dm public void remove_from_active(Base_Data T = null) { if (T is Tile_Simulated) { ((dynamic)T).excited = 0; this.active_turfs.Remove(T); if (Lang13.Bool(((dynamic)T).excited_group)) { ((ExcitedGroup)((dynamic)T).excited_group).garbage_collect(); } } return; }
// Function from file: buildmode.dm public override dynamic Destroy( ) { dynamic button = null; this.stored = null; foreach (dynamic _a in Lang13.Enumerate(this.buttons)) { button = _a; GlobalFuncs.qdel(button); } return(null); }
// Function from file: hivemind.dm public override dynamic sting_action(Mob user = null, Ent_Static target = null) { Changeling changeling = null; ByTable names = null; Changelingprofile prof = null; dynamic S = null; Base_Data chosen_prof = null; dynamic downloaded_prof = null; changeling = user.mind.changeling; names = new ByTable(); foreach (dynamic _a in Lang13.Enumerate(GlobalVars.hivemind_bank, typeof(Changelingprofile))) { prof = _a; if (!changeling.stored_profiles.Contains(prof)) { names[prof.name] = prof; } } if (names.len <= 0) { user.WriteMsg("<span class='notice'>There's no new DNA to absorb from the air.</span>"); return(null); } S = Interface13.Input("Select a DNA absorb from the air: ", "Absorb DNA", null, null, names, InputType.Null | InputType.Any); if (!Lang13.Bool(S)) { return(null); } chosen_prof = names[S]; if (!(chosen_prof != null)) { return(null); } downloaded_prof = Lang13.Call(chosen_prof.type); ((dynamic)chosen_prof).copy_profile(downloaded_prof); changeling.add_profile(downloaded_prof); user.WriteMsg("<span class='notice'>We absorb the DNA of " + S + " from the air.</span>"); GlobalFuncs.feedback_add_details("changeling_powers", "HD"); return(1); }
// Function from file: bluespaceartillery.dm public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null) { dynamic A = null; Base_Data thearea = null; ByTable L = null; dynamic T = null; dynamic loc = null; if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc)))) { return(null); } A = Interface13.Input("Area to jump bombard", "Open Fire", A, null, GlobalVars.teleportlocs, InputType.Any); thearea = GlobalVars.teleportlocs[A]; if (Task13.User.stat != 0 || Task13.User.restrained()) { return(null); } if (this.reload < 60) { return(null); } if (Task13.User.contents.Find(this) != 0 || Map13.GetDistance(this, Task13.User) <= 1 && this.loc is Tile || Task13.User is Mob_Living_Silicon) { GlobalFuncs.priority_announce("Bluespace artillery fire detected. Brace for impact."); GlobalFuncs.message_admins("" + GlobalFuncs.key_name_admin(Task13.User) + " has launched an artillery strike."); L = new ByTable(); foreach (dynamic _a in Lang13.Enumerate(GlobalFuncs.get_area_turfs(thearea.type))) { T = _a; L.Add(T); } loc = Rand13.PickFromTable(L); GlobalFuncs.explosion(loc, this.explosionsize, this.explosionsize * 2, this.explosionsize * 4); this.reload = 0; } return(null); }
// Function from file: shuttle.dm public virtual Base_Data copyTurf(Base_Data T = null) { Obj O = null; if (T.type != this.type) { if (this.underlays.len != 0) { O = new Obj(); O.underlays.Add(T); } ((dynamic)T).ChangeTurf(this.type); if (this.underlays.len != 0) { ((dynamic)T).underlays = O.underlays; } } if (((dynamic)T).icon_state != this.icon_state) { ((dynamic)T).icon_state = this.icon_state; } if (((dynamic)T).icon != this.icon) { ((dynamic)T).icon = this.icon; } if (((dynamic)T).color != this.color) { ((dynamic)T).color = this.color; } if (Convert.ToInt32(((dynamic)T).dir) != this.dir) { ((dynamic)T).dir = this.dir; } return(T); }
// Function from file: experiment.dm public void SendBack(dynamic H = null) { Base_Data A = null; ((Mob)H).Sleeping(8); if (this.console != null && this.console.pad != null && this.console.pad.teleport_target != null) { A = this.console.pad.teleport_target; if (Lang13.Bool(((dynamic)A).safe)) { this.TeleportToArea(H, A); ((Mob_Living_Carbon)H).uncuff(); return; } } ((Ent_Dynamic)H).forceMove(Rand13.PickFromTable(GlobalVars.latejoin)); ((Mob_Living_Carbon)H).uncuff(); return; }
// Function from file: master.dm public void Recover( ) { string msg = null; dynamic varname = null; dynamic varval = null; Base_Data D = null; msg = "## DEBUG: " + String13.FormatTime(Game13.timeofday, null) + " MC restarted. Reports:\n"; foreach (dynamic _b in Lang13.Enumerate(GlobalVars.Master.vars)) { varname = _b; dynamic _a = varname; // Was a switch-case, sorry for the mess. if (_a == "name" || _a == "tag" || _a == "bestF" || _a == "type" || _a == "parent_type" || _a == "vars" || _a == "statclick") { continue; } else { varval = GlobalVars.Master.vars[varname]; if (varval is Game_Data) { D = varval; msg += " "+ varname + " = " + D.type + "\n"; } else { msg += " "+ varname + " = " + varval + "\n"; } } } Game13.log.WriteMsg(msg); this.subsystems = GlobalVars.Master.subsystems; return; }
// Function from file: pad.dm public void Send( ) { Mob_Living target = null; if (this.teleport_target == null) { this.teleport_target = GlobalVars.teleportlocs[Rand13.PickFromTable(GlobalVars.teleportlocs)]; } Icon13.Flick("alien-pad", this); foreach (dynamic _a in Lang13.Enumerate(this.loc, typeof(Mob_Living))) { target = _a; this.TeleportToArea(target, this.teleport_target); Task13.Schedule(0, (Task13.Closure)(() => { GlobalFuncs.anim(target.loc, target, "icons/mob/mob.dmi", null, "uncloak", null, target.dir); return; })); } return; }
// Function from file: machine_stacking.dm public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null) { Base_Data s = null; dynamic dat = null; dynamic O = null; dat += "<b>Stacking unit console</b><br><br>"; foreach (dynamic _a in Lang13.Enumerate(this.machine.stack_list)) { O = _a; s = this.machine.stack_list[O]; if (Convert.ToDouble(((dynamic)s).amount) > 0) { dat += new Txt().item(GlobalFuncs.capitalize(((dynamic)s).name)).str(": ").item(((dynamic)s).amount).str(" <A href='?src=").Ref(this).str(";release=").item(s.type).str("'>Release</A><br>").ToString(); } } dat += "<br>Stacking: " + this.machine.stack_amt + "<br><br>"; Interface13.Browse(a, "" + dat, "window=console_stacking_machine"); return(null); }
// Function from file: scrolls.dm public void teleportscroll(Mob user = null) { dynamic A = null; Base_Data thearea = null; EffectSystem_SmokeSpread smoke = null; ByTable L = null; dynamic T = null; bool clear = false; Obj O = null; ByTable tempL = null; dynamic attempt = null; bool success = false; A = Interface13.Input(user, "Area to jump to", "BOOYEA", A, GlobalVars.teleportlocs, InputType.Any); thearea = GlobalVars.teleportlocs[A]; if (!(user != null) || user.stat != 0 || user.restrained() || this.uses <= 0) { return; } if (!(user == this.loc || Map13.GetDistance(this, user) <= 1 && this.loc is Tile)) { return; } smoke = new EffectSystem_SmokeSpread(); smoke.set_up(2, user.loc); smoke.attach(user); smoke.start(); L = new ByTable(); foreach (dynamic _b in Lang13.Enumerate(GlobalFuncs.get_area_turfs(thearea.type))) { T = _b; if (!T.density) { clear = true; foreach (dynamic _a in Lang13.Enumerate(T, typeof(Obj))) { O = _a; if (O.density) { clear = false; break; } } if (clear) { L.Add(T); } } } if (!(L.len != 0)) { user.WriteMsg("The spell matrix was unable to locate a suitable teleport destination for an unknown reason. Sorry."); return; } if (user != null && user.buckled != null) { user.buckled.unbuckle_mob(); } tempL = L.Copy(); attempt = null; success = false; while (tempL.len != 0) { attempt = Rand13.PickFromTable(tempL); user.Move(attempt); if (GlobalFuncs.get_turf(user) == attempt) { success = true; break; } else { tempL.Remove(attempt); } } if (!success) { user.loc = Rand13.PickFromTable(L); } smoke.start(); this.uses -= 1; return; }
// Function from file: airalarm.dm public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null) { int?_default = null; dynamic device_id = null; dynamic A = null; dynamic target = null; dynamic env = null; dynamic name = null; Base_Data tlv = null; dynamic value = null; dynamic A2 = null; dynamic A3 = null; if (Lang13.Bool(base.ui_act(action, _params, ui, state)) || this.buildstage != 2) { return(_default); } if (this.locked && !Task13.User.has_unlimited_silicon_privilege || Task13.User.has_unlimited_silicon_privilege && Lang13.Bool(this.aidisabled)) { return(_default); } device_id = _params["id_tag"]; switch ((string)(action)) { case "lock": if (Task13.User.has_unlimited_silicon_privilege && !((Wires)this.wires).is_cut("idscan")) { this.locked = !this.locked; _default = GlobalVars.TRUE; } break; case "power": case "co2_scrub": case "tox_scrub": case "n2o_scrub": case "widenet": case "scrubbing": this.send_signal(device_id, new ByTable().Set("" + action, String13.ParseNumber(_params["val"]))); _default = GlobalVars.TRUE; break; case "excheck": this.send_signal(device_id, new ByTable().Set("checks", ((int)(String13.ParseNumber(_params["val"]) ?? 0)) ^ 1)); _default = GlobalVars.TRUE; break; case "incheck": this.send_signal(device_id, new ByTable().Set("checks", ((int)(String13.ParseNumber(_params["val"]) ?? 0)) ^ 2)); _default = GlobalVars.TRUE; break; case "set_external_pressure": A = GlobalFuncs.get_area_master(this); target = Interface13.Input("New target pressure:", this.name, A.air_vent_info[device_id]["external"], null, null, InputType.Num | InputType.Null); if (!(target == null) && !Lang13.Bool(base.ui_act(action, _params, ui, state))) { this.send_signal(device_id, new ByTable().Set("set_external_pressure", target)); _default = GlobalVars.TRUE; } break; case "reset_external_pressure": this.send_signal(device_id, new ByTable(new object [] { "reset_external_pressure" })); _default = GlobalVars.TRUE; break; case "threshold": env = _params["env"]; name = _params["var"]; tlv = this.TLV[env]; if (tlv == null) { return(_default); } value = Interface13.Input("New " + name + " for " + env + ":", name, tlv.vars[name], null, null, InputType.Num | InputType.Null); if (!(value == null) && !Lang13.Bool(base.ui_act(action, _params, ui, state))) { if (Convert.ToDouble(value) < 0) { tlv.vars[name] = -1; } else { tlv.vars[name] = Num13.Round(Convert.ToDouble(value), 0.01); } _default = GlobalVars.TRUE; } break; case "mode": this.mode = String13.ParseNumber(_params["mode"]); this.apply_mode(); _default = GlobalVars.TRUE; break; case "alarm": A2 = GlobalFuncs.get_area_master(this); if (((Zone)A2).atmosalert(2, this)) { this.post_alert(2); } _default = GlobalVars.TRUE; break; case "reset": A3 = GlobalFuncs.get_area_master(this); if (((Zone)A3).atmosalert(0, this)) { this.post_alert(0); } _default = GlobalVars.TRUE; break; } this.update_icon(); return(_default); }
// Function from file: RPD.dm public bool show_menu(dynamic user = null) { string dat = null; Icon preview = null; string datbuild = null; dynamic category = null; dynamic cat = null; dynamic label = null; Base_Data I = null; bool found = false; string color_css = null; string color_picker = null; dynamic color_name = null; dynamic color = null; string selected = null; string dirsel = null; string datsytle = null; Browser popup = null; if (!Lang13.Bool(user) || !(this != null)) { return(false); } dat = "<h2>Type</h2>\n<b>Utilities:</b>\n<ul>"; if (this.p_class != -1) { dat += new Txt("<li><a href='?src=").Ref(this).str(";eatpipes=1;type=-1'>Eat Pipes</a></li>").ToString(); } else { dat += "<li><span class='linkOn'>Eat Pipes</span></li>"; } if (this.p_class != -2) { dat += new Txt("<li><a href='?src=").Ref(this).str(";paintpipes=1;type=-1'>Paint Pipes</a></li>").ToString(); } else { dat += "<li><span class='linkOn'>Paint Pipes</span></li>"; } dat += "</ul>"; dat += "<b>Category:</b><ul>"; if (this.screen == 0) { dat += new Txt("<span class='linkOn'>Atmospherics</span> <A href='?src=").Ref(this).str(";screen=").item(1).str(";dmake=0;type=0'>Disposals</A><BR>").ToString(); } else if (this.screen == 1) { dat += new Txt("<A href='?src=").Ref(this).str(";screen=").item(0).str(";makepipe=0;dir=1;type=0'>Atmospherics</A> <span class='linkOn'>Disposals</span><BR>").ToString(); } dat += "</ul>"; preview = null; datbuild = ""; foreach (dynamic _b in Lang13.Enumerate(GlobalVars.RPD_recipes)) { category = _b; cat = GlobalVars.RPD_recipes[category]; foreach (dynamic _a in Lang13.Enumerate(cat)) { label = _a; I = cat[label]; found = false; if (((dynamic)I).id == this.p_type) { if ((this.p_class == 0 || this.p_class == 1) && (I.type == typeof(PipeInfo) || I.type == typeof(PipeInfo_Meter))) { found = true; } else if (this.p_class == 2 && I.type == typeof(PipeInfo_Disposal)) { found = true; } } if (found) { preview = new Icon(((dynamic)I).icon, ((dynamic)I).icon_state); } if (this.screen == Lang13.DoubleNullable(((dynamic)I).categoryId)) { if (((dynamic)I).id == this.p_type && this.p_class >= 0) { datbuild += "<span class='linkOn'>" + label + "</span>"; } else { datbuild += ((dynamic)I).Render(this, label); } } } if (Lang13.Length(datbuild) > 0) { dat += "<b>" + category + ":</b><ul>"; dat += datbuild; datbuild = ""; } dat += "</ul>"; } color_css = ""; color_picker = ""; foreach (dynamic _c in Lang13.Enumerate(this.paint_colors)) { color_name = _c; color = this.paint_colors[color_name]; color_css += "\n a.color."+ color_name + " {\n color: "+ color + ";\n }\n a.color."+ color_name + ":hover {\n border:1px solid "+ color + ";\n }\n a.color."+ color_name + ".selected {\n background-color: "+ color + ";\n }\n "; selected = ""; if (color_name == this.paint_color) { selected = " selected"; } color_picker += new Txt("<a class=\"color ").item(color_name).item(selected).str("\" href=\"?src=").Ref(this).str(";set_color=").item(color_name).str("\">•</a>").ToString(); } dirsel = "<h2>Direction</h2>"; switch ((int?)(this.p_conntype)) { case -1: if (this.p_class == -2) { dirsel = "<h2>Color</h2>" + color_picker; } else { dirsel = ""; } break; case 0: if (preview != null) { Interface13.CacheBrowseResource(user, new Icon(preview, null, GlobalVars.NORTH), "vertical.png"); Interface13.CacheBrowseResource(user, new Icon(preview, null, GlobalVars.EAST), "horizontal.png"); dirsel += "<p>"; dirsel += this.render_dir_img(1, "vertical.png", "Vertical"); dirsel += this.render_dir_img(4, "horizontal.png", "Horizontal"); dirsel += "</p>"; } else { dirsel += new Txt("\n <p>\n <a href=\"?src=").Ref(this).str(";setdir=1; flipped=0\" title=\"vertical\">↕</a>\n <a href=\"?src=").Ref(this).str(";setdir=4; flipped=0\" title=\"horizontal\">↔</a>\n </p>\n ").ToString(); } break; case 1: if (preview != null) { Interface13.CacheBrowseResource(user, new Icon(preview, null, GlobalVars.NORTH), "vertical.png"); Interface13.CacheBrowseResource(user, new Icon(preview, null, GlobalVars.EAST), "horizontal.png"); Interface13.CacheBrowseResource(user, new Icon(preview, null, GlobalVars.NORTHWEST), "nw.png"); Interface13.CacheBrowseResource(user, new Icon(preview, null, GlobalVars.NORTHEAST), "ne.png"); Interface13.CacheBrowseResource(user, new Icon(preview, null, GlobalVars.SOUTHWEST), "sw.png"); Interface13.CacheBrowseResource(user, new Icon(preview, null, GlobalVars.SOUTHEAST), "se.png"); dirsel += "<p>"; dirsel += this.render_dir_img(1, "vertical.png", "Vertical"); dirsel += this.render_dir_img(4, "horizontal.png", "Horizontal"); dirsel += "<br />"; dirsel += this.render_dir_img(9, "nw.png", "West to North"); dirsel += this.render_dir_img(5, "ne.png", "North to East"); dirsel += "<br />"; dirsel += this.render_dir_img(10, "sw.png", "South to West"); dirsel += this.render_dir_img(6, "se.png", "East to South"); dirsel += "</p>"; } else { dirsel += new Txt("\n <p>\n <a href=\"?src=").Ref(this).str(";setdir=1; flipped=0\" title=\"vertical\">↕</a>\n <a href=\"?src=").Ref(this).str(";setdir=4; flipped=0\" title=\"horizontal\">↔</a>\n <br />\n <a href=\"?src=").Ref(this).str(";setdir=9; flipped=0\" title=\"West to North\">╝</a>\n <a href=\"?src=").Ref(this).str(";setdir=5; flipped=0\" title=\"North to East\">╚</a>\n <br />\n <a href=\"?src=").Ref(this).str(";setdir=10; flipped=0\" title=\"South to West\">╗</a>\n <a href=\"?src=").Ref(this).str(";setdir=6; flipped=0\" title=\"East to South\">╔</a>\n </p>\n ").ToString(); } break; case 2: if (preview != null) { Interface13.CacheBrowseResource(user, new Icon(preview, null, GlobalVars.NORTH), "s.png"); Interface13.CacheBrowseResource(user, new Icon(preview, null, GlobalVars.EAST), "w.png"); Interface13.CacheBrowseResource(user, new Icon(preview, null, GlobalVars.SOUTH), "n.png"); Interface13.CacheBrowseResource(user, new Icon(preview, null, GlobalVars.WEST), "e.png"); dirsel += "<p>"; dirsel += this.render_dir_img(1, "s.png", "West South East"); dirsel += this.render_dir_img(4, "w.png", "North West South"); dirsel += "<br />"; dirsel += this.render_dir_img(2, "n.png", "East North West"); dirsel += this.render_dir_img(8, "e.png", "South East North"); dirsel += "</p>"; } else { dirsel += new Txt("\n <p>\n <a href=\"?src=").Ref(this).str(";setdir=1; flipped=0\" title=\"West, South, East\">╦</a>\n <a href=\"?src=").Ref(this).str(";setdir=4; flipped=0\" title=\"North, West, South\">╣</a>\n <br />\n <a href=\"?src=").Ref(this).str(";setdir=2; flipped=0\" title=\"East, North, West\">╩</a>\n <a href=\"?src=").Ref(this).str(";setdir=8; flipped=0\" title=\"South, East, North\">╠</a>\n </p>\n ").ToString(); } break; case 3: if (preview != null) { Interface13.CacheBrowseResource(user, new Icon(preview, null, GlobalVars.NORTH), "s.png"); Interface13.CacheBrowseResource(user, new Icon(preview, null, GlobalVars.EAST), "w.png"); Interface13.CacheBrowseResource(user, new Icon(preview, null, GlobalVars.SOUTH), "n.png"); Interface13.CacheBrowseResource(user, new Icon(preview, null, GlobalVars.WEST), "e.png"); Interface13.CacheBrowseResource(user, new Icon(preview, null, GlobalVars.SOUTHEAST), "sm.png"); Interface13.CacheBrowseResource(user, new Icon(preview, null, GlobalVars.NORTHEAST), "wm.png"); Interface13.CacheBrowseResource(user, new Icon(preview, null, GlobalVars.NORTHWEST), "nm.png"); Interface13.CacheBrowseResource(user, new Icon(preview, null, GlobalVars.SOUTHWEST), "em.png"); dirsel += "<p>"; dirsel += this.render_dir_img(1, "s.png", "West South East"); dirsel += this.render_dir_img(4, "w.png", "North West South"); dirsel += "<br />"; dirsel += this.render_dir_img(2, "n.png", "East North West"); dirsel += this.render_dir_img(8, "e.png", "South East North"); dirsel += "<br />"; dirsel += this.render_dir_img(6, "sm.png", "West South East", true); dirsel += this.render_dir_img(5, "wm.png", "North West South", true); dirsel += "<br />"; dirsel += this.render_dir_img(9, "nm.png", "East North West", true); dirsel += this.render_dir_img(10, "em.png", "South East North", true); dirsel += "</p>"; } else { dirsel += new Txt("\n <p>\n <a href=\"?src=").Ref(this).str(";setdir=1; flipped=0\" title=\"West, South, East\">╦</a>\n <a href=\"?src=").Ref(this).str(";setdir=4; flipped=0\" title=\"North, West, South\">╣</a>\n <br />\n <a href=\"?src=").Ref(this).str(";setdir=2; flipped=0\" title=\"East, North, West\">╩</a>\n <a href=\"?src=").Ref(this).str(";setdir=8; flipped=0\" title=\"South, East, North\">╠</a>\n <br />\n <a href=\"?src=").Ref(this).str(";setdir=6; flipped=1\" title=\"West, South, East\">╦</a>\n <a href=\"?src=").Ref(this).str(";setdir=5; flipped=1\" title=\"North, West, South\">╣</a>\n <br />\n <a href=\"?src=").Ref(this).str(";setdir=9; flipped=1\" title=\"East, North, West\">╩</a>\n <a href=\"?src=").Ref(this).str(";setdir=10; flipped=1\" title=\"South, East, North\">╠</a>\n </p>\n ").ToString(); } break; case 4: if (preview != null) { Interface13.CacheBrowseResource(user, new Icon(preview, null, GlobalVars.NORTH), "n.png"); Interface13.CacheBrowseResource(user, new Icon(preview, null, GlobalVars.EAST), "e.png"); Interface13.CacheBrowseResource(user, new Icon(preview, null, GlobalVars.SOUTH), "s.png"); Interface13.CacheBrowseResource(user, new Icon(preview, null, GlobalVars.WEST), "w.png"); dirsel += "<p>"; dirsel += this.render_dir_img(GlobalVars.NORTH, "n.png", "North"); dirsel += this.render_dir_img(GlobalVars.EAST, "e.png", "East"); dirsel += this.render_dir_img(GlobalVars.SOUTH, "s.png", "South"); dirsel += this.render_dir_img(GlobalVars.WEST, "w.png", "West"); dirsel += "</p>"; } else { dirsel += new Txt("\n <p>\n <a href=\"?src=").Ref(this).str(";setdir=").item(GlobalVars.NORTH).str("; flipped=0\" title=\"North\">↑</a>\n <a href=\"?src=").Ref(this).str(";setdir=").item(GlobalVars.EAST).str("; flipped=0\" title=\"East\">→</a>\n <a href=\"?src=").Ref(this).str(";setdir=").item(GlobalVars.SOUTH).str("; flipped=0\" title=\"South\">↓</a>\n <a href=\"?src=").Ref(this).str(";setdir=").item(GlobalVars.WEST).str("; flipped=0\" title=\"West\">←</a>\n </p>\n ").ToString(); } break; case 5: if (preview != null) { Interface13.CacheBrowseResource(user, new Icon(preview), "pipe.png"); dirsel += "<p>"; dirsel += this.render_dir_img(1, "pipe.png", "Pipe"); dirsel += "</p>"; } else { dirsel += new Txt("\n <p>\n <a href=\"?src=").Ref(this).str(";setdir=1; flipped=0\" title=\"Pipe\">↕</a>\n </p>\n ").ToString(); } break; } datsytle = @" <style type=""text/css""> a.imglink { padding: none; text-decoration:none; border-style:none; background:none; margin: 1px; } a.imglink:hover { background:none; color:none; } a.imglink.selected img { border: 1px solid #24722e; background: #2f943c; } a img { border: 1px solid #161616; background: #40628a; } a.color { padding: 5px 10px; font-size: large; font-weight: bold; border: 1px solid #161616; } a.selected img, a:hover { background: #0066cc; color: #ffffff; } " + color_css + "\n</style>"; dat = datsytle + dirsel + dat; popup = new Browser(user, "pipedispenser", this.name, 300, 550); popup.set_content(dat); popup.open(); return(false); }
// Function from file: buildmode.dm public bool ClickOn(Ent_Static user = null, string _params = null, Base_Data _object = null) { bool _default = false; ByTable pa = null; int right_click = 0; int left_click = 0; int alt_click = 0; int ctrl_click = 0; Base_Data T = null; Base_Data T2 = null; Base_Data T3 = null; Base_Data T4 = null; Obj_Structure_Window_Reinforced WIN = null; Obj_Structure_Window_Reinforced WIN2 = null; Obj_Structure_Window_Reinforced WIN3 = null; Obj_Structure_Window_Reinforced WIN4 = null; Obj_Structure_Window_Reinforced WIN5 = null; dynamic T5 = null; dynamic A = null; dynamic G = null; dynamic T6 = null; pa = String13.ParseUrlParams(_params); right_click = pa.Find("right"); left_click = pa.Find("left"); alt_click = pa.Find("alt"); ctrl_click = pa.Find("ctrl"); _default = true; switch ((int)(this.mode)) { case 1: if (_object is Tile && left_click != 0 && !(alt_click != 0) && !(ctrl_click != 0)) { T = _object; if (_object is Tile_Space) { ((Tile)T).ChangeTurf(typeof(Tile_Simulated_Floor_Plasteel)); } else if (_object is Tile_Simulated_Floor) { ((Tile)T).ChangeTurf(typeof(Tile_Simulated_Wall)); } else if (_object is Tile_Simulated_Wall) { ((Tile)T).ChangeTurf(typeof(Tile_Simulated_Wall_RWall)); } GlobalFuncs.log_admin("Build Mode: " + GlobalFuncs.key_name(user) + " built " + T + " at (" + ((dynamic)T).x + "," + ((dynamic)T).y + "," + ((dynamic)T).z + ")"); return(_default); } else if (right_click != 0) { GlobalFuncs.log_admin("Build Mode: " + GlobalFuncs.key_name(user) + " deleted " + _object + " at (" + ((dynamic)_object).x + "," + ((dynamic)_object).y + "," + ((dynamic)_object).z + ")"); if (_object is Tile_Simulated_Wall) { T2 = _object; ((Tile)T2).ChangeTurf(typeof(Tile_Simulated_Floor_Plasteel)); } else if (_object is Tile_Simulated_Floor) { T3 = _object; ((Tile)T3).ChangeTurf(typeof(Tile_Space)); } else if (_object is Tile_Simulated_Wall_RWall) { T4 = _object; ((Tile)T4).ChangeTurf(typeof(Tile_Simulated_Wall)); } else if (_object is Obj) { GlobalFuncs.qdel(_object); } return(_default); } else if (_object is Tile && alt_click != 0 && left_click != 0) { GlobalFuncs.log_admin("Build Mode: " + GlobalFuncs.key_name(user) + " built an airlock at (" + ((dynamic)_object).x + "," + ((dynamic)_object).y + "," + ((dynamic)_object).z + ")"); new Obj_Machinery_Door_Airlock(GlobalFuncs.get_turf(_object)); } else if (_object is Tile && ctrl_click != 0 && left_click != 0) { switch ((int?)(this.build_dir)) { case 1: WIN = new Obj_Structure_Window_Reinforced(GlobalFuncs.get_turf(_object)); WIN.dir = ((int)(GlobalVars.NORTH)); break; case 2: WIN2 = new Obj_Structure_Window_Reinforced(GlobalFuncs.get_turf(_object)); WIN2.dir = ((int)(GlobalVars.SOUTH)); break; case 4: WIN3 = new Obj_Structure_Window_Reinforced(GlobalFuncs.get_turf(_object)); WIN3.dir = ((int)(GlobalVars.EAST)); break; case 8: WIN4 = new Obj_Structure_Window_Reinforced(GlobalFuncs.get_turf(_object)); WIN4.dir = ((int)(GlobalVars.WEST)); break; case 9: WIN5 = new Obj_Structure_Window_Reinforced(GlobalFuncs.get_turf(_object)); WIN5.dir = ((int)(GlobalVars.NORTHWEST)); break; } GlobalFuncs.log_admin("Build Mode: " + GlobalFuncs.key_name(user) + " built a window at (" + ((dynamic)_object).x + "," + ((dynamic)_object).y + "," + ((dynamic)_object).z + ")"); } break; case 2: if (left_click != 0) { if (Lang13.Bool(this.objholder.IsSubclassOf(typeof(Tile)))) { T5 = GlobalFuncs.get_turf(_object); GlobalFuncs.log_admin("Build Mode: " + GlobalFuncs.key_name(user) + " modified " + T5 + " (" + T5.x + "," + T5.y + "," + T5.z + ") to " + this.objholder); ((Tile)T5).ChangeTurf(this.objholder); } else { A = Lang13.Call(this.objholder, GlobalFuncs.get_turf(_object)); A.dir = this.build_dir; GlobalFuncs.log_admin("Build Mode: " + GlobalFuncs.key_name(user) + " modified " + A + "'s (" + A.x + "," + A.y + "," + A.z + ") dir to " + this.build_dir); } } else if (right_click != 0) { if (_object is Obj) { GlobalFuncs.log_admin("Build Mode: " + GlobalFuncs.key_name(user) + " deleted " + _object + " at (" + ((dynamic)_object).x + "," + ((dynamic)_object).y + "," + ((dynamic)_object).z + ")"); GlobalFuncs.qdel(_object); } } break; case 3: if (left_click != 0) { if (_object.vars.Find(this.varholder) != 0) { GlobalFuncs.log_admin("Build Mode: " + GlobalFuncs.key_name(user) + " modified " + ((dynamic)_object).name + "'s " + this.varholder + " to " + this.valueholder); _object.vars[this.varholder] = this.valueholder; } else { ((dynamic)user).WriteMsg("<span class='warning'>" + Lang13.Initial(_object, "name") + " does not have a var called '" + this.varholder + "'</span>"); } } if (right_click != 0) { if (_object.vars.Find(this.varholder) != 0) { GlobalFuncs.log_admin("Build Mode: " + GlobalFuncs.key_name(user) + " modified " + ((dynamic)_object).name + "'s " + this.varholder + " to " + this.valueholder); _object.vars[this.varholder] = Lang13.Initial(_object, this.varholder); } else { ((dynamic)user).WriteMsg("<span class='warning'>" + Lang13.Initial(_object, "name") + " does not have a var called '" + this.varholder + "'</span>"); } } break; case 4: if (left_click != 0) { if (_object is Tile) { return(_default); } this.throw_atom = _object; } if (right_click != 0) { if (this.throw_atom != null) { ((Ent_Dynamic)this.throw_atom).throw_at(_object, 10, 1, user); GlobalFuncs.log_admin("Build Mode: " + GlobalFuncs.key_name(user) + " threw " + this.throw_atom + " at " + _object + " (" + ((dynamic)_object).x + "," + ((dynamic)_object).y + "," + ((dynamic)_object).z + ")"); } } break; case 5: if (!Lang13.Bool(this.cornerA)) { this.cornerA = GlobalFuncs.get_turf(_object); return(_default); } if (Lang13.Bool(this.cornerA) && !Lang13.Bool(this.cornerB)) { this.cornerB = GlobalFuncs.get_turf(_object); } if (left_click != 0) { if (Lang13.Bool(this.cornerA) && Lang13.Bool(this.cornerB)) { if (!Lang13.Bool(this.generator_path)) { ((dynamic)user).WriteMsg("<span class='warning'>Select generator type first.</span>"); } G = Lang13.Call(this.generator_path); ((MapGenerator)G).defineRegion(this.cornerA, this.cornerB, true); ((MapGenerator)G).generate(); this.cornerA = null; this.cornerB = null; return(_default); } } this.cornerA = null; this.cornerB = null; break; case 6: if (left_click != 0) { T6 = GlobalFuncs.get_turf(_object); if (this.stored != null) { GlobalFuncs.DuplicateObject(this.stored, true, null, T6); } } else if (right_click != 0) { if (_object is Ent_Dynamic) { this.stored = _object; } } break; } return(_default); }
// Function from file: shuttle.dm public virtual int dock(dynamic S1 = null) { int _default = 0; dynamic S0 = null; Type turf_type = null; Type area_type = null; ByTable L0 = null; ByTable L1 = null; double? rotation = null; dynamic A0 = null; dynamic T0 = null; int? i = null; Base_Data T02 = null; Ent_Static T1 = null; Ent_Static Ts1 = null; Ent_Dynamic AM = null; _default = this.canDock(S1); if (_default != 0) { //throw new Exception( "dock(): shuttle cannot dock" ); return(_default); } if (this.canMove()) { return(-1); } this.closePortDoors(); S0 = this.get_docked(); turf_type = typeof(Tile_Space); area_type = typeof(Zone_Space); if (Lang13.Bool(S0)) { if (Lang13.Bool(S0.turf_type)) { turf_type = S0.turf_type; } if (Lang13.Bool(S0.area_type)) { area_type = S0.area_type; } } L0 = this.return_ordered_turfs(this.x, this.y, this.z, this.dir, this.areaInstance); L1 = this.return_ordered_turfs(Lang13.IntNullable(S1.x), Lang13.IntNullable(S1.y), Lang13.IntNullable(S1.z), Lang13.IntNullable(S1.dir)); rotation = (GlobalFuncs.dir2angle(S1.dir) ?? 0) - (GlobalFuncs.dir2angle(this.dir) ?? 0); if ((rotation ?? 0) % 90 != 0) { rotation += (rotation ?? 0) % 90; } rotation = GlobalFuncs.SimplifyDegrees(rotation); if (this.areaInstance.contents.len != 0) { A0 = Lang13.FindObj("" + area_type); if (!Lang13.Bool(A0)) { A0 = Lang13.Call(area_type, null); } foreach (dynamic _a in Lang13.Enumerate(L0)) { T0 = _a; A0.contents.Add(T0); } } this.roadkill(L1, Convert.ToInt32(S1.dir)); i = null; i = 1; while ((i ?? 0) <= L0.len) { T02 = L0[i]; if (!(T02 != null)) { } else { T1 = L1[i]; if (!(T1 != null)) { } else { if (T02.type != ((dynamic)T02).baseturf) { ((dynamic)T02).copyTurf(T1); this.areaInstance.contents.Add(T1); if (T1 is Tile_Simulated) { Ts1 = T1; ((dynamic)Ts1).copy_air_with_tile(T02); } foreach (dynamic _b in Lang13.Enumerate(T02, typeof(Ent_Dynamic))) { AM = _b; AM.onShuttleMove(T1, rotation); } } if (Lang13.Bool(rotation)) { T1.shuttleRotate(rotation); } ((dynamic)T1).redraw_lighting(); GlobalVars.SSair.remove_from_active(T1); ((dynamic)T1).CalculateAdjacentTurfs(); GlobalVars.SSair.add_to_active(T1, true); ((dynamic)T02).ChangeTurf(turf_type); ((dynamic)T02).redraw_lighting(); GlobalVars.SSair.remove_from_active(T02); ((dynamic)T02).CalculateAdjacentTurfs(); GlobalVars.SSair.add_to_active(T02, true); } } i++; } this.loc = S1.loc; this.dir = Convert.ToInt32(S1.dir); return(_default); }
// Function from file: pad.dm public void TeleportToArea(dynamic target = null, Base_Data thearea = null) { ByTable L = null; dynamic T = null; bool clear = false; Obj O = null; ByTable tempL = null; dynamic attempt = null; bool success = false; L = new ByTable(); foreach (dynamic _b in Lang13.Enumerate(GlobalFuncs.get_area_turfs(thearea.type))) { T = _b; if (!T.density) { clear = true; foreach (dynamic _a in Lang13.Enumerate(T, typeof(Obj))) { O = _a; if (O.density) { clear = false; break; } } if (clear) { L.Add(T); } } } if (!(L.len != 0)) { return; } if (Lang13.Bool(target) && target.buckled != null) { target.buckled.unbuckle_mob(); } tempL = L; attempt = null; success = false; while (tempL.len != 0) { attempt = Rand13.PickFromTable(tempL); target.Move(attempt); if (GlobalFuncs.get_turf(target) == attempt) { success = true; break; } else { tempL.Remove(attempt); } } if (!success) { target.loc = Rand13.PickFromTable(L); } return; }
// Function from file: equipment_locker.dm public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null) { dynamic I = null; Base_Data inp = null; dynamic _out = null; dynamic desired = null; dynamic metalstack = null; dynamic plasmastack = null; dynamic desired2 = null; Obj_Item_Stack_Sheet_Plasteel plasteelout = null; if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc)))) { return(null); } if (Lang13.Bool(href_list["choice"])) { if (this.inserted_id is Obj_Item_Weapon_Card_Id) { if (href_list["choice"] == "eject") { this.inserted_id.loc = this.loc; this.inserted_id.__CallVerb("Pick up"); this.inserted_id = null; } if (href_list["choice"] == "claim") { if (Lang13.Bool(this.inserted_id.access.Contains(GlobalVars.access_mining_station))) { this.inserted_id.mining_points += this.points; this.points = 0; } else { Task13.User.WriteMsg("<span class='warning'>Required access not found.</span>"); } } } else if (href_list["choice"] == "insert") { I = Task13.User.get_active_hand(); if (I is Obj_Item_Weapon_Card_Id) { if (!Task13.User.drop_item()) { return(null); } I.loc = this; this.inserted_id = I; } else { Task13.User.WriteMsg("<span class='warning'>No valid ID.</span>"); } } } if (Lang13.Bool(href_list["release"])) { if (this.check_access(this.inserted_id) || this.allowed(Task13.User)) { if (!this.stack_list.Contains(Lang13.FindClass(href_list["release"]))) { return(null); } inp = this.stack_list[Lang13.FindClass(href_list["release"])]; _out = Lang13.Call(inp.type); desired = Interface13.Input("How much?", "How much to eject?", 1, null, null, InputType.Num); _out.amount = Num13.MinInt(Convert.ToInt32(desired), 50, Convert.ToInt32(((dynamic)inp).amount)); if (Convert.ToDouble(_out.amount) >= 1) { ((dynamic)inp).amount -= _out.amount; this.unload_mineral(_out); } if (Convert.ToDouble(((dynamic)inp).amount) < 1) { this.stack_list.Remove(Lang13.FindClass(href_list["release"])); } } else { Task13.User.WriteMsg("<span class='warning'>Required access not found.</span>"); } } if (Lang13.Bool(href_list["plasteel"])) { if (this.check_access(this.inserted_id) || this.allowed(Task13.User)) { if (!this.stack_list.Contains(typeof(Obj_Item_Stack_Sheet_Metal))) { return(null); } if (!this.stack_list.Contains(typeof(Obj_Item_Stack_Sheet_Mineral_Plasma))) { return(null); } metalstack = this.stack_list[typeof(Obj_Item_Stack_Sheet_Metal)]; plasmastack = this.stack_list[typeof(Obj_Item_Stack_Sheet_Mineral_Plasma)]; desired2 = Interface13.Input("How much?", "How much would you like to smelt?", 1, null, null, InputType.Num); plasteelout = new Obj_Item_Stack_Sheet_Plasteel(); plasteelout.amount = Num13.MinInt(Convert.ToInt32(desired2), 50, Convert.ToInt32(metalstack.amount), Convert.ToInt32(plasmastack.amount)); if ((plasteelout.amount ?? 0) >= 1) { metalstack.amount -= plasteelout.amount; plasmastack.amount -= plasteelout.amount; this.unload_mineral(plasteelout); } } else { Task13.User.WriteMsg("<span class='warning'>Required access not found.</span>"); } } this.updateUsrDialog(); return(null); }
// Function from file: pandemic.dm public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null) { Obj_Item_Weapon_ReagentContainers_Glass_Bottle B = null; dynamic path = null; dynamic vaccine_type = null; string vaccine_name = null; dynamic D = null; dynamic D2 = null; dynamic type = null; dynamic D3 = null; Base_Data A = null; string name = null; Obj_Item_Weapon_ReagentContainers_Glass_Bottle B2 = null; ByTable data = null; string new_name = null; dynamic id = null; Disease_Advance A2 = null; Disease_Advance AD = null; if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc)))) { return(null); } Task13.User.set_machine(this); if (!Lang13.Bool(this.beaker)) { return(null); } if (Lang13.Bool(href_list["create_vaccine"])) { if (!(this.wait == true)) { B = new Obj_Item_Weapon_ReagentContainers_Glass_Bottle(this.loc); if (B != null) { B.pixel_x = Rand13.Int(-3, 3); B.pixel_y = Rand13.Int(-3, 3); path = this.GetResistancesByIndex(String13.ParseNumber(href_list["create_vaccine"])); vaccine_type = path; vaccine_name = "Unknown"; if (!(vaccine_type is Type)) { if (Lang13.Bool(GlobalVars.archive_diseases[path])) { D = GlobalVars.archive_diseases[path]; if (Lang13.Bool(D)) { vaccine_name = D.name; vaccine_type = path; } } } else if (Lang13.Bool(vaccine_type)) { D2 = Lang13.Call(vaccine_type, 0, null); if (Lang13.Bool(D2)) { vaccine_name = D2.name; } } if (Lang13.Bool(vaccine_type)) { B.name = "" + vaccine_name + " vaccine bottle"; B.reagents.add_reagent("vaccine", 15, new ByTable(new object [] { vaccine_type })); this.replicator_cooldown(200); } } } else { this.temp_html = "The replicator is not ready yet."; } this.updateUsrDialog(); return(null); } else if (Lang13.Bool(href_list["create_virus_culture"])) { if (!(this.wait == true)) { type = this.GetVirusTypeByIndex(String13.ParseNumber(href_list["create_virus_culture"])); D3 = null; if (!(type is Type)) { D3 = this.GetVirusByIndex(String13.ParseNumber(href_list["create_virus_culture"])); A = GlobalVars.archive_diseases[((Disease)D3).GetDiseaseID()]; if (A != null) { D3 = Lang13.Call(A.type, 0, A); } } else if (Lang13.Bool(type)) { if (Lang13.Bool(GlobalVars.diseases.Contains(type))) { D3 = Lang13.Call(type, 0, null); } } if (!Lang13.Bool(D3)) { return(null); } name = GlobalFuncs.stripped_input(Task13.User, "Name:", "Name the culture", D3.name, 26); if (name == null || this.wait == true) { return(null); } B2 = new Obj_Item_Weapon_ReagentContainers_Glass_Bottle(this.loc); B2.icon_state = "bottle3"; B2.pixel_x = Rand13.Int(-3, 3); B2.pixel_y = Rand13.Int(-3, 3); this.replicator_cooldown(50); data = new ByTable().Set("viruses", new ByTable(new object [] { D3 })); B2.name = "" + name + " culture bottle"; B2.desc = "A small bottle. Contains " + D3.agent + " culture in synthblood medium."; B2.reagents.add_reagent("blood", 20, data); this.updateUsrDialog(); } else { this.temp_html = "The replicator is not ready yet."; } this.updateUsrDialog(); return(null); } else if (Lang13.Bool(href_list["empty_beaker"])) { ((Reagents)this.beaker.reagents).clear_reagents(); this.updateUsrDialog(); return(null); } else if (Lang13.Bool(href_list["eject"])) { this.beaker.loc = this.loc; this.beaker = null; this.icon_state = "mixer0"; this.updateUsrDialog(); return(null); } else if (Lang13.Bool(href_list["clear"])) { this.temp_html = ""; this.updateUsrDialog(); return(null); } else if (Lang13.Bool(href_list["name_disease"])) { new_name = GlobalFuncs.stripped_input(Task13.User, "Name the Disease", "New Name", "", 26); if (!Lang13.Bool(new_name)) { return(null); } if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc)))) { return(null); } id = this.GetVirusTypeByIndex(String13.ParseNumber(href_list["name_disease"])); if (Lang13.Bool(GlobalVars.archive_diseases[id])) { A2 = GlobalVars.archive_diseases[id]; A2.AssignName(new_name); foreach (dynamic _a in Lang13.Enumerate(GlobalVars.SSdisease.processing, typeof(Disease_Advance))) { AD = _a; AD.Refresh(); } } this.updateUsrDialog(); } else { Interface13.Browse(Task13.User, null, "window=pandemic"); this.updateUsrDialog(); return(null); } this.add_fingerprint(Task13.User); return(null); }
public void CheckData(Base_Data data) { data.Check(); }
// Function from file: holder.dm public bool add_reagent(dynamic reagent = null, dynamic amount = null, dynamic data = null, dynamic reagtemp = null, bool?no_react = null) { reagtemp = reagtemp ?? 300; no_react = no_react ?? false; dynamic A = null; dynamic R = null; Base_Data D = null; dynamic R2 = null; if (!Lang13.Bool(Lang13.IsNumber(amount)) || !Lang13.Bool(amount)) { return(true); } this.update_total(); if ((this.total_volume ?? 0) + Convert.ToDouble(amount) > Convert.ToDouble(this.maximum_volume)) { amount = this.maximum_volume - this.total_volume; } this.chem_temp = Num13.Floor(Convert.ToDouble((amount * reagtemp + (this.total_volume ?? 0) * Convert.ToDouble(this.chem_temp)) / ((this.total_volume ?? 0) + Convert.ToDouble(amount)))); foreach (dynamic _a in Lang13.Enumerate(this.reagent_list)) { A = _a; R = A; if (R.id == reagent) { R.volume += amount; this.update_total(); ((Ent_Static)this.my_atom).on_reagent_change(); ((Reagent)R).on_merge(data); if (!(no_react == true)) { this.handle_reactions(); } return(false); } } D = GlobalVars.chemical_reagents_list[reagent]; if (D != null) { R2 = Lang13.Call(D.type, data); this.reagent_list.Add(R2); R2.holder = this; R2.volume = amount; if (Lang13.Bool(data)) { R2.data = data; ((Reagent)R2).on_new(data); } this.update_total(); ((Ent_Static)this.my_atom).on_reagent_change(); if (!(no_react == true)) { this.handle_reactions(); } return(false); } else { GlobalFuncs.warning("" + ("" + this.my_atom + " attempted to add a reagent called ' " + reagent + " ' which doesn't exist. (" + Task13.User + ")") + " in " + "code/modules/reagents/chemistry/holder.dm" + " at line " + 518 + " src: " + this + " usr: "******"."); } if (!(no_react == true)) { this.handle_reactions(); } return(true); }