Implement rogue buffs

This commit is contained in:
Melledy
2023-10-26 21:59:18 -07:00
parent 175fc92460
commit 3dd3555e8f
24 changed files with 4840 additions and 17 deletions

View File

@@ -0,0 +1,394 @@
// 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;
public final class AddRogueBuffScNotifyOuterClass {
/**
* Protobuf type {@code AddRogueBuffScNotify}
*/
public static final class AddRogueBuffScNotify extends ProtoMessage<AddRogueBuffScNotify> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional .RogueBuffSource source = 15;</code>
*/
private int source;
/**
* <code>optional .RogueBuff maze_buff_info = 11;</code>
*/
private final RogueBuffOuterClass.RogueBuff mazeBuffInfo = RogueBuffOuterClass.RogueBuff.newInstance();
private AddRogueBuffScNotify() {
}
/**
* @return a new empty instance of {@code AddRogueBuffScNotify}
*/
public static AddRogueBuffScNotify newInstance() {
return new AddRogueBuffScNotify();
}
/**
* <code>optional .RogueBuffSource source = 15;</code>
* @return whether the source field is set
*/
public boolean hasSource() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional .RogueBuffSource source = 15;</code>
* @return this
*/
public AddRogueBuffScNotify clearSource() {
bitField0_ &= ~0x00000001;
source = 0;
return this;
}
/**
* <code>optional .RogueBuffSource source = 15;</code>
* @return the source
*/
public RogueBuffSourceOuterClass.RogueBuffSource getSource() {
return RogueBuffSourceOuterClass.RogueBuffSource.forNumber(source);
}
/**
* Gets the value of the internal enum store. The result is
* equivalent to {@link AddRogueBuffScNotify#getSource()}.getNumber().
*
* @return numeric wire representation
*/
public int getSourceValue() {
return source;
}
/**
* Sets the value of the internal enum store. This does not
* do any validity checks, so be sure to use appropriate value
* constants from {@link RogueBuffSourceOuterClass.RogueBuffSource}. Setting an invalid value
* can cause {@link AddRogueBuffScNotify#getSource()} to return null
*
* @param value the numeric wire value to set
* @return this
*/
public AddRogueBuffScNotify setSourceValue(final int value) {
bitField0_ |= 0x00000001;
source = value;
return this;
}
/**
* <code>optional .RogueBuffSource source = 15;</code>
* @param value the source to set
* @return this
*/
public AddRogueBuffScNotify setSource(final RogueBuffSourceOuterClass.RogueBuffSource value) {
bitField0_ |= 0x00000001;
source = value.getNumber();
return this;
}
/**
* <code>optional .RogueBuff maze_buff_info = 11;</code>
* @return whether the mazeBuffInfo field is set
*/
public boolean hasMazeBuffInfo() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>optional .RogueBuff maze_buff_info = 11;</code>
* @return this
*/
public AddRogueBuffScNotify clearMazeBuffInfo() {
bitField0_ &= ~0x00000002;
mazeBuffInfo.clear();
return this;
}
/**
* <code>optional .RogueBuff maze_buff_info = 11;</code>
*
* 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 #getMutableMazeBuffInfo()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RogueBuffOuterClass.RogueBuff getMazeBuffInfo() {
return mazeBuffInfo;
}
/**
* <code>optional .RogueBuff maze_buff_info = 11;</code>
*
* 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 RogueBuffOuterClass.RogueBuff getMutableMazeBuffInfo() {
bitField0_ |= 0x00000002;
return mazeBuffInfo;
}
/**
* <code>optional .RogueBuff maze_buff_info = 11;</code>
* @param value the mazeBuffInfo to set
* @return this
*/
public AddRogueBuffScNotify setMazeBuffInfo(final RogueBuffOuterClass.RogueBuff value) {
bitField0_ |= 0x00000002;
mazeBuffInfo.copyFrom(value);
return this;
}
@Override
public AddRogueBuffScNotify copyFrom(final AddRogueBuffScNotify other) {
cachedSize = other.cachedSize;
if ((bitField0_ | other.bitField0_) != 0) {
bitField0_ = other.bitField0_;
source = other.source;
mazeBuffInfo.copyFrom(other.mazeBuffInfo);
}
return this;
}
@Override
public AddRogueBuffScNotify mergeFrom(final AddRogueBuffScNotify other) {
if (other.isEmpty()) {
return this;
}
cachedSize = -1;
if (other.hasSource()) {
setSourceValue(other.source);
}
if (other.hasMazeBuffInfo()) {
getMutableMazeBuffInfo().mergeFrom(other.mazeBuffInfo);
}
return this;
}
@Override
public AddRogueBuffScNotify clear() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
source = 0;
mazeBuffInfo.clear();
return this;
}
@Override
public AddRogueBuffScNotify clearQuick() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
mazeBuffInfo.clearQuick();
return this;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof AddRogueBuffScNotify)) {
return false;
}
AddRogueBuffScNotify other = (AddRogueBuffScNotify) o;
return bitField0_ == other.bitField0_
&& (!hasSource() || source == other.source)
&& (!hasMazeBuffInfo() || mazeBuffInfo.equals(other.mazeBuffInfo));
}
@Override
public void writeTo(final ProtoSink output) throws IOException {
if ((bitField0_ & 0x00000001) != 0) {
output.writeRawByte((byte) 120);
output.writeEnumNoTag(source);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeRawByte((byte) 90);
output.writeMessageNoTag(mazeBuffInfo);
}
}
@Override
protected int computeSerializedSize() {
int size = 0;
if ((bitField0_ & 0x00000001) != 0) {
size += 1 + ProtoSink.computeEnumSizeNoTag(source);
}
if ((bitField0_ & 0x00000002) != 0) {
size += 1 + ProtoSink.computeMessageSizeNoTag(mazeBuffInfo);
}
return size;
}
@Override
@SuppressWarnings("fallthrough")
public AddRogueBuffScNotify mergeFrom(final ProtoSource input) throws IOException {
// Enabled Fall-Through Optimization (QuickBuffers)
int tag = input.readTag();
while (true) {
switch (tag) {
case 120: {
// source
final int value = input.readInt32();
if (RogueBuffSourceOuterClass.RogueBuffSource.forNumber(value) != null) {
source = value;
bitField0_ |= 0x00000001;
}
tag = input.readTag();
if (tag != 90) {
break;
}
}
case 90: {
// mazeBuffInfo
input.readMessage(mazeBuffInfo);
bitField0_ |= 0x00000002;
tag = input.readTag();
if (tag != 0) {
break;
}
}
case 0: {
return this;
}
default: {
if (!input.skipField(tag)) {
return this;
}
tag = input.readTag();
break;
}
}
}
}
@Override
public void writeTo(final JsonSink output) throws IOException {
output.beginObject();
if ((bitField0_ & 0x00000001) != 0) {
output.writeEnum(FieldNames.source, source, RogueBuffSourceOuterClass.RogueBuffSource.converter());
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeMessage(FieldNames.mazeBuffInfo, mazeBuffInfo);
}
output.endObject();
}
@Override
public AddRogueBuffScNotify mergeFrom(final JsonSource input) throws IOException {
if (!input.beginObject()) {
return this;
}
while (!input.isAtEnd()) {
switch (input.readFieldHash()) {
case -896505829: {
if (input.isAtField(FieldNames.source)) {
if (!input.trySkipNullValue()) {
final RogueBuffSourceOuterClass.RogueBuffSource value = input.readEnum(RogueBuffSourceOuterClass.RogueBuffSource.converter());
if (value != null) {
source = value.getNumber();
bitField0_ |= 0x00000001;
} else {
input.skipUnknownEnumValue();
}
}
} else {
input.skipUnknownField();
}
break;
}
case 1147143296:
case -1635080038: {
if (input.isAtField(FieldNames.mazeBuffInfo)) {
if (!input.trySkipNullValue()) {
input.readMessage(mazeBuffInfo);
bitField0_ |= 0x00000002;
}
} else {
input.skipUnknownField();
}
break;
}
default: {
input.skipUnknownField();
break;
}
}
}
input.endObject();
return this;
}
@Override
public AddRogueBuffScNotify clone() {
return new AddRogueBuffScNotify().copyFrom(this);
}
@Override
public boolean isEmpty() {
return ((bitField0_) == 0);
}
public static AddRogueBuffScNotify parseFrom(final byte[] data) throws
InvalidProtocolBufferException {
return ProtoMessage.mergeFrom(new AddRogueBuffScNotify(), data).checkInitialized();
}
public static AddRogueBuffScNotify parseFrom(final ProtoSource input) throws IOException {
return ProtoMessage.mergeFrom(new AddRogueBuffScNotify(), input).checkInitialized();
}
public static AddRogueBuffScNotify parseFrom(final JsonSource input) throws IOException {
return ProtoMessage.mergeFrom(new AddRogueBuffScNotify(), input).checkInitialized();
}
/**
* @return factory for creating AddRogueBuffScNotify messages
*/
public static MessageFactory<AddRogueBuffScNotify> getFactory() {
return AddRogueBuffScNotifyFactory.INSTANCE;
}
private enum AddRogueBuffScNotifyFactory implements MessageFactory<AddRogueBuffScNotify> {
INSTANCE;
@Override
public AddRogueBuffScNotify create() {
return AddRogueBuffScNotify.newInstance();
}
}
/**
* Contains name constants used for serializing JSON
*/
static class FieldNames {
static final FieldName source = FieldName.forField("source");
static final FieldName mazeBuffInfo = FieldName.forField("mazeBuffInfo", "maze_buff_info");
}
}
}

View File

