Add more cups of tea

This commit is contained in:
gregf36665 2024-12-20 17:29:28 +00:00 committed by Syndromeramo
parent 4f8892c94e
commit 484f6e1614
2 changed files with 17 additions and 1 deletions

View file

@ -288,6 +288,8 @@ public enum Consumables {
NETTLE_WATER(new Drink(new int[] {Items.NETTLE_WATER_4237, Items.BOWL_1923}, new HealingEffect((1)))), NETTLE_WATER(new Drink(new int[] {Items.NETTLE_WATER_4237, Items.BOWL_1923}, new HealingEffect((1)))),
CUP_OF_TEA_NETTLE(new Drink(new int[] {4242, 1980}, new HealingEffect(3))), CUP_OF_TEA_NETTLE(new Drink(new int[] {4242, 1980}, new HealingEffect(3))),
CUP_OF_TEA_MILKY_NETTLE(new Drink(new int[] {4243, 1980}, new HealingEffect(3))), CUP_OF_TEA_MILKY_NETTLE(new Drink(new int[] {4243, 1980}, new HealingEffect(3))),
CUP_OF_TEA_NETTLE_PORCELAIN(new Drink(new int[] {4245, 4244}, new HealingEffect(3))),
CUP_OF_TEA_MILKY_NETTLE_PORCELAIN(new Drink(new int[] {4246, 4244}, new HealingEffect(3))),
NETTLE_TEA(new Drink(new int[] {4239, 1923}, new HealingEffect(3))), NETTLE_TEA(new Drink(new int[] {4239, 1923}, new HealingEffect(3))),
NETTLE_TEA_MILKY(new Drink(new int[] {4240, 1923}, new HealingEffect(3))), NETTLE_TEA_MILKY(new Drink(new int[] {4240, 1923}, new HealingEffect(3))),
CUP_OF_TEA_CLAY(new Drink(new int[] {7730, 7728}, new SkillEffect(Skills.CONSTRUCTION, 1, 0), "You feel refreshed and ready for more building.")), CUP_OF_TEA_CLAY(new Drink(new int[] {7730, 7728}, new SkillEffect(Skills.CONSTRUCTION, 1, 0), "You feel refreshed and ready for more building.")),

View file

@ -18,6 +18,7 @@ import org.rs09.consts.Items
* clay * clay
* porcelain * porcelain
* gold trim * gold trim
* Flask
*/ */
class TeaInteraction : InteractionListener { class TeaInteraction : InteractionListener {
private val teaMilkMap = mapOf( private val teaMilkMap = mapOf(
@ -31,10 +32,16 @@ class TeaInteraction : InteractionListener {
private val teaCupMap = mapOf( private val teaCupMap = mapOf(
Items.NETTLE_TEA_4239 to Items.CUP_OF_TEA_4242, Items.NETTLE_TEA_4239 to Items.CUP_OF_TEA_4242,
Items.NETTLE_TEA_4240 to Items.CUP_OF_TEA_4246, Items.NETTLE_TEA_4240 to Items.CUP_OF_TEA_4243,
Items.BOWL_OF_HOT_WATER_4456 to Items.CUP_OF_HOT_WATER_4460 Items.BOWL_OF_HOT_WATER_4456 to Items.CUP_OF_HOT_WATER_4460
) )
// This is specifically for the porcelain cup without a handle for Ghost Ahoy
private val teaCupPorcelainMap = mapOf(
Items.NETTLE_TEA_4239 to Items.CUP_OF_TEA_4245,
Items.NETTLE_TEA_4240 to Items.CUP_OF_TEA_4246
)
override fun defineListeners() { override fun defineListeners() {
onUseWith(ITEM, teaMilkMap.keys.toIntArray(), Items.BUCKET_OF_MILK_1927){ player, used, with -> onUseWith(ITEM, teaMilkMap.keys.toIntArray(), Items.BUCKET_OF_MILK_1927){ player, used, with ->
if (removeItem(player, used) && removeItem(player, with)){ if (removeItem(player, used) && removeItem(player, with)){
@ -64,6 +71,13 @@ class TeaInteraction : InteractionListener {
} }
return@onUseWith true return@onUseWith true
} }
onUseWith(ITEM, teaCupPorcelainMap.keys.toIntArray(), Items.PORCELAIN_CUP_4244){player, used, with ->
if(removeItem(player, used) && removeItem(player, with)){
addItem(player, teaCupPorcelainMap[used.id]!!)
}
return@onUseWith true
}
} }
} }