|
|
@ -1454,7 +1454,7 @@ pub enum WeaponModifier { |
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
|
|
|
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
|
|
|
|
pub enum WrappingPaper {
|
|
|
|
White_Pink, // 0
|
|
|
|
Yellow_Blue,
|
|
|
@ -1499,8 +1499,7 @@ pub struct Weapon { |
|
|
|
pub grind: u8,
|
|
|
|
pub attrs: [Option<WeaponAttribute>; 3],
|
|
|
|
pub tekked: bool,
|
|
|
|
pub modifiers: Vec<WeaponModifier>,
|
|
|
|
pub wrapped: Option<WrappingPaper>,
|
|
|
|
pub wrapping: Option<WrappingPaper>,
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1512,8 +1511,7 @@ impl Weapon { |
|
|
|
grind: 0,
|
|
|
|
attrs: [None; 3],
|
|
|
|
tekked: true,
|
|
|
|
modifiers: Vec::new(),
|
|
|
|
wrapped: None,
|
|
|
|
wrapping: None,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
@ -1568,9 +1566,9 @@ impl Weapon { |
|
|
|
result[3] = self.grind;
|
|
|
|
result[4] = self.special.map(|s| s.value()).unwrap_or(0);
|
|
|
|
|
|
|
|
if self.wrapped.is_some() {
|
|
|
|
if self.wrapping.is_some() {
|
|
|
|
result[4] += 0x40;
|
|
|
|
result[5] = self.wrapped.unwrap().value();
|
|
|
|
result[5] = self.wrapping.unwrap().value();
|
|
|
|
};
|
|
|
|
|
|
|
|
if self.tekked == false {
|
|
|
@ -1590,16 +1588,21 @@ impl Weapon { |
|
|
|
if w.is_ok() {
|
|
|
|
let mut s = None;
|
|
|
|
let mut t = true;
|
|
|
|
let mut p = None; // wrapping paper
|
|
|
|
let g = data[3];
|
|
|
|
|
|
|
|
if data[4] >= 0x81 && data[4] <= 0xA8 {
|
|
|
|
if data[4] & 0x80 == 0x80 {
|
|
|
|
s = WeaponSpecial::from(data[4] - 0x80);
|
|
|
|
t = false;
|
|
|
|
}
|
|
|
|
else if data[4] >= 0x01 && data[4] <= 0x28 {
|
|
|
|
s = WeaponSpecial::from(data[4]);
|
|
|
|
t = true;
|
|
|
|
|
|
|
|
if data[4] & 0x40 == 0x40 {
|
|
|
|
p = WrappingPaper::from(data[5]);
|
|
|
|
}
|
|
|
|
// else if data[4] >= 0x01 && data[4] <= 0x28 {
|
|
|
|
// s = WeaponSpecial::from(data[4]);
|
|
|
|
// t = true;
|
|
|
|
// }
|
|
|
|
// else {
|
|
|
|
// return Err(ItemParseError::InvalidSpecial)
|
|
|
|
// }
|
|
|
@ -1632,6 +1635,7 @@ impl Weapon { |
|
|
|
a[2],
|
|
|
|
],
|
|
|
|
tekked: t,
|
|
|
|
wrapping: p,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
else {
|
|
|
|