// Function from file: runes.dm
        public override void invoke(dynamic user = null)
        {
            Obj_Effect_Rune R = null;

            this.visible_message("<span class='warning'>" + this + " darkens to black and vanishes.</span>");

            foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInRangeExcludeThis(this, 3), typeof(Obj_Effect_Rune)))
            {
                R = _a;


                if (R.invisibility == 60)
                {
                    R.invisibility = 0;
                    R.alpha        = Convert.ToInt32(Lang13.Initial(R, "alpha"));
                }
                else
                {
                    R.visible_message("<span class='danger'>" + R + " fades away.</span>");
                    R.invisibility = 60;
                    R.alpha        = 100;
                }
            }
            GlobalFuncs.qdel(this);
            return;
        }
Example #2
0
        // Function from file: talisman.dm
        public override bool invoke(dynamic user = null)
        {
            Obj_Effect_Rune R = null;

            ((Ent_Static)user).visible_message("<span class='warning'>Dust flows from " + user + "'s hand.</span>", "<span class='cultitalic'>You speak the words of the talisman, veiling nearby runes.</span>");

            foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInRangeExcludeThis(this, 3), typeof(Obj_Effect_Rune)))
            {
                R = _a;


                if (R.invisibility == 60)
                {
                    R.invisibility = 0;
                    R.alpha        = Convert.ToInt32(Lang13.Initial(R, "alpha"));
                }
                else
                {
                    R.visible_message("<span class='danger'>" + R + " fades away.</span>");
                    R.invisibility = 60;
                    R.alpha        = 100;
                }
            }
            return(false);
        }
        // Function from file: book.dm
        public override bool afterattack(dynamic target = null, dynamic user = null, bool?proximity_flag = null, string click_parameters = null)
        {
            Obj_Effect_Rune R            = null;
            bool            water2holy   = false;
            bool            unholy2clean = false;


            if (!(proximity_flag == true))
            {
                return(false);
            }

            if (target is Tile_Simulated_Floor)
            {
                user.WriteMsg("<span class='notice'>You hit the floor with the bible.</span>");

                if (Lang13.Bool(user.mind) && user.mind.assigned_role == "Chaplain")
                {
                    foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInRangeExcludeThis(user, 2), typeof(Obj_Effect_Rune)))
                    {
                        R = _a;

                        R.invisibility = 0;
                    }
                }
            }

            if (Lang13.Bool(user.mind) && user.mind.assigned_role == "Chaplain")
            {
                if (Lang13.Bool(target.reagents) && Lang13.Bool(((Reagents)target.reagents).has_reagent("water")))
                {
                    user.WriteMsg("<span class='notice'>You bless " + target + ".</span>");
                    water2holy = ((Reagents)target.reagents).get_reagent_amount("water");
                    ((Reagents)target.reagents).del_reagent("water");
                    target.reagents.add_reagent("holywater", water2holy);
                }

                if (Lang13.Bool(target.reagents) && Lang13.Bool(((Reagents)target.reagents).has_reagent("unholywater")))
                {
                    user.WriteMsg("<span class='notice'>You purify " + target + ".</span>");
                    unholy2clean = ((Reagents)target.reagents).get_reagent_amount("unholywater");
                    ((Reagents)target.reagents).del_reagent("unholywater");
                    target.reagents.add_reagent("holywater", unholy2clean);
                }
            }
            return(false);
        }
Example #4
0
        // Function from file: other_reagents.dm
        public override void reaction_turf(dynamic T = null, double?volume = null)
        {
            Obj_Effect_Rune R = null;

            base.reaction_turf((object)(T), volume);

            if (!(T is Tile_Simulated))
            {
                return;
            }

            if ((volume ?? 0) >= 10)
            {
                foreach (dynamic _a in Lang13.Enumerate(T, typeof(Obj_Effect_Rune)))
                {
                    R = _a;

                    GlobalFuncs.qdel(R);
                }
            }
            ((Tile)T).Bless();
            return;
        }
Example #5
0
        // Function from file: runes.dm
        public override void invoke(dynamic user = null)
        {
            dynamic T = null;
            ByTable papers_on_rune         = null;
            Obj_Item_Weapon_Paper P        = null;
            dynamic         paper_to_imbue = null;
            ByTable         nearby_runes   = null;
            Obj_Effect_Rune R               = null;
            dynamic         picked_rune     = null;
            ByTable         split_rune_type = null;
            dynamic         imbue_type      = null;
            Type            talisman_type   = null;
            dynamic         TA              = null;
            dynamic         TR              = null;
            dynamic         TT              = null;

            T = GlobalFuncs.get_turf(this);
            papers_on_rune = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(T, typeof(Obj_Item_Weapon_Paper)))
            {
                P = _a;


                if (!Lang13.Bool(P.info))
                {
                    papers_on_rune.Add(P);
                }
            }

            if (!(papers_on_rune.len != 0))
            {
                user.WriteMsg("<span class='cultitalic'>There must be a blank paper on top of " + this + "!</span>");
                this.fail_invoke();
                GlobalFuncs.log_game("Talisman Imbue rune failed - no blank papers on rune");
                return;
            }
            paper_to_imbue = Rand13.PickFromTable(papers_on_rune);
            nearby_runes   = new ByTable();

            foreach (dynamic _b in Lang13.Enumerate(Map13.FetchInRangeExcludeThis(this, 1), typeof(Obj_Effect_Rune)))
            {
                R = _b;

                nearby_runes.Add(R);
            }

            if (!(nearby_runes.len != 0))
            {
                user.WriteMsg("<span class='cultitalic'>There are no runes near " + this + "!</span>");
                this.fail_invoke();
                GlobalFuncs.log_game("Talisman Imbue rune failed - no nearby runes");
                return;
            }
            picked_rune     = Rand13.PickFromTable(nearby_runes);
            split_rune_type = GlobalFuncs.splittext("" + picked_rune.type, "/");
            imbue_type      = split_rune_type[split_rune_type.len];
            talisman_type   = Lang13.FindClass("/obj/item/weapon/paper/talisman/" + imbue_type);

            if (talisman_type is Type)
            {
                ((Ent_Dynamic)user).say("H'drak v'loso, mir'kanas verbot!");
                TA = Lang13.Call(talisman_type, GlobalFuncs.get_turf(this));

                if (picked_rune is Obj_Effect_Rune_Teleport)
                {
                    TR         = picked_rune;
                    TT         = TA;
                    TT.keyword = TR.keyword;
                }
            }
            else
            {
                user.WriteMsg("<span class='cultitalic'>The chosen rune was not a valid target!</span>");
                this.fail_invoke();
                GlobalFuncs.log_game("Talisman Imbue rune failed - chosen rune invalid");
                return;
            }
            this.visible_message("<span class='warning'>" + picked_rune + " crumbles to dust, and bloody images form themselves on " + paper_to_imbue + ".</span>");
            GlobalFuncs.qdel(paper_to_imbue);
            GlobalFuncs.qdel(picked_rune);
            return;
        }