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
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ describe("mana-source selection wire types", () => {
},
},
{ OnlyForSpellWithColorCount: { comparator: "EQ", count: 2 } },
{ OnlyForSpellColor: "Red" },
{
OnlyForSpellFromZone: {
zone: "Hand",
Expand All @@ -48,6 +49,7 @@ describe("mana-source selection wire types", () => {
],
},
{ OnlyForSpecialAction: "UnlockDoor" },
"Impossible",
"ConvokePayment",
];
const action: GameAction = {
Expand Down
2 changes: 1 addition & 1 deletion client/src/adapter/generated/interaction/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export type InteractionManaSpecialAction = "companionToHand" | "unlockDoor" | "p

export type InteractionManaSpellCostCriterion = { "type": "manaValue", "data": { comparator: InteractionManaComparator, value: number, } } | { "type": "hasXInCost" };

export type InteractionManaRestriction = { "type": "onlyForSpell" } | { "type": "onlyForSpellType", "data": { spellType: string, } } | { "type": "onlyForCreatureType", "data": { creatureType: string, } } | { "type": "onlyForTypeSpellsOrAbilities", "data": { spellType: string, ability: InteractionManaAbilityActivationScope, } } | { "type": "onlyForActivation" } | { "type": "onlyForTaggedActivation", "data": { tag: string, } } | { "type": "onlyForXCosts" } | { "type": "onlyForSpellWithKeywordKind", "data": { keyword: string, } } | { "type": "onlyForSpellWithKeywordKindFromZone", "data": { keyword: string, zone: InteractionZoneCode, } } | { "type": "onlyForSpellWithManaValue", "data": { comparator: InteractionManaComparator, value: number, } } | { "type": "onlyForSpellMatchingCostCriteria", "data": { spellType: string | null, criteria: Array<InteractionManaSpellCostCriterion>, } } | { "type": "onlyForSpellWithColorCount", "data": { comparator: InteractionManaComparator, count: number, } } | { "type": "onlyForSpellFromZone", "data": { zone: InteractionZoneCode, polarity: InteractionManaZoneSpendPolarity, } } | { "type": "onlyForFaceDownSpell" } | { "type": "onlyForAny", "data": { restrictions: Array<InteractionManaRestriction>, } } | { "type": "onlyForSpecialAction", "data": { action: InteractionManaSpecialAction, } } | { "type": "convokePayment" };
export type InteractionManaRestriction = { "type": "onlyForSpell" } | { "type": "onlyForSpellType", "data": { spellType: string, } } | { "type": "onlyForCreatureType", "data": { creatureType: string, } } | { "type": "onlyForTypeSpellsOrAbilities", "data": { spellType: string, ability: InteractionManaAbilityActivationScope, } } | { "type": "onlyForActivation" } | { "type": "onlyForTaggedActivation", "data": { tag: string, } } | { "type": "onlyForXCosts" } | { "type": "onlyForSpellWithKeywordKind", "data": { keyword: string, } } | { "type": "onlyForSpellWithKeywordKindFromZone", "data": { keyword: string, zone: InteractionZoneCode, } } | { "type": "onlyForSpellWithManaValue", "data": { comparator: InteractionManaComparator, value: number, } } | { "type": "onlyForSpellMatchingCostCriteria", "data": { spellType: string | null, criteria: Array<InteractionManaSpellCostCriterion>, } } | { "type": "onlyForSpellWithColorCount", "data": { comparator: InteractionManaComparator, count: number, } } | { "type": "onlyForSpellColor", "data": { color: InteractionManaColor, } } | { "type": "onlyForSpellFromZone", "data": { zone: InteractionZoneCode, polarity: InteractionManaZoneSpendPolarity, } } | { "type": "onlyForFaceDownSpell" } | { "type": "onlyForAny", "data": { restrictions: Array<InteractionManaRestriction>, } } | { "type": "onlyForSpecialAction", "data": { action: InteractionManaSpecialAction, } } | { "type": "impossible" } | { "type": "convokePayment" };

export type InteractionObjectProperty = { "type": "power" } | { "type": "toughness" } | { "type": "manaValue" } | { "type": "manaSymbolCount", "data": { color: InteractionManaColor, } };

Expand Down
4 changes: 4 additions & 0 deletions client/src/adapter/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,8 @@ export type ManaRestriction =
count: number;
};
}
// "Spend this mana only to cast spells of the source's chosen color."
| { OnlyForSpellColor: ManaColor }
// "Spend this mana only to cast a spell from, or not from, the named zone."
| { OnlyForSpellFromZone: ZoneSpend }
// "Spend this mana only to cast a face-down spell."
Expand All @@ -571,6 +573,8 @@ export type ManaRestriction =
| { OnlyForAny: ManaRestriction[] }
// "Spend this mana only on the named special action."
| { OnlyForSpecialAction: SpecialAction }
// A source-dependent restriction could not resolve its required choice.
| "Impossible"
// Internal convoke-tap marker — never surfaced to the player.
| "ConvokePayment";

