Ejemplo n.º 1
0
        // Function from file: ghost.dm
        public Hud_Ghost(Mob_Dead_Observer owner = null) : base(owner)
        {
            Mob G = null;
            Obj_Screen_Ghost _using = null;

            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            G = this.mymob;

            if (!G.client.prefs.ghost_hud)
            {
                this.mymob.client.screen = null;
                return;
            }
            _using            = new Obj_Screen_Ghost_Jumptomob();
            _using.screen_loc = "SOUTH:6,CENTER-2:16";
            this.static_inventory.Add(_using);
            _using            = new Obj_Screen_Ghost_Orbit();
            _using.screen_loc = "SOUTH:6,CENTER-1:16";
            this.static_inventory.Add(_using);
            _using            = new Obj_Screen_Ghost_ReenterCorpse();
            _using.screen_loc = "SOUTH:6,CENTER:16";
            this.static_inventory.Add(_using);
            _using            = new Obj_Screen_Ghost_Teleport();
            _using.screen_loc = "SOUTH:6,CENTER+1:16";
            this.static_inventory.Add(_using);
            return;
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        // Function from file: xenobiology.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            Mob_Dead_Observer       ghost = null;
            Mob_Dead_Observer       O     = null;
            Mob_Living_Carbon_Human G     = null;


            foreach (dynamic _a in Lang13.Enumerate(this.loc, typeof(Mob_Dead_Observer)))
            {
                O = _a;


                if (!(O.client != null))
                {
                    continue;
                }

                if (O.mind != null && Lang13.Bool(O.mind.current) && Convert.ToInt32(O.mind.current.stat) != 2)
                {
                    continue;
                }

                if (Lang13.Bool(O.orbiting))
                {
                    continue;
                }
                ghost = O;
                break;
            }

            if (!(ghost != null))
            {
                a.WriteMsg("<span class='warning'>The rune fizzles uselessly! There is no spirit nearby.</span>");
                return(null);
            }
            G = new Mob_Living_Carbon_Human();
            G.set_species(typeof(Species_Golem_Adamantine));
            G.set_cloned_appearance();
            G.real_name          = "Adamantine Golem (" + Rand13.Int(1, 1000) + ")";
            G.name               = G.real_name;
            G.dna.unique_enzymes = G.dna.generate_unique_enzymes();
            ((Species)G.dna.species).auto_equip(G);
            G.loc = this.loc;
            G.key = ghost.key;
            G.WriteMsg("You are an adamantine golem. You move slowly, but are highly resistant to heat and cold as well as blunt trauma. You are unable to wear clothes, but can still use most tools. Serve " + a + ", and assist them in completing their goals at any cost.");
            G.mind.store_memory("<b>Serve " + a.real_name + ", your creator.</b>");

            if (Lang13.Bool(a.mind.special_role))
            {
                GlobalFuncs.message_admins(new Txt().item(GlobalFuncs.key_name_admin(G)).str("(<A HREF='?_src_=holder;adminmoreinfo=").Ref(G).str("'>?</A>) has been summoned by ").item(GlobalFuncs.key_name_admin(a)).str("(<A HREF='?_src_=holder;adminmoreinfo=").Ref(a).str("'>?</A>), an antagonist.").ToString());
            }
            GlobalFuncs.log_game("" + GlobalFuncs.key_name(G) + " was made a golem by " + GlobalFuncs.key_name(a) + ".");
            GlobalFuncs.log_admin("" + GlobalFuncs.key_name(G) + " was made a golem by " + GlobalFuncs.key_name(a) + ".");
            GlobalFuncs.qdel(this);
            return(null);
        }
Ejemplo n.º 4
0
        // Function from file: pai.dm
        public void requestRecruits(  )
        {
            Mob_Dead_Observer O       = null;
            bool         hasSubmitted = false;
            PaiCandidate c            = null;


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


                if (GlobalFuncs.jobban_isbanned(O, "pAI"))
                {
                    continue;
                }

                if (Lang13.Bool(this.asked[O.ckey]))
                {
                    if (Game13.time < Convert.ToDouble(this.asked[O.ckey] + this.askDelay) || Convert.ToInt32(this.asked[O.ckey]) == GlobalVars.NEVER_FOR_THIS_ROUND)
                    {
                        continue;
                    }
                    else
                    {
                        this.asked.Remove(O.ckey);
                    }
                }

                if (O.client != null)
                {
                    hasSubmitted = false;

                    foreach (dynamic _a in Lang13.Enumerate(GlobalVars.SSpai.candidates, typeof(PaiCandidate)))
                    {
                        c = _a;


                        if (c.key == O.key)
                        {
                            hasSubmitted = true;
                        }
                    }

                    if (!hasSubmitted && O.client.prefs.be_special.Contains("pAI"))
                    {
                        this.question(O.client);
                    }
                }
            }
            return;
        }
