Exemple #1
0
        // Function from file: ert.dm
        public override void post_equip(Mob H = null, int?visualsOnly = null)
        {
            visualsOnly = visualsOnly ?? GlobalVars.FALSE;

            Obj_Item_Device_Pda     pda = null;
            Obj_Item_Weapon_Card_Id W   = null;


            if (Lang13.Bool(visualsOnly))
            {
                return;
            }
            pda        = ((dynamic)H).r_store;
            pda.owner  = H.real_name;
            pda.ownjob = "Centcom Official";
            pda.update_label();
            W                 = ((dynamic)H).wear_id;
            W.icon_state      = "centcom";
            W.access          = GlobalFuncs.get_centcom_access("Centcom Official");
            W.access         += GlobalVars.access_weapons;
            W.assignment      = "Centcom Official";
            W.registered_name = H.real_name;
            W.update_label();
            return;
        }
Exemple #2
0
        // Function from file: standard.dm
        public override void post_equip(Mob H = null, int?visualsOnly = null)
        {
            visualsOnly = visualsOnly ?? GlobalVars.FALSE;

            Obj_Item_Clothing_Under U              = null;
            dynamic                 sec_briefcase  = null;
            Obj_Item                briefcase_item = null;
            int?                    i              = null;
            Obj_Item_Device_Pda     pda            = null;
            Obj_Item_Weapon_Card_Id W              = null;

            U = ((dynamic)H).w_uniform;
            U.attachTie(new Obj_Item_Clothing_Tie_Waistcoat(H));

            if (Lang13.Bool(visualsOnly))
            {
                return;
            }
            sec_briefcase = H.l_hand;

            foreach (dynamic _a in Lang13.Enumerate(sec_briefcase, typeof(Obj_Item)))
            {
                briefcase_item = _a;

                GlobalFuncs.qdel(briefcase_item);
            }
            i = null;
            i = 3;

            while ((i ?? 0) > 0)
            {
                ((Obj_Item_Weapon_Storage)sec_briefcase).handle_item_insertion(new Obj_Item_Stack_Spacecash_C1000(), true);
                i--;
            }
            ((Obj_Item_Weapon_Storage)sec_briefcase).handle_item_insertion(new Obj_Item_Weapon_Gun_Energy_KineticAccelerator_Crossbow(), true);
            ((Obj_Item_Weapon_Storage)sec_briefcase).handle_item_insertion(new Obj_Item_Weapon_Gun_Projectile_Revolver_Mateba(), true);
            ((Obj_Item_Weapon_Storage)sec_briefcase).handle_item_insertion(new Obj_Item_AmmoBox_A357(), true);
            ((Obj_Item_Weapon_Storage)sec_briefcase).handle_item_insertion(new Obj_Item_Weapon_C4(), true);
            pda        = ((dynamic)H).belt;
            pda.owner  = H.real_name;
            pda.ownjob = "Reaper";
            pda.update_label();
            W                 = ((dynamic)H).wear_id;
            W.access          = GlobalFuncs.get_all_accesses();
            W.assignment      = "Reaper";
            W.registered_name = H.real_name;
            W.update_label(H.real_name);
            return;
        }
