|
|
@ -186,36 +186,33 @@ pub enum ToolType { |
|
|
|
|
|
|
|
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::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::Addslot => true,
|
|
|
|
ToolType::PhotonDrop => true,
|
|
|
|
ToolType::PhotonSphere => true,
|
|
|
|
ToolType::PhotonCrystal => true,
|
|
|
|
_ => false,
|
|
|
|
}
|
|
|
|
matches!(self, ToolType::Monomate |
|
|
|
|
ToolType::Dimate |
|
|
|
|
ToolType::Trimate |
|
|
|
|
ToolType::Monofluid |
|
|
|
|
ToolType::Difluid |
|
|
|
|
ToolType::Trifluid |
|
|
|
|
ToolType::SolAtomizer |
|
|
|
|
ToolType::MoonAtomizer |
|
|
|
|
ToolType::StarAtomizer |
|
|
|
|
ToolType::Antidote |
|
|
|
|
ToolType::Antiparalysis |
|
|
|
|
ToolType::Telepipe |
|
|
|
|
ToolType::TrapVision |
|
|
|
|
ToolType::Monogrinder |
|
|
|
|
ToolType::Digrinder |
|
|
|
|
ToolType::Trigrinder |
|
|
|
|
ToolType::PowerMaterial |
|
|
|
|
ToolType::MindMaterial |
|
|
|
|
ToolType::EvadeMaterial |
|
|
|
|
ToolType::HpMaterial |
|
|
|
|
ToolType::TpMaterial |
|
|
|
|
ToolType::DefMaterial |
|
|
|
|
ToolType::LuckMaterial |
|
|
|
|
ToolType::Addslot |
|
|
|
|
ToolType::PhotonDrop |
|
|
|
|
ToolType::PhotonSphere |
|
|
|
|
ToolType::PhotonCrystal)
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn max_stack(&self) -> usize {
|
|
|
@ -252,39 +249,36 @@ impl ToolType { |
|
|
|
}
|
|
|
|
|
|
|
|
pub fn is_mag_cell(&self) -> bool {
|
|
|
|
match self {
|
|
|
|
ToolType::CellOfMag502 => true,
|
|
|
|
ToolType::CellOfMag213 => true,
|
|
|
|
ToolType::PartsOfRobochao => true,
|
|
|
|
ToolType::HeartOfOpaOpa => true,
|
|
|
|
ToolType::HeartOfPian => true,
|
|
|
|
ToolType::HeartOfChao => 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::Tablet => 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,
|
|
|
|
_ => false,
|
|
|
|
}
|
|
|
|
matches!(self, ToolType::CellOfMag502 |
|
|
|
|
ToolType::CellOfMag213 |
|
|
|
|
ToolType::PartsOfRobochao |
|
|
|
|
ToolType::HeartOfOpaOpa |
|
|
|
|
ToolType::HeartOfPian |
|
|
|
|
ToolType::HeartOfChao |
|
|
|
|
ToolType::HeartOfAngel |
|
|
|
|
ToolType::HeartOfDevil |
|
|
|
|
ToolType::KitOfHamburger |
|
|
|
|
ToolType::PanthersSpirit |
|
|
|
|
ToolType::KitOfMark3 |
|
|
|
|
ToolType::KitOfMasterSystem |
|
|
|
|
ToolType::KitOfGenesis |
|
|
|
|
ToolType::KitOfSegaSaturn |
|
|
|
|
ToolType::KitOfDreamcast |
|
|
|
|
ToolType::Tablet |
|
|
|
|
ToolType::DragonScale |
|
|
|
|
ToolType::HeavenStrikerCoat |
|
|
|
|
ToolType::PioneerParts |
|
|
|
|
ToolType::AmitiesMemo |
|
|
|
|
ToolType::HeartOfMorolian |
|
|
|
|
ToolType::RappysBeak |
|
|
|
|
ToolType::YahoosEngine |
|
|
|
|
ToolType::DPhotonCore |
|
|
|
|
ToolType::LibertaKit |
|
|
|
|
ToolType::CellOfMag0503 |
|
|
|
|
ToolType::CellOfMag0504 |
|
|
|
|
ToolType::CellOfMag0505 |
|
|
|
|
ToolType::CellOfMag0506 |
|
|
|
|
ToolType::CellOfMag0507)
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn value(&self) -> [u8; 3] {
|
|
|
@ -669,9 +663,9 @@ impl Tool { |
|
|
|
|
|
|
|
pub fn from_bytes(data: [u8; 16]) -> Result<Tool, ItemParseError> {
|
|
|
|
let t = ToolType::parse_type([data[0], data[1], data[2]]);
|
|
|
|
if t.is_ok() {
|
|
|
|
if let Ok(t) = t {
|
|
|
|
Ok(Tool {
|
|
|
|
tool: t.unwrap(),
|
|
|
|
tool: t,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
else {
|
|
|
|