package net.demilich.metastone.game.spells.custom;
import java.util.Map;
import net.demilich.metastone.game.GameContext;
import net.demilich.metastone.game.Player;
import net.demilich.metastone.game.entities.Actor;
import net.demilich.metastone.game.entities.Entity;
import net.demilich.metastone.game.entities.minions.Summon;
import net.demilich.metastone.game.spells.Spell;
import net.demilich.metastone.game.spells.desc.SpellArg;
import net.demilich.metastone.game.spells.desc.SpellDesc;
public class BetrayalSpell extends Spell {
public static SpellDesc create() {
Map<SpellArg, Object> arguments = SpellDesc.build(BetrayalSpell.class);
return new SpellDesc(arguments);
}
@Override
protected void onCast(GameContext context, Player player, SpellDesc desc, Entity source, Entity target) {
Actor attacker = (Actor) target;
for (Summon adjacentSummon : context.getAdjacentSummons(player, target.getReference())) {
context.getLogic().damage(player, adjacentSummon, attacker.getAttack(), attacker);
}
}
}