// Function from file: revenant_abilities.dm public override bool cast(dynamic targets = null, dynamic thearea = null, dynamic user = null) { thearea = thearea ?? Task13.User; dynamic T = null; Mob_Living_SimpleAnimal_Bot bot = null; Mob_Living_Carbon_Human human = null; Obj thing = null; Mob_Living_Silicon_Robot S = null; if (this.attempt_cast(thearea)) { foreach (dynamic _e in Lang13.Enumerate(targets)) { T = _e; Task13.Schedule(0, (Task13.Closure)(() => { foreach (dynamic _a in Lang13.Enumerate(T.contents, typeof(Mob_Living_SimpleAnimal_Bot))) { bot = _a; if (!(bot.emagged != 0)) { GlobalFuncs.PoolOrNew(typeof(Obj_Effect_Overlay_Temp_Revenant), bot.loc); bot.locked = false; bot.open = true; bot.emag_act(); } } foreach (dynamic _b in Lang13.Enumerate(T.contents, typeof(Mob_Living_Carbon_Human))) { human = _b; if (human == thearea) { continue; } human.WriteMsg("<span class='revenwarning'>You feel " + Rand13.Pick(new object [] { "your sense of direction flicker out", "a stabbing pain in your head", "your mind fill with static" }) + ".</span>"); GlobalFuncs.PoolOrNew(typeof(Obj_Effect_Overlay_Temp_Revenant), human.loc); human.emp_act(1); } foreach (dynamic _c in Lang13.Enumerate(T.contents, typeof(Obj))) { thing = _c; if (thing is Obj_Machinery_Dominator || thing is Obj_Machinery_Power_Apc || thing is Obj_Machinery_Power_Smes) { continue; } if (Rand13.PercentChance(20)) { if (Rand13.PercentChance(50)) { GlobalFuncs.PoolOrNew(typeof(Obj_Effect_Overlay_Temp_Revenant), thing.loc); } thing.emag_act(null); } else if (!(thing is Obj_Machinery_Clonepod)) { thing.emp_act(1); } } foreach (dynamic _d in Lang13.Enumerate(T.contents, typeof(Mob_Living_Silicon_Robot))) { S = _d; GlobalFuncs.playsound(S, "sound/machines/warning-buzzer.ogg", 50, 1); GlobalFuncs.PoolOrNew(typeof(Obj_Effect_Overlay_Temp_Revenant), S.loc); S.spark_system.start(); S.emp_act(1); } return; })); } } return(false); }