mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
minor: player can be attacked only if it is in the defenders list
This commit is contained in:
@@ -96,8 +96,10 @@ public class InputAttack extends InputBase {
|
||||
|
||||
@Override
|
||||
public void selectPlayer(Player selected) {
|
||||
if(player.isOpponentOf(selected))
|
||||
if(defenders.contains(selected))
|
||||
setCurrentDefender(selected);
|
||||
else
|
||||
SDisplayUtil.remind(VMessage.SINGLETON_INSTANCE); // cannot attack that player
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@@ -144,7 +146,7 @@ public class InputAttack extends InputBase {
|
||||
SDisplayUtil.remind(VMessage.SINGLETON_INSTANCE);
|
||||
}
|
||||
} // selectCard()
|
||||
|
||||
|
||||
private final void setCurrentDefender(GameEntity def) {
|
||||
Set<MyObservable> toUpdate = new HashSet<MyObservable>();
|
||||
currentDefender = def;
|
||||
@@ -159,7 +161,8 @@ public class InputAttack extends InputBase {
|
||||
}
|
||||
}
|
||||
|
||||
showMessage("Declare Attackers.\nSelecting Creatures to Attack " + currentDefender + "\n\nTo attack other players or their planewalkers just click on them");
|
||||
showMessage("Declare Attackers.\nSelecting Creatures to Attack " + currentDefender +
|
||||
"\n\nTo attack other players or their planewalkers just click on them");
|
||||
|
||||
// This will instantly highlight targets
|
||||
for(MyObservable updateable : toUpdate) {
|
||||
|
||||
Reference in New Issue
Block a user