Ejemplo n.º 5
0
        // Function from file: ghost.dm
        public override bool start(  )
        {
            Mob_Dead_Observer G = null;


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

                G.invisibility = 0;
                G.WriteMsg("You suddenly feel extremely obvious...");
            }
            return(false);
        }
Ejemplo n.º 6
0
        // Function from file: ghost.dm
        public override bool start(  )
        {
            Mob_Dead_Observer G = null;


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

                G.verbs.Add(typeof(Mob_Dead_Observer).GetMethod("boo"));
                G.verbs.Add(typeof(Mob_Dead_Observer).GetMethod("possess"));
                G.WriteMsg("You suddenly feel a welling of new spooky powers...");
            }
            return(false);
        }
        // Function from file: absorb.dm
        public override dynamic sting_action(Mob user = null, Ent_Static target = null)
        {
            dynamic           G          = null;
            Mob_Living        target2    = null;
            Changeling        changeling = null;
            Mob_Dead_Observer ghost      = null;

            G          = user.get_active_hand();
            target2    = G.affecting;
            changeling = user.mind.changeling;
            user.WriteMsg("<span class='notice'>We tighen our grip. We must hold still....</span>");
            target2.do_jitter_animation(500);
            ((Mob_Living)user).do_jitter_animation(500);

            if (!GlobalFuncs.do_mob(user, target2, 20))
            {
                user.WriteMsg("<span class='warning'>The body swap has been interrupted!</span>");
                return(null);
            }
            target2.WriteMsg("<span class='userdanger'>" + user + " tightens their grip as a painful sensation invades your body.</span>");

            if (!changeling.has_dna(((dynamic)target2).dna))
            {
                changeling.add_new_profile(target2, user);
            }
            changeling.remove_profile(user);
            ghost = target2.ghostize(false);
            user.mind.transfer_to(target2);

            if (ghost != null)
            {
                ghost.mind.transfer_to(user);

                if (Lang13.Bool(ghost.key))
                {
                    user.key = ghost.key;
                }
            }
            user.Paralyse(2);
            target2.WriteMsg("<span class='warning'>Our genes cry out as we swap our " + user + " form for " + target2 + ".</span>");
            return(null);
        }
        // Function from file: magic.dm
        public override dynamic on_hit(Ent_Static target = null, double?blocked = null, dynamic hit_zone = null)
        {
            dynamic _default = null;

            int old_stat            = 0;
            Mob_Dead_Observer ghost = null;

            _default = base.on_hit(target, blocked, (object)(hit_zone));

            if (target is Mob)
            {
                old_stat = Convert.ToInt32(((dynamic)target).stat);
                ((dynamic)target).revive();
                ((dynamic)target).suiciding = 0;

                if (!Lang13.Bool(((dynamic)target).ckey))
                {
                    foreach (dynamic _a in Lang13.Enumerate(GlobalVars.player_list, typeof(Mob_Dead_Observer)))
                    {
                        ghost = _a;


                        if (((dynamic)target).real_name == ghost.real_name)
                        {
                            ghost.__CallVerb("Re-enter Corpse");
                            break;
                        }
                    }
                }

                if (old_stat != 2)
                {
                    ((dynamic)target).WriteMsg("<span class='notice'>You feel great!</span>");
                }
                else
                {
                    ((dynamic)target).WriteMsg("<span class='notice'>You rise with a start, you're alive!!!</span>");
                }
            }
            return(_default);
        }
