Skip to content

Commit

Permalink
Patreon stacking tokens fix (#4618)
Browse files Browse the repository at this point in the history
* converts tokens to build per month

* part 2 automates the metacoins

* Update preferences.dm

* Update code/modules/client/preferences.dm

* stuff

* Update meta_tokens.dm

* Update meta_tokens.dm

---------

Co-authored-by: Lucy <[email protected]>
  • Loading branch information
dwasint and Absolucy authored Dec 19, 2024
1 parent 526b164 commit 46152ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion monkestation/code/datums/meta_tokens.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ GLOBAL_LIST_INIT(patreon_etoken_values, list(
/datum/meta_token_holder/proc/convert_list_to_tokens(list/saved_tokens)
if(!length(saved_tokens))
return
for(var/token in saved_tokens)
if(isnull(saved_tokens[token]))
saved_tokens[token] = 0

total_low_threat_tokens = saved_tokens["low_threat"]
total_medium_threat_tokens = saved_tokens["medium_threat"]
total_high_threat_tokens = saved_tokens["high_threat"]
Expand Down Expand Up @@ -92,13 +96,14 @@ GLOBAL_LIST_INIT(patreon_etoken_values, list(
if(!patreon?.has_access(ACCESS_COMMAND_RANK))
return FALSE
var/month_number = text2num(time2text(world.time, "MM"))
owner.prefs.token_month = month_number
if(owner.prefs.token_month != month_number)
owner.prefs.adjust_metacoins(owner?.ckey, 10000, "Monthly Monkecoin rations.", TRUE, FALSE, FALSE)
if(!patreon.has_access(ACCESS_TRAITOR_RANK))
owner.prefs.save_preferences()
owner.prefs.token_month = month_number
return FALSE
if(owner.prefs.token_month == month_number)
owner.prefs.token_month = month_number
return FALSE
donator_token++
owner.prefs.token_month = month_number
Expand Down
1 change: 1 addition & 0 deletions monkestation/code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"low_threat" = 0,
"event_tokens" = 0,
"event_token_month" = 0,
"donator" = 0,
)

///amount of metaconis you can earn per shift
Expand Down

0 comments on commit 46152ac

Please sign in to comment.