mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +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
|
@Override
|
||||||
public void selectPlayer(Player selected) {
|
public void selectPlayer(Player selected) {
|
||||||
if(player.isOpponentOf(selected))
|
if(defenders.contains(selected))
|
||||||
setCurrentDefender(selected);
|
setCurrentDefender(selected);
|
||||||
|
else
|
||||||
|
SDisplayUtil.remind(VMessage.SINGLETON_INSTANCE); // cannot attack that player
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@@ -144,7 +146,7 @@ public class InputAttack extends InputBase {
|
|||||||
SDisplayUtil.remind(VMessage.SINGLETON_INSTANCE);
|
SDisplayUtil.remind(VMessage.SINGLETON_INSTANCE);
|
||||||
}
|
}
|
||||||
} // selectCard()
|
} // selectCard()
|
||||||
|
|
||||||
private final void setCurrentDefender(GameEntity def) {
|
private final void setCurrentDefender(GameEntity def) {
|
||||||
Set<MyObservable> toUpdate = new HashSet<MyObservable>();
|
Set<MyObservable> toUpdate = new HashSet<MyObservable>();
|
||||||
currentDefender = def;
|
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
|
// This will instantly highlight targets
|
||||||
for(MyObservable updateable : toUpdate) {
|
for(MyObservable updateable : toUpdate) {
|
||||||
|
|||||||
Reference in New Issue
Block a user