Skip to content

Commit

Permalink
Merge branch 'master' into attack-add-move-confirm-button
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-atack committed Oct 20, 2021
2 parents bb141fb + 44a01bf commit 454eff3
Show file tree
Hide file tree
Showing 16 changed files with 7 additions and 610 deletions.
3 changes: 0 additions & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@
"dependencies": {
"@material-ui/core": "^4.11.4",
"@material-ui/icons": "^4.11.2",
"immer": "^8.0.1",
"moment": "^2.24.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-redux": "^7.2.0",
"react-router-dom": "^5.1.2",
"react-scripts": "3.4.1",
"redux": "^4.0.5",
"styled-components": "^5.1.0",
"use-sound": "^2.0.1"
},
Expand Down
88 changes: 0 additions & 88 deletions client/src/actions.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ import { attackRange } from '../../../../Helpers/playerCombatHelpers';
import { determineIfBaddieInRange, determineThrowOrTravel } from '../../../../Helpers/playerActionPhase';
import data from '../../../../data/mapSeed.json';
import baddieData from '../../../../data/baddie.json';
import { useDispatch, useSelector } from 'react-redux';
// recoil state management
import combatState from '../../../../state';
import globalState from '../../../../state';
import { useRecoilValue, useRecoilState } from 'recoil'
import { setCombatPhase, setReflexCheck } from '../../../../actions';
// Components:
import Portrait from './Portrait';
import ReflexCheck from '../../ReflexCheck';
Expand All @@ -25,7 +23,6 @@ import AttackAddMove from './AttackAddMove/AttackAddMove';
// Data:
import playerMoves from '../../../../data/playerMoves.json';
import { baddieCoords } from '../../../../state/combatState';
import { bindActionCreators } from 'redux';
// Placeholder temp stuff ???

const CombatUi = ({turn, setEnemyAttackRadius}) => {
Expand All @@ -45,9 +42,6 @@ const CombatUi = ({turn, setEnemyAttackRadius}) => {

const level = useRecoilValue(globalState.level)

// Conditionally render reflex check based on this value (and falsilly don't render on a zero!):
const doReflexCheck = useSelector((state) => state.game.doReflexCheck);

const [combatPhase, setCombatPhase] = useRecoilState(combatState.combatPhase);
const [reflexCheck, setReflexCheck] = useRecoilState(combatState.reflexCheck);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import React from 'react';
import styled from 'styled-components';

import {useSelector} from 'react-redux';
import {useRecoilState, useRecoilValue} from 'recoil';
import combatState from '../../../../state'


const Portrait = ({playerPortrait, selectedSkill, base}) => {
// for this component to work, the naming convention of the baddie json must be, non capitalized.

const combatPhase = useSelector((state) => state.game.combatPhase);
const combatPhase = useRecoilValue(combatState.combatPhase);
const [baddieDecision, setBaddieDecision] = useRecoilState(combatState.baddieDecision);
const status = useRecoilValue(playerPortrait ? combatState.playerStatus : combatState.baddieStatus); // when baddie is complete this will include baddie as well

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import styled from 'styled-components';
import { useDispatch } from 'react-redux';
import combatState from '../../../../state';
import { useRecoilState } from 'recoil';
import { advanceCombatWithMovement } from '../../../../Helpers/generalCombatHelpers';
Expand Down
2 changes: 0 additions & 2 deletions client/src/components/Game/ReflexCheck/ReflexCheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import styled from 'styled-components';
import useSound from 'use-sound';
import ugh from '../../../assets/sounds/ugh-01.mp3';
import { useTime } from '../../../hooks/useTime';
import { useDispatch } from 'react-redux';
import combatState from '../../../state';
import globalState from '../../../state';
import { useRecoilState, useRecoilValue } from 'recoil';
Expand All @@ -12,7 +11,6 @@ import data from '../../../data/mapSeed.json';

// Combo = integer for which of the 3 possible key combos to use for the reflex check:
function ReflexCheck({ combo }) {
const dispatch = useDispatch();
// Update time at very short interval to 'sample' for updates at high frequency:
let now = useTime(20);
const [then, setThen] = React.useState(0);
Expand Down
Loading

0 comments on commit 454eff3

Please sign in to comment.