database_monsters #179

Merged
Dandaedre merged 2 commits from database_monsters into main 2026-08-07 19:33:28 +02:00
6 changed files with 22 additions and 5 deletions

View File

@ -6,7 +6,7 @@ resolver = "3"
# edition = "2024"
# license = "MIT OR Apache-2.0"
[workspace.package]
version = "0.3.33"
version = "0.3.34"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -72,9 +72,14 @@ pub fn attack_player(
})
.sum::<f64>();
let damage_incoming = avg_damage_incomming;
let damage_tanked = (damage_incoming - (victim.protection + victim.strength) as f64).max(0.0);
let armor_loss =
let mut damage_tanked =
(damage_incoming - (victim.protection + victim.strength) as f64).max(0.0);
let mut armor_loss =
(damage_incoming - victim.protection as f64).clamp(0.0, attack.armor_break as f64);
if avg_successes_left > 0. {
armor_loss += attack.antimaterial as f64;
damage_tanked += attack.armor_pierce.min(victim.protection) as f64;
}
let report = DamageReport {
damage_incoming,
damage_tanked,

View File

@ -29,6 +29,8 @@ impl From<FullMonster> for Vec<MonsterBalancingAttack> {
target_damage: sub_attack.target_damage_category.into(),
target_ab: sub_attack.target_ab_category.into(),
target_stance: sub_attack.target_stance.into(),
antimaterial: from_opt_i64(sub_attack.antimaterial.as_ref()),
armor_pierce: from_opt_i64(sub_attack.armor_pierce.as_ref()),
}
})
.filter(|sub| !sub.damage.is_empty())
@ -76,6 +78,10 @@ pub struct MonsterBalancingAttack {
pub target_ab: ArmorBreakCategory,
#[TEXT(name = "stance_t")]
pub target_stance: ProfileStance,
#[SKIP(name = "AM")]
pub antimaterial: i64,
#[SKIP(name = "AP")]
pub armor_pierce: i64,
}
pub struct DamageDone {

View File

@ -203,6 +203,12 @@ pub struct MonsterSingleAttack {
/// Armor_break of the ability.
#[INTEGER]
pub armor_break: Option<i64>,
/// armor_pierce of the ability.
#[INTEGER]
pub armor_pierce: Option<i64>,
/// antimaterial of the ability.
#[INTEGER]
pub antimaterial: Option<i64>,
/// Action‑point cost (used in systems where actions and fatigue are separate).
#[INTEGER]
pub cost_action: Option<String>,

View File

@ -277,7 +277,7 @@ master_part = '''
{{#each phase as | attack_group |}}
\hline
{{#each attack_group.attacklist}}
\SetCell{bg={{{../color}}}} & {{{name}}} & {{{attack_type}}} & {{{prerequisites}}} & {{{targetting}}} & {{{cost_fatigue}}} & {{{cost_action}}} & {{{element}}} & {{{damage_fatigue}}} & {{{damage_regular}}} {{{success}}} & {{#if armor_break}} {{{armor_break}}}\arbreakk{} {{/if}} {{{effects}}} & {{{threshold_parry}}} & {{{threshold_dodge}}} \\
\SetCell{bg={{{../color}}}} & {{{name}}} & {{{attack_type}}} & {{{prerequisites}}} & {{{targetting}}} & {{{cost_fatigue}}} & {{{cost_action}}} & {{{element}}} & {{{damage_fatigue}}} & {{{damage_regular}}} {{{success}}} & {{#if armor_break}} {{{armor_break}}}\arbreakk{} {{/if}}{{#if armor_pierce}} {{{armor_pierce}}}\arpierce{} {{/if}}{{#if antimaterial}} {{{antimaterial}}}\antimateriel{} {{/if}} {{{effects}}} & {{{threshold_parry}}} & {{{threshold_dodge}}} \\
{{/each}}
{{#if description_final}}\SetCell{bg={{{color}}}} & \SetCell[c=12]{j} {{{description_final}}} & & & & & & & & & & \\
{{/if}} \hline

@ -1 +1 @@
Subproject commit 3bdf69472426e570c987efcf4159600fa019b3cb
Subproject commit c5af8a89ccb47b4a4bd57412a13bec90809fc61a