Exemplo n.º 1
0
        ////

        protected override void Receive(int fromWho)
        {
            IList <(ushort TileX, ushort TileY)> innerHouseSpace, fullHouseSpace;
            int floorX, floorY;

            HouseViabilityState state = HouseFurnishingKitItem.IsValidHouse(
                this.TileX,
                this.TileY,
                out innerHouseSpace,
                out fullHouseSpace,
                out floorX,
                out floorY
                );

            if (state == HouseViabilityState.Good)
            {
                bool aborted = HouseFurnishingKitItem.FurnishHouseFull(
                    Main.player[this.PlayerWho],
                    this.TileX,
                    this.TileY,
                    innerHouseSpace,
                    fullHouseSpace,
                    floorX,
                    floorY
                    );
            }
            else
            {
                LogHelpers.Alert("Could not furnish house");
            }
        }
Exemplo n.º 2
0
        ////////////////

        private void CheckFurnishableHouse()
        {
            (int x, int y)pos = (this.CurrentHouseChunkX, this.CurrentHouseChunkY);
            if (!this.ChartedHouseSpaces.Contains(pos))
            {
                this.ChartedHouseSpaces.Add(pos);
            }
            else
            {
                return;
            }

            int tileX = (int)this.player.Center.X / 16;
            int tileY = (int)this.player.Center.Y / 16;
            HouseViabilityState state = HouseFurnishingKitItem.IsValidHouse(tileX, tileY);

            if (state == HouseViabilityState.Good)
            {
                if (!this._HasPreviousHouseViableAlert)
                {
                    this._HasPreviousHouseViableAlert = true;

                    Color  color;
                    string msg = HouseFurnishingKitItem.GetViabilityStateMessage(
                        state: HouseViabilityState.Good,
                        fullSpace: 0,
                        innerSpace: 0,
                        verbose: !this._FurnishingTipShown,
                        color: out color
                        );

                    this._FurnishingTipShown = true;

                    foreach (string subMsg in msg.Split('\n'))
                    {
                        Main.NewText(subMsg, color);
                    }
                }
            }
            else
            {
                this._HasPreviousHouseViableAlert = false;
            }
        }