Gathering and using compost now rewards XP.

This commit is contained in:
ceikry
2021-07-02 10:47:25 -05:00
parent 60f32629c2
commit d3a53e4901
2 changed files with 6 additions and 0 deletions
@@ -1,6 +1,8 @@
package rs09.game.node.entity.skill.farming
import api.ContentAPI
import core.game.node.entity.player.Player
import core.game.node.entity.skill.Skills
import core.game.node.item.Item
import core.tools.RandomFunction
import org.json.simple.JSONArray
@@ -44,6 +46,8 @@ class CompostBin(val player: Player, val bin: CompostBins) {
isClosed = false
}
updateBit()
if(isSuperCompost) ContentAPI.rewardXP(player, Skills.FARMING, 8.5)
else ContentAPI.rewardXP(player, Skills.FARMING, 4.5)
return Item(item)
}
@@ -1,5 +1,6 @@
package rs09.game.node.entity.skill.farming
import api.ContentAPI
import core.game.interaction.NodeUsageEvent
import core.game.node.entity.skill.Skills
import core.game.node.item.Item
@@ -123,6 +124,7 @@ object UseWithPatchHandler{
override fun pulse(): Boolean {
if(player.inventory.remove(event.usedItem,false)){
p.compost = if(usedItem.id == Items.SUPERCOMPOST_6034) CompostType.SUPER else CompostType.NORMAL
if(p.compost == CompostType.SUPER) ContentAPI.rewardXP(player, Skills.FARMING, 26.0) else ContentAPI.rewardXP(player, Skills.FARMING, 18.5)
if(p.plantable != null){
p.harvestAmt += if(p.compost == CompostType.NORMAL) 1 else if(p.compost == CompostType.SUPER) 2 else 0
}