libram 0.8.31 → 0.8.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -116,10 +116,12 @@ export function differentiate(monster, ...combatParams) {
|
|
|
116
116
|
export function differentiableQuantity(monster) {
|
|
117
117
|
if (!have_($item `mimic egg`))
|
|
118
118
|
return 0;
|
|
119
|
-
const regex = new RegExp(
|
|
119
|
+
const regex = new RegExp(`<!-- monsterid: ${monster.id}-->(?:\\s\\((\\d+)\\))?`);
|
|
120
120
|
const page = examine($item `mimic egg`);
|
|
121
121
|
const match = page.match(regex);
|
|
122
122
|
if (!match)
|
|
123
123
|
return 0;
|
|
124
|
-
|
|
124
|
+
if (!match[1])
|
|
125
|
+
return 1;
|
|
126
|
+
return clamp(Number(match[1]), 1, availableAmount($item `mimic egg`));
|
|
125
127
|
}
|