Skip to content

Commit

Permalink
Merge pull request #87 from Maxencedevweb/fix-return-pourcentage-meal…
Browse files Browse the repository at this point in the history
…-potion

Fix return pourcentage meal potion
  • Loading branch information
GeekaN2 authored Aug 31, 2024
2 parents eb6b59f + 98c5053 commit 7e24460
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions store/food-and-potions/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,19 +153,24 @@ export const getters: GetterTree<FoodAndPotionsState, {}> = {
if (state.settings.useOwnPercentage) {
return state.settings.returnPercentage;
}

const useFocus = state.settings.useFocus;
const craftItemsCity = state.settings.cities.craftItems;
const currentItemTiers = state.currentItemTiers;

let returnMaterialsPercentage = useFocus ? 43.5 : 15.2;

if (craftItemsCity === 'Brecilien') {
returnMaterialsPercentage = useFocus ? 47.9 : 24.8;
const isPotion = currentItemTiers.some(item => item.includes('POTION'));
const isMeal = currentItemTiers.some(item => item.includes('MEAL'));

if (isPotion && craftItemsCity === 'Brecilien') {
returnMaterialsPercentage = useFocus ? 47.9 : 24.8;
} else if (isMeal && craftItemsCity === 'Caerleon') {
returnMaterialsPercentage = useFocus ? 47.9 : 24.8;
}


return returnMaterialsPercentage;
},
},

getResourceValueByName: (state) => (resourceName: string): Number => {
if (resourceName.includes('QUESTITEM_TOKEN_AVALON')) {
Expand Down

0 comments on commit 7e24460

Please sign in to comment.