diff --git a/data/cards.xlsx b/data/cards.xlsx index 0a58a23..8a4d3c7 100644 Binary files a/data/cards.xlsx and b/data/cards.xlsx differ diff --git a/graphics/bundled/graphics.svg b/graphics/bundled/graphics.svg deleted file mode 100644 index 92e90f4..0000000 --- a/graphics/bundled/graphics.svg +++ /dev/null @@ -1,2501 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/graphics/bundled/icones_bannieres.svg b/graphics/bundled/icones_bannieres.svg new file mode 100644 index 0000000..2737900 --- /dev/null +++ b/graphics/bundled/icones_bannieres.svg @@ -0,0 +1,8862 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + point de votecarte magouillecarte effetrobocaïneretournement de vestespin-doctorpropagandecampagne de comm' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ACTION + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CANDIDAT + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/generate_layouts.py b/scripts/generate_layouts.py index 6dd246a..783c7a2 100644 --- a/scripts/generate_layouts.py +++ b/scripts/generate_layouts.py @@ -20,22 +20,29 @@ ICON_MARGIN_TOP = 0 ICON_X = ICON_MARGIN_LEFT + SAFE_MARGIN ICON_Y = ICON_MARGIN_TOP + SAFE_MARGIN +# Ret Icon info +RET_ICON_SIZE = ICON_SIZE * 0.9 +RET_ICON_X = ICON_X + ((ICON_SIZE - RET_ICON_SIZE) / 2.) +RET_ICON_Y = ICON_Y + ICON_SIZE - 0.1 + + # Banner info BANNER_WIDTH = 2 BANNER_HEIGHT = 6 BANNER_X = ICON_X + ICON_SIZE + 0.3 BANNER_Y = 0 -BANNER_TEXT_FONT = "\"ethnocentric 12\"" +BANNER_TEXT_FONT = "\"ethnocentric 11\"" BANNER_TEXT_X = BANNER_X - 0.3 -BANNER_TEXT_Y = BANNER_HEIGHT / 3 +BANNER_TEXT_Y = BANNER_HEIGHT / 2.2 BANNER_TEXT_WIDTH = BANNER_WIDTH + 0.6 +BANNER_TEXT_MOD_T = BANNER_TEXT_Y + 0.2 # Name info NAME_X = ICON_X + ICON_SIZE NAME_Y = SAFE_MARGIN + 0.1 NAME_WIDTH = MAX_SAFE_X - NAME_X NAME_HEIGHT = 3.4 -NAME_FONT = "\"ethnocentric 11\"" +NAME_FONT = "\"ethnocentric 10\"" NAME_WITH_BANNER_X = BANNER_X + BANNER_WIDTH NAME_WITH_BANNER_WIDTH = NAME_WIDTH - (NAME_WITH_BANNER_X - NAME_X) @@ -45,6 +52,7 @@ def central_sym(x: int, y: int) -> Tuple[int, int]: # Alternative objects ALT_ICON_X, ALT_ICON_Y = central_sym(ICON_X, ICON_Y) +ALT_RET_ICON_X, ALT_RET_ICON_Y = central_sym(RET_ICON_X, RET_ICON_Y) ALT_BANNER_X, ALT_BANNER_Y = central_sym(BANNER_X, BANNER_Y) ALT_BANNER_TEXT_X, ALT_BANNER_TEXT_Y = central_sym(BANNER_TEXT_X, BANNER_TEXT_Y) @@ -52,7 +60,7 @@ ALT_BANNER_TEXT_X, ALT_BANNER_TEXT_Y = central_sym(BANNER_TEXT_X, BANNER_TEXT_Y) EFFECT_FRAME_WIDTH = SAFE_WIDTH - 2 EFFECT_FRAME_HEIGHT = 6 EFFECT_FRAME_RADIUS = 0.2 -EFFECT_FRAME_MARGIN_BOTTOM = 2 +EFFECT_FRAME_MARGIN_BOTTOM = 4.1 EFFECT_FRAME_X = (TOTAL_WIDTH - EFFECT_FRAME_WIDTH) / 2. EFFECT_FRAME_Y = MAX_SAFE_Y - EFFECT_FRAME_MARGIN_BOTTOM - EFFECT_FRAME_HEIGHT @@ -75,12 +83,24 @@ icon: width: {ICON_SIZE}c height: {ICON_SIZE}c +ret_icon: + x: {RET_ICON_X}c + y: {RET_ICON_Y}c + width: {RET_ICON_SIZE}c + height: {RET_ICON_SIZE}c + alt_icon: extends: icon x: {ALT_ICON_X}c y: {ALT_ICON_Y}c angle: 3.14159 +alt_ret_icon: + extends: ret_icon + x: {ALT_RET_ICON_X}c + y: {ALT_RET_ICON_Y}c + angle: 3.14159 + banner: x: {BANNER_X}c y: {BANNER_Y}c @@ -94,6 +114,7 @@ banner_text: height: 1c font: {BANNER_TEXT_FONT} align: center + color: '#fff' # hint: blue alt_banner: diff --git a/src/deck.rb b/src/deck.rb index 7d3a935..a494078 100644 --- a/src/deck.rb +++ b/src/deck.rb @@ -6,8 +6,32 @@ def icon_to_svg(icon) icon.nil? ? nil : "icone_#{icon}.svg" end +def ret_icon_to_svg(icon) + icon.nil? ? nil : "retourner_#{icon}.svg" +end + +def banner_text_layout(rank) + if rank.nil? + nil + elsif rank.start_with?('+') + "banniere_bonus.svg" + elsif rank.start_with?('-') + "banniere_malus.svg" + else + "banniere_rang.svg" + end +end + def rank_to_banner_svg(rank) - rank.nil? ? nil : (rank.start_with?('+') || rank.start_with?('-')) ? "banniere_mod.svg" : "banniere_rang.svg" + if rank.nil? + nil + elsif rank.start_with?('+') + "banniere_bonus.svg" + elsif rank.start_with?('-') + "banniere_malus.svg" + else + "banniere_rang.svg" + end end def embed_custom(embed, id) @@ -50,23 +74,30 @@ Squib::Deck.new( alt_icon_file = data['icone_alt'].map { |icon| icon_to_svg(icon) } svg file: alt_icon_file, layout: 'alt_icon' + ret_icon_file = data['icone_alt'].map { |icon| ret_icon_to_svg(icon) } + svg file: ret_icon_file, layout: 'ret_icon' + + alt_ret_icon_file = data['icone'].zip(data['icone_alt']).map { |icon, alt_icon| alt_icon.nil? ? nil : ret_icon_to_svg(icon) } + svg file: alt_ret_icon_file, layout: 'alt_ret_icon' + + alt_banner_file = data['rang_alt'].map { |rank| rank_to_banner_svg(rank) } svg file: alt_banner_file, layout: 'alt_banner' text str: data['rang_alt'], layout: 'alt_banner_text' - fill_color = data['effet'].map { |effet| effet.nil? ? '#0000': '#f5f5f5ff' } - stroke_color = data['effet'].map { |effet| effet.nil? ? '#0000': '#bb98' } + fill_color = data['effet'].map { |effet| effet.nil? ? '#0000': '#f7f7f7ff' } + stroke_color = data['effet'].map { |effet| effet.nil? ? '#0000': '#cca9' } rect layout: 'effect_frame', fill_color: fill_color, stroke_color: stroke_color text(str: data['effet'], layout: 'effect_text') do |embed| embed_custom(embed, 'effet') embed_custom(embed, 'magouille') embed_custom(embed, 'pv') - embed_custom(embed, 'icone_ind') - embed_custom(embed, 'icone_gau') - embed_custom(embed, 'icone_roy') - embed_custom(embed, 'icone_ana') - embed_custom(embed, 'icone_dro') - embed_custom(embed, 'icone_eco') + embed_custom(embed, 'symbole_ind') + embed_custom(embed, 'symbole_gau') + embed_custom(embed, 'symbole_roy') + embed_custom(embed, 'symbole_ana') + embed_custom(embed, 'symbole_dro') + embed_custom(embed, 'symbole_eco') end build :debug do