diff --git a/CHANGELOG.md b/CHANGELOG.md
index ee730dfe..804e23a7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,7 +2,31 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
-## [1.8.0] - 2019-10-31
+## [1.8.1] - 2019-11-07
+
+# Changed
+
+- Game phase
+ - Background for text overlapping with avatars in game phase (mobile)
+ - Fixed issue where effect text would show when not highlighted
+
+- Invert
+ Now reverses recharge into damage
+
+- Restrict
+ Changed cooldown from 2T -> 1T
+ Duration now 2T at all levels
+
+- Ruin
+ Cooldown now 2T at all levels (down from 3T)
+ Now deals damage to each target (40/70/100)%
+
+- Silence
+ Changed cooldown from 2T -> 1T
+ Duration now 2T at all levels
+
+
+## [1.8.0] - 2019-11-06
# Added
- Drag and drop for vbox interactions can be used instead of single click / double click
diff --git a/WORKLOG.md b/WORKLOG.md
index 7ecaec13..57b663fc 100644
--- a/WORKLOG.md
+++ b/WORKLOG.md
@@ -8,15 +8,30 @@
* mobile info page
-* Invert recharge
-
## SOON
+* supporter gold name in instance (anyone whos put any money into game)
+
* change cooldowns to delay & recharge
- delay is cooldown before skill can first be used
- recharge is cooldown after using skill
- every x speed reduces delay of skills
+* audio
+
+* elo + leaderboards
+* reconnect based on time delta
+
+* ACP
+ * essential
+
+## LATER
+
+* theme toasts
+* rework vecs into sets
+* remove names so games/instances are copy
+* consolidate game and instance
+
* combo rework
- reduce number of items for creating t2/t3 items from 3 -> 2
- add lost complexity by adding skill spec items
@@ -27,55 +42,11 @@
- Strike + SpeedRR -> StrikeSpeed (strike has Y% more speed)
- Strike + LifeRR -> StrikeLife (Strike recharges X% of damage as red life)
-* ACP
- * essential
-
-* audio
- * treats
- * susbcriber gold name in instance
- * client animation bpm
- * background colour changes depending on time of day
-
-* rework vecs into sets
-* remove names so games/instances are copy
-
-*$$$*
- * instead of red noise, red and black bar gradient
- * eth adapter
- * illusions
- * vaporwave
- * crop circles
- * insects
- * sacred geometry
- * skulls / day of the dead
- * Aztec
- * youkai
- * Industrial
-
-*CLIENT*
- theme toasts
-
- reconnect based on time delta
- consolidate game and instance
-
- * return of the combat log (last few events with condensed descriptions)
- - click in to scroll
- * elo + leaderboards
-
- * reflect event stages (for animations)
- * mnml tv
-
-## LATER
* constants
-* bot game grind
+* (maybe) return of the combat log (last few events with condensed descriptions)
+ - click in to scroll
-$$$
-* Items
- * Colour scheme
- * targeting highlight colour
- * number of constructs
- * Highlight (dota) colour
- * fx colours + styles
+* mnml tv
* modules
* troll life -> dmg
@@ -84,6 +55,28 @@ $$$
* fuck magic
* empower on ko
+## $$$
+* Items
+ * instead of red noise, red and black bar gradient
+ * eth adapter
+ *sets*
+ * illusions
+ * vaporwave
+ * crop circles
+ * insects
+ * sacred geometry
+ * skulls / day of the dead
+ * Aztec
+ * youkai
+ * Industrial
+ * Colour scheme
+ * targeting highlight colour
+* Highlight (dota) colour
+* fx colours + styles
+* treats
+ * client animation bpm
+ * background colour changes depending on time of day
+
# Mechanics
* 10d chaos maths, not rock paper scissors
* phys is faster and chaotic
diff --git a/client/assets/styles/game.less b/client/assets/styles/game.less
index d6bd7d30..b51ce13c 100644
--- a/client/assets/styles/game.less
+++ b/client/assets/styles/game.less
@@ -130,6 +130,9 @@
margin-bottom: 0.25em;
text-align: center;
grid-area: name;
+ span {
+ background-color: black;
+ }
}
.skills {
@@ -138,9 +141,15 @@
width: 100%;
height: 2em;
margin-right: 1em;
+ span {
+ background-color: black;
+ }
}
button.active {
background: #2c2c2c;
+ span {
+ background-color: #2c2c2c;
+ }
}
}
@@ -151,6 +160,9 @@
width: 100%;
text-align: center;
font-size: 1.5em;
+ span {
+ background-color: black;
+ }
}
.stats {
@@ -232,6 +244,7 @@
padding-left: 1em;
padding-right: 1em;
text-align: center;
+ background-color: black;
svg {
display: inline;
height: 1em;
diff --git a/client/src/components/buttons.jsx b/client/src/components/buttons.jsx
index af6f0f72..ba47d8f5 100644
--- a/client/src/components/buttons.jsx
+++ b/client/src/components/buttons.jsx
@@ -8,33 +8,33 @@ module.exports = {
Slay: () => 'red-green-border',
Siphon: () => 'blue-green-border',
// Stun
- Link: () => 'blue-green-border',
Bash: () => 'red-border',
- Sleep: () => 'green-border',
Ruin: () => 'blue-border',
- Break: () => 'red-green-border',
+ Sleep: () => 'green-border',
Banish: () => 'red-blue-border',
+ Break: () => 'red-green-border',
+ Link: () => 'blue-green-border',
// Block
Counter: () => 'red-border',
- Purify: () => 'green-border',
Electrify: () => 'blue-border',
+ Purify: () => 'green-border',
+ Recharge: () => 'red-blue-border',
Sustain: () => 'red-green-border',
Reflect: () => 'blue-green-border',
- Recharge: () => 'blue-red-border',
// Buff
Intercept: () => 'red-border',
- Triage: () => 'green-border',
- Haste: () => 'red-green-border',
Absorb: () => 'blue-border',
- Hybrid: () => 'blue-green-border',
+ Triage: () => 'green-border',
Amplify: () => 'red-blue-border',
+ Haste: () => 'red-green-border',
+ Hybrid: () => 'blue-green-border',
// Debuff
Restrict: () => 'red-border',
- Purge: () => 'green-border',
Silence: () => 'blue-border',
+ Purge: () => 'green-border',
+ Curse: () => 'red-blue-border',
Invert: () => 'red-green-border',
Decay: () => 'blue-green-border',
- Curse: () => 'red-blue-border',
// // Lifes Upgrades
// LifeGG: () => 'green-border',
diff --git a/client/src/components/construct.jsx b/client/src/components/construct.jsx
index 19e9fd20..112126d8 100644
--- a/client/src/components/construct.jsx
+++ b/client/src/components/construct.jsx
@@ -111,7 +111,7 @@ function constructText(props) {
? animText.text
: construct.name;
- return
{text}
;
+ return {text}
;
}
module.exports = {
diff --git a/client/src/components/game.construct.jsx b/client/src/components/game.construct.jsx
index b448ecec..0a475f7a 100644
--- a/client/src/components/game.construct.jsx
+++ b/client/src/components/game.construct.jsx
@@ -153,11 +153,11 @@ class GameConstruct extends Component {
}
const effects = construct.effects.length
? construct.effects.map(c =>
- hoverInfo(e, c)}
- onMouseOut={e => hoverInfo(e, null)}
- > {c.effect} - {c.duration}T
)
+
+ hoverInfo(e, c)}
+ onMouseOut={e => hoverInfo(e, null)}> {c.effect} - {c.duration}T
+
+
)
: null;
return ( {effects}
);
};
diff --git a/client/src/components/skill.btn.jsx b/client/src/components/skill.btn.jsx
index 87d0cc89..6f96e410 100644
--- a/client/src/components/skill.btn.jsx
+++ b/client/src/components/skill.btn.jsx
@@ -91,7 +91,7 @@ function Skill(props) {
onMouseOut={e => hoverInfo(e, null)}
type="submit"
onClick={onClick}>
- {s.skill} {cdText}
+ {s.skill} {cdText}
);
}
diff --git a/client/src/events.jsx b/client/src/events.jsx
index 0d9c88fa..0c745017 100644
--- a/client/src/events.jsx
+++ b/client/src/events.jsx
@@ -74,7 +74,7 @@ function registerEvents(store) {
// stop fetching the game state til animations are done
const newRes = game.resolved.slice(currentGame.resolved.length);
return eachSeries(newRes, (r, cb) => {
- if (!r.event || r.stages === '') return cb();
+ if (!r.event) return cb();
const timeout = animations.getTime(r.stages);
const anims = animations.getObjects(r, game, account);
const text = animations.getText(r);
diff --git a/client/src/utils.jsx b/client/src/utils.jsx
index 8cbbc11a..05513adb 100644
--- a/client/src/utils.jsx
+++ b/client/src/utils.jsx
@@ -240,6 +240,8 @@ function convertItem(v) {
}
function effectInfo(i) {
+ const hybridBlast = 25;
+ const hasteStrike = 30;
function multiplier(s) { // Update later to use server info in future
if (s === 'CounterAttack') return 120;
if (s === 'CounterAttack+') return 160;
@@ -270,9 +272,9 @@ function effectInfo(i) {
case 'Buff': return `Increases construct RedPower BluePower SpeedStat by ${i.meta[1] - 100}%`;
case 'Sustain': return 'Construct cannot be KO while active. Additionally provides immunity to disables';
case 'Curse': return `Construct will take ${i.meta[1] - 100}% increased red and blue damage`;
- case 'Haste': return `Construct has ${i.meta[1] - 100}% increased SpeedStat. Red attack skills will trigger a HasteStrike dealing 30% SpeedStat as red damage.`;
- case 'Hybrid': return `Construct has ${i.meta[1] - 100}% increased GreenPower. Blue attack skills will trigger a HybridBlast dealing 25% GreenPower as red damage.`;
- case 'Invert': return 'Reverses damage and healing. Healing will damage this construct and damage will heal.';
+ case 'Haste': return `Construct has ${i.meta[1] - 100}% increased SpeedStat. Red attack skills will trigger a HasteStrike dealing ${hasteStrike}% SpeedStat as red damage.`;
+ case 'Hybrid': return `Construct has ${i.meta[1] - 100}% increased GreenPower. Blue attack skills will trigger a HybridBlast dealing ${hybridBlast}% GreenPower as red damage.`;
+ case 'Invert': return 'Reverse healing/recharge into damage and damage into healing/recharge.';
case 'Counter': return `Red damage taken by this construct will trigger a CounterAttack. CounterAttack deals ${multiplier(i.meta[1])}% RedPower as red damage.`;
case 'Purge': return 'Disable construct from casting any green skills';
case 'Reflect': return 'Reflect blue skills back to caster';
diff --git a/server/src/construct.rs b/server/src/construct.rs
index 55a971f1..6d7c2ea8 100644
--- a/server/src/construct.rs
+++ b/server/src/construct.rs
@@ -549,27 +549,94 @@ impl Construct {
}
}
- pub fn recharge(&mut self, skill: Skill, red_amount: u64, blue_amount: u64) -> Event {
+ pub fn recharge(&mut self, skill: Skill, red_amount: u64, blue_amount: u64) -> Vec {
+ let mut events = vec![];
+
// Should red type immunity block recharge???
if let Some(immunity) = self.immune(skill) {
- return Event::Immunity {
- skill,
- immunity,
- };
+ events.push(Event::Immunity { skill, immunity });
+ return events;
}
- // Do we need inversion?
- let current_red_life = self.red_life();
- self.red_life.increase(red_amount);
- let new_red_life = self.red_life.value;
- let red = new_red_life - current_red_life;
+ match self.affected(Effect::Invert) {
+ false => {
+ // Do we need inversion?
+ let current_red_life = self.red_life();
+ self.red_life.increase(red_amount);
+ let new_red_life = self.red_life.value;
+ let red = new_red_life - current_red_life;
- let current_blue_life = self.blue_life();
- self.blue_life.increase(blue_amount);
- let new_blue_life = self.blue_life.value;
- let blue = new_blue_life - current_blue_life;
+ let current_blue_life = self.blue_life();
+ self.blue_life.increase(blue_amount);
+ let new_blue_life = self.blue_life.value;
+ let blue = new_blue_life - current_blue_life;
- Event::Recharge { red, blue, skill }
+ if red != 0 || blue != 0 {
+ events.push(Event::Recharge { red, blue, skill });
+ }
+ },
+ true => {
+ // Recharge takes a red and blue amount so check for them
+ if red_amount != 0 {
+ let red_mods = self.effects.iter()
+ .filter(|e| e.effect.modifications().contains(&Stat::RedDamageTaken))
+ .map(|e| (e.effect, e.meta))
+ .collect::)>>();
+
+ let red_modified_power = red_mods.iter()
+ .fold(red_amount, |acc, fx| fx.0.apply(acc, fx.1));
+
+
+ let red_remainder = red_modified_power.saturating_sub(self.red_life.value);
+ let red_mitigation = red_modified_power.saturating_sub(red_remainder);
+
+ // reduce red_life by mitigation amount
+ self.red_life.reduce(red_mitigation);
+
+ // deal remainder to green_life
+ let red_current_green_life = self.green_life();
+ self.reduce_green_life(red_remainder);
+ let red_damage_amount = red_current_green_life - self.green_life();
+
+ events.push(Event::Damage {
+ skill,
+ amount: red_damage_amount,
+ mitigation: red_mitigation,
+ colour: Colour::Red
+ });
+ }
+
+ if blue_amount != 0 {
+ let blue_mods = self.effects.iter()
+ .filter(|e| e.effect.modifications().contains(&Stat::BlueDamageTaken))
+ .map(|e| (e.effect, e.meta))
+ .collect::)>>();
+
+ let blue_modified_power = blue_mods.iter()
+ .fold(blue_amount, |acc, fx| fx.0.apply(acc, fx.1));
+
+
+ let blue_remainder = blue_modified_power.saturating_sub(self.blue_life.value);
+ let blue_mitigation = blue_modified_power.saturating_sub(blue_remainder);
+
+ // reduce blue_life by mitigation amount
+ self.blue_life.reduce(blue_mitigation);
+
+ // deal remainder to green_life
+ let blue_current_green_life = self.green_life();
+ self.reduce_green_life(blue_remainder);
+ let blue_damage_amount = blue_current_green_life - self.green_life();
+
+ events.push(Event::Damage {
+ skill,
+ amount: blue_damage_amount,
+ mitigation: blue_mitigation,
+ colour: Colour::Blue
+ });
+ }
+ }
+ }
+ return events;
}
pub fn deal_green_damage(&mut self, skill: Skill, amount: u64) -> Vec {
diff --git a/server/src/game.rs b/server/src/game.rs
index e484c286..c91d392d 100644
--- a/server/src/game.rs
+++ b/server/src/game.rs
@@ -1390,6 +1390,7 @@ mod tests {
true
},
Event::AoeSkill { skill: _ } => false,
+ Event::Damage { amount: _, mitigation: _, colour: _, skill: _ } => false,
_ => panic!("ruin result not effect {:?}", event),
}
false => false,
@@ -1428,7 +1429,7 @@ mod tests {
game = game.resolve_phase_start();
- assert!(game.resolved.len() == 5);
+ assert!(game.resolved.len() == 4);
while let Some(r) = game.resolved.pop() {
let Resolution { source , target, event: _, stages: _ } = r;
if [i_construct.id, j_construct.id].contains(&source.id) {
diff --git a/server/src/item.rs b/server/src/item.rs
index 1f1405a2..f4197a36 100644
--- a/server/src/item.rs
+++ b/server/src/item.rs
@@ -807,8 +807,8 @@ impl Item {
Item::Invert|
Item::InvertPlus |
Item::InvertPlusPlus => format!(
- "Reverse healing into damage and damage into healing.
- Any excess red or blue damage is converted into shield recharge.
+ "Reverse healing/recharge into damage and damage into healing/recharge.
+ Any excess red or blue damage is converted into shield recharge after healing.
Lasts {:?}T.",
self.into_skill().unwrap().effect()[0].get_duration()),
@@ -851,8 +851,10 @@ impl Item {
Item::Ruin|
Item::RuinPlus |
Item::RuinPlusPlus => format!(
- "Team wide Stun for {:?}T. Stunned constructs are unable to cast skills.",
- self.into_skill().unwrap().effect()[0].get_duration()),
+ "Team wide skill. Stun each construct for {:?}T.
+ Deal {:?}% BluePower as blue damage to each construct.",
+ self.into_skill().unwrap().effect()[0].get_duration(),
+ self.into_skill().unwrap().multiplier()),
Item::Link|
Item::LinkPlus |
diff --git a/server/src/skill.rs b/server/src/skill.rs
index 855f8954..3092f44f 100644
--- a/server/src/skill.rs
+++ b/server/src/skill.rs
@@ -433,8 +433,6 @@ pub enum EventStages {
EndOnly, // Skip Anim Skip
#[serde(rename = "POST_SKILL")]
PostOnly, // Skip Skip Anim
- #[serde(rename = "")]
- NoStages, // Skip Skip Skip
}
#[derive(Debug,Clone,PartialEq,Serialize,Deserialize)]
@@ -490,7 +488,6 @@ impl Resolution {
EventStages::EndPost => target_duration + post_skill, // Skip Anim Anim
EventStages::EndOnly => target_duration, // Skip Anim Skip
EventStages::PostOnly => post_skill, // Skip Skip Anim
- EventStages::NoStages => 0, // Skip Skip Skip
}
}
}
@@ -764,48 +761,48 @@ impl Skill {
// Attack Base
Skill::Attack => 80, // Base
- Skill::Blast=> 105, // BB
+ Skill::Blast => 105, // BB
Skill::BlastPlus => 140, // BB
Skill::BlastPlusPlus => 200, // BB
- Skill::Chaos=> 40, // BR
+ Skill::Chaos => 40, // BR
Skill::ChaosPlus => 65, // BR
Skill::ChaosPlusPlus => 90, // BR
- Skill::Heal=> 125, //GG
+ Skill::Heal => 125, //GG
Skill::HealPlus => 185, //GG
Skill::HealPlusPlus => 270, //GG
- Skill::SiphonTick=> 25, // GB
+ Skill::SiphonTick => 25, // GB
Skill::SiphonTickPlus => 30,
Skill::SiphonTickPlusPlus => 40,
- Skill::Slay=> 45, // RG
+ Skill::Slay => 45, // RG
Skill::SlayPlus => 65,
Skill::SlayPlusPlus => 100,
- Skill::Strike=> 90, //RR
+ Skill::Strike => 90, //RR
Skill::StrikePlus => 140,
Skill::StrikePlusPlus => 200,
// Block Base
- Skill::ElectrocuteTick=> 80,
+ Skill::ElectrocuteTick => 80,
Skill::ElectrocuteTickPlus => 100,
Skill::ElectrocuteTickPlusPlus => 130,
- Skill::CounterAttack=> 120,
+ Skill::CounterAttack => 120,
Skill::CounterAttackPlus => 160,
Skill::CounterAttackPlusPlus => 230,
- Skill::Purify=> 45, //Green dmg (heal)
+ Skill::Purify => 45, //Green dmg (heal)
Skill::PurifyPlus => 70,
Skill::PurifyPlusPlus => 105,
- Skill::Reflect=> 45, //Recharge blue life (heal)
+ Skill::Reflect => 45, //Recharge blue life (heal)
Skill::ReflectPlus => 70,
Skill::ReflectPlusPlus => 100,
- Skill::Recharge=> 70, //Recharge red and blue life (heal)
+ Skill::Recharge => 70, //Recharge red and blue life (heal)
Skill::RechargePlus => 110,
Skill::RechargePlusPlus => 170,
@@ -814,29 +811,36 @@ impl Skill {
Skill::SustainPlusPlus => 230,
// Stun Base
- Skill::Sleep=> 200, //Green dmg (heal)
+ Skill::Sleep => 200, //Green dmg (heal)
Skill::SleepPlus => 290,
Skill::SleepPlusPlus => 400,
- Skill::Banish=> 40, //Green dmg (heal)
+ Skill::Banish => 40, //Green dmg (heal)
Skill::BanishPlus => 75,
Skill::BanishPlusPlus => 125,
- Skill::Bash=> 45,
+ Skill::Bash => 45,
Skill::BashPlus => 65,
Skill::BashPlusPlus => 100,
- Skill::Link=> 75,
+ Skill::Link => 75,
Skill::LinkPlus => 100,
Skill::LinkPlusPlus => 150,
+
+ Skill::Ruin => 40,
+ Skill::RuinPlus => 70,
+ Skill::RuinPlusPlus => 100,
+
// Debuff Base
- Skill::DecayTick=> 33,
+ Skill::DecayTick => 33,
Skill::DecayTickPlus => 45,
Skill::DecayTickPlusPlus => 70,
- Skill::Silence=> 55, // Deals more per blue skill on target
+
+ Skill::Silence => 55, // Deals more per blue skill on target
Skill::SilencePlus => 80,
Skill::SilencePlusPlus => 110,
- Skill::Restrict=> 40, // Deals more per red skill on target
+
+ Skill::Restrict => 40, // Deals more per red skill on target
Skill::RestrictPlus => 65,
Skill::RestrictPlusPlus => 100,
@@ -849,11 +853,11 @@ impl Skill {
Skill::AbsorbPlus => 120,
Skill::AbsorbPlusPlus => 155,
- Skill::Intercept=> 80,
+ Skill::Intercept => 80,
Skill::InterceptPlus => 110,
Skill::InterceptPlusPlus => 150,
- Skill::TriageTick=> 75,
+ Skill::TriageTick => 75,
Skill::TriageTickPlus => 110,
Skill::TriageTickPlusPlus => 140,
@@ -971,7 +975,7 @@ impl Skill {
Skill::Ruin => vec![ConstructEffect {effect: Effect::Stun, duration: 1, meta: None, tick: None}],
Skill::RuinPlus => vec![ConstructEffect {effect: Effect::Stun, duration: 1, meta: None, tick: None}],
- Skill::RuinPlusPlus => vec![ConstructEffect {effect: Effect::Stun, duration: 2, meta: None, tick: None}],
+ Skill::RuinPlusPlus => vec![ConstructEffect {effect: Effect::Stun, duration: 1, meta: None, tick: None}],
Skill::Purge => vec![ConstructEffect {effect: Effect::Purge, duration: 2, meta: None, tick: None}],
Skill::PurgePlus => vec![ConstructEffect {effect: Effect::Purge, duration: 3, meta: None, tick: None}],
@@ -982,8 +986,8 @@ impl Skill {
Skill::LinkPlusPlus => vec![ConstructEffect {effect: Effect::Stun, duration: 1, meta: None, tick: None}],
Skill::Silence => vec![ConstructEffect {effect: Effect::Silence, duration: 2, meta: None, tick: None}],
- Skill::SilencePlus => vec![ConstructEffect {effect: Effect::Silence, duration: 3, meta: None, tick: None}],
- Skill::SilencePlusPlus => vec![ConstructEffect {effect: Effect::Silence, duration: 4, meta: None, tick: None}],
+ Skill::SilencePlus => vec![ConstructEffect {effect: Effect::Silence, duration: 2, meta: None, tick: None}],
+ Skill::SilencePlusPlus => vec![ConstructEffect {effect: Effect::Silence, duration: 2, meta: None, tick: None}],
Skill::Siphon => vec![ConstructEffect {effect: Effect::Siphon, duration: 2,
meta: Some(EffectMeta::Skill(Skill::SiphonTick)), tick: None}],
@@ -997,8 +1001,8 @@ impl Skill {
Skill::SleepPlusPlus => vec![ConstructEffect {effect: Effect::Stun, duration: 4, meta: None, tick: None}],
Skill::Restrict => vec![ConstructEffect {effect: Effect::Restrict, duration: 2, meta: None, tick: None}],
- Skill::RestrictPlus => vec![ConstructEffect {effect: Effect::Restrict, duration: 3, meta: None, tick: None}],
- Skill::RestrictPlusPlus => vec![ConstructEffect {effect: Effect::Restrict, duration: 4, meta: None, tick: None}],
+ Skill::RestrictPlus => vec![ConstructEffect {effect: Effect::Restrict, duration: 2, meta: None, tick: None}],
+ Skill::RestrictPlusPlus => vec![ConstructEffect {effect: Effect::Restrict, duration: 2, meta: None, tick: None}],
Skill::Bash => vec![ConstructEffect {effect: Effect::Stun, duration: 2,
meta: Some(EffectMeta::Skill(Skill::Bash)), tick: None}],
@@ -1027,24 +1031,25 @@ impl Skill {
pub fn base_cd(&self) -> Cooldown {
match self {
Skill::Attack => None,
- Skill::Debuff => Some(1),
+ Skill::Block => None, // reduce damage
Skill::Buff => None,
+ Skill::Debuff => Some(1),
+ Skill::Stun => Some(2),
Skill::Strike=> None,
Skill::StrikePlus => None,
Skill::StrikePlusPlus => None,
- Skill::Block => None, // reduce damage
+
Skill::Counter|
Skill::CounterPlus |
Skill::CounterPlusPlus => None, // avoid all damage
- Skill::Restrict=> Some(2),
- Skill::RestrictPlus => Some(2),
+ Skill::Restrict |
+ Skill::RestrictPlus |
Skill::RestrictPlusPlus => Some(2),
- Skill::Stun => Some(2),
- Skill::Bash=> Some(2),
- Skill::BashPlus => Some(2),
+ Skill::Bash |
+ Skill::BashPlus |
Skill::BashPlusPlus => Some(2),
Skill::Heal=> None,
@@ -1055,30 +1060,31 @@ impl Skill {
Skill::TriagePlus => None, // hot
Skill::TriagePlusPlus => None, // hot
- Skill::Break=> Some(1), // no damage stun, adds vulnerable
- Skill::BreakPlus => Some(1),
+ Skill::Break | // no damage stun, adds vulnerable
+ Skill::BreakPlus |
Skill::BreakPlusPlus => Some(1),
- Skill::Blast=> None,
- Skill::BlastPlus => None,
+ Skill::Blast |
+ Skill::BlastPlus |
Skill::BlastPlusPlus => None,
- Skill::Chaos=> None,
- Skill::ChaosPlus => None,
+ Skill::Chaos |
+ Skill::ChaosPlus |
Skill::ChaosPlusPlus => None,
- Skill::Amplify=> Some(1),
- Skill::AmplifyPlus => Some(1),
+ Skill::Amplify |
+ Skill::AmplifyPlus |
Skill::AmplifyPlusPlus => Some(1),
- Skill::Hybrid|
+
+ Skill::Hybrid |
Skill::HybridPlus |
Skill::HybridPlusPlus => Some(1),
- Skill::Invert=> Some(2),
- Skill::InvertPlus => Some(2),
+ Skill::Invert |
+ Skill::InvertPlus |
Skill::InvertPlusPlus => Some(2),
- Skill::Decay=> None, // dot
+ Skill::Decay => None, // dot
Skill::DecayPlus => None,
Skill::DecayPlusPlus => None,
@@ -1086,59 +1092,59 @@ impl Skill {
Skill::SiphonPlus |
Skill::SiphonPlusPlus => None,
- Skill::Curse=> Some(1),
- Skill::CursePlus => Some(1),
+ Skill::Curse |
+ Skill::CursePlus |
Skill::CursePlusPlus => Some(1),
- Skill::Link=> Some(2),
- Skill::LinkPlus => Some(2),
+ Skill::Link |
+ Skill::LinkPlus |
Skill::LinkPlusPlus => Some(2),
- Skill::Silence=> Some(2),
- Skill::SilencePlus => Some(2),
+ Skill::Silence |
+ Skill::SilencePlus |
Skill::SilencePlusPlus => Some(2),
Skill::Purify |
Skill::PurifyPlus |
Skill::PurifyPlusPlus => None,
- Skill::Purge=> Some(1),
- Skill::PurgePlus => Some(1),
+ Skill::Purge |
+ Skill::PurgePlus |
Skill::PurgePlusPlus => Some(1),
Skill::Banish |
Skill::BanishPlus |
Skill::BanishPlusPlus => Some(1),
- Skill::Haste=> Some(1),
- Skill::HastePlus => Some(1),
+ Skill::Haste |
+ Skill::HastePlus |
Skill::HastePlusPlus => Some(1),
Skill::Reflect |
Skill::ReflectPlus |
Skill::ReflectPlusPlus => None,
- Skill::Recharge=> None,
- Skill::RechargePlus => None,
+ Skill::Recharge |
+ Skill::RechargePlus |
Skill::RechargePlusPlus => None,
- Skill::Ruin=> Some(3),
- Skill::RuinPlus => Some(2),
+ Skill::Ruin |
+ Skill::RuinPlus |
Skill::RuinPlusPlus => Some(2),
Skill::Slay=> None,
Skill::SlayPlus => None,
Skill::SlayPlusPlus => None,
- Skill::Sleep=> Some(2),
- Skill::SleepPlus => Some(2),
+ Skill::Sleep |
+ Skill::SleepPlus |
Skill::SleepPlusPlus => Some(2),
Skill::Sustain |
Skill::SustainPlus |
Skill::SustainPlusPlus => Some(1),
- Skill::Intercept=> Some(1),
+ Skill::Intercept => Some(1),
Skill::InterceptPlus => Some(1),
Skill::InterceptPlusPlus => Some(1),
@@ -1146,8 +1152,7 @@ impl Skill {
Skill::ElectrifyPlus |
Skill::ElectrifyPlusPlus => None,
-
- Skill::Absorb|
+ Skill::Absorb |
Skill::AbsorbPlus |
Skill::AbsorbPlusPlus => Some(1),
@@ -1184,17 +1189,17 @@ impl Skill {
pub fn ko_castable(&self) -> bool {
match self {
- Skill::ElectrocuteTick|
+ Skill::ElectrocuteTick |
Skill::ElectrocuteTickPlus |
Skill::ElectrocuteTickPlusPlus |
- Skill::DecayTick|
+ Skill::DecayTick |
Skill::DecayTickPlus |
Skill::DecayTickPlusPlus |
- Skill::SiphonTick|
+ Skill::SiphonTick |
Skill::SiphonTickPlus |
Skill::SiphonTickPlusPlus |
- Skill::TriageTick|
+ Skill::TriageTick |
Skill::TriageTickPlus |
Skill::TriageTickPlusPlus => true,
_ => false,
@@ -1203,17 +1208,16 @@ impl Skill {
pub fn is_tick(&self) -> bool {
match self {
- Skill::ElectrocuteTick|
+ Skill::ElectrocuteTick |
Skill::ElectrocuteTickPlus |
Skill::ElectrocuteTickPlusPlus |
- Skill::DecayTick|
+ Skill::DecayTick |
Skill::DecayTickPlus |
Skill::DecayTickPlusPlus |
- Skill::SiphonTick|
+ Skill::SiphonTick |
Skill::SiphonTickPlus |
Skill::SiphonTickPlusPlus |
-
- Skill::TriageTick|
+ Skill::TriageTick |
Skill::TriageTickPlus |
Skill::TriageTickPlusPlus => true,
@@ -1223,19 +1227,19 @@ impl Skill {
pub fn speed(&self) -> u64 {
match self {
- Skill::SiphonTick|
+ Skill::SiphonTick |
Skill::SiphonTickPlus |
Skill::SiphonTickPlusPlus => Skill::Siphon.speed(),
- Skill::DecayTick|
+ Skill::DecayTick |
Skill::DecayTickPlus |
Skill::DecayTickPlusPlus => Skill::Decay.speed(),
- Skill::TriageTick|
+ Skill::TriageTick |
Skill::TriageTickPlus |
Skill::TriageTickPlusPlus => Skill::Triage.speed(),
- Skill::ElectrocuteTick|
+ Skill::ElectrocuteTick |
Skill::ElectrocuteTickPlus |
Skill::ElectrocuteTickPlusPlus => Skill::Electrify.speed(),
@@ -1245,7 +1249,7 @@ impl Skill {
pub fn aoe(&self) -> bool {
match self {
- Skill::Ruin|
+ Skill::Ruin |
Skill::RuinPlus |
Skill::RuinPlusPlus => true,
_ => false,
@@ -1260,44 +1264,44 @@ impl Skill {
Skill::AmplifyPlus |
Skill::AmplifyPlusPlus |
Skill::Block |
- Skill::Sustain|
+ Skill::Sustain |
Skill::SustainPlus |
Skill::SustainPlusPlus |
- Skill::Electrify|
+ Skill::Electrify |
Skill::ElectrifyPlus |
Skill::ElectrifyPlusPlus |
- Skill::Haste|
+ Skill::Haste |
Skill::HastePlus |
Skill::HastePlusPlus |
- Skill::Heal|
+ Skill::Heal |
Skill::HealPlus |
Skill::HealPlusPlus |
- Skill::Absorb|
+ Skill::Absorb |
Skill::AbsorbPlus |
Skill::AbsorbPlusPlus |
- Skill::Invert|
+ Skill::Invert |
Skill::InvertPlus |
Skill::InvertPlusPlus |
- Skill::Intercept|
+ Skill::Intercept |
Skill::InterceptPlus |
Skill::InterceptPlusPlus |
- Skill::Counter|
+ Skill::Counter |
Skill::CounterPlus |
Skill::CounterPlusPlus |
- Skill::Purify|
+ Skill::Purify |
Skill::PurifyPlus |
Skill::PurifyPlusPlus |
- Skill::Recharge|
+ Skill::Recharge |
Skill::RechargePlus |
Skill::RechargePlusPlus |
- Skill::Reflect|
+ Skill::Reflect |
Skill::ReflectPlus |
Skill::ReflectPlusPlus |
- Skill::Triage|
+ Skill::Triage |
Skill::TriagePlus |
Skill::TriagePlusPlus => true,
- Skill::Banish|
+ Skill::Banish |
Skill::BanishPlus |
Skill::BanishPlusPlus => rng.gen_bool(0.5),
@@ -1401,21 +1405,12 @@ fn sleep(source: &mut Construct, target: &mut Construct, mut results: Resolution
}
fn sustain(source: &mut Construct, target: &mut Construct, mut results: Resolutions, skill: Skill) -> Resolutions {
- let red_amount = source.red_power().pct(skill.multiplier());
results.push(Resolution::new(source, target).event(target.add_effect(skill, skill.effect()[0])));
- let e = target.recharge(skill, red_amount, 0);
- 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));
+ let red_amount = source.red_power().pct(skill.multiplier());
+ target.recharge(skill, red_amount, 0)
+ .into_iter()
+ .for_each(|e| results.push(Resolution::new(source, target).event(e).stages(EventStages::PostOnly)));
return results;
}
@@ -1425,18 +1420,9 @@ fn intercept(source: &mut Construct, target: &mut Construct, mut results: Resolu
results.push(Resolution::new(source, target).event(target.add_effect(skill, intercept)));
let red_amount = source.red_power().pct(skill.multiplier());
- let e = target.recharge(skill, red_amount, 0);
- 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));
+ target.recharge(skill, red_amount, 0)
+ .into_iter()
+ .for_each(|e| results.push(Resolution::new(source, target).event(e).stages(EventStages::PostOnly)));
return results;
}
@@ -1684,6 +1670,11 @@ fn electrocute_tick(source: &mut Construct, target: &mut Construct, mut results:
}
fn ruin(source: &mut Construct, target: &mut Construct, mut results: Resolutions, skill: Skill) -> Resolutions {
+ let amount = source.blue_power().pct(skill.multiplier());
+ target.deal_blue_damage(skill, amount)
+ .into_iter()
+ .for_each(|e| results.push(Resolution::new(source, target).event(e).stages(EventStages::PostOnly)));
+
results.push(Resolution::new(source, target)
.event(target.add_effect(skill, skill.effect()[0]))
.stages(EventStages::PostOnly));
@@ -1693,18 +1684,9 @@ 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));
+ target.recharge(skill, 0, blue_amount)
+ .into_iter()
+ .for_each(|e| results.push(Resolution::new(source, target).event(e).stages(EventStages::PostOnly)));
return results;;
}
@@ -1743,36 +1725,21 @@ fn reflect(source: &mut Construct, target: &mut Construct, mut results: Resoluti
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));
+ target.recharge(skill, 0, blue_amount)
+ .into_iter()
+ .for_each(|e| results.push(Resolution::new(source, target).event(e).stages(EventStages::PostOnly)));
+
return results;;
}
fn recharge(source: &mut Construct, target: &mut Construct, mut results: Resolutions, skill: Skill) -> Resolutions {
+ results.push(Resolution::new(source, target).event(Event::Skill { skill }).stages(EventStages::StartEnd));
let red_amount = source.red_power().pct(skill.multiplier());
let blue_amount = source.blue_power().pct(skill.multiplier());
- let e = target.recharge(skill, red_amount, blue_amount);
- let stages = match e {
- Event::Recharge { red, blue, skill: _ } => {
- if red > 0 || blue > 0 { EventStages::AllStages }
- else { EventStages::StartEnd }
- }
- _ => {
- warn!("no recharge event found {:?}", e);
- EventStages::NoStages
- }
- };
- results.push(Resolution::new(source, target).event(e).stages(stages));
+ target.recharge(skill, red_amount, blue_amount)
+ .into_iter()
+ .for_each(|e| results.push(Resolution::new(source, target).event(e).stages(EventStages::PostOnly)));
+
return results;
}
@@ -2183,6 +2150,7 @@ mod tests {
let mut results = recharge(&mut x, &mut y, vec![], Skill::Recharge);
+ results.remove(0);
let Resolution { source: _, target: _, event, stages: _ } = results.remove(0);
match event {
Event::Recharge { red, blue, skill: _ } => {