122 lines
2.8 KiB
Java
Raw Normal View History

2022-05-28 04:21:47 -07:00
package emu.grasscutter.data.excels;
2022-05-13 03:12:25 -07:00
import java.util.Arrays;
import java.util.List;
2022-07-05 20:41:07 +08:00
import com.google.gson.annotations.SerializedName;
2022-05-13 03:12:25 -07:00
import emu.grasscutter.data.GameResource;
import emu.grasscutter.data.ResourceType;
import emu.grasscutter.game.quest.enums.LogicType;
import emu.grasscutter.game.quest.enums.QuestTrigger;
2022-07-05 20:41:07 +08:00
import lombok.AccessLevel;
import lombok.Data;
import lombok.Getter;
import lombok.ToString;
import lombok.experimental.FieldDefaults;
2022-05-13 03:12:25 -07:00
@ResourceType(name = "QuestExcelConfigData.json")
2022-07-05 20:41:07 +08:00
@Getter
@ToString
2022-05-13 03:12:25 -07:00
public class QuestData extends GameResource {
2022-05-28 04:21:47 -07:00
private int subId;
private int mainId;
private int order;
private long descTextMapHash;
2022-07-05 20:41:07 +08:00
2022-05-28 04:21:47 -07:00
private boolean finishParent;
private boolean isRewind;
2022-07-05 20:41:07 +08:00
2022-05-28 04:21:47 -07:00
private LogicType acceptCondComb;
private LogicType finishCondComb;
private LogicType failCondComb;
2022-07-05 20:41:07 +08:00
private List<QuestCondition> acceptCond;
private List<QuestCondition> finishCond;
private List<QuestCondition> failCond;
2022-05-28 04:21:47 -07:00
private List<QuestExecParam> beginExec;
private List<QuestExecParam> finishExec;
private List<QuestExecParam> failExec;
2022-05-13 03:12:25 -07:00
public int getId() {
2022-05-28 04:21:47 -07:00
return subId;
2022-05-13 03:12:25 -07:00
}
public int getMainId() {
2022-05-28 04:21:47 -07:00
return mainId;
2022-05-13 03:12:25 -07:00
}
public int getOrder() {
2022-05-28 04:21:47 -07:00
return order;
2022-05-13 03:12:25 -07:00
}
public long getDescTextMapHash() {
2022-05-28 04:21:47 -07:00
return descTextMapHash;
2022-05-13 03:12:25 -07:00
}
public boolean finishParent() {
2022-05-28 04:21:47 -07:00
return finishParent;
}
public boolean isRewind() {
2022-05-28 04:21:47 -07:00
return isRewind;
}
2022-05-13 03:12:25 -07:00
public LogicType getAcceptCondComb() {
2022-05-28 04:21:47 -07:00
return acceptCondComb;
2022-05-13 03:12:25 -07:00
}
2022-07-05 20:41:07 +08:00
public List<QuestCondition> getAcceptCond() {
return acceptCond;
2022-05-13 03:12:25 -07:00
}
public LogicType getFinishCondComb() {
2022-05-28 04:21:47 -07:00
return finishCondComb;
2022-05-13 03:12:25 -07:00
}
2022-07-05 20:41:07 +08:00
public List<QuestCondition> getFinishCond() {
return finishCond;
2022-05-13 03:12:25 -07:00
}
public LogicType getFailCondComb() {
2022-05-28 04:21:47 -07:00
return failCondComb;
2022-05-13 03:12:25 -07:00
}
2022-07-05 20:41:07 +08:00
public List<QuestCondition> getFailCond() {
return failCond;
2022-05-13 03:12:25 -07:00
}
public void onLoad() {
2022-07-05 20:41:07 +08:00
this.acceptCond = acceptCond.stream().filter(p -> p.type != null).toList();
this.finishCond = finishCond.stream().filter(p -> p.type != null).toList();
this.failCond = failCond.stream().filter(p -> p.type != null).toList();
this.beginExec = beginExec.stream().filter(p -> p.type != null).toList();
this.finishExec = finishExec.stream().filter(p -> p.type != null).toList();
this.failExec = failExec.stream().filter(p -> p.type != null).toList();
2022-05-13 03:12:25 -07:00
}
2022-07-05 20:41:07 +08:00
@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
2022-05-13 03:12:25 -07:00
public class QuestExecParam {
2022-07-05 20:41:07 +08:00
@SerializedName("_type")
QuestTrigger type;
@SerializedName("_param")
String[] param;
@SerializedName("_count")
String count;
2022-05-13 03:12:25 -07:00
}
2022-07-05 20:41:07 +08:00
@Data
2022-05-13 03:12:25 -07:00
public static class QuestCondition {
2022-07-05 20:41:07 +08:00
@SerializedName("_type")
2022-05-13 03:12:25 -07:00
private QuestTrigger type;
2022-07-05 20:41:07 +08:00
@SerializedName("_param")
2022-05-13 03:12:25 -07:00
private int[] param;
2022-07-05 20:41:07 +08:00
@SerializedName("_param_str")
private String paramStr;
@SerializedName("_count")
2022-05-13 03:12:25 -07:00
private String count;
2022-07-05 20:41:07 +08:00
2022-05-13 03:12:25 -07:00
}
}