mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-13 01:08:06 +00:00
Merge branch 'card-fixes' into 'master'
Fix Zurzoth, Akiri See merge request core-developers/forge!4519
This commit is contained in:
@@ -619,7 +619,7 @@ public class PhaseHandler implements java.io.Serializable {
|
|||||||
final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
|
final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
|
||||||
runParams.put(AbilityKey.Attackers, combat.getAttackersOf(ge));
|
runParams.put(AbilityKey.Attackers, combat.getAttackersOf(ge));
|
||||||
runParams.put(AbilityKey.AttackingPlayer, combat.getAttackingPlayer());
|
runParams.put(AbilityKey.AttackingPlayer, combat.getAttackingPlayer());
|
||||||
runParams.put(AbilityKey.AttackedTarget, ge);
|
runParams.put(AbilityKey.AttackedTarget, Collections.singletonList(ge));
|
||||||
attackedTarget.add(ge);
|
attackedTarget.add(ge);
|
||||||
game.getTriggerHandler().runTrigger(TriggerType.AttackersDeclaredOneTarget, runParams, false);
|
game.getTriggerHandler().runTrigger(TriggerType.AttackersDeclaredOneTarget, runParams, false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,12 +17,18 @@
|
|||||||
*/
|
*/
|
||||||
package forge.game.trigger;
|
package forge.game.trigger;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.google.common.collect.Iterables;
|
||||||
|
import forge.game.GameEntity;
|
||||||
|
import forge.game.GameObjectPredicates;
|
||||||
import forge.game.ability.AbilityKey;
|
import forge.game.ability.AbilityKey;
|
||||||
import forge.game.card.Card;
|
import forge.game.card.Card;
|
||||||
|
import forge.game.card.CardCollection;
|
||||||
|
import forge.game.card.CardLists;
|
||||||
import forge.game.spellability.SpellAbility;
|
import forge.game.spellability.SpellAbility;
|
||||||
import forge.util.Localizer;
|
import forge.util.Localizer;
|
||||||
|
import forge.util.collect.FCollection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Write javadoc for this type.
|
* TODO Write javadoc for this type.
|
||||||
@@ -64,7 +70,25 @@ public class TriggerAttackersDeclared extends Trigger {
|
|||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@Override
|
@Override
|
||||||
public final void setTriggeringObjects(final SpellAbility sa, Map<AbilityKey, Object> runParams) {
|
public final void setTriggeringObjects(final SpellAbility sa, Map<AbilityKey, Object> runParams) {
|
||||||
sa.setTriggeringObjectsFrom(runParams, AbilityKey.Attackers, AbilityKey.AttackingPlayer, AbilityKey.AttackedTarget);
|
Iterable<GameEntity> attackedTarget = (Iterable<GameEntity>) runParams.get(AbilityKey.AttackedTarget);
|
||||||
|
|
||||||
|
CardCollection attackers = (CardCollection)(runParams.get(AbilityKey.Attackers));
|
||||||
|
if (hasParam("ValidAttackers")) {
|
||||||
|
attackers = CardLists.getValidCards(attackers, getParam("ValidAttackers").split(","), getHostCard().getController(), getHostCard(), this);
|
||||||
|
FCollection<GameEntity> defenders = new FCollection<>();
|
||||||
|
for (Card attacker : attackers) {
|
||||||
|
defenders.add(attacker.getGame().getCombat().getDefenderByAttacker(attacker));
|
||||||
|
}
|
||||||
|
attackedTarget = defenders;
|
||||||
|
}
|
||||||
|
sa.setTriggeringObject(AbilityKey.Attackers, attackers);
|
||||||
|
|
||||||
|
if (hasParam("AttackedTarget")) {
|
||||||
|
attackedTarget = Iterables.filter(attackedTarget, GameObjectPredicates.restriction(getParam("AttackedTarget").split(","), getHostCard().getController(), getHostCard(), this));
|
||||||
|
}
|
||||||
|
sa.setTriggeringObject(AbilityKey.AttackedTarget, attackedTarget);
|
||||||
|
|
||||||
|
sa.setTriggeringObjectsFrom(runParams, AbilityKey.AttackingPlayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -2,9 +2,8 @@ Name:Akiri, Fearless Voyager
|
|||||||
ManaCost:1 R W
|
ManaCost:1 R W
|
||||||
Types:Legendary Creature Kor Warrior
|
Types:Legendary Creature Kor Warrior
|
||||||
PT:3/3
|
PT:3/3
|
||||||
T:Mode$ Attacks | ValidCard$ Creature.YouCtrl+equipped | Attacked$ Player.IsNotRemembered | RememberKey$ DefendingPlayer | Execute$ TrigDraw | TriggerZones$ Battlefield | TriggerDescription$ Whenever you attack a player with one or more equipped creatures, draw a card.
|
T:Mode$ AttackersDeclaredOneTarget | ValidAttackers$ Creature.YouCtrl+equipped | AttackedTarget$ Player | Execute$ TrigDraw | TriggerZones$ Battlefield | TriggerDescription$ Whenever you attack a player with one or more equipped creatures, draw a card.
|
||||||
SVar:TrigDraw:DB$ Draw | NumCards$ 1
|
SVar:TrigDraw:DB$ Draw | NumCards$ 1
|
||||||
T:Mode$ Phase | Phase$ Declare Attackers | Static$ True | Execute$ DBCleanup
|
|
||||||
A:AB$ ChooseCard | Cost$ W | Defined$ You | Choices$ Creature.YouCtrl+equipped | ChoiceTitle$ Choose an equipped creature you control | RememberChosen$ True | SubAbility$ DBChooseEquip | StackDescription$ SpellDescription | SpellDescription$ You may unattach an Equipment from a creature you control. If you do, tap that creature and it gains indestructible until end of turn.
|
A:AB$ ChooseCard | Cost$ W | Defined$ You | Choices$ Creature.YouCtrl+equipped | ChoiceTitle$ Choose an equipped creature you control | RememberChosen$ True | SubAbility$ DBChooseEquip | StackDescription$ SpellDescription | SpellDescription$ You may unattach an Equipment from a creature you control. If you do, tap that creature and it gains indestructible until end of turn.
|
||||||
SVar:DBChooseEquip:DB$ ChooseCard | Defined$ You | Choices$ Equipment.AttachedTo Creature.IsRemembered | ChoiceTitle$ You may choose an Equipment to unattach from that creature | SubAbility$ DBUnattach
|
SVar:DBChooseEquip:DB$ ChooseCard | Defined$ You | Choices$ Equipment.AttachedTo Creature.IsRemembered | ChoiceTitle$ You may choose an Equipment to unattach from that creature | SubAbility$ DBUnattach
|
||||||
SVar:DBUnattach:DB$ Unattach | Defined$ ChosenCard | SubAbility$ DBTap | StackDescription$ None
|
SVar:DBUnattach:DB$ Unattach | Defined$ ChosenCard | SubAbility$ DBTap | StackDescription$ None
|
||||||
|
|||||||
@@ -4,10 +4,8 @@ Types:Legendary Creature Devil
|
|||||||
PT:2/3
|
PT:2/3
|
||||||
T:Mode$ Drawn | ValidPlayer$ Player.Opponent+NonActive | Number$ 1 | TriggerZones$ Battlefield | Execute$ TrigToken | TriggerDescription$ Whenever an opponent draws their first card each turn, if it's not their turn, you create a 1/1 red Devil creature token with "When this creature dies, it deals 1 damage to any target."
|
T:Mode$ Drawn | ValidPlayer$ Player.Opponent+NonActive | Number$ 1 | TriggerZones$ Battlefield | Execute$ TrigToken | TriggerDescription$ Whenever an opponent draws their first card each turn, if it's not their turn, you create a 1/1 red Devil creature token with "When this creature dies, it deals 1 damage to any target."
|
||||||
SVar:TrigToken:DB$ Token | TokenAmount$ 1 | TokenScript$ r_1_1_devil_burn | TokenOwner$ You | LegacyImage$ r 1 1 devil burn jmp
|
SVar:TrigToken:DB$ Token | TokenAmount$ 1 | TokenScript$ r_1_1_devil_burn | TokenOwner$ You | LegacyImage$ r 1 1 devil burn jmp
|
||||||
T:Mode$ Attacks | ValidCards$ Devil.YouCtrl | Attacked$ Player.IsNotRemembered | RememberKey$ DefendingPlayer | TriggerZones$ Battlefield | Execute$ TrigDraw | TriggerDescription$ Whenever one or more Devils you control attack one or more players, you and those players each draw a card, then discard a card at random.
|
T:Mode$ AttackersDeclared | ValidAttackers$ Devil.YouCtrl | AttackedTarget$ Player | TriggerZones$ Battlefield | Execute$ TrigDraw | TriggerDescription$ Whenever one or more Devils you control attack one or more players, you and those players each draw a card, then discard a card at random.
|
||||||
SVar:TrigDraw:DB$ Draw | Defined$ TriggeredAttackedTargetAndYou | NumCards$ 1 | SubAbility$ DBDiscard
|
SVar:TrigDraw:DB$ Draw | Defined$ TriggeredAttackedTargetAndYou | NumCards$ 1 | SubAbility$ DBDiscard
|
||||||
SVar:DBDiscard:DB$ Discard | Defined$ TriggeredAttackedTargetAndYou | NumCards$ 1 | Mode$ Random
|
SVar:DBDiscard:DB$ Discard | Defined$ TriggeredAttackedTargetAndYou | NumCards$ 1 | Mode$ Random
|
||||||
T:Mode$ Phase | Phase$ Declare Attackers | Static$ True | Execute$ DBCleanup
|
|
||||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
|
||||||
DeckHas:Ability$Token
|
DeckHas:Ability$Token
|
||||||
Oracle:Whenever an opponent draws their first card each turn, if it's not their turn, you create a 1/1 red Devil creature token with "When this creature dies, it deals 1 damage to any target."\nWhenever one or more Devils you control attack one or more players, you and those players each draw a card, then discard a card at random.
|
Oracle:Whenever an opponent draws their first card each turn, if it's not their turn, you create a 1/1 red Devil creature token with "When this creature dies, it deals 1 damage to any target."\nWhenever one or more Devils you control attack one or more players, you and those players each draw a card, then discard a card at random.
|
||||||
|
|||||||
Reference in New Issue
Block a user