Struct ffxiv_crafting::Status

source ·
pub struct Status {
    pub buffs: Buffs,
    pub attributes: Attributes,
    pub recipe: Recipe,
    pub caches: Caches,
    pub durability: u16,
    pub craft_points: i32,
    pub progress: u16,
    pub quality: u32,
    pub step: i32,
    pub condition: Condition,
}
Expand description

Status 储存一次制作模拟所需的全部状态信息

Fields§

§buffs: Buffs

玩家当前身上的buff

§attributes: Attributes

玩家的装备属性

§recipe: Recipe

本次制作配方

§caches: Caches

预计算数据

§durability: u16

剩余耐久

§craft_points: i32

剩余制作力

§progress: u16

进展

§quality: u32

品质

§step: i32

步数

§condition: Condition

制作状态

Implementations§

source§

impl Status

source

pub fn new(attributes: Attributes, recipe: Recipe, rlv: RecipeLevel) -> Self

source

pub fn calc_durability(&self, durability: u16) -> u16

source

pub fn calc_synthesis(&self, efficiency: f32) -> u16

source

pub fn calc_touch(&self, efficiency: f32) -> u32

source

pub fn new_duration_buff(&self, dt: u8) -> u8

source

pub fn craft_point(&self, skill: Actions) -> i32

计算当前状态指定技能消耗的CP。 考虑连击与球色

source

pub fn cast_action(&mut self, action: Actions)

发动一次技能。

source

pub fn success_rate(&self, action: Actions) -> u8

计算当前状态下某技能的成功概率,返回结果介于[0..=100]之间。

source

pub fn is_action_allowed(&self, action: Actions) -> Result<(), CastActionError>

当前状态是否允许发动某技能。

source

pub fn is_finished(&self) -> bool

本次制作是否已经结束。

source

pub fn high_quality_probability(&self) -> Option<i32>

计算当前状态的HQ概率。 返回一个百分数,即: 如果返回89,则代表概率为89%。

Calculate the HQ probability of current status. The return value is a percentage, that is, if 89 is returned, it means that the probability is 89%.

Trait Implementations§

source§

impl Clone for Status

source§

fn clone(&self) -> Status

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Status

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Status

§

impl RefUnwindSafe for Status

§

impl Send for Status

§

impl Sync for Status

§

impl Unpin for Status

§

impl UnwindSafe for Status

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.