Buffs from using techniques to attack monsters now apply to all monster waves

This commit is contained in:
Melledy
2023-10-03 02:24:04 -07:00
parent 94935fde83
commit 3dae00d76f
2 changed files with 18 additions and 7 deletions

View File

@@ -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) { public MazeBuff addBuff(int buffId, int ownerIndex) {
return addBuff(buffId, ownerIndex, 0xffffffff); return addBuff(buffId, ownerIndex, 0xffffffff);
} }
@@ -98,16 +108,13 @@ public class Battle {
.setBattleId(this.getId()) .setBattleId(this.getId())
.setLogicRandomSeed(Utils.randomRange(1, Short.MAX_VALUE)) .setLogicRandomSeed(Utils.randomRange(1, Short.MAX_VALUE))
.setWorldLevel(player.getWorldLevel()); .setWorldLevel(player.getWorldLevel());
// Init variables
int waveId = 0;
// Add monster waves from stages // Add monster waves from stages
for (StageExcel stage : stages) { for (StageExcel stage : stages) {
// Build monster waves // Build monster waves
for (IntList sceneMonsterWave : stage.getMonsterWaves()) { for (IntList sceneMonsterWave : stage.getMonsterWaves()) {
var wave = SceneMonsterWave.newInstance() var wave = SceneMonsterWave.newInstance()
.setWaveId(++waveId) .setWaveId(1) // Probably not named correctly
.setStageId(stage.getId()); .setStageId(stage.getId());
for (int monsterId : sceneMonsterWave) { for (int monsterId : sceneMonsterWave) {

View File

@@ -22,8 +22,12 @@ public class MazeSkillAddBuff extends MazeSkillAction {
@Override @Override
public void onAttack(GameAvatar caster, Battle battle) { public void onAttack(GameAvatar caster, Battle battle) {
// TODO add buff for each monster wave // Get amount of monster waves in battle
battle.addBuff(buffId, caster.getOwner().getLineupManager().getCurrentLeader(), 1); 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);
}
} }
} }