mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
GameAction notify of sector assignments
This commit is contained in:
@@ -1572,13 +1572,23 @@ public class GameAction {
|
|||||||
for (final Card c : p.getCreaturesInPlay().threadSafeIterable()) {
|
for (final Card c : p.getCreaturesInPlay().threadSafeIterable()) {
|
||||||
if (!c.hasSector()) {
|
if (!c.hasSector()) {
|
||||||
toAssign.add(c);
|
toAssign.add(c);
|
||||||
checkAgain = true;
|
if (!checkAgain) {
|
||||||
|
checkAgain = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final StringBuilder sb = new StringBuilder();
|
||||||
for (Card assignee : toAssign) { // probably would be nice for players to pick order of assigning?
|
for (Card assignee : toAssign) { // probably would be nice for players to pick order of assigning?
|
||||||
assignee.assignSector(p.getController().chooseSector(assignee, "Assign"));
|
String sector = p.getController().chooseSector(assignee, "Assign");
|
||||||
toAssign.remove(assignee);
|
assignee.assignSector(sector);
|
||||||
|
if (sb.length() == 0) {
|
||||||
|
sb.append(p).append(" assigns:\n");
|
||||||
|
}
|
||||||
|
sb.append(assignee).append(" ").append(sector).append("\n");
|
||||||
|
}
|
||||||
|
if (sb.length() > 0) {
|
||||||
|
notifyOfValue(null, p, sb.toString(), p);
|
||||||
}
|
}
|
||||||
|
|
||||||
return checkAgain;
|
return checkAgain;
|
||||||
@@ -1971,9 +1981,11 @@ public class GameAction {
|
|||||||
|
|
||||||
/** Delivers a message to all players. (use reveal to show Cards) */
|
/** Delivers a message to all players. (use reveal to show Cards) */
|
||||||
public void notifyOfValue(SpellAbility saSource, GameObject relatedTarget, String value, Player playerExcept) {
|
public void notifyOfValue(SpellAbility saSource, GameObject relatedTarget, String value, Player playerExcept) {
|
||||||
String name = CardTranslation.getTranslatedName(saSource.getHostCard().getName());
|
if (saSource != null) {
|
||||||
value = TextUtil.fastReplace(value, "CARDNAME", name);
|
String name = CardTranslation.getTranslatedName(saSource.getHostCard().getName());
|
||||||
value = TextUtil.fastReplace(value, "NICKNAME", Lang.getInstance().getNickName(name));
|
value = TextUtil.fastReplace(value, "CARDNAME", name);
|
||||||
|
value = TextUtil.fastReplace(value, "NICKNAME", Lang.getInstance().getNickName(name));
|
||||||
|
}
|
||||||
for (Player p : game.getPlayers()) {
|
for (Player p : game.getPlayers()) {
|
||||||
if (playerExcept == p) continue;
|
if (playerExcept == p) continue;
|
||||||
p.getController().notifyOfValue(saSource, relatedTarget, value);
|
p.getController().notifyOfValue(saSource, relatedTarget, value);
|
||||||
|
|||||||
Reference in New Issue
Block a user