コード例 #1
0
 // Function from file: watertank.dm
 public Obj_Item_Weapon_Watertank(dynamic loc = null) : base((object)(loc))
 {
     // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
     this.create_reagents(this.volume);
     this.noz = this.make_noz();
     return;
 }
コード例 #2
0
ファイル: Obj_Effect_Portal.cs プロジェクト: Somnium13/SS13
        // Function from file: portals.dm
        public Obj_Effect_Portal(dynamic loc = null, dynamic target = null, Obj_Item_Weapon creator = null, int?lifespan = null) : base((object)(loc))
        {
            lifespan = lifespan ?? 300;

            dynamic M = null;

            GlobalVars.portals.Add(this);
            this.loc     = loc;
            this.target  = target;
            this.creator = creator;

            foreach (dynamic _a in Lang13.Enumerate(this.loc))
            {
                M = _a;

                this.teleport(M);
            }

            if ((lifespan ?? 0) > 0)
            {
                Task13.Schedule(lifespan ?? 0, (Task13.Closure)(() => {
                    GlobalFuncs.qdel(this);
                    return;
                }));
            }
            return;
        }
コード例 #3
0
ファイル: Obj_Screen_Grab.cs プロジェクト: Somnium13/SS13
        // Function from file: screen_objects.dm
        public override bool Click(dynamic loc = null, string control = null, string _params = null)
        {
            Obj_Item_Weapon G = null;

            G = this.master;
            ((dynamic)G).s_click(this);
            return(true);
        }
コード例 #4
0
 // Function from file: watertank.dm
 public override dynamic Destroy(  )
 {
     if (this.on)
     {
         this.remove_noz();
         GlobalFuncs.qdel(this.noz);
         this.noz = null;
     }
     return(base.Destroy());
 }
コード例 #5
0
        // Function from file: watertank.dm
        public override bool dropped(dynamic user = null)
        {
            Obj_Item_Weapon N = null;

            this.icon_state = "waterbackpackatmos";

            if (this.noz is Obj_Item_Weapon_Extinguisher_Mini_Nozzle)
            {
                N = this.noz;
                ((dynamic)N).nozzle_mode = 0;
            }
            return(false);
        }
コード例 #6
0
        // Function from file: screen_objects.dm
        public override bool Click(dynamic loc = null, string control = null, string _params = null)
        {
            Obj_Item_Weapon S = null;


            if (this.master != null)
            {
                if (this.master is Obj_Item_Weapon_Storage)
                {
                    S = this.master;
                    ((dynamic)S).close(Task13.User);
                }
            }
            return(true);
        }
コード例 #7
0
ファイル: Obj_Effect_Portal.cs プロジェクト: Somnium13/SS13
        // Function from file: portals.dm
        public override dynamic Destroy(  )
        {
            Obj_Item_Weapon O = null;
            Obj_Item_Weapon P = null;

            GlobalVars.portals.Remove(this);

            if (this.creator is Obj_Item_Weapon_HandTele)
            {
                O = this.creator;
                ((dynamic)O).active_portals--;
            }
            else if (this.creator is Obj_Item_Weapon_Gun_Energy_WormholeProjector)
            {
                P = this.creator;
                ((dynamic)P).portal_destroyed(this);
            }
            this.creator = null;
            return(base.Destroy());
        }
コード例 #8
0
        public void toggle_mister(  )
        {
            Mob user = null;


            if (Task13.User.get_item_by_slot(Task13.User.getWatertankSlot()) != this)
            {
                Task13.User.WriteMsg("<span class='warning'>The watertank must be worn properly to use!</span>");
                return;
            }

            if (Task13.User.incapacitated())
            {
                return;
            }
            this.on = !this.on;
            user    = Task13.User;

            if (this.on)
            {
                if (this.noz == null)
                {
                    this.noz = this.make_noz();
                }

                if (!user.put_in_hands(this.noz))
                {
                    this.on = false;
                    user.WriteMsg("<span class='warning'>You need a free hand to hold the mister!</span>");
                    return;
                }
                this.noz.loc = user;
            }
            else
            {
                this.remove_noz();
            }
            return;
        }
コード例 #9
0
 // Function from file: screen_objects.dm
 public override dynamic Destroy(  )
 {
     this.master = null;
     return(base.Destroy());
 }
