diff options
author | 2018-11-20 13:30:38 +0100 | |
---|---|---|
committer | 2018-11-20 13:30:38 +0100 | |
commit | 7ac3946023f48dfebeb0335f66421773cde2d900 (patch) | |
tree | 01f32936cfb480ebaf37ded2fa197913d7136c5f | |
parent | Solved merge conflicts (diff) |
Cleaning up bats a bit
-rw-r--r-- | bot/cogs/hacktober/candy_collection.py | 4 | ||||
-rw-r--r-- | bot/constants.py | 1 | ||||
-rw-r--r-- | bot/resources/halloween/candy_collection.json (renamed from bot/cogs/resources/candy_collection.json) | 0 | ||||
-rw-r--r-- | bot/utils/spookifications.py | 12 |
4 files changed, 10 insertions, 7 deletions
diff --git a/bot/cogs/hacktober/candy_collection.py b/bot/cogs/hacktober/candy_collection.py index 59eadd93..508793a2 100644 --- a/bot/cogs/hacktober/candy_collection.py +++ b/bot/cogs/hacktober/candy_collection.py @@ -5,9 +5,9 @@ import json import functools import os -json_location = os.path.join(os.getcwd(), 'resources', 'candy_collection.json') +from bot.constants import HACKTOBER_CHANNEL_ID -HACKTOBER_CHANNEL_ID = 498804484324196362 +json_location = os.path.join("bot", "resources", "halloween", "candy_collection.json") # chance is 1 in x range, so 1 in 20 range would give 5% chance (for add candy) ADD_CANDY_REACTION_CHANCE = 20 # 5% diff --git a/bot/constants.py b/bot/constants.py index e69de29b..7d00a360 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -0,0 +1 @@ +HACKTOBER_CHANNEL_ID = 498804484324196362 diff --git a/bot/cogs/resources/candy_collection.json b/bot/resources/halloween/candy_collection.json index 6313dd10..6313dd10 100644 --- a/bot/cogs/resources/candy_collection.json +++ b/bot/resources/halloween/candy_collection.json diff --git a/bot/utils/spookifications.py b/bot/utils/spookifications.py index 2211049f..5f2369ae 100644 --- a/bot/utils/spookifications.py +++ b/bot/utils/spookifications.py @@ -21,7 +21,7 @@ def pentagram(im): """Adds pentagram to image.""" im = im.convert('RGB') wt, ht = im.size - penta = Image.open('bot/resources/bloody-pentagram.png') + penta = Image.open('bot/resources/halloween/bloody-pentagram.png') penta = penta.resize((wt, ht)) im.paste(penta, (0, 0), penta) return im @@ -34,14 +34,16 @@ def bat(im): image and may be rotated upto 90 degrees anti-clockwise.""" im = im.convert('RGB') wt, ht = im.size - bat = Image.open('bot/resources/bat-clipart.png') - bat_size = randint(wt//5, wt) + bat = Image.open('bot/resources/halloween/bat-clipart.png') + bat_size = randint(wt//10, wt//7) rot = randint(0, 90) bat = bat.resize((bat_size, bat_size)) bat = bat.rotate(rot) - x = randint(0, wt-bat_size) - y = randint(0, wt-bat_size) + x = randint(wt-(bat_size * 3), wt-bat_size) + y = randint(10, bat_size) im.paste(bat, (x, y), bat) + im.paste(bat, (x + bat_size, y + (bat_size // 4)), bat) + im.paste(bat, (x - bat_size, y - (bat_size // 2)), bat) return im |