// Function from file: crayon.dm public Obj_Effect_Decal_Cleanable_Crayon(dynamic location = null, dynamic main = null, dynamic type = null, string e_name = null, double?rotation = null) : base((object)(location)) { main = main ?? "#FFFFFF"; type = type ?? "rune1"; e_name = e_name ?? "rune"; rotation = rotation ?? 0; Matrix M = null; // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!; this.loc = location; this.name = e_name; this.desc = "A " + this.name + " vandalizing the station."; if (type == "poseur tag") { type = Rand13.PickFromTable(GlobalVars.gang_name_pool); } this.icon_state = type; if (Lang13.Bool(rotation) && this.do_icon_rotate) { M = Num13.Matrix(); M.Turn(rotation); this.transform = M; } this.color = main; return; }
// Function from file: kitchen_spike.dm public override dynamic user_unbuckle_mob(dynamic user = null) { dynamic M = null; Matrix m180 = null; if (Lang13.Bool(this.buckled_mob) && this.buckled_mob.buckled == this) { M = this.buckled_mob; if (M != user) { ((Ent_Static)M).visible_message("" + user.name + " tries to pull " + M.name + " free of the " + this + "!", "<span class='notice'>" + user.name + " is trying to pull you off the " + this + ", opening up fresh wounds!</span>", "<span class='italics'>You hear a squishy wet noise.</span>"); if (!GlobalFuncs.do_after(user, 300, null, this)) { if (Lang13.Bool(M) && M.buckled != null) { ((Ent_Static)M).visible_message("" + user.name + " fails to free " + M.name + "!", "<span class='notice'>" + user.name + " fails to pull you off of the " + this + ".</span>"); } return(null); } } else { ((Ent_Static)M).visible_message("<span class='warning'>" + M.name + " struggles to break free from the " + this + "!</span>", "<span class='notice'>You struggle to break free from the " + this + ", exacerbating your wounds! (Stay still for two minutes.)</span>", "<span class='italics'>You hear a wet squishing noise..</span>"); ((Mob_Living)M).adjustBruteLoss(30); if (!GlobalFuncs.do_after(M, 1200, null, this)) { if (Lang13.Bool(M) && M.buckled != null) { M.WriteMsg("<span class='warning'>You fail to free yourself!</span>"); } return(null); } } if (!(M.buckled != null)) { return(null); } m180 = Num13.Matrix(M.transform); m180.Turn(180); Icon13.Animate(new ByTable().Set(1, M).Set("transform", m180).Set("time", 3)); M.pixel_y = ((Mob_Living)M).get_standard_pixel_y_offset(180); ((Mob_Living)M).adjustBruteLoss(30); this.visible_message("<span class='danger'>" + M + " falls free of the " + this + "!</span>"); this.unbuckle_mob(); ((Mob)M).emote("scream"); ((Mob)M).AdjustWeakened(10); } return(null); }
// Function from file: holder.dm public override bool update_icon(dynamic new_state = null, dynamic new_icon = null, int?new_px = null, int?new_py = null) { dynamic O = null; ByTable images = null; dynamic O2 = null; Matrix matrix = null; Image I = null; this.overlays.Cut(); if (Lang13.Bool(this.a_left)) { this.overlays.Add("" + this.a_left.icon_state + "_left"); foreach (dynamic _a in Lang13.Enumerate(this.a_left.attached_overlays)) { O = _a; this.overlays.Add("" + O + "_l"); } } if (Lang13.Bool(this.a_right)) { images = new ByTable(); images.Add(new Image(this.icon, null, "" + this.a_right.icon_state + "_left")); foreach (dynamic _b in Lang13.Enumerate(this.a_right.attached_overlays)) { O2 = _b; images.Add(new Image(this.icon, null, "" + O2 + "_l")); } matrix = Num13.Matrix(-1, 0, 0, 0, 1, 0); foreach (dynamic _c in Lang13.Enumerate(images, typeof(Image))) { I = _c; I.transform = matrix; this.overlays.Add(I); } } if (Lang13.Bool(this.master)) { this.master.update_icon(); } return(false); }
// Function from file: action.dm public void SetButtonCoords(dynamic button = null, dynamic number = null) { int row = 0; dynamic col = null; bool x_offset = false; double? y_offset = null; Matrix M = null; row = Num13.Floor(Convert.ToDouble((number - 1) / 10)); col = (number - 1) % 10 + 1; x_offset = Lang13.Bool((col - 1) * 32 + col * 2 + 4); y_offset = (row + 1) * -32 + 26; M = Num13.Matrix(); M.Translate(x_offset, y_offset); button.transform = M; return; }
// Function from file: transit.dm public void update_icon( ) { int p = 0; double angle = 0; int state = 0; p = 9; angle = 0; state = 1; switch ((int)(this.dir)) { case 1: angle = 180; state = (-p * this.x + this.y) % 15 + 1; if (state < 1) { state += 15; } break; case 4: angle = 90; state = (this.x + p * this.y) % 15 + 1; break; case 8: angle = -90; state = (this.x - p * this.y) % 15 + 1; if (state < 1) { state += 15; } break; default: state = (p * this.x + this.y) % 15 + 1; break; } this.icon_state = "speedspace_ns_" + state; this.transform = Num13.Rotate(Num13.Matrix(), angle); return; }
public Matrix(dynamic m = null, params object[] _) { ByTable _args = new ByTable(new object[] { m }).Extend(_); if (_args.len == 6) { this.a = Lang13.Bool(_args[1]); this.b = Lang13.Bool(_args[2]); this.c = Lang13.Bool(_args[3]); this.d = Lang13.Bool(_args[4]); this.e = Lang13.Bool(_args[5]); this.f = Lang13.Bool(_args[6]); } else if (Lang13.Bool(_args[1])) { Num13.Matrix(this, _args[1], 128); } return; }
// Function from file: simple_animal.dm public override void update_transform( ) { Matrix ntransform = null; int changed = 0; ntransform = Num13.Matrix(this.transform); changed = 0; if (this.resize != 1) { changed++; ntransform.Scale(this.resize); this.resize = 1; } if (changed != 0) { Icon13.Animate(new ByTable().Set(1, this).Set("transform", ntransform).Set("time", 2).Set("easing", 192)); } return; }
// Function from file: runes.dm public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null) { Matrix oldtransform = null; if (!GlobalFuncs.iscultist(a)) { a.WriteMsg("<span class='warning'>You aren't able to understand the words of " + this + ".</span>"); return(null); } if (this.can_invoke(a)) { this.invoke(a); oldtransform = this.transform; Icon13.Animate(new ByTable().Set(1, this).Set("transform", Num13.Matrix() * 2).Set("alpha", 0).Set("time", 5)); Icon13.Animate(new ByTable().Set("transform", oldtransform).Set("alpha", 255).Set("time", 0)); } else { this.fail_invoke(a); } return(null); }
public Matrix Turn(double?a = null) { return(Num13.Matrix(this, a, 133)); }
// Function from file: unsorted.dm public virtual dynamic orbit(dynamic A = null, double?radius = null, int?clockwise = null, double?rotation_speed = null, int?rotation_segments = null, int?pre_rotation = null, int?lockinorbit = null) { radius = radius ?? 10; clockwise = clockwise ?? GlobalVars.FALSE; rotation_speed = rotation_speed ?? 20; rotation_segments = rotation_segments ?? 36; pre_rotation = pre_rotation ?? GlobalVars.TRUE; lockinorbit = lockinorbit ?? GlobalVars.FALSE; Matrix initial_transform = null; Ent_Static lastloc = null; Matrix M = null; double? pre_rot = null; Matrix shift = null; dynamic targetloc = null; if (!(A is Ent_Static)) { return(null); } if (Lang13.Bool(this.orbiting)) { this.stop_orbit(); } this.orbiting = A; initial_transform = Num13.Matrix(this.transform); lastloc = this.loc; if (Lang13.Bool(pre_rotation)) { M = Num13.Matrix(this.transform); pre_rot = 90; if (!Lang13.Bool(clockwise)) { pre_rot = -90; } M.Turn(pre_rot); this.transform = M; } shift = Num13.Matrix(this.transform); shift.Translate(false, radius); this.transform = shift; this.SpinAnimation(rotation_speed, -1, clockwise, rotation_segments); this.transform = initial_transform; while (Lang13.Bool(this.orbiting) && this.orbiting == A && A.loc != null) { targetloc = GlobalFuncs.get_turf(A); if (!Lang13.Bool(lockinorbit) && this.loc != lastloc && this.loc != targetloc) { break; } this.loc = targetloc; lastloc = this.loc; Task13.Sleep(((int)(0.6))); } if (this.orbiting == A) { this.orbiting = null; this.SpinAnimation(0, 0); } return(null); }
// Function from file: beam.dm public void Draw( ) { double? Angle = null; Matrix rot_matrix = null; double DX = 0; double DY = 0; double N = 0; double length = 0; dynamic X = null; Icon II = null; double? Pixel_x = null; double? Pixel_y = null; int? a = null; Angle = Num13.Floor(GlobalFuncs.Get_Angle(this.origin, this.target)); rot_matrix = Num13.Matrix(); rot_matrix.Turn(Angle); DX = Convert.ToDouble(this.target.x * 32 + this.target.pixel_x - (this.origin.x * 32 + this.origin.pixel_x)); DY = Convert.ToDouble(this.target.y * 32 + this.target.pixel_y - (this.origin.y * 32 + this.origin.pixel_y)); N = 0; length = Num13.Floor(Math.Sqrt(Math.Pow(DX, 2) + Math.Pow(DY, 2))); foreach (dynamic _a in Lang13.IterateRange(0, length - 1, 32)) { N = _a; X = Lang13.Call(this.beam_type, this.origin_oldloc); X.owner = this; this.elements.Or(X); if (N + 32 > length) { II = new Icon(this.icon, this.icon_state); II.DrawBox(null, 1, length - N, 32, 32); X.icon = II; } else { X.icon = this.base_icon; } X.transform = rot_matrix; Pixel_x = null; Pixel_y = null; if (DX == 0) { Pixel_x = 0; } else { Pixel_x = Num13.Floor(Math.Sin(Angle ?? 0) + Math.Sin(Angle ?? 0) * (N + 16) * 32 / 32); } if (DY == 0) { Pixel_y = 0; } else { Pixel_y = Num13.Floor(Math.Cos(Angle ?? 0) + Math.Cos(Angle ?? 0) * (N + 16) * 32 / 32); } a = null; if (Math.Abs(Pixel_x ?? 0) > 32) { a = ((Pixel_x ?? 0) > 0 ? Num13.Floor((Pixel_x ?? 0) / 32) : GlobalFuncs.Ceiling((Pixel_x ?? 0) / 32)); X.x += a; Pixel_x %= 32; } if (Math.Abs(Pixel_y ?? 0) > 32) { a = ((Pixel_y ?? 0) > 0 ? Num13.Floor((Pixel_y ?? 0) / 32) : GlobalFuncs.Ceiling((Pixel_y ?? 0) / 32)); X.y += a; Pixel_y %= 32; } X.pixel_x = Pixel_x; X.pixel_y = Pixel_y; } return; }
// Function from file: kitchen_spike.dm public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null) { Obj_Structure_KitchenspikeFrame F = null; dynamic G = null; Ent_Static H = null; dynamic pos = null; Matrix m180 = null; if (A is Obj_Item_Weapon_Crowbar) { if (!Lang13.Bool(this.buckled_mob)) { GlobalFuncs.playsound(this.loc, "sound/items/Crowbar.ogg", 100, 1); if (GlobalFuncs.do_after(user, 20 / A.toolspeed, null, this)) { user.WriteMsg("<span class='notice'>You pry the spikes out of the frame.</span>"); new Obj_Item_Stack_Rods(this.loc, 4); F = new Obj_Structure_KitchenspikeFrame(this.loc); this.transfer_fingerprints_to(F); GlobalFuncs.qdel(this); } } else { user.WriteMsg("<span class='notice'>You can't do that while something's on the spike!</span>"); } return(null); } if (A is Obj_Item_Weapon_Grab) { G = A; if (G.affecting is Mob_Living) { if (!Lang13.Bool(this.buckled_mob)) { if (GlobalFuncs.do_mob(user, this, 120)) { if (Lang13.Bool(this.buckled_mob)) { return(null); } if (G.affecting.buckled != null) { return(null); } H = G.affecting; GlobalFuncs.playsound(this.loc, "sound/effects/splat.ogg", 25, 1); H.visible_message("<span class='danger'>" + user + " slams " + G.affecting + " onto the meat spike!</span>", "<span class='userdanger'>" + user + " slams you onto the meat spike!</span>", "<span class='italics'>You hear a squishy wet noise.</span>"); H.loc = this.loc; ((dynamic)H).emote("scream"); if (H is Mob_Living_Carbon_Human) { pos = GlobalFuncs.get_turf(H); ((Ent_Static)pos).add_blood_floor(H); } ((dynamic)H).adjustBruteLoss(30); ((dynamic)H).buckled = this; H.dir = 2; this.buckled_mob = H; m180 = Num13.Matrix(H.transform); m180.Turn(180); Icon13.Animate(new ByTable().Set(1, H).Set("transform", m180).Set("time", 3)); H.pixel_y = Convert.ToInt32(((dynamic)H).get_standard_pixel_y_offset(180)); GlobalFuncs.qdel(G); return(null); } } } user.WriteMsg("<span class='danger'>You can't use that on the spike!</span>"); return(null); } base.attackby((object)(A), (object)(user), _params, silent, replace_spent); return(null); }
public Matrix Interpolate(dynamic m2 = null, dynamic t = null) { return(Num13.Matrix(this, m2, t, 8)); }
public Matrix Add(dynamic m = null) { return(Num13.Matrix(this, m, 130)); }
public Matrix Multiply(dynamic m = null) { return(Num13.Matrix(this, m, 129)); }
public Matrix Subtract(dynamic m = null) { return(Num13.Matrix(this, m, 131)); }
public Matrix Invert( ) { return(Num13.Matrix(this, 132)); }
// Function from file: zombie.dm public void Zombify(dynamic H = null) { dynamic helmet = null; dynamic mask = null; Mob_Living_SimpleAnimal_Hostile_Zombie Z = null; Mob_Dead_Observer ghost = null; Mob_Living_SimpleAnimal_Hostile_Zombie_Holder D = null; ((Mob)H).set_species(typeof(Species_Zombie)); if (Lang13.Bool(H.head)) { helmet = H.head; if (!((Mob)H).unEquip(helmet)) { GlobalFuncs.qdel(helmet); } } if (Lang13.Bool(H.wear_mask)) { mask = H.wear_mask; if (!((Mob)H).unEquip(mask)) { GlobalFuncs.qdel(mask); } } Z = new Mob_Living_SimpleAnimal_Hostile_Zombie(H.loc); Z.faction = this.faction; Z.appearance = H.appearance; Z.transform = Num13.Matrix(); Z.pixel_y = 0; foreach (dynamic _a in Lang13.Enumerate(GlobalVars.player_list, typeof(Mob_Dead_Observer))) { ghost = _a; if (H.real_name == ghost.real_name) { ghost.reenter_corpse(); break; } } Z.ckey = H.ckey; H.stat = 2; H.butcher_results = new ByTable().Set(typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Meat_Slab_Human_Mutant_Zombie), 3); H.loc = Z; Z.stored_corpse = H; foreach (dynamic _b in Lang13.Enumerate(H, typeof(Mob_Living_SimpleAnimal_Hostile_Zombie_Holder))) { D = _b; GlobalFuncs.qdel(D); } this.visible_message("<span class='danger'>" + Z + " staggers to their feet!</span>"); Z.WriteMsg("<span class='userdanger'>You are now a zombie! Follow your creators lead!</span>"); return; }
public Matrix Scale(double x = 0, double?y = null) { y = y ?? x; return(Num13.Matrix(this, x, y, 134)); }
public Matrix Translate(bool x = false, double?y = null) { y = y ?? (x ?1:0); return(Num13.Matrix(this, x, y, 135)); }