コード例 #1
0
        // Function from file: disposal-structures.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            dynamic O   = null;
            string  tag = null;


            if (Lang13.Bool(base.attackby((object)(A), (object)(user), _params, silent, replace_spent)))
            {
                return(null);
            }

            if (A is Obj_Item_Device_DestTagger)
            {
                O = A;

                if ((O.currTag ?? 0) > 0)
                {
                    this.sortType = O.currTag;
                    GlobalFuncs.playsound(this.loc, "sound/machines/twobeep.ogg", 100, 1);
                    tag = String13.ToUpper(GlobalVars.TAGGERLOCATIONS[O.currTag]);
                    user.WriteMsg("<span class='warning'>Changed filter to " + tag + ".</span>");
                    this.updatedesc();
                }
            }
            return(null);
        }
コード例 #2
0
        public override void f_invocation(dynamic chosenarea = null, dynamic user = null)
        {
            user = user ?? Task13.User;


            if (!this.invocation_area || !Lang13.Bool(chosenarea))
            {
                base.f_invocation((object)(chosenarea), (object)(user));
            }
            else
            {
                switch ((string)(this.invocation_type))
                {
                case "shout":
                    ((Ent_Dynamic)user).say("" + this.invocation + " " + String13.ToUpper(chosenarea.name));

                    if (user.gender == GlobalVars.MALE)
                    {
                        GlobalFuncs.playsound(user.loc, Rand13.Pick(new object [] { "sound/misc/null.ogg", "sound/misc/null.ogg" }), 100, 1);
                    }
                    else
                    {
                        GlobalFuncs.playsound(user.loc, Rand13.Pick(new object [] { "sound/misc/null.ogg", "sound/misc/null.ogg" }), 100, 1);
                    }
                    break;

                case "whisper":
                    user.__CallVerb("Whisper", "" + this.invocation + " " + String13.ToUpper(chosenarea.name));
                    break;
                }
            }
            return;
        }
コード例 #3
0
        // Function from file: boxing.dm
        public override dynamic speechModification(dynamic message = null)
        {
            if (String13.SubStr(message, 1, 2) != "*")
            {
                message = GlobalFuncs.replacetext(message, "captain", "CAPITÁN");
                message = GlobalFuncs.replacetext(message, "station", "ESTACIÓN");
                message = GlobalFuncs.replacetext(message, "sir", "SEÑOR");
                message = GlobalFuncs.replacetext(message, "the ", "el ");
                message = GlobalFuncs.replacetext(message, "my ", "mi ");
                message = GlobalFuncs.replacetext(message, "is ", "es ");
                message = GlobalFuncs.replacetext(message, "it's", "es");
                message = GlobalFuncs.replacetext(message, "friend", "amigo");
                message = GlobalFuncs.replacetext(message, "buddy", "amigo");
                message = GlobalFuncs.replacetext(message, "hello", "hola");
                message = GlobalFuncs.replacetext(message, " hot", " caliente");
                message = GlobalFuncs.replacetext(message, " very ", " muy ");
                message = GlobalFuncs.replacetext(message, "sword", "espada");
                message = GlobalFuncs.replacetext(message, "library", "biblioteca");
                message = GlobalFuncs.replacetext(message, "traitor", "traidor");
                message = GlobalFuncs.replacetext(message, "wizard", "mago");
                message = String13.ToUpper(message);

                if (Rand13.PercentChance(25))
                {
                    message += " OLE!";
                }
            }
            return(message);
        }
コード例 #4
0
 // Function from file: mutations.dm
 public override dynamic say_mod(dynamic message = null)
 {
     if (Lang13.Bool(message))
     {
         message = "" + String13.ToUpper(GlobalFuncs.replacetext(message, ".", "!")) + "!!";
     }
     return(message);
 }
コード例 #5
0
        // Function from file: magnet.dm
        public void MagnetMove(  )
        {
            Signal signal   = null;
            string nextmove = null;


            if (this.looping)
            {
                return;
            }

            while (this.moving && this.rpath.len >= 1)
            {
                if ((this.stat & 3) != 0)
                {
                    break;
                }
                this.looping = true;
                signal       = new Signal();
                signal.transmission_method = 1;
                signal.source       = this;
                signal.frequency    = this.frequency;
                signal.data["code"] = this.code;

                if (this.pathpos > this.rpath.len)
                {
                    this.pathpos = 1;
                }
                nextmove = String13.ToUpper(this.rpath[this.pathpos]);

                if (!new ByTable(new object [] { "N", "S", "E", "W", "C", "R" }).Contains(nextmove))
                {
                    GlobalFuncs.qdel(signal);
                    break;
                }
                signal.data["command"] = nextmove;
                this.pathpos++;
                Task13.Schedule(0, (Task13.Closure)(() => {
                    this.radio_connection.post_signal(this, signal, GlobalVars.RADIO_MAGNETS);
                    return;
                }));

                if (this.speed == 10)
                {
                    Task13.Sleep(1);
                }
                else
                {
                    Task13.Sleep(12 - this.speed);
                }
            }
            this.looping = false;
            return;
        }
コード例 #6
0
        // Function from file: mutations.dm
        public override dynamic say_mod(dynamic message = null)
        {
            string  prefix     = null;
            ByTable words      = null;
            ByTable rearranged = null;
            int?    i          = null;
            dynamic cword      = null;
            string  suffix     = null;


            if (Lang13.Bool(message))
            {
                prefix = String13.SubStr(message, 1, 2);

                if (prefix == ";")
                {
                    message = String13.SubStr(message, 2, 0);
                }
                else if (new ByTable(new object [] { ":", "#" }).Contains(prefix))
                {
                    prefix += String13.SubStr(message, 2, 3);
                    message = String13.SubStr(message, 3, 0);
                }
                else
                {
                    prefix = "";
                }
                words      = GlobalFuncs.splittext(message, " ");
                rearranged = new ByTable();
                i          = null;
                i          = 1;

                while ((i ?? 0) <= words.len)
                {
                    cword = Rand13.PickFromTable(words);
                    words.Remove(cword);
                    suffix = String13.SubStr(cword, Lang13.Length(cword) - 1, Lang13.Length(cword));

                    while (new ByTable(new object [] { ".", ",", ";", "!", ":", "?" }).Contains(Lang13.Length(cword) > 0 && Lang13.Bool(suffix)))
                    {
                        cword  = String13.SubStr(cword, 1, Lang13.Length(cword) - 1);
                        suffix = String13.SubStr(cword, Lang13.Length(cword) - 1, Lang13.Length(cword));
                    }

                    if (Lang13.Length(cword) != 0)
                    {
                        rearranged.Add(cword);
                    }
                    i++;
                }
                message = "" + prefix + String13.ToUpper(GlobalFuncs.jointext(rearranged, " ")) + "!!";
            }
            return(message);
        }
コード例 #7
0
        // Function from file: sortingmachinery.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            dynamic O   = null;
            string  tag = null;
            string  str = null;
            dynamic WP  = null;


            if (A is Obj_Item_Device_DestTagger)
            {
                O = A;

                if (this.sortTag != O.currTag)
                {
                    tag = String13.ToUpper(GlobalVars.TAGGERLOCATIONS[O.currTag]);
                    user.WriteMsg("<span class='notice'>*" + tag + "*</span>");
                    this.sortTag = O.currTag;
                    GlobalFuncs.playsound(this.loc, "sound/machines/twobeep.ogg", 100, 1);
                }
            }
            else if (A is Obj_Item_Weapon_Pen)
            {
                str = String13.SubStr(GlobalFuncs.sanitize(Interface13.Input(user, "Label text?", "Set label", "", null, InputType.Any)), 1, 26);

                if (!Lang13.Bool(str) || !(Lang13.Length(str) != 0))
                {
                    user.WriteMsg("<span class='warning'>Invalid text!</span>");
                    return(null);
                }
                ((Ent_Static)user).visible_message("" + user + " labels " + this + " as " + str + ".");
                this.name = "" + this.name + " (" + str + ")";
            }
            else if (A is Obj_Item_Stack_WrappingPaper && !this.giftwrapped)
            {
                WP = A;

                if (Lang13.Bool(WP.use(1)))
                {
                    this.icon_state  = "giftcrate" + this.wrapped.w_class;
                    this.giftwrapped = true;
                    ((Ent_Static)user).visible_message("" + user + " wraps the package in festive paper!");

                    if (Convert.ToDouble(WP.amount) <= 0 && !(WP.loc != null))
                    {
                        new Obj_Item_Weapon_CTube(GlobalFuncs.get_turf(user));
                    }
                }
                else
                {
                    user.WriteMsg("<span class='warning'>You need more paper!</span>");
                }
            }
            return(null);
        }
