feat : account for draw amount 2

This commit is contained in:
2024-07-01 10:07:26 +02:00
parent 3b31918704
commit 3eb1cfc9c2
5 changed files with 23 additions and 5 deletions
+1 -1
View File
@@ -22,7 +22,7 @@
<text x="0" y="9" font-size="24" text-anchor="middle" fill="black" font-weight="bold" font-family="Helvetica">6</text> <text x="0" y="9" font-size="24" text-anchor="middle" fill="black" font-weight="bold" font-family="Helvetica">6</text>
</g> </g>
<g id="d1"> <g id="d1">
<text x="137.0" y="26.0" font-size="14" text-anchor="middle" fill="black" font-family="Helvetica">Piochez une carte.</text> <text x="137.0" y="26.0" font-size="14" text-anchor="middle" fill="black" font-family="Helvetica">Piochez deux cartes.</text>
</g> </g>
<g id="d2"> <g id="d2">
<circle cx="0" cy="0" r="15.0" fill="green" x="0" y="0" /> <circle cx="0" cy="0" r="15.0" fill="green" x="0" y="0" />

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

+1 -1
View File
@@ -30,7 +30,7 @@
<text x="0" y="9" font-size="24" text-anchor="middle" fill="white" font-weight="bold" font-family="Helvetica">5</text> <text x="0" y="9" font-size="24" text-anchor="middle" fill="white" font-weight="bold" font-family="Helvetica">5</text>
</g> </g>
<g id="d3"> <g id="d3">
<text x="137.0" y="70.66666666666667" font-size="14" text-anchor="middle" fill="black" font-family="Helvetica">Piochez une carte.</text> <text x="137.0" y="70.66666666666667" font-size="14" text-anchor="middle" fill="black" font-family="Helvetica">Piochez deux cartes.</text>
<use xlink:href="#d1" x="107.0" y="33.0" /> <use xlink:href="#d1" x="107.0" y="33.0" />
<use xlink:href="#d2" x="167.0" y="33.0" /> <use xlink:href="#d2" x="167.0" y="33.0" />
</g> </g>

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

+1
View File
@@ -6,6 +6,7 @@ from typing import TypedDict
class Translation(TypedDict): class Translation(TypedDict):
card_type: dict[str, str] card_type: dict[str, str]
effects: dict[str, str] effects: dict[str, str]
numbers: dict[str, str]
@dataclass @dataclass
+5
View File
@@ -3,8 +3,13 @@
"action":"Action", "action":"Action",
"champion":"Champion" "champion":"Champion"
}, },
"numbers":{
"1": "une",
"2": "deux"
},
"effects":{ "effects":{
"draw":"Piochez une carte.", "draw":"Piochez une carte.",
"draw_n":"Piochez %a cartes.",
"stun":"Assomez le champion ciblé.", "stun":"Assomez le champion ciblé.",
"stack_next_card_bought":"Mettez la prochaine carte dont vous faites l'acquisition\nau dessus de votre pioche.", "stack_next_card_bought":"Mettez la prochaine carte dont vous faites l'acquisition\nau dessus de votre pioche.",
"sacrifice":"Vous pouvez sacrifier une carte de votre main ou de votre défausse.", "sacrifice":"Vous pouvez sacrifier une carte de votre main ou de votre défausse.",
+15 -3
View File
@@ -202,9 +202,21 @@ def create_effect_row(effects: list[Effect], type: str, height: int, width: int)
for e in effect_with_text: for e in effect_with_text:
if effect_text != "": if effect_text != "":
effect_text += " " effect_text += " "
translation = translation_fr.get("effects").get(
e.get("effect"), e.get("effect") if e.get("amount", 1) > 1:
)
translation = (
translation_fr.get("effects")
.get(e.get("effect") + "_n", e.get("effect"))
.replace(
"%a",
str(translation_fr.get("numbers").get(str(e.get("amount", "")))),
)
)
else:
translation = translation_fr.get("effects").get(
e.get("effect"), e.get("effect")
)
effect_text += translation effect_text += translation
group.append( group.append(