@@ -0,0 +1,396 @@
// 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.RepeatedMessage;
public final class RogueBuffInfoOuterClass {
/**
* Protobuf type {@code RogueBuffInfo}
*/
public static final class RogueBuffInfo extends ProtoMessage<RogueBuffInfo> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional .RogueBuffSelectInfo buff_select_info = 5;</code>
*/
private final RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo buffSelectInfo = RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo.newInstance();
/**
* <code>repeated .RogueBuff maze_buff_list = 11;</code>
*/
private final RepeatedMessage<RogueBuffOuterClass.RogueBuff> mazeBuffList = RepeatedMessage.newEmptyInstance(RogueBuffOuterClass.RogueBuff.getFactory());
private RogueBuffInfo() {
}
/**
* @return a new empty instance of {@code RogueBuffInfo}
*/
public static RogueBuffInfo newInstance() {
return new RogueBuffInfo();
}
/**
* <code>optional .RogueBuffSelectInfo buff_select_info = 5;</code>
* @return whether the buffSelectInfo field is set
*/
public boolean hasBuffSelectInfo() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional .RogueBuffSelectInfo buff_select_info = 5;</code>
* @return this
*/
public RogueBuffInfo clearBuffSelectInfo() {
bitField0_ &= ~0x00000001;
buffSelectInfo.clear();
return this;
}
/**
* <code>optional .RogueBuffSelectInfo buff_select_info = 5;</code>
*
* 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 #getMutableBuffSelectInfo()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo getBuffSelectInfo() {
return buffSelectInfo;
}
/**
* <code>optional .RogueBuffSelectInfo buff_select_info = 5;</code>
*
* 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 RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo getMutableBuffSelectInfo() {
bitField0_ |= 0x00000001;
return buffSelectInfo;
}
/**
* <code>optional .RogueBuffSelectInfo buff_select_info = 5;</code>
* @param value the buffSelectInfo to set
* @return this
*/
public RogueBuffInfo setBuffSelectInfo(
final RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo value) {
bitField0_ |= 0x00000001;
buffSelectInfo.copyFrom(value);
return this;
}
/**
* <code>repeated .RogueBuff maze_buff_list = 11;</code>
* @return whether the mazeBuffList field is set
*/
public boolean hasMazeBuffList() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>repeated .RogueBuff maze_buff_list = 11;</code>
* @return this
*/
public RogueBuffInfo clearMazeBuffList() {
bitField0_ &= ~0x00000002;
mazeBuffList.clear();
return this;
}
/**
* <code>repeated .RogueBuff maze_buff_list = 11;</code>
*
* 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 #getMutableMazeBuffList()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RepeatedMessage<RogueBuffOuterClass.RogueBuff> getMazeBuffList() {
return mazeBuffList;
}
/**
* <code>repeated .RogueBuff maze_buff_list = 11;</code>
*
* 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 RepeatedMessage<RogueBuffOuterClass.RogueBuff> getMutableMazeBuffList() {
bitField0_ |= 0x00000002;
return mazeBuffList;
}
/**
* <code>repeated .RogueBuff maze_buff_list = 11;</code>
* @param value the mazeBuffList to add
* @return this
*/
public RogueBuffInfo addMazeBuffList(final RogueBuffOuterClass.RogueBuff value) {
bitField0_ |= 0x00000002;
mazeBuffList.add(value);
return this;
}
/**
* <code>repeated .RogueBuff maze_buff_list = 11;</code>
* @param values the mazeBuffList to add
* @return this
*/
public RogueBuffInfo addAllMazeBuffList(final RogueBuffOuterClass.RogueBuff... values) {
bitField0_ |= 0x00000002;
mazeBuffList.addAll(values);
return this;
}
@Override
public RogueBuffInfo copyFrom(final RogueBuffInfo other) {
cachedSize = other.cachedSize;
if ((bitField0_ | other.bitField0_) != 0) {
bitField0_ = other.bitField0_;
buffSelectInfo.copyFrom(other.buffSelectInfo);
mazeBuffList.copyFrom(other.mazeBuffList);
}
return this;
}
@Override
public RogueBuffInfo mergeFrom(final RogueBuffInfo other) {
if (other.isEmpty()) {
return this;
}
cachedSize = -1;
if (other.hasBuffSelectInfo()) {
getMutableBuffSelectInfo().mergeFrom(other.buffSelectInfo);
}
if (other.hasMazeBuffList()) {
getMutableMazeBuffList().addAll(other.mazeBuffList);
}
return this;
}
@Override
public RogueBuffInfo clear() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
buffSelectInfo.clear();
mazeBuffList.clear();
return this;
}
@Override
public RogueBuffInfo clearQuick() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
buffSelectInfo.clearQuick();
mazeBuffList.clearQuick();
return this;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof RogueBuffInfo)) {
return false;
}
RogueBuffInfo other = (RogueBuffInfo) o;
return bitField0_ == other.bitField0_
&& (!hasBuffSelectInfo() || buffSelectInfo.equals(other.buffSelectInfo))
&& (!hasMazeBuffList() || mazeBuffList.equals(other.mazeBuffList));
}
@Override
public void writeTo(final ProtoSink output) throws IOException {
if ((bitField0_ & 0x00000001) != 0) {
output.writeRawByte((byte) 42);
output.writeMessageNoTag(buffSelectInfo);
}
if ((bitField0_ & 0x00000002) != 0) {
for (int i = 0; i < mazeBuffList.length(); i++) {
output.writeRawByte((byte) 90);
output.writeMessageNoTag(mazeBuffList.get(i));
}
}
}
@Override
protected int computeSerializedSize() {
int size = 0;
if ((bitField0_ & 0x00000001) != 0) {
size += 1 + ProtoSink.computeMessageSizeNoTag(buffSelectInfo);
}
if ((bitField0_ & 0x00000002) != 0) {
size += (1 * mazeBuffList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(mazeBuffList);
}
return size;
}
@Override
@SuppressWarnings("fallthrough")
public RogueBuffInfo mergeFrom(final ProtoSource input) throws IOException {
// Enabled Fall-Through Optimization (QuickBuffers)
int tag = input.readTag();
while (true) {
switch (tag) {
case 42: {
// buffSelectInfo
input.readMessage(buffSelectInfo);
bitField0_ |= 0x00000001;
tag = input.readTag();
if (tag != 90) {
break;
}
}
case 90: {
// mazeBuffList
tag = input.readRepeatedMessage(mazeBuffList, tag);
bitField0_ |= 0x00000002;
if (tag != 0) {
break;
}
}
case 0: {
return this;
}
default: {
if (!input.skipField(tag)) {
return this;
}
tag = input.readTag();
break;
}
}
}
}
@Override
public void writeTo(final JsonSink output) throws IOException {
output.beginObject();
if ((bitField0_ & 0x00000001) != 0) {
output.writeMessage(FieldNames.buffSelectInfo, buffSelectInfo);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeRepeatedMessage(FieldNames.mazeBuffList, mazeBuffList);
}
output.endObject();
}
@Override
public RogueBuffInfo mergeFrom(final JsonSource input) throws IOException {
if (!input.beginObject()) {
return this;
}
while (!input.isAtEnd()) {
switch (input.readFieldHash()) {
case -255242115:
case 1500540965: {
if (input.isAtField(FieldNames.buffSelectInfo)) {
if (!input.trySkipNullValue()) {
input.readMessage(buffSelectInfo);
bitField0_ |= 0x00000001;
}
} else {
input.skipUnknownField();
}
break;
}
case 1147228272:
case -1634995062: {
if (input.isAtField(FieldNames.mazeBuffList)) {
if (!input.trySkipNullValue()) {
input.readRepeatedMessage(mazeBuffList);
bitField0_ |= 0x00000002;
}
} else {
input.skipUnknownField();
}
break;
}
default: {
input.skipUnknownField();
break;
}
}
}
input.endObject();
return this;
}
@Override
public RogueBuffInfo clone() {
return new RogueBuffInfo().copyFrom(this);
}
@Override
public boolean isEmpty() {
return ((bitField0_) == 0);
}
public static RogueBuffInfo parseFrom(final byte[] data) throws InvalidProtocolBufferException {
return ProtoMessage.mergeFrom(new RogueBuffInfo(), data).checkInitialized();
}
public static RogueBuffInfo parseFrom(final ProtoSource input) throws IOException {
return ProtoMessage.mergeFrom(new RogueBuffInfo(), input).checkInitialized();
}
public static RogueBuffInfo parseFrom(final JsonSource input) throws IOException {
return ProtoMessage.mergeFrom(new RogueBuffInfo(), input).checkInitialized();
}
/**
* @return factory for creating RogueBuffInfo messages
*/
public static MessageFactory<RogueBuffInfo> getFactory() {
return RogueBuffInfoFactory.INSTANCE;
}
private enum RogueBuffInfoFactory implements MessageFactory<RogueBuffInfo> {
INSTANCE;
@Override
public RogueBuffInfo create() {
return RogueBuffInfo.newInstance();
}
}
/**
* Contains name constants used for serializing JSON
*/
static class FieldNames {
static final FieldName buffSelectInfo = FieldName.forField("buffSelectInfo", "buff_select_info");
static final FieldName mazeBuffList = FieldName.forField("mazeBuffList", "maze_buff_list");
}
}
}

View File

