Example #1
0
            /// <summary>Create a new breakable container with the specified item contents.</summary>
            /// <param name="tile">The tile location of the container.</param>
            /// <param name="items">A set of items the container will drop when broken. Null or empty lists are valid.</param>
            /// <param name="isBarrel">If true, the container will use the "barrel" sprite. If false, it will use the "crate" sprite.</param>
            public BreakableContainerFTM(Vector2 tile, IEnumerable <Item> items, bool isBarrel = true)
                : base(tile, barrel, false)
            {
                Items.AddRange(items);

                if (!isBarrel) //uses a parameter instead of a 50% chance
                {
                    ParentSheetIndex = crate;
                }

                HitsToBreak.Value        = 3;
                debris.Value             = 12;
                breakDebrisSource.Value  = new Rectangle(598, 1275, 13, 4);
                breakDebrisSource2.Value = new Rectangle(611, 1275, 10, 4);
            }
Example #2
0
 /// <summary>Create a new buried item location with the specified contents.</summary>
 /// <param name="tileLocation">The tile location of the buried items.</param>
 /// <param name="items">>A set of items the container will drop when broken. Null or empty lists are valid.</param>
 public BuriedItems(Vector2 tileLocation, IEnumerable <Item> items)
     : base(tileLocation, 590, 1) //use the typical constructor for an artifact spot
 {
     Items.AddRange(items);       //add the provided set of items to this object's list
 }