コード例 #8
0
        // Function from file: disposal-structures.dm
        public void updatedesc(  )
        {
            string tag = null;

            this.desc = "An underfloor disposal pipe with a package sorting mechanism.";

            if ((this.sortType ?? 0) > 0)
            {
                tag        = String13.ToUpper(GlobalVars.TAGGERLOCATIONS[this.sortType]);
                this.desc += "\nIt's tagged with " + tag;
            }
            return;
        }
コード例 #9
0
ファイル: Obj_Item_Borg_Stun.cs プロジェクト: Somnium13/SS13
 // Function from file: robot_items.dm
 public override bool attack(dynamic M = null, dynamic user = null, bool?def_zone = null)
 {
     if (!Lang13.Bool(user.cell.use(30)))
     {
         return(false);
     }
     ((Mob)M).Weaken(5);
     ((Mob_Living)M).apply_effect("stutter", 5);
     ((Mob)M).Stun(5);
     ((Ent_Static)M).visible_message("<span class='danger'>" + user + " has prodded " + M + " with " + this + "!</span>", "<span class='userdanger'>" + user + " has prodded you with " + this + "!</span>");
     GlobalFuncs.add_logs(user, M, "stunned", this, "(INTENT: " + String13.ToUpper(user.a_intent) + ")");
     return(false);
 }
コード例 #10
0
        // Function from file: explosives.dm
        public override int suicide_act(Mob_Living_Carbon_Human user = null)
        {
            string message_say = null;
            string role        = null;

            user.visible_message(new Txt("<span class='suicide'>").item(user).str(" activates the ").item(this.name).str(" and holds it above ").his_her_its_their().str(" head! It looks like ").he_she_it_they().str("'s going out with a bang!</span>").ToString());
            message_say = "FOR NO RAISIN!";

            if (user.mind != null)
            {
                if (Lang13.Bool(user.mind.special_role))
                {
                    role = String13.ToLower(user.mind.special_role);

                    if (role == "traitor" || role == "syndicate")
                    {
                        message_say = "FOR THE SYNDICATE!";
                    }
                    else if (role == "changeling")
                    {
                        message_say = "FOR THE HIVE!";
                    }
                    else if (role == "cultist")
                    {
                        message_say = "FOR NAR-SIE!";
                    }
                    else if (role == "revolutionary" || role == "head revolutionary")
                    {
                        message_say = "VIVA LA REVOLUTION!";
                    }
                    else if (Lang13.Bool(user.mind.gang_datum))
                    {
                        message_say = "" + String13.ToUpper(user.mind.gang_datum.name) + " RULES!";
                    }
                }
            }
            user.say(message_say);
            this.target = user;
            GlobalFuncs.message_admins(new Txt().item(GlobalFuncs.key_name_admin(user)).str("(<A HREF='?_src_=holder;adminmoreinfo=").Ref(user).str("'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=").Ref(user).str("'>FLW</A>) suicided with ").item(this.name).str(" at (").item(this.x).str(",").item(this.y).str(",").item(this.z).str(" - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=").item(this.x).str(";Y=").item(this.y).str(";Z=").item(this.z).str("'>JMP</a>)").ToString());
            GlobalFuncs.message_admins("" + GlobalFuncs.key_name(user) + " suicided with " + this.name + " at (" + this.x + "," + this.y + "," + this.z + ")");
            Task13.Sleep(10);
            this.explode(  );
            user.gib();
            return(0);
        }
コード例 #11
0
        // Function from file: gps.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            dynamic a = null;

            base.Topic(href, href_list, (object)(hsrc));

            if (Lang13.Bool(href_list["tag"]))
            {
                a = Interface13.Input("Please enter desired tag.", this.name, this.gpstag, null, null, InputType.Str);
                a = String13.ToUpper(String13.SubStr(GlobalFuncs.sanitize(a), 1, 5));

                if (this.loc == Task13.User)
                {
                    this.gpstag = a;
                    this.name   = "global positioning system (" + this.gpstag + ")";
                    this.attack_self(Task13.User);
                }
            }
            return(null);
        }
コード例 #12
0
        // Function from file: mulebot.dm
        public void RunOver(Mob_Living H = null)
        {
            int damage = 0;
            Obj_Effect_Decal_Cleanable_Blood B = null;

            GlobalFuncs.add_logs(this, H, "run over", null, "(DAMTYPE: " + String13.ToUpper("brute") + ")");
            H.visible_message("<span class='danger'>" + this + " drives over " + H + "!</span>", "<span class='userdanger'>" + this + " drives over you!<span>");
            GlobalFuncs.playsound(this.loc, "sound/effects/splat.ogg", 50, 1);
            damage = Rand13.Int(5, 15);
            H.apply_damage(damage * 2, "brute", "head", this.run_armor_check("head", "melee"));
            H.apply_damage(damage * 2, "brute", "chest", this.run_armor_check("chest", "melee"));
            H.apply_damage(damage * 0.5, "brute", "l_leg", this.run_armor_check("l_leg", "melee"));
            H.apply_damage(damage * 0.5, "brute", "r_leg", this.run_armor_check("r_leg", "melee"));
            H.apply_damage(damage * 0.5, "brute", "l_arm", this.run_armor_check("l_arm", "melee"));
            H.apply_damage(damage * 0.5, "brute", "r_arm", this.run_armor_check("r_arm", "melee"));
            B = new Obj_Effect_Decal_Cleanable_Blood(this.loc);
            B.add_blood_list(H);
            this.add_blood_list(H);
            this.bloodiness += 4;
            return;
        }
コード例 #13
0
        // Function from file: item_attack.dm
        public virtual bool attack(dynamic M = null, dynamic user = null, bool?def_zone = null)
        {
            if (!(M is Mob_Living))
            {
                return(false);
            }

            if (Lang13.Bool(this.hitsound) && Convert.ToDouble(this.force) > 0)
            {
                GlobalFuncs.playsound(this.loc, this.hitsound, this.get_clamped_volume(), 1, -1);
            }
            else if (this.force == 0)
            {
                GlobalFuncs.playsound(this.loc, "sound/weapons/tap.ogg", this.get_clamped_volume(), 1, -1);
            }
            user.lastattacked = M;
            M.lastattacker    = user;
            ((Mob_Living)M).attacked_by(this, user, def_zone);
            GlobalFuncs.add_logs(user, M, "attacked", this.name, "(INTENT: " + String13.ToUpper(user.a_intent) + ") (DAMTYPE: " + String13.ToUpper(this.damtype) + ")");
            this.add_fingerprint(user);
            return(true);
        }
