Пример #1
0
        // Function from file: screen_objects.dm
        public override bool Click(dynamic loc = null, string control = null, string _params = null)
        {
            double?___x = null;
            double?___y = null;


            if (Task13.User is Mob_Living_Carbon_Human && Lang13.Bool(Task13.User.client.prefs.toggles & 32))
            {
                ___x = String13.ParseNumber(String13.ParseUrlParams(_params)["icon-x"]);
                ___y = String13.ParseNumber(String13.ParseUrlParams(_params)["icon-y"]);

                if ((___x ?? 0) <= 16 && (___y ?? 0) <= 16)
                {
                    Task13.User.a_intent_change("harm");
                }
                else if ((___x ?? 0) <= 16 && (___y ?? 0) >= 17)
                {
                    Task13.User.a_intent_change("help");
                }
                else if ((___x ?? 0) >= 17 && (___y ?? 0) <= 16)
                {
                    Task13.User.a_intent_change("grab");
                }
                else if ((___x ?? 0) >= 17 && (___y ?? 0) >= 17)
                {
                    Task13.User.a_intent_change("disarm");
                }
            }
            else
            {
                Task13.User.a_intent_change("right");
            }
            return(false);
        }
Пример #2
0
        // Function from file: movable_screen_objects.dm
        public override dynamic MouseDrop(dynamic over = null, dynamic src_location = null, dynamic over_location = null, string src_control = null, dynamic over_control = null, string _params = null)
        {
            ByTable PM = null;
            ByTable screen_loc_params = null;
            ByTable screen_loc_X      = null;
            ByTable screen_loc_Y      = null;
            double  pix_X             = 0;
            double  pix_Y             = 0;

            PM = String13.ParseUrlParams(_params);

            if (!(PM != null) || !Lang13.Bool(PM["screen-loc"]))
            {
                return(null);
            }
            screen_loc_params = GlobalFuncs.splittext(PM["screen-loc"], ",");
            screen_loc_X      = GlobalFuncs.splittext(screen_loc_params[1], ":");
            screen_loc_Y      = GlobalFuncs.splittext(screen_loc_params[2], ":");

            if (this.snap2grid)
            {
                this.screen_loc = "" + screen_loc_X[1] + "," + screen_loc_Y[1];
            }
            else
            {
                pix_X           = (String13.ParseNumber(screen_loc_X[2]) ?? 0) - 16;
                pix_Y           = (String13.ParseNumber(screen_loc_Y[2]) ?? 0) - 16;
                this.screen_loc = "" + screen_loc_X[1] + ":" + pix_X + "," + screen_loc_Y[1] + ":" + pix_Y;
            }
            this.moved = GlobalVars.TRUE;
            return(null);
        }
Пример #3
0
        // Function from file: action.dm
        public override bool Click(dynamic loc = null, string control = null, string _params = null)
        {
            ByTable modifiers = null;

            modifiers = String13.ParseUrlParams(_params);

            if (Lang13.Bool(modifiers["shift"]))
            {
                this.moved = 0;
                return(true);
            }
            Task13.User.hud_used.action_buttons_hidden = !Task13.User.hud_used.action_buttons_hidden;
            this.hidden = Task13.User.hud_used.action_buttons_hidden;

            if (this.hidden)
            {
                this.name = "Show Buttons";
            }
            else
            {
                this.name = "Hide Buttons";
            }
            this.UpdateIcon();
            Task13.User.update_action_buttons();
            return(false);
        }
Пример #4
0
        // Function from file: computer.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            ByTable options          = null;
            Obj_DockingPort_Mobile M = null;
            string dat = null;
            bool   destination_found     = false;
            Obj_DockingPort_Stationary S = null;
            Browser popup = null;


            if (Lang13.Bool(base.attack_hand((object)(a), b, c)))
            {
                return(null);
            }
            this.add_fingerprint(Task13.User);
            options = String13.ParseUrlParams(this.possible_destinations);
            M       = GlobalVars.SSshuttle.getShuttle(this.shuttleId);
            dat     = "Status: " + (M != null ? M.getStatusText() : "*Missing*") + "<br><br>";

            if (M != null)
            {
                foreach (dynamic _a in Lang13.Enumerate(GlobalVars.SSshuttle.stationary, typeof(Obj_DockingPort_Stationary)))
                {
                    S = _a;


                    if (!(options.Find(S.id) != 0))
                    {
                        continue;
                    }

                    if (M.canDock(S) != 0)
                    {
                        continue;
                    }
                    destination_found = true;
                    dat += new Txt("<A href='?src=").Ref(this).str(";move=").item(S.id).str("'>Send to ").item(S.name).str("</A><br>").ToString();
                }

                if (!destination_found)
                {
                    dat += "<B>Shuttle Locked</B><br>";

                    if (this.admin_controlled)
                    {
                        dat += "Authorized personnel only<br>";
                        dat += new Txt("<A href='?src=").Ref(this).str(";request=1]'>Request Authorization</A><br>").ToString();
                    }
                }
            }
            dat  += new Txt("<a href='?src=").Ref(a).str(";mach_close=computer'>Close</a>").ToString();
            popup = new Browser(a, "computer", (M != null ? M.name : "shuttle"), 300, 200);
            popup.set_content("<center>" + dat + "</center>");
            popup.set_title_image(Task13.User.browse_rsc_icon(this.icon, this.icon_state));
            popup.open();
            return(null);
        }
