Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarrough committed Jul 22, 2023
1 parent 02cbec8 commit f1b7d22
Show file tree
Hide file tree
Showing 13 changed files with 299 additions and 471 deletions.
686 changes: 257 additions & 429 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@
"release": "release-it"
},
"devDependencies": {
"ava": "^4.3.3",
"c8": "^7.12.0",
"ava": "^5.3.1",
"c8": "^8.0.0",
"docco": "^0.9.1",
"eslint": "^8.45.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "2.7.1",
"release-it": "^16.1.0",
"vite": "^4.4.4",
"eslint-plugin-prettier": "^5.0.0",
"prettier": "3.0.0",
"release-it": "^16.1.3",
"vite": "^4.4.6",
"vite-plugin-pwa": "^0.16.4"
},
"dependencies": {
"gsap": "^3.12.2",
"htm": "^3.1.1",
"immer": "^9.0.21",
"immer": "^10.0.2",
"preact": "^10.16.0",
"superjson": "^1.13.1",
"tone": "^14.8.49"
Expand Down
28 changes: 14 additions & 14 deletions src/content/dungeon-encounters.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ easyMonsters['Easy does it'] = MonsterRoom(
hp: random(8, 13),
intents: [{damage: 7}, {damage: 11}, {damage: 7}, {block: 9}],
random: 2,
})
}),
)
easyMonsters['Easy does it x2'] = MonsterRoom(
Monster({
Expand All @@ -50,21 +50,21 @@ easyMonsters['Easy does it x2'] = MonsterRoom(
hp: random(8, 13),
intents: [{damage: 6}, {damage: 11}, {damage: 5}, {block: 5}],
random: 1,
})
}),
)
monsters['RNG does it'] = MonsterRoom(
Monster({
hp: random(18, 20),
intents: [{damage: 7}, {damage: 11}, {damage: 7}, {block: 9}],
random: 4,
})
}),
)
monsters['Easy one'] = MonsterRoom(
Monster({
hp: random(33, 37),
intents: [{vulnerable: 1}, {damage: 10}, {damage: 6}, {}, {weak: 1}],
random: 2,
})
}),
)

//not perfect copy of base game monster, but pretty close
Expand All @@ -73,7 +73,7 @@ monsters['jaw worm'] = MonsterRoom(
Monster({
hp: random(40, 44),
intents: [{damage: 11}, {damage: 7, block: 5}, {block: 6}],
})
}),
)
monsters['First double trouble'] = MonsterRoom(
Monster({
Expand All @@ -85,7 +85,7 @@ monsters['First double trouble'] = MonsterRoom(
hp: 29,
intents: [{damage: 9}, {damage: 8}, {weak: 1}, {damage: 6}, {}],
random: 2,
})
}),
)
monsters['Mid sized duo'] = MonsterRoom(
Monster({
Expand All @@ -97,32 +97,32 @@ monsters['Mid sized duo'] = MonsterRoom(
hp: random(50, 54),
intents: [{vulnerable: 1}, {damage: 6}, {damage: 9}, {block: 10}],
random: 2,
})
}),
)
monsters['Tiny Trio'] = MonsterRoom(
Monster({hp: random(12, 15), random: 2, intents: [{damage: 6}]}),
Monster({hp: random(12, 15), random: 2, intents: [{damage: 6}]}),
Monster({hp: random(10, 16), random: 3, intents: [{damage: 6}]})
Monster({hp: random(10, 16), random: 3, intents: [{damage: 6}]}),
)
elites['monster7'] = MonsterRoom(
Monster({
hp: 46,
intents: [{damage: 12}, {block: 6, damage: 11}, {block: 5, damage: 16}, {}, {block: 6}],
})
}),
)
monsters['monster10'] = MonsterRoom(
Monster({
hp: 28,
intents: [{weak: 1}, {block: 10, damage: 10}, {damage: 21}],
})
}),
)

