File tree Expand file tree Collapse file tree 5 files changed +16
-24
lines changed
Expand file tree Collapse file tree 5 files changed +16
-24
lines changed Original file line number Diff line number Diff line change @@ -109,12 +109,11 @@ local membershipcardtwo = {
109109 if Card .get_gameset (card ) == " modest" then
110110 a = 8
111111 end
112- -- HATA DÜZELTME: "or 0" eklendi
113112 return {
114113 key = Cryptid .gameset_loc (self , { modest = " balanced" }),
115114 vars = {
116115 card .ability .extra .chips ,
117- card .ability .extra .chips * math.floor (( GLOBAL_cry_member_count or 0 ) / a ),
116+ card .ability .extra .chips * math.floor (Cryptid . member_count / a ),
118117 },
119118 }
120119 end ,
@@ -124,15 +123,13 @@ local membershipcardtwo = {
124123 if Card .get_gameset (card ) == " modest" then
125124 a = 8
126125 end
127- -- HATA DÜZELTME: "or 0" eklendi
128- local member_count = GLOBAL_cry_member_count or 0
129126 return {
130127 message = localize ({
131128 type = " variable" ,
132129 key = " a_chips" ,
133- vars = { card .ability .extra .chips * math.floor (member_count / a ) },
130+ vars = { card .ability .extra .chips * math.floor (Cryptid . member_count / a ) },
134131 }),
135- chip_mod = card .ability .extra .chips * math.floor (member_count / a ),
132+ chip_mod = card .ability .extra .chips * math.floor (Cryptid . member_count / a ),
136133 }
137134 end
138135 end ,
Original file line number Diff line number Diff line change @@ -449,7 +449,7 @@ if JokerDisplay then
449449 },
450450 text_config = { colour = G .C .CHIPS },
451451 calc_function = function (card )
452- card .joker_display_values .stat = card .ability .extra .chips * ( GLOBAL_cry_member_count or 1 )
452+ card .joker_display_values .stat = card .ability .extra .chips * Cryptid . member_count
453453 end ,
454454 }
455455 JokerDisplay .Definitions [" j_cry_redeo" ] = {
@@ -1754,7 +1754,7 @@ if JokerDisplay then
17541754 },
17551755 calc_function = function (card )
17561756 card .joker_display_values .stat =
1757- math.max (1 , ( card .ability .extra .Xmult_mod * ( GLOBAL_cry_member_count or 1 )) )
1757+ math.max (1 , card .ability .extra .Xmult_mod * Cryptid . member_count )
17581758 end ,
17591759 }
17601760 JokerDisplay .Definitions [" j_cry_cryptidmoment" ] = {
Original file line number Diff line number Diff line change @@ -6189,17 +6189,17 @@ local membershipcard = {
61896189 blueprint_compat = true ,
61906190 atlas = " atlasthree" ,
61916191 loc_vars = function (self , info_queue , card )
6192- return { vars = { card .ability .extra .Xmult_mod , card .ability .extra .Xmult_mod * GLOBAL_cry_member_count } }
6192+ return { vars = { card .ability .extra .Xmult_mod , card .ability .extra .Xmult_mod * Cryptid . member_count } }
61936193 end ,
61946194 calculate = function (self , card , context )
6195- if context .joker_main and card .ability .extra .Xmult_mod * GLOBAL_cry_member_count > 1 then
6195+ if context .joker_main and card .ability .extra .Xmult_mod * Cryptid . member_count > 1 then
61966196 return {
61976197 message = localize ({
61986198 type = " variable" ,
61996199 key = " a_xmult" ,
6200- vars = { card .ability .extra .Xmult_mod * GLOBAL_cry_member_count },
6200+ vars = { card .ability .extra .Xmult_mod * Cryptid . member_count },
62016201 }),
6202- Xmult_mod = card .ability .extra .Xmult_mod * GLOBAL_cry_member_count ,
6202+ Xmult_mod = card .ability .extra .Xmult_mod * Cryptid . member_count ,
62036203 }
62046204 end
62056205 end ,
Original file line number Diff line number Diff line change @@ -3,12 +3,10 @@ local member_fallback = 24000
33local https = require (" SMODS.https" )
44local last_update_time = 0
55local initial = true
6+ Cryptid .member_count = member_fallback
67local function apply_discord_member_count (code , body , headers )
7- if not GLOBAL_cry_member_count then
8- GLOBAL_cry_member_count = member_fallback
9- end
108 if body then
11- GLOBAL_cry_member_count = string.match (body , ' "approximate_member_count"%s*:%s*(%d+)' )
9+ Cryptid . member_count = string.match (body , ' "approximate_member_count"%s*:%s*(%d+)' )
1210 end
1311end
1412function Cryptid .update_member_count ()
@@ -21,8 +19,5 @@ function Cryptid.update_member_count()
2119 apply_discord_member_count
2220 )
2321 end
24- else
25- -- Use a fallback value if HTTPS is disabled (you all are awesome)
26- GLOBAL_cry_member_count = member_fallback
27- end
22+ end -- you all are awesome :)
2823end
Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ target = "game.lua"
1010pattern = ''' if G.FILE_HANDLER and G.FILE_HANDLER and G.FILE_HANDLER.update_queued and ('''
1111position = " before"
1212payload = '''
13- if not GLOBAL_cry_member_count_delay then GLOBAL_cry_member_count_delay = 0 end
14- if (GLOBAL_cry_member_count_delay > 5) or not GLOBAL_cry_member_count then -- it doesn't need to update this frequently? but it also doesn't need to be higher tbh...
13+ if not Cryptid.member_count_delay then Cryptid.member_count_delay = 0 end
14+ if (Cryptid.member_count_delay > 5) or not Cryptid.member_count then -- it doesn't need to update this frequently? but it also doesn't need to be higher tbh...
1515 if Cryptid.update_member_count then Cryptid.update_member_count() end -- i honestly hate nil checks like this, wish there was a shorthand
16- GLOBAL_cry_member_count_delay = 0
16+ Cryptid.member_count_delay = 0
1717else
18- GLOBAL_cry_member_count_delay = GLOBAL_cry_member_count_delay + dt
18+ Cryptid.member_count_delay = Cryptid.member_count_delay + dt
1919end
2020'''
2121match_indent = true
You can’t perform that action at this time.
0 commit comments