fix few bugs

This commit is contained in:
ntr 2019-10-15 10:00:42 +11:00
parent 349c74c08e
commit f2a516b5f0
7 changed files with 30 additions and 33 deletions

View File

@ -3,12 +3,8 @@
*PRODUCTION*
* mobile styles
* mobile info page
* fix info page for tablet layout
* Add TOS and accept to register page
* fix purge bug
* add recipe book
* can't reset password without knowing password =\
@ -48,7 +44,7 @@
reconnect based on time delta
consolidate game and instance
* return of the combat log (last few events with condensed descriptions)
* return of the combat log (last few events with condensed descriptions)
- click in to scroll
* elo + leaderboards

View File

@ -205,7 +205,6 @@
.resolving-skill {
grid-area: target;
align-self: center;
text-align: center;
height: auto;
svg {
display: inline;

View File

@ -30,23 +30,21 @@ const store = createStore(
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(),
);
document.fonts.load('16pt "Jura"').then(() => {
const events = registerEvents(store);
// store.subscribe(() => console.log(store.getState()));
setupKeys(store);
const events = registerEvents(store);
// store.subscribe(() => console.log(store.getState()));
setupKeys(store);
const ws = createSocket(events);
ws.connect();
events.setWs(ws);
const ws = createSocket(events);
ws.connect();
events.setWs(ws);
const App = () => (
<Provider store={store}>
<StripeProvider apiKey={stripeKey()}>
<Mnml />
</StripeProvider>
</Provider>
);
const App = () => (
<Provider store={store}>
<StripeProvider apiKey={stripeKey()}>
<Mnml />
</StripeProvider>
</Provider>
);
// eslint-disable-next-line
preact.render(<App />, document.body);
});
// eslint-disable-next-line
preact.render(<App />, document.body);

View File

@ -49,9 +49,10 @@ function GameCtrlTopBtns(args) {
};
const abandonClasses = `abandon ${abandonState ? 'confirming' : ''}`;
const abandonText = abandonState ? 'Confirm' : 'Abandon';
const abandonAction = abandonState ? sendAbandon : abandonStateTrue;
const abandonBtn = <button class={abandonClasses} disabled={finished} onClick={abandonAction}>Abandon</button>;
const abandonBtn = <button class={abandonClasses} disabled={finished} onClick={abandonAction}>{abandonText}</button>;
const leaveBtn = <button class='abandon confirming' onClick={leave}>Leave</button>;
return (

View File

@ -49,9 +49,10 @@ function InstanceTopBtns(args) {
};
const abandonClasses = `abandon ${abandonState ? 'confirming' : ''}`;
const abandonText = abandonState ? 'Confirm' : 'Abandon';
const abandonAction = abandonState ? sendAbandon : abandonStateTrue;
const abandonBtn = <button class={abandonClasses} disabled={finished} onClick={abandonAction}>Abandon</button>;
const abandonBtn = <button class={abandonClasses} disabled={finished} onClick={abandonAction}>{abandonText}</button>;
const leaveBtn = <button class='abandon confirming' onClick={leave}>Leave</button>;
return (

View File

@ -248,12 +248,14 @@ function Vbox(args) {
function onClick(e) {
if (vboxSelecting) clearVboxSelected();
if (reclaiming) return sendVboxReclaim(i);
if (combiner.length > 2) return combinerChange([i]);
const combinerIndex = combiner.indexOf(i);
if (combinerIndex > -1) {
return combinerChange(without(combiner, i));
}
combiner.push(i);
return combinerChange(combiner);
}

View File

@ -415,7 +415,7 @@ pub enum EventStages {
EndPost, // Skip Anim Anim
EndOnly, // Skip Anim Skip
PostOnly, // Skip Skip Anim
NoStages, // Skip Skip Skip
NoStages, // Skip Skip Skip
}
#[derive(Debug,Clone,PartialEq,Serialize,Deserialize)]
@ -1395,7 +1395,7 @@ fn sustain(source: &mut Construct, target: &mut Construct, mut results: Resoluti
fn intercept(source: &mut Construct, target: &mut Construct, mut results: Resolutions, skill: Skill) -> Resolutions {
let intercept = skill.effect()[0];
results.push(Resolution::new(source, target).event(target.add_effect(skill, intercept)));
let red_amount = source.red_power().pct(skill.multiplier());
let e = target.recharge(skill, red_amount, 0);
let stages = match e {
@ -1614,7 +1614,7 @@ fn electrocute(source: &mut Construct, target: &mut Construct, mut results: Reso
None => ()
}
}
let ConstructEffect { effect, duration, meta, tick: _ } = skill.effect()[0];
let tick_skill = match meta {
Some(EffectMeta::Skill(s)) => s,
@ -1660,10 +1660,10 @@ fn absorption(source: &mut Construct, target: &mut Construct, mut results: Resol
results.push(Resolution::new(source, target)
.event(target.add_effect(reflect_skill, absorb))
.stages(EventStages::PostOnly));
let absorb_index = target.effects.iter().position(|e| e.effect == Effect::Absorb).expect("No absorb");
let ce = target.effects.remove(absorb_index);
results.push(Resolution::new(source, target)
.event(Event::Removal { effect: ce.effect, construct_effects: target.effects.clone() })
.stages(EventStages::PostOnly));
@ -1717,7 +1717,7 @@ fn recharge(source: &mut Construct, target: &mut Construct, mut results: Resolut
}
fn siphon(source: &mut Construct, target: &mut Construct, mut results: Resolutions, skill: Skill) -> Resolutions {
let skip_tick = target.effects.iter().any(|e| e.effect == Effect::Siphon);
let ConstructEffect { effect, duration, meta, tick: _ } = skill.effect()[0];
let tick_skill = match meta {