コード例 #14
0
        // Function from file: syringes.dm
        public override bool afterattack(dynamic target = null, dynamic user = null, bool?proximity_flag = null, string click_parameters = null)
        {
            dynamic       M          = null;
            dynamic       H          = null;
            dynamic       amount     = null;
            dynamic       T          = null;
            dynamic       B          = null;
            dynamic       H2         = null;
            dynamic       trans      = null;
            ByTable       rinject    = null;
            Reagent       R          = null;
            string        contained  = null;
            dynamic       M2         = null;
            double?       fraction   = null;
            ByTable       rinject2   = null;
            Reagent       R2         = null;
            string        contained2 = null;
            dynamic       M3         = null;
            double?       fraction2  = null;
            Reagent_Blood B2         = null;
            Reagent_Blood d          = null;
            dynamic       C          = null;


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

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

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

            if (target is Mob_Living)
            {
                M = target;

                if (!((Mob_Living)M).can_inject(user, true))
                {
                    return(false);
                }
            }

            switch ((bool)(this.mode))
            {
            case false:

                if ((this.reagents.total_volume ?? 0) >= Convert.ToDouble(this.reagents.maximum_volume))
                {
                    user.WriteMsg("<span class='notice'>The syringe is full.</span>");
                    return(false);
                }

                if (target is Mob)
                {
                    if (target is Mob_Living_Carbon_Human)
                    {
                        H = target;

                        if (Lang13.Bool(((dynamic)(H.dna.species.specflags != null && !(H.dna.species.exotic_blood != null))).Contains(1024)))
                        {
                            user.WriteMsg("<span class='warning'>You are unable to locate any blood!</span>");
                            return(false);
                        }
                    }

                    if (Lang13.Bool(this.reagents.has_reagent("blood")))
                    {
                        user.WriteMsg("<span class='warning'>There is already a blood sample in this syringe!</span>");
                        return(false);
                    }

                    if (target is Mob_Living_Carbon)
                    {
                        amount = this.reagents.maximum_volume - this.reagents.total_volume;
                        T      = target;

                        if (!Lang13.Bool(T.has_dna()) || Lang13.Bool(T.disabilities & 128))
                        {
                            user.WriteMsg("<span class='warning'>You are unable to locate any blood!</span>");
                            return(false);
                        }

                        if (target != user)
                        {
                            ((Ent_Static)target).visible_message("<span class='danger'>" + user + " is trying to take a blood sample from " + target + "!</span>", "<span class='userdanger'>" + user + " is trying to take a blood sample from " + target + "!</span>");
                            this.busy = true;

                            if (!GlobalFuncs.do_mob(user, target))
                            {
                                this.busy = false;
                                return(false);
                            }
                        }
                        this.busy = false;
                        B         = null;
                        B         = ((Mob_Living_Carbon)T).take_blood(this, amount);

                        if (!Lang13.Bool(B) && target is Mob_Living_Carbon_Human)
                        {
                            H2 = target;

                            if (H2.dna.species.exotic_blood != null && Lang13.Bool(H2.reagents.total_volume))
                            {
                                ((Reagents)target.reagents).trans_to(this, amount);
                            }
                            else
                            {
                                user.WriteMsg("<span class='warning'>You are unable to locate any blood!</span>");
                                return(false);
                            }
                        }

                        if (Lang13.Bool(B))
                        {
                            this.reagents.reagent_list.Add(B);
                            this.reagents.update_total();
                            this.on_reagent_change();
                            this.reagents.handle_reactions();
                        }
                        ((Ent_Static)user).visible_message("" + user + " takes a blood sample from " + target + ".");
                    }
                }
                else
                {
                    if (!Lang13.Bool(target.reagents.total_volume))
                    {
                        user.WriteMsg("<span class='warning'>" + target + " is empty!</span>");
                        return(false);
                    }

                    if (!Lang13.Bool(((Ent_Static)target).is_open_container()) && !(target is Obj_Structure_ReagentDispensers) && !(target is Obj_Item_SlimeExtract))
                    {
                        user.WriteMsg("<span class='warning'>You cannot directly remove reagents from " + target + "!</span>");
                        return(false);
                    }
                    trans = ((Reagents)target.reagents).trans_to(this, this.amount_per_transfer_from_this);
                    user.WriteMsg("<span class='notice'>You fill " + this + " with " + trans + " units of the solution.</span>");
                }

                if ((this.reagents.total_volume ?? 0) >= Convert.ToDouble(this.reagents.maximum_volume))
                {
                    this.mode = !this.mode;
                    this.update_icon();
                }
                break;

            case true:

                if (!Lang13.Bool(this.reagents.total_volume))
                {
                    user.WriteMsg("<span class='notice'>" + this + " is empty.</span>");
                    return(false);
                }

                if (!Lang13.Bool(((Ent_Static)target).is_open_container()) && !(target is Mob) && !(target is Obj_Item_Weapon_ReagentContainers_Food) && !(target is Obj_Item_SlimeExtract) && !(target is Obj_Item_Clothing_Mask_Cigarette) && !(target is Obj_Item_Weapon_Storage_Fancy_Cigarettes))
                {
                    user.WriteMsg("<span class='warning'>You cannot directly fill " + target + "!</span>");
                    return(false);
                }

                if ((target.reagents.total_volume ?? 0) >= Convert.ToDouble(target.reagents.maximum_volume))
                {
                    user.WriteMsg("<span class='notice'>" + target + " is full.</span>");
                    return(false);
                }

                if (target is Mob && target != user)
                {
                    ((Ent_Static)target).visible_message("<span class='danger'>" + user + " is trying to inject " + target + "!</span>", "<span class='userdanger'>" + user + " is trying to inject " + target + "!</span>");

                    if (!GlobalFuncs.do_mob(user, target))
                    {
                        return(false);
                    }

                    if (!Lang13.Bool(this.reagents.total_volume))
                    {
                        return(false);
                    }

                    if ((target.reagents.total_volume ?? 0) >= Convert.ToDouble(target.reagents.maximum_volume))
                    {
                        return(false);
                    }
                    ((Ent_Static)target).visible_message("<span class='danger'>" + user + " injects " + target + " with the syringe!", "<span class='userdanger'>" + user + " injects " + target + " with the syringe!");
                    rinject = new ByTable();

                    foreach (dynamic _a in Lang13.Enumerate(this.reagents.reagent_list, typeof(Reagent)))
                    {
                        R = _a;

                        rinject.Add(R.name);
                    }
                    contained = GlobalFuncs.english_list(rinject);
                    M2        = target;
                    GlobalFuncs.add_logs(user, M2, "injected", this, "which had " + contained);
                    fraction = Num13.MinInt(((int)((this.amount_per_transfer_from_this ?? 0) / (this.reagents.total_volume ?? 0))), 1);
                    this.reagents.reaction(target, GlobalVars.INJECT, fraction);
                }

                if (target is Mob && target == user)
                {
                    rinject2 = new ByTable();

                    foreach (dynamic _b in Lang13.Enumerate(this.reagents.reagent_list, typeof(Reagent)))
                    {
                        R2 = _b;

                        rinject2.Add(R2.name);
                    }
                    contained2 = GlobalFuncs.english_list(rinject2);
                    M3         = target;
                    GlobalFuncs.log_attack("<font color='red'>" + user.name + " (" + user.ckey + ") injected " + M3.name + " (" + M3.ckey + ") with " + this.name + ", which had " + contained2 + " (INTENT: " + String13.ToUpper(user.a_intent) + ")</font>");
                    M3.attack_log += "[" + GlobalFuncs.time_stamp() + "] <font color='orange'>Injected themselves (" + contained2 + ") with " + this.name + ".</font>";
                    fraction2      = Num13.MinInt(((int)((this.amount_per_transfer_from_this ?? 0) / (this.reagents.total_volume ?? 0))), 1);
                    this.reagents.reaction(target, GlobalVars.INJECT, fraction2);
                }
                Task13.Schedule(5, (Task13.Closure)(() => {
                    B2 = null;

                    foreach (dynamic _c in Lang13.Enumerate(this.reagents.reagent_list, typeof(Reagent_Blood)))
                    {
                        d = _c;

                        B2 = d;
                        break;
                    }

                    if (B2 != null && target is Mob_Living_Carbon)
                    {
                        C = target;
                        ((Mob_Living_Carbon)C).inject_blood(this, 5);
                    }
                    else
                    {
                        this.reagents.trans_to(target, this.amount_per_transfer_from_this);
                    }
                    user.WriteMsg("<span class='notice'>You inject " + this.amount_per_transfer_from_this + " units of the solution. The syringe now contains " + this.reagents.total_volume + " units.</span>");

                    if ((this.reagents.total_volume ?? 0) <= 0 && this.mode)
                    {
                        this.mode = false;
                        this.update_icon();
                    }
                    return;
                }));
                break;
            }
            return(false);
        }
