File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -279,6 +279,27 @@ API.functions["play_hand_or_discard"] = function(args)
279279 }
280280end
281281
282+ API .functions [" cash_out" ] = function (args )
283+ -- Validate current game state is appropriate for cash out
284+ if G .STATE ~= G .STATES .ROUND_EVAL then
285+ sendErrorMessage (" Cannot cash out when not in shop. Current state: " .. tostring (G .STATE ), " BALATROBOT" )
286+ API .send_response ({ error = " Cannot cash out when not in shop" , state = G .STATE })
287+ return
288+ end
289+
290+ G .FUNCS .cash_out ({ config = {} })
291+ API .pending_requests [" cash_out" ] = {
292+ condition = function ()
293+ return G .STATE == G .STATES .SHOP and # G .E_MANAGER .queues .base < 3 and G .STATE_COMPLETE
294+ end ,
295+ action = function (args )
296+ local game_state = utils .get_game_state ()
297+ API .send_response (game_state )
298+ end ,
299+ args = args ,
300+ }
301+ end
302+
282303API .functions [" select_booster_action" ] = function (args )
283304 -- TODO: implement
284305end
You can’t perform that action at this time.
0 commit comments