Пример #5
0
        // Function from file: firing.dm
        public bool throw_proj(dynamic target = null, dynamic targloc = null, dynamic user = null, string _params = null)
        {
            Ent_Static curloc        = null;
            ByTable    mouse_control = null;

            curloc = user.loc;

            if (!(targloc is Tile) || !(curloc is Tile) || !Lang13.Bool(this.BB))
            {
                return(false);
            }

            if (targloc == curloc)
            {
                if (Lang13.Bool(target))
                {
                    ((Ent_Static)target).bullet_act(this.BB, this.BB.def_zone);
                }
                GlobalFuncs.qdel(this.BB);
                this.BB = null;
                return(true);
            }
            this.BB.loc      = GlobalFuncs.get_turf(user);
            this.BB.starting = GlobalFuncs.get_turf(user);
            this.BB.current  = curloc;
            this.BB.yo       = Convert.ToDouble(targloc.y - curloc.y);
            this.BB.xo       = Convert.ToDouble(targloc.x - curloc.x);

            if (Lang13.Bool(_params))
            {
                mouse_control = String13.ParseUrlParams(_params);

                if (Lang13.Bool(mouse_control["icon-x"]))
                {
                    this.BB.p_x = String13.ParseNumber(mouse_control["icon-x"]);
                }

                if (Lang13.Bool(mouse_control["icon-y"]))
                {
                    this.BB.p_y = String13.ParseNumber(mouse_control["icon-y"]);
                }
            }

            if (Lang13.Bool(this.BB))
            {
                ((Obj_Item_Projectile)this.BB).fire();
            }
            this.BB = null;
            return(true);
        }
Пример #6
0
        // Function from file: artstuff.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            ByTable click_params   = null;
            double? pixX           = null;
            double? pixY           = null;
            Icon    masterpiece    = null;
            string  thePix         = null;
            Icon    Ico            = null;
            string  theOriginalPix = null;
            dynamic C = null;

            click_params = String13.ParseUrlParams(_params);
            pixX         = String13.ParseNumber(click_params["icon-x"]);
            pixY         = String13.ParseNumber(click_params["icon-y"]);

            if (!(click_params != null) || !Lang13.Bool(click_params["icon-x"]) || !Lang13.Bool(click_params["icon-y"]))
            {
                return(null);
            }

            if (A is Obj_Item_Weapon_Soap || A is Obj_Item_Weapon_ReagentContainers_Glass_Rag)
            {
                masterpiece = new Icon(this.icon, this.icon_state);
                thePix      = masterpiece.GetPixel(pixX, pixY);
                Ico         = this.getGlobalBackup();

                if (!(Ico != null))
                {
                    GlobalFuncs.qdel(masterpiece);
                    return(null);
                }
                theOriginalPix = Ico.GetPixel(pixX, pixY);

                if (thePix != theOriginalPix)
                {
                    this.DrawPixelOn(theOriginalPix, pixX, pixY);
                }
                GlobalFuncs.qdel(masterpiece);
                return(null);
            }

            if (A is Obj_Item_Toy_Crayon)
            {
                C = A;
                this.DrawPixelOn(C.paint_color, pixX, pixY);
                return(null);
            }
            base.attackby((object)(A), (object)(user), _params, silent, replace_spent);
            return(null);
        }
        // Function from file: experimentor.dm
        public ByTable ConvertReqString2List(dynamic source_list = null)
        {
            ByTable temp_list = null;
            dynamic O         = null;

            temp_list = String13.ParseUrlParams(source_list);

            foreach (dynamic _a in Lang13.Enumerate(temp_list))
            {
                O = _a;

                temp_list[O] = String13.ParseNumber(temp_list[O]);
            }
            return(temp_list);
        }
Пример #8
0
        // Function from file: buildmode.dm
        public override bool Click(dynamic loc = null, string control = null, string _params = null)
        {
            ByTable pa = null;

            pa = String13.ParseUrlParams(_params);

            if (pa.Find("left") != 0)
            {
                ((Buildmode)this.bd).toggle_modes();
            }
            else if (pa.Find("right") != 0)
            {
                ((Buildmode)this.bd).change_settings(Task13.User);
            }
            this.update_icon();
            return(true);
        }
