preview item combos in table
This commit is contained in:
parent
357c38e375
commit
27c562d41b
@ -8,8 +8,14 @@
|
|||||||
|
|
||||||
* mobile info page
|
* mobile info page
|
||||||
|
|
||||||
|
* Don't drop out of game if you don't ready (esp. tutorial)
|
||||||
|
* Preview combo if you select 3 items
|
||||||
|
|
||||||
## SOON
|
## SOON
|
||||||
|
|
||||||
|
* Graphical status effects instead of text
|
||||||
|
* Improve colour contrast / buttons
|
||||||
|
|
||||||
* supporter gold name in instance (anyone whos put any money into game)
|
* supporter gold name in instance (anyone whos put any money into game)
|
||||||
|
|
||||||
* change cooldowns to delay & recharge
|
* change cooldowns to delay & recharge
|
||||||
|
|||||||
@ -122,6 +122,15 @@ svg {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes border-co {
|
||||||
|
0% {
|
||||||
|
border-color: @gray-box;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
border-color: @gray-hint;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@keyframes co {
|
@keyframes co {
|
||||||
from {
|
from {
|
||||||
background: @black;
|
background: @black;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr minmax(min-content, 1fr);
|
grid-template-columns: 1fr minmax(min-content, 1fr);
|
||||||
grid-template-rows: min-content 1fr;
|
grid-template-rows: minmax(min-content, 0.75fr) 1fr;
|
||||||
|
|
||||||
grid-template-areas:
|
grid-template-areas:
|
||||||
"vbox info"
|
"vbox info"
|
||||||
@ -33,16 +33,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.instance .info {
|
.instance .info {
|
||||||
/*font-size: 75%;*/
|
|
||||||
margin: 0 0 0 1em;
|
|
||||||
grid-area: info;
|
grid-area: info;
|
||||||
display: flex;
|
display: grid;
|
||||||
flex-flow: column;
|
font-size: 85%;
|
||||||
|
grid-template-rows: 0.8fr 1fr;
|
||||||
|
grid-template-areas:
|
||||||
|
"item"
|
||||||
|
"combos";
|
||||||
|
// flex-flow: column;
|
||||||
// white-space: pre-wrap;
|
// white-space: pre-wrap;
|
||||||
|
|
||||||
> *:first-child {
|
|
||||||
margin-bottom: 1em;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.instance .info h2 {
|
.instance .info h2 {
|
||||||
@ -63,6 +62,29 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.instance .info-item {
|
||||||
|
grid-area: item;
|
||||||
|
margin: 0 0 0 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.instance .combos {
|
||||||
|
grid-area: combos;
|
||||||
|
margin: 0 0 0 1em;
|
||||||
|
|
||||||
|
td.table-button {
|
||||||
|
padding:5px;
|
||||||
|
cursor: pointer;
|
||||||
|
animation: border-co 0.75s ease-in-out 0s infinite alternate;
|
||||||
|
&:hover {
|
||||||
|
color: whitesmoke;
|
||||||
|
background-color: @gray-hover;
|
||||||
|
}
|
||||||
|
svg {
|
||||||
|
height: 1em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.instance .info figcaption {
|
.instance .info figcaption {
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|||||||
@ -9,12 +9,14 @@ const shapes = require('./shapes');
|
|||||||
|
|
||||||
|
|
||||||
class InfoComponent extends preact.Component {
|
class InfoComponent extends preact.Component {
|
||||||
shouldComponentUpdate(newProps) {
|
shouldComponentUpdate(newProps, newState) {
|
||||||
if (newProps.tutorial !== this.props.tutorial) return true;
|
if (newProps.tutorial !== this.props.tutorial) return true;
|
||||||
// We don't care about info during tutorial
|
// We don't care about info during tutorial
|
||||||
if (newProps.tutorial && this.props.instance.time_control === 'Practice'
|
if (newProps.tutorial && this.props.instance.time_control === 'Practice'
|
||||||
&& this.props.instance.rounds.length === 1) return false;
|
&& this.props.instance.rounds.length === 1) return false;
|
||||||
if (newProps.info !== this.props.info) return true;
|
if (newProps.info !== this.props.info) return true;
|
||||||
|
if (newState.comboItem !== this.state.comboItem) return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,7 +35,8 @@ class InfoComponent extends preact.Component {
|
|||||||
setInfo,
|
setInfo,
|
||||||
setTutorialNull,
|
setTutorialNull,
|
||||||
} = args;
|
} = args;
|
||||||
|
const { comboItem } = this.state;
|
||||||
|
console.log(comboItem);
|
||||||
function Info() {
|
function Info() {
|
||||||
if (tutorial) {
|
if (tutorial) {
|
||||||
const tutorialStageInfo = tutorialStage(tutorial, ws, setTutorialNull, instance);
|
const tutorialStageInfo = tutorialStage(tutorial, ws, setTutorialNull, instance);
|
||||||
@ -42,7 +45,7 @@ class InfoComponent extends preact.Component {
|
|||||||
if (!info) return false;
|
if (!info) return false;
|
||||||
if (info.includes('constructName')) {
|
if (info.includes('constructName')) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div class='info-item'>
|
||||||
<h2> {info.replace('constructName ', '')} </h2>
|
<h2> {info.replace('constructName ', '')} </h2>
|
||||||
<p> This is the name of your construct. <br />
|
<p> This is the name of your construct. <br />
|
||||||
Names are randomly generated and are purely cosmetic. <br />
|
Names are randomly generated and are purely cosmetic. <br />
|
||||||
@ -54,7 +57,7 @@ class InfoComponent extends preact.Component {
|
|||||||
|
|
||||||
if (info.includes('constructAvatar')) {
|
if (info.includes('constructAvatar')) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div class='info-item'>
|
||||||
<h2> {info.replace('constructAvatar ', '')} </h2>
|
<h2> {info.replace('constructAvatar ', '')} </h2>
|
||||||
<p> This is your construct avatar. <br />
|
<p> This is your construct avatar. <br />
|
||||||
Avatars are randomly generated and are purely cosmetic. <br />
|
Avatars are randomly generated and are purely cosmetic. <br />
|
||||||
@ -63,7 +66,9 @@ class InfoComponent extends preact.Component {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const fullInfo = itemInfo.items.find(i => i.item === info) || INFO[info];
|
const fullInfo = comboItem
|
||||||
|
? itemInfo.items.find(i => i.item === comboItem) || INFO[comboItem]
|
||||||
|
: itemInfo.items.find(i => i.item === info) || INFO[info];
|
||||||
if (!fullInfo) return false;
|
if (!fullInfo) return false;
|
||||||
const isSkill = fullInfo.skill;
|
const isSkill = fullInfo.skill;
|
||||||
const isSpec = fullInfo.spec;
|
const isSpec = fullInfo.spec;
|
||||||
@ -75,16 +80,18 @@ class InfoComponent extends preact.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (isSkill || isSpec) {
|
if (isSkill || isSpec) {
|
||||||
let infoName = info;
|
let infoName = fullInfo.item;
|
||||||
while (infoName.includes('Plus')) infoName = infoName.replace('Plus', '+');
|
while (infoName.includes('Plus')) infoName = infoName.replace('Plus', '+');
|
||||||
|
console.log(fullInfo);
|
||||||
|
|
||||||
const header = isSkill ? <h3> SKILL </h3> : <h3> SPEC </h3>;
|
const itemSource = itemInfo.combos.filter(c => c.item === removeTier(fullInfo.item));
|
||||||
|
|
||||||
const itemSource = itemInfo.combos.filter(c => c.item === removeTier(info));
|
let itemSourceInfo = itemSource.length && !isSpec
|
||||||
let itemSourceInfo = itemSource.length
|
|
||||||
? `${itemSource[0].components[0]} ${itemSource[0].components[1]} ${itemSource[0].components[2]}`
|
? `${itemSource[0].components[0]} ${itemSource[0].components[1]} ${itemSource[0].components[2]}`
|
||||||
: false;
|
: false;
|
||||||
|
|
||||||
|
let header = null;
|
||||||
|
if (!itemSource.length) header = isSkill ? <h3> SKILL </h3> : <h3> SPEC </h3>;
|
||||||
if (itemSourceInfo) {
|
if (itemSourceInfo) {
|
||||||
while (itemSourceInfo.includes('Plus')) itemSourceInfo = itemSourceInfo.replace('Plus', '+');
|
while (itemSourceInfo.includes('Plus')) itemSourceInfo = itemSourceInfo.replace('Plus', '+');
|
||||||
const itemRegEx = /(Red|Blue|Green)/;
|
const itemRegEx = /(Red|Blue|Green)/;
|
||||||
@ -100,7 +107,7 @@ class InfoComponent extends preact.Component {
|
|||||||
const thresholds = isSpec ? specThresholds(player, fullInfo, info) : null;
|
const thresholds = isSpec ? specThresholds(player, fullInfo, info) : null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div class={isSkill ? 'info-skill' : 'info-spec'}>
|
<div class={isSkill ? 'info-item' : 'info-item'}>
|
||||||
<h2>{infoName} {fullInfo.cost}b</h2>
|
<h2>{infoName} {fullInfo.cost}b</h2>
|
||||||
{header}
|
{header}
|
||||||
{itemSourceInfo}
|
{itemSourceInfo}
|
||||||
@ -120,10 +127,10 @@ class InfoComponent extends preact.Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function Combos() {
|
const Combos = () => {
|
||||||
if (tutorial && instance.time_control === 'Practice' && instance.rounds.length === 1) return false;
|
if (tutorial && instance.time_control === 'Practice' && instance.rounds.length === 1) return false;
|
||||||
const generalNotes = (
|
const generalNotes = (
|
||||||
<div>
|
<div class="combos">
|
||||||
<h2> General </h2>
|
<h2> General </h2>
|
||||||
<p>
|
<p>
|
||||||
You can preview combos by clicking the combined item when it appears in this section. <br />
|
You can preview combos by clicking the combined item when it appears in this section. <br />
|
||||||
@ -141,18 +148,25 @@ class InfoComponent extends preact.Component {
|
|||||||
<table class="combos">
|
<table class="combos">
|
||||||
<tbody>
|
<tbody>
|
||||||
{vboxCombos.map((c, i) =>
|
{vboxCombos.map((c, i) =>
|
||||||
<tr key={i} >
|
<tr key={i}>
|
||||||
<td class="highlight" onClick={() => setInfo(c.item)} >{convertItem(c.item)}</td>
|
<td class="table-button"
|
||||||
|
onMouseOver={e => {
|
||||||
|
e.stopPropagation();
|
||||||
|
this.setState({ comboItem: c.item });
|
||||||
|
}}
|
||||||
|
onClick={() => setInfo(c.item)}
|
||||||
|
> {convertItem(c.item)} </td>
|
||||||
|
|
||||||
{c.components.map((u, j) => <td key={j} >{convertItem(u)}</td>)}
|
{c.components.map((u, j) => <td key={j} >{convertItem(u)}</td>)}
|
||||||
</tr>
|
</tr>
|
||||||
)}
|
)}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div class='info' >
|
<div class='info' onMouseOver={() => this.setState({ comboItem: null })}>
|
||||||
<Info />
|
<Info />
|
||||||
<Combos />
|
<Combos />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -109,7 +109,7 @@ function tutorialStage(tutorial, ws, clearTutorial, instance) {
|
|||||||
const tutorialText = () => {
|
const tutorialText = () => {
|
||||||
if (tutorial === 1) {
|
if (tutorial === 1) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div class='info-item'>
|
||||||
<h2>Tutorial</h2>
|
<h2>Tutorial</h2>
|
||||||
<p> Welcome to the vbox phase tutorial.</p>
|
<p> Welcome to the vbox phase tutorial.</p>
|
||||||
<p> Colours are used to create powerful combinations. </p>
|
<p> Colours are used to create powerful combinations. </p>
|
||||||
@ -121,7 +121,7 @@ function tutorialStage(tutorial, ws, clearTutorial, instance) {
|
|||||||
|
|
||||||
if (tutorial === 2) {
|
if (tutorial === 2) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div class='info-item'>
|
||||||
<h2>Tutorial</h2>
|
<h2>Tutorial</h2>
|
||||||
<p> In a normal game you start with three base <b>Attack</b> skill items. </p>
|
<p> In a normal game you start with three base <b>Attack</b> skill items. </p>
|
||||||
<p> The <b>Attack</b> item can be combined with <b>colours</b> to create a new skill. </p>
|
<p> The <b>Attack</b> item can be combined with <b>colours</b> to create a new skill. </p>
|
||||||
@ -135,7 +135,7 @@ function tutorialStage(tutorial, ws, clearTutorial, instance) {
|
|||||||
if (tutorial === 3) {
|
if (tutorial === 3) {
|
||||||
const constructOne = instance.players[0].constructs[0].name;
|
const constructOne = instance.players[0].constructs[0].name;
|
||||||
return (
|
return (
|
||||||
<div>
|
<div class='info-item'>
|
||||||
<h2>Tutorial</h2>
|
<h2>Tutorial</h2>
|
||||||
<p> The first construct on your team is <b>{constructOne}</b>. </p>
|
<p> The first construct on your team is <b>{constructOne}</b>. </p>
|
||||||
<p> Skill items can be equipped to your constructs to be used in the combat phase. </p>
|
<p> Skill items can be equipped to your constructs to be used in the combat phase. </p>
|
||||||
@ -147,7 +147,7 @@ function tutorialStage(tutorial, ws, clearTutorial, instance) {
|
|||||||
|
|
||||||
if (tutorial === 4) {
|
if (tutorial === 4) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div class='info-item'>
|
||||||
<h2>Tutorial</h2>
|
<h2>Tutorial</h2>
|
||||||
<p> You can also buy specialisation items for your constructs. <br />
|
<p> You can also buy specialisation items for your constructs. <br />
|
||||||
Specialisation items increase stats including power, speed and life. </p>
|
Specialisation items increase stats including power, speed and life. </p>
|
||||||
@ -159,7 +159,7 @@ function tutorialStage(tutorial, ws, clearTutorial, instance) {
|
|||||||
|
|
||||||
if (tutorial === 5) {
|
if (tutorial === 5) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div class='info-item'>
|
||||||
<h2>Tutorial</h2>
|
<h2>Tutorial</h2>
|
||||||
<p> Equipping specialisation items will increase the stats of your constructs.</p>
|
<p> Equipping specialisation items will increase the stats of your constructs.</p>
|
||||||
<p> These can also be combined with colours for further specialisation. </p>
|
<p> These can also be combined with colours for further specialisation. </p>
|
||||||
@ -173,7 +173,7 @@ function tutorialStage(tutorial, ws, clearTutorial, instance) {
|
|||||||
const constructTwo = instance.players[0].constructs[1].name;
|
const constructTwo = instance.players[0].constructs[1].name;
|
||||||
const constructThree = instance.players[0].constructs[2].name;
|
const constructThree = instance.players[0].constructs[2].name;
|
||||||
return (
|
return (
|
||||||
<div>
|
<div class='info-item'>
|
||||||
<h2>Tutorial</h2>
|
<h2>Tutorial</h2>
|
||||||
<p> You have now created a construct with an upgraded skill and base spec. </p>
|
<p> You have now created a construct with an upgraded skill and base spec. </p>
|
||||||
<p> The goal is to create three powerful constructs for combat. </p>
|
<p> The goal is to create three powerful constructs for combat. </p>
|
||||||
@ -185,7 +185,7 @@ function tutorialStage(tutorial, ws, clearTutorial, instance) {
|
|||||||
|
|
||||||
if (tutorial === 7) {
|
if (tutorial === 7) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div class='info-item'>
|
||||||
<h2>Tutorial</h2>
|
<h2>Tutorial</h2>
|
||||||
<p> Each round you start with a vbox full of different skills, specs and colours. </p>
|
<p> Each round you start with a vbox full of different skills, specs and colours. </p>
|
||||||
<p> Bits are your currency for buying skills, specs and colours from the vbox. <br />
|
<p> Bits are your currency for buying skills, specs and colours from the vbox. <br />
|
||||||
@ -204,7 +204,7 @@ function tutorialStage(tutorial, ws, clearTutorial, instance) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div class='info-item'>
|
||||||
<h2>Tutorial</h2>
|
<h2>Tutorial</h2>
|
||||||
<p>You've completed the tutorial! Try to create more skill and spec combinations. </p>
|
<p>You've completed the tutorial! Try to create more skill and spec combinations. </p>
|
||||||
<p>You can unequip skills and specs back into the inventory by double clicking. <br />
|
<p>You can unequip skills and specs back into the inventory by double clicking. <br />
|
||||||
@ -235,5 +235,5 @@ module.exports = {
|
|||||||
tutorialConstructDisplay,
|
tutorialConstructDisplay,
|
||||||
tutorialVbox,
|
tutorialVbox,
|
||||||
tutorialStage,
|
tutorialStage,
|
||||||
tutorialShouldDisableEquip
|
tutorialShouldDisableEquip,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -900,11 +900,10 @@ impl Item {
|
|||||||
Item::Bash|
|
Item::Bash|
|
||||||
Item::BashPlus |
|
Item::BashPlus |
|
||||||
Item::BashPlusPlus => format!(
|
Item::BashPlusPlus => format!(
|
||||||
"Bash the target increasing the cooldowns of target skills by 1T.
|
"Bash the target increasing the cooldowns of target skills by 1T. Stuns target for {:?}T.
|
||||||
Deals {:?}% RedPower as red damage and 45% more damage per cooldown increased.
|
Deals {:?}% RedPower as red damage and 45% more damage per cooldown increased.",
|
||||||
Stuns for {:?}T.",
|
self.into_skill().unwrap().effect()[0].get_duration(),
|
||||||
self.into_skill().unwrap().effect()[0].get_skill().unwrap().multiplier(),
|
self.into_skill().unwrap().effect()[0].get_skill().unwrap().multiplier()),
|
||||||
self.into_skill().unwrap().effect()[0].get_duration()),
|
|
||||||
|
|
||||||
Item::Strike|
|
Item::Strike|
|
||||||
Item::StrikePlus |
|
Item::StrikePlus |
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user