elites['monster9'] = MonsterRoom(
Monster({
hp: 60,
intents: [{damage: 12}, {damage: 11, weak: 1}, {damage: 4, block: 6}],
random: 6,
})
}),
)
elites['Tougher'] = MonsterRoom(Monster({hp: 70, block: 12, intents: [{block: 5}, {damage: 16}]}))
elites['The Trio'] = MonsterRoom(
Expand All @@ -137,15 +137,15 @@ elites['The Trio'] = MonsterRoom(
Monster({
hp: random(39, 46),
intents: [{weak: 1}, {damage: 10}],
})
}),
)

bosses['The Large One'] = MonsterRoom(
Monster({
hp: random(100, 140),
intents: [{damage: 16}, {block: 6}, {damage: 16}, {damage: 7}, {weak: 2}],
random: 5,
})
}),
)
bosses['Scale much?'] = MonsterRoom(
Monster({
Expand All @@ -160,5 +160,5 @@ bosses['Scale much?'] = MonsterRoom(
{damage: 38},
{damage: 45},
],
})
}),
)
2 changes: 1 addition & 1 deletion src/game/dungeon-rooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function Monster(
currentHealth: 42,
maxHealth: 42,
intents: [],
}
},
) {
// By setting props.random to a number, all damage intents will be randomized with this range.
let randomIntents
Expand Down
2 changes: 1 addition & 1 deletion src/game/dungeon.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ export function graphToString(graph) {
let textGraph = graph.map((floor) =>
floor.map((node) => {
return emojiFromNodeType(node.type)
})
}),
)
const str = textGraph.map((floor) => floor.join('')).join('\n')
return str
Expand Down
2 changes: 1 addition & 1 deletion src/ui/card-chooser.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class CardChooser extends Component {
(card) =>
html`<div class="CardBox" onClick=${() => this.clickedCard(card)}>
${Card(card, props.gameState)}
</div>`
</div>`,
)}
</div>
</article>
Expand Down
2 changes: 1 addition & 1 deletion src/ui/dragdrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function enableDragDrop(container, afterRelease) {
if (
cardHasValidTarget(
this.target.getAttribute('data-card-target'),
getTargetStringFromElement(targets[i])
getTargetStringFromElement(targets[i]),
)
) {
targets[i].classList.add(overClass)
Expand Down
14 changes: 7 additions & 7 deletions src/ui/game-screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ stw.dealCards()`)
Escape: () => {
// let openOverlays = this.base.querySelectorAll('.Overlay:not(#Menu)[open]')
let openOverlays = this.base.querySelectorAll(
'#Deck[open], #DrawPile[open], #DiscardPile[open], #Map[open], #exhaustPile[open]'
'#Deck[open], #DrawPile[open], #DiscardPile[open], #Map[open], #exhaustPile[open]',
)
openOverlays.forEach((el) => el.removeAttribute('open'))
this.toggleOverlay('#Menu')
Expand Down Expand Up @@ -307,7 +307,7 @@ stw.dealCards()`)
${
room.monsters &&
room.monsters.map(
(monster) => html`<${Monster} model=${monster} gameState=${state} />`
(monster) => html`<${Monster} model=${monster} gameState=${state} />`,
)
}
</div>
Expand Down Expand Up @@ -367,8 +367,8 @@ stw.dealCards()`)
<${OverlayWithButton} id="exhaustPile" topleft topleft2>
<button class="tooltipped tooltipped-ne" aria-label="The cards you have exhausted" onClick=${() =>
this.toggleOverlay('#exhaustPile')}>E<u>x</u>haust pile ${
state.exhaustPile.length
}</button>
state.exhaustPile.length
}</button>
<div class="Overlay-content">
<${Cards} gameState=${state} type="exhaustPile" />
</div>
Expand All @@ -377,10 +377,10 @@ stw.dealCards()`)
<${OverlayWithButton} id="DiscardPile" bottomright>
<button onClick=${() =>
this.toggleOverlay(
'#DiscardPile'
'#DiscardPile',
)} align-right class="tooltipped tooltipped-nw tooltipped-multiline" aria-label="Cards you've already played. Once the draw pile is empty, these cards are shuffled into your draw pile.">Di<u>s</u>card pile ${
state.discardPile.length
}</button>
state.discardPile.length
}</button>
<div class="Overlay-content">
<${Cards} gameState=${state} type="discardPile" />
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/ui/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class SlayMap extends Component {
const bPos = getPosWithin(bEl, containerElement)
if (!aPos.top) {
throw Error(
"Could not render the svg path. Is the graph's container element rendered/visible?"
"Could not render the svg path. Is the graph's container element rendered/visible?",
)
}
const line = document.createElementNS('http://www.w3.org/2000/svg', 'line')
Expand Down Expand Up @@ -161,7 +161,7 @@ export class SlayMap extends Component {
</slay-map-node>`
})}
</slay-map-row>
`
`,
)}
</slay-map>
`
Expand Down
2 changes: 1 addition & 1 deletion src/ui/slay-the-web.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ customElements.define(
connectedCallback() {
render(html` <${SlayTheWeb} /> `, this)
}
}
},
)
4 changes: 3 additions & 1 deletion src/ui/splash-screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export default class SplashScreen extends Component {
<p>
The game is
<a href="https://github.com/oskarrough/slaytheweb" rel="noreferrer" target="_blank"
>open source</a> and it'd be wonderful with more contributors
>open source</a
>
and it'd be wonderful with more contributors
</p>
</div>
`
Expand Down
8 changes: 3 additions & 5 deletions tests/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {createCard, CardTargets} from '../src/game/cards.js'
import {MonsterRoom, Monster} from '../src/game/dungeon-rooms.js'
import {createTestDungeon} from '../src/content/dungeon-encounters.js'
import {getTargets, getCurrRoom, isCurrRoomCompleted} from '../src/game/utils-state.js'
import {pick} from '../src/game/utils.js'
import {canPlay} from '../src/game/conditions.js'

