From 414e8a927b3abc6372f0aa92b6703d37c98b7869 Mon Sep 17 00:00:00 2001 From: ntr Date: Sun, 31 Mar 2019 19:04:04 +1100 Subject: [PATCH] stack --- html-client/cryps.css | 26 +++++++ html-client/src/components/game.component.jsx | 67 +++++++++++++------ server/WORKLOG.md | 8 ++- 3 files changed, 78 insertions(+), 23 deletions(-) diff --git a/html-client/cryps.css b/html-client/cryps.css index 6ed723e3..61b6d22f 100755 --- a/html-client/cryps.css +++ b/html-client/cryps.css @@ -289,7 +289,33 @@ button:hover { /* GAME */ +.game { + display: flex; + height: 100%; +} + +.game-cryp-ctr { + display: flex; + flex-flow: row; + align-items: center; +} + +.game .cryp-box { + flex: 1 1 60%; +} + .cryp-skill-btn.active { animation: whiteblackglow 1s ease 0s 1 normal forwards; animation-iteration-count: 1; +} + +.stack { + display: flex; + flex-flow: column; + align-items: stretch; +} + +.stack-line { + padding-left: 2em; + flex: 1 1 40%; } \ No newline at end of file diff --git a/html-client/src/components/game.component.jsx b/html-client/src/components/game.component.jsx index 22c1e20e..e0993850 100644 --- a/html-client/src/components/game.component.jsx +++ b/html-client/src/components/game.component.jsx @@ -18,10 +18,35 @@ function GamePanel(props) { if (!game) return
...
; + function findCryp(id) { + const team = game.teams.find(t => t.cryps.find(c => c.id === id)); + if (team) return team.cryps.find(c => c.id === id); + return null; + } + const otherTeams = game.teams.filter(t => t.id !== account.id); const playerTeam = game.teams.find(t => t.id === account.id); + function stackElement(c, i) { + let skills = game.stack.filter(s => s.source_cryp_id === c.id).map((s, j) => { + const target = findCryp(s.target_cryp_id); + return ( +
{s.skill} -> {target.name}
+ ); + }); + + if (!skills.length) skills = (
 
); + + return ( +
+ {skills} +
+ ); + } + function Cryp(cryp) { const skills = range(0, 4).map(i => { const s = cryp.skills[i] @@ -42,6 +67,8 @@ function GamePanel(props) { ); }); + const stackSkills = stackElement(cryp); + const stats = [ { stat: 'hp', colour: '#1FF01F' }, { stat: 'red_shield', colour: '#a52a2a' }, @@ -54,22 +81,25 @@ function GamePanel(props) { )); return ( -
-
selectSkillTarget(cryp.id)} > - {molecule} -
{cryp.name}
-
-
- {skills} -
-
- {stats} +
+
+
selectSkillTarget(cryp.id)} > + {molecule} +
{cryp.name}
+
+
+ {skills} +
+
+ {stats} +
+ {stackSkills}
); } @@ -78,7 +108,7 @@ function GamePanel(props) { const cryps = team.cryps.map(c => Cryp(c)); return ( -
+
{cryps}
); @@ -139,11 +169,8 @@ function GamePanel(props) {
 
-
+
{PlayerTeam(playerTeam, setActiveSkill)} -
-
 
-
{otherTeams.map(OpponentTeam)}
diff --git a/server/WORKLOG.md b/server/WORKLOG.md index 1fd4e3a4..20afb1d7 100644 --- a/server/WORKLOG.md +++ b/server/WORKLOG.md @@ -16,10 +16,12 @@ # WORK WORK ## NOW -fix taunt -decay is op -siphon might have a prob +*CLIENT* +show cooldowns +*SERVER* +siphon might have a prob +put ticks on stack at start of phase cryp vbox update defensives in skill.rs