@@ -0,0 +1,339 @@
// 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;
public final class RogueBuffOuterClass {
/**
* Protobuf type {@code RogueBuff}
*/
public static final class RogueBuff extends ProtoMessage<RogueBuff> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional uint32 buff_id = 8;</code>
*/
private int buffId;
/**
* <code>optional uint32 level = 13;</code>
*/
private int level;
private RogueBuff() {
}
/**
* @return a new empty instance of {@code RogueBuff}
*/
public static RogueBuff newInstance() {
return new RogueBuff();
}
/**
* <code>optional uint32 buff_id = 8;</code>
* @return whether the buffId field is set
*/
public boolean hasBuffId() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional uint32 buff_id = 8;</code>
* @return this
*/
public RogueBuff clearBuffId() {
bitField0_ &= ~0x00000001;
buffId = 0;
return this;
}
/**
* <code>optional uint32 buff_id = 8;</code>
* @return the buffId
*/
public int getBuffId() {
return buffId;
}
/**
* <code>optional uint32 buff_id = 8;</code>
* @param value the buffId to set
* @return this
*/
public RogueBuff setBuffId(final int value) {
bitField0_ |= 0x00000001;
buffId = value;
return this;
}
/**
* <code>optional uint32 level = 13;</code>
* @return whether the level field is set
*/
public boolean hasLevel() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>optional uint32 level = 13;</code>
* @return this
*/
public RogueBuff clearLevel() {
bitField0_ &= ~0x00000002;
level = 0;
return this;
}
/**
* <code>optional uint32 level = 13;</code>
* @return the level
*/
public int getLevel() {
return level;
}
/**
* <code>optional uint32 level = 13;</code>
* @param value the level to set
* @return this
*/
public RogueBuff setLevel(final int value) {
bitField0_ |= 0x00000002;
level = value;
return this;
}
@Override
public RogueBuff copyFrom(final RogueBuff other) {
cachedSize = other.cachedSize;
if ((bitField0_ | other.bitField0_) != 0) {
bitField0_ = other.bitField0_;
buffId = other.buffId;
level = other.level;
}
return this;
}
@Override
public RogueBuff mergeFrom(final RogueBuff other) {
if (other.isEmpty()) {
return this;
}
cachedSize = -1;
if (other.hasBuffId()) {
setBuffId(other.buffId);
}
if (other.hasLevel()) {
setLevel(other.level);
}
return this;
}
@Override
public RogueBuff clear() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
buffId = 0;
level = 0;
return this;
}
@Override
public RogueBuff clearQuick() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
return this;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof RogueBuff)) {
return false;
}
RogueBuff other = (RogueBuff) o;
return bitField0_ == other.bitField0_
&& (!hasBuffId() || buffId == other.buffId)
&& (!hasLevel() || level == other.level);
}
@Override
public void writeTo(final ProtoSink output) throws IOException {
if ((bitField0_ & 0x00000001) != 0) {
output.writeRawByte((byte) 64);
output.writeUInt32NoTag(buffId);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeRawByte((byte) 104);
output.writeUInt32NoTag(level);
}
}
@Override
protected int computeSerializedSize() {
int size = 0;
if ((bitField0_ & 0x00000001) != 0) {
size += 1 + ProtoSink.computeUInt32SizeNoTag(buffId);
}
if ((bitField0_ & 0x00000002) != 0) {
size += 1 + ProtoSink.computeUInt32SizeNoTag(level);
}
return size;
}
@Override
@SuppressWarnings("fallthrough")
public RogueBuff mergeFrom(final ProtoSource input) throws IOException {
// Enabled Fall-Through Optimization (QuickBuffers)
int tag = input.readTag();
while (true) {
switch (tag) {
case 64: {
// buffId
buffId = input.readUInt32();
bitField0_ |= 0x00000001;
tag = input.readTag();
if (tag != 104) {
break;
}
}
case 104: {
// level
level = input.readUInt32();
bitField0_ |= 0x00000002;
tag = input.readTag();
if (tag != 0) {
break;
}
}
case 0: {
return this;
}
default: {
if (!input.skipField(tag)) {
return this;
}
tag = input.readTag();
break;
}
}
}
}
@Override
public void writeTo(final JsonSink output) throws IOException {
output.beginObject();
if ((bitField0_ & 0x00000001) != 0) {
output.writeUInt32(FieldNames.buffId, buffId);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeUInt32(FieldNames.level, level);
}
output.endObject();
}
@Override
public RogueBuff mergeFrom(final JsonSource input) throws IOException {
if (!input.beginObject()) {
return this;
}
while (!input.isAtEnd()) {
switch (input.readFieldHash()) {
case -1378119474:
case 227990663: {
if (input.isAtField(FieldNames.buffId)) {
if (!input.trySkipNullValue()) {
buffId = input.readUInt32();
bitField0_ |= 0x00000001;
}
} else {
input.skipUnknownField();
}
break;
}
case 102865796: {
if (input.isAtField(FieldNames.level)) {
if (!input.trySkipNullValue()) {
level = input.readUInt32();
bitField0_ |= 0x00000002;
}
} else {
input.skipUnknownField();
}
break;
}
default: {
input.skipUnknownField();
break;
}
}
}
input.endObject();
return this;
}
@Override
public RogueBuff clone() {
return new RogueBuff().copyFrom(this);
}
@Override
public boolean isEmpty() {
return ((bitField0_) == 0);
}
public static RogueBuff parseFrom(final byte[] data) throws InvalidProtocolBufferException {
return ProtoMessage.mergeFrom(new RogueBuff(), data).checkInitialized();
}
public static RogueBuff parseFrom(final ProtoSource input) throws IOException {
return ProtoMessage.mergeFrom(new RogueBuff(), input).checkInitialized();
}
public static RogueBuff parseFrom(final JsonSource input) throws IOException {
return ProtoMessage.mergeFrom(new RogueBuff(), input).checkInitialized();
}
/**
* @return factory for creating RogueBuff messages
*/
public static MessageFactory<RogueBuff> getFactory() {
return RogueBuffFactory.INSTANCE;
}
private enum RogueBuffFactory implements MessageFactory<RogueBuff> {
INSTANCE;
@Override
public RogueBuff create() {
return RogueBuff.newInstance();
}
}
/**
* Contains name constants used for serializing JSON
*/
static class FieldNames {
static final FieldName buffId = FieldName.forField("buffId", "buff_id");
static final FieldName level = FieldName.forField("level");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,250 @@
// Code generated by protocol buffer compiler. Do not edit!
package emu.lunarcore.proto;
import us.hebi.quickbuf.ProtoEnum;
import us.hebi.quickbuf.ProtoUtil;
public final class RogueBuffSourceOuterClass {
/**
* Protobuf enum {@code RogueBuffSource}
*/
public enum RogueBuffSource implements ProtoEnum<RogueBuffSource> {
/**
* <code>ROGUE_BUFF_SOURCE_TYPE_NONE = 0;</code>
*/
ROGUE_BUFF_SOURCE_TYPE_NONE("ROGUE_BUFF_SOURCE_TYPE_NONE", 0),
/**
* <code>ROGUE_BUFF_SOURCE_TYPE_SELECT = 1;</code>
*/
ROGUE_BUFF_SOURCE_TYPE_SELECT("ROGUE_BUFF_SOURCE_TYPE_SELECT", 1),
/**
* <code>ROGUE_BUFF_SOURCE_TYPE_ENHANCE = 2;</code>
*/
ROGUE_BUFF_SOURCE_TYPE_ENHANCE("ROGUE_BUFF_SOURCE_TYPE_ENHANCE", 2),
/**
* <code>ROGUE_BUFF_SOURCE_TYPE_MIRACLE = 3;</code>
*/
ROGUE_BUFF_SOURCE_TYPE_MIRACLE("ROGUE_BUFF_SOURCE_TYPE_MIRACLE", 3),
/**
* <code>ROGUE_BUFF_SOURCE_TYPE_DIALOGUE = 4;</code>
*/
ROGUE_BUFF_SOURCE_TYPE_DIALOGUE("ROGUE_BUFF_SOURCE_TYPE_DIALOGUE", 4),
/**
* <code>ROGUE_BUFF_SOURCE_TYPE_BONUS = 5;</code>
*/
ROGUE_BUFF_SOURCE_TYPE_BONUS("ROGUE_BUFF_SOURCE_TYPE_BONUS", 5),
/**
* <code>ROGUE_BUFF_SOURCE_TYPE_MAZE_SKILL = 6;</code>
*/
ROGUE_BUFF_SOURCE_TYPE_MAZE_SKILL("ROGUE_BUFF_SOURCE_TYPE_MAZE_SKILL", 6),
/**
* <code>ROGUE_BUFF_SOURCE_TYPE_SHOP = 7;</code>
*/
ROGUE_BUFF_SOURCE_TYPE_SHOP("ROGUE_BUFF_SOURCE_TYPE_SHOP", 7),
/**
* <code>ROGUE_BUFF_SOURCE_TYPE_LEVEL_MECHANISM = 8;</code>
*/
ROGUE_BUFF_SOURCE_TYPE_LEVEL_MECHANISM("ROGUE_BUFF_SOURCE_TYPE_LEVEL_MECHANISM", 8),
/**
* <code>ROGUE_BUFF_SOURCE_TYPE_ENDLESS_LEVEL_START = 9;</code>
*/
ROGUE_BUFF_SOURCE_TYPE_ENDLESS_LEVEL_START("ROGUE_BUFF_SOURCE_TYPE_ENDLESS_LEVEL_START", 9);
/**
* <code>ROGUE_BUFF_SOURCE_TYPE_NONE = 0;</code>
*/
public static final int ROGUE_BUFF_SOURCE_TYPE_NONE_VALUE = 0;
/**
* <code>ROGUE_BUFF_SOURCE_TYPE_SELECT = 1;</code>
*/
public static final int ROGUE_BUFF_SOURCE_TYPE_SELECT_VALUE = 1;
/**
* <code>ROGUE_BUFF_SOURCE_TYPE_ENHANCE = 2;</code>
*/
public static final int ROGUE_BUFF_SOURCE_TYPE_ENHANCE_VALUE = 2;
/**
* <code>ROGUE_BUFF_SOURCE_TYPE_MIRACLE = 3;</code>
*/
public static final int ROGUE_BUFF_SOURCE_TYPE_MIRACLE_VALUE = 3;
/**
* <code>ROGUE_BUFF_SOURCE_TYPE_DIALOGUE = 4;</code>
*/
public static final int ROGUE_BUFF_SOURCE_TYPE_DIALOGUE_VALUE = 4;
/**
* <code>ROGUE_BUFF_SOURCE_TYPE_BONUS = 5;</code>
*/
public static final int ROGUE_BUFF_SOURCE_TYPE_BONUS_VALUE = 5;
/**
* <code>ROGUE_BUFF_SOURCE_TYPE_MAZE_SKILL = 6;</code>
*/
public static final int ROGUE_BUFF_SOURCE_TYPE_MAZE_SKILL_VALUE = 6;
/**
* <code>ROGUE_BUFF_SOURCE_TYPE_SHOP = 7;</code>
*/
public static final int ROGUE_BUFF_SOURCE_TYPE_SHOP_VALUE = 7;
/**
* <code>ROGUE_BUFF_SOURCE_TYPE_LEVEL_MECHANISM = 8;</code>
*/
public static final int ROGUE_BUFF_SOURCE_TYPE_LEVEL_MECHANISM_VALUE = 8;
/**
* <code>ROGUE_BUFF_SOURCE_TYPE_ENDLESS_LEVEL_START = 9;</code>
*/
public static final int ROGUE_BUFF_SOURCE_TYPE_ENDLESS_LEVEL_START_VALUE = 9;
private final String name;
private final int number;
private RogueBuffSource(String name, int number) {
this.name = name;
this.number = number;
}
/**
* @return the string representation of enum entry
*/
@Override
public String getName() {
return name;
}
/**
* @return the numeric wire value of this enum entry
*/
@Override
public int getNumber() {
return number;
}
/**
* @return a converter that maps between this enum's numeric and text representations
*/
public static ProtoEnum.EnumConverter<RogueBuffSource> converter() {
return RogueBuffSourceConverter.INSTANCE;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value, or null if unknown.
*/
public static RogueBuffSource forNumber(int value) {
return RogueBuffSourceConverter.INSTANCE.forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @param other Fallback value in case the value is not known.
* @return The enum associated with the given numeric wire value, or the fallback value if unknown.
*/
public static RogueBuffSource forNumberOr(int number, RogueBuffSource other) {
RogueBuffSource value = forNumber(number);
return value == null ? other : value;
}
enum RogueBuffSourceConverter implements ProtoEnum.EnumConverter<RogueBuffSource> {
INSTANCE;
private static final RogueBuffSource[] lookup = new RogueBuffSource[10];
static {
lookup[0] = ROGUE_BUFF_SOURCE_TYPE_NONE;
lookup[1] = ROGUE_BUFF_SOURCE_TYPE_SELECT;
lookup[2] = ROGUE_BUFF_SOURCE_TYPE_ENHANCE;
lookup[3] = ROGUE_BUFF_SOURCE_TYPE_MIRACLE;
lookup[4] = ROGUE_BUFF_SOURCE_TYPE_DIALOGUE;
lookup[5] = ROGUE_BUFF_SOURCE_TYPE_BONUS;
lookup[6] = ROGUE_BUFF_SOURCE_TYPE_MAZE_SKILL;
lookup[7] = ROGUE_BUFF_SOURCE_TYPE_SHOP;
lookup[8] = ROGUE_BUFF_SOURCE_TYPE_LEVEL_MECHANISM;
lookup[9] = ROGUE_BUFF_SOURCE_TYPE_ENDLESS_LEVEL_START;
}
@Override
public final RogueBuffSource forNumber(final int value) {
if (value >= 0 && value < lookup.length) {
return lookup[value];
}
return null;
}
@Override
public final RogueBuffSource forName(final CharSequence value) {
switch (value.length()) {
case 27: {
if (ProtoUtil.isEqual("ROGUE_BUFF_SOURCE_TYPE_NONE", value)) {
return ROGUE_BUFF_SOURCE_TYPE_NONE;
}
if (ProtoUtil.isEqual("ROGUE_BUFF_SOURCE_TYPE_SHOP", value)) {
return ROGUE_BUFF_SOURCE_TYPE_SHOP;
}
break;
}
case 28: {
if (ProtoUtil.isEqual("ROGUE_BUFF_SOURCE_TYPE_BONUS", value)) {
return ROGUE_BUFF_SOURCE_TYPE_BONUS;
}
break;
}
case 29: {
if (ProtoUtil.isEqual("ROGUE_BUFF_SOURCE_TYPE_SELECT", value)) {
return ROGUE_BUFF_SOURCE_TYPE_SELECT;
}
break;
}
case 30: {
if (ProtoUtil.isEqual("ROGUE_BUFF_SOURCE_TYPE_ENHANCE", value)) {
return ROGUE_BUFF_SOURCE_TYPE_ENHANCE;
}
if (ProtoUtil.isEqual("ROGUE_BUFF_SOURCE_TYPE_MIRACLE", value)) {
return ROGUE_BUFF_SOURCE_TYPE_MIRACLE;
}
break;
}
case 31: {
if (ProtoUtil.isEqual("ROGUE_BUFF_SOURCE_TYPE_DIALOGUE", value)) {
return ROGUE_BUFF_SOURCE_TYPE_DIALOGUE;
}
break;
}
case 33: {
if (ProtoUtil.isEqual("ROGUE_BUFF_SOURCE_TYPE_MAZE_SKILL", value)) {
return ROGUE_BUFF_SOURCE_TYPE_MAZE_SKILL;
}
break;
}
case 38: {
if (ProtoUtil.isEqual("ROGUE_BUFF_SOURCE_TYPE_LEVEL_MECHANISM", value)) {
return ROGUE_BUFF_SOURCE_TYPE_LEVEL_MECHANISM;
}
break;
}
case 42: {
if (ProtoUtil.isEqual("ROGUE_BUFF_SOURCE_TYPE_ENDLESS_LEVEL_START", value)) {
return ROGUE_BUFF_SOURCE_TYPE_ENDLESS_LEVEL_START;
}
break;
}
}
return null;
}
}
}
}

View File

@@ -0,0 +1,169 @@
// Code generated by protocol buffer compiler. Do not edit!
package emu.lunarcore.proto;
import us.hebi.quickbuf.ProtoEnum;
import us.hebi.quickbuf.ProtoUtil;
public final class RogueCommonBuffSelectSourceOuterClass {
/**
* Protobuf enum {@code RogueCommonBuffSelectSource}
*/
public enum RogueCommonBuffSelectSource implements ProtoEnum<RogueCommonBuffSelectSource> {
/**
* <code>ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_NONE = 0;</code>
*/
ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_NONE("ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_NONE", 0),
/**
* <code>ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_DICE_ROLL = 1;</code>
*/
ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_DICE_ROLL("ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_DICE_ROLL", 1),
/**
* <code>ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_AEON = 2;</code>
*/
ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_AEON("ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_AEON", 2),
/**
* <code>ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_BOARD_EVENT = 3;</code>
*/
ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_BOARD_EVENT("ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_BOARD_EVENT", 3),
/**
* <code>ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_LEVEL_MECHANISM = 4;</code>
*/
ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_LEVEL_MECHANISM("ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_LEVEL_MECHANISM", 4);
/**
* <code>ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_NONE = 0;</code>
*/
public static final int ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_NONE_VALUE = 0;
/**
* <code>ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_DICE_ROLL = 1;</code>
*/
public static final int ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_DICE_ROLL_VALUE = 1;
/**
* <code>ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_AEON = 2;</code>
*/
public static final int ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_AEON_VALUE = 2;
/**
* <code>ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_BOARD_EVENT = 3;</code>
*/
public static final int ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_BOARD_EVENT_VALUE = 3;
/**
* <code>ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_LEVEL_MECHANISM = 4;</code>
*/
public static final int ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_LEVEL_MECHANISM_VALUE = 4;
private final String name;
private final int number;
private RogueCommonBuffSelectSource(String name, int number) {
this.name = name;
this.number = number;
}
/**
* @return the string representation of enum entry
*/
@Override
public String getName() {
return name;
}
/**
* @return the numeric wire value of this enum entry
*/
@Override
public int getNumber() {
return number;
}
/**
* @return a converter that maps between this enum's numeric and text representations
*/
public static ProtoEnum.EnumConverter<RogueCommonBuffSelectSource> converter() {
return RogueCommonBuffSelectSourceConverter.INSTANCE;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value, or null if unknown.
*/
public static RogueCommonBuffSelectSource forNumber(int value) {
return RogueCommonBuffSelectSourceConverter.INSTANCE.forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @param other Fallback value in case the value is not known.
* @return The enum associated with the given numeric wire value, or the fallback value if unknown.
*/
public static RogueCommonBuffSelectSource forNumberOr(int number,
RogueCommonBuffSelectSource other) {
RogueCommonBuffSelectSource value = forNumber(number);
return value == null ? other : value;
}
enum RogueCommonBuffSelectSourceConverter implements ProtoEnum.EnumConverter<RogueCommonBuffSelectSource> {
INSTANCE;
private static final RogueCommonBuffSelectSource[] lookup = new RogueCommonBuffSelectSource[5];
static {
lookup[0] = ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_NONE;
lookup[1] = ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_DICE_ROLL;
lookup[2] = ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_AEON;
lookup[3] = ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_BOARD_EVENT;
lookup[4] = ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_LEVEL_MECHANISM;
}
@Override
public final RogueCommonBuffSelectSource forNumber(final int value) {
if (value >= 0 && value < lookup.length) {
return lookup[value];
}
return null;
}
@Override
public final RogueCommonBuffSelectSource forName(final CharSequence value) {
switch (value.length()) {
case 41: {
if (ProtoUtil.isEqual("ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_NONE", value)) {
return ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_NONE;
}
if (ProtoUtil.isEqual("ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_AEON", value)) {
return ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_AEON;
}
break;
}
case 46: {
if (ProtoUtil.isEqual("ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_DICE_ROLL", value)) {
return ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_DICE_ROLL;
}
break;
}
case 48: {
if (ProtoUtil.isEqual("ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_BOARD_EVENT", value)) {
return ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_BOARD_EVENT;
}
break;
}
case 52: {
if (ProtoUtil.isEqual("ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_LEVEL_MECHANISM", value)) {
return ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_LEVEL_MECHANISM;
}
break;
}
}
return null;
}
}
}
}

View File

@@ -28,6 +28,11 @@ public final class RogueCurrentInfoOuterClass {
*/
private final RogueMapInfoOuterClass.RogueMapInfo roomMap = RogueMapInfoOuterClass.RogueMapInfo.newInstance();
/**
* <code>optional .RogueBuffInfo rogue_buff_info = 14;</code>
*/
private final RogueBuffInfoOuterClass.RogueBuffInfo rogueBuffInfo = RogueBuffInfoOuterClass.RogueBuffInfo.newInstance();
private RogueCurrentInfo() {
}
@@ -157,6 +162,63 @@ public final class RogueCurrentInfoOuterClass {
return this;
}
/**
* <code>optional .RogueBuffInfo rogue_buff_info = 14;</code>
* @return whether the rogueBuffInfo field is set
*/
public boolean hasRogueBuffInfo() {
return (bitField0_ & 0x00000004) != 0;
}
/**
* <code>optional .RogueBuffInfo rogue_buff_info = 14;</code>
* @return this
*/
public RogueCurrentInfo clearRogueBuffInfo() {
bitField0_ &= ~0x00000004;
rogueBuffInfo.clear();
return this;
}
/**
* <code>optional .RogueBuffInfo rogue_buff_info = 14;</code>
*
* 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 #getMutableRogueBuffInfo()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RogueBuffInfoOuterClass.RogueBuffInfo getRogueBuffInfo() {
return rogueBuffInfo;
}
/**
* <code>optional .RogueBuffInfo rogue_buff_info = 14;</code>
*
* 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 RogueBuffInfoOuterClass.RogueBuffInfo getMutableRogueBuffInfo() {
bitField0_ |= 0x00000004;
return rogueBuffInfo;
}
/**
* <code>optional .RogueBuffInfo rogue_buff_info = 14;</code>
* @param value the rogueBuffInfo to set
* @return this
*/
public RogueCurrentInfo setRogueBuffInfo(final RogueBuffInfoOuterClass.RogueBuffInfo value) {
bitField0_ |= 0x00000004;
rogueBuffInfo.copyFrom(value);
return this;
}
@Override
public RogueCurrentInfo copyFrom(final RogueCurrentInfo other) {
cachedSize = other.cachedSize;
@@ -164,6 +226,7 @@ public final class RogueCurrentInfoOuterClass {
bitField0_ = other.bitField0_;
status = other.status;
roomMap.copyFrom(other.roomMap);
rogueBuffInfo.copyFrom(other.rogueBuffInfo);
}
return this;
}
@@ -180,6 +243,9 @@ public final class RogueCurrentInfoOuterClass {
if (other.hasRoomMap()) {
getMutableRoomMap().mergeFrom(other.roomMap);
}
if (other.hasRogueBuffInfo()) {
getMutableRogueBuffInfo().mergeFrom(other.rogueBuffInfo);
}
return this;
}
@@ -192,6 +258,7 @@ public final class RogueCurrentInfoOuterClass {
bitField0_ = 0;
status = 0;
roomMap.clear();
rogueBuffInfo.clear();
return this;
}
@@ -203,6 +270,7 @@ public final class RogueCurrentInfoOuterClass {
cachedSize = -1;
bitField0_ = 0;
roomMap.clearQuick();
rogueBuffInfo.clearQuick();
return this;
}
@@ -217,7 +285,8 @@ public final class RogueCurrentInfoOuterClass {
RogueCurrentInfo other = (RogueCurrentInfo) o;
return bitField0_ == other.bitField0_
&& (!hasStatus() || status == other.status)
&& (!hasRoomMap() || roomMap.equals(other.roomMap));
&& (!hasRoomMap() || roomMap.equals(other.roomMap))
&& (!hasRogueBuffInfo() || rogueBuffInfo.equals(other.rogueBuffInfo));
}
@Override
@@ -230,6 +299,10 @@ public final class RogueCurrentInfoOuterClass {
output.writeRawByte((byte) 82);
output.writeMessageNoTag(roomMap);
}
if ((bitField0_ & 0x00000004) != 0) {
output.writeRawByte((byte) 114);
output.writeMessageNoTag(rogueBuffInfo);
}
}
@Override
@@ -241,6 +314,9 @@ public final class RogueCurrentInfoOuterClass {
if ((bitField0_ & 0x00000002) != 0) {
size += 1 + ProtoSink.computeMessageSizeNoTag(roomMap);
}
if ((bitField0_ & 0x00000004) != 0) {
size += 1 + ProtoSink.computeMessageSizeNoTag(rogueBuffInfo);
}
return size;
}
@@ -268,6 +344,15 @@ public final class RogueCurrentInfoOuterClass {
input.readMessage(roomMap);
bitField0_ |= 0x00000002;
tag = input.readTag();
if (tag != 114) {
break;
}
}
case 114: {
// rogueBuffInfo
input.readMessage(rogueBuffInfo);
bitField0_ |= 0x00000004;
tag = input.readTag();
if (tag != 0) {
break;
}
@@ -295,6 +380,9 @@ public final class RogueCurrentInfoOuterClass {
if ((bitField0_ & 0x00000002) != 0) {
output.writeMessage(FieldNames.roomMap, roomMap);
}
if ((bitField0_ & 0x00000004) != 0) {
output.writeMessage(FieldNames.rogueBuffInfo, rogueBuffInfo);
}
output.endObject();
}
@@ -333,6 +421,18 @@ public final class RogueCurrentInfoOuterClass {
}
break;
}
case 1107898267:
case -694847243: {
if (input.isAtField(FieldNames.rogueBuffInfo)) {
if (!input.trySkipNullValue()) {
input.readMessage(rogueBuffInfo);
bitField0_ |= 0x00000004;
}
} else {
input.skipUnknownField();
}
break;
}
default: {
input.skipUnknownField();
break;
@@ -389,6 +489,8 @@ public final class RogueCurrentInfoOuterClass {
static final FieldName status = FieldName.forField("status");
static final FieldName roomMap = FieldName.forField("roomMap", "room_map");
static final FieldName rogueBuffInfo = FieldName.forField("rogueBuffInfo", "rogue_buff_info");
}
}
}

View File

@@ -0,0 +1,362 @@
// 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;
public final class RollRogueBuffScRspOuterClass {
/**
* Protobuf type {@code RollRogueBuffScRsp}
*/
public static final class RollRogueBuffScRsp extends ProtoMessage<RollRogueBuffScRsp> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional uint32 retcode = 14;</code>
*/
private int retcode;
/**
* <code>optional .RogueBuffSelectInfo rogue_buff_select_info = 10;</code>
*/
private final RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo rogueBuffSelectInfo = RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo.newInstance();
private RollRogueBuffScRsp() {
}
/**
* @return a new empty instance of {@code RollRogueBuffScRsp}
*/
public static RollRogueBuffScRsp newInstance() {
return new RollRogueBuffScRsp();
}
/**
* <code>optional uint32 retcode = 14;</code>
* @return whether the retcode field is set
*/
public boolean hasRetcode() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional uint32 retcode = 14;</code>
* @return this
*/
public RollRogueBuffScRsp clearRetcode() {
bitField0_ &= ~0x00000001;
retcode = 0;
return this;
}
/**
* <code>optional uint32 retcode = 14;</code>
* @return the retcode
*/
public int getRetcode() {
return retcode;
}
/**
* <code>optional uint32 retcode = 14;</code>
* @param value the retcode to set
* @return this
*/
public RollRogueBuffScRsp setRetcode(final int value) {
bitField0_ |= 0x00000001;
retcode = value;
return this;
}
/**
* <code>optional .RogueBuffSelectInfo rogue_buff_select_info = 10;</code>
* @return whether the rogueBuffSelectInfo field is set
*/
public boolean hasRogueBuffSelectInfo() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>optional .RogueBuffSelectInfo rogue_buff_select_info = 10;</code>
* @return this
*/
public RollRogueBuffScRsp clearRogueBuffSelectInfo() {
bitField0_ &= ~0x00000002;
rogueBuffSelectInfo.clear();
return this;
}
/**
* <code>optional .RogueBuffSelectInfo rogue_buff_select_info = 10;</code>
*
* 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 #getMutableRogueBuffSelectInfo()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo getRogueBuffSelectInfo() {
return rogueBuffSelectInfo;
}
/**
* <code>optional .RogueBuffSelectInfo rogue_buff_select_info = 10;</code>
*
* 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 RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo getMutableRogueBuffSelectInfo() {
bitField0_ |= 0x00000002;
return rogueBuffSelectInfo;
}
/**
* <code>optional .RogueBuffSelectInfo rogue_buff_select_info = 10;</code>
* @param value the rogueBuffSelectInfo to set
* @return this
*/
public RollRogueBuffScRsp setRogueBuffSelectInfo(
final RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo value) {
bitField0_ |= 0x00000002;
rogueBuffSelectInfo.copyFrom(value);
return this;
}
@Override
public RollRogueBuffScRsp copyFrom(final RollRogueBuffScRsp other) {
cachedSize = other.cachedSize;
if ((bitField0_ | other.bitField0_) != 0) {
bitField0_ = other.bitField0_;
retcode = other.retcode;
rogueBuffSelectInfo.copyFrom(other.rogueBuffSelectInfo);
}
return this;
}
@Override
public RollRogueBuffScRsp mergeFrom(final RollRogueBuffScRsp other) {
if (other.isEmpty()) {
return this;
}
cachedSize = -1;
if (other.hasRetcode()) {
setRetcode(other.retcode);
}
if (other.hasRogueBuffSelectInfo()) {
getMutableRogueBuffSelectInfo().mergeFrom(other.rogueBuffSelectInfo);
}
return this;
}
@Override
public RollRogueBuffScRsp clear() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
retcode = 0;
rogueBuffSelectInfo.clear();
return this;
}
@Override
public RollRogueBuffScRsp clearQuick() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
rogueBuffSelectInfo.clearQuick();
return this;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof RollRogueBuffScRsp)) {
return false;
}
RollRogueBuffScRsp other = (RollRogueBuffScRsp) o;
return bitField0_ == other.bitField0_
&& (!hasRetcode() || retcode == other.retcode)
&& (!hasRogueBuffSelectInfo() || rogueBuffSelectInfo.equals(other.rogueBuffSelectInfo));
}
@Override
public void writeTo(final ProtoSink output) throws IOException {
if ((bitField0_ & 0x00000001) != 0) {
output.writeRawByte((byte) 112);
output.writeUInt32NoTag(retcode);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeRawByte((byte) 82);
output.writeMessageNoTag(rogueBuffSelectInfo);
}
}
@Override
protected int computeSerializedSize() {
int size = 0;
if ((bitField0_ & 0x00000001) != 0) {
size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode);
}
if ((bitField0_ & 0x00000002) != 0) {
size += 1 + ProtoSink.computeMessageSizeNoTag(rogueBuffSelectInfo);
}
return size;
}
@Override
@SuppressWarnings("fallthrough")
public RollRogueBuffScRsp mergeFrom(final ProtoSource input) throws IOException {
// Enabled Fall-Through Optimization (QuickBuffers)
int tag = input.readTag();
while (true) {
switch (tag) {
case 112: {
// retcode
retcode = input.readUInt32();
bitField0_ |= 0x00000001;
tag = input.readTag();
if (tag != 82) {
break;
}
}
case 82: {
// rogueBuffSelectInfo
input.readMessage(rogueBuffSelectInfo);
bitField0_ |= 0x00000002;
tag = input.readTag();
if (tag != 0) {
break;
}
}
case 0: {
return this;
}
default: {
if (!input.skipField(tag)) {
return this;
}
tag = input.readTag();
break;
}
}
}
}
@Override
public void writeTo(final JsonSink output) throws IOException {
output.beginObject();
if ((bitField0_ & 0x00000001) != 0) {
output.writeUInt32(FieldNames.retcode, retcode);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeMessage(FieldNames.rogueBuffSelectInfo, rogueBuffSelectInfo);
}
output.endObject();
}
@Override
public RollRogueBuffScRsp mergeFrom(final JsonSource input) throws IOException {
if (!input.beginObject()) {
return this;
}
while (!input.isAtEnd()) {
switch (input.readFieldHash()) {
case 1097936398: {
if (input.isAtField(FieldNames.retcode)) {
if (!input.trySkipNullValue()) {
retcode = input.readUInt32();
bitField0_ |= 0x00000001;
}
} else {
input.skipUnknownField();
}
break;
}
case -2050730761:
case 1692632042: {
if (input.isAtField(FieldNames.rogueBuffSelectInfo)) {
if (!input.trySkipNullValue()) {
input.readMessage(rogueBuffSelectInfo);
bitField0_ |= 0x00000002;
}
} else {
input.skipUnknownField();
}
break;
}
default: {
input.skipUnknownField();
break;
}
}
}
input.endObject();
return this;
}
@Override
public RollRogueBuffScRsp clone() {
return new RollRogueBuffScRsp().copyFrom(this);
}
@Override
public boolean isEmpty() {
return ((bitField0_) == 0);
}
public static RollRogueBuffScRsp parseFrom(final byte[] data) throws
InvalidProtocolBufferException {
return ProtoMessage.mergeFrom(new RollRogueBuffScRsp(), data).checkInitialized();
}
public static RollRogueBuffScRsp parseFrom(final ProtoSource input) throws IOException {
return ProtoMessage.mergeFrom(new RollRogueBuffScRsp(), input).checkInitialized();
}
public static RollRogueBuffScRsp parseFrom(final JsonSource input) throws IOException {
return ProtoMessage.mergeFrom(new RollRogueBuffScRsp(), input).checkInitialized();
}
/**
* @return factory for creating RollRogueBuffScRsp messages
*/
public static MessageFactory<RollRogueBuffScRsp> getFactory() {
return RollRogueBuffScRspFactory.INSTANCE;
}
private enum RollRogueBuffScRspFactory implements MessageFactory<RollRogueBuffScRsp> {
INSTANCE;
@Override
public RollRogueBuffScRsp create() {
return RollRogueBuffScRsp.newInstance();
}
}
/**
* Contains name constants used for serializing JSON
*/
static class FieldNames {
static final FieldName retcode = FieldName.forField("retcode");
static final FieldName rogueBuffSelectInfo = FieldName.forField("rogueBuffSelectInfo", "rogue_buff_select_info");
}
}
}

View File

@@ -0,0 +1,260 @@
// 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;
public final class SelectRogueBuffCsReqOuterClass {
/**
* Protobuf type {@code SelectRogueBuffCsReq}
*/
public static final class SelectRogueBuffCsReq extends ProtoMessage<SelectRogueBuffCsReq> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional uint32 maze_buff_id = 7;</code>
*/
private int mazeBuffId;
private SelectRogueBuffCsReq() {
}
/**
* @return a new empty instance of {@code SelectRogueBuffCsReq}
*/
public static SelectRogueBuffCsReq newInstance() {
return new SelectRogueBuffCsReq();
}
/**
* <code>optional uint32 maze_buff_id = 7;</code>
* @return whether the mazeBuffId field is set
*/
public boolean hasMazeBuffId() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional uint32 maze_buff_id = 7;</code>
* @return this
*/
public SelectRogueBuffCsReq clearMazeBuffId() {
bitField0_ &= ~0x00000001;
mazeBuffId = 0;
return this;
}
/**
* <code>optional uint32 maze_buff_id = 7;</code>
* @return the mazeBuffId
*/
public int getMazeBuffId() {
return mazeBuffId;
}
/**
* <code>optional uint32 maze_buff_id = 7;</code>
* @param value the mazeBuffId to set
* @return this
*/
public SelectRogueBuffCsReq setMazeBuffId(final int value) {
bitField0_ |= 0x00000001;
mazeBuffId = value;
return this;
}
@Override
public SelectRogueBuffCsReq copyFrom(final SelectRogueBuffCsReq other) {
cachedSize = other.cachedSize;
if ((bitField0_ | other.bitField0_) != 0) {
bitField0_ = other.bitField0_;
mazeBuffId = other.mazeBuffId;
}
return this;
}
@Override
public SelectRogueBuffCsReq mergeFrom(final SelectRogueBuffCsReq other) {
if (other.isEmpty()) {
return this;
}
cachedSize = -1;
if (other.hasMazeBuffId()) {
setMazeBuffId(other.mazeBuffId);
}
return this;
}
@Override
public SelectRogueBuffCsReq clear() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
mazeBuffId = 0;
return this;
}
@Override
public SelectRogueBuffCsReq clearQuick() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
return this;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof SelectRogueBuffCsReq)) {
return false;
}
SelectRogueBuffCsReq other = (SelectRogueBuffCsReq) o;
return bitField0_ == other.bitField0_
&& (!hasMazeBuffId() || mazeBuffId == other.mazeBuffId);
}
@Override
public void writeTo(final ProtoSink output) throws IOException {
if ((bitField0_ & 0x00000001) != 0) {
output.writeRawByte((byte) 56);
output.writeUInt32NoTag(mazeBuffId);
}
}
@Override
protected int computeSerializedSize() {
int size = 0;
if ((bitField0_ & 0x00000001) != 0) {
size += 1 + ProtoSink.computeUInt32SizeNoTag(mazeBuffId);
}
return size;
}
@Override
@SuppressWarnings("fallthrough")
public SelectRogueBuffCsReq mergeFrom(final ProtoSource input) throws IOException {
// Enabled Fall-Through Optimization (QuickBuffers)
int tag = input.readTag();
while (true) {
switch (tag) {
case 56: {
// mazeBuffId
mazeBuffId = input.readUInt32();
bitField0_ |= 0x00000001;
tag = input.readTag();
if (tag != 0) {
break;
}
}
case 0: {
return this;
}
default: {
if (!input.skipField(tag)) {
return this;
}
tag = input.readTag();
break;
}
}
}
}
@Override
public void writeTo(final JsonSink output) throws IOException {
output.beginObject();
if ((bitField0_ & 0x00000001) != 0) {
output.writeUInt32(FieldNames.mazeBuffId, mazeBuffId);
}
output.endObject();
}
@Override
public SelectRogueBuffCsReq mergeFrom(final JsonSource input) throws IOException {
if (!input.beginObject()) {
return this;
}
while (!input.isAtEnd()) {
switch (input.readFieldHash()) {
case 144210285:
case 896621575: {
if (input.isAtField(FieldNames.mazeBuffId)) {
if (!input.trySkipNullValue()) {
mazeBuffId = input.readUInt32();
bitField0_ |= 0x00000001;
}
} else {
input.skipUnknownField();
}
break;
}
default: {
input.skipUnknownField();
break;
}
}
}
input.endObject();
return this;
}
@Override
public SelectRogueBuffCsReq clone() {
return new SelectRogueBuffCsReq().copyFrom(this);
}
@Override
public boolean isEmpty() {
return ((bitField0_) == 0);
}
public static SelectRogueBuffCsReq parseFrom(final byte[] data) throws
InvalidProtocolBufferException {
return ProtoMessage.mergeFrom(new SelectRogueBuffCsReq(), data).checkInitialized();
}
public static SelectRogueBuffCsReq parseFrom(final ProtoSource input) throws IOException {
return ProtoMessage.mergeFrom(new SelectRogueBuffCsReq(), input).checkInitialized();
}
public static SelectRogueBuffCsReq parseFrom(final JsonSource input) throws IOException {
return ProtoMessage.mergeFrom(new SelectRogueBuffCsReq(), input).checkInitialized();
}
/**
* @return factory for creating SelectRogueBuffCsReq messages
*/
public static MessageFactory<SelectRogueBuffCsReq> getFactory() {
return SelectRogueBuffCsReqFactory.INSTANCE;
}
private enum SelectRogueBuffCsReqFactory implements MessageFactory<SelectRogueBuffCsReq> {
INSTANCE;
@Override
public SelectRogueBuffCsReq create() {
return SelectRogueBuffCsReq.newInstance();
}
}
/**
* Contains name constants used for serializing JSON
*/
static class FieldNames {
static final FieldName mazeBuffId = FieldName.forField("mazeBuffId", "maze_buff_id");
}
}
}

