Example #1
0
        // Function from file: soulstone.dm
        public bool getCultGhost(Obj_Item_Device_Soulstone C = null, dynamic T = null, dynamic U = null)
        {
            dynamic           chosen_ghost          = null;
            Mob_Dead_Observer ghost                 = null;
            ByTable           consenting_candidates = null;
            Obj_Item          W = null;


            foreach (dynamic _a in Lang13.Enumerate(GlobalVars.player_list, typeof(Mob_Dead_Observer)))
            {
                ghost = _a;


                if (ghost.mind != null && ghost.mind.current == T && ghost.client != null)
                {
                    chosen_ghost = ghost;
                    break;
                }
            }

            if (!Lang13.Bool(chosen_ghost))
            {
                consenting_candidates = GlobalFuncs.pollCandidates("Would you like to play as a Shade?", "Cultist", null, "cultist", 100);

                if (consenting_candidates.len != 0)
                {
                    chosen_ghost = Rand13.PickFromTable(consenting_candidates);
                }
            }

            if (!Lang13.Bool(T))
            {
                return(false);
            }

            if (!Lang13.Bool(chosen_ghost))
            {
                U.WriteMsg("<span class='danger'>The ghost has fled beyond your grasp.</span>");
                return(false);
            }

            if (C.contents.len != 0)
            {
                return(false);
            }
            T.ckey = chosen_ghost.ckey;

            foreach (dynamic _b in Lang13.Enumerate(T, typeof(Obj_Item)))
            {
                W = _b;

                ((Mob)T).unEquip(W);
            }
            this.init_shade(C, T, U);
            GlobalFuncs.qdel(T);
            return(true);
        }
Example #2
0
        // Function from file: soulstone.dm
        public void init_shade(Obj_Item_Device_Soulstone C = null, dynamic T = null, dynamic U = null, bool?vic = null)
        {
            vic = vic ?? false;

            Dynamic_Overlay animation       = null;
            Mob_Living_SimpleAnimal_Shade S = null;

            new Obj_Effect_Decal_Remains_Human(T.loc);
            T.invisibility       = 101;
            animation            = new Dynamic_Overlay(T.loc);
            animation.icon_state = "blank";
            animation.icon       = "icons/mob/mob.dmi";
            animation.master     = T;
            Icon13.Flick("dust-h", animation);
            GlobalFuncs.qdel(animation);
            S               = new Mob_Living_SimpleAnimal_Shade(T.loc);
            S.loc           = C;
            S.status_flags |= 4096;
            S.canmove       = false;
            S.name          = "Shade of " + T.real_name;
            S.real_name     = "Shade of " + T.real_name;
            S.key           = T.key;
            S.faction      |= new Txt().Ref(U).ToString();

            if (GlobalFuncs.iscultist(U))
            {
                ((GameMode)GlobalVars.ticker.mode).add_cultist(S.mind);
            }
            S.__CallVerb("Cancel Camera View");
            C.icon_state = "soulstone2";
            C.name       = "Soul Stone: " + S.real_name;

            if (GlobalFuncs.iswizard(U) || this.usability)
            {
                S.WriteMsg("Your soul has been captured! You are now bound to " + U.real_name + "'s will. Help them succeed in their goals at all costs.");
            }
            else if (GlobalFuncs.iscultist(U))
            {
                S.WriteMsg("Your soul has been captured! You are now bound to the cult's will. Help them succeed in their goals at all costs.");
            }
            C.imprinted = "" + S.name;

            if (vic == true)
            {
                U.WriteMsg("<span class='info'><b>Capture successful!</b>:</span> " + T.real_name + "'s soul has been ripped from their body and stored within the soul stone.");
                U.WriteMsg("The soulstone has been imprinted with " + S.real_name + "'s mind, it will no longer react to other souls.");
            }
            return;
        }
        // Function from file: talisman.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            Obj_Item_Weapon_Paper_Talisman_Teleport  T  = null;
            Obj_Item_Weapon_Paper_Talisman_Emp       T2 = null;
            Obj_Item_Weapon_Paper_Talisman_HideRunes T3 = null;
            Obj_Item_Weapon_Paper_Talisman_Flame     T4 = null;
            Obj_Item_Device_Soulstone T5 = null;
            Mob C = null;


            if (!(this != null) || Task13.User.stat != 0 || Task13.User.restrained() || !(Map13.GetDistance(this, Task13.User) <= 1))
            {
                return(null);
            }

            if (Lang13.Bool(href_list["rune"]))
            {
                dynamic _a = href_list["rune"];                 // Was a switch-case, sorry for the mess.
                if (_a == "teleport")
                {
                    T         = new Obj_Item_Weapon_Paper_Talisman_Teleport(Task13.User);
                    T.keyword = "veri";
                    Task13.User.put_in_hands(T);
                }
                else if (_a == "emp")
                {
                    T2 = new Obj_Item_Weapon_Paper_Talisman_Emp(Task13.User);
                    Task13.User.put_in_hands(T2);
                }
                else if (_a == "conceal")
                {
                    T3 = new Obj_Item_Weapon_Paper_Talisman_HideRunes(Task13.User);
                    Task13.User.put_in_hands(T3);
                }
                else if (_a == "flame")
                {
                    T4 = new Obj_Item_Weapon_Paper_Talisman_Flame(Task13.User);
                    Task13.User.put_in_hands(T4);
                }
                else if (_a == "sacrune")
                {
                    new Obj_Effect_Rune_Sacrifice(GlobalFuncs.get_turf(Task13.User));
                }
                else if (_a == "soulstone")
                {
                    T5 = new Obj_Item_Device_Soulstone(Task13.User);
                    Task13.User.put_in_hands(T5);
                }
                else if (_a == "construct")
                {
                    new Obj_Structure_Constructshell(GlobalFuncs.get_turf(Task13.User));
                }
                this.uses--;

                if (this.uses <= 0)
                {
                    if (Task13.User is Mob_Living_Carbon)
                    {
                        C = Task13.User;
                        C.drop_item();
                        this.visible_message("<span class='warning'>" + this + " crumbles to dust.</span>");
                    }
                    GlobalFuncs.qdel(this);
                }
            }
            return(null);
        }
