Update index.js
Browse files
index.js
CHANGED
|
@@ -56,8 +56,8 @@ function format(n) { return n.toLocaleString("en-US") + "¢" }
|
|
| 56 |
function calcValue(name, weight, rarity = "Normal", mutations = []) {
|
| 57 |
const item = fruits.find(f => f[0] === name)
|
| 58 |
if (!item) return "0¢"
|
| 59 |
-
|
| 60 |
-
const totalMutation = getTotalMutation(mutations)
|
| 61 |
const clamped = clamp(weight / item[1], 0.95, 1e8)
|
| 62 |
const value = Math.round((item[2] * totalMutation * (rarityMultiplier[rarity] || 1)) * (clamped * clamped))
|
| 63 |
return format(value)
|
|
|
|
| 56 |
function calcValue(name, weight, rarity = "Normal", mutations = []) {
|
| 57 |
const item = fruits.find(f => f[0] === name)
|
| 58 |
if (!item) return "0¢"
|
| 59 |
+
const totalMutation = mutations.reduce((t, m) => t * (mutationMultiplier[m] || 1), 1)
|
| 60 |
+
//const totalMutation = getTotalMutation(mutations)
|
| 61 |
const clamped = clamp(weight / item[1], 0.95, 1e8)
|
| 62 |
const value = Math.round((item[2] * totalMutation * (rarityMultiplier[rarity] || 1)) * (clamped * clamped))
|
| 63 |
return format(value)
|