|
|
@ -390,6 +390,78 @@ impl MagType { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub enum MagCell {
|
|
|
|
CellOfMag502,
|
|
|
|
CellOfMag213,
|
|
|
|
PartsOfRobochao,
|
|
|
|
HeartOfOpaOpa,
|
|
|
|
HeartOfPian,
|
|
|
|
HeartOfChao,
|
|
|
|
HeartOfAngel,
|
|
|
|
HeartOfDevil,
|
|
|
|
KitOfHamburger,
|
|
|
|
PanthersSpirit,
|
|
|
|
KitOfMark3,
|
|
|
|
KitOfMasterSystem,
|
|
|
|
KitOfGenesis,
|
|
|
|
KitOfSegaSaturn,
|
|
|
|
KitOfDreamcast,
|
|
|
|
Tablet,
|
|
|
|
DragonScale,
|
|
|
|
HeavenStrikerCoat,
|
|
|
|
PioneerParts,
|
|
|
|
AmitiesMemo,
|
|
|
|
HeartOfMorolian,
|
|
|
|
RappysBeak,
|
|
|
|
YahoosEngine,
|
|
|
|
DPhotonCore,
|
|
|
|
LibertaKit,
|
|
|
|
CellOfMag0503,
|
|
|
|
CellOfMag0504,
|
|
|
|
CellOfMag0505,
|
|
|
|
CellOfMag0506,
|
|
|
|
CellOfMag0507,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl std::convert::TryFrom<ToolType> for MagCell {
|
|
|
|
type Error = ();
|
|
|
|
|
|
|
|
fn try_from(tool: ToolType) -> Result<MagCell, ()> {
|
|
|
|
match tool {
|
|
|
|
ToolType::CellOfMag502 => Ok(MagCell::CellOfMag502),
|
|
|
|
ToolType::CellOfMag213 => Ok(MagCell::CellOfMag213),
|
|
|
|
ToolType::PartsOfRobochao => Ok(MagCell::PartsOfRobochao),
|
|
|
|
ToolType::HeartOfOpaOpa => Ok(MagCell::HeartOfOpaOpa),
|
|
|
|
ToolType::HeartOfPian => Ok(MagCell::HeartOfPian),
|
|
|
|
ToolType::HeartOfChao => Ok(MagCell::HeartOfChao),
|
|
|
|
ToolType::HeartOfAngel => Ok(MagCell::HeartOfAngel),
|
|
|
|
ToolType::HeartOfDevil => Ok(MagCell::HeartOfDevil),
|
|
|
|
ToolType::KitOfHamburger => Ok(MagCell::KitOfHamburger),
|
|
|
|
ToolType::PanthersSpirit => Ok(MagCell::PanthersSpirit),
|
|
|
|
ToolType::KitOfMark3 => Ok(MagCell::KitOfMark3),
|
|
|
|
ToolType::KitOfMasterSystem => Ok(MagCell::KitOfMasterSystem),
|
|
|
|
ToolType::KitOfGenesis => Ok(MagCell::KitOfGenesis),
|
|
|
|
ToolType::KitOfSegaSaturn => Ok(MagCell::KitOfSegaSaturn),
|
|
|
|
ToolType::KitOfDreamcast => Ok(MagCell::KitOfDreamcast),
|
|
|
|
ToolType::Tablet => Ok(MagCell::Tablet),
|
|
|
|
ToolType::DragonScale => Ok(MagCell::DragonScale),
|
|
|
|
ToolType::HeavenStrikerCoat => Ok(MagCell::HeavenStrikerCoat),
|
|
|
|
ToolType::PioneerParts => Ok(MagCell::PioneerParts),
|
|
|
|
ToolType::AmitiesMemo => Ok(MagCell::AmitiesMemo),
|
|
|
|
ToolType::HeartOfMorolian => Ok(MagCell::HeartOfMorolian),
|
|
|
|
ToolType::RappysBeak => Ok(MagCell::RappysBeak),
|
|
|
|
ToolType::YahoosEngine => Ok(MagCell::YahoosEngine),
|
|
|
|
ToolType::DPhotonCore => Ok(MagCell::DPhotonCore),
|
|
|
|
ToolType::LibertaKit => Ok(MagCell::LibertaKit),
|
|
|
|
ToolType::CellOfMag0503 => Ok(MagCell::CellOfMag0503),
|
|
|
|
ToolType::CellOfMag0504 => Ok(MagCell::CellOfMag0504),
|
|
|
|
ToolType::CellOfMag0505 => Ok(MagCell::CellOfMag0505),
|
|
|
|
ToolType::CellOfMag0506 => Ok(MagCell::CellOfMag0506),
|
|
|
|
ToolType::CellOfMag0507 => Ok(MagCell::CellOfMag0507),
|
|
|
|
_ => Err(()),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
enum MagAttribute {
|
|
|
|
//Def,
|
|
|
@ -981,6 +1053,51 @@ impl Mag { |
|
|
|
pub fn bank(&mut self) {
|
|
|
|
// what is the truncation logic anyway
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn apply_mag_cell(&mut self, mag_cell: MagCell) {
|
|
|
|
self.mag = match mag_cell {
|
|
|
|
MagCell::CellOfMag502 => {
|
|
|
|
match self.id {
|
|
|
|
SectionID::Viridia | SectionID::Skyly | SectionID::Purplenum | SectionID::Redria | SectionID::Yellowboze => {
|
|
|
|
MagType::Soniti
|
|
|
|
},
|
|
|
|
SectionID::Greenill | SectionID::Bluefull | SectionID::Pinkal | SectionID::Oran | SectionID::Whitill => {
|
|
|
|
MagType::Pitri
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//MagCell::CellOfMag213 => ,
|
|
|
|
MagCell::PartsOfRobochao => MagType::Robochao,
|
|
|
|
//MagCell::HeartOfOpaOpa => ,
|
|
|
|
//MagCell::HeartOfPian => ,
|
|
|
|
//MagCell::HeartOfChao => ,
|
|
|
|
//MagCell::HeartOfAngel => ,
|
|
|
|
//MagCell::HeartOfDevil => ,
|
|
|
|
//MagCell::KitOfHamburger => ,
|
|
|
|
//MagCell::PanthersSpirit => ,
|
|
|
|
//MagCell::KitOfMark3 => ,
|
|
|
|
//MagCell::KitOfMasterSystem => ,
|
|
|
|
//MagCell::KitOfGenesis => ,
|
|
|
|
//MagCell::KitOfSegaSaturn => ,
|
|
|
|
//MagCell::KitOfDreamcast => ,
|
|
|
|
//MagCell::Tablet => ,
|
|
|
|
//MagCell::DragonScale => ,
|
|
|
|
//MagCell::HeavenStrikerCoat => ,
|
|
|
|
//MagCell::PioneerParts => ,
|
|
|
|
//MagCell::AmitiesMemo => ,
|
|
|
|
//MagCell::HeartOfMorolian => ,
|
|
|
|
//MagCell::RappysBeak => ,
|
|
|
|
//MagCell::YahoosEngine => ,
|
|
|
|
//MagCell::DPhotonCore => ,
|
|
|
|
//MagCell::LibertaKit => ,
|
|
|
|
//MagCell::CellOfMag0503 => ,
|
|
|
|
//MagCell::CellOfMag0504 => ,
|
|
|
|
//MagCell::CellOfMag0505 => ,
|
|
|
|
//MagCell::CellOfMag0506 => ,
|
|
|
|
//MagCell::CellOfMag0507 => ,
|
|
|
|
_ => panic!()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|