Ejemplo n.º 9
0
        // Function from file: xenobiology.dm
        public override int?process(dynamic seconds = null)
        {
            Mob_Dead_Observer ghost = null;
            Mob_Dead_Observer O     = null;


            foreach (dynamic _a in Lang13.Enumerate(this.loc, typeof(Mob_Dead_Observer)))
            {
                O = _a;


                if (!(O.client != null))
                {
                    continue;
                }

                if (O.mind != null && Lang13.Bool(O.mind.current) && Convert.ToInt32(O.mind.current.stat) != 2)
                {
                    continue;
                }

                if (Lang13.Bool(O.orbiting))
                {
                    continue;
                }
                ghost = O;
                break;
            }

            if (ghost != null)
            {
                this.icon_state = "golem2";
            }
            else
            {
                this.icon_state = "golem";
            }
            return(null);
        }
Ejemplo n.º 10
0
        public void jumptomob(  )
        {
            ByTable           dest   = null;
            dynamic           target = null;
            dynamic           M      = null;
            Mob_Dead_Observer A      = null;
            dynamic           T      = null;


            if (Task13.User is Mob_Dead_Observer)
            {
                dest   = new ByTable();
                target = null;
                dest.Add(GlobalFuncs.getpois(true));
                target = Interface13.Input("Please, select a player!", "Jump to Mob", null, null, dest, InputType.Null | InputType.Any);

                if (!Lang13.Bool(target))
                {
                    return;
                }
                else
                {
                    M = dest[target];
                    A = this;
                    T = GlobalFuncs.get_turf(M);

                    if (Lang13.Bool(T) && T is Tile)
                    {
                        A.loc = T;
                    }
                    else
                    {
                        A.WriteMsg("This mob is not located in the game world.");
                    }
                }
            }
            return;
        }
Ejemplo n.º 11
0
        public override bool f_action(Mob_Living_Silicon_Robot R = null)
        {
            Mob_Dead_Observer ghost = null;


            if (Convert.ToDouble(R.health) < 0)
            {
                Task13.User.WriteMsg("<span class='warning'>You have to repair the cyborg before using this module!</span>");
                return(false);
            }

            if (!Lang13.Bool(R.key))
            {
                foreach (dynamic _a in Lang13.Enumerate(GlobalVars.player_list, typeof(Mob_Dead_Observer)))
                {
                    ghost = _a;


                    if (ghost.mind != null && ghost.mind.current == R)
                    {
                        R.key = ghost.key;
                    }
                }
            }
            R.notify_ai(1);
            R.stat = 1;
            R.update_stat();

            if (R.camera != null && !((Wires)R.wires).is_cut("camera"))
            {
                R.camera.toggle_cam(R, false);
            }
            GlobalVars.dead_mob_list.Remove(R);
            GlobalVars.living_mob_list.Add(R);
            return(true);
        }
Ejemplo n.º 12
0
        // Function from file: runes.dm
        public override void invoke(dynamic user = null)
        {
            ByTable                 ghosts_on_rune = null;
            Mob_Dead_Observer       O = null;
            dynamic                 ghost_to_spawn = null;
            Mob_Living_Carbon_Human new_human      = null;
            Obj I = null;


            if (!Lang13.Bool(GlobalFuncs.get_turf(this).Contains(user)))
            {
                user.WriteMsg("<span class='cultitalic'>You must be standing on " + this + "!</span>");
                this.fail_invoke();
                GlobalFuncs.log_game("Manifest rune failed - user not standing on rune");
                return;
            }
            ghosts_on_rune = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(GlobalFuncs.get_turf(this), typeof(Mob_Dead_Observer)))
            {
                O = _a;


                if (O.client != null)
                {
                    ghosts_on_rune.Add(O);
                }
            }

            if (!(ghosts_on_rune.len != 0))
            {
                user.WriteMsg("<span class='cultitalic'>There are no spirits near " + this + "!</span>");
                this.fail_invoke();
                GlobalFuncs.log_game("Manifest rune failed - no nearby ghosts");
                return;
            }
            ghost_to_spawn      = Rand13.PickFromTable(ghosts_on_rune);
            new_human           = new Mob_Living_Carbon_Human(GlobalFuncs.get_turf(this));
            new_human.real_name = ghost_to_spawn.real_name;
            new_human.alpha     = 150;
            this.visible_message("<span class='warning'>A cloud of red mist forms above " + this + ", and from within steps... a man.</span>");
            user.WriteMsg("<span class='cultitalic'>Your blood begins flowing into " + this + ". You must remain in place and conscious to maintain the forms of those summoned. This will hurt you slowly but surely...</span>");
            new_human.key = ghost_to_spawn.key;
            ((GameMode)GlobalVars.ticker.mode).add_cultist(new_human.mind);
            new_human.WriteMsg("<span class='cultitalic'><b>You are a servant of the Geometer. You have been made semi-corporeal by the cult of Nar-Sie, and you are to serve them at all costs.</b></span>");

            while (Lang13.Bool(GlobalFuncs.get_turf(this).Contains(user)))
            {
                if (Lang13.Bool(user.stat))
                {
                    break;
                }
                user.apply_damage(1, "brute");
                Task13.Sleep(30);
            }

            if (new_human != null)
            {
                new_human.visible_message("<span class='warning'>" + new_human + " suddenly dissolves into bones and ashes.</span>", "<span class='cultlarge'>Your link to the world fades. Your form breaks apart.</span>");

                foreach (dynamic _b in Lang13.Enumerate(new_human, typeof(Obj)))
                {
                    I = _b;

                    new_human.unEquip(I);
                }
                new_human.dust();
            }
            return;
        }
