1
0

Compare commits

..

6 Commits

Author SHA1 Message Date
Ninjananas
34046c39a2 Écraser un peu les rangs 2025-06-15 18:38:29 +02:00
Ninjananas
10995f3dc8 Plein de modifs 2025-06-15 18:33:04 +02:00
Ninjananas
f1e68f55cd Add forgotten libraries in Squib 2025-05-25 18:33:15 +02:00
Ninjananas
82ec5b5fb3 use csv instead of xlsx 2025-05-25 18:32:59 +02:00
Ninjananas
a04cf4d0cb update graphics 2025-01-07 22:57:34 +01:00
Ninjananas
f112f57e37 Configurable font and embedable sizes 2024-10-28 13:13:31 +01:00
9 changed files with 2865 additions and 138 deletions

View File

@@ -1,3 +1,8 @@
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'squib' gem "csv"
gem "bigdecimal"
gem "rake"
gem "squib",
:git => "/home/ninjananas/projets/squib",
:branch => "image_anchors"

View File

@@ -1,4 +1,4 @@
common_deps := src/deck.rb data/cards.xlsx ._graphics_copy_touch ._graphics_extract_touch config.yml ._layouts/poker.yml common_deps := src/deck.rb data/cards.csv ._graphics_copy_touch ._graphics_extract_touch config.yml ._layouts/poker.yml
pnp := _output/pnp_A4.pdf pnp := _output/pnp_A4.pdf
debug := _output/debug.pdf debug := _output/debug.pdf
@@ -30,16 +30,16 @@ clean:
$(pnp): $(common_deps) $(pnp): $(common_deps)
rake pnp bundle exec rake pnp
$(debug): $(common_deps) $(debug): $(common_deps)
rake debug bundle exec rake debug
$(showcase): $(common_deps) $(showcase): $(common_deps)
rake showcase bundle exec rake showcase
$(full): $(common_deps) $(full): $(common_deps)
rake full bundle exec rake full
._graphics_extract_touch: $(wildcard graphics/bundled/*) ._graphics_extract_touch: $(wildcard graphics/bundled/*)
@ mkdir -p ._graphics @ mkdir -p ._graphics

53
data/cards.csv Normal file
View File

@@ -0,0 +1,53 @@
quantite,type,nom,rang,icone,rang_alt,icone_alt,type_effet_1,effet_1,type_effet_2,effet_2,type_effet_3,effet_3,art,citation
0,dummy,dummy,dummy,dummy,dummy,dummy,dummy,dummy,,,,,,
1,candidat,Industrion,5,ind,,,,,,,,,,
1,candidat,Usinax,5,ind,,,,,,,,,,
1,candidat,Ouvriex,4,ind,1,gau,,,,,,,,
1,candidat,Patronex,4,ind,1,dro,,,,,,,,
1,candidat,Alpha-Kappa-Beta,3,ind,2,roy,,,,,,,,
1,candidat,Libertarix,3,ind,2,ana,,,,,,,,
1,candidat,Gauchoïde,5,gau,,,,,,,,,,
1,candidat,Répartitron,5,gau,,,,,,,,,,
1,candidat,Oligarchix,4,gau,1,roy,,,,,,,,
1,candidat,Pink Alu,4,gau,1,ind,,,,,,,,
1,candidat,Révolutron XV,3,gau,2,ana,,,,,,,,
1,candidat,Lokaloïd,3,gau,2,eco,,,,,,,,
1,candidat,Royalix,5,roy,,,,,,,,,,
1,candidat,Monark Mk IV,5,roy,,,,,,,,,,
1,candidat,Louis-Louis,4,roy,1,dro,,,,,,,,
1,candidat,BDFL 2.0,4,roy,1,gau,,,,,,,,
1,candidat,Éco-Duc 3.1,3,roy,2,eco,,,,,,,,
1,candidat,Lys-Import,3,roy,2,ind,,,,,,,,
1,candidat,Anarchix 2000,5,ana,,,,,,,,,,
1,candidat,Son of Robotry,5,ana,,,,,,,,,,
1,candidat,Phoc-U,4,ana,1,ind,,,,,,,,
1,candidat,Robow Warrior,4,ana,1,eco,,,,,,,,
1,candidat,Skizzo 2,3,ana,2,dro,,,,,,,,
1,candidat,London Call,3,ana,2,gau,,,,,,,,
1,candidat,Conservator,5,dro,,,,,,,,,,
1,candidat,Traditron,5,dro,,,,,,,,,,
1,candidat,Greenwasher,4,dro,1,eco,,,,,,,,
1,candidat,Crazy Gun,4,dro,1,ana,,,,,,,,
1,candidat,Profitron,3,dro,2,ind,,,,,,,,
1,candidat,MDP 123456,3,dro,2,roy,,,,,,,,
1,candidat,Écolotron,5,eco,,,,,,,,,,
1,candidat,Pichonio,5,eco,,,,,,,,,,
1,candidat,Hermitron,4,eco,1,ana,,,,,,,,
1,candidat,Gaiax,4,eco,1,roy,,,,,,,,
1,candidat,Vegauchix,3,eco,2,gau,,,,,,,,
1,candidat,Chassa-Cor III,3,eco,2,dro,,,,,,,,
1,candidat,Adaptatron,0,jok,,,,,,,,,,
1,candidat,Compatiblix,0,jok,,,,,,,,,,
3,action,Robocaïne,,robocaine,,,effet,Jouez 2 actions,effet,Piochez 2 cartes,,,,
3,action,Corruption,-2,corruption,,,magouille,•Volez un candidat adverse.\n•Il obtient :m2:.\n•Son parti : <b>-2</b> :pv:.,,,,,,
3,action,Retournement de veste,,veste,,,effet,Retournez un de vos candidats sur son autre parti.\nUn :pv: de son ancien parti est transféré à son nouveau parti,,,,,,
2,action,Assassinat,,assassinat,,,magouille,Défaussez un candidat (le vôtre ou celui dun adversaire),,,,,,
5,action,Casserole,-3,casserole,,,effet,Ciblez un candidat\n•Il obtient :m3:.\n•Retirez <b>2</b> :pv: à son parti.,,,,,,
2,action,Spin Doctor,,spindoctor,,,effet,Défaussez un mod négatif d'un de vos candidats,,,,,,
3,action,Propagande,++2,propagande,-1,,magouille,Ciblez un candidat\n<b>Réussite :</b> Il obtient :p2:\n<b>Échec :</b> Il obtient :m1:,,,,,,
1,action,Campagne de Com',++2,campagne,,,effet,Ciblez un candidat :symbole_ind:\n•Il obtient :p2:.\n•Son parti : <b>+1</b>:pv:.,,,,,,
1,action,Campagne de Com',++2,campagne,,,effet,Ciblez un candidat :symbole_gau:\n•Il obtient :p2:.\n•Son parti : <b>+1</b>:pv:.,,,,,,
1,action,Campagne de Com',++2,campagne,,,effet,Ciblez un candidat :symbole_dro:\n•Il obtient :p2:.\n•Son parti : <b>+1</b>:pv:.,,,,,,
1,action,Campagne de Com',++2,campagne,,,effet,Ciblez un candidat :symbole_roy:\n•Il obtient :p2:.\n•Son parti : <b>+1</b>:pv:.,,,,,,
1,action,Campagne de Com',++2,campagne,,,effet,Ciblez un candidat :symbole_eco:\n•Il obtient :p2:.\n•Son parti : <b>+1</b>:pv:.,,,,,,
1,action,Campagne de Com',++2,campagne,,,effet,Ciblez un candidat :symbole_ana:\n•Il obtient :p2:.\n•Son parti : <b>+1</b>:pv:.,,,,,,
1 quantite type nom rang icone rang_alt icone_alt type_effet_1 effet_1 type_effet_2 effet_2 type_effet_3 effet_3 art citation
2 0 dummy dummy dummy dummy dummy dummy dummy dummy
3 1 candidat Industrion 5 ind
4 1 candidat Usinax 5 ind
5 1 candidat Ouvriex 4 ind 1 gau
6 1 candidat Patronex 4 ind 1 dro
7 1 candidat Alpha-Kappa-Beta 3 ind 2 roy
8 1 candidat Libertarix 3 ind 2 ana
9 1 candidat Gauchoïde 5 gau
10 1 candidat Répartitron 5 gau
11 1 candidat Oligarchix 4 gau 1 roy
12 1 candidat Pink Alu 4 gau 1 ind
13 1 candidat Révolutron XV 3 gau 2 ana
14 1 candidat Lokaloïd 3 gau 2 eco
15 1 candidat Royalix 5 roy
16 1 candidat Monark Mk IV 5 roy
17 1 candidat Louis-Louis 4 roy 1 dro
18 1 candidat BDFL 2.0 4 roy 1 gau
19 1 candidat Éco-Duc 3.1 3 roy 2 eco
20 1 candidat Lys-Import 3 roy 2 ind
21 1 candidat Anarchix 2000 5 ana
22 1 candidat Son of Robotry 5 ana
23 1 candidat Phoc-U 4 ana 1 ind
24 1 candidat Robow Warrior 4 ana 1 eco
25 1 candidat Skizzo 2 3 ana 2 dro
26 1 candidat London Call 3 ana 2 gau
27 1 candidat Conservator 5 dro
28 1 candidat Traditron 5 dro
29 1 candidat Greenwasher 4 dro 1 eco
30 1 candidat Crazy Gun 4 dro 1 ana
31 1 candidat Profitron 3 dro 2 ind
32 1 candidat MDP 123456 3 dro 2 roy
33 1 candidat Écolotron 5 eco
34 1 candidat Pichonio 5 eco
35 1 candidat Hermitron 4 eco 1 ana
36 1 candidat Gaiax 4 eco 1 roy
37 1 candidat Vegauchix 3 eco 2 gau
38 1 candidat Chassa-Cor III 3 eco 2 dro
39 1 candidat Adaptatron 0 jok
40 1 candidat Compatiblix 0 jok
41 3 action Robocaïne robocaine effet Jouez 2 actions effet Piochez 2 cartes
42 3 action Corruption -2 corruption magouille •Volez un candidat adverse.\n•Il obtient :m2:.\n•Son parti : <b>-2</b> :pv:.
43 3 action Retournement de veste veste effet Retournez un de vos candidats sur son autre parti.\nUn :pv: de son ancien parti est transféré à son nouveau parti
44 2 action Assassinat assassinat magouille Défaussez un candidat (le vôtre ou celui d’un adversaire)
45 5 action Casserole -3 casserole effet Ciblez un candidat\n•Il obtient :m3:.\n•Retirez <b>2</b> :pv: à son parti.
46 2 action Spin Doctor spindoctor effet Défaussez un mod négatif d'un de vos candidats
47 3 action Propagande ++2 propagande -1 magouille Ciblez un candidat\n<b>Réussite :</b> Il obtient :p2:\n<b>Échec :</b> Il obtient :m1:
48 1 action Campagne de Com' ++2 campagne effet Ciblez un candidat :symbole_ind:\n•Il obtient :p2:.\n•Son parti : <b>+1</b>:pv:.
49 1 action Campagne de Com' ++2 campagne effet Ciblez un candidat :symbole_gau:\n•Il obtient :p2:.\n•Son parti : <b>+1</b>:pv:.
50 1 action Campagne de Com' ++2 campagne effet Ciblez un candidat :symbole_dro:\n•Il obtient :p2:.\n•Son parti : <b>+1</b>:pv:.
51 1 action Campagne de Com' ++2 campagne effet Ciblez un candidat :symbole_roy:\n•Il obtient :p2:.\n•Son parti : <b>+1</b>:pv:.
52 1 action Campagne de Com' ++2 campagne effet Ciblez un candidat :symbole_eco:\n•Il obtient :p2:.\n•Son parti : <b>+1</b>:pv:.
53 1 action Campagne de Com' ++2 campagne effet Ciblez un candidat :symbole_ana:\n•Il obtient :p2:.\n•Son parti : <b>+1</b>:pv:.

Binary file not shown.

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 902 KiB

After

Width:  |  Height:  |  Size: 956 KiB

1794
graphics/plateau_v1.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 156 KiB

View File

@@ -41,7 +41,7 @@ def export_objects(svg_file: str, object_ids: Iterable[str]) -> None:
OUTPUT_DIR + "/" + obj[4:], OUTPUT_DIR + "/" + obj[4:],
svg_file, svg_file,
] ]
print(f"exporting {obj[4:]}...", end="") print(f"exporting {obj[4:]}...", end="", flush=True)
res = subprocess.check_output(command) res = subprocess.check_output(command)
if res: if res:
print(f" An error might have occurred:\n{res}") print(f" An error might have occurred:\n{res}")

View File

@@ -63,17 +63,50 @@ ALT_BANNER_TEXT_X, ALT_BANNER_TEXT_Y = central_sym(BANNER_TEXT_X, BANNER_TEXT_Y)
# Effects # Effects
EFFECT_FRAME_WIDTH = SAFE_WIDTH - 2 EFFECT_FRAME_WIDTH = SAFE_WIDTH - 2
EFFECT_FRAME_HEIGHT = 6 EFFECT_FRAME_HEIGHT = 7
EFFECT_FRAME_RADIUS = 0.2 EFFECT_FRAME_RADIUS = 0.2
EFFECT_FRAME_MARGIN_BOTTOM = 4.1 EFFECT_FRAME_MARGIN_BOTTOM = 4.1
EFFECT_FRAME_X = (TOTAL_WIDTH - EFFECT_FRAME_WIDTH) / 2. EFFECT_FRAME_X = (TOTAL_WIDTH - EFFECT_FRAME_WIDTH) / 2.
EFFECT_FRAME_Y = MAX_SAFE_Y - EFFECT_FRAME_MARGIN_BOTTOM - EFFECT_FRAME_HEIGHT EFFECT_FRAME_Y = MAX_SAFE_Y - EFFECT_FRAME_MARGIN_BOTTOM - EFFECT_FRAME_HEIGHT
EFFECT_TEXT_MARGIN = 1 EFFECT_ICON_MARGIN = .5
EFFECT_TEXT_X = EFFECT_FRAME_X + EFFECT_TEXT_MARGIN EFFECT_ICON_SIZE = 1.5
EFFECT_TEXT_Y = EFFECT_FRAME_Y + EFFECT_TEXT_MARGIN EFFECT_ICON_X = EFFECT_FRAME_X + EFFECT_ICON_MARGIN + (EFFECT_ICON_SIZE / 2.)
EFFECT_TEXT_WIDTH = EFFECT_FRAME_WIDTH - 2 * EFFECT_TEXT_MARGIN
EFFECT_TEXT_HEIGHT = EFFECT_FRAME_HEIGHT - 2 * EFFECT_TEXT_MARGIN EFFECT_TEXT_MARGIN = .2
EFFECT_SEPARATOR_HEIGHT = 2.
EFFECT_SEPARATOR_MARGIN = -.05
TOTAL_SEPARATOR_HEIGHT = EFFECT_SEPARATOR_HEIGHT + (2 * EFFECT_SEPARATOR_MARGIN)
EFFECT_SEPARATOR_X = EFFECT_FRAME_X + (EFFECT_FRAME_WIDTH / 2.)
EFFECT_SEPARATOR_Y_2 = EFFECT_FRAME_Y + (EFFECT_FRAME_HEIGHT / 2.)
EFFECT_SEPARATOR_Y_3_0 = EFFECT_FRAME_Y + EFFECT_TEXT_MARGIN + (EFFECT_FRAME_HEIGHT - (2 * EFFECT_TEXT_MARGIN)) / 3.
EFFECT_SEPARATOR_Y_3_1 = EFFECT_FRAME_Y + EFFECT_TEXT_MARGIN + 2 * (EFFECT_FRAME_HEIGHT - (2 * EFFECT_TEXT_MARGIN)) / 3.
EFFECT_TEXT_X = EFFECT_FRAME_X + EFFECT_ICON_MARGIN + EFFECT_ICON_SIZE + EFFECT_TEXT_MARGIN
EFFECT_TEXT_HEIGHT_1 = EFFECT_FRAME_HEIGHT - 2 * EFFECT_TEXT_MARGIN
EFFECT_TEXT_Y_1 = EFFECT_FRAME_Y + EFFECT_TEXT_MARGIN
EFFECT_TEXT_HEIGHT_2 = (EFFECT_FRAME_HEIGHT - (2 * EFFECT_TEXT_MARGIN) - TOTAL_SEPARATOR_HEIGHT) / 2.
EFFECT_TEXT_Y_2_0 = EFFECT_TEXT_Y_1
EFFECT_TEXT_Y_2_1 = EFFECT_TEXT_Y_2_0 + EFFECT_TEXT_HEIGHT_2 + TOTAL_SEPARATOR_HEIGHT
EFFECT_TEXT_HEIGHT_3 = (EFFECT_FRAME_HEIGHT - (2 * EFFECT_TEXT_MARGIN) - (2 * TOTAL_SEPARATOR_HEIGHT)) / 2.
EFFECT_TEXT_Y_3_0 = EFFECT_TEXT_Y_1
EFFECT_TEXT_Y_3_1 = EFFECT_TEXT_Y_3_0 + EFFECT_TEXT_HEIGHT_3 + TOTAL_SEPARATOR_HEIGHT
EFFECT_TEXT_Y_3_2 = EFFECT_TEXT_Y_3_1 + EFFECT_TEXT_HEIGHT_3 + TOTAL_SEPARATOR_HEIGHT
EFFECT_TEXT_WIDTH = EFFECT_FRAME_X + EFFECT_FRAME_WIDTH - EFFECT_TEXT_X - EFFECT_TEXT_MARGIN
EFFECT_ICON_Y_1 = EFFECT_FRAME_Y + (EFFECT_FRAME_HEIGHT / 2.)
EFFECT_ICON_Y_2_0 = EFFECT_TEXT_Y_2_0 + (EFFECT_TEXT_HEIGHT_2 / 2.)
EFFECT_ICON_Y_2_1 = EFFECT_TEXT_Y_2_1 + (EFFECT_TEXT_HEIGHT_2 / 2.)
EFFECT_ICON_Y_3_0 = EFFECT_TEXT_Y_3_0 + (EFFECT_TEXT_HEIGHT_2 / 2.)
EFFECT_ICON_Y_3_1 = EFFECT_TEXT_Y_3_1 + (EFFECT_TEXT_HEIGHT_2 / 2.)
EFFECT_ICON_Y_3_2 = EFFECT_TEXT_Y_3_2 + (EFFECT_TEXT_HEIGHT_2 / 2.)
POKER_LAYOUT: str = f""" POKER_LAYOUT: str = f"""
background: background:
@@ -165,16 +198,91 @@ effect_frame:
radius: {EFFECT_FRAME_RADIUS}c radius: {EFFECT_FRAME_RADIUS}c
stroke_width: 0.3mm stroke_width: 0.3mm
effect_icon:
x: {EFFECT_ICON_X}c
width: {EFFECT_ICON_SIZE}c
height: {EFFECT_ICON_SIZE}c
anchor: :center
effect_icon_1_0:
extends: effect_icon
y: {EFFECT_ICON_Y_1}c
effect_icon_2_0:
extends: effect_icon
y: {EFFECT_ICON_Y_2_0}c
effect_icon_2_1:
extends: effect_icon
y: {EFFECT_ICON_Y_2_1}c
effect_icon_3_0:
extends: effect_icon
y: {EFFECT_ICON_Y_3_0}c
effect_icon_3_1:
extends: effect_icon
y: {EFFECT_ICON_Y_3_1}c
effect_icon_3_2:
extends: effect_icon
y: {EFFECT_ICON_Y_3_2}c
effect_separator:
x: {EFFECT_SEPARATOR_X}c
anchor: :center
height: {EFFECT_SEPARATOR_HEIGHT}c
width: :scale
effect_separator_2_0:
extends: effect_separator
y: {EFFECT_SEPARATOR_Y_2}c
effect_separator_3_0:
extends: effect_separator
y: {EFFECT_SEPARATOR_Y_3_0}c
effect_separator_3_1:
extends: effect_separator
y: {EFFECT_SEPARATOR_Y_3_1}c
effect_text: effect_text:
x: {EFFECT_TEXT_X}c x: {EFFECT_TEXT_X}c
y: {EFFECT_TEXT_Y}c
width: {EFFECT_TEXT_WIDTH}c width: {EFFECT_TEXT_WIDTH}c
height: {EFFECT_TEXT_HEIGHT}c
font_size: 9
spacing: 5
align: center align: center
valign: middle valign: middle
markup: true markup: true
font: exo-2-0 9
effect_text_1_0:
extends: effect_text
y: {EFFECT_TEXT_Y_1}c
height: {EFFECT_TEXT_HEIGHT_1}c
effect_text_2_0:
extends: effect_text
y: {EFFECT_TEXT_Y_2_0}c
height: {EFFECT_TEXT_HEIGHT_2}c
effect_text_2_1:
extends: effect_text
y: {EFFECT_TEXT_Y_2_1}c
height: {EFFECT_TEXT_HEIGHT_2}c
effect_text_3_0:
extends: effect_text
y: {EFFECT_TEXT_Y_3_0}c
height: {EFFECT_TEXT_HEIGHT_3}c
effect_text_3_1:
extends: effect_text
y: {EFFECT_TEXT_Y_3_1}c
height: {EFFECT_TEXT_HEIGHT_3}c
effect_text_3_2:
extends: effect_text
y: {EFFECT_TEXT_Y_3_2}c
height: {EFFECT_TEXT_HEIGHT_3}c
paparazzo: paparazzo:
x: {PAPARAZZO_X}c x: {PAPARAZZO_X}c

View File

@@ -1,6 +1,22 @@
require 'squib' require 'squib'
data = Squib.xlsx file: 'data/cards.xlsx', explode: 'quantite'
DPI = 150
CELL_PX = DPI / 8.0
BLEED = 0.125 # In inches
WIDTH = (2.5 + 2*BLEED) * DPI
HEIGHT = (3.5 + 2*BLEED) * DPI
EFFECT_FONT_SIZE = 8
EFFECT_FONT_SPACING = 5
EMBED_SIZE = EFFECT_FONT_SIZE / 8.0 # In cells
EMBED_DY = - (0.7 * EMBED_SIZE + 0.2) * DPI / 300 # In cells
#data = Squib.xlsx file: 'data/cards.xlsx', explode: 'quantite'
data = Squib.csv file: 'data/cards.csv', explode: 'quantite'
data['rang'].map! { it.nil? ? nil : it.to_s.sub(/\A\++/, "+") }
data['rang_alt'].map! { it.nil? ? nil : it.to_s.sub(/\A\++/, "+") }
['effet_1', 'effet_2', 'effet_3'].each { data[it].each { it&.gsub! '\n', "\n" } }
def icon_to_svg(icon) def icon_to_svg(icon)
icon.nil? ? nil : "icone_#{icon}.svg" icon.nil? ? nil : "icone_#{icon}.svg"
@@ -42,19 +58,41 @@ def get_art(data, idx)
icon = data['icone'][idx] icon = data['icone'][idx]
icon_alt = data['icone_alt'][idx] icon_alt = data['icone_alt'][idx]
icon_alt = icon_alt.nil? ? '' : "_#{icon_alt}" icon_alt = icon_alt.nil? ? '' : "_#{icon_alt}"
puts "default_art_#{icon}#{icon_alt}.svg"
return "default_art_#{icon}#{icon_alt}.svg" return "default_art_#{icon}#{icon_alt}.svg"
end end
def embed_custom(embed, id) def get_grouped_effects(data, idx)
embed.svg width: '0.8c', height: '0.8c', dx: '0c', dy: '-0.7c', key: ":#{id}:", file: "._graphics/#{id}.svg" if data['effet_1'].nil?
n_effects = 0
elsif data['effet_2'].nil?
n_effects = 1
elsif data['effet_3'].nil?
n_effects = 2
else
n_effects = 3
end
effects = []
(0..3).each do |i|
effects.append([data["type_effet_#{i}"], data["effet_#{i}"]])
end
return [n_effects, effects]
end end
DPI = 300 def get_n_effects(data, idx)
CELL_PX = DPI / 8.0 if data['effet_1'][idx].nil?
BLEED = 0.125 # In inches 0
WIDTH = (2.5 + 2*BLEED) * DPI elsif data['effet_2'][idx].nil?
HEIGHT = (3.5 + 2*BLEED) * DPI 1
elsif data['effet_3'][idx].nil?
2
else
3
end
end
def embed_custom(embed, id)
embed.svg width: "#{EMBED_SIZE}c", height: "#{EMBED_SIZE}c", dx: '0c', dy: "#{EMBED_DY}c", key: ":#{id}:", file: "._graphics/#{id}.svg"
end
Squib.configure cell_px: CELL_PX Squib.configure cell_px: CELL_PX
@@ -103,19 +141,43 @@ Squib::Deck.new(
svg file: alt_banner_file, layout: 'alt_banner' svg file: alt_banner_file, layout: 'alt_banner'
text str: data['rang_alt'], layout: 'alt_banner_text' text str: data['rang_alt'], layout: 'alt_banner_text'
fill_color = data['effet'].map { |effet| effet.nil? ? '#0000': '#f7f7f7ff' } fill_color = data['effet_1'].map { |effet| effet.nil? ? '#0000': '#f7f7f7ff' }
stroke_color = data['effet'].map { |effet| effet.nil? ? '#0000': '#cca9' } stroke_color = data['effet_1'].map { |effet| effet.nil? ? '#0000': '#e3ca0eff' }
rect layout: 'effect_frame', fill_color: fill_color, stroke_color: stroke_color 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') n_effects = (0..data['icone'].length).map { |idx| get_n_effects(data, idx) }
embed_custom(embed, 'magouille') (1..3).each do |n|
embed_custom(embed, 'pv') n.times do |i|
embed_custom(embed, 'symbole_ind') # Effect texts
embed_custom(embed, 'symbole_gau') text(str: (0..data['icone'].length).map { |idx| (n == n_effects[idx]) ? data["effet_#{i+1}"][idx] : nil}, layout: "effect_text_#{n}_#{i}", font_size: EFFECT_FONT_SIZE, spacing: EFFECT_FONT_SPACING) do |embed|
embed_custom(embed, 'symbole_roy') [
embed_custom(embed, 'symbole_ana') 'effet',
embed_custom(embed, 'symbole_dro') 'magouille',
embed_custom(embed, 'symbole_eco') 'pv',
'symbole_ind',
'symbole_gau',
'symbole_roy',
'symbole_ana',
'symbole_dro',
'symbole_eco',
'm1',
'm2',
'm3',
'p1',
'p2',
'p3',
].each { embed_custom(embed, it) }
end
# Effect icons
svg file: (0..data['icone'].length).map { |idx| (n == n_effects[idx]) ? data["type_effet_#{i+1}"][idx] + ".svg" : nil}, layout: "effect_icon_#{n}_#{i}"
end
end
(2..3).each do |n|
#Effect separators
(n-1).times do |i|
svg file: (0..data['icone'].length).map { |idx| (n == n_effects[idx]) ? "separateur_effet.svg" : nil}, layout: "effect_separator_#{n}_#{i}"
end
end end
build :debug do build :debug do
@@ -128,8 +190,8 @@ Squib::Deck.new(
end end
build :showcase do build :showcase do
hand range: [0, 6, 13, 21, 38, 59, 65], trim_radius: inches(0.125), fill_color: 'black' hand range: [0, 6, 13, 21, 38, 59, 62], trim_radius: inches(0.125), fill_color: 'black'
showcase range: [0, 6, 13, 21, 38, 59, 65], trim: inches(BLEED), trim_radius: inches(0.125), fill_color: 'black' showcase range: [0, 6, 13, 21, 38, 59, 62], trim: inches(BLEED), trim_radius: inches(0.125), fill_color: 'black'
end end
build :full do build :full do