pub enum FractionOf {
MaxHp,
CurHp,
LastDamage,
}Expand description
The denominator base for a fraction op (doc 11 §1.1).
Variants§
MaxHp
Fraction of the selector’s max_hp.
CurHp
Fraction of the selector’s current hp.
LastDamage
Fraction of the damage the in-flight move just dealt (the move
execution’s ctx.mv.last_damage; blueprint 15 §2 P2). This is the base
Gen-1 Drain (HealFraction of half the damage dealt) and Recoil
(DamageFraction of a quarter the damage dealt) read. Floors at 1 like
the legacy (dealt / d).max(1) — a non-zero damage event always drains /
recoils at least 1 (a 0-damage event yields 0). Pure read of ctx.mv; no
entropy. Selecting LastDamage for a non-on-hit hook yields whatever
last_damage holds (0 before any hit), so author it only on DamagingHit.
Trait Implementations§
Source§impl Clone for FractionOf
impl Clone for FractionOf
Source§fn clone(&self) -> FractionOf
fn clone(&self) -> FractionOf
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for FractionOf
Source§impl Debug for FractionOf
impl Debug for FractionOf
Source§impl Default for FractionOf
impl Default for FractionOf
Source§impl<'de> Deserialize<'de> for FractionOf
impl<'de> Deserialize<'de> for FractionOf
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for FractionOf
Source§impl PartialEq for FractionOf
impl PartialEq for FractionOf
impl StructuralPartialEq for FractionOf
Auto Trait Implementations§
impl Freeze for FractionOf
impl RefUnwindSafe for FractionOf
impl Send for FractionOf
impl Sync for FractionOf
impl Unpin for FractionOf
impl UnsafeUnpin for FractionOf
impl UnwindSafe for FractionOf
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
Mutably borrows from an owned value. Read more