Пример #9
0
        // Function from file: observer.dm
        public override void ClickOn(Ent_Static A = null, string _params = null)
        {
            ByTable modifiers = null;


            if (this.client.click_intercept != null)
            {
                if (Lang13.Bool(Lang13.Call(Lang13.BindFunc(this.client.click_intercept, "ClickOn"), this, _params, A)))
                {
                    return;
                }
            }
            modifiers = String13.ParseUrlParams(_params);

            if (Lang13.Bool(modifiers["middle"]))
            {
                this.MiddleClickOn(A);
                return;
            }

            if (Lang13.Bool(modifiers["shift"]))
            {
                this.ShiftClickOn(A);
                return;
            }

            if (Lang13.Bool(modifiers["alt"]))
            {
                this.AltClickOn(A);
                return;
            }

            if (Lang13.Bool(modifiers["ctrl"]))
            {
                this.CtrlClickOn(A);
                return;
            }

            if (Game13.time <= this.next_move)
            {
                return;
            }
            A.attack_ghost(this);
            return;
        }
Пример #10
0
        // Function from file: action.dm
        public override bool Click(dynamic loc = null, string control = null, string _params = null)
        {
            ByTable modifiers = null;

            modifiers = String13.ParseUrlParams(_params);

            if (Lang13.Bool(modifiers["shift"]))
            {
                this.moved = 0;
                return(true);
            }

            if (Task13.User.next_move >= Game13.time)
            {
                return(false);
            }
            this.owner.Trigger();
            return(true);
        }
Пример #11
0
        // Function from file: 510.dm
        public void Find(dynamic text = null)
        {
            string  method  = null;
            dynamic results = null;
            ByTable L       = null;
            ByTable M       = null;
            dynamic i       = null;
            int     j       = 0;
            double? pos     = null;
            double? len     = null;


            if (this.flags.Contains("i"))
            {
                method = "regex_find";
            }
            else
            {
                method = "regEx_find";
            }
            results = Lang13.Call(Lang13.GetLibFunc("code/__HELPERS/bygex", method), text, this.pattern);
            L       = String13.ParseUrlParams(results);

            foreach (dynamic _a in Lang13.Enumerate(L))
            {
                i = _a;

                M = L[i];
                j = 2;

                while (j <= M.len)
                {
                    pos = String13.ParseNumber(M[j - 1]);
                    len = String13.ParseNumber(M[j]);
                    this.group.Add(String13.SubStr(text, ((int)(pos ?? 0)), ((int)((pos ?? 0) + (len ?? 0)))));
                    j += 2;
                }
            }
            return;
        }
Пример #12
0
        // Function from file: overmind.dm
        public override void ClickOn(Ent_Static A = null, string _params = null)
        {
            ByTable modifiers = null;
            dynamic T         = null;

            modifiers = String13.ParseUrlParams(_params);

            if (Lang13.Bool(modifiers["middle"]))
            {
                this.MiddleClickOn(A);
                return;
            }

            if (Lang13.Bool(modifiers["shift"]))
            {
                this.ShiftClickOn(A);
                return;
            }

            if (Lang13.Bool(modifiers["alt"]))
            {
                this.AltClickOn(A);
                return;
            }

            if (Lang13.Bool(modifiers["ctrl"]))
            {
                this.CtrlClickOn(A);
                return;
            }
            T = GlobalFuncs.get_turf(A);

            if (Lang13.Bool(T))
            {
                this.expand_blob(T);
            }
            return;
        }
Пример #13
0
        // Function from file: alert.dm
        public override bool Click(dynamic loc = null, string control = null, string _params = null)
        {
            ByTable paramslist = null;


            if (!(Task13.User != null) || !(Task13.User.client != null))
            {
                return(false);
            }
            paramslist = String13.ParseUrlParams(_params);

            if (Lang13.Bool(paramslist["shift"]))
            {
                Task13.User.WriteMsg("<span class='boldnotice'>" + this.name + "</span> - <span class='info'>" + this.desc + "</span>");
                return(false);
            }

            if (this.master != null)
            {
                Task13.User.client.Click(this.master, loc, control, _params); return(false);
            }
            return(false);
        }
Пример #14
0
        // Function from file: click.dm
        public override bool Click(dynamic loc = null, string control = null, string _params = null)
        {
            ByTable modifiers = null;
            Mob     C         = null;
            Tile    T         = null;

            modifiers = String13.ParseUrlParams(_params);

            if (Lang13.Bool(modifiers["middle"]) && Task13.User is Mob_Living_Carbon)
            {
                C = Task13.User;
                C.swap_hand();
            }
            else
            {
                T = GlobalFuncs.screen_loc2turf(modifiers["screen-loc"], GlobalFuncs.get_turf(Task13.User));

                if (T != null)
                {
                    T.Click(loc, control, _params);
                }
            }
            return(true);
        }
