ed_journals/modules/odyssey/models/
weapon.rs

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
82
83
84
85
86
87
88
89
90
91
92
93
use std::fmt::{Display, Formatter};

use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
pub enum Weapon {
    #[serde(
        alias = "Wpn_M_AssaultRifle_Kinetic_FAuto",
        alias = "wpn_m_assaultrifle_kinetic_fauto"
    )]
    KarmaAR50,

    #[serde(
        alias = "Wpn_M_SubMachineGun_Kinetic_FAuto",
        alias = "wpn_m_submachinegun_kinetic_fauto"
    )]
    KarmaC44,

    #[serde(
        alias = "Wpn_M_Launcher_Rocket_SAuto",
        alias = "wpn_m_launcher_rocket_sauto"
    )]
    KarmaL6,

    #[serde(
        alias = "Wpn_S_Pistol_Kinetic_SAuto",
        alias = "wpn_s_pistol_kinetic_sauto"
    )]
    KarmaP15,

    #[serde(
        alias = "Wpn_M_Sniper_Plasma_Charged",
        alias = "wpn_m_sniper_plasma_charged"
    )]
    ManticoreExecutioner,

    #[serde(
        alias = "Wpn_M_Shotgun_Plasma_DoubleBarrel",
        alias = "wpn_m_shotgun_plasma_doublebarrel"
    )]
    ManticoreIntimidator,

    #[serde(
        alias = "Wpn_M_AssaultRifle_Plasma_FAuto",
        alias = "wpn_m_assaultrifle_plasma_fauto"
    )]
    ManticoreOppressor,

    #[serde(
        alias = "Wpn_S_Pistol_Plasma_Charged",
        alias = "wpn_s_pistol_plasma_charged"
    )]
    ManticoreTormentor,

    #[serde(
        alias = "Wpn_M_AssaultRifle_Laser_FAuto",
        alias = "wpn_m_assaultrifle_laser_fauto"
    )]
    TKAphelion,

    #[serde(
        alias = "Wpn_M_SubMachineGun_Laser_FAuto",
        alias = "wpn_m_submachinegun_laser_fauto"
    )]
    TKEclipse,

    #[serde(alias = "Wpn_S_Pistol_Laser_SAuto", alias = "wpn_s_pistol_laser_sauto")]
    TKZenith,
}

impl Display for Weapon {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        write!(
            f,
            "{}",
            match self {
                Weapon::KarmaAR50 => "Karma AR-50",
                Weapon::KarmaC44 => "Karma C-44",
                Weapon::KarmaL6 => "Karma L-6",
                Weapon::KarmaP15 => "Karma P-15",

                Weapon::ManticoreExecutioner => "Manticore Executioner",
                Weapon::ManticoreIntimidator => "Manticore Intimidator",
                Weapon::ManticoreOppressor => "Manticore Oppressor",
                Weapon::ManticoreTormentor => "Manticore Tormentor",

                Weapon::TKAphelion => "TK Aphelion",
                Weapon::TKEclipse => "TK Eclipse",
                Weapon::TKZenith => "TK Zenith ",
            }
        )
    }
}