|
|
@ -127,7 +127,7 @@ pub struct CharacterAppearance { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
|
|
|
|
pub enum Techniques {
|
|
|
|
pub enum Technique {
|
|
|
|
Foie,
|
|
|
|
Gifoie,
|
|
|
|
Rafoie,
|
|
|
@ -150,11 +150,11 @@ pub enum Techniques { |
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Clone, Debug)]
|
|
|
|
pub struct TechLevel(u8);
|
|
|
|
pub struct TechLevel(pub u8);
|
|
|
|
|
|
|
|
#[derive(Clone, Debug)]
|
|
|
|
pub struct CharacterTechniques {
|
|
|
|
techs: HashMap<Techniques, TechLevel>
|
|
|
|
techs: HashMap<Technique, TechLevel>
|
|
|
|
}
|
|
|
|
|
|
|
|
impl CharacterTechniques {
|
|
|
@ -164,38 +164,38 @@ impl CharacterTechniques { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn set_tech(&mut self, tech: Techniques, level: TechLevel) {
|
|
|
|
pub fn set_tech(&mut self, tech: Technique, level: TechLevel) {
|
|
|
|
self.techs.insert(tech, level);
|
|
|
|
}
|
|
|
|
|
|
|
|
// from_bytes
|
|
|
|
|
|
|
|
fn as_bytes(&self) -> [u8; 20] {
|
|
|
|
pub fn as_bytes(&self) -> [u8; 20] {
|
|
|
|
self.techs.iter()
|
|
|
|
.fold([0xFF; 20], |mut techlist, (tech, level)| {
|
|
|
|
let index = match tech {
|
|
|
|
Techniques::Foie => 0,
|
|
|
|
Techniques::Gifoie => 1,
|
|
|
|
Techniques::Rafoie => 2,
|
|
|
|
Techniques::Zonde => 3,
|
|
|
|
Techniques::Gizonde => 4,
|
|
|
|
Techniques::Razonde => 5,
|
|
|
|
Techniques::Barta => 6,
|
|
|
|
Techniques::Gibarta => 7,
|
|
|
|
Techniques::Rabarta => 8,
|
|
|
|
Techniques::Grants => 9,
|
|
|
|
Techniques::Megid => 10,
|
|
|
|
Techniques::Shifta => 11,
|
|
|
|
Techniques::Deband => 12,
|
|
|
|
Techniques::Jellen => 13,
|
|
|
|
Techniques::Zalure => 14,
|
|
|
|
Techniques::Resta => 15,
|
|
|
|
Techniques::Anti => 16,
|
|
|
|
Techniques::Reverser => 17,
|
|
|
|
Techniques::Ryuker => 18,
|
|
|
|
Technique::Foie => 0,
|
|
|
|
Technique::Gifoie => 1,
|
|
|
|
Technique::Rafoie => 2,
|
|
|
|
Technique::Barta => 3,
|
|
|
|
Technique::Gibarta => 4,
|
|
|
|
Technique::Rabarta => 5,
|
|
|
|
Technique::Zonde => 6,
|
|
|
|
Technique::Gizonde => 7,
|
|
|
|
Technique::Razonde => 8,
|
|
|
|
Technique::Grants => 9,
|
|
|
|
Technique::Deband => 10,
|
|
|
|
Technique::Jellen => 11,
|
|
|
|
Technique::Zalure => 12,
|
|
|
|
Technique::Shifta => 13,
|
|
|
|
Technique::Ryuker => 14,
|
|
|
|
Technique::Resta => 15,
|
|
|
|
Technique::Anti => 16,
|
|
|
|
Technique::Reverser => 17,
|
|
|
|
Technique::Megid => 18,
|
|
|
|
};
|
|
|
|
|
|
|
|
techlist[index] = level.0;
|
|
|
|
techlist[index] = level.0 - 1;
|
|
|
|
techlist
|
|
|
|
})
|
|
|
|
}
|
|
|
|