1
0

Plein de modifs

This commit is contained in:
Ninjananas
2025-06-15 18:33:04 +02:00
parent f1e68f55cd
commit 10995f3dc8
4 changed files with 836 additions and 149 deletions

View File

@@ -8,7 +8,7 @@ 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 / 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
@@ -16,6 +16,7 @@ EMBED_DY = - (0.7 * EMBED_SIZE + 0.2) * DPI / 300 # In cells
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)
icon.nil? ? nil : "icone_#{icon}.svg"
@@ -141,7 +142,7 @@ Squib::Deck.new(
text str: data['rang_alt'], layout: 'alt_banner_text'
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
n_effects = (0..data['icone'].length).map { |idx| get_n_effects(data, idx) }
@@ -149,15 +150,23 @@ Squib::Deck.new(
n.times do |i|
# 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|
embed_custom(embed, 'effet')
embed_custom(embed, 'magouille')
embed_custom(embed, 'pv')
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')
[
'effet',
'magouille',
'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