mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-15 14:54:43 +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) {
|
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) {
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user