Merge branch 'master' into return-of-react

This commit is contained in:
ntr 2019-03-30 17:52:40 +11:00
commit 0af3ea9d40
9 changed files with 28 additions and 14 deletions

View File

@ -153,10 +153,12 @@ class CombatCryps extends Phaser.Scene {
this.drawCryps(game); this.drawCryps(game);
this.registry.events.on('changedata', this.updateData, this); this.registry.events.on('changedata', this.updateData, this);
this.registry.set('crypStatusUpdate', false); this.registry.set('crypStatusUpdate', false);
this.teams = game.teams.length;
} }
updateData(parent, key, data) { updateData(parent, key, data) {
if (key === 'game' && data) { if (key === 'game' && data) {
if (data.teams.length !== this.teams) this.scene.restart(data);
const isAnimating = this.phase === 'animating'; const isAnimating = this.phase === 'animating';
this.game = data; this.game = data;
if (isAnimating) return false; if (isAnimating) return false;

View File

@ -72,10 +72,9 @@ class CombatHitBox extends Phaser.Scene {
this.game.events.emit('SEND_SKILL', game.id, activeSkill.cryp.id, c.id, activeSkill.skill.skill); this.game.events.emit('SEND_SKILL', game.id, activeSkill.cryp.id, c.id, activeSkill.skill.skill);
} }
}; };
const crypSpawn = group.children.entries.find(s => s.cryp.id === c.id); const crypSpawn = group.children.entries.find(s => s.cryp.id === c.id);
const team = c.account === account.id ? 0 : 1; const team = c.account === account.id ? 0 : 1;
this.add.existing(new CrypHitBox(this, crypSpawn.iter, team, cback)); if (crypSpawn) this.add.existing(new CrypHitBox(this, crypSpawn.iter, team, cback));
}); });
}); });
this.scene.moveBelow('Combat'); this.scene.moveBelow('Combat');

View File

