// Function from file: light.dm public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null) { Obj_Item_Stack_CableCoil CC = null; Obj_Item_Stack_Sheet_Glass G = null; dynamic M = null; Obj_Item_Stack_Tile_Light L = null; base.attackby((object)(A), (object)(user), _params, silent, replace_spent); if (A is Obj_Item_Weapon_Wirecutters) { CC = new Obj_Item_Stack_CableCoil(user.loc); CC.amount = 5; CC.add_fingerprint(user); this.amount--; G = new Obj_Item_Stack_Sheet_Glass(user.loc); G.add_fingerprint(user); if ((this.amount ?? 0) <= 0) { ((Mob)user).unEquip(this, 1); GlobalFuncs.qdel(this); } } if (A is Obj_Item_Stack_Sheet_Metal) { M = A; if (Lang13.Bool(M.use(1))) { this.use(1); L = new Obj_Item_Stack_Tile_Light(user.loc); user.WriteMsg("<span class='notice'>You make a light tile.</span>"); L.add_fingerprint(user); } else { user.WriteMsg("<span class='warning'>You need one metal sheet to finish the light tile!</span>"); return(null); } } return(null); }
// Function from file: buildandrepair.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 M = null; dynamic B = null; dynamic C = null; Obj_Item_Stack_CableCoil A2 = null; dynamic G = null; Obj_Item_Stack_Sheet_Glass G2 = null; dynamic B2 = null; this.add_fingerprint(user); switch ((int)(this.state)) { case 0: if (A is Obj_Item_Weapon_Wrench) { GlobalFuncs.playsound(this.loc, "sound/items/ratchet.ogg", 50, 1); user.WriteMsg("<span class='notice'>You start wrenching the frame into place...</span>"); if (GlobalFuncs.do_after(user, 20 / A.toolspeed, null, this)) { user.WriteMsg("<span class='notice'>You wrench the frame into place.</span>"); this.anchored = 1; this.state = 1; } } if (A is Obj_Item_Weapon_Weldingtool) { WT = A; if (!((Obj_Item_Weapon_Weldingtool)WT).remove_fuel(0, user)) { if (!((Obj_Item_Weapon_Weldingtool)WT).isOn()) { user.WriteMsg("<span class='warning'>The welding tool must be on to complete this task!</span>"); } return(null); } GlobalFuncs.playsound(this.loc, "sound/items/welder.ogg", 50, 1); user.WriteMsg("<span class='notice'>You start deconstructing the frame...</span>"); if (GlobalFuncs.do_after(user, 20 / A.toolspeed, null, this)) { if (!(this != null) || !((Obj_Item_Weapon_Weldingtool)WT).isOn()) { return(null); } user.WriteMsg("<span class='notice'>You deconstruct the frame.</span>"); M = new Obj_Item_Stack_Sheet_Metal(this.loc, 5); M.add_fingerprint(user); GlobalFuncs.qdel(this); } } break; case 1: if (A is Obj_Item_Weapon_Wrench) { GlobalFuncs.playsound(this.loc, "sound/items/ratchet.ogg", 50, 1); user.WriteMsg("<span class='notice'>You start to unfasten the frame...</span>"); if (GlobalFuncs.do_after(user, 20 / A.toolspeed, null, this)) { user.WriteMsg("<span class='notice'>You unfasten the frame.</span>"); this.anchored = 0; this.state = 0; } } if (A is Obj_Item_Weapon_Circuitboard && !Lang13.Bool(this.circuit)) { B = A; if (B.board_type == "computer") { if (!Lang13.Bool(user.drop_item())) { return(null); } GlobalFuncs.playsound(this.loc, "sound/items/Deconstruct.ogg", 50, 1); user.WriteMsg("<span class='notice'>You place the circuit board inside the frame.</span>"); this.icon_state = "1"; this.circuit = A; ((Ent_Static)this.circuit).add_fingerprint(user); A.loc = null; } else { user.WriteMsg("<span class='warning'>This frame does not accept circuit boards of this type!</span>"); } } if (A is Obj_Item_Weapon_Screwdriver && Lang13.Bool(this.circuit)) { GlobalFuncs.playsound(this.loc, "sound/items/Screwdriver.ogg", 50, 1); user.WriteMsg("<span class='notice'>You screw the circuit board into place.</span>"); this.state = 2; this.icon_state = "2"; } if (A is Obj_Item_Weapon_Crowbar && Lang13.Bool(this.circuit)) { GlobalFuncs.playsound(this.loc, "sound/items/Crowbar.ogg", 50, 1); user.WriteMsg("<span class='notice'>You remove the circuit board.</span>"); this.state = 1; this.icon_state = "0"; this.circuit.loc = this.loc; ((Ent_Static)this.circuit).add_fingerprint(user); this.circuit = null; } break; case 2: if (A is Obj_Item_Weapon_Screwdriver && Lang13.Bool(this.circuit)) { GlobalFuncs.playsound(this.loc, "sound/items/Screwdriver.ogg", 50, 1); user.WriteMsg("<span class='notice'>You unfasten the circuit board.</span>"); this.state = 1; this.icon_state = "1"; } if (A is Obj_Item_Stack_CableCoil) { C = A; if ((((Obj_Item_Stack)C).get_amount() ?? 0) >= 5) { GlobalFuncs.playsound(this.loc, "sound/items/Deconstruct.ogg", 50, 1); user.WriteMsg("<span class='notice'>You start adding cables to the frame...</span>"); if (GlobalFuncs.do_after(user, 20 / A.toolspeed, null, this)) { if ((((Obj_Item_Stack)C).get_amount() ?? 0) >= 5 && this.state == 2) { C.use(5); user.WriteMsg("<span class='notice'>You add cables to the frame.</span>"); this.state = 3; this.icon_state = "3"; } } } else { user.WriteMsg("<span class='warning'>You need five lengths of cable to wire the frame!</span>"); } } break; case 3: if (A is Obj_Item_Weapon_Wirecutters) { GlobalFuncs.playsound(this.loc, "sound/items/Wirecutter.ogg", 50, 1); user.WriteMsg("<span class='notice'>You remove the cables.</span>"); this.state = 2; this.icon_state = "2"; A2 = new Obj_Item_Stack_CableCoil(this.loc); A2.amount = 5; A2.add_fingerprint(user); } if (A is Obj_Item_Stack_Sheet_Glass) { G = A; if ((((Obj_Item_Stack)G).get_amount() ?? 0) < 2) { user.WriteMsg("<span class='warning'>You need two glass sheets to continue construction!</span>"); return(null); } else { GlobalFuncs.playsound(this.loc, "sound/items/Deconstruct.ogg", 50, 1); user.WriteMsg("<span class='notice'>You start to put in the glass panel...</span>"); if (GlobalFuncs.do_after(user, 20, null, this)) { if ((((Obj_Item_Stack)G).get_amount() ?? 0) >= 2 && this.state == 3) { G.use(2); user.WriteMsg("<span class='notice'>You put in the glass panel.</span>"); this.state = 4; this.icon_state = "4"; } } } } break; case 4: if (A is Obj_Item_Weapon_Crowbar) { GlobalFuncs.playsound(this.loc, "sound/items/Crowbar.ogg", 50, 1); user.WriteMsg("<span class='notice'>You remove the glass panel.</span>"); this.state = 3; this.icon_state = "3"; G2 = new Obj_Item_Stack_Sheet_Glass(this.loc, 2); G2.add_fingerprint(user); } if (A is Obj_Item_Weapon_Screwdriver) { GlobalFuncs.playsound(this.loc, "sound/items/Screwdriver.ogg", 50, 1); user.WriteMsg("<span class='notice'>You connect the monitor.</span>"); B2 = Lang13.Call(this.circuit.build_path, this.loc, this.circuit); this.transfer_fingerprints_to(B2); GlobalFuncs.qdel(this); } break; } return(null); }
// Function from file: window.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_Sheet_Glass G = null; if (!this.can_be_reached(user)) { return(1); } this.add_fingerprint(user); if (A is Obj_Item_Weapon_Weldingtool && user.a_intent == "help") { WT = A; if (this.health < this.maxhealth) { if (((Obj_Item_Weapon_Weldingtool)WT).remove_fuel(0, user)) { user.WriteMsg("<span class='notice'>You begin repairing " + this + "...</span>"); GlobalFuncs.playsound(this.loc, "sound/items/welder.ogg", 40, 1); if (GlobalFuncs.do_after(user, 40 / A.toolspeed, null, this)) { this.health = this.maxhealth; GlobalFuncs.playsound(this.loc, "sound/items/welder2.ogg", 50, 1); this.update_nearby_icons(); user.WriteMsg("<span class='notice'>You repair " + this + ".</span>"); } } } else { user.WriteMsg("<span class='warning'>" + this + " is already in good condition!</span>"); } return(null); } if (!Lang13.Bool(this.flags & 128)) { if (A is Obj_Item_Weapon_Screwdriver) { GlobalFuncs.playsound(this.loc, "sound/items/Screwdriver.ogg", 75, 1); if (this.reinf == true && (this.state == 2 || this.state == 1)) { user.WriteMsg((this.state == 2 ? "<span class='notice'>You begin to unscrew the window from the frame...</span>" : "<span class='notice'>You begin to screw the window to the frame...</span>")); } else if (this.reinf == true && this.state == 0) { user.WriteMsg((Lang13.Bool(this.anchored) ? "<span class='notice'>You begin to unscrew the frame from the floor...</span>" : "<span class='notice'>You begin to screw the frame to the floor...</span>")); } else if (!(this.reinf == true)) { user.WriteMsg((Lang13.Bool(this.anchored) ? "<span class='notice'>You begin to unscrew the window from the floor...</span>" : "<span class='notice'>You begin to screw the window to the floor...</span>")); } if (GlobalFuncs.do_after(user, 40 / A.toolspeed, null, this)) { if (this.reinf == true && (this.state == 1 || this.state == 2)) { this.state = (this.state == 1 ? 2 : 1); user.WriteMsg((this.state == 1 ? "<span class='notice'>You unfasten the window from the frame.</span>" : "<span class='notice'>You fasten the window to the frame.</span>")); } else if (this.reinf == true && this.state == 0) { this.anchored = !Lang13.Bool(this.anchored); this.update_nearby_icons(); user.WriteMsg((Lang13.Bool(this.anchored) ? "<span class='notice'>You fasten the frame to the floor.</span>" : "<span class='notice'>You unfasten the frame from the floor.</span>")); } else if (!(this.reinf == true)) { this.anchored = !Lang13.Bool(this.anchored); this.update_nearby_icons(); user.WriteMsg((Lang13.Bool(this.anchored) ? "<span class='notice'>You fasten the window to the floor.</span>" : "<span class='notice'>You unfasten the window.</span>")); } } return(null); } else if (A is Obj_Item_Weapon_Crowbar && this.reinf == true && (this.state == 0 || this.state == 1)) { user.WriteMsg((this.state == 0 ? "<span class='notice'>You begin to lever the window into the frame...</span>" : "<span class='notice'>You begin to lever the window out of the frame...</span>")); GlobalFuncs.playsound(this.loc, "sound/items/Crowbar.ogg", 75, 1); if (GlobalFuncs.do_after(user, 40 / A.toolspeed, null, this)) { this.state = (this.state == 0 ? true : false); user.WriteMsg((this.state == 1 ? "<span class='notice'>You pry the window into the frame.</span>" : "<span class='notice'>You pry the window out of the frame.</span>")); } return(null); } else if (A is Obj_Item_Weapon_Wrench && !Lang13.Bool(this.anchored)) { GlobalFuncs.playsound(this.loc, "sound/items/ratchet.ogg", 75, 1); user.WriteMsg("<span class='notice'> You begin to disassemble " + this + "...</span>"); if (GlobalFuncs.do_after(user, 40 / A.toolspeed, null, this)) { if (this.disassembled) { return(null); } if (this.reinf == true) { RG = new Obj_Item_Stack_Sheet_Rglass(user.loc); RG.add_fingerprint(user); if (this.fulltile) { RG = new Obj_Item_Stack_Sheet_Rglass(user.loc); RG.add_fingerprint(user); } } else { G = new Obj_Item_Stack_Sheet_Glass(user.loc); G.add_fingerprint(user); if (this.fulltile) { G = new Obj_Item_Stack_Sheet_Glass(user.loc); G.add_fingerprint(user); } } GlobalFuncs.playsound(this.loc, "sound/items/Deconstruct.ogg", 50, 1); this.disassembled = true; user.WriteMsg("<span class='notice'>You successfully disassemble " + this + ".</span>"); GlobalFuncs.qdel(this); } return(null); } } if (A is Obj_Item_Weapon_Rcd) { return(null); } if (A.damtype == "brute" || A.damtype == "fire") { ((Mob)user).changeNext_move(8); this.hit(A.force); } else { GlobalFuncs.playsound(this.loc, "sound/effects/Glasshit.ogg", 75, 1); } base.attackby((object)(A), (object)(user), _params, silent, replace_spent); return(null); }