-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSummonAcceptRune.java
46 lines (36 loc) · 1.36 KB
/
SummonAcceptRune.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
import java.util.HashMap;
public class SummonAcceptRune extends Rune {
private String name;
private String desc;
private boolean needsLearned;
private String STR_ERR_NO_SUMMON;
private String STR_SUCCESS;
public SummonAcceptRune(MagicSpellsListener listener, PropertiesFile properties) {
name = properties.getString("runes-summon-accept-name","summon-accept");
desc = properties.getString("runes-summon-accept-desc","Accepts a summons from a summon rune.");
needsLearned = properties.getBoolean("runes-summon-accept-needs-learned",true);
String rune = properties.getString("runes-summon-accept-rune","-1,-1,-1,-1,-1;-1,-1,17,-1,-1;-1,17,1,17,-1;-1,-1,17,-1,-1;-1,-1,-1,-1,-1");
setRune(rune);
STR_ERR_NO_SUMMON = properties.getString("runes-summon-accept-no-summon-str","Nothing happens.");
STR_SUCCESS = properties.getString("runes-summon-accept-success-str","You have been summoned!");
}
public void activate(Player player, Block center) {
Summon summon = Summon.getPendingSummon(player);
if (summon == null) {
player.sendMessage(Spell.TEXT_COLOR + STR_ERR_NO_SUMMON);
} else {
destroyRune(center);
summon.activate();
player.sendMessage(Spell.TEXT_COLOR + STR_SUCCESS);
}
}
public String getName() {
return name;
}
public String getDesc() {
return desc;
}
public boolean needsLearned() {
return needsLearned;
}
}