// Function from file: photography.dm public Icon camera_get_icon(ByTable turfs = null, dynamic center = null) { ByTable atoms = null; dynamic T = null; Ent_Dynamic A = null; Ent_Dynamic O = null; ByTable sorted = null; int? j = null; double i = 0; dynamic c = null; dynamic c2 = null; Icon res = null; Ent_Static A2 = null; Icon img = null; double? offX = null; double? offY = null; dynamic T2 = null; atoms = new ByTable(); foreach (dynamic _b in Lang13.Enumerate(turfs)) { T = _b; atoms.Add(T); foreach (dynamic _a in Lang13.Enumerate(T, typeof(Ent_Dynamic))) { A = _a; if (A.invisibility != 0) { if (this.see_ghosts) { if (A is Mob_Dead_Observer) { O = A; if (Lang13.Bool(O.orbiting)) { continue; } } } else { continue; } } atoms.Add(A); } } sorted = new ByTable(); j = null; foreach (dynamic _c in Lang13.IterateRange(1, atoms.len)) { i = _c; c = atoms[i]; j = sorted.len; while ((j ?? 0) > 0) { c2 = sorted[j]; if (Convert.ToDouble(c2.layer) <= Convert.ToDouble(c.layer)) { break; } j--; } sorted.Insert((j ?? 0) + 1, c); } res = new Icon("icons/effects/96x96.dmi", ""); foreach (dynamic _d in Lang13.Enumerate(sorted, typeof(Ent_Static))) { A2 = _d; img = GlobalFuncs.getFlatIcon(A2); if (A2 is Mob_Living && Lang13.Bool(((dynamic)A2).lying)) { img.Turn(((dynamic)A2).lying); } offX = (A2.x - Convert.ToDouble(center.x)) * 32 + A2.pixel_x + 33; offY = (A2.y - Convert.ToDouble(center.y)) * 32 + A2.pixel_y + 33; if (A2 is Ent_Dynamic) { offX += Convert.ToDouble(((dynamic)A2).step_x); offY += Convert.ToDouble(((dynamic)A2).step_y); } res.Blend(img, GlobalFuncs.blendMode2iconMode(Lang13.BoolNullable(A2.blend_mode)), offX, offY); if (A2 is Obj_Item_Areaeditor_Blueprints) { this.blueprints = true; } } foreach (dynamic _e in Lang13.Enumerate(turfs)) { T2 = _e; res.Blend(GlobalFuncs.getFlatIcon(T2.loc), GlobalFuncs.blendMode2iconMode(Lang13.BoolNullable(T2.blend_mode)), Lang13.DoubleNullable((T2.x - center.x) * 32 + 33), Lang13.DoubleNullable((T2.y - center.y) * 32 + 33)); } return(res); }