Пример #15
0
        // Function from file: scanners.dm
        public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null)
        {
            ByTable blood_traces = null;
            Reagent R            = null;
            string  dat          = null;
            dynamic R2           = null;


            if (Lang13.Bool(user.stat) || user.eye_blind != 0)
            {
                return(null);
            }

            if (this.crit_fail)
            {
                user.WriteMsg("<span class='warning'>This device has critically failed and is no longer functional!</span>");
                return(null);
            }

            if (!((Mob)user).IsAdvancedToolUser())
            {
                user.WriteMsg("<span class='warning'>You don't have the dexterity to do this!</span>");
                return(null);
            }

            if (Lang13.Bool(this.reagents.total_volume))
            {
                blood_traces = new ByTable();

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


                    if (R.id != "blood")
                    {
                        this.reagents.clear_reagents();
                        user.WriteMsg("<span class='warning'>The sample was contaminated! Please insert another sample.</span>");
                        return(null);
                    }
                    else
                    {
                        blood_traces = String13.ParseUrlParams(R.data["trace_chem"]);
                        break;
                    }
                }
                dat = "<i><b>Trace Chemicals Found:</b>";

                if (!(blood_traces.len != 0))
                {
                    dat += "<br>None";
                }
                else
                {
                    foreach (dynamic _b in Lang13.Enumerate(blood_traces))
                    {
                        R2 = _b;


                        if (Rand13.PercentChance(((int)(this.reliability))))
                        {
                            dat += "<br>" + GlobalVars.chemical_reagents_list[R2];

                            if (this.details)
                            {
                                dat += " (" + blood_traces[R2] + " units)";
                            }
                            this.recent_fail = false;
                        }
                        else if (this.recent_fail)
                        {
                            this.crit_fail = true;
                            this.reagents.clear_reagents();
                            return(null);
                        }
                        else
                        {
                            this.recent_fail = true;
                        }
                    }
                }
                dat += "</i>";
                user.WriteMsg(dat);
                this.reagents.clear_reagents();
            }
            return(null);
        }
Пример #16
0
        // Function from file: screen_objects.dm
        public override bool Click(dynamic loc = null, string control = null, string _params = null)
        {
            ByTable PL            = null;
            double? icon_x        = null;
            double? icon_y        = null;
            string  old_selecting = null;

            PL            = String13.ParseUrlParams(_params);
            icon_x        = String13.ParseNumber(PL["icon-x"]);
            icon_y        = String13.ParseNumber(PL["icon-y"]);
            old_selecting = this.selecting;

            dynamic _e = icon_y;             // Was a switch-case, sorry for the mess.

            if (1 <= _e && _e <= 9)
            {
                dynamic _a = icon_x;                 // Was a switch-case, sorry for the mess.
                if (10 <= _a && _a <= 15)
                {
                    this.selecting = "r_leg";
                }
                else if (17 <= _a && _a <= 22)
                {
                    this.selecting = "l_leg";
                }
                else
                {
                    return(true);
                }
            }
            else if (10 <= _e && _e <= 13)
            {
                dynamic _b = icon_x;                 // Was a switch-case, sorry for the mess.
                if (8 <= _b && _b <= 11)
                {
                    this.selecting = "r_arm";
                }
                else if (12 <= _b && _b <= 20)
                {
                    this.selecting = "groin";
                }
                else if (21 <= _b && _b <= 24)
                {
                    this.selecting = "l_arm";
                }
                else
                {
                    return(true);
                }
            }
            else if (14 <= _e && _e <= 22)
            {
                dynamic _c = icon_x;                 // Was a switch-case, sorry for the mess.
                if (8 <= _c && _c <= 11)
                {
                    this.selecting = "r_arm";
                }
                else if (12 <= _c && _c <= 20)
                {
                    this.selecting = "chest";
                }
                else if (21 <= _c && _c <= 24)
                {
                    this.selecting = "l_arm";
                }
                else
                {
                    return(true);
                }
            }
            else if (23 <= _e && _e <= 30)
            {
                if (Lang13.IsInRange(icon_x ?? 0, 12, 20))
                {
                    this.selecting = "head";

                    dynamic _d = icon_y;                     // Was a switch-case, sorry for the mess.
                    if (23 <= _d && _d <= 24)
                    {
                        if (Lang13.IsInRange(icon_x ?? 0, 15, 17))
                        {
                            this.selecting = "mouth";
                        }
                    }
                    else if (25 <= _d && _d <= 27)
                    {
                        if (Lang13.IsInRange(icon_x ?? 0, 15, 17))
                        {
                            this.selecting = "eyes";
                        }
                    }
                    else if (_d == 26)
                    {
                        if (Lang13.IsInRange(icon_x ?? 0, 14, 18))
                        {
                            this.selecting = "eyes";
                        }
                    }
                }
            }

            if (old_selecting != this.selecting)
            {
                this.update_icon(Task13.User);
            }
            return(true);
        }
