initial wrapping stuff
This commit is contained in:
parent
03aa41ef6a
commit
fe0f7ba41e
@ -1454,6 +1454,44 @@ pub enum WeaponModifier {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||||
|
pub enum WrappingPaper {
|
||||||
|
White_Pink, // 0
|
||||||
|
Yellow_Blue,
|
||||||
|
Black_Yellow,
|
||||||
|
LightBlue_Orange,
|
||||||
|
Pink_YellowGreen,
|
||||||
|
Red_Green,
|
||||||
|
Magenta,
|
||||||
|
Blue,
|
||||||
|
Yellow,
|
||||||
|
Vermillion,
|
||||||
|
Green,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl WrappingPaper {
|
||||||
|
pub fn value(&self) -> u8 {
|
||||||
|
*self as u8
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn from(data: u8) -> Option<WrappingPaper> {
|
||||||
|
match data {
|
||||||
|
0 => Some(WrappingPaper::White_Pink),
|
||||||
|
1 => Some(WrappingPaper::Yellow_Blue),
|
||||||
|
2 => Some(WrappingPaper::Black_Yellow),
|
||||||
|
3 => Some(WrappingPaper::LightBlue_Orange),
|
||||||
|
4 => Some(WrappingPaper::Pink_YellowGreen),
|
||||||
|
5 => Some(WrappingPaper::Red_Green),
|
||||||
|
6 => Some(WrappingPaper::Magenta),
|
||||||
|
7 => Some(WrappingPaper::Blue),
|
||||||
|
8 => Some(WrappingPaper::Yellow),
|
||||||
|
9 => Some(WrappingPaper::Vermillion),
|
||||||
|
10 => Some(WrappingPaper::Green),
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct Weapon {
|
pub struct Weapon {
|
||||||
pub weapon: WeaponType,
|
pub weapon: WeaponType,
|
||||||
@ -1461,6 +1499,8 @@ pub struct Weapon {
|
|||||||
pub grind: u8,
|
pub grind: u8,
|
||||||
pub attrs: [Option<WeaponAttribute>; 3],
|
pub attrs: [Option<WeaponAttribute>; 3],
|
||||||
pub tekked: bool,
|
pub tekked: bool,
|
||||||
|
pub modifiers: Vec<WeaponModifier>,
|
||||||
|
pub wrapped: Option<WrappingPaper>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1472,6 +1512,8 @@ impl Weapon {
|
|||||||
grind: 0,
|
grind: 0,
|
||||||
attrs: [None; 3],
|
attrs: [None; 3],
|
||||||
tekked: true,
|
tekked: true,
|
||||||
|
modifiers: Vec::new(),
|
||||||
|
wrapped: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1526,6 +1568,11 @@ impl Weapon {
|
|||||||
result[3] = self.grind;
|
result[3] = self.grind;
|
||||||
result[4] = self.special.map(|s| s.value()).unwrap_or(0);
|
result[4] = self.special.map(|s| s.value()).unwrap_or(0);
|
||||||
|
|
||||||
|
if self.wrapped.is_some() {
|
||||||
|
result[4] += 0x40;
|
||||||
|
result[5] = self.wrapped.unwrap().value();
|
||||||
|
};
|
||||||
|
|
||||||
if self.tekked == false {
|
if self.tekked == false {
|
||||||
result[4] += 0x80
|
result[4] += 0x80
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user