pub struct MonsterSheet {Show 30 fields
pub name: String,
pub size: String,
pub kind: String,
pub alignment: String,
pub armor_class: u8,
pub armor: String,
pub hit_points: u16,
pub hit_dice: String,
pub speed: String,
pub ability_scores: AbilityScores,
pub initiative: Option<i8>,
pub saving_throws: BTreeMap<Ability, i8>,
pub skills: BTreeMap<Skill, i8>,
pub damage_vulnerabilities: Vec<String>,
pub damage_resistances: Vec<String>,
pub damage_immunities: Vec<String>,
pub condition_immunities: Vec<String>,
pub senses: String,
pub languages: String,
pub challenge: String,
pub xp: u32,
pub proficiency_bonus: i8,
pub traits: Vec<Feature>,
pub actions: Vec<Feature>,
pub bonus_actions: Vec<Feature>,
pub reactions: Vec<Feature>,
pub legendary_actions: Vec<Feature>,
pub source: String,
pub edition: Option<Edition>,
pub notes: String,
}Expand description
A full stat block. Everything but the name has a default, so a file needs only what the monster actually has.
Fields§
§name: String§size: String“Medium”, “Large”…
kind: StringThe creature type: “humanoid (goblinoid)”, “dragon”…
alignment: String§armor_class: u8§armor: StringWhat the AC comes from: “leather armor, shield”.
hit_points: u16The average, as printed.
hit_dice: StringThe hit dice, e.g. “2d6” or “18d10+36”; empty if there are none.
speed: String“30 ft., fly 60 ft.”
ability_scores: AbilityScores§initiative: Option<i8>Overrides the Dexterity modifier (2024 stat blocks print it).
saving_throws: BTreeMap<Ability, i8>Saving throw bonuses that differ from the plain modifier.
skills: BTreeMap<Skill, i8>§damage_vulnerabilities: Vec<String>§damage_resistances: Vec<String>§damage_immunities: Vec<String>§condition_immunities: Vec<String>§senses: String“darkvision 60 ft., passive Perception 9”
languages: String§challenge: StringThe challenge rating as printed: “0”, “1/8”, “1/4”, “1/2”, “1”…
xp: u32§proficiency_bonus: i8§traits: Vec<Feature>§actions: Vec<Feature>§bonus_actions: Vec<Feature>§reactions: Vec<Feature>§legendary_actions: Vec<Feature>§source: StringWhere it’s from: “SRD 5.1”, “SRD 5.2”, “Homebrew”…
edition: Option<Edition>The rules it’s written for; None suits either.
notes: StringImplementations§
Source§impl MonsterSheet
impl MonsterSheet
Sourcepub fn validate(&self) -> Result<(), MonsterError>
pub fn validate(&self) -> Result<(), MonsterError>
Checks the stat block: a name, hit points, hit dice that can be read, and ability scores from 1 to 30.
Sourcepub fn hit_dice(&self) -> Option<HitDice>
pub fn hit_dice(&self) -> Option<HitDice>
Its hit dice, if it has any that can be read (8d10+40).
Sourcepub fn max_hit_points(&self) -> u16
pub fn max_hit_points(&self) -> u16
The most hit points it can have: its hit dice’s maximum, or the printed number if it has no hit dice.
Sourcepub fn experience_points(&self) -> u32
pub fn experience_points(&self) -> u32
Its experience points, from its challenge rating if not given.
Sourcepub fn initiative_modifier(&self) -> i8
pub fn initiative_modifier(&self) -> i8
What it adds to initiative: initiative if given, otherwise its
Dexterity modifier.
Sourcepub fn challenge_value(&self) -> f32
pub fn challenge_value(&self) -> f32
The challenge rating as a number, for sorting: “1/4” is 0.25.
Trait Implementations§
Source§impl Clone for MonsterSheet
impl Clone for MonsterSheet
Source§fn clone(&self) -> MonsterSheet
fn clone(&self) -> MonsterSheet
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ComposeSchema for MonsterSheet
impl ComposeSchema for MonsterSheet
Source§impl Debug for MonsterSheet
impl Debug for MonsterSheet
Source§impl Default for MonsterSheet
impl Default for MonsterSheet
Source§impl<'de> Deserialize<'de> for MonsterSheetwhere
MonsterSheet: Default,
impl<'de> Deserialize<'de> for MonsterSheetwhere
MonsterSheet: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for MonsterSheet
impl PartialEq for MonsterSheet
Source§fn eq(&self, other: &MonsterSheet) -> bool
fn eq(&self, other: &MonsterSheet) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for MonsterSheet
impl Serialize for MonsterSheet
Source§impl ToSchema for MonsterSheet
impl ToSchema for MonsterSheet
impl Eq for MonsterSheet
impl StructuralPartialEq for MonsterSheet
Auto Trait Implementations§
impl Freeze for MonsterSheet
impl RefUnwindSafe for MonsterSheet
impl Send for MonsterSheet
impl Sync for MonsterSheet
impl Unpin for MonsterSheet
impl UnsafeUnpin for MonsterSheet
impl UnwindSafe for MonsterSheet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.