Пример #17
0
        // Function from file: laserpointer.dm
        public void laser_act(dynamic target = null, dynamic user = null, string _params = null)
        {
            dynamic H            = null;
            string  outmsg       = null;
            dynamic targloc      = null;
            dynamic C            = null;
            double? severity     = null;
            dynamic S            = null;
            dynamic C2           = null;
            ByTable showto       = null;
            dynamic M            = null;
            Image   I            = null;
            ByTable click_params = null;


            if (!Map13.FetchViewers(target, 7).Contains(user))
            {
                return;
            }

            if (!Lang13.Bool(this.diode))
            {
                user.WriteMsg("<span class='notice'>You point " + this + " at " + target + ", but nothing happens!</span>");
                return;
            }

            if (!((Mob)user).IsAdvancedToolUser())
            {
                user.WriteMsg("<span class='warning'>You don't have the dexterity to do this!</span>");
                return;
            }

            if (user is Mob_Living_Carbon_Human)
            {
                H = user;

                if (H.dna.species.specflags.Contains(((Dna)H.dna).check_mutation("Hulk") != 0 || 512 != 0))
                {
                    user.WriteMsg("<span class='warning'>Your fingers can't press the button!</span>");
                    return;
                }
            }
            this.add_fingerprint(user);

            if (this.recharge_locked)
            {
                user.WriteMsg("<span class='notice'>You point " + this + " at " + target + ", but it's still charging.</span>");
                return;
            }
            targloc = GlobalFuncs.get_turf(target);

            if (target is Mob_Living_Carbon)
            {
                C = target;

                if (user.zone_selected == "eyes")
                {
                    GlobalFuncs.add_logs(user, C, "shone in the eyes", this);
                    severity = 1;

                    if (Rand13.PercentChance(33))
                    {
                        severity = 2;
                    }
                    else if (Rand13.PercentChance(50))
                    {
                        severity = 0;
                    }

                    if (Rand13.PercentChance(((int)(this.effectchance * Convert.ToDouble(this.diode.rating)))) && ((Mob_Living)C).flash_eyes(severity))
                    {
                        outmsg = "<span class='notice'>You blind " + C + " by shining " + this + " in their eyes.</span>";

                        if (C.weakeyes)
                        {
                            ((Mob)C).Stun(1);
                        }
                    }
                    else
                    {
                        outmsg = "<span class='warning'>You fail to blind " + C + " by shining " + this + " at their eyes!</span>";
                    }
                }
            }
            else if (target is Mob_Living_Silicon_Robot)
            {
                S = target;

                if (Rand13.PercentChance(((int)(this.effectchance * Convert.ToDouble(this.diode.rating)))))
                {
                    ((Mob_Living)S).flash_eyes(null, null, true);
                    ((Mob)S).Weaken(Rand13.Int(5, 10));
                    S.WriteMsg("<span class='danger'>Your sensors were overloaded by a laser!</span>");
                    outmsg = "<span class='notice'>You overload " + S + " by shining " + this + " at their sensors.</span>";
                    GlobalFuncs.add_logs(user, S, "shone in the sensors", this);
                }
                else
                {
                    outmsg = "<span class='warning'>You fail to overload " + S + " by shining " + this + " at their sensors!</span>";
                }
            }
            else if (target is Obj_Machinery_Camera)
            {
                C2 = target;

                if (Rand13.PercentChance(((int)(this.effectchance * Convert.ToDouble(this.diode.rating)))))
                {
                    ((Ent_Static)C2).emp_act(1);
                    outmsg = "<span class='notice'>You hit the lens of " + C2 + " with " + this + ", temporarily disabling the camera!</span>";
                    GlobalFuncs.add_logs(user, C2, "EMPed", this);
                }
                else
                {
                    outmsg = "<span class='warning'>You miss the lens of " + C2 + " with " + this + "!</span>";
                }
            }
            this.icon_state = "pointer_" + this.pointer_icon_state;
            showto          = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(Map13.FetchViewers(targloc, 7)))
            {
                M = _a;


                if (Lang13.Bool(M.client))
                {
                    showto.Add(M.client);
                }
            }
            I            = new Image("icons/obj/projectiles.dmi", targloc, this.pointer_icon_state, 10);
            click_params = String13.ParseUrlParams(_params);

            if (click_params != null)
            {
                if (Lang13.Bool(click_params["icon-x"]))
                {
                    I.pixel_x = ((int)((String13.ParseNumber(click_params["icon-x"]) ?? 0) - 16));
                }

                if (Lang13.Bool(click_params["icon-y"]))
                {
                    I.pixel_y = ((int)((String13.ParseNumber(click_params["icon-y"]) ?? 0) - 16));
                }
            }
            else
            {
                I.pixel_x = Convert.ToInt32(target.pixel_x + Rand13.Int(-5, 5));
                I.pixel_y = Convert.ToInt32(target.pixel_y + Rand13.Int(-5, 5));
            }

            if (Lang13.Bool(outmsg))
            {
                user.WriteMsg(outmsg);
            }
            else
            {
                user.WriteMsg("<span class='info'>You point " + this + " at " + target + ".</span>");
            }
            this.energy -= 1;

            if (this.energy <= this.max_energy)
            {
                if (!this.recharging)
                {
                    this.recharging = true;
                    GlobalVars.SSobj.processing.Or(this);
                }

                if (this.energy <= 0)
                {
                    user.WriteMsg("<span class='warning'>The " + this + "'s battery is overused, it needs time to recharge!</span>");
                    this.recharge_locked = true;
                }
            }
            GlobalFuncs.flick_overlay(I, showto, 10);
            this.icon_state = "pointer";
            return;
        }
