Skip to content

Commit b7943a4

Browse files
authored
small qol changes
running out of hands no longer triggers end of round hold keybind during scoring to mimic vanilla behaviour
1 parent 0dc9b67 commit b7943a4

File tree

3 files changed

+35
-6
lines changed

3 files changed

+35
-6
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# NotJustYet
22
(Steamodded 1.0) Prevents scoring from ending the round early
33

4-
Default keybind is 'LShift'. In case you want to change it, open the internal main.lua.
4+
Default keybind is 'LShift'. This is customizable via the main.lua, although I'm not exactly sure what keys work
5+
6+
Holding the keybind during the end of a scoring hand will mimic vanilla behavior, useful in cases where you do not want to draw extra cards
57

68
# Installation
79

@@ -11,4 +13,4 @@ Install [Lovely](https://github.com/ethangreen-dev/lovely-injector)
1113
Install [Steamodded](https://github.com/Steamopollys/Steamodded) (must be **1.0.0 or higher**)
1214

1315

14-
Download the newest release ([linked here](https://github.com/Toneblock/balatro-NotJustYet/releases/tag/v0.3.0)), extract the .zip, and place it into your Mods folder
16+
Download the newest release ([linked here](https://github.com/Toneblock/balatro-NotJustYet/releases/tag/v0.4.0)), extract the .zip, and place it into your Mods folder

lovely/njy_lovely.toml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ target = "game.lua"
1010
pattern = "if G.GAME.chips - G.GAME.blind.chips >= 0 or G.GAME.current_round.hands_left < 1 then"
1111
position = "at"
1212
payload = '''
13-
if G.GAME.current_round.hands_left < 1 then
13+
if not to_big then
14+
function to_big(x) return x end
15+
end
16+
if (G.GAME.current_round.hands_left < 1 and to_big(self.GAME.chips) < to_big(self.GAME.blind.chips)) or (GLOBAL_njy_vanilla_override and to_big(self.GAME.chips) >= to_big(self.GAME.blind.chips)) then
1417
'''
1518
match_indent = true
1619

@@ -21,7 +24,10 @@ target = "game.lua"
2124
pattern = "if Big:new(G.GAME.chips) >= Big:new(G.GAME.blind.chips) or G.GAME.current_round.hands_left < 1 then"
2225
position = "at"
2326
payload = '''
24-
if G.GAME.current_round.hands_left < 1 then
27+
if not to_big then
28+
function to_big(x) return x end
29+
end
30+
if (G.GAME.current_round.hands_left < 1 and to_big(self.GAME.chips) < to_big(self.GAME.blind.chips)) or (GLOBAL_njy_vanilla_override and to_big(self.GAME.chips) >= to_big(self.GAME.blind.chips)) then
2531
'''
2632
match_indent = true
2733

@@ -32,7 +38,10 @@ target = "game.lua"
3238
pattern = "if to_big(G.GAME.chips) >= to_big(G.GAME.blind.chips) or G.GAME.current_round.hands_left <= 0 then"
3339
position = "at"
3440
payload = '''
35-
if G.GAME.current_round.hands_left <= 0 then
41+
if not to_big then
42+
function to_big(x) return x end
43+
end
44+
if (G.GAME.current_round.hands_left < 1 and to_big(self.GAME.chips) < to_big(self.GAME.blind.chips)) or (GLOBAL_njy_vanilla_override and to_big(self.GAME.chips) >= to_big(self.GAME.blind.chips)) then
3645
'''
3746
match_indent = true
3847

@@ -132,6 +141,7 @@ pattern = "if key == 'v' then"
132141
position = "before"
133142
payload = '''
134143
if key == G.njy_keybind then
144+
GLOBAL_njy_vanilla_override = true
135145
if G.STATE_COMPLETE == true and G.buttons and G.buttons.states and G.buttons.states.visible and G.buttons.states.visible == true and G.GAME and G.GAME.chips and G.GAME.blind and G.GAME.blind.chips then
136146
if not to_big then
137147
function to_big(x) return x end
@@ -145,3 +155,17 @@ if key == G.njy_keybind then
145155
end
146156
'''
147157
match_indent = true
158+
159+
# this is dumb and i should not be doing this
160+
[[patches]]
161+
[patches.pattern]
162+
target = "engine/controller.lua"
163+
pattern = '''if key == "a" and self.held_keys["g"] and not _RELEASE_MODE then'''
164+
position = "before"
165+
payload = '''
166+
if key == G.njy_keybind then
167+
GLOBAL_njy_vanilla_override = nil
168+
end
169+
'''
170+
match_indent = true
171+

main.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@
1111
----------------------------------------------
1212
------------MOD CODE -------------------------
1313

14-
-- The variable below defines the keybind used for ending the round. Feel free to change it to anything else, like 'w', or 'enter'
14+
-- The variable below defines the keybind used for ending the round. Feel free to change it to anything else, like 'w', or '9'
1515

1616
G.njy_keybind = 'lshift'
1717

1818

1919

2020

2121

22+
23+
24+
2225
G.FUNCS.njy_can_endround = function(e) -- wtf is this talisman check? [[Fixed it! -Math]]
2326
if not to_big then
2427
function to_big(x) return x end

0 commit comments

Comments
 (0)