mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-14 01:38:13 +00:00
Merge pull request #1285 from tool4ever/viewPT
CardView: display expected P/T for unanimated vehicles
This commit is contained in:
@@ -1247,12 +1247,17 @@ public class CardView extends GameEntityView {
|
||||
return get(TrackableProperty.Power);
|
||||
}
|
||||
void updatePower(Card c) {
|
||||
if (c.getCurrentState().getView() == this || c.getAlternateState() == null) {
|
||||
set(TrackableProperty.Power, c.getNetPower());
|
||||
int num;
|
||||
if (getType().hasSubtype("Vehicle") && !isCreature()) {
|
||||
// use printed value so user can still see it
|
||||
num = c.getCurrentPower();
|
||||
} else {
|
||||
num = c.getNetPower();
|
||||
}
|
||||
else {
|
||||
set(TrackableProperty.Power, c.getNetPower() - c.getBasePower() + c.getAlternateState().getBasePower());
|
||||
if (c.getCurrentState().getView() != this && c.getAlternateState() != null) {
|
||||
num -= c.getBasePower() + c.getAlternateState().getBasePower();
|
||||
}
|
||||
set(TrackableProperty.Power, num);
|
||||
}
|
||||
void updatePower(CardState c) {
|
||||
Card card = c.getCard();
|
||||
@@ -1267,12 +1272,17 @@ public class CardView extends GameEntityView {
|
||||
return get(TrackableProperty.Toughness);
|
||||
}
|
||||
void updateToughness(Card c) {
|
||||
if (c.getCurrentState().getView() == this || c.getAlternateState() == null) {
|
||||
set(TrackableProperty.Toughness, c.getNetToughness());
|
||||
int num;
|
||||
if (getType().hasSubtype("Vehicle") && !isCreature()) {
|
||||
// use printed value so user can still see it
|
||||
num = c.getCurrentToughness();
|
||||
} else {
|
||||
num = c.getNetToughness();
|
||||
}
|
||||
else {
|
||||
set(TrackableProperty.Toughness, c.getNetToughness() - c.getBaseToughness() + c.getAlternateState().getBaseToughness());
|
||||
if (c.getCurrentState().getView() != this && c.getAlternateState() != null) {
|
||||
num -= c.getBaseToughness() + c.getAlternateState().getBaseToughness();
|
||||
}
|
||||
set(TrackableProperty.Toughness, num);
|
||||
}
|
||||
void updateToughness(CardState c) {
|
||||
Card card = c.getCard();
|
||||
|
||||
Reference in New Issue
Block a user