mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
- Fixed Heroic
- Fixed FightEffect
This commit is contained in:
@@ -22,7 +22,7 @@ public class FightEffect extends SpellAbilityEffect {
|
||||
if (fighters.size() > 1) {
|
||||
sb.append(fighters.get(0) + " fights " + fighters.get(1));
|
||||
}
|
||||
else {
|
||||
else if (fighters.size() == 1) {
|
||||
sb.append(fighters.get(0) + " fights unknown");
|
||||
}
|
||||
return sb.toString();
|
||||
|
||||
@@ -53,7 +53,7 @@ public class TriggerPlaneswalkedFrom extends Trigger {
|
||||
*/
|
||||
@Override
|
||||
public void setTriggeringObjects(SpellAbility sa) {
|
||||
sa.setTriggeringObject("Card", this.getRunParams().get("Card"));
|
||||
sa.setTriggeringObject("Cards", this.getRunParams().get("Card"));
|
||||
// The 'Card' triggered object above is actually an array list of the current planes being left,
|
||||
// so the actual source has to be determined differently than usual
|
||||
sa.setTriggeringObject("Source", this.hostCard);
|
||||
|
||||
@@ -52,7 +52,7 @@ public class TriggerPlaneswalkedTo extends Trigger {
|
||||
*/
|
||||
@Override
|
||||
public void setTriggeringObjects(SpellAbility sa) {
|
||||
sa.setTriggeringObject("Card", this.getRunParams().get("Card"));
|
||||
sa.setTriggeringObject("Cards", this.getRunParams().get("Card"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -106,49 +106,27 @@ public class TriggerSpellAbilityCast extends Trigger {
|
||||
if (si != null) {
|
||||
sa = si.getSpellAbility();
|
||||
}
|
||||
if (sa.getTargetRestrictions() == null) {
|
||||
if (sa.getTargetCard() == null) {
|
||||
Player targetPl = sa.getTargets().getFirstTargetedPlayer();
|
||||
if (targetPl == null)
|
||||
return false;
|
||||
|
||||
if (!matchesValid(targetPl, this.mapParams.get("TargetsValid").split(","), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (!matchesValid(sa.getTargetCard(), this.mapParams.get("TargetsValid").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
|
||||
boolean validTgtFound = false;
|
||||
while (sa != null && !validTgtFound) {
|
||||
for (final Card tgt : sa.getTargets().getTargetCards()) {
|
||||
if (tgt.isValid(this.mapParams.get("TargetsValid").split(","), this.getHostCard()
|
||||
.getController(), this.getHostCard())) {
|
||||
validTgtFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (sa.getTargetRestrictions().doesTarget()) {
|
||||
boolean validTgtFound = false;
|
||||
while (sa != null && !validTgtFound) {
|
||||
for (final Card tgt : sa.getTargets().getTargetCards()) {
|
||||
if (tgt.isValid(this.mapParams.get("TargetsValid").split(","), this.getHostCard()
|
||||
.getController(), this.getHostCard())) {
|
||||
validTgtFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (final Player p : sa.getTargets().getTargetPlayers()) {
|
||||
if (matchesValid(p, this.mapParams.get("TargetsValid").split(","), this.getHostCard())) {
|
||||
validTgtFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
sa = sa.getSubAbility();
|
||||
for (final Player p : sa.getTargets().getTargetPlayers()) {
|
||||
if (matchesValid(p, this.mapParams.get("TargetsValid").split(","), this.getHostCard())) {
|
||||
validTgtFound = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!validTgtFound) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
sa = sa.getSubAbility();
|
||||
}
|
||||
if (!validTgtFound) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,6 +181,7 @@ public class TriggerSpellAbilityCast extends Trigger {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final void setTriggeringObjects(final SpellAbility sa) {
|
||||
|
||||
Reference in New Issue
Block a user