View File

@@ -0,0 +1,524 @@
// 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;
public final class SelectRogueBuffScRspOuterClass {
/**
* Protobuf type {@code SelectRogueBuffScRsp}
*/
public static final class SelectRogueBuffScRsp extends ProtoMessage<SelectRogueBuffScRsp> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional uint32 maze_buff_level = 6;</code>
*/
private int mazeBuffLevel;
/**
* <code>optional uint32 maze_buff_id = 12;</code>
*/
private int mazeBuffId;
/**
* <code>optional uint32 retcode = 15;</code>
*/
private int retcode;
/**
* <code>optional .RogueBuffSelectInfo buff_select_info = 2;</code>
*/
private final RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo buffSelectInfo = RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo.newInstance();
private SelectRogueBuffScRsp() {
}
/**
* @return a new empty instance of {@code SelectRogueBuffScRsp}
*/
public static SelectRogueBuffScRsp newInstance() {
return new SelectRogueBuffScRsp();
}
/**
* <code>optional uint32 maze_buff_level = 6;</code>
* @return whether the mazeBuffLevel field is set
*/
public boolean hasMazeBuffLevel() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional uint32 maze_buff_level = 6;</code>
* @return this
*/
public SelectRogueBuffScRsp clearMazeBuffLevel() {
bitField0_ &= ~0x00000001;
mazeBuffLevel = 0;
return this;
}
/**
* <code>optional uint32 maze_buff_level = 6;</code>
* @return the mazeBuffLevel
*/
public int getMazeBuffLevel() {
return mazeBuffLevel;
}
/**
* <code>optional uint32 maze_buff_level = 6;</code>
* @param value the mazeBuffLevel to set
* @return this
*/
public SelectRogueBuffScRsp setMazeBuffLevel(final int value) {
bitField0_ |= 0x00000001;
mazeBuffLevel = value;
return this;
}
/**
* <code>optional uint32 maze_buff_id = 12;</code>
* @return whether the mazeBuffId field is set
*/
public boolean hasMazeBuffId() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>optional uint32 maze_buff_id = 12;</code>
* @return this
*/
public SelectRogueBuffScRsp clearMazeBuffId() {
bitField0_ &= ~0x00000002;
mazeBuffId = 0;
return this;
}
/**
* <code>optional uint32 maze_buff_id = 12;</code>
* @return the mazeBuffId
*/
public int getMazeBuffId() {
return mazeBuffId;
}
/**
* <code>optional uint32 maze_buff_id = 12;</code>
* @param value the mazeBuffId to set
* @return this
*/
public SelectRogueBuffScRsp setMazeBuffId(final int value) {
bitField0_ |= 0x00000002;
mazeBuffId = value;
return this;
}
/**
* <code>optional uint32 retcode = 15;</code>
* @return whether the retcode field is set
*/
public boolean hasRetcode() {
return (bitField0_ & 0x00000004) != 0;
}
/**
* <code>optional uint32 retcode = 15;</code>
* @return this
*/
public SelectRogueBuffScRsp clearRetcode() {
bitField0_ &= ~0x00000004;
retcode = 0;
return this;
}
/**
* <code>optional uint32 retcode = 15;</code>
* @return the retcode
*/
public int getRetcode() {
return retcode;
}
/**
* <code>optional uint32 retcode = 15;</code>
* @param value the retcode to set
* @return this
*/
public SelectRogueBuffScRsp setRetcode(final int value) {
bitField0_ |= 0x00000004;
retcode = value;
return this;
}
/**
* <code>optional .RogueBuffSelectInfo buff_select_info = 2;</code>
* @return whether the buffSelectInfo field is set
*/
public boolean hasBuffSelectInfo() {
return (bitField0_ & 0x00000008) != 0;
}
/**
* <code>optional .RogueBuffSelectInfo buff_select_info = 2;</code>
* @return this
*/
public SelectRogueBuffScRsp clearBuffSelectInfo() {
bitField0_ &= ~0x00000008;
buffSelectInfo.clear();
return this;
}
/**
* <code>optional .RogueBuffSelectInfo buff_select_info = 2;</code>
*
* 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 #getMutableBuffSelectInfo()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo getBuffSelectInfo() {
return buffSelectInfo;
}
/**
* <code>optional .RogueBuffSelectInfo buff_select_info = 2;</code>
*
* 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 RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo getMutableBuffSelectInfo() {
bitField0_ |= 0x00000008;
return buffSelectInfo;
}
/**
* <code>optional .RogueBuffSelectInfo buff_select_info = 2;</code>
* @param value the buffSelectInfo to set
* @return this
*/
public SelectRogueBuffScRsp setBuffSelectInfo(
final RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo value) {
bitField0_ |= 0x00000008;
buffSelectInfo.copyFrom(value);
return this;
}
@Override
public SelectRogueBuffScRsp copyFrom(final SelectRogueBuffScRsp other) {
cachedSize = other.cachedSize;
if ((bitField0_ | other.bitField0_) != 0) {
bitField0_ = other.bitField0_;
mazeBuffLevel = other.mazeBuffLevel;
mazeBuffId = other.mazeBuffId;
retcode = other.retcode;
buffSelectInfo.copyFrom(other.buffSelectInfo);
}
return this;
}
@Override
public SelectRogueBuffScRsp mergeFrom(final SelectRogueBuffScRsp other) {
if (other.isEmpty()) {
return this;
}
cachedSize = -1;
if (other.hasMazeBuffLevel()) {
setMazeBuffLevel(other.mazeBuffLevel);
}
if (other.hasMazeBuffId()) {
setMazeBuffId(other.mazeBuffId);
}
if (other.hasRetcode()) {
setRetcode(other.retcode);
}
if (other.hasBuffSelectInfo()) {
getMutableBuffSelectInfo().mergeFrom(other.buffSelectInfo);
}
return this;
}
@Override
public SelectRogueBuffScRsp clear() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
mazeBuffLevel = 0;
mazeBuffId = 0;
retcode = 0;
buffSelectInfo.clear();
return this;
}
@Override
public SelectRogueBuffScRsp clearQuick() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
buffSelectInfo.clearQuick();
return this;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof SelectRogueBuffScRsp)) {
return false;
}
SelectRogueBuffScRsp other = (SelectRogueBuffScRsp) o;
return bitField0_ == other.bitField0_
&& (!hasMazeBuffLevel() || mazeBuffLevel == other.mazeBuffLevel)
&& (!hasMazeBuffId() || mazeBuffId == other.mazeBuffId)
&& (!hasRetcode() || retcode == other.retcode)
&& (!hasBuffSelectInfo() || buffSelectInfo.equals(other.buffSelectInfo));
}
@Override
public void writeTo(final ProtoSink output) throws IOException {
if ((bitField0_ & 0x00000001) != 0) {
output.writeRawByte((byte) 48);
output.writeUInt32NoTag(mazeBuffLevel);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeRawByte((byte) 96);
output.writeUInt32NoTag(mazeBuffId);
}
if ((bitField0_ & 0x00000004) != 0) {
output.writeRawByte((byte) 120);
output.writeUInt32NoTag(retcode);
}
if ((bitField0_ & 0x00000008) != 0) {
output.writeRawByte((byte) 18);
output.writeMessageNoTag(buffSelectInfo);
}
}
@Override
protected int computeSerializedSize() {
int size = 0;
if ((bitField0_ & 0x00000001) != 0) {
size += 1 + ProtoSink.computeUInt32SizeNoTag(mazeBuffLevel);
}
if ((bitField0_ & 0x00000002) != 0) {
size += 1 + ProtoSink.computeUInt32SizeNoTag(mazeBuffId);
}
if ((bitField0_ & 0x00000004) != 0) {
size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode);
}
if ((bitField0_ & 0x00000008) != 0) {
size += 1 + ProtoSink.computeMessageSizeNoTag(buffSelectInfo);
}
return size;
}
@Override
@SuppressWarnings("fallthrough")
public SelectRogueBuffScRsp mergeFrom(final ProtoSource input) throws IOException {
// Enabled Fall-Through Optimization (QuickBuffers)
int tag = input.readTag();
while (true) {
switch (tag) {
case 48: {
// mazeBuffLevel
mazeBuffLevel = input.readUInt32();
bitField0_ |= 0x00000001;
tag = input.readTag();
if (tag != 96) {
break;
}
}
case 96: {
// mazeBuffId
mazeBuffId = input.readUInt32();
bitField0_ |= 0x00000002;
tag = input.readTag();
if (tag != 120) {
break;
}
}
case 120: {
// retcode
retcode = input.readUInt32();
bitField0_ |= 0x00000004;
tag = input.readTag();
if (tag != 18) {
break;
}
}
case 18: {
// buffSelectInfo
input.readMessage(buffSelectInfo);
bitField0_ |= 0x00000008;
tag = input.readTag();
if (tag != 0) {
break;
}
}
case 0: {
return this;
}
default: {
if (!input.skipField(tag)) {
return this;
}
tag = input.readTag();
break;
}
}
}
}
@Override
public void writeTo(final JsonSink output) throws IOException {
output.beginObject();
if ((bitField0_ & 0x00000001) != 0) {
output.writeUInt32(FieldNames.mazeBuffLevel, mazeBuffLevel);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeUInt32(FieldNames.mazeBuffId, mazeBuffId);
}
if ((bitField0_ & 0x00000004) != 0) {
output.writeUInt32(FieldNames.retcode, retcode);
}
if ((bitField0_ & 0x00000008) != 0) {
output.writeMessage(FieldNames.buffSelectInfo, buffSelectInfo);
}
output.endObject();
}
@Override
public SelectRogueBuffScRsp mergeFrom(final JsonSource input) throws IOException {
if (!input.beginObject()) {
return this;
}
while (!input.isAtEnd()) {
switch (input.readFieldHash()) {
case 1204221426:
case 854643992: {
if (input.isAtField(FieldNames.mazeBuffLevel)) {
if (!input.trySkipNullValue()) {
mazeBuffLevel = input.readUInt32();
bitField0_ |= 0x00000001;
}
} else {
input.skipUnknownField();
}
break;
}
case 144210285:
case 896621575: {
if (input.isAtField(FieldNames.mazeBuffId)) {
if (!input.trySkipNullValue()) {
mazeBuffId = input.readUInt32();
bitField0_ |= 0x00000002;
}
} else {
input.skipUnknownField();
}
break;
}
case 1097936398: {
if (input.isAtField(FieldNames.retcode)) {
if (!input.trySkipNullValue()) {
retcode = input.readUInt32();
bitField0_ |= 0x00000004;
}
} else {
input.skipUnknownField();
}
break;
}
case -255242115:
case 1500540965: {
if (input.isAtField(FieldNames.buffSelectInfo)) {
if (!input.trySkipNullValue()) {
input.readMessage(buffSelectInfo);
bitField0_ |= 0x00000008;
}
} else {
input.skipUnknownField();
}
break;
}
default: {
input.skipUnknownField();
break;
}
}
}
input.endObject();
return this;
}
@Override
public SelectRogueBuffScRsp clone() {
return new SelectRogueBuffScRsp().copyFrom(this);
}
@Override
public boolean isEmpty() {
return ((bitField0_) == 0);
}
public static SelectRogueBuffScRsp parseFrom(final byte[] data) throws
InvalidProtocolBufferException {
return ProtoMessage.mergeFrom(new SelectRogueBuffScRsp(), data).checkInitialized();
}
public static SelectRogueBuffScRsp parseFrom(final ProtoSource input) throws IOException {
return ProtoMessage.mergeFrom(new SelectRogueBuffScRsp(), input).checkInitialized();
}
public static SelectRogueBuffScRsp parseFrom(final JsonSource input) throws IOException {
return ProtoMessage.mergeFrom(new SelectRogueBuffScRsp(), input).checkInitialized();
}
/**
* @return factory for creating SelectRogueBuffScRsp messages
*/
public static MessageFactory<SelectRogueBuffScRsp> getFactory() {
return SelectRogueBuffScRspFactory.INSTANCE;
}
private enum SelectRogueBuffScRspFactory implements MessageFactory<SelectRogueBuffScRsp> {
INSTANCE;
@Override
public SelectRogueBuffScRsp create() {
return SelectRogueBuffScRsp.newInstance();
}
}
/**
* Contains name constants used for serializing JSON
*/
static class FieldNames {
static final FieldName mazeBuffLevel = FieldName.forField("mazeBuffLevel", "maze_buff_level");
static final FieldName mazeBuffId = FieldName.forField("mazeBuffId", "maze_buff_id");
static final FieldName retcode = FieldName.forField("retcode");
static final FieldName buffSelectInfo = FieldName.forField("buffSelectInfo", "buff_select_info");
}
}
}

