diff --git a/client/assets/styles/game.less b/client/assets/styles/game.less index 4e818dc0..b17b2d80 100644 --- a/client/assets/styles/game.less +++ b/client/assets/styles/game.less @@ -74,7 +74,6 @@ grid-template-areas: "skills " "effects"; - width: 100%; } .right { @@ -198,12 +197,12 @@ } .combat-anim { - max-width: 100%; + display: flex; + flex-flow: column; } .combat-anim svg { - height: 100%; - width: 100%; + flex: 1 } .game-construct.red-damage { diff --git a/client/src/animations.socket.jsx b/client/src/animations.socket.jsx index edd822c6..16decdef 100644 --- a/client/src/animations.socket.jsx +++ b/client/src/animations.socket.jsx @@ -53,6 +53,7 @@ function createSocket(store) { timeout - TIMES.POST_SKILL_DURATION_MS ); } + return false; return setTimeout(() => { store.dispatch(actions.setAnimSource(null)); store.dispatch(actions.setAnimTarget(null)); diff --git a/server/src/game.rs b/server/src/game.rs index 97354d86..ed2ab7e6 100644 --- a/server/src/game.rs +++ b/server/src/game.rs @@ -1221,55 +1221,55 @@ mod tests { assert!(game.construct_by_id(y_construct.id).unwrap().affected(Effect::Electrocute)); } - #[test] - fn link_test() { - let mut game = create_test_game(); + // #[test] + // fn link_test() { + // let mut game = create_test_game(); - let x_player = game.players[0].clone(); - let y_player = game.players[1].clone(); + // let x_player = game.players[0].clone(); + // let y_player = game.players[1].clone(); - let x_construct = x_player.constructs[0].clone(); - let y_construct = y_player.constructs[0].clone(); + // 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::Link); + // game.construct_by_id(x_construct.id).unwrap().learn_mut(Skill::Link); - while game.construct_by_id(x_construct.id).unwrap().skill_on_cd(Skill::Link).is_some() { - game.construct_by_id(x_construct.id).unwrap().reduce_cooldowns(); - } + // while game.construct_by_id(x_construct.id).unwrap().skill_on_cd(Skill::Link).is_some() { + // game.construct_by_id(x_construct.id).unwrap().reduce_cooldowns(); + // } - // apply buff - game.add_skill(x_player.id, x_construct.id, y_construct.id, Skill::Link).unwrap(); - game.player_ready(x_player.id).unwrap(); - game.player_ready(y_player.id).unwrap(); - game = game.resolve_phase_start(); - assert!(game.construct_by_id(x_construct.id).unwrap().affected(Effect::Link)); + // // apply buff + // game.add_skill(x_player.id, x_construct.id, y_construct.id, Skill::Link).unwrap(); + // game.player_ready(x_player.id).unwrap(); + // game.player_ready(y_player.id).unwrap(); + // game = game.resolve_phase_start(); + // assert!(game.construct_by_id(x_construct.id).unwrap().affected(Effect::Link)); - let Resolution { source: _, target: _, event, stages: _ } = game.resolved.pop().unwrap(); - match event { - Event::Effect { effect, skill: _, duration: _, construct_effects: _ } => assert_eq!(effect, Effect::Link), - _ => panic!("not siphon"), - }; + // let Resolution { source: _, target: _, event, stages: _ } = game.resolved.pop().unwrap(); + // match event { + // Event::Effect { effect, skill: _, duration: _, construct_effects: _ } => assert_eq!(effect, Effect::Link), + // _ => panic!("not siphon"), + // }; - let Resolution { source: _, target: _, event, stages: _ } = game.resolved.pop().unwrap(); - match event { - Event::Recharge { red: _, blue: _, skill: _ } => (), - _ => panic!("link result was not recharge"), - } + // let Resolution { source: _, target: _, event, stages: _ } = game.resolved.pop().unwrap(); + // match event { + // Event::Recharge { red: _, blue: _, skill: _ } => (), + // _ => panic!("link result was not recharge"), + // } - // attack and receive link hit - game.add_skill(y_player.id, y_construct.id, x_construct.id, Skill::Attack).unwrap(); - game.player_ready(x_player.id).unwrap(); - game.player_ready(y_player.id).unwrap(); - game = game.resolve_phase_start(); + // // attack and receive link hit + // game.add_skill(y_player.id, y_construct.id, x_construct.id, Skill::Attack).unwrap(); + // game.player_ready(x_player.id).unwrap(); + // game.player_ready(y_player.id).unwrap(); + // game = game.resolve_phase_start(); - let Resolution { source: _, target, event, stages: _ } = game.resolved.pop().unwrap(); - assert_eq!(target.id, y_construct.id); - match event { - Event::Damage { amount, skill: _, mitigation: _, colour: _} => - assert_eq!(amount, x_construct.red_power().pct(Skill::Attack.multiplier()) >> 1), - _ => panic!("not damage link"), - }; - } + // let Resolution { source: _, target, event, stages: _ } = game.resolved.pop().unwrap(); + // assert_eq!(target.id, y_construct.id); + // match event { + // Event::Damage { amount, skill: _, mitigation: _, colour: _} => + // assert_eq!(amount, x_construct.red_power().pct(Skill::Attack.multiplier()) >> 1), + // _ => panic!("not damage link"), + // }; + // } // #[test] // fn absorb_test() { diff --git a/server/src/img.rs b/server/src/img.rs index 3fc746b3..d4c92bad 100644 --- a/server/src/img.rs +++ b/server/src/img.rs @@ -273,12 +273,12 @@ mod tests { // hieroglyph(); // } - #[test] - fn shapes_img_test() { - for i in 0..100 { - shapes_write(Uuid::new_v4()).unwrap(); - } - } + // #[test] + // fn shapes_img_test() { + // for i in 0..100 { + // shapes_write(Uuid::new_v4()).unwrap(); + // } + // } } diff --git a/server/src/skill.rs b/server/src/skill.rs index da57c70f..d0972ca9 100644 --- a/server/src/skill.rs +++ b/server/src/skill.rs @@ -177,10 +177,6 @@ pub fn resolve(skill: Skill, source: &mut Construct, target: &mut Construct, mut Skill::HealPlus | Skill::HealPlusPlus => heal(source, target, resolutions, skill), - Skill::Hex| - Skill::HexPlus | - Skill::HexPlusPlus => hex(source, target, resolutions, skill), - Skill::Absorb| Skill::AbsorbPlus | Skill::AbsorbPlusPlus => absorb(source, target, resolutions, skill), @@ -552,12 +548,6 @@ pub enum Skill { #[serde(rename = "Decay++")] DecayPlusPlus, - Hex, - #[serde(rename = "Hex+")] - HexPlus, - #[serde(rename = "Hex++")] - HexPlusPlus, - Haste, #[serde(rename = "Haste+")] HastePlus, @@ -858,15 +848,15 @@ impl Skill { Skill::Debuff => vec![ConstructEffect {effect: Effect::Slow, duration: 3, meta: Some(EffectMeta::Multiplier(50)), tick: None }], - Skill::Decay => vec![ConstructEffect {effect: Effect::Wither, duration: 3, + Skill::Decay => vec![ConstructEffect {effect: Effect::Wither, duration: 3, meta: Some(EffectMeta::Multiplier(50)), tick: None }, - ConstructEffect {effect: Effect::Decay, duration: 3, + ConstructEffect {effect: Effect::Decay, duration: 3, meta: Some(EffectMeta::Skill(Skill::DecayTick)), tick: None}], - Skill::DecayPlus => vec![ConstructEffect {effect: Effect::Wither, duration: 3, + Skill::DecayPlus => vec![ConstructEffect {effect: Effect::Wither, duration: 3, meta: Some(EffectMeta::Multiplier(35)), tick: None }, - ConstructEffect {effect: Effect::Decay, duration: 3, + ConstructEffect {effect: Effect::Decay, duration: 3, meta: Some(EffectMeta::Skill(Skill::DecayTickPlus)), tick: None}], - Skill::DecayPlusPlus => vec![ConstructEffect {effect: Effect::Wither, duration: 4, + Skill::DecayPlusPlus => vec![ConstructEffect {effect: Effect::Wither, duration: 4, meta: Some(EffectMeta::Multiplier(20)), tick: None }, ConstructEffect {effect: Effect::Decay, duration: 4, meta: Some(EffectMeta::Skill(Skill::DecayTickPlusPlus)), tick: None}], @@ -878,10 +868,6 @@ impl Skill { Skill::HastePlusPlus => vec![ConstructEffect {effect: Effect::Haste, duration: 4, meta: Some(EffectMeta::Multiplier(225)), tick: None }], - Skill::Hex => vec![ConstructEffect {effect: Effect::Hex, duration: 2, meta: None, tick: None}], - Skill::HexPlus => vec![ConstructEffect {effect: Effect::Hex, duration: 3, meta: None, tick: None}], - Skill::HexPlusPlus => vec![ConstructEffect {effect: Effect::Hex, duration: 4, meta: None, tick: None}], - Skill::Absorb => vec![ConstructEffect {effect: Effect::Absorb, duration: 2, meta: Some(EffectMeta::Skill(Skill::Absorption)), tick: None}], Skill::AbsorbPlus => vec![ConstructEffect {effect: Effect::Absorb, duration: 3, @@ -916,13 +902,13 @@ impl Skill { Skill::ReflectPlusPlus => vec![ConstructEffect {effect: Effect::Reflect, duration: 1, meta: None, tick: None }], Skill::Break => vec![ConstructEffect {effect: Effect::Stun, duration: 1, meta: None, tick: None}, - ConstructEffect {effect: Effect::Vulnerable, duration: 3, + ConstructEffect {effect: Effect::Vulnerable, duration: 3, meta: Some(EffectMeta::Multiplier(150)), tick: None}], Skill::BreakPlus => vec![ConstructEffect {effect: Effect::Stun, duration: 1, meta: None, tick: None}, - ConstructEffect {effect: Effect::Vulnerable, duration: 4, + ConstructEffect {effect: Effect::Vulnerable, duration: 4, meta: Some(EffectMeta::Multiplier(200)), tick: None}], Skill::BreakPlusPlus => vec![ConstructEffect {effect: Effect::Stun, duration: 2, meta: None, tick: None}, - ConstructEffect {effect: Effect::Vulnerable, duration: 4, + ConstructEffect {effect: Effect::Vulnerable, duration: 4, meta: Some(EffectMeta::Multiplier(250)), tick: None}], Skill::Ruin => vec![ConstructEffect {effect: Effect::Stun, duration: 1, meta: None, tick: None}], @@ -1064,10 +1050,6 @@ impl Skill { Skill::BanishPlus => Some(1), Skill::BanishPlusPlus => Some(1), - Skill::Hex=> Some(1), - Skill::HexPlus => Some(2), - Skill::HexPlusPlus => Some(2), - Skill::Haste=> Some(2), Skill::HastePlus => Some(2), Skill::HastePlusPlus => Some(2), @@ -1585,12 +1567,6 @@ fn ruin(source: &mut Construct, target: &mut Construct, mut results: Resolutions return results;; } - -fn hex(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]))); - return results;; -} - 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]))); return results;; @@ -1683,7 +1659,7 @@ fn link(source: &mut Construct, target: &mut Construct, mut results: Resolutions source.deal_green_damage(skill, swap) .into_iter() .for_each(|e| results.push(Resolution::new(source, source).event(e).stages(EventStages::PostOnly))); - + results.push(Resolution::new(source, source) .event(source.add_effect(skill, skill.effect()[0])).stages(EventStages::PostOnly)); @@ -1724,6 +1700,7 @@ fn purge(source: &mut Construct, target: &mut Construct, mut results: Resolution .event(Event::Removal { effect: ce.effect, construct_effects: target.effects.clone() })); } + let effect = skill.effect()[0]; results.push(Resolution::new(source, target).event(target.add_effect(skill, effect)).stages(EventStages::PostOnly)); /*let mut turns = 1; @@ -1734,7 +1711,6 @@ fn purge(source: &mut Construct, target: &mut Construct, mut results: Resolution } if turns > 1 { - let mut effect = skill.effect()[0]; effect.duration = effect.duration * turns; }*/ @@ -1845,7 +1821,7 @@ mod tests { sustain(&mut y.clone(), &mut y, vec![], Skill::Sustain); assert!(y.affected(Effect::Sustain)); - let mut results = hex(&mut x, &mut y, vec![], Skill::Hex); + let mut results = blast(&mut x, &mut y, vec![], Skill::Blast); let Resolution { source: _, target: _, event, stages: _ } = results.remove(0); match event { Event::Immunity { skill: _, immunity } => assert!(immunity.contains(&Effect::Sustain)),