Ejemplo n.º 13
0
        // Function from file: raginmages.dm
        public bool make_more_mages(  )
        {
            ByTable           candidates = null;
            dynamic           theghost   = null;
            Mob_Dead_Observer G          = null;
            int time_passed                       = 0;
            Mob_Dead_Observer       G2            = null;
            dynamic                 i             = null;
            Mob_Living_Carbon_Human new_character = null;


            if (this.making_mage)
            {
                return(false);
            }

            if (this.mages_made >= this.max_mages)
            {
                return(false);
            }
            this.making_mage = true;
            this.mages_made++;
            candidates = new ByTable();
            theghost   = null;
            Task13.Schedule(Rand13.Int(this.spawn_delay_min, this.spawn_delay_max), (Task13.Closure)(() => {
                GlobalFuncs.message_admins("SWF is still pissed, sending another wizard - " + (this.max_mages - this.mages_made) + " left.");

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


                    if (G.client != null && !(G.client.holder != null) && !(G.client.is_afk() != 0) && G.client.prefs.be_special.Contains("wizard"))
                    {
                        if (!GlobalFuncs.jobban_isbanned(G, "wizard") && !GlobalFuncs.jobban_isbanned(G, "Syndicate"))
                        {
                            if (this.age_check(G.client))
                            {
                                candidates.Add(G);
                            }
                        }
                    }
                }

                if (!(candidates.len != 0))
                {
                    GlobalFuncs.message_admins("No applicable ghosts for the next ragin' mage, asking ghosts instead.");
                    time_passed = Game13.time;

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


                        if (!GlobalFuncs.jobban_isbanned(G2, "wizard") && !GlobalFuncs.jobban_isbanned(G2, "Syndicate"))
                        {
                            if (this.age_check(G2.client))
                            {
                                Task13.Schedule(0, (Task13.Closure)(() => {
                                    switch ((string)(Interface13.Alert(G2, "Do you wish to be considered for the position of Space Wizard Foundation 'diplomat'?", "Please answer in 30 seconds!", "Yes", "No")))
                                    {
                                    case "Yes":

                                        if (Game13.time - time_passed > 300)
                                        {
                                            return;                                                     // Warning: Was a jump out of the closure!
                                        }
                                        candidates.Add(G2);
                                        break;

                                    case "No":
                                        return;                                                 // Warning: Was a jump out of the closure!

                                        break;
                                    }
                                    return;
                                }));
                            }
                        }
                    }
                    Task13.Sleep(300);
                }

                if (!(candidates.len != 0))
                {
                    GlobalFuncs.message_admins("This is awkward, sleeping until another mage check...");
                    this.making_mage = false;
                    this.mages_made--;
                    return;
                }
                else
                {
                    GlobalFuncs.shuffle(candidates);

                    foreach (dynamic _d in Lang13.Enumerate(candidates))
                    {
                        i = _d;


                        if (!Lang13.Bool(i) || !Lang13.Bool(i.client))
                        {
                            continue;
                        }
                        theghost = i;
                        break;
                    }
                }

                if (Lang13.Bool(theghost))
                {
                    new_character = this.makeBody(theghost);
                    new_character.mind.make_Wizard();
                    this.making_mage = false;
                    return;
                }
                return;
            }));
            return(false);
        }
