Implement proper melody drops in Monolith

This commit is contained in:
Melledy
2025-12-15 07:40:03 -08:00
parent 26019d639b
commit 72d9cd530d
5 changed files with 51 additions and 23 deletions
@@ -5,11 +5,11 @@ import java.util.List;
import dev.morphia.annotations.Entity;
import emu.nebula.GameConstants;
import emu.nebula.data.GameData;
import emu.nebula.data.resources.SecondarySkillDef;
import emu.nebula.data.resources.StarTowerDef;
import emu.nebula.data.resources.StarTowerStageDef;
import emu.nebula.data.resources.SubNoteSkillDropGroupDef;
import emu.nebula.game.achievement.AchievementCondition;
import emu.nebula.game.achievement.AchievementManager;
import emu.nebula.game.character.ElementType;
@@ -84,9 +84,6 @@ public class StarTowerGame {
private ItemParamMap potentials;
private IntSet secondarySkills;
// Sub note skill drop list
private IntList subNoteDropList;
// Modifiers
private StarTowerModifiers modifiers;
@@ -123,9 +120,6 @@ public class StarTowerGame {
this.newInfos = new ItemParamMap();
// Init melody drop list
this.subNoteDropList = new IntArrayList();
// Init modifiers
this.modifiers = new StarTowerModifiers(this);
@@ -141,12 +135,6 @@ public class StarTowerGame {
continue;
}
// Add sub note skill id to drop list
int subNoteSkill = character.getData().getElementType().getSubNoteSkillItemId();
if (subNoteSkill > 0 && !this.subNoteDropList.contains(subNoteSkill)) {
this.subNoteDropList.add(subNoteSkill);
}
// Add to character list
charList.add(id);
}
@@ -178,11 +166,6 @@ public class StarTowerGame {
// Temp data to cache for rare potential count
this.rarePotentialCount = new ItemParamMap();
// Finish setting up droppable sub note skills
for (int id : GameConstants.TOWER_COMMON_SUB_NOTE_SKILLS) {
this.subNoteDropList.add(id);
}
// Enter first room
this.enterNextRoom();
this.getRoom().setMapInfo(req);
@@ -784,7 +767,8 @@ public class StarTowerGame {
}
public int getRandomSubNoteId() {
return Utils.randomElement(this.getSubNoteDropList());
int groupId = this.getData().getSubNoteSkillDropGroupId();
return SubNoteSkillDropGroupDef.getRandomDrop(groupId);
}
private PlayerChangeInfo addRandomSubNoteSkills(PlayerChangeInfo change) {
@@ -64,7 +64,7 @@ public class StarTowerHawkerCase extends StarTowerBaseCase {
}
for (int i = 0; i < subNotes; i++) {
// Randomize sub note
int id = Utils.randomElement(this.getGame().getSubNoteDropList());
int id = this.getGame().getRandomSubNoteId();
// Create sub note shop item
StarTowerShopGoods goods = null;