コード例 #15
0
        // Function from file: cart.dm
        public void generate_menu(Mob user = null)
        {
            Obj_Item_Radio_Integrated_Signal S = null;
            Data_Record t          = null;
            int         powercount = 0;
            Obj_Machinery_Computer_Monitor pMon = null;
            int count = 0;
            Obj_Machinery_Computer_Monitor pMon2 = null;
            ByTable L = null;
            Obj_Machinery_Power_Terminal term = null;
            Obj_Machinery_Power          A    = null;
            ByTable S2  = null;
            ByTable chg = null;
            Obj_Machinery_Power_Apc A2     = null;
            Data_Record             R      = null;
            Data_Record             R2     = null;
            Data_Crime          c          = null;
            Data_Crime          c2         = null;
            dynamic             S3         = null;
            dynamic             SO         = null;
            dynamic             S4         = null;
            dynamic             SO2        = null;
            dynamic             cl         = null;
            dynamic             ldat       = null;
            Obj_Item_Weapon_Mop M          = null;
            dynamic             ml         = null;
            double?direction               = null;
            Obj_Structure_Janitorialcart B = null;
            dynamic bl         = null;
            double? direction2 = null;
            Mob_Living_SimpleAnimal_Bot_Cleanbot B2 = null;
            dynamic bl2                    = null;
            double? direction3             = null;
            Newscaster_FeedChannel current = null;
            Newscaster_FeedChannel chan    = null;
            int i = 0;
            Newscaster_FeedMessage msg     = null;
            Newscaster_FeedComment comment = null;


            switch ((int)(this.mode))
            {
            case 40:
                S          = this.radio;
                this.menu  = "<h4><img src=pda_signaler.png> Remote Signaling System</h4>";
                this.menu += new Txt("\n<a href='byond://?src=").Ref(this).str(";choice=Send Signal'>Send Signal</A><BR>\nFrequency:\n<a href='byond://?src=").Ref(this).str(";choice=Signal Frequency;sfreq=-10'>-</a>\n<a href='byond://?src=").Ref(this).str(";choice=Signal Frequency;sfreq=-2'>-</a>\n").item(GlobalFuncs.format_frequency(S.frequency)).str("\n<a href='byond://?src=").Ref(this).str(";choice=Signal Frequency;sfreq=2'>+</a>\n<a href='byond://?src=").Ref(this).str(";choice=Signal Frequency;sfreq=10'>+</a><br>\n<br>\nCode:\n<a href='byond://?src=").Ref(this).str(";choice=Signal Code;scode=-5'>-</a>\n<a href='byond://?src=").Ref(this).str(";choice=Signal Code;scode=-1'>-</a>\n").item(S.code).str("\n<a href='byond://?src=").Ref(this).str(";choice=Signal Code;scode=1'>+</a>\n<a href='byond://?src=").Ref(this).str(";choice=Signal Code;scode=5'>+</a><br>").ToString();
                break;

            case 41:
                this.menu  = "<h4><img src=pda_notes.png> Crew Manifest</h4>";
                this.menu += "Entries cannot be modified from this terminal.<br><br>";

                if (GlobalVars.data_core.general != null)
                {
                    foreach (dynamic _a in Lang13.Enumerate(GlobalFuncs.sortRecord(GlobalVars.data_core.general), typeof(Data_Record)))
                    {
                        t = _a;

                        this.menu += "" + t.fields["name"] + " - " + t.fields["rank"] + "<br>";
                    }
                }
                this.menu += "<br>";
                break;

            case 42:
                this.menu  = "<h4><img src=pda_status.png> Station Status Display Interlink</h4>";
                this.menu += new Txt("[ <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=blank'>Clear</A> ]<BR>").ToString();
                this.menu += new Txt("[ <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=shuttle'>Shuttle ETA</A> ]<BR>").ToString();
                this.menu += new Txt("[ <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=message'>Message</A> ]").ToString();
                this.menu += new Txt("<ul><li> Line 1: <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=setmsg1'>").item((Lang13.Bool(this.message1) ? this.message1 : ((dynamic)("(none)")))).str("</A>").ToString();
                this.menu += new Txt("<li> Line 2: <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=setmsg2'>").item((Lang13.Bool(this.message2) ? this.message2 : ((dynamic)("(none)")))).str("</A></ul><br>").ToString();
                this.menu += new Txt("[ Alert: <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=alert;alert=default'>None</A> |").ToString();
                this.menu += new Txt(" <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=alert;alert=redalert'>Red Alert</A> |").ToString();
                this.menu += new Txt(" <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=alert;alert=lockdown'>Lockdown</A> |").ToString();
                this.menu += new Txt(" <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=alert;alert=biohazard'>Biohazard</A> ]<BR>").ToString();
                break;

            case 43:
                this.menu          = "<h4><img src=pda_power.png> Power Monitors - Please select one</h4><BR>";
                this.powmonitor    = null;
                this.powermonitors = new ByTable();
                powercount         = 0;

                foreach (dynamic _b in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_Computer_Monitor)))
                {
                    pMon = _b;


                    if (!((pMon.stat & 3) != 0))
                    {
                        powercount++;
                        this.powermonitors.Add(pMon);
                    }
                }

                if (!(powercount != 0))
                {
                    this.menu += "<span class='danger'>No connection<BR></span>";
                }
                else
                {
                    this.menu += "<FONT SIZE=-1>";
                    count      = 0;

                    foreach (dynamic _c in Lang13.Enumerate(this.powermonitors, typeof(Obj_Machinery_Computer_Monitor)))
                    {
                        pMon2 = _c;

                        count++;
                        this.menu += new Txt("<a href='byond://?src=").Ref(this).str(";choice=Power Select;target=").item(count).str("'>").item(pMon2).str(" </a><BR>").ToString();
                    }
                    this.menu += "</FONT>";
                }
                break;

            case 433:
                this.menu = "<h4><img src=pda_power.png> Power Monitor </h4><BR>";

                if (!Lang13.Bool(this.powmonitor))
                {
                    this.menu += "<span class='danger'>No connection<BR></span>";
                }
                else
                {
                    L = new ByTable();

                    foreach (dynamic _d in Lang13.Enumerate(this.powmonitor.attached.powernet.nodes, typeof(Obj_Machinery_Power_Terminal)))
                    {
                        term = _d;


                        if (term.master is Obj_Machinery_Power_Apc)
                        {
                            A = term.master;
                            L.Add(A);
                        }
                    }
                    this.menu += "<PRE>Total power: " + this.powmonitor.attached.powernet.viewavail + " W<BR>Total load:  " + String13.NumberToString(this.powmonitor.attached.powernet.viewload, 10) + " W<BR>";
                    this.menu += "<FONT SIZE=-1>";

                    if (L.len > 0)
                    {
                        this.menu += "Area                           Eqp./Lgt./Env.  Load   Cell<HR>";
                        S2         = new ByTable(new object [] { " Off", "AOff", "  On", " AOn" });
                        chg        = new ByTable(new object [] { "N", "C", "F" });

                        foreach (dynamic _e in Lang13.Enumerate(L, typeof(Obj_Machinery_Power_Apc)))
                        {
                            A2 = _e;

                            this.menu += String13.SubStr(GlobalFuncs.add_tspace(A2.area.name, 30), 1, 30);
                            this.menu += " " + S2[(A2.equipment ?? 0) + 1] + " " + S2[(A2.lighting ?? 0) + 1] + " " + S2[(A2.environ ?? 0) + 1] + " " + GlobalFuncs.add_lspace(A2.lastused_total, 6) + "  " + (Lang13.Bool(A2.cell) ? "" + GlobalFuncs.add_lspace(Num13.Floor(((Obj_Item_Weapon_StockParts_Cell)A2.cell).percent()), 3) + "% " + chg[A2.charging + 1] : "  N/C") + "<BR>";
                        }
                    }
                    this.menu += "</FONT></PRE>";
                }
                break;

            case 44:
                this.menu = "<h4><img src=pda_medical.png> Medical Record List</h4>";

                if (GlobalVars.data_core.general != null)
                {
                    foreach (dynamic _f in Lang13.Enumerate(GlobalFuncs.sortRecord(GlobalVars.data_core.general), typeof(Data_Record)))
                    {
                        R = _f;

                        this.menu += new Txt("<a href='byond://?src=").Ref(this).str(";choice=Medical Records;target=").item(R.fields["id"]).str("'>").item(R.fields["id"]).str(": ").item(R.fields["name"]).str("<br>").ToString();
                    }
                }
                this.menu += "<br>";
                break;

            case 441:
                this.menu = "<h4><img src=pda_medical.png> Medical Record</h4>";

                if (GlobalVars.data_core.general.Contains(this.active1))
                {
                    this.menu += "Name: " + this.active1.fields["name"] + " ID: " + this.active1.fields["id"] + "<br>";
                    this.menu += "Sex: " + this.active1.fields["sex"] + "<br>";
                    this.menu += "Age: " + this.active1.fields["age"] + "<br>";
                    this.menu += "Rank: " + this.active1.fields["rank"] + "<br>";
                    this.menu += "Fingerprint: " + this.active1.fields["fingerprint"] + "<br>";
                    this.menu += "Physical Status: " + this.active1.fields["p_stat"] + "<br>";
                    this.menu += "Mental Status: " + this.active1.fields["m_stat"] + "<br>";
                }
                else
                {
                    this.menu += "<b>Record Lost!</b><br>";
                }
                this.menu += "<br>";
                this.menu += "<h4><img src=pda_medical.png> Medical Data</h4>";

                if (GlobalVars.data_core.medical.Contains(this.active2))
                {
                    this.menu += "Blood Type: " + this.active2.fields["blood_type"] + "<br><br>";
                    this.menu += "Minor Disabilities: " + this.active2.fields["mi_dis"] + "<br>";
                    this.menu += "Details: " + this.active2.fields["mi_dis_d"] + "<br><br>";
                    this.menu += "Major Disabilities: " + this.active2.fields["ma_dis"] + "<br>";
                    this.menu += "Details: " + this.active2.fields["ma_dis_d"] + "<br><br>";
                    this.menu += "Allergies: " + this.active2.fields["alg"] + "<br>";
                    this.menu += "Details: " + this.active2.fields["alg_d"] + "<br><br>";
                    this.menu += "Current Diseases: " + this.active2.fields["cdi"] + "<br>";
                    this.menu += "Details: " + this.active2.fields["cdi_d"] + "<br><br>";
                    this.menu += "Important Notes: " + this.active2.fields["notes"] + "<br>";
                }
                else
                {
                    this.menu += "<b>Record Lost!</b><br>";
                }
                this.menu += "<br>";
                break;

            case 45:
                this.menu = "<h4><img src=pda_cuffs.png> Security Record List</h4>";

                if (GlobalVars.data_core.general != null)
                {
                    foreach (dynamic _g in Lang13.Enumerate(GlobalFuncs.sortRecord(GlobalVars.data_core.general), typeof(Data_Record)))
                    {
                        R2 = _g;

                        this.menu += new Txt("<a href='byond://?src=").Ref(this).str(";choice=Security Records;target=").item(R2.fields["id"]).str("'>").item(R2.fields["id"]).str(": ").item(R2.fields["name"]).str("<br>").ToString();
                    }
                }
                this.menu += "<br>";
                break;

            case 451:
                this.menu = "<h4><img src=pda_cuffs.png> Security Record</h4>";

                if (GlobalVars.data_core.general.Contains(this.active1))
                {
                    this.menu += "Name: " + this.active1.fields["name"] + " ID: " + this.active1.fields["id"] + "<br>";
                    this.menu += "Sex: " + this.active1.fields["sex"] + "<br>";
                    this.menu += "Age: " + this.active1.fields["age"] + "<br>";
                    this.menu += "Rank: " + this.active1.fields["rank"] + "<br>";
                    this.menu += "Fingerprint: " + this.active1.fields["fingerprint"] + "<br>";
                    this.menu += "Physical Status: " + this.active1.fields["p_stat"] + "<br>";
                    this.menu += "Mental Status: " + this.active1.fields["m_stat"] + "<br>";
                }
                else
                {
                    this.menu += "<b>Record Lost!</b><br>";
                }
                this.menu += "<br>";
                this.menu += "<h4><img src=pda_cuffs.png> Security Data</h4>";

                if (GlobalVars.data_core.security.Contains(this.active3))
                {
                    this.menu += "Criminal Status: " + this.active3.fields["criminal"] + "<br>";
                    this.menu += "<BR>\nMinor Crimes:";
                    this.menu += @"<table style=""text-align:center;"" border=""1"" cellspacing=""0"" width=""100%"">
<tr>
<th>Crime</th>
<th>Details</th>
<th>Author</th>
<th>Time Added</th>
</tr>";

                    foreach (dynamic _h in Lang13.Enumerate(this.active3.fields["mi_crim"], typeof(Data_Crime)))
                    {
                        c = _h;

                        this.menu += "<tr><td>" + c.crimeName + "</td>";
                        this.menu += "<td>" + c.crimeDetails + "</td>";
                        this.menu += "<td>" + c.author + "</td>";
                        this.menu += "<td>" + c.time + "</td>";
                        this.menu += "</tr>";
                    }
                    this.menu += "</table>";
                    this.menu += "<BR>\nMajor Crimes:";
                    this.menu += @"<table style=""text-align:center;"" border=""1"" cellspacing=""0"" width=""100%"">
<tr>
<th>Crime</th>
<th>Details</th>
<th>Author</th>
<th>Time Added</th>
</tr>";

                    foreach (dynamic _i in Lang13.Enumerate(this.active3.fields["ma_crim"], typeof(Data_Crime)))
                    {
                        c2 = _i;

                        this.menu += "<tr><td>" + c2.crimeName + "</td>";
                        this.menu += "<td>" + c2.crimeDetails + "</td>";
                        this.menu += "<td>" + c2.author + "</td>";
                        this.menu += "<td>" + c2.time + "</td>";
                        this.menu += "</tr>";
                    }
                    this.menu += "</table>";
                    this.menu += "<BR>\nImportant Notes:<br>";
                    this.menu += "" + this.active3.fields["notes"];
                }
                else
                {
                    this.menu += "<b>Record Lost!</b><br>";
                }
                this.menu += "<br>";
                break;

            case 47:
                this.menu  = "<h4><img src=pda_crate.png> Supply Record Interlink</h4>";
                this.menu += "<BR><B>Supply shuttle</B><BR>";
                this.menu += "Location: ";

                switch ((int)(GlobalVars.SSshuttle.supply.mode))
                {
                case 2:
                    this.menu += "Moving to ";

                    if (GlobalVars.SSshuttle.supply.z != 1)
                    {
                        this.menu += "station";
                    }
                    else
                    {
                        this.menu += "centcomm";
                    }
                    this.menu += " (" + GlobalVars.SSshuttle.supply.timeLeft(600) + " Mins)";
                    break;

                default:
                    this.menu += "At ";

                    if (GlobalVars.SSshuttle.supply.z != 1)
                    {
                        this.menu += "centcomm";
                    }
                    else
                    {
                        this.menu += "station";
                    }
                    break;
                }
                this.menu += "<BR>Current approved orders: <BR><ol>";

                foreach (dynamic _k in Lang13.Enumerate(GlobalVars.SSshuttle.shoppinglist))
                {
                    S3 = _k;

                    SO         = S3;
                    this.menu += "<li>#" + SO.id + " - " + SO.pack.name + " approved by " + SO.orderer + " " + (Lang13.Bool(SO.reason) ? "(" + SO.reason + ")" : "") + "</li>";
                }
                this.menu += "</ol>";
                this.menu += "Current requests: <BR><ol>";

                foreach (dynamic _l in Lang13.Enumerate(GlobalVars.SSshuttle.requestlist))
                {
                    S4 = _l;

                    SO2        = S4;
                    this.menu += "<li>#" + SO2.id + " - " + SO2.pack.name + " requested by " + SO2.orderer + "</li>";
                }
                this.menu += "</ol><font size=\"-3\">Upgrade NOW to Space Parts & Space Vendors PLUS for full remote order control and inventory management.";
                break;

            case 49:
                this.menu = "<h4><img src=pda_bucket.png> Persistent Custodial Object Locator</h4>";
                cl        = GlobalFuncs.get_turf(this);

                if (Lang13.Bool(cl))
                {
                    this.menu += "Current Orbital Location: <b>[" + cl.x + "," + cl.y + "]</b>";
                    this.menu += "<h4>Located Mops:</h4>";
                    ldat       = null;

                    foreach (dynamic _m in Lang13.Enumerate(typeof(Game13), typeof(Obj_Item_Weapon_Mop)))
                    {
                        M = _m;

                        ml = GlobalFuncs.get_turf(M);

                        if (Lang13.Bool(ml))
                        {
                            if (ml.z != cl.z)
                            {
                                continue;
                            }
                            direction = Map13.GetDistance(this, M);
                            ldat     += "Mop - <b>[" + ml.x + "," + ml.y + " (" + String13.ToUpper(GlobalFuncs.dir2text(direction)) + ")]</b> - " + (Lang13.Bool(M.reagents.total_volume) ? "Wet" : "Dry") + "<br>";
                        }
                    }

                    if (!Lang13.Bool(ldat))
                    {
                        this.menu += "None";
                    }
                    else
                    {
                        this.menu += "" + ldat;
                    }
                    this.menu += "<h4>Located Janitorial Cart:</h4>";
                    ldat       = null;

                    foreach (dynamic _n in Lang13.Enumerate(typeof(Game13), typeof(Obj_Structure_Janitorialcart)))
                    {
                        B = _n;

                        bl = GlobalFuncs.get_turf(B);

                        if (Lang13.Bool(bl))
                        {
                            if (bl.z != cl.z)
                            {
                                continue;
                            }
                            direction2 = Map13.GetDistance(this, B);
                            ldat      += "Cart - <b>[" + bl.x + "," + bl.y + " (" + String13.ToUpper(GlobalFuncs.dir2text(direction2)) + ")]</b> - Water level: " + B.reagents.total_volume + "/100<br>";
                        }
                    }

                    if (!Lang13.Bool(ldat))
                    {
                        this.menu += "None";
                    }
                    else
                    {
                        this.menu += "" + ldat;
                    }
                    this.menu += "<h4>Located Cleanbots:</h4>";
                    ldat       = null;

                    foreach (dynamic _o in Lang13.Enumerate(GlobalVars.living_mob_list, typeof(Mob_Living_SimpleAnimal_Bot_Cleanbot)))
                    {
                        B2 = _o;

                        bl2 = GlobalFuncs.get_turf(B2);

                        if (Lang13.Bool(bl2))
                        {
                            if (bl2.z != cl.z)
                            {
                                continue;
                            }
                            direction3 = Map13.GetDistance(this, B2);
                            ldat      += "Cleanbot - <b>[" + bl2.x + "," + bl2.y + " (" + String13.ToUpper(GlobalFuncs.dir2text(direction3)) + ")]</b> - " + (Lang13.Bool(B2.on) ? "Online" : "Offline") + "<br>";
                        }
                    }

                    if (!Lang13.Bool(ldat))
                    {
                        this.menu += "None";
                    }
                    else
                    {
                        this.menu += "" + ldat;
                    }
                }
                else
                {
                    this.menu += "ERROR: Unable to determine current location.";
                }
                this.menu += new Txt("<br><br><A href='byond://?src=").Ref(this).str(";choice=49'>Refresh GPS Locator</a>").ToString();
                break;

            case 53:
                this.menu  = "<h4><img src=pda_notes.png> Newscaster Access</h4>";
                this.menu += new Txt("<br> Current Newsfeed: <A href='byond://?src=").Ref(this).str(";choice=Newscaster Switch Channel'>").item((Lang13.Bool(this.current_channel) ? this.current_channel : "None")).str("</a> <br>").ToString();
                current    = null;

                foreach (dynamic _p in Lang13.Enumerate(GlobalVars.news_network.network_channels, typeof(Newscaster_FeedChannel)))
                {
                    chan = _p;


                    if (chan.channel_name == this.current_channel)
                    {
                        current = chan;
                    }
                }

                if (!(current != null))
                {
                    this.menu += "<h5> ERROR : NO CHANNEL FOUND </h5>";
                    return;
                }
                i = 1;

                foreach (dynamic _r in Lang13.Enumerate(current.messages, typeof(Newscaster_FeedMessage)))
                {
                    msg = _r;

                    this.menu += "-" + msg.returnBody(-1) + " <BR><FONT SIZE=1>[Story by <FONT COLOR='maroon'>" + msg.returnAuthor(-1) + "</FONT>]</FONT><BR>";
                    this.menu += "<b><font size=1>" + msg.comments.len + " comment" + (msg.comments.len > 1 ? "s" : "") + "</font></b><br>";

                    if (msg.img != null)
                    {
                        Interface13.CacheBrowseResource(user, msg.img, "tmp_photo" + i + ".png");
                        this.menu += "<img src='tmp_photo" + i + ".png' width = '180'><BR>";
                    }
                    i++;

                    foreach (dynamic _q in Lang13.Enumerate(msg.comments, typeof(Newscaster_FeedComment)))
                    {
                        comment = _q;

                        this.menu += "<font size=1><small>" + comment.body + "</font><br><font size=1><small><small><small>" + comment.author + " " + comment.time_stamp + "</small></small></small></small></font><br>";
                    }
                }
                this.menu += new Txt("<br> <A href='byond://?src=").Ref(this).str(";choice=Newscaster Message'>Post Message</a>").ToString();
                break;

            case 54:
                this.menu = "<h4><img src=pda_medbot.png> Bots Interlink</h4>";
                this.bot_control();
                break;
            }
            return;
        }
