forked from rDrama/rDrama
fMerge branch 'frost' of https://github.com/Aevann1/Drama into frost
commit
7e2e1bc5c5
|
@ -107,7 +107,8 @@ def player_stayed(from_comment):
|
||||||
deck = deck.split("/")
|
deck = deck.split("/")
|
||||||
|
|
||||||
if dealer_value == 21 and is_insured == "1":
|
if dealer_value == 21 and is_insured == "1":
|
||||||
from_comment.author.coins += int(wager)
|
currency_value = getattr(from_comment.author, kind, 0)
|
||||||
|
setattr(from_comment.author, kind, currency_value + int(wager))
|
||||||
else:
|
else:
|
||||||
while dealer_value < 17 and dealer_value != -1:
|
while dealer_value < 17 and dealer_value != -1:
|
||||||
next = deck.pop(0)
|
next = deck.pop(0)
|
||||||
|
@ -126,12 +127,13 @@ def player_doubled_down(from_comment):
|
||||||
# When doubling down, the player receives one additional card (a "hit") and their initial bet is doubled.
|
# When doubling down, the player receives one additional card (a "hit") and their initial bet is doubled.
|
||||||
player_hand, dealer_hand, deck, status, wager, kind, is_insured = from_comment.blackjack_result.split("_")
|
player_hand, dealer_hand, deck, status, wager, kind, is_insured = from_comment.blackjack_result.split("_")
|
||||||
wager_value = int(wager)
|
wager_value = int(wager)
|
||||||
|
currency_value = getattr(from_comment.author, kind, 0)
|
||||||
|
|
||||||
# Gotsta have enough coins
|
# Gotsta have enough coins
|
||||||
if (from_comment.author.coins < wager_value): return
|
if (currency_value < wager_value): return
|
||||||
|
|
||||||
# Double the initial wager
|
# Double the initial wager
|
||||||
from_comment.author.coins -= wager_value
|
setattr(from_comment.author, kind, currency_value - wager_value)
|
||||||
wager_value *= 2
|
wager_value *= 2
|
||||||
|
|
||||||
# Apply the changes to the stored hand.
|
# Apply the changes to the stored hand.
|
||||||
|
@ -148,12 +150,13 @@ def player_bought_insurance(from_comment):
|
||||||
player_hand, dealer_hand, deck, status, wager, kind, is_insured = from_comment.blackjack_result.split("_")
|
player_hand, dealer_hand, deck, status, wager, kind, is_insured = from_comment.blackjack_result.split("_")
|
||||||
wager_value = int(wager)
|
wager_value = int(wager)
|
||||||
insurance_cost = wager_value / 2
|
insurance_cost = wager_value / 2
|
||||||
|
currency_value = getattr(from_comment.author, kind, 0)
|
||||||
|
|
||||||
# Gotsta have enough coins
|
# Gotsta have enough coins
|
||||||
if (from_comment.author.coins < insurance_cost): return
|
if (currency_value < insurance_cost): return
|
||||||
|
|
||||||
# Charge for (and grant) insurance
|
# Charge for (and grant) insurance
|
||||||
from_comment.author.coins -= insurance_cost
|
setattr(from_comment.author, kind, currency_value - insurance_cost)
|
||||||
is_insured = 1
|
is_insured = 1
|
||||||
|
|
||||||
# Apply the changes to the stored hand.
|
# Apply the changes to the stored hand.
|
||||||
|
|
|
@ -1299,7 +1299,7 @@ def submit_post(v, sub=None):
|
||||||
rev = f"* [unddit.com](https://unddit.com/{rev})\n"
|
rev = f"* [unddit.com](https://unddit.com/{rev})\n"
|
||||||
elif post.url.startswith("https://old.reddit.com/u/"):
|
elif post.url.startswith("https://old.reddit.com/u/"):
|
||||||
rev = post.url.replace('https://old.reddit.com/u/', '')
|
rev = post.url.replace('https://old.reddit.com/u/', '')
|
||||||
rev = f"* [camas.github.io](https://camas.github.io/reddit-search/#\u007b\"author\":\"{rev}\",\"resultSize\":100\u007d)\n"
|
rev = f"* [search.marsey.cat](https://search.marsey.cat/reddit-search/#\u007b\"author\":\"{rev}\",\"resultSize\":100\u007d)\n"
|
||||||
else: rev = ''
|
else: rev = ''
|
||||||
|
|
||||||
newposturl = post.url
|
newposturl = post.url
|
||||||
|
@ -1321,10 +1321,11 @@ def submit_post(v, sub=None):
|
||||||
if f'**[{title}]({href})**:\n\n' not in body:
|
if f'**[{title}]({href})**:\n\n' not in body:
|
||||||
body += f'**[{title}]({href})**:\n\n'
|
body += f'**[{title}]({href})**:\n\n'
|
||||||
if href.startswith('https://old.reddit.com/r/'):
|
if href.startswith('https://old.reddit.com/r/'):
|
||||||
body += f'* [unddit.com](https://unddit.com/{href.replace("https://old.reddit.com/", "")})\n'
|
rev = href.replace('https://old.reddit.com/', '')
|
||||||
|
body += f'* [unddit.com](https://unddit.com/{rev})\n'
|
||||||
if href.startswith('https://old.reddit.com/u/'):
|
if href.startswith('https://old.reddit.com/u/'):
|
||||||
rev = post.url.replace('https://old.reddit.com/u/', '')
|
rev = href.replace('https://old.reddit.com/u/', '')
|
||||||
body += f"* [camas.github.io](https://camas.github.io/reddit-search/#\u007b\"author\":\"{rev}\",\"resultSize\":100\u007d)\n"
|
body += f"* [search.marsey.cat](https://search.marsey.cat/reddit-search/#\u007b\"author\":\"{rev}\",\"resultSize\":100\u007d)\n"
|
||||||
body += f'* [archive.org](https://web.archive.org/{href})\n'
|
body += f'* [archive.org](https://web.archive.org/{href})\n'
|
||||||
body += f'* [archive.ph](https://archive.ph/?url={quote(href)}&run=1) (click to archive)\n'
|
body += f'* [archive.ph](https://archive.ph/?url={quote(href)}&run=1) (click to archive)\n'
|
||||||
body += f'* [ghostarchive.org](https://ghostarchive.org/search?term={quote(href)}) (click to archive)\n\n'
|
body += f'* [ghostarchive.org](https://ghostarchive.org/search?term={quote(href)}) (click to archive)\n\n'
|
||||||
|
|
|
@ -83,4 +83,4 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/assets/js/emoji_modal.js?v=276"></script>
|
<script src="/assets/js/emoji_modal.js?v=278"></script>
|
|
@ -25,15 +25,15 @@ INSERT INTO public.users (username, passhash, created_utc, admin_level, over_18,
|
||||||
('AutoPoller', '', extract(epoch from now()), 0, true, true, '', '', 0, false,
|
('AutoPoller', '', extract(epoch from now()), 0, true, true, '', '', 0, false,
|
||||||
0, 'AutoPoller', '', 'hot', 'top', 'day', '62ca56', 'e4432d',
|
0, 'AutoPoller', '', 'hot', 'top', 'day', '62ca56', 'e4432d',
|
||||||
'', 'dark', '30409f', false, 'old.reddit.com', '', '', 0, 0,
|
'', 'dark', '30409f', false, 'old.reddit.com', '', '', 0, 0,
|
||||||
0, 0, '', 'Verified', 0, false),
|
0, 0, '', 'Verified', 0, false, '', ''),
|
||||||
('AutoBetter', '', extract(epoch from now()), 0, true, true, '', '', 0, false,
|
('AutoBetter', '', extract(epoch from now()), 0, true, true, '', '', 0, false,
|
||||||
0, 'AutoBetter', '', 'hot', 'top', 'day', '62ca56', 'e4432d',
|
0, 'AutoBetter', '', 'hot', 'top', 'day', '62ca56', 'e4432d',
|
||||||
'', 'dark', '30409f', false, 'old.reddit.com', '', '', 0, 0,
|
'', 'dark', '30409f', false, 'old.reddit.com', '', '', 0, 0,
|
||||||
0, 0, '', 'Verified', 0, false),
|
0, 0, '', 'Verified', 0, false, '', ''),
|
||||||
('AutoChoice', '', extract(epoch from now()), 0, true, true, '', '', 0, false,
|
('AutoChoice', '', extract(epoch from now()), 0, true, true, '', '', 0, false,
|
||||||
0, 'AutoChoice', '', 'hot', 'top', 'day', '62ca56', 'e4432d',
|
0, 'AutoChoice', '', 'hot', 'top', 'day', '62ca56', 'e4432d',
|
||||||
'', 'dark', '30409f', false, 'old.reddit.com', '', '', 0, 0,
|
'', 'dark', '30409f', false, 'old.reddit.com', '', '', 0, 0,
|
||||||
0, 0, '', 'Verified', 0, false);
|
0, 0, '', 'Verified', 0, false, '', '');
|
||||||
|
|
||||||
INSERT INTO public.badge_defs VALUES
|
INSERT INTO public.badge_defs VALUES
|
||||||
(1,'Alpha User','Joined during open alpha'),
|
(1,'Alpha User','Joined during open alpha'),
|
||||||
|
|
Loading…
Reference in New Issue