Merge branch 'release/1.8.0' into develop
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "mnml"
|
||||
version = "1.7.1"
|
||||
version = "1.8.0"
|
||||
authors = ["ntr <ntr@smokestack.io>"]
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -220,11 +220,11 @@ impl Construct {
|
||||
account: id,
|
||||
img: Uuid::new_v4(),
|
||||
red_power: ConstructStat { base: 320, value: 320, max: 320, stat: Stat::RedPower },
|
||||
red_life: ConstructStat { base: 0, value: 0, max: 0, stat: Stat::RedLife },
|
||||
red_life: ConstructStat { base: 125, value: 125, max: 125, stat: Stat::RedLife },
|
||||
blue_power: ConstructStat { base: 320, value: 320, max: 320, stat: Stat::BluePower },
|
||||
blue_life: ConstructStat { base: 0, value: 0, max: 0, stat: Stat::BlueLife },
|
||||
blue_life: ConstructStat { base: 125, value: 125, max: 125, stat: Stat::BlueLife },
|
||||
green_power: ConstructStat { base: 300, value: 300, max: 300, stat: Stat::GreenPower },
|
||||
green_life: ConstructStat { base: 950, value: 950, max: 950, stat: Stat::GreenLife },
|
||||
green_life: ConstructStat { base: 800, value: 800, max: 800, stat: Stat::GreenLife },
|
||||
speed: ConstructStat { base: 100, value: 100, max: 100, stat: Stat::Speed },
|
||||
// evasion: ConstructStat { base: 0, value: 0, max: 0, stat: Stat::Evasion },
|
||||
skills: vec![],
|
||||
|
||||
@@ -105,7 +105,7 @@ impl Effect {
|
||||
|
||||
Effect::Absorption => vec![Stat::RedPower, Stat::BluePower],
|
||||
|
||||
Effect::Amplify => vec![Stat::RedPower, Stat::BluePower],
|
||||
Effect::Amplify => vec![Stat::GreenPower, Stat::RedPower, Stat::BluePower],
|
||||
Effect::Curse => vec![Stat::RedDamageTaken, Stat::BlueDamageTaken],
|
||||
|
||||
Effect::Hybrid => vec![Stat::GreenPower],
|
||||
|
||||
+1
-1
@@ -1229,7 +1229,7 @@ mod tests {
|
||||
assert!(game.player_by_id(x_player.id).unwrap().constructs[0].is_stunned() == false);
|
||||
// riposte
|
||||
assert_eq!(game.player_by_id(y_player.id).unwrap().constructs[0].green_life(), (
|
||||
y_construct.green_life() - x_construct.red_power().pct(Skill::CounterAttack.multiplier())));
|
||||
y_construct.green_life() + y_construct.red_life() - x_construct.red_power().pct(Skill::CounterAttack.multiplier())));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
+1
-1
@@ -302,7 +302,7 @@ pub fn smile(id: Uuid) -> Result<Uuid, Error> {
|
||||
// 100W 25H
|
||||
let mouths = [
|
||||
("M50,100 L150,100", 1), // _
|
||||
("M50,75 L150,75 L150,100 L50,100 L50,75", 1), // box
|
||||
("M50,75 L150,75 L125,100 L75,100 L50,75", 1), // D
|
||||
("M50,75 L75,100 L100,75 L125,100 L150,75", 1), // w
|
||||
("M50,75 L75,75 L75,87.5 M75,75 L125,75 L125,87.5 M125,75 L150,75", 1), // vamp
|
||||
("M50,75 L150,75 M50,75 L50,87.5 M75,75 L75,87.5 M100,75 L100,87.5 M125,75 L125,87.5 M150,75 L150,87.5", 1), // mm
|
||||
|
||||
+7
-6
@@ -712,14 +712,14 @@ impl Item {
|
||||
// Skills <- need to move effect mulltipliers into skills
|
||||
Item::Amplify|
|
||||
Item::AmplifyPlus |
|
||||
Item::AmplifyPlusPlus => format!("Increase RedPower and BluePower by {:?}%. Lasts {:?}T.",
|
||||
Item::AmplifyPlusPlus => format!("Increase RedPower BluePower GreenPower by {:?}%. Lasts {:?}T.",
|
||||
self.into_skill().unwrap().effect()[0].get_multiplier() - 100,
|
||||
self.into_skill().unwrap().effect()[0].get_duration()),
|
||||
|
||||
Item::Banish|
|
||||
Item::BanishPlus |
|
||||
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.",
|
||||
self.into_skill().unwrap().effect()[0].get_duration(),
|
||||
self.into_skill().unwrap().multiplier()),
|
||||
@@ -773,11 +773,12 @@ impl Item {
|
||||
Item::Absorb|
|
||||
Item::AbsorbPlus |
|
||||
Item::AbsorbPlusPlus => format!(
|
||||
"Gain Absorb for {:?}T. When attacked with Absorb you gain Absorption.
|
||||
Absorption increases RedPower and BluePower based on Damage taken.
|
||||
Absorption lasts {:?}T.",
|
||||
"Gain Absorb for {:?}T. Taking damage replaces Absorb with Absorption.
|
||||
Absorption increases RedPower and BluePower based on damage taken.
|
||||
Absorption lasts {:?}T. Recharges BlueLife based on {:?}% BluePower.",
|
||||
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::HastePlus |
|
||||
|
||||
+64
-29
@@ -89,10 +89,15 @@ pub fn resolve(skill: Skill, source: &mut Construct, target: &mut Construct, mut
|
||||
|
||||
if source.affected(Effect::Haste) {
|
||||
match skill {
|
||||
Skill::Attack |
|
||||
Skill::Slay|
|
||||
Skill::Chaos|
|
||||
Skill::Strike=> {
|
||||
Skill::Slay |
|
||||
Skill::SlayPlus |
|
||||
Skill::SlayPlusPlus |
|
||||
Skill::Chaos |
|
||||
Skill::ChaosPlus |
|
||||
Skill::ChaosPlusPlus |
|
||||
Skill::Strike |
|
||||
Skill::StrikePlus |
|
||||
Skill::StrikePlusPlus => {
|
||||
let amount = source.speed().pct(Skill::HasteStrike.multiplier());
|
||||
target.deal_red_damage(Skill::HasteStrike, amount)
|
||||
.into_iter()
|
||||
@@ -105,8 +110,14 @@ pub fn resolve(skill: Skill, source: &mut Construct, target: &mut Construct, mut
|
||||
if source.affected(Effect::Hybrid) {
|
||||
match skill {
|
||||
Skill::Blast|
|
||||
Skill::Chaos|
|
||||
Skill::Siphon=> {
|
||||
Skill::BlastPlus |
|
||||
Skill::BlastPlusPlus |
|
||||
Skill::Chaos |
|
||||
Skill::ChaosPlus |
|
||||
Skill::ChaosPlusPlus |
|
||||
Skill::Siphon |
|
||||
Skill::SiphonPlus |
|
||||
Skill::SiphonPlusPlus => {
|
||||
let amount = source.green_power().pct(Skill::HybridBlast.multiplier());
|
||||
target.deal_blue_damage(Skill::HybridBlast, amount)
|
||||
.into_iter()
|
||||
@@ -293,7 +304,7 @@ fn post_resolve(_skill: Skill, game: &mut Game, mut resolutions: Resolutions) ->
|
||||
let mut target = game.construct_by_id(target.id).unwrap().clone();
|
||||
|
||||
match event {
|
||||
Event::Damage { amount, skill, mitigation: _, colour: c } => {
|
||||
Event::Damage { amount, skill, mitigation, colour: c } => {
|
||||
if target.affected(Effect::Electric) && !skill.is_tick() {
|
||||
let ConstructEffect { effect: _, duration: _, meta, tick: _ } = target.effects.iter()
|
||||
.find(|e| e.effect == Effect::Electric).unwrap().clone();
|
||||
@@ -320,7 +331,7 @@ fn post_resolve(_skill: Skill, game: &mut Game, mut resolutions: Resolutions) ->
|
||||
.find(|e| e.effect == Effect::Absorb).unwrap().clone();
|
||||
match meta {
|
||||
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"),
|
||||
};
|
||||
@@ -840,6 +851,10 @@ impl Skill {
|
||||
Skill::HybridBlast => 50,
|
||||
|
||||
Skill::HasteStrike => 60,
|
||||
|
||||
Skill::Absorb=> 95,
|
||||
Skill::AbsorbPlus => 120,
|
||||
Skill::AbsorbPlusPlus => 155,
|
||||
|
||||
Skill::Intercept => 80,
|
||||
Skill::InterceptPlus => 110,
|
||||
@@ -918,11 +933,11 @@ impl Skill {
|
||||
Skill::HastePlusPlus => vec![ConstructEffect {effect: Effect::Haste, duration: 5,
|
||||
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}],
|
||||
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}],
|
||||
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}],
|
||||
|
||||
Skill::Absorption => vec![ConstructEffect {effect: Effect::Absorption, duration: 3, meta: None, tick: None}],
|
||||
@@ -1000,9 +1015,9 @@ impl Skill {
|
||||
meta: Some(EffectMeta::Skill(Skill::BashPlusPlus)), tick: None}],
|
||||
Skill::Stun => vec![ConstructEffect {effect: Effect::Stun, duration: 2, meta: None, tick: None}],
|
||||
|
||||
Skill::Intercept => vec![ConstructEffect {effect: Effect::Intercept, duration: 2, meta: None, tick: None}],
|
||||
Skill::InterceptPlus => vec![ConstructEffect {effect: Effect::Intercept, duration: 3, meta: None, tick: None}],
|
||||
Skill::InterceptPlusPlus => vec![ConstructEffect {effect: Effect::Intercept, duration: 4, meta: None, tick: None}],
|
||||
Skill::Intercept => vec![ConstructEffect {effect: Effect::Intercept, duration: 1, meta: None, tick: None}],
|
||||
Skill::InterceptPlus => vec![ConstructEffect {effect: Effect::Intercept, duration: 1, meta: None, tick: None}],
|
||||
Skill::InterceptPlusPlus => vec![ConstructEffect {effect: Effect::Intercept, duration: 1, meta: None, tick: None}],
|
||||
|
||||
Skill::Triage => vec![ConstructEffect {effect: Effect::Triage, duration: 2,
|
||||
meta: Some(EffectMeta::Skill(Skill::TriageTick)), tick: None}],
|
||||
@@ -1072,11 +1087,11 @@ impl Skill {
|
||||
Skill::InvertPlus |
|
||||
Skill::InvertPlusPlus => Some(2),
|
||||
|
||||
Skill::Decay |
|
||||
Skill::DecayPlus |
|
||||
Skill::DecayPlusPlus => Some(1),
|
||||
Skill::Decay => None, // dot
|
||||
Skill::DecayPlus => None,
|
||||
Skill::DecayPlusPlus => None,
|
||||
|
||||
Skill::Siphon |
|
||||
Skill::Siphon|
|
||||
Skill::SiphonPlus |
|
||||
Skill::SiphonPlusPlus => None,
|
||||
|
||||
@@ -1102,7 +1117,7 @@ impl Skill {
|
||||
|
||||
Skill::Banish |
|
||||
Skill::BanishPlus |
|
||||
Skill::BanishPlusPlus => Some(2),
|
||||
Skill::BanishPlusPlus => Some(1),
|
||||
|
||||
Skill::Haste |
|
||||
Skill::HastePlus |
|
||||
@@ -1132,9 +1147,9 @@ impl Skill {
|
||||
Skill::SustainPlus |
|
||||
Skill::SustainPlusPlus => Some(1),
|
||||
|
||||
Skill::Intercept |
|
||||
Skill::InterceptPlus |
|
||||
Skill::InterceptPlusPlus => Some(2),
|
||||
Skill::Intercept => Some(1),
|
||||
Skill::InterceptPlus => Some(1),
|
||||
Skill::InterceptPlusPlus => Some(1),
|
||||
|
||||
Skill::Electrify |
|
||||
Skill::ElectrifyPlus |
|
||||
@@ -1689,6 +1704,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 {
|
||||
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;;
|
||||
}
|
||||
|
||||
@@ -1808,13 +1836,19 @@ fn link(source: &mut Construct, target: &mut Construct, mut results: Resolutions
|
||||
None => 0
|
||||
};
|
||||
|
||||
target.deal_blue_damage(skill, swap)
|
||||
.into_iter()
|
||||
.for_each(|e| results.push(Resolution::new(source, target).event(e)));
|
||||
|
||||
source.deal_green_damage(skill, swap)
|
||||
.into_iter()
|
||||
.for_each(|e| results.push(Resolution::new(source, source).event(e).stages(EventStages::PostOnly)));
|
||||
let link_events = target.deal_blue_damage(skill, swap);
|
||||
for e in link_events {
|
||||
match e {
|
||||
Event::Damage { amount, mitigation: _, colour: _, skill: _ } => {
|
||||
results.push(Resolution::new(source, target).event(e));
|
||||
let heal = source.deal_green_damage(skill, amount);
|
||||
for h in heal {
|
||||
results.push(Resolution::new(source, source).event(h).stages(EventStages::PostOnly));
|
||||
};
|
||||
},
|
||||
_ => results.push(Resolution::new(source, target).event(e)),
|
||||
}
|
||||
}
|
||||
|
||||
results.push(Resolution::new(source, source)
|
||||
.event(source.add_effect(skill, skill.effect()[0])).stages(EventStages::PostOnly));
|
||||
@@ -2090,6 +2124,7 @@ mod tests {
|
||||
x.blue_power.force(256);
|
||||
x.green_power.force(220);
|
||||
x.green_life.force(1024);
|
||||
y.blue_life.force(0);
|
||||
x.green_life.reduce(512);
|
||||
|
||||
let mut results = resolve(Skill::Siphon, &mut x, &mut y, vec![]);
|
||||
|
||||
Reference in New Issue
Block a user