// Function from file: syndicatebeacon.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            dynamic          M                = null;
            dynamic          N                = null;
            string           objective        = null;
            Objective        custom_objective = null;
            Objective_Escape escape_objective = null;
            int       obj_count               = 0;
            Objective OBJ = null;


            if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc))))
            {
                return(null);
            }

            if (Lang13.Bool(href_list["betraitor"]))
            {
                if (this.charges < 1)
                {
                    this.updateUsrDialog();
                    return(null);
                }
                M = Lang13.FindObj(href_list["traitormob"]);

                if (Lang13.Bool(M.mind.special_role))
                {
                    this.temptext = "<i>We have no need for you at this time. Have a pleasant day.</i><br>";
                    this.updateUsrDialog();
                    return(null);
                }
                this.charges -= 1;

                switch ((int)(Rand13.Int(1, 2)))
                {
                case 1:
                    this.temptext = "<font color=red><i><b>Double-crosser. You planned to betray us from the start. Allow us to repay the favor in kind.</b></i></font>";
                    this.updateUsrDialog();
                    Task13.Schedule(Rand13.Int(50, 200), (Task13.Closure)(() => {
                        this.selfdestruct();
                        return;
                    }));
                    return(null);

                    break;
                }

                if (M is Mob_Living_Carbon_Human)
                {
                    N = M;
                    ((GameMode)GlobalVars.ticker.mode).equip_traitor(N);
                    GlobalVars.ticker.mode.traitors.Add(N.mind);
                    N.mind.special_role = "traitor";
                    objective           = "Free Objective";

                    dynamic _b = Rand13.Int(1, 100);                       // Was a switch-case, sorry for the mess.
                    if (1 <= _b && _b <= 50)
                    {
                        objective = "Steal " + Rand13.Pick(new object [] { "a hand teleporter", "the Captain's antique laser gun", "a jetpack", "the Captain's ID", "the Captain's jumpsuit" }) + ".";
                    }
                    else if (51 <= _b && _b <= 60)
                    {
                        objective = "Destroy 70% or more of the station's plasma tanks.";
                    }
                    else if (61 <= _b && _b <= 70)
                    {
                        objective = "Cut power to 80% or more of the station's tiles.";
                    }
                    else if (71 <= _b && _b <= 80)
                    {
                        objective = "Destroy the AI.";
                    }
                    else if (81 <= _b && _b <= 90)
                    {
                        objective = "Kill all monkeys aboard the station.";
                    }
                    else
                    {
                        objective = "Make certain at least 80% of the station evacuates on the shuttle.";
                    }
                    custom_objective       = new Objective(objective);
                    custom_objective.owner = N.mind;
                    N.mind.objectives.Add(custom_objective);
                    escape_objective       = new Objective_Escape();
                    escape_objective.owner = N.mind;
                    N.mind.objectives.Add(escape_objective);
                    M.WriteMsg("<B>You have joined the ranks of the Syndicate and become a traitor to the station!</B>");
                    obj_count = 1;

                    foreach (dynamic _c in Lang13.Enumerate(M.mind.objectives, typeof(Objective)))
                    {
                        OBJ = _c;

                        M.WriteMsg("<B>Objective #" + obj_count + "</B>: " + OBJ.explanation_text);
                        obj_count++;
                    }
                }
            }
            this.updateUsrDialog();
            return(null);
        }