コード例 #10
0
        // Function from file: lib_items.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            dynamic         choice         = null;
            dynamic         newtitle       = null;
            string          content        = null;
            string          newauthor      = null;
            dynamic         scanner        = null;
            Borrowbook      b              = null;
            Obj_Item_Weapon book           = null;
            Obj_Item_Weapon_Storage_Book B = null;


            if (A is Obj_Item_Weapon_Pen)
            {
                if (GlobalFuncs.is_blind(user) != 0)
                {
                    return(null);
                }

                if (this.unique)
                {
                    user.WriteMsg("<span class='warning'>These pages don't seem to take the ink well! Looks like you can't modify it.</span>");
                    return(null);
                }
                choice = Interface13.Input("What would you like to change?", null, null, null, new ByTable(new object [] { "Title", "Contents", "Author", "Cancel" }), InputType.Any);

                dynamic _a = choice;                 // Was a switch-case, sorry for the mess.
                if (_a == "Title")
                {
                    newtitle = GlobalFuncs.reject_bad_text(GlobalFuncs.stripped_input(Task13.User, "Write a new title:"));

                    if (!Lang13.Bool(newtitle))
                    {
                        Task13.User.WriteMsg("The title is invalid.");
                        return(null);
                    }
                    else
                    {
                        this.name  = newtitle;
                        this.title = newtitle;
                    }
                }
                else if (_a == "Contents")
                {
                    content = GlobalFuncs.stripped_input(Task13.User, "Write your book's contents (HTML NOT allowed):", "", "", 8192);

                    if (!Lang13.Bool(content))
                    {
                        Task13.User.WriteMsg("The content is invalid.");
                        return(null);
                    }
                    else
                    {
                        this.dat += content;
                    }
                }
                else if (_a == "Author")
                {
                    newauthor = GlobalFuncs.stripped_input(Task13.User, "Write the author's name:");

                    if (!Lang13.Bool(newauthor))
                    {
                        Task13.User.WriteMsg("The name is invalid.");
                        return(null);
                    }
                    else
                    {
                        this.author = newauthor;
                    }
                }
                else
                {
                    return(null);
                }
            }
            else if (A is Obj_Item_Weapon_Barcodescanner)
            {
                scanner = A;

                if (!Lang13.Bool(scanner.computer))
                {
                    user.WriteMsg("" + A + "'s screen flashes: 'No associated computer found!'");
                }
                else
                {
                    dynamic _d = scanner.mode;                     // Was a switch-case, sorry for the mess.
                    if (_d == 0)
                    {
                        scanner.book = this;
                        user.WriteMsg("" + A + "'s screen flashes: 'Book stored in buffer.'");
                    }
                    else if (_d == 1)
                    {
                        scanner.book = this;
                        scanner.computer.buffer_book = this.name;
                        user.WriteMsg("" + A + "'s screen flashes: 'Book stored in buffer. Book title stored in associated computer buffer.'");
                    }
                    else if (_d == 2)
                    {
                        scanner.book = this;

                        foreach (dynamic _b in Lang13.Enumerate(scanner.computer.checkouts, typeof(Borrowbook)))
                        {
                            b = _b;


                            if (b.bookname == this.name)
                            {
                                scanner.computer.checkouts.Remove(b);
                                user.WriteMsg("" + A + "'s screen flashes: 'Book stored in buffer. Book has been checked in.'");
                                return(null);
                            }
                        }
                        user.WriteMsg("" + A + "'s screen flashes: 'Book stored in buffer. No active check-out record found for current title.'");
                    }
                    else if (_d == 3)
                    {
                        scanner.book = this;

                        foreach (dynamic _c in Lang13.Enumerate(scanner.computer.inventory, typeof(Obj_Item_Weapon)))
                        {
                            book = _c;


                            if (book == this)
                            {
                                user.WriteMsg("" + A + "'s screen flashes: 'Book stored in buffer. Title already present in inventory, aborting to avoid duplicate entry.'");
                                return(null);
                            }
                        }
                        scanner.computer.inventory.Add(this);
                        user.WriteMsg("" + A + "'s screen flashes: 'Book stored in buffer. Title added to general inventory.'");
                    }
                }
            }
            else if (A is Obj_Item_Weapon_Kitchen_Knife || A is Obj_Item_Weapon_Wirecutters)
            {
                user.WriteMsg("<span class='notice'>You begin to carve out " + this.title + "...</span>");

                if (GlobalFuncs.do_after(user, 30, null, this))
                {
                    user.WriteMsg("<span class='notice'>You carve out the pages from " + this.title + "! You didn't want to read it anyway.</span>");
                    B            = new Obj_Item_Weapon_Storage_Book();
                    B.name       = this.name;
                    B.title      = this.title;
                    B.icon_state = this.icon_state;

                    if (user.l_hand == this || user.r_hand == this)
                    {
                        GlobalFuncs.qdel(this);
                        ((Mob)user).put_in_hands(B);
                        return(null);
                    }
                    else
                    {
                        B.loc = this.loc;
                        GlobalFuncs.qdel(this);
                        return(null);
                    }
                }
                return(null);
            }
            else
            {
                base.attackby((object)(A), (object)(user), _params, silent, replace_spent);
            }
            return(null);
        }
コード例 #11
0
 public Obj_Effect_Portal_Wormhole_JauntTunnel(dynamic loc = null, dynamic target = null, Obj_Item_Weapon creator = null, int?lifespan = null) : base((object)(loc), (object)(target), creator, lifespan)
 {
 }