示例#1
0
        // Function from file: contraband.dm
        public Obj_Item_Weapon_Poster(dynamic loc = null, dynamic given_serial = null) : base((object)(loc))
        {
            given_serial = given_serial ?? 0;


            if (given_serial == 0)
            {
                if (!this.official)
                {
                    this.serial_number    = Rand13.Int(1, 36);
                    this.resulting_poster = new Obj_Structure_Sign_Poster(this.loc, this.serial_number, this.official);
                }
                else
                {
                    this.serial_number    = Rand13.Int(1, 35);
                    this.resulting_poster = new Obj_Structure_Sign_Poster(this.loc, this.serial_number, this.official);
                }
            }
            else
            {
                this.serial_number = given_serial;
            }
            this.name += " - No. " + this.serial_number;
            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            return;
        }
示例#2
0
        // Function from file: tgstation.dme
        public void place_poster(dynamic P = null, dynamic user = null)
        {
            int stuff_on_wall           = 0;
            Obj O                       = null;
            Obj_Structure_Sign_Poster D = null;
            Ent_Static temp_loc         = null;


            if (!(P.resulting_poster != null))
            {
                return;
            }
            stuff_on_wall = 0;

            foreach (dynamic _a in Lang13.Enumerate(this.contents, typeof(Obj)))
            {
                O = _a;


                if (O is Obj_Structure_Sign_Poster)
                {
                    user.WriteMsg("<span class='warning'>The wall is far too cluttered to place a poster!</span>");
                    return;
                }
                stuff_on_wall++;

                if (stuff_on_wall == 3)
                {
                    user.WriteMsg("<span class='warning'>The wall is far too cluttered to place a poster!</span>");
                    return;
                }
            }
            user.WriteMsg("<span class='notice'>You start placing the poster on the wall...</span>");
            D        = P.resulting_poster;
            temp_loc = user.loc;
            Icon13.Flick("poster_being_set", D);
            D.loc      = this;
            D.official = Lang13.BoolNullable(P.official);
            GlobalFuncs.qdel(P);
            GlobalFuncs.playsound(D.loc, "sound/items/poster_being_created.ogg", 100, 1);

            if (GlobalFuncs.do_after(user, D.placespeed, null, this))
            {
                if (!(D != null))
                {
                    return;
                }

                if (this is Tile_Simulated_Wall && Lang13.Bool(user) && user.loc == temp_loc)
                {
                    user.WriteMsg("<span class='notice'>You place the poster!</span>");
                }
                else
                {
                    D.roll_and_drop(temp_loc, D.official);
                }
                return;
            }
            return;
        }