mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
ActivationFirstCombat
This commit is contained in:
@@ -309,6 +309,7 @@ public class PhaseHandler implements java.io.Serializable {
|
||||
break;
|
||||
|
||||
case COMBAT_BEGIN:
|
||||
nCombatsThisTurn++;
|
||||
combat = new Combat(playerTurn);
|
||||
//PhaseUtil.verifyCombat();
|
||||
break;
|
||||
@@ -603,7 +604,6 @@ public class PhaseHandler implements java.io.Serializable {
|
||||
return;
|
||||
}
|
||||
|
||||
nCombatsThisTurn++;
|
||||
// Reset all active Triggers
|
||||
game.getTriggerHandler().resetActiveTriggers();
|
||||
|
||||
@@ -981,6 +981,9 @@ public class PhaseHandler implements java.io.Serializable {
|
||||
public final boolean isFirstCombat() {
|
||||
return nCombatsThisTurn == 1;
|
||||
}
|
||||
public final int getNumCombat() {
|
||||
return nCombatsThisTurn;
|
||||
}
|
||||
|
||||
public final boolean isFirstUpkeep() {
|
||||
return is(PhaseType.UPKEEP) && nUpkeepsThisTurn == 0;
|
||||
|
||||
@@ -134,6 +134,10 @@ public class SpellAbilityRestriction extends SpellAbilityVariables {
|
||||
this.setPhases(PhaseType.parseRange(params.get("ActivationPhases")));
|
||||
}
|
||||
|
||||
if (params.containsKey("ActivationFirstCombat")) {
|
||||
this.setFirstCombatOnly(true);
|
||||
}
|
||||
|
||||
if (params.containsKey("ActivationGameTypes")) {
|
||||
this.setGameTypes(GameType.listValueOf(params.get("ActivationGameTypes")));
|
||||
}
|
||||
@@ -319,6 +323,12 @@ public class SpellAbilityRestriction extends SpellAbilityVariables {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getFirstCombatOnly()) {
|
||||
if (game.getPhaseHandler().getNumCombat() > 1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ public class SpellAbilityVariables implements Cloneable {
|
||||
public void setVariables(SpellAbilityVariables sav) {
|
||||
this.zone = sav.getZone();
|
||||
this.phases = Sets.newEnumSet(sav.getPhases(), PhaseType.class);
|
||||
this.firstCombatOnly = sav.getFirstCombatOnly();
|
||||
this.gameTypes = Sets.newEnumSet(sav.getGameTypes(), GameType.class);
|
||||
this.sorcerySpeed = sav.isSorcerySpeed();
|
||||
this.instantSpeed = sav.isInstantSpeed();
|
||||
@@ -104,6 +105,8 @@ public class SpellAbilityVariables implements Cloneable {
|
||||
/** The phases. */
|
||||
private Set<PhaseType> phases = EnumSet.noneOf(PhaseType.class);
|
||||
|
||||
private boolean firstCombatOnly = false;
|
||||
|
||||
/** The GameTypes */
|
||||
private Set<GameType> gameTypes = EnumSet.noneOf(GameType.class);
|
||||
|
||||
@@ -695,10 +698,22 @@ public class SpellAbilityVariables implements Cloneable {
|
||||
return this.phases;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the first combat.
|
||||
*
|
||||
* @return first combat
|
||||
*/
|
||||
public final boolean getFirstCombatOnly() {
|
||||
return this.firstCombatOnly;
|
||||
}
|
||||
public final boolean setFirstCombatOnly(boolean first) {
|
||||
return this.firstCombatOnly = first;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the game types.
|
||||
*
|
||||
* @return the phases
|
||||
* @return the game types
|
||||
*/
|
||||
public final Set<GameType> getGameTypes() {
|
||||
return this.gameTypes;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Name:Berserk
|
||||
ManaCost:G
|
||||
Types:Instant
|
||||
A:SP$ Pump | Cost$ G | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumAtt$ X | KW$ Trample | ActivationPhases$ Upkeep->Declare Blockers | SubAbility$ DelTrig | AILogic$ Berserk | SpellDescription$ Cast CARDNAME only before the combat damage step. Target creature gains trample and gets +X/+0 until end of turn, where X is its power. At the beginning of the next end step, destroy that creature if it attacked this turn.
|
||||
A:SP$ Pump | Cost$ G | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumAtt$ X | KW$ Trample | ActivationPhases$ Upkeep->Declare Blockers | ActivationFirstCombat$ True | SubAbility$ DelTrig | AILogic$ Berserk | SpellDescription$ Cast CARDNAME only before the combat damage step. Target creature gains trample and gets +X/+0 until end of turn, where X is its power. At the beginning of the next end step, destroy that creature if it attacked this turn.
|
||||
SVar:DelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ End Of Turn | Execute$ TrigDestroy | RememberObjects$ Targeted | TriggerDescription$ At the beginning of the next end step, destroy that creature if it attacked this turn. | AILogic$ Always
|
||||
SVar:TrigDestroy:DB$ Destroy | Defined$ DelayTriggerRemembered | ConditionDefined$ DelayTriggerRemembered | ConditionPresent$ Card.attackedThisTurn | ConditionCompare$ GE1
|
||||
SVar:X:Targeted$CardPower
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Name:Blood Frenzy
|
||||
ManaCost:1 R
|
||||
Types:Instant
|
||||
A:SP$ Pump | Cost$ 1 R | ActivationPhases$ Upkeep,Draw,Main1,BeginCombat,Declare Attackers,Declare Blockers | ValidTgts$ Creature.attacking,Creature.blocking | TgtPrompt$ Select target attacking or blocking creature | NumAtt$ +4 | NumDef$ +0 | AtEOT$ Destroy | SpellDescription$ Cast CARDNAME only before the combat damage step. Target attacking or blocking creature gets +4/+0 until end of turn. Destroy that creature at the beginning of the next end step.
|
||||
A:SP$ Pump | Cost$ 1 R | ActivationPhases$ Upkeep->Declare Blockers | ActivationFirstCombat$ True | ValidTgts$ Creature.attacking,Creature.blocking | TgtPrompt$ Select target attacking or blocking creature | NumAtt$ +4 | NumDef$ +0 | AtEOT$ Destroy | SpellDescription$ Cast CARDNAME only before the combat damage step. Target attacking or blocking creature gets +4/+0 until end of turn. Destroy that creature at the beginning of the next end step.
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/blood_frenzy.jpg
|
||||
Oracle:Cast this spell only before the combat damage step.\nTarget attacking or blocking creature gets +4/+0 until end of turn. Destroy that creature at the beginning of the next end step.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Name:Master Warcraft
|
||||
ManaCost:2 RW RW
|
||||
Types:Instant
|
||||
A:SP$ DeclareCombatants | Cost$ 2 RW RW | DeclareAttackers$ True | DeclareBlockers$ True | ActivationPhases$ Upkeep->BeginCombat | Until$ EndOfTurn | SpellDescription$ Cast this spell only before attackers are declared. You choose which creatures attack this turn. You choose which creatures block this turn and how those creatures block.
|
||||
A:SP$ DeclareCombatants | Cost$ 2 RW RW | DeclareAttackers$ True | DeclareBlockers$ True | ActivationPhases$ Upkeep->BeginCombat | ActivationFirstCombat$ True | Until$ EndOfTurn | SpellDescription$ Cast this spell only before attackers are declared. You choose which creatures attack this turn. You choose which creatures block this turn and how those creatures block.
|
||||
AI:RemoveDeck:All
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/master_warcraft.jpg
|
||||
Oracle:Cast this spell only before attackers are declared.\nYou choose which creatures attack this turn.\nYou choose which creatures block this turn and how those creatures block.
|
||||
|
||||
@@ -2,7 +2,6 @@ Name:Nebelgast Beguiler
|
||||
ManaCost:4 W
|
||||
Types:Creature Spirit
|
||||
PT:2/5
|
||||
K:Flying
|
||||
A:AB$ Tap | Cost$ W T | ValidTgts$ Creature | TgtPrompt$ Select target creature | SpellDescription$ Tap target creature.
|
||||
SVar:NonCombatPriority:1
|
||||
Oracle:Flying\n{W}, {T}: Tap target creature.
|
||||
|
||||
@@ -2,7 +2,7 @@ Name:Rapid Fire
|
||||
ManaCost:3 W
|
||||
Types:Instant
|
||||
Text:Cast this spell only before blockers are declared.
|
||||
A:SP$ Pump | Cost$ 3 W | ValidTgts$ Creature | TgtPrompt$ Select target creature | KW$ First Strike | ActivationPhases$ Upkeep->Declare Attackers | SubAbility$ DBPump | SpellDescription$ Target creature gains first strike until end of turn. If it doesn't have rampage, that creature gains rampage 2 until end of turn. (Whenever the creature becomes blocked, it gets +2/+2 until end of turn for each creature blocking it beyond the first.)
|
||||
A:SP$ Pump | Cost$ 3 W | ValidTgts$ Creature | TgtPrompt$ Select target creature | KW$ First Strike | ActivationPhases$ Upkeep->Declare Attackers | ActivationFirstCombat$ True | SubAbility$ DBPump | SpellDescription$ Target creature gains first strike until end of turn. If it doesn't have rampage, that creature gains rampage 2 until end of turn. (Whenever the creature becomes blocked, it gets +2/+2 until end of turn for each creature blocking it beyond the first.)
|
||||
SVar:DBPump:DB$ Pump | Defined$ Targeted | KW$ Rampage:2 | ConditionDefined$ Targeted | ConditionPresent$ Creature.withoutRampage
|
||||
AI:RemoveDeck:All
|
||||
Oracle:Cast this spell only before blockers are declared.\nTarget creature gains first strike until end of turn. If it doesn't have rampage, that creature gains rampage 2 until end of turn. (Whenever the creature becomes blocked, it gets +2/+2 until end of turn for each creature blocking it beyond the first.)
|
||||
|
||||
Reference in New Issue
Block a user