Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a887758
WIP
Hacktier Apr 7, 2025
b3e1763
colorized limitedUsage Cards
Hacktier Apr 7, 2025
9a55e78
changed font and adjusted positioning
Hacktier Apr 7, 2025
7e75836
changed line height
Hacktier Apr 7, 2025
efbdee7
Merge branch 'main' into feature/newCardsAndColors
Hacktier Apr 7, 2025
dbca124
added 12 bg images with change function
Hacktier Apr 7, 2025
7992007
optimized
Hacktier Apr 7, 2025
a33a7b8
Merge branch 'main' into improvement/bg-images
Hacktier Apr 7, 2025
5277768
removed custom css
Hacktier Apr 7, 2025
7199ab7
removed style tag
Hacktier Apr 7, 2025
94fdb26
balancing wip
Hacktier Apr 7, 2025
39f9cf3
fixed conflict
Hacktier Apr 7, 2025
721a5a4
started destroying asteroid field
Hacktier Apr 7, 2025
96944d2
started destroying asteroid field
Hacktier Apr 7, 2025
3faf74e
changed shipwreck event to spawn card
Hacktier Apr 7, 2025
eba5e85
filled distress signal card actions
Hacktier Apr 7, 2025
4550469
added action to radar
Hacktier Apr 7, 2025
cb3c324
only reveal events if there is something to reveal
Hacktier Apr 7, 2025
40b9e4f
added pages dir?
Hacktier Apr 7, 2025
218d7b6
evaluated if card is stacked
Hacktier Apr 7, 2025
c2ddb3c
updated startup board
Hacktier Apr 7, 2025
c131ac4
changed 3 imgs
Hacktier Apr 7, 2025
03c2348
added soundeffects
Hacktier Apr 8, 2025
02f3a1f
Update composables/actions/replace.ts
Hacktier Apr 8, 2025
9f8ff65
Merge branch 'main' into feature/sounds
Hacktier Apr 8, 2025
23e05da
Merge branch 'main' into feature/sounds
Hacktier Apr 8, 2025
3e1bf2f
repaired broken index after merge
Hacktier Apr 8, 2025
2f79fa5
adjusted baby volume
Hacktier Apr 8, 2025
8cf3222
Merge branch 'main' into feature/sounds
Hacktier Apr 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions composables/actions/replace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ export const replace: Action = (action: CardsCollectionItem['interactions'][0]['
const card = cardStore.getCardByIdentifier(action.card)
assert(card !== undefined, 'Card not found!')

if (action.sound) {
const audio = new Audio('/sounds/' + action.sound)
audio.play()
}

boardStore.removeCard(baseCard)
boardStore.addCard(card, baseCard.x, baseCard.z)
}
10 changes: 10 additions & 0 deletions composables/actions/spawn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ export const spawn: Action = (action: CardsCollectionItem['interactions'][0]['ac
const card = cardStore.getCardByIdentifier(action.card)
assert(card !== undefined, 'Card not found!')

if (action.sound && !action.instantSound) {
const audio = new Audio('/sounds/' + action.sound)

if (action.soundVolume) {
audio.volume = action.soundVolume
}

audio.play()
}

const amount = typeof action.amount === 'number'
? action.amount
: action.amount?.min && action.amount?.max
Expand Down
7 changes: 6 additions & 1 deletion composables/actions/trade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ import type { CardsCollectionItem } from '@nuxt/content'
import type { BoardCard } from '~/types/Board'
import type { Action } from '~/types/Action'

export const trade: Action = (_action: CardsCollectionItem['interactions'][0]['actions'][0], baseCard: BoardCard, _interactingCard: BoardCard) => {
export const trade: Action = (action: CardsCollectionItem['interactions'][0]['actions'][0], baseCard: BoardCard, _interactingCard: BoardCard) => {
const boardStore = useBoardStore()

assert(baseCard.buyableCard !== undefined, 'Action `trade` requires the base card to have a buyable card!')
assert(baseCard.buyableAmount !== undefined, 'Action `trade` requires the base card to have a buyable amount!')

if (action.sound && !action.instantSound) {
const audio = new Audio('/sounds/' + action.sound)
audio.play()
}

if (baseCard.buyableAmount > 3) {
const { x, y } = getDropCoordinates(baseCard.x, baseCard.z)
boardStore.addCard(baseCard.buyableCard, x, y, true, baseCard.buyableAmount)
Expand Down
9 changes: 9 additions & 0 deletions composables/useInteraction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ export const useInteraction = (draggingCard: BoardCard) => {
return
}

const action = boardCard.currentInteraction.actions.find(
action => !!action.sound && action.instantSound,
)

if (action) {
const audio = new Audio('/sounds/' + action.sound)
audio.play()
}

boardCard.interactionStartAt = Date.now()
boardCard.interactionFinishAt = (new Date(Date.now() + (interaction.time ?? 0) * 1000)).getTime()
boardCard.interactionProgress = 0
Expand Down
3 changes: 3 additions & 0 deletions content.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const actionsType = z.array(z.object({
type: z.string(),
card: z.string().optional(),
amount: amountType.optional(),
sound: z.string().optional(),
instantSound: z.boolean().optional(),
soundVolume: z.number().gte(0).lte(1).optional(),
actions: z.array(z.object({
type: z.string(),
card: z.string().optional(),
Expand Down
62 changes: 62 additions & 0 deletions content/cards/distressSignal.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,68 @@
]
},
{
"type": "random",
"actions": [
{
"type": "spawn",
"card": "pirate",
"sound": "pirate-1.mp3",
"soundVolume": 0.5,
"amount": {
"min": 1,
"max": 3
}
},
{
"type": "spawn",
"card": "pirate",
"sound": "pirate-1.mp3",
"soundVolume": 0.5,
"amount": {
"min": 1,
"max": 3
}
},
{
"type": "spawn",
"card": "pirate",
"sound": "pirate-2.mp3",
"soundVolume": 0.5,
"amount": {
"min": 1,
"max": 3
}
},
{
"type": "spawn",
"card": "pirate",
"sound": "pirate-2.mp3",
"soundVolume": 0.5,
"amount": {
"min": 1,
"max": 3
}
},
{
"type": "spawn",
"card": "pirate",
"sound": "pirate-2.mp3",
"soundVolume": 0.5,
"amount": {
"min": 1,
"max": 3
}
},
{
"type": "spawn",
"card": "pirate",
"sound": "pirate-3.mp3",
"amount": {
"min": 1,
"max": 3
}
}
]
"type": "spawn",
"card": "pirate",
"amount": {
Expand Down
3 changes: 2 additions & 1 deletion content/cards/helmsman.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"actions": [
{
"type": "replace",
"card": "worker"
"card": "worker",
"sound": "brainrot.mp3"
}
]
}
Expand Down
6 changes: 5 additions & 1 deletion content/cards/hyperdrive.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"actions": [
{
"type": "travel",
"amount": 10
"amount": 10,
"sound": "hyperdrive.mp3",
"instantSound": true
},
{
"type": "destroy"
Expand All @@ -26,6 +28,7 @@
"actions": [
{
"type": "travel",
"sound": "hyperdrive.mp3"
"amount": 10
},
{
Expand All @@ -39,6 +42,7 @@
"actions": [
{
"type": "travel",
"sound": "hyperdrive.mp3"
"amount": 10
},
{
Expand Down
3 changes: 2 additions & 1 deletion content/cards/medic.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"actions": [
{
"type": "replace",
"card": "worker"
"card": "worker",
"sound": "brainrot.mp3"
}
]
}
Expand Down
3 changes: 2 additions & 1 deletion content/cards/miner.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"actions": [
{
"type": "replace",
"card": "worker"
"card": "worker",
"sound": "brainrot.mp3"
}
]
}
Expand Down
3 changes: 2 additions & 1 deletion content/cards/soldier.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"actions": [
{
"type": "replace",
"card": "worker"
"card": "worker",
"sound": "brainrot.mp3"
}
]
}
Expand Down
3 changes: 2 additions & 1 deletion content/cards/trade.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"amount": 1,
"actions": [
{
"type": "trade"
"type": "trade",
"sound": "trade.mp3"
},
{
"type": "destroy"
Expand Down
4 changes: 3 additions & 1 deletion content/cards/tradeLink.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
{
"type": "spawn",
"card": "merchant",
"amount": 1
"amount": 1,
"sound": "merchant-call.mp3",
"instantSound": true
}
]
}
Expand Down
8 changes: 6 additions & 2 deletions content/cards/worker.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"actions": [
{
"type": "spawn",
"card": "baby"
"card": "baby",
"sound": "baby.mp3",
"soundVolume": 0.25
}
]
},
Expand All @@ -26,7 +28,9 @@
"actions": [
{
"type": "replace",
"card": "baby"
"card": "baby",
"sound": "baby.mp3",
"soundVolume": 0.25
}
]
},
Expand Down
1 change: 1 addition & 0 deletions content/events/asteroid-storm.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
{
"type": "spawn",
"card": "asteroid",
"sound": "asteroid.mp3",
"amount": {
"min": 1,
"max": 2
Expand Down
68 changes: 62 additions & 6 deletions content/events/pirate-attack.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,68 @@
"type": "negative",
"actions": [
{
"type": "spawn",
"card": "pirate",
"amount": {
"min": 1,
"max": 3
}
"type": "random",
"actions": [
{
"type": "spawn",
"card": "pirate",
"sound": "pirate-1.mp3",
"soundVolume": 0.5,
"amount": {
"min": 1,
"max": 3
}
},
{
"type": "spawn",
"card": "pirate",
"sound": "pirate-1.mp3",
"soundVolume": 0.5,
"amount": {
"min": 1,
"max": 3
}
},
{
"type": "spawn",
"card": "pirate",
"sound": "pirate-2.mp3",
"soundVolume": 0.5,
"amount": {
"min": 1,
"max": 3
}
},
{
"type": "spawn",
"card": "pirate",
"sound": "pirate-2.mp3",
"soundVolume": 0.5,
"amount": {
"min": 1,
"max": 3
}
},
{
"type": "spawn",
"card": "pirate",
"sound": "pirate-2.mp3",
"soundVolume": 0.5,
"amount": {
"min": 1,
"max": 3
}
},
{
"type": "spawn",
"card": "pirate",
"sound": "pirate-3.mp3",
"amount": {
"min": 1,
"max": 3
}
}
]
}
]
}
Binary file modified public/background-images/space-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/background-images/space-7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/background-images/space-9.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/sounds/asteroid.mp3
Binary file not shown.
Binary file added public/sounds/baby.mp3
Binary file not shown.
Binary file added public/sounds/brainrot.mp3
Binary file not shown.
Binary file added public/sounds/hyperdrive.mp3
Binary file not shown.
Binary file added public/sounds/merchant-call.mp3
Binary file not shown.
Binary file added public/sounds/pirate-1.mp3
Binary file not shown.
Binary file added public/sounds/pirate-2.mp3
Binary file not shown.
Binary file added public/sounds/pirate-3.mp3
Binary file not shown.
Binary file added public/sounds/trade.mp3
Binary file not shown.