corruption t2/t3, chaos is now 0-30% MORE
This commit is contained in:
parent
7d2ad82800
commit
0971c3a2e2
@ -1179,14 +1179,14 @@ mod tests {
|
||||
let x_construct = x_player.constructs[0].clone();
|
||||
let y_construct = y_player.constructs[0].clone();
|
||||
|
||||
game.construct_by_id(x_construct.id).unwrap().learn_mut(Skill::Corrupt);
|
||||
game.construct_by_id(x_construct.id).unwrap().learn_mut(Skill::CorruptI);
|
||||
|
||||
while game.construct_by_id(x_construct.id).unwrap().skill_on_cd(Skill::Corrupt).is_some() {
|
||||
while game.construct_by_id(x_construct.id).unwrap().skill_on_cd(Skill::CorruptI).is_some() {
|
||||
game.construct_by_id(x_construct.id).unwrap().reduce_cooldowns();
|
||||
}
|
||||
|
||||
// apply buff
|
||||
game.add_skill(x_player.id, x_construct.id, None, Skill::Corrupt).unwrap();
|
||||
game.add_skill(x_player.id, x_construct.id, None, Skill::CorruptI).unwrap();
|
||||
game.player_ready(x_player.id).unwrap();
|
||||
game.player_ready(y_player.id).unwrap();
|
||||
game = game.resolve_phase_start();
|
||||
|
||||
@ -61,7 +61,9 @@ pub enum Item {
|
||||
ClutchI,
|
||||
ClutchII,
|
||||
ClutchIII,
|
||||
Corrupt,
|
||||
CorruptI,
|
||||
CorruptII,
|
||||
CorruptIII,
|
||||
CurseI,
|
||||
CurseII,
|
||||
CurseIII,
|
||||
@ -320,7 +322,9 @@ impl Item {
|
||||
Item::ThrowI => Some(Skill::ThrowI),
|
||||
Item::ThrowII => Some(Skill::ThrowII),
|
||||
Item::ThrowIII => Some(Skill::ThrowIII),
|
||||
Item::Corrupt => Some(Skill::Corrupt),
|
||||
Item::CorruptI => Some(Skill::CorruptI),
|
||||
Item::CorruptII => Some(Skill::CorruptII),
|
||||
Item::CorruptIII => Some(Skill::CorruptIII),
|
||||
Item::TriageI => Some(Skill::TriageI),
|
||||
Item::TriageII => Some(Skill::TriageII),
|
||||
Item::TriageIII => Some(Skill::TriageIII),
|
||||
@ -442,18 +446,20 @@ impl Item {
|
||||
Item::ChaosI |
|
||||
Item::ChaosII |
|
||||
Item::ChaosIII => format!(
|
||||
"Hits twice for red and blue damage. Damage is random 0 to 30% + {:?}% red and blue power.",
|
||||
"Hits twice for red and blue damage. Damage {:?}% red and blue power. Randomly deals 0 to 30% more damage",
|
||||
self.into_skill().unwrap().multiplier()),
|
||||
|
||||
Item::ClutchI |
|
||||
Item::ClutchII |
|
||||
Item::ClutchIII => format!("Construct cannot be KO'd while active. Additionally provides immunity to disables."),
|
||||
|
||||
Item::Corrupt => format!(
|
||||
Item::CorruptI |
|
||||
Item::CorruptII |
|
||||
Item::CorruptIII => format!(
|
||||
"Self targetting defensive for {:?}T. Applies corrupt to attackers dealing BlueDamage {:?}% \
|
||||
BluePower per turn for {:?}T.",
|
||||
self.into_skill().unwrap().effect().first().unwrap().get_duration(),
|
||||
Skill::Corrupt.multiplier(),
|
||||
Skill::CorruptI.multiplier(), // TO BE FIXT
|
||||
self.into_skill().unwrap().effect().last().unwrap().get_duration()),
|
||||
|
||||
Item::CurseI |
|
||||
@ -535,7 +541,7 @@ impl Item {
|
||||
Item::RechargeI |
|
||||
Item::RechargeII |
|
||||
Item::RechargeIII => format!(
|
||||
"Recharge red and blue shield based on {:?} red and blue power",
|
||||
"Recharge Red and Blue Life based on {:?} RedPower and BluePower",
|
||||
self.into_skill().unwrap().multiplier()),
|
||||
|
||||
Item::RuinI |
|
||||
@ -558,12 +564,6 @@ impl Item {
|
||||
self.into_skill().unwrap().multiplier(),
|
||||
"Deals 45% more Damage per blue skill on target"),
|
||||
|
||||
Item::RechargeI |
|
||||
Item::RechargeII |
|
||||
Item::RechargeIII => format!(
|
||||
"Recharge Red and Blue Life based on {:?} RedPower and BluePower",
|
||||
self.into_skill().unwrap().multiplier()),
|
||||
|
||||
Item::SlayI |
|
||||
Item::SlayII |
|
||||
Item::SlayIII => format!(
|
||||
@ -675,7 +675,9 @@ impl Item {
|
||||
Item::PurifyI => vec![Item::Block, Item::Green, Item::Green],
|
||||
Item::PurifyII => vec![Item::PurifyI, Item::PurifyI, Item::PurifyI],
|
||||
Item::PurifyIII => vec![Item::PurifyII, Item::PurifyII, Item::PurifyII],
|
||||
Item::Corrupt => vec![Item::Block, Item::Blue, Item::Blue],
|
||||
Item::CorruptI => vec![Item::Block, Item::Blue, Item::Blue],
|
||||
Item::CorruptII => vec![Item::CorruptI, Item::CorruptI, Item::CorruptI],
|
||||
Item::CorruptIII => vec![Item::CorruptII, Item::CorruptII, Item::CorruptII],
|
||||
Item::ClutchI => vec![Item::Block, Item::Red, Item::Green],
|
||||
Item::ClutchII => vec![Item::ClutchI, Item::ClutchI, Item::ClutchI],
|
||||
Item::ClutchIII => vec![Item::ClutchII, Item::ClutchII, Item::ClutchII],
|
||||
@ -843,9 +845,9 @@ impl From<Skill> for Item {
|
||||
Skill::TriageI => Item::TriageI,
|
||||
Skill::TriageII => Item::TriageII,
|
||||
Skill::TriageIII => Item::TriageIII,
|
||||
Skill::Corrupt => Item::Corrupt,
|
||||
|
||||
Skill::CorruptionTick => Item::Corrupt,
|
||||
Skill::CorruptI => Item::CorruptI,
|
||||
Skill::CorruptII => Item::CorruptII,
|
||||
Skill::CorruptIII => Item::CorruptIII,
|
||||
|
||||
Skill::TestTouch => Item::TestTouch,
|
||||
Skill::TestStun => Item::TestStun,
|
||||
@ -910,6 +912,8 @@ pub fn get_combos() -> Vec<Combo> {
|
||||
Combo { components: Item::ScatterIII.combo(), item: Item::ScatterIII },
|
||||
|
||||
Combo { components: Item::Haste.combo(), item: Item::Haste },
|
||||
Combo { components: Item::Hostility.combo(), item: Item::Hostility },
|
||||
|
||||
Combo { components: Item::Impurity.combo(), item: Item::Impurity },
|
||||
|
||||
Combo { components: Item::AmplifyI.combo(), item: Item::AmplifyI },
|
||||
@ -945,7 +949,9 @@ pub fn get_combos() -> Vec<Combo> {
|
||||
Combo { components: Item::PurifyII.combo(), item: Item::PurifyII },
|
||||
Combo { components: Item::PurifyIII.combo(), item: Item::PurifyIII },
|
||||
|
||||
Combo { components: Item::Corrupt.combo(), item: Item::Corrupt },
|
||||
Combo { components: Item::CorruptI.combo(), item: Item::CorruptI },
|
||||
Combo { components: Item::CorruptII.combo(), item: Item::CorruptII },
|
||||
Combo { components: Item::CorruptIII.combo(), item: Item::CorruptIII },
|
||||
|
||||
Combo { components: Item::ClutchI.combo(), item: Item::ClutchI },
|
||||
Combo { components: Item::ClutchII.combo(), item: Item::ClutchII },
|
||||
|
||||
@ -21,7 +21,8 @@ pub fn pre_resolve(cast: &Cast, game: &mut Game, mut resolutions: Resolutions) -
|
||||
let targets = game.get_targets(cast.skill, &source, cast.target_construct_id);
|
||||
|
||||
if skill.aoe() { // Send an aoe skill event for anims
|
||||
resolutions.push(Resolution::new(&source, &game.construct_by_id(cast.target_construct_id).unwrap().clone()).event(Event::AoeSkill { skill }));
|
||||
resolutions.push(Resolution::new(&source,
|
||||
&game.construct_by_id(cast.target_construct_id).unwrap().clone()).event(Event::AoeSkill { skill }));
|
||||
}
|
||||
|
||||
for target_id in targets {
|
||||
@ -132,8 +133,12 @@ pub fn resolve(skill: Skill, source: &mut Construct, target: &mut Construct, mut
|
||||
Skill::ClutchII |
|
||||
Skill::ClutchIII => clutch(source, target, resolutions, skill),
|
||||
|
||||
Skill::Corrupt => corrupt(source, target, resolutions, skill),
|
||||
Skill::CorruptionTick => corruption_tick(source, target, resolutions, skill),
|
||||
Skill::CorruptI |
|
||||
Skill::CorruptII |
|
||||
Skill::CorruptIII => corrupt(source, target, resolutions, skill),
|
||||
Skill::CorruptionTickI |
|
||||
Skill::CorruptionTickII |
|
||||
Skill::CorruptionTickIII => corruption_tick(source, target, resolutions, skill),
|
||||
|
||||
Skill::CurseI |
|
||||
Skill::CurseII |
|
||||
@ -249,6 +254,9 @@ pub fn resolve(skill: Skill, source: &mut Construct, target: &mut Construct, mut
|
||||
Skill::Stun => stun(source, target, resolutions, skill),
|
||||
|
||||
//Triggered
|
||||
Skill::CorruptionI |
|
||||
Skill::CorruptionII |
|
||||
Skill::CorruptionIII => panic!("should only trigget from corrupt hit"),
|
||||
Skill::HasteStrike => panic!("should only trigger from haste"),
|
||||
Skill::ImpureBlast => panic!("should only trigger from impurity"),
|
||||
Skill::RiposteI |
|
||||
@ -281,7 +289,14 @@ fn post_resolve(_skill: Skill, game: &mut Game, mut resolutions: Resolutions) ->
|
||||
match event {
|
||||
Event::Damage { amount, skill, mitigation: _, colour: _ } => {
|
||||
if target.affected(Effect::Corrupt) {
|
||||
resolutions = corruption(&mut target, &mut source, resolutions, Skill::Corrupt);
|
||||
let ConstructEffect { effect: _, duration: _, meta, tick: _ } = target.effects.iter()
|
||||
.find(|e| e.effect == Effect::Corrupt).unwrap().clone();
|
||||
match meta {
|
||||
Some(EffectMeta::Skill(s)) => {
|
||||
resolutions = corruption(&mut target, &mut source, resolutions, s);
|
||||
},
|
||||
_ => panic!("no corrupt skill"),
|
||||
};
|
||||
}
|
||||
|
||||
if target.affected(Effect::Hostility) {
|
||||
@ -297,14 +312,15 @@ fn post_resolve(_skill: Skill, game: &mut Game, mut resolutions: Resolutions) ->
|
||||
|
||||
Event::Immunity { skill: _, immunity } => match immunity.contains(&Effect::Parry) {
|
||||
true => {
|
||||
let im_targ = target.clone();
|
||||
let ConstructEffect { effect: _, duration: _, meta, tick: _ } = im_targ.effects.iter()
|
||||
.find(|e| e.effect == Effect::Parry).unwrap();
|
||||
let &riposte_skill = match meta {
|
||||
Some(EffectMeta::Skill(s)) => s,
|
||||
let ConstructEffect { effect: _, duration: _, meta, tick: _ } = target.effects.iter()
|
||||
.find(|e| e.effect == Effect::Parry).unwrap().clone();
|
||||
match meta {
|
||||
Some(EffectMeta::Skill(s)) => {
|
||||
resolutions = riposte(&mut target, &mut source, resolutions, s);
|
||||
},
|
||||
_ => panic!("no parry skill"),
|
||||
};
|
||||
resolutions = riposte(&mut target, &mut source, resolutions, riposte_skill);
|
||||
|
||||
},
|
||||
false => (),
|
||||
},
|
||||
@ -679,8 +695,15 @@ pub enum Skill {
|
||||
ClutchII,
|
||||
ClutchIII,
|
||||
|
||||
Corrupt,
|
||||
CorruptionTick,
|
||||
CorruptI,
|
||||
CorruptII,
|
||||
CorruptIII,
|
||||
CorruptionI,
|
||||
CorruptionII,
|
||||
CorruptionIII,
|
||||
CorruptionTickI,
|
||||
CorruptionTickII,
|
||||
CorruptionTickIII,
|
||||
|
||||
CurseI,
|
||||
CurseII,
|
||||
@ -834,7 +857,10 @@ impl Skill {
|
||||
Skill::StrikeIII => 140,
|
||||
|
||||
// Block Base
|
||||
Skill::CorruptionTick => 80,
|
||||
Skill::CorruptionTickI => 80,
|
||||
Skill::CorruptionTickII => 100,
|
||||
Skill::CorruptionTickIII => 130,
|
||||
|
||||
Skill::ParryI => 110,
|
||||
Skill::ParryII => 145,
|
||||
Skill::ParryIII => 200,
|
||||
@ -908,8 +934,18 @@ impl Skill {
|
||||
Skill::Buff => vec![ConstructEffect {effect: Effect::Buff, duration: 2,
|
||||
meta: Some(EffectMeta::Multiplier(125)), tick: None }],
|
||||
|
||||
Skill::Corrupt => vec![ConstructEffect {effect: Effect::Corrupt, duration: 2, meta: None, tick: None},
|
||||
ConstructEffect {effect: Effect::Corruption, duration: 3, meta: None, tick: None}],
|
||||
Skill::CorruptI => vec![ConstructEffect {effect: Effect::Corrupt, duration: 2,
|
||||
meta: Some(EffectMeta::Skill(Skill::CorruptionI)), tick: None}],
|
||||
Skill::CorruptII => vec![ConstructEffect {effect: Effect::Corrupt, duration: 3,
|
||||
meta: Some(EffectMeta::Skill(Skill::CorruptionII)), tick: None}],
|
||||
Skill::CorruptIII => vec![ConstructEffect {effect: Effect::Corrupt, duration: 4,
|
||||
meta: Some(EffectMeta::Skill(Skill::CorruptionIII)), tick: None}],
|
||||
Skill::CorruptionI => vec![ConstructEffect {effect: Effect::Corruption, duration: 3,
|
||||
meta: Some(EffectMeta::Skill(Skill::CorruptionTickI)), tick: None}],
|
||||
Skill::CorruptionII => vec![ConstructEffect {effect: Effect::Corruption, duration: 4,
|
||||
meta: Some(EffectMeta::Skill(Skill::CorruptionTickII)), tick: None}],
|
||||
Skill::CorruptionIII => vec![ConstructEffect {effect: Effect::Corruption, duration: 5,
|
||||
meta: Some(EffectMeta::Skill(Skill::CorruptionTickIII)), tick: None}],
|
||||
|
||||
Skill::ClutchI => vec![ConstructEffect {effect: Effect::Clutch, duration: 1, meta: None, tick: None }],
|
||||
Skill::ClutchII => vec![ConstructEffect {effect: Effect::Clutch, duration: 2, meta: None, tick: None }],
|
||||
@ -1139,7 +1175,10 @@ impl Skill {
|
||||
Skill::TauntIII => Some(2),
|
||||
Skill::Injure => Some(2),
|
||||
|
||||
Skill::Corrupt => Some(1),
|
||||
Skill::CorruptI =>Some(1),
|
||||
Skill::CorruptII =>Some(1),
|
||||
Skill::CorruptIII =>Some(1),
|
||||
|
||||
|
||||
Skill::Hostility => Some(1),
|
||||
|
||||
@ -1152,8 +1191,13 @@ impl Skill {
|
||||
Skill::RiposteI |
|
||||
Skill::RiposteII |
|
||||
Skill::RiposteIII | // parry
|
||||
Skill::CorruptionI |
|
||||
Skill::CorruptionII |
|
||||
Skill::CorruptionIII |
|
||||
// Ticks
|
||||
Skill::CorruptionTick |
|
||||
Skill::CorruptionTickI |
|
||||
Skill::CorruptionTickII |
|
||||
Skill::CorruptionTickIII |
|
||||
Skill::DecayTickI |
|
||||
Skill::DecayTickII |
|
||||
Skill::DecayTickIII |
|
||||
@ -1182,7 +1226,9 @@ impl Skill {
|
||||
|
||||
pub fn ko_castable(&self) -> bool {
|
||||
match self {
|
||||
Skill::CorruptionTick |
|
||||
Skill::CorruptionTickI |
|
||||
Skill::CorruptionTickII |
|
||||
Skill::CorruptionTickIII |
|
||||
Skill::DecayTickI |
|
||||
Skill::DecayTickII |
|
||||
Skill::DecayTickIII |
|
||||
@ -1199,7 +1245,9 @@ impl Skill {
|
||||
|
||||
pub fn is_tick(&self) -> bool {
|
||||
match self {
|
||||
Skill::CorruptionTick |
|
||||
Skill::CorruptionTickI |
|
||||
Skill::CorruptionTickII |
|
||||
Skill::CorruptionTickIII |
|
||||
Skill::DecayTickI |
|
||||
Skill::DecayTickII |
|
||||
Skill::DecayTickIII |
|
||||
@ -1247,7 +1295,9 @@ impl Skill {
|
||||
Skill::StrangleTickI |
|
||||
Skill::StrangleTickII |
|
||||
Skill::StrangleTickIII => Skill::StrangleI.speed(),
|
||||
Skill::CorruptionTick => Skill::Corrupt.speed(),
|
||||
Skill::CorruptionTickI |
|
||||
Skill::CorruptionTickII |
|
||||
Skill::CorruptionTickIII => Skill::CorruptI.speed(),
|
||||
|
||||
_ => Item::from(*self).speed(),
|
||||
}
|
||||
@ -1265,7 +1315,9 @@ impl Skill {
|
||||
pub fn self_targeting(&self) -> bool {
|
||||
match self {
|
||||
Skill::Block |
|
||||
Skill::Corrupt |
|
||||
Skill::CorruptI |
|
||||
Skill::CorruptII |
|
||||
Skill::CorruptIII |
|
||||
Skill::ClutchI |
|
||||
Skill::ClutchII |
|
||||
Skill::ClutchIII |
|
||||
@ -1290,7 +1342,9 @@ impl Skill {
|
||||
Skill::ClutchI |
|
||||
Skill::ClutchII |
|
||||
Skill::ClutchIII |
|
||||
Skill::Corrupt |
|
||||
Skill::CorruptI |
|
||||
Skill::CorruptII |
|
||||
Skill::CorruptIII |
|
||||
Skill::Haste |
|
||||
Skill::HealI |
|
||||
Skill::HealII |
|
||||
@ -1563,13 +1617,13 @@ fn triage_tick(source: &mut Construct, target: &mut Construct, mut results: Reso
|
||||
|
||||
fn chaos(source: &mut Construct, target: &mut Construct, mut results: Resolutions, skill: Skill) -> Resolutions {
|
||||
let mut rng = thread_rng();
|
||||
let b_rng: u64 = rng.gen_range(0, 30);
|
||||
let amount = source.blue_power().pct(skill.multiplier() + b_rng);
|
||||
let b_rng: u64 = rng.gen_range(100, 130);
|
||||
let amount = source.blue_power().pct(skill.multiplier()).pct(b_rng);
|
||||
target.deal_blue_damage(skill, amount)
|
||||
.into_iter()
|
||||
.for_each(|e| results.push(Resolution::new(source, target).event(e)));
|
||||
let r_rng: u64 = rng.gen_range(0, 30);
|
||||
let amount = source.red_power().pct(skill.multiplier() + r_rng);
|
||||
let r_rng: u64 = rng.gen_range(100, 130);
|
||||
let amount = source.red_power().pct(skill.multiplier()).pct(r_rng);
|
||||
target.deal_red_damage(skill, amount)
|
||||
.into_iter()
|
||||
.for_each(|e| results.push(Resolution::new(source, target).event(e)));
|
||||
@ -1635,11 +1689,15 @@ fn corrupt(source: &mut Construct, target: &mut Construct, mut results: Resoluti
|
||||
}
|
||||
|
||||
fn corruption(source: &mut Construct, target: &mut Construct, mut results: Resolutions, skill: Skill) -> Resolutions {
|
||||
let corruption = skill.effect().last().unwrap().clone()
|
||||
.set_tick(Cast::new_tick(source, target, Skill::CorruptionTick));
|
||||
|
||||
let ConstructEffect { effect, duration, meta, tick: _ } = skill.effect().first().unwrap().clone();
|
||||
let tick_skill = match meta {
|
||||
Some(EffectMeta::Skill(s)) => s,
|
||||
_ => panic!("no corruption tick skill"),
|
||||
};
|
||||
let corruption = ConstructEffect::new(effect, duration).set_tick(Cast::new_tick(source, target, tick_skill));
|
||||
results.push(Resolution::new(source, target).event(target.add_effect(skill, corruption)));
|
||||
return corruption_tick(source, target, results, Skill::CorruptionTick);
|
||||
return corruption_tick(source, target, results, tick_skill);
|
||||
}
|
||||
|
||||
fn corruption_tick(source: &mut Construct, target: &mut Construct, mut results: Resolutions, skill: Skill) -> Resolutions {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user