コード例 #16
0
        // Function from file: summonitem.dm
        public override bool cast(dynamic targets = null, dynamic thearea = null, dynamic user = null)
        {
            thearea = thearea ?? Task13.User;

            Mob_Living L                  = null;
            ByTable    hand_items         = null;
            bool       butterfingers      = false;
            string     message            = null;
            Obj        item               = null;
            Ent_Static item_to_retrive    = null;
            int        infinite_recursion = 0;
            Ent_Static organ              = null;
            Ent_Static M                  = null;
            Ent_Static C                  = null;
            Ent_Static P                  = null;


            foreach (dynamic _b in Lang13.Enumerate(targets, typeof(Mob_Living)))
            {
                L = _b;

                hand_items    = new ByTable(new object [] { L.get_active_hand(), L.get_inactive_hand() });
                butterfingers = false;
                message       = null;

                if (!(this.marked_item != null))
                {
                    message = "<span class='notice'>";

                    foreach (dynamic _a in Lang13.Enumerate(hand_items, typeof(Obj)))
                    {
                        item = _a;


                        if (Lang13.Bool(item.flags.Contains(128)))
                        {
                            continue;
                        }

                        if (Lang13.Bool(item.flags.Contains(2)))
                        {
                            message += "Though it feels redundant, ";
                        }
                        this.marked_item = item;
                        message         += "You mark " + item + " for recall.</span>";
                        this.name        = "Recall " + item;
                        break;
                    }

                    if (!(this.marked_item != null))
                    {
                        if (hand_items != null)
                        {
                            message = "<span class='caution'>You aren't holding anything that can be marked for recall.</span>";
                        }
                        else
                        {
                            message = "<span class='notice'>You must hold the desired item in your hands to mark it for recall.</span>";
                        }
                    }
                }
                else if (hand_items.Contains(this.marked_item != null && this.marked_item != null))
                {
                    message          = "<span class='notice'>You remove the mark on " + this.marked_item + " to use elsewhere.</span>";
                    this.name        = "Instant Summons";
                    this.marked_item = null;
                }
                else if (this.marked_item != null && Lang13.Bool(this.marked_item.gc_destroyed))
                {
                    message          = "<span class='warning'>You sense your marked item has been destroyed!</span>";
                    this.name        = "Instant Summons";
                    this.marked_item = null;
                }
                else
                {
                    item_to_retrive    = this.marked_item;
                    infinite_recursion = 0;

                    if (!(item_to_retrive.loc != null))
                    {
                        if (GlobalFuncs.isorgan(item_to_retrive))
                        {
                            organ = item_to_retrive;

                            if (Lang13.Bool(((dynamic)organ).owner))
                            {
                                GlobalFuncs.add_logs(L, ((dynamic)organ).owner, "magically removed " + organ.name + " from", null, "INTENT: " + String13.ToUpper(L.a_intent));
                                ((dynamic)organ).Remove(((dynamic)organ).owner);
                            }
                        }
                    }
                    else
                    {
                        while (!(item_to_retrive.loc is Tile) && infinite_recursion < 10)
                        {
                            if (item_to_retrive.loc is Mob)
                            {
                                M = item_to_retrive.loc;

                                if (M is Mob_Living_Silicon)
                                {
                                    M.loc.visible_message("<span class='warning'>" + M + " suddenly disappears!</span>");
                                    M.loc = L.loc;
                                    M.loc.visible_message("<span class='caution'>" + M + " suddenly appears!</span>");
                                    item_to_retrive = null;
                                    break;
                                }
                                ((Mob)M).unEquip(item_to_retrive);

                                if (M is Mob_Living_Carbon)
                                {
                                    C = M;

                                    if (Lang13.Bool(((dynamic)C).stomach_contents.Contains(Lang13.Bool(((dynamic)C).stomach_contents) && item_to_retrive != null)))
                                    {
                                        ((dynamic)C).stomach_contents -= item_to_retrive;
                                    }
                                }
                            }
                            else
                            {
                                if (item_to_retrive.loc is Obj_Machinery_PortableAtmospherics)
                                {
                                    P = item_to_retrive.loc;
                                    ((dynamic)P).disconnect();
                                    ((dynamic)P).update_icon();
                                }
                                item_to_retrive = item_to_retrive.loc;
                            }
                            infinite_recursion += 1;
                        }
                    }

                    if (!(item_to_retrive != null))
                    {
                        return(false);
                    }

                    if (item_to_retrive.loc != null)
                    {
                        item_to_retrive.loc.visible_message("<span class='warning'>The " + item_to_retrive.name + " suddenly disappears!</span>");
                    }

                    if (L.hand)
                    {
                        if (!L.equip_to_slot_if_possible(item_to_retrive, 4, false, true, true))
                        {
                            if (!L.equip_to_slot_if_possible(item_to_retrive, 5, false, true, true))
                            {
                                butterfingers = true;
                            }
                        }
                    }
                    else if (!L.equip_to_slot_if_possible(item_to_retrive, 5, false, true, true))
                    {
                        if (!L.equip_to_slot_if_possible(item_to_retrive, 4, false, true, true))
                        {
                            butterfingers = true;
                        }
                    }

                    if (butterfingers)
                    {
                        item_to_retrive.loc = L.loc;
                        item_to_retrive.loc.visible_message("<span class='caution'>The " + item_to_retrive.name + " suddenly appears!</span>");
                        GlobalFuncs.playsound(GlobalFuncs.get_turf(L), "sound/magic/SummonItems_generic.ogg", 50, 1);
                    }
                    else
                    {
                        item_to_retrive.loc.visible_message("<span class='caution'>The " + item_to_retrive.name + " suddenly appears in " + L + "'s hand!</span>");
                        GlobalFuncs.playsound(GlobalFuncs.get_turf(L), "sound/magic/SummonItems_generic.ogg", 50, 1);
                    }
                }

                if (Lang13.Bool(message))
                {
                    L.WriteMsg(message);
                }
            }
            return(false);
        }