@ -270,7 +270,7 @@ function createSocket(events) {
if (!account) events.loginPrompt(); if (!account) events.loginPrompt();
if (process.env.NODE_ENV !== 'production') { if (process.env.NODE_ENV !== 'production') {
send({ method: 'account_login', params: { name: 'ntr', password: 'grepgrepgrep' } }); // send({ method: 'account_login', params: { name: 'ntr', password: 'grepgrepgrep' } });
} }
return true; return true;

View File

@ -4,7 +4,7 @@
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"split:molecules": "cd molecules; csplit -f mol bulk.sdf /\$\$\$\$/ {*} --suppress-matched -z", "split:molecules": "cd molecules; csplit -f mol bulk.sdf /\\$\\$\\$\\$/ {*} --suppress-matched -z",
"migrate": "knex migrate:latest", "migrate": "knex migrate:latest",
"migrate:make": "knex migrate:make --", "migrate:make": "knex migrate:make --",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"

View File

@ -15,6 +15,12 @@
# WORK WORK # WORK WORK
## NOW ## NOW
fix taunt
decay is op
siphon might have a prob
cryp vbox cryp vbox
update defensives in skill.rs update defensives in skill.rs

View File

@ -392,7 +392,9 @@ impl Game {
} }
fn get_targets(&self, skill: Skill, source: &Cryp, target_cryp_id: Uuid) -> Vec<Uuid> { fn get_targets(&self, skill: Skill, source: &Cryp, target_cryp_id: Uuid) -> Vec<Uuid> {
let target_team = self.teams.iter().find(|t| t.id == source.account).unwrap(); let target_team = self.teams.iter()
.find(|t| t.cryps.iter().any(|c| c.id == target_cryp_id))
.unwrap();
if let Some(t) = target_team.taunting() { if let Some(t) = target_team.taunting() {
return vec![t.id]; return vec![t.id];

View File

@ -289,7 +289,11 @@ impl Effect {
_ => false, _ => false,
}, },
Effect::Strangle => skill != Skill::StrangleTick, Effect::Strangle => skill != Skill::StrangleTick,
Effect::Strangling => true, Effect::Strangling => match skill.category() {
Category::BlueTick => false,
Category::RedTick => false,
_ => true,
},
Effect::Banish => true, Effect::Banish => true,
Effect::Injured => match skill.category() { Effect::Injured => match skill.category() {
Category::Green => true, Category::Green => true,
@ -948,7 +952,7 @@ fn decay(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions) -> Reso
} }
fn decay_tick(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions) -> Resolutions { fn decay_tick(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions) -> Resolutions {
let amount = source.blue_damage(); let amount = source.blue_damage() / 2;
target.deal_blue_damage(Skill::DecayTick, amount) target.deal_blue_damage(Skill::DecayTick, amount)
.into_iter() .into_iter()
.for_each(|e| results.push(Resolution::new(source, target).event(e))); .for_each(|e| results.push(Resolution::new(source, target).event(e)));

View File

@ -162,42 +162,42 @@ impl Spec {
// Upgrades to HP Spec // Upgrades to HP Spec
Spec::Hp => modified + base.pct(5), Spec::Hp => modified + base.pct(5),
Spec::LifeI => modified + { Spec::LifeI => modified + {
let mut mult = 10; let mut mult: u64 = 10;
if team_colours.red >= 5 { mult += 20 }; if team_colours.red >= 5 { mult += 20 };
if team_colours.red >= 10 { mult += 30 }; if team_colours.red >= 10 { mult += 30 };
if team_colours.red >= 20 { mult += 50 }; if team_colours.red >= 20 { mult += 50 };
mult * team_colours.green as u64 mult * team_colours.green as u64
}, },
Spec::RedShieldI => modified + { Spec::RedShieldI => modified + {
let mut mult = 10; let mut mult: u64 = 10;
if team_colours.red >= 5 { mult += 20 }; if team_colours.red >= 5 { mult += 20 };
if team_colours.red >= 10 { mult += 30 }; if team_colours.red >= 10 { mult += 30 };
if team_colours.red >= 20 { mult += 50 }; if team_colours.red >= 20 { mult += 50 };
mult * team_colours.red as u64 mult * team_colours.red as u64
}, },
Spec::BlueShieldI => modified + { Spec::BlueShieldI => modified + {
let mut mult = 10; let mut mult: u64 = 10;
if team_colours.red >= 5 { mult += 20 }; if team_colours.red >= 5 { mult += 20 };
if team_colours.red >= 10 { mult += 30 }; if team_colours.red >= 10 { mult += 30 };
if team_colours.red >= 20 { mult += 50 }; if team_colours.red >= 20 { mult += 50 };
(mult * team_colours.blue) as u64 mult * team_colours.blue as u64
}, },
Spec::LRSI => modified + { Spec::LRSI => modified + {
let mut mult = 5; let mut mult: u64 = 5;
if team_colours.green >= 2 && team_colours.red >= 2 { mult += 5 }; if team_colours.green >= 2 && team_colours.red >= 2 { mult += 5 };
if team_colours.green >= 5 && team_colours.red >= 5 { mult += 10 }; if team_colours.green >= 5 && team_colours.red >= 5 { mult += 10 };
if team_colours.green >= 10 && team_colours.red >= 10 { mult += 20 }; if team_colours.green >= 10 && team_colours.red >= 10 { mult += 20 };
mult * (team_colours.green + team_colours.red) as u64 mult * (team_colours.green + team_colours.red) as u64
}, },
Spec::LBSI => modified + { Spec::LBSI => modified + {
let mut mult = 5; let mut mult: u64 = 5;
if team_colours.green >= 2 && team_colours.red >= 2 { mult += 5 }; if team_colours.green >= 2 && team_colours.red >= 2 { mult += 5 };
if team_colours.green >= 5 && team_colours.red >= 5 { mult += 10 }; if team_colours.green >= 5 && team_colours.red >= 5 { mult += 10 };
if team_colours.green >= 10 && team_colours.red >= 10 { mult += 20 }; if team_colours.green >= 10 && team_colours.red >= 10 { mult += 20 };
mult * (team_colours.green + team_colours.red) as u64 mult * (team_colours.green + team_colours.red) as u64
}, },
Spec::RBSI => modified + { Spec::RBSI => modified + {
let mut mult = 5; let mut mult: u64 = 5;
if team_colours.blue >= 2 && team_colours.red >= 2 { mult += 5 }; if team_colours.blue >= 2 && team_colours.red >= 2 { mult += 5 };
if team_colours.blue >= 5 && team_colours.red >= 5 { mult += 10 }; if team_colours.blue >= 5 && team_colours.red >= 5 { mult += 10 };
if team_colours.blue >= 10 && team_colours.red >= 10 { mult += 20 }; if team_colours.blue >= 10 && team_colours.red >= 10 { mult += 20 };

View File

@ -202,6 +202,7 @@ impl Var {
Var::Silence => Some(Skill::Silence), Var::Silence => Some(Skill::Silence),
// Var::Slay => Some(Skill::Slay), // Var::Slay => Some(Skill::Slay),
Var::Slow => Some(Skill::Slow), Var::Slow => Some(Skill::Slow),
Var::Siphon => Some(Skill::Siphon),
Var::Snare => Some(Skill::Snare), Var::Snare => Some(Skill::Snare),
Var::Strangle => Some(Skill::Strangle), Var::Strangle => Some(Skill::Strangle),
Var::Strike => Some(Skill::Strike), Var::Strike => Some(Skill::Strike),