Exemplo n.º 1
0
        static void SpawnBoss(Level level, SeedOptions seedOptions, int vanillaBossId)
        {
            if (!level.GameSave.GetSettings().BossRando.Value || TargetBossId == -1 || !level.GameSave.GetSaveBool("IsFightingBoss"))
            {
                return;
            }

            BossAttributes vanillaBossInfo  = BestiaryManager.GetBossAttributes(level, vanillaBossId);
            BossAttributes replacedBossInfo = BestiaryManager.GetReplacedBoss(level, vanillaBossId);

            level.JukeBox.StopSong();
            level.PlayCue(Timespinner.GameAbstractions.ESFX.FoleyWarpGyreIn);

            if (seedOptions.GasMaw && (vanillaBossId == (int)EBossID.Maw || (vanillaBossId == (int)EBossID.FelineSentry && level.GameSave.GetSaveBool("TSRando_IsVileteSaved"))))
            {
                FillRoomWithGas(level);
            }

            if (replacedBossInfo.ShouldSpawn)
            {
                ObjectTileSpecification bossTile = new ObjectTileSpecification();
                bossTile.Category = EObjectTileCategory.Enemy;
                bossTile.Layer    = ETileLayerType.Objects;
                bossTile.ObjectID = replacedBossInfo.TileId;
                bossTile.Argument = replacedBossInfo.Argument;
                bossTile.IsFlippedHorizontally = !replacedBossInfo.IsFacingLeft;

                var boss = replacedBossInfo.BossType.CreateInstance(false, replacedBossInfo.Position, level, replacedBossInfo.Sprite, -1, bossTile);
                level.AsDynamic().RequestAddObject(boss);
            }

            level.JukeBox.StopSong();
            level.JukeBox.PlaySong(vanillaBossInfo.Song);
            TargetBossId = -1;
        }
 public GlowingFloorEvent(Mobile typedObject) : base(typedObject)
 {
     if (Dynamic.Level.ID == 16)
     {
         Dynamic._textPromptOffsetX = -20;
         Dynamic._textPromptText    = "Exit the pyramid";
         return;
     }
     if (Dynamic.Level.ID == 11 && Level.GameSave.GetSettings().BossRando.Value)
     {
         int            bossId = Dynamic.PrefabType.ToString() == "L11_SwitchWinderia" ? (int)EBossID.Prince : (int)EBossID.Vol;
         BossAttributes boss   = BestiaryManager.GetReplacedBoss(Level, bossId);
         Dynamic._textPromptOffsetX = -20;
         Dynamic._textPromptText    = $"Fight {boss.VisibleName}";
     }
 }
Exemplo n.º 3
0
        static void CreateBossWarp(Level level, int vanillaBossId)
        {
            if (!level.GameSave.GetSettings().BossRando.Value)
            {
                return;
            }

            BestiaryManager.RefreshBossSaveFlags(level);
            BossAttributes vanillaBossInfo  = BestiaryManager.GetBossAttributes(level, vanillaBossId);
            BossAttributes replacedBossInfo = BestiaryManager.GetReplacedBoss(level, vanillaBossId);

            if (level.GameSave.GetSaveBool("TSRando_" + vanillaBossInfo.SaveName))
            {
                return;
            }

            TargetBossId = vanillaBossId;

            level.JukeBox.StopSong();
            RoomItemKey bossArena = replacedBossInfo.BossRoom;

            BestiaryManager.ClearBossSaveFlags(level, replacedBossInfo.ShouldSpawn);
            level.GameSave.SetValue("IsFightingBoss", true);

            EDirection facing = replacedBossInfo.IsFacingLeft ? EDirection.West : EDirection.East;

            level.RequestChangeLevel(new LevelChangeRequest
            {
                LevelID                   = bossArena.LevelId,
                RoomID                    = bossArena.RoomId,
                IsUsingWarp               = true,
                IsUsingWhiteFadeOut       = true,
                FadeInTime                = 0.5f,
                FadeOutTime               = 0.25f,
                EnterDirection            = facing,
                AdditionalBlackScreenTime = 0.5f,
            });
        }