|
|
@ -93,6 +93,95 @@ impl WeaponSpecial { |
|
|
|
pub fn value(&self) -> u8 {
|
|
|
|
*self as u8
|
|
|
|
}
|
|
|
|
pub fn rank_up(&self) -> WeaponSpecial {
|
|
|
|
match self {
|
|
|
|
WeaponSpecial::Draw => WeaponSpecial::Drain,
|
|
|
|
WeaponSpecial::Drain => WeaponSpecial::Fill,
|
|
|
|
WeaponSpecial::Fill => WeaponSpecial::Gush,
|
|
|
|
WeaponSpecial::Gush => WeaponSpecial::Gush,
|
|
|
|
WeaponSpecial::Heart => WeaponSpecial::Mind,
|
|
|
|
WeaponSpecial::Mind => WeaponSpecial::Soul,
|
|
|
|
WeaponSpecial::Soul => WeaponSpecial::Geist,
|
|
|
|
WeaponSpecial::Geist => WeaponSpecial::Geist,
|
|
|
|
WeaponSpecial::Masters => WeaponSpecial::Lords,
|
|
|
|
WeaponSpecial::Lords => WeaponSpecial::Kings,
|
|
|
|
WeaponSpecial::Kings => WeaponSpecial::Kings,
|
|
|
|
WeaponSpecial::Charge => WeaponSpecial::Charge,
|
|
|
|
WeaponSpecial::Spirit => WeaponSpecial::Spirit,
|
|
|
|
WeaponSpecial::Berserk => WeaponSpecial::Berserk,
|
|
|
|
WeaponSpecial::Ice => WeaponSpecial::Frost,
|
|
|
|
WeaponSpecial::Frost => WeaponSpecial::Freeze,
|
|
|
|
WeaponSpecial::Freeze => WeaponSpecial::Blizzard,
|
|
|
|
WeaponSpecial::Blizzard => WeaponSpecial::Blizzard,
|
|
|
|
WeaponSpecial::Bind => WeaponSpecial::Hold,
|
|
|
|
WeaponSpecial::Hold => WeaponSpecial::Seize,
|
|
|
|
WeaponSpecial::Seize => WeaponSpecial::Arrest,
|
|
|
|
WeaponSpecial::Arrest => WeaponSpecial::Arrest,
|
|
|
|
WeaponSpecial::Heat => WeaponSpecial::Fire,
|
|
|
|
WeaponSpecial::Fire => WeaponSpecial::Flame,
|
|
|
|
WeaponSpecial::Flame => WeaponSpecial::Burning,
|
|
|
|
WeaponSpecial::Burning => WeaponSpecial::Burning,
|
|
|
|
WeaponSpecial::Shock => WeaponSpecial::Thunder,
|
|
|
|
WeaponSpecial::Thunder => WeaponSpecial::Storm,
|
|
|
|
WeaponSpecial::Storm => WeaponSpecial::Tempest,
|
|
|
|
WeaponSpecial::Tempest => WeaponSpecial::Tempest,
|
|
|
|
WeaponSpecial::Dim => WeaponSpecial::Shadow,
|
|
|
|
WeaponSpecial::Shadow => WeaponSpecial::Dark,
|
|
|
|
WeaponSpecial::Dark => WeaponSpecial::Hell,
|
|
|
|
WeaponSpecial::Hell => WeaponSpecial::Hell,
|
|
|
|
WeaponSpecial::Panic => WeaponSpecial::Riot,
|
|
|
|
WeaponSpecial::Riot => WeaponSpecial::Havoc,
|
|
|
|
WeaponSpecial::Havoc => WeaponSpecial::Chaos,
|
|
|
|
WeaponSpecial::Chaos => WeaponSpecial::Chaos,
|
|
|
|
WeaponSpecial::Devils => WeaponSpecial::Demons,
|
|
|
|
WeaponSpecial::Demons => WeaponSpecial::Demons,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn rank_down(&self) -> WeaponSpecial {
|
|
|
|
match self {
|
|
|
|
WeaponSpecial::Draw => WeaponSpecial::Draw,
|
|
|
|
WeaponSpecial::Drain => WeaponSpecial::Draw,
|
|
|
|
WeaponSpecial::Fill => WeaponSpecial::Drain,
|
|
|
|
WeaponSpecial::Gush => WeaponSpecial::Fill,
|
|
|
|
WeaponSpecial::Heart => WeaponSpecial::Heart,
|
|
|
|
WeaponSpecial::Mind => WeaponSpecial::Heart,
|
|
|
|
WeaponSpecial::Soul => WeaponSpecial::Mind,
|
|
|
|
WeaponSpecial::Geist => WeaponSpecial::Soul,
|
|
|
|
WeaponSpecial::Masters => WeaponSpecial::Masters,
|
|
|
|
WeaponSpecial::Lords => WeaponSpecial::Masters,
|
|
|
|
WeaponSpecial::Kings => WeaponSpecial::Lords,
|
|
|
|
WeaponSpecial::Charge => WeaponSpecial::Charge,
|
|
|
|
WeaponSpecial::Spirit => WeaponSpecial::Spirit,
|
|
|
|
WeaponSpecial::Berserk => WeaponSpecial::Berserk,
|
|
|
|
WeaponSpecial::Ice => WeaponSpecial::Ice,
|
|
|
|
WeaponSpecial::Frost => WeaponSpecial::Ice,
|
|
|
|
WeaponSpecial::Freeze => WeaponSpecial::Frost,
|
|
|
|
WeaponSpecial::Blizzard => WeaponSpecial::Freeze,
|
|
|
|
WeaponSpecial::Bind => WeaponSpecial::Bind,
|
|
|
|
WeaponSpecial::Hold => WeaponSpecial::Bind,
|
|
|
|
WeaponSpecial::Seize => WeaponSpecial::Hold,
|
|
|
|
WeaponSpecial::Arrest => WeaponSpecial::Seize,
|
|
|
|
WeaponSpecial::Heat => WeaponSpecial::Heat,
|
|
|
|
WeaponSpecial::Fire => WeaponSpecial::Heat,
|
|
|
|
WeaponSpecial::Flame => WeaponSpecial::Fire,
|
|
|
|
WeaponSpecial::Burning => WeaponSpecial::Flame,
|
|
|
|
WeaponSpecial::Shock => WeaponSpecial::Shock,
|
|
|
|
WeaponSpecial::Thunder => WeaponSpecial::Shock,
|
|
|
|
WeaponSpecial::Storm => WeaponSpecial::Thunder,
|
|
|
|
WeaponSpecial::Tempest => WeaponSpecial::Storm,
|
|
|
|
WeaponSpecial::Dim => WeaponSpecial::Dim,
|
|
|
|
WeaponSpecial::Shadow => WeaponSpecial::Dim,
|
|
|
|
WeaponSpecial::Dark => WeaponSpecial::Shadow,
|
|
|
|
WeaponSpecial::Hell => WeaponSpecial::Dark,
|
|
|
|
WeaponSpecial::Panic => WeaponSpecial::Panic,
|
|
|
|
WeaponSpecial::Riot => WeaponSpecial::Panic,
|
|
|
|
WeaponSpecial::Havoc => WeaponSpecial::Riot,
|
|
|
|
WeaponSpecial::Chaos => WeaponSpecial::Havoc,
|
|
|
|
WeaponSpecial::Devils => WeaponSpecial::Devils,
|
|
|
|
WeaponSpecial::Demons => WeaponSpecial::Devils,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn from(data: u8) -> Option<WeaponSpecial> {
|
|
|
|
match data {
|
|
|
@ -1360,7 +1449,8 @@ pub enum WeaponModifier { |
|
|
|
},
|
|
|
|
Tekked {
|
|
|
|
special: TekSpecialModifier,
|
|
|
|
percents: TekPercentModifier,
|
|
|
|
percent: TekPercentModifier,
|
|
|
|
grind: i32,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
@ -1371,7 +1461,6 @@ pub struct Weapon { |
|
|
|
pub grind: u8,
|
|
|
|
pub attrs: [Option<WeaponAttribute>; 3],
|
|
|
|
pub tekked: bool,
|
|
|
|
pub modifiers: Vec<WeaponModifier>
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1383,7 +1472,51 @@ impl Weapon { |
|
|
|
grind: 0,
|
|
|
|
attrs: [None; 3],
|
|
|
|
tekked: true,
|
|
|
|
modifiers: Vec::new(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn apply_modifier(&mut self, modifier: &WeaponModifier) {
|
|
|
|
match modifier {
|
|
|
|
WeaponModifier::Tekked{special, percent, grind} => {
|
|
|
|
match special {
|
|
|
|
TekSpecialModifier::Plus => {
|
|
|
|
self.special = self.special.map(|special| {
|
|
|
|
special.rank_up()
|
|
|
|
});
|
|
|
|
},
|
|
|
|
TekSpecialModifier::Minus => {
|
|
|
|
self.special = self.special.map(|special| {
|
|
|
|
special.rank_down()
|
|
|
|
});
|
|
|
|
},
|
|
|
|
TekSpecialModifier::Neutral => {
|
|
|
|
},
|
|
|
|
}
|
|
|
|
for i in 0..3 {
|
|
|
|
self.attrs[i] = self.attrs[i].map(|mut attr| {
|
|
|
|
match percent {
|
|
|
|
TekPercentModifier::PlusPlus => {
|
|
|
|
attr.value += 10;
|
|
|
|
},
|
|
|
|
TekPercentModifier::Plus => {
|
|
|
|
attr.value += 5;
|
|
|
|
},
|
|
|
|
TekPercentModifier::MinusMinus => {
|
|
|
|
attr.value -= 10;
|
|
|
|
},
|
|
|
|
TekPercentModifier::Minus => {
|
|
|
|
attr.value -= 5;
|
|
|
|
},
|
|
|
|
TekPercentModifier::Neutral => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
attr
|
|
|
|
});
|
|
|
|
}
|
|
|
|
self.grind = std::cmp::max(self.grind as i32 + grind, 0) as u8;
|
|
|
|
self.tekked = true;
|
|
|
|
},
|
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
@ -1452,7 +1585,6 @@ impl Weapon { |
|
|
|
a[2],
|
|
|
|
],
|
|
|
|
tekked: t,
|
|
|
|
modifiers: Vec::new(),
|
|
|
|
})
|
|
|
|
}
|
|
|
|
else {
|
|
|
|