This commit is contained in:
@@ -300,6 +300,10 @@
|
||||
"title": "Forethought",
|
||||
"image_path": "../../img/skins/heron/061.png"
|
||||
},
|
||||
"62": {
|
||||
"title": "Festival de Watanagashi",
|
||||
"image_path": "../../img/skins/heron/062.png"
|
||||
},
|
||||
"65": {
|
||||
"title": "Starlight Convergence",
|
||||
"image_path": "../../img/skins/heron/065.png"
|
||||
@@ -316,6 +320,10 @@
|
||||
"title": "Rosser",
|
||||
"image_path": "../../img/skins/heron/071.png"
|
||||
},
|
||||
"72": {
|
||||
"title": "Rakiie Swiftkick",
|
||||
"image_path": "../../img/skins/heron/072.png"
|
||||
},
|
||||
"73": {
|
||||
"title": "Trading Card",
|
||||
"image_path": "../../img/skins/heron/073.png"
|
||||
@@ -323,6 +331,14 @@
|
||||
"74": {
|
||||
"title": "Scout, Nain de DRG",
|
||||
"image_path": "../../img/skins/heron/074.png"
|
||||
},
|
||||
"84": {
|
||||
"title": "ULTRAKILL",
|
||||
"image_path": "../../img/skins/heron/084.png"
|
||||
},
|
||||
"85": {
|
||||
"title": "Ultralive",
|
||||
"image_path": "../../img/skins/heron/085.png"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,12 @@
|
||||
"champion":"Champion",
|
||||
"item": "Objet"
|
||||
},
|
||||
"colors":{
|
||||
"red": "rouge",
|
||||
"green": "verte",
|
||||
"blue": "bleu",
|
||||
"yellow": "jaune"
|
||||
},
|
||||
"numbers":{
|
||||
"1": "une",
|
||||
"2": "deux",
|
||||
@@ -23,9 +29,9 @@
|
||||
"restack_discarded_action":"Mettez une action de\nvotre défausse au dessus\nde votre pioche.",
|
||||
"make_discard":"L'adversaire ciblé%nse défausse d'une carte.",
|
||||
"draw_and_discard":"Vous pouvez piocher une carte, puis\n vous défausser d'une carte.",
|
||||
"draw_and_discard_times":"Vous pouvez piocher jusqu'à %a cartes,\ndéfaussez-vous ensuite d'autant de cartes",
|
||||
"draw_and_discard_times":"Vous pouvez piocher jusqu'à %a cartes,\ndéfaussez-vous ensuite d'autant de cartes.",
|
||||
"play_next_card_bought":"Mettez la prochaine carte dont\nvous faites l'acquisition ce tour-ci\n dans votre main.",
|
||||
"prepare":"Mobilisez un Champion",
|
||||
"prepare":"Mobilisez un Champion.",
|
||||
"prepare_all_champions":"Mobilisez vos Champions.",
|
||||
"prepare_another_champion":"Mobilisez un autre Champion.",
|
||||
"cheaper_champions_passive":"Les Champions que vous achetez ce tour-ci\nvous coûtent 1 de moins.",
|
||||
@@ -36,13 +42,18 @@
|
||||
"discard_x_and_draw_x":"Vous pouvez vous défausser de\nn'importe quel nombre de cartes\net en piocher autant."
|
||||
},
|
||||
"per":{
|
||||
"champion":"pour chaque Champion\nque vous avez en jeu",
|
||||
"other_champion":"pour chaque autre Champion\nque vous avez en jeu",
|
||||
"other_guard":"pour chaque autre\nGarde que vous avez en jeu",
|
||||
"other_card_of_same_faction":"pour chaque autre x\nque vous avez en jeu",
|
||||
"champion_of_same_faction":"pour chaque Champion x\nque vous avez en jeu",
|
||||
"other_knife_played":"pour chaque autre Couteau\nque vous avez en jeu",
|
||||
"stunned_champion": "pour chaque Champion\nassommé"
|
||||
"champion":"pour chaque Champion\nque vous avez en jeu.",
|
||||
"other_champion":"pour chaque autre\nChampion que vous avez\nen jeu.",
|
||||
"other_guard":"pour chaque autre\nGarde que vous avez en jeu.",
|
||||
"other_card_of_same_faction":"pour chaque autre\n carte %c que vous avez\nen jeu.",
|
||||
"champion_of_same_faction":"pour chaque \nChampion %c que vous\navez en jeu.",
|
||||
"other_knife_played":"pour chaque autre Couteau\nque vous avez en jeu.",
|
||||
"stunned_champion": "pour chaque Champion\nassommé ce tour-ci."
|
||||
},
|
||||
"per_effect":{
|
||||
"damage":"dégats",
|
||||
"heal":"PV",
|
||||
"gold":"$"
|
||||
}
|
||||
|
||||
}
|
||||
+43
-21
@@ -213,18 +213,19 @@ resourceIcons = {
|
||||
# return group
|
||||
|
||||
|
||||
def create_effect_text(effects: list[Effect], height: float, width: int, has_mutex: bool = False):
|
||||
def create_effect_text(card: Card, effects: list[Effect], height: float, width: int, has_mutex: bool = False):
|
||||
group = []
|
||||
|
||||
effect_text = ""
|
||||
|
||||
for [i, e] in enumerate(effects):
|
||||
print(effects)
|
||||
if effect_text != "":
|
||||
effect_text += " "
|
||||
per = e.get("per")
|
||||
if per is not None:
|
||||
translation = f"+ {e.get('amount', '1')} {translation_fr.get('per').get(per)}"
|
||||
print(e.get('effect'))
|
||||
translation = f"+ {e.get('amount', '1')} {translation_fr.get('per_effect').get(e.get('effect'))} {translation_fr.get('per').get(per)}"
|
||||
translation = translation.replace('%c', translation_fr.get('colors').get(card.get('faction'), card.get('faction')) + " ") # FIXME: card color is needed here
|
||||
elif e.get("amount", 1) > 1:
|
||||
translation = (
|
||||
translation_fr.get("effects")
|
||||
@@ -247,10 +248,18 @@ def create_effect_text(effects: list[Effect], height: float, width: int, has_mut
|
||||
translation = translation_fr.get("effects").get(
|
||||
e.get("effect"), e.get("effect")
|
||||
)
|
||||
print(e)
|
||||
|
||||
if len(effect_text) > 20:
|
||||
effect_text += "\n"
|
||||
effect_text += translation
|
||||
|
||||
# Handle sub_effects
|
||||
if (len(e.get('sub_effects', [])) > 0):
|
||||
effect_text += "\nSi vous le faites, gagnez:\n"
|
||||
for se in e.get('sub_effects'):
|
||||
effect_text += str(se) + "\n"
|
||||
|
||||
if has_mutex and i is not len(effects) - 1:
|
||||
effect_text += "\nou"
|
||||
|
||||
@@ -289,7 +298,7 @@ def create_effect_text(effects: list[Effect], height: float, width: int, has_mut
|
||||
return group
|
||||
|
||||
|
||||
def create_effect_row(effects: list[Effect], type: str, height: int, width: int):
|
||||
def create_effect_row(card: Card, effects: list[Effect], type: str, height: int, width: int):
|
||||
group = dw.Group(**{"class": "svg_effect"})
|
||||
has_icon = False
|
||||
if type == "faction_combo":
|
||||
@@ -385,7 +394,13 @@ def create_effect_row(effects: list[Effect], type: str, height: int, width: int)
|
||||
has_text_mutex = True
|
||||
group.append(
|
||||
dw.Group(
|
||||
create_effect_text(effect_with_text, text_height, text_width, has_mutex=has_text_mutex),
|
||||
create_effect_text(
|
||||
card=card,
|
||||
effects=effect_with_text,
|
||||
height=text_height,
|
||||
width=text_width,
|
||||
has_mutex=has_text_mutex
|
||||
),
|
||||
transform=f"translate({width / 2},{text_y_pos})",
|
||||
**{
|
||||
"class": "svg_effect",
|
||||
@@ -463,7 +478,7 @@ def generate_subeffect_index(effect: Effect):
|
||||
generate_subeffect_index(e)
|
||||
|
||||
|
||||
def create_effects(effects: list[Effect], height: int, width: int):
|
||||
def create_effects(card: Card, effects: list[Effect], height: int, width: int):
|
||||
for [i, e] in enumerate(effects):
|
||||
e["index"] = str(i)
|
||||
generate_subeffect_index(e)
|
||||
@@ -481,7 +496,11 @@ def create_effects(effects: list[Effect], height: int, width: int):
|
||||
if len(grouped_effects) == 1:
|
||||
group.append(
|
||||
create_effect_row(
|
||||
grouped_effects[effect_types[0]], effect_types[0], height, width
|
||||
card=card,
|
||||
effects=grouped_effects[effect_types[0]],
|
||||
type=effect_types[0],
|
||||
height=height,
|
||||
width=width
|
||||
),
|
||||
)
|
||||
if len(grouped_effects) == 2:
|
||||
@@ -490,7 +509,7 @@ def create_effects(effects: list[Effect], height: int, width: int):
|
||||
)
|
||||
group.append(
|
||||
create_effect_row(
|
||||
grouped_effects[effect_types[0]], effect_types[0], 80, width
|
||||
card=card, effects=grouped_effects[effect_types[0]], type=effect_types[0], height=80, width=width
|
||||
),
|
||||
)
|
||||
|
||||
@@ -498,10 +517,11 @@ def create_effects(effects: list[Effect], height: int, width: int):
|
||||
dw.Group(
|
||||
[
|
||||
create_effect_row(
|
||||
grouped_effects[effect_types[1]],
|
||||
effect_types[1],
|
||||
height - 80,
|
||||
width,
|
||||
card=card,
|
||||
effects=grouped_effects[effect_types[1]],
|
||||
type=effect_types[1],
|
||||
height=height - 80,
|
||||
width=width,
|
||||
)
|
||||
],
|
||||
transform=f"translate({0},{80})",
|
||||
@@ -517,7 +537,7 @@ def create_effects(effects: list[Effect], height: int, width: int):
|
||||
)
|
||||
group.append(
|
||||
create_effect_row(
|
||||
grouped_effects[effect_types[0]], effect_types[0], 45, width
|
||||
card=card, effects=grouped_effects[effect_types[0]], type=effect_types[0], height=45, width=width
|
||||
)
|
||||
)
|
||||
|
||||
@@ -525,10 +545,11 @@ def create_effects(effects: list[Effect], height: int, width: int):
|
||||
dw.Group(
|
||||
[
|
||||
create_effect_row(
|
||||
grouped_effects[effect_types[1]],
|
||||
effect_types[1],
|
||||
45,
|
||||
width,
|
||||
card=card,
|
||||
effects=grouped_effects[effect_types[1]],
|
||||
type=effect_types[1],
|
||||
height=45,
|
||||
width=width,
|
||||
)
|
||||
],
|
||||
transform=f"translate({0},{45})",
|
||||
@@ -539,10 +560,11 @@ def create_effects(effects: list[Effect], height: int, width: int):
|
||||
dw.Group(
|
||||
[
|
||||
create_effect_row(
|
||||
grouped_effects[effect_types[2]],
|
||||
effect_types[2],
|
||||
45,
|
||||
width,
|
||||
card=card,
|
||||
effects=grouped_effects[effect_types[2]],
|
||||
type=effect_types[2],
|
||||
height=45,
|
||||
width=width,
|
||||
)
|
||||
],
|
||||
transform=f"translate({0},{90})",
|
||||
|
||||
@@ -63,7 +63,7 @@ icon_colors = {
|
||||
}
|
||||
|
||||
fullscreen_card_ids = [
|
||||
56, 57, 58, 59
|
||||
56, 57, 58, 59, 84, 85
|
||||
]
|
||||
|
||||
|
||||
@@ -252,7 +252,7 @@ for card_data in cards:
|
||||
effects = card_data.get("effects")
|
||||
if effects is not None:
|
||||
effects_height = 265 if card_data['id'] not in fullscreen_card_ids else 220
|
||||
effects = create_effects(effects=effects, height=135, width=x_internal_width)
|
||||
effects = create_effects(card=card_data, effects=effects, height=135, width=x_internal_width)
|
||||
d.append(
|
||||
dw.Group(
|
||||
effects,
|
||||
|
||||
Reference in New Issue
Block a user