Skip to content

Commit

Permalink
Merge pull request #108 from dan-atack/attack-add-move-confirm-button
Browse files Browse the repository at this point in the history
Attack add move confirm button
  • Loading branch information
dan-atack authored Oct 21, 2021
2 parents 44a01bf + dc0a872 commit f9145b8
Show file tree
Hide file tree
Showing 9 changed files with 290 additions and 22 deletions.
235 changes: 227 additions & 8 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions client/src/Helpers/playerActionPhase.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,12 @@ export const determineIfBaddieInRange = (range, playerCoords, baddieCoords) => {
})
return inRange;
};

export const determineThrowOrTravel = (skill) => {
// See Recoil Combat State for all the options of what strings to return!
if (skill.travelDistance > 0) {
return "travelDestination";
} else {
return "attackTarget"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ const CombatEnvironment = () => {

// Player Attack Data (damage and such) is fetched based on the ID of the 'move' fed to the Reflex Check component:
const [reflexCheck, setReflexCheck] = useRecoilState(combatState.reflexCheck);
const playerAttackData = playerMoveData.find((move) => move.id === reflexCheck.reflexCheckId); // Hacky but effective!

// Baddie Related State Values:
const [baddieHP, setBaddieHP] = useRecoilState(combatState.baddieHP);
Expand Down Expand Up @@ -209,7 +208,7 @@ const CombatEnvironment = () => {
const playerAttack = (x, y) => {
setPlayerAttackRadius([]); // Clear player attack radius once attack is selected.
if (baddieCoords.x === x && baddieCoords.y === y) {
setReflexCheck({...reflexCheck, isReflexCheck: true}); // If the player hits the baddie, begin a reflex check but don't advance combat round.
setReflexCheck(true); // If the player hits the baddie, begin a reflex check but don't advance combat round.
} else { // Otherwise, advance the combat round:
setCombatPhase('specialEvent')
}
Expand Down
Loading

0 comments on commit f9145b8

Please sign in to comment.