wip add hex

This commit is contained in:
Mashy 2019-05-24 16:49:34 +10:00
parent 4ac0146b39
commit 2da21ca5bc
2 changed files with 24 additions and 9 deletions

View File

@ -69,7 +69,9 @@ pub enum Item {
HealI, HealI,
HealII, HealII,
HealIII, HealIII,
Hex, HexI,
HexII,
HexIII,
Impurity, Impurity,
Invert, Invert,
Parry, Parry,
@ -216,7 +218,9 @@ impl Item {
Item::HealI => Some(Skill::HealI), Item::HealI => Some(Skill::HealI),
Item::HealII => Some(Skill::HealII), Item::HealII => Some(Skill::HealII),
Item::HealIII => Some(Skill::HealIII), Item::HealIII => Some(Skill::HealIII),
Item::Hex => Some(Skill::Hex), Item::HexI => Some(Skill::HexI),
Item::HexII => Some(Skill::HexII),
Item::HexIII => Some(Skill::HexIII),
Item::Hostility => Some(Skill::Hostility), Item::Hostility => Some(Skill::Hostility),
Item::Impurity => Some(Skill::Impurity), Item::Impurity => Some(Skill::Impurity),
Item::Invert => Some(Skill::Invert), Item::Invert => Some(Skill::Invert),
@ -405,7 +409,9 @@ impl Item {
Item::HealII | Item::HealII |
Item::HealIII => format!("Heals for {:?}% green power.", self.into_skill().unwrap().multiplier()), Item::HealIII => format!("Heals for {:?}% green power.", self.into_skill().unwrap().multiplier()),
Item::Hex => format!("Blue based skill that applies Hex for {:?}T. \ Item::HexI |
Item::HexII |
Item::HexIII => format!("Blue based skill that applies Hex for {:?}T. \
Hexed targets cannot cast any skills.", Hexed targets cannot cast any skills.",
self.into_skill().unwrap().effect().first().unwrap().get_duration()), self.into_skill().unwrap().effect().first().unwrap().get_duration()),
@ -542,7 +548,9 @@ impl Item {
Item::Sleep => vec![Item::Stun, Item::Green, Item::Green], Item::Sleep => vec![Item::Stun, Item::Green, Item::Green],
Item::Ruin => vec![Item::Stun, Item::Blue, Item::Blue], Item::Ruin => vec![Item::Stun, Item::Blue, Item::Blue],
Item::Throw => vec![Item::Stun, Item::Red, Item::Green], Item::Throw => vec![Item::Stun, Item::Red, Item::Green],
Item::Hex => vec![Item::Stun, Item::Green, Item::Blue], Item::HexI => vec![Item::Stun, Item::Green, Item::Blue],
Item::HexII => vec![Item::HexI, Item::HexI, Item::HexI],
Item::HexIII => vec![Item::HexII, Item::HexII, Item::HexII],
Item::Banish => vec![Item::Stun, Item::Red, Item::Blue], Item::Banish => vec![Item::Stun, Item::Red, Item::Blue],
Item::StrikeI => vec![Item::Attack, Item::Red, Item::Red], Item::StrikeI => vec![Item::Attack, Item::Red, Item::Red],
@ -615,7 +623,9 @@ impl From<Skill> for Item {
Skill::HealI => Item::HealI, Skill::HealI => Item::HealI,
Skill::HealII => Item::HealII, Skill::HealII => Item::HealII,
Skill::HealIII => Item::HealIII, Skill::HealIII => Item::HealIII,
Skill::Hex => Item::Hex, Skill::HexI => Item::HexI,
Skill::HexII => Item::HexII,
Skill::HexIII => Item::HexIII,
Skill::Impurity => Item::Impurity, Skill::Impurity => Item::Impurity,
Skill::Invert => Item::Invert, Skill::Invert => Item::Invert,
Skill::Parry => Item::Parry, Skill::Parry => Item::Parry,
@ -727,7 +737,9 @@ pub fn get_combos() -> Vec<Combo> {
Combo { components: Item::Sleep.combo(), item: Item::Sleep }, Combo { components: Item::Sleep.combo(), item: Item::Sleep },
Combo { components: Item::Ruin.combo(), item: Item::Ruin }, Combo { components: Item::Ruin.combo(), item: Item::Ruin },
Combo { components: Item::Throw.combo(), item: Item::Throw }, Combo { components: Item::Throw.combo(), item: Item::Throw },
Combo { components: Item::Hex.combo(), item: Item::Hex }, Combo { components: Item::HexI.combo(), item: Item::HexI },
Combo { components: Item::HexII.combo(), item: Item::HexII },
Combo { components: Item::HexIII.combo(), item: Item::HexIII },
Combo { components: Item::Banish.combo(), item: Item::Banish }, Combo { components: Item::Banish.combo(), item: Item::Banish },
Combo { components: Item::StrikeI.combo(), item: Item::StrikeI }, Combo { components: Item::StrikeI.combo(), item: Item::StrikeI },

View File

@ -583,7 +583,9 @@ pub enum Skill {
HealI, HealI,
HealII, HealII,
HealIII, HealIII,
Hex, HexI,
HexII,
HexIII,
Hostility, Hostility,
ImpureBlast, ImpureBlast,
Impurity, Impurity,
@ -774,7 +776,8 @@ impl Skill {
Skill::Purge => None, Skill::Purge => None,
Skill::Banish => Some(1), Skill::Banish => Some(1),
Skill::HexI => Some(1), Skill::HexI => Some(1),
Skill::HexII => Some(1), Skill::HexII => Some(2),
Skill::HexIII => Some(2),
Skill::Haste => Some(2), Skill::Haste => Some(2),
Skill::HasteStrike => None, // Used in haste Skill::HasteStrike => None, // Used in haste
@ -1485,7 +1488,7 @@ mod tests {
clutch(&mut y.clone(), &mut y, vec![], Skill::ClutchI); clutch(&mut y.clone(), &mut y, vec![], Skill::ClutchI);
assert!(y.affected(Effect::Clutch)); assert!(y.affected(Effect::Clutch));
let mut results = hex(&mut x, &mut y, vec![], Skill::Hex); let mut results = hex(&mut x, &mut y, vec![], Skill::HexI);
let Resolution { source: _, target: _, event } = results.remove(0); let Resolution { source: _, target: _, event } = results.remove(0);
match event { match event {
Event::Immunity { skill: _, immunity } => assert!(immunity.contains(&Effect::Clutch)), Event::Immunity { skill: _, immunity } => assert!(immunity.contains(&Effect::Clutch)),