Merge branch 'compost-xp' into 'master'
Gathering and using compost now rewards XP. See merge request 2009scape/2009scape!90
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user