-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathDestroySecretsSpell.java
More file actions
35 lines (29 loc) · 1.26 KB
/
DestroySecretsSpell.java
File metadata and controls
35 lines (29 loc) · 1.26 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
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.targeting.EntityReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Map;
/**
* Destroys all the secrets belonging to {@link SpellArg#TARGET_PLAYER}.
* <p>
* Secrets removed in this way have their enchantments removed and are removed from play (not sent to the graveyard).
*/
public class DestroySecretsSpell extends Spell {
public static Logger logger = LoggerFactory.getLogger(DestroySecretsSpell.class);
public static SpellDesc create(TargetPlayer targetPlayer) {
Map<SpellArg, Object> arguments = new SpellDesc(DestroySecretsSpell.class);
arguments.put(SpellArg.TARGET_PLAYER, targetPlayer);
arguments.put(SpellArg.TARGET, EntityReference.NONE);
return new SpellDesc(arguments);
}
@Override
protected void onCast(GameContext context, Player player, SpellDesc desc, Entity source, Entity target) {
checkArguments(logger, context, source, desc);
context.getLogic().removeSecrets(player);
}
}