Merge branch 'newBranch' into 'master'

[Mobile] Don't stack token creature with different PT

See merge request core-developers/forge!3281
This commit is contained in:
Michael Kamensky
2020-10-21 04:04:19 +00:00
2 changed files with 8 additions and 0 deletions

View File

@@ -253,6 +253,13 @@ public class CardView extends GameEntityView {
} }
return counters.equals(otherCard.getCounters()); return counters.equals(otherCard.getCounters());
} }
public boolean hasSamePT(CardView otherCard) {
if (getCurrentState().getPower() != otherCard.getCurrentState().getPower())
return false;
if (getCurrentState().getToughness() != otherCard.getCurrentState().getToughness())
return false;
return true;
}
void updateCounters(Card c) { void updateCounters(Card c) {
set(TrackableProperty.Counters, c.getCounters()); set(TrackableProperty.Counters, c.getCounters());
updateLethalDamage(c); updateLethalDamage(c);

View File

@@ -114,6 +114,7 @@ public class VField extends FContainer {
if (!c.hasCardAttachments() && if (!c.hasCardAttachments() &&
cardName.equals(c.getCurrentState().getName()) && cardName.equals(c.getCurrentState().getName()) &&
card.hasSameCounters(c) && card.hasSameCounters(c) &&
card.hasSamePT(c) && //don't stack token with different PT
card.getCurrentState().getKeywordKey().equals(c.getCurrentState().getKeywordKey()) && card.getCurrentState().getKeywordKey().equals(c.getCurrentState().getKeywordKey()) &&
card.isTapped() == c.isTapped() && // don't stack tapped tokens on untapped tokens card.isTapped() == c.isTapped() && // don't stack tapped tokens on untapped tokens
card.isSick() == c.isSick() && //don't stack sick tokens on non sick card.isSick() == c.isSick() && //don't stack sick tokens on non sick