const a = actions
Expand Down Expand Up @@ -178,7 +177,7 @@ test('weak makes you deal 25% less damage', (t) => {
t.is(
getTargets(nextState, 'enemy0')[0].currentHealth,
32,
'weak is rounded down. 25% of 6 is 4.5, so we deal 4 damage'
'weak is rounded down. 25% of 6 is 4.5, so we deal 4 damage',
)
})

Expand All @@ -189,7 +188,7 @@ test('weak makes a monster deal 25% less damage', (t) => {
t.deepEqual(
getTargets(state, 'enemy0')[0].intents[1],
{damage: 10},
'second turn monster will deal 10 damage'
'second turn monster will deal 10 damage',
)

let nextState = a.endTurn(state)
Expand Down Expand Up @@ -410,7 +409,7 @@ test('target "allEnemies" works for damage as well as power', (t) => {
t.is(room.monsters[1].currentHealth, 13)
t.falsy(
room.monsters[0].powers.vulnerable && room.monsters[1].powers.vulnerable,
'none are vulnerable'
'none are vulnerable',
)
const card = createCard('Thunderclap')
const nextState = a.playCard(state, {card})
Expand Down Expand Up @@ -507,4 +506,3 @@ test('upgraded cards are really upgraded', (t) => {

test.todo('playing defend on an enemy ?')
test.todo('can apply a power to a specific monster')

2 changes: 1 addition & 1 deletion tests/ai.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test.beforeEach((t) => {
state = a.setDungeon(state, Dungeon({width: 3, height: 1}))
state.dungeon.y = 1
state.dungeon.graph[1][0].room = MonsterRoom(
Monster({intents: [{block: 7}, {damage: 10}, {damage: 10}]})
Monster({intents: [{block: 7}, {damage: 10}, {damage: 10}]}),
)
t.context = {state}
})
Expand Down

0 comments on commit f1b7d22

Please sign in to comment.