oops i made foraging too op

This commit is contained in:
Jill 2023-11-15 18:46:00 +03:00
parent 32cdaf5199
commit 39014d3b90
Signed by: oat
GPG Key ID: 33489AA58A955108
2 changed files with 4 additions and 3 deletions

View File

@ -27,8 +27,8 @@ export const craftingStations: CraftingStation[] = [
formatRecipe: (_inputs, _requirements, outputs, disableBold = false) => `${outputs.map(i => formatItems(i.item, i.quantity, disableBold) + '?').join(' ')}`,
manipulateResults: (outputs) => {
const totalItems = outputs.reduce((a, b) => a + b.quantity, 0);
// grab from 1/2 to the entire pool, ensure it never goes below 1
const rolledItems = Math.max(Math.round(totalItems/2 + Math.random() * totalItems/2), 1);
// grab from 1/3 to the entire pool, ensure it never goes below 1
const rolledItems = Math.max(Math.round(totalItems/3 + Math.random() * totalItems*2/3), 1);
const res: Items[] = [];
for (let i = 0; i < rolledItems; i++) {
const rolled = pickRandom(outputs);
@ -36,7 +36,7 @@ export const craftingStations: CraftingStation[] = [
if (r) {
r.quantity = r.quantity + 1;
} else {
res.push({ item: rolled.item, quantity: rolled.quantity });
res.push({ item: rolled.item, quantity: 1 });
}
}
return res;

View File

@ -52,6 +52,7 @@ export const defaultRecipes: DefaultRecipe[] = [
requirements: [],
outputs: [
{ item: getDefaultItem(DefaultItems.TWIG), quantity: 1 },
{ item: getDefaultItem(DefaultItems.COIN), quantity: 1 },
{ item: getDefaultItem(DefaultItems.APPLE), quantity: 4 },
{ item: getDefaultItem(DefaultItems.BERRIES), quantity: 6 },
]