コード例 #17
0
        // Function from file: mining_tools.dm
        public void drill_mob(dynamic target = null, Ent_Static user = null, int?drill_damage = null)
        {
            drill_damage = drill_damage ?? 80;

            dynamic H         = null;
            dynamic affecting = null;

            ((Ent_Static)target).visible_message("<span class='danger'>" + this.chassis + " drills " + target + " with " + this + ".</span>", "<span class='userdanger'>" + this.chassis + " drills " + target + " with " + this + ".</span>");
            GlobalFuncs.add_logs(user, target, "attacked", "" + this.name, "(INTENT: " + String13.ToUpper(((dynamic)user).a_intent) + ") (DAMTYPE: " + String13.ToUpper(this.damtype) + ")");

            if (target is Mob_Living_Carbon_Human)
            {
                H         = target;
                affecting = ((Mob_Living_Carbon_Human)H).get_organ("chest");
                affecting.take_damage(drill_damage);
                ((Mob_Living)H).update_damage_overlays(  );
            }
            else
            {
                ((Mob_Living)target).take_organ_damage(drill_damage);
            }

            if (Lang13.Bool(target))
            {
                ((Mob)target).Paralyse(10);
                ((Mob_Living)target).updatehealth();
            }
            return;
        }
コード例 #18
0
 // Function from file: organ_manipulation.dm
 public override bool success(dynamic user = null, Mob target = null, string target_zone = null, dynamic tool = null, Surgery surgery = null)
 {
     if (this.current_type == "mend")
     {
         ((Ent_Static)user).visible_message("" + user + " mends the incision in " + target + "'s " + GlobalFuncs.parse_zone(target_zone) + ".", "<span class='notice'>You mend the incision in " + target + "'s " + GlobalFuncs.parse_zone(target_zone) + ".</span>");
         return(true);
     }
     else if (this.current_type == "insert")
     {
         this.I = tool;
         user.drop_item();
         this.I.Insert(target);
         ((Ent_Static)user).visible_message("" + user + " inserts " + tool + " into " + target + "'s " + GlobalFuncs.parse_zone(target_zone) + "!", "<span class='notice'>You insert " + tool + " into " + target + "'s " + GlobalFuncs.parse_zone(target_zone) + ".</span>");
     }
     else if (this.current_type == "extract")
     {
         if (Lang13.Bool(this.I) && this.I.owner == target)
         {
             ((Ent_Static)user).visible_message("" + user + " successfully extracts " + this.I + " from " + target + "'s " + GlobalFuncs.parse_zone(target_zone) + "!", "<span class='notice'>You successfully extract " + this.I + " from " + target + "'s " + GlobalFuncs.parse_zone(target_zone) + ".</span>");
             GlobalFuncs.add_logs(user, target, "surgically removed " + this.I.name + " from", null, "INTENT: " + String13.ToUpper(user.a_intent));
             this.I.Remove(target);
             this.I.loc = GlobalFuncs.get_turf(target);
         }
         else
         {
             ((Ent_Static)user).visible_message("" + user + " can't seem to extract anything from " + target + "'s " + GlobalFuncs.parse_zone(target_zone) + "!", "<span class='notice'>You can't extract anything from " + target + "'s " + GlobalFuncs.parse_zone(target_zone) + "!</span>");
         }
     }
     return(false);
 }
