Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions forge-game/src/main/java/forge/game/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,7 @@ public void onPlayerLost(Player p) {
}

final Map<AbilityKey, Object> runParams = AbilityKey.mapFromPlayer(p);
runParams.put(AbilityKey.LastStateBattlefield, triggerList.getLastStateBattlefield());
getTriggerHandler().runTrigger(TriggerType.LosesGame, runParams, false);

getTriggerHandler().onPlayerLost(p);
Expand Down
3 changes: 1 addition & 2 deletions forge-game/src/main/java/forge/game/card/CardProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -1472,8 +1472,7 @@ else if (prop.isEmpty() && dmgSource.equalsWithGameTimestamp(source)) {
if (!card.hasCounters()) {
return false;
}
}
else if (property.startsWith("counters")) {
} else if (property.startsWith("counters")) {
// syntax example: counters_GE9_P1P1 or counters_LT12_TIME
final String[] splitProperty = property.split("_");
final String strNum = splitProperty[1].substring(2);
Expand Down
2 changes: 2 additions & 0 deletions forge-game/src/main/java/forge/game/card/CounterEnumType.java
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,8 @@ public enum CounterEnumType implements CounterType {

// Player Counters

CONTRACT("CTRCT", CounterAiCategory.Neutral),

ENERGY("ENRGY", CounterAiCategory.Positive),

EXPERIENCE("EXP", CounterAiCategory.Positive),
Expand Down
10 changes: 10 additions & 0 deletions forge-game/src/main/java/forge/game/player/PlayerProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import forge.game.card.CardCollectionView;
import forge.game.card.CardLists;
import forge.game.card.CardPredicates;
import forge.game.card.CounterType;
import forge.game.spellability.SpellAbility;
import forge.game.zone.ZoneType;
import forge.util.Expressions;
Expand Down Expand Up @@ -497,6 +498,15 @@ else if (kind.startsWith("Type")) {
}
}
return false;
} else if (property.startsWith("counters")) {
final String[] splitProperty = property.split("_");
final String strNum = splitProperty[1].substring(2);
final String comparator = splitProperty[1].substring(0, 2);
final int number = AbilityUtils.calculateAmount(source, strNum, spellAbility);
final int actualNumber = player.getCounters(CounterType.getType(splitProperty[2]));
if (!Expressions.compare(actualNumber, comparator, number)) {
return false;
}
} else {
// could print error msg for unknown property here, though it'd need to check that it's not "Any" case
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public final boolean performTest(final Map<AbilityKey, Object> runParams) {
/** {@inheritDoc} */
@Override
public final void setTriggeringObjects(final SpellAbility sa, Map<AbilityKey, Object> runParams) {
sa.setTriggeringObjectsFrom(runParams, AbilityKey.Player);
sa.setTriggeringObjectsFrom(runParams, AbilityKey.Player, AbilityKey.LastStateBattlefield);
}

@Override
Expand Down
14 changes: 14 additions & 0 deletions forge-gui/res/cardsfolder/upcoming/miss_highwater.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Name:Miss Highwater
ManaCost:2 B B
Types:Legendary Creature Demon Advisor
PT:5/3
K:Menace
T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player.counters_EQ0_Contract | CombatDamage$ True | Execute$ TrigDraw | TriggerDescription$ Whenever CARDNAME deals combat damage to a player who doesn't have a contract counter, they may discard their hand. If they do, they draw seven cards and get a contract counter. For as long as they have a contract counter, when they lose the game, for each artifact and creature they controlled, create a token that's a copy of it.
SVar:TrigDraw:DB$ Draw | Defined$ TriggeredTarget | NumCards$ 7 | UnlessCost$ Discard<1/Hand> | UnlessPayer$ TriggeredTarget | UnlessSwitched$ True | UnlessResolveSubs$ WhenPaid | SubAbility$ DBPutCounter
SVar:DBPutCounter:DB$ PutCounter | Defined$ TriggeredTarget | CounterType$ Contract | CounterNum$ 1 | SubAbility$ DBEffect
SVar:DBEffect:DB$ Effect | RememberObjects$ TriggeredTarget | Triggers$ LoseGameTrigger,ExileEffect | Duration$ Permanent
SVar:LoseGameTrigger:Mode$ LosesGame | ValidPlayer$ Player.IsRemembered | Execute$ TrigCopy | TriggerDescription$ When that player loses the game, for each artifact and creature they controlled, create a token that's a copy of it.
SVar:TrigCopy:DB$ CopyPermanent | Defined$ TriggeredLastStateBattlefieldLKICopy.Creature+ControlledBy TriggeredPlayer,Artifact+ControlledBy TriggeredPlayer
SVar:ExileEffect:Mode$ Always | TriggerZones$ Battlefield | CheckDefinedPlayer$ Player.IsRemembered+counters_EQ0_Contract | Execute$ RemoveEffect | Static$ True
SVar:RemoveEffect:DB$ ChangeZone | Origin$ Command | Destination$ Exile | Defined$ Self
Oracle:Menace\nWhenever Miss Highwater deals combat damage to a player who doesn't have a contract counter, they may discard their hand. If they do, they draw seven cards and get a contract counter. For as long as they have a contract counter, when they lose the game, for each artifact and creature they controlled, create a token that's a copy of it.
Loading