update info

This commit is contained in:
ntr 2019-09-06 17:44:29 +10:00
parent c22c09a87b
commit 9358d0a99f
3 changed files with 37 additions and 41 deletions

View File

@ -9,7 +9,6 @@ const shapes = require('./shapes');
function InfoComponent(args) { function InfoComponent(args) {
const { const {
itemInfo, itemInfo,
combiner,
player, player,
info, info,
} = args; } = args;
@ -25,6 +24,8 @@ function InfoComponent(args) {
<p>double clicking items in the <b>VBOX</b> will purchase and move them to your <b>INVENTORY</b>.</p> <p>double clicking items in the <b>VBOX</b> will purchase and move them to your <b>INVENTORY</b>.</p>
<p> <p>
hover over an item to see its effects and combinations.<br /> hover over an item to see its effects and combinations.<br />
combine a <b>SKILL</b> or <b>SPEC</b> with 2 <b>COLOURS</b> to create an item.<br />
combine 3 of the same item to upgrade it.<br />
click an item and then click a construct to equip that item to it.<br /> click an item and then click a construct to equip that item to it.<br />
</p> </p>
<p>click the <b>READY</b> button on the right to progress to the <b>GAME PHASE</b>.</p> <p>click the <b>READY</b> button on the right to progress to the <b>GAME PHASE</b>.</p>
@ -40,17 +41,11 @@ function InfoComponent(args) {
const regEx = /(RedPower|BluePower|GreenPower|RedLife|BlueLife|GreenLife|SpeedStat)/; const regEx = /(RedPower|BluePower|GreenPower|RedLife|BlueLife|GreenLife|SpeedStat)/;
const infoDescription = reactStringReplace(fullInfo.description, regEx, match => shapes[match]()); const infoDescription = reactStringReplace(fullInfo.description, regEx, match => shapes[match]());
const itemSource = itemInfo.combos.filter(c => c.item === info);
const itemSourceInfo = itemSource.length
? `${itemSource[0].components[0]} ${itemSource[0].components[1]} ${itemSource[0].components[2]}`
: false;
const itemRegEx = /(Red|Blue|Green)/;
const itemSourceDescription = reactStringReplace(itemSourceInfo, itemRegEx, match => shapes[match]());
return ( return (
<div class="info-skill"> <div class="info-skill">
<h2>{fullInfo.item}</h2> <h2>{fullInfo.item}</h2>
<h3>{itemSourceDescription}</h3> <h3>SKILL</h3>
<div> {infoDescription} </div> <div>{infoDescription}</div>
</div> </div>
); );
} }
@ -144,6 +139,7 @@ function InfoComponent(args) {
return ( return (
<div class="info-spec"> <div class="info-spec">
<h2>{info}</h2> <h2>{info}</h2>
<h3>SPEC</h3>
<div>{infoDescription}</div> <div>{infoDescription}</div>
<div class="thresholds"> <div class="thresholds">
{thresholds} {thresholds}

View File

@ -200,7 +200,7 @@ function createSocket(events) {
let pongTimeout; let pongTimeout;
function onPong() { function onPong() {
events.setPing(Date.now() - ping); events.setPing(Date.now() - ping);
pongTimeout = setTimeout(sendPing, 1000); // pongTimeout = setTimeout(sendPing, 1000);
} }
// ------------- // -------------