Skip to content

Commit

Permalink
feat: [#176] Implemented NS & some other expansions weapons
Browse files Browse the repository at this point in the history
  • Loading branch information
annabranco committed Apr 20, 2021
1 parent 066479b commit 26544fa
Show file tree
Hide file tree
Showing 9 changed files with 319 additions and 19 deletions.
38 changes: 38 additions & 0 deletions src/assets/sounds/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import AK47 from './weapons/AK47.mp3';
import AssaultRifle from './weapons/AssaultRifle.mp3';
import AutomaticShotgun from './weapons/AutomaticShotgun.mp3';
import BaseballBat from './weapons/BaseballBat.mp3';
import BatteringRam from './weapons/BatteringRam.mp3';
import Bow from './weapons/Bow.mp3';
import Chainsaw from './weapons/Chainsaw.mp3';
import ColtPython from './weapons/ColtPython.mp3';
import ColtPythonAlt from './weapons/ColtPythonAlt.mp3';
import ConcreteSaw from './weapons/ConcreteSaw.mp3';
import Crossbow from './weapons/Crossbow.mp3';
import Crowbar from './weapons/Crowbar.mp3';
import DesertEagle from './weapons/DesertEagle.mp3';
import DoubleBarrel from './weapons/DoubleBarrel.mp3';
Expand All @@ -15,18 +19,26 @@ import ExpandableBaton from './weapons/ExpandableBaton.mp3';
import FireAxe from './weapons/FireAxe.mp3';
import Flamethrower from './weapons/FlameThrower.mp3';
import Flashbang from './weapons/Flashbang.mp3';
import Handcannon from './weapons/Handcannon.mp3';
import Handgun from './weapons/Handgun.mp3';
import Hatchet from './weapons/Hatchet.mp3';
import JacknJill from './weapons/JacknJill.mp3';
import Katana from './weapons/Katana.mp3';
import Knife from './weapons/Knife.mp3';
import Kukri from './weapons/Kukri.mp3';
import LaGuillotine from './weapons/LaGuillotine.mp3';
import M4 from './weapons/M4.mp3';
import M4CQB from './weapons/M4-CQB.mp3';
import Mac10 from './weapons/Mac10.mp3';
import Machete from './weapons/Machete.mp3';
import Magnum44 from './weapons/Magnum44.mp3';
import Magnum44Alt from './weapons/Magnum44Alt.mp3';
import MasShotgun from './weapons/MasShotgun.mp3';
import MeatCleaver from './weapons/MeatCleaver.mp3';
import Minigun from './weapons/Minigun.mp3';
import Molotov from './weapons/Molotov.mp3';
import Mp5 from './weapons/Mp5.mp3';
import Nailbat from './weapons/Nailbat.mp3';
import NedsAtomicFlashlight from './weapons/NedsAtomicFlashlight.mp3';
import NightStick from './weapons/NightStick.mp3';
import Pan from './weapons/Pan.mp3';
Expand All @@ -35,15 +47,22 @@ import PasGunAlt from './weapons/PasGunAlt.mp3';
import Pistol from './weapons/Pistol.mp3';
import Rifle from './weapons/Rifle.mp3';
import RocketLauncher from './weapons/RocketLauncher.mp3';
import Saber from './weapons/Saber.mp3';
import SamuraiEdge from './weapons/SamuraiEdge.mp3';
import SawedOff from './weapons/SawedOff.mp3';
import SBF from './weapons/SBF.mp3';
import Shotgun from './weapons/Shotgun.mp3';
import SmokeGrenade from './weapons/SmokeGrenade.mp3';
import SPAS12 from './weapons/SPAS12.mp3';
import Special911 from './weapons/Special911.mp3';
import SubMG from './weapons/SubMG.mp3';
import SweetSisters from './weapons/SweetSisters.mp3';
import TaserGun from './weapons/TaserGun.mp3';
import Thompson from './weapons/Thompson.mp3';
import VikingAxe from './weapons/VikingAxe.mp3';
import Wakizashi from './weapons/Wakizashi.mp3';
import Winchester from './weapons/Winchester.mp3';
import ZombKnuckles from './weapons/ZombKnuckles.mp3';

import CarAttack from './actions/car-attack.mp3';
import CarEnterStart from './actions/car-enter-start.mp3';
Expand Down Expand Up @@ -168,13 +187,17 @@ import Rain from './intro/rain.mp3';
import Thunder from './intro/thunder.mp3';

export const SOUNDS = {
AK47,
AssaultRifle,
AutomaticShotgun,
BaseballBat,
BatteringRam,
Bow,
Chainsaw,
ColtPython,
ColtPythonAlt,
ConcreteSaw,
Crossbow,
Crowbar,
DesertEagle,
DoubleBarrel,
Expand All @@ -185,18 +208,26 @@ export const SOUNDS = {
FireAxe,
Flamethrower,
Flashbang,
Handcannon,
Handgun,
Hatchet,
JacknJill,
Katana,
Knife,
Kukri,
LaGuillotine,
M4,
M4CQB,
Mac10,
Machete,
Magnum44,
Magnum44Alt,
MasShotgun,
MeatCleaver,
Minigun,
Molotov,
Mp5,
Nailbat,
NedsAtomicFlashlight,
NightStick,
Pan,
Expand All @@ -205,6 +236,9 @@ export const SOUNDS = {
Pistol,
Rifle,
RocketLauncher,
SBF,
SPAS12,
Saber,
SamuraiEdge,
SawedOff,
Shotgun,
Expand All @@ -213,7 +247,11 @@ export const SOUNDS = {
SubMG,
SweetSisters,
TaserGun,
Thompson,
VikingAxe,
Wakizashi,
Winchester,
ZombKnuckles,
'car-attack': CarAttack,
'car-enter-start': CarEnterStart,
'car-enter': CarEnter,
Expand Down
Binary file removed src/assets/sounds/weapons/Thompsom.mp3
Binary file not shown.
Binary file added src/assets/sounds/weapons/Thompson.mp3
Binary file not shown.
Binary file added src/assets/sounds/weapons/Winchester.mp3
Binary file not shown.
15 changes: 4 additions & 11 deletions src/components/Sections/PlayersSection/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,16 @@ import {
checkIfCharacterCanOpenDoors,
checkIfCharacterHasFlashlight,
checkIfHasAnyActionLeft,
getActionColor,
getCharacterColor,
getCombiningReference,
getMediaQuery,
getXpColor,
handlePromotionEffects,
loadSavedGame,
logger,
orangeThreatThresold,
useStateWithLabel,
useTurnsCounter,
yellowThreatThresold,
totalActions
yellowThreatThresold
} from '../../../utils';
import NewGame from '../../mainSections/NewGame';
import EndGame from '../../gameScreens/EndGame';
Expand Down Expand Up @@ -201,13 +198,11 @@ import {
ExtraActivationImage,
FirstPlayerToken,
FirstPlayerWrapper,
IndicatorsWrapper,
LevelIndicator,
MainButton,
MidScreenTag,
ModalSign,
ModalSignText,
MovementIcon,
NavIconsWrapper,
NextButton,
NoiseIcon,
Expand Down Expand Up @@ -1131,8 +1126,6 @@ const PlayersSection = ({
};

const onFindingItem = slotType => (item, currentSlot = slot - 1) => {
console.log('$$$ item', item);

const updChar = cloneDeep(character);
const findingSlot = slotType === IN_HAND ? slot - 1 : slot - 3;
const hasFlashlight = checkIfCharacterHasFlashlight([
Expand Down Expand Up @@ -1688,9 +1681,9 @@ const PlayersSection = ({
}, [
generalActions,
extraMovementActions,
extraAttackActions[0],
extraAttackActions[1],
extraAttackActions[2],
extraAttackActions[0], // eslint-disable-line react-hooks/exhaustive-deps
extraAttackActions[1], // eslint-disable-line react-hooks/exhaustive-deps
extraAttackActions[2], // eslint-disable-line react-hooks/exhaustive-deps
searchActions,
bonusActions
]);
Expand Down
5 changes: 4 additions & 1 deletion src/components/elements/Items/ItemsSelectorModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ import {
TABLET,
WEAPONS
} from '../../../../constants';
import { ButtonsWrapper, CancelButton } from '../../../gameScreens/TradeArea/styles';
import {
ButtonsWrapper,
CancelButton
} from '../../../gameScreens/TradeArea/styles';
import { SelectorArea } from '../../SoundBlock/styles';
import {
SelectorButton,
Expand Down
26 changes: 22 additions & 4 deletions src/components/gameScreens/ConfigGame/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ const ConfigGame = ({ toggleConfig }) => {
const onClickExpansion = expansion => {
const updRules = { ...rules };
updRules[expansion] = !updRules[expansion];

if (expansion === 'nightShift') {
updRules.season2 = updRules[expansion];
updRules.season3 = updRules[expansion];
updRules.angryNeighbors = updRules[expansion];
updRules.others = updRules[expansion];
}

changeRules(updRules);
};

Expand Down Expand Up @@ -135,12 +143,17 @@ const ConfigGame = ({ toggleConfig }) => {
<CoversWrapper>
{Object.values(SETS).map(set => (
<Cover
active
active={rules[set.name]}
alt={set.label}
key={`Set-${set.name}`}
src={set.cover}
onMouseOver={() => changeSetLabel(set.name)}
onMouseOver={() => changeSetLabel(set.label)}
onMouseOut={() => changeSetLabel()}
onClick={() => changeSetLabel(CANT_DESELECT)}
onClick={() =>
set.deselectable
? onClickExpansion(set.name)
: changeSetLabel(CANT_DESELECT)
}
/>
))}
<CoverLabel>{setLabel}</CoverLabel>
Expand All @@ -154,12 +167,17 @@ const ConfigGame = ({ toggleConfig }) => {
{Object.values(EXPANSIONS).map(expansion => (
<Cover
active={rules[expansion.name]}
alt={expansion.label}
key={`Expansion-${expansion.name}`}
small
src={expansion.cover}
onMouseOver={() => changeExpansionLabel(expansion.label)}
onMouseOut={() => changeExpansionLabel()}
onClick={() => onClickExpansion(expansion.name)}
onClick={() =>
expansion.deselectable
? onClickExpansion(expansion.name)
: changeExpansionLabel(CANT_DESELECT)
}
/>
))}
<CoverLabel>{expansionLabel}</CoverLabel>
Expand Down
46 changes: 45 additions & 1 deletion src/setup/sets.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,46 @@ import {
CHARACTERS_S1,
CHARACTERS_TOXIC_MALL
} from './characters';
import { WEAPONS_S1, WEAPONS_NIGHT_SHIFT, WEAPONS_TOXIC_MALL } from './weapons';
import {
WEAPONS_S1,
WEAPONS_S2,
WEAPONS_S3,
WEAPONS_NIGHT_SHIFT,
WEAPONS_TOXIC_MALL,
WEAPONS_ANGRY_NEIGHBORS,
WEAPONS_OTHERS
} from './weapons';
import { DOGZ, ZOMBIES_S1 } from './zombies';
import { ITEMS_S1, ITEMS_NIGHT_SHIFT, ITEMS_TOXIC_MALL } from './items';

export const SETS = {
season1: {
characters: CHARACTERS_S1,
cover: Season1,
defaultSelected: true,
deselectable: false,
items: ITEMS_S1,
label: 'Season 1',
name: 'season1',
weapons: WEAPONS_S1,
zombies: ZOMBIES_S1
},
season2: {
cover: NightShift,
coverSize: 'small',
deselectable: false,
label: 'Season 2: Prison Outbreak',
name: 'season2',
weapons: WEAPONS_S2
},
season3: {
characters: CHARACTERS_NIGHT_SHIFT,
cover: NightShift,
coverSize: 'small',
deselectable: false,
label: 'Season 3: Rue Morgue',
name: 'season3',
weapons: WEAPONS_S3
}
};

Expand Down Expand Up @@ -63,5 +89,23 @@ export const EXPANSIONS = {
label: 'Night Shift Campaign (beta)',
name: 'nightShift',
weapons: WEAPONS_NIGHT_SHIFT
},
angryNeighbors: {
characters: CHARACTERS_NIGHT_SHIFT,
cover: NightShift,
coverSize: 'small',
deselectable: false,
label: 'Angry Neighbors',
name: 'angryNeighbors',
weapons: WEAPONS_ANGRY_NEIGHBORS
},
others: {
characters: CHARACTERS_NIGHT_SHIFT,
cover: NightShift,
coverSize: 'small',
deselectable: false,
label: 'Kickstarters & Others',
name: 'others',
weapons: WEAPONS_OTHERS
}
};
Loading

0 comments on commit 26544fa

Please sign in to comment.