Compare commits

...
22 Commits
Author SHA1 Message Date
ntr cc8ffc946e Merge tag '1.14.1' into develop
1.14.1
2020-02-10 13:19:54 +10:00
ntr edccfbc42b Merge branch 'release/1.14.1' 2020-02-10 13:19:51 +10:00
ntr 9ed191d9ae finish games when finishing idle instances 2020-02-10 13:19:44 +10:00
ntr 36b5b5088b wrap invite copy navigator clipboard check 2020-02-06 14:37:43 +10:00
ntr 077b79e49f v1.14.1 2020-02-06 14:10:46 +10:00
ntr bf6d0c2202 Merge branch 'develop' of ssh://git.mnml.gg:40022/~/mnml into develop 2020-02-05 20:37:52 +10:00
Mashy c39cfba970 fix aside scrollbar shit 2020-02-05 20:37:17 +10:00
ntr 1d9ab02ff3 upkeep game id 2020-02-05 20:35:37 +10:00
ntr 4b3d5d5586 Merge tag '1.14.0' into develop
1.14.0
2020-02-05 20:09:53 +10:00
ntr 4abcfdef0c Merge branch 'release/1.14.0' 2020-02-05 20:09:47 +10:00
ntr 7539b40f08 increase duration 2020-02-05 20:09:43 +10:00
ntr 0e97eb462d disable clear button on game finished 2020-02-05 15:14:50 +10:00
ntr c3a8463ea9 fix sketchy idle animation 2020-02-04 20:56:03 +10:00
ntr 0a0db9e57f set pvp false when connecting 2020-02-04 11:37:24 +10:00
ntr 262eaa357b v1.14.0 2020-01-31 15:00:51 +10:00
ntr 87af1fded7 fix register prompt 2020-01-31 15:00:29 +10:00
Mashy 1f2dcbe83f can_be_disabled skill fix (absorption) 2020-01-31 13:29:29 +10:00
Mashy 2e7a8c3530 absorb silence test 2020-01-31 11:45:06 +10:00
ntr db1516bef6 Merge branch 'develop' of ssh://git.mnml.gg:40022/~/mnml into develop 2020-01-31 10:52:37 +10:00
ntr 40f3bb5be6 Merge tag '1.13.0' into develop
1.13.0
2020-01-31 10:52:17 +10:00
Mashy 594fe49eb2 timeout to clear vbox tutorial 2020-01-23 14:59:44 +10:00
Mashy d5ba372264 Invite link text same as play.jsx 2020-01-23 11:19:33 +10:00
22 changed files with 85 additions and 33 deletions

No files matched your search