Пример #18
0
        // Function from file: buildmode.dm
        public bool ClickOn(Ent_Static user = null, string _params = null, Base_Data _object = null)
        {
            bool _default = false;

            ByTable   pa          = null;
            int       right_click = 0;
            int       left_click  = 0;
            int       alt_click   = 0;
            int       ctrl_click  = 0;
            Base_Data T           = null;
            Base_Data T2          = null;
            Base_Data T3          = null;
            Base_Data T4          = null;
            Obj_Structure_Window_Reinforced WIN  = null;
            Obj_Structure_Window_Reinforced WIN2 = null;
            Obj_Structure_Window_Reinforced WIN3 = null;
            Obj_Structure_Window_Reinforced WIN4 = null;
            Obj_Structure_Window_Reinforced WIN5 = null;
            dynamic T5 = null;
            dynamic A  = null;
            dynamic G  = null;
            dynamic T6 = null;

            pa          = String13.ParseUrlParams(_params);
            right_click = pa.Find("right");
            left_click  = pa.Find("left");
            alt_click   = pa.Find("alt");
            ctrl_click  = pa.Find("ctrl");
            _default    = true;

            switch ((int)(this.mode))
            {
            case 1:

                if (_object is Tile && left_click != 0 && !(alt_click != 0) && !(ctrl_click != 0))
                {
                    T = _object;

                    if (_object is Tile_Space)
                    {
                        ((Tile)T).ChangeTurf(typeof(Tile_Simulated_Floor_Plasteel));
                    }
                    else if (_object is Tile_Simulated_Floor)
                    {
                        ((Tile)T).ChangeTurf(typeof(Tile_Simulated_Wall));
                    }
                    else if (_object is Tile_Simulated_Wall)
                    {
                        ((Tile)T).ChangeTurf(typeof(Tile_Simulated_Wall_RWall));
                    }
                    GlobalFuncs.log_admin("Build Mode: " + GlobalFuncs.key_name(user) + " built " + T + " at (" + ((dynamic)T).x + "," + ((dynamic)T).y + "," + ((dynamic)T).z + ")");
                    return(_default);
                }
                else if (right_click != 0)
                {
                    GlobalFuncs.log_admin("Build Mode: " + GlobalFuncs.key_name(user) + " deleted " + _object + " at (" + ((dynamic)_object).x + "," + ((dynamic)_object).y + "," + ((dynamic)_object).z + ")");

                    if (_object is Tile_Simulated_Wall)
                    {
                        T2 = _object;
                        ((Tile)T2).ChangeTurf(typeof(Tile_Simulated_Floor_Plasteel));
                    }
                    else if (_object is Tile_Simulated_Floor)
                    {
                        T3 = _object;
                        ((Tile)T3).ChangeTurf(typeof(Tile_Space));
                    }
                    else if (_object is Tile_Simulated_Wall_RWall)
                    {
                        T4 = _object;
                        ((Tile)T4).ChangeTurf(typeof(Tile_Simulated_Wall));
                    }
                    else if (_object is Obj)
                    {
                        GlobalFuncs.qdel(_object);
                    }
                    return(_default);
                }
                else if (_object is Tile && alt_click != 0 && left_click != 0)
                {
                    GlobalFuncs.log_admin("Build Mode: " + GlobalFuncs.key_name(user) + " built an airlock at (" + ((dynamic)_object).x + "," + ((dynamic)_object).y + "," + ((dynamic)_object).z + ")");
                    new Obj_Machinery_Door_Airlock(GlobalFuncs.get_turf(_object));
                }
                else if (_object is Tile && ctrl_click != 0 && left_click != 0)
                {
                    switch ((int?)(this.build_dir))
                    {
                    case 1:
                        WIN     = new Obj_Structure_Window_Reinforced(GlobalFuncs.get_turf(_object));
                        WIN.dir = ((int)(GlobalVars.NORTH));
                        break;

                    case 2:
                        WIN2     = new Obj_Structure_Window_Reinforced(GlobalFuncs.get_turf(_object));
                        WIN2.dir = ((int)(GlobalVars.SOUTH));
                        break;

                    case 4:
                        WIN3     = new Obj_Structure_Window_Reinforced(GlobalFuncs.get_turf(_object));
                        WIN3.dir = ((int)(GlobalVars.EAST));
                        break;

                    case 8:
                        WIN4     = new Obj_Structure_Window_Reinforced(GlobalFuncs.get_turf(_object));
                        WIN4.dir = ((int)(GlobalVars.WEST));
                        break;

                    case 9:
                        WIN5     = new Obj_Structure_Window_Reinforced(GlobalFuncs.get_turf(_object));
                        WIN5.dir = ((int)(GlobalVars.NORTHWEST));
                        break;
                    }
                    GlobalFuncs.log_admin("Build Mode: " + GlobalFuncs.key_name(user) + " built a window at (" + ((dynamic)_object).x + "," + ((dynamic)_object).y + "," + ((dynamic)_object).z + ")");
                }
                break;

            case 2:

                if (left_click != 0)
                {
                    if (Lang13.Bool(this.objholder.IsSubclassOf(typeof(Tile))))
                    {
                        T5 = GlobalFuncs.get_turf(_object);
                        GlobalFuncs.log_admin("Build Mode: " + GlobalFuncs.key_name(user) + " modified " + T5 + " (" + T5.x + "," + T5.y + "," + T5.z + ") to " + this.objholder);
                        ((Tile)T5).ChangeTurf(this.objholder);
                    }
                    else
                    {
                        A     = Lang13.Call(this.objholder, GlobalFuncs.get_turf(_object));
                        A.dir = this.build_dir;
                        GlobalFuncs.log_admin("Build Mode: " + GlobalFuncs.key_name(user) + " modified " + A + "'s (" + A.x + "," + A.y + "," + A.z + ") dir to " + this.build_dir);
                    }
                }
                else if (right_click != 0)
                {
                    if (_object is Obj)
                    {
                        GlobalFuncs.log_admin("Build Mode: " + GlobalFuncs.key_name(user) + " deleted " + _object + " at (" + ((dynamic)_object).x + "," + ((dynamic)_object).y + "," + ((dynamic)_object).z + ")");
                        GlobalFuncs.qdel(_object);
                    }
                }
                break;

            case 3:

                if (left_click != 0)
                {
                    if (_object.vars.Find(this.varholder) != 0)
                    {
                        GlobalFuncs.log_admin("Build Mode: " + GlobalFuncs.key_name(user) + " modified " + ((dynamic)_object).name + "'s " + this.varholder + " to " + this.valueholder);
                        _object.vars[this.varholder] = this.valueholder;
                    }
                    else
                    {
                        ((dynamic)user).WriteMsg("<span class='warning'>" + Lang13.Initial(_object, "name") + " does not have a var called '" + this.varholder + "'</span>");
                    }
                }

                if (right_click != 0)
                {
                    if (_object.vars.Find(this.varholder) != 0)
                    {
                        GlobalFuncs.log_admin("Build Mode: " + GlobalFuncs.key_name(user) + " modified " + ((dynamic)_object).name + "'s " + this.varholder + " to " + this.valueholder);
                        _object.vars[this.varholder] = Lang13.Initial(_object, this.varholder);
                    }
                    else
                    {
                        ((dynamic)user).WriteMsg("<span class='warning'>" + Lang13.Initial(_object, "name") + " does not have a var called '" + this.varholder + "'</span>");
                    }
                }
                break;

            case 4:

                if (left_click != 0)
                {
                    if (_object is Tile)
                    {
                        return(_default);
                    }
                    this.throw_atom = _object;
                }

                if (right_click != 0)
                {
                    if (this.throw_atom != null)
                    {
                        ((Ent_Dynamic)this.throw_atom).throw_at(_object, 10, 1, user);
                        GlobalFuncs.log_admin("Build Mode: " + GlobalFuncs.key_name(user) + " threw " + this.throw_atom + " at " + _object + " (" + ((dynamic)_object).x + "," + ((dynamic)_object).y + "," + ((dynamic)_object).z + ")");
                    }
                }
                break;

            case 5:

                if (!Lang13.Bool(this.cornerA))
                {
                    this.cornerA = GlobalFuncs.get_turf(_object);
                    return(_default);
                }

                if (Lang13.Bool(this.cornerA) && !Lang13.Bool(this.cornerB))
                {
                    this.cornerB = GlobalFuncs.get_turf(_object);
                }

                if (left_click != 0)
                {
                    if (Lang13.Bool(this.cornerA) && Lang13.Bool(this.cornerB))
                    {
                        if (!Lang13.Bool(this.generator_path))
                        {
                            ((dynamic)user).WriteMsg("<span class='warning'>Select generator type first.</span>");
                        }
                        G = Lang13.Call(this.generator_path);
                        ((MapGenerator)G).defineRegion(this.cornerA, this.cornerB, true);
                        ((MapGenerator)G).generate();
                        this.cornerA = null;
                        this.cornerB = null;
                        return(_default);
                    }
                }
                this.cornerA = null;
                this.cornerB = null;
                break;

            case 6:

                if (left_click != 0)
                {
                    T6 = GlobalFuncs.get_turf(_object);

                    if (this.stored != null)
                    {
                        GlobalFuncs.DuplicateObject(this.stored, true, null, T6);
                    }
                }
                else if (right_click != 0)
                {
                    if (_object is Ent_Dynamic)
                    {
                        this.stored = _object;
                    }
                }
                break;
            }
            return(_default);
        }
