diff --git a/html-client/src/components/body.component.jsx b/html-client/src/components/body.component.jsx old mode 100755 new mode 100644 index fcb6abcf..7c1b3b8f --- a/html-client/src/components/body.component.jsx +++ b/html-client/src/components/body.component.jsx @@ -39,7 +39,7 @@ function renderBody(props) { type="submit" onClick={() => setGame(null)} > - Return to Main Menu + Back to instance ); diff --git a/html-client/src/components/cryp.list.jsx b/html-client/src/components/cryp.list.jsx old mode 100755 new mode 100644 diff --git a/html-client/src/components/game.container.js b/html-client/src/components/game.container.js index 8adac3fd..17a41dba 100644 --- a/html-client/src/components/game.container.js +++ b/html-client/src/components/game.container.js @@ -8,9 +8,9 @@ const addState = connect( function receiveState(state) { const { ws, game, account, activeSkill, activeIncoming } = state; - function selectSkillTarget(targetTeamId) { + function selectSkillTarget(targetCrypId) { if (activeSkill) { - return ws.sendGameSkill(game.id, activeSkill.crypId, targetTeamId, activeSkill.skill.skill); + return ws.sendGameSkill(game.id, activeSkill.crypId, targetCrypId, activeSkill.skill.skill); } return false; } diff --git a/html-client/src/components/game.jsx b/html-client/src/components/game.jsx old mode 100755 new mode 100644 index 0a81b6a7..f1a2f004 --- a/html-client/src/components/game.jsx +++ b/html-client/src/components/game.jsx @@ -69,7 +69,6 @@ function GamePanel(props) {

{cryp.name}

-

Level {cryp.lvl}

@@ -78,11 +77,9 @@ function GamePanel(props) {
-
{cryp.hp.value} / {cryp.stam.value} HP
- +
{cryp.hp.value} / {cryp.hp.max} HP
+ -
{cryp.xp} / {Math.pow(2, cryp.lvl + 1)} XP
- {effects} {skills} @@ -106,28 +103,28 @@ function GamePanel(props) { )); return ( -
-
-
-
-

{cryp.name}

-

Level {cryp.lvl}

-
-
-
- -
+
selectSkillTarget(cryp.id)} > +
+
+
+
+

{cryp.name}

+
+
+
+ +
+
+
+
{cryp.hp.value} / {cryp.hp.value} HP
+
-
{cryp.hp.value} / {cryp.stam.value} HP
- - -
{cryp.xp} / {Math.pow(2, cryp.lvl + 1)} XP
- - + {effects}
- {effects}
); } @@ -135,46 +132,30 @@ function GamePanel(props) { function OpponentTeam(team) { const cryps = team.cryps.map(OpponentCrypCard); return ( -
selectSkillTarget(team.id)} > +
{cryps}
); } - // style={{ "min-height": "100%" }} - function phaseText(phase) { - switch (phase) { - case 'Skill': - return 'Choose abilities'; - case 'Target': - return 'Block abilities'; - case 'Finish': - return 'Game over'; - } - } - const logs = game.log.reverse().map((l, i) => (
{l}
)); return ( -
-
- {phaseText(game.phase)} -
-
- {PlayerTeam(playerTeam, setActiveSkill)} -
-
-
+
+
+
+ {playerTeam.id} + {PlayerTeam(playerTeam, setActiveSkill)} +
+
+ Round X +
+
+ {otherTeams.id} {otherTeams.map(OpponentTeam)}
-
- {incoming} -
-
+
{logs}
diff --git a/html-client/src/components/login.component.jsx b/html-client/src/components/login.component.jsx old mode 100755 new mode 100644 diff --git a/html-client/src/components/login.container.jsx b/html-client/src/components/login.container.jsx old mode 100755 new mode 100644 diff --git a/html-client/src/events.jsx b/html-client/src/events.jsx index 3eae6e4d..515c535e 100644 --- a/html-client/src/events.jsx +++ b/html-client/src/events.jsx @@ -16,7 +16,8 @@ function registerEvents(store) { } function setGame(game) { - return console.log('EVENT ->', 'game', game); + store.dispatch(actions.setGame(game)); + // return console.log('EVENT ->', 'game', game); } function setAccount(account) { diff --git a/html-client/src/keyboard.jsx b/html-client/src/keyboard.jsx old mode 100755 new mode 100644 diff --git a/html-client/src/main.jsx b/html-client/src/main.jsx old mode 100755 new mode 100644 index 026fcc79..5b414a0c --- a/html-client/src/main.jsx +++ b/html-client/src/main.jsx @@ -17,6 +17,7 @@ const Body = require('./components/body.component'); const store = createStore( combineReducers({ account: reducers.accountReducer, + activeSkill: reducers.activeSkillReducer, combiner: reducers.combinerReducer, game: reducers.gameReducer, cryps: reducers.crypsReducer, diff --git a/html-client/src/reducers.jsx b/html-client/src/reducers.jsx index 2da78ba3..1e44c353 100644 --- a/html-client/src/reducers.jsx +++ b/html-client/src/reducers.jsx @@ -10,6 +10,16 @@ function accountReducer(state = defaultAccount, action) { } } +const defaultActiveSkill = null; +function activeSkillReducer(state = defaultActiveSkill, action) { + switch (action.type) { + case actions.SET_ACTIVE_SKILL: + return action.value; + default: + return state; + } +} + const defaultCryps = null; function crypsReducer(state = defaultCryps, action) { switch (action.type) { @@ -72,6 +82,7 @@ function wsReducer(state = defaultWs, action) { module.exports = { accountReducer, + activeSkillReducer, combinerReducer, crypsReducer, gameReducer, diff --git a/html-client/src/socket.jsx b/html-client/src/socket.jsx old mode 100755 new mode 100644