Expand Down
4 changes: 4 additions & 0 deletions client/src/i18n/locales/de/game.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,12 +510,14 @@
"onlyForSpellWithManaValue": "Nur zum Wirken von Zaubersprüchen ausgeben, die eine Anforderung an den Manabetrag erfüllen",
"onlyForSpellMatchingCostCriteria": "Nur zum Wirken von Zaubersprüchen ausgeben, die eine Kostenanforderung erfüllen",
"onlyForSpellWithColorCount": "Nur zum Wirken von Zaubersprüchen ausgeben, die eine Anforderung an die Anzahl der Farben erfüllen",
"onlyForSpellColor": "Nur zum Wirken von Zaubersprüchen der gewählten Farbe ausgeben",
"onlyForSpellFromZone": "Nur zum Wirken von Zaubersprüchen aus einer erlaubten Zone ausgeben",
"onlyForFaceDownSpell": "Nur zum Wirken verdeckter Zaubersprüche ausgeben",
"onlyForActivation": "Nur zum Aktivieren von Fähigkeiten ausgeben",
"onlyForXCosts": "Nur für Kosten ausgeben, die {X} enthalten",
"onlyForAny": "Nur für eine der aufgeführten Verwendungen ausgeben",
"onlyForSpecialAction": "Nur für eine bestimmte Sonderaktion ausgeben",
"impossible": "Dieses Mana kann nicht ausgegeben werden",
"convokePayment": "Beschwörbeitrag-Bezahlung",
"grantsProperty": "Verleiht dem Zauberspruch eine Eigenschaft",
"grantCantBeCountered": "Für diesen Zauberspruch ausgeben, damit er nicht neutralisiert werden kann"
Expand Down Expand Up @@ -1029,10 +1031,12 @@
"manaValueCriterion": "Manawert {{comparator}} {{value}}",
"hasXInCostCriterion": "ein X in ihren Kosten",
"onlyForSpellWithColorCount": "Nur für Zaubersprüche mit {{comparator}} {{count}} Farben.",
"onlyForSpellColor": "Nur für Zaubersprüche der Farbe {{color}}.",
"onlyForSpellFromZone": "Nur für Zaubersprüche {{polarity}} {{zone}}.",
"onlyForFaceDownSpell": "Nur für verdeckte Zaubersprüche.",
"onlyForAny": "Nur für eine dieser Verwendungen: {{restrictions}}",
"onlyForSpecialAction": "Nur für die Sonderaktion {{action}}.",
"impossible": "Dieses Mana kann nicht ausgegeben werden.",
"convokePayment": "Nur für diese Einberufen-Zahlung.",
"anySpell": "beliebige"
},
Expand Down
4 changes: 4 additions & 0 deletions client/src/i18n/locales/en/game.json
Original file line number Diff line number Diff line change
Expand Up @@ -542,12 +542,14 @@
"onlyForSpellWithManaValue": "Spend only to cast spells meeting a mana-value requirement",
"onlyForSpellMatchingCostCriteria": "Spend only to cast spells meeting a cost requirement",
"onlyForSpellWithColorCount": "Spend only to cast spells meeting a color-count requirement",
"onlyForSpellColor": "Spend only to cast spells of the chosen color",
"onlyForSpellFromZone": "Spend only to cast spells from an allowed zone",
"onlyForFaceDownSpell": "Spend only to cast face-down spells",
"onlyForActivation": "Spend only to activate abilities",
"onlyForXCosts": "Spend only on costs that include {X}",
"onlyForAny": "Spend only on one of the listed uses",
"onlyForSpecialAction": "Spend only on a specific special action",
"impossible": "This mana can't be spent",
"convokePayment": "Convoke payment",
"grantsProperty": "Grants a property to the spell",
"grantCantBeCountered": "Spend on this spell to make it uncounterable"
Expand Down Expand Up @@ -1061,10 +1063,12 @@
"manaValueCriterion": "mana value {{comparator}} {{value}}",
"hasXInCostCriterion": "an X in their cost",
"onlyForSpellWithColorCount": "Only for spells with {{comparator}} {{count}} colors.",
"onlyForSpellColor": "Only for spells of the {{color}} color.",
"onlyForSpellFromZone": "Only for spells {{polarity}} {{zone}}.",
"onlyForFaceDownSpell": "Only for face-down spells.",
"onlyForAny": "Only for one of these uses: {{restrictions}}",
"onlyForSpecialAction": "Only for the {{action}} special action.",
"impossible": "This mana can't be spent.",
"convokePayment": "Only for this convoke payment.",
"anySpell": "any"
},
Expand Down
4 changes: 4 additions & 0 deletions client/src/i18n/locales/es/game.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,12 +510,14 @@
"onlyForSpellWithManaValue": "Gastar solo para lanzar hechizos que cumplan un requisito de valor de maná",
"onlyForSpellMatchingCostCriteria": "Gastar solo para lanzar hechizos que cumplan un requisito de coste",
"onlyForSpellWithColorCount": "Gastar solo para lanzar hechizos que cumplan un requisito de cantidad de colores",
"onlyForSpellColor": "Gastar solo para lanzar hechizos del color elegido",
"onlyForSpellFromZone": "Gastar solo para lanzar hechizos desde una zona permitida",
"onlyForFaceDownSpell": "Gastar solo para lanzar hechizos boca abajo",
"onlyForActivation": "Gastar solo para activar habilidades",
"onlyForXCosts": "Gastar solo en costes que incluyan {X}",
"onlyForAny": "Gastar solo en uno de los usos indicados",
"onlyForSpecialAction": "Gastar solo en una acción especial específica",
"impossible": "Este maná no se puede gastar",
"convokePayment": "Pago de convocar",
"grantsProperty": "Otorga una propiedad al hechizo",
"grantCantBeCountered": "Gástalo en este hechizo para que no se pueda contrarrestar"
Expand Down Expand Up @@ -1029,10 +1031,12 @@
"manaValueCriterion": "valor de maná {{comparator}} {{value}}",
"hasXInCostCriterion": "una X en su coste",
"onlyForSpellWithColorCount": "Solo para hechizos con {{comparator}} {{count}} colores.",
"onlyForSpellColor": "Solo para hechizos del color {{color}}.",
"onlyForSpellFromZone": "Solo para hechizos {{polarity}} {{zone}}.",
"onlyForFaceDownSpell": "Solo para hechizos boca abajo.",
"onlyForAny": "Solo para uno de estos usos: {{restrictions}}",
"onlyForSpecialAction": "Solo para la acción especial {{action}}.",
"impossible": "Este maná no se puede gastar.",
"convokePayment": "Solo para este pago de convocar.",
"anySpell": "cualquiera"
},
Expand Down
4 changes: 4 additions & 0 deletions client/src/i18n/locales/fr/game.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,12 +510,14 @@
"onlyForSpellWithManaValue": "À dépenser uniquement pour lancer des sorts répondant à une condition de valeur de mana",
"onlyForSpellMatchingCostCriteria": "À dépenser uniquement pour lancer des sorts répondant à une condition de coût",
"onlyForSpellWithColorCount": "À dépenser uniquement pour lancer des sorts répondant à une condition de nombre de couleurs",
"onlyForSpellColor": "À dépenser uniquement pour lancer des sorts de la couleur choisie",
"onlyForSpellFromZone": "À dépenser uniquement pour lancer des sorts depuis une zone autorisée",
"onlyForFaceDownSpell": "À dépenser uniquement pour lancer des sorts face cachée",
"onlyForActivation": "À dépenser uniquement pour activer des capacités",
"onlyForXCosts": "À dépenser uniquement pour des coûts incluant {X}",
"onlyForAny": "À dépenser uniquement pour l'une des utilisations indiquées",
"onlyForSpecialAction": "À dépenser uniquement pour une action spéciale spécifique",
"impossible": "Ce mana ne peut pas être dépensé",
"convokePayment": "Paiement de la convocation",
"grantsProperty": "Accorde une propriété au sort",
"grantCantBeCountered": "À dépenser pour ce sort afin qu'il ne puisse pas être contrecarré"
Expand Down Expand Up @@ -1029,10 +1031,12 @@
"manaValueCriterion": "valeur de mana {{comparator}} {{value}}",
"hasXInCostCriterion": "un X dans leur coût",
"onlyForSpellWithColorCount": "Uniquement pour les sorts avec {{comparator}} {{count}} couleurs.",
"onlyForSpellColor": "Uniquement pour les sorts de la couleur {{color}}.",
"onlyForSpellFromZone": "Uniquement pour les sorts {{polarity}} {{zone}}.",
"onlyForFaceDownSpell": "Uniquement pour les sorts face cachée.",
"onlyForAny": "Uniquement pour l'un de ces usages : {{restrictions}}",
"onlyForSpecialAction": "Uniquement pour l'action spéciale {{action}}.",
"impossible": "Ce mana ne peut pas être dépensé.",
"convokePayment": "Uniquement pour ce paiement de convocation.",
"anySpell": "n'importe quel"
},
Expand Down
4 changes: 4 additions & 0 deletions client/src/i18n/locales/it/game.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,12 +510,14 @@
"onlyForSpellWithManaValue": "Spendi solo per lanciare magie che soddisfano un requisito di valore di mana",
"onlyForSpellMatchingCostCriteria": "Spendi solo per lanciare magie che soddisfano un requisito di costo",
"onlyForSpellWithColorCount": "Spendi solo per lanciare magie che soddisfano un requisito sul numero di colori",
"onlyForSpellColor": "Spendi solo per lanciare magie del colore scelto",
"onlyForSpellFromZone": "Spendi solo per lanciare magie da una zona consentita",
"onlyForFaceDownSpell": "Spendi solo per lanciare magie a faccia in giù",
"onlyForActivation": "Spendi solo per attivare abilità",
"onlyForXCosts": "Spendi solo su costi che includono {X}",
"onlyForAny": "Spendi solo per uno degli usi elencati",
"onlyForSpecialAction": "Spendi solo per un'azione speciale specifica",
"impossible": "Questo mana non può essere speso",
"convokePayment": "Pagamento di Convocare",
"grantsProperty": "Concede una proprietà alla magia",
"grantCantBeCountered": "Spendi per questa magia per renderla impossibile da neutralizzare"
Expand Down Expand Up @@ -1029,10 +1031,12 @@
"manaValueCriterion": "valore di mana {{comparator}} {{value}}",
"hasXInCostCriterion": "una X nel loro costo",
"onlyForSpellWithColorCount": "Solo per magie con {{comparator}} {{count}} colori.",
"onlyForSpellColor": "Solo per magie del colore {{color}}.",
"onlyForSpellFromZone": "Solo per magie {{polarity}} {{zone}}.",
"onlyForFaceDownSpell": "Solo per magie a faccia in giù.",
"onlyForAny": "Solo per uno di questi usi: {{restrictions}}",
"onlyForSpecialAction": "Solo per l'azione speciale {{action}}.",
"impossible": "Questo mana non può essere speso.",
"convokePayment": "Solo per questo pagamento di convocazione.",
"anySpell": "qualsiasi"
},
Expand Down
4 changes: 4 additions & 0 deletions client/src/i18n/locales/pl/game.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,12 +510,14 @@
"onlyForSpellWithManaValue": "Wydaj tylko na rzucanie czarów spełniających wymaganie wartości many",
"onlyForSpellMatchingCostCriteria": "Wydaj tylko na rzucanie czarów spełniających wymaganie kosztu",
"onlyForSpellWithColorCount": "Wydaj tylko na rzucanie czarów spełniających wymaganie liczby kolorów",
"onlyForSpellColor": "Wydaj tylko na rzucanie czarów wybranego koloru",
"onlyForSpellFromZone": "Wydaj tylko na rzucanie czarów z dozwolonej strefy",
"onlyForFaceDownSpell": "Wydaj tylko na rzucanie zakrytych czarów",
"onlyForActivation": "Wydaj tylko na aktywowanie zdolności",
"onlyForXCosts": "Wydaj tylko na koszty zawierające {X}",
"onlyForAny": "Wydaj tylko na jedno z wymienionych zastosowań",
"onlyForSpecialAction": "Wydaj tylko na określoną akcję specjalną",
"impossible": "Ta mana nie może zostać wydana",
"convokePayment": "Płatność Convoke",
"grantsProperty": "Nadaje czarowi właściwość",
"grantCantBeCountered": "Wydaj na ten czar, aby nie można było go skontrować"
Expand Down Expand Up @@ -1029,10 +1031,12 @@
"manaValueCriterion": "wartość many {{comparator}} {{value}}",
"hasXInCostCriterion": "X w ich koszcie",
"onlyForSpellWithColorCount": "Tylko na czary z {{comparator}} {{count}} kolorami.",
"onlyForSpellColor": "Tylko na czary w kolorze {{color}}.",
"onlyForSpellFromZone": "Tylko na czary {{polarity}} {{zone}}.",
"onlyForFaceDownSpell": "Tylko na czary zakryte.",
"onlyForAny": "Tylko do jednego z tych zastosowań: {{restrictions}}",
"onlyForSpecialAction": "Tylko do specjalnej akcji {{action}}.",
"impossible": "Ta mana nie może zostać wydana.",
"convokePayment": "Tylko do tej płatności konwokacji.",
"anySpell": "dowolny"
},
Expand Down
4 changes: 4 additions & 0 deletions client/src/i18n/locales/pt/game.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,12 +510,14 @@
"onlyForSpellWithManaValue": "Gaste apenas para conjurar mágicas que atendam a um requisito de valor de mana",
"onlyForSpellMatchingCostCriteria": "Gaste apenas para conjurar mágicas que atendam a um requisito de custo",
"onlyForSpellWithColorCount": "Gaste apenas para conjurar mágicas que atendam a um requisito de quantidade de cores",
"onlyForSpellColor": "Gaste este mana apenas para conjurar mágicas da cor escolhida",
"onlyForSpellFromZone": "Gaste apenas para conjurar mágicas a partir de uma zona permitida",
"onlyForFaceDownSpell": "Gaste apenas para conjurar mágicas com a face voltada para baixo",
"onlyForActivation": "Gaste apenas para ativar habilidades",
"onlyForXCosts": "Gaste apenas em custos que incluam {X}",
"onlyForAny": "Gaste apenas em um dos usos listados",
"onlyForSpecialAction": "Gaste apenas em uma ação especial específica",
"impossible": "Este mana não pode ser gasto",
"convokePayment": "Pagamento de convocação",
"grantsProperty": "Concede uma propriedade à mágica",
"grantCantBeCountered": "Gaste nesta mágica para que ela não possa ser anulada"
Expand Down Expand Up @@ -1029,10 +1031,12 @@
"manaValueCriterion": "valor de mana {{comparator}} {{value}}",
"hasXInCostCriterion": "um X em seu custo",
"onlyForSpellWithColorCount": "Apenas para mágicas com {{comparator}} {{count}} cores.",
"onlyForSpellColor": "Apenas para mágicas da cor {{color}}.",
"onlyForSpellFromZone": "Apenas para mágicas {{polarity}} {{zone}}.",
"onlyForFaceDownSpell": "Apenas para mágicas viradas para baixo.",
"onlyForAny": "Apenas para um destes usos: {{restrictions}}",
"onlyForSpecialAction": "Apenas para a ação especial {{action}}.",
"impossible": "Este mana não pode ser gasto.",
"convokePayment": "Apenas para este pagamento de convocar.",
"anySpell": "qualquer"
},
Expand Down
4 changes: 4 additions & 0 deletions client/src/pages/GamePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2898,6 +2898,8 @@ export function manaRestrictionLabel(
});
case "onlyForSpellWithColorCount":
return t("gamePage.manaRestrictions.onlyForSpellWithColorCount", restriction.data);
case "onlyForSpellColor":
return t("gamePage.manaRestrictions.onlyForSpellColor", restriction.data);
case "onlyForSpellFromZone":
return t("gamePage.manaRestrictions.onlyForSpellFromZone", restriction.data);
case "onlyForFaceDownSpell":
Expand All @@ -2910,6 +2912,8 @@ export function manaRestrictionLabel(
});
case "onlyForSpecialAction":
return t("gamePage.manaRestrictions.onlyForSpecialAction", restriction.data);
case "impossible":
return t("gamePage.manaRestrictions.impossible");
case "convokePayment":
return t("gamePage.manaRestrictions.convokePayment");
}
Expand Down
2 changes: 2 additions & 0 deletions client/src/viewmodel/manaPoolGroups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ export const RESTRICTION_LABEL_KEYS: Record<ManaRestrictionTag, string> = {
OnlyForSpellWithManaValue: "manaPool.onlyForSpellWithManaValue",
OnlyForSpellMatchingCostCriteria: "manaPool.onlyForSpellMatchingCostCriteria",
OnlyForSpellWithColorCount: "manaPool.onlyForSpellWithColorCount",
OnlyForSpellColor: "manaPool.onlyForSpellColor",
OnlyForSpellFromZone: "manaPool.onlyForSpellFromZone",
OnlyForFaceDownSpell: "manaPool.onlyForFaceDownSpell",
OnlyForActivation: "manaPool.onlyForActivation",
OnlyForXCosts: "manaPool.onlyForXCosts",
OnlyForAny: "manaPool.onlyForAny",
OnlyForSpecialAction: "manaPool.onlyForSpecialAction",
Impossible: "manaPool.impossible",
ConvokePayment: "manaPool.convokePayment",
};

Expand Down
3 changes: 2 additions & 1 deletion crates/engine/src/ai_support/candidates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2127,7 +2127,7 @@ pub fn candidate_actions_broad_with_probe(
*player,
pending_cast.object_id,
cost,
pending_cast.ability.context.ability_tag,
pending_cast.activation_ability_index,
)
})
.map(|(i, _)| {
Expand Down Expand Up @@ -4041,6 +4041,7 @@ pub(crate) fn priority_actions_with_probe(
state,
player,
*ninjutsu_object_id,
None,
cost,
);
if !can_afford {
Expand Down
Loading
Loading