Add silk cocoon herbalism nodes for silk fibre.
Cocoons need adamantium-or-better plant clippers and drop raw silk; dragonweave stays a future dragon drop.
The contents of this binary file are not shown.
@@ -716,6 +716,10 @@ function completePlant (world, handle, entityId, character, gather, events, priv
716
716
{
717
717
itemId = rawClothItemId(ClothTier.linen);
718
718
}
719
else if (gather.plantKind === "silk")
720
{
721
itemId = rawClothItemId(ClothTier.silk);
722
}
719
723
else if (gather.plantKind === "herb")
720
724
{
721
725
const herb = herbDefinition(gather.herbId);
@@ -905,5 +909,7 @@ function defaultPlantState (typeId)
905
909
{ return "mint"; }
906
910
if (typeId === BlockType.flaxPlant)
907
911
{ return "flax-plant"; }
912
if (typeId === BlockType.silkCocoon)
913
{ return "silk-cocoon"; }
908
914
return "cotton-plant";
909
915
}
@@ -716,6 +716,10 @@ function completePlant (world, handle, entityId, character, gather, events, priv716
{716
{717
itemId = rawClothItemId(ClothTier.linen);717
itemId = rawClothItemId(ClothTier.linen);718
}718
}719
else if (gather.plantKind === "silk")720
{721
itemId = rawClothItemId(ClothTier.silk);722
}719
else if (gather.plantKind === "herb")723
else if (gather.plantKind === "herb")720
{724
{721
const herb = herbDefinition(gather.herbId);725
const herb = herbDefinition(gather.herbId);@@ -905,5 +909,7 @@ function defaultPlantState (typeId)905
{ return "mint"; }909
{ return "mint"; }906
if (typeId === BlockType.flaxPlant)910
if (typeId === BlockType.flaxPlant)907
{ return "flax-plant"; }911
{ return "flax-plant"; }912
if (typeId === BlockType.silkCocoon)913
{ return "silk-cocoon"; }908
return "cotton-plant";914
return "cotton-plant";909
}915
}@@ -149,6 +149,32 @@ test("flax needs steel-or-better clippers; linen fibre is named Flax", () =>
149
149
assert.equal(plant.minClothTier, "linen");
150
150
});
151
151
152
test("silk cocoons need adamantium-or-better clippers", () =>
153
{
154
assert.equal(metalTierForCloth(ClothTier.silk), MaterialTier.adamantium);
155
assert.match(itemDefinition(ClothItemId.silk).description, /cocoon/i);
156
const skills = normalizePlayerSkills(null);
157
skills.xp[SkillId.herbalism] = totalXpForLevel(50);
158
const mithril = resolvePlantClippers({
159
inventorySlots: [{ itemId: MetalItemId.mithrilPlantClippers, quantity: 1 }],
160
equipmentSlots: emptyEquipment().slots,
161
skills,
162
minClothTier: ClothTier.silk
163
});
164
assert.equal(mithril.ok, false);
165
const adamantium = resolvePlantClippers({
166
inventorySlots: [{ itemId: MetalItemId.adamantiumPlantClippers, quantity: 1 }],
167
equipmentSlots: emptyEquipment().slots,
168
skills,
169
minClothTier: ClothTier.silk
170
});
171
assert.equal(adamantium.ok, true);
172
const plant = plantGatherForBlock({ typeId: BlockType.silkCocoon, state: "silk-cocoon" });
173
assert.equal(plant.kind, "silk");
174
assert.equal(plant.requiresClippers, true);
175
assert.equal(plant.minClothTier, "silk");
176
});
177
152
178
test("shearing a sheep grants wool and sets shorn state", () =>
153
179
{
154
180
const harness = makeSimulation({ workerCount: 1 });
@@ -149,6 +149,32 @@ test("flax needs steel-or-better clippers; linen fibre is named Flax", () =>149
assert.equal(plant.minClothTier, "linen");149
assert.equal(plant.minClothTier, "linen");150
});150
});151
151
152
test("silk cocoons need adamantium-or-better clippers", () =>153
{154
assert.equal(metalTierForCloth(ClothTier.silk), MaterialTier.adamantium);155
assert.match(itemDefinition(ClothItemId.silk).description, /cocoon/i);156
const skills = normalizePlayerSkills(null);157
skills.xp[SkillId.herbalism] = totalXpForLevel(50);158
const mithril = resolvePlantClippers({159
inventorySlots: [{ itemId: MetalItemId.mithrilPlantClippers, quantity: 1 }],160
equipmentSlots: emptyEquipment().slots,161
skills,162
minClothTier: ClothTier.silk163
});164
assert.equal(mithril.ok, false);165
const adamantium = resolvePlantClippers({166
inventorySlots: [{ itemId: MetalItemId.adamantiumPlantClippers, quantity: 1 }],167
equipmentSlots: emptyEquipment().slots,168
skills,169
minClothTier: ClothTier.silk170
});171
assert.equal(adamantium.ok, true);172
const plant = plantGatherForBlock({ typeId: BlockType.silkCocoon, state: "silk-cocoon" });173
assert.equal(plant.kind, "silk");174
assert.equal(plant.requiresClippers, true);175
assert.equal(plant.minClothTier, "silk");176
});177
152
test("shearing a sheep grants wool and sets shorn state", () =>178
test("shearing a sheep grants wool and sets shorn state", () =>153
{179
{154
const harness = makeSimulation({ workerCount: 1 });180
const harness = makeSimulation({ workerCount: 1 });