mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- [C17] Added O-Kagachi, Vengeful Kami.
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -17177,6 +17177,7 @@ forge-gui/res/cardsfolder/upcoming/mathas_fiend_seeker.txt -text
|
||||
forge-gui/res/cardsfolder/upcoming/mirror_of_the_forebears.txt -text
|
||||
forge-gui/res/cardsfolder/upcoming/nazahn_revered_bladesmith.txt -text
|
||||
forge-gui/res/cardsfolder/upcoming/new_blood.txt -text
|
||||
forge-gui/res/cardsfolder/upcoming/o-kagachi_vengeful_kami.txt -text
|
||||
forge-gui/res/cardsfolder/upcoming/path_of_ancestry.txt -text
|
||||
forge-gui/res/cardsfolder/upcoming/patron_of_the_vein.txt -text
|
||||
forge-gui/res/cardsfolder/upcoming/qasali_slingers.txt -text
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.google.common.eventbus.EventBus;
|
||||
|
||||
@@ -90,6 +91,9 @@ public class Game {
|
||||
private CardCollection lastStateBattlefield = new CardCollection();
|
||||
private CardCollection lastStateGraveyard = new CardCollection();
|
||||
|
||||
private Map<Player, PlayerCollection> attackedThisTurn = Maps.newHashMap();
|
||||
private Map<Player, PlayerCollection> attackedLastTurn = Maps.newHashMap();
|
||||
|
||||
private Player monarch = null;
|
||||
private Player monarchBeginTurn = null;
|
||||
|
||||
@@ -120,6 +124,28 @@ public class Game {
|
||||
this.monarchBeginTurn = monarchBeginTurn;
|
||||
}
|
||||
|
||||
public Map<Player, PlayerCollection> getPlayersAttackedThisTurn() {
|
||||
return attackedThisTurn;
|
||||
}
|
||||
|
||||
public Map<Player, PlayerCollection> getPlayersAttackedLastTurn() {
|
||||
return attackedLastTurn;
|
||||
}
|
||||
|
||||
public void addPlayerAttackedThisTurn(Player attacker, Player defender) {
|
||||
PlayerCollection atk = attackedThisTurn.get(attacker);
|
||||
if (atk == null) {
|
||||
attackedThisTurn.put(attacker, new PlayerCollection());
|
||||
}
|
||||
attackedThisTurn.get(attacker).add(defender);
|
||||
}
|
||||
|
||||
public void resetPlayersAttackedOnNextTurn() {
|
||||
attackedLastTurn.clear();
|
||||
attackedLastTurn.putAll(attackedThisTurn);
|
||||
attackedThisTurn.clear();
|
||||
}
|
||||
|
||||
public CardCollectionView getLastStateBattlefield() {
|
||||
return lastStateBattlefield;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import forge.card.mana.ManaCost;
|
||||
import forge.game.*;
|
||||
import forge.game.card.Card;
|
||||
@@ -45,7 +44,6 @@ import forge.util.CollectionSuppliers;
|
||||
import forge.util.collect.FCollectionView;
|
||||
import forge.util.maps.HashMapOfLists;
|
||||
import forge.util.maps.MapOfLists;
|
||||
|
||||
import org.apache.commons.lang3.time.StopWatch;
|
||||
|
||||
import java.util.*;
|
||||
@@ -273,6 +271,14 @@ public class PhaseHandler implements java.io.Serializable {
|
||||
&& !game.getTriggerHandler().hasDelayedTriggers()) {
|
||||
endCombat();
|
||||
}
|
||||
|
||||
if (combat != null) {
|
||||
for (Card c : combat.getAttackers()) {
|
||||
if (combat.getDefenderByAttacker(c) instanceof Player) {
|
||||
game.addPlayerAttackedThisTurn(c.getController(), (Player)combat.getDefenderByAttacker(c));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
givePriorityToPlayer = inCombat();
|
||||
@@ -328,6 +334,10 @@ public class PhaseHandler implements java.io.Serializable {
|
||||
if (playerTurn.getController().isAI()) {
|
||||
playerTurn.getController().resetAtEndOfTurn();
|
||||
}
|
||||
|
||||
// Reset the attackers this turn/last turn
|
||||
game.resetPlayersAttackedOnNextTurn();
|
||||
|
||||
game.getEndOfTurn().executeAt();
|
||||
break;
|
||||
|
||||
|
||||
@@ -362,6 +362,25 @@ public abstract class Trigger extends TriggerReplacementBase {
|
||||
this.getHostCard().getController(), this.getHostCard(), null)) {
|
||||
return false;
|
||||
}
|
||||
} else if ("AttackedPlayerWhoAttackedYouLastTurn".equals(condition)) {
|
||||
GameEntity attacked = (GameEntity) runParams.get("Attacked");
|
||||
if (attacked == null) {
|
||||
// Check "Defender" too because once triggering objects are set on TriggerAttacks, the value of Attacked
|
||||
// ends up being in Defender at that point.
|
||||
attacked = (GameEntity) runParams.get("DefendingPlayer");
|
||||
}
|
||||
Player attacker = this.getHostCard().getController();
|
||||
|
||||
boolean valid = false;
|
||||
if (game.getPlayersAttackedLastTurn().containsKey(attacked)) {
|
||||
if (game.getPlayersAttackedLastTurn().get(attacked).contains(attacker)) {
|
||||
valid = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (attacked == null || !valid) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
Name:O-Kagachi, Vengeful Kami
|
||||
ManaCost:1 W U B R G
|
||||
Types:Legendary Creature Dragon Spirit
|
||||
PT:6/6
|
||||
K:Flying
|
||||
K:Trample
|
||||
T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | Execute$ TrigExile | CombatDamage$ True | Condition$ AttackedPlayerWhoAttackedYouLastTurn | TriggerDescription$ Whenever CARDNAME deals combat damage to a player, if that player attacked you during his or her last turn, exile target nonland permanent that player controls.
|
||||
SVar:TrigExile:DB$ ChangeZone | ValidTgts$ Permanent.nonLand+DefenderCtrl | TgtPrompt$ Select target nonland permanent | Origin$ Battlefield | Destination$ Exile
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/o-kagachi_vengeful_kami.jpg
|
||||
Oracle:Flying, trample\nWhenever O-Kagachi, Vengeful Kami deals combat damage to a player, if that player attacked you during his or her last turn, exile target nonland permanent that player controls.
|
||||
Reference in New Issue
Block a user