mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-12 13:24:36 +01:00
Fix WeightedList error in SU
This commit is contained in:
@@ -56,14 +56,14 @@ public class GameData {
|
|||||||
@Getter private static Int2ObjectMap<RogueMapExcel> rogueMapExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<RogueMapExcel> rogueMapExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
@Getter private static Int2ObjectMap<RogueMonsterExcel> rogueMonsterExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<RogueMonsterExcel> rogueMonsterExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
@Getter private static Int2ObjectMap<DialogueEventExcel> rogueDialogueEventList = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<DialogueEventExcel> rogueDialogueEventList = new Int2ObjectOpenHashMap<>();
|
||||||
@Getter private static Int2ObjectMap<RogueBuffExcel> rogueBuffTagExcelMap = new Int2ObjectOpenHashMap<>();
|
|
||||||
@Getter private static Int2ObjectMap<RogueBuffGroupExcel> rogueBuffGroupExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<RogueBuffGroupExcel> rogueBuffGroupExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
|
@Getter private static Int2ObjectMap<RogueBuffExcel> rogueBuffTagExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
|
private static Int2ObjectMap<RogueBuffExcel> rogueBuffExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
|
|
||||||
@Getter private static Int2ObjectMap<RogueDLCAreaExcel> rogueDLCAreaExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<RogueDLCAreaExcel> rogueDLCAreaExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
@Getter private static Int2ObjectMap<RogueNousMainStoryExcel> rogueNousMainStoryExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<RogueNousMainStoryExcel> rogueNousMainStoryExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
@Getter private static Int2ObjectMap<RogueNousSubStoryExcel> rogueNousSubStoryExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<RogueNousSubStoryExcel> rogueNousSubStoryExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
@Getter private static Int2ObjectMap<RogueNousDiceBranchExcel> rogueNousDiceBranchExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<RogueNousDiceBranchExcel> rogueNousDiceBranchExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
private static Int2ObjectMap<RogueBuffExcel> rogueBuffExcelMap = new Int2ObjectOpenHashMap<>();
|
|
||||||
|
|
||||||
private static Int2ObjectMap<AvatarPromotionExcel> avatarPromotionExcelMap = new Int2ObjectOpenHashMap<>();
|
private static Int2ObjectMap<AvatarPromotionExcel> avatarPromotionExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
private static Int2ObjectMap<AvatarSkillTreeExcel> avatarSkillTreeExcelMap = new Int2ObjectOpenHashMap<>();
|
private static Int2ObjectMap<AvatarSkillTreeExcel> avatarSkillTreeExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import emu.lunarcore.data.GameResource;
|
|||||||
import emu.lunarcore.data.ResourceType;
|
import emu.lunarcore.data.ResourceType;
|
||||||
import emu.lunarcore.data.ResourceType.LoadPriority;
|
import emu.lunarcore.data.ResourceType.LoadPriority;
|
||||||
import emu.lunarcore.game.enums.RogueBuffAeonType;
|
import emu.lunarcore.game.enums.RogueBuffAeonType;
|
||||||
|
import emu.lunarcore.game.enums.RogueBuffCategory;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@@ -16,9 +17,9 @@ public class RogueBuffExcel extends GameResource {
|
|||||||
private int MazeBuffID;
|
private int MazeBuffID;
|
||||||
private int MazeBuffLevel;
|
private int MazeBuffLevel;
|
||||||
private int RogueBuffType;
|
private int RogueBuffType;
|
||||||
private int RogueBuffRarity;
|
|
||||||
private int RogueBuffTag;
|
private int RogueBuffTag;
|
||||||
private int AeonID;
|
private int AeonID;
|
||||||
|
private RogueBuffCategory RogueBuffCategory = emu.lunarcore.game.enums.RogueBuffCategory.None;
|
||||||
private RogueBuffAeonType BattleEventBuffType = RogueBuffAeonType.Normal;
|
private RogueBuffAeonType BattleEventBuffType = RogueBuffAeonType.Normal;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -33,7 +34,7 @@ public class RogueBuffExcel extends GameResource {
|
|||||||
@Override
|
@Override
|
||||||
public void onLoad() {
|
public void onLoad() {
|
||||||
// Add to random buff list
|
// Add to random buff list
|
||||||
if (RogueBuffType >= 120 && RogueBuffType <= 128 && RogueBuffRarity >= 1 && RogueBuffRarity <= 3 && MazeBuffLevel == 1 && AeonID == 0) {
|
if (RogueBuffType >= 120 && RogueBuffType <= 128 && RogueBuffCategory.getVal() >= 1 && RogueBuffCategory.getVal() <= 3 && MazeBuffLevel == 1 && AeonID == 0) {
|
||||||
GameDepot.getRogueRandomBuffList().add(this);
|
GameDepot.getRogueRandomBuffList().add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package emu.lunarcore.game.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
public enum RogueBuffCategory {
|
||||||
|
None (0),
|
||||||
|
Common (1),
|
||||||
|
Rare (2),
|
||||||
|
Legendary (3);
|
||||||
|
|
||||||
|
private final int val;
|
||||||
|
|
||||||
|
private RogueBuffCategory(int value) {
|
||||||
|
this.val = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,7 +5,6 @@ import java.util.HashSet;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import emu.lunarcore.data.GameData;
|
|
||||||
import emu.lunarcore.data.GameDepot;
|
import emu.lunarcore.data.GameDepot;
|
||||||
import emu.lunarcore.data.excel.RogueBuffExcel;
|
import emu.lunarcore.data.excel.RogueBuffExcel;
|
||||||
import emu.lunarcore.proto.ItemCostOuterClass.ItemCost;
|
import emu.lunarcore.proto.ItemCostOuterClass.ItemCost;
|
||||||
@@ -32,7 +31,7 @@ public class RogueBuffSelectMenu {
|
|||||||
public RogueBuffSelectMenu() {}
|
public RogueBuffSelectMenu() {}
|
||||||
|
|
||||||
public RogueBuffSelectMenu(RogueInstance rogue) {
|
public RogueBuffSelectMenu(RogueInstance rogue) {
|
||||||
this(rogue, false, GameData.getRogueBuffGroupExcelMap().get(110002).getRogueBuffList());
|
this(rogue, false, new HashSet<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
public RogueBuffSelectMenu(RogueInstance rogue, boolean generateAeonBuffs, Set<RogueBuffData> buffs) {
|
public RogueBuffSelectMenu(RogueInstance rogue, boolean generateAeonBuffs, Set<RogueBuffData> buffs) {
|
||||||
@@ -76,7 +75,7 @@ public class RogueBuffSelectMenu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Calculate buff weights
|
// Calculate buff weights
|
||||||
double weight = 10.0 / excel.getExcel().getRogueBuffRarity();
|
double weight = 10.0 / excel.getExcel().getRogueBuffCategory().getVal();
|
||||||
|
|
||||||
if (getRogue().getAeonBuffType() == excel.getExcel().getRogueBuffType()) {
|
if (getRogue().getAeonBuffType() == excel.getExcel().getRogueBuffType()) {
|
||||||
weight *= 2;
|
weight *= 2;
|
||||||
|
|||||||
@@ -300,7 +300,7 @@ public class RogueInstance {
|
|||||||
public synchronized RogueBuff enhanceBuff(int buffId) {
|
public synchronized RogueBuff enhanceBuff(int buffId) {
|
||||||
var buff = this.getBuffs().get(buffId);
|
var buff = this.getBuffs().get(buffId);
|
||||||
if (buff == null) return null;
|
if (buff == null) return null;
|
||||||
var cost = 100 + (buff.getExcel().getRogueBuffRarity() - 1) * 30;
|
var cost = 100 + (buff.getExcel().getRogueBuffCategory().getVal() - 1) * 30;
|
||||||
if (this.getCoin() < cost) return null;
|
if (this.getCoin() < cost) return null;
|
||||||
this.removeCoin(cost);
|
this.removeCoin(cost);
|
||||||
this.getBuffs().remove(buffId);
|
this.getBuffs().remove(buffId);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class PacketGetRogueBuffEnhanceInfoScRsp extends BasePacket {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ItemCostList getItemCostList(RogueBuffExcel excel) {
|
public ItemCostList getItemCostList(RogueBuffExcel excel) {
|
||||||
int cost = 100 + (excel.getRogueBuffRarity() - 1) * 30;
|
int cost = 100 + (excel.getRogueBuffCategory().getVal() - 1) * 30;
|
||||||
return ItemCostList.newInstance()
|
return ItemCostList.newInstance()
|
||||||
.addItemList(ItemCost.newInstance()
|
.addItemList(ItemCost.newInstance()
|
||||||
.setPileItem(PileItem.newInstance()
|
.setPileItem(PileItem.newInstance()
|
||||||
|
|||||||
Reference in New Issue
Block a user