speeds based on colour and base item

This commit is contained in:
ntr 2019-03-24 17:37:49 +11:00
parent 34d9139140
commit 467db4838f
3 changed files with 34 additions and 52 deletions

View File

@ -19,6 +19,7 @@ cryp vbox
ensure all skills impl ensure all skills impl
ez ez
Skill::Slay -> red attack with bonus somethingorother for blue / maim no healing Skill::Slay -> red attack with bonus somethingorother for blue / maim no healing
Hatred -> damage received converted into bonus dmg
aoe aoe
Skill::Ruin -> aoe stun Skill::Ruin -> aoe stun
@ -45,7 +46,6 @@ change to ownership pattern
deal_damage(colour) deal_damage(colour)
resolutions.push(skill()).flatten() resolutions.push(skill()).flatten()
overkill in logs overkill in logs
immunity resolution type
* confirm cryp without skill ready * confirm cryp without skill ready
* iconography * iconography

View File

@ -2,6 +2,7 @@ use rand::{thread_rng, Rng};
use uuid::Uuid; use uuid::Uuid;
use cryp::{Cryp, CrypEffect, Stat}; use cryp::{Cryp, CrypEffect, Stat};
use vbox::{Var};
#[derive(Debug,Clone,PartialEq,Serialize,Deserialize)] #[derive(Debug,Clone,PartialEq,Serialize,Deserialize)]
pub struct Cast { pub struct Cast {
@ -550,57 +551,6 @@ impl Skill {
pub fn speed(&self) -> u8 { pub fn speed(&self) -> u8 {
match self { match self {
// defensive block
Skill::Block => 10, // reduce damage
Skill::Parry => 10, // avoid all damage
Skill::Snare => 10,
Skill::Shield => 10, // avoid magic damage,
// fast phys combat
Skill::Attack => 5,
Skill::Strike => 10,
Skill::Banish => 5,
Skill::Blast => 5,
Skill::Decay => 5, // dot
// magic combat trickery
Skill::Invert => 3, // hot
Skill::Triage => 3, // hot
Skill::Slow => 3,
Skill::Amplify => 3,
Skill::Curse => 3,
Skill::Empower => 3,
Skill::Haste => 3,
// general combat
Skill::DecayTick => 2, // hot
Skill::Siphon => 2,
Skill::SiphonTick => 2, // hot
Skill::Hex => 2,
Skill::Silence => 2,
Skill::Stun => 2,
Skill::Throw => 2, // no damage stun, adds vulnerable
Skill::TriageTick => 2, // hot
Skill::Heal => 1,
Skill::Purify => 1,
Skill::Purge => 1,
Skill::Recharge => 1,
Skill::Reflect => 5,
Skill::Ruin => 1,
Skill::Slay => 1,
Skill::Strangle => 5,
Skill::StrangleTick => 5,
Skill::Clutch => 1,
Skill::Taunt => 1,
Skill::Toxic => 1,
// unimplemented
// Skill::Lag => 2, //
// ----------------- // -----------------
// Test // Test
// ----------------- // -----------------
@ -609,6 +559,15 @@ impl Skill {
Skill::TestBlock => 10, Skill::TestBlock => 10,
Skill::TestParry => 10, Skill::TestParry => 10,
Skill::TestSiphon => 10, Skill::TestSiphon => 10,
Skill::Strike => u8::max_value(),
Skill::SiphonTick => Var::from(Skill::Siphon).speed(),
Skill::DecayTick => Var::from(Skill::Decay).speed(),
Skill::TriageTick => Var::from(Skill::Triage).speed(),
Skill::StrangleTick => Var::from(Skill::Strangle).speed(),
_ => Var::from(*self).speed(),
} }
} }

View File

@ -145,6 +145,27 @@ impl Var {
} }
} }
pub fn speed(&self) -> u8 {
match self {
Var::Red => 3,
Var::Green => 2,
Var::Blue => 1,
Var::Attack => 1,
Var::Stun => 2,
Var::Block => 3,
Var::Buff => 4,
Var::Debuff => 4,
_ => {
let combos = get_combos();
let combo = combos.iter().find(|c| c.var == *self)
.unwrap_or_else(|| panic!("unable to find components for {:?}", self));
return combo.units.iter().fold(0, |acc, c| acc + c.speed());
},
}
}
fn effect(&self) -> Option<VarEffect> { fn effect(&self) -> Option<VarEffect> {
if let Some(_skill) = self.into_skill() { if let Some(_skill) = self.into_skill() {
return Some(VarEffect::Skill); return Some(VarEffect::Skill);
@ -163,6 +184,7 @@ impl Var {
Var::Blast => Some(Skill::Blast), Var::Blast => Some(Skill::Blast),
Var::Block => Some(Skill::Block), Var::Block => Some(Skill::Block),
Var::Curse => Some(Skill::Curse), Var::Curse => Some(Skill::Curse),
Var::Decay => Some(Skill::Decay),
Var::Empower => Some(Skill::Empower), Var::Empower => Some(Skill::Empower),
Var::Haste => Some(Skill::Haste), Var::Haste => Some(Skill::Haste),
Var::Heal => Some(Skill::Heal), Var::Heal => Some(Skill::Heal),
@ -250,6 +272,7 @@ impl From<Skill> for Var {
Skill::Triage => Var::Triage, Skill::Triage => Var::Triage,
Skill::Decay => Var::Decay, Skill::Decay => Var::Decay,
Skill::Reflect => Var::Reflect, Skill::Reflect => Var::Reflect,
Skill::Recharge => Var::Recharge,
Skill::TestTouch => Var::TestTouch, Skill::TestTouch => Var::TestTouch,
Skill::TestStun => Var::TestStun, Skill::TestStun => Var::TestStun,