mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
- Show that the card was Exerted this turn in the card detail panel.
This commit is contained in:
@@ -6116,6 +6116,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
public void exert() {
|
public void exert() {
|
||||||
exertedByPlayer.add(getController());
|
exertedByPlayer.add(getController());
|
||||||
exertThisTurn++;
|
exertThisTurn++;
|
||||||
|
view.updateExertedThisTurn(this, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isExertedBy(final Player player) {
|
public boolean isExertedBy(final Player player) {
|
||||||
@@ -6124,6 +6125,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
|
|
||||||
public void removeExertedBy(final Player player) {
|
public void removeExertedBy(final Player player) {
|
||||||
exertedByPlayer.remove(player);
|
exertedByPlayer.remove(player);
|
||||||
|
view.updateExertedThisTurn(this, getExertedThisTurn() > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void resetExtertedThisTurn() {
|
protected void resetExtertedThisTurn() {
|
||||||
|
|||||||
@@ -139,6 +139,13 @@ public class CardView extends GameEntityView {
|
|||||||
set(TrackableProperty.Attacking, combat != null && combat.isAttacking(c));
|
set(TrackableProperty.Attacking, combat != null && combat.isAttacking(c));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isExertedThisTurn() {
|
||||||
|
return get(TrackableProperty.ExertedThisTurn);
|
||||||
|
}
|
||||||
|
void updateExertedThisTurn(Card c, boolean exerted) {
|
||||||
|
set(TrackableProperty.ExertedThisTurn, exerted);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isBlocking() {
|
public boolean isBlocking() {
|
||||||
return get(TrackableProperty.Blocking);
|
return get(TrackableProperty.Blocking);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ public enum TrackableProperty {
|
|||||||
CurrentState(TrackableTypes.CardStateViewType, false), //can't respect freeze, otherwise card constructor can crash
|
CurrentState(TrackableTypes.CardStateViewType, false), //can't respect freeze, otherwise card constructor can crash
|
||||||
AlternateState(TrackableTypes.CardStateViewType),
|
AlternateState(TrackableTypes.CardStateViewType),
|
||||||
HiddenId(TrackableTypes.IntegerType),
|
HiddenId(TrackableTypes.IntegerType),
|
||||||
|
ExertedThisTurn(TrackableTypes.BooleanType),
|
||||||
|
|
||||||
//Card State
|
//Card State
|
||||||
Name(TrackableTypes.StringType),
|
Name(TrackableTypes.StringType),
|
||||||
|
|||||||
@@ -532,6 +532,14 @@ public class CardDetailUtil {
|
|||||||
area.append("Must block " + mustBlockThese);
|
area.append("Must block " + mustBlockThese);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// exerted
|
||||||
|
if (card.isExertedThisTurn()) {
|
||||||
|
if (area.length() != 0) {
|
||||||
|
area.append("\n\n");
|
||||||
|
}
|
||||||
|
area.append("^Exerted^");
|
||||||
|
}
|
||||||
|
|
||||||
//show current card colors if enabled
|
//show current card colors if enabled
|
||||||
String curCardColors = formatCurrentCardColors(state);
|
String curCardColors = formatCurrentCardColors(state);
|
||||||
if (!curCardColors.isEmpty()) {
|
if (!curCardColors.isEmpty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user