oops i made foraging too op
This commit is contained in:
parent
32cdaf5199
commit
39014d3b90
|
@ -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;
|
||||
|
|
|
@ -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 },
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue