Browse Source

shield and unit item stats

pbs
jake 5 years ago
parent
commit
b0c6d10590
  1. 338
      src/entity/item/shield.rs
  2. 58
      src/entity/item/unit.rs
  3. 62
      src/ship/item_stats.rs

338
src/entity/item/shield.rs

@ -1,6 +1,6 @@
use serde::{Serialize, Deserialize};
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize, enum_utils::FromStr, derive_more::Display)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Serialize, Deserialize, enum_utils::FromStr, derive_more::Display)]
pub enum ShieldType {
Barrier,
Shield,
@ -25,8 +25,8 @@ pub enum ShieldType {
CelestialShield,
InvisibleGuard,
SacredGuard,
SPartsver116,
SPartsver201,
SPartsVer116,
SPartsVer201,
LightRelief,
ShieldOfDelsaber,
ForceWall,
@ -39,7 +39,7 @@ pub enum ShieldType {
RegenerateGear,
RegeneGearAdv,
FlowensShield,
CustomBarrierveroo,
CustomBarrierVerOo,
DbsShield,
RedRing,
TripolicShield,
@ -144,7 +144,7 @@ pub enum ShieldType {
BunnyEars,
CatEars,
ThreeSeals,
GodsShieldkouryu,
GodsShieldKouryu,
DfShield,
FromTheDepths,
DeRolLeShield,
@ -172,170 +172,170 @@ pub enum ShieldType {
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::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],
}
}

58
src/entity/item/unit.rs

@ -1,7 +1,7 @@
use serde::{Serialize, Deserialize};
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize, enum_utils::FromStr, derive_more::Display)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Serialize, Deserialize, enum_utils::FromStr, derive_more::Display)]
pub enum UnitType {
KnightPower,
GeneralPower,
@ -75,6 +75,34 @@ pub enum UnitType {
CureConfuse,
CureFreeze,
CureShock,
YasakaniMagatama,
V101,
V501,
V502,
V801,
Limiter,
Adept,
SwordsmanLore,
ProofOfSwordSaint,
Smartlink,
DivineProtection,
HeavenlyBattle,
HeavenlyPower,
HeavenlyMind,
HeavenlyArms,
HeavenlyLegs,
HeavenlyBody,
HeavenlyLuck,
HeavenlyAbility,
CenturionAbility,
FriendRing,
HeavenlyHP,
HeavenlyTP,
HeavenlyResist,
HeavenlyTechnique,
HPRessurection,
TPRessurection,
PBIncrease,
}
impl UnitType {
@ -152,6 +180,34 @@ impl UnitType {
UnitType::CureConfuse => [0x01, 0x03, 0x45],
UnitType::CureFreeze => [0x01, 0x03, 0x46],
UnitType::CureShock => [0x01, 0x03, 0x47],
UnitType::YasakaniMagatama => [0x01, 0x03, 0x48],
UnitType::V101 => [0x01, 0x03, 0x49],
UnitType::V501 => [0x01, 0x03, 0x4A],
UnitType::V502 => [0x01, 0x03, 0x4B],
UnitType::V801 => [0x01, 0x03, 0x4C],
UnitType::Limiter => [0x01, 0x03, 0x4D],
UnitType::Adept => [0x01, 0x03, 0x4E],
UnitType::SwordsmanLore => [0x01, 0x03, 0x4F],
UnitType::ProofOfSwordSaint => [0x01, 0x03, 0x50],
UnitType::Smartlink => [0x01, 0x03, 0x51],
UnitType::DivineProtection => [0x01, 0x03, 0x52],
UnitType::HeavenlyBattle => [0x01, 0x03, 0x53],
UnitType::HeavenlyPower => [0x01, 0x03, 0x54],
UnitType::HeavenlyMind => [0x01, 0x03, 0x55],
UnitType::HeavenlyArms => [0x01, 0x03, 0x56],
UnitType::HeavenlyLegs => [0x01, 0x03, 0x57],
UnitType::HeavenlyBody => [0x01, 0x03, 0x58],
UnitType::HeavenlyLuck => [0x01, 0x03, 0x59],
UnitType::HeavenlyAbility => [0x01, 0x03, 0x5A],
UnitType::CenturionAbility => [0x01, 0x03, 0x5B],
UnitType::FriendRing => [0x01, 0x03, 0x5C],
UnitType::HeavenlyHP => [0x01, 0x03, 0x5D],
UnitType::HeavenlyTP => [0x01, 0x03, 0x5E],
UnitType::HeavenlyResist => [0x01, 0x03, 0x5F],
UnitType::HeavenlyTechnique => [0x01, 0x03, 0x60],
UnitType::HPRessurection => [0x01, 0x03, 0x61],
UnitType::TPRessurection => [0x01, 0x03, 0x62],
UnitType::PBIncrease => [0x01, 0x03, 0x63],
}
}
}

62
src/ship/item_stats.rs

@ -4,12 +4,8 @@ use std::fs::File;
use std::io::Read;
use crate::entity::item::armor::ArmorType;
use crate::entity::item::shield::ShieldType;
use crate::entity::item::unit::UnitType;
fn load_data_file<T: serde::de::DeserializeOwned>(path: &str) -> T {
@ -21,11 +17,6 @@ fn load_data_file<T: serde::de::DeserializeOwned>(path: &str) -> T {
}
struct WeaponStats {
}
@ -46,16 +37,32 @@ struct ArmorStats {
edk: i32,
}
#[derive(Debug, Copy, Clone, Serialize, Deserialize)]
struct ShieldStats {
stars: u32,
dfp: i32,
evp: i32,
dfp_modifier: u32,
evp_modifier: u32,
team_points: u32,
level_req: u32,
efr: i32,
eic: i32,
eth: i32,
elt: i32,
edk: i32,
}
#[derive(Debug, Copy, Clone, Serialize, Deserialize)]
struct UnitStats {
stars: u32,
stat: u32,
amount: u32,
team_points: u32,
modifier: u32,
}
fn armor_stats() -> HashMap<ArmorType, ArmorStats> {
let armor_stats: HashMap<String, ArmorStats> = load_data_file("data/item_stats/armor_stats.toml");
armor_stats.iter()
@ -64,6 +71,21 @@ fn armor_stats() -> HashMap<ArmorType, ArmorStats> {
}).collect()
}
fn shield_stats() -> HashMap<ShieldType, ShieldStats> {
let shield_stats: HashMap<String, ShieldStats> = load_data_file("data/item_stats/shield_stats.toml");
shield_stats.iter()
.map(|(name, stats)| {
(name.parse().unwrap(), *stats)
}).collect()
}
fn unit_stats() -> HashMap<UnitType, UnitStats> {
let unit_stats: HashMap<String, UnitStats> = load_data_file("data/item_stats/unit_stats.toml");
unit_stats.iter()
.map(|(name, stats)| {
(name.parse().unwrap(), *stats)
}).collect()
}
#[cfg(test)]
mod test {
@ -75,5 +97,15 @@ mod test {
assert!(astat.get(&ArmorType::CrimsonCoat).unwrap().stars == 11);
}
#[test]
fn test_shield_stats() {
let sstat = shield_stats();
assert!(sstat.get(&ShieldType::RedRing).unwrap().stars == 11);
}
#[test]
fn test_unit_stats() {
let ustat = unit_stats();
assert!(ustat.get(&UnitType::ElfArm).unwrap().stars == 5);
}
}
Loading…
Cancel
Save