// Function from file: lichdom.dm public override dynamic Destroy( ) { Mind M = null; Obj_Effect_ProcHolder_Spell S = null; foreach (dynamic _b in Lang13.Enumerate(GlobalVars.ticker.mode.wizards, typeof(Mind))) { M = _b; foreach (dynamic _a in Lang13.Enumerate(M.spell_list, typeof(Obj_Effect_ProcHolder_Spell))) { S = _a; if (S is Obj_Effect_ProcHolder_Spell_Targeted_Lichdom && S != this) { return(base.Destroy()); } } } if (this.existence_stops_round_end) { GlobalVars.ticker.mode.round_ends_with_antag_death = true; } base.Destroy(); return(null); }
// Function from file: spellbook.dm public bool CanRefund(dynamic user = null, Obj_Item_Weapon_Spellbook book = null) { Obj_Effect_ProcHolder_Spell aspell = null; if (!this.refundable) { return(false); } if (!Lang13.Bool(this.S)) { this.S = Lang13.Call(this.spell_type); } foreach (dynamic _a in Lang13.Enumerate(user.mind.spell_list, typeof(Obj_Effect_ProcHolder_Spell))) { aspell = _a; if (Lang13.Initial(this.S, "name") == Lang13.Initial(aspell, "name")) { return(true); } } return(false); }
// Function from file: tgstation.dme public override bool cast(dynamic targets = null, dynamic thearea = null, dynamic user = null) { thearea = thearea ?? Task13.User; Mob_Living target = null; Obj_Effect_ProcHolder_Spell spell = null; Obj_Effect_ProcHolder_Spell spell2 = null; this.playMagSound(); foreach (dynamic _c in Lang13.Enumerate(targets, typeof(Mob_Living))) { target = _c; foreach (dynamic _a in Lang13.Enumerate(this.contents, typeof(Obj_Effect_ProcHolder_Spell))) { spell = _a; spell.perform(new ByTable(new object [] { target }), false); } foreach (dynamic _b in Lang13.Enumerate(this.linked_spells, typeof(Obj_Effect_ProcHolder_Spell))) { spell2 = _b; spell2.perform(new ByTable(new object [] { target }), false); } } return(false); }
// Function from file: spellbook.dm public int Refund(Mob user = null, Obj_Item_Weapon_Spellbook book = null) { dynamic A = null; int spell_levels = 0; Obj_Effect_ProcHolder_Spell aspell = null; A = Lang13.FindObj(typeof(Zone_WizardStation)); if (!A.contents.Contains(user)) { user.WriteMsg("<span clas=='warning'>You can only refund spells at the wizard lair</span>"); return(-1); } if (!Lang13.Bool(this.S)) { this.S = Lang13.Call(this.spell_type); } spell_levels = 0; foreach (dynamic _a in Lang13.Enumerate(user.mind.spell_list, typeof(Obj_Effect_ProcHolder_Spell))) { aspell = _a; if (Lang13.Initial(this.S, "name") == Lang13.Initial(aspell, "name")) { spell_levels = aspell.spell_level; user.mind.spell_list.Remove(aspell); GlobalFuncs.qdel(this.S); return(this.cost * (spell_levels + 1)); } } return(-1); }
// Function from file: slaughter.dm public override bool attack(dynamic M = null, dynamic user = null, bool?def_zone = null) { Obj_Effect_ProcHolder_Spell knownspell = null; if (M != user) { return(base.attack((object)(M), (object)(user), def_zone)); } ((Ent_Static)user).visible_message("<span class='warning'>" + user + " raises " + this + " to their mouth and tears into it with their teeth!</span>", "<span class='danger'>An unnatural hunger consumes you. You raise " + this + " your mouth and devour it!</span>"); GlobalFuncs.playsound(user, "sound/magic/Demon_consume.ogg", 50, 1); foreach (dynamic _a in Lang13.Enumerate(user.mind.spell_list, typeof(Obj_Effect_ProcHolder_Spell))) { knownspell = _a; if (knownspell.type == typeof(Obj_Effect_ProcHolder_Spell_Bloodcrawl)) { user.WriteMsg("<span class='warning'>...and you don't feel any different.</span>"); GlobalFuncs.qdel(this); return(false); } } ((Ent_Static)user).visible_message("<span class='warning'>" + user + "'s eyes flare a deep crimson!</span>", "<span class='userdanger'>You feel a strange power seep into your body... you have absorbed the demon's blood-travelling powers!</span>"); user.drop_item(); this.Insert(user); return(false); }
// Function from file: spellbook.dm public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null) { dynamic S = null; Obj_Effect_ProcHolder_Spell knownspell = null; S = Lang13.Call(this.spell); foreach (dynamic _a in Lang13.Enumerate(user.mind.spell_list, typeof(Obj_Effect_ProcHolder_Spell))) { knownspell = _a; if (knownspell.type == S.type) { if (Lang13.Bool(user.mind)) { if (user.mind.special_role == "apprentice" || user.mind.special_role == "Wizard") { user.WriteMsg("<span class='notice'>You're already far more versed in this spell than this flimsy how-to book can provide.</span>"); } else { user.WriteMsg("<span class='notice'>You've already read this one.</span>"); } } return(null); } } if (this.used) { this.recoil(user); } else { user.mind.AddSpell(S); user.WriteMsg("<span class='notice'>you rapidly read through the arcane book. Suddenly you realize you understand " + this.spellname + "!</span>"); user.attack_log += "[" + GlobalFuncs.time_stamp() + "] <font color='orange'>" + user.real_name + " (" + user.ckey + ") learned the spell " + this.spellname + " (" + S + ").</font>"; this.onlearned(user); } return(null); }
// Function from file: aid.dm public override bool start( ) { Mob_Living L = null; bool spell_improved = false; Obj_Effect_ProcHolder_Spell S = null; foreach (dynamic _b in Lang13.Enumerate(GlobalVars.mob_list, typeof(Mob_Living))) { L = _b; if (L.mind != null && L.mind.spell_list.len != 0) { spell_improved = false; foreach (dynamic _a in Lang13.Enumerate(L.mind.spell_list, typeof(Obj_Effect_ProcHolder_Spell))) { S = _a; if (Lang13.Bool(S.clothes_req)) { S.clothes_req = 0; spell_improved = true; } } if (spell_improved) { L.WriteMsg("<span class='notice'>You suddenly feel like you never needed those garish robes in the first place...</span>"); } } } return(false); }
// Function from file: special_shadowling_abilities.dm public override bool cast(dynamic targets = null, dynamic thearea = null, dynamic user = null) { thearea = thearea ?? Task13.User; dynamic H = null; string hatch_or_no = null; Obj_Item I = null; Mob_Living M = null; Obj_Machinery_Power_Apc A = null; Mob_Living_SimpleAnimal_AscendantShadowling A2 = null; Obj_Effect_ProcHolder_Spell S = null; H = thearea; if (!this.shadowling_check(H)) { return(false); } hatch_or_no = Interface13.Alert(H, "It is time to ascend. Are you sure about this?", null, "Yes", "No"); switch ((string)(hatch_or_no)) { case "No": H.WriteMsg("<span class='warning'>You decide against ascending for now."); this.charge_counter = this.charge_max; return(false); break; case "Yes": H.notransform = 1; ((Ent_Static)H).visible_message("<span class='warning'>" + H + "'s things suddenly slip off. They gently rise into the air, red light glowing in their eyes.</span>", "<span class='shadowling'>You rise into the air and get ready for your transformation.</span>"); foreach (dynamic _d in Lang13.Enumerate(H, typeof(Obj_Item))) { I = _d; ((Mob)H).unEquip(I); Task13.Sleep(50); ((Ent_Static)H).visible_message("<span class='warning'>" + H + "'s skin begins to crack and harden.</span>", "<span class='shadowling'>Your flesh begins creating a shield around yourself.</span>"); Task13.Sleep(100); ((Ent_Static)H).visible_message("<span class='warning'>The small horns on " + H + "'s head slowly grow and elongate.</span>", "<span class='shadowling'>Your body continues to mutate. Your telepathic abilities grow.</span>"); Task13.Sleep(90); ((Ent_Static)H).visible_message("<span class='warning'>" + H + "'s body begins to violently stretch and contort.</span>", "<span class='shadowling'>You begin to rend apart the final barriers to godhood.</span>"); Task13.Sleep(40); H.WriteMsg("<i><b>Yes!</b></i>"); Task13.Sleep(10); H.WriteMsg("<i><b><span class='big'>YES!!</span></b></i>"); Task13.Sleep(10); H.WriteMsg("<i><b><span class='reallybig'>YE--</span></b></i>"); Task13.Sleep(1); foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInRangeExcludeThis(H, 7), typeof(Mob_Living))) { M = _a; M.Weaken(10); M.WriteMsg("<span class='userdanger'>An immense pressure slams you onto the ground!</span>"); } Game13.WriteMsg("<font size=5><span class='shadowling'><b>\"VYSHA NERADA YEKHEZET U'RUU!!\"</font></span>"); Game13.WriteMsg("sound/hallucinations/veryfar_noise.ogg"); foreach (dynamic _b in Lang13.Enumerate(GlobalVars.apcs_list, typeof(Obj_Machinery_Power_Apc))) { A = _b; A.overload_lighting(); } A2 = new Mob_Living_SimpleAnimal_AscendantShadowling(H.loc); foreach (dynamic _c in Lang13.Enumerate(H.mind.spell_list, typeof(Obj_Effect_ProcHolder_Spell))) { S = _c; if (S == this) { continue; } ((Mind)H.mind).remove_spell(S); } H.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_Targeted_Annihilate(null)); H.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_Targeted_Hypnosis(null)); H.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_Self_ShadowlingPhaseShift(null)); H.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_AoeTurf_AscendantStorm(null)); H.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_Self_ShadowlingHivemindAscendant(null)); ((Mind)H.mind).transfer_to(A2); A2.name = H.real_name; if (Lang13.Bool(A2.real_name)) { A2.real_name = H.real_name; } H.invisibility = 60; H.loc = A2; Task13.Sleep(50); if (!GlobalVars.ticker.mode.shadowling_ascended) { GlobalVars.SSshuttle.emergency.request(null, 0.3); } GlobalVars.ticker.mode.shadowling_ascended = true; A2.mind.remove_spell(this); GlobalFuncs.qdel(H); } break; } return(false); }
// Function from file: charge.dm public override bool cast(dynamic targets = null, dynamic thearea = null, dynamic user = null) { thearea = thearea ?? Task13.User; Mob_Living L = null; ByTable hand_items = null; dynamic charged_item = null; bool burnt_out = false; dynamic M = null; Obj_Effect_ProcHolder_Spell S = null; Obj_Effect_ProcHolder_Spell S2 = null; Obj item = null; Obj I = null; Obj I2 = null; Obj W = null; Obj C = null; Obj I3 = null; Obj C2 = null; foreach (dynamic _e in Lang13.Enumerate(targets, typeof(Mob_Living))) { L = _e; hand_items = new ByTable(new object [] { L.get_active_hand(), L.get_inactive_hand() }); charged_item = null; burnt_out = false; if (Lang13.Bool(L.pulling) && L.pulling is Mob_Living) { M = L.pulling; if (M.mob_spell_list.len != 0 || Lang13.Bool(M.mind) && M.mind.spell_list.len != 0) { foreach (dynamic _a in Lang13.Enumerate(M.mob_spell_list, typeof(Obj_Effect_ProcHolder_Spell))) { S = _a; S.charge_counter = S.charge_max; } if (Lang13.Bool(M.mind)) { foreach (dynamic _b in Lang13.Enumerate(M.mind.spell_list, typeof(Obj_Effect_ProcHolder_Spell))) { S2 = _b; S2.charge_counter = S2.charge_max; } } M.WriteMsg("<span class='notice'>you feel raw magic flowing through you, it feels good!</span>"); } else { M.WriteMsg("<span class='notice'>you feel very strange for a moment, but then it passes.</span>"); burnt_out = true; } charged_item = M; break; } foreach (dynamic _d in Lang13.Enumerate(hand_items, typeof(Obj))) { item = _d; if (item is Obj_Item_Weapon_Spellbook) { if (item is Obj_Item_Weapon_Spellbook_Oneuse) { I = item; if (Rand13.PercentChance(80)) { L.visible_message("<span class='warning'>" + I + " catches fire!</span>"); GlobalFuncs.qdel(I); } else { ((dynamic)I).used = 0; charged_item = I; break; } } else { L.WriteMsg("<span class='caution'>Glowing red letters appear on the front cover...</span>"); L.WriteMsg("<span class='warning'>" + Rand13.Pick(new object [] { "NICE TRY BUT NO!", "CLEVER BUT NOT CLEVER ENOUGH!", "SUCH FLAGRANT CHEESING IS WHY WE ACCEPTED YOUR APPLICATION!", "CUTE!", "YOU DIDN'T THINK IT'D BE THAT EASY, DID YOU?" }) + "</span>"); burnt_out = true; } } else if (item is Obj_Item_Weapon_Gun_Magic) { I2 = item; if (Rand13.PercentChance(80) && !Lang13.Bool(((dynamic)I2).can_charge)) { ((dynamic)I2).max_charges--; } if (Convert.ToDouble(((dynamic)I2).max_charges) <= 0) { ((dynamic)I2).max_charges = 0; burnt_out = true; } ((dynamic)I2).charges = ((dynamic)I2).max_charges; if (item is Obj_Item_Weapon_Gun_Magic_Wand && Lang13.Bool(((dynamic)I2).max_charges) != false) { W = item; W.icon_state = Lang13.Initial(W, "icon_state"); } charged_item = I2; break; } else if (item is Obj_Item_Weapon_StockParts_Cell) { C = item; if (Rand13.PercentChance(80)) { ((dynamic)C).maxcharge -= 200; } if (Convert.ToDouble(((dynamic)C).maxcharge) <= 1) { ((dynamic)C).maxcharge = 1; burnt_out = true; } ((dynamic)C).charge = ((dynamic)C).maxcharge; charged_item = C; break; } else if (item.contents != null) { foreach (dynamic _c in Lang13.Enumerate(item.contents, typeof(Obj))) { I3 = _c; if (I3 is Obj_Item_Weapon_StockParts_Cell) { C2 = I3; if (Rand13.PercentChance(80)) { ((dynamic)C2).maxcharge -= 200; } if (Convert.ToDouble(((dynamic)C2).maxcharge) <= 1) { ((dynamic)C2).maxcharge = 1; burnt_out = true; } ((dynamic)C2).charge = ((dynamic)C2).maxcharge; item.update_icon(); charged_item = item; break; } } } } if (!Lang13.Bool(charged_item)) { L.WriteMsg("<span class='notice'>you feel magical power surging to your hands, but the feeling rapidly fades...</span>"); } else if (burnt_out) { L.WriteMsg("<span class='caution'>" + charged_item + " doesn't seem to be reacting to the spell...</span>"); } else { GlobalFuncs.playsound(GlobalFuncs.get_turf(L), "sound/magic/Charge.ogg", 50, 1); L.WriteMsg("<span class='notice'>" + charged_item + " suddenly feels very warm!</span>"); } } return(false); }
// Function from file: aid.dm public override bool start( ) { Mob_Living L = null; Obj_Effect_ProcHolder_Spell S = null; foreach (dynamic _c in Lang13.Enumerate(GlobalVars.mob_list, typeof(Mob_Living))) { L = _c; if (L.mind != null && L.mind.spell_list.len != 0) { foreach (dynamic _b in Lang13.Enumerate(L.mind.spell_list, typeof(Obj_Effect_ProcHolder_Spell))) { S = _b; S.name = Lang13.Initial(S, "name"); S.spell_level++; if (S.spell_level >= 6 || S.charge_max <= 0) { continue; } if (S.level_max <= 0) { continue; } S.charge_max = Num13.Floor(Convert.ToDouble(Lang13.Initial(S, "charge_max") - S.spell_level * Convert.ToDouble(Lang13.Initial(S, "charge_max") - S.cooldown_min) / S.level_max)); if (S.charge_max < S.charge_counter) { S.charge_counter = S.charge_max; } switch ((int)(S.spell_level)) { case 1: S.name = "Efficient " + S.name; break; case 2: S.name = "Quickened " + S.name; break; case 3: S.name = "Free " + S.name; break; case 4: S.name = "Instant " + S.name; break; case 5: S.name = "Ludicrous " + S.name; break; } } L.WriteMsg("<span class='notice'>You suddenly feel more competent with your casting!</span>"); } } return(false); }
// Function from file: spellbook.dm public virtual bool Buy(Mob user = null, Obj_Item_Weapon_Spellbook book = null) { Obj_Effect_ProcHolder_Spell aspell = null; if (!Lang13.Bool(this.S) || Lang13.Bool(GlobalFuncs.qdeleted(this.S))) { this.S = Lang13.Call(this.spell_type); } foreach (dynamic _b in Lang13.Enumerate(user.mind.spell_list, typeof(Obj_Effect_ProcHolder_Spell))) { aspell = _b; if (Lang13.Initial(this.S, "name") == Lang13.Initial(aspell, "name")) { if (aspell.spell_level >= aspell.level_max) { user.WriteMsg("<span class='warning'>This spell cannot be improved further.</span>"); return(false); } else { aspell.name = Lang13.Initial(aspell, "name"); aspell.spell_level++; aspell.charge_max = Num13.Floor(Convert.ToDouble(Lang13.Initial(aspell, "charge_max") - aspell.spell_level * Convert.ToDouble(Lang13.Initial(aspell, "charge_max") - aspell.cooldown_min) / aspell.level_max)); if (aspell.charge_max < aspell.charge_counter) { aspell.charge_counter = aspell.charge_max; } switch ((int)(aspell.spell_level)) { case 1: user.WriteMsg("<span class='notice'>You have improved " + aspell.name + " into Efficient " + aspell.name + ".</span>"); aspell.name = "Efficient " + aspell.name; break; case 2: user.WriteMsg("<span class='notice'>You have further improved " + aspell.name + " into Quickened " + aspell.name + ".</span>"); aspell.name = "Quickened " + aspell.name; break; case 3: user.WriteMsg("<span class='notice'>You have further improved " + aspell.name + " into Free " + aspell.name + ".</span>"); aspell.name = "Free " + aspell.name; break; case 4: user.WriteMsg("<span class='notice'>You have further improved " + aspell.name + " into Instant " + aspell.name + ".</span>"); aspell.name = "Instant " + aspell.name; break; } if (aspell.spell_level >= aspell.level_max) { user.WriteMsg("<span class='notice'>This spell cannot be strengthened any further.</span>"); } return(true); } } } GlobalFuncs.feedback_add_details("wizard_spell_learned", this.log_name); user.mind.AddSpell(this.S); user.WriteMsg("<span class='notice'>You have learned " + this.S.name + ".</span>"); return(true); }