View File

@@ -0,0 +1,284 @@
// 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;
public final class SyncRogueBuffSelectInfoScNotifyOuterClass {
/**
* Protobuf type {@code SyncRogueBuffSelectInfoScNotify}
*/
public static final class SyncRogueBuffSelectInfoScNotify extends ProtoMessage<SyncRogueBuffSelectInfoScNotify> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional .RogueBuffSelectInfo buff_select_info = 2;</code>
*/
private final RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo buffSelectInfo = RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo.newInstance();
private SyncRogueBuffSelectInfoScNotify() {
}
/**
* @return a new empty instance of {@code SyncRogueBuffSelectInfoScNotify}
*/
public static SyncRogueBuffSelectInfoScNotify newInstance() {
return new SyncRogueBuffSelectInfoScNotify();
}
/**
* <code>optional .RogueBuffSelectInfo buff_select_info = 2;</code>
* @return whether the buffSelectInfo field is set
*/
public boolean hasBuffSelectInfo() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional .RogueBuffSelectInfo buff_select_info = 2;</code>
* @return this
*/
public SyncRogueBuffSelectInfoScNotify clearBuffSelectInfo() {
bitField0_ &= ~0x00000001;
buffSelectInfo.clear();
return this;
}
/**
* <code>optional .RogueBuffSelectInfo buff_select_info = 2;</code>
*
* 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 #getMutableBuffSelectInfo()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo getBuffSelectInfo() {
return buffSelectInfo;
}
/**
* <code>optional .RogueBuffSelectInfo buff_select_info = 2;</code>
*
* 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 RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo getMutableBuffSelectInfo() {
bitField0_ |= 0x00000001;
return buffSelectInfo;
}
/**
* <code>optional .RogueBuffSelectInfo buff_select_info = 2;</code>
* @param value the buffSelectInfo to set
* @return this
*/
public SyncRogueBuffSelectInfoScNotify setBuffSelectInfo(
final RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo value) {
bitField0_ |= 0x00000001;
buffSelectInfo.copyFrom(value);
return this;
}
@Override
public SyncRogueBuffSelectInfoScNotify copyFrom(final SyncRogueBuffSelectInfoScNotify other) {
cachedSize = other.cachedSize;
if ((bitField0_ | other.bitField0_) != 0) {
bitField0_ = other.bitField0_;
buffSelectInfo.copyFrom(other.buffSelectInfo);
}
return this;
}
@Override
public SyncRogueBuffSelectInfoScNotify mergeFrom(final SyncRogueBuffSelectInfoScNotify other) {
if (other.isEmpty()) {
return this;
}
cachedSize = -1;
if (other.hasBuffSelectInfo()) {
getMutableBuffSelectInfo().mergeFrom(other.buffSelectInfo);
}
return this;
}
@Override
public SyncRogueBuffSelectInfoScNotify clear() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
buffSelectInfo.clear();
return this;
}
@Override
public SyncRogueBuffSelectInfoScNotify clearQuick() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
buffSelectInfo.clearQuick();
return this;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof SyncRogueBuffSelectInfoScNotify)) {
return false;
}
SyncRogueBuffSelectInfoScNotify other = (SyncRogueBuffSelectInfoScNotify) o;
return bitField0_ == other.bitField0_
&& (!hasBuffSelectInfo() || buffSelectInfo.equals(other.buffSelectInfo));
}
@Override
public void writeTo(final ProtoSink output) throws IOException {
if ((bitField0_ & 0x00000001) != 0) {
output.writeRawByte((byte) 18);
output.writeMessageNoTag(buffSelectInfo);
}
}
@Override
protected int computeSerializedSize() {
int size = 0;
if ((bitField0_ & 0x00000001) != 0) {
size += 1 + ProtoSink.computeMessageSizeNoTag(buffSelectInfo);
}
return size;
}
@Override
@SuppressWarnings("fallthrough")
public SyncRogueBuffSelectInfoScNotify mergeFrom(final ProtoSource input) throws IOException {
// Enabled Fall-Through Optimization (QuickBuffers)
int tag = input.readTag();
while (true) {
switch (tag) {
case 18: {
// buffSelectInfo
input.readMessage(buffSelectInfo);
bitField0_ |= 0x00000001;
tag = input.readTag();
if (tag != 0) {
break;
}
}
case 0: {
return this;
}
default: {
if (!input.skipField(tag)) {
return this;
}
tag = input.readTag();
break;
}
}
}
}
@Override
public void writeTo(final JsonSink output) throws IOException {
output.beginObject();
if ((bitField0_ & 0x00000001) != 0) {
output.writeMessage(FieldNames.buffSelectInfo, buffSelectInfo);
}
output.endObject();
}
@Override
public SyncRogueBuffSelectInfoScNotify mergeFrom(final JsonSource input) throws IOException {
if (!input.beginObject()) {
return this;
}
while (!input.isAtEnd()) {
switch (input.readFieldHash()) {
case -255242115:
case 1500540965: {
if (input.isAtField(FieldNames.buffSelectInfo)) {
if (!input.trySkipNullValue()) {
input.readMessage(buffSelectInfo);
bitField0_ |= 0x00000001;
}
} else {
input.skipUnknownField();
}
break;
}
default: {
input.skipUnknownField();
break;
}
}
}
input.endObject();
return this;
}
@Override
public SyncRogueBuffSelectInfoScNotify clone() {
return new SyncRogueBuffSelectInfoScNotify().copyFrom(this);
}
@Override
public boolean isEmpty() {
return ((bitField0_) == 0);
}
public static SyncRogueBuffSelectInfoScNotify parseFrom(final byte[] data) throws
InvalidProtocolBufferException {
return ProtoMessage.mergeFrom(new SyncRogueBuffSelectInfoScNotify(), data).checkInitialized();
}
public static SyncRogueBuffSelectInfoScNotify parseFrom(final ProtoSource input) throws
IOException {
return ProtoMessage.mergeFrom(new SyncRogueBuffSelectInfoScNotify(), input).checkInitialized();
}
public static SyncRogueBuffSelectInfoScNotify parseFrom(final JsonSource input) throws
IOException {
return ProtoMessage.mergeFrom(new SyncRogueBuffSelectInfoScNotify(), input).checkInitialized();
}
/**
* @return factory for creating SyncRogueBuffSelectInfoScNotify messages
*/
public static MessageFactory<SyncRogueBuffSelectInfoScNotify> getFactory() {
return SyncRogueBuffSelectInfoScNotifyFactory.INSTANCE;
}
private enum SyncRogueBuffSelectInfoScNotifyFactory implements MessageFactory<SyncRogueBuffSelectInfoScNotify> {
INSTANCE;
@Override
public SyncRogueBuffSelectInfoScNotify create() {
return SyncRogueBuffSelectInfoScNotify.newInstance();
}
}
/**
* Contains name constants used for serializing JSON
*/
static class FieldNames {
static final FieldName buffSelectInfo = FieldName.forField("buffSelectInfo", "buff_select_info");
}
}
}

