absorb changes

This commit is contained in:
Mashy 2019-11-06 13:10:00 +10:00
parent 59e1c9673b
commit b3ba8825e4
4 changed files with 33 additions and 11 deletions

View File

@ -27,6 +27,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Vbox phase everything is now in one view - Vbox phase everything is now in one view
- Game constructs and animations are much larger in mobile view - Game constructs and animations are much larger in mobile view
- Absorb
- Reduced duration and cooldown from 2T -> 1T (Absorption duration unchanged)
- Absorption damage is now based on all damage taken (previously only green damage taken)
- Now recharges blue life based on 95 / 120 / 155 blue power
- Intercept - Intercept
- Reduced duration to 1T down from 2T - Reduced duration to 1T down from 2T
- Reduced cooldown to 1T down from 2T - Reduced cooldown to 1T down from 2T

View File

@ -232,7 +232,6 @@
padding-left: 1em; padding-left: 1em;
padding-right: 1em; padding-right: 1em;
text-align: center; text-align: center;
font-size: 0.8em;
svg { svg {
display: inline; display: inline;
height: 1em; height: 1em;

View File

@ -719,7 +719,7 @@ impl Item {
Item::Banish| Item::Banish|
Item::BanishPlus | Item::BanishPlus |
Item::BanishPlusPlus => format!("Banish target for {:?}T. Item::BanishPlusPlus => format!("Banish target for {:?}T.
Deal blue damage and red damage equal to {:?}% target red and blue life. Deal {:?}% target RedLife and BlueLife as red and blue damage respectively.
Banished constructs are immune to all skills and effects.", Banished constructs are immune to all skills and effects.",
self.into_skill().unwrap().effect()[0].get_duration(), self.into_skill().unwrap().effect()[0].get_duration(),
self.into_skill().unwrap().multiplier()), self.into_skill().unwrap().multiplier()),
@ -773,11 +773,12 @@ impl Item {
Item::Absorb| Item::Absorb|
Item::AbsorbPlus | Item::AbsorbPlus |
Item::AbsorbPlusPlus => format!( Item::AbsorbPlusPlus => format!(
"Gain Absorb for {:?}T. When attacked with Absorb you gain Absorption. "Gain Absorb for {:?}T. Taking damage replaces Absorb with Absorption.
Absorption increases RedPower and BluePower based on Damage taken. Absorption increases RedPower and BluePower based on damage taken.
Absorption lasts {:?}T.", Absorption lasts {:?}T. Recharges BlueLife based on {:?}% BluePower.",
self.into_skill().unwrap().effect()[0].get_duration(), self.into_skill().unwrap().effect()[0].get_duration(),
self.into_skill().unwrap().effect()[0].get_skill().unwrap().effect()[0].get_duration()), self.into_skill().unwrap().effect()[0].get_skill().unwrap().effect()[0].get_duration(),
self.into_skill().unwrap().multiplier()),
Item::Haste| Item::Haste|
Item::HastePlus | Item::HastePlus |

View File

@ -293,7 +293,7 @@ fn post_resolve(_skill: Skill, game: &mut Game, mut resolutions: Resolutions) ->
let mut target = game.construct_by_id(target.id).unwrap().clone(); let mut target = game.construct_by_id(target.id).unwrap().clone();
match event { match event {
Event::Damage { amount, skill, mitigation: _, colour: c } => { Event::Damage { amount, skill, mitigation, colour: c } => {
if target.affected(Effect::Electric) && !skill.is_tick() { if target.affected(Effect::Electric) && !skill.is_tick() {
let ConstructEffect { effect: _, duration: _, meta, tick: _ } = target.effects.iter() let ConstructEffect { effect: _, duration: _, meta, tick: _ } = target.effects.iter()
.find(|e| e.effect == Effect::Electric).unwrap().clone(); .find(|e| e.effect == Effect::Electric).unwrap().clone();
@ -320,7 +320,7 @@ fn post_resolve(_skill: Skill, game: &mut Game, mut resolutions: Resolutions) ->
.find(|e| e.effect == Effect::Absorb).unwrap().clone(); .find(|e| e.effect == Effect::Absorb).unwrap().clone();
match meta { match meta {
Some(EffectMeta::Skill(s)) => { Some(EffectMeta::Skill(s)) => {
resolutions = absorption(&mut source, &mut target, resolutions, skill, amount, s); resolutions = absorption(&mut source, &mut target, resolutions, skill, amount + mitigation, s);
}, },
_ => panic!("no absorb skill"), _ => panic!("no absorb skill"),
}; };
@ -834,6 +834,10 @@ impl Skill {
Skill::HasteStrike => 60, Skill::HasteStrike => 60,
Skill::Absorb=> 95,
Skill::AbsorbPlus => 120,
Skill::AbsorbPlusPlus => 155,
Skill::Intercept=> 80, Skill::Intercept=> 80,
Skill::InterceptPlus => 110, Skill::InterceptPlus => 110,
Skill::InterceptPlusPlus => 150, Skill::InterceptPlusPlus => 150,
@ -911,11 +915,11 @@ impl Skill {
Skill::HastePlusPlus => vec![ConstructEffect {effect: Effect::Haste, duration: 5, Skill::HastePlusPlus => vec![ConstructEffect {effect: Effect::Haste, duration: 5,
meta: Some(EffectMeta::Multiplier(225)), tick: None }], meta: Some(EffectMeta::Multiplier(225)), tick: None }],
Skill::Absorb => vec![ConstructEffect {effect: Effect::Absorb, duration: 2, Skill::Absorb => vec![ConstructEffect {effect: Effect::Absorb, duration: 1,
meta: Some(EffectMeta::Skill(Skill::Absorption)), tick: None}], meta: Some(EffectMeta::Skill(Skill::Absorption)), tick: None}],
Skill::AbsorbPlus => vec![ConstructEffect {effect: Effect::Absorb, duration: 3, Skill::AbsorbPlus => vec![ConstructEffect {effect: Effect::Absorb, duration: 1,
meta: Some(EffectMeta::Skill(Skill::AbsorptionPlus)), tick: None}], meta: Some(EffectMeta::Skill(Skill::AbsorptionPlus)), tick: None}],
Skill::AbsorbPlusPlus => vec![ConstructEffect {effect: Effect::Absorb, duration: 4, Skill::AbsorbPlusPlus => vec![ConstructEffect {effect: Effect::Absorb, duration: 1,
meta: Some(EffectMeta::Skill(Skill::AbsorptionPlusPlus)), tick: None}], meta: Some(EffectMeta::Skill(Skill::AbsorptionPlusPlus)), tick: None}],
Skill::Absorption => vec![ConstructEffect {effect: Effect::Absorption, duration: 3, meta: None, tick: None}], Skill::Absorption => vec![ConstructEffect {effect: Effect::Absorption, duration: 3, meta: None, tick: None}],
@ -1675,6 +1679,19 @@ fn ruin(source: &mut Construct, target: &mut Construct, mut results: Resolutions
fn absorb(source: &mut Construct, target: &mut Construct, mut results: Resolutions, skill: Skill) -> Resolutions { fn absorb(source: &mut Construct, target: &mut Construct, mut results: Resolutions, skill: Skill) -> Resolutions {
results.push(Resolution::new(source, target).event(target.add_effect(skill, skill.effect()[0]))); results.push(Resolution::new(source, target).event(target.add_effect(skill, skill.effect()[0])));
let blue_amount = source.blue_power().pct(skill.multiplier());
let e = target.recharge(skill, 0, blue_amount);
let stages = match e {
Event::Recharge { red, blue, skill: _ } => {
if red > 0 || blue > 0 { EventStages::PostOnly }
else { EventStages::NoStages }
}
_ => {
warn!("no recharge event found {:?}", e);
EventStages::NoStages
}
};
results.push(Resolution::new(source, target).event(e).stages(stages));
return results;; return results;;
} }