-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCreepData.java
executable file
·274 lines (266 loc) · 6.55 KB
/
CreepData.java
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
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
public class CreepData {
//CP怪
private int num;//編號
private String name;//名字
private int width; //寬度
private int height; //高度
private int speed; //速度
private int baseAtk; //基礎攻擊力
private int bulletNum; //子彈種類編號
private double hp; //生命值
private double hpRate; //每秒生命值回復值
private double manaArmor; //魔法裝甲值
private double atkRate; //攻擊速率
private double mp; //魔法值
private double mpRate; //每秒魔法值回復值
private double armor; //裝甲值
private int[] skill = new int[4]; //技能1-4編號
private int range; //攻擊範圍
private int detectRange; //視野範圍
private int exp; //被擊殺或摧毀經驗值
private int award; //被擊殺或摧毀獎勵金錢
public void printData(){
System.out.print(name+" ");
System.out.print(width+" ");
System.out.print(height+" ");
System.out.print(speed+" ");
System.out.print(manaArmor+" ");
System.out.print(armor+" ");
System.out.print(skill[0]+" "+skill[1]+" "+skill[2]+" "+skill[3]+" ");
System.out.print(range+" ");
System.out.print(detectRange+"\n");
}
public void readData(File file){
try {
BufferedReader br = new BufferedReader(new InputStreamReader(
new FileInputStream(file)));
String input = "";
try {
input = br.readLine();
input = br.readLine();
while(!input.matches("name")){
num = Integer.parseInt(input);
input = br.readLine();
}
input = br.readLine();
while(!input.matches("width")){
name = input;
input = br.readLine();
}
input = br.readLine();
while(!input.matches("height")){
width = Integer.parseInt(input);
input = br.readLine();
}
input = br.readLine();
while(!input.matches("speed")){
height = Integer.parseInt(input);
input = br.readLine();
}
input = br.readLine();
while(!input.matches("baseAtk")){
speed = Integer.parseInt(input);
input = br.readLine();
}
input = br.readLine();
while(!input.matches("bulletNum")){
baseAtk = Integer.parseInt(input);
input = br.readLine();
}
input = br.readLine();
while(!input.matches("hp")){
bulletNum = Integer.parseInt(input);
input = br.readLine();
}
input = br.readLine();
while(!input.matches("hpRate")){
hp = Double.parseDouble(input);
input = br.readLine();
}
input = br.readLine();
while(!input.matches("atkRate")){
hpRate = Double.parseDouble(input);
input = br.readLine();
}
input = br.readLine();
while(!input.matches("mp")){
atkRate = Double.parseDouble(input);
input = br.readLine();
}
input = br.readLine();
while(!input.matches("mpRate")){
mp = Double.parseDouble(input);
input = br.readLine();
}
input = br.readLine();
while(!input.matches("manaArmor")){
mpRate = Double.parseDouble(input);
input = br.readLine();
}
input = br.readLine();
while(!input.matches("armor")){
manaArmor = Double.parseDouble(input);
input = br.readLine();
}
input = br.readLine();
while(!input.matches("skill")){
armor = Double.parseDouble(input);
input = br.readLine();
}
input = br.readLine();
while(!input.matches("range")){
String[] s = input.split(" ");
skill[0] = Integer.parseInt(s[0]);
skill[1] = Integer.parseInt(s[1]);
skill[2] = Integer.parseInt(s[2]);
skill[3] = Integer.parseInt(s[3]);
input = br.readLine();
}
input = br.readLine();
while(!input.matches("detectRange")){
range = Integer.parseInt(input);
input = br.readLine();
}
input = br.readLine();
while(!input.matches("exp")){
detectRange = Integer.parseInt(input);
input = br.readLine();
}
input = br.readLine();
while(!input.matches("award")){
exp = Integer.parseInt(input);
input = br.readLine();
}
input = br.readLine();
award = Integer.parseInt(input);
br.close();
} catch (IOException e) {
// TODO 自動產生 catch 區塊
e.printStackTrace();
}
} catch (FileNotFoundException e) {
// TODO 自動產生 catch 區塊
e.printStackTrace();
}
}
public double getArmor() {
return armor;
}
public void setArmor(double armor) {
this.armor = armor;
}
public double getAtkRate() {
return atkRate;
}
public void setAtkRate(double atkRate) {
this.atkRate = atkRate;
}
public double getHp() {
return hp;
}
public void setHp(double hp) {
this.hp = hp;
}
public double getHpRate() {
return hpRate;
}
public void setHpRate(double hpRate) {
this.hpRate = hpRate;
}
public double getMp() {
return mp;
}
public void setMp(double mp) {
this.mp = mp;
}
public double getMpRate() {
return mpRate;
}
public void setMpRate(double mpRate) {
this.mpRate = mpRate;
}
public int getDetectRange() {
return detectRange;
}
public void setDetectRange(int detectRange) {
this.detectRange = detectRange;
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
public double getManaArmor() {
return manaArmor;
}
public void setManaArmor(double manaArmor) {
this.manaArmor = manaArmor;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getRange() {
return range;
}
public void setRange(int range) {
this.range = range;
}
public int[] getSkill() {
return skill;
}
public void setSkill(int[] skill) {
this.skill = skill;
}
public int getSpeed() {
return speed;
}
public void setSpeed(int speed) {
this.speed = speed;
}
public int getWidth() {
return width;
}
public void setWidth(int width) {
this.width = width;
}
public int getBaseAtk() {
return baseAtk;
}
public void setBaseAtk(int baseAtk) {
this.baseAtk = baseAtk;
}
public int getAward() {
return award;
}
public void setAward(int award) {
this.award = award;
}
public int getExp() {
return exp;
}
public void setExp(int exp) {
this.exp = exp;
}
public int getBulletNum() {
return bulletNum;
}
public void setBulletNum(int bulletNum) {
this.bulletNum = bulletNum;
}
public int getNum() {
return num;
}
public void setNum(int num) {
this.num = num;
}
}