MKC: prisoners_dilemma + support (#4860)

This commit is contained in:
Northmoc
2024-03-23 04:42:04 -04:00
committed by GitHub
parent 6757ffdc56
commit 34f2fa846d
10 changed files with 36 additions and 9 deletions

View File

@@ -19,6 +19,7 @@ import forge.game.player.Player;
import forge.game.spellability.SpellAbility; import forge.game.spellability.SpellAbility;
import forge.util.Aggregates; import forge.util.Aggregates;
import forge.util.Lang; import forge.util.Lang;
import forge.util.Localizer;
public class ChooseGenericEffect extends SpellAbilityEffect { public class ChooseGenericEffect extends SpellAbilityEffect {
@@ -49,6 +50,8 @@ public class ChooseGenericEffect extends SpellAbilityEffect {
final int amount = AbilityUtils.calculateAmount(host, sa.getParamOrDefault("ChoiceAmount", "1"), sa); final int amount = AbilityUtils.calculateAmount(host, sa.getParamOrDefault("ChoiceAmount", "1"), sa);
final boolean tempRem = sa.hasParam("TempRemember"); final boolean tempRem = sa.hasParam("TempRemember");
final boolean secretly = sa.hasParam("Secretly");
final StringBuilder record = new StringBuilder();
final boolean changeZoneTable = sa.hasParam("ChangeZoneTable"); final boolean changeZoneTable = sa.hasParam("ChangeZoneTable");
final boolean damageMap = sa.hasParam("DamageMap"); final boolean damageMap = sa.hasParam("DamageMap");
@@ -113,6 +116,10 @@ public class ChooseGenericEffect extends SpellAbilityEffect {
if (sa.hasParam("ShowChoice")) { if (sa.hasParam("ShowChoice")) {
boolean dontNotifySelf = sa.getParam("ShowChoice").equals("ExceptSelf"); boolean dontNotifySelf = sa.getParam("ShowChoice").equals("ExceptSelf");
game.getAction().notifyOfValue(sa, p, chosenValue, dontNotifySelf ? p : null); game.getAction().notifyOfValue(sa, p, chosenValue, dontNotifySelf ? p : null);
} else if (secretly) {
if (record.length() > 0) record.append("\r\n");
record.append(Localizer.getInstance().getMessage("lblPlayerChooseValue", p, chosenValue));
} }
if (sa.hasParam("SetChosenMode")) { if (sa.hasParam("SetChosenMode")) {
sa.getHostCard().setChosenMode(chosenValue); sa.getHostCard().setChosenMode(chosenValue);
@@ -137,6 +144,9 @@ public class ChooseGenericEffect extends SpellAbilityEffect {
host.addRemembered(oldRem); host.addRemembered(oldRem);
} }
} }
if (secretly) {
game.getAction().notifyOfValue(sa, host, record.toString(), null);
}
if (damageMap) game.getAction().dealDamage(false, sa.getDamageMap(), sa.getPreventMap(), if (damageMap) game.getAction().dealDamage(false, sa.getDamageMap(), sa.getPreventMap(),
sa.getCounterTable(), sa); sa.getCounterTable(), sa);
if (changeZoneTable) { if (changeZoneTable) {

View File

@@ -57,7 +57,8 @@ public class VoteEffect extends SpellAbilityEffect {
final Card host = sa.getHostCard(); final Card host = sa.getHostCard();
final Game game = host.getGame(); final Game game = host.getGame();
final Player activator = sa.getActivatingPlayer(); final Player activator = sa.getActivatingPlayer();
final boolean secret = sa.hasParam("Secret");
final boolean secret = sa.hasParam("Secretly");
final boolean other = sa.hasParam("VotePlayer") & sa.getParam("VotePlayer").equals("Other"); final boolean other = sa.hasParam("VotePlayer") & sa.getParam("VotePlayer").equals("Other");
final StringBuilder record = new StringBuilder(); final StringBuilder record = new StringBuilder();

View File

@@ -63,7 +63,8 @@ public class MessageUtil {
? Localizer.getInstance().getMessage("lblPlayerFlipComesUpValue", Lang.getInstance().getPossesive(flipper), value) ? Localizer.getInstance().getMessage("lblPlayerFlipComesUpValue", Lang.getInstance().getPossesive(flipper), value)
: Localizer.getInstance().getMessage("lblPlayerActionFlip", flipper, Lang.joinVerb(flipper, value)); : Localizer.getInstance().getMessage("lblPlayerActionFlip", flipper, Lang.joinVerb(flipper, value));
case GenericChoice: case GenericChoice:
if (sa.hasParam("ShowChoice") && sa.getParam("ShowChoice").equals("Description")) { if ((sa.hasParam("Secretly")) ||
(sa.hasParam("ShowChoice") && sa.getParam("ShowChoice").equals("Description"))) {
return value; return value;
} }
case Protection: case Protection:
@@ -73,7 +74,7 @@ public class MessageUtil {
case PutCounter:// For Clay Golem cost text case PutCounter:// For Clay Golem cost text
return value; return value;
case Vote: case Vote:
if (sa.hasParam("Secret")) { if (sa.hasParam("Secretly")) {
return value; return value;
} else { } else {
String chooser = StringUtils.capitalize(mayBeYou(player, target)); String chooser = StringUtils.capitalize(mayBeYou(player, target));

View File

@@ -5,7 +5,7 @@ PT:3/4
K:Vigilance K:Vigilance
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigVote | TriggerDescription$ Secret council — Whenever CARDNAME enters the battlefield or attacks, each player secretly votes for a player, then those votes are revealed. Each player draws a card for each vote they received. Each player who received no votes may put a permanent card from their hand onto the battlefield. T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigVote | TriggerDescription$ Secret council — Whenever CARDNAME enters the battlefield or attacks, each player secretly votes for a player, then those votes are revealed. Each player draws a card for each vote they received. Each player who received no votes may put a permanent card from their hand onto the battlefield.
T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigVote | Secondary$ True | TriggerZones$ Battlefield | TriggerDescription$ Secret council — Whenever CARDNAME enters the battlefield or attacks, each player secretly votes for a player, then those votes are revealed. Each player draws a card for each vote they received. Each player who received no votes may put a permanent card from their hand onto the battlefield. T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigVote | Secondary$ True | TriggerZones$ Battlefield | TriggerDescription$ Secret council — Whenever CARDNAME enters the battlefield or attacks, each player secretly votes for a player, then those votes are revealed. Each player draws a card for each vote they received. Each player who received no votes may put a permanent card from their hand onto the battlefield.
SVar:TrigVote:DB$ Vote | Defined$ Player | Secret$ True | VotePlayer$ Player | StoreVoteNum$ True | SubAbility$ DBRepeatDraw SVar:TrigVote:DB$ Vote | Defined$ Player | Secretly$ True | VotePlayer$ Player | StoreVoteNum$ True | SubAbility$ DBRepeatDraw
SVar:DBRepeatDraw:DB$ RepeatEach | RepeatPlayers$ Player | RepeatSubAbility$ DBDraw | AmountFromVotes$ True | SubAbility$ DBRepeatPut SVar:DBRepeatDraw:DB$ RepeatEach | RepeatPlayers$ Player | RepeatSubAbility$ DBDraw | AmountFromVotes$ True | SubAbility$ DBRepeatPut
SVar:DBDraw:DB$ Draw | Defined$ Remembered | NumCards$ Votes SVar:DBDraw:DB$ Draw | Defined$ Remembered | NumCards$ Votes
SVar:DBRepeatPut:DB$ RepeatEach | RepeatPlayers$ Player | RepeatSubAbility$ DBChangeZone | AmountFromVotes$ True | SubAbility$ DBChangeZone SVar:DBRepeatPut:DB$ RepeatEach | RepeatPlayers$ Player | RepeatSubAbility$ DBChangeZone | AmountFromVotes$ True | SubAbility$ DBChangeZone

View File

@@ -3,7 +3,7 @@ ManaCost:3 G U
Types:Legendary Creature Elf Noble Types:Legendary Creature Elf Noble
PT:3/3 PT:3/3
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigVote | TriggerDescription$ Secret council — When CARDNAME enters the battlefield, each player secretly votes for fellowship or aid, then those votes are revealed. For each fellowship vote, the voter chooses a creature they control. You gain control of each creature chosen this way, and they gain "This creature can't attack its owner." Then for each aid vote, put a +1/+1 counter on each creature you control. T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigVote | TriggerDescription$ Secret council — When CARDNAME enters the battlefield, each player secretly votes for fellowship or aid, then those votes are revealed. For each fellowship vote, the voter chooses a creature they control. You gain control of each creature chosen this way, and they gain "This creature can't attack its owner." Then for each aid vote, put a +1/+1 counter on each creature you control.
SVar:TrigVote:DB$ Vote | Defined$ Player | Secret$ True | VoteType$ Fellowship,Aid | VoteFellowship$ Fellowship | VoteAid$ AidPlus | EachVote$ True | SubAbility$ DBGainControl SVar:TrigVote:DB$ Vote | Defined$ Player | Secretly$ True | VoteType$ Fellowship,Aid | VoteFellowship$ Fellowship | VoteAid$ AidPlus | EachVote$ True | SubAbility$ DBGainControl
SVar:Fellowship:DB$ ChooseCard | Defined$ Remembered | Amount$ 1 | Choices$ Creature.RememberedPlayerCtrl | ChoiceTitle$ Choose a creature you control | ImprintChosen$ True | Mandatory$ True SVar:Fellowship:DB$ ChooseCard | Defined$ Remembered | Amount$ 1 | Choices$ Creature.RememberedPlayerCtrl | ChoiceTitle$ Choose a creature you control | ImprintChosen$ True | Mandatory$ True
SVar:AidPlus:DB$ StoreSVar | SVar$ Aid | Type$ CountSVar | Expression$ Aid/Plus.1 SVar:AidPlus:DB$ StoreSVar | SVar$ Aid | Type$ CountSVar | Expression$ Aid/Plus.1
SVar:DBGainControl:DB$ GainControl | Defined$ Imprinted | NewController$ You | SubAbility$ DBAnimate SVar:DBGainControl:DB$ GainControl | Defined$ Imprinted | NewController$ You | SubAbility$ DBAnimate

View File

@@ -0,0 +1,15 @@
Name:Prisoner's Dilemma
ManaCost:3 R R
Types:Sorcery
A:SP$ GenericChoice | Defined$ Opponent | TempRemember$ Chooser | Secretly$ True | Choices$ Silence,Snitch | SubAbility$ DBSilenceBranch | StackDescription$ SpellDescription | SpellDescription$ Each opponent secretly chooses silence or snitch, then the choices are revealed. If each opponent chose silence, CARDNAME deals 4 damage to each of them. If each opponent chose snitch, CARDNAME deals 8 damage to each of them. Otherwise, CARDNAME deals 12 damage to each opponent who chose silence.
SVar:Silence:DB$ Pump | Defined$ Remembered | NoteCards$ Self | NoteCardsFor$ Silence | SpellDescription$ Silence
SVar:Snitch:DB$ Pump | Defined$ Remembered | NoteCards$ Self | NoteCardsFor$ Snitch | SpellDescription$ Snitch
SVar:DBSilenceBranch:DB$ Branch | BranchConditionSVar$ PlayerCountPropertyOpponents$HasPropertyNotedForSilence | BranchConditionSVarCompare$ EQPlayerCountOpponents$Amount | TrueSubAbility$ Damage4 | FalseSubAbility$ DBSnitchBranch
SVar:DBSnitchBranch:DB$ Branch | BranchConditionSVar$ PlayerCountPropertyOpponents$HasPropertyNotedForSnitch | BranchConditionSVarCompare$ EQPlayerCountOpponents$Amount | TrueSubAbility$ Damage8 | FalseSubAbility$ Damage12
SVar:Damage4:DB$ DealDamage | Defined$ Opponent | NumDmg$ 4 | SubAbility$ DBCleanup
SVar:Damage8:DB$ DealDamage | Defined$ Opponent | NumDmg$ 8 | SubAbility$ DBCleanup
SVar:Damage12:DB$ DealDamage | Defined$ Opponent.NotedForSilence | NumDmg$ 12 | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Pump | Defined$ Player | ClearNotedCardsFor$ Silence,Snitch
K:Flashback:5 R R
DeckHas:Ability$Graveyard
Oracle:Each opponent secretly chooses silence or snitch, then the choices are revealed. If each opponent chose silence, Prisoner's Dilemma deals 4 damage to each of them. If each opponent chose snitch, Prisoner's Dilemma deals 8 damage to each of them. Otherwise, Prisoner's Dilemma deals 12 damage to each opponent who chose silence.\nFlashback {5}{R}{R}

View File

@@ -1,7 +1,7 @@
Name:Trap the Trespassers Name:Trap the Trespassers
ManaCost:2 U ManaCost:2 U
Types:Instant Types:Instant
A:SP$ Vote | Defined$ Player | Secret$ True | StoreVoteNum$ True | VoteCard$ Creature.YouDontCtrl | RememberVotedObjects$ True | AILogic$ Judgment | SubAbility$ DBRepeatStun | StackDescription$ SpellDescription | SpellDescription$ Secret council — Each player secretly votes for a creature you don't control, then those votes are revealed. A:SP$ Vote | Defined$ Player | Secretly$ True | StoreVoteNum$ True | VoteCard$ Creature.YouDontCtrl | RememberVotedObjects$ True | AILogic$ Judgment | SubAbility$ DBRepeatStun | StackDescription$ SpellDescription | SpellDescription$ Secret council — Each player secretly votes for a creature you don't control, then those votes are revealed.
SVar:DBRepeatStun:DB$ RepeatEach | UseImprinted$ True | DefinedCards$ Remembered | RepeatSubAbility$ DBPutCounter | AmountFromVotes$ True | SubAbility$ DBCleanup | SpellDescription$ For each creature with one or more votes, put that many stun counters on it, then tap it. (If a permanent with a stun counter would become untapped, remove one from it instead.) SVar:DBRepeatStun:DB$ RepeatEach | UseImprinted$ True | DefinedCards$ Remembered | RepeatSubAbility$ DBPutCounter | AmountFromVotes$ True | SubAbility$ DBCleanup | SpellDescription$ For each creature with one or more votes, put that many stun counters on it, then tap it. (If a permanent with a stun counter would become untapped, remove one from it instead.)
SVar:DBPutCounter:DB$ PutCounter | Defined$ Imprinted | CounterType$ STUN | CounterNum$ Votes | SubAbility$ DBTap SVar:DBPutCounter:DB$ PutCounter | Defined$ Imprinted | CounterType$ STUN | CounterNum$ Votes | SubAbility$ DBTap
SVar:DBTap:DB$ Tap | Defined$ Imprinted SVar:DBTap:DB$ Tap | Defined$ Imprinted

View File

@@ -1,7 +1,7 @@
Name:Truth or Consequences Name:Truth or Consequences
ManaCost:2 U R ManaCost:2 U R
Types:Sorcery Types:Sorcery
A:SP$ Vote | Defined$ Player | Secret$ True | VoteType$ Truth,Consequences | StoreVoteNum$ True | SubAbility$ DBDraw | SpellDescription$ Secret council — Each player secretly votes for truth or consequences, then those votes are revealed. You draw cards equal to the number of truth votes. Then choose an opponent at random. CARDNAME deals 3 damage to that player for each consequences vote. A:SP$ Vote | Defined$ Player | Secretly$ True | VoteType$ Truth,Consequences | StoreVoteNum$ True | SubAbility$ DBDraw | SpellDescription$ Secret council — Each player secretly votes for truth or consequences, then those votes are revealed. You draw cards equal to the number of truth votes. Then choose an opponent at random. CARDNAME deals 3 damage to that player for each consequences vote.
SVar:DBDraw:DB$ Draw | NumCards$ VoteNumTruth | SubAbility$ DBChoose SVar:DBDraw:DB$ Draw | NumCards$ VoteNumTruth | SubAbility$ DBChoose
SVar:DBChoose:DB$ ChoosePlayer | Defined$ You | Choices$ Opponent | Random$ True | SubAbility$ DBDamage SVar:DBChoose:DB$ ChoosePlayer | Defined$ You | Choices$ Opponent | Random$ True | SubAbility$ DBDamage
SVar:DBDamage:DB$ DealDamage | Defined$ ChosenPlayer | NumDmg$ X SVar:DBDamage:DB$ DealDamage | Defined$ ChosenPlayer | NumDmg$ X

View File

@@ -4,7 +4,7 @@ Types:Enchantment Saga
K:Chapter:3:DBToken,DBVote,DBVote K:Chapter:3:DBToken,DBVote,DBVote
SVar:DBToken:DB$ Token | TokenAmount$ OneEach | TokenScript$ w_1_1_human_soldier SVar:DBToken:DB$ Token | TokenAmount$ OneEach | TokenScript$ w_1_1_human_soldier
SVar:OneEach:PlayerCountOpponents$Amount SVar:OneEach:PlayerCountOpponents$Amount
SVar:DBVote:DB$ Vote | Defined$ Player | Secret$ True | VoteCard$ Creature | VoteMessage$ for a creature | UpTo$ True | VoteSubAbility$ DBDestroyAll | SubAbility$ DBBranch | SpellDescription$ Each player secretly votes for up to one creature, then those votes are revealed. If no creature got votes, each player draws a card. Otherwise, destroy each creature with the most votes or tied for most votes. SVar:DBVote:DB$ Vote | Defined$ Player | Secretly$ True | VoteCard$ Creature | VoteMessage$ for a creature | UpTo$ True | VoteSubAbility$ DBDestroyAll | SubAbility$ DBBranch | SpellDescription$ Each player secretly votes for up to one creature, then those votes are revealed. If no creature got votes, each player draws a card. Otherwise, destroy each creature with the most votes or tied for most votes.
SVar:DBDestroyAll:DB$ DestroyAll | ValidCards$ Creature.IsRemembered | SubAbility$ DBDraw SVar:DBDestroyAll:DB$ DestroyAll | ValidCards$ Creature.IsRemembered | SubAbility$ DBDraw
SVar:DBDraw:DB$ Draw | Defined$ Player | NumCards$ 1 | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ0 SVar:DBDraw:DB$ Draw | Defined$ Player | NumCards$ 1 | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ0
SVar:X:Remembered$Amount SVar:X:Remembered$Amount

View File

@@ -2261,7 +2261,7 @@ lblRandomTypeChosen=Randomly chosen type: {0}
lblPlayerChooseValueOfEffectOfCard={0} chose {1} for effect of {2} lblPlayerChooseValueOfEffectOfCard={0} chose {1} for effect of {2}
lblPlayerFlipComesUpValue={0} flip comes up {1} lblPlayerFlipComesUpValue={0} flip comes up {1}
lblPlayerActionFlip={0} {1} the flip lblPlayerActionFlip={0} {1} the flip
lblPlayerChooseValue={0} choose {1} lblPlayerChooseValue={0} chose {1}
lblPlayerVoteValue={0} vote {1} lblPlayerVoteValue={0} vote {1}
lblCardEffectValueIs={0} effect''s value is {1} lblCardEffectValueIs={0} effect''s value is {1}
lblCardEffectToTargetValueIs={0} effect''s value for {1} is {2} lblCardEffectToTargetValueIs={0} effect''s value for {1} is {2}