mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Merge branch 'counters' into 'master'
CountersPutEffect allow to handle multiple Defined See merge request core-developers/forge!6345
This commit is contained in:
@@ -69,19 +69,26 @@ public class CountersPutEffect extends SpellAbilityEffect {
|
|||||||
stringBuilder.append("up to ");
|
stringBuilder.append("up to ");
|
||||||
}
|
}
|
||||||
|
|
||||||
String type = spellAbility.getParam("CounterType");
|
final String typeName = CounterType.getType(spellAbility.getParam("CounterType")).getName().toLowerCase();
|
||||||
if (amount == 1) {
|
stringBuilder.append(Lang.nounWithNumeralExceptOne(amount,
|
||||||
stringBuilder.append(Lang.startsWithVowel(type) ? "an " : "a ");
|
typeName + " counter"));
|
||||||
} else {
|
stringBuilder.append(divAsChoose || spellAbility.hasParam("DividedRandomly")
|
||||||
stringBuilder.append(Lang.getNumeral(amount)).append(" ");
|
|
||||||
}
|
|
||||||
|
|
||||||
stringBuilder.append(CounterType.getType(type).getName().toLowerCase()).append(" counter");
|
|
||||||
stringBuilder.append(amount != 1 ? "s" : "").append(divAsChoose || spellAbility.hasParam("DividedRandomly")
|
|
||||||
? " among " : " on ");
|
? " among " : " on ");
|
||||||
|
|
||||||
|
// special handling for multiple Defined
|
||||||
|
if (spellAbility.hasParam("Defined") && spellAbility.getParam("Defined").contains(" & ")) {
|
||||||
|
String[] def = spellAbility.getParam("Defined").split(" & ");
|
||||||
|
for (int i = 0; i < def.length; i++) {
|
||||||
|
stringBuilder.append(AbilityUtils.getDefinedEntities(card, def[i],
|
||||||
|
spellAbility).toString().replaceAll("[\\[\\]]",""));
|
||||||
|
if (i + 1 < def.length) {
|
||||||
|
stringBuilder.append(" and ");
|
||||||
|
stringBuilder.append(Lang.nounWithNumeralExceptOne(amount,
|
||||||
|
typeName + " counter")).append(" on ");
|
||||||
|
}
|
||||||
|
}
|
||||||
// if use targeting we show all targets and corresponding counters
|
// if use targeting we show all targets and corresponding counters
|
||||||
if(spellAbility.usesTargeting()) {
|
} else if (spellAbility.usesTargeting()) {
|
||||||
final List<Card> targetCards = SpellAbilityEffect.getTargetCards(spellAbility);
|
final List<Card> targetCards = SpellAbilityEffect.getTargetCards(spellAbility);
|
||||||
for(int i = 0; i < targetCards.size(); i++) {
|
for(int i = 0; i < targetCards.size(); i++) {
|
||||||
Card targetCard = targetCards.get(i);
|
Card targetCard = targetCards.get(i);
|
||||||
@@ -182,7 +189,13 @@ public class CountersPutEffect extends SpellAbilityEffect {
|
|||||||
sa.hasParam("ChoiceOptional"), params));
|
sa.hasParam("ChoiceOptional"), params));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tgtObjects.addAll(getDefinedEntitiesOrTargeted(sa, "Defined"));
|
if (sa.hasParam("Defined") && sa.getParam("Defined").contains(" & ")) {
|
||||||
|
for (String def : sa.getParam("Defined").split(" & ")) {
|
||||||
|
tgtObjects.addAll(AbilityUtils.getDefinedEntities(card, def, sa));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
tgtObjects.addAll(getDefinedEntitiesOrTargeted(sa, "Defined"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sa.hasParam("Optional") && !pc.confirmAction
|
if (sa.hasParam("Optional") && !pc.confirmAction
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ ManaCost:3 G W
|
|||||||
Types:Creature Human Knight Ranger
|
Types:Creature Human Knight Ranger
|
||||||
PT:2/4
|
PT:2/4
|
||||||
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Creature.Other+YouCtrl | TriggerZones$ Battlefield | Execute$ TrigPutCounter | TriggerDescription$ Whenever another creature enters the battlefield under your control, put a +1/+1 counter on that creature and a +1/+1 counter on CARDNAME.
|
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Creature.Other+YouCtrl | TriggerZones$ Battlefield | Execute$ TrigPutCounter | TriggerDescription$ Whenever another creature enters the battlefield under your control, put a +1/+1 counter on that creature and a +1/+1 counter on CARDNAME.
|
||||||
SVar:TrigPutCounter:DB$ PutCounter | Defined$ TriggeredCardLKICopy | CounterType$ P1P1 | CounterNum$ 1 | SubAbility$ DBPutCounter
|
SVar:TrigPutCounter:DB$ PutCounter | Defined$ TriggeredCardLKICopy & Self | CounterType$ P1P1
|
||||||
SVar:DBPutCounter:DB$ PutCounter | Defined$ Self.StrictlySelf | CounterType$ P1P1 | CounterNum$ 1
|
|
||||||
SVar:BuffedBy:Creature
|
SVar:BuffedBy:Creature
|
||||||
|
DeckHas:Ability$Counters
|
||||||
Oracle:Whenever another creature enters the battlefield under your control, put a +1/+1 counter on that creature and a +1/+1 counter on Juniper Order Ranger.
|
Oracle:Whenever another creature enters the battlefield under your control, put a +1/+1 counter on that creature and a +1/+1 counter on Juniper Order Ranger.
|
||||||
|
|||||||
@@ -2,6 +2,5 @@ Name:Serrated Biskelion
|
|||||||
ManaCost:3
|
ManaCost:3
|
||||||
Types:Artifact Creature Construct
|
Types:Artifact Creature Construct
|
||||||
PT:2/2
|
PT:2/2
|
||||||
A:AB$ PutCounter | Cost$ T | ValidTgts$ Creature | TgtPrompt$ Select target creature | CounterType$ M1M1 | CounterNum$ 1 | SubAbility$ DBPutCounter | IsCurse$ True | SpellDescription$ Put a -1/-1 counter on target creature and a -1/-1 counter on CARDNAME.
|
A:AB$ PutCounter | Cost$ T | Defined$ Self & Targeted | ValidTgts$ Creature | TgtPrompt$ Select target creature | CounterType$ M1M1 | IsCurse$ True | SpellDescription$ Put a -1/-1 counter on target creature and a -1/-1 counter on CARDNAME.
|
||||||
SVar:DBPutCounter:DB$ PutCounter | CounterType$ M1M1 | CounterNum$ 1
|
|
||||||
Oracle:{T}: Put a -1/-1 counter on Serrated Biskelion and a -1/-1 counter on target creature.
|
Oracle:{T}: Put a -1/-1 counter on Serrated Biskelion and a -1/-1 counter on target creature.
|
||||||
|
|||||||
Reference in New Issue
Block a user