Merge branch 'remove-categories' of ssh://cryps.gg:40022/~/cryps into remove-categories
This commit is contained in:
commit
585bafe45e
@ -543,6 +543,7 @@ impl Effect {
|
|||||||
#[derive(Debug,Clone,PartialEq,Serialize,Deserialize)]
|
#[derive(Debug,Clone,PartialEq,Serialize,Deserialize)]
|
||||||
pub enum SkillEffect {
|
pub enum SkillEffect {
|
||||||
Modifier {effect: Effect, multiplier: u64, duration: u8},
|
Modifier {effect: Effect, multiplier: u64, duration: u8},
|
||||||
|
Disable {effect: Effect, duration: u8},
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug,Clone,Copy,PartialEq,Serialize,Deserialize)]
|
#[derive(Debug,Clone,Copy,PartialEq,Serialize,Deserialize)]
|
||||||
@ -688,18 +689,22 @@ impl Skill {
|
|||||||
}),
|
}),
|
||||||
*/
|
*/
|
||||||
|
|
||||||
pub fn effect(&self) -> SkillEffect {
|
pub fn effect(&self) -> CrypEffect {
|
||||||
// Buff -> Effect, Multiplier, duration
|
// Buff -> Effect, Multiplier, duration
|
||||||
match self {
|
match self {
|
||||||
Skill::Amplify => SkillEffect::Modifier {effect: Effect::Amplify, multiplier: 150, duration: 2},
|
// Modifiers
|
||||||
Skill::Block => SkillEffect::Modifier {effect: Effect::Block, multiplier: 50, duration: 1},
|
Skill::Amplify => CrypEffect {effect: Effect::Amplify, duration: 2, meta: Some(EffectMeta::Multiplier(150)), tick: None},
|
||||||
Skill::Buff => SkillEffect::Modifier {effect: Effect::Buff, multiplier: 125, duration: 2},
|
Skill::Block => CrypEffect {effect: Effect::Block, duration: 1, meta: Some(EffectMeta::Multiplier(50)), tick: None},
|
||||||
Skill::Curse => SkillEffect::Modifier {effect: Effect::Curse, multiplier: 150, duration: 2},
|
Skill::Buff => CrypEffect {effect: Effect::Buff, duration: 2, meta: Some(EffectMeta::Multiplier(125)), tick: None },
|
||||||
Skill::Debuff => SkillEffect::Modifier {effect: Effect::Slow, multiplier: 50, duration: 3},
|
Skill::Curse => CrypEffect {effect: Effect::Curse, duration: 2, meta: Some(EffectMeta::Multiplier(150)), tick: None},
|
||||||
Skill::Decay => SkillEffect::Modifier {effect: Effect::Wither, multiplier: 50, duration: 3},
|
Skill::Debuff => CrypEffect {effect: Effect::Slow, duration: 3, meta: Some(EffectMeta::Multiplier(50)), tick: None },
|
||||||
Skill::Impurity => SkillEffect::Modifier {effect: Effect::Impurity, multiplier: 150, duration: 3},
|
Skill::Decay => CrypEffect {effect: Effect::Wither, duration: 3, meta: Some(EffectMeta::Multiplier(50)), tick: None },
|
||||||
Skill::Haste => SkillEffect::Modifier {effect: Effect::Haste, multiplier: 150, duration: 2},
|
Skill::Impurity => CrypEffect {effect: Effect::Impurity, duration: 3, meta: Some(EffectMeta::Multiplier(150)), tick: None },
|
||||||
Skill::Throw => SkillEffect::Modifier {effect: Effect::Vulnerable, multiplier: 150, duration: 3},
|
Skill::Haste => CrypEffect {effect: Effect::Haste, duration: 2, meta: Some(EffectMeta::Multiplier(150)), tick: None },
|
||||||
|
Skill::Throw => CrypEffect {effect: Effect::Vulnerable, duration: 3, meta: Some(EffectMeta::Multiplier(150)), tick: None},
|
||||||
|
|
||||||
|
// Disables
|
||||||
|
Skill::Stun => CrypEffect {effect: Effect::Stun, duration: 2, meta: None, tick: None},
|
||||||
|
|
||||||
_ => {
|
_ => {
|
||||||
panic!("no skill effect");
|
panic!("no skill effect");
|
||||||
@ -709,7 +714,6 @@ impl Skill {
|
|||||||
|
|
||||||
pub fn duration(&self) -> u8 {
|
pub fn duration(&self) -> u8 {
|
||||||
match self {
|
match self {
|
||||||
Skill::Block => 1,
|
|
||||||
Skill::Parry => 2,
|
Skill::Parry => 2,
|
||||||
Skill::Clutch => 1,
|
Skill::Clutch => 1,
|
||||||
Skill::Reflect => 1,
|
Skill::Reflect => 1,
|
||||||
@ -984,17 +988,6 @@ impl Skill {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn apply_modifier(skill: Skill, source: &mut Cryp, target: &mut Cryp) -> Resolution {
|
|
||||||
let skillEffect = skill.effect();
|
|
||||||
match skillEffect {
|
|
||||||
SkillEffect::Modifier { effect, multiplier, duration } => {
|
|
||||||
let crypEffect = CrypEffect::new(effect, duration)
|
|
||||||
.set_meta(EffectMeta::Multiplier(multiplier));
|
|
||||||
return Resolution::new(source, target).event(target.add_effect(skill, crypEffect));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn touch(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill: Skill) -> Resolutions {
|
fn touch(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill: Skill) -> Resolutions {
|
||||||
target.deal_red_damage(skill, 0)
|
target.deal_red_damage(skill, 0)
|
||||||
.into_iter()
|
.into_iter()
|
||||||
@ -1067,7 +1060,7 @@ fn taunt(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill:
|
|||||||
fn throw(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill: Skill) -> Resolutions {
|
fn throw(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill: Skill) -> Resolutions {
|
||||||
let stun = CrypEffect::new(Effect::Stun, skill.duration());
|
let stun = CrypEffect::new(Effect::Stun, skill.duration());
|
||||||
results.push(Resolution::new(source, target).event(target.add_effect(skill, stun)));
|
results.push(Resolution::new(source, target).event(target.add_effect(skill, stun)));
|
||||||
results.push(apply_modifier(skill, source, target));
|
results.push(Resolution::new(source, target).event(target.add_effect(skill, skill.effect())));
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1102,12 +1095,12 @@ fn strangle_tick(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions,
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn block(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill: Skill) -> Resolutions {
|
fn block(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill: Skill) -> Resolutions {
|
||||||
results.push(apply_modifier(skill, source, target));
|
results.push(Resolution::new(source, target).event(target.add_effect(skill, skill.effect())));
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn buff(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill: Skill) -> Resolutions {
|
fn buff(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill: Skill) -> Resolutions {
|
||||||
results.push(apply_modifier(skill, source, target));
|
results.push(Resolution::new(source, target).event(target.add_effect(skill, skill.effect())));
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1217,17 +1210,17 @@ fn blast(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill:
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn amplify(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill: Skill) -> Resolutions {
|
fn amplify(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill: Skill) -> Resolutions {
|
||||||
results.push(apply_modifier(skill, source, target));
|
results.push(Resolution::new(source, target).event(target.add_effect(skill, skill.effect())));
|
||||||
return results;;
|
return results;;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn haste(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill: Skill) -> Resolutions {
|
fn haste(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill: Skill) -> Resolutions {
|
||||||
results.push(apply_modifier(skill, source, target));
|
results.push(Resolution::new(source, target).event(target.add_effect(skill, skill.effect())));
|
||||||
return results;;
|
return results;;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn debuff(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill: Skill) -> Resolutions {
|
fn debuff(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill: Skill) -> Resolutions {
|
||||||
results.push(apply_modifier(skill, source, target));
|
results.push(Resolution::new(source, target).event(target.add_effect(skill, skill.effect())));
|
||||||
return results;;
|
return results;;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1236,8 +1229,7 @@ fn decay(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill:
|
|||||||
.set_tick(Cast::new_tick(source, target, Skill::DecayTick));
|
.set_tick(Cast::new_tick(source, target, Skill::DecayTick));
|
||||||
|
|
||||||
results.push(Resolution::new(source, target).event(target.add_effect(skill, decay)));
|
results.push(Resolution::new(source, target).event(target.add_effect(skill, decay)));
|
||||||
results.push(apply_modifier(skill, source, target));
|
results.push(Resolution::new(source, target).event(target.add_effect(skill, skill.effect())));
|
||||||
|
|
||||||
return decay_tick(source, target, results, Skill::DecayTick);
|
return decay_tick(source, target, results, Skill::DecayTick);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1301,12 +1293,12 @@ fn hatred(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, reflec
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn curse(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill: Skill) -> Resolutions {
|
fn curse(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill: Skill) -> Resolutions {
|
||||||
results.push(apply_modifier(skill, source, target));
|
results.push(Resolution::new(source, target).event(target.add_effect(skill, skill.effect())));
|
||||||
return results;;
|
return results;;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn impurity(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill: Skill) -> Resolutions {
|
fn impurity(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill: Skill) -> Resolutions {
|
||||||
results.push(apply_modifier(skill, source, target));
|
results.push(Resolution::new(source, target).event(target.add_effect(skill, skill.effect())));
|
||||||
return results;;
|
return results;;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user