Пример #19
0
        // Function from file: items.dm
        public override double examine(dynamic user = null)
        {
            string  size     = null;
            string  pronoun  = null;
            string  msg      = null;
            ByTable techlvls = null;
            dynamic T        = null;
            dynamic mat      = null;

            base.examine((object)(user));

            dynamic _a = this.w_class;             // Was a switch-case, sorry for the mess.

            if (_a == 1)
            {
                size = "tiny";
            }
            else if (_a == 2)
            {
                size = "small";
            }
            else if (_a == 3)
            {
                size = "normal-sized";
            }
            else if (_a == 4)
            {
                size = "bulky";
            }
            else if (_a == 5)
            {
                size = "huge";
            }
            else if (_a == 6)
            {
                size = "gigantic";
            }
            pronoun = null;

            if (this.gender == GlobalVars.PLURAL)
            {
                pronoun = "They are";
            }
            else
            {
                pronoun = "It is";
            }
            user.WriteMsg("" + pronoun + " a " + size + " item.");

            if (user.research_scanner)
            {
                msg = "*--------* <BR>";

                if (Lang13.Bool(this.origin_tech))
                {
                    msg     += "<span class='notice'>Testing potentials:</span><BR>";
                    techlvls = String13.ParseUrlParams(this.origin_tech);

                    foreach (dynamic _b in Lang13.Enumerate(techlvls))
                    {
                        T = _b;

                        msg += "Tech: " + GlobalFuncs.CallTechName(T) + " | magnitude: " + techlvls[T] + " <BR>";
                    }
                    msg += "Research reliability: " + this.reliability + "% <BR>";

                    if (this.crit_fail)
                    {
                        msg += "<span class='danger'>Critical failure detected in subject!</span><BR>";
                    }
                }
                else
                {
                    msg += "<span class='danger'>No tech origins detected.</span><BR>";
                }

                if (this.materials.len != 0)
                {
                    msg += "<span class='notice'>Extractable materials:<BR>";

                    foreach (dynamic _c in Lang13.Enumerate(this.materials))
                    {
                        mat = _c;

                        msg += "" + GlobalFuncs.CallMaterialName(mat) + "<BR>";
                    }
                }
                else
                {
                    msg += "<span class='danger'>No extractable materials detected.</span><BR>";
                }
                msg += "*--------*";
                user.WriteMsg(msg);
            }
            return(0);
        }
