mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 12:02:01 -08:00
[AFC] Implemented Hellish Rebuke
This commit is contained in:
parent
898f8ca287
commit
d20b15c7b6
3 changed files with 140 additions and 0 deletions
|
|
@ -1,6 +1,8 @@
|
|||
package mage.watchers.common;
|
||||
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.WatcherScope;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
|
|
@ -68,4 +70,18 @@ public class SpellsCastWatcher extends Watcher {
|
|||
public int getNumberOfNonCreatureSpells() {
|
||||
return nonCreatureSpells;
|
||||
}
|
||||
|
||||
public UUID getCasterId(Ability source, Game game) {
|
||||
for (Map.Entry<UUID, List<Spell>> entry : spellsCast.entrySet()) {
|
||||
if (entry.getValue()
|
||||
.stream()
|
||||
.map(Spell::getCard)
|
||||
.map(Card::getMainCard)
|
||||
.anyMatch(card -> card.getId().equals(source.getSourceId())
|
||||
&& card.getZoneChangeCounter(game) == source.getSourceObjectZoneChangeCounter())) {
|
||||
return entry.getKey();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue