mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-02-11 14:23:22 +08:00
Format code
This commit is contained in:
parent
b03870ab48
commit
a3970f8e43
@ -5,26 +5,28 @@ package emu.grasscutter.net.proto;
|
|||||||
|
|
||||||
public final class GetAllMailNotifyOuterClass {
|
public final class GetAllMailNotifyOuterClass {
|
||||||
private GetAllMailNotifyOuterClass() {}
|
private GetAllMailNotifyOuterClass() {}
|
||||||
public static void registerAllExtensions(
|
|
||||||
com.google.protobuf.ExtensionRegistryLite registry) {
|
public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {}
|
||||||
|
|
||||||
|
public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
|
||||||
|
registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void registerAllExtensions(
|
public interface GetAllMailNotifyOrBuilder
|
||||||
com.google.protobuf.ExtensionRegistry registry) {
|
extends
|
||||||
registerAllExtensions(
|
|
||||||
(com.google.protobuf.ExtensionRegistryLite) registry);
|
|
||||||
}
|
|
||||||
public interface GetAllMailNotifyOrBuilder extends
|
|
||||||
// @@protoc_insertion_point(interface_extends:GetAllMailNotify)
|
// @@protoc_insertion_point(interface_extends:GetAllMailNotify)
|
||||||
com.google.protobuf.MessageOrBuilder {
|
com.google.protobuf.MessageOrBuilder {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>bool is_collected = 6;</code>
|
* <code>bool is_collected = 6;</code>
|
||||||
|
*
|
||||||
* @return The isCollected.
|
* @return The isCollected.
|
||||||
*/
|
*/
|
||||||
boolean getIsCollected();
|
boolean getIsCollected();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* Name: PFHIOOMPNBH
|
* Name: PFHIOOMPNBH
|
||||||
* CmdId: 1442
|
* CmdId: 1442
|
||||||
@ -32,8 +34,8 @@ public final class GetAllMailNotifyOuterClass {
|
|||||||
*
|
*
|
||||||
* Protobuf type {@code GetAllMailNotify}
|
* Protobuf type {@code GetAllMailNotify}
|
||||||
*/
|
*/
|
||||||
public static final class GetAllMailNotify extends
|
public static final class GetAllMailNotify extends com.google.protobuf.GeneratedMessageV3
|
||||||
com.google.protobuf.GeneratedMessageV3 implements
|
implements
|
||||||
// @@protoc_insertion_point(message_implements:GetAllMailNotify)
|
// @@protoc_insertion_point(message_implements:GetAllMailNotify)
|
||||||
GetAllMailNotifyOrBuilder {
|
GetAllMailNotifyOrBuilder {
|
||||||
private static final long serialVersionUID = 0L;
|
private static final long serialVersionUID = 0L;
|
||||||
@ -41,21 +43,20 @@ public final class GetAllMailNotifyOuterClass {
|
|||||||
private GetAllMailNotify(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
|
private GetAllMailNotify(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
|
||||||
super(builder);
|
super(builder);
|
||||||
}
|
}
|
||||||
private GetAllMailNotify() {
|
|
||||||
}
|
private GetAllMailNotify() {}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
@SuppressWarnings({"unused"})
|
@SuppressWarnings({"unused"})
|
||||||
protected java.lang.Object newInstance(
|
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
|
||||||
UnusedPrivateParameter unused) {
|
|
||||||
return new GetAllMailNotify();
|
return new GetAllMailNotify();
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public final com.google.protobuf.UnknownFieldSet
|
public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
|
||||||
getUnknownFields() {
|
|
||||||
return this.unknownFields;
|
return this.unknownFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
private GetAllMailNotify(
|
private GetAllMailNotify(
|
||||||
com.google.protobuf.CodedInputStream input,
|
com.google.protobuf.CodedInputStream input,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
@ -74,14 +75,14 @@ public final class GetAllMailNotifyOuterClass {
|
|||||||
case 0:
|
case 0:
|
||||||
done = true;
|
done = true;
|
||||||
break;
|
break;
|
||||||
case 48: {
|
case 48:
|
||||||
|
{
|
||||||
isCollected_ = input.readBool();
|
isCollected_ = input.readBool();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default:
|
||||||
if (!parseUnknownField(
|
{
|
||||||
input, unknownFields, extensionRegistry, tag)) {
|
if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
|
||||||
done = true;
|
done = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -91,30 +92,33 @@ public final class GetAllMailNotifyOuterClass {
|
|||||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||||
throw e.setUnfinishedMessage(this);
|
throw e.setUnfinishedMessage(this);
|
||||||
} catch (java.io.IOException e) {
|
} catch (java.io.IOException e) {
|
||||||
throw new com.google.protobuf.InvalidProtocolBufferException(
|
throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
|
||||||
e).setUnfinishedMessage(this);
|
|
||||||
} finally {
|
} finally {
|
||||||
this.unknownFields = unknownFields.build();
|
this.unknownFields = unknownFields.build();
|
||||||
makeExtensionsImmutable();
|
makeExtensionsImmutable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static final com.google.protobuf.Descriptors.Descriptor
|
|
||||||
getDescriptor() {
|
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
|
||||||
return emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.internal_static_GetAllMailNotify_descriptor;
|
return emu.grasscutter.net.proto.GetAllMailNotifyOuterClass
|
||||||
|
.internal_static_GetAllMailNotify_descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||||
internalGetFieldAccessorTable() {
|
internalGetFieldAccessorTable() {
|
||||||
return emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.internal_static_GetAllMailNotify_fieldAccessorTable
|
return emu.grasscutter.net.proto.GetAllMailNotifyOuterClass
|
||||||
|
.internal_static_GetAllMailNotify_fieldAccessorTable
|
||||||
.ensureFieldAccessorsInitialized(
|
.ensureFieldAccessorsInitialized(
|
||||||
emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify.class, emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify.Builder.class);
|
emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify.class,
|
||||||
|
emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify.Builder.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final int IS_COLLECTED_FIELD_NUMBER = 6;
|
public static final int IS_COLLECTED_FIELD_NUMBER = 6;
|
||||||
private boolean isCollected_;
|
private boolean isCollected_;
|
||||||
/**
|
/**
|
||||||
* <code>bool is_collected = 6;</code>
|
* <code>bool is_collected = 6;</code>
|
||||||
|
*
|
||||||
* @return The isCollected.
|
* @return The isCollected.
|
||||||
*/
|
*/
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
@ -123,6 +127,7 @@ public final class GetAllMailNotifyOuterClass {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private byte memoizedIsInitialized = -1;
|
private byte memoizedIsInitialized = -1;
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public final boolean isInitialized() {
|
public final boolean isInitialized() {
|
||||||
byte isInitialized = memoizedIsInitialized;
|
byte isInitialized = memoizedIsInitialized;
|
||||||
@ -134,8 +139,7 @@ public final class GetAllMailNotifyOuterClass {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public void writeTo(com.google.protobuf.CodedOutputStream output)
|
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
|
||||||
throws java.io.IOException {
|
|
||||||
if (isCollected_ != false) {
|
if (isCollected_ != false) {
|
||||||
output.writeBool(6, isCollected_);
|
output.writeBool(6, isCollected_);
|
||||||
}
|
}
|
||||||
@ -149,8 +153,7 @@ public final class GetAllMailNotifyOuterClass {
|
|||||||
|
|
||||||
size = 0;
|
size = 0;
|
||||||
if (isCollected_ != false) {
|
if (isCollected_ != false) {
|
||||||
size += com.google.protobuf.CodedOutputStream
|
size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, isCollected_);
|
||||||
.computeBoolSize(6, isCollected_);
|
|
||||||
}
|
}
|
||||||
size += unknownFields.getSerializedSize();
|
size += unknownFields.getSerializedSize();
|
||||||
memoizedSize = size;
|
memoizedSize = size;
|
||||||
@ -165,10 +168,10 @@ public final class GetAllMailNotifyOuterClass {
|
|||||||
if (!(obj instanceof emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify)) {
|
if (!(obj instanceof emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify)) {
|
||||||
return super.equals(obj);
|
return super.equals(obj);
|
||||||
}
|
}
|
||||||
emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify other = (emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify) obj;
|
emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify other =
|
||||||
|
(emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify) obj;
|
||||||
|
|
||||||
if (getIsCollected()
|
if (getIsCollected() != other.getIsCollected()) return false;
|
||||||
!= other.getIsCollected()) return false;
|
|
||||||
if (!unknownFields.equals(other.unknownFields)) return false;
|
if (!unknownFields.equals(other.unknownFields)) return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -181,95 +184,102 @@ public final class GetAllMailNotifyOuterClass {
|
|||||||
int hash = 41;
|
int hash = 41;
|
||||||
hash = (19 * hash) + getDescriptor().hashCode();
|
hash = (19 * hash) + getDescriptor().hashCode();
|
||||||
hash = (37 * hash) + IS_COLLECTED_FIELD_NUMBER;
|
hash = (37 * hash) + IS_COLLECTED_FIELD_NUMBER;
|
||||||
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
|
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsCollected());
|
||||||
getIsCollected());
|
|
||||||
hash = (29 * hash) + unknownFields.hashCode();
|
hash = (29 * hash) + unknownFields.hashCode();
|
||||||
memoizedHashCode = hash;
|
memoizedHashCode = hash;
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
||||||
java.nio.ByteBuffer data)
|
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
|
||||||
return PARSER.parseFrom(data);
|
return PARSER.parseFrom(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
||||||
java.nio.ByteBuffer data,
|
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
return PARSER.parseFrom(data, extensionRegistry);
|
return PARSER.parseFrom(data, extensionRegistry);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
||||||
com.google.protobuf.ByteString data)
|
com.google.protobuf.ByteString data)
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
return PARSER.parseFrom(data);
|
return PARSER.parseFrom(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
||||||
com.google.protobuf.ByteString data,
|
com.google.protobuf.ByteString data,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
return PARSER.parseFrom(data, extensionRegistry);
|
return PARSER.parseFrom(data, extensionRegistry);
|
||||||
}
|
}
|
||||||
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(byte[] data)
|
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
||||||
|
byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
return PARSER.parseFrom(data);
|
return PARSER.parseFrom(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
||||||
byte[] data,
|
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
return PARSER.parseFrom(data, extensionRegistry);
|
return PARSER.parseFrom(data, extensionRegistry);
|
||||||
}
|
}
|
||||||
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(java.io.InputStream input)
|
|
||||||
throws java.io.IOException {
|
|
||||||
return com.google.protobuf.GeneratedMessageV3
|
|
||||||
.parseWithIOException(PARSER, input);
|
|
||||||
}
|
|
||||||
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
||||||
java.io.InputStream input,
|
java.io.InputStream input) throws java.io.IOException {
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
|
||||||
throws java.io.IOException {
|
|
||||||
return com.google.protobuf.GeneratedMessageV3
|
|
||||||
.parseWithIOException(PARSER, input, extensionRegistry);
|
|
||||||
}
|
|
||||||
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseDelimitedFrom(java.io.InputStream input)
|
|
||||||
throws java.io.IOException {
|
|
||||||
return com.google.protobuf.GeneratedMessageV3
|
|
||||||
.parseDelimitedWithIOException(PARSER, input);
|
|
||||||
}
|
|
||||||
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseDelimitedFrom(
|
|
||||||
java.io.InputStream input,
|
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
|
||||||
throws java.io.IOException {
|
|
||||||
return com.google.protobuf.GeneratedMessageV3
|
|
||||||
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
||||||
com.google.protobuf.CodedInputStream input)
|
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
return com.google.protobuf.GeneratedMessageV3
|
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
|
||||||
.parseWithIOException(PARSER, input);
|
PARSER, input, extensionRegistry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify
|
||||||
|
parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify
|
||||||
|
parseDelimitedFrom(
|
||||||
|
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
|
||||||
|
PARSER, input, extensionRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
||||||
|
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
|
||||||
|
}
|
||||||
|
|
||||||
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
||||||
com.google.protobuf.CodedInputStream input,
|
com.google.protobuf.CodedInputStream input,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
return com.google.protobuf.GeneratedMessageV3
|
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
|
||||||
.parseWithIOException(PARSER, input, extensionRegistry);
|
PARSER, input, extensionRegistry);
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public Builder newBuilderForType() { return newBuilder(); }
|
public Builder newBuilderForType() {
|
||||||
|
return newBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
public static Builder newBuilder() {
|
public static Builder newBuilder() {
|
||||||
return DEFAULT_INSTANCE.toBuilder();
|
return DEFAULT_INSTANCE.toBuilder();
|
||||||
}
|
}
|
||||||
public static Builder newBuilder(emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify prototype) {
|
|
||||||
|
public static Builder newBuilder(
|
||||||
|
emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify prototype) {
|
||||||
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
|
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public Builder toBuilder() {
|
public Builder toBuilder() {
|
||||||
return this == DEFAULT_INSTANCE
|
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
|
||||||
? new Builder() : new Builder().mergeFrom(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
@ -279,6 +289,8 @@ public final class GetAllMailNotifyOuterClass {
|
|||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* Name: PFHIOOMPNBH
|
* Name: PFHIOOMPNBH
|
||||||
* CmdId: 1442
|
* CmdId: 1442
|
||||||
@ -286,38 +298,42 @@ public final class GetAllMailNotifyOuterClass {
|
|||||||
*
|
*
|
||||||
* Protobuf type {@code GetAllMailNotify}
|
* Protobuf type {@code GetAllMailNotify}
|
||||||
*/
|
*/
|
||||||
public static final class Builder extends
|
public static final class Builder
|
||||||
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
|
extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
|
||||||
|
implements
|
||||||
// @@protoc_insertion_point(builder_implements:GetAllMailNotify)
|
// @@protoc_insertion_point(builder_implements:GetAllMailNotify)
|
||||||
emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotifyOrBuilder {
|
emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotifyOrBuilder {
|
||||||
public static final com.google.protobuf.Descriptors.Descriptor
|
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
|
||||||
getDescriptor() {
|
return emu.grasscutter.net.proto.GetAllMailNotifyOuterClass
|
||||||
return emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.internal_static_GetAllMailNotify_descriptor;
|
.internal_static_GetAllMailNotify_descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||||
internalGetFieldAccessorTable() {
|
internalGetFieldAccessorTable() {
|
||||||
return emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.internal_static_GetAllMailNotify_fieldAccessorTable
|
return emu.grasscutter.net.proto.GetAllMailNotifyOuterClass
|
||||||
|
.internal_static_GetAllMailNotify_fieldAccessorTable
|
||||||
.ensureFieldAccessorsInitialized(
|
.ensureFieldAccessorsInitialized(
|
||||||
emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify.class, emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify.Builder.class);
|
emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify.class,
|
||||||
|
emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify.Builder
|
||||||
|
.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Construct using emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify.newBuilder()
|
// Construct using
|
||||||
|
// emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify.newBuilder()
|
||||||
private Builder() {
|
private Builder() {
|
||||||
maybeForceBuilderInitialization();
|
maybeForceBuilderInitialization();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Builder(
|
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||||
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
|
||||||
super(parent);
|
super(parent);
|
||||||
maybeForceBuilderInitialization();
|
maybeForceBuilderInitialization();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void maybeForceBuilderInitialization() {
|
private void maybeForceBuilderInitialization() {
|
||||||
if (com.google.protobuf.GeneratedMessageV3
|
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
|
||||||
.alwaysUseFieldBuilders) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public Builder clear() {
|
public Builder clear() {
|
||||||
super.clear();
|
super.clear();
|
||||||
@ -327,19 +343,22 @@ public final class GetAllMailNotifyOuterClass {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public com.google.protobuf.Descriptors.Descriptor
|
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
|
||||||
getDescriptorForType() {
|
return emu.grasscutter.net.proto.GetAllMailNotifyOuterClass
|
||||||
return emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.internal_static_GetAllMailNotify_descriptor;
|
.internal_static_GetAllMailNotify_descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify getDefaultInstanceForType() {
|
public emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify
|
||||||
return emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify.getDefaultInstance();
|
getDefaultInstanceForType() {
|
||||||
|
return emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify
|
||||||
|
.getDefaultInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify build() {
|
public emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify build() {
|
||||||
emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify result = buildPartial();
|
emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify result =
|
||||||
|
buildPartial();
|
||||||
if (!result.isInitialized()) {
|
if (!result.isInitialized()) {
|
||||||
throw newUninitializedMessageException(result);
|
throw newUninitializedMessageException(result);
|
||||||
}
|
}
|
||||||
@ -348,7 +367,8 @@ public final class GetAllMailNotifyOuterClass {
|
|||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify buildPartial() {
|
public emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify buildPartial() {
|
||||||
emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify result = new emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify(this);
|
emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify result =
|
||||||
|
new emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify(this);
|
||||||
result.isCollected_ = isCollected_;
|
result.isCollected_ = isCollected_;
|
||||||
onBuilt();
|
onBuilt();
|
||||||
return result;
|
return result;
|
||||||
@ -358,46 +378,54 @@ public final class GetAllMailNotifyOuterClass {
|
|||||||
public Builder clone() {
|
public Builder clone() {
|
||||||
return super.clone();
|
return super.clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public Builder setField(
|
public Builder setField(
|
||||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
|
||||||
java.lang.Object value) {
|
|
||||||
return super.setField(field, value);
|
return super.setField(field, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public Builder clearField(
|
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
|
||||||
com.google.protobuf.Descriptors.FieldDescriptor field) {
|
|
||||||
return super.clearField(field);
|
return super.clearField(field);
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public Builder clearOneof(
|
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
|
||||||
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
|
|
||||||
return super.clearOneof(oneof);
|
return super.clearOneof(oneof);
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public Builder setRepeatedField(
|
public Builder setRepeatedField(
|
||||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||||
int index, java.lang.Object value) {
|
int index,
|
||||||
|
java.lang.Object value) {
|
||||||
return super.setRepeatedField(field, index, value);
|
return super.setRepeatedField(field, index, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public Builder addRepeatedField(
|
public Builder addRepeatedField(
|
||||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
|
||||||
java.lang.Object value) {
|
|
||||||
return super.addRepeatedField(field, value);
|
return super.addRepeatedField(field, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public Builder mergeFrom(com.google.protobuf.Message other) {
|
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||||
if (other instanceof emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify) {
|
if (other
|
||||||
return mergeFrom((emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify)other);
|
instanceof emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify) {
|
||||||
|
return mergeFrom(
|
||||||
|
(emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify) other);
|
||||||
} else {
|
} else {
|
||||||
super.mergeFrom(other);
|
super.mergeFrom(other);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder mergeFrom(emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify other) {
|
public Builder mergeFrom(
|
||||||
if (other == emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify.getDefaultInstance()) return this;
|
emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify other) {
|
||||||
|
if (other
|
||||||
|
== emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify
|
||||||
|
.getDefaultInstance()) return this;
|
||||||
if (other.getIsCollected() != false) {
|
if (other.getIsCollected() != false) {
|
||||||
setIsCollected(other.getIsCollected());
|
setIsCollected(other.getIsCollected());
|
||||||
}
|
}
|
||||||
@ -420,7 +448,9 @@ public final class GetAllMailNotifyOuterClass {
|
|||||||
try {
|
try {
|
||||||
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
|
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
|
||||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||||
parsedMessage = (emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify) e.getUnfinishedMessage();
|
parsedMessage =
|
||||||
|
(emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify)
|
||||||
|
e.getUnfinishedMessage();
|
||||||
throw e.unwrapIOException();
|
throw e.unwrapIOException();
|
||||||
} finally {
|
} finally {
|
||||||
if (parsedMessage != null) {
|
if (parsedMessage != null) {
|
||||||
@ -430,9 +460,10 @@ public final class GetAllMailNotifyOuterClass {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isCollected_ ;
|
private boolean isCollected_;
|
||||||
/**
|
/**
|
||||||
* <code>bool is_collected = 6;</code>
|
* <code>bool is_collected = 6;</code>
|
||||||
|
*
|
||||||
* @return The isCollected.
|
* @return The isCollected.
|
||||||
*/
|
*/
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
@ -441,6 +472,7 @@ public final class GetAllMailNotifyOuterClass {
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* <code>bool is_collected = 6;</code>
|
* <code>bool is_collected = 6;</code>
|
||||||
|
*
|
||||||
* @param value The isCollected to set.
|
* @param value The isCollected to set.
|
||||||
* @return This builder for chaining.
|
* @return This builder for chaining.
|
||||||
*/
|
*/
|
||||||
@ -452,6 +484,7 @@ public final class GetAllMailNotifyOuterClass {
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* <code>bool is_collected = 6;</code>
|
* <code>bool is_collected = 6;</code>
|
||||||
|
*
|
||||||
* @return This builder for chaining.
|
* @return This builder for chaining.
|
||||||
*/
|
*/
|
||||||
public Builder clearIsCollected() {
|
public Builder clearIsCollected() {
|
||||||
@ -460,6 +493,7 @@ public final class GetAllMailNotifyOuterClass {
|
|||||||
onChanged();
|
onChanged();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public final Builder setUnknownFields(
|
public final Builder setUnknownFields(
|
||||||
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||||
@ -472,22 +506,25 @@ public final class GetAllMailNotifyOuterClass {
|
|||||||
return super.mergeUnknownFields(unknownFields);
|
return super.mergeUnknownFields(unknownFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// @@protoc_insertion_point(builder_scope:GetAllMailNotify)
|
// @@protoc_insertion_point(builder_scope:GetAllMailNotify)
|
||||||
}
|
}
|
||||||
|
|
||||||
// @@protoc_insertion_point(class_scope:GetAllMailNotify)
|
// @@protoc_insertion_point(class_scope:GetAllMailNotify)
|
||||||
private static final emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify DEFAULT_INSTANCE;
|
private static final emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify
|
||||||
|
DEFAULT_INSTANCE;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
DEFAULT_INSTANCE = new emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify();
|
DEFAULT_INSTANCE =
|
||||||
|
new emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify getDefaultInstance() {
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify
|
||||||
|
getDefaultInstance() {
|
||||||
return DEFAULT_INSTANCE;
|
return DEFAULT_INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final com.google.protobuf.Parser<GetAllMailNotify>
|
private static final com.google.protobuf.Parser<GetAllMailNotify> PARSER =
|
||||||
PARSER = new com.google.protobuf.AbstractParser<GetAllMailNotify>() {
|
new com.google.protobuf.AbstractParser<GetAllMailNotify>() {
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public GetAllMailNotify parsePartialFrom(
|
public GetAllMailNotify parsePartialFrom(
|
||||||
com.google.protobuf.CodedInputStream input,
|
com.google.protobuf.CodedInputStream input,
|
||||||
@ -507,40 +544,39 @@ public final class GetAllMailNotifyOuterClass {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify getDefaultInstanceForType() {
|
public emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify
|
||||||
|
getDefaultInstanceForType() {
|
||||||
return DEFAULT_INSTANCE;
|
return DEFAULT_INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final com.google.protobuf.Descriptors.Descriptor
|
private static final com.google.protobuf.Descriptors.Descriptor
|
||||||
internal_static_GetAllMailNotify_descriptor;
|
internal_static_GetAllMailNotify_descriptor;
|
||||||
private static final
|
private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
|
||||||
internal_static_GetAllMailNotify_fieldAccessorTable;
|
internal_static_GetAllMailNotify_fieldAccessorTable;
|
||||||
|
|
||||||
public static com.google.protobuf.Descriptors.FileDescriptor
|
public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
|
||||||
getDescriptor() {
|
|
||||||
return descriptor;
|
return descriptor;
|
||||||
}
|
}
|
||||||
private static com.google.protobuf.Descriptors.FileDescriptor
|
|
||||||
descriptor;
|
private static com.google.protobuf.Descriptors.FileDescriptor descriptor;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
java.lang.String[] descriptorData = {
|
java.lang.String[] descriptorData = {
|
||||||
"\n\026GetAllMailNotify.proto\"(\n\020GetAllMailNo" +
|
"\n\026GetAllMailNotify.proto\"(\n\020GetAllMailNo"
|
||||||
"tify\022\024\n\014is_collected\030\006 \001(\010B\033\n\031emu.grassc" +
|
+ "tify\022\024\n\014is_collected\030\006 \001(\010B\033\n\031emu.grassc"
|
||||||
"utter.net.protob\006proto3"
|
+ "utter.net.protob\006proto3"
|
||||||
};
|
};
|
||||||
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
descriptor =
|
||||||
.internalBuildGeneratedFileFrom(descriptorData,
|
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
|
||||||
new com.google.protobuf.Descriptors.FileDescriptor[] {
|
descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {});
|
||||||
});
|
internal_static_GetAllMailNotify_descriptor = getDescriptor().getMessageTypes().get(0);
|
||||||
internal_static_GetAllMailNotify_descriptor =
|
internal_static_GetAllMailNotify_fieldAccessorTable =
|
||||||
getDescriptor().getMessageTypes().get(0);
|
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||||
internal_static_GetAllMailNotify_fieldAccessorTable = new
|
|
||||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
|
||||||
internal_static_GetAllMailNotify_descriptor,
|
internal_static_GetAllMailNotify_descriptor,
|
||||||
new java.lang.String[] { "IsCollected", });
|
new java.lang.String[] {
|
||||||
|
"IsCollected",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// @@protoc_insertion_point(outer_class_scope)
|
// @@protoc_insertion_point(outer_class_scope)
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -105,7 +105,9 @@ public final class GameData {
|
|||||||
private static final Int2ObjectMap<AvatarCostumeData> avatarCostumeDataMap =
|
private static final Int2ObjectMap<AvatarCostumeData> avatarCostumeDataMap =
|
||||||
new Int2ObjectLinkedOpenHashMap<>();
|
new Int2ObjectLinkedOpenHashMap<>();
|
||||||
|
|
||||||
@Getter private static final Int2ObjectMap<AvatarReplaceCostumeData> avatarReplaceCostumeDataMap = new Int2ObjectOpenHashMap<>();
|
@Getter
|
||||||
|
private static final Int2ObjectMap<AvatarReplaceCostumeData> avatarReplaceCostumeDataMap =
|
||||||
|
new Int2ObjectOpenHashMap<>();
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private static final Int2ObjectMap<AvatarCurveData> avatarCurveDataMap =
|
private static final Int2ObjectMap<AvatarCurveData> avatarCurveDataMap =
|
||||||
@ -226,8 +228,12 @@ public final class GameData {
|
|||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private static final Int2ObjectMap<GatherData> gatherDataMap = new Int2ObjectOpenHashMap<>();
|
private static final Int2ObjectMap<GatherData> gatherDataMap = new Int2ObjectOpenHashMap<>();
|
||||||
@Getter @Deprecated // This is to prevent people from using this map. This is for the resource loader only!
|
|
||||||
private static final Int2ObjectMap<GuideTriggerData> guideTriggerDataMap = new Int2ObjectOpenHashMap<>();
|
@Getter
|
||||||
|
@Deprecated // This is to prevent people from using this map. This is for the resource loader
|
||||||
|
// only!
|
||||||
|
private static final Int2ObjectMap<GuideTriggerData> guideTriggerDataMap =
|
||||||
|
new Int2ObjectOpenHashMap<>();
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private static final Int2ObjectMap<HomeWorldBgmData> homeWorldBgmDataMap =
|
private static final Int2ObjectMap<HomeWorldBgmData> homeWorldBgmDataMap =
|
||||||
@ -253,7 +259,9 @@ public final class GameData {
|
|||||||
@Getter
|
@Getter
|
||||||
private static final Int2ObjectMap<MonsterDescribeData> monsterDescribeDataMap =
|
private static final Int2ObjectMap<MonsterDescribeData> monsterDescribeDataMap =
|
||||||
new Int2ObjectOpenHashMap<>();
|
new Int2ObjectOpenHashMap<>();
|
||||||
@Getter private static final Int2ObjectMap<MonsterSpecialNameData> monsterSpecialNameDataMap =
|
|
||||||
|
@Getter
|
||||||
|
private static final Int2ObjectMap<MonsterSpecialNameData> monsterSpecialNameDataMap =
|
||||||
new Int2ObjectOpenHashMap<>();
|
new Int2ObjectOpenHashMap<>();
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@ -412,8 +420,12 @@ public final class GameData {
|
|||||||
@Getter private static final List<OpenStateData> openStateList = new ArrayList<>();
|
@Getter private static final List<OpenStateData> openStateList = new ArrayList<>();
|
||||||
@Getter private static final Map<Integer, List<Integer>> scenePointsPerScene = new HashMap<>();
|
@Getter private static final Map<Integer, List<Integer>> scenePointsPerScene = new HashMap<>();
|
||||||
@Getter private static final Map<String, ScriptSceneData> scriptSceneDataMap = new HashMap<>();
|
@Getter private static final Map<String, ScriptSceneData> scriptSceneDataMap = new HashMap<>();
|
||||||
@Getter private static final Map<String, GuideTriggerData> guideTriggerDataStringMap = new HashMap<>();
|
|
||||||
@Getter private static final Map<String, ConfigLevelEntity> configLevelEntityDataMap = new HashMap<>();
|
@Getter
|
||||||
|
private static final Map<String, GuideTriggerData> guideTriggerDataStringMap = new HashMap<>();
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
private static final Map<String, ConfigLevelEntity> configLevelEntityDataMap = new HashMap<>();
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private static final Int2ObjectMap<IntSet> proudSkillGroupLevels = new Int2ObjectOpenHashMap<>();
|
private static final Int2ObjectMap<IntSet> proudSkillGroupLevels = new Int2ObjectOpenHashMap<>();
|
||||||
|
@ -579,42 +579,52 @@ public class ResourceLoader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void loadConfigData(){
|
private static void loadConfigData() {
|
||||||
loadConfigData(GameData.getAvatarConfigData(), "BinOutput/Avatar/", ConfigEntityAvatar.class);
|
loadConfigData(GameData.getAvatarConfigData(), "BinOutput/Avatar/", ConfigEntityAvatar.class);
|
||||||
loadConfigData(GameData.getMonsterConfigData(), "BinOutput/Monster/", ConfigEntityMonster.class);
|
loadConfigData(
|
||||||
loadConfigDataMap(GameData.getGadgetConfigData(), "BinOutput/Gadget/", ConfigEntityGadget.class);
|
GameData.getMonsterConfigData(), "BinOutput/Monster/", ConfigEntityMonster.class);
|
||||||
|
loadConfigDataMap(
|
||||||
|
GameData.getGadgetConfigData(), "BinOutput/Gadget/", ConfigEntityGadget.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static <T extends ConfigEntityBase> void loadConfigData(Map<String,T> targetMap, String folderPath, Class<T> configClass) {
|
private static <T extends ConfigEntityBase> void loadConfigData(
|
||||||
|
Map<String, T> targetMap, String folderPath, Class<T> configClass) {
|
||||||
val className = configClass.getName();
|
val className = configClass.getName();
|
||||||
try(val stream = Files.newDirectoryStream(getResourcePath(folderPath), "*.json")) {
|
try (val stream = Files.newDirectoryStream(getResourcePath(folderPath), "*.json")) {
|
||||||
stream.forEach(path -> {
|
stream.forEach(
|
||||||
|
path -> {
|
||||||
try {
|
try {
|
||||||
val name = path.getFileName().toString().replace(".json", "");
|
val name = path.getFileName().toString().replace(".json", "");
|
||||||
targetMap.put(name, JsonUtils.loadToClass(path, configClass));
|
targetMap.put(name, JsonUtils.loadToClass(path, configClass));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Grasscutter.getLogger().error("failed to load {} entries for {}", className, path.toString(), e);
|
Grasscutter.getLogger()
|
||||||
|
.error("failed to load {} entries for {}", className, path.toString(), e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Grasscutter.getLogger().debug("Loaded {} {} entries.", GameData.getMonsterConfigData().size(), className);
|
Grasscutter.getLogger()
|
||||||
|
.debug("Loaded {} {} entries.", GameData.getMonsterConfigData().size(), className);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Grasscutter.getLogger().error("Failed to load {} folder.", className);
|
Grasscutter.getLogger().error("Failed to load {} folder.", className);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static <T extends ConfigEntityBase> void loadConfigDataMap(Map<String,T> targetMap, String folderPath, Class<T> configClass) {
|
private static <T extends ConfigEntityBase> void loadConfigDataMap(
|
||||||
|
Map<String, T> targetMap, String folderPath, Class<T> configClass) {
|
||||||
val className = configClass.getName();
|
val className = configClass.getName();
|
||||||
try(val stream = Files.newDirectoryStream(getResourcePath(folderPath), "*.json")) {
|
try (val stream = Files.newDirectoryStream(getResourcePath(folderPath), "*.json")) {
|
||||||
stream.forEach(path -> {
|
stream.forEach(
|
||||||
|
path -> {
|
||||||
try {
|
try {
|
||||||
targetMap.putAll(JsonUtils.loadToMap(path, String.class, configClass));
|
targetMap.putAll(JsonUtils.loadToMap(path, String.class, configClass));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Grasscutter.getLogger().error("failed to load {} entries for {}", className, path.toString(), e);
|
Grasscutter.getLogger()
|
||||||
|
.error("failed to load {} entries for {}", className, path.toString(), e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Grasscutter.getLogger().debug("Loaded {} {} entries.", GameData.getMonsterConfigData().size(), className);
|
Grasscutter.getLogger()
|
||||||
|
.debug("Loaded {} {} entries.", GameData.getMonsterConfigData().size(), className);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Grasscutter.getLogger().error("Failed to load {} folder.", className);
|
Grasscutter.getLogger().error("Failed to load {} folder.", className);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package emu.grasscutter.data.common;
|
package emu.grasscutter.data.common;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
import emu.grasscutter.Grasscutter;
|
import emu.grasscutter.Grasscutter;
|
||||||
import emu.grasscutter.data.GameData;
|
import emu.grasscutter.data.GameData;
|
||||||
import emu.grasscutter.data.excels.dungeon.DailyDungeonData;
|
import emu.grasscutter.data.excels.dungeon.DailyDungeonData;
|
||||||
@ -19,17 +18,30 @@ public final class PointData {
|
|||||||
@Getter private Position rot;
|
@Getter private Position rot;
|
||||||
@Getter private Position size;
|
@Getter private Position size;
|
||||||
|
|
||||||
@SerializedName(value="dungeonIds", alternate={"JHHFPGJNMIN"})
|
@SerializedName(
|
||||||
@Getter private int[] dungeonIds;
|
value = "dungeonIds",
|
||||||
|
alternate = {"JHHFPGJNMIN"})
|
||||||
|
@Getter
|
||||||
|
private int[] dungeonIds;
|
||||||
|
|
||||||
@SerializedName(value="dungeonRandomList", alternate={"OIBKFJNBLHO"})
|
@SerializedName(
|
||||||
@Getter private int[] dungeonRandomList;
|
value = "dungeonRandomList",
|
||||||
|
alternate = {"OIBKFJNBLHO"})
|
||||||
|
@Getter
|
||||||
|
private int[] dungeonRandomList;
|
||||||
|
|
||||||
@SerializedName(value="groupIDs", alternate={"HFOBOOHKBGF"})
|
@SerializedName(
|
||||||
@Getter private int[] groupIDs;
|
value = "groupIDs",
|
||||||
|
alternate = {"HFOBOOHKBGF"})
|
||||||
|
@Getter
|
||||||
|
private int[] groupIDs;
|
||||||
|
|
||||||
@SerializedName(value="tranSceneId", alternate={"JHBICGBAPIH"})
|
@SerializedName(
|
||||||
@Getter @Setter private int tranSceneId;
|
value = "tranSceneId",
|
||||||
|
alternate = {"JHBICGBAPIH"})
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
private int tranSceneId;
|
||||||
|
|
||||||
public String getType() {
|
public String getType() {
|
||||||
return $type;
|
return $type;
|
||||||
|
@ -1,11 +1,6 @@
|
|||||||
package emu.grasscutter.data.excels.monster;
|
package emu.grasscutter.data.excels.monster;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map.Entry;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
import emu.grasscutter.data.GameData;
|
import emu.grasscutter.data.GameData;
|
||||||
import emu.grasscutter.data.GameResource;
|
import emu.grasscutter.data.GameResource;
|
||||||
import emu.grasscutter.data.ResourceType;
|
import emu.grasscutter.data.ResourceType;
|
||||||
@ -14,12 +9,27 @@ import emu.grasscutter.data.common.PropGrowCurve;
|
|||||||
import emu.grasscutter.data.excels.GadgetData;
|
import emu.grasscutter.data.excels.GadgetData;
|
||||||
import emu.grasscutter.game.props.FightProperty;
|
import emu.grasscutter.game.props.FightProperty;
|
||||||
import emu.grasscutter.game.props.MonsterType;
|
import emu.grasscutter.game.props.MonsterType;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
import java.util.Set;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@ResourceType(name = "MonsterExcelConfigData.json", loadPriority = LoadPriority.LOW)
|
@ResourceType(name = "MonsterExcelConfigData.json", loadPriority = LoadPriority.LOW)
|
||||||
@Getter
|
@Getter
|
||||||
public class MonsterData extends GameResource {
|
public class MonsterData extends GameResource {
|
||||||
static public Set<FightProperty> definedFightProperties = Set.of(FightProperty.FIGHT_PROP_BASE_HP, FightProperty.FIGHT_PROP_BASE_ATTACK, FightProperty.FIGHT_PROP_BASE_DEFENSE, FightProperty.FIGHT_PROP_PHYSICAL_SUB_HURT, FightProperty.FIGHT_PROP_FIRE_SUB_HURT, FightProperty.FIGHT_PROP_ELEC_SUB_HURT, FightProperty.FIGHT_PROP_WATER_SUB_HURT, FightProperty.FIGHT_PROP_GRASS_SUB_HURT, FightProperty.FIGHT_PROP_WIND_SUB_HURT, FightProperty.FIGHT_PROP_ROCK_SUB_HURT, FightProperty.FIGHT_PROP_ICE_SUB_HURT);
|
public static Set<FightProperty> definedFightProperties =
|
||||||
|
Set.of(
|
||||||
|
FightProperty.FIGHT_PROP_BASE_HP,
|
||||||
|
FightProperty.FIGHT_PROP_BASE_ATTACK,
|
||||||
|
FightProperty.FIGHT_PROP_BASE_DEFENSE,
|
||||||
|
FightProperty.FIGHT_PROP_PHYSICAL_SUB_HURT,
|
||||||
|
FightProperty.FIGHT_PROP_FIRE_SUB_HURT,
|
||||||
|
FightProperty.FIGHT_PROP_ELEC_SUB_HURT,
|
||||||
|
FightProperty.FIGHT_PROP_WATER_SUB_HURT,
|
||||||
|
FightProperty.FIGHT_PROP_GRASS_SUB_HURT,
|
||||||
|
FightProperty.FIGHT_PROP_WIND_SUB_HURT,
|
||||||
|
FightProperty.FIGHT_PROP_ROCK_SUB_HURT,
|
||||||
|
FightProperty.FIGHT_PROP_ICE_SUB_HURT);
|
||||||
|
|
||||||
@Getter(onMethod_ = @Override)
|
@Getter(onMethod_ = @Override)
|
||||||
private int id;
|
private int id;
|
||||||
@ -42,8 +52,10 @@ public class MonsterData extends GameResource {
|
|||||||
|
|
||||||
@SerializedName("hpBase")
|
@SerializedName("hpBase")
|
||||||
private float baseHp;
|
private float baseHp;
|
||||||
|
|
||||||
@SerializedName("attackBase")
|
@SerializedName("attackBase")
|
||||||
private float baseAttack;
|
private float baseAttack;
|
||||||
|
|
||||||
@SerializedName("defenseBase")
|
@SerializedName("defenseBase")
|
||||||
private float baseDefense;
|
private float baseDefense;
|
||||||
|
|
||||||
@ -84,11 +96,12 @@ public class MonsterData extends GameResource {
|
|||||||
|
|
||||||
this.describeData = GameData.getMonsterDescribeDataMap().get(this.getDescribeId());
|
this.describeData = GameData.getMonsterDescribeDataMap().get(this.getDescribeId());
|
||||||
|
|
||||||
if (this.describeData == null){
|
if (this.describeData == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for(Entry<Integer, MonsterSpecialNameData> entry: GameData.getMonsterSpecialNameDataMap().entrySet()) {
|
for (Entry<Integer, MonsterSpecialNameData> entry :
|
||||||
if (entry.getValue().getSpecialNameLabId() == this.getDescribeData().getSpecialNameLabId()){
|
GameData.getMonsterSpecialNameDataMap().entrySet()) {
|
||||||
|
if (entry.getValue().getSpecialNameLabId() == this.getDescribeData().getSpecialNameLabId()) {
|
||||||
this.specialNameId = entry.getKey();
|
this.specialNameId = entry.getKey();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -13,9 +13,16 @@ public class MonsterDescribeData extends GameResource {
|
|||||||
private int id;
|
private int id;
|
||||||
|
|
||||||
private long nameTextMapHash;
|
private long nameTextMapHash;
|
||||||
@SerializedName(value = "titleId", alternate={"titleID"})
|
|
||||||
|
@SerializedName(
|
||||||
|
value = "titleId",
|
||||||
|
alternate = {"titleID"})
|
||||||
private int titleId;
|
private int titleId;
|
||||||
@SerializedName(value = "specialNameLabId", alternate={"specialNameLabID"})
|
|
||||||
|
@SerializedName(
|
||||||
|
value = "specialNameLabId",
|
||||||
|
alternate = {"specialNameLabID"})
|
||||||
private int specialNameLabId;
|
private int specialNameLabId;
|
||||||
|
|
||||||
private MonsterSpecialNameData specialNameData;
|
private MonsterSpecialNameData specialNameData;
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,6 @@ import emu.grasscutter.game.mail.Mail;
|
|||||||
import emu.grasscutter.game.player.Player;
|
import emu.grasscutter.game.player.Player;
|
||||||
import emu.grasscutter.game.quest.GameMainQuest;
|
import emu.grasscutter.game.quest.GameMainQuest;
|
||||||
import emu.grasscutter.game.world.SceneGroupInstance;
|
import emu.grasscutter.game.world.SceneGroupInstance;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
@ -457,8 +456,9 @@ public final class DatabaseHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static SceneGroupInstance loadGroupInstance(int groupId, Player owner) {
|
public static SceneGroupInstance loadGroupInstance(int groupId, Player owner) {
|
||||||
return DatabaseManager.getGameDatastore().find(SceneGroupInstance.class)
|
return DatabaseManager.getGameDatastore()
|
||||||
.filter(Filters.and(Filters.eq("ownerUid", owner.getUid()),
|
.find(SceneGroupInstance.class)
|
||||||
Filters.eq("groupId", groupId))).first();
|
.filter(Filters.and(Filters.eq("ownerUid", owner.getUid()), Filters.eq("groupId", groupId)))
|
||||||
|
.first();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ public class PlayerActivityData {
|
|||||||
/**
|
/**
|
||||||
* @return True when the progress of this watcher has reached the total progress.
|
* @return True when the progress of this watcher has reached the total progress.
|
||||||
*/
|
*/
|
||||||
public boolean isFinished(){
|
public boolean isFinished() {
|
||||||
return this.curProgress >= this.totalProgress;
|
return this.curProgress >= this.totalProgress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,14 +43,13 @@ import emu.grasscutter.utils.ProtoHelper;
|
|||||||
import it.unimi.dsi.fastutil.ints.*;
|
import it.unimi.dsi.fastutil.ints.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.val;
|
import lombok.val;
|
||||||
import org.bson.types.ObjectId;
|
import org.bson.types.ObjectId;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
@Entity(value = "avatars", useDiscriminator = false)
|
@Entity(value = "avatars", useDiscriminator = false)
|
||||||
public class Avatar {
|
public class Avatar {
|
||||||
@Transient @Getter private final Int2ObjectMap<GameItem> equips;
|
@Transient @Getter private final Int2ObjectMap<GameItem> equips;
|
||||||
@ -237,8 +236,7 @@ public class Avatar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Changes this avatar's skill depot.
|
* Changes this avatar's skill depot. Does not notify the player of the change.
|
||||||
* Does not notify the player of the change.
|
|
||||||
*
|
*
|
||||||
* @param skillDepot The new skill depot.
|
* @param skillDepot The new skill depot.
|
||||||
*/
|
*/
|
||||||
@ -275,7 +273,8 @@ public class Avatar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Changes the avatar's element to the target element, if the character has values for it set in the candSkillDepot
|
* Changes the avatar's element to the target element, if the character has values for it set in
|
||||||
|
* the candSkillDepot
|
||||||
*
|
*
|
||||||
* @param elementTypeToChange element to change to
|
* @param elementTypeToChange element to change to
|
||||||
* @return false if failed or already using that element, true if it actually changed
|
* @return false if failed or already using that element, true if it actually changed
|
||||||
@ -285,8 +284,7 @@ public class Avatar {
|
|||||||
var candSkillDepotIndex = elementTypeToChange.getDepotIndex();
|
var candSkillDepotIndex = elementTypeToChange.getDepotIndex();
|
||||||
|
|
||||||
// if no candidate skill to change or index out of bound
|
// if no candidate skill to change or index out of bound
|
||||||
if (candSkillDepotIdsList == null ||
|
if (candSkillDepotIdsList == null || candSkillDepotIndex >= candSkillDepotIdsList.size()) {
|
||||||
candSkillDepotIndex >= candSkillDepotIdsList.size()) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,10 +6,11 @@ import emu.grasscutter.server.packet.send.PacketDungeonSettleNotify;
|
|||||||
public class BasicDungeonSettleListener implements DungeonSettleListener {
|
public class BasicDungeonSettleListener implements DungeonSettleListener {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDungeonSettle(DungeonManager dungeonManager, BaseDungeonResult.DungeonEndReason endReason) {
|
public void onDungeonSettle(
|
||||||
|
DungeonManager dungeonManager, BaseDungeonResult.DungeonEndReason endReason) {
|
||||||
var scene = dungeonManager.getScene();
|
var scene = dungeonManager.getScene();
|
||||||
var dungeonData = dungeonManager.getDungeonData();
|
var dungeonData = dungeonManager.getDungeonData();
|
||||||
var time = scene.getSceneTimeSeconds() - dungeonManager.getStartSceneTime() ;
|
var time = scene.getSceneTimeSeconds() - dungeonManager.getStartSceneTime();
|
||||||
// TODO time taken and chests handling
|
// TODO time taken and chests handling
|
||||||
DungeonEndStats stats = new DungeonEndStats(scene.getKilledMonsterCount(), time, 0, endReason);
|
DungeonEndStats stats = new DungeonEndStats(scene.getKilledMonsterCount(), time, 0, endReason);
|
||||||
|
|
||||||
|
@ -24,20 +24,17 @@ import emu.grasscutter.utils.Position;
|
|||||||
import emu.grasscutter.utils.Utils;
|
import emu.grasscutter.utils.Utils;
|
||||||
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
|
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
|
||||||
import it.unimi.dsi.fastutil.ints.IntSet;
|
import it.unimi.dsi.fastutil.ints.IntSet;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.IntStream;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
import lombok.val;
|
import lombok.val;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import java.util.stream.IntStream;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO handle time limits
|
* TODO handle time limits TODO handle respawn points TODO handle team wipes and respawns TODO check
|
||||||
* TODO handle respawn points
|
* monster level and levelConfigMap
|
||||||
* TODO handle team wipes and respawns
|
|
||||||
* TODO check monster level and levelConfigMap
|
|
||||||
*/
|
*/
|
||||||
public final class DungeonManager {
|
public final class DungeonManager {
|
||||||
@Getter private final Scene scene;
|
@Getter private final Scene scene;
|
||||||
@ -71,14 +68,12 @@ public final class DungeonManager {
|
|||||||
if (getScene().getWorld().getServer().getDungeonSystem().triggerCondition(cond, params)) {
|
if (getScene().getWorld().getServer().getDungeonSystem().triggerCondition(cond, params)) {
|
||||||
finishedConditions[i] = 1;
|
finishedConditions[i] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isFinishedSuccessfully()) {
|
if (isFinishedSuccessfully()) {
|
||||||
finishDungeon();
|
finishDungeon();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isFinishedSuccessfully() {
|
public boolean isFinishedSuccessfully() {
|
||||||
@ -86,7 +81,7 @@ public final class DungeonManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getLevelForMonster(int id) {
|
public int getLevelForMonster(int id) {
|
||||||
//TODO should use levelConfigMap? and how?
|
// TODO should use levelConfigMap? and how?
|
||||||
return dungeonData.getShowLevel();
|
return dungeonData.getShowLevel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,15 +93,16 @@ public final class DungeonManager {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
scene.broadcastPacket(new PacketDungeonWayPointNotify(activeDungeonWayPoints.add(pointId), activeDungeonWayPoints));
|
scene.broadcastPacket(
|
||||||
|
new PacketDungeonWayPointNotify(
|
||||||
|
activeDungeonWayPoints.add(pointId), activeDungeonWayPoints));
|
||||||
newestWayPoint = pointId;
|
newestWayPoint = pointId;
|
||||||
|
|
||||||
Grasscutter.getLogger().debug("[unimplemented respawn] activated respawn point {}", pointId);
|
Grasscutter.getLogger().debug("[unimplemented respawn] activated respawn point {}", pointId);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable public Position getRespawnLocation() {
|
||||||
public Position getRespawnLocation() {
|
|
||||||
if (newestWayPoint == 0) { // validity is checked before setting it, so if != 0 its always valid
|
if (newestWayPoint == 0) { // validity is checked before setting it, so if != 0 its always valid
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -123,7 +119,9 @@ public final class DungeonManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean getStatueDrops(Player player, boolean useCondensed, int groupId) {
|
public boolean getStatueDrops(Player player, boolean useCondensed, int groupId) {
|
||||||
if (!isFinishedSuccessfully() || dungeonData.getRewardPreviewData() == null || dungeonData.getRewardPreviewData().getPreviewItems().length == 0) {
|
if (!isFinishedSuccessfully()
|
||||||
|
|| dungeonData.getRewardPreviewData() == null
|
||||||
|
|| dungeonData.getRewardPreviewData().getPreviewItems().length == 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,7 +130,6 @@ public final class DungeonManager {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!handleCost(player, useCondensed)) {
|
if (!handleCost(player, useCondensed)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -198,8 +195,10 @@ public final class DungeonManager {
|
|||||||
|
|
||||||
// Roll items for this group.
|
// Roll items for this group.
|
||||||
// Here, we have to handle stacking, or the client will not display results correctly.
|
// Here, we have to handle stacking, or the client will not display results correctly.
|
||||||
// For now, we use the following logic: If the possible drop item are a list of multiple items,
|
// For now, we use the following logic: If the possible drop item are a list of multiple
|
||||||
// we roll them separately. If not, we stack them. This should work out in practice, at least
|
// items,
|
||||||
|
// we roll them separately. If not, we stack them. This should work out in practice, at
|
||||||
|
// least
|
||||||
// for the currently existing set of dungeons.
|
// for the currently existing set of dungeons.
|
||||||
if (entry.getItems().size() == 1) {
|
if (entry.getItems().size() == 1) {
|
||||||
rewards.add(new GameItem(entry.getItems().get(0), amount));
|
rewards.add(new GameItem(entry.getItems().get(0), amount));
|
||||||
@ -207,7 +206,8 @@ public final class DungeonManager {
|
|||||||
for (int i = 0; i < amount; i++) {
|
for (int i = 0; i < amount; i++) {
|
||||||
// int itemIndex = ThreadLocalRandom.current().nextInt(0, entry.getItems().size());
|
// int itemIndex = ThreadLocalRandom.current().nextInt(0, entry.getItems().size());
|
||||||
// int itemId = entry.getItems().get(itemIndex);
|
// int itemId = entry.getItems().get(itemIndex);
|
||||||
int itemId = Utils.drawRandomListElement(entry.getItems(), entry.getItemProbabilities());
|
int itemId =
|
||||||
|
Utils.drawRandomListElement(entry.getItems(), entry.getItemProbabilities());
|
||||||
rewards.add(new GameItem(itemId, 1));
|
rewards.add(new GameItem(itemId, 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -215,7 +215,8 @@ public final class DungeonManager {
|
|||||||
}
|
}
|
||||||
// Otherwise, we fall back to the preview data.
|
// Otherwise, we fall back to the preview data.
|
||||||
else {
|
else {
|
||||||
Grasscutter.getLogger().info("No drop data found or dungeon {}, falling back to preview data ...", dungeonId);
|
Grasscutter.getLogger()
|
||||||
|
.info("No drop data found or dungeon {}, falling back to preview data ...", dungeonId);
|
||||||
for (ItemParamData param : dungeonData.getRewardPreviewData().getPreviewItems()) {
|
for (ItemParamData param : dungeonData.getRewardPreviewData().getPreviewItems()) {
|
||||||
rewards.add(new GameItem(param.getId(), Math.max(param.getCount(), 1)));
|
rewards.add(new GameItem(param.getId(), Math.max(param.getCount(), 1)));
|
||||||
}
|
}
|
||||||
@ -232,9 +233,13 @@ public final class DungeonManager {
|
|||||||
case DUNGEON_ACTIVITY -> {
|
case DUNGEON_ACTIVITY -> {
|
||||||
switch (getDungeonData().getPlayType()) {
|
switch (getDungeonData().getPlayType()) {
|
||||||
case DUNGEON_PLAY_TYPE_TRIAL_AVATAR -> {
|
case DUNGEON_PLAY_TYPE_TRIAL_AVATAR -> {
|
||||||
val activityHandler = player.getActivityManager()
|
val activityHandler =
|
||||||
.getActivityHandlerAs(ActivityType.NEW_ACTIVITY_TRIAL_AVATAR, TrialAvatarActivityHandler.class);
|
player
|
||||||
activityHandler.ifPresent(trialAvatarActivityHandler ->
|
.getActivityManager()
|
||||||
|
.getActivityHandlerAs(
|
||||||
|
ActivityType.NEW_ACTIVITY_TRIAL_AVATAR, TrialAvatarActivityHandler.class);
|
||||||
|
activityHandler.ifPresent(
|
||||||
|
trialAvatarActivityHandler ->
|
||||||
this.trialTeam = trialAvatarActivityHandler.getTrialAvatarDungeonTeam());
|
this.trialTeam = trialAvatarActivityHandler.getTrialAvatarDungeonTeam());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -247,7 +252,7 @@ public final class DungeonManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unsetTrialTeam(Player player){
|
public void unsetTrialTeam(Player player) {
|
||||||
if (this.trialTeam == null) return;
|
if (this.trialTeam == null) return;
|
||||||
|
|
||||||
player.getTeamManager().removeTrialAvatar();
|
player.getTeamManager().removeTrialAvatar();
|
||||||
@ -256,8 +261,12 @@ public final class DungeonManager {
|
|||||||
|
|
||||||
public void startDungeon() {
|
public void startDungeon() {
|
||||||
this.startSceneTime = scene.getSceneTimeSeconds();
|
this.startSceneTime = scene.getSceneTimeSeconds();
|
||||||
scene.getPlayers().forEach(p -> {
|
scene
|
||||||
p.getQuestManager().queueEvent(QuestContent.QUEST_CONTENT_ENTER_DUNGEON, dungeonData.getId());
|
.getPlayers()
|
||||||
|
.forEach(
|
||||||
|
p -> {
|
||||||
|
p.getQuestManager()
|
||||||
|
.queueEvent(QuestContent.QUEST_CONTENT_ENTER_DUNGEON, dungeonData.getId());
|
||||||
applyTrialTeam(p);
|
applyTrialTeam(p);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -268,10 +277,16 @@ public final class DungeonManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void notifyEndDungeon(boolean successfully) {
|
public void notifyEndDungeon(boolean successfully) {
|
||||||
scene.getPlayers().forEach(p -> {
|
scene
|
||||||
|
.getPlayers()
|
||||||
|
.forEach(
|
||||||
|
p -> {
|
||||||
// Quest trigger
|
// Quest trigger
|
||||||
p.getQuestManager().queueEvent(successfully ?
|
p.getQuestManager()
|
||||||
QuestContent.QUEST_CONTENT_FINISH_DUNGEON : QuestContent.QUEST_CONTENT_FAIL_DUNGEON,
|
.queueEvent(
|
||||||
|
successfully
|
||||||
|
? QuestContent.QUEST_CONTENT_FINISH_DUNGEON
|
||||||
|
: QuestContent.QUEST_CONTENT_FAIL_DUNGEON,
|
||||||
dungeonData.getId());
|
dungeonData.getId());
|
||||||
|
|
||||||
// Battle pass trigger
|
// Battle pass trigger
|
||||||
@ -279,7 +294,9 @@ public final class DungeonManager {
|
|||||||
p.getBattlePassManager().triggerMission(WatcherTriggerType.TRIGGER_FINISH_DUNGEON);
|
p.getBattlePassManager().triggerMission(WatcherTriggerType.TRIGGER_FINISH_DUNGEON);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
scene.getScriptManager().callEvent(new ScriptArgs(0, EventType.EVENT_DUNGEON_SETTLE, successfully ? 1 : 0));
|
scene
|
||||||
|
.getScriptManager()
|
||||||
|
.callEvent(new ScriptArgs(0, EventType.EVENT_DUNGEON_SETTLE, successfully ? 1 : 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void quitDungeon() {
|
public void quitDungeon() {
|
||||||
|
@ -16,13 +16,13 @@ import emu.grasscutter.server.packet.send.PacketDungeonEntryInfoRsp;
|
|||||||
import emu.grasscutter.utils.Position;
|
import emu.grasscutter.utils.Position;
|
||||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||||
|
import java.util.List;
|
||||||
import lombok.val;
|
import lombok.val;
|
||||||
import org.reflections.Reflections;
|
import org.reflections.Reflections;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class DungeonSystem extends BaseGameSystem {
|
public class DungeonSystem extends BaseGameSystem {
|
||||||
private static final BasicDungeonSettleListener basicDungeonSettleObserver = new BasicDungeonSettleListener();
|
private static final BasicDungeonSettleListener basicDungeonSettleObserver =
|
||||||
|
new BasicDungeonSettleListener();
|
||||||
private final Int2ObjectMap<DungeonBaseHandler> passCondHandlers;
|
private final Int2ObjectMap<DungeonBaseHandler> passCondHandlers;
|
||||||
|
|
||||||
public DungeonSystem(GameServer server) {
|
public DungeonSystem(GameServer server) {
|
||||||
@ -32,7 +32,10 @@ public class DungeonSystem extends BaseGameSystem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void registerHandlers() {
|
public void registerHandlers() {
|
||||||
this.registerHandlers(this.passCondHandlers, "emu.grasscutter.game.dungeons.pass_condition", DungeonBaseHandler.class);
|
this.registerHandlers(
|
||||||
|
this.passCondHandlers,
|
||||||
|
"emu.grasscutter.game.dungeons.pass_condition",
|
||||||
|
DungeonBaseHandler.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> void registerHandlers(Int2ObjectMap<T> map, String packageName, Class<T> clazz) {
|
public <T> void registerHandlers(Int2ObjectMap<T> map, String packageName, Class<T> clazz) {
|
||||||
@ -70,11 +73,13 @@ public class DungeonSystem extends BaseGameSystem {
|
|||||||
player.sendPacket(new PacketDungeonEntryInfoRsp(player, entry.getPointData()));
|
player.sendPacket(new PacketDungeonEntryInfoRsp(player, entry.getPointData()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean triggerCondition(DungeonPassConfigData.DungeonPassCondition condition, int... params) {
|
public boolean triggerCondition(
|
||||||
|
DungeonPassConfigData.DungeonPassCondition condition, int... params) {
|
||||||
var handler = passCondHandlers.get(condition.getCondType().ordinal());
|
var handler = passCondHandlers.get(condition.getCondType().ordinal());
|
||||||
|
|
||||||
if (handler == null) {
|
if (handler == null) {
|
||||||
Grasscutter.getLogger().debug("Could not trigger condition {} at {}", condition.getCondType(), params);
|
Grasscutter.getLogger()
|
||||||
|
.debug("Could not trigger condition {} at {}", condition.getCondType(), params);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,7 +92,12 @@ public class DungeonSystem extends BaseGameSystem {
|
|||||||
if (data == null) {
|
if (data == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Grasscutter.getLogger().info("{}({}) is trying to enter dungeon {}" ,player.getNickname(),player.getUid(),dungeonId);
|
Grasscutter.getLogger()
|
||||||
|
.info(
|
||||||
|
"{}({}) is trying to enter dungeon {}",
|
||||||
|
player.getNickname(),
|
||||||
|
player.getUid(),
|
||||||
|
dungeonId);
|
||||||
|
|
||||||
int sceneId = data.getSceneId();
|
int sceneId = data.getSceneId();
|
||||||
var scene = player.getScene();
|
var scene = player.getScene();
|
||||||
@ -102,16 +112,20 @@ public class DungeonSystem extends BaseGameSystem {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** used in tower dungeons handoff */
|
||||||
* used in tower dungeons handoff
|
public boolean handoffDungeon(
|
||||||
*/
|
Player player, int dungeonId, List<DungeonSettleListener> dungeonSettleListeners) {
|
||||||
public boolean handoffDungeon(Player player, int dungeonId, List<DungeonSettleListener> dungeonSettleListeners) {
|
|
||||||
DungeonData data = GameData.getDungeonDataMap().get(dungeonId);
|
DungeonData data = GameData.getDungeonDataMap().get(dungeonId);
|
||||||
|
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Grasscutter.getLogger().info("{}({}) is trying to enter tower dungeon {}" ,player.getNickname(),player.getUid(),dungeonId);
|
Grasscutter.getLogger()
|
||||||
|
.info(
|
||||||
|
"{}({}) is trying to enter tower dungeon {}",
|
||||||
|
player.getNickname(),
|
||||||
|
player.getUid(),
|
||||||
|
dungeonId);
|
||||||
|
|
||||||
if (player.getWorld().transferPlayerToScene(player, data.getSceneId(), data)) {
|
if (player.getWorld().transferPlayerToScene(player, data.getSceneId(), data)) {
|
||||||
dungeonSettleListeners.forEach(player.getScene()::addDungeonSettleObserver);
|
dungeonSettleListeners.forEach(player.getScene()::addDungeonSettleObserver);
|
||||||
@ -122,7 +136,7 @@ public class DungeonSystem extends BaseGameSystem {
|
|||||||
public void exitDungeon(Player player) {
|
public void exitDungeon(Player player) {
|
||||||
Scene scene = player.getScene();
|
Scene scene = player.getScene();
|
||||||
|
|
||||||
if (scene==null || scene.getSceneType() != SceneType.SCENE_DUNGEON) {
|
if (scene == null || scene.getSceneType() != SceneType.SCENE_DUNGEON) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +154,7 @@ public class DungeonSystem extends BaseGameSystem {
|
|||||||
if (entry != null) {
|
if (entry != null) {
|
||||||
prevPos.set(entry.getPointData().getTranPos());
|
prevPos.set(entry.getPointData().getTranPos());
|
||||||
}
|
}
|
||||||
if(!dungeonManager.isFinishedSuccessfully()){
|
if (!dungeonManager.isFinishedSuccessfully()) {
|
||||||
dungeonManager.quitDungeon();
|
dungeonManager.quitDungeon();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,7 +164,6 @@ public class DungeonSystem extends BaseGameSystem {
|
|||||||
player.getTeamManager().cleanTemporaryTeam();
|
player.getTeamManager().cleanTemporaryTeam();
|
||||||
player.getTowerManager().clearEntry();
|
player.getTowerManager().clearEntry();
|
||||||
|
|
||||||
|
|
||||||
// Transfer player back to world
|
// Transfer player back to world
|
||||||
player.getWorld().transferPlayerToScene(player, prevScene, prevPos);
|
player.getWorld().transferPlayerToScene(player, prevScene, prevPos);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package emu.grasscutter.game.dungeons;
|
package emu.grasscutter.game.dungeons;
|
||||||
|
|
||||||
import emu.grasscutter.game.dungeons.dungeon_results.BaseDungeonResult.DungeonEndReason;
|
import emu.grasscutter.game.dungeons.dungeon_results.BaseDungeonResult.DungeonEndReason;
|
||||||
import emu.grasscutter.game.world.SceneGroupInstance;
|
|
||||||
import emu.grasscutter.game.dungeons.dungeon_results.TowerResult;
|
import emu.grasscutter.game.dungeons.dungeon_results.TowerResult;
|
||||||
import emu.grasscutter.server.packet.send.PacketDungeonSettleNotify;
|
import emu.grasscutter.server.packet.send.PacketDungeonSettleNotify;
|
||||||
import emu.grasscutter.server.packet.send.PacketTowerFloorRecordChangeNotify;
|
import emu.grasscutter.server.packet.send.PacketTowerFloorRecordChangeNotify;
|
||||||
@ -12,9 +11,13 @@ public class TowerDungeonSettleListener implements DungeonSettleListener {
|
|||||||
public void onDungeonSettle(DungeonManager dungeonManager, DungeonEndReason endReason) {
|
public void onDungeonSettle(DungeonManager dungeonManager, DungeonEndReason endReason) {
|
||||||
var scene = dungeonManager.getScene();
|
var scene = dungeonManager.getScene();
|
||||||
var dungeonData = dungeonManager.getDungeonData();
|
var dungeonData = dungeonManager.getDungeonData();
|
||||||
if (scene.getLoadedGroups().stream().anyMatch(g -> {
|
if (scene.getLoadedGroups().stream()
|
||||||
|
.anyMatch(
|
||||||
|
g -> {
|
||||||
var variables = scene.getScriptManager().getVariables(g.id);
|
var variables = scene.getScriptManager().getVariables(g.id);
|
||||||
return variables != null && variables.containsKey("stage") && variables.get("stage") == 1;
|
return variables != null
|
||||||
|
&& variables.containsKey("stage")
|
||||||
|
&& variables.get("stage") == 1;
|
||||||
})) {
|
})) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -22,17 +25,16 @@ public class TowerDungeonSettleListener implements DungeonSettleListener {
|
|||||||
var towerManager = scene.getPlayers().get(0).getTowerManager();
|
var towerManager = scene.getPlayers().get(0).getTowerManager();
|
||||||
|
|
||||||
towerManager.notifyCurLevelRecordChangeWhenDone(3);
|
towerManager.notifyCurLevelRecordChangeWhenDone(3);
|
||||||
scene.broadcastPacket(new PacketTowerFloorRecordChangeNotify(
|
scene.broadcastPacket(
|
||||||
towerManager.getCurrentFloorId(),
|
new PacketTowerFloorRecordChangeNotify(
|
||||||
3,
|
towerManager.getCurrentFloorId(), 3, towerManager.canEnterScheduleFloor()));
|
||||||
towerManager.canEnterScheduleFloor()
|
|
||||||
));
|
|
||||||
|
|
||||||
var challenge = scene.getChallenge();
|
var challenge = scene.getChallenge();
|
||||||
var dungeonStats = new DungeonEndStats(scene.getKilledMonsterCount(), challenge.getFinishedTime(), 0, endReason);
|
var dungeonStats =
|
||||||
|
new DungeonEndStats(
|
||||||
|
scene.getKilledMonsterCount(), challenge.getFinishedTime(), 0, endReason);
|
||||||
var result = new TowerResult(dungeonData, dungeonStats, towerManager, challenge);
|
var result = new TowerResult(dungeonData, dungeonStats, towerManager, challenge);
|
||||||
|
|
||||||
scene.broadcastPacket(new PacketDungeonSettleNotify(result));
|
scene.broadcastPacket(new PacketDungeonSettleNotify(result));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,6 @@ import java.util.List;
|
|||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.val;
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@ -88,27 +87,40 @@ public class WorldChallenge {
|
|||||||
var scene = this.getScene();
|
var scene = this.getScene();
|
||||||
var dungeonManager = scene.getDungeonManager();
|
var dungeonManager = scene.getDungeonManager();
|
||||||
if (dungeonManager != null && dungeonManager.getDungeonData() != null) {
|
if (dungeonManager != null && dungeonManager.getDungeonData() != null) {
|
||||||
scene.getPlayers().forEach(p -> p.getActivityManager().triggerWatcher(
|
scene
|
||||||
|
.getPlayers()
|
||||||
|
.forEach(
|
||||||
|
p ->
|
||||||
|
p.getActivityManager()
|
||||||
|
.triggerWatcher(
|
||||||
WatcherTriggerType.TRIGGER_FINISH_CHALLENGE,
|
WatcherTriggerType.TRIGGER_FINISH_CHALLENGE,
|
||||||
String.valueOf(dungeonManager.getDungeonData().getId()),
|
String.valueOf(dungeonManager.getDungeonData().getId()),
|
||||||
String.valueOf(this.getGroup().id),
|
String.valueOf(this.getGroup().id),
|
||||||
String.valueOf(this.getChallengeId())
|
String.valueOf(this.getChallengeId())));
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
scene.getScriptManager().callEvent(
|
scene
|
||||||
|
.getScriptManager()
|
||||||
|
.callEvent(
|
||||||
// TODO record the time in PARAM2 and used in action
|
// TODO record the time in PARAM2 and used in action
|
||||||
new ScriptArgs(this.getGroup().id, EventType.EVENT_CHALLENGE_SUCCESS).setParam2(finishedTime));
|
new ScriptArgs(this.getGroup().id, EventType.EVENT_CHALLENGE_SUCCESS)
|
||||||
this.getScene().triggerDungeonEvent(DungeonPassConditionType.DUNGEON_COND_FINISH_CHALLENGE, getChallengeId(), getChallengeIndex());
|
.setParam2(finishedTime));
|
||||||
|
this.getScene()
|
||||||
|
.triggerDungeonEvent(
|
||||||
|
DungeonPassConditionType.DUNGEON_COND_FINISH_CHALLENGE,
|
||||||
|
getChallengeId(),
|
||||||
|
getChallengeIndex());
|
||||||
|
|
||||||
this.challengeTriggers.forEach(t -> t.onFinish(this));
|
this.challengeTriggers.forEach(t -> t.onFinish(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void fail(){
|
public void fail() {
|
||||||
if (!this.inProgress()) return;
|
if (!this.inProgress()) return;
|
||||||
this.finish(true);
|
this.finish(true);
|
||||||
|
|
||||||
this.getScene().getScriptManager().callEvent(new ScriptArgs(this.getGroup().id, EventType.EVENT_CHALLENGE_FAIL));
|
this.getScene()
|
||||||
|
.getScriptManager()
|
||||||
|
.callEvent(new ScriptArgs(this.getGroup().id, EventType.EVENT_CHALLENGE_FAIL));
|
||||||
challengeTriggers.forEach(t -> t.onFinish(this));
|
challengeTriggers.forEach(t -> t.onFinish(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,11 +156,10 @@ public class WorldChallenge {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onGroupTriggerDeath(SceneTrigger trigger) {
|
public void onGroupTriggerDeath(SceneTrigger trigger) {
|
||||||
if(!this.inProgress()) return;
|
if (!this.inProgress()) return;
|
||||||
|
|
||||||
var triggerGroup = trigger.getCurrentGroup();
|
var triggerGroup = trigger.getCurrentGroup();
|
||||||
if (triggerGroup == null ||
|
if (triggerGroup == null || triggerGroup.id != getGroup().id) {
|
||||||
triggerGroup.id != getGroup().id) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,10 +4,9 @@ import emu.grasscutter.data.GameData;
|
|||||||
import emu.grasscutter.game.dungeons.challenge.WorldChallenge;
|
import emu.grasscutter.game.dungeons.challenge.WorldChallenge;
|
||||||
import emu.grasscutter.game.world.Scene;
|
import emu.grasscutter.game.world.Scene;
|
||||||
import emu.grasscutter.scripts.data.SceneGroup;
|
import emu.grasscutter.scripts.data.SceneGroup;
|
||||||
import lombok.val;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import lombok.val;
|
||||||
|
|
||||||
public abstract class ChallengeFactory {
|
public abstract class ChallengeFactory {
|
||||||
private static final List<ChallengeFactoryHandler> challengeFactoryHandlers = new ArrayList<>();
|
private static final List<ChallengeFactoryHandler> challengeFactoryHandlers = new ArrayList<>();
|
||||||
@ -21,15 +20,24 @@ public abstract class ChallengeFactory {
|
|||||||
challengeFactoryHandlers.add(new TriggerInTimeChallengeFactoryHandler());
|
challengeFactoryHandlers.add(new TriggerInTimeChallengeFactoryHandler());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static WorldChallenge getChallenge(int localChallengeId, int challengeDataId, int param3, int param4, int param5, int param6, Scene scene, SceneGroup group){
|
public static WorldChallenge getChallenge(
|
||||||
|
int localChallengeId,
|
||||||
|
int challengeDataId,
|
||||||
|
int param3,
|
||||||
|
int param4,
|
||||||
|
int param5,
|
||||||
|
int param6,
|
||||||
|
Scene scene,
|
||||||
|
SceneGroup group) {
|
||||||
val challengeData = GameData.getDungeonChallengeConfigDataMap().get(challengeDataId);
|
val challengeData = GameData.getDungeonChallengeConfigDataMap().get(challengeDataId);
|
||||||
val challengeType = challengeData.getChallengeType();
|
val challengeType = challengeData.getChallengeType();
|
||||||
|
|
||||||
for(var handler : challengeFactoryHandlers){
|
for (var handler : challengeFactoryHandlers) {
|
||||||
if(!handler.isThisType(challengeType)){
|
if (!handler.isThisType(challengeType)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
return handler.build(localChallengeId, challengeDataId, param3, param4, param5, param6, scene, group);
|
return handler.build(
|
||||||
|
localChallengeId, challengeDataId, param3, param4, param5, param6, scene, group);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -7,5 +7,14 @@ import emu.grasscutter.scripts.data.SceneGroup;
|
|||||||
|
|
||||||
public interface ChallengeFactoryHandler {
|
public interface ChallengeFactoryHandler {
|
||||||
boolean isThisType(ChallengeType challengeType);
|
boolean isThisType(ChallengeType challengeType);
|
||||||
WorldChallenge build(int challengeIndex, int challengeId, int param3, int param4, int param5, int param6, Scene scene, SceneGroup group);
|
|
||||||
|
WorldChallenge build(
|
||||||
|
int challengeIndex,
|
||||||
|
int challengeId,
|
||||||
|
int param3,
|
||||||
|
int param4,
|
||||||
|
int param5,
|
||||||
|
int param6,
|
||||||
|
Scene scene,
|
||||||
|
SceneGroup group);
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,17 @@
|
|||||||
package emu.grasscutter.game.dungeons.challenge.factory;
|
package emu.grasscutter.game.dungeons.challenge.factory;
|
||||||
|
|
||||||
|
import static emu.grasscutter.game.dungeons.challenge.enums.ChallengeType.CHALLENGE_KILL_COUNT_GUARD_HP;
|
||||||
|
|
||||||
import emu.grasscutter.game.dungeons.challenge.WorldChallenge;
|
import emu.grasscutter.game.dungeons.challenge.WorldChallenge;
|
||||||
import emu.grasscutter.game.dungeons.challenge.enums.ChallengeType;
|
import emu.grasscutter.game.dungeons.challenge.enums.ChallengeType;
|
||||||
import emu.grasscutter.game.dungeons.challenge.trigger.GuardTrigger;
|
import emu.grasscutter.game.dungeons.challenge.trigger.GuardTrigger;
|
||||||
import emu.grasscutter.game.dungeons.challenge.trigger.KillMonsterCountTrigger;
|
import emu.grasscutter.game.dungeons.challenge.trigger.KillMonsterCountTrigger;
|
||||||
import emu.grasscutter.game.world.Scene;
|
import emu.grasscutter.game.world.Scene;
|
||||||
import emu.grasscutter.scripts.data.SceneGroup;
|
import emu.grasscutter.scripts.data.SceneGroup;
|
||||||
|
import java.util.List;
|
||||||
import lombok.val;
|
import lombok.val;
|
||||||
|
|
||||||
import java.util.List;
|
public class KillAndGuardChallengeFactoryHandler implements ChallengeFactoryHandler {
|
||||||
|
|
||||||
import static emu.grasscutter.game.dungeons.challenge.enums.ChallengeType.CHALLENGE_KILL_COUNT_GUARD_HP;
|
|
||||||
|
|
||||||
public class KillAndGuardChallengeFactoryHandler implements ChallengeFactoryHandler{
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isThisType(ChallengeType challengeType) {
|
public boolean isThisType(ChallengeType challengeType) {
|
||||||
// ActiveChallenge with 1,188,234101003,12,3030,0
|
// ActiveChallenge with 1,188,234101003,12,3030,0
|
||||||
@ -20,10 +19,19 @@ public class KillAndGuardChallengeFactoryHandler implements ChallengeFactoryHand
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override /*TODO check param4 == monstesToKill*/
|
@Override /*TODO check param4 == monstesToKill*/
|
||||||
public WorldChallenge build(int challengeIndex, int challengeId, int groupId, int monstersToKill, int gadgetCFGId, int unused, Scene scene, SceneGroup group) {
|
public WorldChallenge build(
|
||||||
|
int challengeIndex,
|
||||||
|
int challengeId,
|
||||||
|
int groupId,
|
||||||
|
int monstersToKill,
|
||||||
|
int gadgetCFGId,
|
||||||
|
int unused,
|
||||||
|
Scene scene,
|
||||||
|
SceneGroup group) {
|
||||||
val realGroup = scene.getScriptManager().getGroupById(groupId);
|
val realGroup = scene.getScriptManager().getGroupById(groupId);
|
||||||
return new WorldChallenge(
|
return new WorldChallenge(
|
||||||
scene, realGroup,
|
scene,
|
||||||
|
realGroup,
|
||||||
challengeId, // Id
|
challengeId, // Id
|
||||||
challengeIndex, // Index
|
challengeIndex, // Index
|
||||||
List.of(monstersToKill, 0),
|
List.of(monstersToKill, 0),
|
||||||
|
@ -5,11 +5,10 @@ import emu.grasscutter.game.dungeons.challenge.enums.ChallengeType;
|
|||||||
import emu.grasscutter.game.dungeons.challenge.trigger.KillMonsterCountTrigger;
|
import emu.grasscutter.game.dungeons.challenge.trigger.KillMonsterCountTrigger;
|
||||||
import emu.grasscutter.game.world.Scene;
|
import emu.grasscutter.game.world.Scene;
|
||||||
import emu.grasscutter.scripts.data.SceneGroup;
|
import emu.grasscutter.scripts.data.SceneGroup;
|
||||||
|
import java.util.List;
|
||||||
import lombok.val;
|
import lombok.val;
|
||||||
|
|
||||||
import java.util.List;
|
public class KillMonsterCountChallengeFactoryHandler implements ChallengeFactoryHandler {
|
||||||
|
|
||||||
public class KillMonsterCountChallengeFactoryHandler implements ChallengeFactoryHandler{
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isThisType(ChallengeType challengeType) {
|
public boolean isThisType(ChallengeType challengeType) {
|
||||||
// ActiveChallenge with 1, 1, 241033003, 15, 0, 0
|
// ActiveChallenge with 1, 1, 241033003, 15, 0, 0
|
||||||
@ -17,16 +16,24 @@ public class KillMonsterCountChallengeFactoryHandler implements ChallengeFactory
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WorldChallenge build(int challengeIndex, int challengeId, int groupId, int goal, int param5, int param6, Scene scene, SceneGroup group) {
|
public WorldChallenge build(
|
||||||
|
int challengeIndex,
|
||||||
|
int challengeId,
|
||||||
|
int groupId,
|
||||||
|
int goal,
|
||||||
|
int param5,
|
||||||
|
int param6,
|
||||||
|
Scene scene,
|
||||||
|
SceneGroup group) {
|
||||||
val realGroup = scene.getScriptManager().getGroupById(groupId);
|
val realGroup = scene.getScriptManager().getGroupById(groupId);
|
||||||
return new WorldChallenge(
|
return new WorldChallenge(
|
||||||
scene, realGroup,
|
scene,
|
||||||
|
realGroup,
|
||||||
challengeId, // Id
|
challengeId, // Id
|
||||||
challengeIndex, // Index
|
challengeIndex, // Index
|
||||||
List.of(goal, groupId),
|
List.of(goal, groupId),
|
||||||
0, // Limit
|
0, // Limit
|
||||||
goal, // Goal
|
goal, // Goal
|
||||||
List.of(new KillMonsterCountTrigger())
|
List.of(new KillMonsterCountTrigger()));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,11 +6,10 @@ import emu.grasscutter.game.dungeons.challenge.trigger.InTimeTrigger;
|
|||||||
import emu.grasscutter.game.dungeons.challenge.trigger.KillMonsterTrigger;
|
import emu.grasscutter.game.dungeons.challenge.trigger.KillMonsterTrigger;
|
||||||
import emu.grasscutter.game.world.Scene;
|
import emu.grasscutter.game.world.Scene;
|
||||||
import emu.grasscutter.scripts.data.SceneGroup;
|
import emu.grasscutter.scripts.data.SceneGroup;
|
||||||
|
import java.util.List;
|
||||||
import lombok.val;
|
import lombok.val;
|
||||||
|
|
||||||
import java.util.List;
|
public class KillMonsterInTimeChallengeFactoryHandler implements ChallengeFactoryHandler {
|
||||||
|
|
||||||
public class KillMonsterInTimeChallengeFactoryHandler implements ChallengeFactoryHandler{
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isThisType(ChallengeType challengeType) {
|
public boolean isThisType(ChallengeType challengeType) {
|
||||||
// ActiveChallenge with 180, 72, 240, 133220161, 133220161, 0
|
// ActiveChallenge with 180, 72, 240, 133220161, 133220161, 0
|
||||||
@ -18,16 +17,24 @@ public class KillMonsterInTimeChallengeFactoryHandler implements ChallengeFactor
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WorldChallenge build(int challengeIndex, int challengeId, int timeLimit, int groupId, int targetCfgId, int param6, Scene scene, SceneGroup group) {
|
public WorldChallenge build(
|
||||||
|
int challengeIndex,
|
||||||
|
int challengeId,
|
||||||
|
int timeLimit,
|
||||||
|
int groupId,
|
||||||
|
int targetCfgId,
|
||||||
|
int param6,
|
||||||
|
Scene scene,
|
||||||
|
SceneGroup group) {
|
||||||
val realGroup = scene.getScriptManager().getGroupById(groupId);
|
val realGroup = scene.getScriptManager().getGroupById(groupId);
|
||||||
return new WorldChallenge(
|
return new WorldChallenge(
|
||||||
scene, realGroup,
|
scene,
|
||||||
|
realGroup,
|
||||||
challengeId, // Id
|
challengeId, // Id
|
||||||
challengeIndex, // Index
|
challengeIndex, // Index
|
||||||
List.of(timeLimit),
|
List.of(timeLimit),
|
||||||
timeLimit, // Limit
|
timeLimit, // Limit
|
||||||
0, // Goal
|
0, // Goal
|
||||||
List.of(new KillMonsterTrigger(targetCfgId), new InTimeTrigger())
|
List.of(new KillMonsterTrigger(targetCfgId), new InTimeTrigger()));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,30 +6,37 @@ import emu.grasscutter.game.dungeons.challenge.trigger.InTimeTrigger;
|
|||||||
import emu.grasscutter.game.dungeons.challenge.trigger.KillMonsterCountTrigger;
|
import emu.grasscutter.game.dungeons.challenge.trigger.KillMonsterCountTrigger;
|
||||||
import emu.grasscutter.game.world.Scene;
|
import emu.grasscutter.game.world.Scene;
|
||||||
import emu.grasscutter.scripts.data.SceneGroup;
|
import emu.grasscutter.scripts.data.SceneGroup;
|
||||||
|
import java.util.List;
|
||||||
import lombok.val;
|
import lombok.val;
|
||||||
|
|
||||||
import java.util.List;
|
public class KillMonsterTimeChallengeFactoryHandler implements ChallengeFactoryHandler {
|
||||||
|
|
||||||
public class KillMonsterTimeChallengeFactoryHandler implements ChallengeFactoryHandler{
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isThisType(ChallengeType challengeType) {
|
public boolean isThisType(ChallengeType challengeType) {
|
||||||
// ActiveChallenge with 180,180,45,133108061,1,0
|
// ActiveChallenge with 180,180,45,133108061,1,0
|
||||||
// ActiveChallenge Fast with 1001, 5, 15, 240004005, 10, 0
|
// ActiveChallenge Fast with 1001, 5, 15, 240004005, 10, 0
|
||||||
return challengeType == ChallengeType.CHALLENGE_KILL_COUNT_IN_TIME ||
|
return challengeType == ChallengeType.CHALLENGE_KILL_COUNT_IN_TIME
|
||||||
challengeType == ChallengeType.CHALLENGE_KILL_COUNT_FAST;
|
|| challengeType == ChallengeType.CHALLENGE_KILL_COUNT_FAST;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WorldChallenge build(int challengeIndex, int challengeId, int timeLimit, int groupId, int targetCount, int param6, Scene scene, SceneGroup group) {
|
public WorldChallenge build(
|
||||||
|
int challengeIndex,
|
||||||
|
int challengeId,
|
||||||
|
int timeLimit,
|
||||||
|
int groupId,
|
||||||
|
int targetCount,
|
||||||
|
int param6,
|
||||||
|
Scene scene,
|
||||||
|
SceneGroup group) {
|
||||||
val realGroup = scene.getScriptManager().getGroupById(groupId);
|
val realGroup = scene.getScriptManager().getGroupById(groupId);
|
||||||
return new WorldChallenge(
|
return new WorldChallenge(
|
||||||
scene, realGroup,
|
scene,
|
||||||
|
realGroup,
|
||||||
challengeId, // Id
|
challengeId, // Id
|
||||||
challengeIndex, // Index
|
challengeIndex, // Index
|
||||||
List.of(targetCount, timeLimit),
|
List.of(targetCount, timeLimit),
|
||||||
timeLimit, // Limit
|
timeLimit, // Limit
|
||||||
targetCount, // Goal
|
targetCount, // Goal
|
||||||
List.of(new KillMonsterCountTrigger(), new InTimeTrigger())
|
List.of(new KillMonsterCountTrigger(), new InTimeTrigger()));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
package emu.grasscutter.game.dungeons.challenge.factory;
|
package emu.grasscutter.game.dungeons.challenge.factory;
|
||||||
|
|
||||||
|
import static emu.grasscutter.game.dungeons.challenge.enums.ChallengeType.CHALLENGE_SURVIVE;
|
||||||
|
|
||||||
import emu.grasscutter.game.dungeons.challenge.WorldChallenge;
|
import emu.grasscutter.game.dungeons.challenge.WorldChallenge;
|
||||||
import emu.grasscutter.game.dungeons.challenge.enums.ChallengeType;
|
import emu.grasscutter.game.dungeons.challenge.enums.ChallengeType;
|
||||||
import emu.grasscutter.game.dungeons.challenge.trigger.ForTimeTrigger;
|
import emu.grasscutter.game.dungeons.challenge.trigger.ForTimeTrigger;
|
||||||
import emu.grasscutter.game.world.Scene;
|
import emu.grasscutter.game.world.Scene;
|
||||||
import emu.grasscutter.scripts.data.SceneGroup;
|
import emu.grasscutter.scripts.data.SceneGroup;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static emu.grasscutter.game.dungeons.challenge.enums.ChallengeType.CHALLENGE_SURVIVE;
|
|
||||||
|
|
||||||
public class SurviveChallengeFactoryHandler implements ChallengeFactoryHandler {
|
public class SurviveChallengeFactoryHandler implements ChallengeFactoryHandler {
|
||||||
@Override
|
@Override
|
||||||
public boolean isThisType(ChallengeType challengeType) {
|
public boolean isThisType(ChallengeType challengeType) {
|
||||||
@ -19,15 +18,23 @@ public class SurviveChallengeFactoryHandler implements ChallengeFactoryHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WorldChallenge build(int challengeIndex, int challengeId, int timeToSurvive, int unused4, int unused5, int unused6, Scene scene, SceneGroup group) {
|
public WorldChallenge build(
|
||||||
|
int challengeIndex,
|
||||||
|
int challengeId,
|
||||||
|
int timeToSurvive,
|
||||||
|
int unused4,
|
||||||
|
int unused5,
|
||||||
|
int unused6,
|
||||||
|
Scene scene,
|
||||||
|
SceneGroup group) {
|
||||||
return new WorldChallenge(
|
return new WorldChallenge(
|
||||||
scene, group,
|
scene,
|
||||||
|
group,
|
||||||
challengeId, // Id
|
challengeId, // Id
|
||||||
challengeIndex, // Index
|
challengeIndex, // Index
|
||||||
List.of(timeToSurvive),
|
List.of(timeToSurvive),
|
||||||
timeToSurvive, // Limit
|
timeToSurvive, // Limit
|
||||||
0, // Goal
|
0, // Goal
|
||||||
List.of(new ForTimeTrigger())
|
List.of(new ForTimeTrigger()));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,15 @@
|
|||||||
package emu.grasscutter.game.dungeons.challenge.factory;
|
package emu.grasscutter.game.dungeons.challenge.factory;
|
||||||
|
|
||||||
|
import static emu.grasscutter.game.dungeons.challenge.enums.ChallengeType.CHALLENGE_TRIGGER_IN_TIME;
|
||||||
|
|
||||||
import emu.grasscutter.game.dungeons.challenge.WorldChallenge;
|
import emu.grasscutter.game.dungeons.challenge.WorldChallenge;
|
||||||
import emu.grasscutter.game.dungeons.challenge.enums.ChallengeType;
|
import emu.grasscutter.game.dungeons.challenge.enums.ChallengeType;
|
||||||
import emu.grasscutter.game.dungeons.challenge.trigger.InTimeTrigger;
|
import emu.grasscutter.game.dungeons.challenge.trigger.InTimeTrigger;
|
||||||
import emu.grasscutter.game.dungeons.challenge.trigger.TriggerGroupTriggerTrigger;
|
import emu.grasscutter.game.dungeons.challenge.trigger.TriggerGroupTriggerTrigger;
|
||||||
import emu.grasscutter.game.world.Scene;
|
import emu.grasscutter.game.world.Scene;
|
||||||
import emu.grasscutter.scripts.data.SceneGroup;
|
import emu.grasscutter.scripts.data.SceneGroup;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static emu.grasscutter.game.dungeons.challenge.enums.ChallengeType.CHALLENGE_TRIGGER_IN_TIME;
|
|
||||||
|
|
||||||
public class TriggerInTimeChallengeFactoryHandler implements ChallengeFactoryHandler {
|
public class TriggerInTimeChallengeFactoryHandler implements ChallengeFactoryHandler {
|
||||||
@Override
|
@Override
|
||||||
public boolean isThisType(ChallengeType challengeType) {
|
public boolean isThisType(ChallengeType challengeType) {
|
||||||
@ -22,15 +21,23 @@ public class TriggerInTimeChallengeFactoryHandler implements ChallengeFactoryHan
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WorldChallenge build(int challengeIndex, int challengeId, int timeLimit, int param4, int triggerTag, int triggerCount, Scene scene, SceneGroup group) {
|
public WorldChallenge build(
|
||||||
|
int challengeIndex,
|
||||||
|
int challengeId,
|
||||||
|
int timeLimit,
|
||||||
|
int param4,
|
||||||
|
int triggerTag,
|
||||||
|
int triggerCount,
|
||||||
|
Scene scene,
|
||||||
|
SceneGroup group) {
|
||||||
return new WorldChallenge(
|
return new WorldChallenge(
|
||||||
scene, group,
|
scene,
|
||||||
|
group,
|
||||||
challengeId, // Id
|
challengeId, // Id
|
||||||
challengeIndex, // Index
|
challengeIndex, // Index
|
||||||
List.of(timeLimit, triggerCount),
|
List.of(timeLimit, triggerCount),
|
||||||
timeLimit, // Limit
|
timeLimit, // Limit
|
||||||
triggerCount, // Goal
|
triggerCount, // Goal
|
||||||
List.of(new InTimeTrigger(), new TriggerGroupTriggerTrigger(Integer.toString(triggerTag)))
|
List.of(new InTimeTrigger(), new TriggerGroupTriggerTrigger(Integer.toString(triggerTag))));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,11 +6,17 @@ import emu.grasscutter.game.entity.EntityMonster;
|
|||||||
import emu.grasscutter.scripts.data.SceneTrigger;
|
import emu.grasscutter.scripts.data.SceneTrigger;
|
||||||
|
|
||||||
public abstract class ChallengeTrigger {
|
public abstract class ChallengeTrigger {
|
||||||
public void onBegin(WorldChallenge challenge) { }
|
public void onBegin(WorldChallenge challenge) {}
|
||||||
public void onFinish(WorldChallenge challenge) { }
|
|
||||||
public void onMonsterDeath(WorldChallenge challenge, EntityMonster monster) { }
|
public void onFinish(WorldChallenge challenge) {}
|
||||||
public void onGadgetDeath(WorldChallenge challenge, EntityGadget gadget) { }
|
|
||||||
public void onCheckTimeout(WorldChallenge challenge) { }
|
public void onMonsterDeath(WorldChallenge challenge, EntityMonster monster) {}
|
||||||
public void onGadgetDamage(WorldChallenge challenge, EntityGadget gadget) { }
|
|
||||||
public void onGroupTrigger(WorldChallenge challenge, SceneTrigger trigger) { }
|
public void onGadgetDeath(WorldChallenge challenge, EntityGadget gadget) {}
|
||||||
|
|
||||||
|
public void onCheckTimeout(WorldChallenge challenge) {}
|
||||||
|
|
||||||
|
public void onGadgetDamage(WorldChallenge challenge, EntityGadget gadget) {}
|
||||||
|
|
||||||
|
public void onGroupTrigger(WorldChallenge challenge, SceneTrigger trigger) {}
|
||||||
}
|
}
|
||||||
|
@ -2,14 +2,14 @@ package emu.grasscutter.game.dungeons.challenge.trigger;
|
|||||||
|
|
||||||
import emu.grasscutter.game.dungeons.challenge.WorldChallenge;
|
import emu.grasscutter.game.dungeons.challenge.WorldChallenge;
|
||||||
import emu.grasscutter.game.entity.EntityGadget;
|
import emu.grasscutter.game.entity.EntityGadget;
|
||||||
import emu.grasscutter.game.entity.EntityMonster;
|
|
||||||
import emu.grasscutter.game.props.FightProperty;
|
import emu.grasscutter.game.props.FightProperty;
|
||||||
import emu.grasscutter.server.packet.send.PacketChallengeDataNotify;
|
import emu.grasscutter.server.packet.send.PacketChallengeDataNotify;
|
||||||
|
|
||||||
public class GuardTrigger extends ChallengeTrigger {
|
public class GuardTrigger extends ChallengeTrigger {
|
||||||
private final int entityToProtectCFGId;
|
private final int entityToProtectCFGId;
|
||||||
private int lastSendPercent = 100;
|
private int lastSendPercent = 100;
|
||||||
public GuardTrigger(int entityToProtectCFGId){
|
|
||||||
|
public GuardTrigger(int entityToProtectCFGId) {
|
||||||
this.entityToProtectCFGId = entityToProtectCFGId;
|
this.entityToProtectCFGId = entityToProtectCFGId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -19,19 +19,19 @@ public class GuardTrigger extends ChallengeTrigger {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onGadgetDamage(WorldChallenge challenge, EntityGadget gadget) {
|
public void onGadgetDamage(WorldChallenge challenge, EntityGadget gadget) {
|
||||||
if(gadget.getConfigId() != entityToProtectCFGId){
|
if (gadget.getConfigId() != entityToProtectCFGId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var curHp = gadget.getFightProperties().get(FightProperty.FIGHT_PROP_CUR_HP.getId());
|
var curHp = gadget.getFightProperties().get(FightProperty.FIGHT_PROP_CUR_HP.getId());
|
||||||
var maxHp = gadget.getFightProperties().get(FightProperty.FIGHT_PROP_BASE_HP.getId());
|
var maxHp = gadget.getFightProperties().get(FightProperty.FIGHT_PROP_BASE_HP.getId());
|
||||||
int percent = (int) (curHp / maxHp);
|
int percent = (int) (curHp / maxHp);
|
||||||
|
|
||||||
if(percent!=lastSendPercent) {
|
if (percent != lastSendPercent) {
|
||||||
challenge.getScene().broadcastPacket(new PacketChallengeDataNotify(challenge, 2, percent));
|
challenge.getScene().broadcastPacket(new PacketChallengeDataNotify(challenge, 2, percent));
|
||||||
lastSendPercent = percent;
|
lastSendPercent = percent;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(percent <= 0){
|
if (percent <= 0) {
|
||||||
challenge.fail();
|
challenge.fail();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,16 +6,19 @@ import emu.grasscutter.server.packet.send.PacketChallengeDataNotify;
|
|||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class KillMonsterTrigger extends ChallengeTrigger{
|
public class KillMonsterTrigger extends ChallengeTrigger {
|
||||||
private int monsterCfgId;
|
private int monsterCfgId;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBegin(WorldChallenge challenge) {
|
public void onBegin(WorldChallenge challenge) {
|
||||||
challenge.getScene().broadcastPacket(new PacketChallengeDataNotify(challenge, 1, challenge.getScore().get()));
|
challenge
|
||||||
|
.getScene()
|
||||||
|
.broadcastPacket(new PacketChallengeDataNotify(challenge, 1, challenge.getScore().get()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMonsterDeath(WorldChallenge challenge, EntityMonster monster) {
|
public void onMonsterDeath(WorldChallenge challenge, EntityMonster monster) {
|
||||||
if(monster.getConfigId() == monsterCfgId){
|
if (monster.getConfigId() == monsterCfgId) {
|
||||||
challenge.done();
|
challenge.done();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,19 +37,21 @@ import emu.grasscutter.utils.Position;
|
|||||||
import emu.grasscutter.utils.ProtoHelper;
|
import emu.grasscutter.utils.ProtoHelper;
|
||||||
import it.unimi.dsi.fastutil.ints.Int2FloatMap;
|
import it.unimi.dsi.fastutil.ints.Int2FloatMap;
|
||||||
import it.unimi.dsi.fastutil.ints.Int2FloatOpenHashMap;
|
import it.unimi.dsi.fastutil.ints.Int2FloatOpenHashMap;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class EntityGadget extends EntityBaseGadget {
|
public class EntityGadget extends EntityBaseGadget {
|
||||||
@Getter private final GadgetData gadgetData;
|
@Getter private final GadgetData gadgetData;
|
||||||
@Getter(onMethod = @__(@Override)) @Setter
|
|
||||||
|
@Getter(onMethod = @__(@Override))
|
||||||
|
@Setter
|
||||||
private int gadgetId;
|
private int gadgetId;
|
||||||
|
|
||||||
@Getter private final Position bornPos;
|
@Getter private final Position bornPos;
|
||||||
@Getter private final Position bornRot;
|
@Getter private final Position bornRot;
|
||||||
@Getter @Setter private GameEntity owner = null;
|
@Getter @Setter private GameEntity owner = null;
|
||||||
@ -58,18 +60,18 @@ public class EntityGadget extends EntityBaseGadget {
|
|||||||
@Getter private int state;
|
@Getter private int state;
|
||||||
@Getter @Setter private int pointType;
|
@Getter @Setter private int pointType;
|
||||||
@Getter private GadgetContent content;
|
@Getter private GadgetContent content;
|
||||||
|
|
||||||
@Getter(onMethod = @__(@Override), lazy = true)
|
@Getter(onMethod = @__(@Override), lazy = true)
|
||||||
private final Int2FloatMap fightProperties = new Int2FloatOpenHashMap();
|
private final Int2FloatMap fightProperties = new Int2FloatOpenHashMap();
|
||||||
|
|
||||||
@Getter @Setter private SceneGadget metaGadget;
|
@Getter @Setter private SceneGadget metaGadget;
|
||||||
@Nullable @Getter
|
@Nullable @Getter private ConfigEntityGadget configGadget;
|
||||||
private ConfigEntityGadget configGadget;
|
|
||||||
@Getter @Setter private BaseRoute routeConfig;
|
@Getter @Setter private BaseRoute routeConfig;
|
||||||
|
|
||||||
@Getter @Setter private int stopValue = 0; //Controller related, inited to zero
|
@Getter @Setter private int stopValue = 0; // Controller related, inited to zero
|
||||||
@Getter @Setter private int startValue = 0; //Controller related, inited to zero
|
@Getter @Setter private int startValue = 0; // Controller related, inited to zero
|
||||||
@Getter @Setter private int ticksSinceChange;
|
@Getter @Setter private int ticksSinceChange;
|
||||||
|
|
||||||
|
|
||||||
public EntityGadget(Scene scene, int gadgetId, Position pos) {
|
public EntityGadget(Scene scene, int gadgetId, Position pos) {
|
||||||
this(scene, gadgetId, pos, null, null);
|
this(scene, gadgetId, pos, null, null);
|
||||||
}
|
}
|
||||||
@ -78,7 +80,8 @@ public class EntityGadget extends EntityBaseGadget {
|
|||||||
this(scene, gadgetId, pos, rot, null);
|
this(scene, gadgetId, pos, rot, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityGadget(Scene scene, int gadgetId, Position pos, Position rot, GadgetContent content) {
|
public EntityGadget(
|
||||||
|
Scene scene, int gadgetId, Position pos, Position rot, GadgetContent content) {
|
||||||
super(scene, pos, rot);
|
super(scene, pos, rot);
|
||||||
|
|
||||||
this.gadgetData = GameData.getGadgetDataMap().get(gadgetId);
|
this.gadgetData = GameData.getGadgetDataMap().get(gadgetId);
|
||||||
@ -93,7 +96,7 @@ public class EntityGadget extends EntityBaseGadget {
|
|||||||
this.bornRot = this.getRotation().clone();
|
this.bornRot = this.getRotation().clone();
|
||||||
this.fillFightProps(configGadget);
|
this.fillFightProps(configGadget);
|
||||||
|
|
||||||
if(GameData.getGadgetMappingMap().containsKey(gadgetId)) {
|
if (GameData.getGadgetMappingMap().containsKey(gadgetId)) {
|
||||||
String controllerName = GameData.getGadgetMappingMap().get(gadgetId).getServerController();
|
String controllerName = GameData.getGadgetMappingMap().get(gadgetId).getServerController();
|
||||||
this.setEntityController(EntityControllerScriptManager.getGadgetController(controllerName));
|
this.setEntityController(EntityControllerScriptManager.getGadgetController(controllerName));
|
||||||
}
|
}
|
||||||
@ -101,20 +104,24 @@ public class EntityGadget extends EntityBaseGadget {
|
|||||||
|
|
||||||
public void setState(int state) {
|
public void setState(int state) {
|
||||||
this.state = state;
|
this.state = state;
|
||||||
//Cache the gadget state
|
// Cache the gadget state
|
||||||
if(metaGadget != null && metaGadget.group != null) {
|
if (metaGadget != null && metaGadget.group != null) {
|
||||||
var instance = getScene().getScriptManager().getCachedGroupInstanceById(metaGadget.group.id);
|
var instance = getScene().getScriptManager().getCachedGroupInstanceById(metaGadget.group.id);
|
||||||
if(instance != null) instance.cacheGadgetState(metaGadget, state);
|
if (instance != null) instance.cacheGadgetState(metaGadget, state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateState(int state) {
|
public void updateState(int state) {
|
||||||
if(state == this.getState()) return; //Don't triggers events
|
if (state == this.getState()) return; // Don't triggers events
|
||||||
|
|
||||||
this.setState(state);
|
this.setState(state);
|
||||||
ticksSinceChange = getScene().getSceneTimeSeconds();
|
ticksSinceChange = getScene().getSceneTimeSeconds();
|
||||||
this.getScene().broadcastPacket(new PacketGadgetStateNotify(this, state));
|
this.getScene().broadcastPacket(new PacketGadgetStateNotify(this, state));
|
||||||
getScene().getScriptManager().callEvent(new ScriptArgs(this.getGroupId(), EventType.EVENT_GADGET_STATE_CHANGE, state, this.getConfigId()));
|
getScene()
|
||||||
|
.getScriptManager()
|
||||||
|
.callEvent(
|
||||||
|
new ScriptArgs(
|
||||||
|
this.getGroupId(), EventType.EVENT_GADGET_STATE_CHANGE, state, this.getConfigId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated(forRemoval = true) // Dont use!
|
@Deprecated(forRemoval = true) // Dont use!
|
||||||
@ -124,11 +131,14 @@ public class EntityGadget extends EntityBaseGadget {
|
|||||||
|
|
||||||
// TODO refactor
|
// TODO refactor
|
||||||
public void buildContent() {
|
public void buildContent() {
|
||||||
if (this.getContent() != null || this.getGadgetData() == null || this.getGadgetData().getType() == null) {
|
if (this.getContent() != null
|
||||||
|
|| this.getGadgetData() == null
|
||||||
|
|| this.getGadgetData().getType() == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.content = switch (this.getGadgetData().getType()) {
|
this.content =
|
||||||
|
switch (this.getGadgetData().getType()) {
|
||||||
case GatherPoint -> new GadgetGatherPoint(this);
|
case GatherPoint -> new GadgetGatherPoint(this);
|
||||||
case GatherObject -> new GadgetGatherObject(this);
|
case GatherObject -> new GadgetGatherObject(this);
|
||||||
case Worktop, SealGadget -> new GadgetWorktop(this);
|
case Worktop, SealGadget -> new GadgetWorktop(this);
|
||||||
@ -155,13 +165,16 @@ public class EntityGadget extends EntityBaseGadget {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
// Lua event
|
// Lua event
|
||||||
getScene().getScriptManager().callEvent(new ScriptArgs(this.getGroupId(), EventType.EVENT_GADGET_CREATE, this.getConfigId()));
|
getScene()
|
||||||
|
.getScriptManager()
|
||||||
|
.callEvent(
|
||||||
|
new ScriptArgs(this.getGroupId(), EventType.EVENT_GADGET_CREATE, this.getConfigId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRemoved() {
|
public void onRemoved() {
|
||||||
super.onRemoved();
|
super.onRemoved();
|
||||||
if(!children.isEmpty()) {
|
if (!children.isEmpty()) {
|
||||||
getScene().removeEntities(children, VisionTypeOuterClass.VisionType.VISION_TYPE_REMOVE);
|
getScene().removeEntities(children, VisionTypeOuterClass.VisionType.VISION_TYPE_REMOVE);
|
||||||
children.clear();
|
children.clear();
|
||||||
}
|
}
|
||||||
@ -177,19 +190,23 @@ public class EntityGadget extends EntityBaseGadget {
|
|||||||
if (getScene().getChallenge() != null) {
|
if (getScene().getChallenge() != null) {
|
||||||
getScene().getChallenge().onGadgetDeath(this);
|
getScene().getChallenge().onGadgetDeath(this);
|
||||||
}
|
}
|
||||||
getScene().getScriptManager().callEvent(new ScriptArgs(this.getGroupId(), EventType.EVENT_ANY_GADGET_DIE, this.getConfigId()));
|
getScene()
|
||||||
|
.getScriptManager()
|
||||||
|
.callEvent(
|
||||||
|
new ScriptArgs(this.getGroupId(), EventType.EVENT_ANY_GADGET_DIE, this.getConfigId()));
|
||||||
|
|
||||||
SceneGroupInstance groupInstance = getScene().getScriptManager().getCachedGroupInstanceById(this.getGroupId());
|
SceneGroupInstance groupInstance =
|
||||||
if(groupInstance != null && metaGadget != null)
|
getScene().getScriptManager().getCachedGroupInstanceById(this.getGroupId());
|
||||||
|
if (groupInstance != null && metaGadget != null)
|
||||||
groupInstance.getDeadEntities().add(metaGadget.config_id);
|
groupInstance.getDeadEntities().add(metaGadget.config_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean startPlatform(){
|
public boolean startPlatform() {
|
||||||
if(routeConfig == null){
|
if (routeConfig == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(routeConfig.isStarted()){
|
if (routeConfig.isStarted()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
getScene().broadcastPacket(new PacketSceneTimeNotify(getScene()));
|
getScene().broadcastPacket(new PacketSceneTimeNotify(getScene()));
|
||||||
@ -199,12 +216,12 @@ public class EntityGadget extends EntityBaseGadget {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean stopPlatform(){
|
public boolean stopPlatform() {
|
||||||
if(routeConfig == null){
|
if (routeConfig == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!routeConfig.isStarted()){
|
if (!routeConfig.isStarted()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
routeConfig.stopRoute(getScene());
|
routeConfig.stopRoute(getScene());
|
||||||
@ -215,34 +232,44 @@ public class EntityGadget extends EntityBaseGadget {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SceneEntityInfo toProto() {
|
public SceneEntityInfo toProto() {
|
||||||
EntityAuthorityInfo authority = EntityAuthorityInfo.newBuilder()
|
EntityAuthorityInfo authority =
|
||||||
|
EntityAuthorityInfo.newBuilder()
|
||||||
.setAbilityInfo(AbilitySyncStateInfo.newBuilder())
|
.setAbilityInfo(AbilitySyncStateInfo.newBuilder())
|
||||||
.setRendererChangedInfo(EntityRendererChangedInfo.newBuilder())
|
.setRendererChangedInfo(EntityRendererChangedInfo.newBuilder())
|
||||||
.setAiInfo(SceneEntityAiInfo.newBuilder().setIsAiOpen(true).setBornPos(bornPos.toProto()))
|
.setAiInfo(
|
||||||
|
SceneEntityAiInfo.newBuilder().setIsAiOpen(true).setBornPos(bornPos.toProto()))
|
||||||
.setBornPos(bornPos.toProto())
|
.setBornPos(bornPos.toProto())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
SceneEntityInfo.Builder entityInfo = SceneEntityInfo.newBuilder()
|
SceneEntityInfo.Builder entityInfo =
|
||||||
|
SceneEntityInfo.newBuilder()
|
||||||
.setEntityId(getId())
|
.setEntityId(getId())
|
||||||
.setEntityType(ProtEntityType.PROT_ENTITY_TYPE_GADGET)
|
.setEntityType(ProtEntityType.PROT_ENTITY_TYPE_GADGET)
|
||||||
.setMotionInfo(MotionInfo.newBuilder().setPos(getPosition().toProto()).setRot(getRotation().toProto()).setSpeed(Vector.newBuilder()))
|
.setMotionInfo(
|
||||||
|
MotionInfo.newBuilder()
|
||||||
|
.setPos(getPosition().toProto())
|
||||||
|
.setRot(getRotation().toProto())
|
||||||
|
.setSpeed(Vector.newBuilder()))
|
||||||
.addAnimatorParaList(AnimatorParameterValueInfoPair.newBuilder())
|
.addAnimatorParaList(AnimatorParameterValueInfoPair.newBuilder())
|
||||||
.setEntityClientData(EntityClientData.newBuilder())
|
.setEntityClientData(EntityClientData.newBuilder())
|
||||||
.setEntityAuthorityInfo(authority)
|
.setEntityAuthorityInfo(authority)
|
||||||
.setLifeState(1);
|
.setLifeState(1);
|
||||||
|
|
||||||
PropPair pair = PropPair.newBuilder()
|
PropPair pair =
|
||||||
|
PropPair.newBuilder()
|
||||||
.setType(PlayerProperty.PROP_LEVEL.getId())
|
.setType(PlayerProperty.PROP_LEVEL.getId())
|
||||||
.setPropValue(ProtoHelper.newPropValue(PlayerProperty.PROP_LEVEL, 1))
|
.setPropValue(ProtoHelper.newPropValue(PlayerProperty.PROP_LEVEL, 1))
|
||||||
.build();
|
.build();
|
||||||
entityInfo.addPropList(pair);
|
entityInfo.addPropList(pair);
|
||||||
|
|
||||||
// We do not use the getter to null check because the getter will create a fight prop map if it is null
|
// We do not use the getter to null check because the getter will create a fight prop map if it
|
||||||
|
// is null
|
||||||
if (this.fightProperties != null) {
|
if (this.fightProperties != null) {
|
||||||
addAllFightPropsToEntityInfo(entityInfo);
|
addAllFightPropsToEntityInfo(entityInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneGadgetInfo.Builder gadgetInfo = SceneGadgetInfo.newBuilder()
|
SceneGadgetInfo.Builder gadgetInfo =
|
||||||
|
SceneGadgetInfo.newBuilder()
|
||||||
.setGadgetId(this.getGadgetId())
|
.setGadgetId(this.getGadgetId())
|
||||||
.setGroupId(this.getGroupId())
|
.setGroupId(this.getGroupId())
|
||||||
.setConfigId(this.getConfigId())
|
.setConfigId(this.getConfigId())
|
||||||
@ -254,7 +281,7 @@ public class EntityGadget extends EntityBaseGadget {
|
|||||||
gadgetInfo.setDraftId(this.metaGadget.draft_id);
|
gadgetInfo.setDraftId(this.metaGadget.draft_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(owner != null){
|
if (owner != null) {
|
||||||
gadgetInfo.setOwnerEntityId(owner.getId());
|
gadgetInfo.setOwnerEntityId(owner.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,7 +289,7 @@ public class EntityGadget extends EntityBaseGadget {
|
|||||||
this.getContent().onBuildProto(gadgetInfo);
|
this.getContent().onBuildProto(gadgetInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(routeConfig!=null){
|
if (routeConfig != null) {
|
||||||
gadgetInfo.setPlatform(getPlatformInfo());
|
gadgetInfo.setPlatform(getPlatformInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -271,8 +298,8 @@ public class EntityGadget extends EntityBaseGadget {
|
|||||||
return entityInfo.build();
|
return entityInfo.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public PlatformInfoOuterClass.PlatformInfo.Builder getPlatformInfo(){
|
public PlatformInfoOuterClass.PlatformInfo.Builder getPlatformInfo() {
|
||||||
if(routeConfig != null){
|
if (routeConfig != null) {
|
||||||
return routeConfig.toProto();
|
return routeConfig.toProto();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,20 +11,23 @@ public class EntitySolarIsotomaClientGadget extends EntityClientGadget {
|
|||||||
public static final int ELEVATOR_GADGET_ID = 41038002;
|
public static final int ELEVATOR_GADGET_ID = 41038002;
|
||||||
@Getter private EntityGadget platformGadget;
|
@Getter private EntityGadget platformGadget;
|
||||||
|
|
||||||
public EntitySolarIsotomaClientGadget(Scene scene, Player player, EvtCreateGadgetNotifyOuterClass.EvtCreateGadgetNotify notify) {
|
public EntitySolarIsotomaClientGadget(
|
||||||
|
Scene scene, Player player, EvtCreateGadgetNotifyOuterClass.EvtCreateGadgetNotify notify) {
|
||||||
super(scene, player, notify);
|
super(scene, player, notify);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
//Create solar isotoma elevator and send to all.
|
// Create solar isotoma elevator and send to all.
|
||||||
this.platformGadget = new EntitySolarIsotomaElevatorPlatform(this, getScene(), ELEVATOR_GADGET_ID, getPosition(), getRotation());
|
this.platformGadget =
|
||||||
|
new EntitySolarIsotomaElevatorPlatform(
|
||||||
|
this, getScene(), ELEVATOR_GADGET_ID, getPosition(), getRotation());
|
||||||
getScene().addEntity(this.platformGadget);
|
getScene().addEntity(this.platformGadget);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRemoved() {
|
public void onRemoved() {
|
||||||
//Remove solar isotoma elevator entity.
|
// Remove solar isotoma elevator entity.
|
||||||
getScene().removeEntity(this.platformGadget);
|
getScene().removeEntity(this.platformGadget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,16 +25,16 @@ import emu.grasscutter.utils.Position;
|
|||||||
import emu.grasscutter.utils.ProtoHelper;
|
import emu.grasscutter.utils.ProtoHelper;
|
||||||
import it.unimi.dsi.fastutil.ints.Int2FloatMap;
|
import it.unimi.dsi.fastutil.ints.Int2FloatMap;
|
||||||
import it.unimi.dsi.fastutil.ints.Int2FloatOpenHashMap;
|
import it.unimi.dsi.fastutil.ints.Int2FloatOpenHashMap;
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
public class EntityVehicle extends EntityBaseGadget {
|
public class EntityVehicle extends EntityBaseGadget {
|
||||||
|
|
||||||
@Getter private final Player owner;
|
@Getter private final Player owner;
|
||||||
|
|
||||||
@Getter(onMethod = @__(@Override))
|
@Getter(onMethod = @__(@Override))
|
||||||
private final Int2FloatMap fightProperties;
|
private final Int2FloatMap fightProperties;
|
||||||
|
|
||||||
@ -45,7 +45,8 @@ public class EntityVehicle extends EntityBaseGadget {
|
|||||||
@Getter private final List<VehicleMember> vehicleMembers;
|
@Getter private final List<VehicleMember> vehicleMembers;
|
||||||
@Nullable @Getter private ConfigEntityGadget configGadget;
|
@Nullable @Getter private ConfigEntityGadget configGadget;
|
||||||
|
|
||||||
public EntityVehicle(Scene scene, Player player, int gadgetId, int pointId, Position pos, Position rot) {
|
public EntityVehicle(
|
||||||
|
Scene scene, Player player, int gadgetId, int pointId, Position pos, Position rot) {
|
||||||
super(scene, pos, rot);
|
super(scene, pos, rot);
|
||||||
this.owner = player;
|
this.owner = player;
|
||||||
this.id = getScene().getWorld().getNextEntityId(EntityIdType.GADGET);
|
this.id = getScene().getWorld().getNextEntityId(EntityIdType.GADGET);
|
||||||
@ -72,34 +73,46 @@ public class EntityVehicle extends EntityBaseGadget {
|
|||||||
@Override
|
@Override
|
||||||
public SceneEntityInfo toProto() {
|
public SceneEntityInfo toProto() {
|
||||||
|
|
||||||
VehicleInfo vehicle = VehicleInfo.newBuilder()
|
VehicleInfo vehicle =
|
||||||
|
VehicleInfo.newBuilder()
|
||||||
.setOwnerUid(this.owner.getUid())
|
.setOwnerUid(this.owner.getUid())
|
||||||
.setCurStamina(getCurStamina())
|
.setCurStamina(getCurStamina())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
EntityAuthorityInfo authority = EntityAuthorityInfo.newBuilder()
|
EntityAuthorityInfo authority =
|
||||||
|
EntityAuthorityInfo.newBuilder()
|
||||||
.setAbilityInfo(AbilitySyncStateInfo.newBuilder())
|
.setAbilityInfo(AbilitySyncStateInfo.newBuilder())
|
||||||
.setRendererChangedInfo(EntityRendererChangedInfo.newBuilder())
|
.setRendererChangedInfo(EntityRendererChangedInfo.newBuilder())
|
||||||
.setAiInfo(SceneEntityAiInfo.newBuilder().setIsAiOpen(true).setBornPos(getPosition().toProto()))
|
.setAiInfo(
|
||||||
|
SceneEntityAiInfo.newBuilder()
|
||||||
|
.setIsAiOpen(true)
|
||||||
|
.setBornPos(getPosition().toProto()))
|
||||||
.setBornPos(getPosition().toProto())
|
.setBornPos(getPosition().toProto())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
SceneGadgetInfo.Builder gadgetInfo = SceneGadgetInfo.newBuilder()
|
SceneGadgetInfo.Builder gadgetInfo =
|
||||||
|
SceneGadgetInfo.newBuilder()
|
||||||
.setGadgetId(this.getGadgetId())
|
.setGadgetId(this.getGadgetId())
|
||||||
.setAuthorityPeerId(this.getOwner().getPeerId())
|
.setAuthorityPeerId(this.getOwner().getPeerId())
|
||||||
.setIsEnableInteract(true)
|
.setIsEnableInteract(true)
|
||||||
.setVehicleInfo(vehicle);
|
.setVehicleInfo(vehicle);
|
||||||
|
|
||||||
SceneEntityInfo.Builder entityInfo = SceneEntityInfo.newBuilder()
|
SceneEntityInfo.Builder entityInfo =
|
||||||
|
SceneEntityInfo.newBuilder()
|
||||||
.setEntityId(getId())
|
.setEntityId(getId())
|
||||||
.setEntityType(ProtEntityType.PROT_ENTITY_TYPE_GADGET)
|
.setEntityType(ProtEntityType.PROT_ENTITY_TYPE_GADGET)
|
||||||
.setMotionInfo(MotionInfo.newBuilder().setPos(getPosition().toProto()).setRot(getRotation().toProto()).setSpeed(Vector.newBuilder()))
|
.setMotionInfo(
|
||||||
|
MotionInfo.newBuilder()
|
||||||
|
.setPos(getPosition().toProto())
|
||||||
|
.setRot(getRotation().toProto())
|
||||||
|
.setSpeed(Vector.newBuilder()))
|
||||||
.addAnimatorParaList(AnimatorParameterValueInfoPair.newBuilder())
|
.addAnimatorParaList(AnimatorParameterValueInfoPair.newBuilder())
|
||||||
.setGadget(gadgetInfo)
|
.setGadget(gadgetInfo)
|
||||||
.setEntityAuthorityInfo(authority)
|
.setEntityAuthorityInfo(authority)
|
||||||
.setLifeState(1);
|
.setLifeState(1);
|
||||||
|
|
||||||
PropPair pair = PropPair.newBuilder()
|
PropPair pair =
|
||||||
|
PropPair.newBuilder()
|
||||||
.setType(PlayerProperty.PROP_LEVEL.getId())
|
.setType(PlayerProperty.PROP_LEVEL.getId())
|
||||||
.setPropValue(ProtoHelper.newPropValue(PlayerProperty.PROP_LEVEL, 47))
|
.setPropValue(ProtoHelper.newPropValue(PlayerProperty.PROP_LEVEL, 47))
|
||||||
.build();
|
.build();
|
||||||
|
@ -202,7 +202,7 @@ public abstract class GameEntity {
|
|||||||
*/
|
*/
|
||||||
public void runLuaCallbacks(EntityDamageEvent event) {
|
public void runLuaCallbacks(EntityDamageEvent event) {
|
||||||
if (entityController != null) {
|
if (entityController != null) {
|
||||||
entityController.onBeHurt(this, event.getAttackElementType(), true);//todo is host handling
|
entityController.onBeHurt(this, event.getAttackElementType(), true); // todo is host handling
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,8 @@ public final class GadgetRewardStatue extends GadgetContent {
|
|||||||
var dungeonManager = player.getScene().getDungeonManager();
|
var dungeonManager = player.getScene().getDungeonManager();
|
||||||
|
|
||||||
if (player.getScene().getChallenge() instanceof DungeonChallenge) {
|
if (player.getScene().getChallenge() instanceof DungeonChallenge) {
|
||||||
var useCondensed = req.getResinCostType() == ResinCostTypeOuterClass.ResinCostType.RESIN_COST_TYPE_CONDENSE;
|
var useCondensed =
|
||||||
|
req.getResinCostType() == ResinCostTypeOuterClass.ResinCostType.RESIN_COST_TYPE_CONDENSE;
|
||||||
dungeonManager.getStatueDrops(player, useCondensed, getGadget().getGroupId());
|
dungeonManager.getStatueDrops(player, useCondensed, getGadget().getGroupId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,12 @@ import emu.grasscutter.game.world.Scene;
|
|||||||
import emu.grasscutter.utils.Position;
|
import emu.grasscutter.utils.Position;
|
||||||
|
|
||||||
public class EntitySolarIsotomaElevatorPlatform extends EntityGadget {
|
public class EntitySolarIsotomaElevatorPlatform extends EntityGadget {
|
||||||
public EntitySolarIsotomaElevatorPlatform(EntitySolarIsotomaClientGadget isotoma, Scene scene, int gadgetId, Position pos, Position rot) {
|
public EntitySolarIsotomaElevatorPlatform(
|
||||||
|
EntitySolarIsotomaClientGadget isotoma,
|
||||||
|
Scene scene,
|
||||||
|
int gadgetId,
|
||||||
|
Position pos,
|
||||||
|
Position rot) {
|
||||||
super(scene, gadgetId, pos, rot);
|
super(scene, gadgetId, pos, rot);
|
||||||
setOwner(isotoma);
|
setOwner(isotoma);
|
||||||
this.setRouteConfig(new AbilityRoute(rot, false, false, pos));
|
this.setRouteConfig(new AbilityRoute(rot, false, false, pos));
|
||||||
@ -25,7 +30,7 @@ public class EntitySolarIsotomaElevatorPlatform extends EntityGadget {
|
|||||||
var combatProperties = combatData.getProperty();
|
var combatProperties = combatData.getProperty();
|
||||||
|
|
||||||
if (combatProperties.isUseCreatorProperty()) {
|
if (combatProperties.isUseCreatorProperty()) {
|
||||||
//If useCreatorProperty == true, use owner's property;
|
// If useCreatorProperty == true, use owner's property;
|
||||||
GameEntity ownerEntity = getOwner();
|
GameEntity ownerEntity = getOwner();
|
||||||
if (ownerEntity != null) {
|
if (ownerEntity != null) {
|
||||||
getFightProperties().putAll(ownerEntity.getFightProperties());
|
getFightProperties().putAll(ownerEntity.getFightProperties());
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package emu.grasscutter.game.mail;
|
package emu.grasscutter.game.mail;
|
||||||
|
|
||||||
|
import static emu.grasscutter.net.proto.MailItemOuterClass.MailItem.*;
|
||||||
|
|
||||||
import dev.morphia.annotations.Entity;
|
import dev.morphia.annotations.Entity;
|
||||||
import dev.morphia.annotations.Id;
|
import dev.morphia.annotations.Id;
|
||||||
import dev.morphia.annotations.Indexed;
|
import dev.morphia.annotations.Indexed;
|
||||||
@ -10,13 +12,10 @@ import emu.grasscutter.net.proto.*;
|
|||||||
import emu.grasscutter.net.proto.EquipParamOuterClass.EquipParam;
|
import emu.grasscutter.net.proto.EquipParamOuterClass.EquipParam;
|
||||||
import emu.grasscutter.net.proto.MailCollectStateOuterClass.MailCollectState;
|
import emu.grasscutter.net.proto.MailCollectStateOuterClass.MailCollectState;
|
||||||
import emu.grasscutter.net.proto.MailTextContentOuterClass.MailTextContent;
|
import emu.grasscutter.net.proto.MailTextContentOuterClass.MailTextContent;
|
||||||
import org.bson.types.ObjectId;
|
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import org.bson.types.ObjectId;
|
||||||
import static emu.grasscutter.net.proto.MailItemOuterClass.MailItem.*;
|
|
||||||
|
|
||||||
@Entity(value = "mail", useDiscriminator = false)
|
@Entity(value = "mail", useDiscriminator = false)
|
||||||
public final class Mail {
|
public final class Mail {
|
||||||
@ -33,7 +32,11 @@ public final class Mail {
|
|||||||
@Transient private boolean shouldDelete;
|
@Transient private boolean shouldDelete;
|
||||||
|
|
||||||
public Mail() {
|
public Mail() {
|
||||||
this(new MailContent(), new ArrayList<MailItem>(), (int) Instant.now().getEpochSecond() + 604800); // TODO: add expire time to send mail command
|
this(
|
||||||
|
new MailContent(),
|
||||||
|
new ArrayList<MailItem>(),
|
||||||
|
(int) Instant.now().getEpochSecond()
|
||||||
|
+ 604800); // TODO: add expire time to send mail command
|
||||||
}
|
}
|
||||||
|
|
||||||
public Mail(MailContent mailContent, List<MailItem> itemList, long expireTime) {
|
public Mail(MailContent mailContent, List<MailItem> itemList, long expireTime) {
|
||||||
@ -44,7 +47,12 @@ public final class Mail {
|
|||||||
this(mailContent, itemList, expireTime, importance, 1);
|
this(mailContent, itemList, expireTime, importance, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Mail(MailContent mailContent, List<MailItem> itemList, long expireTime, int importance, int state) {
|
public Mail(
|
||||||
|
MailContent mailContent,
|
||||||
|
List<MailItem> itemList,
|
||||||
|
long expireTime,
|
||||||
|
int importance,
|
||||||
|
int state) {
|
||||||
this.mailContent = mailContent;
|
this.mailContent = mailContent;
|
||||||
this.itemList = itemList;
|
this.itemList = itemList;
|
||||||
this.sendTime = (int) Instant.now().getEpochSecond();
|
this.sendTime = (int) Instant.now().getEpochSecond();
|
||||||
@ -143,11 +151,13 @@ public final class Mail {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public MailItemOuterClass.MailItem toProto() {
|
public MailItemOuterClass.MailItem toProto() {
|
||||||
return newBuilder().setEquipParam(EquipParam.newBuilder()
|
return newBuilder()
|
||||||
|
.setEquipParam(
|
||||||
|
EquipParam.newBuilder()
|
||||||
.setItemId(this.itemId)
|
.setItemId(this.itemId)
|
||||||
.setItemNum(this.itemCount)
|
.setItemNum(this.itemCount)
|
||||||
.setItemLevel(this.itemLevel)
|
.setItemLevel(this.itemLevel)
|
||||||
.setPromoteLevel(0)//mock
|
.setPromoteLevel(0) // mock
|
||||||
.build())
|
.build())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,6 @@ import emu.grasscutter.scripts.data.SceneGadget;
|
|||||||
import emu.grasscutter.scripts.data.SceneGroup;
|
import emu.grasscutter.scripts.data.SceneGroup;
|
||||||
import emu.grasscutter.utils.Position;
|
import emu.grasscutter.utils.Position;
|
||||||
import emu.grasscutter.utils.Utils;
|
import emu.grasscutter.utils.Utils;
|
||||||
|
|
||||||
import java.util.ArrayDeque;
|
import java.util.ArrayDeque;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -29,32 +28,39 @@ public final class BlossomActivity {
|
|||||||
private final int goal;
|
private final int goal;
|
||||||
private int generatedCount;
|
private int generatedCount;
|
||||||
private final int worldLevel;
|
private final int worldLevel;
|
||||||
private boolean pass=false;
|
private boolean pass = false;
|
||||||
private final List<EntityMonster> activeMonsters = new ArrayList<>();
|
private final List<EntityMonster> activeMonsters = new ArrayList<>();
|
||||||
private final Queue<Integer> candidateMonsters = new ArrayDeque<>();
|
private final Queue<Integer> candidateMonsters = new ArrayDeque<>();
|
||||||
private static final int BLOOMING_GADGET_ID = 70210109;
|
private static final int BLOOMING_GADGET_ID = 70210109;
|
||||||
public BlossomActivity(EntityGadget entityGadget, List<Integer> monsters, int timeout, int worldLevel) {
|
|
||||||
|
public BlossomActivity(
|
||||||
|
EntityGadget entityGadget, List<Integer> monsters, int timeout, int worldLevel) {
|
||||||
this.tempSceneGroup = new SceneGroup();
|
this.tempSceneGroup = new SceneGroup();
|
||||||
this.tempSceneGroup.id = entityGadget.getId();
|
this.tempSceneGroup.id = entityGadget.getId();
|
||||||
this.gadget=entityGadget;
|
this.gadget = entityGadget;
|
||||||
this.step=0;
|
this.step = 0;
|
||||||
this.goal = monsters.size();
|
this.goal = monsters.size();
|
||||||
this.candidateMonsters.addAll(monsters);
|
this.candidateMonsters.addAll(monsters);
|
||||||
this.worldLevel = worldLevel;
|
this.worldLevel = worldLevel;
|
||||||
ArrayList<ChallengeTrigger> challengeTriggers = new ArrayList<>();
|
ArrayList<ChallengeTrigger> challengeTriggers = new ArrayList<>();
|
||||||
this.challenge = new WorldChallenge(entityGadget.getScene(),
|
this.challenge =
|
||||||
|
new WorldChallenge(
|
||||||
|
entityGadget.getScene(),
|
||||||
tempSceneGroup,
|
tempSceneGroup,
|
||||||
1,
|
1,
|
||||||
1,
|
1,
|
||||||
List.of(goal, timeout),
|
List.of(goal, timeout),
|
||||||
timeout,
|
timeout,
|
||||||
goal, challengeTriggers);
|
goal,
|
||||||
|
challengeTriggers);
|
||||||
challengeTriggers.add(new KillMonsterCountTrigger());
|
challengeTriggers.add(new KillMonsterCountTrigger());
|
||||||
//this.challengeTriggers.add(new InTimeTrigger());
|
// this.challengeTriggers.add(new InTimeTrigger());
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorldChallenge getChallenge() {
|
public WorldChallenge getChallenge() {
|
||||||
return this.challenge;
|
return this.challenge;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMonsters(List<EntityMonster> monsters) {
|
public void setMonsters(List<EntityMonster> monsters) {
|
||||||
this.activeMonsters.clear();
|
this.activeMonsters.clear();
|
||||||
this.activeMonsters.addAll(monsters);
|
this.activeMonsters.addAll(monsters);
|
||||||
@ -62,26 +68,30 @@ public final class BlossomActivity {
|
|||||||
monster.setGroupId(this.tempSceneGroup.id);
|
monster.setGroupId(this.tempSceneGroup.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getAliveMonstersCount() {
|
public int getAliveMonstersCount() {
|
||||||
int count=0;
|
int count = 0;
|
||||||
for (EntityMonster monster: activeMonsters) {
|
for (EntityMonster monster : activeMonsters) {
|
||||||
if (monster.isAlive()) {
|
if (monster.isAlive()) {
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getPass() {
|
public boolean getPass() {
|
||||||
return pass;
|
return pass;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void start() {
|
public void start() {
|
||||||
challenge.start();
|
challenge.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onTick() {
|
public void onTick() {
|
||||||
Scene scene = gadget.getScene();
|
Scene scene = gadget.getScene();
|
||||||
Position pos = gadget.getPosition();
|
Position pos = gadget.getPosition();
|
||||||
if (getAliveMonstersCount() <= 2) {
|
if (getAliveMonstersCount() <= 2) {
|
||||||
if (generatedCount<goal) {
|
if (generatedCount < goal) {
|
||||||
step++;
|
step++;
|
||||||
|
|
||||||
var worldLevelData = GameData.getWorldLevelDataMap().get(worldLevel);
|
var worldLevelData = GameData.getWorldLevelDataMap().get(worldLevel);
|
||||||
@ -91,11 +101,11 @@ public final class BlossomActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<EntityMonster> newMonsters = new ArrayList<>();
|
List<EntityMonster> newMonsters = new ArrayList<>();
|
||||||
int willSpawn = Utils.randomRange(3,5);
|
int willSpawn = Utils.randomRange(3, 5);
|
||||||
if (generatedCount+willSpawn>goal) {
|
if (generatedCount + willSpawn > goal) {
|
||||||
willSpawn = goal - generatedCount;
|
willSpawn = goal - generatedCount;
|
||||||
}
|
}
|
||||||
generatedCount+=willSpawn;
|
generatedCount += willSpawn;
|
||||||
for (int i = 0; i < willSpawn; i++) {
|
for (int i = 0; i < willSpawn; i++) {
|
||||||
var monsterData = GameData.getMonsterDataMap().get(candidateMonsters.poll());
|
var monsterData = GameData.getMonsterDataMap().get(candidateMonsters.poll());
|
||||||
int level = scene.getEntityLevel(1, worldLevelOverride);
|
int level = scene.getEntityLevel(1, worldLevelOverride);
|
||||||
@ -104,7 +114,7 @@ public final class BlossomActivity {
|
|||||||
newMonsters.add(entity);
|
newMonsters.add(entity);
|
||||||
}
|
}
|
||||||
setMonsters(newMonsters);
|
setMonsters(newMonsters);
|
||||||
}else {
|
} else {
|
||||||
if (getAliveMonstersCount() == 0) {
|
if (getAliveMonstersCount() == 0) {
|
||||||
this.pass = true;
|
this.pass = true;
|
||||||
this.challenge.done();
|
this.challenge.done();
|
||||||
@ -112,12 +122,15 @@ public final class BlossomActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityGadget getGadget() {
|
public EntityGadget getGadget() {
|
||||||
return gadget;
|
return gadget;
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityGadget getChest() {
|
public EntityGadget getChest() {
|
||||||
if (chest==null) {
|
if (chest == null) {
|
||||||
EntityGadget rewardGadget = new EntityGadget(gadget.getScene(), BLOOMING_GADGET_ID, gadget.getPosition());
|
EntityGadget rewardGadget =
|
||||||
|
new EntityGadget(gadget.getScene(), BLOOMING_GADGET_ID, gadget.getPosition());
|
||||||
SceneGadget metaGadget = new SceneGadget();
|
SceneGadget metaGadget = new SceneGadget();
|
||||||
metaGadget.boss_chest = new SceneBossChest();
|
metaGadget.boss_chest = new SceneBossChest();
|
||||||
metaGadget.boss_chest.resin = 20;
|
metaGadget.boss_chest.resin = 20;
|
||||||
|
@ -30,11 +30,10 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
|||||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||||
import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
||||||
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
|
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.concurrent.ThreadLocalRandom;
|
import java.util.concurrent.ThreadLocalRandom;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
public class EnergyManager extends BasePlayerManager {
|
public class EnergyManager extends BasePlayerManager {
|
||||||
private static final Int2ObjectMap<List<EnergyDropInfo>> energyDropData =
|
private static final Int2ObjectMap<List<EnergyDropInfo>> energyDropData =
|
||||||
@ -390,7 +389,8 @@ public class EnergyManager extends BasePlayerManager {
|
|||||||
*/
|
*/
|
||||||
public boolean refillActiveEnergy() {
|
public boolean refillActiveEnergy() {
|
||||||
var activeEntity = this.player.getTeamManager().getCurrentAvatarEntity();
|
var activeEntity = this.player.getTeamManager().getCurrentAvatarEntity();
|
||||||
return activeEntity.addEnergy(activeEntity.getAvatar().getSkillDepot().getEnergySkillData().getCostElemVal());
|
return activeEntity.addEnergy(
|
||||||
|
activeEntity.getAvatar().getSkillDepot().getEnergySkillData().getCostElemVal());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -402,8 +402,10 @@ public class EnergyManager extends BasePlayerManager {
|
|||||||
public void refillTeamEnergy(PropChangeReason changeReason, boolean isFlat) {
|
public void refillTeamEnergy(PropChangeReason changeReason, boolean isFlat) {
|
||||||
for (var entityAvatar : this.player.getTeamManager().getActiveTeam()) {
|
for (var entityAvatar : this.player.getTeamManager().getActiveTeam()) {
|
||||||
// giving the exact amount read off the AvatarSkillData.json
|
// giving the exact amount read off the AvatarSkillData.json
|
||||||
entityAvatar.addEnergy(entityAvatar.getAvatar().getSkillDepot()
|
entityAvatar.addEnergy(
|
||||||
.getEnergySkillData().getCostElemVal(), changeReason, isFlat);
|
entityAvatar.getAvatar().getSkillDepot().getEnergySkillData().getCostElemVal(),
|
||||||
|
changeReason,
|
||||||
|
isFlat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,8 +10,6 @@ import emu.grasscutter.game.quest.enums.QuestContent;
|
|||||||
import emu.grasscutter.game.quest.enums.QuestState;
|
import emu.grasscutter.game.quest.enums.QuestState;
|
||||||
import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode;
|
import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode;
|
||||||
import emu.grasscutter.server.packet.send.*;
|
import emu.grasscutter.server.packet.send.*;
|
||||||
import lombok.val;
|
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@ -149,9 +147,7 @@ public final class PlayerProgressManager extends BasePlayerDataManager {
|
|||||||
this.player.sendPacket(new PacketSetOpenStateRsp(openState, value));
|
this.player.sendPacket(new PacketSetOpenStateRsp(openState, value));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** This force sets an open state, ignoring all conditions and permissions */
|
||||||
* This force sets an open state, ignoring all conditions and permissions
|
|
||||||
*/
|
|
||||||
public void forceSetOpenState(int openState, int value) {
|
public void forceSetOpenState(int openState, int value) {
|
||||||
this.setOpenState(openState, value);
|
this.setOpenState(openState, value);
|
||||||
}
|
}
|
||||||
@ -247,32 +243,32 @@ public final class PlayerProgressManager extends BasePlayerDataManager {
|
|||||||
this.player.sendPacket(new PacketSceneAreaUnlockNotify(sceneId, areaId));
|
this.player.sendPacket(new PacketSceneAreaUnlockNotify(sceneId, areaId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** Give replace costume to player (Amber, Jean, Mona, Rosaria) */
|
||||||
* Give replace costume to player (Amber, Jean, Mona, Rosaria)
|
public void addReplaceCostumes() {
|
||||||
*/
|
|
||||||
public void addReplaceCostumes(){
|
|
||||||
var currentPlayerCostumes = player.getCostumeList();
|
var currentPlayerCostumes = player.getCostumeList();
|
||||||
GameData.getAvatarReplaceCostumeDataMap().keySet().forEach(costumeId -> {
|
GameData.getAvatarReplaceCostumeDataMap()
|
||||||
if (GameData.getAvatarCostumeDataMap().get(costumeId) == null || currentPlayerCostumes.contains(costumeId)){
|
.keySet()
|
||||||
|
.forEach(
|
||||||
|
costumeId -> {
|
||||||
|
if (GameData.getAvatarCostumeDataMap().get(costumeId) == null
|
||||||
|
|| currentPlayerCostumes.contains(costumeId)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.player.addCostume(costumeId);
|
this.player.addCostume(costumeId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** Quest progress */
|
||||||
* Quest progress
|
public void addQuestProgress(int id, int count) {
|
||||||
*/
|
|
||||||
public void addQuestProgress(int id, int count){
|
|
||||||
var newCount = player.getPlayerProgress().addToCurrentProgress(id, count);
|
var newCount = player.getPlayerProgress().addToCurrentProgress(id, count);
|
||||||
player.save();
|
player.save();
|
||||||
player.getQuestManager().queueEvent(QuestContent.QUEST_CONTENT_ADD_QUEST_PROGRESS, id, newCount);
|
player
|
||||||
|
.getQuestManager()
|
||||||
|
.queueEvent(QuestContent.QUEST_CONTENT_ADD_QUEST_PROGRESS, id, newCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** Item history */
|
||||||
* Item history
|
public void addItemObtainedHistory(int id, int count) {
|
||||||
*/
|
|
||||||
public void addItemObtainedHistory(int id, int count){
|
|
||||||
var newCount = player.getPlayerProgress().addToItemHistory(id, count);
|
var newCount = player.getPlayerProgress().addToItemHistory(id, count);
|
||||||
player.save();
|
player.save();
|
||||||
player.getQuestManager().queueEvent(QuestCond.QUEST_COND_HISTORY_GOT_ANY_ITEM, id, newCount);
|
player.getQuestManager().queueEvent(QuestCond.QUEST_COND_HISTORY_GOT_ANY_ITEM, id, newCount);
|
||||||
|
@ -659,11 +659,13 @@ public final class TeamManager extends BasePlayerDataManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies 10% of the avatar's max HP as damage.
|
* Applies 10% of the avatar's max HP as damage. This occurs when the avatar is killed by the
|
||||||
* This occurs when the avatar is killed by the void.
|
* void.
|
||||||
*/
|
*/
|
||||||
public void applyVoidDamage() {
|
public void applyVoidDamage() {
|
||||||
this.getActiveTeam().forEach(entity -> {
|
this.getActiveTeam()
|
||||||
|
.forEach(
|
||||||
|
entity -> {
|
||||||
entity.damage(entity.getFightProperty(FightProperty.FIGHT_PROP_MAX_HP) * .1f);
|
entity.damage(entity.getFightProperty(FightProperty.FIGHT_PROP_MAX_HP) * .1f);
|
||||||
player.sendPacket(new PacketAvatarLifeStateChangeNotify(entity.getAvatar()));
|
player.sendPacket(new PacketAvatarLifeStateChangeNotify(entity.getAvatar()));
|
||||||
});
|
});
|
||||||
|
@ -1,34 +1,82 @@
|
|||||||
package emu.grasscutter.game.props;
|
package emu.grasscutter.game.props;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Stream;
|
|
||||||
|
|
||||||
import emu.grasscutter.scripts.constants.IntValueEnum;
|
import emu.grasscutter.scripts.constants.IntValueEnum;
|
||||||
import emu.grasscutter.utils.Utils;
|
import emu.grasscutter.utils.Utils;
|
||||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Stream;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
public enum ElementType implements IntValueEnum {
|
public enum ElementType implements IntValueEnum {
|
||||||
None (0, FightProperty.FIGHT_PROP_CUR_FIRE_ENERGY, FightProperty.FIGHT_PROP_MAX_FIRE_ENERGY),
|
None(0, FightProperty.FIGHT_PROP_CUR_FIRE_ENERGY, FightProperty.FIGHT_PROP_MAX_FIRE_ENERGY),
|
||||||
Fire (1, FightProperty.FIGHT_PROP_CUR_FIRE_ENERGY, FightProperty.FIGHT_PROP_MAX_FIRE_ENERGY, 10101, "TeamResonance_Fire_Lv2", 1),
|
Fire(
|
||||||
Water (2, FightProperty.FIGHT_PROP_CUR_WATER_ENERGY, FightProperty.FIGHT_PROP_MAX_WATER_ENERGY, 10201, "TeamResonance_Water_Lv2", 2),
|
1,
|
||||||
Grass (3, FightProperty.FIGHT_PROP_CUR_GRASS_ENERGY, FightProperty.FIGHT_PROP_MAX_GRASS_ENERGY, 10501, "TeamResonance_Grass_Lv2", 7),
|
FightProperty.FIGHT_PROP_CUR_FIRE_ENERGY,
|
||||||
Electric (4, FightProperty.FIGHT_PROP_CUR_ELEC_ENERGY, FightProperty.FIGHT_PROP_MAX_ELEC_ENERGY, 10401, "TeamResonance_Electric_Lv2", 6),
|
FightProperty.FIGHT_PROP_MAX_FIRE_ENERGY,
|
||||||
Ice (5, FightProperty.FIGHT_PROP_CUR_ICE_ENERGY, FightProperty.FIGHT_PROP_MAX_ICE_ENERGY, 10601, "TeamResonance_Ice_Lv2", 4),
|
10101,
|
||||||
Frozen (6, FightProperty.FIGHT_PROP_CUR_ICE_ENERGY, FightProperty.FIGHT_PROP_MAX_ICE_ENERGY),
|
"TeamResonance_Fire_Lv2",
|
||||||
Wind (7, FightProperty.FIGHT_PROP_CUR_WIND_ENERGY, FightProperty.FIGHT_PROP_MAX_WIND_ENERGY, 10301, "TeamResonance_Wind_Lv2", 3),
|
1),
|
||||||
Rock (8, FightProperty.FIGHT_PROP_CUR_ROCK_ENERGY, FightProperty.FIGHT_PROP_MAX_ROCK_ENERGY, 10701, "TeamResonance_Rock_Lv2", 5),
|
Water(
|
||||||
AntiFire (9, FightProperty.FIGHT_PROP_CUR_FIRE_ENERGY, FightProperty.FIGHT_PROP_MAX_FIRE_ENERGY),
|
2,
|
||||||
Default (255, FightProperty.FIGHT_PROP_CUR_FIRE_ENERGY, FightProperty.FIGHT_PROP_MAX_FIRE_ENERGY, 10801, "TeamResonance_AllDifferent");
|
FightProperty.FIGHT_PROP_CUR_WATER_ENERGY,
|
||||||
|
FightProperty.FIGHT_PROP_MAX_WATER_ENERGY,
|
||||||
|
10201,
|
||||||
|
"TeamResonance_Water_Lv2",
|
||||||
|
2),
|
||||||
|
Grass(
|
||||||
|
3,
|
||||||
|
FightProperty.FIGHT_PROP_CUR_GRASS_ENERGY,
|
||||||
|
FightProperty.FIGHT_PROP_MAX_GRASS_ENERGY,
|
||||||
|
10501,
|
||||||
|
"TeamResonance_Grass_Lv2",
|
||||||
|
7),
|
||||||
|
Electric(
|
||||||
|
4,
|
||||||
|
FightProperty.FIGHT_PROP_CUR_ELEC_ENERGY,
|
||||||
|
FightProperty.FIGHT_PROP_MAX_ELEC_ENERGY,
|
||||||
|
10401,
|
||||||
|
"TeamResonance_Electric_Lv2",
|
||||||
|
6),
|
||||||
|
Ice(
|
||||||
|
5,
|
||||||
|
FightProperty.FIGHT_PROP_CUR_ICE_ENERGY,
|
||||||
|
FightProperty.FIGHT_PROP_MAX_ICE_ENERGY,
|
||||||
|
10601,
|
||||||
|
"TeamResonance_Ice_Lv2",
|
||||||
|
4),
|
||||||
|
Frozen(6, FightProperty.FIGHT_PROP_CUR_ICE_ENERGY, FightProperty.FIGHT_PROP_MAX_ICE_ENERGY),
|
||||||
|
Wind(
|
||||||
|
7,
|
||||||
|
FightProperty.FIGHT_PROP_CUR_WIND_ENERGY,
|
||||||
|
FightProperty.FIGHT_PROP_MAX_WIND_ENERGY,
|
||||||
|
10301,
|
||||||
|
"TeamResonance_Wind_Lv2",
|
||||||
|
3),
|
||||||
|
Rock(
|
||||||
|
8,
|
||||||
|
FightProperty.FIGHT_PROP_CUR_ROCK_ENERGY,
|
||||||
|
FightProperty.FIGHT_PROP_MAX_ROCK_ENERGY,
|
||||||
|
10701,
|
||||||
|
"TeamResonance_Rock_Lv2",
|
||||||
|
5),
|
||||||
|
AntiFire(9, FightProperty.FIGHT_PROP_CUR_FIRE_ENERGY, FightProperty.FIGHT_PROP_MAX_FIRE_ENERGY),
|
||||||
|
Default(
|
||||||
|
255,
|
||||||
|
FightProperty.FIGHT_PROP_CUR_FIRE_ENERGY,
|
||||||
|
FightProperty.FIGHT_PROP_MAX_FIRE_ENERGY,
|
||||||
|
10801,
|
||||||
|
"TeamResonance_AllDifferent");
|
||||||
|
|
||||||
private static final Int2ObjectMap<ElementType> map = new Int2ObjectOpenHashMap<>();
|
private static final Int2ObjectMap<ElementType> map = new Int2ObjectOpenHashMap<>();
|
||||||
private static final Map<String, ElementType> stringMap = new HashMap<>();
|
private static final Map<String, ElementType> stringMap = new HashMap<>();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
// Create bindings for each value.
|
// Create bindings for each value.
|
||||||
Stream.of(ElementType.values()).forEach(entry -> {
|
Stream.of(ElementType.values())
|
||||||
|
.forEach(
|
||||||
|
entry -> {
|
||||||
map.put(entry.getValue(), entry);
|
map.put(entry.getValue(), entry);
|
||||||
stringMap.put(entry.name(), entry);
|
stringMap.put(entry.name(), entry);
|
||||||
});
|
});
|
||||||
@ -45,11 +93,22 @@ public enum ElementType implements IntValueEnum {
|
|||||||
this(value, curEnergyProp, maxEnergyProp, 0, null, 1);
|
this(value, curEnergyProp, maxEnergyProp, 0, null, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
ElementType(int value, FightProperty curEnergyProp, FightProperty maxEnergyProp, int teamResonanceId, String configName) {
|
ElementType(
|
||||||
|
int value,
|
||||||
|
FightProperty curEnergyProp,
|
||||||
|
FightProperty maxEnergyProp,
|
||||||
|
int teamResonanceId,
|
||||||
|
String configName) {
|
||||||
this(value, curEnergyProp, maxEnergyProp, teamResonanceId, configName, 1);
|
this(value, curEnergyProp, maxEnergyProp, teamResonanceId, configName, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
ElementType(int value, FightProperty curEnergyProp, FightProperty maxEnergyProp, int teamResonanceId, String configName, int depotIndex) {
|
ElementType(
|
||||||
|
int value,
|
||||||
|
FightProperty curEnergyProp,
|
||||||
|
FightProperty maxEnergyProp,
|
||||||
|
int teamResonanceId,
|
||||||
|
String configName,
|
||||||
|
int depotIndex) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
this.curEnergyProp = curEnergyProp;
|
this.curEnergyProp = curEnergyProp;
|
||||||
this.maxEnergyProp = maxEnergyProp;
|
this.maxEnergyProp = maxEnergyProp;
|
||||||
|
@ -4,7 +4,6 @@ import emu.grasscutter.data.excels.QuestData;
|
|||||||
import emu.grasscutter.game.player.Player;
|
import emu.grasscutter.game.player.Player;
|
||||||
import emu.grasscutter.game.quest.QuestValueCond;
|
import emu.grasscutter.game.quest.QuestValueCond;
|
||||||
import emu.grasscutter.game.quest.enums.QuestCond;
|
import emu.grasscutter.game.quest.enums.QuestCond;
|
||||||
import lombok.val;
|
|
||||||
|
|
||||||
@QuestValueCond(QuestCond.QUEST_COND_PERSONAL_LINE_UNLOCK)
|
@QuestValueCond(QuestCond.QUEST_COND_PERSONAL_LINE_UNLOCK)
|
||||||
public class ConditionPersonalLineUnlock extends BaseCondition {
|
public class ConditionPersonalLineUnlock extends BaseCondition {
|
||||||
@ -15,8 +14,7 @@ public class ConditionPersonalLineUnlock extends BaseCondition {
|
|||||||
QuestData questData,
|
QuestData questData,
|
||||||
QuestData.QuestAcceptCondition condition,
|
QuestData.QuestAcceptCondition condition,
|
||||||
String paramStr,
|
String paramStr,
|
||||||
int... params
|
int... params) {
|
||||||
) {
|
|
||||||
var personalLineId = condition.getParam()[0];
|
var personalLineId = condition.getParam()[0];
|
||||||
return owner.getPersonalLineList().contains(personalLineId);
|
return owner.getPersonalLineList().contains(personalLineId);
|
||||||
}
|
}
|
||||||
|
@ -437,32 +437,31 @@ public final class Scene {
|
|||||||
|
|
||||||
this.finishLoading();
|
this.finishLoading();
|
||||||
this.checkPlayerRespawn();
|
this.checkPlayerRespawn();
|
||||||
if (this.tickCount++ % 10 == 0)
|
if (this.tickCount++ % 10 == 0) broadcastPacket(new PacketSceneTimeNotify(this));
|
||||||
broadcastPacket(new PacketSceneTimeNotify(this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** Validates a player's current position. Teleports the player if the player is out of bounds. */
|
||||||
* Validates a player's current position.
|
|
||||||
* Teleports the player if the player is out of bounds.
|
|
||||||
*/
|
|
||||||
private void checkPlayerRespawn() {
|
private void checkPlayerRespawn() {
|
||||||
if (this.getScriptManager().getConfig() == null) return;
|
if (this.getScriptManager().getConfig() == null) return;
|
||||||
var diePos = this.getScriptManager().getConfig().die_y;
|
var diePos = this.getScriptManager().getConfig().die_y;
|
||||||
|
|
||||||
// Check players in the scene.
|
// Check players in the scene.
|
||||||
this.players.forEach(player -> {
|
this.players.forEach(
|
||||||
|
player -> {
|
||||||
if (this.getScriptManager().getConfig() == null) return;
|
if (this.getScriptManager().getConfig() == null) return;
|
||||||
|
|
||||||
// Check if we need a respawn
|
// Check if we need a respawn
|
||||||
if (diePos >= player.getPosition().getY()) {
|
if (diePos >= player.getPosition().getY()) {
|
||||||
//Respawn the player.
|
// Respawn the player.
|
||||||
this.respawnPlayer(player);
|
this.respawnPlayer(player);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Check entities in the scene.
|
// Check entities in the scene.
|
||||||
this.getEntities().forEach((id, entity) -> {
|
this.getEntities()
|
||||||
if (diePos >= entity.getPosition().getY()){
|
.forEach(
|
||||||
|
(id, entity) -> {
|
||||||
|
if (diePos >= entity.getPosition().getY()) {
|
||||||
this.killEntity(entity);
|
this.killEntity(entity);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -503,7 +502,8 @@ public final class Scene {
|
|||||||
* @return The respawn rotation for the player.
|
* @return The respawn rotation for the player.
|
||||||
*/
|
*/
|
||||||
private Position getRespawnRotation(Player player) {
|
private Position getRespawnRotation(Player player) {
|
||||||
var lastCheckpointRot = this.dungeonManager != null ? this.dungeonManager.getRespawnRotation() : null;
|
var lastCheckpointRot =
|
||||||
|
this.dungeonManager != null ? this.dungeonManager.getRespawnRotation() : null;
|
||||||
return lastCheckpointRot != null ? lastCheckpointRot : this.getDefaultRot(player);
|
return lastCheckpointRot != null ? lastCheckpointRot : this.getDefaultRot(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -520,20 +520,22 @@ public final class Scene {
|
|||||||
// TODO: Respawn the player at the last valid location.
|
// TODO: Respawn the player at the last valid location.
|
||||||
var targetPos = getRespawnLocation(player);
|
var targetPos = getRespawnLocation(player);
|
||||||
var targetRot = getRespawnRotation(player);
|
var targetRot = getRespawnRotation(player);
|
||||||
var teleportProps = TeleportProperties.builder()
|
var teleportProps =
|
||||||
|
TeleportProperties.builder()
|
||||||
.sceneId(getId())
|
.sceneId(getId())
|
||||||
.teleportTo(targetPos)
|
.teleportTo(targetPos)
|
||||||
.teleportRot(targetRot)
|
.teleportRot(targetRot)
|
||||||
.teleportType(PlayerTeleportEvent.TeleportType.INTERNAL)
|
.teleportType(PlayerTeleportEvent.TeleportType.INTERNAL)
|
||||||
.enterType(EnterTypeOuterClass.EnterType.ENTER_TYPE_GOTO)
|
.enterType(EnterTypeOuterClass.EnterType.ENTER_TYPE_GOTO)
|
||||||
.enterReason(dungeonManager != null ? EnterReason.DungeonReviveOnWaypoint : EnterReason.Revival);
|
.enterReason(
|
||||||
|
dungeonManager != null ? EnterReason.DungeonReviveOnWaypoint : EnterReason.Revival);
|
||||||
|
|
||||||
return this.getWorld().transferPlayerToScene(player, teleportProps.build());
|
return this.getWorld().transferPlayerToScene(player, teleportProps.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoked when the scene finishes loading.
|
* Invoked when the scene finishes loading. Runs all callbacks that were added with {@link
|
||||||
* Runs all callbacks that were added with {@link #runWhenFinished(Runnable)}.
|
* #runWhenFinished(Runnable)}.
|
||||||
*/
|
*/
|
||||||
public void finishLoading() {
|
public void finishLoading() {
|
||||||
if (this.finishedLoading) return;
|
if (this.finishedLoading) return;
|
||||||
@ -544,14 +546,15 @@ public final class Scene {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a callback to be executed when the scene is finished loading.
|
* Adds a callback to be executed when the scene is finished loading. If the scene is already
|
||||||
* If the scene is already finished loading, the callback will be executed immediately.
|
* finished loading, the callback will be executed immediately.
|
||||||
*
|
*
|
||||||
* @param runnable The callback to be executed.
|
* @param runnable The callback to be executed.
|
||||||
*/
|
*/
|
||||||
public void runWhenFinished(Runnable runnable) {
|
public void runWhenFinished(Runnable runnable) {
|
||||||
if (this.isFinishedLoading()) {
|
if (this.isFinishedLoading()) {
|
||||||
runnable.run();return;
|
runnable.run();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.afterLoadedCallbacks.add(runnable);
|
this.afterLoadedCallbacks.add(runnable);
|
||||||
@ -774,17 +777,18 @@ public final class Scene {
|
|||||||
|
|
||||||
public int loadDynamicGroup(int group_id) {
|
public int loadDynamicGroup(int group_id) {
|
||||||
SceneGroup group = getScriptManager().getGroupById(group_id);
|
SceneGroup group = getScriptManager().getGroupById(group_id);
|
||||||
if(group == null || getScriptManager().getGroupInstanceById(group_id) != null) return -1; //Group not found or already instanced
|
if (group == null || getScriptManager().getGroupInstanceById(group_id) != null)
|
||||||
|
return -1; // Group not found or already instanced
|
||||||
|
|
||||||
onLoadGroup(new ArrayList<>(List.of(group)));
|
onLoadGroup(new ArrayList<>(List.of(group)));
|
||||||
|
|
||||||
if(GameData.getGroupReplacements().containsKey(group_id)) onRegisterGroups();
|
if (GameData.getGroupReplacements().containsKey(group_id)) onRegisterGroups();
|
||||||
|
|
||||||
if (group.init_config == null) return -1;
|
if (group.init_config == null) return -1;
|
||||||
return group.init_config.suite;
|
return group.init_config.suite;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean unregisterDynamicGroup(int groupId){
|
public boolean unregisterDynamicGroup(int groupId) {
|
||||||
var group = getScriptManager().getGroupById(groupId);
|
var group = getScriptManager().getGroupById(groupId);
|
||||||
if (group == null) return false;
|
if (group == null) return false;
|
||||||
|
|
||||||
@ -795,29 +799,27 @@ public final class Scene {
|
|||||||
|
|
||||||
public void onRegisterGroups() {
|
public void onRegisterGroups() {
|
||||||
var sceneGroups = this.loadedGroups;
|
var sceneGroups = this.loadedGroups;
|
||||||
var sceneGroupMap = sceneGroups.stream()
|
var sceneGroupMap =
|
||||||
.collect(Collectors.toMap(item -> item.id, item -> item));
|
sceneGroups.stream().collect(Collectors.toMap(item -> item.id, item -> item));
|
||||||
var sceneGroupsIds = sceneGroups.stream()
|
var sceneGroupsIds = sceneGroups.stream().map(group -> group.id).toList();
|
||||||
.map(group -> group.id)
|
var dynamicGroups =
|
||||||
.toList();
|
sceneGroups.stream().filter(group -> group.dynamic_load).map(group -> group.id).toList();
|
||||||
var dynamicGroups = sceneGroups.stream()
|
|
||||||
.filter(group -> group.dynamic_load)
|
|
||||||
.map(group -> group.id)
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
//Create the graph
|
// Create the graph
|
||||||
var nodes = new ArrayList<KahnsSort.Node>();
|
var nodes = new ArrayList<KahnsSort.Node>();
|
||||||
var groupList = new ArrayList<Integer>();
|
var groupList = new ArrayList<Integer>();
|
||||||
GameData.getGroupReplacements().values().stream().filter(replacement -> dynamicGroups.contains(replacement.id)).forEach(replacement -> {
|
GameData.getGroupReplacements().values().stream()
|
||||||
|
.filter(replacement -> dynamicGroups.contains(replacement.id))
|
||||||
|
.forEach(
|
||||||
|
replacement -> {
|
||||||
Grasscutter.getLogger().info("Graph ordering replacement {}", replacement);
|
Grasscutter.getLogger().info("Graph ordering replacement {}", replacement);
|
||||||
replacement.replace_groups.forEach(group -> {
|
replacement.replace_groups.forEach(
|
||||||
|
group -> {
|
||||||
nodes.add(new KahnsSort.Node(replacement.id, group));
|
nodes.add(new KahnsSort.Node(replacement.id, group));
|
||||||
if (!groupList.contains(group))
|
if (!groupList.contains(group)) groupList.add(group);
|
||||||
groupList.add(group);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!groupList.contains(replacement.id))
|
if (!groupList.contains(replacement.id)) groupList.add(replacement.id);
|
||||||
groupList.add(replacement.id);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
KahnsSort.Graph graph = new KahnsSort.Graph(nodes, groupList);
|
KahnsSort.Graph graph = new KahnsSort.Graph(nodes, groupList);
|
||||||
@ -825,10 +827,12 @@ public final class Scene {
|
|||||||
if (dynamicGroupsOrdered == null) throw new RuntimeException("Invalid group replacement graph");
|
if (dynamicGroupsOrdered == null) throw new RuntimeException("Invalid group replacement graph");
|
||||||
|
|
||||||
// Now we can start unloading and loading groups :D
|
// Now we can start unloading and loading groups :D
|
||||||
dynamicGroupsOrdered.forEach(group -> {
|
dynamicGroupsOrdered.forEach(
|
||||||
if (GameData.getGroupReplacements().containsKey((int)group)) { //isGroupJoinReplacement
|
group -> {
|
||||||
var data = GameData.getGroupReplacements().get((int)group);
|
if (GameData.getGroupReplacements().containsKey((int) group)) { // isGroupJoinReplacement
|
||||||
var sceneGroupReplacement = this.loadedGroups.stream().filter(g -> g.id == group).findFirst().orElseThrow();
|
var data = GameData.getGroupReplacements().get((int) group);
|
||||||
|
var sceneGroupReplacement =
|
||||||
|
this.loadedGroups.stream().filter(g -> g.id == group).findFirst().orElseThrow();
|
||||||
if (sceneGroupReplacement.is_replaceable != null) {
|
if (sceneGroupReplacement.is_replaceable != null) {
|
||||||
var it = data.replace_groups.iterator();
|
var it = data.replace_groups.iterator();
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
@ -837,11 +841,14 @@ public final class Scene {
|
|||||||
|
|
||||||
// Check if we can replace this group
|
// Check if we can replace this group
|
||||||
SceneGroup sceneGroup = sceneGroupMap.get(replace_group);
|
SceneGroup sceneGroup = sceneGroupMap.get(replace_group);
|
||||||
if (sceneGroup != null && sceneGroup.is_replaceable != null &&
|
if (sceneGroup != null
|
||||||
((sceneGroup.is_replaceable.value &&
|
&& sceneGroup.is_replaceable != null
|
||||||
sceneGroup.is_replaceable.version <= sceneGroupReplacement.is_replaceable.version) ||
|
&& ((sceneGroup.is_replaceable.value
|
||||||
sceneGroup.is_replaceable.new_bin_only)) {
|
&& sceneGroup.is_replaceable.version
|
||||||
this.unloadGroup(scriptManager.getBlocks().get(sceneGroup.block_id), replace_group);
|
<= sceneGroupReplacement.is_replaceable.version)
|
||||||
|
|| sceneGroup.is_replaceable.new_bin_only)) {
|
||||||
|
this.unloadGroup(
|
||||||
|
scriptManager.getBlocks().get(sceneGroup.block_id), replace_group);
|
||||||
it.remove();
|
it.remove();
|
||||||
Grasscutter.getLogger().info("Graph ordering: unloaded {}", replace_group);
|
Grasscutter.getLogger().info("Graph ordering: unloaded {}", replace_group);
|
||||||
}
|
}
|
||||||
@ -853,8 +860,11 @@ public final class Scene {
|
|||||||
|
|
||||||
public void loadTriggerFromGroup(SceneGroup group, String triggerName) {
|
public void loadTriggerFromGroup(SceneGroup group, String triggerName) {
|
||||||
// Load triggers and regions
|
// Load triggers and regions
|
||||||
this.getScriptManager().registerTrigger(group.triggers.values().stream()
|
this.getScriptManager()
|
||||||
.filter(p -> p.getName().contains(triggerName)).toList());
|
.registerTrigger(
|
||||||
|
group.triggers.values().stream()
|
||||||
|
.filter(p -> p.getName().contains(triggerName))
|
||||||
|
.toList());
|
||||||
group.regions.values().stream()
|
group.regions.values().stream()
|
||||||
.filter(q -> q.config_id == Integer.parseInt(triggerName.substring(13)))
|
.filter(q -> q.config_id == Integer.parseInt(triggerName.substring(13)))
|
||||||
.map(region -> new EntityRegion(this, region))
|
.map(region -> new EntityRegion(this, region))
|
||||||
@ -867,7 +877,7 @@ public final class Scene {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (var group : groups) {
|
for (var group : groups) {
|
||||||
if(this.loadedGroups.contains(group)) continue;
|
if (this.loadedGroups.contains(group)) continue;
|
||||||
|
|
||||||
// We load the script files for the groups here
|
// We load the script files for the groups here
|
||||||
this.getScriptManager().loadGroupFromScript(group);
|
this.getScriptManager().loadGroupFromScript(group);
|
||||||
@ -880,7 +890,7 @@ public final class Scene {
|
|||||||
// TODO
|
// TODO
|
||||||
var entities = new ArrayList<GameEntity>();
|
var entities = new ArrayList<GameEntity>();
|
||||||
for (var group : groups) {
|
for (var group : groups) {
|
||||||
if(this.loadedGroups.contains(group)) continue;
|
if (this.loadedGroups.contains(group)) continue;
|
||||||
|
|
||||||
if (group.init_config == null) {
|
if (group.init_config == null) {
|
||||||
continue;
|
continue;
|
||||||
@ -897,20 +907,24 @@ public final class Scene {
|
|||||||
var garbageGadgets = group.getGarbageGadgets();
|
var garbageGadgets = group.getGarbageGadgets();
|
||||||
|
|
||||||
if (garbageGadgets != null) {
|
if (garbageGadgets != null) {
|
||||||
entities.addAll(garbageGadgets.stream()
|
entities.addAll(
|
||||||
|
garbageGadgets.stream()
|
||||||
.map(g -> scriptManager.createGadget(group.id, group.block_id, g))
|
.map(g -> scriptManager.createGadget(group.id, group.block_id, g))
|
||||||
.filter(Objects::nonNull).toList());
|
.filter(Objects::nonNull)
|
||||||
|
.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load suites
|
// Load suites
|
||||||
//int suite = group.findInitSuiteIndex(0);
|
// int suite = group.findInitSuiteIndex(0);
|
||||||
this.getScriptManager().refreshGroup(groupInstance, 0, false); //This is what the official server does
|
this.getScriptManager()
|
||||||
|
.refreshGroup(groupInstance, 0, false); // This is what the official server does
|
||||||
|
|
||||||
this.loadedGroups.add(group);
|
this.loadedGroups.add(group);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.scriptManager.meetEntities(entities);
|
this.scriptManager.meetEntities(entities);
|
||||||
groups.forEach(g -> scriptManager.callEvent(new ScriptArgs(g.id, EventType.EVENT_GROUP_LOAD, g.id)));
|
groups.forEach(
|
||||||
|
g -> scriptManager.callEvent(new ScriptArgs(g.id, EventType.EVENT_GROUP_LOAD, g.id)));
|
||||||
|
|
||||||
Grasscutter.getLogger().info("Scene {} loaded {} group(s)", this.getId(), groups.size());
|
Grasscutter.getLogger().info("Scene {} loaded {} group(s)", this.getId(), groups.size());
|
||||||
}
|
}
|
||||||
@ -944,25 +958,23 @@ public final class Scene {
|
|||||||
* @param groupId The group ID.
|
* @param groupId The group ID.
|
||||||
*/
|
*/
|
||||||
public void unloadGroup(SceneBlock block, int groupId) {
|
public void unloadGroup(SceneBlock block, int groupId) {
|
||||||
var toRemove = this.getEntities().values().stream()
|
var toRemove =
|
||||||
.filter(e -> e != null && (
|
this.getEntities().values().stream()
|
||||||
e.getBlockId() == block.id &&
|
.filter(e -> e != null && (e.getBlockId() == block.id && e.getGroupId() == groupId))
|
||||||
e.getGroupId() == groupId)
|
.toList();
|
||||||
).toList();
|
|
||||||
|
|
||||||
if (toRemove.size() > 0) {
|
if (toRemove.size() > 0) {
|
||||||
toRemove.forEach(this::removeEntityDirectly);
|
toRemove.forEach(this::removeEntityDirectly);
|
||||||
this.broadcastPacket(new PacketSceneEntityDisappearNotify(toRemove, VisionType.VISION_TYPE_REMOVE));
|
this.broadcastPacket(
|
||||||
|
new PacketSceneEntityDisappearNotify(toRemove, VisionType.VISION_TYPE_REMOVE));
|
||||||
}
|
}
|
||||||
|
|
||||||
var group = block.groups.get(groupId);
|
var group = block.groups.get(groupId);
|
||||||
if (group.triggers != null) {
|
if (group.triggers != null) {
|
||||||
group.triggers.values().forEach(
|
group.triggers.values().forEach(this.getScriptManager()::deregisterTrigger);
|
||||||
this.getScriptManager()::deregisterTrigger);
|
|
||||||
}
|
}
|
||||||
if (group.regions != null) {
|
if (group.regions != null) {
|
||||||
group.regions.values().forEach(
|
group.regions.values().forEach(this.getScriptManager()::deregisterRegion);
|
||||||
this.getScriptManager()::deregisterRegion);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.scriptManager.getLoadedGroupSetPerBlock().get(block.id).remove(group);
|
this.scriptManager.getLoadedGroupSetPerBlock().get(block.id).remove(group);
|
||||||
@ -1093,7 +1105,8 @@ public final class Scene {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sceneGroupSuite.forEach(i -> {
|
sceneGroupSuite.forEach(
|
||||||
|
i -> {
|
||||||
var group = scriptManager.getGroupById(i.getGroup());
|
var group = scriptManager.getGroupById(i.getGroup());
|
||||||
if (group == null) return;
|
if (group == null) return;
|
||||||
|
|
||||||
|
@ -1,12 +1,5 @@
|
|||||||
package emu.grasscutter.game.world;
|
package emu.grasscutter.game.world;
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
|
|
||||||
import org.bson.types.ObjectId;
|
|
||||||
|
|
||||||
import dev.morphia.annotations.Entity;
|
import dev.morphia.annotations.Entity;
|
||||||
import dev.morphia.annotations.Id;
|
import dev.morphia.annotations.Id;
|
||||||
import dev.morphia.annotations.Indexed;
|
import dev.morphia.annotations.Indexed;
|
||||||
@ -14,20 +7,25 @@ import emu.grasscutter.database.DatabaseHelper;
|
|||||||
import emu.grasscutter.game.player.Player;
|
import emu.grasscutter.game.player.Player;
|
||||||
import emu.grasscutter.scripts.data.SceneGadget;
|
import emu.grasscutter.scripts.data.SceneGadget;
|
||||||
import emu.grasscutter.scripts.data.SceneGroup;
|
import emu.grasscutter.scripts.data.SceneGroup;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import org.bson.types.ObjectId;
|
||||||
|
|
||||||
@Entity(value = "group_instances", useDiscriminator = false)
|
@Entity(value = "group_instances", useDiscriminator = false)
|
||||||
public final class SceneGroupInstance {
|
public final class SceneGroupInstance {
|
||||||
@Id private ObjectId id;
|
@Id private ObjectId id;
|
||||||
|
|
||||||
@Indexed private int ownerUid; //This group is owned by the host player
|
@Indexed private int ownerUid; // This group is owned by the host player
|
||||||
@Getter private int groupId;
|
@Getter private int groupId;
|
||||||
|
|
||||||
@Getter private transient SceneGroup luaGroup;
|
@Getter private transient SceneGroup luaGroup;
|
||||||
@Getter @Setter private int targetSuiteId;
|
@Getter @Setter private int targetSuiteId;
|
||||||
@Getter @Setter private int activeSuiteId;
|
@Getter @Setter private int activeSuiteId;
|
||||||
@Getter private Set<Integer> deadEntities; //Config_ids
|
@Getter private Set<Integer> deadEntities; // Config_ids
|
||||||
private boolean isCached;
|
private boolean isCached;
|
||||||
|
|
||||||
@Getter private Map<Integer, Integer> cachedGadgetStates;
|
@Getter private Map<Integer, Integer> cachedGadgetStates;
|
||||||
@ -46,11 +44,12 @@ public final class SceneGroupInstance {
|
|||||||
this.cachedGadgetStates = new ConcurrentHashMap<>();
|
this.cachedGadgetStates = new ConcurrentHashMap<>();
|
||||||
this.cachedVariables = new ConcurrentHashMap<>();
|
this.cachedVariables = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
this.isCached = false; //This is true when the group is not loaded on scene but caches suite data
|
this.isCached =
|
||||||
|
false; // This is true when the group is not loaded on scene but caches suite data
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated // Morphia only!
|
@Deprecated // Morphia only!
|
||||||
SceneGroupInstance(){
|
SceneGroupInstance() {
|
||||||
this.cachedVariables = new ConcurrentHashMap<>();
|
this.cachedVariables = new ConcurrentHashMap<>();
|
||||||
this.deadEntities = new HashSet<>();
|
this.deadEntities = new HashSet<>();
|
||||||
this.cachedGadgetStates = new ConcurrentHashMap<>();
|
this.cachedGadgetStates = new ConcurrentHashMap<>();
|
||||||
@ -67,11 +66,11 @@ public final class SceneGroupInstance {
|
|||||||
|
|
||||||
public void setCached(boolean value) {
|
public void setCached(boolean value) {
|
||||||
this.isCached = value;
|
this.isCached = value;
|
||||||
save(); //Save each time a group is registered or unregistered
|
save(); // Save each time a group is registered or unregistered
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cacheGadgetState(SceneGadget g, int state) {
|
public void cacheGadgetState(SceneGadget g, int state) {
|
||||||
if(g.persistent) //Only cache when is persistent
|
if (g.persistent) // Only cache when is persistent
|
||||||
cachedGadgetStates.put(g.config_id, state);
|
cachedGadgetStates.put(g.config_id, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,10 +1,8 @@
|
|||||||
package emu.grasscutter.scripts;
|
package emu.grasscutter.scripts;
|
||||||
|
|
||||||
import emu.grasscutter.Grasscutter;
|
import emu.grasscutter.Grasscutter;
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
import emu.grasscutter.utils.Position;
|
import emu.grasscutter.utils.Position;
|
||||||
import lombok.val;
|
import java.util.HashMap;
|
||||||
import org.luaj.vm2.LuaTable;
|
import org.luaj.vm2.LuaTable;
|
||||||
import org.luaj.vm2.LuaValue;
|
import org.luaj.vm2.LuaValue;
|
||||||
|
|
||||||
|
@ -3,26 +3,25 @@ package emu.grasscutter.scripts.data;
|
|||||||
import emu.grasscutter.Grasscutter;
|
import emu.grasscutter.Grasscutter;
|
||||||
import emu.grasscutter.scripts.ScriptLoader;
|
import emu.grasscutter.scripts.ScriptLoader;
|
||||||
import emu.grasscutter.utils.Position;
|
import emu.grasscutter.utils.Position;
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
import lombok.ToString;
|
|
||||||
import org.luaj.vm2.LuaValue;
|
|
||||||
|
|
||||||
import javax.script.Bindings;
|
|
||||||
import javax.script.CompiledScript;
|
|
||||||
import javax.script.ScriptException;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import javax.script.Bindings;
|
||||||
|
import javax.script.CompiledScript;
|
||||||
|
import javax.script.ScriptException;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import org.luaj.vm2.LuaValue;
|
||||||
|
|
||||||
@ToString
|
@ToString
|
||||||
@Setter
|
@Setter
|
||||||
public final class SceneGroup {
|
public final class SceneGroup {
|
||||||
public transient int block_id; // Not an actual variable in the scripts but we will keep it here for reference
|
public transient int
|
||||||
|
block_id; // Not an actual variable in the scripts but we will keep it here for reference
|
||||||
|
|
||||||
public int id;
|
public int id;
|
||||||
public int refresh_id;
|
public int refresh_id;
|
||||||
@ -46,6 +45,7 @@ public final class SceneGroup {
|
|||||||
private transient boolean loaded; // Not an actual variable in the scripts either
|
private transient boolean loaded; // Not an actual variable in the scripts either
|
||||||
private transient CompiledScript script;
|
private transient CompiledScript script;
|
||||||
private transient Bindings bindings;
|
private transient Bindings bindings;
|
||||||
|
|
||||||
public static SceneGroup of(int groupId) {
|
public static SceneGroup of(int groupId) {
|
||||||
var group = new SceneGroup();
|
var group = new SceneGroup();
|
||||||
group.id = groupId;
|
group.id = groupId;
|
||||||
@ -73,7 +73,7 @@ public final class SceneGroup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public SceneSuite getSuiteByIndex(int index) {
|
public SceneSuite getSuiteByIndex(int index) {
|
||||||
if(index < 1 || index > suites.size()) {
|
if (index < 1 || index > suites.size()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return this.suites.get(index - 1);
|
return this.suites.get(index - 1);
|
||||||
@ -92,7 +92,9 @@ public final class SceneGroup {
|
|||||||
|
|
||||||
this.bindings = ScriptLoader.getEngine().createBindings();
|
this.bindings = ScriptLoader.getEngine().createBindings();
|
||||||
|
|
||||||
CompiledScript cs = ScriptLoader.getScript("Scene/" + sceneId + "/scene" + sceneId + "_group" + this.id + ".lua");
|
CompiledScript cs =
|
||||||
|
ScriptLoader.getScript(
|
||||||
|
"Scene/" + sceneId + "/scene" + sceneId + "_group" + this.id + ".lua");
|
||||||
|
|
||||||
if (cs == null) {
|
if (cs == null) {
|
||||||
return this;
|
return this;
|
||||||
@ -105,56 +107,78 @@ public final class SceneGroup {
|
|||||||
cs.eval(this.bindings);
|
cs.eval(this.bindings);
|
||||||
|
|
||||||
// Set
|
// Set
|
||||||
this.monsters = ScriptLoader.getSerializer().toList(SceneMonster.class, this.bindings.get("monsters")).stream()
|
this.monsters =
|
||||||
|
ScriptLoader.getSerializer()
|
||||||
|
.toList(SceneMonster.class, this.bindings.get("monsters"))
|
||||||
|
.stream()
|
||||||
.collect(Collectors.toMap(x -> x.config_id, y -> y, (a, b) -> a));
|
.collect(Collectors.toMap(x -> x.config_id, y -> y, (a, b) -> a));
|
||||||
this.monsters.values().forEach(m -> m.group = this);
|
this.monsters.values().forEach(m -> m.group = this);
|
||||||
|
|
||||||
this.npcs = ScriptLoader.getSerializer().toList(SceneNPC.class, this.bindings.get("npcs")).stream()
|
this.npcs =
|
||||||
|
ScriptLoader.getSerializer().toList(SceneNPC.class, this.bindings.get("npcs")).stream()
|
||||||
.collect(Collectors.toMap(x -> x.config_id, y -> y, (a, b) -> a));
|
.collect(Collectors.toMap(x -> x.config_id, y -> y, (a, b) -> a));
|
||||||
this.npcs.values().forEach(m -> m.group = this);
|
this.npcs.values().forEach(m -> m.group = this);
|
||||||
|
|
||||||
this.gadgets = ScriptLoader.getSerializer().toList(SceneGadget.class, this.bindings.get("gadgets")).stream()
|
this.gadgets =
|
||||||
|
ScriptLoader.getSerializer()
|
||||||
|
.toList(SceneGadget.class, this.bindings.get("gadgets"))
|
||||||
|
.stream()
|
||||||
.collect(Collectors.toMap(x -> x.config_id, y -> y, (a, b) -> a));
|
.collect(Collectors.toMap(x -> x.config_id, y -> y, (a, b) -> a));
|
||||||
this.gadgets.values().forEach(m -> m.group = this);
|
this.gadgets.values().forEach(m -> m.group = this);
|
||||||
|
|
||||||
this.triggers = ScriptLoader.getSerializer().toList(SceneTrigger.class, this.bindings.get("triggers")).stream()
|
this.triggers =
|
||||||
|
ScriptLoader.getSerializer()
|
||||||
|
.toList(SceneTrigger.class, this.bindings.get("triggers"))
|
||||||
|
.stream()
|
||||||
.collect(Collectors.toMap(SceneTrigger::getName, y -> y, (a, b) -> a));
|
.collect(Collectors.toMap(SceneTrigger::getName, y -> y, (a, b) -> a));
|
||||||
this.triggers.values().forEach(t -> t.currentGroup = this);
|
this.triggers.values().forEach(t -> t.currentGroup = this);
|
||||||
|
|
||||||
this.suites = ScriptLoader.getSerializer().toList(SceneSuite.class, this.bindings.get("suites"));
|
this.suites =
|
||||||
this.regions = ScriptLoader.getSerializer().toList(SceneRegion.class, this.bindings.get("regions")).stream()
|
ScriptLoader.getSerializer().toList(SceneSuite.class, this.bindings.get("suites"));
|
||||||
|
this.regions =
|
||||||
|
ScriptLoader.getSerializer()
|
||||||
|
.toList(SceneRegion.class, this.bindings.get("regions"))
|
||||||
|
.stream()
|
||||||
.collect(Collectors.toMap(x -> x.config_id, y -> y, (a, b) -> a));
|
.collect(Collectors.toMap(x -> x.config_id, y -> y, (a, b) -> a));
|
||||||
this.regions.values().forEach(m -> m.group = this);
|
this.regions.values().forEach(m -> m.group = this);
|
||||||
|
|
||||||
this.init_config = ScriptLoader.getSerializer().toObject(SceneInitConfig.class, this.bindings.get("init_config"));
|
this.init_config =
|
||||||
|
ScriptLoader.getSerializer()
|
||||||
|
.toObject(SceneInitConfig.class, this.bindings.get("init_config"));
|
||||||
|
|
||||||
// Garbages // TODO: fix properly later
|
// Garbages // TODO: fix properly later
|
||||||
Object garbagesValue = this.bindings.get("garbages");
|
Object garbagesValue = this.bindings.get("garbages");
|
||||||
if (garbagesValue instanceof LuaValue garbagesTable) {
|
if (garbagesValue instanceof LuaValue garbagesTable) {
|
||||||
this.garbages = new SceneGarbage();
|
this.garbages = new SceneGarbage();
|
||||||
if (garbagesTable.checktable().get("gadgets") != LuaValue.NIL) {
|
if (garbagesTable.checktable().get("gadgets") != LuaValue.NIL) {
|
||||||
this.garbages.gadgets = ScriptLoader.getSerializer().toList(SceneGadget.class, garbagesTable.checktable().get("gadgets").checktable());
|
this.garbages.gadgets =
|
||||||
|
ScriptLoader.getSerializer()
|
||||||
|
.toList(
|
||||||
|
SceneGadget.class, garbagesTable.checktable().get("gadgets").checktable());
|
||||||
this.garbages.gadgets.forEach(m -> m.group = this);
|
this.garbages.gadgets.forEach(m -> m.group = this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add variables to suite
|
// Add variables to suite
|
||||||
this.variables = ScriptLoader.getSerializer().toList(SceneVar.class, this.bindings.get("variables"));
|
this.variables =
|
||||||
|
ScriptLoader.getSerializer().toList(SceneVar.class, this.bindings.get("variables"));
|
||||||
|
|
||||||
// Add monsters and gadgets to suite
|
// Add monsters and gadgets to suite
|
||||||
this.suites.forEach(i -> i.init(this));
|
this.suites.forEach(i -> i.init(this));
|
||||||
|
|
||||||
} catch (ScriptException e) {
|
} catch (ScriptException e) {
|
||||||
Grasscutter.getLogger().error("An error occurred while loading group " + this.id + " in scene " + sceneId + ".", e);
|
Grasscutter.getLogger()
|
||||||
|
.error(
|
||||||
|
"An error occurred while loading group " + this.id + " in scene " + sceneId + ".", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
Grasscutter.getLogger().debug("Successfully loaded group {} in scene {}.", this.id, sceneId);
|
Grasscutter.getLogger().debug("Successfully loaded group {} in scene {}.", this.id, sceneId);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int findInitSuiteIndex(int exclude_index) { //TODO: Investigate end index
|
public int findInitSuiteIndex(int exclude_index) { // TODO: Investigate end index
|
||||||
if (init_config == null) return 1;
|
if (init_config == null) return 1;
|
||||||
if (init_config.io_type == 1) return init_config.suite; //IO TYPE FLOW
|
if (init_config.io_type == 1) return init_config.suite; // IO TYPE FLOW
|
||||||
if (init_config.rand_suite) {
|
if (init_config.rand_suite) {
|
||||||
if (suites.size() == 1) {
|
if (suites.size() == 1) {
|
||||||
return init_config.suite;
|
return init_config.suite;
|
||||||
@ -164,7 +188,7 @@ public final class SceneGroup {
|
|||||||
if (i == exclude_index) continue;
|
if (i == exclude_index) continue;
|
||||||
|
|
||||||
var suite = suites.get(i);
|
var suite = suites.get(i);
|
||||||
for(int j = 0; j < suite.rand_weight; j++) randSuiteList.add(i);
|
for (int j = 0; j < suite.rand_weight; j++) randSuiteList.add(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
return randSuiteList.get(new Random().nextInt(randSuiteList.size()));
|
return randSuiteList.get(new Random().nextInt(randSuiteList.size()));
|
||||||
@ -179,5 +203,4 @@ public final class SceneGroup {
|
|||||||
.map(g -> g.boss_chest)
|
.map(g -> g.boss_chest)
|
||||||
.findFirst();
|
.findFirst();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import lombok.ToString;
|
|||||||
|
|
||||||
@ToString
|
@ToString
|
||||||
@Setter
|
@Setter
|
||||||
public class SceneMonster extends SceneObject{
|
public class SceneMonster extends SceneObject {
|
||||||
public int monster_id;
|
public int monster_id;
|
||||||
public int pose_id;
|
public int pose_id;
|
||||||
public int drop_id;
|
public int drop_id;
|
||||||
|
@ -2,7 +2,6 @@ package emu.grasscutter.scripts.data;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
|
||||||
@ -24,40 +23,39 @@ public class SceneSuite {
|
|||||||
public transient List<SceneRegion> sceneRegions = List.of();
|
public transient List<SceneRegion> sceneRegions = List.of();
|
||||||
|
|
||||||
public void init(SceneGroup sceneGroup) {
|
public void init(SceneGroup sceneGroup) {
|
||||||
if(sceneGroup.monsters != null){
|
if (sceneGroup.monsters != null) {
|
||||||
this.sceneMonsters = new ArrayList<>(
|
this.sceneMonsters =
|
||||||
|
new ArrayList<>(
|
||||||
this.monsters.stream()
|
this.monsters.stream()
|
||||||
.filter(sceneGroup.monsters::containsKey)
|
.filter(sceneGroup.monsters::containsKey)
|
||||||
.map(sceneGroup.monsters::get)
|
.map(sceneGroup.monsters::get)
|
||||||
.toList()
|
.toList());
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sceneGroup.gadgets != null){
|
if (sceneGroup.gadgets != null) {
|
||||||
this.sceneGadgets = new ArrayList<>(
|
this.sceneGadgets =
|
||||||
|
new ArrayList<>(
|
||||||
this.gadgets.stream()
|
this.gadgets.stream()
|
||||||
.filter(sceneGroup.gadgets::containsKey)
|
.filter(sceneGroup.gadgets::containsKey)
|
||||||
.map(sceneGroup.gadgets::get)
|
.map(sceneGroup.gadgets::get)
|
||||||
.toList()
|
.toList());
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sceneGroup.triggers != null) {
|
if (sceneGroup.triggers != null) {
|
||||||
this.sceneTriggers = new ArrayList<>(
|
this.sceneTriggers =
|
||||||
|
new ArrayList<>(
|
||||||
this.triggers.stream()
|
this.triggers.stream()
|
||||||
.filter(sceneGroup.triggers::containsKey)
|
.filter(sceneGroup.triggers::containsKey)
|
||||||
.map(sceneGroup.triggers::get)
|
.map(sceneGroup.triggers::get)
|
||||||
.toList()
|
.toList());
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if(sceneGroup.regions != null) {
|
if (sceneGroup.regions != null) {
|
||||||
this.sceneRegions = new ArrayList<>(
|
this.sceneRegions =
|
||||||
|
new ArrayList<>(
|
||||||
this.regions.stream()
|
this.regions.stream()
|
||||||
.filter(sceneGroup.regions::containsKey)
|
.filter(sceneGroup.regions::containsKey)
|
||||||
.map(sceneGroup.regions::get)
|
.map(sceneGroup.regions::get)
|
||||||
.toList()
|
.toList());
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ public final class SceneTrigger {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (obj instanceof SceneTrigger sceneTrigger){
|
if (obj instanceof SceneTrigger sceneTrigger) {
|
||||||
return this.name.equals(sceneTrigger.name);
|
return this.name.equals(sceneTrigger.name);
|
||||||
} else return super.equals(obj);
|
} else return super.equals(obj);
|
||||||
}
|
}
|
||||||
@ -32,14 +32,26 @@ public final class SceneTrigger {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "SceneTrigger{" +
|
return "SceneTrigger{"
|
||||||
"name='" + name + '\'' +
|
+ "name='"
|
||||||
", config_id=" + config_id +
|
+ name
|
||||||
", event=" + event +
|
+ '\''
|
||||||
", source='" + source + '\'' +
|
+ ", config_id="
|
||||||
", condition='" + condition + '\'' +
|
+ config_id
|
||||||
", action='" + action + '\'' +
|
+ ", event="
|
||||||
", trigger_count='" + trigger_count + '\'' +
|
+ event
|
||||||
'}';
|
+ ", source='"
|
||||||
|
+ source
|
||||||
|
+ '\''
|
||||||
|
+ ", condition='"
|
||||||
|
+ condition
|
||||||
|
+ '\''
|
||||||
|
+ ", action='"
|
||||||
|
+ action
|
||||||
|
+ '\''
|
||||||
|
+ ", trigger_count='"
|
||||||
|
+ trigger_count
|
||||||
|
+ '\''
|
||||||
|
+ '}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,11 +11,11 @@ public class ScriptArgs {
|
|||||||
public int type; // lua event type, used by scripts and the ScriptManager
|
public int type; // lua event type, used by scripts and the ScriptManager
|
||||||
|
|
||||||
public ScriptArgs(int groupId, int eventType) {
|
public ScriptArgs(int groupId, int eventType) {
|
||||||
this(groupId, eventType, 0,0);
|
this(groupId, eventType, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ScriptArgs(int groupId, int eventType, int param1) {
|
public ScriptArgs(int groupId, int eventType, int param1) {
|
||||||
this(groupId, eventType, param1,0);
|
this(groupId, eventType, param1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ScriptArgs(int groupId, int eventType, int param1, int param2) {
|
public ScriptArgs(int groupId, int eventType, int param1, int param2) {
|
||||||
|
@ -7,8 +7,6 @@ import emu.grasscutter.scripts.data.SceneGroup;
|
|||||||
import emu.grasscutter.scripts.data.SceneMonster;
|
import emu.grasscutter.scripts.data.SceneMonster;
|
||||||
import emu.grasscutter.scripts.data.ScriptArgs;
|
import emu.grasscutter.scripts.data.ScriptArgs;
|
||||||
import emu.grasscutter.scripts.listener.ScriptMonsterListener;
|
import emu.grasscutter.scripts.listener.ScriptMonsterListener;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
@ -22,11 +20,15 @@ public final class ScriptMonsterTideService {
|
|||||||
private final int monsterSceneLimit;
|
private final int monsterSceneLimit;
|
||||||
private final ConcurrentLinkedQueue<Integer> monsterConfigOrders;
|
private final ConcurrentLinkedQueue<Integer> monsterConfigOrders;
|
||||||
private final List<Integer> monsterConfigIds;
|
private final List<Integer> monsterConfigIds;
|
||||||
private final OnMonsterCreated onMonsterCreated= new OnMonsterCreated();
|
private final OnMonsterCreated onMonsterCreated = new OnMonsterCreated();
|
||||||
private final OnMonsterDead onMonsterDead= new OnMonsterDead();
|
private final OnMonsterDead onMonsterDead = new OnMonsterDead();
|
||||||
|
|
||||||
public ScriptMonsterTideService(SceneScriptManager sceneScriptManager,
|
public ScriptMonsterTideService(
|
||||||
SceneGroup group, int tideCount, int monsterSceneLimit, Integer[] ordersConfigId){
|
SceneScriptManager sceneScriptManager,
|
||||||
|
SceneGroup group,
|
||||||
|
int tideCount,
|
||||||
|
int monsterSceneLimit,
|
||||||
|
Integer[] ordersConfigId) {
|
||||||
this.sceneScriptManager = sceneScriptManager;
|
this.sceneScriptManager = sceneScriptManager;
|
||||||
this.currentGroup = group;
|
this.currentGroup = group;
|
||||||
this.monsterSceneLimit = monsterSceneLimit;
|
this.monsterSceneLimit = monsterSceneLimit;
|
||||||
@ -36,27 +38,30 @@ public final class ScriptMonsterTideService {
|
|||||||
this.monsterConfigOrders = new ConcurrentLinkedQueue<>(List.of(ordersConfigId));
|
this.monsterConfigOrders = new ConcurrentLinkedQueue<>(List.of(ordersConfigId));
|
||||||
this.monsterConfigIds = List.of(ordersConfigId);
|
this.monsterConfigIds = List.of(ordersConfigId);
|
||||||
|
|
||||||
this.sceneScriptManager.getScriptMonsterSpawnService().addMonsterCreatedListener(onMonsterCreated);
|
this.sceneScriptManager
|
||||||
|
.getScriptMonsterSpawnService()
|
||||||
|
.addMonsterCreatedListener(onMonsterCreated);
|
||||||
this.sceneScriptManager.getScriptMonsterSpawnService().addMonsterDeadListener(onMonsterDead);
|
this.sceneScriptManager.getScriptMonsterSpawnService().addMonsterDeadListener(onMonsterDead);
|
||||||
// spawn the first turn
|
// spawn the first turn
|
||||||
for (int i = 0; i < this.monsterSceneLimit; i++) {
|
for (int i = 0; i < this.monsterSceneLimit; i++) {
|
||||||
sceneScriptManager.addEntity(this.sceneScriptManager.createMonster(group.id, group.block_id, getNextMonster()));
|
sceneScriptManager.addEntity(
|
||||||
|
this.sceneScriptManager.createMonster(group.id, group.block_id, getNextMonster()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class OnMonsterCreated implements ScriptMonsterListener{
|
public class OnMonsterCreated implements ScriptMonsterListener {
|
||||||
@Override
|
@Override
|
||||||
public void onNotify(EntityMonster sceneMonster) {
|
public void onNotify(EntityMonster sceneMonster) {
|
||||||
if(monsterConfigIds.contains(sceneMonster.getConfigId()) && monsterSceneLimit > 0){
|
if (monsterConfigIds.contains(sceneMonster.getConfigId()) && monsterSceneLimit > 0) {
|
||||||
monsterAlive.incrementAndGet();
|
monsterAlive.incrementAndGet();
|
||||||
monsterTideCount.decrementAndGet();
|
monsterTideCount.decrementAndGet();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public SceneMonster getNextMonster(){
|
public SceneMonster getNextMonster() {
|
||||||
var nextId = this.monsterConfigOrders.poll();
|
var nextId = this.monsterConfigOrders.poll();
|
||||||
if(currentGroup.monsters.containsKey(nextId)){
|
if (currentGroup.monsters.containsKey(nextId)) {
|
||||||
return currentGroup.monsters.get(nextId);
|
return currentGroup.monsters.get(nextId);
|
||||||
}
|
}
|
||||||
// TODO some monster config_id do not exist in groups, so temporarily set it to the first
|
// TODO some monster config_id do not exist in groups, so temporarily set it to the first
|
||||||
@ -76,17 +81,22 @@ public final class ScriptMonsterTideService {
|
|||||||
monsterKillCount.incrementAndGet();
|
monsterKillCount.incrementAndGet();
|
||||||
if (monsterTideCount.get() > 0) {
|
if (monsterTideCount.get() > 0) {
|
||||||
// add more
|
// add more
|
||||||
sceneScriptManager.addEntity(sceneScriptManager.createMonster(currentGroup.id, currentGroup.block_id, getNextMonster()));
|
sceneScriptManager.addEntity(
|
||||||
|
sceneScriptManager.createMonster(
|
||||||
|
currentGroup.id, currentGroup.block_id, getNextMonster()));
|
||||||
}
|
}
|
||||||
// spawn the last turn of monsters
|
// spawn the last turn of monsters
|
||||||
// fix the 5-2
|
// fix the 5-2
|
||||||
sceneScriptManager.callEvent(new ScriptArgs(currentGroup.id, EventType.EVENT_MONSTER_TIDE_DIE, monsterKillCount.get()));
|
sceneScriptManager.callEvent(
|
||||||
|
new ScriptArgs(
|
||||||
|
currentGroup.id, EventType.EVENT_MONSTER_TIDE_DIE, monsterKillCount.get()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
public void unload() {
|
||||||
|
this.sceneScriptManager
|
||||||
public void unload(){
|
.getScriptMonsterSpawnService()
|
||||||
this.sceneScriptManager.getScriptMonsterSpawnService().removeMonsterCreatedListener(onMonsterCreated);
|
.removeMonsterCreatedListener(onMonsterCreated);
|
||||||
this.sceneScriptManager.getScriptMonsterSpawnService().removeMonsterDeadListener(onMonsterDead);
|
this.sceneScriptManager.getScriptMonsterSpawnService().removeMonsterDeadListener(onMonsterDead);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,17 +4,20 @@ import emu.grasscutter.game.entity.GameEntity;
|
|||||||
import emu.grasscutter.game.props.ElementType;
|
import emu.grasscutter.game.props.ElementType;
|
||||||
import emu.grasscutter.server.event.Cancellable;
|
import emu.grasscutter.server.event.Cancellable;
|
||||||
import emu.grasscutter.server.event.types.EntityEvent;
|
import emu.grasscutter.server.event.types.EntityEvent;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
public final class EntityDamageEvent extends EntityEvent implements Cancellable {
|
public final class EntityDamageEvent extends EntityEvent implements Cancellable {
|
||||||
@Getter @Setter private float damage;
|
@Getter @Setter private float damage;
|
||||||
@Getter @Setter private ElementType attackElementType;
|
@Getter @Setter private ElementType attackElementType;
|
||||||
@Getter @Nullable private final GameEntity damager;
|
@Getter @Nullable private final GameEntity damager;
|
||||||
|
|
||||||
public EntityDamageEvent(GameEntity entity, float damage, ElementType attackElementType, @Nullable GameEntity damager) {
|
public EntityDamageEvent(
|
||||||
|
GameEntity entity,
|
||||||
|
float damage,
|
||||||
|
ElementType attackElementType,
|
||||||
|
@Nullable GameEntity damager) {
|
||||||
super(entity);
|
super(entity);
|
||||||
|
|
||||||
this.damage = damage;
|
this.damage = damage;
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
//package emu.grasscutter.server.packet.recv;
|
// package emu.grasscutter.server.packet.recv;
|
||||||
//
|
//
|
||||||
//import emu.grasscutter.net.packet.Opcodes;
|
// import emu.grasscutter.net.packet.Opcodes;
|
||||||
//import emu.grasscutter.net.packet.PacketHandler;
|
// import emu.grasscutter.net.packet.PacketHandler;
|
||||||
//import emu.grasscutter.net.packet.PacketOpcodes;
|
// import emu.grasscutter.net.packet.PacketOpcodes;
|
||||||
//import emu.grasscutter.server.game.GameSession;
|
// import emu.grasscutter.server.game.GameSession;
|
||||||
//
|
//
|
||||||
//@Opcodes(PacketOpcodes.AddCustomTeamReq)
|
// @Opcodes(PacketOpcodes.AddCustomTeamReq)
|
||||||
//public class HandlerAddCustomTeamReq extends PacketHandler {
|
// public class HandlerAddCustomTeamReq extends PacketHandler {
|
||||||
// @Override
|
// @Override
|
||||||
// public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
// public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
||||||
// session.getPlayer().getTeamManager().addNewCustomTeam();
|
// session.getPlayer().getTeamManager().addNewCustomTeam();
|
||||||
// }
|
// }
|
||||||
//}
|
// }
|
||||||
|
@ -16,11 +16,10 @@ public class HandlerAddQuestContentProgressReq extends PacketHandler {
|
|||||||
|
|
||||||
// Find all conditions in quest that are the same as the given one
|
// Find all conditions in quest that are the same as the given one
|
||||||
var type = QuestContent.getContentTriggerByValue(req.getContentType());
|
var type = QuestContent.getContentTriggerByValue(req.getContentType());
|
||||||
if(type != null) {
|
if (type != null) {
|
||||||
session.getPlayer().getQuestManager().queueEvent(type, req.getParam());
|
session.getPlayer().getQuestManager().queueEvent(type, req.getParam());
|
||||||
}
|
}
|
||||||
|
|
||||||
session.send(new PacketAddQuestContentProgressRsp(req.getContentType()));
|
session.send(new PacketAddQuestContentProgressRsp(req.getContentType()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,9 +10,7 @@ import emu.grasscutter.server.game.GameSession;
|
|||||||
import emu.grasscutter.server.packet.send.PacketAvatarChangeElementTypeRsp;
|
import emu.grasscutter.server.packet.send.PacketAvatarChangeElementTypeRsp;
|
||||||
import lombok.val;
|
import lombok.val;
|
||||||
|
|
||||||
/**
|
/** Changes the currently active avatars Element if possible */
|
||||||
* Changes the currently active avatars Element if possible
|
|
||||||
*/
|
|
||||||
@Opcodes(PacketOpcodes.AvatarChangeElementTypeReq)
|
@Opcodes(PacketOpcodes.AvatarChangeElementTypeReq)
|
||||||
public class HandlerAvatarChangeElementTypeReq extends PacketHandler {
|
public class HandlerAvatarChangeElementTypeReq extends PacketHandler {
|
||||||
|
|
||||||
@ -21,7 +19,9 @@ public class HandlerAvatarChangeElementTypeReq extends PacketHandler {
|
|||||||
var req = AvatarChangeElementTypeReq.parseFrom(payload);
|
var req = AvatarChangeElementTypeReq.parseFrom(payload);
|
||||||
var area = GameData.getWorldAreaDataMap().get(req.getAreaId());
|
var area = GameData.getWorldAreaDataMap().get(req.getAreaId());
|
||||||
|
|
||||||
if (area == null || area.getElementType() == null || area.getElementType().getDepotIndex() <= 0) {
|
if (area == null
|
||||||
|
|| area.getElementType() == null
|
||||||
|
|| area.getElementType().getDepotIndex() <= 0) {
|
||||||
session.send(new PacketAvatarChangeElementTypeRsp(Retcode.RET_SVR_ERROR_VALUE));
|
session.send(new PacketAvatarChangeElementTypeRsp(Retcode.RET_SVR_ERROR_VALUE));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -35,5 +35,4 @@ public class HandlerAvatarChangeElementTypeReq extends PacketHandler {
|
|||||||
// Success
|
// Success
|
||||||
session.send(new PacketAvatarChangeElementTypeRsp());
|
session.send(new PacketAvatarChangeElementTypeRsp());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
//package emu.grasscutter.server.packet.recv;
|
// package emu.grasscutter.server.packet.recv;
|
||||||
//
|
//
|
||||||
//import emu.grasscutter.net.packet.Opcodes;
|
// import emu.grasscutter.net.packet.Opcodes;
|
||||||
//import emu.grasscutter.net.packet.PacketHandler;
|
// import emu.grasscutter.net.packet.PacketHandler;
|
||||||
//import emu.grasscutter.net.packet.PacketOpcodes;
|
// import emu.grasscutter.net.packet.PacketOpcodes;
|
||||||
//import emu.grasscutter.net.proto.Unk2700BEDLIGJANCJClientReq;
|
// import emu.grasscutter.net.proto.Unk2700BEDLIGJANCJClientReq;
|
||||||
//import emu.grasscutter.server.game.GameSession;
|
// import emu.grasscutter.server.game.GameSession;
|
||||||
//import emu.grasscutter.server.packet.send.PacketChangeHomeBgmNotify;
|
// import emu.grasscutter.server.packet.send.PacketChangeHomeBgmNotify;
|
||||||
//import emu.grasscutter.server.packet.send.PacketChangeHomeBgmRsp;
|
// import emu.grasscutter.server.packet.send.PacketChangeHomeBgmRsp;
|
||||||
//
|
//
|
||||||
//@Opcodes(PacketOpcodes.Unk2700_BEDLIGJANCJ_ClientReq)
|
// @Opcodes(PacketOpcodes.Unk2700_BEDLIGJANCJ_ClientReq)
|
||||||
//public class HandlerChangeHomeBgmReq extends PacketHandler {
|
// public class HandlerChangeHomeBgmReq extends PacketHandler {
|
||||||
// @Override
|
// @Override
|
||||||
// public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
// public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
||||||
// var req = Unk2700BEDLIGJANCJClientReq.Unk2700_BEDLIGJANCJ_ClientReq.parseFrom(payload);
|
// var req = Unk2700BEDLIGJANCJClientReq.Unk2700_BEDLIGJANCJ_ClientReq.parseFrom(payload);
|
||||||
@ -23,4 +23,4 @@
|
|||||||
// session.send(new PacketChangeHomeBgmNotify(homeBgmId));
|
// session.send(new PacketChangeHomeBgmNotify(homeBgmId));
|
||||||
// session.send(new PacketChangeHomeBgmRsp());
|
// session.send(new PacketChangeHomeBgmRsp());
|
||||||
// }
|
// }
|
||||||
//}
|
// }
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
//package emu.grasscutter.server.packet.recv;
|
// package emu.grasscutter.server.packet.recv;
|
||||||
//
|
//
|
||||||
//import emu.grasscutter.net.packet.Opcodes;
|
// import emu.grasscutter.net.packet.Opcodes;
|
||||||
//import emu.grasscutter.net.packet.PacketHandler;
|
// import emu.grasscutter.net.packet.PacketHandler;
|
||||||
//import emu.grasscutter.net.packet.PacketOpcodes;
|
// import emu.grasscutter.net.packet.PacketOpcodes;
|
||||||
//import emu.grasscutter.server.game.GameSession;
|
// import emu.grasscutter.server.game.GameSession;
|
||||||
//import emu.grasscutter.server.packet.send.PacketHomeUnknown2Rsp;
|
// import emu.grasscutter.server.packet.send.PacketHomeUnknown2Rsp;
|
||||||
//
|
//
|
||||||
//@Opcodes(PacketOpcodes.Unk2700_ACILPONNGGK_ClientReq)
|
// @Opcodes(PacketOpcodes.Unk2700_ACILPONNGGK_ClientReq)
|
||||||
//public class HandlerHomeUnknown2Req extends PacketHandler {
|
// public class HandlerHomeUnknown2Req extends PacketHandler {
|
||||||
//
|
//
|
||||||
// @Override
|
// @Override
|
||||||
// public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
// public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
||||||
@ -16,4 +16,4 @@
|
|||||||
// */
|
// */
|
||||||
// session.send(new PacketHomeUnknown2Rsp());
|
// session.send(new PacketHomeUnknown2Rsp());
|
||||||
// }
|
// }
|
||||||
//}
|
// }
|
||||||
|
@ -23,9 +23,12 @@ public class HandlerMusicGameSettleReq extends PacketHandler {
|
|||||||
|
|
||||||
val activityManager = session.getPlayer().getActivityManager();
|
val activityManager = session.getPlayer().getActivityManager();
|
||||||
|
|
||||||
val playerDataOpt = activityManager.getPlayerActivityDataByActivityType(ActivityType.NEW_ACTIVITY_MUSIC_GAME);
|
val playerDataOpt =
|
||||||
|
activityManager.getPlayerActivityDataByActivityType(ActivityType.NEW_ACTIVITY_MUSIC_GAME);
|
||||||
if (playerDataOpt.isEmpty()) {
|
if (playerDataOpt.isEmpty()) {
|
||||||
session.send(new PacketMusicGameSettleRsp(RetcodeOuterClass.Retcode.RET_MUSIC_GAME_LEVEL_CONFIG_NOT_FOUND, req));
|
session.send(
|
||||||
|
new PacketMusicGameSettleRsp(
|
||||||
|
RetcodeOuterClass.Retcode.RET_MUSIC_GAME_LEVEL_CONFIG_NOT_FOUND, req));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,13 +38,17 @@ public class HandlerMusicGameSettleReq extends PacketHandler {
|
|||||||
|
|
||||||
// check if custom beatmap
|
// check if custom beatmap
|
||||||
if (req.getUgcGuid() == 0) {
|
if (req.getUgcGuid() == 0) {
|
||||||
session.getPlayer().getActivityManager().triggerWatcher(
|
session
|
||||||
|
.getPlayer()
|
||||||
|
.getActivityManager()
|
||||||
|
.triggerWatcher(
|
||||||
WatcherTriggerType.TRIGGER_FLEUR_FAIR_MUSIC_GAME_REACH_SCORE,
|
WatcherTriggerType.TRIGGER_FLEUR_FAIR_MUSIC_GAME_REACH_SCORE,
|
||||||
String.valueOf(req.getMusicBasicId()),
|
String.valueOf(req.getMusicBasicId()),
|
||||||
String.valueOf(req.getScore())
|
String.valueOf(req.getScore()));
|
||||||
);
|
|
||||||
|
|
||||||
isNewRecord = handler.setMusicGameRecord(playerData,
|
isNewRecord =
|
||||||
|
handler.setMusicGameRecord(
|
||||||
|
playerData,
|
||||||
MusicGamePlayerData.MusicGameRecord.of()
|
MusicGamePlayerData.MusicGameRecord.of()
|
||||||
.musicId(req.getMusicBasicId())
|
.musicId(req.getMusicBasicId())
|
||||||
.maxCombo(req.getMaxCombo())
|
.maxCombo(req.getMaxCombo())
|
||||||
@ -49,9 +56,12 @@ public class HandlerMusicGameSettleReq extends PacketHandler {
|
|||||||
.build());
|
.build());
|
||||||
|
|
||||||
// update activity info
|
// update activity info
|
||||||
session.send(new PacketActivityInfoNotify(handler.toProto(playerData, activityManager.getConditionExecutor())));
|
session.send(
|
||||||
|
new PacketActivityInfoNotify(
|
||||||
|
handler.toProto(playerData, activityManager.getConditionExecutor())));
|
||||||
} else {
|
} else {
|
||||||
handler.setMusicGameCustomBeatmapRecord(playerData,
|
handler.setMusicGameCustomBeatmapRecord(
|
||||||
|
playerData,
|
||||||
MusicGamePlayerData.CustomBeatmapRecord.of()
|
MusicGamePlayerData.CustomBeatmapRecord.of()
|
||||||
.musicShareId(req.getUgcGuid())
|
.musicShareId(req.getUgcGuid())
|
||||||
.score(req.getMaxCombo())
|
.score(req.getMaxCombo())
|
||||||
@ -59,8 +69,7 @@ public class HandlerMusicGameSettleReq extends PacketHandler {
|
|||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
session.send(
|
||||||
session.send(new PacketMusicGameSettleRsp(req.getMusicBasicId(), req.getUgcGuid(), isNewRecord));
|
new PacketMusicGameSettleRsp(req.getMusicBasicId(), req.getUgcGuid(), isNewRecord));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
//package emu.grasscutter.server.packet.recv;
|
// package emu.grasscutter.server.packet.recv;
|
||||||
//
|
//
|
||||||
//import emu.grasscutter.net.packet.Opcodes;
|
// import emu.grasscutter.net.packet.Opcodes;
|
||||||
//import emu.grasscutter.net.packet.PacketHandler;
|
// import emu.grasscutter.net.packet.PacketHandler;
|
||||||
//import emu.grasscutter.net.packet.PacketOpcodes;
|
// import emu.grasscutter.net.packet.PacketOpcodes;
|
||||||
//import emu.grasscutter.net.proto.RemoveCustomTeamReqOuterClass.RemoveCustomTeamReq;
|
// import emu.grasscutter.net.proto.RemoveCustomTeamReqOuterClass.RemoveCustomTeamReq;
|
||||||
//import emu.grasscutter.server.game.GameSession;
|
// import emu.grasscutter.server.game.GameSession;
|
||||||
//
|
//
|
||||||
//@Opcodes(PacketOpcodes.RemoveCustomTeamReq)
|
// @Opcodes(PacketOpcodes.RemoveCustomTeamReq)
|
||||||
//public class HandlerRemoveCustomTeamReq extends PacketHandler {
|
// public class HandlerRemoveCustomTeamReq extends PacketHandler {
|
||||||
// @Override
|
// @Override
|
||||||
// public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
// public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
||||||
// RemoveCustomTeamReq req = RemoveCustomTeamReq.parseFrom(payload);
|
// RemoveCustomTeamReq req = RemoveCustomTeamReq.parseFrom(payload);
|
||||||
// session.getPlayer().getTeamManager().removeCustomTeam(req.getId());
|
// session.getPlayer().getTeamManager().removeCustomTeam(req.getId());
|
||||||
// }
|
// }
|
||||||
//}
|
// }
|
||||||
|
@ -1,25 +1,25 @@
|
|||||||
//package emu.grasscutter.server.packet.recv;
|
// package emu.grasscutter.server.packet.recv;
|
||||||
//
|
//
|
||||||
//import emu.grasscutter.database.DatabaseHelper;
|
// import emu.grasscutter.database.DatabaseHelper;
|
||||||
//import emu.grasscutter.game.activity.musicgame.MusicGameActivityHandler;
|
// import emu.grasscutter.game.activity.musicgame.MusicGameActivityHandler;
|
||||||
//import emu.grasscutter.game.activity.musicgame.MusicGameBeatmap;
|
// import emu.grasscutter.game.activity.musicgame.MusicGameBeatmap;
|
||||||
//import emu.grasscutter.game.activity.musicgame.MusicGamePlayerData;
|
// import emu.grasscutter.game.activity.musicgame.MusicGamePlayerData;
|
||||||
//import emu.grasscutter.game.props.ActivityType;
|
// import emu.grasscutter.game.props.ActivityType;
|
||||||
//import emu.grasscutter.net.packet.Opcodes;
|
// import emu.grasscutter.net.packet.Opcodes;
|
||||||
//import emu.grasscutter.net.packet.PacketHandler;
|
// import emu.grasscutter.net.packet.PacketHandler;
|
||||||
//import emu.grasscutter.net.packet.PacketOpcodes;
|
// import emu.grasscutter.net.packet.PacketOpcodes;
|
||||||
//import emu.grasscutter.net.proto.RetcodeOuterClass;
|
// import emu.grasscutter.net.proto.RetcodeOuterClass;
|
||||||
//import emu.grasscutter.net.proto.SaveUgcReqOuterClass;
|
// import emu.grasscutter.net.proto.SaveUgcReqOuterClass;
|
||||||
//import emu.grasscutter.net.proto.UgcTypeOuterClass;
|
// import emu.grasscutter.net.proto.UgcTypeOuterClass;
|
||||||
//import emu.grasscutter.server.game.GameSession;
|
// import emu.grasscutter.server.game.GameSession;
|
||||||
//import emu.grasscutter.server.packet.send.PacketActivityInfoNotify;
|
// import emu.grasscutter.server.packet.send.PacketActivityInfoNotify;
|
||||||
//import emu.grasscutter.server.packet.send.PacketMusicGameCreateBeatmapRsp;
|
// import emu.grasscutter.server.packet.send.PacketMusicGameCreateBeatmapRsp;
|
||||||
//import emu.grasscutter.utils.Utils;
|
// import emu.grasscutter.utils.Utils;
|
||||||
//import java.util.Objects;
|
// import java.util.Objects;
|
||||||
//import lombok.val;
|
// import lombok.val;
|
||||||
//
|
//
|
||||||
//@Opcodes(PacketOpcodes.SaveUgcReq)
|
// @Opcodes(PacketOpcodes.SaveUgcReq)
|
||||||
//public class HandlerSaveUgcReq extends PacketHandler {
|
// public class HandlerSaveUgcReq extends PacketHandler {
|
||||||
//
|
//
|
||||||
// @Override
|
// @Override
|
||||||
// public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
// public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
||||||
@ -48,6 +48,7 @@
|
|||||||
// .realTimeEditTime(briefInfo.getRealTimeEditTime())
|
// .realTimeEditTime(briefInfo.getRealTimeEditTime())
|
||||||
// .maxScore(briefInfo.getMaxScore())
|
// .maxScore(briefInfo.getMaxScore())
|
||||||
// .authorUid(session.getPlayer().getUid())
|
// .authorUid(session.getPlayer().getUid())
|
||||||
|
//
|
||||||
// .beatmap(MusicGameBeatmap.parse(req.getMusicRecord().getMusicTrackListList()))
|
// .beatmap(MusicGameBeatmap.parse(req.getMusicRecord().getMusicTrackListList()))
|
||||||
// .createTime(Utils.getCurrentSeconds())
|
// .createTime(Utils.getCurrentSeconds())
|
||||||
// .build();
|
// .build();
|
||||||
@ -58,6 +59,7 @@
|
|||||||
// session
|
// session
|
||||||
// .getPlayer()
|
// .getPlayer()
|
||||||
// .getActivityManager()
|
// .getActivityManager()
|
||||||
|
//
|
||||||
// .getPlayerActivityDataByActivityType(ActivityType.NEW_ACTIVITY_MUSIC_GAME);
|
// .getPlayerActivityDataByActivityType(ActivityType.NEW_ACTIVITY_MUSIC_GAME);
|
||||||
// if (playerData.isEmpty()) {
|
// if (playerData.isEmpty()) {
|
||||||
// session.send(
|
// session.send(
|
||||||
@ -76,7 +78,8 @@
|
|||||||
// .filter(Objects::nonNull)
|
// .filter(Objects::nonNull)
|
||||||
// .filter(item -> item.getAuthorUid() == session.getPlayer().getUid())
|
// .filter(item -> item.getAuthorUid() == session.getPlayer().getUid())
|
||||||
// .filter(item -> item.getMusicId() == req.getMusicBriefInfo().getMusicId())
|
// .filter(item -> item.getMusicId() == req.getMusicBriefInfo().getMusicId())
|
||||||
// .filter(item -> item.getSavePosition() == req.getMusicBriefInfo().getSaveIdx())
|
// .filter(item -> item.getSavePosition() ==
|
||||||
|
// req.getMusicBriefInfo().getSaveIdx())
|
||||||
// .findFirst();
|
// .findFirst();
|
||||||
//
|
//
|
||||||
// // delete old beatmap for player
|
// // delete old beatmap for player
|
||||||
@ -90,8 +93,10 @@
|
|||||||
// new PacketActivityInfoNotify(
|
// new PacketActivityInfoNotify(
|
||||||
// handler.toProto(
|
// handler.toProto(
|
||||||
// playerData.get(),
|
// playerData.get(),
|
||||||
|
//
|
||||||
// session.getPlayer().getActivityManager().getConditionExecutor())));
|
// session.getPlayer().getActivityManager().getConditionExecutor())));
|
||||||
// session.send(
|
// session.send(
|
||||||
// new PacketMusicGameCreateBeatmapRsp(musicGameBeatmap.getMusicShareId(), req.getUgcType()));
|
// new PacketMusicGameCreateBeatmapRsp(musicGameBeatmap.getMusicShareId(),
|
||||||
|
// req.getUgcType()));
|
||||||
|
// }
|
||||||
// }
|
// }
|
||||||
//}
|
|
||||||
|
@ -4,11 +4,11 @@ import emu.grasscutter.game.entity.EntityGadget;
|
|||||||
import emu.grasscutter.game.entity.GameEntity;
|
import emu.grasscutter.game.entity.GameEntity;
|
||||||
import emu.grasscutter.game.quest.enums.QuestContent;
|
import emu.grasscutter.game.quest.enums.QuestContent;
|
||||||
import emu.grasscutter.net.packet.Opcodes;
|
import emu.grasscutter.net.packet.Opcodes;
|
||||||
|
import emu.grasscutter.net.packet.PacketHandler;
|
||||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||||
import emu.grasscutter.net.proto.SelectWorktopOptionReqOuterClass.SelectWorktopOptionReq;
|
import emu.grasscutter.net.proto.SelectWorktopOptionReqOuterClass.SelectWorktopOptionReq;
|
||||||
import emu.grasscutter.scripts.constants.EventType;
|
import emu.grasscutter.scripts.constants.EventType;
|
||||||
import emu.grasscutter.scripts.data.ScriptArgs;
|
import emu.grasscutter.scripts.data.ScriptArgs;
|
||||||
import emu.grasscutter.net.packet.PacketHandler;
|
|
||||||
import emu.grasscutter.server.game.GameSession;
|
import emu.grasscutter.server.game.GameSession;
|
||||||
import emu.grasscutter.server.packet.send.PacketSelectWorktopOptionRsp;
|
import emu.grasscutter.server.packet.send.PacketSelectWorktopOptionRsp;
|
||||||
|
|
||||||
@ -26,14 +26,24 @@ public class HandlerSelectWorktopOptionReq extends PacketHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
session.getPlayer().getScene().selectWorktopOptionWith(req);
|
session.getPlayer().getScene().selectWorktopOptionWith(req);
|
||||||
session.getPlayer().getScene().getScriptManager().callEvent(
|
session
|
||||||
new ScriptArgs(entity.getGroupId(), EventType.EVENT_SELECT_OPTION, entity.getConfigId(), req.getOptionId())
|
.getPlayer()
|
||||||
);
|
.getScene()
|
||||||
session.getPlayer().getQuestManager().queueEvent(QuestContent.QUEST_CONTENT_WORKTOP_SELECT, entity.getConfigId(), req.getOptionId());
|
.getScriptManager()
|
||||||
|
.callEvent(
|
||||||
|
new ScriptArgs(
|
||||||
|
entity.getGroupId(),
|
||||||
|
EventType.EVENT_SELECT_OPTION,
|
||||||
|
entity.getConfigId(),
|
||||||
|
req.getOptionId()));
|
||||||
|
session
|
||||||
|
.getPlayer()
|
||||||
|
.getQuestManager()
|
||||||
|
.queueEvent(
|
||||||
|
QuestContent.QUEST_CONTENT_WORKTOP_SELECT, entity.getConfigId(), req.getOptionId());
|
||||||
} finally {
|
} finally {
|
||||||
// Always send packet
|
// Always send packet
|
||||||
session.send(new PacketSelectWorktopOptionRsp(req.getGadgetEntityId(), req.getOptionId()));
|
session.send(new PacketSelectWorktopOptionRsp(req.getGadgetEntityId(), req.getOptionId()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,8 @@ public class HandlerUpdateAbilityCreatedMovingPlatformNotify extends PacketHandl
|
|||||||
var notify = UpdateAbilityCreatedMovingPlatformNotify.parseFrom(payload);
|
var notify = UpdateAbilityCreatedMovingPlatformNotify.parseFrom(payload);
|
||||||
var entity = session.getPlayer().getScene().getEntityById(notify.getEntityId());
|
var entity = session.getPlayer().getScene().getEntityById(notify.getEntityId());
|
||||||
|
|
||||||
if (!(entity instanceof EntityGadget entityGadget) || !(entityGadget.getRouteConfig() instanceof AbilityRoute)) {
|
if (!(entity instanceof EntityGadget entityGadget)
|
||||||
|
|| !(entityGadget.getRouteConfig() instanceof AbilityRoute)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
//package emu.grasscutter.server.packet.send;
|
// package emu.grasscutter.server.packet.send;
|
||||||
//
|
//
|
||||||
//import emu.grasscutter.net.packet.BasePacket;
|
// import emu.grasscutter.net.packet.BasePacket;
|
||||||
//import emu.grasscutter.net.packet.PacketOpcodes;
|
// import emu.grasscutter.net.packet.PacketOpcodes;
|
||||||
//import emu.grasscutter.net.proto.AddCustomTeamRspOuterClass.AddCustomTeamRsp;
|
// import emu.grasscutter.net.proto.AddCustomTeamRspOuterClass.AddCustomTeamRsp;
|
||||||
//import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode;
|
// import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode;
|
||||||
//
|
//
|
||||||
//public class PacketAddCustomTeamRsp extends BasePacket {
|
// public class PacketAddCustomTeamRsp extends BasePacket {
|
||||||
// public PacketAddCustomTeamRsp(Retcode retcode) {
|
// public PacketAddCustomTeamRsp(Retcode retcode) {
|
||||||
// super(PacketOpcodes.AddCustomTeamRsp);
|
// super(PacketOpcodes.AddCustomTeamRsp);
|
||||||
//
|
//
|
||||||
// AddCustomTeamRsp proto = AddCustomTeamRsp.newBuilder().setRetcode(retcode.getNumber()).build();
|
// AddCustomTeamRsp proto =
|
||||||
|
// AddCustomTeamRsp.newBuilder().setRetcode(retcode.getNumber()).build();
|
||||||
//
|
//
|
||||||
// this.setData(proto);
|
// this.setData(proto);
|
||||||
// }
|
// }
|
||||||
@ -17,4 +18,4 @@
|
|||||||
// public PacketAddCustomTeamRsp() {
|
// public PacketAddCustomTeamRsp() {
|
||||||
// this(Retcode.RET_SUCC);
|
// this(Retcode.RET_SUCC);
|
||||||
// }
|
// }
|
||||||
//}
|
// }
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
//package emu.grasscutter.server.packet.send;
|
// package emu.grasscutter.server.packet.send;
|
||||||
//
|
//
|
||||||
//import emu.grasscutter.net.packet.BasePacket;
|
// import emu.grasscutter.net.packet.BasePacket;
|
||||||
//import emu.grasscutter.net.packet.PacketOpcodes;
|
// import emu.grasscutter.net.packet.PacketOpcodes;
|
||||||
//import emu.grasscutter.net.proto.BeginCameraSceneLookNotifyOuterClass.BeginCameraSceneLookNotify;
|
// import emu.grasscutter.net.proto.BeginCameraSceneLookNotifyOuterClass.BeginCameraSceneLookNotify;
|
||||||
//import emu.grasscutter.utils.Position;
|
// import emu.grasscutter.utils.Position;
|
||||||
//import java.util.ArrayList;
|
// import java.util.ArrayList;
|
||||||
//import java.util.Collection;
|
// import java.util.Collection;
|
||||||
//import lombok.Data;
|
// import lombok.Data;
|
||||||
//import lombok.NoArgsConstructor;
|
// import lombok.NoArgsConstructor;
|
||||||
//
|
//
|
||||||
//public class PacketBeginCameraSceneLookNotify extends BasePacket {
|
// public class PacketBeginCameraSceneLookNotify extends BasePacket {
|
||||||
//
|
//
|
||||||
// public PacketBeginCameraSceneLookNotify(CameraSceneLookNotify parameters) {
|
// public PacketBeginCameraSceneLookNotify(CameraSceneLookNotify parameters) {
|
||||||
// super(PacketOpcodes.BeginCameraSceneLookNotify);
|
// super(PacketOpcodes.BeginCameraSceneLookNotify);
|
||||||
@ -58,4 +58,4 @@
|
|||||||
// int entityId = 0;
|
// int entityId = 0;
|
||||||
// Collection<String> otherParams = new ArrayList<>(0);
|
// Collection<String> otherParams = new ArrayList<>(0);
|
||||||
// }
|
// }
|
||||||
//}
|
// }
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//package emu.grasscutter.server.packet.send;
|
// package emu.grasscutter.server.packet.send;
|
||||||
//
|
//
|
||||||
//import emu.grasscutter.net.packet.BasePacket;
|
// import emu.grasscutter.net.packet.BasePacket;
|
||||||
//import emu.grasscutter.net.packet.PacketOpcodes;
|
// import emu.grasscutter.net.packet.PacketOpcodes;
|
||||||
//import emu.grasscutter.net.proto.Unk2700FJEHHCPCBLGServerNotify;
|
// import emu.grasscutter.net.proto.Unk2700FJEHHCPCBLGServerNotify;
|
||||||
//
|
//
|
||||||
//public class PacketChangeHomeBgmNotify extends BasePacket {
|
// public class PacketChangeHomeBgmNotify extends BasePacket {
|
||||||
// public PacketChangeHomeBgmNotify(int homeBgmId) {
|
// public PacketChangeHomeBgmNotify(int homeBgmId) {
|
||||||
// super(PacketOpcodes.Unk2700_FJEHHCPCBLG_ServerNotify);
|
// super(PacketOpcodes.Unk2700_FJEHHCPCBLG_ServerNotify);
|
||||||
//
|
//
|
||||||
@ -15,4 +15,4 @@
|
|||||||
//
|
//
|
||||||
// this.setData(notify);
|
// this.setData(notify);
|
||||||
// }
|
// }
|
||||||
//}
|
// }
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//package emu.grasscutter.server.packet.send;
|
// package emu.grasscutter.server.packet.send;
|
||||||
//
|
//
|
||||||
//import emu.grasscutter.net.packet.BasePacket;
|
// import emu.grasscutter.net.packet.BasePacket;
|
||||||
//import emu.grasscutter.net.packet.PacketOpcodes;
|
// import emu.grasscutter.net.packet.PacketOpcodes;
|
||||||
//import emu.grasscutter.net.proto.Unk2700OGHMHELMBNNServerRsp;
|
// import emu.grasscutter.net.proto.Unk2700OGHMHELMBNNServerRsp;
|
||||||
//
|
//
|
||||||
//public class PacketChangeHomeBgmRsp extends BasePacket {
|
// public class PacketChangeHomeBgmRsp extends BasePacket {
|
||||||
// public PacketChangeHomeBgmRsp() {
|
// public PacketChangeHomeBgmRsp() {
|
||||||
// super(PacketOpcodes.Unk2700_OGHMHELMBNN_ServerRsp);
|
// super(PacketOpcodes.Unk2700_OGHMHELMBNN_ServerRsp);
|
||||||
//
|
//
|
||||||
@ -15,4 +15,4 @@
|
|||||||
//
|
//
|
||||||
// this.setData(rsp);
|
// this.setData(rsp);
|
||||||
// }
|
// }
|
||||||
//}
|
// }
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
//package emu.grasscutter.server.packet.send;
|
// package emu.grasscutter.server.packet.send;
|
||||||
//
|
//
|
||||||
//import emu.grasscutter.game.player.Player;
|
// import emu.grasscutter.game.player.Player;
|
||||||
//import emu.grasscutter.net.packet.BasePacket;
|
// import emu.grasscutter.net.packet.BasePacket;
|
||||||
//import emu.grasscutter.net.packet.PacketOpcodes;
|
// import emu.grasscutter.net.packet.PacketOpcodes;
|
||||||
//import emu.grasscutter.net.proto.CustomTeamListNotifyOuterClass.CustomTeamListNotify;
|
// import emu.grasscutter.net.proto.CustomTeamListNotifyOuterClass.CustomTeamListNotify;
|
||||||
//
|
//
|
||||||
//public class PacketCustomTeamListNotify extends BasePacket {
|
// public class PacketCustomTeamListNotify extends BasePacket {
|
||||||
// public PacketCustomTeamListNotify(Player player) {
|
// public PacketCustomTeamListNotify(Player player) {
|
||||||
// super(PacketOpcodes.CustomTeamListNotify);
|
// super(PacketOpcodes.CustomTeamListNotify);
|
||||||
//
|
//
|
||||||
@ -26,4 +26,4 @@
|
|||||||
//
|
//
|
||||||
// this.setData(proto);
|
// this.setData(proto);
|
||||||
// }
|
// }
|
||||||
//}
|
// }
|
||||||
|
@ -5,7 +5,6 @@ import emu.grasscutter.game.props.FightProperty;
|
|||||||
import emu.grasscutter.net.packet.BasePacket;
|
import emu.grasscutter.net.packet.BasePacket;
|
||||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||||
import emu.grasscutter.net.proto.EntityFightPropUpdateNotifyOuterClass.EntityFightPropUpdateNotify;
|
import emu.grasscutter.net.proto.EntityFightPropUpdateNotifyOuterClass.EntityFightPropUpdateNotify;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
public class PacketEntityFightPropUpdateNotify extends BasePacket {
|
public class PacketEntityFightPropUpdateNotify extends BasePacket {
|
||||||
@ -24,8 +23,7 @@ public class PacketEntityFightPropUpdateNotify extends BasePacket {
|
|||||||
public PacketEntityFightPropUpdateNotify(GameEntity entity, Collection<FightProperty> props) {
|
public PacketEntityFightPropUpdateNotify(GameEntity entity, Collection<FightProperty> props) {
|
||||||
super(PacketOpcodes.EntityFightPropUpdateNotify);
|
super(PacketOpcodes.EntityFightPropUpdateNotify);
|
||||||
|
|
||||||
var protoBuilder = EntityFightPropUpdateNotify.newBuilder()
|
var protoBuilder = EntityFightPropUpdateNotify.newBuilder().setEntityId(entity.getId());
|
||||||
.setEntityId(entity.getId());
|
|
||||||
props.forEach(p -> protoBuilder.putFightPropMap(p.getId(), entity.getFightProperty(p)));
|
props.forEach(p -> protoBuilder.putFightPropMap(p.getId(), entity.getFightProperty(p)));
|
||||||
|
|
||||||
this.setData(protoBuilder);
|
this.setData(protoBuilder);
|
||||||
|
@ -15,7 +15,7 @@ public class PacketFinishedParentQuestNotify extends BasePacket {
|
|||||||
FinishedParentQuestNotify.Builder proto = FinishedParentQuestNotify.newBuilder();
|
FinishedParentQuestNotify.Builder proto = FinishedParentQuestNotify.newBuilder();
|
||||||
|
|
||||||
for (GameMainQuest mainQuest : player.getQuestManager().getMainQuests().values()) {
|
for (GameMainQuest mainQuest : player.getQuestManager().getMainQuests().values()) {
|
||||||
//Canceled Quests do not appear in this packet
|
// Canceled Quests do not appear in this packet
|
||||||
if (mainQuest.getState() != ParentQuestState.PARENT_QUEST_STATE_CANCELED) {
|
if (mainQuest.getState() != ParentQuestState.PARENT_QUEST_STATE_CANCELED) {
|
||||||
proto.addParentQuestList(mainQuest.toProto(false));
|
proto.addParentQuestList(mainQuest.toProto(false));
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@ import emu.grasscutter.game.quest.GameMainQuest;
|
|||||||
import emu.grasscutter.net.packet.BasePacket;
|
import emu.grasscutter.net.packet.BasePacket;
|
||||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||||
import emu.grasscutter.net.proto.FinishedParentQuestUpdateNotifyOuterClass.FinishedParentQuestUpdateNotify;
|
import emu.grasscutter.net.proto.FinishedParentQuestUpdateNotifyOuterClass.FinishedParentQuestUpdateNotify;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class PacketFinishedParentQuestUpdateNotify extends BasePacket {
|
public class PacketFinishedParentQuestUpdateNotify extends BasePacket {
|
||||||
@ -12,7 +11,8 @@ public class PacketFinishedParentQuestUpdateNotify extends BasePacket {
|
|||||||
public PacketFinishedParentQuestUpdateNotify(GameMainQuest quest) {
|
public PacketFinishedParentQuestUpdateNotify(GameMainQuest quest) {
|
||||||
super(PacketOpcodes.FinishedParentQuestUpdateNotify);
|
super(PacketOpcodes.FinishedParentQuestUpdateNotify);
|
||||||
|
|
||||||
FinishedParentQuestUpdateNotify proto = FinishedParentQuestUpdateNotify.newBuilder()
|
FinishedParentQuestUpdateNotify proto =
|
||||||
|
FinishedParentQuestUpdateNotify.newBuilder()
|
||||||
.addParentQuestList(quest.toProto(true))
|
.addParentQuestList(quest.toProto(true))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@ import emu.grasscutter.net.packet.BasePacket;
|
|||||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||||
import emu.grasscutter.net.proto.GetAllMailResultNotifyOuterClass.GetAllMailResultNotify;
|
import emu.grasscutter.net.proto.GetAllMailResultNotifyOuterClass.GetAllMailResultNotify;
|
||||||
import emu.grasscutter.utils.Utils;
|
import emu.grasscutter.utils.Utils;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -17,7 +16,8 @@ public final class PacketGetAllMailResultNotify extends BasePacket {
|
|||||||
public PacketGetAllMailResultNotify(Player player, boolean gifts) {
|
public PacketGetAllMailResultNotify(Player player, boolean gifts) {
|
||||||
super(PacketOpcodes.GetAllMailResultNotify);
|
super(PacketOpcodes.GetAllMailResultNotify);
|
||||||
|
|
||||||
var packet = GetAllMailResultNotify.newBuilder()
|
var packet =
|
||||||
|
GetAllMailResultNotify.newBuilder()
|
||||||
.setTransaction(player.getUid() + "-" + Utils.getCurrentSeconds() + "-" + 0)
|
.setTransaction(player.getUid() + "-" + Utils.getCurrentSeconds() + "-" + 0)
|
||||||
.setIsCollected(gifts)
|
.setIsCollected(gifts)
|
||||||
.setPacketBeSentNum(1)
|
.setPacketBeSentNum(1)
|
||||||
@ -25,10 +25,12 @@ public final class PacketGetAllMailResultNotify extends BasePacket {
|
|||||||
|
|
||||||
var inbox = player.getAllMail();
|
var inbox = player.getAllMail();
|
||||||
if (!gifts && inbox.size() > 0) {
|
if (!gifts && inbox.size() > 0) {
|
||||||
packet.addAllMailList(inbox.stream()
|
packet.addAllMailList(
|
||||||
|
inbox.stream()
|
||||||
.filter(mail -> mail.stateValue == 1)
|
.filter(mail -> mail.stateValue == 1)
|
||||||
.filter(mail -> mail.expireTime > Instant.now().getEpochSecond())
|
.filter(mail -> mail.expireTime > Instant.now().getEpochSecond())
|
||||||
.map(mail -> mail.toProto(player)).toList());
|
.map(mail -> mail.toProto(player))
|
||||||
|
.toList());
|
||||||
} else {
|
} else {
|
||||||
// Empty mailbox.
|
// Empty mailbox.
|
||||||
// TODO: Implement the gift mailbox.
|
// TODO: Implement the gift mailbox.
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//package emu.grasscutter.server.packet.send;
|
// package emu.grasscutter.server.packet.send;
|
||||||
//
|
//
|
||||||
//import emu.grasscutter.net.packet.BasePacket;
|
// import emu.grasscutter.net.packet.BasePacket;
|
||||||
//import emu.grasscutter.net.packet.PacketOpcodes;
|
// import emu.grasscutter.net.packet.PacketOpcodes;
|
||||||
//import emu.grasscutter.net.proto.HomeUnknown1NotifyOuterClass;
|
// import emu.grasscutter.net.proto.HomeUnknown1NotifyOuterClass;
|
||||||
//
|
//
|
||||||
//public class PacketHomeUnknown1Notify extends BasePacket {
|
// public class PacketHomeUnknown1Notify extends BasePacket {
|
||||||
//
|
//
|
||||||
// public PacketHomeUnknown1Notify(boolean isEnterEditMode) {
|
// public PacketHomeUnknown1Notify(boolean isEnterEditMode) {
|
||||||
// super(PacketOpcodes.Unk2700_JDMPECKFGIG_ServerNotify);
|
// super(PacketOpcodes.Unk2700_JDMPECKFGIG_ServerNotify);
|
||||||
@ -15,4 +15,4 @@
|
|||||||
//
|
//
|
||||||
// this.setData(proto);
|
// this.setData(proto);
|
||||||
// }
|
// }
|
||||||
//}
|
// }
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
//package emu.grasscutter.server.packet.send;
|
// package emu.grasscutter.server.packet.send;
|
||||||
//
|
//
|
||||||
//import emu.grasscutter.net.packet.BasePacket;
|
// import emu.grasscutter.net.packet.BasePacket;
|
||||||
//import emu.grasscutter.net.packet.PacketOpcodes;
|
// import emu.grasscutter.net.packet.PacketOpcodes;
|
||||||
//
|
//
|
||||||
//public class PacketHomeUnknown2Rsp extends BasePacket {
|
// public class PacketHomeUnknown2Rsp extends BasePacket {
|
||||||
//
|
//
|
||||||
// public PacketHomeUnknown2Rsp() {
|
// public PacketHomeUnknown2Rsp() {
|
||||||
// super(PacketOpcodes.Unk2700_KIIOGMKFNNP_ServerRsp);
|
// super(PacketOpcodes.Unk2700_KIIOGMKFNNP_ServerRsp);
|
||||||
// }
|
// }
|
||||||
//}
|
// }
|
||||||
|
@ -18,15 +18,16 @@ public class PacketMusicGameSettleRsp extends BasePacket {
|
|||||||
this.setData(proto);
|
this.setData(proto);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PacketMusicGameSettleRsp(RetcodeOuterClass.Retcode errorCode, MusicGameSettleReqOuterClass.MusicGameSettleReq req) {
|
public PacketMusicGameSettleRsp(
|
||||||
|
RetcodeOuterClass.Retcode errorCode, MusicGameSettleReqOuterClass.MusicGameSettleReq req) {
|
||||||
super(PacketOpcodes.MusicGameSettleRsp);
|
super(PacketOpcodes.MusicGameSettleRsp);
|
||||||
|
|
||||||
var proto = MusicGameSettleRspOuterClass.MusicGameSettleRsp.newBuilder()
|
var proto =
|
||||||
|
MusicGameSettleRspOuterClass.MusicGameSettleRsp.newBuilder()
|
||||||
.setRetcode(errorCode.getNumber())
|
.setRetcode(errorCode.getNumber())
|
||||||
.setMusicBasicId(req.getMusicBasicId())
|
.setMusicBasicId(req.getMusicBasicId())
|
||||||
.setUgcGuid(req.getUgcGuid());
|
.setUgcGuid(req.getUgcGuid());
|
||||||
|
|
||||||
|
|
||||||
this.setData(proto);
|
this.setData(proto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,8 @@ public class PacketPlatformStartRouteNotify extends BasePacket {
|
|||||||
public PacketPlatformStartRouteNotify(EntityGadget gadgetEntity) {
|
public PacketPlatformStartRouteNotify(EntityGadget gadgetEntity) {
|
||||||
super(PacketOpcodes.PlatformStartRouteNotify);
|
super(PacketOpcodes.PlatformStartRouteNotify);
|
||||||
|
|
||||||
val notify = PlatformStartRouteNotify.newBuilder()
|
val notify =
|
||||||
|
PlatformStartRouteNotify.newBuilder()
|
||||||
.setEntityId(gadgetEntity.getId())
|
.setEntityId(gadgetEntity.getId())
|
||||||
.setSceneTime(gadgetEntity.getScene().getSceneTime())
|
.setSceneTime(gadgetEntity.getScene().getSceneTime())
|
||||||
.setPlatform(gadgetEntity.getPlatformInfo());
|
.setPlatform(gadgetEntity.getPlatformInfo());
|
||||||
|
@ -9,7 +9,8 @@ public class PacketPlatformStopRouteNotify extends BasePacket {
|
|||||||
public PacketPlatformStopRouteNotify(EntityGadget gadgetEntity) {
|
public PacketPlatformStopRouteNotify(EntityGadget gadgetEntity) {
|
||||||
super(PacketOpcodes.PlatformStopRouteNotify);
|
super(PacketOpcodes.PlatformStopRouteNotify);
|
||||||
|
|
||||||
var notify = PlatformStopRouteNotifyOuterClass.PlatformStopRouteNotify.newBuilder()
|
var notify =
|
||||||
|
PlatformStopRouteNotifyOuterClass.PlatformStopRouteNotify.newBuilder()
|
||||||
.setPlatform(gadgetEntity.getPlatformInfo())
|
.setPlatform(gadgetEntity.getPlatformInfo())
|
||||||
.setSceneTime(gadgetEntity.getScene().getSceneTime())
|
.setSceneTime(gadgetEntity.getScene().getSceneTime())
|
||||||
.setEntityId(gadgetEntity.getId())
|
.setEntityId(gadgetEntity.getId())
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
//package emu.grasscutter.server.packet.send;
|
// package emu.grasscutter.server.packet.send;
|
||||||
//
|
//
|
||||||
//import emu.grasscutter.net.packet.BasePacket;
|
// import emu.grasscutter.net.packet.BasePacket;
|
||||||
//import emu.grasscutter.net.packet.PacketOpcodes;
|
// import emu.grasscutter.net.packet.PacketOpcodes;
|
||||||
//import emu.grasscutter.net.proto.RemoveCustomTeamRspOuterClass.RemoveCustomTeamRsp;
|
// import emu.grasscutter.net.proto.RemoveCustomTeamRspOuterClass.RemoveCustomTeamRsp;
|
||||||
//import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode;
|
// import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode;
|
||||||
//
|
//
|
||||||
//public class PacketRemoveCustomTeamRsp extends BasePacket {
|
// public class PacketRemoveCustomTeamRsp extends BasePacket {
|
||||||
// public PacketRemoveCustomTeamRsp(Retcode retcode, int id) {
|
// public PacketRemoveCustomTeamRsp(Retcode retcode, int id) {
|
||||||
// super(PacketOpcodes.RemoveCustomTeamRsp);
|
// super(PacketOpcodes.RemoveCustomTeamRsp);
|
||||||
//
|
//
|
||||||
// RemoveCustomTeamRsp proto =
|
// RemoveCustomTeamRsp proto =
|
||||||
|
//
|
||||||
// RemoveCustomTeamRsp.newBuilder().setRetcode(retcode.getNumber()).setId(id).build();
|
// RemoveCustomTeamRsp.newBuilder().setRetcode(retcode.getNumber()).setId(id).build();
|
||||||
//
|
//
|
||||||
// this.setData(proto);
|
// this.setData(proto);
|
||||||
@ -18,4 +19,4 @@
|
|||||||
// public PacketRemoveCustomTeamRsp(int id) {
|
// public PacketRemoveCustomTeamRsp(int id) {
|
||||||
// this(Retcode.RET_SUCC, id);
|
// this(Retcode.RET_SUCC, id);
|
||||||
// }
|
// }
|
||||||
//}
|
// }
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//package emu.grasscutter.server.packet.send;
|
// package emu.grasscutter.server.packet.send;
|
||||||
//
|
//
|
||||||
//import emu.grasscutter.net.packet.BasePacket;
|
// import emu.grasscutter.net.packet.BasePacket;
|
||||||
//import emu.grasscutter.net.packet.PacketOpcodes;
|
// import emu.grasscutter.net.packet.PacketOpcodes;
|
||||||
//import emu.grasscutter.net.proto.Unk2700MEBFPBDNPGOServerNotify;
|
// import emu.grasscutter.net.proto.Unk2700MEBFPBDNPGOServerNotify;
|
||||||
//
|
//
|
||||||
//public class PacketUnlockHomeBgmNotify extends BasePacket {
|
// public class PacketUnlockHomeBgmNotify extends BasePacket {
|
||||||
// public PacketUnlockHomeBgmNotify(int homeBgmId) {
|
// public PacketUnlockHomeBgmNotify(int homeBgmId) {
|
||||||
// super(PacketOpcodes.Unk2700_MEBFPBDNPGO_ServerNotify);
|
// super(PacketOpcodes.Unk2700_MEBFPBDNPGO_ServerNotify);
|
||||||
//
|
//
|
||||||
@ -15,4 +15,4 @@
|
|||||||
//
|
//
|
||||||
// this.setData(notify);
|
// this.setData(notify);
|
||||||
// }
|
// }
|
||||||
//}
|
// }
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
//package emu.grasscutter.server.packet.send;
|
// package emu.grasscutter.server.packet.send;
|
||||||
//
|
//
|
||||||
//import emu.grasscutter.game.player.Player;
|
// import emu.grasscutter.game.player.Player;
|
||||||
//import emu.grasscutter.net.packet.BasePacket;
|
// import emu.grasscutter.net.packet.BasePacket;
|
||||||
//import emu.grasscutter.net.packet.PacketOpcodes;
|
// import emu.grasscutter.net.packet.PacketOpcodes;
|
||||||
//import emu.grasscutter.net.proto.Unk2700LOHBMOKOPLHServerNotify;
|
// import emu.grasscutter.net.proto.Unk2700LOHBMOKOPLHServerNotify;
|
||||||
//
|
//
|
||||||
//public class PacketUnlockedHomeBgmNotify extends BasePacket {
|
// public class PacketUnlockedHomeBgmNotify extends BasePacket {
|
||||||
// public PacketUnlockedHomeBgmNotify(Player player) {
|
// public PacketUnlockedHomeBgmNotify(Player player) {
|
||||||
// super(PacketOpcodes.Unk2700_LOHBMOKOPLH_ServerNotify);
|
// super(PacketOpcodes.Unk2700_LOHBMOKOPLH_ServerNotify);
|
||||||
//
|
//
|
||||||
@ -22,4 +22,4 @@
|
|||||||
//
|
//
|
||||||
// this.setData(notify);
|
// this.setData(notify);
|
||||||
// }
|
// }
|
||||||
//}
|
// }
|
||||||
|
Loading…
Reference in New Issue
Block a user