Skip to content

Commit

Permalink
chore: nerf aby set
Browse files Browse the repository at this point in the history
  • Loading branch information
Mees committed Nov 3, 2024
1 parent 8b360a6 commit 2f292a9
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 26 deletions.
17 changes: 17 additions & 0 deletions src/components/ResourceCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@
{{ storageMultiplierFormatted }}
</span>
</p>
<p
v-if="storageMultiplierEquipment > 1"
class="text-xs sm:text-sm text-gray-600 flex items-center"
>
<span class="font-semibold">Equipment Storage Multiplier:</span>
<span
class="ml-2 inline-block bg-purple-100 text-purple-600 text-xs px-2 py-0.5 rounded-full"
>
{{ storageMultiplierEquipmentFormatted }}
</span>
</p>
</div>

<div class="mt-4">
Expand Down Expand Up @@ -100,13 +111,15 @@ const props = withDefaults(defineProps<{
ratePer?: string
bonus?: number
storageMultiplier?: number
storageMultiplierEquipment?: number
cardClass?: string
unlocked?: boolean
}>(), {
ratePer: '/s',
rate: undefined,
bonus: undefined,
storageMultiplier: undefined,
storageMultiplierEquipment: undefined,
cardClass: 'bg-white p-4 sm:p-6 rounded-lg shadow-lg',
unlocked: true,
})
Expand All @@ -130,6 +143,10 @@ const bonusPercentage = computed(() => {
const storageMultiplierFormatted = computed(() => {
return props.storageMultiplier ? `x${gameStore.formatNumber(props.storageMultiplier, 2)}` : ''
})

const storageMultiplierEquipmentFormatted = computed(() => {
return props.storageMultiplierEquipment ? `x${gameStore.formatNumber(props.storageMultiplierEquipment, 2)}` : ''
})
</script>

<style scoped>
Expand Down
36 changes: 32 additions & 4 deletions src/stores/equipmentStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ interface EquipmentState {
loadOuts: LoadOut[];
maxLoadOuts: number;

storageModifier: number;
storageModifiers: {
larvae: number;
seeds: number;
ants: number;
queen: number;
};
}

interface LoadOut {
Expand Down Expand Up @@ -52,7 +57,12 @@ export const useEquipmentStore = defineStore('equipmentStore', {

loadOuts: [],
maxLoadOuts: 3,
storageModifier: 1,
storageModifiers: {
larvae: 1,
seeds: 1,
ants: 1,
queen: 1,
},
}),
getters: {
getAvailableItemsForSlot: (state) => (slotType: SlotType) => {
Expand All @@ -79,6 +89,14 @@ export const useEquipmentStore = defineStore('equipmentStore', {
},
},
actions: {
maxAllEquipped() {
// Max all equipped items to the max level
Object.values(this.equippedItems).flat().forEach((item) => {
if (item) {
item.level = getMaxItemLevel(item)
}
})
},
getItemFromEquipment(itemId: string): Item | null {
const equippedItems = [
this.equippedItems.head,
Expand Down Expand Up @@ -438,7 +456,12 @@ export const useEquipmentStore = defineStore('equipmentStore', {
this.loadOuts = state.loadOuts ?? []
this.maxLoadOuts = state.maxLoadOuts ?? this.maxLoadOuts
this.maxAccessories = 2
this.storageModifier = 1
this.storageModifiers = {
larvae: 1,
seeds: 1,
ants: 1,
queen: 1,
}
},

loadEquippedItems(equippedItems, context) {
Expand Down Expand Up @@ -506,7 +529,12 @@ export const useEquipmentStore = defineStore('equipmentStore', {

this.maxLoadOuts = 3

this.storageModifier = 1
this.storageModifiers = {
larvae: 1,
seeds: 1,
ants: 1,
queen: 1,
}

// Recalculate set bonuses
this.checkForSetBonus()
Expand Down
10 changes: 5 additions & 5 deletions src/stores/resourcesStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,19 +155,19 @@ export const useResourcesStore = defineStore('resources', {
},
maxAnts: (state) => {
if (state.resources.antHousing === 0) {
return Math.floor(state.storage.maxAnts * state.storageModifiers.ant * state.achievementModifiers.storage.ant * useEquipmentStore().storageModifier)
return Math.floor(state.storage.maxAnts * state.storageModifiers.ant * state.achievementModifiers.storage.ant * useEquipmentStore().storageModifiers.ants)
}

return Math.floor(state.storage.maxAnts + state.resources.antHousing * state.antsPerHousing * state.storageModifiers.ant * state.achievementModifiers.storage.ant * useEquipmentStore().storageModifier)
return Math.floor(state.storage.maxAnts + state.resources.antHousing * state.antsPerHousing * state.storageModifiers.ant * state.achievementModifiers.storage.ant * useEquipmentStore().storageModifiers.ants)
},
maxSeeds: (state) => {
return Math.floor(state.storage.maxSeeds * state.storageModifiers.seed * state.achievementModifiers.storage.seed * useEquipmentStore().storageModifier)
return Math.floor(state.storage.maxSeeds * state.storageModifiers.seed * state.achievementModifiers.storage.seed * useEquipmentStore().storageModifiers.seeds)
},
maxLarvae: (state) => {
return Math.floor(state.storage.maxLarvae * state.storageModifiers.larvae * state.achievementModifiers.storage.larvae * useEquipmentStore().storageModifier)
return Math.floor(state.storage.maxLarvae * state.storageModifiers.larvae * state.achievementModifiers.storage.larvae * useEquipmentStore().storageModifiers.larvae)
},
maxQueens: (state) => {
return Math.floor(state.storage.maxQueens * state.storageModifiers.queen * state.achievementModifiers.storage.queen * useEquipmentStore().storageModifier)
return Math.floor(state.storage.maxQueens * state.storageModifiers.queen * state.achievementModifiers.storage.queen * useEquipmentStore().storageModifiers.queen)
},
maxWorkers: (state) => {
return Math.floor(state.storage.maxAnts * 0.01)
Expand Down
4 changes: 4 additions & 0 deletions src/types/items/itemRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ export interface Item {
}

export function getItemFromRegistry(item: Item): Item {
if (!item.id && !item.name) {
return item
}

const itemFromRegistry = useInventoryStore().getItemById(item.id ?? item.name)

if (itemFromRegistry) {
Expand Down
32 changes: 16 additions & 16 deletions src/types/items/sets/abyssalSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const abyssalSet = [
id: 'abyssal-helm',
name: 'Abyssal Helm',
type: 'equipment',
description: 'Helm that enhances storage by 1.5% per level.',
description: 'Helm that enhances seed storage by 1% per level.',
equipmentType: 'armor',
slotType: 'head',
set: 'Abyssal Set',
Expand All @@ -15,22 +15,22 @@ export const abyssalSet = [
maxLevel: () => {
return useEvolveStore().getMaxItemLevel('Abyssal Set')
},
multiplier: 0.015,
multiplier: 0.01,
effect: ({equipmentStore}, item: Item) => {
const bonusMultiplier = 1 + (item.multiplier * item.level)
equipmentStore.storageModifier *= bonusMultiplier
equipmentStore.storageModifiers.seeds *= bonusMultiplier
return true
},
onRemove: ({equipmentStore}, item: Item) => {
const bonusMultiplier = 1 + (item.multiplier * item.level)
equipmentStore.storageModifier /= bonusMultiplier
equipmentStore.storageModifiers.seeds /= bonusMultiplier
},
evolves: true,
},
{
id: 'abyssal-chestplate',
name: 'Abyssal Chestplate',
description: 'Chestplate that enhances storage by 1.5% per level.',
description: 'Chestplate that enhances larvae storage by 1% per level.',
type: 'equipment',
equipmentType: 'armor',
slotType: 'body',
Expand All @@ -40,22 +40,22 @@ export const abyssalSet = [
maxLevel: () => {
return useEvolveStore().getMaxItemLevel('Abyssal Set')
},
multiplier: 0.015,
multiplier: 0.01,
effect: ({equipmentStore}, item: Item) => {
const bonusMultiplier = 1 + (item.multiplier * item.level)
equipmentStore.storageModifier *= bonusMultiplier
equipmentStore.storageModifiers.larvae *= bonusMultiplier
return true
},
onRemove: ({equipmentStore}, item: Item) => {
const bonusMultiplier = 1 + (item.multiplier * item.level)
equipmentStore.storageModifier /= bonusMultiplier
equipmentStore.storageModifiers.larvae /= bonusMultiplier
},
evolves: true,
},
{
id: 'abyssal-boots',
name: 'Abyssal Boots',
description: 'Boots that enhance storage by 1.5% per level.',
description: 'Boots that enhance ants storage by 0.2% per level.',
type: 'equipment',
equipmentType: 'armor',
slotType: 'legs',
Expand All @@ -65,15 +65,15 @@ export const abyssalSet = [
maxLevel: () => {
return useEvolveStore().getMaxItemLevel('Abyssal Set')
},
multiplier: 0.015,
multiplier: 0.002,
effect: ({equipmentStore}, item: Item) => {
const bonusMultiplier = 1 + (item.multiplier * item.level)
equipmentStore.storageModifier *= bonusMultiplier
equipmentStore.storageModifiers.ants *= bonusMultiplier
return true
},
onRemove: ({equipmentStore}, item: Item) => {
const bonusMultiplier = 1 + (item.multiplier * item.level)
equipmentStore.storageModifier /= bonusMultiplier
equipmentStore.storageModifiers.ants /= bonusMultiplier
},
evolves: true,
},
Expand Down Expand Up @@ -105,7 +105,7 @@ export const abyssalSet = [
{
id: 'abyssal-shield',
name: 'Abyssal Shield',
description: 'Shield that enhances army defense by 1.5% per level.',
description: 'Shield that enhances queen storage by 0.1% per level.',
type: 'equipment',
equipmentType: 'accessory',
slotType: 'accessory',
Expand All @@ -115,15 +115,15 @@ export const abyssalSet = [
maxLevel: () => {
return useEvolveStore().getMaxItemLevel('Abyssal Set')
},
multiplier: 0.015,
multiplier: 0.001,
effect: ({equipmentStore}, item: Item) => {
const bonusMultiplier = 1 + (item.multiplier * item.level)
equipmentStore.defenseModifier *= bonusMultiplier
equipmentStore.storageModifiers.queen *= bonusMultiplier
return true
},
onRemove: ({equipmentStore}, item: Item) => {
const bonusMultiplier = 1 + (item.multiplier * item.level)
equipmentStore.defenseModifier /= bonusMultiplier
equipmentStore.storageModifiers.queen /= bonusMultiplier
},
evolves: true,
},
Expand Down
7 changes: 6 additions & 1 deletion src/views/AntResources.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
:rate="resourcesStore.seedsPerSecond"
:bonus="resourcesStore.productionRates.collectionRateModifier"
:storage-multiplier="resourcesStore.storageModifiers.seed * resourcesStore.achievementModifiers.storage.seed"
:storage-multiplier-equipment="equipmentStore.storageModifiers.seeds"
>
<template #actions>
<StorageButtons
Expand Down Expand Up @@ -73,6 +74,7 @@
:rate-per="'/m'"
:bonus="resourcesStore.productionRates.larvaeProductionModifier"
:storage-multiplier="resourcesStore.storageModifiers.larvae * resourcesStore.achievementModifiers.storage.larvae"
:storage-multiplier-equipment="equipmentStore.storageModifiers.larvae"
>
<template #actions>
<StorageButtons
Expand Down Expand Up @@ -119,6 +121,7 @@
:max-count="resourcesStore.maxAnts"
:rate="resourcesStore.antsPerSecond"
:storage-multiplier="resourcesStore.storageModifiers.ant * resourcesStore.achievementModifiers.storage.ant"
:storage-multiplier-equipment="equipmentStore.storageModifiers.ants"
>
<template #actions>
<div class="w-full flex flex-wrap gap-2">
Expand Down Expand Up @@ -211,6 +214,7 @@
:count="resourcesStore.resources.queens"
:max-count="resourcesStore.maxQueens"
:storage-multiplier="resourcesStore.storageModifiers.queen * resourcesStore.achievementModifiers.storage.queen"
:storage-multiplier-equipment="equipmentStore.storageModifiers.queen"
>
<template #actions>
<div class="flex flex-wrap gap-2">
Expand Down Expand Up @@ -468,11 +472,12 @@ import {useResourcesStore} from '@/stores/resourcesStore'
import {useEvolveStore} from '@/stores/evolveStore'
import ResourceCard from '@/components/ResourceCard.vue'
import AutoToggle from '@/components/AutoToggle.vue'
import {useEquipmentStore} from '@/stores/equipmentStore'
const gameStore = useGameStore()
const resourcesStore = useResourcesStore()
const prestigeStore = usePrestigeStore()
const evolveStore = useEvolveStore()
const equipmentStore = useEquipmentStore()
// Format numbers using the store's function
const formatNumber = gameStore.formatNumber
Expand Down
14 changes: 14 additions & 0 deletions src/views/DebuggerPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@
Max all resources
</button>

<button
class="bg-red-500 hover:bg-red-600 text-white px-6 py-2 rounded-lg shadow-lg focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-opacity-50"
@click="maxAllEquipped()"
>
Max all equipped
</button>

<div class="flex flex-col gap-2">
<div
v-for="(value, key) in resourcesStore.resources"
Expand Down Expand Up @@ -134,6 +141,7 @@ import {useResourcesStore} from '@/stores/resourcesStore'
import {useEvolveStore} from '@/stores/evolveStore'
import {getItemName, itemRegistry} from '@/types/items/itemRegistry'
import {ref} from 'vue'
import { useEquipmentStore } from '@/stores/equipmentStore'
const gameStore = useGameStore()
const resourcesStore = useResourcesStore()
Expand Down Expand Up @@ -167,4 +175,10 @@ const maxAllResources = () => {
resourcesStore.resources.eliteAnts = resourcesStore.storage.maxEliteAnts
}
}
const maxAllEquipped = () => {
const equipmentStore = useEquipmentStore()
equipmentStore.maxAllEquipped()
}
</script>

0 comments on commit 2f292a9

Please sign in to comment.