+1 -1
View File
@@ -1 +1 @@
1.13.0 1.14.1
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "mnml-client", "name": "mnml-client",
"version": "1.13.0", "version": "1.14.1",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
+2 -2
View File
@@ -27,7 +27,7 @@ aside {
flex-flow: column;; flex-flow: column;;
} }
grid-template-rows: min-content 3fr 3fr 1fr; grid-template-rows: min-content 1fr 1fr min-content;
grid-gap: 0.5em 0; grid-gap: 0.5em 0;
} }
@@ -132,7 +132,7 @@ aside {
.ready { .ready {
flex: 1; flex: 1;
font-size: 200%; font-size: 2.5em;
} }
.quit { .quit {
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "mnml-client", "name": "mnml-client",
"version": "1.13.0", "version": "1.14.1",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
+6 -1
View File
@@ -59,8 +59,13 @@ class AccountAvatar extends Component {
} }
componentDidMount() { componentDidMount() {
const startIdle = () => {
this.idle = idleAnimation(this.props.account.id); this.idle = idleAnimation(this.props.account.id);
return this.animations.push(this.idle); this.animations.push(this.idle);
this.idle.finished.then(startIdle);
};
startIdle();
} }
resetAnimations() { resetAnimations() {
+3 -3
View File
@@ -1,8 +1,9 @@
const anime = require('animejs').default; const anime = require('animejs').default;
function idle(id) { function idle(id) {
const duration = anime.random(2000, 18000); const duration = anime.random(2000, 8000);
const target = document.getElementById(id); const target = document.getElementById(id);
return anime({ return anime({
targets: target, targets: target,
translateX: () => anime.random(-20, 20), translateX: () => anime.random(-20, 20),
@@ -10,8 +11,7 @@ function idle(id) {
rotate: () => anime.random(-15, 15), rotate: () => anime.random(-15, 15),
duration, duration,
direction: 'alternate', direction: 'alternate',
easing: 'linear', easing: 'easeInOutSine',
loop: true,
}); });
} }
+6 -1
View File
@@ -48,8 +48,13 @@ class ConstructAvatar extends Component {
} }
componentDidMount() { componentDidMount() {
const startIdle = () => {
this.idle = idleAnimation(this.props.construct.id); this.idle = idleAnimation(this.props.construct.id);
return this.animations.push(this.idle); this.animations.push(this.idle);
this.idle.finished.then(startIdle);
};
startIdle();
} }
resetAnimations() { resetAnimations() {
+1 -1
View File
@@ -22,7 +22,7 @@ const addState = connect(
} }
return { return {
promptRegister: tutorial === 99, // see events promptRegister: !tutorial, // see events
account, account,
sendInstancePractice, sendInstancePractice,
}; };
+1 -1
View File
@@ -98,7 +98,7 @@ function GameCtrlBtns(args) {
return ( return (
<div class="game-ctrl-btns"> <div class="game-ctrl-btns">
<button disabled={!account.subscribed} onClick={() => setChatShow(!chatShow)}>Chat</button> <button disabled={!account.subscribed} onClick={() => setChatShow(!chatShow)}>Chat</button>
<button disabled={animating} onClick={sendGameSkillClear}>Clear</button> <button disabled={finished || animating} onClick={sendGameSkillClear}>Clear</button>
{finished ? quitBtn : readyBtn} {finished ? quitBtn : readyBtn}
</div> </div>
); );
+6 -1
View File
@@ -34,8 +34,13 @@ class MnniAvatatr extends Component {
} }
componentDidMount() { componentDidMount() {
const startIdle = () => {
this.idle = idleAnimation('mnni'); this.idle = idleAnimation('mnni');
return this.animations.push(this.idle); this.animations.push(this.idle);
this.idle.finished.then(startIdle);
};
startIdle();
} }
resetAnimations() { resetAnimations() {
+6 -1
View File
@@ -37,8 +37,13 @@ class Img extends Component {
} }
componentDidMount() { componentDidMount() {
const startIdle = () => {
this.idle = idleAnimation(this.props.id); this.idle = idleAnimation(this.props.id);
return this.animations.push(this.idle); this.animations.push(this.idle);
this.idle.finished.then(startIdle);
};
startIdle();
} }
resetAnimations() { resetAnimations() {
+4 -1
View File
@@ -166,9 +166,12 @@ function registerEvents(store) {
function setInvite(code) { function setInvite(code) {
if (!code) return store.dispatch(actions.setInvite(null)); if (!code) return store.dispatch(actions.setInvite(null));
const link = `${document.location.origin}#join=${code}`; const link = `${document.location.origin}#join=${code}`;
if (navigator.clipboard) {
navigator.clipboard.writeText(link).then(() => { navigator.clipboard.writeText(link).then(() => {
notify('Your invite code was copied to the clipboard.'); notify('Invite link copied to clipboard.');
}, () => {}); }, () => {});
}
return store.dispatch(actions.setInvite(code)); return store.dispatch(actions.setInvite(code));
} }
+1
View File
@@ -349,6 +349,7 @@ function createSocket(events) {
sendItemInfo(); sendItemInfo();
events.urlHashChange(); events.urlHashChange();
events.setPvp(false);
return true; return true;
} }
+1
View File
@@ -97,6 +97,7 @@ function tutorialVbox(player, store, tutorial) {
if (stage === 7) { if (stage === 7) {
if (vbox.bits < 25) { if (vbox.bits < 25) {
stage += 1; stage += 1;
setTimeout(() => store.dispatch(actions.setTutorial(null)), 4000);
} else { } else {
vbox.store.Colours = {}; vbox.store.Colours = {};
vbox.store.Skills = {}; vbox.store.Skills = {};
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "mnml_core" name = "mnml_core"
version = "1.13.0" version = "1.14.1"
authors = ["ntr <ntr@smokestack.io>", "mashy <mashy@mnml.gg>"] authors = ["ntr <ntr@smokestack.io>", "mashy <mashy@mnml.gg>"]
[dependencies] [dependencies]
+1 -7
View File
@@ -121,13 +121,7 @@ impl Effect {
} }
pub fn disables_skill(&self, skill: Skill) -> bool { pub fn disables_skill(&self, skill: Skill) -> bool {
if skill.is_tick() { if !skill.can_be_disabled() {
return false;
}
// electrocute always goes off baybee
// even if you are stunned particularly
if [Skill::Electrocute, Skill::ElectrocutePlus, Skill::ElectrocutePlusPlus].contains(&skill) {
return false; return false;
} }
+17 -7
View File
@@ -804,7 +804,7 @@ impl Game {
} }
} }
fn finish(mut self) -> Game { pub fn finish(mut self) -> Game {
self.phase = Phase::Finished; self.phase = Phase::Finished;
// self.log.push(format!("Game finished.")); // self.log.push(format!("Game finished."));
@@ -835,7 +835,7 @@ impl Game {
return self; return self;
} }
info!("upkeep game: {:} vs {:}", self.players[0].name, self.players[1].name); info!("upkeep {:?} {:} vs {:}", self.id, self.players[0].name, self.players[1].name);
for player in self.players.iter_mut() { for player in self.players.iter_mut() {
if !player.ready { if !player.ready {
@@ -2335,13 +2335,23 @@ mod tests {
}, },
_ => false, _ => false,
})); }));
}
/* assert!(match game.players[1].constructs[0].effects[0].meta { #[test]
Some(EffectMeta::AddedDamage(d)) => d, fn absorb_silence_test() {
_ => 0 let mut game = create_2v2_test_game();
// 320 base blue power and 125 base blue life let player_id = game.players[0].id;
} == 320.pct(Skill::Blast.multiplier()) - 125);*/ let target_player_id = game.players[1].id;
let source = game.players[0].constructs[0].id;
let target = game.players[1].constructs[0].id;
game.new_resolve(Cast::new(target, player_id, target, Skill::Absorb));
assert!(game.construct_by_id(target).unwrap().affected(Effect::Absorb));
game.new_resolve(Cast::new(source, target_player_id, target, Skill::Silence));
assert!(game.construct_by_id(target).unwrap().affected(Effect::Silence));
assert!(game.construct_by_id(target).unwrap().affected(Effect::Absorption));
} }
#[test] #[test]
+16
View File
@@ -834,6 +834,22 @@ impl Skill {
} }
} }
pub fn can_be_disabled(self) -> bool {
match self {
Skill::ElectrocuteTick |
Skill::DecayTick |
Skill::SiphonTick |
Skill::TriageTick |
Skill::Electrocute |
Skill::ElectrocutePlus |
Skill::ElectrocutePlusPlus |
Skill::Absorption |
Skill::AbsorptionPlus |
Skill::AbsorptionPlusPlus => false,
_ => true,
}
}
pub fn additional_skill(&self, effect: Effect) -> Option<Skill> { pub fn additional_skill(&self, effect: Effect) -> Option<Skill> {
match effect { match effect {
Effect::Haste => match self { Effect::Haste => match self {
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "mnml-ops", "name": "mnml-ops",
"version": "1.13.0", "version": "1.14.1",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "mnml" name = "mnml"
version = "1.13.0" version = "1.14.1"
authors = ["ntr <ntr@smokestack.io>"] authors = ["ntr <ntr@smokestack.io>"]
[dependencies] [dependencies]
+7
View File
@@ -13,6 +13,7 @@ use pg::{
PgPool, PgPool,
games_need_upkeep, games_need_upkeep,
game_get,
game_update, game_update,
game_write, game_write,
game_delete, game_delete,
@@ -157,6 +158,12 @@ fn fetch_instances(mut tx: Transaction) -> Result<Transaction, Error> {
} }
for mut instance in instances_idle(&mut tx)? { for mut instance in instances_idle(&mut tx)? {
if let Some(game_id) = instance.current_game_id() {
let mut game = game_get(&mut tx, game_id)?;
game = game.finish();
game_update(&mut tx, &game)?;
}
instance.finish(); instance.finish();
instance_update(&mut tx, instance)?; instance_update(&mut tx, instance)?;
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "mnml-studios", "name": "mnml-studios",
"version": "1.13.0", "version": "1.14.1",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {