mirror of
https://github.com/wlinator/luminara.git
synced 2024-10-02 18:23:12 +00:00
Increase BJ MP & utilize JSON
BJ MP = BlackJack multiplier. It went from 1.20 to 1.50
This commit is contained in:
parent
efe166d999
commit
eb11990da5
5 changed files with 20 additions and 13 deletions
|
@ -4,10 +4,10 @@
|
|||
"daily_reward": 50,
|
||||
"blackjack": {
|
||||
"emotes": {
|
||||
"hit_id": 1119262723285467156,
|
||||
"stand_id": 1118923298298929154
|
||||
"hit": "<:hit:1119262723285467156>",
|
||||
"stand": "<:stand:1118923298298929154>"
|
||||
},
|
||||
"reward_multiplier": 1,
|
||||
"reward_multiplier": 1.5,
|
||||
"deck_suits": [
|
||||
"♠",
|
||||
"♡",
|
||||
|
|
|
@ -6,3 +6,10 @@ def load_strings(path="config/strings.en-US.json"):
|
|||
data = json.load(file)
|
||||
|
||||
return data
|
||||
|
||||
|
||||
def load_economy_config(path="config/economy.json"):
|
||||
with open(path, 'r') as file:
|
||||
data = json.load(file)
|
||||
|
||||
return data
|
||||
|
|
3
main.py
3
main.py
|
@ -20,8 +20,9 @@ from config import json_loader
|
|||
logging.basicConfig(level=logging.INFO)
|
||||
load_dotenv('.env')
|
||||
|
||||
# load all strings.en-US.json strings
|
||||
# load all json
|
||||
strings = json_loader.load_strings()
|
||||
economy_config = json_loader.load_economy_config()
|
||||
|
||||
sbbot = discord.Bot(
|
||||
owner_id=os.getenv('OWNER_ID'),
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import asyncio
|
||||
import json
|
||||
import os
|
||||
import random
|
||||
|
||||
|
@ -10,6 +9,7 @@ from dotenv import load_dotenv
|
|||
from data.BlackJackStats import BlackJackStats
|
||||
from data.Currency import Currency
|
||||
from data.SlotsStats import SlotsStats
|
||||
from main import economy_config
|
||||
from sb_tools import economy_embeds, economy_functions, universal, interaction, embeds
|
||||
|
||||
load_dotenv('.env')
|
||||
|
@ -18,9 +18,6 @@ active_blackjack_games = {}
|
|||
special_balance_name = os.getenv("SPECIAL_BALANCE_NAME")
|
||||
cash_balance_name = os.getenv("CASH_BALANCE_NAME")
|
||||
|
||||
with open("config/economy.json") as file:
|
||||
json_data = json.load(file)
|
||||
|
||||
|
||||
class Gambling(commands.Cog):
|
||||
def __init__(self, sbbot):
|
||||
|
@ -133,7 +130,7 @@ class Gambling(commands.Cog):
|
|||
|
||||
else:
|
||||
# bet multiplier
|
||||
payout = bet * 1.2
|
||||
payout = bet * float(economy_config["blackjack"]["reward_multiplier"])
|
||||
ctx_currency.add_cash(payout)
|
||||
ctx_currency.push()
|
||||
|
||||
|
@ -262,8 +259,8 @@ class Gambling(commands.Cog):
|
|||
if view.clickedConfirm:
|
||||
winner = random.choice([challenger, opponent])
|
||||
loser = opponent if winner == challenger else challenger
|
||||
combat_message = random.choice(json_data["duel"]["combat_messages"]).format(f"**{winner.name}**",
|
||||
f"**{loser.name}**")
|
||||
combat_message = random.choice(economy_config["duel"]["combat_messages"]).format(f"**{winner.name}**",
|
||||
f"**{loser.name}**")
|
||||
|
||||
await ctx.respond(content=f"{combat_message}\n\n"
|
||||
f"{winner.mention} wins **{cash_balance_name}{bet}**\n"
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
import random
|
||||
from collections import Counter
|
||||
|
||||
from main import economy_config
|
||||
|
||||
|
||||
def blackjack_get_new_deck():
|
||||
suits = ['♠', '♡', '♢', '♣']
|
||||
ranks = ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K']
|
||||
suits = economy_config["blackjack"]["deck_suits"]
|
||||
ranks = economy_config["blackjack"]["deck_ranks"]
|
||||
deck = []
|
||||
for suit in suits:
|
||||
for rank in ranks:
|
||||
|
|
Loading…
Reference in a new issue