-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathClearOverloadSpell.java
More file actions
45 lines (38 loc) · 1.18 KB
/
ClearOverloadSpell.java
File metadata and controls
45 lines (38 loc) · 1.18 KB
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
package net.demilich.metastone.game.spells;
import net.demilich.metastone.game.GameContext;
import net.demilich.metastone.game.Player;
import net.demilich.metastone.game.entities.Entity;
import net.demilich.metastone.game.spells.desc.SpellArg;
import net.demilich.metastone.game.spells.desc.SpellDesc;
import net.demilich.metastone.game.cards.Attribute;
import java.util.Map;
/**
* Use a {@link SetAttributeSpell} instead:
* <pre>
* {
* "class": "SetAttributeSpell",
* "target": "FRIENDLY_PLAYER",
* "attribute": "OVERLOAD",
* "value": 0
* }
* </pre>
* Resets the player's overload status.
*
* @deprecated
*/
@Deprecated
public class ClearOverloadSpell extends Spell {
public static SpellDesc create() {
Map<SpellArg, Object> arguments = new SpellDesc(ClearOverloadSpell.class);
return new SpellDesc(arguments);
}
@Override
protected void onCast(GameContext context, Player player, SpellDesc desc, Entity source, Entity target) {
int lockedMana = player.getLockedMana();
if (lockedMana > 0) {
context.getLogic().modifyCurrentMana(player.getId(), lockedMana, false);
player.setLockedMana(0);
}
player.getAttributes().remove(Attribute.OVERLOAD);
}
}