fMerge branch 'frost' of https://github.com/Aevann1/Drama into frost

master
Aevann1 2022-05-09 01:08:15 +00:00
commit 7e2e1bc5c5
4 changed files with 17 additions and 13 deletions

View File

@ -107,7 +107,8 @@ def player_stayed(from_comment):
deck = deck.split("/")
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:
while dealer_value < 17 and dealer_value != -1:
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.
player_hand, dealer_hand, deck, status, wager, kind, is_insured = from_comment.blackjack_result.split("_")
wager_value = int(wager)
currency_value = getattr(from_comment.author, kind, 0)
# Gotsta have enough coins
if (from_comment.author.coins < wager_value): return
if (currency_value < wager_value): return
# Double the initial wager
from_comment.author.coins -= wager_value
setattr(from_comment.author, kind, currency_value - wager_value)
wager_value *= 2
# 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("_")
wager_value = int(wager)
insurance_cost = wager_value / 2
currency_value = getattr(from_comment.author, kind, 0)
# Gotsta have enough coins
if (from_comment.author.coins < insurance_cost): return
if (currency_value < insurance_cost): return
# Charge for (and grant) insurance
from_comment.author.coins -= insurance_cost
setattr(from_comment.author, kind, currency_value - insurance_cost)
is_insured = 1
# Apply the changes to the stored hand.

View File

@ -1299,7 +1299,7 @@ def submit_post(v, sub=None):
rev = f"* [unddit.com](https://unddit.com/{rev})\n"
elif post.url.startswith("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 = ''
newposturl = post.url
@ -1321,10 +1321,11 @@ def submit_post(v, sub=None):
if f'**[{title}]({href})**:\n\n' not in body:
body += f'**[{title}]({href})**:\n\n'
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/'):
rev = post.url.replace('https://old.reddit.com/u/', '')
body += f"* [camas.github.io](https://camas.github.io/reddit-search/#\u007b\"author\":\"{rev}\",\"resultSize\":100\u007d)\n"
rev = href.replace('https://old.reddit.com/u/', '')
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.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'

View File

@ -83,4 +83,4 @@
</div>
</div>
<script src="/assets/js/emoji_modal.js?v=276"></script>
<script src="/assets/js/emoji_modal.js?v=278"></script>

View File

@ -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,
0, 'AutoPoller', '', 'hot', 'top', 'day', '62ca56', 'e4432d',
'', '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,
0, 'AutoBetter', '', 'hot', 'top', 'day', '62ca56', 'e4432d',
'', '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,
0, 'AutoChoice', '', 'hot', 'top', 'day', '62ca56', 'e4432d',
'', 'dark', '30409f', false, 'old.reddit.com', '', '', 0, 0,
0, 0, '', 'Verified', 0, false);
0, 0, '', 'Verified', 0, false, '', '');
INSERT INTO public.badge_defs VALUES
(1,'Alpha User','Joined during open alpha'),