mirror of
https://github.com/correl/mage.git
synced 2024-12-26 19:16:54 +00:00
fixed some range of influence issues
This commit is contained in:
parent
587e8a75ef
commit
457269cb12
3 changed files with 19 additions and 14 deletions
|
@ -63,7 +63,6 @@ public class EnsnaringBridge extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class EnsnaringBridgeRestrictionEffect extends RestrictionEffect {
|
class EnsnaringBridgeRestrictionEffect extends RestrictionEffect {
|
||||||
|
|
||||||
public EnsnaringBridgeRestrictionEffect() {
|
public EnsnaringBridgeRestrictionEffect() {
|
||||||
|
@ -78,11 +77,12 @@ class EnsnaringBridgeRestrictionEffect extends RestrictionEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller != null) {
|
if (controller == null) {
|
||||||
return permanent.getPower().getValue() > controller.getHand().size();
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
return controller.getInRange().contains(permanent.getControllerId())
|
||||||
|
&& permanent.getPower().getValue() > controller.getHand().size();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canAttack(Game game) {
|
public boolean canAttack(Game game) {
|
||||||
|
|
|
@ -52,7 +52,6 @@ public class PriceOfGlory extends CardImpl {
|
||||||
public PriceOfGlory(UUID ownerId, CardSetInfo setInfo) {
|
public PriceOfGlory(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}");
|
||||||
|
|
||||||
|
|
||||||
// Whenever a player taps a land for mana, if it's not that player's turn, destroy that land.
|
// Whenever a player taps a land for mana, if it's not that player's turn, destroy that land.
|
||||||
this.addAbility(new PriceOfGloryAbility());
|
this.addAbility(new PriceOfGloryAbility());
|
||||||
}
|
}
|
||||||
|
@ -86,11 +85,16 @@ class PriceOfGloryAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
Permanent permanent = game.getPermanent(event.getSourceId());
|
Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId());
|
||||||
if (permanent == null) {
|
if (permanent == null) {
|
||||||
permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD);
|
return false;
|
||||||
}
|
}
|
||||||
if (permanent != null && permanent.isLand()
|
Player player = game.getPlayer(controllerId);
|
||||||
|
if (player == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (permanent.isLand()
|
||||||
|
&& player.getInRange().contains(permanent.getControllerId())
|
||||||
&& !permanent.getControllerId().equals(game.getActivePlayerId())) { // intervening if clause
|
&& !permanent.getControllerId().equals(game.getActivePlayerId())) { // intervening if clause
|
||||||
getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
|
getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -3484,9 +3484,10 @@ public abstract class PlayerImpl implements Player, Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasOpponent(UUID playerToCheckId, Game game
|
public boolean hasOpponent(UUID playerToCheckId, Game game) {
|
||||||
) {
|
return !this.getId().equals(playerToCheckId)
|
||||||
return !this.getId().equals(playerToCheckId) && game.isOpponent(this, playerToCheckId);
|
&& game.isOpponent(this, playerToCheckId)
|
||||||
|
&& getInRange().contains(playerToCheckId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue