move combat text
This commit is contained in:
parent
9e5a612739
commit
3e8634e6c7
@ -206,7 +206,6 @@
|
|||||||
font-size: 2em;
|
font-size: 2em;
|
||||||
font-family: 'Jura';
|
font-family: 'Jura';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
object-fit: contain;
|
|
||||||
top: 15%;
|
top: 15%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -118,7 +118,6 @@ function animations(props) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const combatAnim = anim(event.skill);
|
const combatAnim = anim(event.skill);
|
||||||
|
|
||||||
if (combatAnim) {
|
if (combatAnim) {
|
||||||
return (
|
return (
|
||||||
<div class={'combat-anim'}>
|
<div class={'combat-anim'}>
|
||||||
@ -127,15 +126,6 @@ function animations(props) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stages.includes('POST_SKILL')) {
|
|
||||||
const combatText = getCombatText(resolution);
|
|
||||||
return (
|
|
||||||
<div class={'combat-text'}>
|
|
||||||
{combatText}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div></div>);
|
<div></div>);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@ const { connect } = require('preact-redux');
|
|||||||
const preact = require('preact');
|
const preact = require('preact');
|
||||||
const range = require('lodash/range');
|
const range = require('lodash/range');
|
||||||
|
|
||||||
const { STATS, eventClasses } = require('../utils');
|
const { STATS, eventClasses, getCombatText } = require('../utils');
|
||||||
const { ConstructAvatar } = require('./construct');
|
const { ConstructAvatar } = require('./construct');
|
||||||
const animations = require('./animations');
|
const animations = require('./animations');
|
||||||
const shapes = require('./shapes');
|
const shapes = require('./shapes');
|
||||||
@ -78,8 +78,8 @@ function GameConstruct(props) {
|
|||||||
? construct.effects.map(c => <div key={c.effect}>{c.effect} - {c.duration}T</div>)
|
? construct.effects.map(c => <div key={c.effect}>{c.effect} - {c.duration}T</div>)
|
||||||
: <div> </div>;
|
: <div> </div>;
|
||||||
|
|
||||||
const combatInfo = animations({ game, account, resolution, player, construct });
|
const combatAnim = animations({ game, account, resolution, player, construct });
|
||||||
|
const combatText = getCombatText(resolution, construct);
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
onClick={() => selectSkillTarget(construct.id)}
|
onClick={() => selectSkillTarget(construct.id)}
|
||||||
@ -89,7 +89,8 @@ function GameConstruct(props) {
|
|||||||
{crypSkills}
|
{crypSkills}
|
||||||
<div class="stats"> {stats} </div>
|
<div class="stats"> {stats} </div>
|
||||||
<ConstructAvatar name={construct.name} id={construct.id} />
|
<ConstructAvatar name={construct.name} id={construct.id} />
|
||||||
{combatInfo}
|
{combatAnim}
|
||||||
|
<div class={'combat-text'}> {combatText} </div>
|
||||||
<div class="effects"> {effects} </div>
|
<div class="effects"> {effects} </div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -200,8 +200,10 @@ function getCombatSequence(resolution) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCombatText(resolution) {
|
function getCombatText(resolution, construct) {
|
||||||
if (!resolution) return false;
|
if (!resolution) return false;
|
||||||
|
if (!resolution.stages.includes('POST_SKILL')) return false;
|
||||||
|
if (construct.id !== resolution.target.id) return false;
|
||||||
|
|
||||||
const [type, event] = resolution.event;
|
const [type, event] = resolution.event;
|
||||||
if (type === 'Ko') {
|
if (type === 'Ko') {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user