Browse Source

initial item enums, move logic from libpso to elseware

pbs
jake 5 years ago
parent
commit
f3e6b1e63e
  1. 410
      src/entity/item/armor.rs
  2. 23
      src/entity/item/mod.rs
  3. 717
      src/entity/item/shield.rs
  4. 566
      src/entity/item/tool.rs
  5. 1688
      src/entity/item/weapon.rs
  6. 2
      src/login/character.rs
  7. 6
      src/main.rs
  8. 5
      src/ship/items.rs

410
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<ArmorType, ArmorTypeError> {
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<String> 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<String> ^^
#[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
}
}

23
src/entity/item.rs → 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; use libpso::character::character;
@ -22,6 +27,14 @@ pub enum ItemLocation {
// floor: eventually // floor: eventually
// x y z: ????? // 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)] #[derive(Clone, Debug, PartialEq)]
pub struct Weapon { pub struct Weapon {
pub equipped: bool, pub equipped: bool,
pub weapon: item::weapon::Weapon,
pub weapon: weapon::Weapon,
} }
#[derive(Clone, Debug, PartialEq)] #[derive(Clone, Debug, PartialEq)]
pub struct Armor { pub struct Armor {
pub equipped: bool, pub equipped: bool,
pub armor: item::armor::Armor,
pub armor: armor::Armor,
} }
#[derive(Clone, Debug, PartialEq)] #[derive(Clone, Debug, PartialEq)]
pub struct Shield { pub struct Shield {
pub equipped: bool, pub equipped: bool,
pub shield: item::shield::Shield,
pub shield: shield::Shield,
} }
#[derive(Clone, Debug, PartialEq)] #[derive(Clone, Debug, PartialEq)]
pub struct Tool { pub struct Tool {
pub tool: item::tool::ToolType,
pub tool: tool::ToolType,
} }
impl Tool { impl Tool {

717
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<ShieldType, ShieldTypeError> {
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<String> 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<String> ^^
#[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
}
}

566
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
}
}

1688
src/entity/item/weapon.rs
File diff suppressed because it is too large
View File

2
src/login/character.rs

@ -7,7 +7,7 @@ use crc::{crc32, Hasher32};
use libpso::packet::login::*; use libpso::packet::login::*;
use libpso::{PacketParseError, PSOPacket}; use libpso::{PacketParseError, PSOPacket};
use libpso::crypto::bb::PSOBBCipher; use libpso::crypto::bb::PSOBBCipher;
use libpso::item;
use crate::entity::item;
use libpso::character::character; use libpso::character::character;
use crate::common::cipherkeys::{ELSEWHERE_PRIVATE_KEY, ELSEWHERE_PARRAY}; use crate::common::cipherkeys::{ELSEWHERE_PRIVATE_KEY, ELSEWHERE_PARRAY};

6
src/main.rs

@ -26,8 +26,6 @@ use libpso::{utf8_to_array, utf8_to_utf16_array};
use crate::entity::item; use crate::entity::item;
use libpso::item::*;
fn setup_logger() { fn setup_logger() {
let colors = fern::colors::ColoredLevelConfig::new() let colors = fern::colors::ColoredLevelConfig::new()
.error(fern::colors::Color::Red) .error(fern::colors::Color::Red)
@ -88,8 +86,8 @@ fn main() {
item::ItemDetail::Weapon( item::ItemDetail::Weapon(
item::Weapon { item::Weapon {
equipped: true, equipped: true,
weapon: weapon::Weapon {
weapon: weapon::WeaponType::Handgun,
weapon: item::weapon::Weapon {
weapon: item::weapon::WeaponType::Handgun,
grind: 5, grind: 5,
special: None, special: None,
attrs: [None; 3], attrs: [None; 3],

5
src/ship/items.rs

@ -2,10 +2,9 @@ use std::collections::HashMap;
use std::hash::{Hash, Hasher}; use std::hash::{Hash, Hasher};
use libpso::character::character::InventoryItem; use libpso::character::character::InventoryItem;
use libpso::item;
use crate::entity::item::{Item, ItemDetail, ItemLocation, Weapon, Armor, Shield}; 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 { fn are_items_same_type(itema: &Item, itemb: &Item) -> bool {
@ -58,7 +57,7 @@ impl StackedItem {
let count = items.len(); let count = items.len();
match &items[0].item { match &items[0].item {
ItemDetail::Tool(tool) => { ItemDetail::Tool(tool) => {
item::tool::Tool {
StackedTool {
tool: tool.tool, tool: tool.tool,
count: count count: count
}.as_bytes() }.as_bytes()

Loading…
Cancel
Save