Tool Leprechaun Interface complete
This commit is contained in:
+14
-1
@@ -158,7 +158,12 @@ class ToolLeprechaunInterface : ComponentPlugin() {
|
|||||||
player ?: return
|
player ?: return
|
||||||
val hasAmount = player.inventory.getAmount(item)
|
val hasAmount = player.inventory.getAmount(item)
|
||||||
var finalAmount = amount
|
var finalAmount = amount
|
||||||
val spaceLeft = 255 - quantityCheckMethod.invoke(player)
|
val spaceLeft = (if(item == Items.BUCKET_1925) 31 else 255) - quantityCheckMethod.invoke(player)
|
||||||
|
|
||||||
|
if(hasAmount == 0){
|
||||||
|
player.dialogueInterpreter.sendDialogue("You don't have any of those to store.")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if(amount == -2){
|
if(amount == -2){
|
||||||
player.setAttribute("runscript", object : RunScript() {
|
player.setAttribute("runscript", object : RunScript() {
|
||||||
@@ -170,6 +175,10 @@ class ToolLeprechaunInterface : ComponentPlugin() {
|
|||||||
if(amt > spaceLeft){
|
if(amt > spaceLeft){
|
||||||
amt = spaceLeft
|
amt = spaceLeft
|
||||||
}
|
}
|
||||||
|
if(amt == 0){
|
||||||
|
player.dialogueInterpreter.sendDialogue("You don't have any of those to store.")
|
||||||
|
return true
|
||||||
|
}
|
||||||
player.inventory.remove(Item(item,amt))
|
player.inventory.remove(Item(item,amt))
|
||||||
updateQuantityMethod.invoke(player,amt)
|
updateQuantityMethod.invoke(player,amt)
|
||||||
player.varpManager.get(varp).send(player)
|
player.varpManager.get(varp).send(player)
|
||||||
@@ -186,6 +195,10 @@ class ToolLeprechaunInterface : ComponentPlugin() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!player.inventory.contains(item,finalAmount)){
|
||||||
|
player.dialogueInterpreter.sendDialogue("You don't have any of those to store.")
|
||||||
|
}
|
||||||
|
|
||||||
player.inventory.remove(Item(item,finalAmount))
|
player.inventory.remove(Item(item,finalAmount))
|
||||||
updateQuantityMethod.invoke(player,finalAmount)
|
updateQuantityMethod.invoke(player,finalAmount)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user