コード例 #19
0
        // Function from file: wizarditis.dm
        public void teleport(  )
        {
            ByTable    theareas = null;
            Zone_Space S        = null;
            dynamic    thearea  = null;
            ByTable    L        = null;
            dynamic    T        = null;
            bool       clear    = false;
            Obj        O        = null;

            theareas = GlobalFuncs.get_areas_in_range(80, this.affected_mob);

            foreach (dynamic _a in Lang13.Enumerate(theareas, typeof(Zone_Space)))
            {
                S = _a;

                theareas.Remove(S);
            }

            if (!(theareas != null) || !(theareas.len != 0))
            {
                return;
            }
            thearea = Rand13.PickFromTable(theareas);
            L       = new ByTable();

            foreach (dynamic _c in Lang13.Enumerate(GlobalFuncs.get_area_turfs(thearea.type)))
            {
                T = _c;


                if (T.z != this.affected_mob.z)
                {
                    continue;
                }

                if (T.name == "space")
                {
                    continue;
                }

                if (!T.density)
                {
                    clear = true;

                    foreach (dynamic _b in Lang13.Enumerate(T, typeof(Obj)))
                    {
                        O = _b;


                        if (O.density)
                        {
                            clear = false;
                            break;
                        }
                    }

                    if (clear)
                    {
                        L.Add(T);
                    }
                }
            }

            if (!(L != null))
            {
                return;
            }
            ((Ent_Dynamic)this.affected_mob).say("SCYAR NILA " + String13.ToUpper(thearea.name) + "!");
            this.affected_mob.loc = Rand13.PickFromTable(L);
            return;
        }
コード例 #20
0
        // Function from file: atmos_control.dm
        public void reconnect(Mob user = null)
        {
            ByTable        IO      = null;
            RadioFrequency freq    = null;
            dynamic        devices = null;
            Obj_Machinery_Atmospherics_Components_Unary_VentPump U = null;
            ByTable text = null;
            Obj_Machinery_Atmospherics_Components_Unary_OutletInjector U2 = null;
            ByTable text2              = null;
            dynamic S                  = null;
            dynamic new_devices        = null;
            Obj_Machinery_AirSensor U3 = null;
            ByTable text3              = null;
            Obj_Machinery_Atmospherics_Components_Unary_OutletInjector U4 = null;
            Obj_Machinery_Atmospherics_Components_Unary_VentPump       U5 = null;

            IO      = new ByTable();
            freq    = GlobalVars.SSradio.return_frequency(1441);
            devices = freq.devices["_default"];

            foreach (dynamic _a in Lang13.Enumerate(devices, typeof(Obj_Machinery_Atmospherics_Components_Unary_VentPump)))
            {
                U = _a;

                text = GlobalFuncs.splittext(U.id_tag, "_");
                IO.Or(text[1]);
            }

            foreach (dynamic _b in Lang13.Enumerate(devices, typeof(Obj_Machinery_Atmospherics_Components_Unary_OutletInjector)))
            {
                U2 = _b;

                text2 = GlobalFuncs.splittext(U2.id, "_");
                IO.Or(text2[1]);
            }

            if (!(IO.len != 0))
            {
                user.WriteMsg("<span class='alert'>No machinery detected.</span>");
            }
            S = Interface13.Input("Select the device set: ", "Selection", IO[1], null, IO, InputType.Any);

            if (this != null)
            {
                this.input_tag  = "" + S + "_in";
                this.output_tag = "" + S + "_out";
                this.name       = "" + String13.ToUpper(S) + " Supply Control";
                new_devices     = freq.devices["4"];

                foreach (dynamic _c in Lang13.Enumerate(new_devices, typeof(Obj_Machinery_AirSensor)))
                {
                    U3 = _c;

                    text3 = GlobalFuncs.splittext(U3.id_tag, "_");

                    if (text3[1] == S)
                    {
                        this.sensors = new ByTable().Set("" + S + "_sensor", "Tank");
                        break;
                    }
                }
            }

            foreach (dynamic _d in Lang13.Enumerate(devices, typeof(Obj_Machinery_Atmospherics_Components_Unary_OutletInjector)))
            {
                U4 = _d;

                U4.broadcast_status();
            }

            foreach (dynamic _e in Lang13.Enumerate(devices, typeof(Obj_Machinery_Atmospherics_Components_Unary_VentPump)))
            {
                U5 = _e;

                U5.broadcast_status();
            }
            return;
        }
