Skip to content

Commit

Permalink
feat: add item effects
Browse files Browse the repository at this point in the history
  • Loading branch information
Mezeman1 committed Sep 7, 2024
1 parent 1560059 commit f5695af
Show file tree
Hide file tree
Showing 8 changed files with 363 additions and 198 deletions.
2 changes: 1 addition & 1 deletion .eslintcache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"C:\\Development\\IdleViteVue\\.eslintrc.js":"1","C:\\Development\\IdleViteVue\\postcss.config.js":"2","C:\\Development\\IdleViteVue\\tailwind.config.js":"3","C:\\Development\\IdleViteVue\\vite.config.js":"4","C:\\Development\\IdleViteVue\\src\\App.vue":"5","C:\\Development\\IdleViteVue\\src\\main.ts":"6","C:\\Development\\IdleViteVue\\src\\routes.ts":"7","C:\\Development\\IdleViteVue\\src\\shims-vue.d.ts":"8","C:\\Development\\IdleViteVue\\src\\store.ts":"9","C:\\Development\\IdleViteVue\\src\\components\\AntSimulation.vue":"10","C:\\Development\\IdleViteVue\\src\\views\\Adventure.vue":"11","C:\\Development\\IdleViteVue\\src\\views\\AntResources.vue":"12","C:\\Development\\IdleViteVue\\src\\views\\Home.vue":"13","C:\\Development\\IdleViteVue\\src\\views\\NotFound.vue":"14","C:\\Development\\IdleViteVue\\src\\stores\\adventureStore.ts":"15","C:\\Development\\IdleViteVue\\src\\stores\\gameStore.ts":"16","C:\\Development\\IdleViteVue\\src\\views\\Debugger.vue":"17"},{"size":758,"mtime":1725657576729},{"size":83,"mtime":1725657576792},{"size":589,"mtime":1725657576811},{"size":177,"mtime":1725657576822},{"size":83,"mtime":1725657506695,"results":"18","hashOfConfig":"19"},{"size":1492,"mtime":1725657506695,"results":"20","hashOfConfig":"19"},{"size":272,"mtime":1725660566335,"results":"21","hashOfConfig":"19"},{"size":120,"mtime":1725474178300,"results":"22","hashOfConfig":"19"},{"size":90,"mtime":1725474178300,"results":"23","hashOfConfig":"19"},{"size":14558,"mtime":1725706247085,"results":"24","hashOfConfig":"19"},{"size":3050,"mtime":1725657506695,"results":"25","hashOfConfig":"19"},{"size":8262,"mtime":1725707031886,"results":"26","hashOfConfig":"19"},{"size":4857,"mtime":1725707215666,"results":"27","hashOfConfig":"19"},{"size":436,"mtime":1725474178301,"results":"28","hashOfConfig":"19"},{"size":4924,"mtime":1725657506695,"results":"29","hashOfConfig":"19"},{"size":14202,"mtime":1725707348142,"results":"30","hashOfConfig":"19"},{"size":1820,"mtime":1725706194569},{"filePath":"31","messages":"32","suppressedMessages":"33","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"adzkch",{"filePath":"34","messages":"35","suppressedMessages":"36","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"37","messages":"38","suppressedMessages":"39","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"40","messages":"41","suppressedMessages":"42","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"43","messages":"44","suppressedMessages":"45","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"46","messages":"47","suppressedMessages":"48","errorCount":0,"fatalErrorCount":0,"warningCount":9,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"49","messages":"50","suppressedMessages":"51","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"52","messages":"53","suppressedMessages":"54","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"55","messages":"56","suppressedMessages":"57","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"58","messages":"59","suppressedMessages":"60","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"61","messages":"62","suppressedMessages":"63","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"64","messages":"65","suppressedMessages":"66","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Development\\IdleViteVue\\src\\App.vue",[],[],"C:\\Development\\IdleViteVue\\src\\main.ts",[],[],"C:\\Development\\IdleViteVue\\src\\routes.ts",[],[],"C:\\Development\\IdleViteVue\\src\\shims-vue.d.ts",[],[],"C:\\Development\\IdleViteVue\\src\\store.ts",[],[],"C:\\Development\\IdleViteVue\\src\\components\\AntSimulation.vue",["67","68","69","70","71","72","73","74","75"],[],"C:\\Development\\IdleViteVue\\src\\views\\Adventure.vue",[],[],"C:\\Development\\IdleViteVue\\src\\views\\AntResources.vue",[],[],"C:\\Development\\IdleViteVue\\src\\views\\Home.vue",["76"],[],"C:\\Development\\IdleViteVue\\src\\views\\NotFound.vue",[],[],"C:\\Development\\IdleViteVue\\src\\stores\\adventureStore.ts",[],[],"C:\\Development\\IdleViteVue\\src\\stores\\gameStore.ts",[],[],{"ruleId":"77","severity":1,"message":"78","line":240,"column":49,"nodeType":"79","messageId":"80","endLine":240,"endColumn":62,"suggestions":"81"},{"ruleId":"77","severity":1,"message":"78","line":242,"column":62,"nodeType":"79","messageId":"80","endLine":242,"endColumn":75,"suggestions":"82"},{"ruleId":"77","severity":1,"message":"78","line":244,"column":49,"nodeType":"79","messageId":"80","endLine":244,"endColumn":62,"suggestions":"83"},{"ruleId":"77","severity":1,"message":"78","line":246,"column":62,"nodeType":"79","messageId":"80","endLine":246,"endColumn":75,"suggestions":"84"},{"ruleId":"77","severity":1,"message":"78","line":269,"column":3,"nodeType":"79","messageId":"80","endLine":269,"endColumn":13,"suggestions":"85"},{"ruleId":"77","severity":1,"message":"78","line":282,"column":3,"nodeType":"79","messageId":"80","endLine":282,"endColumn":13,"suggestions":"86"},{"ruleId":"77","severity":1,"message":"78","line":283,"column":3,"nodeType":"79","messageId":"80","endLine":283,"endColumn":13,"suggestions":"87"},{"ruleId":"77","severity":1,"message":"78","line":283,"column":29,"nodeType":"79","messageId":"80","endLine":283,"endColumn":42,"suggestions":"88"},{"ruleId":"77","severity":1,"message":"78","line":283,"column":50,"nodeType":"79","messageId":"80","endLine":283,"endColumn":63,"suggestions":"89"},{"ruleId":"90","severity":1,"message":"91","line":82,"column":7,"nodeType":"92","messageId":"93","endLine":82,"endColumn":14},"@typescript-eslint/no-non-null-assertion","Forbidden non-null assertion.","TSNonNullExpression","noNonNull",["94"],["95"],["96"],["97"],["98"],["99"],["100"],["101"],["102"],"@typescript-eslint/no-unused-vars","'element' is assigned a value but never used.","Identifier","unusedVar",{"messageId":"103","fix":"104","desc":"105"},{"messageId":"103","fix":"106","desc":"105"},{"messageId":"103","fix":"107","desc":"105"},{"messageId":"103","fix":"108","desc":"105"},{"messageId":"103","fix":"109","desc":"105"},{"messageId":"103","fix":"110","desc":"105"},{"messageId":"103","fix":"111","desc":"105"},{"messageId":"103","fix":"112","desc":"105"},{"messageId":"103","fix":"113","desc":"105"},"suggestOptionalChain",{"range":"114","text":"115"},"Consider using the optional chain operator `?.` instead. This operator includes runtime checks, so it is safer than the compile-only non-null assertion operator.",{"range":"116","text":"115"},{"range":"117","text":"115"},{"range":"118","text":"115"},{"range":"119","text":"115"},{"range":"120","text":"115"},{"range":"121","text":"115"},{"range":"122","text":"115"},{"range":"123","text":"115"},[8279,8280],"?",[8422,8423],[8517,8518],[8656,8657],[9342,9343],[9721,9722],[9776,9777],[9805,9806],[9826,9827]]
[{"C:\\Development\\IdleViteVue\\.eslintrc.js":"1","C:\\Development\\IdleViteVue\\postcss.config.js":"2","C:\\Development\\IdleViteVue\\tailwind.config.js":"3","C:\\Development\\IdleViteVue\\vite.config.js":"4","C:\\Development\\IdleViteVue\\src\\App.vue":"5","C:\\Development\\IdleViteVue\\src\\main.ts":"6","C:\\Development\\IdleViteVue\\src\\routes.ts":"7","C:\\Development\\IdleViteVue\\src\\shims-vue.d.ts":"8","C:\\Development\\IdleViteVue\\src\\store.ts":"9","C:\\Development\\IdleViteVue\\src\\components\\AntSimulation.vue":"10","C:\\Development\\IdleViteVue\\src\\views\\Adventure.vue":"11","C:\\Development\\IdleViteVue\\src\\views\\AntResources.vue":"12","C:\\Development\\IdleViteVue\\src\\views\\Home.vue":"13","C:\\Development\\IdleViteVue\\src\\views\\NotFound.vue":"14","C:\\Development\\IdleViteVue\\src\\stores\\adventureStore.ts":"15","C:\\Development\\IdleViteVue\\src\\stores\\gameStore.ts":"16","C:\\Development\\IdleViteVue\\src\\views\\Debugger.vue":"17","C:\\Development\\IdleViteVue\\src\\views\\Inventory.vue":"18","C:\\Development\\IdleViteVue\\src\\stores\\inventoryStore.ts":"19","C:\\Development\\IdleViteVue\\src\\types\\Item.ts":"20","C:\\Development\\IdleViteVue\\src\\components\\InventoryItem.vue":"21"},{"size":758,"mtime":1725657576729},{"size":83,"mtime":1725657576792},{"size":666,"mtime":1725714369965},{"size":177,"mtime":1725657576822},{"size":83,"mtime":1725657506695,"results":"22","hashOfConfig":"23"},{"size":1492,"mtime":1725657506695,"results":"24","hashOfConfig":"23"},{"size":272,"mtime":1725660566335,"results":"25","hashOfConfig":"23"},{"size":120,"mtime":1725474178300,"results":"26","hashOfConfig":"23"},{"size":90,"mtime":1725474178300,"results":"27","hashOfConfig":"23"},{"size":14558,"mtime":1725706247085,"results":"28","hashOfConfig":"23"},{"size":3050,"mtime":1725657506695,"results":"29","hashOfConfig":"23"},{"size":8262,"mtime":1725707031886,"results":"30","hashOfConfig":"23"},{"size":5827,"mtime":1725707889321,"results":"31","hashOfConfig":"23"},{"size":436,"mtime":1725474178301,"results":"32","hashOfConfig":"23"},{"size":5417,"mtime":1725712752927,"results":"33","hashOfConfig":"23"},{"size":14504,"mtime":1725712859904,"results":"34","hashOfConfig":"23"},{"size":1820,"mtime":1725706194569},{"size":4579,"mtime":1725713828750},{"size":1691,"mtime":1725712859910},{"size":0,"mtime":1725711503832,"results":"35","hashOfConfig":"23"},{"size":661,"mtime":1725714221150},{"filePath":"36","messages":"37","suppressedMessages":"38","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"adzkch",{"filePath":"39","messages":"40","suppressedMessages":"41","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"42","messages":"43","suppressedMessages":"44","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"45","messages":"46","suppressedMessages":"47","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"48","messages":"49","suppressedMessages":"50","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"51","messages":"52","suppressedMessages":"53","errorCount":0,"fatalErrorCount":0,"warningCount":9,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"54","messages":"55","suppressedMessages":"56","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"57","messages":"58","suppressedMessages":"59","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"60","messages":"61","suppressedMessages":"62","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"63","messages":"64","suppressedMessages":"65","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"66","messages":"67","suppressedMessages":"68","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"69","messages":"70","suppressedMessages":"71","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"72","messages":"73","suppressedMessages":"74","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Development\\IdleViteVue\\src\\App.vue",[],[],"C:\\Development\\IdleViteVue\\src\\main.ts",[],[],"C:\\Development\\IdleViteVue\\src\\routes.ts",[],[],"C:\\Development\\IdleViteVue\\src\\shims-vue.d.ts",[],[],"C:\\Development\\IdleViteVue\\src\\store.ts",[],[],"C:\\Development\\IdleViteVue\\src\\components\\AntSimulation.vue",["75","76","77","78","79","80","81","82","83"],[],"C:\\Development\\IdleViteVue\\src\\views\\Adventure.vue",[],[],"C:\\Development\\IdleViteVue\\src\\views\\AntResources.vue",[],[],"C:\\Development\\IdleViteVue\\src\\views\\Home.vue",["84"],[],"C:\\Development\\IdleViteVue\\src\\views\\NotFound.vue",[],[],"C:\\Development\\IdleViteVue\\src\\stores\\adventureStore.ts",[],[],"C:\\Development\\IdleViteVue\\src\\stores\\gameStore.ts",[],[],"C:\\Development\\IdleViteVue\\src\\types\\Item.ts",[],[],{"ruleId":"85","severity":1,"message":"86","line":240,"column":49,"nodeType":"87","messageId":"88","endLine":240,"endColumn":62,"suggestions":"89"},{"ruleId":"85","severity":1,"message":"86","line":242,"column":62,"nodeType":"87","messageId":"88","endLine":242,"endColumn":75,"suggestions":"90"},{"ruleId":"85","severity":1,"message":"86","line":244,"column":49,"nodeType":"87","messageId":"88","endLine":244,"endColumn":62,"suggestions":"91"},{"ruleId":"85","severity":1,"message":"86","line":246,"column":62,"nodeType":"87","messageId":"88","endLine":246,"endColumn":75,"suggestions":"92"},{"ruleId":"85","severity":1,"message":"86","line":269,"column":3,"nodeType":"87","messageId":"88","endLine":269,"endColumn":13,"suggestions":"93"},{"ruleId":"85","severity":1,"message":"86","line":282,"column":3,"nodeType":"87","messageId":"88","endLine":282,"endColumn":13,"suggestions":"94"},{"ruleId":"85","severity":1,"message":"86","line":283,"column":3,"nodeType":"87","messageId":"88","endLine":283,"endColumn":13,"suggestions":"95"},{"ruleId":"85","severity":1,"message":"86","line":283,"column":29,"nodeType":"87","messageId":"88","endLine":283,"endColumn":42,"suggestions":"96"},{"ruleId":"85","severity":1,"message":"86","line":283,"column":50,"nodeType":"87","messageId":"88","endLine":283,"endColumn":63,"suggestions":"97"},{"ruleId":"98","severity":1,"message":"99","line":82,"column":7,"nodeType":"100","messageId":"101","endLine":82,"endColumn":14},"@typescript-eslint/no-non-null-assertion","Forbidden non-null assertion.","TSNonNullExpression","noNonNull",["102"],["103"],["104"],["105"],["106"],["107"],["108"],["109"],["110"],"@typescript-eslint/no-unused-vars","'element' is assigned a value but never used.","Identifier","unusedVar",{"messageId":"111","fix":"112","desc":"113"},{"messageId":"111","fix":"114","desc":"113"},{"messageId":"111","fix":"115","desc":"113"},{"messageId":"111","fix":"116","desc":"113"},{"messageId":"111","fix":"117","desc":"113"},{"messageId":"111","fix":"118","desc":"113"},{"messageId":"111","fix":"119","desc":"113"},{"messageId":"111","fix":"120","desc":"113"},{"messageId":"111","fix":"121","desc":"113"},"suggestOptionalChain",{"range":"122","text":"123"},"Consider using the optional chain operator `?.` instead. This operator includes runtime checks, so it is safer than the compile-only non-null assertion operator.",{"range":"124","text":"123"},{"range":"125","text":"123"},{"range":"126","text":"123"},{"range":"127","text":"123"},{"range":"128","text":"123"},{"range":"129","text":"123"},{"range":"130","text":"123"},{"range":"131","text":"123"},[8279,8280],"?",[8422,8423],[8517,8518],[8656,8657],[9342,9343],[9721,9722],[9776,9777],[9805,9806],[9826,9827]]
12 changes: 8 additions & 4 deletions src/components/InventoryItem.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
<template>
<div
v-tooltip="'We will be giving more information about this item later.'"
class="p-2 flex flex-col h-full"
<button
v-tooltip="itemFromRegistry?.description"
class="p-2 flex flex-col h-full cursor-pointer"
@click="useInventoryStore().useItem(item.id)"
>
<div class="w-full text-right">
{{ formatNumber(item.amount) }}
</div>
<div class="text-3xs text-center break-words">
{{ item.name }}
</div>
</div>
</button>
</template>

<script setup lang="ts">
import {useGameStore} from '../stores/gameStore'
import {useInventoryStore} from '../stores/inventoryStore'
import {computed} from 'vue'
const props = defineProps<{
item: {
Expand All @@ -24,6 +27,7 @@ const props = defineProps<{
}>()
const formatNumber = useGameStore().formatNumber
const itemFromRegistry = computed(() => useInventoryStore().getItemById(props.item.id))
</script>

<style scoped>
Expand Down
Loading

0 comments on commit f5695af

Please sign in to comment.