costs
This commit is contained in:
parent
4920821ec2
commit
24951c1442
@ -26,10 +26,17 @@ class Combiner extends preact.Component {
|
|||||||
|
|
||||||
const { stashSelect, storeSelect } = vboxSelected;
|
const { stashSelect, storeSelect } = vboxSelected;
|
||||||
|
|
||||||
|
function cost([group, i]) {
|
||||||
|
if (group === 'Colours') return 1;
|
||||||
|
if (group === 'Skills') return 2;
|
||||||
|
if (group === 'Specs') return 3;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
if (vboxCombiner) {
|
if (vboxCombiner) {
|
||||||
const combinerComboText = vboxCombiner.replace('Plus', '+');
|
const combinerComboText = vboxCombiner.replace('Plus', '+');
|
||||||
let bits = 0;
|
let bits = 0;
|
||||||
storeSelect.forEach(item => bits += item[0] + 1);
|
storeSelect.forEach(item => bits += cost(item));
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
class='combiner vbox-btn'
|
class='combiner vbox-btn'
|
||||||
@ -48,7 +55,7 @@ class Combiner extends preact.Component {
|
|||||||
class='combiner vbox-btn'
|
class='combiner vbox-btn'
|
||||||
onClick={e => e.stopPropagation()}
|
onClick={e => e.stopPropagation()}
|
||||||
onMouseDown={vboxBuySelected}>
|
onMouseDown={vboxBuySelected}>
|
||||||
{`Buy ${vbox.store[item[0]][item[1]]} ${item[0] + 1}b`}
|
{`Buy ${vbox.store[item[0]][item[1]]} ${cost(item)}b`}
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user