public void Wrap( ) { ByTable choices = null; Mob_Living L = null; Obj O = null; Obj_Effect_Spider_Cocoon C = null; bool large_cocoon = false; Obj_Item I = null; Obj_Structure S = null; Obj_Machinery M = null; Mob_Living L2 = null; if (this.stat == 2) { return; } if (!Lang13.Bool(this.cocoon_target)) { choices = new ByTable(); foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInView(this, 1), typeof(Mob_Living))) { L = _a; if (L == this) { continue; } if (this.Adjacent(L)) { choices.Add(L); } } foreach (dynamic _b in Lang13.Enumerate(this.loc, typeof(Obj))) { O = _b; if (this.Adjacent(O)) { choices.Add(O); } } this.cocoon_target = Interface13.Input(this, "What do you wish to cocoon?", null, null, null | choices, InputType.Any); } if (Lang13.Bool(this.cocoon_target) && this.busy != 4) { this.busy = 4; this.visible_message(new Txt("<span class='notice'>").the(this).item().str(" begins to secrete a sticky substance around ").the(this.cocoon_target).item().str(".</span>").ToString()); this.stop_automated_movement = true; Map13.Walk(this, 0, 0); if (GlobalFuncs.do_after(this, 50, null, this)) { if (this.busy == 4) { if (Lang13.Bool(this.cocoon_target) && this.cocoon_target.loc is Tile && Map13.GetDistance(this, this.cocoon_target) <= 1) { C = new Obj_Effect_Spider_Cocoon(this.cocoon_target.loc); large_cocoon = false; C.pixel_x = Convert.ToInt32(this.cocoon_target.pixel_x); C.pixel_y = Convert.ToInt32(this.cocoon_target.pixel_y); foreach (dynamic _c in Lang13.Enumerate(C.loc, typeof(Obj_Item))) { I = _c; I.loc = C; } foreach (dynamic _d in Lang13.Enumerate(C.loc, typeof(Obj_Structure))) { S = _d; if (!Lang13.Bool(S.anchored)) { S.loc = C; large_cocoon = true; } } foreach (dynamic _e in Lang13.Enumerate(C.loc, typeof(Obj_Machinery))) { M = _e; if (!Lang13.Bool(M.anchored)) { M.loc = C; large_cocoon = true; } } foreach (dynamic _f in Lang13.Enumerate(C.loc, typeof(Mob_Living))) { L2 = _f; if (L2 is Mob_Living_SimpleAnimal_Hostile_Poison_GiantSpider) { continue; } large_cocoon = true; L2.loc = C; C.pixel_x = L2.pixel_x; C.pixel_y = L2.pixel_y; this.fed++; this.visible_message(new Txt("<span class='danger'>").the(this).item().str(" sticks a proboscis into ").the(L2).item().str(" and sucks a viscous substance out.</span>").ToString()); break; } if (large_cocoon) { C.icon_state = Rand13.Pick(new object [] { "cocoon_large1", "cocoon_large2", "cocoon_large3" }); } } } } this.cocoon_target = null; this.busy = 0; this.stop_automated_movement = false; } return; }
// Function from file: giant_spider.dm public override bool handle_automated_action( ) { ByTable can_see = null; Mob_Living C = null; dynamic W = null; Obj O = null; if (base.handle_automated_action()) { can_see = Map13.FetchInView(10, this); if (!(this.busy != 0) && Rand13.PercentChance(30)) { foreach (dynamic _a in Lang13.Enumerate(can_see, typeof(Mob_Living))) { C = _a; if (C.stat != 0 && !(C is Mob_Living_SimpleAnimal_Hostile_Poison_GiantSpider)) { this.cocoon_target = C; this.busy = 3; this.Goto(C, this.move_to_delay); this.GiveUp(C); return(false); } } W = Lang13.FindIn(typeof(Obj_Effect_Spider_Stickyweb), GlobalFuncs.get_turf(this)); if (!Lang13.Bool(W)) { this.Web(); } else if (this.fed != 0) { this.LayEggs(); } else { foreach (dynamic _b in Lang13.Enumerate(can_see, typeof(Obj))) { O = _b; if (Lang13.Bool(O.anchored)) { continue; } if (O is Obj_Item || O is Obj_Structure || O is Obj_Machinery) { this.cocoon_target = O; this.busy = 3; this.stop_automated_movement = true; this.Goto(O, this.move_to_delay); this.GiveUp(O); } } } } else if (this.busy == 3 && Lang13.Bool(this.cocoon_target)) { if (Map13.GetDistance(this, this.cocoon_target) <= 1) { this.Wrap(); } } } else { this.busy = 0; this.stop_automated_movement = false; } return(false); }
// Function from file: area_teleport.dm public override bool cast(dynamic targets = null, dynamic thearea = null, dynamic user = null) { user = user ?? Task13.User; Mob_Living target = null; ByTable L = null; dynamic T = null; bool clear = false; Obj O = null; ByTable tempL = null; dynamic attempt = null; bool success = false; GlobalFuncs.playsound(GlobalFuncs.get_turf(user), this.sound1, 50, 1); foreach (dynamic _c in Lang13.Enumerate(targets, typeof(Mob_Living))) { target = _c; 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)) { Task13.User.WriteMsg("The spell matrix was unable to locate a suitable teleport destination for an unknown reason. Sorry."); return(false); } if (target != null && 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); GlobalFuncs.playsound(GlobalFuncs.get_turf(user), this.sound2, 50, 1); } } return(false); }
// Function from file: jobs.dm public bool EquipRank(dynamic H = null, dynamic rank = null, bool?joined_late = null) { joined_late = joined_late ?? false; Job job = null; dynamic S = null; Obj_Effect_Landmark_Start sloc = null; dynamic T = null; bool clear = false; Obj O = null; dynamic new_mob = null; job = this.GetJob(rank); H.job = rank; if (!(joined_late == true)) { S = null; foreach (dynamic _a in Lang13.Enumerate(GlobalVars.start_landmarks_list, typeof(Obj_Effect_Landmark_Start))) { sloc = _a; if (sloc.name != rank) { S = sloc; continue; } if (Lang13.Bool(Lang13.FindIn(typeof(Mob_Living), sloc.loc))) { continue; } S = sloc; break; } if (!Lang13.Bool(S)) { Game13.log.WriteMsg("Couldn't find a round start spawn point for " + rank); S = Rand13.PickFromTable(GlobalVars.latejoin); } if (!Lang13.Bool(S)) { Game13.log.WriteMsg("Couldn't find a round start latejoin spawn point."); foreach (dynamic _c in Lang13.Enumerate(GlobalFuncs.get_area_turfs(typeof(Zone_Shuttle_Arrival)))) { T = _c; if (!T.density) { clear = true; foreach (dynamic _b in Lang13.Enumerate(T, typeof(Obj))) { O = _b; if (O.density) { clear = false; break; } } if (clear) { S = T; continue; } } } } if (S is Obj_Effect_Landmark && S.loc is Tile) { H.loc = S.loc; } } if (Lang13.Bool(H.mind)) { H.mind.assigned_role = rank; } if (job != null) { new_mob = job.equip(H); if (new_mob is Mob) { H = new_mob; } job.apply_fingerprints(H); } H.WriteMsg("<b>You are the " + rank + ".</b>"); H.WriteMsg("<b>As the " + rank + " you answer directly to " + job.supervisors + ". Special circumstances may change this.</b>"); H.WriteMsg("<b>To speak on your departments radio, use the :h button. To see others, look closely at your headset.</b>"); if (job.req_admin_notify) { H.WriteMsg("<b>You are playing a job that is important for Game Progression. If you have to disconnect, please notify the admins via adminhelp.</b>"); } if (Lang13.Bool(GlobalVars.config.minimal_access_threshold)) { H.WriteMsg("<FONT color='blue'><B>As this station was initially staffed with a " + (GlobalVars.config.jobs_have_minimal_access ? "full crew, only your job's necessities" : "skeleton crew, additional access may") + " have been added to your ID card.</B></font>"); } return(true); }
// Function from file: areas.dm public bool atmosalert(int danger_level = 0, Obj source = null) { ByTable cameras = null; dynamic RA = null; Obj_Machinery_Camera C = null; Mob_Living_Silicon aiPlayer = null; Obj_Machinery_Computer_StationAlert a = null; Mob_Living_SimpleAnimal_Drone D = null; Mob_Living_Silicon aiPlayer2 = null; Obj_Machinery_Computer_StationAlert a2 = null; Mob_Living_SimpleAnimal_Drone D2 = null; if (danger_level != this.atmosalm) { if (danger_level == 2) { cameras = new ByTable(); foreach (dynamic _b in Lang13.Enumerate(this.related)) { RA = _b; foreach (dynamic _a in Lang13.Enumerate(RA, typeof(Obj_Machinery_Camera))) { C = _a; cameras.Add(C); } } foreach (dynamic _c in Lang13.Enumerate(GlobalVars.player_list, typeof(Mob_Living_Silicon))) { aiPlayer = _c; aiPlayer.triggerAlarm("Atmosphere", this, cameras, source); } foreach (dynamic _d in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_Computer_StationAlert))) { a = _d; a.triggerAlarm("Atmosphere", this, cameras, source); } foreach (dynamic _e in Lang13.Enumerate(GlobalVars.mob_list, typeof(Mob_Living_SimpleAnimal_Drone))) { D = _e; D.triggerAlarm("Atmosphere", this, cameras, source); } } else if (this.atmosalm == 2) { foreach (dynamic _f in Lang13.Enumerate(GlobalVars.player_list, typeof(Mob_Living_Silicon))) { aiPlayer2 = _f; aiPlayer2.cancelAlarm("Atmosphere", this, source); } foreach (dynamic _g in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_Computer_StationAlert))) { a2 = _g; a2.cancelAlarm("Atmosphere", this, source); } foreach (dynamic _h in Lang13.Enumerate(GlobalVars.mob_list, typeof(Mob_Living_SimpleAnimal_Drone))) { D2 = _h; D2.cancelAlarm("Atmosphere", this, source); } } this.atmosalm = danger_level; return(true); } return(false); }
public override bool f_action(dynamic target = null) { ByTable theareas = null; dynamic thearea = null; ByTable L = null; dynamic pos = null; dynamic T = null; bool clear = false; Obj O = null; dynamic target_turf = null; Obj_Effect_Portal P = null; dynamic T2 = null; if (!this.action_checks(target) || this.loc.z == 2) { return(false); } theareas = GlobalFuncs.get_areas_in_range(100, this.chassis); if (!(theareas.len != 0)) { return(false); } thearea = Rand13.PickFromTable(theareas); L = new ByTable(); pos = GlobalFuncs.get_turf(this); foreach (dynamic _b in Lang13.Enumerate(GlobalFuncs.get_area_turfs(thearea.type))) { T = _b; if (!T.density && pos.z == T.z) { 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(false); } target_turf = Rand13.PickFromTable(L); if (!Lang13.Bool(target_turf)) { return(false); } P = new Obj_Effect_Portal(GlobalFuncs.get_turf(target)); P.target = target_turf; P.creator = null; P.icon = "icons/obj/objects.dmi"; P.icon_state = "anom"; P.name = "wormhole"; T2 = GlobalFuncs.get_turf(target); GlobalFuncs.message_admins(new Txt().item(GlobalFuncs.key_name_admin(this.chassis.occupant, ((dynamic)this.chassis.occupant).client)).str("(<A HREF='?_src_=holder;adminmoreinfo=").Ref(this.chassis.occupant).str("'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=").Ref(this.chassis.occupant).str("'>FLW</A>) used a Wormhole Generator in (").item(T2.x).str(",").item(T2.y).str(",").item(T2.z).str(" - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=").item(T2.x).str(";Y=").item(T2.y).str(";Z=").item(T2.z).str("'>JMP</a>)").ToString()); GlobalFuncs.log_game("" + GlobalFuncs.key_name(this.chassis.occupant) + " used a Wormhole Generator in (" + T2.x + "," + T2.y + "," + T2.z + ")"); Task13.Source = null; Task13.Schedule(Rand13.Int(150, 300), (Task13.Closure)(() => { GlobalFuncs.qdel(P); return; })); return(true); }
// Function from file: musician.dm public override dynamic Destroy( ) { this.instrumentObj = null; return base.Destroy(); }
// Function from file: area_copy.dm public dynamic copy_contents_to(dynamic A = null, bool?platingRequired = null, bool?nerf_weapons = null) { platingRequired = platingRequired ?? false; nerf_weapons = nerf_weapons ?? false; ByTable turfs_src = null; ByTable turfs_trg = null; int src_min_x = 0; int src_min_y = 0; ByTable refined_src = null; dynamic T = null; dynamic T2 = null; int trg_min_x = 0; int trg_min_y = 0; ByTable refined_trg = null; dynamic T3 = null; dynamic T4 = null; ByTable toupdate = null; ByTable copiedobjs = null; Tile_Simulated T5 = null; dynamic coordstring = null; dynamic B = null; int old_dir1 = 0; string old_icon_state1 = null; string old_icon1 = null; dynamic X = null; Obj O = null; dynamic O2 = null; dynamic M = null; dynamic SM = null; dynamic V = null; Tile_Simulated T1 = null; if (!Lang13.Bool(A) || !(this != null)) { return(0); } turfs_src = GlobalFuncs.get_area_turfs(this.type); turfs_trg = GlobalFuncs.get_area_turfs(A.type); src_min_x = 99999; src_min_y = 99999; refined_src = new ByTable(); foreach (dynamic _a in Lang13.Enumerate(turfs_src)) { T = _a; src_min_x = Num13.MinInt(src_min_x, Convert.ToInt32(T.x)); src_min_y = Num13.MinInt(src_min_y, Convert.ToInt32(T.y)); } foreach (dynamic _b in Lang13.Enumerate(turfs_src)) { T2 = _b; refined_src[T2] = "" + (T2.x - src_min_x) + "." + (T2.y - src_min_y); } trg_min_x = 99999; trg_min_y = 99999; refined_trg = new ByTable(); foreach (dynamic _c in Lang13.Enumerate(turfs_trg)) { T3 = _c; trg_min_x = Num13.MinInt(trg_min_x, Convert.ToInt32(T3.x)); trg_min_y = Num13.MinInt(trg_min_y, Convert.ToInt32(T3.y)); } foreach (dynamic _d in Lang13.Enumerate(turfs_trg)) { T4 = _d; refined_trg["" + (T4.x - trg_min_x) + "." + (T4.y - trg_min_y)] = T4; } toupdate = new ByTable(); copiedobjs = new ByTable(); foreach (dynamic _h in Lang13.Enumerate(refined_src, typeof(Tile_Simulated))) { T5 = _h; coordstring = refined_src[T5]; B = refined_trg[coordstring]; if (!(B is Tile)) { continue; } if (platingRequired == true) { if (B is Tile_Space) { continue; } } old_dir1 = T5.dir; old_icon_state1 = T5.icon_state; old_icon1 = T5.icon; X = Lang13.Call(T5.type, B); X.dir = old_dir1; X.icon = old_icon1; X.icon_state = old_icon_state1; foreach (dynamic _e in Lang13.Enumerate(T5, typeof(Obj))) { O = _e; O2 = GlobalFuncs.DuplicateObject(O, true, null, X, nerf_weapons); if (!Lang13.Bool(O2)) { continue; } copiedobjs.Add(((Ent_Static)O2).GetAllContents()); } foreach (dynamic _f in Lang13.Enumerate(T5)) { M = _f; if (M is Mob_Camera) { continue; } SM = GlobalFuncs.DuplicateObject(M, true, null, X); copiedobjs.Add(((Ent_Static)SM).GetAllContents()); } foreach (dynamic _g in Lang13.Enumerate(T5.vars - GlobalVars.forbidden_vars)) { V = _g; if (V == "air") { X.air.copy_from(T5.air); continue; } X.vars[V] = T5.vars[V]; } toupdate.Add(X); } if (toupdate.len != 0) { foreach (dynamic _i in Lang13.Enumerate(toupdate, typeof(Tile_Simulated))) { T1 = _i; T1.CalculateAdjacentTurfs(); GlobalVars.SSair.add_to_active(T1, true); } } return(copiedobjs); }
// Function from file: musician.dm public Song ( string dir = null, Obj obj = null ) { this.tempo = this.sanitize_tempo( this.tempo ); this.instrumentDir = dir; this.instrumentObj = obj; return; }
// Function from file: wizarditis.dm public void teleport( ) { ByTable theareas = null; Zone_Space S = null; dynamic thearea = null; ByTable L = null; dynamic T = null; bool clear = false; Obj O = null; theareas = GlobalFuncs.get_areas_in_range(80, this.affected_mob); foreach (dynamic _a in Lang13.Enumerate(theareas, typeof(Zone_Space))) { S = _a; theareas.Remove(S); } if (!(theareas != null) || !(theareas.len != 0)) { return; } thearea = Rand13.PickFromTable(theareas); L = new ByTable(); foreach (dynamic _c in Lang13.Enumerate(GlobalFuncs.get_area_turfs(thearea.type))) { T = _c; if (T.z != this.affected_mob.z) { continue; } if (T.name == "space") { continue; } if (!T.density) { clear = true; foreach (dynamic _b in Lang13.Enumerate(T, typeof(Obj))) { O = _b; if (O.density) { clear = false; break; } } if (clear) { L.Add(T); } } } if (!(L != null)) { return; } ((Ent_Dynamic)this.affected_mob).say("SCYAR NILA " + String13.ToUpper(thearea.name) + "!"); this.affected_mob.loc = Rand13.PickFromTable(L); return; }
// Function from file: communications.dm public bool post_signal(Obj source = null, Signal signal = null, string filter = null, int?range = null) { ByTable filter_list = null; dynamic start_point = null; dynamic current_filter = null; Obj device = null; dynamic end_point = null; if (Lang13.Bool(filter)) { filter_list = new ByTable(new object [] { filter, "_default" }); } else { filter_list = this.devices; } if (Lang13.Bool(range)) { start_point = GlobalFuncs.get_turf(source); if (!Lang13.Bool(start_point)) { return(false); } } foreach (dynamic _b in Lang13.Enumerate(filter_list)) { current_filter = _b; foreach (dynamic _a in Lang13.Enumerate(this.devices[current_filter], typeof(Obj))) { device = _a; if (device == source) { continue; } if (Lang13.Bool(range)) { end_point = GlobalFuncs.get_turf(device); if (!Lang13.Bool(end_point)) { continue; } if (start_point.z != end_point.z || (range ?? 0) > 0 && Map13.GetDistance(start_point, end_point) > (range ?? 0)) { continue; } } device.receive_signal(signal, true, this.frequency); } } return(false); }
// Function from file: spacevine.dm public override bool on_hit(Obj_Effect_Spacevine holder = null, dynamic hitter = null, Obj I = null) { dynamic chance = null; if (Lang13.Bool(hitter)) { if (I != null) { chance = I.force * 2; } else { chance = 8; } if (Rand13.PercentChance(Convert.ToInt32(chance))) { GlobalFuncs.qdel(holder); } } return(true); }
// Function from file: wires.dm public override dynamic Destroy( ) { this.holder = null; this.assemblies = new ByTable(); return(base.Destroy()); }