More fixing #106

Merged
Dandaedre merged 1 commits from fix-gen into main 2026-07-18 18:14:11 +02:00
4 changed files with 13 additions and 11 deletions

View File

@ -197,23 +197,28 @@ impl MonsterAllAttacks {
attacklist: atk.iter().map(|&v| v.clone()).collect(),
// color: atk.first().unwrap().attack_type.clone(),
size: atk.len() + 1,
description: atk
description_final: atk
.first()
.unwrap()
.description_all
.clone()
.unwrap_or_default(),
};
// println!("group: {:#?}", group_attack.description_final);
phases.get_mut(&phase_name).unwrap().push(group_attack);
} else {
for single_atk in atk {
// println!("single: {:#?}", single_atk.description_all);
phases
.get_mut(&phase_name)
.unwrap()
.push(MonsterFullAttack {
attacklist: vec![single_atk.clone()],
size: 2,
description: single_atk.description_all.clone().unwrap_or_default(),
description_final: single_atk
.description_all
.clone()
.unwrap_or_default(),
});
}
};
@ -262,11 +267,8 @@ impl MonsterAllAttacks {
)?;
}
write!(
out,
"{}",
templates.render("attack_info_row", &list_full_attacks[0])?
)?;
write!(out, "{}", templates.render("attack_info_row", attack)?)?;
println!("{:?}", list_full_attacks);
}
}
Ok(out)

View File

@ -386,5 +386,5 @@ pub struct MonsterFullAttack {
pub attacklist: Vec<MonsterSingleAttack>,
// pub color: String,
pub size: usize,
pub description: String,
pub description_final: String,
}

View File

@ -259,7 +259,7 @@ init_end= '''
attacks_intro= '''
{\scriptsize
\begin{tblr}{
colspec={X[0.05] X[3,l] X[1,c] X[1,c] X[0.3,c] X[0.3,c] X[0.3,c] X[0.3,c] X[0.3,c] X[2,r] X[4,c] X[0.3,c] X[0.3,c]},
colspec={X[0.05] X[2.5,l] X[1,c] X[1,c] X[0.3,c] X[0.3,c] X[0.3,c] X[0.3,c] X[0.3,c] X[2,r] X[4,l] X[0.3,c] X[0.3,c]},
hspan=minimal,
colsep=2pt,
row{2}={font=\tiny},
@ -279,7 +279,7 @@ attack_color='\SetCell[r={{{size}}}]{bg={{{color}}}}' # Very ugly hack, going to
# attack_repeatable_row= ''' & {{{name}}} & {{{short_name}}} & {{{prerequisites}}} & {{{atk_type}}} & {{{targetting}}} & {{{cost_fatigue}}} & {{{cost_action}}} & {{{element}}} & {{{damage_fatigue}}} &{{{damage_regular}}} & {{{effects}}} & {{{threshold_parry}}} & {{{threshold_dodge}}} \\
attack_repeatable_row= ''' & {{{name}}} & {{{atk_type}}} & {{{prerequisites}}} & {{{targetting}}} & {{{cost_fatigue}}} & {{{cost_action}}} & {{{element}}} & {{{damage_fatigue}}} &{{{damage_regular}}} & {{{effects}}} & {{{threshold_parry}}} & {{{threshold_dodge}}} \\
'''
attack_info_row='''& \SetCell[c=12]{j} {{{description}}} & & & & & & & & & & \\
attack_info_row='''& \SetCell[c=12]{j} {{{description_final}}} & & & & & & & & & & \\
\hline
'''
attacks_end= ''' \end{tblr}

@ -1 +1 @@
Subproject commit 27b578ce3b1202817e406ef2a762893432706eec
Subproject commit ec988aabeb3c94233d7f60deef2ff3873c8e9100