コード例 #21
0
        // Function from file: items.dm
        public void eyestab(dynamic M = null, dynamic user = null)
        {
            bool    is_human_victim = false;
            dynamic H         = null;
            dynamic Mo        = null;
            dynamic U         = null;
            dynamic affecting = null;

            is_human_victim = false;

            if (M is Mob_Living_Carbon_Human)
            {
                is_human_victim = true;
                H = M;

                if (Lang13.Bool(H.head) && Lang13.Bool(H.head.flags_cover & 4) || Lang13.Bool(H.wear_mask) && Lang13.Bool(H.wear_mask.flags_cover & 2) || Lang13.Bool(H.glasses) && Lang13.Bool(H.glasses.flags_cover & 1))
                {
                    user.WriteMsg("<span class='danger'>You're going to need to remove that mask/helmet/glasses first!</span>");
                    return;
                }
            }

            if (M is Mob_Living_Carbon_Monkey)
            {
                Mo = M;

                if (Lang13.Bool(Mo.wear_mask) && Lang13.Bool(Mo.wear_mask.flags_cover & 2))
                {
                    user.WriteMsg("<span class='danger'>You're going to need to remove that mask/helmet/glasses first!</span>");
                    return;
                }
            }

            if (M is Mob_Living_Carbon_Alien)
            {
                user.WriteMsg("<span class='warning'>You cannot locate any eyes on this creature!</span>");
                return;
            }

            if (M is Mob_Living_Carbon_Brain)
            {
                user.WriteMsg("<span class='danger'>You cannot locate any organic eyes on this brain!</span>");
                return;
            }
            this.add_fingerprint(user);
            GlobalFuncs.playsound(this.loc, this.hitsound, 30, 1, -1);

            if (M != user)
            {
                ((Ent_Static)M).visible_message("<span class='danger'>" + user + " has stabbed " + M + " in the eye with " + this + "!</span>", "<span class='userdanger'>" + user + " stabs you in the eye with " + this + "!</span>");
                ((Ent_Dynamic)user).do_attack_animation(M);
            }
            else
            {
                ((Ent_Static)user).visible_message("<span class='danger'>" + user + " has stabbed themself in the eyes with " + this + "!</span>", "<span class='userdanger'>You stab yourself in the eyes with " + this + "!</span>");
            }

            if (is_human_victim)
            {
                U         = M;
                affecting = ((Mob_Living_Carbon_Human)U).get_organ("head");

                if (((Obj_Item_Organ_Limb)affecting).take_damage(7))
                {
                    ((Mob_Living)U).update_damage_overlays(  );
                }
            }
            else
            {
                ((Mob_Living)M).take_organ_damage(7);
            }
            GlobalFuncs.add_logs(user, M, "attacked", "" + this.name, "(INTENT: " + String13.ToUpper(user.a_intent) + ")");
            ((Mob)M).adjust_blurriness(3);
            ((Mob)M).adjust_eye_damage(Rand13.Int(2, 4));

            if (M.eye_damage >= 10)
            {
                ((Mob)M).adjust_blurriness(15);

                if (Convert.ToInt32(M.stat) != 2)
                {
                    M.WriteMsg("<span class='danger'>Your eyes start to bleed profusely!</span>");
                }

                if (!Lang13.Bool(M.disabilities & 9))
                {
                    if (((Mob)M).become_nearsighted())
                    {
                        M.WriteMsg("<span class='danger'>You become nearsighted!</span>");
                    }
                }

                if (Rand13.PercentChance(50))
                {
                    if (Convert.ToInt32(M.stat) != 2)
                    {
                        if (Lang13.Bool(M.drop_item()))
                        {
                            M.WriteMsg("<span class='danger'>You drop what you're holding and clutch at your eyes!</span>");
                        }
                    }
                    ((Mob)M).adjust_blurriness(10);
                    ((Mob)M).Paralyse(1);
                    ((Mob)M).Weaken(2);
                }

                if (Rand13.PercentChance(M.eye_damage - 10 + 1))
                {
                    if (((Mob)M).become_blind())
                    {
                        M.WriteMsg("<span class='danger'>You go blind!</span>");
                    }
                }
            }
            return;
        }
コード例 #22
0
        public override bool f_action(dynamic target = null)
        {
            dynamic O = null;
            dynamic M = null;


            if (!this.action_checks(target))
            {
                return(false);
            }

            if (!(this.cargo_holder != null))
            {
                return(false);
            }

            if (target is Obj)
            {
                O = target;

                if (!Lang13.Bool(O.anchored))
                {
                    if (((dynamic)this.cargo_holder).cargo.len < Convert.ToDouble(((dynamic)this.cargo_holder).cargo_capacity))
                    {
                        this.chassis.visible_message("" + this.chassis + " lifts " + target + " and starts to load it into cargo compartment.");
                        O.anchored = 1;

                        if (this.do_after_cooldown(target))
                        {
                            ((dynamic)this.cargo_holder).cargo += O;
                            O.loc      = this.chassis;
                            O.anchored = 0;
                            this.occupant_message("<span class='notice'>" + target + " successfully loaded.</span>");
                            this.log_message("Loaded " + O + ". Cargo compartment capacity: " + (((dynamic)this.cargo_holder).cargo_capacity - ((dynamic)this.cargo_holder).cargo.len));
                        }
                        else
                        {
                            O.anchored = Lang13.Initial(O, "anchored");
                        }
                    }
                    else
                    {
                        this.occupant_message("<span class='warning'>Not enough room in cargo compartment!</span>");
                    }
                }
                else
                {
                    this.occupant_message("<span class='warning'>" + target + " is firmly secured!</span>");
                }
            }
            else if (target is Mob_Living)
            {
                M = target;

                if (Convert.ToInt32(M.stat) == 2)
                {
                    return(false);
                }

                if (((dynamic)this.chassis.occupant).a_intent == "harm")
                {
                    ((Mob_Living)M).take_overall_damage(this.dam_force);

                    if (!Lang13.Bool(M))
                    {
                        return(false);
                    }
                    ((Mob_Living)M).adjustOxyLoss(Num13.Floor(this.dam_force / 2));
                    ((Mob_Living)M).updatehealth();
                    ((Ent_Static)target).visible_message("<span class='danger'>" + this.chassis + " squeezes " + target + ".</span>", "<span class='userdanger'>" + this.chassis + " squeezes " + target + ".</span>", "<span class='italics'>You hear something crack.</span>");
                    GlobalFuncs.add_logs(this.chassis.occupant, M, "attacked", "" + this.name, "(INTENT: " + String13.ToUpper(((dynamic)this.chassis.occupant).a_intent) + ") (DAMTYE: " + String13.ToUpper(this.damtype) + ")");
                }
                else
                {
                    Map13.StepAway(M, this.chassis, null);
                    this.occupant_message("You push " + target + " out of the way.");
                    this.chassis.visible_message("" + this.chassis + " pushes " + target + " out of the way.");
                }
                return(true);
            }
            return(false);
        }
コード例 #23
0
ファイル: SurgeryStep_AddLimb.cs プロジェクト: Somnium13/SS13
        // Function from file: limb augmentation.dm
        public override bool success(dynamic user = null, Mob target = null, string target_zone = null, dynamic tool = null, Surgery surgery = null)
        {
            Mob H = null;
            Obj_Item_Organ_Internal I = null;


            if (Lang13.Bool(this.L))
            {
                if (target is Mob_Living_Carbon_Human)
                {
                    H = target;
                    ((Ent_Static)user).visible_message("" + user + " successfully augments " + target + "'s " + GlobalFuncs.parse_zone(target_zone) + "!", "<span class='notice'>You successfully augment " + target + "'s " + GlobalFuncs.parse_zone(target_zone) + ".</span>");
                    this.L.loc           = GlobalFuncs.get_turf(target);
                    ((dynamic)H).organs -= this.L;

                    switch ((string)(target_zone))
                    {
                    case "r_leg":
                        ((dynamic)H).organs += new Obj_Item_Organ_Limb_Robot_RLeg(this);
                        break;

                    case "l_leg":
                        ((dynamic)H).organs += new Obj_Item_Organ_Limb_Robot_LLeg(this);
                        break;

                    case "r_arm":
                        ((dynamic)H).organs += new Obj_Item_Organ_Limb_Robot_RArm(this);
                        break;

                    case "l_arm":
                        ((dynamic)H).organs += new Obj_Item_Organ_Limb_Robot_LArm(this);
                        break;

                    case "head":
                        ((dynamic)H).organs += new Obj_Item_Organ_Limb_Robot_Head(this);
                        break;

                    case "chest":

                        foreach (dynamic _a in Lang13.Enumerate(target.getorganszone(target_zone, true), typeof(Obj_Item_Organ_Internal)))
                        {
                            I = _a;


                            if (I.status == 1)
                            {
                                I.Remove(target, true);
                                GlobalFuncs.qdel(I);
                            }
                        }
                        ((dynamic)H).organs += new Obj_Item_Organ_Limb_Robot_Chest(this);
                        break;
                    }
                    user.drop_item();
                    GlobalFuncs.qdel(tool);
                    ((dynamic)H).update_damage_overlays(0);
                    ((dynamic)H).update_augments();
                    GlobalFuncs.add_logs(user, target, "augmented", null, "by giving him new " + GlobalFuncs.parse_zone(target_zone) + " INTENT: " + String13.ToUpper(user.a_intent));
                }
            }
            else
            {
                user.WriteMsg("<span class='warning'>" + target + " has no organic " + GlobalFuncs.parse_zone(target_zone) + " there!</span>");
            }
            return(true);
        }