View File

@@ -4,10 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import emu.lunarcore.GameConstants;
import emu.lunarcore.data.excel.RelicMainAffixExcel;
import emu.lunarcore.data.excel.RelicSubAffixExcel;
import emu.lunarcore.data.excel.RogueMapExcel;
import emu.lunarcore.data.excel.RogueManagerExcel;
import emu.lunarcore.data.excel.*;
import emu.lunarcore.util.Utils;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
@@ -15,11 +12,13 @@ import lombok.Getter;
// Game data that is parsed by the server goes here
public class GameDepot {
// Relics
private static Int2ObjectMap<List<RelicMainAffixExcel>> relicMainAffixDepot = new Int2ObjectOpenHashMap<>();
private static Int2ObjectMap<List<RelicSubAffixExcel>> relicSubAffixDepot = new Int2ObjectOpenHashMap<>();
@Getter
private static Int2ObjectMap<int[]> rogueMapGen = new Int2ObjectOpenHashMap<>();
// Rogue
@Getter private static Int2ObjectMap<int[]> rogueMapGen = new Int2ObjectOpenHashMap<>();
@Getter private static List<RogueBuffExcel> rogueBuffsList = new ArrayList<>();
private static Int2ObjectMap<List<RogueMapExcel>> rogueMapDepot = new Int2ObjectOpenHashMap<>();
public static void addRelicMainAffix(RelicMainAffixExcel affix) {

View File

@@ -0,0 +1,29 @@
package emu.lunarcore.data.excel;
import emu.lunarcore.data.GameDepot;
import emu.lunarcore.data.GameResource;
import emu.lunarcore.data.ResourceType;
import lombok.Getter;
@Getter
@ResourceType(name = {"RogueBuff.json"})
public class RogueBuffExcel extends GameResource {
private int MazeBuffID;
private int MazeBuffLevel;
private int RogueBuffType;
private int RogueBuffRarity;
private int AeonID;
@Override
public int getId() {
return MazeBuffID;
}
@Override
public void onLoad() {
if (RogueBuffType >= 120 && RogueBuffType <= 126 && RogueBuffRarity >= 1 && RogueBuffRarity <= 3 && MazeBuffLevel == 1 && AeonID == 0) {
GameDepot.getRogueBuffsList().add(this);
}
}
}

View File

@@ -103,8 +103,11 @@ public class Battle {
if (excel == null) return null;
MazeBuff buff = new MazeBuff(excel, ownerIndex, waveFlag);
return addBuff(buff);
}
public MazeBuff addBuff(MazeBuff buff) {
this.buffs.add(buff);
return buff;
}

View File

@@ -140,6 +140,11 @@ public class BattleService extends BaseGameService {
player.getChallengeInstance().onBattleStart(battle);
}
// Rogue
if (player.getRogueInstance() != null) {
player.getRogueInstance().onBattleStart(battle);
}
// Set battle and send rsp packet
player.setBattle(battle);
player.sendPacket(new PacketSceneCastSkillScRsp(battle, attackedGroupId));
@@ -272,6 +277,11 @@ public class BattleService extends BaseGameService {
player.getChallengeInstance().onBattleFinish(battle, result, stats);
}
// Rogue
if (player.getRogueInstance() != null) {
player.getRogueInstance().onBattleFinish(battle, result, stats);
}
// Done - Clear battle object from player
player.setBattle(null);
return battle;

View File

@@ -12,7 +12,8 @@ import lombok.Getter;
@Getter
public class MazeBuff {
private MazeBuffExcel excel;
private int id;
private int level;
private int ownerIndex;
private int waveFlag;
private IntList targetIndex;
@@ -21,7 +22,12 @@ public class MazeBuff {
private Object2DoubleMap<String> dynamicValues;
public MazeBuff(MazeBuffExcel excel, int ownerIndex, int waveFlag) {
this.excel = excel;
this(excel.getBuffId(), excel.getLv(), ownerIndex, waveFlag);
}
public MazeBuff(int id, int level, int ownerIndex, int waveFlag) {
this.id = id;
this.level = level;
this.ownerIndex = ownerIndex;
this.waveFlag = waveFlag;
}
@@ -44,8 +50,8 @@ public class MazeBuff {
public BattleBuff toProto() {
var proto = BattleBuff.newInstance()
.setId(excel.getBuffId())
.setLevel(excel.getLv())
.setId(this.getId())
.setLevel(this.getLevel())
.setOwnerId(this.getOwnerIndex())
.setWaveFlag(this.getWaveFlag());

View File

@@ -0,0 +1,28 @@
package emu.lunarcore.game.rogue;
import emu.lunarcore.game.battle.MazeBuff;
import emu.lunarcore.proto.RogueBuffOuterClass.RogueBuff;
import lombok.Getter;
@Getter
public class RogueBuffData {
private int buffId;
private int level;
public RogueBuffData(int buffId, int level) {
this.buffId = buffId;
this.level = level;
}
public MazeBuff toMazeBuff() {
return new MazeBuff(buffId, level, 0, 0xffffffff);
}
public RogueBuff toProto() {
var proto = RogueBuff.newInstance()
.setBuffId(this.getBuffId())
.setLevel(this.getLevel());
return proto;
}
}

View File

@@ -0,0 +1,77 @@
package emu.lunarcore.game.rogue;
import java.util.ArrayList;
import java.util.List;
import emu.lunarcore.data.GameDepot;
import emu.lunarcore.data.excel.RogueBuffExcel;
import emu.lunarcore.proto.RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo;
import emu.lunarcore.util.WeightedList;
import lombok.Getter;
@Getter
public class RogueBuffSelectMenu {
private transient RogueInstance rogue;
private int maxBuffs;
private int rerolls;
private int maxRerolls;
private List<RogueBuffData> buffs;
// Cache
private transient WeightedList<RogueBuffExcel> randomBuffs;
@Deprecated // Morphia only!
public RogueBuffSelectMenu() {}
public RogueBuffSelectMenu(RogueInstance rogue) {
this.rogue = rogue;
this.maxBuffs = 3;
this.buffs = new ArrayList<>();
this.generateRandomBuffs();
}
public void generateRandomBuffs() {
if (this.randomBuffs == null) {
this.randomBuffs = new WeightedList<>();
for (RogueBuffExcel excel : GameDepot.getRogueBuffsList()) {
if (rogue.getBuffs().containsKey(excel.getMazeBuffID())) {
continue;
}
this.randomBuffs.add(10.0 / excel.getRogueBuffRarity(), excel);
};
}
this.getBuffs().clear();
while (this.getBuffs().size() < this.getMaxBuffs()) {
RogueBuffExcel excel = this.randomBuffs.next();
this.getBuffs().add(new RogueBuffData(excel.getMazeBuffID(), 1));
}
}
protected void onLoad(RogueInstance rogue) {
this.rogue = rogue;
}
public RogueBuffSelectInfo toProto() {
var proto = RogueBuffSelectInfo.newInstance();
if (this.getMaxRerolls() > 0) {
proto.setCanRoll(true);
proto.setRollBuffTimes(this.getRerolls());
proto.setRollBuffMaxTimes(this.getMaxRerolls());
}
for (var buff : this.getBuffs()) {
proto.addMazeBuffList(buff.toProto());
}
proto.getMutableRollBuffsCost();
return proto;
}
}

View File

@@ -0,0 +1,22 @@
package emu.lunarcore.game.rogue;
import lombok.Getter;
@Getter
public enum RogueBuffType {
Default (100),
Preservation (120),
Remembrance (121),
Nihility (122),
Abundance (123),
Hunt (124),
Destruction (125),
Elation (126),
Propagation (127);
private final int val;
private RogueBuffType(int val) {
this.val = val;
}
}

View File

@@ -1,16 +1,22 @@
package emu.lunarcore.game.rogue;
import java.util.HashSet;
import java.util.Set;
import java.util.TreeMap;
import java.util.*;
import emu.lunarcore.data.GameData;
import emu.lunarcore.data.config.AnchorInfo;
import emu.lunarcore.data.excel.RogueAreaExcel;
import emu.lunarcore.game.battle.Battle;
import emu.lunarcore.game.player.Player;
import emu.lunarcore.proto.BattleEndStatusOuterClass.BattleEndStatus;
import emu.lunarcore.proto.BattleStatisticsOuterClass.BattleStatistics;
import emu.lunarcore.proto.RogueBuffInfoOuterClass.RogueBuffInfo;
import emu.lunarcore.proto.RogueBuffSourceOuterClass.RogueBuffSource;
import emu.lunarcore.proto.RogueCurrentInfoOuterClass.RogueCurrentInfo;
import emu.lunarcore.proto.RogueMapInfoOuterClass.RogueMapInfo;
import emu.lunarcore.proto.RogueRoomStatusOuterClass.RogueRoomStatus;
import emu.lunarcore.proto.RogueStatusOuterClass.RogueStatus;
import emu.lunarcore.server.packet.send.PacketAddRogueBuffScNotify;
import emu.lunarcore.server.packet.send.PacketSyncRogueBuffSelectInfoScNotify;
import emu.lunarcore.server.packet.send.PacketSyncRogueMapRoomScNotify;
import emu.lunarcore.util.Utils;
import lombok.Getter;
@@ -20,17 +26,28 @@ public class RogueInstance {
private transient Player player;
private transient RogueAreaExcel excel;
private int areaId;
private int currentRoomProgress;
private int currentSiteId;
private int startSiteId;
private Set<Integer> baseAvatarIds;
private TreeMap<Integer, RogueRoomData> rooms;
private Set<Integer> baseAvatarIds;
private Map<Integer, RogueBuffData> buffs;
private RogueBuffSelectMenu buffSelect;
private int pendingBuffSelects;
@Deprecated // Morphia only!
public RogueInstance() {}
public RogueInstance(Player player, RogueAreaExcel excel) {
this.player = player;
this.excel = excel;
this.areaId = excel.getRogueAreaID();
this.currentRoomProgress = 0;
this.baseAvatarIds = new HashSet<>();
this.buffs = new HashMap<>();
this.initRooms();
}
@@ -62,6 +79,43 @@ public class RogueInstance {
return this.getRoomBySiteId(this.getCurrentSiteId());
}
public synchronized void createBuffSelect(int amount) {
this.pendingBuffSelects += amount;
RogueBuffSelectMenu buffSelect = this.updateBuffSelect();
if (buffSelect != null) {
getPlayer().sendPacket(new PacketSyncRogueBuffSelectInfoScNotify(buffSelect));
}
}
public synchronized RogueBuffSelectMenu updateBuffSelect() {
if (this.pendingBuffSelects > 0 && this.getBuffSelect() == null) {
this.buffSelect = new RogueBuffSelectMenu(this);
this.pendingBuffSelects--;
return this.buffSelect;
}
return null;
}
public synchronized RogueBuffData selectBuff(int buffId) {
if (this.getBuffSelect() == null) return null;
RogueBuffData buff = this.getBuffSelect().getBuffs()
.stream()
.filter(b -> b.getBuffId() == buffId)
.findFirst()
.orElse(null);
if (buff == null) return null;
this.buffSelect = null;
this.getBuffs().put(buff.getBuffId(), buff);
getPlayer().sendPacket(new PacketAddRogueBuffScNotify(buff, RogueBuffSource.ROGUE_BUFF_SOURCE_TYPE_SELECT));
return buff;
}
public synchronized RogueRoomData enterRoom(int siteId) {
// Set status on previous room
RogueRoomData prevRoom = getCurrentRoom();
@@ -108,12 +162,37 @@ public class RogueInstance {
return nextRoom;
}
public synchronized void onBattleStart(Battle battle) {
for (var buff : this.getBuffs().values()) {
battle.addBuff(buff.toMazeBuff());
}
}
public synchronized void onBattleFinish(Battle battle, BattleEndStatus result, BattleStatistics stats) {
if (result == BattleEndStatus.BATTLE_END_WIN) {
int amount = battle.getNpcMonsters().size();
this.createBuffSelect(amount);
}
}
// Database
public void onLoad(Player player) {
this.player = player;
this.excel = GameData.getRogueAreaExcelMap().get(areaId);
if (this.getBuffSelect() != null) {
this.getBuffSelect().onLoad(this);
}
}
// Serialization
public RogueCurrentInfo toProto() {
var proto = RogueCurrentInfo.newInstance()
.setStatus(this.getStatus())
.setRoomMap(this.toMapProto());
.setRoomMap(this.toMapProto())
.setRogueBuffInfo(this.toBuffProto());
return proto;
}
@@ -134,4 +213,20 @@ public class RogueInstance {
return proto;
}
public RogueBuffInfo toBuffProto() {
var proto = RogueBuffInfo.newInstance();
if (this.getBuffSelect() != null) {
proto.setBuffSelectInfo(this.getBuffSelect().toProto());
} else {
proto.getMutableBuffSelectInfo();
}
for (var buff : this.getBuffs().values()) {
proto.addMazeBuffList(buff.toProto());
}
return proto;
}
}

View File

@@ -0,0 +1,30 @@
package emu.lunarcore.server.packet.recv;
import emu.lunarcore.game.rogue.RogueBuffData;
import emu.lunarcore.game.rogue.RogueBuffSelectMenu;
import emu.lunarcore.proto.SelectRogueBuffCsReqOuterClass.SelectRogueBuffCsReq;
import emu.lunarcore.server.game.GameSession;
import emu.lunarcore.server.packet.CmdId;
import emu.lunarcore.server.packet.Opcodes;
import emu.lunarcore.server.packet.PacketHandler;
import emu.lunarcore.server.packet.send.PacketSelectRogueBuffScRsp;
@Opcodes(CmdId.SelectRogueBuffCsReq)
public class HandlerSelectRogueBuffCsReq extends PacketHandler {
@Override
public void handle(GameSession session, byte[] header, byte[] data) throws Exception {
var req = SelectRogueBuffCsReq.parseFrom(data);
if (session.getPlayer().getRogueInstance() != null) {
RogueBuffData buff = session.getPlayer().getRogueInstance().selectBuff(req.getMazeBuffId());
if (buff != null) {
RogueBuffSelectMenu buffSelect = session.getPlayer().getRogueInstance().updateBuffSelect();
session.send(new PacketSelectRogueBuffScRsp(buff, buffSelect));
}
}
session.send(CmdId.SelectRogueBuffScRsp);
}
}

View File

@@ -0,0 +1,20 @@
package emu.lunarcore.server.packet.send;
import emu.lunarcore.game.rogue.RogueBuffData;
import emu.lunarcore.proto.AddRogueBuffScNotifyOuterClass.AddRogueBuffScNotify;
import emu.lunarcore.proto.RogueBuffSourceOuterClass.RogueBuffSource;
import emu.lunarcore.server.packet.BasePacket;
import emu.lunarcore.server.packet.CmdId;
public class PacketAddRogueBuffScNotify extends BasePacket {
public PacketAddRogueBuffScNotify(RogueBuffData buff, RogueBuffSource source) {
super(CmdId.AddRogueBuffScNotify);
var data = AddRogueBuffScNotify.newInstance()
.setMazeBuffInfo(buff.toProto())
.setSource(source);
this.setData(data);
}
}

View File

@@ -0,0 +1,26 @@
package emu.lunarcore.server.packet.send;
import emu.lunarcore.game.rogue.RogueBuffData;
import emu.lunarcore.game.rogue.RogueBuffSelectMenu;
import emu.lunarcore.proto.SelectRogueBuffScRspOuterClass.SelectRogueBuffScRsp;
import emu.lunarcore.server.packet.BasePacket;
import emu.lunarcore.server.packet.CmdId;
public class PacketSelectRogueBuffScRsp extends BasePacket {
public PacketSelectRogueBuffScRsp(RogueBuffData buff, RogueBuffSelectMenu buffSelect) {
super(CmdId.SelectRogueBuffScRsp);
var data = SelectRogueBuffScRsp.newInstance()
.setMazeBuffId(buff.getBuffId())
.setMazeBuffLevel(buff.getLevel());
if (buffSelect != null) {
data.setBuffSelectInfo(buffSelect.toProto());
} else {
data.getMutableBuffSelectInfo();
}
this.setData(data);
}
}

View File

@@ -0,0 +1,18 @@
package emu.lunarcore.server.packet.send;
import emu.lunarcore.game.rogue.RogueBuffSelectMenu;
import emu.lunarcore.proto.SyncRogueBuffSelectInfoScNotifyOuterClass.SyncRogueBuffSelectInfoScNotify;
import emu.lunarcore.server.packet.BasePacket;
import emu.lunarcore.server.packet.CmdId;
public class PacketSyncRogueBuffSelectInfoScNotify extends BasePacket {
public PacketSyncRogueBuffSelectInfoScNotify(RogueBuffSelectMenu selectMenu) {
super(CmdId.SyncRogueBuffSelectInfoScNotify);
var data = SyncRogueBuffSelectInfoScNotify.newInstance()
.setBuffSelectInfo(selectMenu.toProto());
this.setData(data);
}
}