1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
use num_enum::{IntoPrimitive, TryFromPrimitive};

#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};

#[cfg(feature = "strum")]
use strum::{Display, EnumCount, EnumIter, IntoStaticStr, VariantNames};

/// Attributes for buff formulas.
///
/// Used in [`StateChange::BuffFormula`](crate::StateChange::BuffFormula) events.
/// This enum is different from the game's own attribute ids.
#[derive(
    Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, IntoPrimitive, TryFromPrimitive,
)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(
    feature = "strum",
    derive(Display, EnumCount, EnumIter, IntoStaticStr, VariantNames)
)]
#[repr(u16)]
pub enum Attribute {
    None = 0,

    /// Power.
    Power = 1,

    /// Precision.
    Precision = 2,

    /// Toughness.
    Toughness = 3,

    /// Vitality.
    Vitality = 4,

    /// Ferocity.
    Ferocity = 5,

    /// Healing.
    Healing = 6,

    /// Condition Damage.
    Condition = 7,

    /// Concentration.
    Concentration = 8,

    /// Expertise.
    Expertise = 9,

    /// Armor.
    Armor = 10,

    /// Agony Resistance.
    Agony = 11,

    /// Stat increase.
    StatInc = 12,

    /// Outgoing strike damage.
    PhysInc = 13,

    /// Outgoing condition damage.
    CondInc = 14,

    /// Incoming strike damage.
    PhysRec = 15,

    /// Incoming condition damage.
    CondRec = 16,

    /// Attack speed.
    AttackSpeed = 17,

    /// Outgoing life leech.
    SiphonInc = 18,

    /// Incoming life leech.
    SiphonRec = 19,
}