some more progress on character stuff but its really hard

This commit is contained in:
Rusty Striker 2024-10-16 16:40:10 +03:00
parent 5cdfe71528
commit e8291e15d9
Signed by: RustyStriker
GPG key ID: 9DBDBC7C48FC3C31
5 changed files with 22 additions and 3 deletions

View file

@ -14,6 +14,12 @@ pub struct Pathfinder2rCharacterSheet {
#[Input("Weapons")]
#[InputExpr(set_items, get_items)]
weapon: [Option<Weapon>; 2],
#[Input("Health")]
#[Access(PartyMember)]
health: i32,
#[Input("Max Health")]
#[Access(PartyMember)]
max_health: i32,
// Attributes
#[Seperator]
#[Input("Strength")]
@ -124,4 +130,13 @@ impl Character<Entry> for Pathfinder2rCharacterSheet {
.map(|s| ActionDefinition { name: s.0.to_string(), targets: s.1, display_name: None, source: None, rolls: None })
.collect()
}
fn short(&self) -> CharacterShort {
CharacterShort {
title: self.name.clone(),
sub_title: Some("A Character!".to_string()),
health: Some([ "Dying", "Hurt", "Harmed", "Unharmed" ][((self.health * 4) / self.max_health) as usize].to_string()),
level: Some(1),
}
}
}