mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 22:42:03 -08:00
* Heroic - Fixed that heroic only triggered for one mode if a modal spell with heroic targets in differnt modes was used (e.g. Dromoka's Command).
This commit is contained in:
parent
907b029bdb
commit
bb478fa9d5
2 changed files with 89 additions and 8 deletions
|
|
@ -83,17 +83,19 @@ public class HeroicAbility extends TriggeredAbilityImpl {
|
|||
private boolean checkSpell(Spell spell, Game game) {
|
||||
if (spell != null) {
|
||||
SpellAbility sa = spell.getSpellAbility();
|
||||
for (Target target : sa.getTargets()) {
|
||||
if (!target.isNotTarget() && target.getTargets().contains(this.getSourceId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
for (Effect effect : sa.getEffects()) {
|
||||
for (UUID targetId : effect.getTargetPointer().getTargets(game, sa)) {
|
||||
if (targetId.equals(this.getSourceId())) {
|
||||
for(UUID modeId :sa.getModes().getSelectedModes()) {
|
||||
for (Target target : sa.getModes().get(modeId).getTargets()) {
|
||||
if (!target.isNotTarget() && target.getTargets().contains(this.getSourceId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
for (Effect effect : sa.getModes().get(modeId).getEffects()) {
|
||||
for (UUID targetId : effect.getTargetPointer().getTargets(game, sa)) {
|
||||
if (targetId.equals(this.getSourceId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue