MonsterData.java 3.7 KB
Newer Older
Melledy's avatar
Melledy committed
1
2
3
4
package emu.grasscutter.data.def;

import java.util.List;

5
6
import emu.grasscutter.data.GameData;
import emu.grasscutter.data.GameResource;
Melledy's avatar
Melledy committed
7
8
9
10
11
import emu.grasscutter.data.ResourceType;
import emu.grasscutter.data.ResourceType.LoadPriority;
import emu.grasscutter.data.common.PropGrowCurve;

@ResourceType(name = "MonsterExcelConfigData.json", loadPriority = LoadPriority.LOW)
12
public class MonsterData extends GameResource {
Melledy's avatar
Melledy committed
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
	private int Id;
	
	private String MonsterName;
    private String Type;
    private String ServerScript;
    private List<Integer> Affix;
    private String Ai;
    private int[] Equips;
    private List<HpDrops> HpDrops;
    private int KillDropId;
    private String ExcludeWeathers;
    private int FeatureTagGroupID;
    private int MpPropID;
    private String Skin;
    private int DescribeId;
    private int CombatBGMLevel;
    private int EntityBudgetLevel;
    private float HpBase;
    private float AttackBase;
    private float DefenseBase;
    private float FireSubHurt;
    private float ElecSubHurt;
    private float GrassSubHurt;
    private float WaterSubHurt;
    private float WindSubHurt;
    private float RockSubHurt;
    private float IceSubHurt;
    private float PhysicalSubHurt;
    private List<PropGrowCurve> PropGrowCurves;
    private long NameTextMapHash;
    private int CampID;
    
    private int weaponId;
    private MonsterDescribeData describeData;
    
	@Override
	public int getId() {
		return this.Id;
	}
	
	public String getMonsterName() {
		return MonsterName;
	}

	public String getType() {
		return Type;
	}

	public String getServerScript() {
		return ServerScript;
	}

	public List<Integer> getAffix() {
		return Affix;
	}

	public String getAi() {
		return Ai;
	}

	public int[] getEquips() {
		return Equips;
	}

	public List<HpDrops> getHpDrops() {
		return HpDrops;
	}

	public int getKillDropId() {
		return KillDropId;
	}

	public String getExcludeWeathers() {
		return ExcludeWeathers;
	}

	public int getFeatureTagGroupID() {
		return FeatureTagGroupID;
	}

	public int getMpPropID() {
		return MpPropID;
	}

	public String getSkin() {
		return Skin;
	}

	public int getDescribeId() {
		return DescribeId;
	}

	public int getCombatBGMLevel() {
		return CombatBGMLevel;
	}

	public int getEntityBudgetLevel() {
		return EntityBudgetLevel;
	}

	public float getBaseHp() {
		return HpBase;
	}

	public float getBaseAttack() {
		return AttackBase;
	}

	public float getBaseDefense() {
		return DefenseBase;
	}

	public float getElecSubHurt() {
		return ElecSubHurt;
	}

	public float getGrassSubHurt() {
		return GrassSubHurt;
	}

	public float getWaterSubHurt() {
		return WaterSubHurt;
	}

	public float getWindSubHurt() {
		return WindSubHurt;
	}

	public float getIceSubHurt() {
		return IceSubHurt;
	}

	public float getPhysicalSubHurt() {
		return PhysicalSubHurt;
	}

	public List<PropGrowCurve> getPropGrowCurves() {
		return PropGrowCurves;
	}

	public long getNameTextMapHash() {
		return NameTextMapHash;
	}

	public int getCampID() {
		return CampID;
	}

	public MonsterDescribeData getDescribeData() {
		return describeData;
	}

	public int getWeaponId() {
		return weaponId;
	}

	@Override
	public void onLoad() {
171
		this.describeData = GameData.getMonsterDescribeDataMap().get(this.getDescribeId());
Melledy's avatar
Melledy committed
172
173
174
175
176
		
		for (int id : this.Equips) {
			if (id == 0) {
				continue;
			}
177
			GadgetData gadget = GameData.getGadgetDataMap().get(id);
Melledy's avatar
Melledy committed
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
			if (gadget == null) {
				continue;
			}
			if (gadget.getItemJsonName().equals("Default_MonsterWeapon")) {
				this.weaponId = id;
			}
		}
	}
	
	public class HpDrops {
	    private int DropId;
	    private int HpPercent;

	    public int getDropId(){
	        return this.DropId;
	    }
	    public int getHpPercent(){
	        return this.HpPercent;
	    }
	}
}