Пример #20
0
        // Function from file: tables_racks.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            Obj_Structure_Table RT           = null;
            Obj_Structure_Table RT2          = null;
            dynamic             T            = null;
            ByTable             oldContents  = null;
            Obj_Item            C            = null;
            ByTable             click_params = null;


            if (A is Obj_Item_Weapon_Grab)
            {
                this.tablepush(A, user);
                return(null);
            }

            if (!Lang13.Bool(this.flags & 128))
            {
                if (A is Obj_Item_Weapon_Screwdriver)
                {
                    if (this is Obj_Structure_Table_Reinforced)
                    {
                        RT = this;

                        if (Lang13.Bool(((dynamic)RT).status) == true)
                        {
                            this.table_destroy(2, user);
                            return(null);
                        }
                    }
                    else
                    {
                        this.table_destroy(2, user);
                        return(null);
                    }
                }

                if (A is Obj_Item_Weapon_Wrench)
                {
                    if (this is Obj_Structure_Table_Reinforced)
                    {
                        RT2 = this;

                        if (Lang13.Bool(((dynamic)RT2).status) == true)
                        {
                            this.table_destroy(3, user);
                            return(null);
                        }
                    }
                    else
                    {
                        this.table_destroy(3, user);
                        return(null);
                    }
                }
            }

            if (A is Obj_Item_Weapon_Storage_Bag_Tray)
            {
                T = A;

                if (T.contents.len > 0)
                {
                    oldContents = T.contents.Copy();
                    T.__CallVerb("Empty Contents");

                    foreach (dynamic _a in Lang13.Enumerate(oldContents, typeof(Obj_Item)))
                    {
                        C = _a;

                        C.loc = this.loc;
                    }
                    ((Ent_Static)user).visible_message("" + user + " empties " + A + " on " + this + ".");
                    return(null);
                }
            }

            if (user is Mob_Living_Silicon_Robot)
            {
                return(null);
            }

            if (!Lang13.Bool(A.flags & 128))
            {
                if (Lang13.Bool(user.drop_item()))
                {
                    A.Move(this.loc);
                    click_params = String13.ParseUrlParams(_params);

                    if (!(click_params != null) || !Lang13.Bool(click_params["icon-x"]) || !Lang13.Bool(click_params["icon-y"]))
                    {
                        return(null);
                    }
                    A.pixel_x = Num13.MaxInt(((int)(-(Game13.icon_size / 2))), Num13.MinInt(((int)((String13.ParseNumber(click_params["icon-x"]) ?? 0) - 16)), ((int)(Game13.icon_size / 2))));
                    A.pixel_y = Num13.MaxInt(((int)(-(Game13.icon_size / 2))), Num13.MinInt(((int)((String13.ParseNumber(click_params["icon-y"]) ?? 0) - 16)), ((int)(Game13.icon_size / 2))));
                }
            }
            return(null);
        }