-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathHeroPowerSpell.java
More file actions
23 lines (20 loc) · 992 Bytes
/
HeroPowerSpell.java
File metadata and controls
23 lines (20 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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.aura.HeroPowerBonusAura;
import net.demilich.metastone.game.spells.desc.SpellArg;
import net.demilich.metastone.game.spells.desc.SpellDesc;
/**
* Signifies that the subspells {@link SpellArg#SPELL}, {@link SpellArg#SPELLS}, etc.) represent the "hero power effect"
* for cards that interact with the hero power.
*/
public final class HeroPowerSpell extends MetaSpell {
@Override
protected void onCast(GameContext context, Player player, SpellDesc desc, Entity source, Entity target) {
super.onCast(context, player, desc, source, target);
for (SpellDesc bonusEffect : SpellUtils.getBonusesFromAura(context, player.getId(), HeroPowerBonusAura.class, source, target)) {
SpellUtils.castChildSpell(context, player, bonusEffect, source, target);
}
}
}