// Function from file: conveyor2.dm public Obj_Machinery_ConveyorSwitch(dynamic newloc = null, dynamic newid = null) : base((object)(newloc)) { Obj_Machinery_Conveyor C = null; // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!; if (!Lang13.Bool(this.id)) { this.id = newid; } this.update(); Task13.Schedule(5, (Task13.Closure)(() => { this.conveyors = new ByTable(); foreach (dynamic _a in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_Conveyor))) { C = _a; if (C.id == this.id) { this.conveyors.Add(C); } } return; })); return; }
// Function from file: conveyor2.dm public override bool afterattack(dynamic target = null, dynamic user = null, bool?proximity_flag = null, string click_parameters = null) { bool found = false; Obj_Machinery_Conveyor C = null; Obj_Machinery_ConveyorSwitch NC = null; if (!(proximity_flag == true) || Lang13.Bool(user.stat) || !(target is Tile_Simulated_Floor) || target is Zone_Shuttle) { return(false); } found = false; foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInView(null, null), typeof(Obj_Machinery_Conveyor))) { C = _a; if (C.id == this.id) { found = true; break; } } if (!found) { user.WriteMsg(new Txt().icon(this).str("<span class=notice>The conveyor switch did not detect any linked conveyor belts in range.</span>").ToString()); return(false); } NC = new Obj_Machinery_ConveyorSwitch(target, this.id); this.transfer_fingerprints_to(NC); GlobalFuncs.qdel(this); return(false); }
// Function from file: conveyor2.dm public override int?process(dynamic seconds = null) { Obj_Machinery_Conveyor C = null; if (!this.operated) { return(null); } this.operated = false; foreach (dynamic _a in Lang13.Enumerate(this.conveyors, typeof(Obj_Machinery_Conveyor))) { C = _a; C.operating = this.position; C.update_move_direction(); } return(null); }
// Function from file: conveyor2.dm public override bool afterattack(dynamic target = null, dynamic user = null, bool?proximity_flag = null, string click_parameters = null) { double?cdir = null; Obj_Machinery_Conveyor C = null; if (!(proximity_flag == true) || Lang13.Bool(user.stat) || !(target is Tile_Simulated_Floor) || target is Zone_Shuttle) { return(false); } cdir = Map13.GetDistance(target, user); if (target == user.loc) { user.WriteMsg("<span class='notice'>You cannot place a conveyor belt under yourself.</span>"); return(false); } C = new Obj_Machinery_Conveyor(target, cdir); C.id = this.id; this.transfer_fingerprints_to(C); GlobalFuncs.qdel(this); return(false); }