mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
modifications to allow cards that transform to Auras to attach to a target.
This commit is contained in:
@@ -6926,6 +6926,12 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
AllZone.getComputerPlayer()))) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("controllerWasDealtDamageByThisTurn")) {
|
||||
if (!(source.dealtDmgToHumanThisTurn && this.getController().isPlayer(AllZone.getHumanPlayer()))
|
||||
&& !(source.dealtDmgToComputerThisTurn && this.getController().isPlayer(
|
||||
AllZone.getComputerPlayer()))) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("wasDealtDamageThisTurn")) {
|
||||
if ((this.getReceivedDamageFromThisTurn().keySet()).isEmpty()) {
|
||||
return false;
|
||||
|
||||
@@ -1115,6 +1115,7 @@ public class AbilityFactoryAttach {
|
||||
|
||||
final AbilityFactory af = aura.getAbilityFactory();
|
||||
final Target tgt = aura.getTarget();
|
||||
final boolean gainControl = "GainControl".equals(af.getMapParams().get("AILogic"));
|
||||
|
||||
if (source.getController().isHuman()) {
|
||||
if (tgt.canTgtPlayer()) {
|
||||
@@ -1130,7 +1131,8 @@ public class AbilityFactoryAttach {
|
||||
|
||||
final Object o = GuiUtils.getChoice(source + " - Select a player to attach to.", players.toArray());
|
||||
if (o instanceof Player) {
|
||||
source.enchantEntity((Player) o);
|
||||
AbilityFactoryAttach.handleAura(source, (Player) o, false);
|
||||
//source.enchantEntity((Player) o);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
@@ -1139,7 +1141,8 @@ public class AbilityFactoryAttach {
|
||||
|
||||
final Object o = GuiUtils.getChoice(source + " - Select a card to attach to.", list.toArray());
|
||||
if (o instanceof Card) {
|
||||
source.enchantEntity((Card) o);
|
||||
AbilityFactoryAttach.handleAura(source, (Card) o, gainControl);
|
||||
//source.enchantEntity((Card) o);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1148,10 +1151,12 @@ public class AbilityFactoryAttach {
|
||||
else if (AbilityFactoryAttach.attachPreference(af, aura, af.getMapParams(), tgt, true)) {
|
||||
final Object o = aura.getTarget().getTargets().get(0);
|
||||
if (o instanceof Card) {
|
||||
source.enchantEntity((Card) o);
|
||||
//source.enchantEntity((Card) o);
|
||||
AbilityFactoryAttach.handleAura(source, (Card) o, gainControl);
|
||||
return true;
|
||||
} else if (o instanceof Player) {
|
||||
source.enchantEntity((Player) o);
|
||||
//source.enchantEntity((Player) o);
|
||||
AbilityFactoryAttach.handleAura(source, (Player) o, false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import java.util.Map;
|
||||
import forge.AllZoneUtil;
|
||||
import forge.Card;
|
||||
import forge.CardList;
|
||||
import forge.Constant;
|
||||
import forge.Constant.Zone;
|
||||
import forge.Player;
|
||||
import forge.card.spellability.AbilityActivated;
|
||||
@@ -252,6 +253,9 @@ public class AbilityFactorySetState {
|
||||
} else {
|
||||
tgt.setState(abilityFactory.getMapParams().get("NewState"));
|
||||
}
|
||||
if (tgt.isAura()) {
|
||||
AbilityFactoryAttach.attachAuraOnIndirectEnterBattlefield(tgt);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user