From 936ec9c43029a6e7074e8566fdeb589115a02e3a Mon Sep 17 00:00:00 2001 From: Melledy <121644117+Melledy@users.noreply.github.com> Date: Sat, 28 Oct 2023 00:05:50 -0700 Subject: [PATCH] Implement picking aeons in the beginning of SU --- .../proto/RogueAeonInfoOuterClass.java | 623 ++++++++++++++++++ .../lunarcore/proto/RogueInfoOuterClass.java | 174 ++++- .../java/emu/lunarcore/data/GameData.java | 1 + .../lunarcore/data/excel/RogueAeonExcel.java | 18 + .../game/rogue/RogueBuffSelectMenu.java | 9 +- .../lunarcore/game/rogue/RogueInstance.java | 11 +- .../lunarcore/game/rogue/RogueManager.java | 24 +- .../packet/recv/HandlerStartRogueCsReq.java | 2 +- 8 files changed, 818 insertions(+), 44 deletions(-) create mode 100644 src/generated/main/emu/lunarcore/proto/RogueAeonInfoOuterClass.java create mode 100644 src/main/java/emu/lunarcore/data/excel/RogueAeonExcel.java diff --git a/src/generated/main/emu/lunarcore/proto/RogueAeonInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/RogueAeonInfoOuterClass.java new file mode 100644 index 0000000..afd6ec6 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/RogueAeonInfoOuterClass.java @@ -0,0 +1,623 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import java.io.IOException; +import us.hebi.quickbuf.FieldName; +import us.hebi.quickbuf.InvalidProtocolBufferException; +import us.hebi.quickbuf.JsonSink; +import us.hebi.quickbuf.JsonSource; +import us.hebi.quickbuf.MessageFactory; +import us.hebi.quickbuf.ProtoMessage; +import us.hebi.quickbuf.ProtoSink; +import us.hebi.quickbuf.ProtoSource; +import us.hebi.quickbuf.RepeatedInt; + +public final class RogueAeonInfoOuterClass { + /** + * Protobuf type {@code RogueAeonInfo} + */ + public static final class RogueAeonInfo extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 unlock_aeon_enhance_num = 1; + */ + private int unlockAeonEnhanceNum; + + /** + * optional uint32 unlocked_aeon_num = 4; + */ + private int unlockedAeonNum; + + /** + * optional uint32 selected_aeon_id = 8; + */ + private int selectedAeonId; + + /** + * optional bool AFPFIHKLELP = 9; + */ + private boolean aFPFIHKLELP; + + /** + * repeated uint32 aeon_id_list = 5; + */ + private final RepeatedInt aeonIdList = RepeatedInt.newEmptyInstance(); + + private RogueAeonInfo() { + } + + /** + * @return a new empty instance of {@code RogueAeonInfo} + */ + public static RogueAeonInfo newInstance() { + return new RogueAeonInfo(); + } + + /** + * optional uint32 unlock_aeon_enhance_num = 1; + * @return whether the unlockAeonEnhanceNum field is set + */ + public boolean hasUnlockAeonEnhanceNum() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 unlock_aeon_enhance_num = 1; + * @return this + */ + public RogueAeonInfo clearUnlockAeonEnhanceNum() { + bitField0_ &= ~0x00000001; + unlockAeonEnhanceNum = 0; + return this; + } + + /** + * optional uint32 unlock_aeon_enhance_num = 1; + * @return the unlockAeonEnhanceNum + */ + public int getUnlockAeonEnhanceNum() { + return unlockAeonEnhanceNum; + } + + /** + * optional uint32 unlock_aeon_enhance_num = 1; + * @param value the unlockAeonEnhanceNum to set + * @return this + */ + public RogueAeonInfo setUnlockAeonEnhanceNum(final int value) { + bitField0_ |= 0x00000001; + unlockAeonEnhanceNum = value; + return this; + } + + /** + * optional uint32 unlocked_aeon_num = 4; + * @return whether the unlockedAeonNum field is set + */ + public boolean hasUnlockedAeonNum() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 unlocked_aeon_num = 4; + * @return this + */ + public RogueAeonInfo clearUnlockedAeonNum() { + bitField0_ &= ~0x00000002; + unlockedAeonNum = 0; + return this; + } + + /** + * optional uint32 unlocked_aeon_num = 4; + * @return the unlockedAeonNum + */ + public int getUnlockedAeonNum() { + return unlockedAeonNum; + } + + /** + * optional uint32 unlocked_aeon_num = 4; + * @param value the unlockedAeonNum to set + * @return this + */ + public RogueAeonInfo setUnlockedAeonNum(final int value) { + bitField0_ |= 0x00000002; + unlockedAeonNum = value; + return this; + } + + /** + * optional uint32 selected_aeon_id = 8; + * @return whether the selectedAeonId field is set + */ + public boolean hasSelectedAeonId() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional uint32 selected_aeon_id = 8; + * @return this + */ + public RogueAeonInfo clearSelectedAeonId() { + bitField0_ &= ~0x00000004; + selectedAeonId = 0; + return this; + } + + /** + * optional uint32 selected_aeon_id = 8; + * @return the selectedAeonId + */ + public int getSelectedAeonId() { + return selectedAeonId; + } + + /** + * optional uint32 selected_aeon_id = 8; + * @param value the selectedAeonId to set + * @return this + */ + public RogueAeonInfo setSelectedAeonId(final int value) { + bitField0_ |= 0x00000004; + selectedAeonId = value; + return this; + } + + /** + * optional bool AFPFIHKLELP = 9; + * @return whether the aFPFIHKLELP field is set + */ + public boolean hasAFPFIHKLELP() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * optional bool AFPFIHKLELP = 9; + * @return this + */ + public RogueAeonInfo clearAFPFIHKLELP() { + bitField0_ &= ~0x00000008; + aFPFIHKLELP = false; + return this; + } + + /** + * optional bool AFPFIHKLELP = 9; + * @return the aFPFIHKLELP + */ + public boolean getAFPFIHKLELP() { + return aFPFIHKLELP; + } + + /** + * optional bool AFPFIHKLELP = 9; + * @param value the aFPFIHKLELP to set + * @return this + */ + public RogueAeonInfo setAFPFIHKLELP(final boolean value) { + bitField0_ |= 0x00000008; + aFPFIHKLELP = value; + return this; + } + + /** + * repeated uint32 aeon_id_list = 5; + * @return whether the aeonIdList field is set + */ + public boolean hasAeonIdList() { + return (bitField0_ & 0x00000010) != 0; + } + + /** + * repeated uint32 aeon_id_list = 5; + * @return this + */ + public RogueAeonInfo clearAeonIdList() { + bitField0_ &= ~0x00000010; + aeonIdList.clear(); + return this; + } + + /** + * repeated uint32 aeon_id_list = 5; + * + * This method returns the internal storage object without modifying any has state. + * The returned object should not be modified and be treated as read-only. + * + * Use {@link #getMutableAeonIdList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getAeonIdList() { + return aeonIdList; + } + + /** + * repeated uint32 aeon_id_list = 5; + * + * This method returns the internal storage object and sets the corresponding + * has state. The returned object will become part of this message and its + * contents may be modified as long as the has state is not cleared. + * + * @return internal storage object for modifications + */ + public RepeatedInt getMutableAeonIdList() { + bitField0_ |= 0x00000010; + return aeonIdList; + } + + /** + * repeated uint32 aeon_id_list = 5; + * @param value the aeonIdList to add + * @return this + */ + public RogueAeonInfo addAeonIdList(final int value) { + bitField0_ |= 0x00000010; + aeonIdList.add(value); + return this; + } + + /** + * repeated uint32 aeon_id_list = 5; + * @param values the aeonIdList to add + * @return this + */ + public RogueAeonInfo addAllAeonIdList(final int... values) { + bitField0_ |= 0x00000010; + aeonIdList.addAll(values); + return this; + } + + @Override + public RogueAeonInfo copyFrom(final RogueAeonInfo other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + unlockAeonEnhanceNum = other.unlockAeonEnhanceNum; + unlockedAeonNum = other.unlockedAeonNum; + selectedAeonId = other.selectedAeonId; + aFPFIHKLELP = other.aFPFIHKLELP; + aeonIdList.copyFrom(other.aeonIdList); + } + return this; + } + + @Override + public RogueAeonInfo mergeFrom(final RogueAeonInfo other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasUnlockAeonEnhanceNum()) { + setUnlockAeonEnhanceNum(other.unlockAeonEnhanceNum); + } + if (other.hasUnlockedAeonNum()) { + setUnlockedAeonNum(other.unlockedAeonNum); + } + if (other.hasSelectedAeonId()) { + setSelectedAeonId(other.selectedAeonId); + } + if (other.hasAFPFIHKLELP()) { + setAFPFIHKLELP(other.aFPFIHKLELP); + } + if (other.hasAeonIdList()) { + getMutableAeonIdList().addAll(other.aeonIdList); + } + return this; + } + + @Override + public RogueAeonInfo clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + unlockAeonEnhanceNum = 0; + unlockedAeonNum = 0; + selectedAeonId = 0; + aFPFIHKLELP = false; + aeonIdList.clear(); + return this; + } + + @Override + public RogueAeonInfo clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + aeonIdList.clear(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof RogueAeonInfo)) { + return false; + } + RogueAeonInfo other = (RogueAeonInfo) o; + return bitField0_ == other.bitField0_ + && (!hasUnlockAeonEnhanceNum() || unlockAeonEnhanceNum == other.unlockAeonEnhanceNum) + && (!hasUnlockedAeonNum() || unlockedAeonNum == other.unlockedAeonNum) + && (!hasSelectedAeonId() || selectedAeonId == other.selectedAeonId) + && (!hasAFPFIHKLELP() || aFPFIHKLELP == other.aFPFIHKLELP) + && (!hasAeonIdList() || aeonIdList.equals(other.aeonIdList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 8); + output.writeUInt32NoTag(unlockAeonEnhanceNum); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 32); + output.writeUInt32NoTag(unlockedAeonNum); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 64); + output.writeUInt32NoTag(selectedAeonId); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeRawByte((byte) 72); + output.writeBoolNoTag(aFPFIHKLELP); + } + if ((bitField0_ & 0x00000010) != 0) { + for (int i = 0; i < aeonIdList.length(); i++) { + output.writeRawByte((byte) 40); + output.writeUInt32NoTag(aeonIdList.array()[i]); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(unlockAeonEnhanceNum); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(unlockedAeonNum); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(selectedAeonId); + } + if ((bitField0_ & 0x00000008) != 0) { + size += 2; + } + if ((bitField0_ & 0x00000010) != 0) { + size += (1 * aeonIdList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(aeonIdList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public RogueAeonInfo mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 8: { + // unlockAeonEnhanceNum + unlockAeonEnhanceNum = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 32) { + break; + } + } + case 32: { + // unlockedAeonNum + unlockedAeonNum = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 64) { + break; + } + } + case 64: { + // selectedAeonId + selectedAeonId = input.readUInt32(); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 72) { + break; + } + } + case 72: { + // aFPFIHKLELP + aFPFIHKLELP = input.readBool(); + bitField0_ |= 0x00000008; + tag = input.readTag(); + if (tag != 42) { + break; + } + } + case 42: { + // aeonIdList [packed=true] + input.readPackedUInt32(aeonIdList, tag); + bitField0_ |= 0x00000010; + tag = input.readTag(); + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + case 40: { + // aeonIdList [packed=false] + tag = input.readRepeatedUInt32(aeonIdList, tag); + bitField0_ |= 0x00000010; + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.unlockAeonEnhanceNum, unlockAeonEnhanceNum); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.unlockedAeonNum, unlockedAeonNum); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeUInt32(FieldNames.selectedAeonId, selectedAeonId); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeBool(FieldNames.aFPFIHKLELP, aFPFIHKLELP); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeRepeatedUInt32(FieldNames.aeonIdList, aeonIdList); + } + output.endObject(); + } + + @Override + public RogueAeonInfo mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 1040991167: + case 7773396: { + if (input.isAtField(FieldNames.unlockAeonEnhanceNum)) { + if (!input.trySkipNullValue()) { + unlockAeonEnhanceNum = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case -149403872: + case 1158862886: { + if (input.isAtField(FieldNames.unlockedAeonNum)) { + if (!input.trySkipNullValue()) { + unlockedAeonNum = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1331475449: + case 853040179: { + if (input.isAtField(FieldNames.selectedAeonId)) { + if (!input.trySkipNullValue()) { + selectedAeonId = input.readUInt32(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case -337406834: { + if (input.isAtField(FieldNames.aFPFIHKLELP)) { + if (!input.trySkipNullValue()) { + aFPFIHKLELP = input.readBool(); + bitField0_ |= 0x00000008; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1452976956: + case 953805318: { + if (input.isAtField(FieldNames.aeonIdList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(aeonIdList); + bitField0_ |= 0x00000010; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public RogueAeonInfo clone() { + return new RogueAeonInfo().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static RogueAeonInfo parseFrom(final byte[] data) throws InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new RogueAeonInfo(), data).checkInitialized(); + } + + public static RogueAeonInfo parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new RogueAeonInfo(), input).checkInitialized(); + } + + public static RogueAeonInfo parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new RogueAeonInfo(), input).checkInitialized(); + } + + /** + * @return factory for creating RogueAeonInfo messages + */ + public static MessageFactory getFactory() { + return RogueAeonInfoFactory.INSTANCE; + } + + private enum RogueAeonInfoFactory implements MessageFactory { + INSTANCE; + + @Override + public RogueAeonInfo create() { + return RogueAeonInfo.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName unlockAeonEnhanceNum = FieldName.forField("unlockAeonEnhanceNum", "unlock_aeon_enhance_num"); + + static final FieldName unlockedAeonNum = FieldName.forField("unlockedAeonNum", "unlocked_aeon_num"); + + static final FieldName selectedAeonId = FieldName.forField("selectedAeonId", "selected_aeon_id"); + + static final FieldName aFPFIHKLELP = FieldName.forField("AFPFIHKLELP"); + + static final FieldName aeonIdList = FieldName.forField("aeonIdList", "aeon_id_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/RogueInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/RogueInfoOuterClass.java index bae6245..16d2686 100644 --- a/src/generated/main/emu/lunarcore/proto/RogueInfoOuterClass.java +++ b/src/generated/main/emu/lunarcore/proto/RogueInfoOuterClass.java @@ -70,6 +70,11 @@ public final class RogueInfoOuterClass { */ private final RogueInfoDataOuterClass.RogueInfoData rogueData = RogueInfoDataOuterClass.RogueInfoData.newInstance(); + /** + * optional .RogueAeonInfo rogue_aeon_info = 772; + */ + private final RogueAeonInfoOuterClass.RogueAeonInfo rogueAeonInfo = RogueAeonInfoOuterClass.RogueAeonInfo.newInstance(); + /** * optional .RogueMapInfo room_map = 862; */ @@ -556,12 +561,69 @@ public final class RogueInfoOuterClass { return this; } + /** + * optional .RogueAeonInfo rogue_aeon_info = 772; + * @return whether the rogueAeonInfo field is set + */ + public boolean hasRogueAeonInfo() { + return (bitField0_ & 0x00000400) != 0; + } + + /** + * optional .RogueAeonInfo rogue_aeon_info = 772; + * @return this + */ + public RogueInfo clearRogueAeonInfo() { + bitField0_ &= ~0x00000400; + rogueAeonInfo.clear(); + return this; + } + + /** + * optional .RogueAeonInfo rogue_aeon_info = 772; + * + * This method returns the internal storage object without modifying any has state. + * The returned object should not be modified and be treated as read-only. + * + * Use {@link #getMutableRogueAeonInfo()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RogueAeonInfoOuterClass.RogueAeonInfo getRogueAeonInfo() { + return rogueAeonInfo; + } + + /** + * optional .RogueAeonInfo rogue_aeon_info = 772; + * + * This method returns the internal storage object and sets the corresponding + * has state. The returned object will become part of this message and its + * contents may be modified as long as the has state is not cleared. + * + * @return internal storage object for modifications + */ + public RogueAeonInfoOuterClass.RogueAeonInfo getMutableRogueAeonInfo() { + bitField0_ |= 0x00000400; + return rogueAeonInfo; + } + + /** + * optional .RogueAeonInfo rogue_aeon_info = 772; + * @param value the rogueAeonInfo to set + * @return this + */ + public RogueInfo setRogueAeonInfo(final RogueAeonInfoOuterClass.RogueAeonInfo value) { + bitField0_ |= 0x00000400; + rogueAeonInfo.copyFrom(value); + return this; + } + /** * optional .RogueMapInfo room_map = 862; * @return whether the roomMap field is set */ public boolean hasRoomMap() { - return (bitField0_ & 0x00000400) != 0; + return (bitField0_ & 0x00000800) != 0; } /** @@ -569,7 +631,7 @@ public final class RogueInfoOuterClass { * @return this */ public RogueInfo clearRoomMap() { - bitField0_ &= ~0x00000400; + bitField0_ &= ~0x00000800; roomMap.clear(); return this; } @@ -598,7 +660,7 @@ public final class RogueInfoOuterClass { * @return internal storage object for modifications */ public RogueMapInfoOuterClass.RogueMapInfo getMutableRoomMap() { - bitField0_ |= 0x00000400; + bitField0_ |= 0x00000800; return roomMap; } @@ -608,7 +670,7 @@ public final class RogueInfoOuterClass { * @return this */ public RogueInfo setRoomMap(final RogueMapInfoOuterClass.RogueMapInfo value) { - bitField0_ |= 0x00000400; + bitField0_ |= 0x00000800; roomMap.copyFrom(value); return this; } @@ -618,7 +680,7 @@ public final class RogueInfoOuterClass { * @return whether the rogueScoreInfo field is set */ public boolean hasRogueScoreInfo() { - return (bitField0_ & 0x00000800) != 0; + return (bitField0_ & 0x00001000) != 0; } /** @@ -626,7 +688,7 @@ public final class RogueInfoOuterClass { * @return this */ public RogueInfo clearRogueScoreInfo() { - bitField0_ &= ~0x00000800; + bitField0_ &= ~0x00001000; rogueScoreInfo.clear(); return this; } @@ -655,7 +717,7 @@ public final class RogueInfoOuterClass { * @return internal storage object for modifications */ public RogueScoreRewardInfoOuterClass.RogueScoreRewardInfo getMutableRogueScoreInfo() { - bitField0_ |= 0x00000800; + bitField0_ |= 0x00001000; return rogueScoreInfo; } @@ -666,7 +728,7 @@ public final class RogueInfoOuterClass { */ public RogueInfo setRogueScoreInfo( final RogueScoreRewardInfoOuterClass.RogueScoreRewardInfo value) { - bitField0_ |= 0x00000800; + bitField0_ |= 0x00001000; rogueScoreInfo.copyFrom(value); return this; } @@ -676,7 +738,7 @@ public final class RogueInfoOuterClass { * @return whether the baseAvatarIdList field is set */ public boolean hasBaseAvatarIdList() { - return (bitField0_ & 0x00001000) != 0; + return (bitField0_ & 0x00002000) != 0; } /** @@ -684,7 +746,7 @@ public final class RogueInfoOuterClass { * @return this */ public RogueInfo clearBaseAvatarIdList() { - bitField0_ &= ~0x00001000; + bitField0_ &= ~0x00002000; baseAvatarIdList.clear(); return this; } @@ -713,7 +775,7 @@ public final class RogueInfoOuterClass { * @return internal storage object for modifications */ public RepeatedInt getMutableBaseAvatarIdList() { - bitField0_ |= 0x00001000; + bitField0_ |= 0x00002000; return baseAvatarIdList; } @@ -723,7 +785,7 @@ public final class RogueInfoOuterClass { * @return this */ public RogueInfo addBaseAvatarIdList(final int value) { - bitField0_ |= 0x00001000; + bitField0_ |= 0x00002000; baseAvatarIdList.add(value); return this; } @@ -734,7 +796,7 @@ public final class RogueInfoOuterClass { * @return this */ public RogueInfo addAllBaseAvatarIdList(final int... values) { - bitField0_ |= 0x00001000; + bitField0_ |= 0x00002000; baseAvatarIdList.addAll(values); return this; } @@ -744,7 +806,7 @@ public final class RogueInfoOuterClass { * @return whether the rogueAreaList field is set */ public boolean hasRogueAreaList() { - return (bitField0_ & 0x00002000) != 0; + return (bitField0_ & 0x00004000) != 0; } /** @@ -752,7 +814,7 @@ public final class RogueInfoOuterClass { * @return this */ public RogueInfo clearRogueAreaList() { - bitField0_ &= ~0x00002000; + bitField0_ &= ~0x00004000; rogueAreaList.clear(); return this; } @@ -781,7 +843,7 @@ public final class RogueInfoOuterClass { * @return internal storage object for modifications */ public RepeatedMessage getMutableRogueAreaList() { - bitField0_ |= 0x00002000; + bitField0_ |= 0x00004000; return rogueAreaList; } @@ -791,7 +853,7 @@ public final class RogueInfoOuterClass { * @return this */ public RogueInfo addRogueAreaList(final RogueAreaOuterClass.RogueArea value) { - bitField0_ |= 0x00002000; + bitField0_ |= 0x00004000; rogueAreaList.add(value); return this; } @@ -802,7 +864,7 @@ public final class RogueInfoOuterClass { * @return this */ public RogueInfo addAllRogueAreaList(final RogueAreaOuterClass.RogueArea... values) { - bitField0_ |= 0x00002000; + bitField0_ |= 0x00004000; rogueAreaList.addAll(values); return this; } @@ -822,6 +884,7 @@ public final class RogueInfoOuterClass { rogueVirtualItems.copyFrom(other.rogueVirtualItems); rogueProgress.copyFrom(other.rogueProgress); rogueData.copyFrom(other.rogueData); + rogueAeonInfo.copyFrom(other.rogueAeonInfo); roomMap.copyFrom(other.roomMap); rogueScoreInfo.copyFrom(other.rogueScoreInfo); baseAvatarIdList.copyFrom(other.baseAvatarIdList); @@ -866,6 +929,9 @@ public final class RogueInfoOuterClass { if (other.hasRogueData()) { getMutableRogueData().mergeFrom(other.rogueData); } + if (other.hasRogueAeonInfo()) { + getMutableRogueAeonInfo().mergeFrom(other.rogueAeonInfo); + } if (other.hasRoomMap()) { getMutableRoomMap().mergeFrom(other.roomMap); } @@ -898,6 +964,7 @@ public final class RogueInfoOuterClass { rogueVirtualItems.clear(); rogueProgress.clear(); rogueData.clear(); + rogueAeonInfo.clear(); roomMap.clear(); rogueScoreInfo.clear(); baseAvatarIdList.clear(); @@ -915,6 +982,7 @@ public final class RogueInfoOuterClass { rogueVirtualItems.clearQuick(); rogueProgress.clearQuick(); rogueData.clearQuick(); + rogueAeonInfo.clearQuick(); roomMap.clearQuick(); rogueScoreInfo.clearQuick(); baseAvatarIdList.clear(); @@ -942,6 +1010,7 @@ public final class RogueInfoOuterClass { && (!hasRogueVirtualItems() || rogueVirtualItems.equals(other.rogueVirtualItems)) && (!hasRogueProgress() || rogueProgress.equals(other.rogueProgress)) && (!hasRogueData() || rogueData.equals(other.rogueData)) + && (!hasRogueAeonInfo() || rogueAeonInfo.equals(other.rogueAeonInfo)) && (!hasRoomMap() || roomMap.equals(other.roomMap)) && (!hasRogueScoreInfo() || rogueScoreInfo.equals(other.rogueScoreInfo)) && (!hasBaseAvatarIdList() || baseAvatarIdList.equals(other.baseAvatarIdList)) @@ -991,20 +1060,24 @@ public final class RogueInfoOuterClass { output.writeMessageNoTag(rogueData); } if ((bitField0_ & 0x00000400) != 0) { + output.writeRawLittleEndian16((short) 12450); + output.writeMessageNoTag(rogueAeonInfo); + } + if ((bitField0_ & 0x00000800) != 0) { output.writeRawLittleEndian16((short) 13810); output.writeMessageNoTag(roomMap); } - if ((bitField0_ & 0x00000800) != 0) { + if ((bitField0_ & 0x00001000) != 0) { output.writeRawLittleEndian16((short) 20898); output.writeMessageNoTag(rogueScoreInfo); } - if ((bitField0_ & 0x00001000) != 0) { + if ((bitField0_ & 0x00002000) != 0) { for (int i = 0; i < baseAvatarIdList.length(); i++) { output.writeRawByte((byte) 96); output.writeUInt32NoTag(baseAvatarIdList.array()[i]); } } - if ((bitField0_ & 0x00002000) != 0) { + if ((bitField0_ & 0x00004000) != 0) { for (int i = 0; i < rogueAreaList.length(); i++) { output.writeRawLittleEndian16((short) 3834); output.writeMessageNoTag(rogueAreaList.get(i)); @@ -1046,15 +1119,18 @@ public final class RogueInfoOuterClass { size += 2 + ProtoSink.computeMessageSizeNoTag(rogueData); } if ((bitField0_ & 0x00000400) != 0) { - size += 2 + ProtoSink.computeMessageSizeNoTag(roomMap); + size += 2 + ProtoSink.computeMessageSizeNoTag(rogueAeonInfo); } if ((bitField0_ & 0x00000800) != 0) { - size += 2 + ProtoSink.computeMessageSizeNoTag(rogueScoreInfo); + size += 2 + ProtoSink.computeMessageSizeNoTag(roomMap); } if ((bitField0_ & 0x00001000) != 0) { - size += (1 * baseAvatarIdList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(baseAvatarIdList); + size += 2 + ProtoSink.computeMessageSizeNoTag(rogueScoreInfo); } if ((bitField0_ & 0x00002000) != 0) { + size += (1 * baseAvatarIdList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(baseAvatarIdList); + } + if ((bitField0_ & 0x00004000) != 0) { size += (2 * rogueAreaList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(rogueAreaList); } return size; @@ -1156,6 +1232,15 @@ public final class RogueInfoOuterClass { input.readMessage(rogueData); bitField0_ |= 0x00000200; tag = input.readTag(); + if (tag != 6178) { + break; + } + } + case 6178: { + // rogueAeonInfo + input.readMessage(rogueAeonInfo); + bitField0_ |= 0x00000400; + tag = input.readTag(); if (tag != 6898) { break; } @@ -1163,7 +1248,7 @@ public final class RogueInfoOuterClass { case 6898: { // roomMap input.readMessage(roomMap); - bitField0_ |= 0x00000400; + bitField0_ |= 0x00000800; tag = input.readTag(); if (tag != 10402) { break; @@ -1172,7 +1257,7 @@ public final class RogueInfoOuterClass { case 10402: { // rogueScoreInfo input.readMessage(rogueScoreInfo); - bitField0_ |= 0x00000800; + bitField0_ |= 0x00001000; tag = input.readTag(); if (tag != 98) { break; @@ -1181,7 +1266,7 @@ public final class RogueInfoOuterClass { case 98: { // baseAvatarIdList [packed=true] input.readPackedUInt32(baseAvatarIdList, tag); - bitField0_ |= 0x00001000; + bitField0_ |= 0x00002000; tag = input.readTag(); if (tag != 1914) { break; @@ -1190,7 +1275,7 @@ public final class RogueInfoOuterClass { case 1914: { // rogueAreaList tag = input.readRepeatedMessage(rogueAreaList, tag); - bitField0_ |= 0x00002000; + bitField0_ |= 0x00004000; if (tag != 0) { break; } @@ -1208,7 +1293,7 @@ public final class RogueInfoOuterClass { case 96: { // baseAvatarIdList [packed=false] tag = input.readRepeatedUInt32(baseAvatarIdList, tag); - bitField0_ |= 0x00001000; + bitField0_ |= 0x00002000; break; } } @@ -1249,15 +1334,18 @@ public final class RogueInfoOuterClass { output.writeMessage(FieldNames.rogueData, rogueData); } if ((bitField0_ & 0x00000400) != 0) { - output.writeMessage(FieldNames.roomMap, roomMap); + output.writeMessage(FieldNames.rogueAeonInfo, rogueAeonInfo); } if ((bitField0_ & 0x00000800) != 0) { - output.writeMessage(FieldNames.rogueScoreInfo, rogueScoreInfo); + output.writeMessage(FieldNames.roomMap, roomMap); } if ((bitField0_ & 0x00001000) != 0) { - output.writeRepeatedUInt32(FieldNames.baseAvatarIdList, baseAvatarIdList); + output.writeMessage(FieldNames.rogueScoreInfo, rogueScoreInfo); } if ((bitField0_ & 0x00002000) != 0) { + output.writeRepeatedUInt32(FieldNames.baseAvatarIdList, baseAvatarIdList); + } + if ((bitField0_ & 0x00004000) != 0) { output.writeRepeatedMessage(FieldNames.rogueAreaList, rogueAreaList); } output.endObject(); @@ -1392,12 +1480,24 @@ public final class RogueInfoOuterClass { } break; } + case -1685018549: + case -1375922619: { + if (input.isAtField(FieldNames.rogueAeonInfo)) { + if (!input.trySkipNullValue()) { + input.readMessage(rogueAeonInfo); + bitField0_ |= 0x00000400; + } + } else { + input.skipUnknownField(); + } + break; + } case 1379875457: case -172986376: { if (input.isAtField(FieldNames.roomMap)) { if (!input.trySkipNullValue()) { input.readMessage(roomMap); - bitField0_ |= 0x00000400; + bitField0_ |= 0x00000800; } } else { input.skipUnknownField(); @@ -1409,7 +1509,7 @@ public final class RogueInfoOuterClass { if (input.isAtField(FieldNames.rogueScoreInfo)) { if (!input.trySkipNullValue()) { input.readMessage(rogueScoreInfo); - bitField0_ |= 0x00000800; + bitField0_ |= 0x00001000; } } else { input.skipUnknownField(); @@ -1421,7 +1521,7 @@ public final class RogueInfoOuterClass { if (input.isAtField(FieldNames.baseAvatarIdList)) { if (!input.trySkipNullValue()) { input.readRepeatedUInt32(baseAvatarIdList); - bitField0_ |= 0x00001000; + bitField0_ |= 0x00002000; } } else { input.skipUnknownField(); @@ -1433,7 +1533,7 @@ public final class RogueInfoOuterClass { if (input.isAtField(FieldNames.rogueAreaList)) { if (!input.trySkipNullValue()) { input.readRepeatedMessage(rogueAreaList); - bitField0_ |= 0x00002000; + bitField0_ |= 0x00004000; } } else { input.skipUnknownField(); @@ -1512,6 +1612,8 @@ public final class RogueInfoOuterClass { static final FieldName rogueData = FieldName.forField("rogueData", "rogue_data"); + static final FieldName rogueAeonInfo = FieldName.forField("rogueAeonInfo", "rogue_aeon_info"); + static final FieldName roomMap = FieldName.forField("roomMap", "room_map"); static final FieldName rogueScoreInfo = FieldName.forField("rogueScoreInfo", "rogue_score_info"); diff --git a/src/main/java/emu/lunarcore/data/GameData.java b/src/main/java/emu/lunarcore/data/GameData.java index 0804e07..8acd413 100644 --- a/src/main/java/emu/lunarcore/data/GameData.java +++ b/src/main/java/emu/lunarcore/data/GameData.java @@ -36,6 +36,7 @@ public class GameData { @Getter private static Int2ObjectMap rogueManagerExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap rogueTalentExcelMap = new Int2ObjectOpenHashMap<>(); + @Getter private static Int2ObjectMap rogueAeonExcelMap = new Int2ObjectLinkedOpenHashMap<>(); @Getter private static Int2ObjectMap rogueAreaExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap rogueRoomExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap rogueMonsterExcelMap = new Int2ObjectOpenHashMap<>(); diff --git a/src/main/java/emu/lunarcore/data/excel/RogueAeonExcel.java b/src/main/java/emu/lunarcore/data/excel/RogueAeonExcel.java new file mode 100644 index 0000000..ae3e71a --- /dev/null +++ b/src/main/java/emu/lunarcore/data/excel/RogueAeonExcel.java @@ -0,0 +1,18 @@ +package emu.lunarcore.data.excel; + +import emu.lunarcore.data.GameResource; +import emu.lunarcore.data.ResourceType; +import lombok.Getter; + +@Getter +@ResourceType(name = {"RogueAeon.json"}) +public class RogueAeonExcel extends GameResource { + private int AeonID; + private int RogueBuffType; + + @Override + public int getId() { + return AeonID; + } + +} diff --git a/src/main/java/emu/lunarcore/game/rogue/RogueBuffSelectMenu.java b/src/main/java/emu/lunarcore/game/rogue/RogueBuffSelectMenu.java index a77b076..2d9ce68 100644 --- a/src/main/java/emu/lunarcore/game/rogue/RogueBuffSelectMenu.java +++ b/src/main/java/emu/lunarcore/game/rogue/RogueBuffSelectMenu.java @@ -41,7 +41,14 @@ public class RogueBuffSelectMenu { continue; } - this.randomBuffs.add(10.0 / excel.getRogueBuffRarity(), excel); + // Calculate buff weights + double weight = 10.0 / excel.getRogueBuffRarity(); + + if (this.getRogue().getAeonBuffType() == excel.getRogueBuffType()) { + weight *= 2; + } + + this.randomBuffs.add(weight, excel); }; } diff --git a/src/main/java/emu/lunarcore/game/rogue/RogueInstance.java b/src/main/java/emu/lunarcore/game/rogue/RogueInstance.java index 787c817..da18204 100644 --- a/src/main/java/emu/lunarcore/game/rogue/RogueInstance.java +++ b/src/main/java/emu/lunarcore/game/rogue/RogueInstance.java @@ -4,6 +4,7 @@ import java.util.*; import emu.lunarcore.data.GameData; import emu.lunarcore.data.config.AnchorInfo; +import emu.lunarcore.data.excel.RogueAeonExcel; import emu.lunarcore.data.excel.RogueAreaExcel; import emu.lunarcore.game.battle.Battle; import emu.lunarcore.game.player.Player; @@ -42,10 +43,13 @@ public class RogueInstance { private int pendingMiracleSelects; private RogueMiracleSelectMenu miracleSelect; + private int aeonId; + private int aeonBuffType; + @Deprecated // Morphia only! public RogueInstance() {} - public RogueInstance(Player player, RogueAreaExcel excel) { + public RogueInstance(Player player, RogueAreaExcel excel, RogueAeonExcel aeonExcel) { this.player = player; this.excel = excel; this.areaId = excel.getRogueAreaID(); @@ -54,6 +58,11 @@ public class RogueInstance { this.buffs = new HashMap<>(); this.miracles = new HashMap<>(); + if (aeonExcel != null) { + this.aeonId = aeonExcel.getAeonID(); + this.aeonBuffType = aeonExcel.getRogueBuffType(); + } + this.initRooms(); } diff --git a/src/main/java/emu/lunarcore/game/rogue/RogueManager.java b/src/main/java/emu/lunarcore/game/rogue/RogueManager.java index 9c809c7..ce54c99 100644 --- a/src/main/java/emu/lunarcore/game/rogue/RogueManager.java +++ b/src/main/java/emu/lunarcore/game/rogue/RogueManager.java @@ -10,6 +10,7 @@ import emu.lunarcore.game.player.BasePlayerManager; import emu.lunarcore.game.player.Player; import emu.lunarcore.game.player.PlayerLineup; import emu.lunarcore.proto.ExtraLineupTypeOuterClass.ExtraLineupType; +import emu.lunarcore.proto.RogueAeonInfoOuterClass.RogueAeonInfo; import emu.lunarcore.proto.RogueAreaOuterClass.RogueArea; import emu.lunarcore.proto.RogueAreaStatusOuterClass.RogueAreaStatus; import emu.lunarcore.proto.RogueInfoDataOuterClass.RogueInfoData; @@ -27,7 +28,7 @@ public class RogueManager extends BasePlayerManager { super(player); } - public void startRogue(int areaId, RepeatedInt avatarIdList) { + public void startRogue(int areaId, int aeonId, RepeatedInt avatarIdList) { // Make sure player already isnt in a rogue instance if (getPlayer().getRogueInstance() != null) { getPlayer().sendPacket(new PacketStartRogueScRsp()); @@ -35,12 +36,14 @@ public class RogueManager extends BasePlayerManager { } // Get excel - var excel = GameData.getRogueAreaExcelMap().get(areaId); - if (excel == null || !excel.isValid()) { + var rogueAreaExcel = GameData.getRogueAreaExcelMap().get(areaId); + if (rogueAreaExcel == null || !rogueAreaExcel.isValid()) { getPlayer().sendPacket(new PacketStartRogueScRsp()); return; } + var aeonExcel = GameData.getRogueAeonExcelMap().get(aeonId); + // Replace lineup getPlayer().getLineupManager().replaceLineup(0, ExtraLineupType.LINEUP_ROGUE_VALUE, Arrays.stream(avatarIdList.array()).boxed().toList()); // Get lineup @@ -50,8 +53,9 @@ public class RogueManager extends BasePlayerManager { getPlayer().sendPacket(new PacketStartRogueScRsp()); return; } - // Get entrance id - RogueInstance data = new RogueInstance(getPlayer(), excel); + + // Get entrance id + RogueInstance data = new RogueInstance(getPlayer(), rogueAreaExcel, aeonExcel); getPlayer().setRogueInstance(data); // Reset hp/sp @@ -117,9 +121,17 @@ public class RogueManager extends BasePlayerManager { var data = RogueInfoData.newInstance() .setRogueScoreInfo(score) .setRogueSeasonInfo(season); + + var aeonInfo = RogueAeonInfo.newInstance() + .setUnlockedAeonNum(GameData.getRogueAeonExcelMap().size()); + + for (var aeonExcel : GameData.getRogueAeonExcelMap().values()) { + aeonInfo.addAeonIdList(aeonExcel.getAeonID()); + } var proto = RogueInfo.newInstance() .setRogueScoreInfo(score) + .setRogueAeonInfo(aeonInfo) .setRogueData(data) .setTalentPoints(getPlayer().getTalentPoints()) .setSeasonId(seasonId) @@ -139,6 +151,8 @@ public class RogueManager extends BasePlayerManager { for (int id : curRogue.getBaseAvatarIds()) { proto.addBaseAvatarIdList(id); } + + aeonInfo.setSelectedAeonId(curRogue.getAeonId()); } // Add areas diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerStartRogueCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerStartRogueCsReq.java index 552bb9a..17ae446 100644 --- a/src/main/java/emu/lunarcore/server/packet/recv/HandlerStartRogueCsReq.java +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerStartRogueCsReq.java @@ -13,7 +13,7 @@ public class HandlerStartRogueCsReq extends PacketHandler { public void handle(GameSession session, byte[] header, byte[] data) throws Exception { var req = StartRogueCsReq.parseFrom(data); - session.getPlayer().getRogueManager().startRogue(req.getAreaId(), req.getBaseAvatarIdList()); + session.getPlayer().getRogueManager().startRogue(req.getAreaId(), req.getBuffAeonId(), req.getBaseAvatarIdList()); } }