QuestData.java 2.53 KB
Newer Older
Melledy's avatar
Melledy committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
package emu.grasscutter.data.def;

import java.util.Arrays;
import java.util.List;

import emu.grasscutter.data.GameResource;
import emu.grasscutter.data.ResourceType;
import emu.grasscutter.game.quest.enums.LogicType;
import emu.grasscutter.game.quest.enums.QuestTrigger;

@ResourceType(name = "QuestExcelConfigData.json")
public class QuestData extends GameResource {
	private int SubId;
	private int MainId;
	private int Order;
	private long DescTextMapHash;
	
	private LogicType AcceptCondComb;
	private QuestCondition[] acceptConditons;
	private LogicType FinishCondComb;
	private QuestCondition[] finishConditons;
	private LogicType FailCondComb;
	private QuestCondition[] failConditons;
	
	private List<QuestParam> AcceptCond;
	private List<QuestParam> FinishCond;
	private List<QuestParam> FailCond;
	private List<QuestExecParam> BeginExec;
	private List<QuestExecParam> FinishExec;
	private List<QuestExecParam> FailExec;

	public int getId() {
		return SubId;
	}

	public int getMainId() {
		return MainId;
	}

	public int getOrder() {
		return Order;
	}

	public long getDescTextMapHash() {
		return DescTextMapHash;
	}

	public LogicType getAcceptCondComb() {
		return AcceptCondComb;
	}

	public QuestCondition[] getAcceptCond() {
		return acceptConditons;
	}

	public LogicType getFinishCondComb() {
		return FinishCondComb;
	}

	public QuestCondition[] getFinishCond() {
		return finishConditons;
	}

	public LogicType getFailCondComb() {
		return FailCondComb;
	}

	public QuestCondition[] getFailCond() {
		return failConditons;
	}

	public void onLoad() {
		this.acceptConditons = AcceptCond.stream().filter(p -> p.Type != null).map(QuestCondition::new).toArray(QuestCondition[]::new);
		AcceptCond = null;
		this.finishConditons = FinishCond.stream().filter(p -> p.Type != null).map(QuestCondition::new).toArray(QuestCondition[]::new);
		FinishCond = null;
		this.failConditons = FailCond.stream().filter(p -> p.Type != null).map(QuestCondition::new).toArray(QuestCondition[]::new);
		FailCond = null;
	}
	
	public class QuestParam {
		QuestTrigger Type;
		int[] Param;
		String count;
	}
	
	public class QuestExecParam {
		QuestTrigger Type;
		String[] Param;
		String count;
	}
	
	public static class QuestCondition {
		private QuestTrigger type;
		private int[] param;
		private String count;
		
		public QuestCondition(QuestParam param) {
			this.type = param.Type;
			this.param = param.Param;
		}
		
		public QuestTrigger getType() {
			return type;
		}
		
		public int[] getParam() {
			return param;
		}

		public String getCount() {
			return count;
		}
	}
}