Gathering and using compost now rewards XP.
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
package rs09.game.node.entity.skill.farming
|
package rs09.game.node.entity.skill.farming
|
||||||
|
|
||||||
|
import api.ContentAPI
|
||||||
import core.game.node.entity.player.Player
|
import core.game.node.entity.player.Player
|
||||||
|
import core.game.node.entity.skill.Skills
|
||||||
import core.game.node.item.Item
|
import core.game.node.item.Item
|
||||||
import core.tools.RandomFunction
|
import core.tools.RandomFunction
|
||||||
import org.json.simple.JSONArray
|
import org.json.simple.JSONArray
|
||||||
@@ -44,6 +46,8 @@ class CompostBin(val player: Player, val bin: CompostBins) {
|
|||||||
isClosed = false
|
isClosed = false
|
||||||
}
|
}
|
||||||
updateBit()
|
updateBit()
|
||||||
|
if(isSuperCompost) ContentAPI.rewardXP(player, Skills.FARMING, 8.5)
|
||||||
|
else ContentAPI.rewardXP(player, Skills.FARMING, 4.5)
|
||||||
return Item(item)
|
return Item(item)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package rs09.game.node.entity.skill.farming
|
package rs09.game.node.entity.skill.farming
|
||||||
|
|
||||||
|
import api.ContentAPI
|
||||||
import core.game.interaction.NodeUsageEvent
|
import core.game.interaction.NodeUsageEvent
|
||||||
import core.game.node.entity.skill.Skills
|
import core.game.node.entity.skill.Skills
|
||||||
import core.game.node.item.Item
|
import core.game.node.item.Item
|
||||||
@@ -123,6 +124,7 @@ object UseWithPatchHandler{
|
|||||||
override fun pulse(): Boolean {
|
override fun pulse(): Boolean {
|
||||||
if(player.inventory.remove(event.usedItem,false)){
|
if(player.inventory.remove(event.usedItem,false)){
|
||||||
p.compost = if(usedItem.id == Items.SUPERCOMPOST_6034) CompostType.SUPER else CompostType.NORMAL
|
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){
|
if(p.plantable != null){
|
||||||
p.harvestAmt += if(p.compost == CompostType.NORMAL) 1 else if(p.compost == CompostType.SUPER) 2 else 0
|
p.harvestAmt += if(p.compost == CompostType.NORMAL) 1 else if(p.compost == CompostType.SUPER) 2 else 0
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user