Ejemplo n.º 14
0
        // Function from file: runes.dm
        public override void invoke(dynamic user = null)
        {
            dynamic           T  = null;
            Mob_Dead_Observer G  = null;
            Mob_Dead_Observer G2 = null;


            if (this.rune_in_use)
            {
                user.WriteMsg("<span class='cultitalic'>" + this + " cannot support more than one body!</span>");
                this.fail_invoke();
                GlobalFuncs.log_game("Astral Communion rune failed - more than one user");
                return;
            }
            T = GlobalFuncs.get_turf(this);

            if (T.contents.Contains(!Lang13.Bool(user)))
            {
                user.WriteMsg("<span class='cultitalic'>You must be standing on top of " + this + "!</span>");
                this.fail_invoke();
                GlobalFuncs.log_game("Astral Communion rune failed - user not standing on rune");
                return;
            }
            this.rune_in_use = true;
            this.affecting   = user;
            user.color       = "#7e1717";
            ((Ent_Static)user).visible_message("<span class='warning'>" + user + " freezes statue-still, glowing an unearthly red.</span>", "<span class='cult'>You see what lies beyond. All is revealed. While this is a wondrous experience, your physical form will waste away in this state. Hurry...</span>");
            ((Mob)user).ghostize(true);

            while (Lang13.Bool(user))
            {
                if (!Lang13.Bool(this.affecting))
                {
                    this.visible_message("<span class='warning'>" + this + " pulses gently before falling dark.</span>");
                    this.affecting   = null;
                    this.rune_in_use = false;
                    return;
                }
                this.affecting.apply_damage(1, "brute");

                if (!T.contents.Contains(user))
                {
                    ((Ent_Static)user).visible_message("<span class='warning'>A spectral tendril wraps around " + user + " and pulls them back to the rune!</span>");
                    this.Beam(user, "drainbeam", "icons/effects/effects.dmi", 2);
                    ((Ent_Dynamic)user).forceMove(GlobalFuncs.get_turf(this));
                }

                if (Lang13.Bool(user.key))
                {
                    ((Ent_Static)user).visible_message("<span class='warning'>" + user + " slowly relaxes, the glow around them dimming.</span>", "<span class='danger'>You are re-united with your physical form. " + this + " releases its hold over you.</span>");
                    user.color = Lang13.Initial(user, "color");
                    ((Mob)user).Weaken(3);
                    this.rune_in_use = false;
                    this.affecting   = null;
                    return;
                }

                if (Lang13.Bool(user.stat) == true)
                {
                    if (Rand13.PercentChance(10))
                    {
                        G = ((Mob)user).get_ghost();

                        if (G != null)
                        {
                            G.WriteMsg("<span class='cultitalic'>You feel the link between you and your body weakening... you must hurry!</span>");
                        }
                    }
                }

                if (Convert.ToInt32(user.stat) == 2)
                {
                    user.color       = Lang13.Initial(user, "color");
                    this.rune_in_use = false;
                    this.affecting   = null;
                    G2 = ((Mob)user).get_ghost();

                    if (G2 != null)
                    {
                        G2.WriteMsg("<span class='cultitalic'><b>You suddenly feel your physical form pass on. " + this + "'s exertion has killed you!</b></span>");
                    }
                    return;
                }
                Task13.Sleep(10);
            }
            this.rune_in_use = false;
            return;
        }
        // Function from file: zombie.dm
        public void Zombify(dynamic H = null)
        {
            dynamic helmet = null;
            dynamic mask   = null;
            Mob_Living_SimpleAnimal_Hostile_Zombie Z = null;
            Mob_Dead_Observer ghost = null;
            Mob_Living_SimpleAnimal_Hostile_Zombie_Holder D = null;

            ((Mob)H).set_species(typeof(Species_Zombie));

            if (Lang13.Bool(H.head))
            {
                helmet = H.head;

                if (!((Mob)H).unEquip(helmet))
                {
                    GlobalFuncs.qdel(helmet);
                }
            }

            if (Lang13.Bool(H.wear_mask))
            {
                mask = H.wear_mask;

                if (!((Mob)H).unEquip(mask))
                {
                    GlobalFuncs.qdel(mask);
                }
            }
            Z            = new Mob_Living_SimpleAnimal_Hostile_Zombie(H.loc);
            Z.faction    = this.faction;
            Z.appearance = H.appearance;
            Z.transform  = Num13.Matrix();
            Z.pixel_y    = 0;

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


                if (H.real_name == ghost.real_name)
                {
                    ghost.reenter_corpse();
                    break;
                }
            }
            Z.ckey            = H.ckey;
            H.stat            = 2;
            H.butcher_results = new ByTable().Set(typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Meat_Slab_Human_Mutant_Zombie), 3);
            H.loc             = Z;
            Z.stored_corpse   = H;

            foreach (dynamic _b in Lang13.Enumerate(H, typeof(Mob_Living_SimpleAnimal_Hostile_Zombie_Holder)))
            {
                D = _b;

                GlobalFuncs.qdel(D);
            }
            this.visible_message("<span class='danger'>" + Z + " staggers to their feet!</span>");
            Z.WriteMsg("<span class='userdanger'>You are now a zombie! Follow your creators lead!</span>");
            return;
        }
