summaryrefslogtreecommitdiff
path: root/incantesimi/excel_to_incantesimi.pl
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2011-10-23 15:10:57 +0100
committerdakkar <dakkar@thenautilus.net>2011-10-23 15:10:57 +0100
commit3a845849d6d63dbfc363c0d34a4acdf1c975124d (patch)
treeed9218eb88541e5ffbeaaf6491bdaa857dadbd19 /incantesimi/excel_to_incantesimi.pl
parentgestisci incantesimi di dominio (2Âș foglio) (diff)
downloadinventario-3a845849d6d63dbfc363c0d34a4acdf1c975124d.tar.gz
inventario-3a845849d6d63dbfc363c0d34a4acdf1c975124d.tar.bz2
inventario-3a845849d6d63dbfc363c0d34a4acdf1c975124d.zip
fattorizzazione, e poteri
Diffstat (limited to 'incantesimi/excel_to_incantesimi.pl')
-rw-r--r--incantesimi/excel_to_incantesimi.pl18
1 files changed, 17 insertions, 1 deletions
diff --git a/incantesimi/excel_to_incantesimi.pl b/incantesimi/excel_to_incantesimi.pl
index 674d0b1..d1c82cf 100644
--- a/incantesimi/excel_to_incantesimi.pl
+++ b/incantesimi/excel_to_incantesimi.pl
@@ -1,6 +1,7 @@
#!/usr/bin/perl
use strict;
use warnings;
+use utf8;
use Spreadsheet::ParseExcel;
use LaTeX::Encode;
use Template;
@@ -10,10 +11,16 @@ use Data::Printer;
my %fieldmap = (
spellname => 'name',
name => 'name',
+ ability => 'name',
level => 'level',
+ equiv => 'level',
school => 'scuola',
+ source => 'source',
+ uses => 'uses',
+ type => 'type',
comp => 'components',
ct => 'tempo',
+ at => 'tempo',
range => 'range',
target => 'target',
duration => 'durata',
@@ -44,6 +51,13 @@ sheet_2_latex(
output_filename => "${output_filename}.domini.tex",
skip_col => 1,
);
+sheet_2_latex(
+ sheet_name => 'AbilitĂ  speciali',
+ sheet_idx => 2,
+ output_filename => "${output_filename}.special.tex",
+ command => 'potere',
+ skip_col => 1,
+);
{
my $template;
@@ -57,6 +71,7 @@ sub sheet_2_latex {
my %opts = (
sheet_idx => 0,
fieldmap => \%fieldmap,
+ command => 'incantesimo',
@_,
);
@@ -74,6 +89,7 @@ sub sheet_2_latex {
{
spells => $spells,
fieldmap => $opts{fieldmap},
+ command => $opts{command},
lt => \&latexise,
},
$opts{output_filename},
@@ -145,7 +161,7 @@ __DATA__
\matrix {
[% FOREACH spell IN spells %]
-\incantesimo{type=spell,
+\[% command %]{
[%- FOREACH field IN fieldmap; IF spell.item(field.key) != '' %]
[% field.value %]={[% lt(spell.item(field.key)) %]},
[%- END; END %]