Exemple #3
0
        // Function from file: message.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            string              dkey     = null;
            string              dkey2    = null;
            string              newkey   = null;
            ByTable             sendPDAs = null;
            Obj_Item_Device_Pda PDARec   = null;
            Obj_Item_Device_Pda P        = null;
            Ent_Static          H        = null;
            Ent_Static          H2       = null;


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

            if (Task13.User.contents.Find(this) != 0 || Map13.GetDistance(this, Task13.User) <= 1 && this.loc is Tile || Task13.User is Mob_Living_Silicon)
            {
                if (Lang13.Bool(href_list["auth"]))
                {
                    if (!Lang13.Bool(this.linkedServer) || Lang13.Bool(this.linkedServer.stat & 3))
                    {
                        this.message = this.noserver;
                    }
                    else if (this.auth)
                    {
                        this.auth   = false;
                        this.screen = 0;
                    }
                    else
                    {
                        dkey = GlobalFuncs.trim(Interface13.Input(Task13.User, "Please enter the decryption key.", null, null, null, InputType.Str | InputType.Null));

                        if (Lang13.Bool(dkey) && dkey != "")
                        {
                            if (this.linkedServer.decryptkey == dkey)
                            {
                                this.auth = true;
                            }
                            else
                            {
                                this.message = this.incorrectkey;
                            }
                        }
                    }
                }

                if (Lang13.Bool(href_list["active"]))
                {
                    if (this.auth)
                    {
                        this.linkedServer.active = !Lang13.Bool(this.linkedServer.active);
                    }
                }

                if (Lang13.Bool(href_list["find"]))
                {
                    if (GlobalVars.message_servers != null && GlobalVars.message_servers.len > 1)
                    {
                        this.linkedServer = Interface13.Input(Task13.User, "Please select a server.", "Select a server.", null, GlobalVars.message_servers, InputType.Null | InputType.Any);
                        this.message      = "<span class='alert'>NOTICE: Server selected.</span>";
                    }
                    else if (GlobalVars.message_servers != null && GlobalVars.message_servers.len > 0)
                    {
                        this.linkedServer = GlobalVars.message_servers[1];
                        this.message      = "<span class='notice'>NOTICE: Only Single Server Detected - Server selected.</span>";
                    }
                    else
                    {
                        this.message = this.noserver;
                    }
                }

                if (Lang13.Bool(href_list["view"]))
                {
                    if (this.linkedServer == null || Lang13.Bool(this.linkedServer.stat & 3))
                    {
                        this.message = this.noserver;
                    }
                    else if (this.auth)
                    {
                        this.screen = 1;
                    }
                }

                if (Lang13.Bool(href_list["clear"]))
                {
                    if (!Lang13.Bool(this.linkedServer) || Lang13.Bool(this.linkedServer.stat & 3))
                    {
                        this.message = this.noserver;
                    }
                    else if (this.auth)
                    {
                        this.linkedServer.pda_msgs = new ByTable();
                        this.message = "<span class='notice'>NOTICE: Logs cleared.</span>";
                    }
                }

                if (Lang13.Bool(href_list["clearr"]))
                {
                    if (!Lang13.Bool(this.linkedServer) || Lang13.Bool(this.linkedServer.stat & 3))
                    {
                        this.message = this.noserver;
                    }
                    else if (this.auth)
                    {
                        this.linkedServer.rc_msgs = new ByTable();
                        this.message = "<span class='notice'>NOTICE: Logs cleared.</span>";
                    }
                }

                if (Lang13.Bool(href_list["pass"]))
                {
                    if (!Lang13.Bool(this.linkedServer) || Lang13.Bool(this.linkedServer.stat & 3))
                    {
                        this.message = this.noserver;
                    }
                    else if (this.auth)
                    {
                        dkey2 = GlobalFuncs.trim(Interface13.Input(Task13.User, "Please enter the decryption key.", null, null, null, InputType.Str | InputType.Null));

                        if (Lang13.Bool(dkey2) && dkey2 != "")
                        {
                            if (this.linkedServer.decryptkey == dkey2)
                            {
                                newkey = GlobalFuncs.trim(Interface13.Input(Task13.User, "Please enter the new key (3 - 16 characters max):", null, null, null, InputType.Any));

                                if (Lang13.Length(newkey) <= 3)
                                {
                                    this.message = "<span class='notice'>NOTICE: Decryption key too short!</span>";
                                }
                                else if (Lang13.Length(newkey) > 16)
                                {
                                    this.message = "<span class='notice'>NOTICE: Decryption key too long!</span>";
                                }
                                else if (Lang13.Bool(newkey) && newkey != "")
                                {
                                    this.linkedServer.decryptkey = newkey;
                                }
                                this.message = "<span class='notice'>NOTICE: Decryption key set.</span>";
                            }
                            else
                            {
                                this.message = this.incorrectkey;
                            }
                        }
                    }
                }

                if (Lang13.Bool(href_list["hack"]))
                {
                    if (Task13.User is Mob_Living_Silicon && GlobalFuncs.is_special_character(Task13.User) != 0)
                    {
                        this.hacking = true;
                        this.screen  = 2;
                        Task13.Schedule(Lang13.Length(this.linkedServer.decryptkey) * 100, (Task13.Closure)(() => {
                            if (this != null && Lang13.Bool(this.linkedServer) && Task13.User != null)
                            {
                                this.BruteForce(Task13.User);
                            }
                            return;
                        }));
                    }
                }

                if (Lang13.Bool(href_list["delete"]))
                {
                    if (this.screen == 1)
                    {
                        if (!Lang13.Bool(this.linkedServer) || Lang13.Bool(this.linkedServer.stat & 3))
                        {
                            this.message = this.noserver;
                        }
                        else
                        {
                            this.linkedServer.pda_msgs.Remove(Lang13.FindObj(href_list["delete"]));
                            this.message = "<span class='notice'>NOTICE: Log Deleted!</span>";
                        }
                    }
                }

                if (Lang13.Bool(href_list["deleter"]))
                {
                    if (this.screen == 4)
                    {
                        if (!Lang13.Bool(this.linkedServer) || Lang13.Bool(this.linkedServer.stat & 3))
                        {
                            this.message = this.noserver;
                        }
                        else
                        {
                            this.linkedServer.rc_msgs.Remove(Lang13.FindObj(href_list["deleter"]));
                            this.message = "<span class='notice'>NOTICE: Log Deleted!</span>";
                        }
                    }
                }

                if (Lang13.Bool(href_list["msg"]))
                {
                    if (this.linkedServer == null || Lang13.Bool(this.linkedServer.stat & 3))
                    {
                        this.message = this.noserver;
                    }
                    else if (this.auth)
                    {
                        this.screen = 3;
                    }
                }

                if (Lang13.Bool(href_list["select"]))
                {
                    if (this.linkedServer == null || Lang13.Bool(this.linkedServer.stat & 3))
                    {
                        this.message = this.noserver;
                        this.screen  = 0;
                    }
                    else
                    {
                        dynamic _b = href_list["select"];                         // Was a switch-case, sorry for the mess.
                        if (_b == "Reset")
                        {
                            this.ResetMessage();
                        }
                        else if (_b == "Sender")
                        {
                            this.customsender = GlobalFuncs.stripped_input(Task13.User, "Please enter the sender's name.");
                        }
                        else if (_b == "Recepient")
                        {
                            sendPDAs = GlobalFuncs.get_viewable_pdas();

                            if (GlobalVars.PDAs != null && GlobalVars.PDAs.len > 0)
                            {
                                this.customrecepient = Interface13.Input(Task13.User, "Select a PDA from the list.", null, null, GlobalFuncs.sortNames(sendPDAs), InputType.Null | InputType.Any);
                            }
                            else
                            {
                                this.customrecepient = null;
                            }
                        }
                        else if (_b == "RecJob")
                        {
                            this.customjob = GlobalFuncs.stripped_input(Task13.User, "Please enter the sender's job.");
                        }
                        else if (_b == "Message")
                        {
                            this.custommessage = GlobalFuncs.stripped_input(Task13.User, "Please enter your message.");
                        }
                        else if (_b == "Send")
                        {
                            if (this.customsender == null || this.customsender == "")
                            {
                                this.customsender = "UNKNOWN";
                            }

                            if (this.customrecepient == null)
                            {
                                this.message = "<span class='notice'>NOTICE: No recepient selected!</span>";
                                return(this.attack_hand(Task13.User));
                            }

                            if (this.custommessage == null || this.custommessage == "")
                            {
                                this.message = "<span class='notice'>NOTICE: No message entered!</span>";
                                return(this.attack_hand(Task13.User));
                            }
                            PDARec = null;

                            foreach (dynamic _a in Lang13.Enumerate(GlobalFuncs.get_viewable_pdas(), typeof(Obj_Item_Device_Pda)))
                            {
                                P = _a;


                                if (P.owner == this.customsender)
                                {
                                    PDARec = P;
                                }
                            }

                            if (PDARec == null)
                            {
                                ((Obj_Machinery_MessageServer)this.linkedServer).send_pda_message("" + this.customrecepient.owner, "" + this.customsender, "" + this.custommessage);
                                this.customrecepient.tnote += new Txt("<i><b>&larr; From <a href='byond://?src=").Ref(this.customrecepient).str(";choice=Message;target=").Ref(this).str("'>").item(this.customsender).str("</a> (").item(this.customjob).str("):</b></i><br>").item(this.custommessage).str("<br>").ToString();

                                if (!Lang13.Bool(this.customrecepient.silent))
                                {
                                    GlobalFuncs.playsound(this.customrecepient.loc, "sound/machines/twobeep.ogg", 50, 1);
                                    ((Ent_Static)this.customrecepient).audible_message(new Txt().icon(this.customrecepient).str(" *").item(this.customrecepient.ttone).str("*").ToString(), null, 3);

                                    if (this.customrecepient.loc != null && this.customrecepient.loc is Mob_Living_Carbon_Human)
                                    {
                                        H = this.customrecepient.loc;
                                        ((dynamic)H).WriteMsg(new Txt().icon(this.customrecepient).str(" <b>Message from ").item(this.customsender).str(" (").item(this.customjob).str("), </b>\"").item(this.custommessage).str("\" (<a href='byond://?src=").Ref(this).str(";choice=Message;skiprefresh=1;target=").Ref(this).str("'>Reply</a>)").ToString());
                                    }
                                    GlobalFuncs.log_pda("" + Task13.User + "/(" + Task13.User.ckey + ") (PDA: " + this.customsender + ") sent \"" + this.custommessage + "\" to " + this.customrecepient.owner);
                                    this.customrecepient.overlays.Cut();
                                    this.customrecepient.overlays += new Image("icons/obj/pda.dmi", "pda-r");
                                }
                            }
                            else
                            {
                                ((Obj_Machinery_MessageServer)this.linkedServer).send_pda_message("" + this.customrecepient.owner, "" + PDARec.owner, "" + this.custommessage);
                                this.customrecepient.tnote += new Txt("<i><b>&larr; From <a href='byond://?src=").Ref(this.customrecepient).str(";choice=Message;target=").Ref(PDARec).str("'>").item(PDARec.owner).str("</a> (").item(this.customjob).str("):</b></i><br>").item(this.custommessage).str("<br>").ToString();

                                if (!Lang13.Bool(this.customrecepient.silent))
                                {
                                    GlobalFuncs.playsound(this.customrecepient.loc, "sound/machines/twobeep.ogg", 50, 1);
                                    ((Ent_Static)this.customrecepient).audible_message(new Txt().icon(this.customrecepient).str(" *").item(this.customrecepient.ttone).str("*").ToString(), null, 3);

                                    if (this.customrecepient.loc != null && this.customrecepient.loc is Mob_Living_Carbon_Human)
                                    {
                                        H2 = this.customrecepient.loc;
                                        ((dynamic)H2).WriteMsg(new Txt().icon(this.customrecepient).str(" <b>Message from ").item(PDARec.owner).str(" (").item(this.customjob).str("), </b>\"").item(this.custommessage).str("\" (<a href='byond://?src=").Ref(this.customrecepient).str(";choice=Message;skiprefresh=1;target=").Ref(PDARec).str("'>Reply</a>)").ToString());
                                    }
                                    GlobalFuncs.log_pda("" + Task13.User + "/(" + Task13.User.ckey + ") (PDA: " + PDARec.owner + ") sent \"" + this.custommessage + "\" to " + this.customrecepient.owner);
                                    this.customrecepient.overlays.Cut();
                                    this.customrecepient.overlays += new Image("icons/obj/pda.dmi", "pda-r");
                                }
                            }
                            this.ResetMessage();
                        }
                    }
                }

                if (Lang13.Bool(href_list["viewr"]))
                {
                    if (this.linkedServer == null || Lang13.Bool(this.linkedServer.stat & 3))
                    {
                        this.message = this.noserver;
                    }
                    else if (this.auth)
                    {
                        this.screen = 4;
                    }
                }

                if (Lang13.Bool(href_list["back"]))
                {
                    this.screen = 0;
                }
            }
            return(this.attack_hand(Task13.User));
        }
        // Function from file: interactive.dm
        public Mob_Living_Carbon_Human_Interactive(dynamic loc = null) : base((object)(loc))
        {
            dynamic             R    = null;
            dynamic             L    = null;
            dynamic             R2   = null;
            dynamic             L2   = null;
            dynamic             R3   = null;
            dynamic             L3   = null;
            Obj_Item_Organ_Limb LIMB = null;

            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            this.random();
            this.MYID                 = new Obj_Item_Weapon_Card_Id(this);
            this.MYID.name            = "" + this.real_name + "'s ID Card (" + this.myjob.title + ")";
            this.MYID.assignment      = "" + this.myjob.title;
            this.MYID.registered_name = this.real_name;
            this.MYID.access          = this.myjob.access;
            this.equip_to_slot_or_del(this.MYID, 7);
            this.MYPDA        = new Obj_Item_Device_Pda(this);
            this.MYPDA.owner  = this.real_name;
            this.MYPDA.ownjob = "Crew";
            this.MYPDA.name   = "PDA-" + this.real_name + " (" + this.myjob.title + ")";
            this.equip_to_slot_or_del(this.MYPDA, 6);
            this.zone_selected = "chest";

            if (Rand13.PercentChance(10))
            {
                if (Rand13.PercentChance(((int)(67.5))))
                {
                    R = Lang13.FindIn(typeof(Obj_Item_Organ_Limb_RArm), this.organs);
                    GlobalFuncs.qdel(R);
                    this.organs.Add(new Obj_Item_Organ_Limb_Robot_RArm());
                }
                else
                {
                    L = Lang13.FindIn(typeof(Obj_Item_Organ_Limb_LArm), this.organs);
                    GlobalFuncs.qdel(L);
                    this.organs.Add(new Obj_Item_Organ_Limb_Robot_LArm());
                }

                if (Rand13.PercentChance(((int)(67.5))))
                {
                    R2 = Lang13.FindIn(typeof(Obj_Item_Organ_Limb_RLeg), this.organs);
                    GlobalFuncs.qdel(R2);
                    this.organs.Add(new Obj_Item_Organ_Limb_Robot_RLeg());
                }
                else
                {
                    L2 = Lang13.FindIn(typeof(Obj_Item_Organ_Limb_LLeg), this.organs);
                    GlobalFuncs.qdel(L2);
                    this.organs.Add(new Obj_Item_Organ_Limb_Robot_LLeg());
                }

                if (Rand13.PercentChance(((int)(67.5))))
                {
                    R3 = Lang13.FindIn(typeof(Obj_Item_Organ_Limb_Chest), this.organs);
                    GlobalFuncs.qdel(R3);
                    this.organs.Add(new Obj_Item_Organ_Limb_Robot_Chest());
                }
                else
                {
                    L3 = Lang13.FindIn(typeof(Obj_Item_Organ_Limb_Head), this.organs);
                    GlobalFuncs.qdel(L3);
                    this.organs.Add(new Obj_Item_Organ_Limb_Robot_Head());
                }

                foreach (dynamic _a in Lang13.Enumerate(this.organs, typeof(Obj_Item_Organ_Limb)))
                {
                    LIMB = _a;

                    LIMB.owner = this;
                }
            }
            this.update_icons();
            this.update_damage_overlays(  );
            this.update_augments();
            this.hand = false;

            if ((this.TRAITS & 2) != 0)
            {
                this.robustness = 75;
            }
            else if ((this.TRAITS & 4) != 0)
            {
                this.robustness = 25;
            }

            if ((this.TRAITS & 8) != 0)
            {
                this.smartness = 25;
            }
            else if ((this.TRAITS & 16) != 0)
            {
                this.disabilities |= 256;
                this.smartness     = 75;
            }

            if ((this.TRAITS & 32) != 0)
            {
                this.attitude = 75;
            }
            else if ((this.TRAITS & 64) != 0)
            {
                this.attitude = 1;
            }

            if ((this.TRAITS & 128) != 0)
            {
                this.slyness = 75;
            }
            GlobalVars.SSnpc.insertBot(this);
            return;
        }