-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinfiniteScore.lua
More file actions
3743 lines (3542 loc) · 188 KB
/
infiniteScore.lua
File metadata and controls
3743 lines (3542 loc) · 188 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--- STEAMODDED HEADER
--- MOD_NAME: Infinite Score
--- MOD_ID: InfiniteScore
--- MOD_AUTHOR: [JamesTheJellyfish]
--- MOD_DESCRIPTION: allows you to score hands past the score cap of e308, effectively making endless truly infinite.
----------------------------------------------
------------MOD CODE -------------------------
big = BigNumber
local x = big(15)
sendDebugMessage(x.maxExp)
function Blind:init(X, Y, W, H)
Moveable.init(self,X, Y, W, H)
self.children = {}
self.config = {}
self.tilt_var = {mx = 0, my = 0, amt = 0}
self.ambient_tilt = 0.3
self.chips = big(0)
self.zoom = true
self.states.collide.can = true
self.colour = copy_table(G.C.BLACK)
self.dark_colour = darken(self.colour, 0.2)
self.children.animatedSprite = AnimatedSprite(self.T.x, self.T.y, self.T.w, self.T.h, G.ANIMATION_ATLAS['blind_chips'], G.P_BLINDS.bl_small.pos)
self.children.animatedSprite.states = self.states
self.children.animatedSprite.states.visible = false
self.children.animatedSprite.states.drag.can = true
self.states.collide.can = true
self.states.drag.can = true
self.loc_debuff_lines = {'',''}
self.shadow_height = 0
if getmetatable(self) == Blind then
table.insert(G.I.CARD, self)
end
end
function Blind:set_text()
if self.config.blind then
if self.disabled then
self.loc_name = self.name == '' and self.name or localize{type ='name_text', key = self.config.blind.key, set = 'Blind'}
self.loc_debuff_text = ''
self.loc_debuff_lines[1] = ''
self.loc_debuff_lines[2] = ''
else
local loc_vars = nil
if self.name == 'The Ox' then
loc_vars = {localize(G.GAME.current_round.most_played_poker_hand, 'poker_hands')}
end
local loc_target = localize{type = 'raw_descriptions', key = self.config.blind.key, set = 'Blind', vars = loc_vars or self.config.blind.vars}
if loc_target then
self.loc_name = self.name == '' and self.name or localize{type ='name_text', key = self.config.blind.key, set = 'Blind'}
self.loc_debuff_text = ''
for k, v in ipairs(loc_target) do
self.loc_debuff_text = self.loc_debuff_text..v..(k <= #loc_target and ' ' or '')
end
self.loc_debuff_lines[1] = loc_target[1] or ''
self.loc_debuff_lines[2] = loc_target[2] or ''
else
self.loc_name = ''; self.loc_debuff_text = ''
self.loc_debuff_lines[1] = ''
self.loc_debuff_lines[2] = ''
end
end
end
end
function Blind:set_blind(blind, reset, silent)
if not reset then
self.config.blind = blind or {}
self.name = blind and blind.name or ''
self.dollars = blind and blind.dollars or 0
self.sound_pings = self.dollars + 2
if G.GAME.modifiers.no_blind_reward and G.GAME.modifiers.no_blind_reward[self:get_type()] then self.dollars = 0 end
self.debuff = blind and blind.debuff or {}
self.pos = blind and blind.pos
self.mult = blind and blind.mult or 0
self.disabled = false
self.discards_sub = nil
self.hands_sub = nil
self.boss = blind and not not blind.boss
self.blind_set = false
self.triggered = nil
self.prepped = true
self:set_text()
G.GAME.last_blind = G.GAME.last_blind or {}
G.GAME.last_blind.boss = self.boss
G.GAME.last_blind.name = self.name
if blind and blind.name then
self:change_colour()
else
self:change_colour(G.C.BLACK)
end
self.chips = get_blind_amount(G.GAME.round_resets.ante)*self.mult*G.GAME.starting_params.ante_scaling
self.chip_text = number_format(self.chips)
if not blind then self.chips = big(0) end
G.GAME.current_round.dollars_to_be_earned = self.dollars > 0 and (string.rep(localize('$'), self.dollars)..'') or ('')
G.HUD_blind.alignment.offset.y = -10
G.HUD_blind:recalculate(false)
if blind and blind.name and blind.name ~= '' then
self:alert_debuff(true)
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.05,
blockable = false,
func = (function()
G.HUD_blind:get_UIE_by_ID("HUD_blind_name").states.visible = false
G.HUD_blind:get_UIE_by_ID("dollars_to_be_earned").parent.parent.states.visible = false
G.HUD_blind.alignment.offset.y = 0
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.15,
blockable = false,
func = (function()
G.HUD_blind:get_UIE_by_ID("HUD_blind_name").states.visible = true
G.HUD_blind:get_UIE_by_ID("dollars_to_be_earned").parent.parent.states.visible = true
G.HUD_blind:get_UIE_by_ID("dollars_to_be_earned").config.object:pop_in(0)
G.HUD_blind:get_UIE_by_ID("HUD_blind_name").config.object:pop_in(0)
G.HUD_blind:get_UIE_by_ID("HUD_blind_count"):juice_up()
self.children.animatedSprite:set_sprite_pos(self.config.blind.pos)
self.blind_set = true
G.ROOM.jiggle = G.ROOM.jiggle + 3
if not reset and not silent then
self:juice_up()
if blind then play_sound('chips1', math.random()*0.1 + 0.55, 0.42);play_sound('gold_seal', math.random()*0.1 + 1.85, 0.26)--play_sound('cancel')
end
end
return true
end)
}))
return true
end)
}))
end
self.config.h_popup_config ={align="tm", offset = {x=0,y=-0.1},parent = self}
end
if self.name == 'The Eye' and not reset then
self.hands = {
["Flush Five"] = false,
["Flush House"] = false,
["Five of a Kind"] = false,
["Straight Flush"] = false,
["Four of a Kind"] = false,
["Full House"] = false,
["Flush"] = false,
["Straight"] = false,
["Three of a Kind"] = false,
["Two Pair"] = false,
["Pair"] = false,
["High Card"] = false,
}
end
if self.name == 'The Mouth' and not reset then
self.only_hand = false
end
if self.name == 'The Fish' and not reset then
self.prepped = nil
end
if self.name == 'The Water' and not reset then
self.discards_sub = G.GAME.current_round.discards_left
ease_discard(-self.discards_sub)
end
if self.name == 'The Needle' and not reset then
self.hands_sub = G.GAME.round_resets.hands - 1
ease_hands_played(-self.hands_sub)
end
if self.name == 'The Manacle' and not reset then
G.hand:change_size(-1)
end
if self.name == 'Amber Acorn' and not reset and #G.jokers.cards > 0 then
G.jokers:unhighlight_all()
for k, v in ipairs(G.jokers.cards) do
v:flip()
end
if #G.jokers.cards > 1 then
G.E_MANAGER:add_event(Event({ trigger = 'after', delay = 0.2, func = function()
G.E_MANAGER:add_event(Event({ func = function() G.jokers:shuffle('aajk'); play_sound('cardSlide1', 0.85);return true end }))
delay(0.15)
G.E_MANAGER:add_event(Event({ func = function() G.jokers:shuffle('aajk'); play_sound('cardSlide1', 1.15);return true end }))
delay(0.15)
G.E_MANAGER:add_event(Event({ func = function() G.jokers:shuffle('aajk'); play_sound('cardSlide1', 1);return true end }))
delay(0.5)
return true end }))
end
end
--add new debuffs
for _, v in ipairs(G.playing_cards) do
self:debuff_card(v)
end
for _, v in ipairs(G.jokers.cards) do
if not reset then self:debuff_card(v, true) end
end
G.ARGS.spin.real = (self.config.blind.boss and (self.config.blind.boss.showdown and 0.5 or 0.25) or 0)
end
function Blind:disable()
self.disabled = true
for k, v in ipairs(G.jokers.cards) do
if v.facing == 'back' then v:flip() end
end
if self.name == 'The Water' then
ease_discard(self.discards_sub)
end
if self.name == 'The Wheel' or self.name == 'The House' or self.name == 'The Mark' or self.name == 'The Fish' then
for i = 1, #G.hand.cards do
if G.hand.cards[i].facing == 'back' then
G.hand.cards[i]:flip()
end
end
for k, v in pairs(G.playing_cards) do
v.ability.wheel_flipped = nil
end
end
if self.name == 'The Needle' then
ease_hands_played(self.hands_sub)
end
if self.name == 'The Wall' then
self.chips = self.chips/2
self.chip_text = number_format(self.chips)
end
if self.name == 'Cerulean Bell' then
for k, v in ipairs(G.playing_cards) do
v.ability.forced_selection = nil
end
end
if self.name == 'The Manacle' then
G.hand:change_size(1)
end
if self.name == 'The Serpent' then
end
if self.name == 'Violet Vessel' then
self.chips = self.chips/3
self.chip_text = number_format(self.chips)
end
G.E_MANAGER:add_event(Event({
trigger = 'immediate',
func = function()
if self.boss and G.GAME.chips - G.GAME.blind.chips >= big(0) then
G.STATE = G.STATES.NEW_ROUND
G.STATE_COMPLETE = false
end
return true
end
}))
for _, v in ipairs(G.playing_cards) do
self:debuff_card(v)
end
for _, v in ipairs(G.jokers.cards) do
self:debuff_card(v)
end
self:set_text()
self:wiggle()
end
function Blind:load(blindTable)
self.config.blind = G.P_BLINDS[blindTable.config_blind] or {}
self.name = blindTable.name
self.dollars = blindTable.dollars
self.debuff = blindTable.debuff
self.pos = blindTable.pos
self.mult = blindTable.mult
self.disabled = blindTable.disabled
self.discards_sub = blindTable.discards_sub
self.hands_sub = blindTable.hands_sub
self.boss = blindTable.boss
self.chips = big(blindTable.chips)
self.chip_text = blindTable.chip_text
self.hands = blindTable.hands
self.only_hand = blindTable.only_hand
self.triggered = blindTable.triggered
G.ARGS.spin.real = (self.config.blind.boss and (self.config.blind.boss.showdown and 1 or 0.3) or 0)
if G.P_BLINDS[blindTable.config_blind] then
self.blind_set = true
self.children.animatedSprite.states.visible = true
self.children.animatedSprite:set_sprite_pos(self.config.blind.pos)
self.children.animatedSprite:juice_up(0.3)
self:align()
self.children.animatedSprite:hard_set_VT()
else
self.children.animatedSprite.states.visible = false
end
self.children.animatedSprite.states = self.states
self:change_colour()
if self.dollars > 0 then
G.GAME.current_round.dollars_to_be_earned = string.rep(localize('$'), self.dollars)..''
G.HUD_blind:get_UIE_by_ID("dollars_to_be_earned").config.object:pop_in(0)
G.HUD_blind.alignment.offset.y = 0
end
self:set_text()
end
function Game:update_hand_played(dt)
if self.buttons then self.buttons:remove(); self.buttons = nil end
if self.shop then self.shop:remove(); self.shop = nil end
if not G.STATE_COMPLETE then
G.STATE_COMPLETE = true
G.E_MANAGER:add_event(Event({
trigger = 'immediate',
func = function()
if G.GAME.chips - G.GAME.blind.chips >= big(0) or G.GAME.current_round.hands_left < 1 then
G.STATE = G.STATES.NEW_ROUND
else
G.STATE = G.STATES.DRAW_TO_HAND
end
G.STATE_COMPLETE = false
return true
end
}))
end
end
function scale_number(number, scale, max)
G.E_SWITCH_POINT = G.E_SWITCH_POINT or 100000000000
if not number or (type(number) ~= 'number' and type(number) ~= 'table') then
return scale
end
if not max then max = 10000 end
if type(number) == 'table' then
if number >= big(G.E_SWITCH_POINT) then
scale = scale * 0.75
elseif number >= big(max) then
scale = scale * 5 / (string.len(tostring(number)))
end
return scale
end
if number >= G.E_SWITCH_POINT then
scale = scale*math.floor(math.log(max*10, 10))/math.floor(math.log(1000000*10, 10))
elseif number >= max then
scale = scale*math.floor(math.log(max*10, 10))/math.floor(math.log(number*10, 10))
end
return scale
end
G.FUNCS.flame_handler = function(e)
G.C.UI_CHIPLICK = G.C.UI_CHIPLICK or {1, 1, 1, 1}
G.C.UI_MULTLICK = G.C.UI_MULTLICK or {1, 1, 1, 1}
for i=1, 3 do
G.C.UI_CHIPLICK[i] = math.min(math.max(((G.C.UI_CHIPS[i]*0.5+G.C.YELLOW[i]*0.5) + 0.1)^2, 0.1), 1)
G.C.UI_MULTLICK[i] = math.min(math.max(((G.C.UI_MULT[i]*0.5+G.C.YELLOW[i]*0.5) + 0.1)^2, 0.1), 1)
end
G.ARGS.flame_handler = G.ARGS.flame_handler or {
chips = {
id = 'flame_chips',
arg_tab = 'chip_flames',
colour = G.C.UI_CHIPS,
accent = G.C.UI_CHIPLICK
},
mult = {
id = 'flame_mult',
arg_tab = 'mult_flames',
colour = G.C.UI_MULT,
accent = G.C.UI_MULTLICK
}
}
for k, v in pairs(G.ARGS.flame_handler) do
if e.config.id == v.id then
if not e.config.object:is(Sprite) or e.config.object.ID ~= v.ID then
e.config.object:remove()
e.config.object = Sprite(0, 0, 2.5, 2.5, G.ASSET_ATLAS["ui_1"], {x = 2, y = 0})
v.ID = e.config.object.ID
G.ARGS[v.arg_tab] = {
intensity = 0,
real_intensity = 0,
intensity_vel = 0,
colour_1 = v.colour,
colour_2 = v.accent,
timer = G.TIMERS.REAL
}
e.config.object:set_alignment({
major = e.parent,
type = 'bmi',
offset = {x=0,y=0},
xy_bond = 'Weak'
})
e.config.object:define_draw_steps({{
shader = 'flame',
send = {
{name = 'time', ref_table = G.ARGS[v.arg_tab], ref_value = 'timer'},
{name = 'amount', ref_table = G.ARGS[v.arg_tab], ref_value = 'real_intensity'},
{name = 'image_details', ref_table = e.config.object, ref_value = 'image_dims'},
{name = 'texture_details', ref_table = e.config.object.RETS, ref_value = 'get_pos_pixel'},
{name = 'colour_1', ref_table = G.ARGS[v.arg_tab], ref_value = 'colour_1'},
{name = 'colour_2', ref_table = G.ARGS[v.arg_tab], ref_value = 'colour_2'},
{name = 'id', val = e.config.object.ID},
}}})
e.config.object:get_pos_pixel()
end
local _F = G.ARGS[v.arg_tab]
local exptime = math.exp(-0.4*G.real_dt)
if G.ARGS.score_intensity.earned_score >= G.ARGS.score_intensity.required_score and G.ARGS.score_intensity.required_score > big(0) then
_F.intensity = ((G.pack_cards and not G.pack_cards.REMOVED) or (G.TAROT_INTERRUPT)) and 0 or math.max(0., G.ARGS.score_intensity.earned_score.maxExp)
else
_F.intensity = 0
end
_F.timer = _F.timer + G.real_dt*(1 + _F.intensity*0.2)
if _F.intensity_vel < 0 then _F.intensity_vel = _F.intensity_vel*(1 - 10*G.real_dt) end
_F.intensity_vel = (1-exptime)*(_F.intensity - _F.real_intensity)*G.real_dt*25 + exptime*_F.intensity_vel
_F.real_intensity = math.max(0, _F.real_intensity + _F.intensity_vel)
_F.change = (_F.change or 0)*(1 - 4.*G.real_dt) + ( 4.*G.real_dt)*(_F.real_intensity < _F.intensity - 0.0 and 1 or 0)*_F.real_intensity
end
end
end
function ease_chips(mod)
G.E_MANAGER:add_event(Event({
trigger = 'immediate',
func = function()
local chip_UI = G.HUD:get_UIE_by_ID('chip_UI_count')
mod = mod or 0
G.GAME.chips = big(G.GAME.chips)
--Ease from current chips to the new number of chips
G.E_MANAGER:add_event(Event({
trigger = 'ease',
blockable = false,
ref_table = G.GAME,
ref_value = 'chips',
ease_to = mod,
delay = 0.3,
func = (function(t) return big.floor(t) end)
}))
--Popup text next to the chips in UI showing number of chips gained/lost
chip_UI:juice_up()
--Play a chip sound
play_sound('chips2')
return true
end
}))
end
function modulate_sound(dt)
--volume of the splash screen is set here
G.SPLASH_VOL = 2*dt*(G.STATE == G.STATES.SPLASH and 1 or 0) + (G.SPLASH_VOL or 1)*(1-2*dt)
--Control the music here
local desired_track =
G.video_soundtrack or
(G.STATE == G.STATES.SPLASH and '') or
(G.booster_pack_sparkles and not G.booster_pack_sparkles.REMOVED and 'music2') or
(G.booster_pack_meteors and not G.booster_pack_meteors.REMOVED and 'music3') or
(G.booster_pack and not G.booster_pack.REMOVED and 'music2') or
(G.shop and not G.shop.REMOVED and 'music4') or
(G.GAME.blind and G.GAME.blind.boss and 'music5') or
('music1')
G.PITCH_MOD = (G.PITCH_MOD or 1)*(1 - dt) + dt*((not G.normal_music_speed and G.STATE == G.STATES.GAME_OVER) and 0.5 or 1)
--For ambient sound control
G.SETTINGS.ambient_control = G.SETTINGS.ambient_control or {}
G.ARGS.score_intensity = G.ARGS.score_intensity or {}
if type(G.GAME.current_round.current_hand.chips) ~= 'table' or type(G.GAME.current_round.current_hand.mult) ~= 'table' then
if type(G.GAME.current_round.current_hand.chips) ~= 'number' or type(G.GAME.current_round.current_hand.mult) ~= 'number' then
G.ARGS.score_intensity.earned_score = big(0)
else
G.ARGS.score_intensity.earned_score = big(G.GAME.current_round.current_hand.chips)*big(G.GAME.current_round.current_hand.mult)
end
else
G.ARGS.score_intensity.earned_score = G.GAME.current_round.current_hand.chips*G.GAME.current_round.current_hand.mult
end
G.ARGS.score_intensity.required_score = G.GAME.blind and G.GAME.blind.chips or big(0)
G.ARGS.score_intensity.flames = math.min(1, (G.STAGE == G.STAGES.RUN and 1 or 0)*(
(G.ARGS.chip_flames and (G.ARGS.chip_flames.real_intensity + G.ARGS.chip_flames.change) or 0))/10)
local earned_score_exp = G.ARGS.score_intensity.earned_score.maxExp or 0
local required_score_exp = G.ARGS.score_intensity.required_score.maxExp or 0
if type(G.ARGS.score_intensity.required_score) == 'string' then G.ARGS.score_intensity.required_score = big(G.ARGS.score_intensity.required_score) end
G.ARGS.score_intensity.organ = G.video_organ or G.ARGS.score_intensity.required_score > big(0) and math.max(math.min(0.4, 0.1*(earned_score_exp-required_score_exp)),0.) or 0
local AC = G.SETTINGS.ambient_control
G.ARGS.ambient_sounds = G.ARGS.ambient_sounds or {
ambientFire2 = {volfunc = function(_prev_volume) return _prev_volume*(1 - dt) + dt*0.9*((G.ARGS.score_intensity.flames > 0.3) and 1 or G.ARGS.score_intensity.flames/0.3) end},
ambientFire1 = {volfunc = function(_prev_volume) return _prev_volume*(1 - dt) + dt*0.8*((G.ARGS.score_intensity.flames > 0.3) and (G.ARGS.score_intensity.flames-0.3)/0.7 or 0) end},
ambientFire3 = {volfunc = function(_prev_volume) return _prev_volume*(1 - dt) + dt*0.4*((G.ARGS.chip_flames and G.ARGS.chip_flames.change or 0) + (G.ARGS.mult_flames and G.ARGS.mult_flames.change or 0)) end},
ambientOrgan1 = {volfunc = function(_prev_volume) return _prev_volume*(1 - dt) + dt*0.6*(G.SETTINGS.SOUND.music_volume + 100)/200*(G.ARGS.score_intensity.organ) end},
}
for k, v in pairs(G.ARGS.ambient_sounds) do
AC[k] = AC[k] or {}
AC[k].per = (k == 'ambientOrgan1') and 0.7 or (k == 'ambientFire1' and 1.1) or (k == 'ambientFire2' and 1.05) or 1
AC[k].vol = (not G.video_organ and G.STATE == G.STATES.SPLASH) and 0 or AC[k].vol and v.volfunc(AC[k].vol) or 0
end
G.ARGS.push = G.ARGS.push or {}
G.ARGS.push.type = 'modulate'
G.ARGS.push.pitch_mod = G.PITCH_MOD
G.ARGS.push.state = G.STATE
G.ARGS.push.time = G.TIMERS.REAL
G.ARGS.push.dt = dt
G.ARGS.push.desired_track = desired_track
G.ARGS.push.sound_settings = G.SETTINGS.SOUND
G.ARGS.push.splash_vol = G.SPLASH_VOL
G.ARGS.push.overlay_menu = not (not G.OVERLAY_MENU)
G.ARGS.push.ambient_control = G.SETTINGS.ambient_control
if G.F_SOUND_THREAD then
G.SOUND_MANAGER.channel:push(G.ARGS.push)
else
MODULATE(G.ARGS.push)
end
end
function get_blind_amount(ante)
local k = 0.75
if not G.GAME.modifiers.scaling or G.GAME.modifiers.scaling == 1 then
local amounts = {
300, 800, 2800, 6000, 11000, 20000, 35000, 50000
}
if ante < 1 then return big(100) end
if ante <= 8 then return big(amounts[ante]) end
if ante <= 38 then
local a, b, c, d = amounts[8],1.6,ante-8,1 + 0.2*(ante-8)
temp = (b+(k*c)^d)
amount = big(temp)
for i=1,c-1 do
amount = amount * temp
end
return big.floor(amount * a)
else
local a, b, c, d = amounts[8],1.6,ante-8, 1 + 0.2*(ante-8)
local temp = math.floor(math.log10(b+(k*c)^d))
amount = big(a)
for i = 1,c do
amount = amount:shiftLeft(temp+1)
end
return amount
end
elseif G.GAME.modifiers.scaling == 2 then
local amounts = {
300, 1000, 3200, 9000, 18000, 32000, 56000, 90000
}
if ante < 1 then return big(100) end
if ante <= 8 then return big(amounts[ante]) end
if ante <= 38 then
local a, b, c, d = amounts[8],1.6,ante-8,1 + 0.2*(ante-8)
temp = (b+(k*c)^d)
amount = big(temp)
for i=1,c-1 do
amount = amount * temp
end
return big.floor(amount * a)
else
local a, b, c, d = amounts[8],1.6,ante-8, 1 + 0.2*(ante-8)
local temp = math.floor(math.log10(b+(k*c)^d))
amount = big(a)
for i = 1,c do
amount = amount:shiftLeft(temp)
end
return amount
end
elseif G.GAME.modifiers.scaling == 3 then
local amounts = {
300, 1200, 3600, 10000, 25000, 50000, 90000, 180000
}
if ante < 1 then return big(100) end
if ante <= 8 then return big(amounts[ante]) end
if ante <= 38 then
local a, b, c, d = amounts[8],1.6,ante-8,1 + 0.2*(ante-8)
temp = (b+(k*c)^d)
amount = big(temp)
for i=1,c-1 do
amount = amount * temp
end
return big.floor(amount * a)
else
local a, b, c, d = amounts[8],1.6,ante-8, 1 + 0.2*(ante-8)
local temp = math.floor(math.log10(b+(k*c)^d))
amount = big(a)
for i = 1,c do
amount = amount:shiftLeft(temp)
end
return amount
end
end
end
function score_number_scale(scale, amt)
G.E_SWITCH_POINT = G.E_SWITCH_POINT or 100000000000
if type(number) == 'table' then
if number >= big(G.E_SWITCH_POINT) then
scale = 0.7*(scale or 1)
elseif number >= big(1000000) then
scale = 14*0.75/(amt.maxExp+4)*(scale or 1)
end
return 0.75*(scale or 1)
end
if type(amt) ~= 'number' then return 0.7*(scale or 1) end
if amt >= G.E_SWITCH_POINT then
return 0.7*(scale or 1)
elseif amt >= 1000000 then
return 14*0.75/(math.floor(math.log(amt))+4)*(scale or 1)
else
return 0.75*(scale or 1)
end
end
function recursive_table_cull(t)
local ret_t = {}
for k, v in pairs(t) do
if type(v) == 'table' then
if v.is and v:is(big) then ret_t[k] = tostring(v)
elseif v.is and v:is(Object) then ret_t[k] = [["]].."MANUAL_REPLACE"..[["]]
else ret_t[k] = recursive_table_cull(v)
end
else ret_t[k] = v end
end
return ret_t
end
function end_round()
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.2,
func = function()
local game_over = true
local game_won = false
G.RESET_BLIND_STATES = true
G.RESET_JIGGLES = true
if G.GAME.chips - G.GAME.blind.chips >= big(0) then
game_over = false
end
for i = 1, #G.jokers.cards do
local eval = nil
eval = G.jokers.cards[i]:calculate_joker({end_of_round = true, game_over = game_over})
if eval then
if eval.saved then
game_over = false
end
card_eval_status_text(G.jokers.cards[i], 'jokers', nil, nil, nil, eval)
end
end
if G.GAME.round_resets.ante == G.GAME.win_ante and G.GAME.blind:get_type() == 'Boss' then
game_won = true
G.GAME.won = true
end
if game_over then
G.STATE = G.STATES.GAME_OVER
if not G.GAME.won and not G.GAME.seeded and not G.GAME.challenge then
G.PROFILES[G.SETTINGS.profile].high_scores.current_streak.amt = 0
end
G:save_settings()
G.FILE_HANDLER.force = true
G.STATE_COMPLETE = false
else
G.GAME.unused_discards = (G.GAME.unused_discards or 0) + G.GAME.current_round.discards_left
G.DEBUG_VALUE = G.GAME.unused_discards
if G.GAME.blind and G.GAME.blind.config.blind then
discover_card(G.GAME.blind.config.blind)
end
if G.GAME.blind:get_type() == 'Boss' then
local _handname, _played, _order = 'High Card', -1, 100
for k, v in pairs(G.GAME.hands) do
if v.played > _played or (v.played == _played and _order > v.order) then
_played = v.played
_handname = k
end
end
G.GAME.current_round.most_played_poker_hand = _handname
end
if G.GAME.blind:get_type() == 'Boss' and not G.GAME.seeded and not G.GAME.challenge then
G.GAME.current_boss_streak = G.GAME.current_boss_streak + 1
check_and_set_high_score('boss_streak', G.GAME.current_boss_streak)
end
if G.GAME.current_round.hands_played == 1 then
inc_career_stat('c_single_hand_round_streak', 1)
else
if not G.GAME.seeded and not G.GAME.challenge then
G.PROFILES[G.SETTINGS.profile].career_stats.c_single_hand_round_streak = 0
G:save_settings()
end
end
check_for_unlock({type = 'round_win'})
set_joker_usage()
if game_won and not G.GAME.win_notified then
G.GAME.win_notified = true
G.E_MANAGER:add_event(Event({
trigger = 'immediate',
blocking = false,
blockable = false,
func = (function()
if G.STATE == G.STATES.ROUND_EVAL then
win_game()
G.GAME.won = true
return true
end
end)
}))
end
for i=1, #G.hand.cards do
--Check for hand doubling
local reps = {1}
local j = 1
while j <= #reps do
local percent = (i-0.999)/(#G.hand.cards-0.998) + (j-1)*0.1
if reps[j] ~= 1 then card_eval_status_text((reps[j].jokers or reps[j].seals).card, 'jokers', nil, nil, nil, (reps[j].jokers or reps[j].seals)) end
--calculate the hand effects
local effects = {G.hand.cards[i]:get_end_of_round_effect()}
for k=1, #G.jokers.cards do
--calculate the joker individual card effects
local eval = G.jokers.cards[k]:calculate_joker({cardarea = G.hand, other_card = G.hand.cards[i], individual = true, end_of_round = true})
if eval then
table.insert(effects, eval)
end
end
if reps[j] == 1 then
--Check for hand doubling
--From Red seal
local eval = eval_card(G.hand.cards[i], {end_of_round = true,cardarea = G.hand, repetition = true, repetition_only = true})
if next(eval) and (next(effects[1]) or #effects > 1) then
for h = 1, eval.seals.repetitions do
reps[#reps+1] = eval
end
end
--from Jokers
for j=1, #G.jokers.cards do
--calculate the joker effects
local eval = eval_card(G.jokers.cards[j], {cardarea = G.hand, other_card = G.hand.cards[i], repetition = true, end_of_round = true, card_effects = effects})
if next(eval) then
for h = 1, eval.jokers.repetitions do
reps[#reps+1] = eval
end
end
end
end
for ii = 1, #effects do
--if this effect came from a joker
if effects[ii].card then
G.E_MANAGER:add_event(Event({
trigger = 'immediate',
func = (function() effects[ii].card:juice_up(0.7);return true end)
}))
end
--If dollars
if effects[ii].h_dollars then
ease_dollars(effects[ii].h_dollars)
card_eval_status_text(G.hand.cards[i], 'dollars', effects[ii].h_dollars, percent)
end
--Any extras
if effects[ii].extra then
card_eval_status_text(G.hand.cards[i], 'extra', nil, percent, nil, effects[ii].extra)
end
end
j = j + 1
end
end
delay(0.3)
G.FUNCS.draw_from_hand_to_discard()
if G.GAME.blind:get_type() == 'Boss' then
G.GAME.voucher_restock = nil
if G.GAME.modifiers.set_eternal_ante and (G.GAME.round_resets.ante == G.GAME.modifiers.set_eternal_ante) then
for k, v in ipairs(G.jokers.cards) do
v:set_eternal(true)
end
end
if G.GAME.modifiers.set_joker_slots_ante and (G.GAME.round_resets.ante == G.GAME.modifiers.set_joker_slots_ante) then
G.jokers.config.card_limit = 0
end
delay(0.4); ease_ante(1); delay(0.4); check_for_unlock({type = 'ante_up', ante = G.GAME.round_resets.ante + 1})
end
G.FUNCS.draw_from_discard_to_deck()
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.3,
func = function()
G.STATE = G.STATES.ROUND_EVAL
G.STATE_COMPLETE = false
if G.GAME.round_resets.blind == G.P_BLINDS.bl_small then
G.GAME.round_resets.blind_states.Small = 'Defeated'
elseif G.GAME.round_resets.blind == G.P_BLINDS.bl_big then
G.GAME.round_resets.blind_states.Big = 'Defeated'
else
G.GAME.current_round.voucher = get_next_voucher_key()
G.GAME.round_resets.blind_states.Boss = 'Defeated'
for k, v in ipairs(G.playing_cards) do
v.ability.played_this_ante = nil
end
end
if G.GAME.round_resets.temp_handsize then G.hand:change_size(-G.GAME.round_resets.temp_handsize); G.GAME.round_resets.temp_handsize = nil end
if G.GAME.round_resets.temp_reroll_cost then G.GAME.round_resets.temp_reroll_cost = nil; calculate_reroll_cost(true) end
reset_idol_card()
reset_mail_rank()
reset_ancient_card()
reset_castle_card()
for k, v in ipairs(G.playing_cards) do
v.ability.discarded = nil
v.ability.forced_selection = nil
end
return true
end
}))
end
return true
end
}))
end
G.FUNCS.evaluate_play = function(e)
local text,disp_text,poker_hands,scoring_hand,non_loc_disp_text = G.FUNCS.get_poker_hand_info(G.play.cards)
G.GAME.hands[text].played = G.GAME.hands[text].played + 1
G.GAME.hands[text].played_this_round = G.GAME.hands[text].played_this_round + 1
G.GAME.last_hand_played = text
set_hand_usage(text)
G.GAME.hands[text].visible = true
--Add all the pure bonus cards to the scoring hand
local pures = {}
for i=1, #G.play.cards do
if next(find_joker('Splash')) then
scoring_hand[i] = G.play.cards[i]
else
if G.play.cards[i].ability.effect == 'Stone Card' or G.play.cards[i].ability.effect == 'Coal Card' then
local inside = false
for j=1, #scoring_hand do
if scoring_hand[j] == G.play.cards[i] then
inside = true
end
end
if not inside then table.insert(pures, G.play.cards[i]) end
end
end
end
for i=1, #pures do
table.insert(scoring_hand, pures[i])
end
table.sort(scoring_hand, function (a, b) return a.T.x < b.T.x end )
delay(0.2)
for i=1, #scoring_hand do
--Highlight all the cards used in scoring and play a sound indicating highlight
highlight_card(scoring_hand[i],(i-0.999)/5,'up')
end
local percent = 0.3
local percent_delta = 0.08
if G.GAME.current_round.current_hand.handname ~= disp_text then delay(0.3) end
update_hand_text({sound = G.GAME.current_round.current_hand.handname ~= disp_text and 'button' or nil, volume = 0.4, immediate = true, nopulse = nil,
delay = G.GAME.current_round.current_hand.handname ~= disp_text and 0.4 or 0}, {handname=disp_text, level=G.GAME.hands[text].level, mult = G.GAME.hands[text].mult, chips = G.GAME.hands[text].chips})
if not G.GAME.blind:debuff_hand(G.play.cards, poker_hands, text) then
mult = mod_mult(big(G.GAME.hands[text].mult))
hand_chips = mod_chips(big(G.GAME.hands[text].chips))
check_for_unlock({type = 'hand', handname = text, disp_text = non_loc_disp_text, scoring_hand = scoring_hand, full_hand = G.play.cards})
delay(0.4)
if G.GAME.first_used_hand_level and G.GAME.first_used_hand_level > 0 then
level_up_hand(G.deck.cards[1], text, nil, G.GAME.first_used_hand_level)
G.GAME.first_used_hand_level = nil
end
local hand_text_set = false
for i=1, #G.jokers.cards do
--calculate the joker effects
local effects = eval_card(G.jokers.cards[i], {cardarea = G.jokers, full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands, before = true})
if effects.jokers then
card_eval_status_text(G.jokers.cards[i], 'jokers', nil, percent, nil, effects.jokers)
percent = percent + percent_delta
if effects.jokers.level_up then
level_up_hand(G.jokers.cards[i], text)
end
end
end
mult = mod_mult(G.GAME.hands[text].mult)
hand_chips = mod_chips(G.GAME.hands[text].chips)
local modded = false
mult, hand_chips, modded = G.GAME.blind:modify_hand(G.play.cards, poker_hands, text, mult, hand_chips)
mult, hand_chips = big(mod_mult(mult)), big(mod_chips(hand_chips))
if modded then update_hand_text({sound = 'chips2', modded = modded}, {chips = hand_chips, mult = mult}) end
for i=1, #scoring_hand do
--add cards played to list
if scoring_hand[i].ability.effect ~= 'Stone Card' or scoring_hand[i].ability.effect ~= 'Coal Card' then
G.GAME.cards_played[scoring_hand[i].base.value].total = G.GAME.cards_played[scoring_hand[i].base.value].total + 1
G.GAME.cards_played[scoring_hand[i].base.value].suits[scoring_hand[i].base.suit] = true
end
--if card is debuffed
if scoring_hand[i].debuff then
G.GAME.blind.triggered = true
G.E_MANAGER:add_event(Event({
trigger = 'immediate',
func = (function() G.HUD_blind:get_UIE_by_ID('HUD_blind_debuff_1'):juice_up(0.3, 0)
G.HUD_blind:get_UIE_by_ID('HUD_blind_debuff_2'):juice_up(0.3, 0)
G.GAME.blind:juice_up();return true end)
}))
card_eval_status_text(scoring_hand[i], 'debuff')
else
--Check for play doubling
local reps = {1}
--From Red seal
local eval = eval_card(scoring_hand[i], {repetition_only = true,cardarea = G.play, full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands, repetition = true})
if next(eval) then
for h = 1, eval.seals.repetitions do
reps[#reps+1] = eval
end
end
--From jokers
for j=1, #G.jokers.cards do
--calculate the joker effects
local eval = eval_card(G.jokers.cards[j], {cardarea = G.play, full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands, other_card = scoring_hand[i], repetition = true})
if next(eval) and eval.jokers then
for h = 1, eval.jokers.repetitions do
reps[#reps+1] = eval
end
end
end
for j=1,#reps do
percent = percent + percent_delta
if reps[j] ~= 1 then
card_eval_status_text((reps[j].jokers or reps[j].seals).card, 'jokers', nil, nil, nil, (reps[j].jokers or reps[j].seals))
end
--calculate the hand effects
local effects = {eval_card(scoring_hand[i], {cardarea = G.play, full_hand = G.play.cards, scoring_hand = scoring_hand, poker_hand = text})}
for k=1, #G.jokers.cards do
--calculate the joker individual card effects
local eval = G.jokers.cards[k]:calculate_joker({cardarea = G.play, full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands, other_card = scoring_hand[i], individual = true})
if eval then
table.insert(effects, eval)
end
end
scoring_hand[i].lucky_trigger = nil
for ii = 1, #effects do
--If chips added, do chip add event and add the chips to the total
if effects[ii].coal and effects[ii].card then
local card = effects[ii].card
if card.ability.extra.current >= card.ability.extra.rounds then
card.ability.extra.current = 1
else
card.ability.extra.current = card.ability.extra.current + 1
end
end
if effects[ii].chips then
if effects[ii].card then juice_card(effects[ii].card) end
hand_chips = mod_chips(hand_chips + effects[ii].chips)
update_hand_text({delay = 0}, {chips = hand_chips})
card_eval_status_text(scoring_hand[i], 'chips', effects[ii].chips, percent)
end
--If mult added, do mult add event and add the mult to the total
if effects[ii].mult then
if effects[ii].card then juice_card(effects[ii].card) end
mult = mod_mult(mult + effects[ii].mult)
update_hand_text({delay = 0}, {mult = mult})
card_eval_status_text(scoring_hand[i], 'mult', effects[ii].mult, percent)
end
if effects[ii].wooden then
card_eval_status_text(scoring_hand[i], 'debuff')
end