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