taunt / intercept

This commit is contained in:
ntr
2019-07-04 15:00:19 +10:00
parent 28abca3ed8
commit 34cfc19ae2
16 changed files with 234 additions and 57 deletions
+2 -2
View File
@@ -22,7 +22,7 @@ pub enum Effect {
Slow,
Snare,
Stun,
Taunt,
Intercept,
Vulnerable,
Silence,
Wither, // Reduce green dmg (healing) taken
@@ -170,7 +170,7 @@ impl Effect {
Effect::Vulnerable => Some(Colour::Red),
Effect::Snare => Some(Colour::Red),
Effect::Clutch => Some(Colour::Green),
Effect::Taunt => Some(Colour::Green),
Effect::Intercept => Some(Colour::Green),
// magic
Effect::Hex => Some(Colour::Blue),
+5 -5
View File
@@ -389,7 +389,7 @@ impl Game {
.find(|t| t.constructs.iter().any(|c| c.id == target_construct_id))
.unwrap();
if let Some(t) = target_player.taunting() {
if let Some(t) = target_player.intercepting() {
return vec![t.id];
}
@@ -1271,7 +1271,7 @@ mod tests {
}
#[test]
fn taunt_test() {
fn intercept_test() {
let mut game = create_2v2_test_game();
let i_player = game.players[0].clone();
@@ -1282,15 +1282,15 @@ mod tests {
let x_construct = x_player.constructs[0].clone();
let y_construct = x_player.constructs[1].clone();
game.construct_by_id(x_construct.id).unwrap().learn_mut(Skill::TauntI);
game.construct_by_id(x_construct.id).unwrap().learn_mut(Skill::InterceptI);
while game.construct_by_id(x_construct.id).unwrap().skill_on_cd(Skill::TauntI).is_some() {
while game.construct_by_id(x_construct.id).unwrap().skill_on_cd(Skill::InterceptI).is_some() {
game.construct_by_id(x_construct.id).unwrap().reduce_cooldowns();
}
game.add_skill(i_player.id, i_construct.id, Some(x_construct.id), Skill::Attack).unwrap();
game.add_skill(i_player.id, j_construct.id, Some(x_construct.id), Skill::Attack).unwrap();
game.add_skill(x_player.id, x_construct.id, Some(i_construct.id), Skill::TauntI).unwrap();
game.add_skill(x_player.id, x_construct.id, Some(i_construct.id), Skill::InterceptI).unwrap();
game.add_skill(x_player.id, y_construct.id, Some(i_construct.id), Skill::Attack).unwrap();
game.player_ready(i_player.id).unwrap();
+18 -18
View File
@@ -169,9 +169,9 @@ pub enum Item {
SiphonI,
SiphonII,
SiphonIII,
TauntI,
TauntII,
TauntIII,
InterceptI,
InterceptII,
InterceptIII,
ThrowI,
ThrowII,
ThrowIII,
@@ -381,9 +381,9 @@ impl Item {
Item::ClutchI => Some(Skill::ClutchI),
Item::ClutchII => Some(Skill::ClutchII),
Item::ClutchIII => Some(Skill::ClutchIII),
Item::TauntI => Some(Skill::TauntI),
Item::TauntII => Some(Skill::TauntII),
Item::TauntIII => Some(Skill::TauntIII),
Item::InterceptI => Some(Skill::InterceptI),
Item::InterceptII => Some(Skill::InterceptII),
Item::InterceptIII => Some(Skill::InterceptIII),
Item::ThrowI => Some(Skill::ThrowI),
Item::ThrowII => Some(Skill::ThrowII),
Item::ThrowIII => Some(Skill::ThrowIII),
@@ -761,9 +761,9 @@ impl Item {
self.into_skill().unwrap().effect()[0].get_skill().unwrap().multiplier(),
self.into_skill().unwrap().effect()[0].get_duration()),
Item::TauntI |
Item::TauntII |
Item::TauntIII => format!("Taunt redirects skills against the team to target, lasts {:?}T.\
Item::InterceptI |
Item::InterceptII |
Item::InterceptIII => format!("Intercept redirects skills against the team to target, lasts {:?}T.\
Recharges RedLife for {:?} RedPower.",
self.into_skill().unwrap().effect()[0].get_duration(),
self.into_skill().unwrap().multiplier()),
@@ -787,9 +787,9 @@ impl Item {
fn combo(&self) -> Vec<Item> {
match self {
Item::TauntI => vec![Item::Buff, Item::Red, Item::Red],
Item::TauntII => vec![Item::TauntI, Item::TauntI, Item::TauntI],
Item::TauntIII => vec![Item::TauntII, Item::TauntII, Item::TauntII],
Item::InterceptI => vec![Item::Buff, Item::Red, Item::Red],
Item::InterceptII => vec![Item::InterceptI, Item::InterceptI, Item::InterceptI],
Item::InterceptIII => vec![Item::InterceptII, Item::InterceptII, Item::InterceptII],
Item::TriageI => vec![Item::Buff, Item::Green, Item::Green],
Item::TriageII => vec![Item::TriageI, Item::TriageI, Item::TriageI],
Item::TriageIII => vec![Item::TriageII, Item::TriageII, Item::TriageII],
@@ -1040,9 +1040,9 @@ impl From<Skill> for Item {
Skill::StrikeII => Item::StrikeII,
Skill::StrikeIII => Item::StrikeIII,
Skill::Stun => Item::Stun,
Skill::TauntI => Item::TauntI,
Skill::TauntII => Item::TauntII,
Skill::TauntIII => Item::TauntIII,
Skill::InterceptI => Item::InterceptI,
Skill::InterceptII => Item::InterceptII,
Skill::InterceptIII => Item::InterceptIII,
Skill::ThrowI => Item::ThrowI,
Skill::ThrowII => Item::ThrowII,
Skill::ThrowIII => Item::ThrowIII,
@@ -1157,9 +1157,9 @@ pub struct Combo {
pub fn get_combos() -> Vec<Combo> {
let mut combinations = vec![
Combo { components: Item::TauntI.combo(), item: Item::TauntI },
Combo { components: Item::TauntII.combo(), item: Item::TauntII },
Combo { components: Item::TauntIII.combo(), item: Item::TauntIII },
Combo { components: Item::InterceptI.combo(), item: Item::InterceptI },
Combo { components: Item::InterceptII.combo(), item: Item::InterceptII },
Combo { components: Item::InterceptIII.combo(), item: Item::InterceptIII },
Combo { components: Item::TriageI.combo(), item: Item::TriageI },
Combo { components: Item::TriageII.combo(), item: Item::TriageII },
+2 -2
View File
@@ -281,9 +281,9 @@ impl Player {
return required;
}
pub fn taunting(&self) -> Option<&Construct> {
pub fn intercepting(&self) -> Option<&Construct> {
self.constructs.iter()
.find(|c| c.affected(Effect::Taunt))
.find(|c| c.affected(Effect::Intercept))
}
pub fn construct_by_id(&mut self, id: Uuid) -> Option<&mut Construct> {
+18 -18
View File
@@ -243,9 +243,9 @@ pub fn resolve(skill: Skill, source: &mut Construct, target: &mut Construct, mut
Skill::StrikeII |
Skill::StrikeIII => strike(source, target, resolutions, skill),
Skill::TauntI |
Skill::TauntII |
Skill::TauntIII => taunt(source, target, resolutions, skill),
Skill::InterceptI |
Skill::InterceptII |
Skill::InterceptIII => intercept(source, target, resolutions, skill),
Skill::ThrowI |
Skill::ThrowII |
@@ -618,9 +618,9 @@ pub enum Skill {
StrikeII,
StrikeIII,
TauntI,
TauntII,
TauntIII,
InterceptI,
InterceptII,
InterceptIII,
ThrowI, // no damage stun, adds vulnerable
ThrowII,
@@ -714,9 +714,9 @@ impl Skill {
Skill::ScatterI => 140,
Skill::ScatterII => 200,
Skill::ScatterIII => 300,
Skill::TauntI => 80,
Skill::TauntII => 110,
Skill::TauntIII => 150,
Skill::InterceptI => 80,
Skill::InterceptII => 110,
Skill::InterceptIII => 150,
Skill::TriageTickI => 75,
Skill::TriageTickII => 110,
Skill::TriageTickIII => 140,
@@ -869,9 +869,9 @@ impl Skill {
meta: Some(EffectMeta::Skill(Skill::BashIII)), tick: None}],
Skill::Stun => vec![ConstructEffect {effect: Effect::Stun, duration: 2, meta: None, tick: None}],
Skill::TauntI => vec![ConstructEffect {effect: Effect::Taunt, duration: 2, meta: None, tick: None}],
Skill::TauntII => vec![ConstructEffect {effect: Effect::Taunt, duration: 3, meta: None, tick: None}],
Skill::TauntIII => vec![ConstructEffect {effect: Effect::Taunt, duration: 4, meta: None, tick: None}],
Skill::InterceptI => vec![ConstructEffect {effect: Effect::Intercept, duration: 2, meta: None, tick: None}],
Skill::InterceptII => vec![ConstructEffect {effect: Effect::Intercept, duration: 3, meta: None, tick: None}],
Skill::InterceptIII => vec![ConstructEffect {effect: Effect::Intercept, duration: 4, meta: None, tick: None}],
Skill::TriageI => vec![ConstructEffect {effect: Effect::Triage, duration: 2,
meta: Some(EffectMeta::Skill(Skill::TriageTickI)), tick: None}],
@@ -1001,9 +1001,9 @@ impl Skill {
Skill::ClutchII => Some(2),
Skill::ClutchIII => Some(3),
Skill::TauntI => Some(2),
Skill::TauntII => Some(2),
Skill::TauntIII => Some(2),
Skill::InterceptI => Some(2),
Skill::InterceptII => Some(2),
Skill::InterceptIII => Some(2),
Skill::ElectrifyI =>Some(1),
Skill::ElectrifyII =>Some(1),
@@ -1287,12 +1287,12 @@ fn clutch(source: &mut Construct, target: &mut Construct, mut results: Resolutio
return results;
}
fn taunt(source: &mut Construct, target: &mut Construct, mut results: Resolutions, skill: Skill) -> Resolutions {
fn intercept(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.recharge(skill, red_amount, 0)));
let taunt = skill.effect()[0];
results.push(Resolution::new(source, target).event(target.add_effect(skill, taunt)).stages(LogStages::PostOnly));
let intercept = skill.effect()[0];
results.push(Resolution::new(source, target).event(target.add_effect(skill, intercept)).stages(LogStages::PostOnly));
return results;
}