This commit is contained in:
ntr 2019-12-09 16:41:20 +10:00
parent f6465acea0
commit a80c398c85
4 changed files with 74 additions and 26 deletions

View File

@ -14,6 +14,8 @@ cooldown events leak skills
hit event
reqs moving eventconstruct into specific events
purify conditional healing
counter / absorb post resolve etc
cooldown checking -> go through round and find all casters

View File

@ -703,6 +703,10 @@ impl Construct {
colour: Colour::Green,
display: EventConstruct::new(self),
});
if self.is_ko() {
events.push(Event::Ko { construct });
}
}
}
@ -749,6 +753,7 @@ impl Construct {
display: EventConstruct::new(self),
}
);
if self.is_ko() {
events.push(Event::Ko { construct });
}
@ -819,6 +824,10 @@ impl Construct {
colour: Colour::Blue,
display: EventConstruct::new(self),
});
if self.is_ko() {
events.push(Event::Ko { construct });
}
},
true => {
// events.push(Event::new(Event::Inversion { skill }));

View File

@ -523,6 +523,15 @@ impl Game {
_ => dmg,
}),
Value::Removals { construct, mult } =>
events.iter().fold(0, |dmg, e| match e {
Event::Damage { construct: event_construct, amount, mitigation:_, colour: event_colour, display: _ } =>
match *construct == *event_construct {
true => dmg + amount.pct(*mult),
false => dmg,
}
_ => dmg,
}),
// Skills { construct: Uuid, colour: Colour },
}
})
@ -617,13 +626,6 @@ impl Game {
// };
// }
// }
// if target.is_ko() && event_target.green == 0 {
// // Make sure target ko is from this event
// target.effects.clear();
// game.event(Event::new(&source, &target).event(Event::Ko()).stages(EventStages::PostOnly));
// }
// },
// _ => (),
// };
// }
@ -859,11 +861,11 @@ pub enum Value {
Cooldowns { construct: Uuid, mult: usize },
ColourSkills { construct: Uuid, colour: Colour, mult: usize },
Effects { construct: Uuid, mult: usize },
Removals { construct: Uuid, mult: usize },
DamageTaken { construct: Uuid, colour: Colour, mult: usize },
// Skills { construct: Uuid, colour: Colour },
}
#[derive(Debug,PartialEq)]
#[derive(Debug,Clone,PartialEq)]
pub enum Action {
Hit,
Cast,

View File

@ -579,6 +579,58 @@ impl Cast {
},
],
Skill::Purify => vec![
Action::RemoveAll {
construct: self.target,
},
Action::Heal {
construct: self.target,
colour: Colour::Green,
values: vec![
Value::Stat { construct: self.source, stat: Stat::GreenPower, mult: self.skill.multiplier() },
Value::Removals { construct: self.target, mult: self.skill.multiplier() },
],
},
Action::Effect {
construct: self.target,
effect: ConstructEffect { effect: Effect::Pure, duration: 2, meta: Some(EffectMeta::Multiplier(150)), tick: None }
},
],
Skill::PurifyPlus => vec![
Action::RemoveAll {
construct: self.target,
},
Action::Heal {
construct: self.target,
colour: Colour::Green,
values: vec![
Value::Stat { construct: self.source, stat: Stat::GreenPower, mult: self.skill.multiplier() },
Value::Removals { construct: self.target, mult: self.skill.multiplier() },
],
},
Action::Effect {
construct: self.target,
effect: ConstructEffect { effect: Effect::Pure, duration: 2, meta: Some(EffectMeta::Multiplier(175)), tick: None }
},
],
Skill::PurifyPlusPlus => vec![
Action::RemoveAll {
construct: self.target,
},
Action::Heal {
construct: self.target,
colour: Colour::Green,
values: vec![
Value::Stat { construct: self.source, stat: Stat::GreenPower, mult: self.skill.multiplier() },
Value::Removals { construct: self.target, mult: self.skill.multiplier() },
],
},
Action::Effect {
construct: self.target,
effect: ConstructEffect { effect: Effect::Pure, duration: 2, meta: Some(EffectMeta::Multiplier(200)), tick: None }
},
],
Skill::Recharge |
Skill::RechargePlus |
Skill::RechargePlusPlus => vec![
@ -800,23 +852,6 @@ impl Cast {
fn end() {}
// fn purify(source: &mut Construct, target: &mut Construct, skill: Skill) {
// game.event(Event::new(source, target).event(Event::Skill { skill }).stages(EventStages::StartEnd));
// if target.effects.len() > 0 {
// let amount = source.green_power().pct(skill.multiplier().saturating_mul(target.effects.len() as usize));
// target.effects.clear();
// game.event(Event::new(source, target)
// .event(Event::Remove { skill, effect: None, construct_effects: target.effects.clone() })
// .stages(EventStages::PostOnly));
// target.deal_green_damage(skill, amount)
// .into_iter()
// .for_each(|e| game.event(Event::new(source, target).event(e).stages(EventStages::PostOnly)));
// }
// let effect = skill.effect()[0];
// game.event(Event::new(source, target).event(target.effect_remove(skill, effect)).stages(EventStages::PostOnly));
// }
// pub fn dev_resolve(a_id: Uuid, b_id: Uuid, skill: Skill) {
// let mut resolutions =vec![];