lf2_parse/
weapon_strength.rs

1/// Attack strength of a light weapon.
2///
3/// This is used when the `attacking` tag on a `WPoint` `kind: 1` is non-zero.
4///
5/// See https://lf-empire.de/lf2-empire/data-changing/types/168-type-1-light-weapons
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7pub struct WeaponStrength {
8    /// Acceleration to place on the hit object in the X axis.
9    pub d_vx: i64,
10    /// Acceleration to place on the hit object in the Y axis.
11    pub d_vy: i64,
12    /// Delay before another hit may happen, restricts this `Itr` to one object.
13    pub arest: u32,
14    /// Delay before another hit may happen, allows multiple objects to be hit.
15    pub vrest: u32,
16    /// How much a character is "off balance".
17    ///
18    /// The `fall` value determines how an attacked character will react to this
19    /// itr by flinching, getting into the stunned frames, or `falling`. If no
20    /// value is specified, the default of `20` will be used.
21    ///
22    /// * If a character accumulates `20` `fall` points, he switches to
23    ///   `injured1` (`220`).
24    /// * If a character accumulates `40` `fall` points, he switches to
25    ///   `injured2` (`222`) or `injured2back` (`224`) depending on the
26    ///   direction he is hit, and will fall if he is in mid-air.
27    /// * If a character accumulates `60` `fall` points, he switches into the
28    ///   `stunned` (`226`) frames where he can be grabbed or hit by
29    ///   `super_punch`.
30    ///
31    /// Attacks with `fall: 41` or more can hit `falling` characters.
32    ///
33    /// Here are a few values as a rule of thumb for various `fall` values:
34    ///
35    /// | `fall` | Description                                              |
36    /// | -----: | :------------------------------------------------------- |
37    /// |     -1 | Does not go into injured frames and harder to knockdown. |
38    /// |      1 | Never stun, never fall (Davis DvA shrafe)                |
39    /// |     20 | 3 hit stun, 4 hit fall                                   |
40    /// |     25 | 2 hit stun, 3 hit fall (Dennis normal kick)              |
41    /// |     40 | Does not stun, 2 hit fall (baseball bat normal swing)    |
42    /// |     60 | 1 hit stun, 2 hit fall (Henry's arrow)                   |
43    /// |     70 | 1 hit fall                                               |
44    ///
45    /// Every 1 TU, a `fall` point is deducted.
46    pub fall: i32,
47    /// Broken-defence points.
48    ///
49    /// `bdefend` points determine if a character is able to block an attack by
50    /// defending or if he will go to the broken-defense-frames. As long as he
51    /// has 30 or less Bdefend-points, he will be able to block the attack, if
52    /// it's 31 or higher, he goes to the broken-defense-frames. If an itr hits
53    /// the character while he is not in the defend-frames, his `bdefend`
54    /// counter will automatically increase to 45. If you have, for example,
55    /// accumulated 31 points and get hit during your defense (assuming you have
56    /// specified a positive `bdefend` value in the hitting itr), the character
57    /// will go to the broken-defense-frames.
58    ///
59    /// Here are some common values for various `bdefend` values:
60    ///
61    /// | `bdefend` | Description                                       |
62    /// | --------: | :------------------------------------------------ |
63    /// |         0 | never breaks defense (ex: John's D>J shield)      |
64    /// |        12 | 4 hit break                                       |
65    /// |        16 | 3 hit break                                       |
66    /// |        30 | 2 hit break                                       |
67    /// |        60 | 1 hit break                                       |
68    /// |       100 | ignores defense, sets `bdefend` counter to `45`,\
69    ///               and instantly destroys weapons.                   |
70    ///
71    /// Every 1 TU, a `bdefend` point is deducted, so he will be able to recover
72    /// his defense.
73    ///
74    /// Armor will function as long as a character has not accumulated more
75    /// `bdefend` points than the specific armor points of Louis(1), Knight or
76    /// Julian(15) at the time of attack. For example, Julian can resist a dash
77    /// attack(bdefend 60) even though he only has 15 armor points, but he will
78    /// be left completely vulnerable for the next 45 TU until he regains his
79    /// 1st armor point.
80    pub b_defend: i32,
81    /// Amount of damage to inflict on the target object.
82    pub injury: i32,
83}