Skip to content

Commit

Permalink
Merge pull request #2656 from planetarium/bugfix/adv-boss/add-breakth…
Browse files Browse the repository at this point in the history
…rough-floor

Fix floor order
  • Loading branch information
U-lis authored Jun 27, 2024
2 parents cad9bb4 + a5b7e7c commit a281f48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion Lib9c/Action/AdventureBoss/SweepAdventureBoss.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ public override IWorld Execute(IActionContext context)
.First(row => row.BossId == latestSeason.BossId).Id;
var floorRows = states.GetSheet<AdventureBossFloorSheet>().OrderedList
.Where(row => row.AdventureBossId == adventureBossId).ToList();
var firstFloorId = floorRows.First(r => r.Floor == 1).Id;
var floorId = floorRows.First(r => r.Floor == explorer.Floor).Id;

var simulator = new AdventureBossSimulator(
Expand Down
7 changes: 4 additions & 3 deletions Lib9c/Battle/AdventureBoss/AdventureBossSimulator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public Player Simulate()
return Player;
}

public void AddBreakthrough(IEnumerable<int> floorIdList,
public void AddBreakthrough(List<int> floorIdList,
AdventureBossFloorWaveSheet adventureBossFloorWaveSheet)
{
if (Log.events.Count == 0)
Expand All @@ -255,10 +255,11 @@ public void AddBreakthrough(IEnumerable<int> floorIdList,
}

// Add event in reversed order to keep insert position
foreach (var floorId in floorIdList)
for (var i = 0; i < floorIdList.Count; i++)
{
var floorId = floorIdList[i];
var floorWave = adventureBossFloorWaveSheet[floorId].Waves[0];
Log.events.Insert(1, new Breakthrough(Player, floorId, floorWave.Monsters));
Log.events.Insert(i + 1, new Breakthrough(Player, floorId, floorWave.Monsters));
}
}

Expand Down

0 comments on commit a281f48

Please sign in to comment.