Ejemplo n.º 16
0
        // Function from file: pai.dm
        public void findPAI(Obj_Item_Device_Paicard p = null, Mob user = null)
        {
            ByTable           available = null;
            PaiCandidate      c         = null;
            bool              found     = false;
            Mob_Dead_Observer o         = null;
            string            dat       = null;
            PaiCandidate      c2        = null;

            this.requestRecruits();
            available = new ByTable();

            foreach (dynamic _b in Lang13.Enumerate(GlobalVars.SSpai.candidates, typeof(PaiCandidate)))
            {
                c = _b;


                if (c.ready)
                {
                    found = false;

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


                        if (o.key == c.key)
                        {
                            found = true;
                        }
                    }

                    if (found)
                    {
                        available.Add(c);
                    }
                }
            }
            dat  = "";
            dat += @"
			<style type=""text/css"">

			p.top {
				background-color: #AAAAAA; color: black;
			}

			tr.d0 td {
				background-color: #CC9999; color: black;
			}
			tr.d1 td {
				background-color: #9999CC; color: black;
			}
			tr.d2 td {
				background-color: #99CC99; color: black;
			}
			</style>
			"            ;
            dat += "<p class=\"top\">Requesting AI personalities from central database... If there are no entries, or if a suitable entry is not listed, check again later as more personalities may be added.</p>";
            dat += "<table>";

            foreach (dynamic _c in Lang13.Enumerate(available, typeof(PaiCandidate)))
            {
                c2 = _c;

                dat += "<tr class=\"d0\"><td>Name:</td><td>" + c2.name + "</td></tr>";
                dat += "<tr class=\"d1\"><td>Description:</td><td>" + c2.description + "</td></tr>";
                dat += "<tr class=\"d0\"><td>Preferred Role:</td><td>" + c2.role + "</td></tr>";
                dat += "<tr class=\"d1\"><td>OOC Comments:</td><td>" + c2.comments + "</td></tr>";
                dat += new Txt("<tr class=\"d2\"><td><a href='byond://?src=").Ref(this).str(";download=1;candidate=").Ref(c2).str(";device=").Ref(p).str("'>[Download ").item(c2.name).str("]</a></td><td></td></tr>").ToString();
            }
            dat += "</table>";
            Interface13.Browse(user, dat, "window=findPai");
            return;
        }
