// Function from file: rods.dm public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null) { dynamic WT = null; Obj_Item_Stack_Sheet_Metal new_item = null; Obj_Item_Stack_Rods R = null; bool replace = false; dynamic S = null; Obj_Item_Weapon_ReagentContainers_Food_Snacks_Customizable_Kebab A2 = null; if (A is Obj_Item_Weapon_Weldingtool) { WT = A; if ((this.get_amount() ?? 0) < 2) { user.WriteMsg("<span class='warning'>You need at least two rods to do this!</span>"); return(null); } if (((Obj_Item_Weapon_Weldingtool)WT).remove_fuel(0, user)) { new_item = new Obj_Item_Stack_Sheet_Metal(Task13.User.loc); ((Ent_Static)user).visible_message("" + user.name + " shaped " + this + " into metal with the welding tool.", "<span class='notice'>You shape " + this + " into metal with the welding tool.</span>", "<span class='italics'>You hear welding.</span>"); R = this; Task13.Source = null; replace = ((Mob)user).get_inactive_hand() == R; R.use(2); if (!(R != null) && replace) { ((Mob)user).put_in_hands(new_item); } } return(null); } if (A is Obj_Item_Weapon_ReagentContainers_Food_Snacks) { S = A; if (this.amount != 1) { user.WriteMsg("<span class='warning'>You must use a single rod!</span>"); } else if (Convert.ToDouble(S.w_class) > 2) { user.WriteMsg("<span class='warning'>The ingredient is too big for " + this + "!</span>"); } else { A2 = new Obj_Item_Weapon_ReagentContainers_Food_Snacks_Customizable_Kebab(GlobalFuncs.get_turf(this)); A2.initialize_custom_food(this, S, user); } return(null); } base.attackby((object)(A), (object)(user), _params, silent, replace_spent); return(null); }
// Function from file: grille.dm public void Break( ) { Obj_Item_Stack_Rods newrods = null; this.icon_state = "brokengrille"; this.density = false; this.destroyed = true; this.stored.amount = 1; if (!Lang13.Bool(this.flags & 128)) { newrods = new Obj_Item_Stack_Rods(this.loc); this.transfer_fingerprints_to(newrods); } return; }
// Function from file: window.dm public Obj_Structure_Window(dynamic Loc = null, bool?re = null) : base((object)(Loc)) { re = re ?? false; Obj_Item_Stack_Rods R = null; // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!; this.health = this.maxhealth; if (re == true) { this.reinf = re; } if (this.reinf == true) { this.state = this.anchored * 2; } Task13.Schedule(5, (Task13.Closure)(() => { if (!Lang13.Bool(this.flags & 128)) { this.storeditems.Add(new Obj_Item_Weapon_Shard(this)); if (this.fulltile) { this.storeditems.Add(new Obj_Item_Weapon_Shard(this)); } if (this.reinf == true) { R = new Obj_Item_Stack_Rods(this); this.storeditems.Add(R); if (this.fulltile) { R.add(1); } } } return; })); this.ini_dir = this.dir; this.air_update_turf(true); return; }
// Function from file: lattice.dm public Obj_Structure_Lattice(dynamic loc = null) : base((object)(loc)) { Obj_Structure_Lattice LAT = null; // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!; if (!(this.loc is Tile_Space)) { GlobalFuncs.qdel(this); } foreach (dynamic _a in Lang13.Enumerate(this.loc, typeof(Obj_Structure_Lattice))) { LAT = _a; if (LAT != this) { GlobalFuncs.qdel(LAT); } } this.stored = new Obj_Item_Stack_Rods(this); return; }
// Function from file: grille.dm public Obj_Structure_Grille(dynamic loc = null) : base((object)(loc)) { this.stored = new Obj_Item_Stack_Rods(this); this.stored.amount = 2; return; }
// Function from file: windoor_assembly.dm public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null) { dynamic WT = null; Obj_Item_Stack_Sheet_Rglass RG = null; Obj_Item_Stack_Rods R = null; Obj_Machinery_Door_Window WD = null; Obj_Machinery_Door_Window WD2 = null; dynamic P = null; dynamic CC = null; dynamic ae = null; string t = null; Obj_Machinery_Door_Window_Brigdoor windoor = null; Obj_Machinery_Door_Window windoor2 = null; this.add_fingerprint(user); switch ((string)(this.state)) { case "01": if (A is Obj_Item_Weapon_Weldingtool && !Lang13.Bool(this.anchored)) { WT = A; if (((Obj_Item_Weapon_Weldingtool)WT).remove_fuel(0, user)) { ((Ent_Static)user).visible_message("" + user + " disassembles the windoor assembly.", "<span class='notice'>You start to disassemble the windoor assembly...</span>"); GlobalFuncs.playsound(this.loc, "sound/items/welder2.ogg", 50, 1); if (GlobalFuncs.do_after(user, 40 / A.toolspeed, null, this)) { if (!(this != null) || !((Obj_Item_Weapon_Weldingtool)WT).isOn()) { return(null); } user.WriteMsg("<span class='notice'>You disassemble the windoor assembly.</span>"); RG = new Obj_Item_Stack_Sheet_Rglass(GlobalFuncs.get_turf(this), 5); RG.add_fingerprint(user); if (this.secure) { R = new Obj_Item_Stack_Rods(GlobalFuncs.get_turf(this), 4); R.add_fingerprint(user); } GlobalFuncs.qdel(this); } } else { return(null); } } if (A is Obj_Item_Weapon_Wrench && !Lang13.Bool(this.anchored)) { foreach (dynamic _a in Lang13.Enumerate(this.loc, typeof(Obj_Machinery_Door_Window))) { WD = _a; if (WD.dir == this.dir) { user.WriteMsg("<span class='warning'>There is already a windoor in that location!</span>"); return(null); } } GlobalFuncs.playsound(this.loc, "sound/items/ratchet.ogg", 100, 1); ((Ent_Static)user).visible_message("" + user + " secures the windoor assembly to the floor.", "<span class='notice'>You start to secure the windoor assembly to the floor...</span>"); if (GlobalFuncs.do_after(user, 40 / A.toolspeed, null, this)) { if (!(this != null) || Lang13.Bool(this.anchored)) { return(null); } foreach (dynamic _b in Lang13.Enumerate(this.loc, typeof(Obj_Machinery_Door_Window))) { WD2 = _b; if (WD2.dir == this.dir) { user.WriteMsg("<span class='warning'>There is already a windoor in that location!</span>"); return(null); } } user.WriteMsg("<span class='notice'>You secure the windoor assembly.</span>"); this.anchored = 1; if (this.secure) { this.name = "secure anchored windoor assembly"; } else { this.name = "anchored windoor assembly"; } } } else if (A is Obj_Item_Weapon_Wrench && Lang13.Bool(this.anchored)) { GlobalFuncs.playsound(this.loc, "sound/items/ratchet.ogg", 100, 1); ((Ent_Static)user).visible_message("" + user + " unsecures the windoor assembly to the floor.", "<span class='notice'>You start to unsecure the windoor assembly to the floor...</span>"); if (GlobalFuncs.do_after(user, 40 / A.toolspeed, null, this)) { if (!(this != null) || !Lang13.Bool(this.anchored)) { return(null); } user.WriteMsg("<span class='notice'>You unsecure the windoor assembly.</span>"); this.anchored = 0; if (this.secure) { this.name = "secure windoor assembly"; } else { this.name = "windoor assembly"; } } } else if (A is Obj_Item_Stack_Sheet_Plasteel && !this.secure) { P = A; if (Convert.ToDouble(P.amount) < 2) { user.WriteMsg("<span class='warning'>You need more plasteel to do this!</span>"); return(null); } user.WriteMsg("<span class='notice'>You start to reinforce the windoor with plasteel...</span>"); if (GlobalFuncs.do_after(user, 40, null, this)) { if (!(this != null) || this.secure) { return(null); } P.use(2); user.WriteMsg("<span class='notice'>You reinforce the windoor.</span>"); this.secure = true; if (Lang13.Bool(this.anchored)) { this.name = "secure anchored windoor assembly"; } else { this.name = "secure windoor assembly"; } } } else if (A is Obj_Item_Stack_CableCoil && Lang13.Bool(this.anchored)) { ((Ent_Static)user).visible_message("" + user + " wires the windoor assembly.", "<span class='notice'>You start to wire the windoor assembly...</span>"); if (GlobalFuncs.do_after(user, 40, null, this)) { if (!(this != null) || !Lang13.Bool(this.anchored) || this.state != "01") { return(null); } CC = A; if (!Lang13.Bool(CC.use(1))) { user.WriteMsg("<span class='warning'>You need more cable to do this!</span>"); return(null); } user.WriteMsg("<span class='notice'>You wire the windoor.</span>"); this.state = "02"; if (this.secure) { this.name = "secure wired windoor assembly"; } else { this.name = "wired windoor assembly"; } } } else { base.attackby((object)(A), (object)(user), _params, silent, replace_spent); } break; case "02": if (A is Obj_Item_Weapon_Wirecutters) { GlobalFuncs.playsound(this.loc, "sound/items/Wirecutter.ogg", 100, 1); ((Ent_Static)user).visible_message("" + user + " cuts the wires from the airlock assembly.", "<span class='notice'>You start to cut the wires from airlock assembly...</span>"); if (GlobalFuncs.do_after(user, 40 / A.toolspeed, null, this)) { if (!(this != null) || this.state != "02") { return(null); } user.WriteMsg("<span class='notice'>You cut the windoor wires.</span>"); new Obj_Item_Stack_CableCoil(GlobalFuncs.get_turf(user), 1); this.state = "01"; if (this.secure) { this.name = "secure anchored windoor assembly"; } else { this.name = "anchored windoor assembly"; } } } else if (A is Obj_Item_Weapon_Electronics_Airlock) { if (!Lang13.Bool(user.drop_item())) { return(null); } GlobalFuncs.playsound(this.loc, "sound/items/Screwdriver.ogg", 100, 1); ((Ent_Static)user).visible_message("" + user + " installs the electronics into the airlock assembly.", "<span class='notice'>You start to install electronics into the airlock assembly...</span>"); A.loc = this; if (GlobalFuncs.do_after(user, 40, null, this)) { if (!(this != null) || Lang13.Bool(this.electronics)) { A.loc = this.loc; return(null); } user.WriteMsg("<span class='notice'>You install the airlock electronics.</span>"); this.name = "near finished windoor assembly"; this.electronics = A; } else { A.loc = this.loc; } } else if (A is Obj_Item_Weapon_Screwdriver) { if (!Lang13.Bool(this.electronics)) { return(null); } GlobalFuncs.playsound(this.loc, "sound/items/Screwdriver.ogg", 100, 1); ((Ent_Static)user).visible_message("" + user + " removes the electronics from the airlock assembly.", "<span class='notice'>You start to uninstall electronics from the airlock assembly...</span>"); if (GlobalFuncs.do_after(user, 40 / A.toolspeed, null, this)) { if (!(this != null) || !Lang13.Bool(this.electronics)) { return(null); } user.WriteMsg("<span class='notice'>You remove the airlock electronics.</span>"); this.name = "wired windoor assembly"; ae = null; ae = this.electronics; this.electronics = null; ae.loc = this.loc; } } else if (A is Obj_Item_Weapon_Pen) { t = GlobalFuncs.stripped_input(user, "Enter the name for the door.", this.name, this.created_name, 26); if (!Lang13.Bool(t)) { return(null); } if (!(Map13.GetDistance(this, Task13.User) <= 1) && this.loc != Task13.User) { return(null); } this.created_name = t; return(null); } else if (A is Obj_Item_Weapon_Crowbar) { if (!Lang13.Bool(this.electronics)) { Task13.User.WriteMsg("<span class='warning'>The assembly is missing electronics!</span>"); return(null); } Interface13.Browse(Task13.User, null, "window=windoor_access"); GlobalFuncs.playsound(this.loc, "sound/items/Crowbar.ogg", 100, 1); ((Ent_Static)user).visible_message("" + user + " pries the windoor into the frame.", "<span class='notice'>You start prying the windoor into the frame...</span>"); if (GlobalFuncs.do_after(user, 40 / A.toolspeed, null, this)) { if (this.loc != null && Lang13.Bool(this.electronics)) { this.density = true; user.WriteMsg("<span class='notice'>You finish the windoor.</span>"); if (this.secure) { windoor = new Obj_Machinery_Door_Window_Brigdoor(this.loc); if (this.facing == "l") { windoor.icon_state = "leftsecureopen"; windoor.base_state = "leftsecure"; } else { windoor.icon_state = "rightsecureopen"; windoor.base_state = "rightsecure"; } windoor.dir = this.dir; windoor.density = false; if (this.electronics.one_access) { windoor.req_one_access = this.electronics.accesses; } else { windoor.req_access = this.electronics.accesses; } windoor.electronics = this.electronics; this.electronics.loc = windoor; if (Lang13.Bool(this.created_name)) { windoor.name = this.created_name; } GlobalFuncs.qdel(this); windoor.close(); } else { windoor2 = new Obj_Machinery_Door_Window(this.loc); if (this.facing == "l") { windoor2.icon_state = "leftopen"; windoor2.base_state = "left"; } else { windoor2.icon_state = "rightopen"; windoor2.base_state = "right"; } windoor2.dir = this.dir; windoor2.density = false; windoor2.req_access = this.electronics.accesses; windoor2.electronics = this.electronics; this.electronics.loc = windoor2; if (Lang13.Bool(this.created_name)) { windoor2.name = this.created_name; } GlobalFuncs.qdel(this); windoor2.close(); } } } } else { base.attackby((object)(A), (object)(user), _params, silent, replace_spent); } break; } this.update_icon(); return(null); }