Exemple #2
0
        // Function from file: xmas.dm
        public override bool start(  )
        {
            dynamic M        = null;
            string  response = null;
            Obj_Item_Weapon_Card_Id_Gold santacard = null;
            Job_Captain           J               = null;
            dynamic               bag             = null;
            Obj_Item_Weapon_AGift gift            = null;
            Objective             santa_objective = null;
            Obj_Effect_ProcHolder_Spell_Targeted_AreaTeleport_Teleport telespell = null;


            foreach (dynamic _a in Lang13.Enumerate(GlobalVars.dead_mob_list))
            {
                M = _a;

                Task13.Schedule(0, (Task13.Closure)(() => {
                    response = Interface13.Alert(M, "Santa is coming to town! Do you want to be santa?", "Ho ho ho!", "Yes", "No");

                    if (response == "Yes" && Lang13.Bool(M) && Lang13.Bool(M.client) && Convert.ToInt32(M.stat) == 2 && !(this.santa != null))
                    {
                        this.santa     = new Mob_Living_Carbon_Human(Rand13.PickFromTable(GlobalVars.blobstart));
                        this.santa.key = M.key;
                        GlobalFuncs.qdel(M);
                        this.santa.real_name          = "Santa Claus";
                        this.santa.name               = "Santa Claus";
                        this.santa.mind.name          = "Santa Claus";
                        this.santa.mind.assigned_role = "Santa";
                        this.santa.mind.special_role  = "Santa";
                        this.santa.hair_style         = "Long Hair";
                        this.santa.facial_hair_style  = "Full Beard";
                        this.santa.hair_color         = "FFF";
                        this.santa.facial_hair_color  = "FFF";
                        this.santa.equip_to_slot_or_del(new Obj_Item_Clothing_Under_Color_Red(), 14);
                        this.santa.equip_to_slot_or_del(new Obj_Item_Clothing_Suit_Space_Santa(), 13);
                        this.santa.equip_to_slot_or_del(new Obj_Item_Clothing_Head_Santa(), 11);
                        this.santa.equip_to_slot_or_del(new Obj_Item_Clothing_Mask_Breath(), 2);
                        this.santa.equip_to_slot_or_del(new Obj_Item_Clothing_Gloves_Color_Red(), 10);
                        this.santa.equip_to_slot_or_del(new Obj_Item_Clothing_Shoes_Sneakers_Red(), 12);
                        this.santa.equip_to_slot_or_del(new Obj_Item_Weapon_Tank_Internals_EmergencyOxygen_Double(), 6);
                        this.santa.equip_to_slot_or_del(new Obj_Item_Device_Radio_Headset_Heads_Captain(), 8);
                        this.santa.equip_to_slot_or_del(new Obj_Item_Weapon_Storage_Backpack_Santabag(), 1);
                        this.santa.equip_to_slot_or_del(new Obj_Item_Device_Flashlight(), 16);
                        santacard = new Obj_Item_Weapon_Card_Id_Gold(this.santa);
                        santacard.update_label("Santa Claus", "Santa");
                        J = new Job_Captain();
                        santacard.access = J.get_access();
                        this.santa.equip_to_slot_or_del(santacard, 7);
                        this.santa.update_icons();
                        bag  = this.santa.back;
                        gift = new Obj_Item_Weapon_AGift(this.santa);

                        while (((Obj_Item_Weapon_Storage)bag).can_be_inserted(gift, true))
                        {
                            ((Obj_Item_Weapon_Storage)bag).handle_item_insertion(gift, true);
                            gift = new Obj_Item_Weapon_AGift(this.santa);
                        }
                        santa_objective = new Objective();
                        santa_objective.explanation_text = "Bring joy and presents to the station!";
                        santa_objective.completed        = true;
                        santa_objective.owner            = this.santa.mind;
                        this.santa.mind.objectives.Add(santa_objective);
                        this.santa.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_AoeTurf_Conjure_Presents());
                        telespell             = new Obj_Effect_ProcHolder_Spell_Targeted_AreaTeleport_Teleport(this.santa);
                        telespell.clothes_req = 0;
                        this.santa.mind.AddSpell(telespell);
                        this.santa.WriteMsg("<span class='boldannounce'>You are Santa! Your objective is to bring joy to the people on this station. You can conjure more presents using a spell, and there are several presents in your bag.</span>");
                    }
                    return;
                }));
            }
            return(false);
        }