From be983504b7037d4a1ff7fd8d16a69950e008869c Mon Sep 17 00:00:00 2001 From: TLSM Date: Mon, 18 Jul 2022 03:47:17 -0400 Subject: [PATCH] LGB: disable gambling. --- files/helpers/blackjack.py | 2 +- files/helpers/const.py | 4 ++++ files/helpers/slots.py | 2 +- files/helpers/treasure.py | 2 +- files/templates/formatting.html | 32 +++++++++++++++++--------------- 5 files changed, 24 insertions(+), 18 deletions(-) diff --git a/files/helpers/blackjack.py b/files/helpers/blackjack.py index c0c753059..49d75908a 100644 --- a/files/helpers/blackjack.py +++ b/files/helpers/blackjack.py @@ -51,7 +51,7 @@ def format_all(player_hand, dealer_hand, deck, status, wager, kind, is_insured=0 def check_for_blackjack_commands(in_text, from_user, from_comment): - if not from_user.can_gamble: + if not FEATURES['GAMBLING'] or not from_user.can_gamble: return for command_word in (coins_command_word, marseybux_command_word): diff --git a/files/helpers/const.py b/files/helpers/const.py index 1ff146e5f..260c0c78a 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -150,6 +150,7 @@ FEATURES = { 'PRONOUNS': False, 'HOUSES': False, 'USERS_SUICIDE': True, + 'GAMBLING': True, } EMOJI_MARSEYS = True @@ -327,6 +328,7 @@ elif SITE == 'lgbdropthet.com': FEATURES['PROCOINS'] = False FEATURES['CHAT'] = False FEATURES['USERS_SUICIDE'] = False + FEATURES['GAMBLING'] = False EMOJI_MARSEYS = False EMOJI_SRCS = ['files/assets/emojis.lgbdropthet.json'] @@ -350,6 +352,8 @@ else: # localhost or testing environment implied FEATURES['PRONOUNS'] = True FEATURES['HOUSES'] = True + FEATURES['GAMBLING'] = False + if SITE == 'deuxrama.net': PERMS['HOLE_CREATE'] = 3 PERMS['CONTENT_THREADS'] = 2 diff --git a/files/helpers/slots.py b/files/helpers/slots.py index 55a0c0078..cc75bf275 100644 --- a/files/helpers/slots.py +++ b/files/helpers/slots.py @@ -19,7 +19,7 @@ def shuffle(stuff): return stuff def check_for_slots_command(in_text, from_user, from_comment): - if not from_user.can_gamble: + if not FEATURES['GAMBLING'] or not from_user.can_gamble: return in_text = in_text.lower() diff --git a/files/helpers/treasure.py b/files/helpers/treasure.py index 2c23e76a3..ad29855f7 100644 --- a/files/helpers/treasure.py +++ b/files/helpers/treasure.py @@ -12,7 +12,7 @@ lotterizer_rate = 33 def check_for_treasure(in_text, from_comment): user = from_comment.author - if not user.can_gamble: + if not FEATURES['GAMBLING'] or not user.can_gamble: return if '!slots' not in in_text and '!blackjack' not in in_text and '!wordle' not in in_text: diff --git a/files/templates/formatting.html b/files/templates/formatting.html index 474c6abb9..248d0acb6 100644 --- a/files/templates/formatting.html +++ b/files/templates/formatting.html @@ -599,25 +599,27 @@ line breaks - - !slots100 - Play slots using coins - minimum 100 coins - - {% if FEATURES['PROCOINS'] %} + {% if FEATURES['GAMBLING'] %} - !slotsmb100 - Play slots using marseybux - minimum 100 marseybux + !slots100 + Play slots using coins - minimum 100 coins - {% endif %} - - !blackjack100 - Play blackjack using coins - minimum 100 coins - - {% if FEATURES['PROCOINS'] %} + {% if FEATURES['PROCOINS'] %} + + !slotsmb100 + Play slots using marseybux - minimum 100 marseybux + + {% endif %} - !blackjackmb100 - Play blackjack using marseybux - minimum 100 marseybux + !blackjack100 + Play blackjack using coins - minimum 100 coins + {% if FEATURES['PROCOINS'] %} + + !blackjackmb100 + Play blackjack using marseybux - minimum 100 marseybux + + {% endif %} {% endif %} !wordle