/// <summary>
        /// Moves objects in the level when the stage changes, since the size of the map changes
        /// </summary>
        private void StageChanged_UpdateStage(object sender, DimensionStageChangedArgs e)
        {
            daysPlayedAtStageOpen = Game1.stats.DaysPlayed;
            building.modData[modData_stageOpened] = Convert.ToString(daysPlayedAtStageOpen);
            var prev    = e.OldStage;
            var current = e.NewStage;

            // essentially setting upgrade level but not in the base class
            mapPath.Set("Maps/" + info.MapName + Math.Max(1, current));
            updateMap();
            updateWarps();
            punishmentStage = current == 5 ? 3 : 0;
            if (prev != 0)
            {
                while (prev < current)
                {
                    switch (prev)
                    {
                    case 1:
                        shiftObjects(30, 0);
                        break;

                    case 2:
                        shiftObjects(0, 7);
                        break;

                    case 3:
                        shiftObjects(0, 8);
                        break;

                    case 4:
                        shiftObjects(-100, -100);
                        break;

                    case 5:
                        // Shift back into view + 1x
                        shiftObjects(99, 100);
                        break;

                    default:
                        throw new InvalidOperationException($"You can't upgrade a stage {prev} {typeof(WinterDimension).Name}");
                    }
                    ++prev;
                }
            }
            updatePresents();
        }
Exemplo n.º 2
0
        private void StageChanged_UpdateStage(object sender, DimensionStageChangedArgs e)
        {
            var prev    = e.OldStage;
            var current = e.NewStage;

            if (prev != 0)
            {
                while (prev < current)
                {
                    switch (prev)
                    {
                    case 1:
                    case 4:
                        // Shift right to be in front of the door again
                        shiftObjects(19, 0);
                        break;

                    case 2:
                    case 3:
                        // Shift down to be in front of the door again
                        shiftObjects(0, 16);
                        break;

                    case 5:
                        // Shift down twice to be in front of the door again
                        shiftObjects(0, 32);
                        break;

                    default:
                        throw new InvalidOperationException($"You can't upgrade a stage {prev} {typeof(ShedDimension).Name}");
                    }
                    ++prev;
                }
            }
            // essentially setting upgrade level but not in the base class
            mapPath.Set("Maps/" + info.MapName + Math.Max(1, info.DimensionImplementation.CurrentStage()));
            updateMap();
            updateLayout();
        }