diff --git a/src/main/java/emu/lunarcore/game/battle/Battle.java b/src/main/java/emu/lunarcore/game/battle/Battle.java index 3f62aed..ef48736 100644 --- a/src/main/java/emu/lunarcore/game/battle/Battle.java +++ b/src/main/java/emu/lunarcore/game/battle/Battle.java @@ -74,6 +74,16 @@ public class Battle { } } + public int getMonsterWaveCount() { + int count = 0; + + for (StageExcel stage : stages) { + count += stage.getMonsterWaves().size(); + } + + return count; + } + public MazeBuff addBuff(int buffId, int ownerIndex) { return addBuff(buffId, ownerIndex, 0xffffffff); } @@ -98,16 +108,13 @@ public class Battle { .setBattleId(this.getId()) .setLogicRandomSeed(Utils.randomRange(1, Short.MAX_VALUE)) .setWorldLevel(player.getWorldLevel()); - - // Init variables - int waveId = 0; - + // Add monster waves from stages for (StageExcel stage : stages) { // Build monster waves for (IntList sceneMonsterWave : stage.getMonsterWaves()) { var wave = SceneMonsterWave.newInstance() - .setWaveId(++waveId) + .setWaveId(1) // Probably not named correctly .setStageId(stage.getId()); for (int monsterId : sceneMonsterWave) { diff --git a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillAddBuff.java b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillAddBuff.java index 9f3c7d1..3ef6975 100644 --- a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillAddBuff.java +++ b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillAddBuff.java @@ -22,8 +22,12 @@ public class MazeSkillAddBuff extends MazeSkillAction { @Override public void onAttack(GameAvatar caster, Battle battle) { - // TODO add buff for each monster wave - battle.addBuff(buffId, caster.getOwner().getLineupManager().getCurrentLeader(), 1); + // Get amount of monster waves in battle + int waveCount = battle.getMonsterWaveCount(); + // Add buff for each wave id + for (int i = 0; i < waveCount; i++) { + battle.addBuff(buffId, caster.getOwner().getLineupManager().getCurrentLeader(), 1 << i); + } } }