mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 03:25:23 +09:00
Allow Waterfill with Recipe (#364)
* Update waterfill.lua * Update en.cfg * Update zh-CN.cfg * Update zh-TW.cfg * Update zh-CN.cfg * Update zh-TW.cfg * Update waterfill.lua * Update waterfill.lua * Update waterfill.lua * Update tool.lua * Update waterfill.lua
This commit is contained in:
@@ -83,11 +83,16 @@ local tool_gui_waterfill_b = Gui.element("tool_gui_waterfill_b")
|
||||
if Selection.is_selecting(player, SelectionWaterfillArea) then
|
||||
Selection.stop(player)
|
||||
return player.print{ "exp-commands_waterfill.exit" }
|
||||
elseif player.get_item_count("cliff-explosives") == 0 then
|
||||
return player.print{ "exp-commands_waterfill.requires-explosives" }
|
||||
else
|
||||
Selection.start(player, SelectionWaterfillArea)
|
||||
return player.print{ "exp-commands_waterfill.enter" }
|
||||
local item_count_cliff = player.get_item_count("cliff-explosives")
|
||||
local item_count_craft = math.min(math.floor(player.get_item_count("explosives") / 10), player.get_item_count("barrel"), player.get_item_count("grenade"))
|
||||
local item_count_total = item_count_cliff + item_count_craft
|
||||
if item_count_total == 0 then
|
||||
return player.print{ "exp-commands_waterfill.requires-explosives" }
|
||||
else
|
||||
Selection.start(player, SelectionWaterfillArea)
|
||||
return player.print{ "exp-commands_waterfill.enter" }
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user