1
0

Compare commits

...

4 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
8 changed files with 2645 additions and 103 deletions

View File

@@ -1,3 +1,8 @@
source 'https://rubygems.org' source 'https://rubygems.org'
gem "squib", path: "../squib/pkg" 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: 912 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

@@ -75,8 +75,8 @@ EFFECT_ICON_X = EFFECT_FRAME_X + EFFECT_ICON_MARGIN + (EFFECT_ICON_SIZE / 2.)
EFFECT_TEXT_MARGIN = .2 EFFECT_TEXT_MARGIN = .2
EFFECT_SEPARATOR_HEIGHT = 1. EFFECT_SEPARATOR_HEIGHT = 2.
EFFECT_SEPARATOR_MARGIN = .05 EFFECT_SEPARATOR_MARGIN = -.05
TOTAL_SEPARATOR_HEIGHT = EFFECT_SEPARATOR_HEIGHT + (2 * EFFECT_SEPARATOR_MARGIN) TOTAL_SEPARATOR_HEIGHT = EFFECT_SEPARATOR_HEIGHT + (2 * EFFECT_SEPARATOR_MARGIN)
EFFECT_SEPARATOR_X = EFFECT_FRAME_X + (EFFECT_FRAME_WIDTH / 2.) EFFECT_SEPARATOR_X = EFFECT_FRAME_X + (EFFECT_FRAME_WIDTH / 2.)
@@ -252,6 +252,7 @@ effect_text:
align: center align: center
valign: middle valign: middle
markup: true markup: true
font: exo-2-0 9
effect_text_1_0: effect_text_1_0:
extends: effect_text extends: effect_text

View File

@@ -8,11 +8,15 @@ WIDTH = (2.5 + 2*BLEED) * DPI
HEIGHT = (3.5 + 2*BLEED) * DPI HEIGHT = (3.5 + 2*BLEED) * DPI
EFFECT_FONT_SIZE = 8 EFFECT_FONT_SIZE = 8
EFFECT_FONT_SPACING = 5 EFFECT_FONT_SPACING = 5
EMBED_SIZE = EFFECT_FONT_SIZE / 9.0 # In cells EMBED_SIZE = EFFECT_FONT_SIZE / 8.0 # In cells
EMBED_DY = - (0.7 * EMBED_SIZE + 0.2) * DPI / 300 # 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.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"
@@ -138,7 +142,7 @@ Squib::Deck.new(
text str: data['rang_alt'], layout: 'alt_banner_text' text str: data['rang_alt'], layout: 'alt_banner_text'
fill_color = data['effet_1'].map { |effet| effet.nil? ? '#0000': '#f7f7f7ff' } fill_color = data['effet_1'].map { |effet| effet.nil? ? '#0000': '#f7f7f7ff' }
stroke_color = data['effet_1'].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
n_effects = (0..data['icone'].length).map { |idx| get_n_effects(data, idx) } n_effects = (0..data['icone'].length).map { |idx| get_n_effects(data, idx) }
@@ -146,15 +150,23 @@ Squib::Deck.new(
n.times do |i| n.times do |i|
# Effect texts # Effect texts
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| 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, 'effet') [
embed_custom(embed, 'magouille') 'effet',
embed_custom(embed, 'pv') 'magouille',
embed_custom(embed, 'symbole_ind') 'pv',
embed_custom(embed, 'symbole_gau') 'symbole_ind',
embed_custom(embed, 'symbole_roy') 'symbole_gau',
embed_custom(embed, 'symbole_ana') 'symbole_roy',
embed_custom(embed, 'symbole_dro') 'symbole_ana',
embed_custom(embed, 'symbole_eco') 'symbole_dro',
'symbole_eco',
'm1',
'm2',
'm3',
'p1',
'p2',
'p3',
].each { embed_custom(embed, it) }
end end
# Effect icons # Effect icons