Ejemplo n.º 17
0
        // Function from file: mind_transfer.dm
        public override bool cast(dynamic targets = null, dynamic thearea = null, dynamic user = null)
        {
            thearea = thearea ?? Task13.User;

            dynamic           target = null;
            Mob               victim = null;
            dynamic           caster = null;
            dynamic           V      = null;
            dynamic           V2     = null;
            Mob_Dead_Observer ghost  = null;
            dynamic           V3     = null;
            dynamic           V4     = null;


            if (!(targets.len != 0))
            {
                thearea.WriteMsg("<span class='warning'>No mind found!</span>");
                return(false);
            }

            if (targets.len > 1)
            {
                thearea.WriteMsg("<span class='warning'>Too many minds! You're not a hive damnit!</span>");
                return(false);
            }
            target = targets[1];

            if (!Map13.FetchInViewExcludeThis(null, this.range).Contains(target) && !Lang13.Bool(user))
            {
                thearea.WriteMsg("<span class='warning'>They are too far away!</span>");
                return(false);
            }

            if (Convert.ToInt32(target.stat) == 2)
            {
                thearea.WriteMsg("<span class='warning'>You don't particularly want to be dead!</span>");
                return(false);
            }

            if (!Lang13.Bool(target.key) || !Lang13.Bool(target.mind))
            {
                thearea.WriteMsg("<span class='warning'>They appear to be catatonic! Not even magic can affect their vacant mind.</span>");
                return(false);
            }

            if (Lang13.Bool(thearea.suiciding))
            {
                thearea.WriteMsg("<span class='warning'>You're killing yourself! You can't concentrate enough to do this!</span>");
                return(false);
            }

            if (this.protected_roles.Contains(target.mind.special_role) || String13.CompareIgnoreCase("@", String13.SubStr(target.key, 1, 2)))
            {
                thearea.WriteMsg("<span class='warning'>Their mind is resisting your spell!</span>");
                return(false);
            }
            victim = target;
            caster = thearea;

            if (caster.mind.special_verbs.len != 0)
            {
                foreach (dynamic _a in Lang13.Enumerate(caster.mind.special_verbs))
                {
                    V = _a;

                    caster.verbs -= V;
                }
            }

            if (victim.mind.special_verbs.len != 0)
            {
                foreach (dynamic _b in Lang13.Enumerate(victim.mind.special_verbs))
                {
                    V2 = _b;

                    victim.verbs.Remove(V2);
                }
            }
            ghost = victim.ghostize(false);
            ((Mind)caster.mind).transfer_to(victim);

            if (victim.mind.special_verbs.len != 0)
            {
                foreach (dynamic _c in Lang13.Enumerate(caster.mind.special_verbs))
                {
                    V3 = _c;

                    caster.verbs += V3;
                }
            }
            ghost.mind.transfer_to(caster);

            if (Lang13.Bool(ghost.key))
            {
                caster.key = ghost.key;
            }
            GlobalFuncs.qdel(ghost);

            if (caster.mind.special_verbs.len != 0)
            {
                foreach (dynamic _d in Lang13.Enumerate(caster.mind.special_verbs))
                {
                    V4 = _d;

                    caster.verbs += V4;
                }
            }
            ((Mob)caster).Paralyse(this.paralysis_amount_caster);
            victim.Paralyse(this.paralysis_amount_victim);
            caster.WriteMsg(new Sound("sound/magic/MandSwap.ogg"));
            victim.WriteMsg(new Sound("sound/magic/MandSwap.ogg"));
            return(false);
        }
Ejemplo n.º 18
0
        // Function from file: narsie.dm
        public void pickcultist(  )
        {
            ByTable           cultists    = null;
            ByTable           noncultists = null;
            Mob_Living_Carbon food        = null;
            dynamic           pos         = null;
            Mob_Dead_Observer ghost       = null;
            dynamic           pos2        = null;

            cultists    = new ByTable();
            noncultists = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(GlobalVars.living_mob_list, typeof(Mob_Living_Carbon)))
            {
                food = _a;

                pos = GlobalFuncs.get_turf(food);

                if (Convert.ToInt32(pos.z) != this.z)
                {
                    continue;
                }

                if (GlobalFuncs.iscultist(food))
                {
                    cultists.Add(food);
                }
                else
                {
                    noncultists.Add(food);
                }

                if (cultists.len != 0)
                {
                    this.acquire(Rand13.PickFromTable(cultists));
                    return;
                }

                if (noncultists.len != 0)
                {
                    this.acquire(Rand13.PickFromTable(noncultists));
                    return;
                }
            }

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


                if (!(ghost.client != null))
                {
                    continue;
                }
                pos2 = GlobalFuncs.get_turf(ghost);

                if (Convert.ToInt32(pos2.z) != this.z)
                {
                    continue;
                }
                cultists.Add(ghost);
            }

            if (cultists.len != 0)
            {
                this.acquire(Rand13.PickFromTable(cultists));
                return;
            }
            return;
        }