Example #4
0
        // Function from file: runes.dm
        public void sac(dynamic T = null)
        {
            Mob_Living M = null;
            Obj_Item_Device_Soulstone stone = null;


            if (Lang13.Bool(T))
            {
                GlobalFuncs.PoolOrNew(typeof(Obj_Effect_Overlay_Temp_Cult_Sac), this.loc);

                foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInRange(this, 3), typeof(Mob_Living)))
                {
                    M = _a;


                    if (GlobalFuncs.iscultist(M))
                    {
                        if (T is Mob_Living_Carbon_Human || T is Mob_Living_Silicon_Robot)
                        {
                            M.WriteMsg("<span class='cultlarge'>\"I accept this sacrifice.\"</span>");
                        }
                        else
                        {
                            M.WriteMsg("<span class='cultlarge'>\"I accept this meager sacrifice.\"</span>");
                        }
                    }
                }

                if (Lang13.Bool(T.mind))
                {
                    if (T is Mob_Living_Carbon_Human || T is Mob_Living_Silicon_Robot)
                    {
                        new Obj_Item_SummoningOrb(GlobalFuncs.get_turf(this));
                    }
                    stone = new Obj_Item_Device_Soulstone(GlobalFuncs.get_turf(this));
                    stone.invisibility = 100;

                    if (!stone.transfer_soul("FORCE", T, Task13.User))
                    {
                        GlobalFuncs.qdel(stone);
                    }

                    if (stone != null)
                    {
                        stone.invisibility = 0;
                    }

                    if (!Lang13.Bool(T))
                    {
                        this.rune_in_use = false;
                        return;
                    }
                }

                if (T is Mob_Living_Silicon_Robot)
                {
                    GlobalFuncs.playsound(T, "sound/magic/Disable_Tech.ogg", 100, 1);
                    ((Mob)T).dust();
                }
                else
                {
                    GlobalFuncs.playsound(T, "sound/magic/Disintegrate.ogg", 100, 1);
                    ((Mob)T).gib();
                }
            }
            this.rune_in_use = false;
            return;
        }