mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-13 05:44:36 +01:00
Buffs from using techniques to attack monsters now apply to all monster waves
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user