Merge branch 'remove-categories' of ssh://cryps.gg:40022/~/cryps into remove-categories
This commit is contained in:
commit
f5b9cd2662
@ -65,6 +65,7 @@ pub enum EffectMeta {
|
|||||||
TickAmount(u64),
|
TickAmount(u64),
|
||||||
AddedDamage(u64),
|
AddedDamage(u64),
|
||||||
ScatterTarget(Uuid),
|
ScatterTarget(Uuid),
|
||||||
|
Multiplier(u64),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug,Clone,PartialEq,Serialize,Deserialize)]
|
#[derive(Debug,Clone,PartialEq,Serialize,Deserialize)]
|
||||||
|
|||||||
@ -450,18 +450,18 @@ impl Effect {
|
|||||||
|
|
||||||
pub fn apply(&self, value: u64, meta: Option<EffectMeta>) -> u64 {
|
pub fn apply(&self, value: u64, meta: Option<EffectMeta>) -> u64 {
|
||||||
match self {
|
match self {
|
||||||
Effect::Vulnerable => value.pct(150),
|
Effect::Amplify |
|
||||||
Effect::Block => value.pct(50),
|
Effect::Vulnerable |
|
||||||
Effect::Buff => value.pct(125),
|
Effect::Block |
|
||||||
|
Effect::Buff |
|
||||||
Effect::Amplify => value.pct(150),
|
Effect::Curse |
|
||||||
Effect::Curse => value.pct(150),
|
Effect::Haste |
|
||||||
|
Effect::Slow |
|
||||||
Effect::Haste => value.pct(150),
|
Effect::Impurity |
|
||||||
Effect::Slow => value.pct(50),
|
Effect::Wither => value.pct(match meta {
|
||||||
|
Some(EffectMeta::Multiplier(d)) => d,
|
||||||
Effect::Impurity => value.pct(150),
|
_ => panic!("not multiplier"),
|
||||||
Effect::Wither => value.pct(50),
|
}),
|
||||||
|
|
||||||
Effect::Scatter => value >> 1,
|
Effect::Scatter => value >> 1,
|
||||||
|
|
||||||
@ -540,6 +540,11 @@ impl Effect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug,Clone,PartialEq,Serialize,Deserialize)]
|
||||||
|
pub enum SkillEffect {
|
||||||
|
Modifier {effect: Effect, multiplier: u64, duration: u8},
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug,Clone,Copy,PartialEq,Serialize,Deserialize)]
|
#[derive(Debug,Clone,Copy,PartialEq,Serialize,Deserialize)]
|
||||||
pub enum Category {
|
pub enum Category {
|
||||||
Red,
|
Red,
|
||||||
@ -668,14 +673,45 @@ impl Skill {
|
|||||||
_ => 100,
|
_ => 100,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
Effect::Amplify |
|
||||||
|
Effect::Vulnerable |
|
||||||
|
Effect::Block |
|
||||||
|
Effect::Buff |
|
||||||
|
Effect::Curse |
|
||||||
|
Effect::Haste |
|
||||||
|
Effect::Slow |
|
||||||
|
Effect::Impurity |
|
||||||
|
Effect::Wither => value.pct(match meta {
|
||||||
|
Some(EffectMeta::Multiplier(d)) => d,
|
||||||
|
_ => panic!("not multiplier"),
|
||||||
|
}),
|
||||||
|
*/
|
||||||
|
|
||||||
|
pub fn effect(&self) -> SkillEffect {
|
||||||
|
// Buff -> Effect, Multiplier, duration
|
||||||
|
match self {
|
||||||
|
Skill::Amplify => SkillEffect::Modifier {effect: Effect::Amplify, multiplier: 150, duration: 2},
|
||||||
|
Skill::Block => SkillEffect::Modifier {effect: Effect::Block, multiplier: 50, duration: 1},
|
||||||
|
Skill::Buff => SkillEffect::Modifier {effect: Effect::Buff, multiplier: 125, duration: 2},
|
||||||
|
Skill::Curse => SkillEffect::Modifier {effect: Effect::Curse, multiplier: 150, duration: 2},
|
||||||
|
Skill::Debuff => SkillEffect::Modifier {effect: Effect::Slow, multiplier: 50, duration: 3},
|
||||||
|
Skill::Decay => SkillEffect::Modifier {effect: Effect::Wither, multiplier: 50, duration: 3},
|
||||||
|
Skill::Impurity => SkillEffect::Modifier {effect: Effect::Impurity, multiplier: 150, duration: 3},
|
||||||
|
Skill::Haste => SkillEffect::Modifier {effect: Effect::Haste, multiplier: 150, duration: 2},
|
||||||
|
Skill::Throw => SkillEffect::Modifier {effect: Effect::Vulnerable, multiplier: 150, duration: 3},
|
||||||
|
|
||||||
|
_ => {
|
||||||
|
panic!("no skill effect");
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn duration(&self) -> u8 {
|
pub fn duration(&self) -> u8 {
|
||||||
match self {
|
match self {
|
||||||
Skill::Block => 1,
|
Skill::Block => 1,
|
||||||
Skill::Buff => 2,
|
|
||||||
Skill::Parry => 2,
|
Skill::Parry => 2,
|
||||||
Skill::Clutch => 1,
|
Skill::Clutch => 1,
|
||||||
Skill::Debuff => 3,
|
|
||||||
Skill::Reflect => 1,
|
Skill::Reflect => 1,
|
||||||
|
|
||||||
Skill::Injure => 2,
|
Skill::Injure => 2,
|
||||||
@ -689,17 +725,14 @@ impl Skill {
|
|||||||
Skill::Snare => 3,
|
Skill::Snare => 3,
|
||||||
|
|
||||||
Skill::Taunt => 2,
|
Skill::Taunt => 2,
|
||||||
Skill::Impurity => 3,
|
|
||||||
Skill::Invert => 1,
|
Skill::Invert => 1,
|
||||||
|
|
||||||
Skill::Hex => 2,
|
Skill::Hex => 2,
|
||||||
Skill::Ruin => 1,
|
Skill::Ruin => 1,
|
||||||
Skill::Curse => 2,
|
|
||||||
Skill::Banish => 1,
|
Skill::Banish => 1,
|
||||||
|
|
||||||
Skill::Haste => 2,
|
Skill::Haste => 2,
|
||||||
|
|
||||||
Skill::Amplify => 2,
|
|
||||||
Skill::Silence => 3,
|
Skill::Silence => 3,
|
||||||
|
|
||||||
Skill::Hostility => 2, // Primary Buff
|
Skill::Hostility => 2, // Primary Buff
|
||||||
@ -951,6 +984,17 @@ 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()
|
||||||
@ -1022,11 +1066,8 @@ 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());
|
||||||
let vulnerable = CrypEffect::new(Effect::Vulnerable, skill.secondary_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(Resolution::new(source, target).event(target.add_effect(skill, vulnerable)));
|
results.push(apply_modifier(skill, source, target));
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1061,14 +1102,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 {
|
||||||
let block = CrypEffect::new(Effect::Block, skill.duration());
|
results.push(apply_modifier(skill, source, target));
|
||||||
results.push(Resolution::new(source, target).event(target.add_effect(skill, block)));
|
|
||||||
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 {
|
||||||
let fx = CrypEffect::new(Effect::Buff, skill.duration());
|
results.push(apply_modifier(skill, source, target));
|
||||||
results.push(Resolution::new(source, target).event(target.add_effect(skill, fx)));
|
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1178,30 +1217,27 @@ 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 {
|
||||||
let amplify = CrypEffect::new(Effect::Amplify, skill.duration());
|
results.push(apply_modifier(skill, source, target));
|
||||||
results.push(Resolution::new(source, target).event(target.add_effect(skill, amplify)));
|
|
||||||
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 {
|
||||||
let effect = CrypEffect::new(Effect::Haste, skill.duration());
|
results.push(apply_modifier(skill, source, target));
|
||||||
results.push(Resolution::new(source, target).event(target.add_effect(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 {
|
||||||
let effect = CrypEffect::new(Effect::Slow, skill.duration());
|
results.push(apply_modifier(skill, source, target));
|
||||||
results.push(Resolution::new(source, target).event(target.add_effect(skill, effect)));
|
|
||||||
return results;;
|
return results;;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn decay(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill: Skill) -> Resolutions {
|
fn decay(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill: Skill) -> Resolutions {
|
||||||
let wither = CrypEffect::new(Effect::Wither, skill.duration());
|
|
||||||
let decay = CrypEffect::new(Effect::Decay, skill.duration())
|
let decay = CrypEffect::new(Effect::Decay, skill.duration())
|
||||||
.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(Resolution::new(source, target).event(target.add_effect(skill, wither)));
|
results.push(apply_modifier(skill, source, target));
|
||||||
|
|
||||||
return decay_tick(source, target, results, Skill::DecayTick);
|
return decay_tick(source, target, results, Skill::DecayTick);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1265,14 +1301,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 {
|
||||||
let curse = CrypEffect::new(Effect::Curse, skill.duration());
|
results.push(apply_modifier(skill, source, target));
|
||||||
results.push(Resolution::new(source, target).event(target.add_effect(Skill::Curse, curse)));
|
|
||||||
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 {
|
||||||
let effect = CrypEffect::new(Effect::Impurity, skill.duration());
|
results.push(apply_modifier(skill, source, target));
|
||||||
results.push(Resolution::new(source, target).event(target.add_effect(skill, effect)));
|
|
||||||
return results;;
|
return results;;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user