Merge tag '1.8.3' into develop

1.8.3
This commit is contained in:
ntr 2019-11-13 21:52:00 +11:00
commit f502bb5756
17 changed files with 48 additions and 57 deletions

View File

@ -14,7 +14,7 @@
- Amplify no longer increase GreenPower - Amplify no longer increase GreenPower
- Purify - Purify
- Now removes all effects on target - Now removes all effects on target
- Applies "Purified" increasing healing taken - Applies "Pure" increasing healing taken
- Purge - Purge
- Now removes all effects on target - Now removes all effects on target

View File

@ -1 +1 @@
1.8.2 1.8.3

View File

@ -1,6 +1,6 @@
{ {
"name": "mnml-client", "name": "mnml-client",
"version": "1.8.2", "version": "1.8.3",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -434,6 +434,10 @@
&.winner { &.winner {
animation: win 2s ease-in-out 0s 1; animation: win 2s ease-in-out 0s 1;
} }
.cancelled {
color: white;
}
} }
.tutorial { .tutorial {

View File

@ -1,6 +1,6 @@
{ {
"name": "mnml-client", "name": "mnml-client",
"version": "1.8.2", "version": "1.8.3",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -80,6 +80,12 @@ class Faceoff extends preact.Component {
} }
function faceoffText() { function faceoffText() {
if (!instance.winner) { if (!instance.winner) {
if (instance.phase === 'Finished') return (
<div class="faceoff-text">
<div class="cancelled"> game cancelled </div>
</div>
);
return ( return (
<div class="faceoff-text"> <div class="faceoff-text">
<div class="opponent-text"> {otherTeam.name} </div> <div class="opponent-text"> {otherTeam.name} </div>

View File

@ -209,34 +209,23 @@ function registerEvents(store) {
return store.dispatch(actions.setInvite(code)); return store.dispatch(actions.setInvite(code));
} }
let autoReady = null;
function setInstance(v) { function setInstance(v) {
const { account, instance, ws, tutorial } = store.getState(); const { account, ws, tutorial } = store.getState();
if (v) { if (v) {
setInvite(null); setInvite(null);
setPvp(false); setPvp(false);
const player = v.players.find(p => p.id === account.id); const player = v.players.find(p => p.id === account.id);
store.dispatch(actions.setPlayer(player)); store.dispatch(actions.setPlayer(player));
if (!instance || v.id !== instance.id) { const skip = v.time_control === 'Practice' && v.phase === 'Lobby';
clearTimeout(autoReady); if (skip) {
ws.sendInstanceReady(v.id);
} }
if (v.phase === 'Finished') { if (v.phase === 'Finished') {
ws.sendAccountInstances(); ws.sendAccountInstances();
} }
if (v.phase_end && v.phase === 'Lobby' && !autoReady) {
const skip = v.time_control === 'Practice' ? 10000 : 2000;
const autoReadyDelay = Date.parse(v.phase_end) - Date.now() - skip;
autoReady = setTimeout(() => {
ws.sendInstanceReady(v.id);
autoReady = null;
}, autoReadyDelay);
}
if (v.phase !== 'Lobby') clearTimeout(autoReady);
// instance.mobile.less hides info at @media 1000 // instance.mobile.less hides info at @media 1000
if (localStorage.getItem('tutorial-complete') || window.innerWidth <= 1100) { if (localStorage.getItem('tutorial-complete') || window.innerWidth <= 1100) {
store.dispatch(actions.setTutorial(null)); store.dispatch(actions.setTutorial(null));

View File

@ -282,7 +282,7 @@ function effectInfo(i) {
case 'Restrict': return 'Disable construct from casting any red skills'; case 'Restrict': return 'Disable construct from casting any red skills';
case 'Stun': return 'Stunned construct cannot use skills'; case 'Stun': return 'Stunned construct cannot use skills';
case 'Intercept': return 'Redirect any skills on team to this target construct'; case 'Intercept': return 'Redirect any skills on team to this target construct';
case 'Purified': return `Construct will take ${i.meta[1] - 100}% increased healing`; case 'Pure': return `Construct will take ${i.meta[1] - 100}% increased healing`;
case 'Vulnerable': return `Construct will take ${i.meta[1] - 100}% increased red damage`; case 'Vulnerable': return `Construct will take ${i.meta[1] - 100}% increased red damage`;
case 'Silence': return 'Disable construct from casting any blue skills'; case 'Silence': return 'Disable construct from casting any blue skills';
case 'Wither': return `Construct will take ${100 - i.meta[1]}% reduced healing`; // case 'Wither': return `Construct will take ${100 - i.meta[1]}% reduced healing`; //

View File

@ -1,6 +1,6 @@
{ {
"name": "mnml-ops", "name": "mnml-ops",
"version": "1.8.2", "version": "1.8.3",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -1,6 +1,6 @@
[package] [package]
name = "mnml" name = "mnml"
version = "1.8.2" version = "1.8.3"
authors = ["ntr <ntr@smokestack.io>"] authors = ["ntr <ntr@smokestack.io>"]
[dependencies] [dependencies]

View File

@ -73,7 +73,7 @@ pub fn chat_wheel(_db: &Db, _id: Uuid) -> Result<Vec<String>, Error> {
"glhf".to_string(), "glhf".to_string(),
"ez".to_string(), "ez".to_string(),
"rekt".to_string(), "rekt".to_string(),
"nice".to_string(), "wow".to_string(),
"wp".to_string(), "wp".to_string(),
"ok".to_string(), "ok".to_string(),
"...".to_string(), "...".to_string(),

View File

@ -16,7 +16,7 @@ pub enum Effect {
Hybrid, Hybrid,
Intercept, Intercept,
Invert, Invert,
Purified, Pure,
Purge, Purge,
Reflect, Reflect,
Restrict, Restrict,
@ -112,7 +112,7 @@ impl Effect {
// Damage taken changes // Damage taken changes
Effect::Curse => vec![Stat::RedDamageTaken, Stat::BlueDamageTaken], Effect::Curse => vec![Stat::RedDamageTaken, Stat::BlueDamageTaken],
Effect::Purified => vec![Stat::GreenDamageTaken], // increased green taken Effect::Pure => vec![Stat::GreenDamageTaken], // increased green taken
Effect::Vulnerable => vec![Stat::RedDamageTaken], Effect::Vulnerable => vec![Stat::RedDamageTaken],
Effect::Wither => vec![Stat::GreenDamageTaken], // reduced green taken Effect::Wither => vec![Stat::GreenDamageTaken], // reduced green taken
@ -133,7 +133,7 @@ impl Effect {
Effect::Haste | Effect::Haste |
Effect::Slow | Effect::Slow |
Effect::Hybrid | Effect::Hybrid |
Effect::Purified | Effect::Pure |
Effect::Wither => value.pct(match meta { Effect::Wither => value.pct(match meta {
Some(EffectMeta::Multiplier(d)) => d, Some(EffectMeta::Multiplier(d)) => d,
_ => 100, _ => 100,
@ -194,7 +194,7 @@ impl Effect {
Effect::Decay => Some(Colour::Blue), Effect::Decay => Some(Colour::Blue),
Effect::Regen => Some(Colour::Green), Effect::Regen => Some(Colour::Green),
Effect::Siphon => Some(Colour::Blue), Effect::Siphon => Some(Colour::Blue),
Effect::Purified => Some(Colour::Green), Effect::Pure => Some(Colour::Green),
Effect::Ko => None, Effect::Ko => None,
} }

View File

@ -635,15 +635,15 @@ impl Game {
for player in self.players.iter_mut() { for player in self.players.iter_mut() {
if !player.ready { if !player.ready {
player.set_ready(true); player.set_ready(true);
player.add_warning(); // player.add_warning();
info!("upkeep: {:} warned", player.name); // info!("upkeep: {:} warned", player.name);
if player.warnings >= 3 { // if player.warnings >= 3 {
player.forfeit(); // player.forfeit();
info!("upkeep: {:} forfeited", player.name); // info!("upkeep: {:} forfeited", player.name);
//todo // //todo
// self.resolved.push(forfeit) // // self.resolved.push(forfeit)
// self.log.push(format!("{:} forfeited.", player.name)); // // self.log.push(format!("{:} forfeited.", player.name));
} // }
} }
} }
@ -1622,6 +1622,6 @@ mod tests {
game.players[0].set_ready(true); game.players[0].set_ready(true);
game.phase_end = Some(Utc::now().checked_sub_signed(Duration::seconds(500)).unwrap()); game.phase_end = Some(Utc::now().checked_sub_signed(Duration::seconds(500)).unwrap());
game = game.upkeep(); game = game.upkeep();
assert!(game.players[1].warnings == 1); // assert!(game.players[1].warnings == 1);
} }
} }

View File

@ -832,7 +832,7 @@ impl Item {
Item::PurifyPlus | Item::PurifyPlus |
Item::PurifyPlusPlus => format!( Item::PurifyPlusPlus => format!(
"Remove all effects and heals for {:?}% GreenPower per effect removed. "Remove all effects and heals for {:?}% GreenPower per effect removed.
Applies Purified increasing healing taken by {:?}%.", Applies Pure increasing healing taken by {:?}%.",
self.into_skill().unwrap().multiplier(), self.into_skill().unwrap().multiplier(),
self.into_skill().unwrap().effect()[0].get_multiplier() - 100), self.into_skill().unwrap().effect()[0].get_multiplier() - 100),

View File

@ -44,7 +44,7 @@ const FIRSTS: [&'static str; 53] = [
"orbiting", "orbiting",
"piscine", "piscine",
"polar", "polar",
"purified", "pure",
"recalcitrant", "recalcitrant",
"rogue", "rogue",
"sealed", "sealed",

View File

@ -63,7 +63,6 @@ pub struct Player {
pub constructs: Vec<Construct>, pub constructs: Vec<Construct>,
pub bot: bool, pub bot: bool,
pub ready: bool, pub ready: bool,
pub warnings: u8,
pub draw_offered: bool, pub draw_offered: bool,
pub score: Score, pub score: Score,
} }
@ -85,7 +84,6 @@ impl Player {
constructs, constructs,
bot: false, bot: false,
ready: false, ready: false,
warnings: 0,
draw_offered: false, draw_offered: false,
score: Score::Zero, score: Score::Zero,
}) })
@ -100,7 +98,6 @@ impl Player {
constructs, constructs,
bot: false, bot: false,
ready: false, ready: false,
warnings: 0,
draw_offered: false, draw_offered: false,
score: Score::Zero, score: Score::Zero,
} }
@ -134,11 +131,6 @@ impl Player {
self self
} }
pub fn add_warning(&mut self) -> &mut Player {
self.warnings += 1;
self
}
pub fn forfeit(&mut self) -> &mut Player { pub fn forfeit(&mut self) -> &mut Player {
for construct in self.constructs.iter_mut() { for construct in self.constructs.iter_mut() {
construct.force_ko(); construct.force_ko();

View File

@ -1024,11 +1024,11 @@ impl Skill {
Skill::TriagePlusPlus => vec![ConstructEffect {effect: Effect::Triage, duration: 4, Skill::TriagePlusPlus => vec![ConstructEffect {effect: Effect::Triage, duration: 4,
meta: Some(EffectMeta::Skill(Skill::TriageTickPlusPlus)), tick: None}], meta: Some(EffectMeta::Skill(Skill::TriageTickPlusPlus)), tick: None}],
Skill::Purify => vec![ConstructEffect { effect: Effect::Purified, duration: 2, Skill::Purify => vec![ConstructEffect { effect: Effect::Pure, duration: 2,
meta: Some(EffectMeta::Multiplier(150)), tick: None}], meta: Some(EffectMeta::Multiplier(150)), tick: None}],
Skill::PurifyPlus => vec![ConstructEffect { effect: Effect::Purified, duration: 2, Skill::PurifyPlus => vec![ConstructEffect { effect: Effect::Pure, duration: 2,
meta: Some(EffectMeta::Multiplier(175)), tick: None}], meta: Some(EffectMeta::Multiplier(175)), tick: None}],
Skill::PurifyPlusPlus => vec![ConstructEffect { effect: Effect::Purified, duration: 2, Skill::PurifyPlusPlus => vec![ConstructEffect { effect: Effect::Pure, duration: 2,
meta: Some(EffectMeta::Multiplier(200)), tick: None}], meta: Some(EffectMeta::Multiplier(200)), tick: None}],
_ => { _ => {