skill doesn't count towards colours, 0 colour skill case, fk tutorial
This commit is contained in:
parent
7576081c52
commit
a280c4686e
@ -177,14 +177,15 @@ function registerEvents(store) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setInstance(v) {
|
function setInstance(v) {
|
||||||
const { account, ws, tutorial } = store.getState();
|
const { account, ws } = store.getState();
|
||||||
if (v) {
|
if (v) {
|
||||||
setInvite(null);
|
setInvite(null);
|
||||||
setPvp(false);
|
setPvp(false);
|
||||||
|
clearTutorial();
|
||||||
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 (tutorial && v.rounds.length === 1 && v.time_control === 'Practice') tutorialVbox(player, store, tutorial);
|
// if (tutorial && v.rounds.length === 1 && v.time_control === 'Practice') tutorialVbox(player, store, tutorial);
|
||||||
|
|
||||||
if (v.phase === 'Finished') {
|
if (v.phase === 'Finished') {
|
||||||
ws.sendAccountInstances();
|
ws.sendAccountInstances();
|
||||||
|
|||||||
@ -30,10 +30,10 @@ impl Colours {
|
|||||||
v.colours(&mut count);
|
v.colours(&mut count);
|
||||||
}
|
}
|
||||||
|
|
||||||
for cs in construct.skills.iter() {
|
// for cs in construct.skills.iter() {
|
||||||
let v = Item::from(cs.skill);
|
// let v = Item::from(cs.skill);
|
||||||
v.colours(&mut count);
|
// v.colours(&mut count);
|
||||||
}
|
// }
|
||||||
|
|
||||||
count
|
count
|
||||||
}
|
}
|
||||||
|
|||||||
@ -336,6 +336,7 @@ impl Player {
|
|||||||
println!("{:?}", colour_counts);
|
println!("{:?}", colour_counts);
|
||||||
|
|
||||||
let total = (construct.colours.red + construct.colours.green + construct.colours.blue) as f64;
|
let total = (construct.colours.red + construct.colours.green + construct.colours.blue) as f64;
|
||||||
|
if total != 0.0 {
|
||||||
let colour_pcts = colour_counts.iter_mut()
|
let colour_pcts = colour_counts.iter_mut()
|
||||||
.map(|cc| (cc.0, cc.1 as f64 / total))
|
.map(|cc| (cc.0, cc.1 as f64 / total))
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
@ -353,7 +354,7 @@ impl Player {
|
|||||||
construct.skills[0].skill
|
construct.skills[0].skill
|
||||||
} else {
|
} else {
|
||||||
let mut skill_item_combo = {
|
let mut skill_item_combo = {
|
||||||
if colour_pcts[0].1 > 0.75 {
|
if colour_pcts[0].1 > 0.70 {
|
||||||
vec![skill_item, colour_pcts[0].0, colour_pcts[0].0]
|
vec![skill_item, colour_pcts[0].0, colour_pcts[0].0]
|
||||||
} else if colour_pcts[1].1 > 0.4 {
|
} else if colour_pcts[1].1 > 0.4 {
|
||||||
vec![skill_item, colour_pcts[0].0, colour_pcts[1].0]
|
vec![skill_item, colour_pcts[0].0, colour_pcts[1].0]
|
||||||
@ -378,6 +379,7 @@ impl Player {
|
|||||||
// unlearn everything
|
// unlearn everything
|
||||||
construct.skills = vec![];
|
construct.skills = vec![];
|
||||||
construct.learn_mut(colour_skill);
|
construct.learn_mut(colour_skill);
|
||||||
|
}
|
||||||
|
|
||||||
// // now the item has been applied
|
// // now the item has been applied
|
||||||
// // recalculate the stats of the whole player
|
// // recalculate the stats of the whole player
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user