Skip to content

Farming updates phase 2

zsrv requested to merge zsrv/2009scape:farming-updates-phase2 into master

This is based on !1689 (merged) and will be rebased once that MR is merged

What has been done in this MR?

Enhancements

  • Farming animation corrections
  • Farming message updates and additions
  • Gardeners will chop down fully grown trees for 200 gp
  • Gardeners will give farming advice
  • Obsolete class FarmingState has been removed
  • Allow custom titles to be set when using DialogueFile.options and DialogueFile.showTopics
  • Compost bin debugging command "finishbins" restored: Finishes any in-progress compost bins
  • Compost bin debugging command "resetbins" added: Resets the player's compost bins to their initial states

Bug fixes

  • Don't let players pay gardeners to protect diseased or dead farming patches
  • Don't let players water dead patches
  • Grow weeds in farming patches as part of the offline catch-up
  • Allow trees that are not fully grown to be dug up

What should testers check?

Commands

  • Admin command "::finishbins" should immediately make ready any compost bins that are closed and have something composting in them.
  • Admin command "::resetbins" should reset all of the player's compost bins to their initial states (open and empty)

Tool Leprechaun

  • Attempting to store more than one of a tool should send message "You cannot store more than one [tool name] in here."

Gardeners

  • All gardener dialogue paths should be tested, using gardeners assigned to one patch (e.g. tree patch) and gardeners assigned to two patches (e.g. two allotments), with the patches in various growth stages (empty patch, growing patch, fully grown patch)
  • Gardeners should accept protection items in either noted or unnoted form (but the entire quantity of the item must be either noted or unnoted - a mix of the item in noted and unnoted forms would not be accepted)
  • Attempting to pay a gardener to protect a patch when the patch does not have anything planted in it (the patch is weedy or empty) should send message "You don't have anything planted in that patch. Plant something and I might agree to look after it for you."
  • Attempting to pay a gardener to protect a patch that is dead should send message "That patch is dead - it's too late for me to do anything about it now."
  • A gardener that is assigned to a tree patch that is fully grown should present dialogue option "Would you chop my tree down for me?" instead of "Would you look after my crops for me?"
  • Using the right-click "Pay" option on a gardener that is assigned to a tree patch that is fully grown should offer to chop down the tree for 200 gp instead of going into the patch protection dialogue
  • Using the right-click "Pay" option on a gardener when a protectable crop is planted but the player does not have the protection item in their inventory (noted or unnoted) should trigger dialogue "I want [num] [item] for that.", "Thanks, maybe another time."

All patches

  • Using seeds on a farming patch when the player does not have enough seeds in their inventory to plant the crop should send message "You need [number] seeds to plant [a/an] [patch type]." (this effectively applies only to allotments and hops patches)
  • The message "You can only plant [seed name] in [patch type].", sent when you try to use a seed or sapling on the wrong patch type, has been updated to use names hardcoded for each seed/sapling. The same has been done for the message "You plant [a/the/seed amount] [seed name] in the [patch name]." that is sent when you plant a seed/sapling in its proper patch. This has been done because some seeds/saplings (bushes, hops, fruit tree saplings) use special names when planted. Please check the Plantable.kt file changes in this merge request for the list of names used in these two messages for all seeds/saplings.

Allotment, flower, hops patches

  • Attempting to water a diseased or dead allotment, flower, or hops patch should send message "Water isn't going to cure that!"

Flower patches

  • Harvesting a flower patch should use the animation where the player bends down to the patch
  • Harvesting a flower patch should not send any messages

Tree and fruit tree patches

  • Planting a tree or fruit tree sapling should send message "You plant the [sapling type] in the [tree/fruit tree] patch."
  • Planting a tree or fruit tree sapling should use the spade digging animation
  • Checking the health of a tree or fruit tree should send message "You examine the tree for signs of disease and find that it is in perfect health."

Tree patches

  • Using a spade on a growing tree patch should give the option to dig up the patch
  • Using a spade on a fully grown tree patch that has not yet been reduced to a stump should send message "You need to chop this tree down first."
  • Using a spade on a fully grown tree patch that has been reduced to a stump should give the option to dig up the patch

Cactus patches

  • Checking the health of a cactus should send message "You examine the cactus for signs of disease and find that it is in perfect health."

Lunar spellbook - Cure Plant spell

  • Casting Cure Plant on a compost bin should send message "Bins don't often get diseased."
  • Casting Cure Plant on an object that is not a compost bin or farming patch should send message "Umm... this spell won't cure that!"
  • Casting Cure Plant on a weedy patch should send message "The weeds are healthy enough already."
  • Casting Cure Plant on an empty and weeded patch should send message "There's nothing there to cure."
  • Casting Cure Plant on a fully grown patch should send message "That's not diseased."
  • Casting Cure Plant on a dead patch should send message "It says 'Cure' not 'Resurrect'. Although death may arise from disease, it is not in itself a disease and hence cannot be cured. So there."
  • Casting Cure Plant on a patch that is growing and free of disease should send message "It is growing just fine."
  • Casting Cure Plant on a diseased patch should cast the spell and cure the patch of disease

Offline catch-up

  • Logging out for some time with a partially weedy or empty and weeded patch, then logging back in (after 5 minutes or so) should show weed growth in the patches immediately after logging in
  • Other patches should also show growth
  • I have tested these changes thoroughly.

  • I used the relevant Thanos/Zaros tool for any JSON edits where possible, and have attached screenshots of any changes.

Sources

Server/src/main/content/global/dialogue

GardenerDialoguePlugin.kt

Talk to a gardener and pay to chop down a fully grown tree

Buy plant cure from a gardener

Gardener dialogue (recent, but it does not seem to have changed; used this to add missing dialogue and correct existing dialogue)

Gardener farming advice dialogue (recent, but it probably has not changed)

Server/src/main/content/global/skill/farming

CropHarvester.kt

Flower patch harvest animation
No harvest messages sent to the player when harvesting a flower patch

FarmerPayOptionDialogue.kt

"You don't have anything planted in that patch. Plant something and I might agree to look after it for you."

"That patch is dead - it's too late for me to do anything about it now."

"Pay 200 gp to have the tree chopped down?"

Dialogue when a player uses the right-click Pay option on a gardener to protect a crop but does not have the required protection item
"I want [num] [item] for that."
"Thanks, maybe another time."

Dialogue when a player uses the right-click Pay option on a gardener to protect a crop and has the required protection item

HealthChecker.kt

"You examine the tree for signs of disease and find that it is in perfect health."

"You examine the cactus for signs of disease and find that it is in perfect health."

ToolLeprechaunInterface.kt

"You cannot store more than one [tool] in here."

UseWithPatchHandler.kt

"You plant the [sapling type] in the [tree/fruit tree] patch."
Spade animation is used to plant saplings

"Water isn't going to cure that!"

  • https://youtu.be/-m1mTHZh7bs?t=1 (the action taken to receive the message isn't seen, but from the messages that are received next, I can infer that the player tried to water a diseased patch. Since I haven't seen a player try to water a dead patch, this same message will be sent for dead patches)

Server/src/main/content/global/skill/magic/lunar

LunarListeners.kt

"It is growing just fine."
"It says 'Cure', not 'Resurrect'. Although death may arise from disease, it is not in itself a disease and hence cannot be cured. So there."

"That's not diseased."
"Bins don't often get diseased."
"Umm... this spell won't cure that!"

"The weeds are healthy enough already."
"There's nothing there to cure."

Edited by zsrv

Merge request reports