From d70ee401e34cadfcb455139b7e70616b6f2c2b46 Mon Sep 17 00:00:00 2001 From: Itchy Date: Sat, 2 Dec 2023 20:18:12 +0000 Subject: [PATCH 1/6] Add Schematics Tracking --- src/components/SchematicComponent.vue | 244 +++++++++++++++++++++++ src/components/SchematicsComponent.vue | 121 +++++++++++ src/data/defaults/progress/schematics.js | 23 +++ src/data/requirements/schematics.js | 23 +++ src/data/schematics.js | 11 + src/data/schematics/aetherium.js | 42 ++++ src/data/schematics/ammoMod.js | 42 ++++ src/data/schematics/perkaCola.js | 66 ++++++ src/data/schematics/wonderWeapon.js | 24 +++ src/i18n/locales/en-US.json | 3 +- src/router/index.js | 5 + src/stores/store.js | 36 +++- src/views/SchematicsView.vue | 108 ++++++++++ src/views/SettingsView.vue | 1 + src/views/ZombiesView.vue | 8 + 15 files changed, 755 insertions(+), 2 deletions(-) create mode 100644 src/components/SchematicComponent.vue create mode 100644 src/components/SchematicsComponent.vue create mode 100644 src/data/defaults/progress/schematics.js create mode 100644 src/data/requirements/schematics.js create mode 100644 src/data/schematics.js create mode 100644 src/data/schematics/aetherium.js create mode 100644 src/data/schematics/ammoMod.js create mode 100644 src/data/schematics/perkaCola.js create mode 100644 src/data/schematics/wonderWeapon.js create mode 100644 src/views/SchematicsView.vue diff --git a/src/components/SchematicComponent.vue b/src/components/SchematicComponent.vue new file mode 100644 index 0000000..1ecaba8 --- /dev/null +++ b/src/components/SchematicComponent.vue @@ -0,0 +1,244 @@ + + + + + diff --git a/src/components/SchematicsComponent.vue b/src/components/SchematicsComponent.vue new file mode 100644 index 0000000..33622ef --- /dev/null +++ b/src/components/SchematicsComponent.vue @@ -0,0 +1,121 @@ + + + + + diff --git a/src/data/defaults/progress/schematics.js b/src/data/defaults/progress/schematics.js new file mode 100644 index 0000000..d545956 --- /dev/null +++ b/src/data/defaults/progress/schematics.js @@ -0,0 +1,23 @@ +export default { + 'Uncommon Aether Tool': false, + 'Rare Aether Tool': false, + 'Epic Aether Tool': false, + 'Raw Aetherium Crystal': false, + 'Refined Aetherium Crystal': false, + 'Deadshot Daiquiri Can': false, + 'Speed Cola Can': false, + 'Death Perception Can': false, + 'Elemental Pop Can': false, + 'Jugger-Nog Can': false, + 'PHD Flopper Can': false, + 'Quick Revive Can': false, + 'Stamin-Up Can': false, + 'Tombstone Soda Can': false, + 'Napalm Burst Ammo Mod': false, + 'Shatter Blast Ammo Mod': false, + 'Brain Rot Ammo Mod': false, + 'Cryo Freeze Ammo Mod': false, + 'Dead Wire Ammo Mod': false, + 'Ray Gun': false, + 'Wunderwaffe DG-2': false +} diff --git a/src/data/requirements/schematics.js b/src/data/requirements/schematics.js new file mode 100644 index 0000000..d77cad4 --- /dev/null +++ b/src/data/requirements/schematics.js @@ -0,0 +1,23 @@ +export default { + 'Uncommon Aether Tool': "Act 1 Tier 5 Mission", + 'Rare Aether Tool': "Act 2 Tier 5 Mission", + 'Epic Aether Tool': "Contracts in High Threat Zone", + 'Raw Aetherium Crystal': "Contracts in Medium Threat Zone", + 'Refined Aetherium Crystal': "Contracts in High Threat Zone", + 'Deadshot Daiquiri Can': "Contracts in Low Threat Zone", + 'Speed Cola Can': "Contracts in Low Threat Zone", + 'Death Perception Can': "Act 3 Tier 1 Mission", + 'Elemental Pop Can': "Contracts in High Threat Zone", + 'Jugger-Nog Can': "Contracts in Medium Threat Zone", + 'PHD Flopper Can': "Contracts in Medium Threat Zone", + 'Quick Revive Can': "Act 1 Tier 5 Mission", + 'Stamin-Up Can': "Contracts in Low Threat Zone", + 'Tombstone Soda Can': "Contracts in High Threat Zone", + 'Napalm Burst Ammo Mod': "Contracts in Low Threat Zone", + 'Shatter Blast Ammo Mod': "Contracts in Medium Threat Zone", + 'Brain Rot Ammo Mod': "Contracts in Low Threat Zone", + 'Cryo Freeze Ammo Mod': "Act 2 Tier 2 Mission", + 'Dead Wire Ammo Mod': "Contracts in Medium Threat Zone", + 'Ray Gun': "Contracts in High Threat Zone", + 'Wunderwaffe DG-2': "Contracts in High Threat Zone" +} diff --git a/src/data/schematics.js b/src/data/schematics.js new file mode 100644 index 0000000..30656db --- /dev/null +++ b/src/data/schematics.js @@ -0,0 +1,11 @@ +import aetherium from './schematics/aetherium' +import perkaCola from './schematics/perkaCola' +import ammoMod from './schematics/ammoMod' +import wonderWeapon from './schematics/wonderWeapon' + +export default [ + {category: 'Aetherium', ...aetherium}, + {category: 'Perk-A-Cola', ...perkaCola}, + {category: 'Ammo Mod', ...ammoMod}, + {category: 'Wonder Weapon', ...wonderWeapon}, +] diff --git a/src/data/schematics/aetherium.js b/src/data/schematics/aetherium.js new file mode 100644 index 0000000..3b945d8 --- /dev/null +++ b/src/data/schematics/aetherium.js @@ -0,0 +1,42 @@ +import defaultProgress from '@/data/defaults/progress/schematics' + +// The order of the items in this array is the order they will appear in the app +const schematics = [ + { + name: 'Uncommon Aether Tool', + rarity: 'uncommon', + description: 'Upgrades currently held weapon to Uncommon Rarity.', + cooldown: '2 hour' + }, + { + name: 'Rare Aether Tool', + rarity: 'rare', + description: 'Upgrades currently held weapon to Rare Rarity.', + cooldown: '8 hour' + }, + { + name: 'Epic Aether Tool', + rarity: 'epic', + description: 'Upgrades currently held weapon to Epic Rarity.', + cooldown: '8 hour' + }, + { + name: 'Raw Aetherium Crystal', + rarity: 'epic', + description: 'Pack-A-Punches currently held weapon to Level I.', + cooldown: '8 hour' + }, + { + name: 'Refined Aetherium Crystal', + rarity: 'legendary', + description: 'Pack-A-Punches currently held weapon to Level II.', + cooldown: '8 hour' + } +] + +export default schematics.map((schematic) => ({ + category: 'Aetherium', + comingSoon: schematic.comingSoon || false, + acquired: defaultProgress[schematic.name], + ...schematic +})) diff --git a/src/data/schematics/ammoMod.js b/src/data/schematics/ammoMod.js new file mode 100644 index 0000000..7d14671 --- /dev/null +++ b/src/data/schematics/ammoMod.js @@ -0,0 +1,42 @@ +import defaultProgress from '@/data/defaults/progress/schematics' + +// The order of the items in this array is the order they will appear in the app +const schematics = [ + { + name: 'Napalm Burst Ammo Mod', + rarity: 'rare', + description: 'Applies Napalm Burst to your currently held weapon.', + cooldown: '3 hour' + }, + { + name: 'Shatter Blast Ammo Mod', + rarity: 'rare', + description: 'Applies Shatter Blast to your currently held weapon.', + cooldown: '3 hour' + }, + { + name: 'Brain Rot Ammo Mod', + rarity: 'rare', + description: 'Applies Brain Rot to your currently held weapon.', + cooldown: '3 hour' + }, + { + name: 'Cryo Freeze Ammo Mod', + rarity: 'rare', + description: 'Applies Cryo Freeze to your currently held weapon.', + cooldown: '3 hour' + }, + { + name: 'Dead Wire Ammo Mod', + rarity: 'rare', + description: 'Applies Dead Wire to your currently held weapon.', + cooldown: '3 hour' + } +] + +export default schematics.map((schematic) => ({ + category: 'Ammo Mod', + comingSoon: schematic.comingSoon || false, + acquired: defaultProgress[schematic.name], + ...schematic +})) diff --git a/src/data/schematics/perkaCola.js b/src/data/schematics/perkaCola.js new file mode 100644 index 0000000..feb06e1 --- /dev/null +++ b/src/data/schematics/perkaCola.js @@ -0,0 +1,66 @@ +import defaultProgress from '@/data/defaults/progress/schematics' + +// The order of the items in this array is the order they will appear in the app +const schematics = [ + { + name: 'Deadshot Daiquiri Can', + rarity: 'epic', + description: 'ADS moves to enemy critical location. Remove scope sway.', + cooldown: '3 hour' + }, + { + name: 'Speed Cola Can', + rarity: 'epic', + description: 'Reload and replate amor faster.', + cooldown: '3 hour' + }, + { + name: 'Death Perception Can', + rarity: 'epic', + description: 'Obscured enemies, chests, resources, and item drops are keylined.', + cooldown: '3 hour' + }, + { + name: 'Elemental Pop Can', + rarity: 'epic', + description: 'Every bullet you fire has a small chance to apply a random Ammo Mod effect.', + cooldown: '3 hour' + }, + { + name: 'Jugger-Nog Can', + rarity: 'epic', + description: 'Increases max health.', + cooldown: '3 hour' + }, + { + name: 'PHD Flopper Can', + rarity: 'epic', + description: 'Dive to prone triggers an explosion. The explosion increases the higher you fall. Immunity from fall damage while diving.', + cooldown: '3 hour' + }, + { + name: 'Quick Revive Can', + rarity: 'epic', + description: 'Reduce the health regen delay time by 50%. Reduce the time it takes to revive an ally by 50%.', + cooldown: '3 hour' + }, + { + name: 'Stamin-Up Can', + rarity: 'epic', + description: 'Increase run and sprint speed.', + cooldown: '3 hour' + }, + { + name: 'Tombstone Soda Can', + rarity: 'epic', + description: 'On death create a tombstone stash at that location containing your backpack inventory in the next game.', + cooldown: '3 hour' + } +] + +export default schematics.map((schematic) => ({ + category: 'Perk-A-Cola', + comingSoon: schematic.comingSoon || false, + acquired: defaultProgress[schematic.name], + ...schematic +})) diff --git a/src/data/schematics/wonderWeapon.js b/src/data/schematics/wonderWeapon.js new file mode 100644 index 0000000..806fe99 --- /dev/null +++ b/src/data/schematics/wonderWeapon.js @@ -0,0 +1,24 @@ +import defaultProgress from '@/data/defaults/progress/schematics' + +// The order of the items in this array is the order they will appear in the app +const schematics = [ + { + name: 'Ray Gun', + rarity: 'ultra', + description: 'Ray Gun Weapon Case that can be opened to equip the Ray Gun Wonder Weapon.', + cooldown: '48 hour' + }, + { + name: 'Wunderwaffe DG-2', + rarity: 'ultra', + description: 'Wunderwaffe DG-2 Weapon Case that can be opened to equip the Wunderwaffe DG-2 Wonder Weapon.', + cooldown: '48 hour' + } +] + +export default schematics.map((schematic) => ({ + category: 'Wonder Weapon', + comingSoon: schematic.comingSoon || false, + acquired: defaultProgress[schematic.name], + ...schematic +})) diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index a64e8c8..264728f 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json @@ -34,7 +34,8 @@ "translated_by": ", translated by {0}", "weapon": "Weapon | Weapons", "unlocked": "unlocked", - "zombies": "Zombies" + "zombies": "Zombies", + "schematics": "Schematics" }, "filters": { "hide_completed": "Hide completed", diff --git a/src/router/index.js b/src/router/index.js index 22dd9b1..3d5190b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -34,6 +34,11 @@ const routes = [ name: 'zombies', component: () => import('../views/ZombiesView.vue'), }, + { + path: '/zombies/schematics', + name: 'schematics', + component: () => import('../views/SchematicsView.vue'), + }, { path: '/about', name: 'about', diff --git a/src/stores/store.js b/src/stores/store.js index 789d626..3dc1290 100644 --- a/src/stores/store.js +++ b/src/stores/store.js @@ -2,11 +2,13 @@ import { defineStore } from 'pinia' import { notify } from '@kyvg/vue3-notification' import { filterObject } from '@/utils/utils' import defaultWeapons from '@/data/weapons' +import defaultSchematics from '@/data/schematics' import defaultCallingCards from '@/data/defaults/calling_cards' import defaultFilters from '@/data/defaults/filters' import defaultPreferences from '@/data/defaults/preferences' import weaponRequirements from '@/data/requirements/weapons' import masteryRequirements from '@/data/masteryRequirements' +import schematicRequirements from '@/data/requirements/schematics' import camouflageRequirements from '@/data/requirements/camouflages' import camouflageNameChanges from '@/data/camouflageNameChanges' @@ -28,9 +30,11 @@ export const useStore = defineStore({ filters: {}, weaponRequirements: { ...weaponRequirements }, masteryRequirements: { ...masteryRequirements }, + schematicRequirements: { ...schematicRequirements }, weapons: [], callingCards: {}, preferences: { ...defaultPreferences }, + schematics: [] }), getters: { @@ -39,6 +43,8 @@ export const useStore = defineStore({ weaponCategories: (state) => Array.from(new Set(state.weapons.map((weapon) => weapon.category))), callingCardCompleted: (state) => (card) => state.callingCards[card], + schematicCategories: (state) => + Array.from(new Set(state.schematics.map((schematic) => schematic.category))) }, actions: { @@ -123,17 +129,31 @@ export const useStore = defineStore({ } }, + setSchematics(schematics) { + this.schematics = JSON.parse(JSON.stringify(defaultSchematics)) + + + if (schematics) { + Object.keys(schematics).forEach((key) => { + if (key in defaultSchematics) { + this.schematics[key] = schematics[key] + } + }) + } + }, + getStoredProgress() { const storage = localStorage.getItem(token) if (!storage) { this.setWeapons() + this.setSchematics() this.setCallingCards() this.setFilters() return } - const { weapons, callingCards, filters, beganGrind, favorites, preferences } = + const { weapons, callingCards, filters, beganGrind, favorites, preferences, schematics } = JSON.parse(storage) if (weapons) this.setWeapons(weapons) @@ -142,6 +162,7 @@ export const useStore = defineStore({ if (beganGrind) this.beganGrind = beganGrind if (favorites) this.setFavorites(favorites) if (preferences) this.setPreferences(preferences) + if (schematics) this.setSchematics(schematics) }, storeProgress() { @@ -154,6 +175,7 @@ export const useStore = defineStore({ beganGrind: this.beganGrind || new Date(), favorites: this.favorites, preferences: this.preferences, + schematics: this.schematics }) ) }, @@ -162,6 +184,7 @@ export const useStore = defineStore({ localStorage.removeItem(token) this.setWeapons() this.setCallingCards() + this.setSchematics() this.beganGrind = null notify({ @@ -237,5 +260,16 @@ export const useStore = defineStore({ this.callingCards[card.name] = !current this.storeProgress() }, + + toggleSchematicAcquired(schematic, current) { + for (let category in this.schematics) { + for (let s in this.schematics[category]) { + if (this.schematics[category][s].name === schematic) { + this.schematics[category][s].acquired = !current + } + } + } + this.storeProgress() + }, }, }) diff --git a/src/views/SchematicsView.vue b/src/views/SchematicsView.vue new file mode 100644 index 0000000..2beff55 --- /dev/null +++ b/src/views/SchematicsView.vue @@ -0,0 +1,108 @@ + + + + + diff --git a/src/views/SettingsView.vue b/src/views/SettingsView.vue index f15b0ee..41681c7 100644 --- a/src/views/SettingsView.vue +++ b/src/views/SettingsView.vue @@ -133,6 +133,7 @@ export default { try { const parsedJson = JSON.parse(this.importJsonCode) await this.setWeapons(parsedJson) + await this.setSchematics(parsedJson) await this.storeProgress() this.$notify({ type: 'success', diff --git a/src/views/ZombiesView.vue b/src/views/ZombiesView.vue index 4acf0d8..516a9b6 100644 --- a/src/views/ZombiesView.vue +++ b/src/views/ZombiesView.vue @@ -1,5 +1,11 @@