pub enum Spell {
Show 16 variants
TeamSpiritFootprints,
HeadlessHorseshoes,
CorpseGrayFootprints,
ViolentVioletFootprints,
BruisedPurpleFootprints,
GangreenFootprints,
RottenOrangeFootprints,
DieJob,
ChromaticCorruption,
PutrescentPigmentation,
SpectralSpectrum,
SinisterStaining,
VoicesFromBelow,
PumpkinBombs,
HalloweenFire,
Exorcism,
}
Expand description
Spell.
As defined by the schema these wouldn’t normally be grouped together as different types of spells fall under different attributes, but in practice they are often treated as if they are.
Variants§
TeamSpiritFootprints
HeadlessHorseshoes
CorpseGrayFootprints
ViolentVioletFootprints
BruisedPurpleFootprints
GangreenFootprints
RottenOrangeFootprints
DieJob
ChromaticCorruption
PutrescentPigmentation
SpectralSpectrum
SinisterStaining
VoicesFromBelow
PumpkinBombs
HalloweenFire
Exorcism
Implementations§
Source§impl Spell
impl Spell
Sourcepub const DEFINDEX_PAINT: u32 = 1_004u32
pub const DEFINDEX_PAINT: u32 = 1_004u32
The attribute defindex
for paint spells.
Sourcepub const DEFINDEX_FOOTPRINTS: u32 = 1_005u32
pub const DEFINDEX_FOOTPRINTS: u32 = 1_005u32
The attribute defindex
for footprints spells.
Sourcepub const DEFINDEX_VOICES_FROM_BELOW: u32 = 1_006u32
pub const DEFINDEX_VOICES_FROM_BELOW: u32 = 1_006u32
The attribute defindex
for voices from below spell.
Sourcepub const DEFINDEX_PUMPKIN_BOMBS: u32 = 1_007u32
pub const DEFINDEX_PUMPKIN_BOMBS: u32 = 1_007u32
The attribute defindex
for pumpkin bombs spell.
Sourcepub const DEFINDEX_HALLOWEEN_FIRE: u32 = 1_008u32
pub const DEFINDEX_HALLOWEEN_FIRE: u32 = 1_008u32
The attribute defindex
for halloween fire spell.
Sourcepub const DEFINDEX_EXORCISM: u32 = 1_009u32
pub const DEFINDEX_EXORCISM: u32 = 1_009u32
The attribute defindex
for exorcism spell.
Sourcepub fn attribute_defindex(&self) -> u32
pub fn attribute_defindex(&self) -> u32
Gets the attribute defindex
of this spell.
Sourcepub fn attribute_id(&self) -> Option<u32>
pub fn attribute_id(&self) -> Option<u32>
Gets the attribute ID used to identify this spell. This will only return a value for footprints spells and paint spells.
Sourcepub fn is_paint_spell(&self) -> bool
pub fn is_paint_spell(&self) -> bool
Checks if this spell is a paint spell.
Sourcepub fn is_footprints_spell(&self) -> bool
pub fn is_footprints_spell(&self) -> bool
Checks if this spell is a footprints spell.
Trait Implementations§
Source§impl Attributes for Spell
impl Attributes for Spell
Source§const ATTRIBUTES: &'static [AttributeDef]
const ATTRIBUTES: &'static [AttributeDef]
Represents the “set_item_tint_rgb_override”, “halloween_footstep_type”, “halloween_voice_modulation”, “halloween_pumpkin_explosions”, “halloween_green_flames”, and “halloween_death_ghosts” attributes.
Source§fn attribute_float_value(&self) -> Option<f32>
fn attribute_float_value(&self) -> Option<f32>
Gets the value of an attribute belonging to a group of spells.
Footprints and paint spells share a common attribute but have specific values that correspond to which spell is being referenced that can be used to identify the spell.
§Examples
use tf2_enum::{Spell, Attributes};
assert_eq!(Spell::DieJob.attribute_float_value(), Some(0.));
assert_eq!(Spell::HeadlessHorseshoes.attribute_float_value(), Some(2.));
// 1 means true in this context
assert_eq!(Spell::Exorcism.attribute_float_value(), Some(1.));
Source§const USES_FLOAT_VALUE: bool = true
const USES_FLOAT_VALUE: bool = true
Attribute::USES_FLOAT_VALUE
. This applies to all attributes in the set.