mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 22:42:03 -08:00
* Fixed human players controlling other human players turn (e.g. by Mindsliver).
This commit is contained in:
parent
be11d287dc
commit
15efe14fd5
8 changed files with 34 additions and 16 deletions
|
|
@ -55,7 +55,7 @@ public class PlayLandAbility extends ActivatedAbilityImpl {
|
|||
if (!controlsAbility(playerId, game)) {
|
||||
return false;
|
||||
}
|
||||
//20091005 - 114.2a
|
||||
//20091005 - 114.2a
|
||||
return game.canPlaySorcery(playerId) && game.getPlayer(playerId).canPlayLand();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ import mage.game.events.GameEvent;
|
|||
public class AtTheEndOfTurnStepPostDelayedTriggeredAbility extends DelayedTriggeredAbility {
|
||||
|
||||
public AtTheEndOfTurnStepPostDelayedTriggeredAbility(Effect effect) {
|
||||
super(effect);
|
||||
this(effect, false);
|
||||
}
|
||||
|
||||
public AtTheEndOfTurnStepPostDelayedTriggeredAbility(Effect effect, boolean usesStack) {
|
||||
|
|
@ -68,6 +68,6 @@ public class AtTheEndOfTurnStepPostDelayedTriggeredAbility extends DelayedTrigge
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "At end of turn " + modes.getText();
|
||||
return "At end of turn " + super.getRule();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,8 +40,9 @@ import mage.players.Player;
|
|||
*/
|
||||
public class LoseControlOnOtherPlayersControllerEffect extends OneShotEffect {
|
||||
|
||||
public LoseControlOnOtherPlayersControllerEffect() {
|
||||
public LoseControlOnOtherPlayersControllerEffect(String controllingPlayerName, String controlledPlayerName) {
|
||||
super(Outcome.Detriment);
|
||||
staticText = controlledPlayerName + " lost control over " + controlledPlayerName;
|
||||
}
|
||||
|
||||
public LoseControlOnOtherPlayersControllerEffect(final LoseControlOnOtherPlayersControllerEffect effect) {
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public class GraftAbility extends TriggeredAbilityImpl {
|
|||
addSubAbility(new GraftStaticAbility(amount));
|
||||
}
|
||||
|
||||
public GraftAbility(GraftAbility ability) {
|
||||
public GraftAbility(final GraftAbility ability) {
|
||||
super(ability);
|
||||
this.amount = ability.amount;
|
||||
this.cardtype = ability.cardtype;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ package mage.players;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
|
@ -379,7 +380,8 @@ public interface Player extends MageItem, Copyable<Player> {
|
|||
List<Ability> getPlayableOptions(Ability ability, Game game);
|
||||
|
||||
Set<UUID> getPlayableInHand(Game game);
|
||||
|
||||
LinkedHashMap<UUID, ActivatedAbility> getUseableActivatedAbilities(MageObject object, Zone zone, Game game);
|
||||
|
||||
void addCounters(Counter counter, Game game);
|
||||
List<UUID> getAttachments();
|
||||
boolean addAttachment(UUID permanentId, Game game);
|
||||
|
|
|
|||
|
|
@ -550,7 +550,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
player.setGameUnderYourControl(false);
|
||||
player.setTurnControlledBy(this.getId());
|
||||
}
|
||||
DelayedTriggeredAbility ability = new AtTheEndOfTurnStepPostDelayedTriggeredAbility(new LoseControlOnOtherPlayersControllerEffect());
|
||||
DelayedTriggeredAbility ability = new AtTheEndOfTurnStepPostDelayedTriggeredAbility(new LoseControlOnOtherPlayersControllerEffect(this.getLogName(), player.getLogName()));
|
||||
ability.setSourceId(getId());
|
||||
ability.setControllerId(getId());
|
||||
game.addDelayedTriggeredAbility(ability);
|
||||
|
|
@ -1174,7 +1174,8 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
return useable;
|
||||
}
|
||||
|
||||
protected LinkedHashMap<UUID, ActivatedAbility> getUseableActivatedAbilities(MageObject object, Zone zone, Game game) {
|
||||
@Override
|
||||
public LinkedHashMap<UUID, ActivatedAbility> getUseableActivatedAbilities(MageObject object, Zone zone, Game game) {
|
||||
LinkedHashMap<UUID, ActivatedAbility> useable = new LinkedHashMap<>();
|
||||
if (!(object instanceof Permanent) || ((Permanent) object).canUseActivatedAbilities(game)) {
|
||||
for (Ability ability : object.getAbilities()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue