From f3e6b1e63e6c738b1277c31b1114878ebaa37d40 Mon Sep 17 00:00:00 2001 From: jake Date: Thu, 6 Feb 2020 23:03:51 -0800 Subject: [PATCH] initial item enums, move logic from libpso to elseware --- src/entity/item/armor.rs | 410 +++++++ src/entity/{item.rs => item/mod.rs} | 23 +- src/entity/item/shield.rs | 717 ++++++++++++ src/entity/item/tool.rs | 566 +++++++++ src/entity/item/weapon.rs | 1688 +++++++++++++++++++++++++++ src/login/character.rs | 2 +- src/main.rs | 6 +- src/ship/items.rs | 5 +- 8 files changed, 3404 insertions(+), 13 deletions(-) create mode 100644 src/entity/item/armor.rs rename src/entity/{item.rs => item/mod.rs} (82%) create mode 100644 src/entity/item/shield.rs create mode 100644 src/entity/item/tool.rs create mode 100644 src/entity/item/weapon.rs diff --git a/src/entity/item/armor.rs b/src/entity/item/armor.rs new file mode 100644 index 0000000..3e2a235 --- /dev/null +++ b/src/entity/item/armor.rs @@ -0,0 +1,410 @@ +use std::convert::{TryFrom, Into}; + +pub enum ArmorTypeError { + UnknownArmor(String) +} + +#[derive(Debug, Copy, Clone, PartialEq)] +pub enum ArmorType { + Frame, + Armor, + PsyArmor, + GigaFrame, + SoulFrame, + CrossArmor, + SolidFrame, + BraveArmor, + HyperFrame, + GrandArmor, + ShockFrame, + KingsFrame, + DragonFrame, + AbsorbArmor, + ProtectFrame, + GeneralArmor, + PerfectFrame, + ValiantFrame, + ImperialArmor, + HolinessArmor, + GuardianArmor, + DivinityArmor, + UltimateFrame, + CelestialArmor, + HunterField, + RangerField, + ForceField, + RevivalGarment, + SpiritGarment, + StinkFrame, + DPartsver101, + DPartsver210, + ParasiteWeardeRol, + ParasiteWearnelgal, + ParasiteWearvajulla, + SensePlate, + GravitonPlate, + AttributePlate, + FlowensFrame, + CustomFrameveroo, + DbsArmor, + GuardWave, + DfField, + LuminousField, + ChuChuFever, + LoveHeart, + FlameGarment, + VirusArmorlafuteria, + BrightnessCircle, + AuraField, + ElectroFrame, + SacredCloth, + SmokingPlate, + StarCuirass, + BlackHoundCuirass, + MorningPrayer, + BlackOdoshiDomaru, + RedOdoshiDomaru, + BlackOdoshiRedNimaidou, + BlueOdoshiVioletNimaidou, + DirtyLifejacket, + KroesSweater, + WeddingDress, + SonicteamArmor, + RedCoat, + Thirteen, + MotherGarb, + MotherGarb2, + DressPlate, + Sweetheart, + IgnitionCloak, + CongealCloak, + TempestCloak, + CursedCloak, + SelectCloak, + SpiritCuirass, + RevivalCuriass, + AllianceUniform, + OfficerUniform, + CommanderUniform, + CrimsonCoat, + InfantryGear, + LieutenantGear, + InfantryMantle, + LieutenantMantle, + UnionField, + SamuraiArmor, + StealthSuit, +} + +impl ArmorType { + pub fn value(&self) -> [u8; 3] { + match self { + ArmorType::Frame => [0x01, 0x01, 0x00], + ArmorType::Armor => [0x01, 0x01, 0x01], + ArmorType::PsyArmor => [0x01, 0x01, 0x02], + ArmorType::GigaFrame => [0x01, 0x01, 0x03], + ArmorType::SoulFrame => [0x01, 0x01, 0x04], + ArmorType::CrossArmor => [0x01, 0x01, 0x05], + ArmorType::SolidFrame => [0x01, 0x01, 0x06], + ArmorType::BraveArmor => [0x01, 0x01, 0x07], + ArmorType::HyperFrame => [0x01, 0x01, 0x08], + ArmorType::GrandArmor => [0x01, 0x01, 0x09], + ArmorType::ShockFrame => [0x01, 0x01, 0x0A], + ArmorType::KingsFrame => [0x01, 0x01, 0x0B], + ArmorType::DragonFrame => [0x01, 0x01, 0x0C], + ArmorType::AbsorbArmor => [0x01, 0x01, 0x0D], + ArmorType::ProtectFrame => [0x01, 0x01, 0x0E], + ArmorType::GeneralArmor => [0x01, 0x01, 0x0F], + ArmorType::PerfectFrame => [0x01, 0x01, 0x10], + ArmorType::ValiantFrame => [0x01, 0x01, 0x11], + ArmorType::ImperialArmor => [0x01, 0x01, 0x12], + ArmorType::HolinessArmor => [0x01, 0x01, 0x13], + ArmorType::GuardianArmor => [0x01, 0x01, 0x14], + ArmorType::DivinityArmor => [0x01, 0x01, 0x15], + ArmorType::UltimateFrame => [0x01, 0x01, 0x16], + ArmorType::CelestialArmor => [0x01, 0x01, 0x17], + ArmorType::HunterField => [0x01, 0x01, 0x18], + ArmorType::RangerField => [0x01, 0x01, 0x19], + ArmorType::ForceField => [0x01, 0x01, 0x1A], + ArmorType::RevivalGarment => [0x01, 0x01, 0x1B], + ArmorType::SpiritGarment => [0x01, 0x01, 0x1C], + ArmorType::StinkFrame => [0x01, 0x01, 0x1D], + ArmorType::DPartsver101 => [0x01, 0x01, 0x1E], + ArmorType::DPartsver210 => [0x01, 0x01, 0x1F], + ArmorType::ParasiteWeardeRol => [0x01, 0x01, 0x20], + ArmorType::ParasiteWearnelgal => [0x01, 0x01, 0x21], + ArmorType::ParasiteWearvajulla => [0x01, 0x01, 0x22], + ArmorType::SensePlate => [0x01, 0x01, 0x23], + ArmorType::GravitonPlate => [0x01, 0x01, 0x24], + ArmorType::AttributePlate => [0x01, 0x01, 0x25], + ArmorType::FlowensFrame => [0x01, 0x01, 0x26], + ArmorType::CustomFrameveroo => [0x01, 0x01, 0x27], + ArmorType::DbsArmor => [0x01, 0x01, 0x28], + ArmorType::GuardWave => [0x01, 0x01, 0x29], + ArmorType::DfField => [0x01, 0x01, 0x2A], + ArmorType::LuminousField => [0x01, 0x01, 0x2B], + ArmorType::ChuChuFever => [0x01, 0x01, 0x2C], + ArmorType::LoveHeart => [0x01, 0x01, 0x2D], + ArmorType::FlameGarment => [0x01, 0x01, 0x2E], + ArmorType::VirusArmorlafuteria => [0x01, 0x01, 0x2F], + ArmorType::BrightnessCircle => [0x01, 0x01, 0x30], + ArmorType::AuraField => [0x01, 0x01, 0x31], + ArmorType::ElectroFrame => [0x01, 0x01, 0x32], + ArmorType::SacredCloth => [0x01, 0x01, 0x33], + ArmorType::SmokingPlate => [0x01, 0x01, 0x34], + ArmorType::StarCuirass => [0x01, 0x01, 0x35], + ArmorType::BlackHoundCuirass => [0x01, 0x01, 0x36], + ArmorType::MorningPrayer => [0x01, 0x01, 0x37], + ArmorType::BlackOdoshiDomaru => [0x01, 0x01, 0x38], + ArmorType::RedOdoshiDomaru => [0x01, 0x01, 0x39], + ArmorType::BlackOdoshiRedNimaidou => [0x01, 0x01, 0x3A], + ArmorType::BlueOdoshiVioletNimaidou => [0x01, 0x01, 0x3B], + ArmorType::DirtyLifejacket => [0x01, 0x01, 0x3C], + ArmorType::KroesSweater => [0x01, 0x01, 0x3D], + ArmorType::WeddingDress => [0x01, 0x01, 0x3E], + ArmorType::SonicteamArmor => [0x01, 0x01, 0x3F], + ArmorType::RedCoat => [0x01, 0x01, 0x40], + ArmorType::Thirteen => [0x01, 0x01, 0x41], + ArmorType::MotherGarb => [0x01, 0x01, 0x42], + ArmorType::MotherGarb2 => [0x01, 0x01, 0x43], + ArmorType::DressPlate => [0x01, 0x01, 0x44], + ArmorType::Sweetheart => [0x01, 0x01, 0x45], + ArmorType::IgnitionCloak => [0x01, 0x01, 0x46], + ArmorType::CongealCloak => [0x01, 0x01, 0x47], + ArmorType::TempestCloak => [0x01, 0x01, 0x48], + ArmorType::CursedCloak => [0x01, 0x01, 0x49], + ArmorType::SelectCloak => [0x01, 0x01, 0x4A], + ArmorType::SpiritCuirass => [0x01, 0x01, 0x4B], + ArmorType::RevivalCuriass => [0x01, 0x01, 0x4C], + ArmorType::AllianceUniform => [0x01, 0x01, 0x4D], + ArmorType::OfficerUniform => [0x01, 0x01, 0x4E], + ArmorType::CommanderUniform => [0x01, 0x01, 0x4F], + ArmorType::CrimsonCoat => [0x01, 0x01, 0x50], + ArmorType::InfantryGear => [0x01, 0x01, 0x51], + ArmorType::LieutenantGear => [0x01, 0x01, 0x52], + ArmorType::InfantryMantle => [0x01, 0x01, 0x53], + ArmorType::LieutenantMantle => [0x01, 0x01, 0x54], + ArmorType::UnionField => [0x01, 0x01, 0x55], + ArmorType::SamuraiArmor => [0x01, 0x01, 0x56], + ArmorType::StealthSuit => [0x01, 0x01, 0x57], + } + } +} + +impl TryFrom<&str> for ArmorType { + type Error = ArmorTypeError; + fn try_from(value: &str) -> Result { + match value { + "Frame" => Ok(ArmorType::Frame), + "Armor" => Ok(ArmorType::Armor), + "PsyArmor" => Ok(ArmorType::PsyArmor), + "GigaFrame" => Ok(ArmorType::GigaFrame), + "SoulFrame" => Ok(ArmorType::SoulFrame), + "CrossArmor" => Ok(ArmorType::CrossArmor), + "SolidFrame" => Ok(ArmorType::SolidFrame), + "BraveArmor" => Ok(ArmorType::BraveArmor), + "HyperFrame" => Ok(ArmorType::HyperFrame), + "GrandArmor" => Ok(ArmorType::GrandArmor), + "ShockFrame" => Ok(ArmorType::ShockFrame), + "KingsFrame" => Ok(ArmorType::KingsFrame), + "DragonFrame" => Ok(ArmorType::DragonFrame), + "AbsorbArmor" => Ok(ArmorType::AbsorbArmor), + "ProtectFrame" => Ok(ArmorType::ProtectFrame), + "GeneralArmor" => Ok(ArmorType::GeneralArmor), + "PerfectFrame" => Ok(ArmorType::PerfectFrame), + "ValiantFrame" => Ok(ArmorType::ValiantFrame), + "ImperialArmor" => Ok(ArmorType::ImperialArmor), + "HolinessArmor" => Ok(ArmorType::HolinessArmor), + "GuardianArmor" => Ok(ArmorType::GuardianArmor), + "DivinityArmor" => Ok(ArmorType::DivinityArmor), + "UltimateFrame" => Ok(ArmorType::UltimateFrame), + "CelestialArmor" => Ok(ArmorType::CelestialArmor), + "HunterField" => Ok(ArmorType::HunterField), + "RangerField" => Ok(ArmorType::RangerField), + "ForceField" => Ok(ArmorType::ForceField), + "RevivalGarment" => Ok(ArmorType::RevivalGarment), + "SpiritGarment" => Ok(ArmorType::SpiritGarment), + "StinkFrame" => Ok(ArmorType::StinkFrame), + "DPartsver101" => Ok(ArmorType::DPartsver101), + "DPartsver210" => Ok(ArmorType::DPartsver210), + "ParasiteWeardeRol" => Ok(ArmorType::ParasiteWeardeRol), + "ParasiteWearnelgal" => Ok(ArmorType::ParasiteWearnelgal), + "ParasiteWearvajulla" => Ok(ArmorType::ParasiteWearvajulla), + "SensePlate" => Ok(ArmorType::SensePlate), + "GravitonPlate" => Ok(ArmorType::GravitonPlate), + "AttributePlate" => Ok(ArmorType::AttributePlate), + "FlowensFrame" => Ok(ArmorType::FlowensFrame), + "CustomFrameveroo" => Ok(ArmorType::CustomFrameveroo), + "DbsArmor" => Ok(ArmorType::DbsArmor), + "GuardWave" => Ok(ArmorType::GuardWave), + "DfField" => Ok(ArmorType::DfField), + "LuminousField" => Ok(ArmorType::LuminousField), + "ChuChuFever" => Ok(ArmorType::ChuChuFever), + "LoveHeart" => Ok(ArmorType::LoveHeart), + "FlameGarment" => Ok(ArmorType::FlameGarment), + "VirusArmorlafuteria" => Ok(ArmorType::VirusArmorlafuteria), + "BrightnessCircle" => Ok(ArmorType::BrightnessCircle), + "AuraField" => Ok(ArmorType::AuraField), + "ElectroFrame" => Ok(ArmorType::ElectroFrame), + "SacredCloth" => Ok(ArmorType::SacredCloth), + "SmokingPlate" => Ok(ArmorType::SmokingPlate), + "StarCuirass" => Ok(ArmorType::StarCuirass), + "BlackHoundCuirass" => Ok(ArmorType::BlackHoundCuirass), + "MorningPrayer" => Ok(ArmorType::MorningPrayer), + "BlackOdoshiDomaru" => Ok(ArmorType::BlackOdoshiDomaru), + "RedOdoshiDomaru" => Ok(ArmorType::RedOdoshiDomaru), + "BlackOdoshiRedNimaidou" => Ok(ArmorType::BlackOdoshiRedNimaidou), + "BlueOdoshiVioletNimaidou" => Ok(ArmorType::BlueOdoshiVioletNimaidou), + "DirtyLifejacket" => Ok(ArmorType::DirtyLifejacket), + "KroesSweater" => Ok(ArmorType::KroesSweater), + "WeddingDress" => Ok(ArmorType::WeddingDress), + "SonicteamArmor" => Ok(ArmorType::SonicteamArmor), + "RedCoat" => Ok(ArmorType::RedCoat), + "Thirteen" => Ok(ArmorType::Thirteen), + "MotherGarb" => Ok(ArmorType::MotherGarb), + "MotherGarb2" => Ok(ArmorType::MotherGarb2), + "DressPlate" => Ok(ArmorType::DressPlate), + "Sweetheart" => Ok(ArmorType::Sweetheart), + "IgnitionCloak" => Ok(ArmorType::IgnitionCloak), + "CongealCloak" => Ok(ArmorType::CongealCloak), + "TempestCloak" => Ok(ArmorType::TempestCloak), + "CursedCloak" => Ok(ArmorType::CursedCloak), + "SelectCloak" => Ok(ArmorType::SelectCloak), + "SpiritCuirass" => Ok(ArmorType::SpiritCuirass), + "RevivalCuriass" => Ok(ArmorType::RevivalCuriass), + "AllianceUniform" => Ok(ArmorType::AllianceUniform), + "OfficerUniform" => Ok(ArmorType::OfficerUniform), + "CommanderUniform" => Ok(ArmorType::CommanderUniform), + "CrimsonCoat" => Ok(ArmorType::CrimsonCoat), + "InfantryGear" => Ok(ArmorType::InfantryGear), + "LieutenantGear" => Ok(ArmorType::LieutenantGear), + "InfantryMantle" => Ok(ArmorType::InfantryMantle), + "LieutenantMantle" => Ok(ArmorType::LieutenantMantle), + "UnionField" => Ok(ArmorType::UnionField), + "SamuraiArmor" => Ok(ArmorType::SamuraiArmor), + "StealthSuit" => Ok(ArmorType::StealthSuit), + _ => Err(ArmorTypeError::UnknownArmor(value.to_string())) + } + } +} + +impl Into for ArmorType { + fn into(self) -> String { + match self { + ArmorType::Frame => "Frame", + ArmorType::Armor => "Armor", + ArmorType::PsyArmor => "PsyArmor", + ArmorType::GigaFrame => "GigaFrame", + ArmorType::SoulFrame => "SoulFrame", + ArmorType::CrossArmor => "CrossArmor", + ArmorType::SolidFrame => "SolidFrame", + ArmorType::BraveArmor => "BraveArmor", + ArmorType::HyperFrame => "HyperFrame", + ArmorType::GrandArmor => "GrandArmor", + ArmorType::ShockFrame => "ShockFrame", + ArmorType::KingsFrame => "KingsFrame", + ArmorType::DragonFrame => "DragonFrame", + ArmorType::AbsorbArmor => "AbsorbArmor", + ArmorType::ProtectFrame => "ProtectFrame", + ArmorType::GeneralArmor => "GeneralArmor", + ArmorType::PerfectFrame => "PerfectFrame", + ArmorType::ValiantFrame => "ValiantFrame", + ArmorType::ImperialArmor => "ImperialArmor", + ArmorType::HolinessArmor => "HolinessArmor", + ArmorType::GuardianArmor => "GuardianArmor", + ArmorType::DivinityArmor => "DivinityArmor", + ArmorType::UltimateFrame => "UltimateFrame", + ArmorType::CelestialArmor => "CelestialArmor", + ArmorType::HunterField => "HunterField", + ArmorType::RangerField => "RangerField", + ArmorType::ForceField => "ForceField", + ArmorType::RevivalGarment => "RevivalGarment", + ArmorType::SpiritGarment => "SpiritGarment", + ArmorType::StinkFrame => "StinkFrame", + ArmorType::DPartsver101 => "DPartsver101", + ArmorType::DPartsver210 => "DPartsver210", + ArmorType::ParasiteWeardeRol => "ParasiteWeardeRol", + ArmorType::ParasiteWearnelgal => "ParasiteWearnelgal", + ArmorType::ParasiteWearvajulla => "ParasiteWearvajulla", + ArmorType::SensePlate => "SensePlate", + ArmorType::GravitonPlate => "GravitonPlate", + ArmorType::AttributePlate => "AttributePlate", + ArmorType::FlowensFrame => "FlowensFrame", + ArmorType::CustomFrameveroo => "CustomFrameveroo", + ArmorType::DbsArmor => "DbsArmor", + ArmorType::GuardWave => "GuardWave", + ArmorType::DfField => "DfField", + ArmorType::LuminousField => "LuminousField", + ArmorType::ChuChuFever => "ChuChuFever", + ArmorType::LoveHeart => "LoveHeart", + ArmorType::FlameGarment => "FlameGarment", + ArmorType::VirusArmorlafuteria => "VirusArmorlafuteria", + ArmorType::BrightnessCircle => "BrightnessCircle", + ArmorType::AuraField => "AuraField", + ArmorType::ElectroFrame => "ElectroFrame", + ArmorType::SacredCloth => "SacredCloth", + ArmorType::SmokingPlate => "SmokingPlate", + ArmorType::StarCuirass => "StarCuirass", + ArmorType::BlackHoundCuirass => "BlackHoundCuirass", + ArmorType::MorningPrayer => "MorningPrayer", + ArmorType::BlackOdoshiDomaru => "BlackOdoshiDomaru", + ArmorType::RedOdoshiDomaru => "RedOdoshiDomaru", + ArmorType::BlackOdoshiRedNimaidou => "BlackOdoshiRedNimaidou", + ArmorType::BlueOdoshiVioletNimaidou => "BlueOdoshiVioletNimaidou", + ArmorType::DirtyLifejacket => "DirtyLifejacket", + ArmorType::KroesSweater => "KroesSweater", + ArmorType::WeddingDress => "WeddingDress", + ArmorType::SonicteamArmor => "SonicteamArmor", + ArmorType::RedCoat => "RedCoat", + ArmorType::Thirteen => "Thirteen", + ArmorType::MotherGarb => "MotherGarb", + ArmorType::MotherGarb2 => "MotherGarb2", + ArmorType::DressPlate => "DressPlate", + ArmorType::Sweetheart => "Sweetheart", + ArmorType::IgnitionCloak => "IgnitionCloak", + ArmorType::CongealCloak => "CongealCloak", + ArmorType::TempestCloak => "TempestCloak", + ArmorType::CursedCloak => "CursedCloak", + ArmorType::SelectCloak => "SelectCloak", + ArmorType::SpiritCuirass => "SpiritCuirass", + ArmorType::RevivalCuriass => "RevivalCuriass", + ArmorType::AllianceUniform => "AllianceUniform", + ArmorType::OfficerUniform => "OfficerUniform", + ArmorType::CommanderUniform => "CommanderUniform", + ArmorType::CrimsonCoat => "CrimsonCoat", + ArmorType::InfantryGear => "InfantryGear", + ArmorType::LieutenantGear => "LieutenantGear", + ArmorType::InfantryMantle => "InfantryMantle", + ArmorType::LieutenantMantle => "LieutenantMantle", + ArmorType::UnionField => "UnionField", + ArmorType::SamuraiArmor => "SamuraiArmor", + ArmorType::StealthSuit => "StealthSuit", + }.to_string() + } +} + +// TODO: TryFrom<&str> maybe done check please +// TODO Into ^^ + + +#[derive(Debug, Copy, Clone, PartialEq)] +pub struct Armor { + pub armor: ArmorType, + pub dfp: u8, + pub evp: u8, + pub slots: u8, +} + + + + + +impl Armor { + pub fn as_bytes(&self) -> [u8; 16] { + let mut result = [0; 16]; + result[0..3].copy_from_slice(&self.armor.value()); + // TODO: other attrs + + result + } +} diff --git a/src/entity/item.rs b/src/entity/item/mod.rs similarity index 82% rename from src/entity/item.rs rename to src/entity/item/mod.rs index 3f280cc..1ecf08a 100644 --- a/src/entity/item.rs +++ b/src/entity/item/mod.rs @@ -1,4 +1,9 @@ -use libpso::item; +pub mod weapon; +pub mod armor; +pub mod shield; +pub mod tool; + +//use libpso::item; use libpso::character::character; @@ -22,6 +27,14 @@ pub enum ItemLocation { // floor: eventually // x y z: ????? }, + /*Destroyed { + // marks an item that has been consumed in some way + }, + Transformed { + item_id, + change_event + } +*/ } @@ -29,24 +42,24 @@ pub enum ItemLocation { #[derive(Clone, Debug, PartialEq)] pub struct Weapon { pub equipped: bool, - pub weapon: item::weapon::Weapon, + pub weapon: weapon::Weapon, } #[derive(Clone, Debug, PartialEq)] pub struct Armor { pub equipped: bool, - pub armor: item::armor::Armor, + pub armor: armor::Armor, } #[derive(Clone, Debug, PartialEq)] pub struct Shield { pub equipped: bool, - pub shield: item::shield::Shield, + pub shield: shield::Shield, } #[derive(Clone, Debug, PartialEq)] pub struct Tool { - pub tool: item::tool::ToolType, + pub tool: tool::ToolType, } impl Tool { diff --git a/src/entity/item/shield.rs b/src/entity/item/shield.rs new file mode 100644 index 0000000..fb58f81 --- /dev/null +++ b/src/entity/item/shield.rs @@ -0,0 +1,717 @@ +use std::convert::{TryFrom, Into}; + +pub enum ShieldTypeError { + UnknownShield(String) +} + +#[derive(Debug, Copy, Clone, PartialEq)] +pub enum ShieldType { + Barrier, + Shield, + CoreShield, + GigaShield, + SoulBarrier, + HardShield, + BraveBarrier, + SolidShield, + FlameBarrier, + PlasmaBarrier, + FreezeBarrier, + PsychicBarrier, + GeneralShield, + ProtectBarrier, + GloriousShield, + ImperialBarrier, + GuardianShield, + DivinityBarrier, + UltimateShield, + SpiritualShield, + CelestialShield, + InvisibleGuard, + SacredGuard, + SPartsver116, + SPartsver201, + LightRelief, + ShieldOfDelsaber, + ForceWall, + RangerWall, + HunterWall, + AttributeWall, + SecretGear, + CombatGear, + ProtoRegeneGear, + RegenerateGear, + RegeneGearAdv, + FlowensShield, + CustomBarrierveroo, + DbsShield, + RedRing, + TripolicShield, + StandstillShield, + SafetyHeart, + KasamiBracer, + GodsShieldSuzaku, + GodsShieldGenbu, + GodsShieldByakko, + GodsShieldSeiryu, + HuntersShell, + RicosGlasses, + RicosEarring, + BlueRing, + Barrier2, + SecureFeet, + Barrier3, + Barrier4, + Barrier5, + Barrier6, + RestaMerge, + AntiMerge, + ShiftaMerge, + DebandMerge, + FoieMerge, + GifoieMerge, + RafoieMerge, + RedMerge, + BartaMerge, + GibartaMerge, + RabartaMerge, + BlueMerge, + ZondeMerge, + GizondeMerge, + RazondeMerge, + YellowMerge, + RecoveryBarrier, + AssistBarrier, + RedBarrier, + BlueBarrier, + YellowBarrier, + WeaponsGoldShield, + BlackGear, + WorksGuard, + RagolRing, + BlueRing2, + BlueRing3, + BlueRing4, + BlueRing5, + BlueRing6, + BlueRing7, + BlueRing8, + BlueRing9, + GreenRing, + GreenRing2, + GreenRing3, + GreenRing4, + GreenRing5, + GreenRing6, + GreenRing7, + GreenRing8, + YellowRing, + YellowRing2, + YellowRing3, + YellowRing4, + YellowRing5, + YellowRing6, + YellowRing7, + YellowRing8, + PurpleRing, + PurpleRing2, + PurpleRing3, + PurpleRing4, + PurpleRing5, + PurpleRing6, + PurpleRing7, + PurpleRing8, + WhiteRing, + WhiteRing2, + WhiteRing3, + WhiteRing4, + WhiteRing5, + WhiteRing6, + WhiteRing7, + WhiteRing8, + BlackRing, + BlackRing2, + BlackRing3, + BlackRing4, + BlackRing5, + BlackRing6, + BlackRing7, + BlackRing8, + WeaponsSilverShield, + WeaponsCopperShield, + Gratia, + TripolicReflector, + StrikerPlus, + RegenerateGearBP, + Rupika, + YataMirror, + BunnyEars, + CatEars, + ThreeSeals, + GodsShieldkouryu, + DfShield, + FromTheDepths, + DeRolLeShield, + HoneycombReflector, + Epsiguard, + AngelRing, + UnionGuard, + UnionGuard2, + UnionGuard3, + UnionGuard4, + StinkShield, + Unknownb, + Genpei, + Genpei2, + Genpei3, + Genpei4, + Genpei5, + Genpei6, + Genpei7, + Genpei8, + Genpei9, + Genpei10, +} + +impl ShieldType { + pub fn value(&self) -> [u8; 3] { + match self { + ShieldType::Barrier => [0x01, 0x02, 0x00], + ShieldType::Shield => [0x01, 0x02, 0x01], + ShieldType::CoreShield => [0x01, 0x02, 0x02], + ShieldType::GigaShield => [0x01, 0x02, 0x03], + ShieldType::SoulBarrier => [0x01, 0x02, 0x04], + ShieldType::HardShield => [0x01, 0x02, 0x05], + ShieldType::BraveBarrier => [0x01, 0x02, 0x06], + ShieldType::SolidShield => [0x01, 0x02, 0x07], + ShieldType::FlameBarrier => [0x01, 0x02, 0x08], + ShieldType::PlasmaBarrier => [0x01, 0x02, 0x09], + ShieldType::FreezeBarrier => [0x01, 0x02, 0x0A], + ShieldType::PsychicBarrier => [0x01, 0x02, 0x0B], + ShieldType::GeneralShield => [0x01, 0x02, 0x0C], + ShieldType::ProtectBarrier => [0x01, 0x02, 0x0D], + ShieldType::GloriousShield => [0x01, 0x02, 0x0E], + ShieldType::ImperialBarrier => [0x01, 0x02, 0x0F], + ShieldType::GuardianShield => [0x01, 0x02, 0x10], + ShieldType::DivinityBarrier => [0x01, 0x02, 0x11], + ShieldType::UltimateShield => [0x01, 0x02, 0x12], + ShieldType::SpiritualShield => [0x01, 0x02, 0x13], + ShieldType::CelestialShield => [0x01, 0x02, 0x14], + ShieldType::InvisibleGuard => [0x01, 0x02, 0x15], + ShieldType::SacredGuard => [0x01, 0x02, 0x16], + ShieldType::SPartsver116 => [0x01, 0x02, 0x17], + ShieldType::SPartsver201 => [0x01, 0x02, 0x18], + ShieldType::LightRelief => [0x01, 0x02, 0x19], + ShieldType::ShieldOfDelsaber => [0x01, 0x02, 0x1A], + ShieldType::ForceWall => [0x01, 0x02, 0x1B], + ShieldType::RangerWall => [0x01, 0x02, 0x1C], + ShieldType::HunterWall => [0x01, 0x02, 0x1D], + ShieldType::AttributeWall => [0x01, 0x02, 0x1E], + ShieldType::SecretGear => [0x01, 0x02, 0x1F], + ShieldType::CombatGear => [0x01, 0x02, 0x20], + ShieldType::ProtoRegeneGear => [0x01, 0x02, 0x21], + ShieldType::RegenerateGear => [0x01, 0x02, 0x22], + ShieldType::RegeneGearAdv => [0x01, 0x02, 0x23], + ShieldType::FlowensShield => [0x01, 0x02, 0x24], + ShieldType::CustomBarrierveroo => [0x01, 0x02, 0x25], + ShieldType::DbsShield => [0x01, 0x02, 0x26], + ShieldType::RedRing => [0x01, 0x02, 0x27], + ShieldType::TripolicShield => [0x01, 0x02, 0x28], + ShieldType::StandstillShield => [0x01, 0x02, 0x29], + ShieldType::SafetyHeart => [0x01, 0x02, 0x2A], + ShieldType::KasamiBracer => [0x01, 0x02, 0x2B], + ShieldType::GodsShieldSuzaku => [0x01, 0x02, 0x2C], + ShieldType::GodsShieldGenbu => [0x01, 0x02, 0x2D], + ShieldType::GodsShieldByakko => [0x01, 0x02, 0x2E], + ShieldType::GodsShieldSeiryu => [0x01, 0x02, 0x2F], + ShieldType::HuntersShell => [0x01, 0x02, 0x30], + ShieldType::RicosGlasses => [0x01, 0x02, 0x31], + ShieldType::RicosEarring => [0x01, 0x02, 0x32], + ShieldType::BlueRing => [0x01, 0x02, 0x33], + ShieldType::Barrier2 => [0x01, 0x02, 0x34], + ShieldType::SecureFeet => [0x01, 0x02, 0x35], + ShieldType::Barrier3 => [0x01, 0x02, 0x36], + ShieldType::Barrier4 => [0x01, 0x02, 0x37], + ShieldType::Barrier5 => [0x01, 0x02, 0x38], + ShieldType::Barrier6 => [0x01, 0x02, 0x39], + ShieldType::RestaMerge => [0x01, 0x02, 0x3A], + ShieldType::AntiMerge => [0x01, 0x02, 0x3B], + ShieldType::ShiftaMerge => [0x01, 0x02, 0x3C], + ShieldType::DebandMerge => [0x01, 0x02, 0x3D], + ShieldType::FoieMerge => [0x01, 0x02, 0x3E], + ShieldType::GifoieMerge => [0x01, 0x02, 0x3F], + ShieldType::RafoieMerge => [0x01, 0x02, 0x40], + ShieldType::RedMerge => [0x01, 0x02, 0x41], + ShieldType::BartaMerge => [0x01, 0x02, 0x42], + ShieldType::GibartaMerge => [0x01, 0x02, 0x43], + ShieldType::RabartaMerge => [0x01, 0x02, 0x44], + ShieldType::BlueMerge => [0x01, 0x02, 0x45], + ShieldType::ZondeMerge => [0x01, 0x02, 0x46], + ShieldType::GizondeMerge => [0x01, 0x02, 0x47], + ShieldType::RazondeMerge => [0x01, 0x02, 0x48], + ShieldType::YellowMerge => [0x01, 0x02, 0x49], + ShieldType::RecoveryBarrier => [0x01, 0x02, 0x4A], + ShieldType::AssistBarrier => [0x01, 0x02, 0x4B], + ShieldType::RedBarrier => [0x01, 0x02, 0x4C], + ShieldType::BlueBarrier => [0x01, 0x02, 0x4D], + ShieldType::YellowBarrier => [0x01, 0x02, 0x4E], + ShieldType::WeaponsGoldShield => [0x01, 0x02, 0x4F], + ShieldType::BlackGear => [0x01, 0x02, 0x50], + ShieldType::WorksGuard => [0x01, 0x02, 0x51], + ShieldType::RagolRing => [0x01, 0x02, 0x52], + ShieldType::BlueRing2 => [0x01, 0x02, 0x53], + ShieldType::BlueRing3 => [0x01, 0x02, 0x54], + ShieldType::BlueRing4 => [0x01, 0x02, 0x55], + ShieldType::BlueRing5 => [0x01, 0x02, 0x56], + ShieldType::BlueRing6 => [0x01, 0x02, 0x57], + ShieldType::BlueRing7 => [0x01, 0x02, 0x58], + ShieldType::BlueRing8 => [0x01, 0x02, 0x59], + ShieldType::BlueRing9 => [0x01, 0x02, 0x5A], + ShieldType::GreenRing => [0x01, 0x02, 0x5B], + ShieldType::GreenRing2 => [0x01, 0x02, 0x5C], + ShieldType::GreenRing3 => [0x01, 0x02, 0x5D], + ShieldType::GreenRing4 => [0x01, 0x02, 0x5E], + ShieldType::GreenRing5 => [0x01, 0x02, 0x5F], + ShieldType::GreenRing6 => [0x01, 0x02, 0x60], + ShieldType::GreenRing7 => [0x01, 0x02, 0x61], + ShieldType::GreenRing8 => [0x01, 0x02, 0x62], + ShieldType::YellowRing => [0x01, 0x02, 0x63], + ShieldType::YellowRing2 => [0x01, 0x02, 0x64], + ShieldType::YellowRing3 => [0x01, 0x02, 0x65], + ShieldType::YellowRing4 => [0x01, 0x02, 0x66], + ShieldType::YellowRing5=> [0x01, 0x02, 0x67], + ShieldType::YellowRing6 => [0x01, 0x02, 0x68], + ShieldType::YellowRing7 => [0x01, 0x02, 0x69], + ShieldType::YellowRing8 => [0x01, 0x02, 0x6A], + ShieldType::PurpleRing => [0x01, 0x02, 0x6B], + ShieldType::PurpleRing2 => [0x01, 0x02, 0x6C], + ShieldType::PurpleRing3 => [0x01, 0x02, 0x6D], + ShieldType::PurpleRing4 => [0x01, 0x02, 0x6E], + ShieldType::PurpleRing5=> [0x01, 0x02, 0x6F], + ShieldType::PurpleRing6 => [0x01, 0x02, 0x70], + ShieldType::PurpleRing7 => [0x01, 0x02, 0x71], + ShieldType::PurpleRing8 => [0x01, 0x02, 0x72], + ShieldType::WhiteRing => [0x01, 0x02, 0x73], + ShieldType::WhiteRing2 => [0x01, 0x02, 0x74], + ShieldType::WhiteRing3 => [0x01, 0x02, 0x75], + ShieldType::WhiteRing4 => [0x01, 0x02, 0x76], + ShieldType::WhiteRing5 => [0x01, 0x02, 0x77], + ShieldType::WhiteRing6=> [0x01, 0x02, 0x78], + ShieldType::WhiteRing7 => [0x01, 0x02, 0x79], + ShieldType::WhiteRing8 => [0x01, 0x02, 0x7A], + ShieldType::BlackRing => [0x01, 0x02, 0x7B], + ShieldType::BlackRing2 => [0x01, 0x02, 0x7C], + ShieldType::BlackRing3 => [0x01, 0x02, 0x7D], + ShieldType::BlackRing4 => [0x01, 0x02, 0x7E], + ShieldType::BlackRing5 => [0x01, 0x02, 0x7F], + ShieldType::BlackRing6 => [0x01, 0x02, 0x80], + ShieldType::BlackRing7 => [0x01, 0x02, 0x81], + ShieldType::BlackRing8 => [0x01, 0x02, 0x82], + ShieldType::WeaponsSilverShield => [0x01, 0x02, 0x83], + ShieldType::WeaponsCopperShield => [0x01, 0x02, 0x84], + ShieldType::Gratia => [0x01, 0x02, 0x85], + ShieldType::TripolicReflector => [0x01, 0x02, 0x86], + ShieldType::StrikerPlus => [0x01, 0x02, 0x87], + ShieldType::RegenerateGearBP => [0x01, 0x02, 0x88], + ShieldType::Rupika => [0x01, 0x02, 0x89], + ShieldType::YataMirror => [0x01, 0x02, 0x8A], + ShieldType::BunnyEars => [0x01, 0x02, 0x8B], + ShieldType::CatEars => [0x01, 0x02, 0x8C], + ShieldType::ThreeSeals => [0x01, 0x02, 0x8D], + ShieldType::GodsShieldkouryu => [0x01, 0x02, 0x8E], + ShieldType::DfShield => [0x01, 0x02, 0x8F], + ShieldType::FromTheDepths => [0x01, 0x02, 0x90], + ShieldType::DeRolLeShield => [0x01, 0x02, 0x91], + ShieldType::HoneycombReflector => [0x01, 0x02, 0x92], + ShieldType::Epsiguard => [0x01, 0x02, 0x93], + ShieldType::AngelRing => [0x01, 0x02, 0x94], + ShieldType::UnionGuard => [0x01, 0x02, 0x95], + ShieldType::UnionGuard2 => [0x01, 0x02, 0x96], + ShieldType::UnionGuard3 => [0x01, 0x02, 0x97], + ShieldType::UnionGuard4 => [0x01, 0x02, 0x98], + ShieldType::StinkShield => [0x01, 0x02, 0x99], + ShieldType::Unknownb => [0x01, 0x02, 0x9A], + ShieldType::Genpei => [0x01, 0x02, 0x9B], + ShieldType::Genpei2 => [0x01, 0x02, 0x9C], + ShieldType::Genpei3 => [0x01, 0x02, 0x9D], + ShieldType::Genpei4 => [0x01, 0x02, 0x9E], + ShieldType::Genpei5 => [0x01, 0x02, 0x9F], + ShieldType::Genpei6 => [0x01, 0x02, 0xA0], + ShieldType::Genpei7 => [0x01, 0x02, 0xA1], + ShieldType::Genpei8 => [0x01, 0x02, 0xA2], + ShieldType::Genpei9 => [0x01, 0x02, 0xA3], + ShieldType::Genpei10 => [0x01, 0x02, 0xA4], + } + } +} + +impl TryFrom<&str> for ShieldType { + type Error = ShieldTypeError; + fn try_from(value: &str) -> Result { + match value { + "Barrier" => Ok(ShieldType::Barrier), + "Shield" => Ok(ShieldType::Shield), + "CoreShield" => Ok(ShieldType::CoreShield), + "GigaShield" => Ok(ShieldType::GigaShield), + "SoulBarrier" => Ok(ShieldType::SoulBarrier), + "HardShield" => Ok(ShieldType::HardShield), + "BraveBarrier" => Ok(ShieldType::BraveBarrier), + "SolidShield" => Ok(ShieldType::SolidShield), + "FlameBarrier" => Ok(ShieldType::FlameBarrier), + "PlasmaBarrier" => Ok(ShieldType::PlasmaBarrier), + "FreezeBarrier" => Ok(ShieldType::FreezeBarrier), + "PsychicBarrier" => Ok(ShieldType::PsychicBarrier), + "GeneralShield" => Ok(ShieldType::GeneralShield), + "ProtectBarrier" => Ok(ShieldType::ProtectBarrier), + "GloriousShield" => Ok(ShieldType::GloriousShield), + "ImperialBarrier" => Ok(ShieldType::ImperialBarrier), + "GuardianShield" => Ok(ShieldType::GuardianShield), + "DivinityBarrier" => Ok(ShieldType::DivinityBarrier), + "UltimateShield" => Ok(ShieldType::UltimateShield), + "SpiritualShield" => Ok(ShieldType::SpiritualShield), + "CelestialShield" => Ok(ShieldType::CelestialShield), + "InvisibleGuard" => Ok(ShieldType::InvisibleGuard), + "SacredGuard" => Ok(ShieldType::SacredGuard), + "SPartsver116" => Ok(ShieldType::SPartsver116), + "SPartsver201" => Ok(ShieldType::SPartsver201), + "LightRelief" => Ok(ShieldType::LightRelief), + "ShieldOfDelsaber" => Ok(ShieldType::ShieldOfDelsaber), + "ForceWall" => Ok(ShieldType::ForceWall), + "RangerWall" => Ok(ShieldType::RangerWall), + "HunterWall" => Ok(ShieldType::HunterWall), + "AttributeWall" => Ok(ShieldType::AttributeWall), + "SecretGear" => Ok(ShieldType::SecretGear), + "CombatGear" => Ok(ShieldType::CombatGear), + "ProtoRegeneGear" => Ok(ShieldType::ProtoRegeneGear), + "RegenerateGear" => Ok(ShieldType::RegenerateGear), + "RegeneGearAdv" => Ok(ShieldType::RegeneGearAdv), + "FlowensShield" => Ok(ShieldType::FlowensShield), + "CustomBarrierveroo" => Ok(ShieldType::CustomBarrierveroo), + "DbsShield" => Ok(ShieldType::DbsShield), + "RedRing" => Ok(ShieldType::RedRing), + "TripolicShield" => Ok(ShieldType::TripolicShield), + "StandstillShield" => Ok(ShieldType::StandstillShield), + "SafetyHeart" => Ok(ShieldType::SafetyHeart), + "KasamiBracer" => Ok(ShieldType::KasamiBracer), + "GodsShieldSuzaku" => Ok(ShieldType::GodsShieldSuzaku), + "GodsShieldGenbu" => Ok(ShieldType::GodsShieldGenbu), + "GodsShieldByakko" => Ok(ShieldType::GodsShieldByakko), + "GodsShieldSeiryu" => Ok(ShieldType::GodsShieldSeiryu), + "HuntersShell" => Ok(ShieldType::HuntersShell), + "RicosGlasses" => Ok(ShieldType::RicosGlasses), + "RicosEarring" => Ok(ShieldType::RicosEarring), + "BlueRing" => Ok(ShieldType::BlueRing), + "Barrier2" => Ok(ShieldType::Barrier2), + "SecureFeet" => Ok(ShieldType::SecureFeet), + "Barrier3" => Ok(ShieldType::Barrier3), + "Barrier4" => Ok(ShieldType::Barrier4), + "Barrier5" => Ok(ShieldType::Barrier5), + "Barrier6" => Ok(ShieldType::Barrier6), + "RestaMerge" => Ok(ShieldType::RestaMerge), + "AntiMerge" => Ok(ShieldType::AntiMerge), + "ShiftaMerge" => Ok(ShieldType::ShiftaMerge), + "DebandMerge" => Ok(ShieldType::DebandMerge), + "FoieMerge" => Ok(ShieldType::FoieMerge), + "GifoieMerge" => Ok(ShieldType::GifoieMerge), + "RafoieMerge" => Ok(ShieldType::RafoieMerge), + "RedMerge" => Ok(ShieldType::RedMerge), + "BartaMerge" => Ok(ShieldType::BartaMerge), + "GibartaMerge" => Ok(ShieldType::GibartaMerge), + "RabartaMerge" => Ok(ShieldType::RabartaMerge), + "BlueMerge" => Ok(ShieldType::BlueMerge), + "ZondeMerge" => Ok(ShieldType::ZondeMerge), + "GizondeMerge" => Ok(ShieldType::GizondeMerge), + "RazondeMerge" => Ok(ShieldType::RazondeMerge), + "YellowMerge" => Ok(ShieldType::YellowMerge), + "RecoveryBarrier" => Ok(ShieldType::RecoveryBarrier), + "AssistBarrier" => Ok(ShieldType::AssistBarrier), + "RedBarrier" => Ok(ShieldType::RedBarrier), + "BlueBarrier" => Ok(ShieldType::BlueBarrier), + "YellowBarrier" => Ok(ShieldType::YellowBarrier), + "WeaponsGoldShield" => Ok(ShieldType::WeaponsGoldShield), + "BlackGear" => Ok(ShieldType::BlackGear), + "WorksGuard" => Ok(ShieldType::WorksGuard), + "RagolRing" => Ok(ShieldType::RagolRing), + "BlueRing2" => Ok(ShieldType::BlueRing2), + "BlueRing3" => Ok(ShieldType::BlueRing3), + "BlueRing4" => Ok(ShieldType::BlueRing4), + "BlueRing5" => Ok(ShieldType::BlueRing5), + "BlueRing6" => Ok(ShieldType::BlueRing6), + "BlueRing7" => Ok(ShieldType::BlueRing7), + "BlueRing8" => Ok(ShieldType::BlueRing8), + "BlueRing9" => Ok(ShieldType::BlueRing9), + "GreenRing" => Ok(ShieldType::GreenRing), + "GreenRing2" => Ok(ShieldType::GreenRing2), + "GreenRing3" => Ok(ShieldType::GreenRing3), + "GreenRing4" => Ok(ShieldType::GreenRing4), + "GreenRing5" => Ok(ShieldType::GreenRing5), + "GreenRing6" => Ok(ShieldType::GreenRing6), + "GreenRing7" => Ok(ShieldType::GreenRing7), + "GreenRing8" => Ok(ShieldType::GreenRing8), + "YellowRing" => Ok(ShieldType::YellowRing), + "YellowRing2" => Ok(ShieldType::YellowRing2), + "YellowRing3" => Ok(ShieldType::YellowRing3), + "YellowRing4" => Ok(ShieldType::YellowRing4), + "YellowRing5" => Ok(ShieldType::YellowRing5), + "YellowRing6" => Ok(ShieldType::YellowRing6), + "YellowRing7" => Ok(ShieldType::YellowRing7), + "YellowRing8" => Ok(ShieldType::YellowRing8), + "PurpleRing" => Ok(ShieldType::PurpleRing), + "PurpleRing2" => Ok(ShieldType::PurpleRing2), + "PurpleRing3" => Ok(ShieldType::PurpleRing3), + "PurpleRing4" => Ok(ShieldType::PurpleRing4), + "PurpleRing5" => Ok(ShieldType::PurpleRing5), + "PurpleRing6" => Ok(ShieldType::PurpleRing6), + "PurpleRing7" => Ok(ShieldType::PurpleRing7), + "PurpleRing8" => Ok(ShieldType::PurpleRing8), + "WhiteRing" => Ok(ShieldType::WhiteRing), + "WhiteRing2" => Ok(ShieldType::WhiteRing2), + "WhiteRing3" => Ok(ShieldType::WhiteRing3), + "WhiteRing4" => Ok(ShieldType::WhiteRing4), + "WhiteRing5" => Ok(ShieldType::WhiteRing5), + "WhiteRing6" => Ok(ShieldType::WhiteRing6), + "WhiteRing7" => Ok(ShieldType::WhiteRing7), + "WhiteRing8" => Ok(ShieldType::WhiteRing8), + "BlackRing" => Ok(ShieldType::BlackRing), + "BlackRing2" => Ok(ShieldType::BlackRing2), + "BlackRing3" => Ok(ShieldType::BlackRing3), + "BlackRing4" => Ok(ShieldType::BlackRing4), + "BlackRing5" => Ok(ShieldType::BlackRing5), + "BlackRing6" => Ok(ShieldType::BlackRing6), + "BlackRing7" => Ok(ShieldType::BlackRing7), + "BlackRing8" => Ok(ShieldType::BlackRing8), + "WeaponsSilverShield" => Ok(ShieldType::WeaponsSilverShield), + "WeaponsCopperShield" => Ok(ShieldType::WeaponsCopperShield), + "Gratia" => Ok(ShieldType::Gratia), + "TripolicReflector" => Ok(ShieldType::TripolicReflector), + "StrikerPlus" => Ok(ShieldType::StrikerPlus), + "RegenerateGearBP" => Ok(ShieldType::RegenerateGearBP), + "Rupika" => Ok(ShieldType::Rupika), + "YataMirror" => Ok(ShieldType::YataMirror), + "BunnyEars" => Ok(ShieldType::BunnyEars), + "CatEars" => Ok(ShieldType::CatEars), + "ThreeSeals" => Ok(ShieldType::ThreeSeals), + "GodsShieldkouryu" => Ok(ShieldType::GodsShieldkouryu), + "DfShield" => Ok(ShieldType::DfShield), + "FromTheDepths" => Ok(ShieldType::FromTheDepths), + "DeRolLeShield" => Ok(ShieldType::DeRolLeShield), + "HoneycombReflector" => Ok(ShieldType::HoneycombReflector), + "Epsiguard" => Ok(ShieldType::Epsiguard), + "AngelRing" => Ok(ShieldType::AngelRing), + "UnionGuard" => Ok(ShieldType::UnionGuard), + "UnionGuard2" => Ok(ShieldType::UnionGuard2), + "UnionGuard3" => Ok(ShieldType::UnionGuard3), + "UnionGuard4" => Ok(ShieldType::UnionGuard4), + "StinkShield" => Ok(ShieldType::StinkShield), + "Unknownb" => Ok(ShieldType::Unknownb), + "Genpei" => Ok(ShieldType::Genpei), + "Genpei2" => Ok(ShieldType::Genpei2), + "Genpei3" => Ok(ShieldType::Genpei3), + "Genpei4" => Ok(ShieldType::Genpei4), + "Genpei5" => Ok(ShieldType::Genpei5), + "Genpei6" => Ok(ShieldType::Genpei6), + "Genpei7" => Ok(ShieldType::Genpei7), + "Genpei8" => Ok(ShieldType::Genpei8), + "Genpei9" => Ok(ShieldType::Genpei9), + "Genpei10" => Ok(ShieldType::Genpei10), + _ => Err(ShieldTypeError::UnknownShield(value.to_string())) + } + } +} + +impl Into for ShieldType { + fn into(self) -> String { + match self { + ShieldType::Barrier => "Barrier", + ShieldType::Shield => "Shield", + ShieldType::CoreShield => "CoreShield", + ShieldType::GigaShield => "GigaShield", + ShieldType::SoulBarrier => "SoulBarrier", + ShieldType::HardShield => "HardShield", + ShieldType::BraveBarrier => "BraveBarrier", + ShieldType::SolidShield => "SolidShield", + ShieldType::FlameBarrier => "FlameBarrier", + ShieldType::PlasmaBarrier => "PlasmaBarrier", + ShieldType::FreezeBarrier => "FreezeBarrier", + ShieldType::PsychicBarrier => "PsychicBarrier", + ShieldType::GeneralShield => "GeneralShield", + ShieldType::ProtectBarrier => "ProtectBarrier", + ShieldType::GloriousShield => "GloriousShield", + ShieldType::ImperialBarrier => "ImperialBarrier", + ShieldType::GuardianShield => "GuardianShield", + ShieldType::DivinityBarrier => "DivinityBarrier", + ShieldType::UltimateShield => "UltimateShield", + ShieldType::SpiritualShield => "SpiritualShield", + ShieldType::CelestialShield => "CelestialShield", + ShieldType::InvisibleGuard => "InvisibleGuard", + ShieldType::SacredGuard => "SacredGuard", + ShieldType::SPartsver116 => "SPartsver116", + ShieldType::SPartsver201 => "SPartsver201", + ShieldType::LightRelief => "LightRelief", + ShieldType::ShieldOfDelsaber => "ShieldOfDelsaber", + ShieldType::ForceWall => "ForceWall", + ShieldType::RangerWall => "RangerWall", + ShieldType::HunterWall => "HunterWall", + ShieldType::AttributeWall => "AttributeWall", + ShieldType::SecretGear => "SecretGear", + ShieldType::CombatGear => "CombatGear", + ShieldType::ProtoRegeneGear => "ProtoRegeneGear", + ShieldType::RegenerateGear => "RegenerateGear", + ShieldType::RegeneGearAdv => "RegeneGearAdv", + ShieldType::FlowensShield => "FlowensShield", + ShieldType::CustomBarrierveroo => "CustomBarrierveroo", + ShieldType::DbsShield => "DbsShield", + ShieldType::RedRing => "RedRing", + ShieldType::TripolicShield => "TripolicShield", + ShieldType::StandstillShield => "StandstillShield", + ShieldType::SafetyHeart => "SafetyHeart", + ShieldType::KasamiBracer => "KasamiBracer", + ShieldType::GodsShieldSuzaku => "GodsShieldSuzaku", + ShieldType::GodsShieldGenbu => "GodsShieldGenbu", + ShieldType::GodsShieldByakko => "GodsShieldByakko", + ShieldType::GodsShieldSeiryu => "GodsShieldSeiryu", + ShieldType::HuntersShell => "HuntersShell", + ShieldType::RicosGlasses => "RicosGlasses", + ShieldType::RicosEarring => "RicosEarring", + ShieldType::BlueRing => "BlueRing", + ShieldType::Barrier2 => "Barrier2", + ShieldType::SecureFeet => "SecureFeet", + ShieldType::Barrier3 => "Barrier3", + ShieldType::Barrier4 => "Barrier4", + ShieldType::Barrier5 => "Barrier5", + ShieldType::Barrier6 => "Barrier6", + ShieldType::RestaMerge => "RestaMerge", + ShieldType::AntiMerge => "AntiMerge", + ShieldType::ShiftaMerge => "ShiftaMerge", + ShieldType::DebandMerge => "DebandMerge", + ShieldType::FoieMerge => "FoieMerge", + ShieldType::GifoieMerge => "GifoieMerge", + ShieldType::RafoieMerge => "RafoieMerge", + ShieldType::RedMerge => "RedMerge", + ShieldType::BartaMerge => "BartaMerge", + ShieldType::GibartaMerge => "GibartaMerge", + ShieldType::RabartaMerge => "RabartaMerge", + ShieldType::BlueMerge => "BlueMerge", + ShieldType::ZondeMerge => "ZondeMerge", + ShieldType::GizondeMerge => "GizondeMerge", + ShieldType::RazondeMerge => "RazondeMerge", + ShieldType::YellowMerge => "YellowMerge", + ShieldType::RecoveryBarrier => "RecoveryBarrier", + ShieldType::AssistBarrier => "AssistBarrier", + ShieldType::RedBarrier => "RedBarrier", + ShieldType::BlueBarrier => "BlueBarrier", + ShieldType::YellowBarrier => "YellowBarrier", + ShieldType::WeaponsGoldShield => "WeaponsGoldShield", + ShieldType::BlackGear => "BlackGear", + ShieldType::WorksGuard => "WorksGuard", + ShieldType::RagolRing => "RagolRing", + ShieldType::BlueRing2 => "BlueRing2", + ShieldType::BlueRing3 => "BlueRing3", + ShieldType::BlueRing4 => "BlueRing4", + ShieldType::BlueRing5 => "BlueRing5", + ShieldType::BlueRing6 => "BlueRing6", + ShieldType::BlueRing7 => "BlueRing7", + ShieldType::BlueRing8 => "BlueRing8", + ShieldType::BlueRing9 => "BlueRing9", + ShieldType::GreenRing => "GreenRing", + ShieldType::GreenRing2 => "GreenRing2", + ShieldType::GreenRing3 => "GreenRing3", + ShieldType::GreenRing4 => "GreenRing4", + ShieldType::GreenRing5 => "GreenRing5", + ShieldType::GreenRing6 => "GreenRing6", + ShieldType::GreenRing7 => "GreenRing7", + ShieldType::GreenRing8 => "GreenRing8", + ShieldType::YellowRing => "YellowRing", + ShieldType::YellowRing2 => "YellowRing2", + ShieldType::YellowRing3 => "YellowRing3", + ShieldType::YellowRing4 => "YellowRing4", + ShieldType::YellowRing5 => "YellowRing5", + ShieldType::YellowRing6 => "YellowRing6", + ShieldType::YellowRing7 => "YellowRing7", + ShieldType::YellowRing8 => "YellowRing8", + ShieldType::PurpleRing => "PurpleRing", + ShieldType::PurpleRing2 => "PurpleRing2", + ShieldType::PurpleRing3 => "PurpleRing3", + ShieldType::PurpleRing4 => "PurpleRing4", + ShieldType::PurpleRing5 => "PurpleRing5", + ShieldType::PurpleRing6 => "PurpleRing6", + ShieldType::PurpleRing7 => "PurpleRing7", + ShieldType::PurpleRing8 => "PurpleRing8", + ShieldType::WhiteRing => "WhiteRing", + ShieldType::WhiteRing2 => "WhiteRing2", + ShieldType::WhiteRing3 => "WhiteRing3", + ShieldType::WhiteRing4 => "WhiteRing4", + ShieldType::WhiteRing5 => "WhiteRing5", + ShieldType::WhiteRing6 => "WhiteRing6", + ShieldType::WhiteRing7 => "WhiteRing7", + ShieldType::WhiteRing8 => "WhiteRing8", + ShieldType::BlackRing => "BlackRing", + ShieldType::BlackRing2 => "BlackRing2", + ShieldType::BlackRing3 => "BlackRing3", + ShieldType::BlackRing4 => "BlackRing4", + ShieldType::BlackRing5 => "BlackRing5", + ShieldType::BlackRing6 => "BlackRing6", + ShieldType::BlackRing7 => "BlackRing7", + ShieldType::BlackRing8 => "BlackRing8", + ShieldType::WeaponsSilverShield => "WeaponsSilverShield", + ShieldType::WeaponsCopperShield => "WeaponsCopperShield", + ShieldType::Gratia => "Gratia", + ShieldType::TripolicReflector => "TripolicReflector", + ShieldType::StrikerPlus => "StrikerPlus", + ShieldType::RegenerateGearBP => "RegenerateGearBP", + ShieldType::Rupika => "Rupika", + ShieldType::YataMirror => "YataMirror", + ShieldType::BunnyEars => "BunnyEars", + ShieldType::CatEars => "CatEars", + ShieldType::ThreeSeals => "ThreeSeals", + ShieldType::GodsShieldkouryu => "GodsShieldkouryu", + ShieldType::DfShield => "DfShield", + ShieldType::FromTheDepths => "FromTheDepths", + ShieldType::DeRolLeShield => "DeRolLeShield", + ShieldType::HoneycombReflector => "HoneycombReflector", + ShieldType::Epsiguard => "Epsiguard", + ShieldType::AngelRing => "AngelRing", + ShieldType::UnionGuard => "UnionGuard", + ShieldType::UnionGuard2 => "UnionGuard2", + ShieldType::UnionGuard3 => "UnionGuard3", + ShieldType::UnionGuard4 => "UnionGuard4", + ShieldType::StinkShield => "StinkShield", + ShieldType::Unknownb => "Unknownb", + ShieldType::Genpei => "Genpei", + ShieldType::Genpei2 => "Genpei2", + ShieldType::Genpei3 => "Genpei3", + ShieldType::Genpei4 => "Genpei4", + ShieldType::Genpei5 => "Genpei5", + ShieldType::Genpei6 => "Genpei6", + ShieldType::Genpei7 => "Genpei7", + ShieldType::Genpei8 => "Genpei8", + ShieldType::Genpei9 => "Genpei9", + ShieldType::Genpei10 => "Genpei10", + }.to_string() + } +} + +// TODO: TryFrom<&str> done maybe - wilson someone with braincells check +// TODO Into ^^ + + +#[derive(Debug, Copy, Clone, PartialEq)] +pub struct Shield { + pub shield: ShieldType, + pub dfp: u8, + pub evp: u8, +} + + + + + +impl Shield { + pub fn as_bytes(&self) -> [u8; 16] { + let mut result = [0; 16]; + result[0..3].copy_from_slice(&self.shield.value()); + // TODO: other attrs + + result + } +} diff --git a/src/entity/item/tool.rs b/src/entity/item/tool.rs new file mode 100644 index 0000000..a4737c6 --- /dev/null +++ b/src/entity/item/tool.rs @@ -0,0 +1,566 @@ + + +#[derive(Debug, Copy, Clone, PartialEq)] +pub enum ToolType { + Monomate, + Dimate, + Trimate, + Monofluid, + Difluid, + Trifluid, + SolAtomizer, + MoonAtomizer, + StarAtomizer, + Antidote, + Antiparalysis, + Telepipe, + TrapVision, + ScapeDoll, + Monogrinder, + Digrinder, + Trigrinder, + PowerMaterial, + MindMaterial, + EvadeMaterial, + HpMaterial, + TpMaterial, + DefMaterial, + LuckMaterial, + CellofMag502, + CellofMag213, + PartsofRobochao, + HeartofOpaOpa, + HeartofPian, + HeartofChao, + SorcerersRightArm, + SbeatsArms, + ParmsArms, + DelsabersRightArm, + BringersRightArm, + DelsabersLeftArm, + SredsArms, + DragonsClaw, + HildebearsHead, + HildebluesHead, + PartsofBaranz, + BelrasRightArm, + GiGuesbody, + SinowBerillsArms, + GrassAssassinsArms, + BoomasRightArm, + GoboomasRightArm, + GigoboomasRightArm, + GalGryphonsWing, + RappysWing, + CladdingofEpsilon, + DeRolLeShell, + BerillPhoton, + Parasiticgeneflow, + MagicStoneiritista, + Blueblackstone, + Syncesta, + MagicWater, + ParasiticcellTypeD, + MagicrockheartKey, + Magicrockmoola, + StarAmplifier, + BookofHitogata, + HeartofChuChu, + PartsofEggBlaster, + HeartofAngel, + HeartofDevil, + KitofHamburger, + PanthersSpirit, + KitofMark3, + KitofMasterSystem, + KitofGenesis, + KitofSegaSaturn, + KitofDreamcast, + AmplifierofResta, + AmplifierofAnti, + AmplifierofShifta, + AmplifierofDeband, + AmplifierofFoie, + AmplifierofGifoie, + AmplifierofRafoie, + AmplifierofBarta, + AmplifierofGibarta, + AmplifierofRabarta, + AmplifierofZonde, + AmplifierofGizonde, + AmplifierofRazonde, + AmplifierofRed, + AmplifierofBlue, + AmplifierofYellow, + HeartofKapuKapu, + PhotonBooster, + Addslot, + PhotonDrop, + PhotonSphere, + PhotonCrystal, + SecretTicket, + PhotonTicket, + BookofKatana1, + BookofKatana2, + BookofKatana3, + WeaponsBronzeBadge, + WeaponsSilverBadge, + WeaponsGoldBadge, + WeaponsCrystalBadge, + WeaponsSteelBadge, + WeaponsAluminumBadge, + WeaponsLeatherBadge, + WeaponsBoneBadge, + Letterofappreciation, + ItemTicket, + ValentinesChocolate, + NewYearsCard, + ChristmasCard, + BirthdayCard, + ProofofSonicTeam, + SpecialEventTicket, + FlowerBouquet, + Cake, + Accessories, + MrnakasBusinessCard, + Present, + Chocolate, + Candy, + Cake2, + WeaponsSilverBadge2, + WeaponsGoldBadge2, + WeaponsCrystalBadge2, + WeaponsSteelBadge2, + WeaponsAluminumBadge2, + WeaponsLeatherBadge2, + WeaponsBoneBadge2, + Bouquet, + Decoction, + ChristmasPresent, + EasterEgg, + Jackolantern, + DiskVol1weddingMarch, + DiskVol2dayLight, + DiskVol3burningRangers, + DiskVol4openYourHeart, + DiskVol5liveLearn, + DiskVol6nights, + DiskVol7endingThemepianover, + DiskVol8hearttoHeart, + DiskVol9strangeBlue, + DiskVol10reunionSystem, + DiskVol11pinnacles, + DiskVol12fightinsidetheSpaceship, + HuntersReport, + HuntersReport2, + HuntersReport3, + HuntersReport4, + HuntersReport5, + Tablet, + Unknown2, + DragonScale, + HeavenStrikerCoat, + PioneerParts, + AmitiesMemo, + HeartofMorolian, + RappysBeak, + Yahoosengine, + DPhotonCore, + LibertaKit, + CellofMag0503, + CellofMag0504, + CellofMag0505, + CellofMag0506, + CellofMag0507, + TeamPoints500, + TeamPoints1000, + TeamPoints5000, + TeamPoints10000, +} + + +impl ToolType { + pub fn is_stackable(&self) -> bool { + match self { + ToolType::Monomate => true, + ToolType::Dimate => true, + ToolType::Trimate => true, + ToolType::Monofluid => true, + ToolType::Difluid => true, + ToolType::Trifluid => true, + ToolType::SolAtomizer => true, + ToolType::MoonAtomizer => true, + ToolType::StarAtomizer => true, + ToolType::Antidote => true, + ToolType::Antiparalysis => true, + ToolType::Telepipe => true, + ToolType::TrapVision => true, + ToolType::ScapeDoll => false, + ToolType::Monogrinder => true, + ToolType::Digrinder => true, + ToolType::Trigrinder => true, + ToolType::PowerMaterial => true, + ToolType::MindMaterial => true, + ToolType::EvadeMaterial => true, + ToolType::HpMaterial => true, + ToolType::TpMaterial => true, + ToolType::DefMaterial => true, + ToolType::LuckMaterial => true, + ToolType::CellofMag502 => true, + ToolType::CellofMag213 => true, + ToolType::PartsofRobochao => true, + ToolType::HeartofOpaOpa => true, + ToolType::HeartofPian => true, + ToolType::HeartofChao => true, + ToolType::SorcerersRightArm => true, + ToolType::SbeatsArms => true, + ToolType::ParmsArms => true, + ToolType::DelsabersRightArm => true, + ToolType::BringersRightArm => true, + ToolType::DelsabersLeftArm => true, + ToolType::SredsArms => true, + ToolType::DragonsClaw => true, + ToolType::HildebearsHead => true, + ToolType::HildebluesHead => true, + ToolType::PartsofBaranz => true, + ToolType::BelrasRightArm => true, + ToolType::GiGuesbody => true, + ToolType::SinowBerillsArms => true, + ToolType::GrassAssassinsArms => true, + ToolType::BoomasRightArm => true, + ToolType::GoboomasRightArm => true, + ToolType::GigoboomasRightArm => true, + ToolType::GalGryphonsWing => true, + ToolType::RappysWing => true, + ToolType::CladdingofEpsilon => true, + ToolType::DeRolLeShell => true, + ToolType::BerillPhoton => true, + ToolType::Parasiticgeneflow => true, + ToolType::MagicStoneiritista => true, + ToolType::Blueblackstone => true, + ToolType::Syncesta => true, + ToolType::MagicWater => true, + ToolType::ParasiticcellTypeD => true, + ToolType::MagicrockheartKey => true, + ToolType::Magicrockmoola => true, + ToolType::StarAmplifier => true, + ToolType::BookofHitogata => true, + ToolType::HeartofChuChu => true, + ToolType::PartsofEggBlaster => true, + ToolType::HeartofAngel => true, + ToolType::HeartofDevil => true, + ToolType::KitofHamburger => true, + ToolType::PanthersSpirit => true, + ToolType::KitofMark3 => true, + ToolType::KitofMasterSystem => true, + ToolType::KitofGenesis => true, + ToolType::KitofSegaSaturn => true, + ToolType::KitofDreamcast => true, + ToolType::AmplifierofResta => true, + ToolType::AmplifierofAnti => true, + ToolType::AmplifierofShifta => true, + ToolType::AmplifierofDeband => true, + ToolType::AmplifierofFoie => true, + ToolType::AmplifierofGifoie => true, + ToolType::AmplifierofRafoie => true, + ToolType::AmplifierofBarta => true, + ToolType::AmplifierofGibarta => true, + ToolType::AmplifierofRabarta => true, + ToolType::AmplifierofZonde => true, + ToolType::AmplifierofGizonde => true, + ToolType::AmplifierofRazonde => true, + ToolType::AmplifierofRed => true, + ToolType::AmplifierofBlue => true, + ToolType::AmplifierofYellow => true, + ToolType::HeartofKapuKapu => true, + ToolType::PhotonBooster => true, + ToolType::Addslot => true, + ToolType::PhotonDrop => true, + ToolType::PhotonSphere => true, + ToolType::PhotonCrystal => true, + ToolType::SecretTicket => true, + ToolType::PhotonTicket => true, + ToolType::BookofKatana1 => true, + ToolType::BookofKatana2 => true, + ToolType::BookofKatana3 => true, + ToolType::WeaponsBronzeBadge => true, + ToolType::WeaponsSilverBadge => true, + ToolType::WeaponsGoldBadge => true, + ToolType::WeaponsCrystalBadge => true, + ToolType::WeaponsSteelBadge => true, + ToolType::WeaponsAluminumBadge => true, + ToolType::WeaponsLeatherBadge => true, + ToolType::WeaponsBoneBadge => true, + ToolType::Letterofappreciation => true, + ToolType::ItemTicket => true, + ToolType::ValentinesChocolate => true, + ToolType::NewYearsCard => true, + ToolType::ChristmasCard => true, + ToolType::BirthdayCard => true, + ToolType::ProofofSonicTeam => true, + ToolType::SpecialEventTicket => true, + ToolType::FlowerBouquet => true, + ToolType::Cake => true, + ToolType::Accessories => true, + ToolType::MrnakasBusinessCard => true, + ToolType::Present => true, + ToolType::Chocolate => true, + ToolType::Candy => true, + ToolType::Cake2 => true, + ToolType::WeaponsSilverBadge2 => true, + ToolType::WeaponsGoldBadge2 => true, + ToolType::WeaponsCrystalBadge2 => true, + ToolType::WeaponsSteelBadge2 => true, + ToolType::WeaponsAluminumBadge2 => true, + ToolType::WeaponsLeatherBadge2 => true, + ToolType::WeaponsBoneBadge2 => true, + ToolType::Bouquet => true, + ToolType::Decoction => true, + ToolType::ChristmasPresent => true, + ToolType::EasterEgg => true, + ToolType::Jackolantern => true, + ToolType::DiskVol1weddingMarch => true, + ToolType::DiskVol2dayLight => true, + ToolType::DiskVol3burningRangers => true, + ToolType::DiskVol4openYourHeart => true, + ToolType::DiskVol5liveLearn => true, + ToolType::DiskVol6nights => true, + ToolType::DiskVol7endingThemepianover => true, + ToolType::DiskVol8hearttoHeart => true, + ToolType::DiskVol9strangeBlue => true, + ToolType::DiskVol10reunionSystem => true, + ToolType::DiskVol11pinnacles => true, + ToolType::DiskVol12fightinsidetheSpaceship => true, + ToolType::HuntersReport => true, + ToolType::HuntersReport2 => true, + ToolType::HuntersReport3 => true, + ToolType::HuntersReport4 => true, + ToolType::HuntersReport5 => true, + ToolType::Tablet => true, + ToolType::Unknown2 => true, + ToolType::DragonScale => true, + ToolType::HeavenStrikerCoat => true, + ToolType::PioneerParts => true, + ToolType::AmitiesMemo => true, + ToolType::HeartofMorolian => true, + ToolType::RappysBeak => true, + ToolType::Yahoosengine => true, + ToolType::DPhotonCore => true, + ToolType::LibertaKit => true, + ToolType::CellofMag0503 => true, + ToolType::CellofMag0504 => true, + ToolType::CellofMag0505 => true, + ToolType::CellofMag0506 => true, + ToolType::CellofMag0507 => true, + ToolType::TeamPoints500 => true, + ToolType::TeamPoints1000 => true, + ToolType::TeamPoints5000 => true, + ToolType::TeamPoints10000 => true, + } + } + + pub fn value(&self) -> [u8; 3] { + match self { + ToolType::Monomate => [0x03, 0x00, 0x00], + ToolType::Dimate => [0x03, 0x00, 0x01], + ToolType::Trimate => [0x03, 0x00, 0x02], + ToolType::Monofluid => [0x03, 0x01, 0x00], + ToolType::Difluid => [0x03, 0x01, 0x01], + ToolType::Trifluid => [0x03, 0x01, 0x02], + ToolType::SolAtomizer => [0x03, 0x03, 0x00], + ToolType::MoonAtomizer => [0x03, 0x04, 0x00], + ToolType::StarAtomizer => [0x03, 0x05, 0x00], + ToolType::Antidote => [0x03, 0x06, 0x00], + ToolType::Antiparalysis => [0x03, 0x06, 0x01], + ToolType::Telepipe => [0x03, 0x07, 0x00], + ToolType::TrapVision => [0x03, 0x08, 0x00], + ToolType::ScapeDoll => [0x03, 0x09, 0x00], + ToolType::Monogrinder => [0x03, 0x0A, 0x00], + ToolType::Digrinder => [0x03, 0x0A, 0x01], + ToolType::Trigrinder => [0x03, 0x0A, 0x02], + ToolType::PowerMaterial => [0x03, 0x0B, 0x00], + ToolType::MindMaterial => [0x03, 0x0B, 0x01], + ToolType::EvadeMaterial => [0x03, 0x0B, 0x02], + ToolType::HpMaterial => [0x03, 0x0B, 0x03], + ToolType::TpMaterial => [0x03, 0x0B, 0x04], + ToolType::DefMaterial => [0x03, 0x0B, 0x05], + ToolType::LuckMaterial => [0x03, 0x0B, 0x06], + ToolType::CellofMag502 => [0x03, 0x0C, 0x00], + ToolType::CellofMag213 => [0x03, 0x0C, 0x01], + ToolType::PartsofRobochao => [0x03, 0x0C, 0x02], + ToolType::HeartofOpaOpa => [0x03, 0x0C, 0x03], + ToolType::HeartofPian => [0x03, 0x0C, 0x04], + ToolType::HeartofChao => [0x03, 0x0C, 0x05], + ToolType::SorcerersRightArm => [0x03, 0x0D, 0x00], + ToolType::SbeatsArms => [0x03, 0x0D, 0x01], + ToolType::ParmsArms => [0x03, 0x0D, 0x02], + ToolType::DelsabersRightArm => [0x03, 0x0D, 0x03], + ToolType::BringersRightArm => [0x03, 0x0D, 0x04], + ToolType::DelsabersLeftArm => [0x03, 0x0D, 0x05], + ToolType::SredsArms => [0x03, 0x0D, 0x06], + ToolType::DragonsClaw => [0x03, 0x0D, 0x07], + ToolType::HildebearsHead => [0x03, 0x0D, 0x08], + ToolType::HildebluesHead => [0x03, 0x0D, 0x09], + ToolType::PartsofBaranz => [0x03, 0x0D, 0x0A], + ToolType::BelrasRightArm => [0x03, 0x0D, 0x0B], + ToolType::GiGuesbody => [0x03, 0x0D, 0x0C], + ToolType::SinowBerillsArms => [0x03, 0x0D, 0x0D], + ToolType::GrassAssassinsArms => [0x03, 0x0D, 0x0E], + ToolType::BoomasRightArm => [0x03, 0x0D, 0x0F], + ToolType::GoboomasRightArm => [0x03, 0x0D, 0x10], + ToolType::GigoboomasRightArm => [0x03, 0x0D, 0x11], + ToolType::GalGryphonsWing => [0x03, 0x0D, 0x12], + ToolType::RappysWing => [0x03, 0x0D, 0x13], + ToolType::CladdingofEpsilon => [0x03, 0x0D, 0x14], + ToolType::DeRolLeShell => [0x03, 0x0D, 0x15], + ToolType::BerillPhoton => [0x03, 0x0E, 0x00], + ToolType::Parasiticgeneflow => [0x03, 0x0E, 0x01], + ToolType::MagicStoneiritista => [0x03, 0x0E, 0x02], + ToolType::Blueblackstone => [0x03, 0x0E, 0x03], + ToolType::Syncesta => [0x03, 0x0E, 0x04], + ToolType::MagicWater => [0x03, 0x0E, 0x05], + ToolType::ParasiticcellTypeD => [0x03, 0x0E, 0x06], + ToolType::MagicrockheartKey => [0x03, 0x0E, 0x07], + ToolType::Magicrockmoola => [0x03, 0x0E, 0x08], + ToolType::StarAmplifier => [0x03, 0x0E, 0x09], + ToolType::BookofHitogata => [0x03, 0x0E, 0x0A], + ToolType::HeartofChuChu => [0x03, 0x0E, 0x0B], + ToolType::PartsofEggBlaster => [0x03, 0x0E, 0x0C], + ToolType::HeartofAngel => [0x03, 0x0E, 0x0D], + ToolType::HeartofDevil => [0x03, 0x0E, 0x0E], + ToolType::KitofHamburger => [0x03, 0x0E, 0x0F], + ToolType::PanthersSpirit => [0x03, 0x0E, 0x10], + ToolType::KitofMark3 => [0x03, 0x0E, 0x11], + ToolType::KitofMasterSystem => [0x03, 0x0E, 0x12], + ToolType::KitofGenesis => [0x03, 0x0E, 0x13], + ToolType::KitofSegaSaturn => [0x03, 0x0E, 0x14], + ToolType::KitofDreamcast => [0x03, 0x0E, 0x15], + ToolType::AmplifierofResta => [0x03, 0x0E, 0x16], + ToolType::AmplifierofAnti => [0x03, 0x0E, 0x17], + ToolType::AmplifierofShifta => [0x03, 0x0E, 0x18], + ToolType::AmplifierofDeband => [0x03, 0x0E, 0x19], + ToolType::AmplifierofFoie => [0x03, 0x0E, 0x1A], + ToolType::AmplifierofGifoie => [0x03, 0x0E, 0x1B], + ToolType::AmplifierofRafoie => [0x03, 0x0E, 0x1C], + ToolType::AmplifierofBarta => [0x03, 0x0E, 0x1D], + ToolType::AmplifierofGibarta => [0x03, 0x0E, 0x1E], + ToolType::AmplifierofRabarta => [0x03, 0x0E, 0x1F], + ToolType::AmplifierofZonde => [0x03, 0x0E, 0x20], + ToolType::AmplifierofGizonde => [0x03, 0x0E, 0x21], + ToolType::AmplifierofRazonde => [0x03, 0x0E, 0x22], + ToolType::AmplifierofRed => [0x03, 0x0E, 0x23], + ToolType::AmplifierofBlue => [0x03, 0x0E, 0x24], + ToolType::AmplifierofYellow => [0x03, 0x0E, 0x25], + ToolType::HeartofKapuKapu => [0x03, 0x0E, 0x26], + ToolType::PhotonBooster => [0x03, 0x0E, 0x27], + ToolType::Addslot => [0x03, 0x0F, 0x00], + ToolType::PhotonDrop => [0x03, 0x10, 0x00], + ToolType::PhotonSphere => [0x03, 0x10, 0x01], + ToolType::PhotonCrystal => [0x03, 0x10, 0x02], + ToolType::SecretTicket => [0x03, 0x10, 0x03], + ToolType::PhotonTicket => [0x03, 0x10, 0x04], + ToolType::BookofKatana1 => [0x03, 0x11, 0x00], + ToolType::BookofKatana2 => [0x03, 0x11, 0x01], + ToolType::BookofKatana3 => [0x03, 0x11, 0x02], + ToolType::WeaponsBronzeBadge => [0x03, 0x12, 0x00], + ToolType::WeaponsSilverBadge => [0x03, 0x12, 0x01], + ToolType::WeaponsGoldBadge => [0x03, 0x12, 0x02], + ToolType::WeaponsCrystalBadge => [0x03, 0x12, 0x03], + ToolType::WeaponsSteelBadge => [0x03, 0x12, 0x04], + ToolType::WeaponsAluminumBadge => [0x03, 0x12, 0x05], + ToolType::WeaponsLeatherBadge => [0x03, 0x12, 0x06], + ToolType::WeaponsBoneBadge => [0x03, 0x12, 0x07], + ToolType::Letterofappreciation => [0x03, 0x12, 0x08], + ToolType::ItemTicket => [0x03, 0x12, 0x09], + ToolType::ValentinesChocolate => [0x03, 0x12, 0x0A], + ToolType::NewYearsCard => [0x03, 0x12, 0x0B], + ToolType::ChristmasCard => [0x03, 0x12, 0x0C], + ToolType::BirthdayCard => [0x03, 0x12, 0x0D], + ToolType::ProofofSonicTeam => [0x03, 0x12, 0x0E], + ToolType::SpecialEventTicket => [0x03, 0x12, 0x0F], + ToolType::FlowerBouquet => [0x03, 0x12, 0x10], + ToolType::Cake => [0x03, 0x12, 0x11], + ToolType::Accessories => [0x03, 0x12, 0x12], + ToolType::MrnakasBusinessCard => [0x03, 0x12, 0x13], + ToolType::Present => [0x03, 0x13, 0x00], + ToolType::Chocolate => [0x03, 0x14, 0x00], + ToolType::Candy => [0x03, 0x14, 0x01], + ToolType::Cake2 => [0x03, 0x14, 0x02], + ToolType::WeaponsSilverBadge2 => [0x03, 0x14, 0x03], + ToolType::WeaponsGoldBadge2 => [0x03, 0x14, 0x04], + ToolType::WeaponsCrystalBadge2 => [0x03, 0x14, 0x05], + ToolType::WeaponsSteelBadge2 => [0x03, 0x14, 0x06], + ToolType::WeaponsAluminumBadge2 => [0x03, 0x14, 0x07], + ToolType::WeaponsLeatherBadge2 => [0x03, 0x14, 0x08], + ToolType::WeaponsBoneBadge2 => [0x03, 0x14, 0x09], + ToolType::Bouquet => [0x03, 0x14, 0x0A], + ToolType::Decoction => [0x03, 0x14, 0x0B], + ToolType::ChristmasPresent => [0x03, 0x15, 0x00], + ToolType::EasterEgg => [0x03, 0x15, 0x01], + ToolType::Jackolantern => [0x03, 0x15, 0x02], + ToolType::DiskVol1weddingMarch => [0x03, 0x16, 0x00], + ToolType::DiskVol2dayLight => [0x03, 0x16, 0x01], + ToolType::DiskVol3burningRangers => [0x03, 0x16, 0x02], + ToolType::DiskVol4openYourHeart => [0x03, 0x16, 0x03], + ToolType::DiskVol5liveLearn => [0x03, 0x16, 0x04], + ToolType::DiskVol6nights => [0x03, 0x16, 0x05], + ToolType::DiskVol7endingThemepianover => [0x03, 0x16, 0x06], + ToolType::DiskVol8hearttoHeart => [0x03, 0x16, 0x07], + ToolType::DiskVol9strangeBlue => [0x03, 0x16, 0x08], + ToolType::DiskVol10reunionSystem => [0x03, 0x16, 0x09], + ToolType::DiskVol11pinnacles => [0x03, 0x16, 0x0A], + ToolType::DiskVol12fightinsidetheSpaceship => [0x03, 0x16, 0x0B], + ToolType::HuntersReport => [0x03, 0x17, 0x00], + ToolType::HuntersReport2 => [0x03, 0x17, 0x01], + ToolType::HuntersReport3 => [0x03, 0x17, 0x02], + ToolType::HuntersReport4 => [0x03, 0x17, 0x03], + ToolType::HuntersReport5 => [0x03, 0x17, 0x04], + ToolType::Tablet => [0x03, 0x18, 0x00], + ToolType::Unknown2 => [0x03, 0x18, 0x01], + ToolType::DragonScale => [0x03, 0x18, 0x02], + ToolType::HeavenStrikerCoat => [0x03, 0x18, 0x03], + ToolType::PioneerParts => [0x03, 0x18, 0x04], + ToolType::AmitiesMemo => [0x03, 0x18, 0x05], + ToolType::HeartofMorolian => [0x03, 0x18, 0x06], + ToolType::RappysBeak => [0x03, 0x18, 0x07], + ToolType::Yahoosengine => [0x03, 0x18, 0x08], + ToolType::DPhotonCore => [0x03, 0x18, 0x09], + ToolType::LibertaKit => [0x03, 0x18, 0x0A], + ToolType::CellofMag0503 => [0x03, 0x18, 0x0B], + ToolType::CellofMag0504 => [0x03, 0x18, 0x0C], + ToolType::CellofMag0505 => [0x03, 0x18, 0x0D], + ToolType::CellofMag0506 => [0x03, 0x18, 0x0E], + ToolType::CellofMag0507 => [0x03, 0x18, 0x0F], + ToolType::TeamPoints500 => [0x03, 0x19, 0x00], + ToolType::TeamPoints1000 => [0x03, 0x19, 0x01], + ToolType::TeamPoints5000 => [0x03, 0x19, 0x02], + ToolType::TeamPoints10000 => [0x03, 0x19, 0x03], + _ => panic!() + } + } +} + + + +#[derive(Debug, Copy, Clone, PartialEq)] +pub struct StackedTool { + pub tool: ToolType, + pub count: usize, +} + +impl StackedTool { + pub fn new(tool: ToolType, count: usize) -> StackedTool { + StackedTool { + tool: tool, + count: count, + } + } + + pub fn as_bytes(&self) -> [u8; 16] { + let mut result = [0; 16]; + result[0..3].copy_from_slice(&self.tool.value()); + result[5] = self.count as u8; + + result + } +} diff --git a/src/entity/item/weapon.rs b/src/entity/item/weapon.rs new file mode 100644 index 0000000..e7f121c --- /dev/null +++ b/src/entity/item/weapon.rs @@ -0,0 +1,1688 @@ +use std::convert::{TryFrom, Into}; + + +#[derive(Debug, Copy, Clone, PartialEq)] +pub enum Attribute { + Native, + ABeast, + Machine, + Dark, + Hit +} + +#[derive(Debug, Copy, Clone, PartialEq)] +pub struct WeaponAttribute { + attr: Attribute, + value: u8, +} + + +#[derive(Debug, Copy, Clone, PartialEq)] +pub enum WeaponSpecial { + Draw, + Drain, + Fill, + Gush, + Heart, + Mind, + Soul, + Geist, + Masters, + Lords, + Kings, + Charge, + Spirit, + Berserk, + Ice, + Frost, + Freeze, + Blizzard, + Bind, + Hold, + Seize, + Arrest, + Heat, + Fire, + Flame, + Burning, + Shock, + Thunder, + Storm, + Tempest, + Dim, + Shadow, + Dark, + Hell, + Panic, + Riot, + Havoc, + Chaos, + Devils, + Demons, +} + +pub enum WeaponTypeError { + UnknownWeapon(String) +} + +#[derive(Debug, Copy, Clone, PartialEq)] +pub enum WeaponType { + Saber, + Brand, + Buster, + Pallasch, + Gladius, + DbsSaber, + Kaladbolg, + Durandal, + Galatine, + Sword, + Gigush, + Breaker, + Claymore, + Calibur, + FlowensSword, + LastSurvivor, + DragonSlayer, + Dagger, + Knife, + Blade, + Edge, + Ripper, + BladeDance, + BloodyArt, + CrossScar, + ZeroDivide, + TwoKamui, + Partisan, + Halbert, + Glaive, + Berdys, + Gungnir, + Brionac, + Vjaya, + GaeBolg, + AsteronBelt, + Slicer, + Spinner, + Cutter, + Sawcer, + Diska, + SlicerOfAssassin, + DiskaOfLiberator, + DiskaOfBraveman, + Izmaela, + Handgun, + Autogun, + Lockgun, + Railgun, + Raygun, + Varista, + CustomRayveroo, + Bravace, + TensionBlaster, + Rifle, + Sniper, + Blaster, + Beam, + Laser, + Visk235w, + Walsmk2, + Justy23st, + Rianov303snr, + Rianov303snr1, + Rianov303snr2, + Rianov303snr3, + Rianov303snr4, + Rianov303snr5, + Mechgun, + Assault, + Repeater, + Gatling, + Vulcan, + MA60Vise, + HS25Justice, + LK14Combat, + Shot, + Spread, + Cannon, + Launcher, + Arms, + CrushBullet, + MeteorSmash, + FinalImpact, + Cane, + Stick, + Mace, + Club, + ClubOfLaconium, + MaceOfAdaman, + ClubOfZumiuran, + Lollipop, + Rod, + Pole, + Pillar, + Striker, + BattleVerge, + BraveHammer, + AliveAqhu, + Valkyrie, + Wand, + Staff, + Baton, + Scepter, + FireScepteragni, + IceStaffdagon, + StormWandindra, + EarthWandBrownie, + PhotonClaw, + SilenceClaw, + NeisClaw, + PhoenixClaw, + DoubleSaber, + StagCutlery, + TwinBrand, + BraveKnuckle, + AngryFist, + GodHand, + SonicKnuckle, + Login, + Orotiagito, + Agito1975, + Agito1983, + Agito2001, + Agito1991, + Agito1977, + Agito1980, + Raikiri, + SoulEater, + SoulBanish, + SpreadNeedle, + HolyRay, + InfernoBazooka, + RamblingMay, + LK38Combat, + FlameVisit, + BurningVisit, + AkikosFryingPan, + SorcerersCane, + SBeatsBlade, + PArmssBlade, + DelsabersBuster, + BringersRifle, + EggBlaster, + PsychoWand, + HeavenPunisher, + LavisCannon, + VictorAxe, + LaconiumAxe, + ChainSawd, + Caduceus, + MercuriusRod, + StingTip, + MagicalPiece, + TechnicalCrozier, + SuppressedGun, + AncientSaber, + HarisenBattleFan, + Yamigarasu, + AkikosWok, + ToyHammer, + Elysion, + RedSaber, + MeteorCudgel, + MonkeyKingBar, + BlackKingBar, + DoubleCannon, + Girasole, + HugeBattleFan, + TsumikiriJSword, + SealedJSword, + RedSword, + CrazyTune, + TwinChakram, + WokOfAkikosShop, + LavisBlade, + RedDagger, + MadamsParasol, + MadamsUmbrella, + ImperialPick, + Berdysh, + RedPartisan, + FlightCutter, + FlightFan, + RedSlicer, + Handgunguld, + MasterRaven, + Handgunmilla, + LastSwan, + RedHandgun, + FrozenShooter, + SnowQueen, + AntiAndroidRifle, + RocketPunch, + SambaMaracas, + TwinPsychogun, + DrillLauncher, + GuldMilla, + DualBird, + RedMechgun, + BelraCannon, + PanzerFaust, + IronFaust, + SummitMoon, + Windmill, + EvilCurst, + FlowerCane, + HildebearsCane, + HildebluesCane, + RabbitWand, + PlantainLeaf, + Fatsia, + DemonicFork, + StrikerOfChao, + Broom, + ProphetsOfMotav, + TheSighOfAGod, + TwinkleStar, + PlantainFan, + TwinBlaze, + MarinasBag, + DragonsClaw, + PanthersClaw, + SRedsBlade, + PlantainHugeFan, + ChameleonScythe, + Yasminkov3000r, + AnoRifle, + BaranzLauncher, + BranchOfPakupaku, + HeartOfPoumn, + Yasminkov2000h, + Yasminkov7000v, + Yasminkov9000m, + MaserBeam, + PowerMaser, + GameMagazne, + Login2, + FlowerBouquet, + Musashi, + Yamato, + Asuka, + SangeYasha, + Sange, + Yasha, + Kamui, + PhotonLauncher, + GuiltyLight, + RedScorpio, + PhononMaser, + Talis, + Mahu, + Hitogata, + DancingHitogata, + Kunai, + Nug2000bazooka, + SBerillsHands0, + SBerillsHands1, + FlowensSword3060, + FlowensSword3064, + FlowensSword3067, + FlowensSword3073, + FlowensSword3077, + FlowensSword3082, + FlowensSword3083, + FlowensSword3084, + FlowensSword3079, + DbsSaber3062, + DbsSaber3067, + DbsSaber3069Chris, + DbsSaber3064, + DbsSaber3069Torato, + DbsSaber3073, + DbsSaber3070, + DbsSaber3075, + DbsSaber3077, + GiGueBazooka, + Guardianna, + ViridiaCard, + GreenillCard, + SkylyCard, + BluefullCard, + PurplenumCard, + PinkalCard, + RedriaCard, + OranCard, + YellowbozeCard, + WhitillCard, + MorningGlory, + PartisanofLightning, + GalWind, + Zanba, + RikasClaw, + AngelHarp, + DemolitionComet, + NeisClaw2, + RainbowBaton, + DarkFlow, + DarkMeteor, + DarkBridge, + GAssassinsSabers, + RappysFan, + BoomasClaw, + GoboomasClaw, + GigoboomasClaw, + RubyBullet, + AmoreRose, + SlicerOfFanatic, + LameDArgent, + Excalibur, + RageDeFeu, + RageDeFeu2, + RageDeFeu3, + RageDeFeu4, + DaisyChain, + OphelieSeize, + MilleMarteaux, + LeCogneur, + CommanderBlade, + Vivienne, + Kusanagi, + SacredDuster, + Guren, + Shouren, + Jizai, + Flamberge, + Yunchang, + SnakeSpire, + FlapjackFlapper, + Getsugasan, + Maguwa, + HeavenStriker, + CannonRouge, + MeteorRouge, + Solferino, + Clio, + SirenGlassHammer, + GlideDivine, + Shichishito, + Murasame, + DaylightScar, + Decalog, + FifthAnnivBlade, + TyrellsParasol, + AkikosCleaver, + Tanegashima, + TreeClippers, + NiceShot, + Unknown3, + Unknown4, + AnoBazooka, + Synthesizer, + BambooSpear, + KaneiTsuho, + Jitte, + ButterflyNet, + Syringe, + Battledore, + Racket, + Hammer, + GreatBouquet, + TypesaSaber, + TypeslSaber, + TypeslSlicer, + TypeslClaw, + TypeslKatana, + TypejsSaber, + TypejsSlicer, + TypejsJSword, + TypeswSword, + TypeswSlicer, + TypeswJSword, + TyperoSword, + TyperoHalbert, + TyperoRod, + TypeblBlade, + TypeknBlade, + TypeknClaw, + TypehaHalbert, + TypehaRod, + TypedsDSaber, + TypedsRod, + Typeds, + TypeclClaw, + TypessSw, + TypeguHand, + TypeguMechgun, + TyperiRifle, + TypemeMechgun, + TypeshShot, + TypewaWand, +} + +impl WeaponType { + pub fn value(&self) -> [u8; 3] { + match self { + WeaponType::Saber => [0x00, 0x01, 0x00], + WeaponType::Brand => [0x00, 0x01, 0x01], + WeaponType::Buster => [0x00, 0x01, 0x02], + WeaponType::Pallasch => [0x00, 0x01, 0x03], + WeaponType::Gladius => [0x00, 0x01, 0x04], + WeaponType::DbsSaber => [0x00, 0x01, 0x05], + WeaponType::Kaladbolg => [0x00, 0x01, 0x06], + WeaponType::Durandal => [0x00, 0x01, 0x07], + WeaponType::Galatine => [0x00, 0x01, 0x08], + WeaponType::Sword => [0x00, 0x02, 0x00], + WeaponType::Gigush => [0x00, 0x02, 0x01], + WeaponType::Breaker => [0x00, 0x02, 0x02], + WeaponType::Claymore => [0x00, 0x02, 0x03], + WeaponType::Calibur => [0x00, 0x02, 0x04], + WeaponType::FlowensSword => [0x00, 0x02, 0x05], + WeaponType::LastSurvivor => [0x00, 0x02, 0x06], + WeaponType::DragonSlayer => [0x00, 0x02, 0x07], + WeaponType::Dagger => [0x00, 0x03, 0x00], + WeaponType::Knife => [0x00, 0x03, 0x01], + WeaponType::Blade => [0x00, 0x03, 0x02], + WeaponType::Edge => [0x00, 0x03, 0x03], + WeaponType::Ripper => [0x00, 0x03, 0x04], + WeaponType::BladeDance => [0x00, 0x03, 0x05], + WeaponType::BloodyArt => [0x00, 0x03, 0x06], + WeaponType::CrossScar => [0x00, 0x03, 0x07], + WeaponType::ZeroDivide => [0x00, 0x03, 0x08], + WeaponType::TwoKamui => [0x00, 0x03, 0x09], + WeaponType::Partisan => [0x00, 0x04, 0x00], + WeaponType::Halbert => [0x00, 0x04, 0x01], + WeaponType::Glaive => [0x00, 0x04, 0x02], + WeaponType::Berdys => [0x00, 0x04, 0x03], + WeaponType::Gungnir => [0x00, 0x04, 0x04], + WeaponType::Brionac => [0x00, 0x04, 0x05], + WeaponType::Vjaya => [0x00, 0x04, 0x06], + WeaponType::GaeBolg => [0x00, 0x04, 0x07], + WeaponType::AsteronBelt => [0x00, 0x04, 0x08], + WeaponType::Slicer => [0x00, 0x05, 0x00], + WeaponType::Spinner => [0x00, 0x05, 0x01], + WeaponType::Cutter => [0x00, 0x05, 0x02], + WeaponType::Sawcer => [0x00, 0x05, 0x03], + WeaponType::Diska => [0x00, 0x05, 0x04], + WeaponType::SlicerOfAssassin => [0x00, 0x05, 0x05], + WeaponType::DiskaOfLiberator => [0x00, 0x05, 0x06], + WeaponType::DiskaOfBraveman => [0x00, 0x05, 0x07], + WeaponType::Izmaela => [0x00, 0x05, 0x08], + WeaponType::Handgun => [0x00, 0x06, 0x00], + WeaponType::Autogun => [0x00, 0x06, 0x01], + WeaponType::Lockgun => [0x00, 0x06, 0x02], + WeaponType::Railgun => [0x00, 0x06, 0x03], + WeaponType::Raygun => [0x00, 0x06, 0x04], + WeaponType::Varista => [0x00, 0x06, 0x05], + WeaponType::CustomRayveroo => [0x00, 0x06, 0x06], + WeaponType::Bravace => [0x00, 0x06, 0x07], + WeaponType::TensionBlaster => [0x00, 0x06, 0x08], + WeaponType::Rifle => [0x00, 0x07, 0x00], + WeaponType::Sniper => [0x00, 0x07, 0x01], + WeaponType::Blaster => [0x00, 0x07, 0x02], + WeaponType::Beam => [0x00, 0x07, 0x03], + WeaponType::Laser => [0x00, 0x07, 0x04], + WeaponType::Visk235w => [0x00, 0x07, 0x05], + WeaponType::Walsmk2 => [0x00, 0x07, 0x06], + WeaponType::Justy23st => [0x00, 0x07, 0x07], + WeaponType::Rianov303snr => [0x00, 0x07, 0x08], + WeaponType::Rianov303snr1 => [0x00, 0x07, 0x09], + WeaponType::Rianov303snr2 => [0x00, 0x07, 0x0A], + WeaponType::Rianov303snr3 => [0x00, 0x07, 0x0B], + WeaponType::Rianov303snr4 => [0x00, 0x07, 0x0C], + WeaponType::Rianov303snr5 => [0x00, 0x07, 0x0D], + WeaponType::Mechgun => [0x00, 0x08, 0x00], + WeaponType::Assault => [0x00, 0x08, 0x01], + WeaponType::Repeater => [0x00, 0x08, 0x02], + WeaponType::Gatling => [0x00, 0x08, 0x03], + WeaponType::Vulcan => [0x00, 0x08, 0x04], + WeaponType::MA60Vise => [0x00, 0x08, 0x05], + WeaponType::HS25Justice => [0x00, 0x08, 0x06], + WeaponType::LK14Combat => [0x00, 0x08, 0x07], + WeaponType::Shot => [0x00, 0x09, 0x00], + WeaponType::Spread => [0x00, 0x09, 0x01], + WeaponType::Cannon => [0x00, 0x09, 0x02], + WeaponType::Launcher => [0x00, 0x09, 0x03], + WeaponType::Arms => [0x00, 0x09, 0x04], + WeaponType::CrushBullet => [0x00, 0x09, 0x05], + WeaponType::MeteorSmash => [0x00, 0x09, 0x06], + WeaponType::FinalImpact => [0x00, 0x09, 0x07], + WeaponType::Cane => [0x00, 0x0A, 0x00], + WeaponType::Stick => [0x00, 0x0A, 0x01], + WeaponType::Mace => [0x00, 0x0A, 0x02], + WeaponType::Club => [0x00, 0x0A, 0x03], + WeaponType::ClubOfLaconium => [0x00, 0x0A, 0x04], + WeaponType::MaceOfAdaman => [0x00, 0x0A, 0x05], + WeaponType::ClubOfZumiuran => [0x00, 0x0A, 0x06], + WeaponType::Lollipop => [0x00, 0x0A, 0x07], + WeaponType::Rod => [0x00, 0x0B, 0x00], + WeaponType::Pole => [0x00, 0x0B, 0x01], + WeaponType::Pillar => [0x00, 0x0B, 0x02], + WeaponType::Striker => [0x00, 0x0B, 0x03], + WeaponType::BattleVerge => [0x00, 0x0B, 0x04], + WeaponType::BraveHammer => [0x00, 0x0B, 0x05], + WeaponType::AliveAqhu => [0x00, 0x0B, 0x06], + WeaponType::Valkyrie => [0x00, 0x0B, 0x07], + WeaponType::Wand => [0x00, 0x0C, 0x00], + WeaponType::Staff => [0x00, 0x0C, 0x01], + WeaponType::Baton => [0x00, 0x0C, 0x02], + WeaponType::Scepter => [0x00, 0x0C, 0x03], + WeaponType::FireScepteragni => [0x00, 0x0C, 0x04], + WeaponType::IceStaffdagon => [0x00, 0x0C, 0x05], + WeaponType::StormWandindra => [0x00, 0x0C, 0x06], + WeaponType::EarthWandBrownie => [0x00, 0x0C, 0x07], + WeaponType::PhotonClaw => [0x00, 0x0D, 0x00], + WeaponType::SilenceClaw => [0x00, 0x0D, 0x01], + WeaponType::NeisClaw => [0x00, 0x0D, 0x02], + WeaponType::PhoenixClaw => [0x00, 0x0D, 0x03], + WeaponType::DoubleSaber => [0x00, 0x0E, 0x00], + WeaponType::StagCutlery => [0x00, 0x0E, 0x01], + WeaponType::TwinBrand => [0x00, 0x0E, 0x02], + WeaponType::BraveKnuckle => [0x00, 0x0F, 0x00], + WeaponType::AngryFist => [0x00, 0x0F, 0x01], + WeaponType::GodHand => [0x00, 0x0F, 0x02], + WeaponType::SonicKnuckle => [0x00, 0x0F, 0x03], + WeaponType::Login => [0x00, 0x0F, 0x04], + WeaponType::Orotiagito => [0x00, 0x10, 0x00], + WeaponType::Agito1975 => [0x00, 0x10, 0x01], + WeaponType::Agito1983 => [0x00, 0x10, 0x02], + WeaponType::Agito2001 => [0x00, 0x10, 0x03], + WeaponType::Agito1991 => [0x00, 0x10, 0x04], + WeaponType::Agito1977 => [0x00, 0x10, 0x05], + WeaponType::Agito1980 => [0x00, 0x10, 0x06], + WeaponType::Raikiri => [0x00, 0x10, 0x07], + WeaponType::SoulEater => [0x00, 0x11, 0x00], + WeaponType::SoulBanish => [0x00, 0x11, 0x01], + WeaponType::SpreadNeedle => [0x00, 0x12, 0x00], + WeaponType::HolyRay => [0x00, 0x13, 0x00], + WeaponType::InfernoBazooka => [0x00, 0x14, 0x00], + WeaponType::RamblingMay => [0x00, 0x14, 0x01], + WeaponType::LK38Combat => [0x00, 0x14, 0x02], + WeaponType::FlameVisit => [0x00, 0x15, 0x00], + WeaponType::BurningVisit => [0x00, 0x15, 0x01], + WeaponType::AkikosFryingPan => [0x00, 0x16, 0x00], + WeaponType::SorcerersCane => [0x00, 0x17, 0x00], + WeaponType::SBeatsBlade => [0x00, 0x18, 0x00], + WeaponType::PArmssBlade => [0x00, 0x19, 0x00], + WeaponType::DelsabersBuster => [0x00, 0x1A, 0x00], + WeaponType::BringersRifle => [0x00, 0x1B, 0x00], + WeaponType::EggBlaster => [0x00, 0x1C, 0x00], + WeaponType::PsychoWand => [0x00, 0x1D, 0x00], + WeaponType::HeavenPunisher => [0x00, 0x1E, 0x00], + WeaponType::LavisCannon => [0x00, 0x1F, 0x00], + WeaponType::VictorAxe => [0x00, 0x20, 0x00], + WeaponType::LaconiumAxe => [0x00, 0x20, 0x01], + WeaponType::ChainSawd => [0x00, 0x21, 0x00], + WeaponType::Caduceus => [0x00, 0x22, 0x00], + WeaponType::MercuriusRod => [0x00, 0x22, 0x01], + WeaponType::StingTip => [0x00, 0x23, 0x00], + WeaponType::MagicalPiece => [0x00, 0x24, 0x00], + WeaponType::TechnicalCrozier => [0x00, 0x25, 0x00], + WeaponType::SuppressedGun => [0x00, 0x26, 0x00], + WeaponType::AncientSaber => [0x00, 0x27, 0x00], + WeaponType::HarisenBattleFan => [0x00, 0x28, 0x00], + WeaponType::Yamigarasu => [0x00, 0x29, 0x00], + WeaponType::AkikosWok => [0x00, 0x2A, 0x00], + WeaponType::ToyHammer => [0x00, 0x2B, 0x00], + WeaponType::Elysion => [0x00, 0x2C, 0x00], + WeaponType::RedSaber => [0x00, 0x2D, 0x00], + WeaponType::MeteorCudgel => [0x00, 0x2E, 0x00], + WeaponType::MonkeyKingBar => [0x00, 0x2F, 0x00], + WeaponType::BlackKingBar => [0x00, 0x2F, 0x01], + WeaponType::DoubleCannon => [0x00, 0x30, 0x00], + WeaponType::Girasole => [0x00, 0x30, 0x01], + WeaponType::HugeBattleFan => [0x00, 0x31, 0x00], + WeaponType::TsumikiriJSword => [0x00, 0x32, 0x00], + WeaponType::SealedJSword => [0x00, 0x33, 0x00], + WeaponType::RedSword => [0x00, 0x34, 0x00], + WeaponType::CrazyTune => [0x00, 0x35, 0x00], + WeaponType::TwinChakram => [0x00, 0x36, 0x00], + WeaponType::WokOfAkikosShop => [0x00, 0x37, 0x00], + WeaponType::LavisBlade => [0x00, 0x38, 0x00], + WeaponType::RedDagger => [0x00, 0x39, 0x00], + WeaponType::MadamsParasol => [0x00, 0x3A, 0x00], + WeaponType::MadamsUmbrella => [0x00, 0x3B, 0x00], + WeaponType::ImperialPick => [0x00, 0x3C, 0x00], + WeaponType::Berdysh => [0x00, 0x3D, 0x00], + WeaponType::RedPartisan => [0x00, 0x3E, 0x00], + WeaponType::FlightCutter => [0x00, 0x3F, 0x00], + WeaponType::FlightFan => [0x00, 0x40, 0x00], + WeaponType::RedSlicer => [0x00, 0x41, 0x00], + WeaponType::Handgunguld => [0x00, 0x42, 0x00], + WeaponType::MasterRaven => [0x00, 0x42, 0x01], + WeaponType::Handgunmilla => [0x00, 0x43, 0x00], + WeaponType::LastSwan => [0x00, 0x43, 0x01], + WeaponType::RedHandgun => [0x00, 0x44, 0x00], + WeaponType::FrozenShooter => [0x00, 0x45, 0x00], + WeaponType::SnowQueen => [0x00, 0x45, 0x01], + WeaponType::AntiAndroidRifle => [0x00, 0x46, 0x00], + WeaponType::RocketPunch => [0x00, 0x47, 0x00], + WeaponType::SambaMaracas => [0x00, 0x48, 0x00], + WeaponType::TwinPsychogun => [0x00, 0x49, 0x00], + WeaponType::DrillLauncher => [0x00, 0x4A, 0x00], + WeaponType::GuldMilla => [0x00, 0x4B, 0x00], + WeaponType::DualBird => [0x00, 0x4B, 0x01], + WeaponType::RedMechgun => [0x00, 0x4C, 0x00], + WeaponType::BelraCannon => [0x00, 0x4D, 0x00], + WeaponType::PanzerFaust => [0x00, 0x4E, 0x00], + WeaponType::IronFaust => [0x00, 0x4E, 0x01], + WeaponType::SummitMoon => [0x00, 0x4F, 0x00], + WeaponType::Windmill => [0x00, 0x50, 0x00], + WeaponType::EvilCurst => [0x00, 0x51, 0x00], + WeaponType::FlowerCane => [0x00, 0x52, 0x00], + WeaponType::HildebearsCane => [0x00, 0x53, 0x00], + WeaponType::HildebluesCane => [0x00, 0x54, 0x00], + WeaponType::RabbitWand => [0x00, 0x55, 0x00], + WeaponType::PlantainLeaf => [0x00, 0x56, 0x00], + WeaponType::Fatsia => [0x00, 0x56, 0x01], + WeaponType::DemonicFork => [0x00, 0x57, 0x00], + WeaponType::StrikerOfChao => [0x00, 0x58, 0x00], + WeaponType::Broom => [0x00, 0x59, 0x00], + WeaponType::ProphetsOfMotav => [0x00, 0x5A, 0x00], + WeaponType::TheSighOfAGod => [0x00, 0x5B, 0x00], + WeaponType::TwinkleStar => [0x00, 0x5C, 0x00], + WeaponType::PlantainFan => [0x00, 0x5D, 0x00], + WeaponType::TwinBlaze => [0x00, 0x5E, 0x00], + WeaponType::MarinasBag => [0x00, 0x5F, 0x00], + WeaponType::DragonsClaw => [0x00, 0x60, 0x00], + WeaponType::PanthersClaw => [0x00, 0x61, 0x00], + WeaponType::SRedsBlade => [0x00, 0x62, 0x00], + WeaponType::PlantainHugeFan => [0x00, 0x63, 0x00], + WeaponType::ChameleonScythe => [0x00, 0x64, 0x00], + WeaponType::Yasminkov3000r => [0x00, 0x65, 0x00], + WeaponType::AnoRifle => [0x00, 0x66, 0x00], + WeaponType::BaranzLauncher => [0x00, 0x67, 0x00], + WeaponType::BranchOfPakupaku => [0x00, 0x68, 0x00], + WeaponType::HeartOfPoumn => [0x00, 0x69, 0x00], + WeaponType::Yasminkov2000h => [0x00, 0x6A, 0x00], + WeaponType::Yasminkov7000v => [0x00, 0x6B, 0x00], + WeaponType::Yasminkov9000m => [0x00, 0x6C, 0x00], + WeaponType::MaserBeam => [0x00, 0x6D, 0x00], + WeaponType::PowerMaser => [0x00, 0x6D, 0x01], + WeaponType::GameMagazne => [0x00, 0x6E, 0x00], + WeaponType::Login2 => [0x00, 0x6E, 0x01], + WeaponType::FlowerBouquet => [0x00, 0x6F, 0x00], + WeaponType::Musashi => [0x00, 0x89, 0x00], + WeaponType::Yamato => [0x00, 0x89, 0x01], + WeaponType::Asuka => [0x00, 0x89, 0x02], + WeaponType::SangeYasha => [0x00, 0x89, 0x03], + WeaponType::Sange => [0x00, 0x8A, 0x00], + WeaponType::Yasha => [0x00, 0x8A, 0x01], + WeaponType::Kamui => [0x00, 0x8A, 0x02], + WeaponType::PhotonLauncher => [0x00, 0x8B, 0x00], + WeaponType::GuiltyLight => [0x00, 0x8B, 0x01], + WeaponType::RedScorpio => [0x00, 0x8B, 0x02], + WeaponType::PhononMaser => [0x00, 0x8B, 0x03], + WeaponType::Talis => [0x00, 0x8C, 0x00], + WeaponType::Mahu => [0x00, 0x8C, 0x01], + WeaponType::Hitogata => [0x00, 0x8C, 0x02], + WeaponType::DancingHitogata => [0x00, 0x8C, 0x03], + WeaponType::Kunai => [0x00, 0x8C, 0x04], + WeaponType::Nug2000bazooka => [0x00, 0x8D, 0x00], + WeaponType::SBerillsHands0 => [0x00, 0x8E, 0x00], + WeaponType::SBerillsHands1 => [0x00, 0x8E, 0x01], + WeaponType::FlowensSword3060 => [0x00, 0x8F, 0x00], + WeaponType::FlowensSword3064 => [0x00, 0x8F, 0x01], + WeaponType::FlowensSword3067 => [0x00, 0x8F, 0x02], + WeaponType::FlowensSword3073 => [0x00, 0x8F, 0x03], + WeaponType::FlowensSword3077 => [0x00, 0x8F, 0x04], + WeaponType::FlowensSword3082 => [0x00, 0x8F, 0x05], + WeaponType::FlowensSword3083 => [0x00, 0x8F, 0x06], + WeaponType::FlowensSword3084 => [0x00, 0x8F, 0x07], + WeaponType::FlowensSword3079 => [0x00, 0x8F, 0x08], + WeaponType::DbsSaber3062 => [0x00, 0x90, 0x00], + WeaponType::DbsSaber3067 => [0x00, 0x90, 0x01], + WeaponType::DbsSaber3069Chris => [0x00, 0x90, 0x02], + WeaponType::DbsSaber3064 => [0x00, 0x90, 0x03], + WeaponType::DbsSaber3069Torato => [0x00, 0x90, 0x04], + WeaponType::DbsSaber3073 => [0x00, 0x90, 0x05], + WeaponType::DbsSaber3070 => [0x00, 0x90, 0x06], + WeaponType::DbsSaber3075 => [0x00, 0x90, 0x07], + WeaponType::DbsSaber3077 => [0x00, 0x90, 0x08], + WeaponType::GiGueBazooka => [0x00, 0x91, 0x00], + WeaponType::Guardianna => [0x00, 0x92, 0x00], + WeaponType::ViridiaCard => [0x00, 0x93, 0x00], + WeaponType::GreenillCard => [0x00, 0x93, 0x01], + WeaponType::SkylyCard => [0x00, 0x93, 0x02], + WeaponType::BluefullCard => [0x00, 0x93, 0x03], + WeaponType::PurplenumCard => [0x00, 0x93, 0x04], + WeaponType::PinkalCard => [0x00, 0x93, 0x05], + WeaponType::RedriaCard => [0x00, 0x93, 0x06], + WeaponType::OranCard => [0x00, 0x93, 0x07], + WeaponType::YellowbozeCard => [0x00, 0x93, 0x08], + WeaponType::WhitillCard => [0x00, 0x93, 0x09], + WeaponType::MorningGlory => [0x00, 0x94, 0x00], + WeaponType::PartisanofLightning => [0x00, 0x95, 0x00], + WeaponType::GalWind => [0x00, 0x96, 0x00], + WeaponType::Zanba => [0x00, 0x97, 0x00], + WeaponType::RikasClaw => [0x00, 0x98, 0x00], + WeaponType::AngelHarp => [0x00, 0x99, 0x00], + WeaponType::DemolitionComet => [0x00, 0x9A, 0x00], + WeaponType::NeisClaw2 => [0x00, 0x9B, 0x00], + WeaponType::RainbowBaton => [0x00, 0x9C, 0x00], + WeaponType::DarkFlow => [0x00, 0x9D, 0x00], + WeaponType::DarkMeteor => [0x00, 0x9E, 0x00], + WeaponType::DarkBridge => [0x00, 0x9F, 0x00], + WeaponType::GAssassinsSabers => [0x00, 0xA0, 0x00], + WeaponType::RappysFan => [0x00, 0xA1, 0x00], + WeaponType::BoomasClaw => [0x00, 0xA2, 0x00], + WeaponType::GoboomasClaw => [0x00, 0xA2, 0x01], + WeaponType::GigoboomasClaw => [0x00, 0xA2, 0x02], + WeaponType::RubyBullet => [0x00, 0xA3, 0x00], + WeaponType::AmoreRose => [0x00, 0xA4, 0x00], + WeaponType::SlicerOfFanatic => [0x00, 0xAA, 0x00], + WeaponType::LameDArgent => [0x00, 0xAB, 0x00], + WeaponType::Excalibur => [0x00, 0xAC, 0x00], + WeaponType::RageDeFeu => [0x00, 0xAD, 0x00], + WeaponType::RageDeFeu2 => [0x00, 0xAD, 0x01], + WeaponType::RageDeFeu3 => [0x00, 0xAD, 0x02], + WeaponType::RageDeFeu4 => [0x00, 0xAD, 0x03], + WeaponType::DaisyChain => [0x00, 0xAE, 0x00], + WeaponType::OphelieSeize => [0x00, 0xAF, 0x00], + WeaponType::MilleMarteaux => [0x00, 0xB0, 0x00], + WeaponType::LeCogneur => [0x00, 0xB1, 0x00], + WeaponType::CommanderBlade => [0x00, 0xB2, 0x00], + WeaponType::Vivienne => [0x00, 0xB3, 0x00], + WeaponType::Kusanagi => [0x00, 0xB4, 0x00], + WeaponType::SacredDuster => [0x00, 0xB5, 0x00], + WeaponType::Guren => [0x00, 0xB6, 0x00], + WeaponType::Shouren => [0x00, 0xB7, 0x00], + WeaponType::Jizai => [0x00, 0xB8, 0x00], + WeaponType::Flamberge => [0x00, 0xB9, 0x00], + WeaponType::Yunchang => [0x00, 0xBA, 0x00], + WeaponType::SnakeSpire => [0x00, 0xBB, 0x00], + WeaponType::FlapjackFlapper => [0x00, 0xBC, 0x00], + WeaponType::Getsugasan => [0x00, 0xBD, 0x00], + WeaponType::Maguwa => [0x00, 0xBE, 0x00], + WeaponType::HeavenStriker => [0x00, 0xBF, 0x00], + WeaponType::CannonRouge => [0x00, 0xC0, 0x00], + WeaponType::MeteorRouge => [0x00, 0xC1, 0x00], + WeaponType::Solferino => [0x00, 0xC2, 0x00], + WeaponType::Clio => [0x00, 0xC3, 0x00], + WeaponType::SirenGlassHammer => [0x00, 0xC4, 0x00], + WeaponType::GlideDivine => [0x00, 0xC5, 0x00], + WeaponType::Shichishito => [0x00, 0xC6, 0x00], + WeaponType::Murasame => [0x00, 0xC7, 0x00], + WeaponType::DaylightScar => [0x00, 0xC8, 0x00], + WeaponType::Decalog => [0x00, 0xC9, 0x00], + WeaponType::FifthAnnivBlade => [0x00, 0xCA, 0x00], + WeaponType::TyrellsParasol => [0x00, 0xCB, 0x00], + WeaponType::AkikosCleaver => [0x00, 0xCC, 0x00], + WeaponType::Tanegashima => [0x00, 0xCD, 0x00], + WeaponType::TreeClippers => [0x00, 0xCE, 0x00], + WeaponType::NiceShot => [0x00, 0xCF, 0x00], + WeaponType::Unknown3 => [0x00, 0xD0, 0x00], + WeaponType::Unknown4 => [0x00, 0xD1, 0x00], + WeaponType::AnoBazooka => [0x00, 0xD2, 0x00], + WeaponType::Synthesizer => [0x00, 0xD3, 0x00], + WeaponType::BambooSpear => [0x00, 0xD4, 0x00], + WeaponType::KaneiTsuho => [0x00, 0xD5, 0x00], + WeaponType::Jitte => [0x00, 0xD6, 0x00], + WeaponType::ButterflyNet => [0x00, 0xD7, 0x00], + WeaponType::Syringe => [0x00, 0xD8, 0x00], + WeaponType::Battledore => [0x00, 0xD9, 0x00], + WeaponType::Racket => [0x00, 0xDA, 0x00], + WeaponType::Hammer => [0x00, 0xDB, 0x00], + WeaponType::GreatBouquet => [0x00, 0xDC, 0x00], + WeaponType::TypesaSaber => [0x00, 0xDD, 0x00], + WeaponType::TypeslSaber => [0x00, 0xDE, 0x00], + WeaponType::TypeslSlicer => [0x00, 0xDE, 0x01], + WeaponType::TypeslClaw => [0x00, 0xDE, 0x02], + WeaponType::TypeslKatana => [0x00, 0xDE, 0x03], + WeaponType::TypejsSaber => [0x00, 0xDF, 0x00], + WeaponType::TypejsSlicer => [0x00, 0xDF, 0x01], + WeaponType::TypejsJSword => [0x00, 0xDF, 0x02], + WeaponType::TypeswSword => [0x00, 0xE0, 0x00], + WeaponType::TypeswSlicer => [0x00, 0xE0, 0x01], + WeaponType::TypeswJSword => [0x00, 0xE0, 0x02], + WeaponType::TyperoSword => [0x00, 0xE1, 0x00], + WeaponType::TyperoHalbert => [0x00, 0xE1, 0x01], + WeaponType::TyperoRod => [0x00, 0xE1, 0x02], + WeaponType::TypeblBlade => [0x00, 0xE2, 0x00], + WeaponType::TypeknBlade => [0x00, 0xE3, 0x00], + WeaponType::TypeknClaw => [0x00, 0xE3, 0x01], + WeaponType::TypehaHalbert => [0x00, 0xE4, 0x00], + WeaponType::TypehaRod => [0x00, 0xE4, 0x01], + WeaponType::TypedsDSaber => [0x00, 0xE5, 0x00], + WeaponType::TypedsRod => [0x00, 0xE5, 0x01], + WeaponType::Typeds => [0x00, 0xE5, 0x02], + WeaponType::TypeclClaw => [0x00, 0xE6, 0x00], + WeaponType::TypessSw => [0x00, 0xE7, 0x00], + WeaponType::TypeguHand => [0x00, 0xE8, 0x00], + WeaponType::TypeguMechgun => [0x00, 0xE8, 0x01], + WeaponType::TyperiRifle => [0x00, 0xE9, 0x00], + WeaponType::TypemeMechgun => [0x00, 0xEA, 0x00], + WeaponType::TypeshShot => [0x00, 0xEB, 0x00], + WeaponType::TypewaWand => [0x00, 0xEC, 0x00], + } + } +} + +impl TryFrom<&str> for WeaponType { + type Error = WeaponTypeError; + fn try_from(value: &str) -> Result { + match value { + "Saber" => Ok(WeaponType::Saber), + "Brand" => Ok(WeaponType::Brand), + "Buster" => Ok(WeaponType::Buster), + "Pallasch" => Ok(WeaponType::Pallasch), + "Gladius" => Ok(WeaponType::Gladius), + "DbsSaber" => Ok(WeaponType::DbsSaber), + "Kaladbolg" => Ok(WeaponType::Kaladbolg), + "Durandal" => Ok(WeaponType::Durandal), + "Galatine" => Ok(WeaponType::Galatine), + "Sword" => Ok(WeaponType::Sword), + "Gigush" => Ok(WeaponType::Gigush), + "Breaker" => Ok(WeaponType::Breaker), + "Claymore" => Ok(WeaponType::Claymore), + "Calibur" => Ok(WeaponType::Calibur), + "FlowensSword" => Ok(WeaponType::FlowensSword), + "LastSurvivor" => Ok(WeaponType::LastSurvivor), + "DragonSlayer" => Ok(WeaponType::DragonSlayer), + "Dagger" => Ok(WeaponType::Dagger), + "Knife" => Ok(WeaponType::Knife), + "Blade" => Ok(WeaponType::Blade), + "Edge" => Ok(WeaponType::Edge), + "Ripper" => Ok(WeaponType::Ripper), + "BladeDance" => Ok(WeaponType::BladeDance), + "BloodyArt" => Ok(WeaponType::BloodyArt), + "CrossScar" => Ok(WeaponType::CrossScar), + "ZeroDivide" => Ok(WeaponType::ZeroDivide), + "TwoKamui" => Ok(WeaponType::TwoKamui), + "Partisan" => Ok(WeaponType::Partisan), + "Halbert" => Ok(WeaponType::Halbert), + "Glaive" => Ok(WeaponType::Glaive), + "Berdys" => Ok(WeaponType::Berdys), + "Gungnir" => Ok(WeaponType::Gungnir), + "Brionac" => Ok(WeaponType::Brionac), + "Vjaya" => Ok(WeaponType::Vjaya), + "GaeBolg" => Ok(WeaponType::GaeBolg), + "AsteronBelt" => Ok(WeaponType::AsteronBelt), + "Slicer" => Ok(WeaponType::Slicer), + "Spinner" => Ok(WeaponType::Spinner), + "Cutter" => Ok(WeaponType::Cutter), + "Sawcer" => Ok(WeaponType::Sawcer), + "Diska" => Ok(WeaponType::Diska), + "SlicerOfAssassin" => Ok(WeaponType::SlicerOfAssassin), + "DiskaOfLiberator" => Ok(WeaponType::DiskaOfLiberator), + "DiskaOfBraveman" => Ok(WeaponType::DiskaOfBraveman), + "Izmaela" => Ok(WeaponType::Izmaela), + "Handgun" => Ok(WeaponType::Handgun), + "Autogun" => Ok(WeaponType::Autogun), + "Lockgun" => Ok(WeaponType::Lockgun), + "Railgun" => Ok(WeaponType::Railgun), + "Raygun" => Ok(WeaponType::Raygun), + "Varista" => Ok(WeaponType::Varista), + "CustomRayveroo" => Ok(WeaponType::CustomRayveroo), + "Bravace" => Ok(WeaponType::Bravace), + "TensionBlaster" => Ok(WeaponType::TensionBlaster), + "Rifle" => Ok(WeaponType::Rifle), + "Sniper" => Ok(WeaponType::Sniper), + "Blaster" => Ok(WeaponType::Blaster), + "Beam" => Ok(WeaponType::Beam), + "Laser" => Ok(WeaponType::Laser), + "Visk235w" => Ok(WeaponType::Visk235w), + "Walsmk2" => Ok(WeaponType::Walsmk2), + "Justy23st" => Ok(WeaponType::Justy23st), + "Rianov303snr" => Ok(WeaponType::Rianov303snr), + "Rianov303snr1" => Ok(WeaponType::Rianov303snr1), + "Rianov303snr2" => Ok(WeaponType::Rianov303snr2), + "Rianov303snr3" => Ok(WeaponType::Rianov303snr3), + "Rianov303snr4" => Ok(WeaponType::Rianov303snr4), + "Rianov303snr5" => Ok(WeaponType::Rianov303snr5), + "Mechgun" => Ok(WeaponType::Mechgun), + "Assault" => Ok(WeaponType::Assault), + "Repeater" => Ok(WeaponType::Repeater), + "Gatling" => Ok(WeaponType::Gatling), + "Vulcan" => Ok(WeaponType::Vulcan), + "MA60Vise" => Ok(WeaponType::MA60Vise), + "HS25Justice" => Ok(WeaponType::HS25Justice), + "LK14Combat" => Ok(WeaponType::LK14Combat), + "Shot" => Ok(WeaponType::Shot), + "Spread" => Ok(WeaponType::Spread), + "Cannon" => Ok(WeaponType::Cannon), + "Launcher" => Ok(WeaponType::Launcher), + "Arms" => Ok(WeaponType::Arms), + "CrushBullet" => Ok(WeaponType::CrushBullet), + "MeteorSmash" => Ok(WeaponType::MeteorSmash), + "FinalImpact" => Ok(WeaponType::FinalImpact), + "Cane" => Ok(WeaponType::Cane), + "Stick" => Ok(WeaponType::Stick), + "Mace" => Ok(WeaponType::Mace), + "Club" => Ok(WeaponType::Club), + "ClubOfLaconium" => Ok(WeaponType::ClubOfLaconium), + "MaceOfAdaman" => Ok(WeaponType::MaceOfAdaman), + "ClubOfZumiuran" => Ok(WeaponType::ClubOfZumiuran), + "Lollipop" => Ok(WeaponType::Lollipop), + "Rod" => Ok(WeaponType::Rod), + "Pole" => Ok(WeaponType::Pole), + "Pillar" => Ok(WeaponType::Pillar), + "Striker" => Ok(WeaponType::Striker), + "BattleVerge" => Ok(WeaponType::BattleVerge), + "BraveHammer" => Ok(WeaponType::BraveHammer), + "AliveAqhu" => Ok(WeaponType::AliveAqhu), + "Valkyrie" => Ok(WeaponType::Valkyrie), + "Wand" => Ok(WeaponType::Wand), + "Staff" => Ok(WeaponType::Staff), + "Baton" => Ok(WeaponType::Baton), + "Scepter" => Ok(WeaponType::Scepter), + "FireScepteragni" => Ok(WeaponType::FireScepteragni), + "IceStaffdagon" => Ok(WeaponType::IceStaffdagon), + "StormWandindra" => Ok(WeaponType::StormWandindra), + "EarthWandBrownie" => Ok(WeaponType::EarthWandBrownie), + "PhotonClaw" => Ok(WeaponType::PhotonClaw), + "SilenceClaw" => Ok(WeaponType::SilenceClaw), + "NeisClaw" => Ok(WeaponType::NeisClaw), + "PhoenixClaw" => Ok(WeaponType::PhoenixClaw), + "DoubleSaber" => Ok(WeaponType::DoubleSaber), + "StagCutlery" => Ok(WeaponType::StagCutlery), + "TwinBrand" => Ok(WeaponType::TwinBrand), + "BraveKnuckle" => Ok(WeaponType::BraveKnuckle), + "AngryFist" => Ok(WeaponType::AngryFist), + "GodHand" => Ok(WeaponType::GodHand), + "SonicKnuckle" => Ok(WeaponType::SonicKnuckle), + "Login" => Ok(WeaponType::Login), + "Orotiagito" => Ok(WeaponType::Orotiagito), + "Agito1975" => Ok(WeaponType::Agito1975), + "Agito1983" => Ok(WeaponType::Agito1983), + "Agito2001" => Ok(WeaponType::Agito2001), + "Agito1991" => Ok(WeaponType::Agito1991), + "Agito1977" => Ok(WeaponType::Agito1977), + "Agito1980" => Ok(WeaponType::Agito1980), + "Raikiri" => Ok(WeaponType::Raikiri), + "SoulEater" => Ok(WeaponType::SoulEater), + "SoulBanish" => Ok(WeaponType::SoulBanish), + "SpreadNeedle" => Ok(WeaponType::SpreadNeedle), + "HolyRay" => Ok(WeaponType::HolyRay), + "InfernoBazooka" => Ok(WeaponType::InfernoBazooka), + "RamblingMay" => Ok(WeaponType::RamblingMay), + "LK38Combat" => Ok(WeaponType::LK38Combat), + "FlameVisit" => Ok(WeaponType::FlameVisit), + "BurningVisit" => Ok(WeaponType::BurningVisit), + "AkikosFryingPan" => Ok(WeaponType::AkikosFryingPan), + "SorcerersCane" => Ok(WeaponType::SorcerersCane), + "SBeatsBlade" => Ok(WeaponType::SBeatsBlade), + "PArmssBlade" => Ok(WeaponType::PArmssBlade), + "DelsabersBuster" => Ok(WeaponType::DelsabersBuster), + "BringersRifle" => Ok(WeaponType::BringersRifle), + "EggBlaster" => Ok(WeaponType::EggBlaster), + "PsychoWand" => Ok(WeaponType::PsychoWand), + "HeavenPunisher" => Ok(WeaponType::HeavenPunisher), + "LavisCannon" => Ok(WeaponType::LavisCannon), + "VictorAxe" => Ok(WeaponType::VictorAxe), + "LaconiumAxe" => Ok(WeaponType::LaconiumAxe), + "ChainSawd" => Ok(WeaponType::ChainSawd), + "Caduceus" => Ok(WeaponType::Caduceus), + "MercuriusRod" => Ok(WeaponType::MercuriusRod), + "StingTip" => Ok(WeaponType::StingTip), + "MagicalPiece" => Ok(WeaponType::MagicalPiece), + "TechnicalCrozier" => Ok(WeaponType::TechnicalCrozier), + "SuppressedGun" => Ok(WeaponType::SuppressedGun), + "AncientSaber" => Ok(WeaponType::AncientSaber), + "HarisenBattleFan" => Ok(WeaponType::HarisenBattleFan), + "Yamigarasu" => Ok(WeaponType::Yamigarasu), + "AkikosWok" => Ok(WeaponType::AkikosWok), + "ToyHammer" => Ok(WeaponType::ToyHammer), + "Elysion" => Ok(WeaponType::Elysion), + "RedSaber" => Ok(WeaponType::RedSaber), + "MeteorCudgel" => Ok(WeaponType::MeteorCudgel), + "MonkeyKingBar" => Ok(WeaponType::MonkeyKingBar), + "BlackKingBar" => Ok(WeaponType::BlackKingBar), + "DoubleCannon" => Ok(WeaponType::DoubleCannon), + "Girasole" => Ok(WeaponType::Girasole), + "HugeBattleFan" => Ok(WeaponType::HugeBattleFan), + "TsumikiriJSword" => Ok(WeaponType::TsumikiriJSword), + "SealedJSword" => Ok(WeaponType::SealedJSword), + "RedSword" => Ok(WeaponType::RedSword), + "CrazyTune" => Ok(WeaponType::CrazyTune), + "TwinChakram" => Ok(WeaponType::TwinChakram), + "WokOfAkikosShop" => Ok(WeaponType::WokOfAkikosShop), + "LavisBlade" => Ok(WeaponType::LavisBlade), + "RedDagger" => Ok(WeaponType::RedDagger), + "MadamsParasol" => Ok(WeaponType::MadamsParasol), + "MadamsUmbrella" => Ok(WeaponType::MadamsUmbrella), + "ImperialPick" => Ok(WeaponType::ImperialPick), + "Berdysh" => Ok(WeaponType::Berdysh), + "RedPartisan" => Ok(WeaponType::RedPartisan), + "FlightCutter" => Ok(WeaponType::FlightCutter), + "FlightFan" => Ok(WeaponType::FlightFan), + "RedSlicer" => Ok(WeaponType::RedSlicer), + "Handgunguld" => Ok(WeaponType::Handgunguld), + "MasterRaven" => Ok(WeaponType::MasterRaven), + "Handgunmilla" => Ok(WeaponType::Handgunmilla), + "LastSwan" => Ok(WeaponType::LastSwan), + "RedHandgun" => Ok(WeaponType::RedHandgun), + "FrozenShooter" => Ok(WeaponType::FrozenShooter), + "SnowQueen" => Ok(WeaponType::SnowQueen), + "AntiAndroidRifle" => Ok(WeaponType::AntiAndroidRifle), + "RocketPunch" => Ok(WeaponType::RocketPunch), + "SambaMaracas" => Ok(WeaponType::SambaMaracas), + "TwinPsychogun" => Ok(WeaponType::TwinPsychogun), + "DrillLauncher" => Ok(WeaponType::DrillLauncher), + "GuldMilla" => Ok(WeaponType::GuldMilla), + "DualBird" => Ok(WeaponType::DualBird), + "RedMechgun" => Ok(WeaponType::RedMechgun), + "BelraCannon" => Ok(WeaponType::BelraCannon), + "PanzerFaust" => Ok(WeaponType::PanzerFaust), + "IronFaust" => Ok(WeaponType::IronFaust), + "SummitMoon" => Ok(WeaponType::SummitMoon), + "Windmill" => Ok(WeaponType::Windmill), + "EvilCurst" => Ok(WeaponType::EvilCurst), + "FlowerCane" => Ok(WeaponType::FlowerCane), + "HildebearsCane" => Ok(WeaponType::HildebearsCane), + "HildebluesCane" => Ok(WeaponType::HildebluesCane), + "RabbitWand" => Ok(WeaponType::RabbitWand), + "PlantainLeaf" => Ok(WeaponType::PlantainLeaf), + "Fatsia" => Ok(WeaponType::Fatsia), + "DemonicFork" => Ok(WeaponType::DemonicFork), + "StrikerOfChao" => Ok(WeaponType::StrikerOfChao), + "Broom" => Ok(WeaponType::Broom), + "ProphetsOfMotav" => Ok(WeaponType::ProphetsOfMotav), + "TheSighOfAGod" => Ok(WeaponType::TheSighOfAGod), + "TwinkleStar" => Ok(WeaponType::TwinkleStar), + "PlantainFan" => Ok(WeaponType::PlantainFan), + "TwinBlaze" => Ok(WeaponType::TwinBlaze), + "MarinasBag" => Ok(WeaponType::MarinasBag), + "DragonsClaw" => Ok(WeaponType::DragonsClaw), + "PanthersClaw" => Ok(WeaponType::PanthersClaw), + "SRedsBlade" => Ok(WeaponType::SRedsBlade), + "PlantainHugeFan" => Ok(WeaponType::PlantainHugeFan), + "ChameleonScythe" => Ok(WeaponType::ChameleonScythe), + "Yasminkov3000r" => Ok(WeaponType::Yasminkov3000r), + "AnoRifle" => Ok(WeaponType::AnoRifle), + "BaranzLauncher" => Ok(WeaponType::BaranzLauncher), + "BranchOfPakupaku" => Ok(WeaponType::BranchOfPakupaku), + "HeartOfPoumn" => Ok(WeaponType::HeartOfPoumn), + "Yasminkov2000h" => Ok(WeaponType::Yasminkov2000h), + "Yasminkov7000v" => Ok(WeaponType::Yasminkov7000v), + "Yasminkov9000m" => Ok(WeaponType::Yasminkov9000m), + "MaserBeam" => Ok(WeaponType::MaserBeam), + "PowerMaser" => Ok(WeaponType::PowerMaser), + "GameMagazne" => Ok(WeaponType::GameMagazne), + "Login2" => Ok(WeaponType::Login2), + "FlowerBouquet" => Ok(WeaponType::FlowerBouquet), + "Musashi" => Ok(WeaponType::Musashi), + "Yamato" => Ok(WeaponType::Yamato), + "Asuka" => Ok(WeaponType::Asuka), + "SangeYasha" => Ok(WeaponType::SangeYasha), + "Sange" => Ok(WeaponType::Sange), + "Yasha" => Ok(WeaponType::Yasha), + "Kamui" => Ok(WeaponType::Kamui), + "PhotonLauncher" => Ok(WeaponType::PhotonLauncher), + "GuiltyLight" => Ok(WeaponType::GuiltyLight), + "RedScorpio" => Ok(WeaponType::RedScorpio), + "PhononMaser" => Ok(WeaponType::PhononMaser), + "Talis" => Ok(WeaponType::Talis), + "Mahu" => Ok(WeaponType::Mahu), + "Hitogata" => Ok(WeaponType::Hitogata), + "DancingHitogata" => Ok(WeaponType::DancingHitogata), + "Kunai" => Ok(WeaponType::Kunai), + "Nug2000bazooka" => Ok(WeaponType::Nug2000bazooka), + "SBerillsHands0" => Ok(WeaponType::SBerillsHands0), + "SBerillsHands1" => Ok(WeaponType::SBerillsHands1), + "FlowensSword3060" => Ok(WeaponType::FlowensSword3060), + "FlowensSword3064" => Ok(WeaponType::FlowensSword3064), + "FlowensSword3067" => Ok(WeaponType::FlowensSword3067), + "FlowensSword3073" => Ok(WeaponType::FlowensSword3073), + "FlowensSword3077" => Ok(WeaponType::FlowensSword3077), + "FlowensSword3082" => Ok(WeaponType::FlowensSword3082), + "FlowensSword3083" => Ok(WeaponType::FlowensSword3083), + "FlowensSword3084" => Ok(WeaponType::FlowensSword3084), + "FlowensSword3079" => Ok(WeaponType::FlowensSword3079), + "DbsSaber3062" => Ok(WeaponType::DbsSaber3062), + "DbsSaber3067" => Ok(WeaponType::DbsSaber3067), + "DbsSaber3069Chris" => Ok(WeaponType::DbsSaber3069Chris), + "DbsSaber3064" => Ok(WeaponType::DbsSaber3064), + "DbsSaber3069Torato" => Ok(WeaponType::DbsSaber3069Torato), + "DbsSaber3073" => Ok(WeaponType::DbsSaber3073), + "DbsSaber3070" => Ok(WeaponType::DbsSaber3070), + "DbsSaber3075" => Ok(WeaponType::DbsSaber3075), + "DbsSaber3077" => Ok(WeaponType::DbsSaber3077), + "GiGueBazooka" => Ok(WeaponType::GiGueBazooka), + "Guardianna" => Ok(WeaponType::Guardianna), + "ViridiaCard" => Ok(WeaponType::ViridiaCard), + "GreenillCard" => Ok(WeaponType::GreenillCard), + "SkylyCard" => Ok(WeaponType::SkylyCard), + "BluefullCard" => Ok(WeaponType::BluefullCard), + "PurplenumCard" => Ok(WeaponType::PurplenumCard), + "PinkalCard" => Ok(WeaponType::PinkalCard), + "RedriaCard" => Ok(WeaponType::RedriaCard), + "OranCard" => Ok(WeaponType::OranCard), + "YellowbozeCard" => Ok(WeaponType::YellowbozeCard), + "WhitillCard" => Ok(WeaponType::WhitillCard), + "MorningGlory" => Ok(WeaponType::MorningGlory), + "PartisanofLightning" => Ok(WeaponType::PartisanofLightning), + "GalWind" => Ok(WeaponType::GalWind), + "Zanba" => Ok(WeaponType::Zanba), + "RikasClaw" => Ok(WeaponType::RikasClaw), + "AngelHarp" => Ok(WeaponType::AngelHarp), + "DemolitionComet" => Ok(WeaponType::DemolitionComet), + "NeisClaw2" => Ok(WeaponType::NeisClaw2), + "RainbowBaton" => Ok(WeaponType::RainbowBaton), + "DarkFlow" => Ok(WeaponType::DarkFlow), + "DarkMeteor" => Ok(WeaponType::DarkMeteor), + "DarkBridge" => Ok(WeaponType::DarkBridge), + "GAssassinsSabers" => Ok(WeaponType::GAssassinsSabers), + "RappysFan" => Ok(WeaponType::RappysFan), + "BoomasClaw" => Ok(WeaponType::BoomasClaw), + "GoboomasClaw" => Ok(WeaponType::GoboomasClaw), + "GigoboomasClaw" => Ok(WeaponType::GigoboomasClaw), + "RubyBullet" => Ok(WeaponType::RubyBullet), + "AmoreRose" => Ok(WeaponType::AmoreRose), + "SlicerOfFanatic" => Ok(WeaponType::SlicerOfFanatic), + "LameDArgent" => Ok(WeaponType::LameDArgent), + "Excalibur" => Ok(WeaponType::Excalibur), + "RageDeFeu" => Ok(WeaponType::RageDeFeu), + "RageDeFeu2" => Ok(WeaponType::RageDeFeu2), + "RageDeFeu3" => Ok(WeaponType::RageDeFeu3), + "RageDeFeu4" => Ok(WeaponType::RageDeFeu4), + "DaisyChain" => Ok(WeaponType::DaisyChain), + "OphelieSeize" => Ok(WeaponType::OphelieSeize), + "MilleMarteaux" => Ok(WeaponType::MilleMarteaux), + "LeCogneur" => Ok(WeaponType::LeCogneur), + "CommanderBlade" => Ok(WeaponType::CommanderBlade), + "Vivienne" => Ok(WeaponType::Vivienne), + "Kusanagi" => Ok(WeaponType::Kusanagi), + "SacredDuster" => Ok(WeaponType::SacredDuster), + "Guren" => Ok(WeaponType::Guren), + "Shouren" => Ok(WeaponType::Shouren), + "Jizai" => Ok(WeaponType::Jizai), + "Flamberge" => Ok(WeaponType::Flamberge), + "Yunchang" => Ok(WeaponType::Yunchang), + "SnakeSpire" => Ok(WeaponType::SnakeSpire), + "FlapjackFlapper" => Ok(WeaponType::FlapjackFlapper), + "Getsugasan" => Ok(WeaponType::Getsugasan), + "Maguwa" => Ok(WeaponType::Maguwa), + "HeavenStriker" => Ok(WeaponType::HeavenStriker), + "CannonRouge" => Ok(WeaponType::CannonRouge), + "MeteorRouge" => Ok(WeaponType::MeteorRouge), + "Solferino" => Ok(WeaponType::Solferino), + "Clio" => Ok(WeaponType::Clio), + "SirenGlassHammer" => Ok(WeaponType::SirenGlassHammer), + "GlideDivine" => Ok(WeaponType::GlideDivine), + "Shichishito" => Ok(WeaponType::Shichishito), + "Murasame" => Ok(WeaponType::Murasame), + "DaylightScar" => Ok(WeaponType::DaylightScar), + "Decalog" => Ok(WeaponType::Decalog), + "FifthAnnivBlade" => Ok(WeaponType::FifthAnnivBlade), + "TyrellsParasol" => Ok(WeaponType::TyrellsParasol), + "AkikosCleaver" => Ok(WeaponType::AkikosCleaver), + "Tanegashima" => Ok(WeaponType::Tanegashima), + "TreeClippers" => Ok(WeaponType::TreeClippers), + "NiceShot" => Ok(WeaponType::NiceShot), + "Unknown3" => Ok(WeaponType::Unknown3), + "Unknown4" => Ok(WeaponType::Unknown4), + "AnoBazooka" => Ok(WeaponType::AnoBazooka), + "Synthesizer" => Ok(WeaponType::Synthesizer), + "BambooSpear" => Ok(WeaponType::BambooSpear), + "KaneiTsuho" => Ok(WeaponType::KaneiTsuho), + "Jitte" => Ok(WeaponType::Jitte), + "ButterflyNet" => Ok(WeaponType::ButterflyNet), + "Syringe" => Ok(WeaponType::Syringe), + "Battledore" => Ok(WeaponType::Battledore), + "Racket" => Ok(WeaponType::Racket), + "Hammer" => Ok(WeaponType::Hammer), + "GreatBouquet" => Ok(WeaponType::GreatBouquet), + "TypesaSaber" => Ok(WeaponType::TypesaSaber), + "TypeslSaber" => Ok(WeaponType::TypeslSaber), + "TypeslSlicer" => Ok(WeaponType::TypeslSlicer), + "TypeslClaw" => Ok(WeaponType::TypeslClaw), + "TypeslKatana" => Ok(WeaponType::TypeslKatana), + "TypejsSaber" => Ok(WeaponType::TypejsSaber), + "TypejsSlicer" => Ok(WeaponType::TypejsSlicer), + "TypejsJSword" => Ok(WeaponType::TypejsJSword), + "TypeswSword" => Ok(WeaponType::TypeswSword), + "TypeswSlicer" => Ok(WeaponType::TypeswSlicer), + "TypeswJSword" => Ok(WeaponType::TypeswJSword), + "TyperoSword" => Ok(WeaponType::TyperoSword), + "TyperoHalbert" => Ok(WeaponType::TyperoHalbert), + "TyperoRod" => Ok(WeaponType::TyperoRod), + "TypeblBlade" => Ok(WeaponType::TypeblBlade), + "TypeknBlade" => Ok(WeaponType::TypeknBlade), + "TypeknClaw" => Ok(WeaponType::TypeknClaw), + "TypehaHalbert" => Ok(WeaponType::TypehaHalbert), + "TypehaRod" => Ok(WeaponType::TypehaRod), + "TypedsDSaber" => Ok(WeaponType::TypedsDSaber), + "TypedsRod" => Ok(WeaponType::TypedsRod), + "Typeds" => Ok(WeaponType::Typeds), + "TypeclClaw" => Ok(WeaponType::TypeclClaw), + "TypessSw" => Ok(WeaponType::TypessSw), + "TypeguHand" => Ok(WeaponType::TypeguHand), + "TypeguMechgun" => Ok(WeaponType::TypeguMechgun), + "TyperiRifle" => Ok(WeaponType::TyperiRifle), + "TypemeMechgun" => Ok(WeaponType::TypemeMechgun), + "TypeshShot" => Ok(WeaponType::TypeshShot), + "TypewaWand" => Ok(WeaponType::TypewaWand), + _ => Err(WeaponTypeError::UnknownWeapon(value.to_string())) + } + } +} + +impl Into for WeaponType { + fn into(self) -> String { + match self { + WeaponType::Saber => "Saber", + WeaponType::Brand => "Brand", + WeaponType::Buster => "Buster", + WeaponType::Pallasch => "Pallasch", + WeaponType::Gladius => "Gladius", + WeaponType::DbsSaber => "DbsSaber", + WeaponType::Kaladbolg => "Kaladbolg", + WeaponType::Durandal => "Durandal", + WeaponType::Galatine => "Galatine", + WeaponType::Sword => "Sword", + WeaponType::Gigush => "Gigush", + WeaponType::Breaker => "Breaker", + WeaponType::Claymore => "Claymore", + WeaponType::Calibur => "Calibur", + WeaponType::FlowensSword => "FlowensSword", + WeaponType::LastSurvivor => "LastSurvivor", + WeaponType::DragonSlayer => "DragonSlayer", + WeaponType::Dagger => "Dagger", + WeaponType::Knife => "Knife", + WeaponType::Blade => "Blade", + WeaponType::Edge => "Edge", + WeaponType::Ripper => "Ripper", + WeaponType::BladeDance => "BladeDance", + WeaponType::BloodyArt => "BloodyArt", + WeaponType::CrossScar => "CrossScar", + WeaponType::ZeroDivide => "ZeroDivide", + WeaponType::TwoKamui => "TwoKamui", + WeaponType::Partisan => "Partisan", + WeaponType::Halbert => "Halbert", + WeaponType::Glaive => "Glaive", + WeaponType::Berdys => "Berdys", + WeaponType::Gungnir => "Gungnir", + WeaponType::Brionac => "Brionac", + WeaponType::Vjaya => "Vjaya", + WeaponType::GaeBolg => "GaeBolg", + WeaponType::AsteronBelt => "AsteronBelt", + WeaponType::Slicer => "Slicer", + WeaponType::Spinner => "Spinner", + WeaponType::Cutter => "Cutter", + WeaponType::Sawcer => "Sawcer", + WeaponType::Diska => "Diska", + WeaponType::SlicerOfAssassin => "SlicerOfAssassin", + WeaponType::DiskaOfLiberator => "DiskaOfLiberator", + WeaponType::DiskaOfBraveman => "DiskaOfBraveman", + WeaponType::Izmaela => "Izmaela", + WeaponType::Handgun => "Handgun", + WeaponType::Autogun => "Autogun", + WeaponType::Lockgun => "Lockgun", + WeaponType::Railgun => "Railgun", + WeaponType::Raygun => "Raygun", + WeaponType::Varista => "Varista", + WeaponType::CustomRayveroo => "CustomRayveroo", + WeaponType::Bravace => "Bravace", + WeaponType::TensionBlaster => "TensionBlaster", + WeaponType::Rifle => "Rifle", + WeaponType::Sniper => "Sniper", + WeaponType::Blaster => "Blaster", + WeaponType::Beam => "Beam", + WeaponType::Laser => "Laser", + WeaponType::Visk235w => "Visk235w", + WeaponType::Walsmk2 => "Walsmk2", + WeaponType::Justy23st => "Justy23st", + WeaponType::Rianov303snr => "Rianov303snr", + WeaponType::Rianov303snr1 => "Rianov303snr1", + WeaponType::Rianov303snr2 => "Rianov303snr2", + WeaponType::Rianov303snr3 => "Rianov303snr3", + WeaponType::Rianov303snr4 => "Rianov303snr4", + WeaponType::Rianov303snr5 => "Rianov303snr5", + WeaponType::Mechgun => "Mechgun", + WeaponType::Assault => "Assault", + WeaponType::Repeater => "Repeater", + WeaponType::Gatling => "Gatling", + WeaponType::Vulcan => "Vulcan", + WeaponType::MA60Vise => "MA60Vise", + WeaponType::HS25Justice => "HS25Justice", + WeaponType::LK14Combat => "LK14Combat", + WeaponType::Shot => "Shot", + WeaponType::Spread => "Spread", + WeaponType::Cannon => "Cannon", + WeaponType::Launcher => "Launcher", + WeaponType::Arms => "Arms", + WeaponType::CrushBullet => "CrushBullet", + WeaponType::MeteorSmash => "MeteorSmash", + WeaponType::FinalImpact => "FinalImpact", + WeaponType::Cane => "Cane", + WeaponType::Stick => "Stick", + WeaponType::Mace => "Mace", + WeaponType::Club => "Club", + WeaponType::ClubOfLaconium => "ClubOfLaconium", + WeaponType::MaceOfAdaman => "MaceOfAdaman", + WeaponType::ClubOfZumiuran => "ClubOfZumiuran", + WeaponType::Lollipop => "Lollipop", + WeaponType::Rod => "Rod", + WeaponType::Pole => "Pole", + WeaponType::Pillar => "Pillar", + WeaponType::Striker => "Striker", + WeaponType::BattleVerge => "BattleVerge", + WeaponType::BraveHammer => "BraveHammer", + WeaponType::AliveAqhu => "AliveAqhu", + WeaponType::Valkyrie => "Valkyrie", + WeaponType::Wand => "Wand", + WeaponType::Staff => "Staff", + WeaponType::Baton => "Baton", + WeaponType::Scepter => "Scepter", + WeaponType::FireScepteragni => "FireScepteragni", + WeaponType::IceStaffdagon => "IceStaffdagon", + WeaponType::StormWandindra => "StormWandindra", + WeaponType::EarthWandBrownie => "EarthWandBrownie", + WeaponType::PhotonClaw => "PhotonClaw", + WeaponType::SilenceClaw => "SilenceClaw", + WeaponType::NeisClaw => "NeisClaw", + WeaponType::PhoenixClaw => "PhoenixClaw", + WeaponType::DoubleSaber => "DoubleSaber", + WeaponType::StagCutlery => "StagCutlery", + WeaponType::TwinBrand => "TwinBrand", + WeaponType::BraveKnuckle => "BraveKnuckle", + WeaponType::AngryFist => "AngryFist", + WeaponType::GodHand => "GodHand", + WeaponType::SonicKnuckle => "SonicKnuckle", + WeaponType::Login => "Login", + WeaponType::Orotiagito => "Orotiagito", + WeaponType::Agito1975 => "Agito1975", + WeaponType::Agito1983 => "Agito1983", + WeaponType::Agito2001 => "Agito2001", + WeaponType::Agito1991 => "Agito1991", + WeaponType::Agito1977 => "Agito1977", + WeaponType::Agito1980 => "Agito1980", + WeaponType::Raikiri => "Raikiri", + WeaponType::SoulEater => "SoulEater", + WeaponType::SoulBanish => "SoulBanish", + WeaponType::SpreadNeedle => "SpreadNeedle", + WeaponType::HolyRay => "HolyRay", + WeaponType::InfernoBazooka => "InfernoBazooka", + WeaponType::RamblingMay => "RamblingMay", + WeaponType::LK38Combat => "LK38Combat", + WeaponType::FlameVisit => "FlameVisit", + WeaponType::BurningVisit => "BurningVisit", + WeaponType::AkikosFryingPan => "AkikosFryingPan", + WeaponType::SorcerersCane => "SorcerersCane", + WeaponType::SBeatsBlade => "SBeatsBlade", + WeaponType::PArmssBlade => "PArmssBlade", + WeaponType::DelsabersBuster => "DelsabersBuster", + WeaponType::BringersRifle => "BringersRifle", + WeaponType::EggBlaster => "EggBlaster", + WeaponType::PsychoWand => "PsychoWand", + WeaponType::HeavenPunisher => "HeavenPunisher", + WeaponType::LavisCannon => "LavisCannon", + WeaponType::VictorAxe => "VictorAxe", + WeaponType::LaconiumAxe => "LaconiumAxe", + WeaponType::ChainSawd => "ChainSawd", + WeaponType::Caduceus => "Caduceus", + WeaponType::MercuriusRod => "MercuriusRod", + WeaponType::StingTip => "StingTip", + WeaponType::MagicalPiece => "MagicalPiece", + WeaponType::TechnicalCrozier => "TechnicalCrozier", + WeaponType::SuppressedGun => "SuppressedGun", + WeaponType::AncientSaber => "AncientSaber", + WeaponType::HarisenBattleFan => "HarisenBattleFan", + WeaponType::Yamigarasu => "Yamigarasu", + WeaponType::AkikosWok => "AkikosWok", + WeaponType::ToyHammer => "ToyHammer", + WeaponType::Elysion => "Elysion", + WeaponType::RedSaber => "RedSaber", + WeaponType::MeteorCudgel => "MeteorCudgel", + WeaponType::MonkeyKingBar => "MonkeyKingBar", + WeaponType::BlackKingBar => "BlackKingBar", + WeaponType::DoubleCannon => "DoubleCannon", + WeaponType::Girasole => "Girasole", + WeaponType::HugeBattleFan => "HugeBattleFan", + WeaponType::TsumikiriJSword => "TsumikiriJSword", + WeaponType::SealedJSword => "SealedJSword", + WeaponType::RedSword => "RedSword", + WeaponType::CrazyTune => "CrazyTune", + WeaponType::TwinChakram => "TwinChakram", + WeaponType::WokOfAkikosShop => "WokOfAkikosShop", + WeaponType::LavisBlade => "LavisBlade", + WeaponType::RedDagger => "RedDagger", + WeaponType::MadamsParasol => "MadamsParasol", + WeaponType::MadamsUmbrella => "MadamsUmbrella", + WeaponType::ImperialPick => "ImperialPick", + WeaponType::Berdysh => "Berdysh", + WeaponType::RedPartisan => "RedPartisan", + WeaponType::FlightCutter => "FlightCutter", + WeaponType::FlightFan => "FlightFan", + WeaponType::RedSlicer => "RedSlicer", + WeaponType::Handgunguld => "Handgunguld", + WeaponType::MasterRaven => "MasterRaven", + WeaponType::Handgunmilla => "Handgunmilla", + WeaponType::LastSwan => "LastSwan", + WeaponType::RedHandgun => "RedHandgun", + WeaponType::FrozenShooter => "FrozenShooter", + WeaponType::SnowQueen => "SnowQueen", + WeaponType::AntiAndroidRifle => "AntiAndroidRifle", + WeaponType::RocketPunch => "RocketPunch", + WeaponType::SambaMaracas => "SambaMaracas", + WeaponType::TwinPsychogun => "TwinPsychogun", + WeaponType::DrillLauncher => "DrillLauncher", + WeaponType::GuldMilla => "GuldMilla", + WeaponType::DualBird => "DualBird", + WeaponType::RedMechgun => "RedMechgun", + WeaponType::BelraCannon => "BelraCannon", + WeaponType::PanzerFaust => "PanzerFaust", + WeaponType::IronFaust => "IronFaust", + WeaponType::SummitMoon => "SummitMoon", + WeaponType::Windmill => "Windmill", + WeaponType::EvilCurst => "EvilCurst", + WeaponType::FlowerCane => "FlowerCane", + WeaponType::HildebearsCane => "HildebearsCane", + WeaponType::HildebluesCane => "HildebluesCane", + WeaponType::RabbitWand => "RabbitWand", + WeaponType::PlantainLeaf => "PlantainLeaf", + WeaponType::Fatsia => "Fatsia", + WeaponType::DemonicFork => "DemonicFork", + WeaponType::StrikerOfChao => "StrikerOfChao", + WeaponType::Broom => "Broom", + WeaponType::ProphetsOfMotav => "ProphetsOfMotav", + WeaponType::TheSighOfAGod => "TheSighOfAGod", + WeaponType::TwinkleStar => "TwinkleStar", + WeaponType::PlantainFan => "PlantainFan", + WeaponType::TwinBlaze => "TwinBlaze", + WeaponType::MarinasBag => "MarinasBag", + WeaponType::DragonsClaw => "DragonsClaw", + WeaponType::PanthersClaw => "PanthersClaw", + WeaponType::SRedsBlade => "SRedsBlade", + WeaponType::PlantainHugeFan => "PlantainHugeFan", + WeaponType::ChameleonScythe => "ChameleonScythe", + WeaponType::Yasminkov3000r => "Yasminkov3000r", + WeaponType::AnoRifle => "AnoRifle", + WeaponType::BaranzLauncher => "BaranzLauncher", + WeaponType::BranchOfPakupaku => "BranchOfPakupaku", + WeaponType::HeartOfPoumn => "HeartOfPoumn", + WeaponType::Yasminkov2000h => "Yasminkov2000h", + WeaponType::Yasminkov7000v => "Yasminkov7000v", + WeaponType::Yasminkov9000m => "Yasminkov9000m", + WeaponType::MaserBeam => "MaserBeam", + WeaponType::PowerMaser => "PowerMaser", + WeaponType::GameMagazne => "GameMagazne", + WeaponType::Login2 => "Login2", + WeaponType::FlowerBouquet => "FlowerBouquet", + WeaponType::Musashi => "Musashi", + WeaponType::Yamato => "Yamato", + WeaponType::Asuka => "Asuka", + WeaponType::SangeYasha => "SangeYasha", + WeaponType::Sange => "Sange", + WeaponType::Yasha => "Yasha", + WeaponType::Kamui => "Kamui", + WeaponType::PhotonLauncher => "PhotonLauncher", + WeaponType::GuiltyLight => "GuiltyLight", + WeaponType::RedScorpio => "RedScorpio", + WeaponType::PhononMaser => "PhononMaser", + WeaponType::Talis => "Talis", + WeaponType::Mahu => "Mahu", + WeaponType::Hitogata => "Hitogata", + WeaponType::DancingHitogata => "DancingHitogata", + WeaponType::Kunai => "Kunai", + WeaponType::Nug2000bazooka => "Nug2000bazooka", + WeaponType::SBerillsHands0 => "SBerillsHands0", + WeaponType::SBerillsHands1 => "SBerillsHands1", + WeaponType::FlowensSword3060 => "FlowensSword3060", + WeaponType::FlowensSword3064 => "FlowensSword3064", + WeaponType::FlowensSword3067 => "FlowensSword3067", + WeaponType::FlowensSword3073 => "FlowensSword3073", + WeaponType::FlowensSword3077 => "FlowensSword3077", + WeaponType::FlowensSword3082 => "FlowensSword3082", + WeaponType::FlowensSword3083 => "FlowensSword3083", + WeaponType::FlowensSword3084 => "FlowensSword3084", + WeaponType::FlowensSword3079 => "FlowensSword3079", + WeaponType::DbsSaber3062 => "DbsSaber3062", + WeaponType::DbsSaber3067 => "DbsSaber3067", + WeaponType::DbsSaber3069Chris => "DbsSaber3069Chris", + WeaponType::DbsSaber3064 => "DbsSaber3064", + WeaponType::DbsSaber3069Torato => "DbsSaber3069Torato", + WeaponType::DbsSaber3073 => "DbsSaber3073", + WeaponType::DbsSaber3070 => "DbsSaber3070", + WeaponType::DbsSaber3075 => "DbsSaber3075", + WeaponType::DbsSaber3077 => "DbsSaber3077", + WeaponType::GiGueBazooka => "GiGueBazooka", + WeaponType::Guardianna => "Guardianna", + WeaponType::ViridiaCard => "ViridiaCard", + WeaponType::GreenillCard => "GreenillCard", + WeaponType::SkylyCard => "SkylyCard", + WeaponType::BluefullCard => "BluefullCard", + WeaponType::PurplenumCard => "PurplenumCard", + WeaponType::PinkalCard => "PinkalCard", + WeaponType::RedriaCard => "RedriaCard", + WeaponType::OranCard => "OranCard", + WeaponType::YellowbozeCard => "YellowbozeCard", + WeaponType::WhitillCard => "WhitillCard", + WeaponType::MorningGlory => "MorningGlory", + WeaponType::PartisanofLightning => "PartisanofLightning", + WeaponType::GalWind => "GalWind", + WeaponType::Zanba => "Zanba", + WeaponType::RikasClaw => "RikasClaw", + WeaponType::AngelHarp => "AngelHarp", + WeaponType::DemolitionComet => "DemolitionComet", + WeaponType::NeisClaw2 => "NeisClaw2", + WeaponType::RainbowBaton => "RainbowBaton", + WeaponType::DarkFlow => "DarkFlow", + WeaponType::DarkMeteor => "DarkMeteor", + WeaponType::DarkBridge => "DarkBridge", + WeaponType::GAssassinsSabers => "GAssassinsSabers", + WeaponType::RappysFan => "RappysFan", + WeaponType::BoomasClaw => "BoomasClaw", + WeaponType::GoboomasClaw => "GoboomasClaw", + WeaponType::GigoboomasClaw => "GigoboomasClaw", + WeaponType::RubyBullet => "RubyBullet", + WeaponType::AmoreRose => "AmoreRose", + WeaponType::SlicerOfFanatic => "SlicerOfFanatic", + WeaponType::LameDArgent => "LameDArgent", + WeaponType::Excalibur => "Excalibur", + WeaponType::RageDeFeu => "RageDeFeu", + WeaponType::RageDeFeu2 => "RageDeFeu2", + WeaponType::RageDeFeu3 => "RageDeFeu3", + WeaponType::RageDeFeu4 => "RageDeFeu4", + WeaponType::DaisyChain => "DaisyChain", + WeaponType::OphelieSeize => "OphelieSeize", + WeaponType::MilleMarteaux => "MilleMarteaux", + WeaponType::LeCogneur => "LeCogneur", + WeaponType::CommanderBlade => "CommanderBlade", + WeaponType::Vivienne => "Vivienne", + WeaponType::Kusanagi => "Kusanagi", + WeaponType::SacredDuster => "SacredDuster", + WeaponType::Guren => "Guren", + WeaponType::Shouren => "Shouren", + WeaponType::Jizai => "Jizai", + WeaponType::Flamberge => "Flamberge", + WeaponType::Yunchang => "Yunchang", + WeaponType::SnakeSpire => "SnakeSpire", + WeaponType::FlapjackFlapper => "FlapjackFlapper", + WeaponType::Getsugasan => "Getsugasan", + WeaponType::Maguwa => "Maguwa", + WeaponType::HeavenStriker => "HeavenStriker", + WeaponType::CannonRouge => "CannonRouge", + WeaponType::MeteorRouge => "MeteorRouge", + WeaponType::Solferino => "Solferino", + WeaponType::Clio => "Clio", + WeaponType::SirenGlassHammer => "SirenGlassHammer", + WeaponType::GlideDivine => "GlideDivine", + WeaponType::Shichishito => "Shichishito", + WeaponType::Murasame => "Murasame", + WeaponType::DaylightScar => "DaylightScar", + WeaponType::Decalog => "Decalog", + WeaponType::FifthAnnivBlade => "FifthAnnivBlade", + WeaponType::TyrellsParasol => "TyrellsParasol", + WeaponType::AkikosCleaver => "AkikosCleaver", + WeaponType::Tanegashima => "Tanegashima", + WeaponType::TreeClippers => "TreeClippers", + WeaponType::NiceShot => "NiceShot", + WeaponType::Unknown3 => "Unknown3", + WeaponType::Unknown4 => "Unknown4", + WeaponType::AnoBazooka => "AnoBazooka", + WeaponType::Synthesizer => "Synthesizer", + WeaponType::BambooSpear => "BambooSpear", + WeaponType::KaneiTsuho => "KaneiTsuho", + WeaponType::Jitte => "Jitte", + WeaponType::ButterflyNet => "ButterflyNet", + WeaponType::Syringe => "Syringe", + WeaponType::Battledore => "Battledore", + WeaponType::Racket => "Racket", + WeaponType::Hammer => "Hammer", + WeaponType::GreatBouquet => "GreatBouquet", + WeaponType::TypesaSaber => "TypesaSaber", + WeaponType::TypeslSaber => "TypeslSaber", + WeaponType::TypeslSlicer => "TypeslSlicer", + WeaponType::TypeslClaw => "TypeslClaw", + WeaponType::TypeslKatana => "TypeslKatana", + WeaponType::TypejsSaber => "TypejsSaber", + WeaponType::TypejsSlicer => "TypejsSlicer", + WeaponType::TypejsJSword => "TypejsJSword", + WeaponType::TypeswSword => "TypeswSword", + WeaponType::TypeswSlicer => "TypeswSlicer", + WeaponType::TypeswJSword => "TypeswJSword", + WeaponType::TyperoSword => "TyperoSword", + WeaponType::TyperoHalbert => "TyperoHalbert", + WeaponType::TyperoRod => "TyperoRod", + WeaponType::TypeblBlade => "TypeblBlade", + WeaponType::TypeknBlade => "TypeknBlade", + WeaponType::TypeknClaw => "TypeknClaw", + WeaponType::TypehaHalbert => "TypehaHalbert", + WeaponType::TypehaRod => "TypehaRod", + WeaponType::TypedsDSaber => "TypedsDSaber", + WeaponType::TypedsRod => "TypedsRod", + WeaponType::Typeds => "Typeds", + WeaponType::TypeclClaw => "TypeclClaw", + WeaponType::TypessSw => "TypessSw", + WeaponType::TypeguHand => "TypeguHand", + WeaponType::TypeguMechgun => "TypeguMechgun", + WeaponType::TyperiRifle => "TyperiRifle", + WeaponType::TypemeMechgun => "TypemeMechgun", + WeaponType::TypeshShot => "TypeshShot", + WeaponType::TypewaWand => "TypewaWand", + }.to_string() + } +} + + +#[derive(Debug, Copy, Clone, PartialEq)] +pub struct Weapon { + pub weapon: WeaponType, + pub special: Option, + pub grind: u8, + pub attrs: [Option; 3], +} + + +impl Weapon { + pub fn new(wep: WeaponType) -> Weapon { + Weapon { + weapon: wep, + special: None, + grind: 0, + attrs: [None; 3] + } + } + + pub fn as_bytes(&self) -> [u8; 16] { + let mut result = [0u8; 16]; + result[0..3].copy_from_slice(&self.weapon.value()); + result[3] = self.grind; + // TODO: percents + result + } +} + + diff --git a/src/login/character.rs b/src/login/character.rs index 58b7e33..6c52bd1 100644 --- a/src/login/character.rs +++ b/src/login/character.rs @@ -7,7 +7,7 @@ use crc::{crc32, Hasher32}; use libpso::packet::login::*; use libpso::{PacketParseError, PSOPacket}; use libpso::crypto::bb::PSOBBCipher; -use libpso::item; +use crate::entity::item; use libpso::character::character; use crate::common::cipherkeys::{ELSEWHERE_PRIVATE_KEY, ELSEWHERE_PARRAY}; diff --git a/src/main.rs b/src/main.rs index 4c81c71..810463c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,8 +26,6 @@ use libpso::{utf8_to_array, utf8_to_utf16_array}; use crate::entity::item; -use libpso::item::*; - fn setup_logger() { let colors = fern::colors::ColoredLevelConfig::new() .error(fern::colors::Color::Red) @@ -88,8 +86,8 @@ fn main() { item::ItemDetail::Weapon( item::Weapon { equipped: true, - weapon: weapon::Weapon { - weapon: weapon::WeaponType::Handgun, + weapon: item::weapon::Weapon { + weapon: item::weapon::WeaponType::Handgun, grind: 5, special: None, attrs: [None; 3], diff --git a/src/ship/items.rs b/src/ship/items.rs index f592d06..5d77b97 100644 --- a/src/ship/items.rs +++ b/src/ship/items.rs @@ -2,10 +2,9 @@ use std::collections::HashMap; use std::hash::{Hash, Hasher}; use libpso::character::character::InventoryItem; -use libpso::item; use crate::entity::item::{Item, ItemDetail, ItemLocation, Weapon, Armor, Shield}; - +use crate::entity::item::tool::StackedTool; fn are_items_same_type(itema: &Item, itemb: &Item) -> bool { @@ -58,7 +57,7 @@ impl StackedItem { let count = items.len(); match &items[0].item { ItemDetail::Tool(tool) => { - item::tool::Tool { + StackedTool { tool: tool.tool, count: count }.as_bytes()