can't make it

This commit is contained in:
ntr
2019-02-19 23:14:39 +11:00
7 changed files with 64 additions and 47 deletions
+5 -5
View File
@@ -847,7 +847,7 @@ mod tests {
.learn(Skill::TestTouch)
.learn(Skill::TestBlock)
.learn(Skill::TestParry)
.learn(Skill::TestDrain)
.learn(Skill::TestSiphon)
.learn(Skill::Empower)
.learn(Skill::Stun)
.learn(Skill::Block)
@@ -861,7 +861,7 @@ mod tests {
.learn(Skill::TestTouch)
.learn(Skill::TestBlock)
.learn(Skill::TestParry)
.learn(Skill::TestDrain)
.learn(Skill::TestSiphon)
.learn(Skill::Empower)
.learn(Skill::Stun)
.learn(Skill::Block)
@@ -1081,7 +1081,7 @@ mod tests {
}
#[test]
fn drain_test() {
fn siphon_test() {
let mut game = create_test_game();
let x_team = game.teams[0].clone();
@@ -1090,7 +1090,7 @@ mod tests {
let x_cryp = x_team.cryps[0].clone();
let y_cryp = y_team.cryps[0].clone();
let _x_drain_id = game.add_skill(x_team.id, x_cryp.id, Some(y_cryp.id), Skill::TestDrain).unwrap();
let _x_siphon_id = game.add_skill(x_team.id, x_cryp.id, Some(y_cryp.id), Skill::TestSiphon).unwrap();
let _y_touch_id = game.add_skill(y_team.id, y_cryp.id, Some(x_cryp.id), Skill::TestTouch).unwrap();
game.resolve_phase_start();
@@ -1100,7 +1100,7 @@ mod tests {
game.resolve_phase_start();
assert!(game.resolved.iter().any(|r| r.skill == Skill::DrainTick));
assert!(game.resolved.iter().any(|r| r.skill == Skill::SiphonTick));
}
#[test]
+6 -6
View File
@@ -938,7 +938,7 @@ mod tests {
.learn(Skill::TestTouch)
.learn(Skill::TestBlock)
.learn(Skill::TestParry)
.learn(Skill::TestDrain)
.learn(Skill::TestSiphon)
.learn(Skill::Empower)
.learn(Skill::Block)
.create();
@@ -950,7 +950,7 @@ mod tests {
.learn(Skill::TestTouch)
.learn(Skill::TestBlock)
.learn(Skill::TestParry)
.learn(Skill::TestDrain)
.learn(Skill::TestSiphon)
.learn(Skill::Empower)
.learn(Skill::Block)
.create();
@@ -1194,7 +1194,7 @@ mod tests {
}
#[test]
fn drain_test() {
fn siphon_test() {
let mut game = create_test_game();
let x_team = game.teams[0].clone();
@@ -1203,13 +1203,13 @@ mod tests {
let x_cryp = x_team.cryps[0].clone();
let y_cryp = y_team.cryps[0].clone();
let x_drain_id = game.add_skill(x_team.id, x_cryp.id, Some(y_team.id), Skill::TestDrain).unwrap();
let x_siphon_id = game.add_skill(x_team.id, x_cryp.id, Some(y_team.id), Skill::TestSiphon).unwrap();
let y_touch_id = game.add_skill(y_team.id, y_cryp.id, Some(x_team.id), Skill::TestTouch).unwrap();
game.target_phase_start();
game.add_target(x_team.id, x_cryp.id, y_touch_id).unwrap();
game.add_target(y_team.id, y_cryp.id, x_drain_id).unwrap();
game.add_target(y_team.id, y_cryp.id, x_siphon_id).unwrap();
game.resolve_phase_start();
@@ -1218,7 +1218,7 @@ mod tests {
game.target_phase_start();
assert!(game.resolved.iter().any(|r| r.skill == Skill::DrainTick));
assert!(game.resolved.iter().any(|r| r.skill == Skill::SiphonTick));
}
#[test]
+1 -1
View File
@@ -291,7 +291,7 @@ impl Rpc {
let cryp = cryp_spawn(CrypSpawnParams { name }, tx, &account)?;
cryp_learn(CrypLearnParams { id: cryp.id, skill: Skill::Decay }, tx, &account)?;
cryp_learn(CrypLearnParams { id: cryp.id, skill: Skill::Blast }, tx, &account)?;
cryp_learn(CrypLearnParams { id: cryp.id, skill: Skill::Drain }, tx, &account)?;
cryp_learn(CrypLearnParams { id: cryp.id, skill: Skill::Siphon }, tx, &account)?;
let name: String = iter::repeat(()).map(|()| rng.sample(Alphanumeric)).take(8).collect();
let cryp = cryp_spawn(CrypSpawnParams { name }, tx, &account)?;
+17 -8
View File
@@ -44,10 +44,14 @@ pub enum Var {
Reflect,
Ruin,
Shield,
Silence,
Slay,
Slow,
Snare,
Strangle,
Strike,
Siphon,
Survival,
Taunt,
Throw,
Toxic,
@@ -81,10 +85,15 @@ impl Var {
Var::Purify => Ok(Skill::Purify),
// Var::Reflect => Ok(Skill::Reflect),
Var::Ruin => Ok(Skill::Ruin),
Var::Shield => Ok(Skill::Shield),
Var::Shield => Ok(Skill::Shield),
Var::Silence => Ok(Skill::Silence),
Var::Slay => Ok(Skill::Slay),
Var::Slow => Ok(Skill::Slow),
Var::Snare => Ok(Skill::Snare),
Var::Strangle => Ok(Skill::Strangle),
Var::Shield => Ok(Skill::Shield),
// Var::Strike => Ok(Skill::Strike),
// Var::Survival => Ok(Skill::Survival),
// Var::Taunt => Ok(Skill::Taunt),
Var::Throw => Ok(Skill::Throw),
// Var::Toxic => Ok(Skill::Toxic),
@@ -224,9 +233,9 @@ impl Vbox {
ColourCode::RR => Var::Strike,
ColourCode::GG => Var::Heal,
ColourCode::BB => Var::Blast,
ColourCode::RG => return Err(err_msg("unhandled skill combo")),
ColourCode::RG => Var::Slay, //
ColourCode::GB => return Err(err_msg("unhandled skill combo")),
ColourCode::BR => return Err(err_msg("unhandled skill combo")),
ColourCode::BR => Var::Banish, //
},
Var::Block => match colour_code {
ColourCode::RR => Var::Parry,
@@ -240,8 +249,8 @@ impl Vbox {
ColourCode::RR => Var::Empower,
ColourCode::GG => Var::Triage,
ColourCode::BB => Var::Amplify,
ColourCode::RG => return Err(err_msg("unhandled skill combo")),
ColourCode::GB => Var::Purify,
ColourCode::RG => Var::Survival,
ColourCode::GB => return Err(err_msg("unhandled skill combo")),
ColourCode::BR => Var::Haste,
},
Var::Debuff => match colour_code {
@@ -250,15 +259,15 @@ impl Vbox {
ColourCode::BB => Var::Curse,
ColourCode::RG => return Err(err_msg("unhandled skill combo")),
ColourCode::GB => Var::Siphon,
ColourCode::BR => return Err(err_msg("unhandled skill combo")),
ColourCode::BR => Var::Slow,
},
Var::Stun => match colour_code {
ColourCode::RR => Var::Strangle,
ColourCode::GG => Var::Throw,
ColourCode::BB => Var::Ruin,
ColourCode::RG => return Err(err_msg("unhandled skill combo")),
ColourCode::GB => return Err(err_msg("unhandled skill combo")),
ColourCode::BR => Var::Banish,
ColourCode::GB => Var::Silence,
ColourCode::BR => Var::Hex,
},
_ => panic!("wrong base {:?}", base),
};