mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Merge branch 'guilds_fxes' into 'master'
Experimental Frenzy See merge request core-developers/forge!954
This commit is contained in:
@@ -422,7 +422,8 @@ public class AiController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
|
return player.canPlayLand(c);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return landList;
|
return landList;
|
||||||
@@ -1174,7 +1175,7 @@ public class AiController {
|
|||||||
if (landsWannaPlay != null) {
|
if (landsWannaPlay != null) {
|
||||||
landsWannaPlay = filterLandsToPlay(landsWannaPlay);
|
landsWannaPlay = filterLandsToPlay(landsWannaPlay);
|
||||||
Log.debug("Computer " + game.getPhaseHandler().getPhase().nameForUi);
|
Log.debug("Computer " + game.getPhaseHandler().getPhase().nameForUi);
|
||||||
if (landsWannaPlay != null && !landsWannaPlay.isEmpty() && player.canPlayLand(null)) {
|
if (landsWannaPlay != null && !landsWannaPlay.isEmpty()) {
|
||||||
// TODO search for other land it might want to play?
|
// TODO search for other land it might want to play?
|
||||||
Card land = chooseBestLandToPlay(landsWannaPlay);
|
Card land = chooseBestLandToPlay(landsWannaPlay);
|
||||||
if (ComputerUtil.getDamageFromETB(player, land) < player.getLife() || !player.canLoseLife()
|
if (ComputerUtil.getDamageFromETB(player, land) < player.getLife() || !player.canLoseLife()
|
||||||
|
|||||||
@@ -17,13 +17,10 @@
|
|||||||
*/
|
*/
|
||||||
package forge.game.spellability;
|
package forge.game.spellability;
|
||||||
|
|
||||||
import forge.game.Game;
|
|
||||||
import forge.game.card.Card;
|
import forge.game.card.Card;
|
||||||
import forge.game.cost.Cost;
|
import forge.game.cost.Cost;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.game.staticability.StaticAbility;
|
import forge.game.staticability.StaticAbility;
|
||||||
import forge.game.zone.Zone;
|
|
||||||
import forge.game.zone.ZoneType;
|
|
||||||
|
|
||||||
public class LandAbility extends Ability {
|
public class LandAbility extends Ability {
|
||||||
|
|
||||||
@@ -33,57 +30,14 @@ public class LandAbility extends Ability {
|
|||||||
setMayPlay(mayPlay);
|
setMayPlay(mayPlay);
|
||||||
}
|
}
|
||||||
public LandAbility(Card sourceCard) {
|
public LandAbility(Card sourceCard) {
|
||||||
this(sourceCard, sourceCard.getController(), (StaticAbility)null);
|
this(sourceCard, sourceCard.getController(), null);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
final Card land = this.getHostCard();
|
final Card land = this.getHostCard();
|
||||||
final Player p = this.getActivatingPlayer();
|
final Player p = this.getActivatingPlayer();
|
||||||
final Game game = p.getGame();
|
|
||||||
if (!p.canCastSorcery()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// CantBeCast static abilities
|
return p.canPlayLand(land);
|
||||||
for (final Card ca : game.getCardsIn(ZoneType.listValueOf("Battlefield,Command"))) {
|
|
||||||
final Iterable<StaticAbility> staticAbilities = ca.getStaticAbilities();
|
|
||||||
for (final StaticAbility stAb : staticAbilities) {
|
|
||||||
if (stAb.applyAbility("CantPlayLand", land, this)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (land != null) {
|
|
||||||
final boolean mayPlay = getMayPlay() != null;
|
|
||||||
if (land.getOwner() != p && !mayPlay) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Zone zone = game.getZoneOf(land);
|
|
||||||
if (zone != null && (zone.is(ZoneType.Battlefield) || (!zone.is(ZoneType.Hand) && !mayPlay))) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// **** Check for land play limit per turn ****
|
|
||||||
// Dev Mode
|
|
||||||
if (p.getController().canPlayUnlimitedLands() || p.hasKeyword("You may play any number of additional lands on each of your turns.")) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// check for adjusted max lands play per turn
|
|
||||||
int adjMax = 1;
|
|
||||||
for (String keyword : p.getKeywords()) {
|
|
||||||
if (keyword.startsWith("AdjustLandPlays")) {
|
|
||||||
final String[] k = keyword.split(":");
|
|
||||||
adjMax += Integer.valueOf(k[1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (p.getLandsPlayedThisTurn() < adjMax) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
|
|||||||
@@ -160,6 +160,14 @@ public class StaticAbilityCantBeCast {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (params.containsKey("Origin")) {
|
||||||
|
List<ZoneType> src = ZoneType.listValueOf(params.get("Origin"));
|
||||||
|
|
||||||
|
if (!src.contains(card.getZone().getZoneType())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (params.containsKey("Player") && (player != null)
|
if (params.containsKey("Player") && (player != null)
|
||||||
&& !player.isValid(params.get("Player"), hostCard.getController(), hostCard, null)) {
|
&& !player.isValid(params.get("Player"), hostCard.getController(), hostCard, null)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
10
forge-gui/res/cardsfolder/upcoming/experimental_frenzy.txt
Normal file
10
forge-gui/res/cardsfolder/upcoming/experimental_frenzy.txt
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
Name:Experimental Frenzy
|
||||||
|
ManaCost:3 R
|
||||||
|
Types:Enchantment
|
||||||
|
S:Mode$ Continuous | Affected$ Card.TopLibrary+YouCtrl | AffectedZone$ Library | MayLookAt$ Player | Description$ You may look at the top card of your library any time.
|
||||||
|
S:Mode$ Continuous | Affected$ Card.TopLibrary+YouCtrl | AffectedZone$ Library | MayPlay$ True | Description$ You may play the top card of your library.
|
||||||
|
S:Mode$ CantPlayLand | Player$ You | Origin$ Hand | Description$ You can't play lands from your hand.
|
||||||
|
S:Mode$ CantBeCast | ValidCard$ Card | Caster$ You | Origin$ Hand | Description$ You can't play cards from your hand.
|
||||||
|
SVar:NonStackingEffect:True
|
||||||
|
A:AB$ Destroy | Cost$ 3 R | Defined$ Self | SpellDescription$ Destroy CARDNAME.
|
||||||
|
Oracle:You may look at the top card of your library any time.\nYou may play the top card of your library.\nYou can't play cards from your hand.\n{3}{R}: Destroy Experimental Frenzy.
|
||||||
Reference in New Issue
Block a user