compiling"
This commit is contained in:
parent
48a3f75f0c
commit
2876b24cb3
@ -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 {
|
||||
|
||||
@ -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));
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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();
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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,
|
||||
@ -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,
|
||||
@ -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;;
|
||||
@ -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)),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user