diff --git a/files/assets/images/hats/Airpods.webp b/files/assets/images/hats/Airpods.webp index c3ba5654e..cecb8dec9 100644 Binary files a/files/assets/images/hats/Airpods.webp and b/files/assets/images/hats/Airpods.webp differ diff --git a/files/assets/images/hats/Astronaut Helmet.webp b/files/assets/images/hats/Astronaut Helmet.webp index 06ba89a09..9f6f5863d 100644 Binary files a/files/assets/images/hats/Astronaut Helmet.webp and b/files/assets/images/hats/Astronaut Helmet.webp differ diff --git a/files/assets/images/hats/Badass Fighter Ace.webp b/files/assets/images/hats/Badass Fighter Ace.webp index c9e303c22..d96e62ea1 100644 Binary files a/files/assets/images/hats/Badass Fighter Ace.webp and b/files/assets/images/hats/Badass Fighter Ace.webp differ diff --git a/files/assets/images/hats/Bowler.webp b/files/assets/images/hats/Bowler.webp new file mode 100644 index 000000000..c38a17b39 Binary files /dev/null and b/files/assets/images/hats/Bowler.webp differ diff --git a/files/assets/images/hats/Cartman.webp b/files/assets/images/hats/Cartman.webp index 26288f39f..efeef559a 100644 Binary files a/files/assets/images/hats/Cartman.webp and b/files/assets/images/hats/Cartman.webp differ diff --git a/files/assets/images/hats/Cheesehead.webp b/files/assets/images/hats/Cheesehead.webp index 1dcaefec0..7ae0d7b7b 100644 Binary files a/files/assets/images/hats/Cheesehead.webp and b/files/assets/images/hats/Cheesehead.webp differ diff --git a/files/assets/images/hats/Cock.webp b/files/assets/images/hats/Cock.webp index 362c402b5..2528020c6 100644 Binary files a/files/assets/images/hats/Cock.webp and b/files/assets/images/hats/Cock.webp differ diff --git a/files/assets/images/hats/Devil Horns.webp b/files/assets/images/hats/Devil Horns.webp index 8f24cb9ae..9077e222c 100644 Binary files a/files/assets/images/hats/Devil Horns.webp and b/files/assets/images/hats/Devil Horns.webp differ diff --git a/files/assets/images/hats/Family Man Free Hat.webp b/files/assets/images/hats/Family Man Free Hat.webp index 9f1754b38..e4d5ad626 100644 Binary files a/files/assets/images/hats/Family Man Free Hat.webp and b/files/assets/images/hats/Family Man Free Hat.webp differ diff --git a/files/assets/images/hats/Gigachin.webp b/files/assets/images/hats/Gigachin.webp index 3cef17087..b4004609d 100644 Binary files a/files/assets/images/hats/Gigachin.webp and b/files/assets/images/hats/Gigachin.webp differ diff --git a/files/assets/images/hats/Karen.webp b/files/assets/images/hats/Karen.webp index 0d79e3fe7..a54314fcc 100644 Binary files a/files/assets/images/hats/Karen.webp and b/files/assets/images/hats/Karen.webp differ diff --git a/files/assets/images/hats/Kenny I.webp b/files/assets/images/hats/Kenny I.webp new file mode 100644 index 000000000..0c3394394 Binary files /dev/null and b/files/assets/images/hats/Kenny I.webp differ diff --git a/files/assets/images/hats/Kenny II.webp b/files/assets/images/hats/Kenny II.webp index d9b219bd3..42bc4d602 100644 Binary files a/files/assets/images/hats/Kenny II.webp and b/files/assets/images/hats/Kenny II.webp differ diff --git a/files/assets/images/hats/Kenny.webp b/files/assets/images/hats/Kenny.webp index 8e6facf30..1b27c39d7 100644 Binary files a/files/assets/images/hats/Kenny.webp and b/files/assets/images/hats/Kenny.webp differ diff --git a/files/assets/images/hats/Kyle.webp b/files/assets/images/hats/Kyle.webp index 2ad1be375..4455fbde6 100644 Binary files a/files/assets/images/hats/Kyle.webp and b/files/assets/images/hats/Kyle.webp differ diff --git a/files/assets/images/hats/Maskmaxxer.webp b/files/assets/images/hats/Maskmaxxer.webp index 3064fa752..57630f246 100644 Binary files a/files/assets/images/hats/Maskmaxxer.webp and b/files/assets/images/hats/Maskmaxxer.webp differ diff --git a/files/assets/images/hats/Media Executive.webp b/files/assets/images/hats/Media Executive.webp index 936a82dd4..97cce1225 100644 Binary files a/files/assets/images/hats/Media Executive.webp and b/files/assets/images/hats/Media Executive.webp differ diff --git a/files/assets/images/hats/Modern Major General.webp b/files/assets/images/hats/Modern Major General.webp index d145f5330..0ee5cc637 100644 Binary files a/files/assets/images/hats/Modern Major General.webp and b/files/assets/images/hats/Modern Major General.webp differ diff --git a/files/assets/images/hats/Mouseketeer.webp b/files/assets/images/hats/Mouseketeer.webp index e1b6671c4..0749c7bf7 100644 Binary files a/files/assets/images/hats/Mouseketeer.webp and b/files/assets/images/hats/Mouseketeer.webp differ diff --git a/files/assets/images/hats/Nervous, Sweating.webp b/files/assets/images/hats/Nervous, Sweating.webp index 03f931305..d5bb46db9 100644 Binary files a/files/assets/images/hats/Nervous, Sweating.webp and b/files/assets/images/hats/Nervous, Sweating.webp differ diff --git a/files/assets/images/hats/Noose.webp b/files/assets/images/hats/Noose.webp index fc87cc2df..ab5d5b062 100644 Binary files a/files/assets/images/hats/Noose.webp and b/files/assets/images/hats/Noose.webp differ diff --git a/files/assets/images/hats/Nooticer.webp b/files/assets/images/hats/Nooticer.webp index ec3694dfb..97a06fc3b 100644 Binary files a/files/assets/images/hats/Nooticer.webp and b/files/assets/images/hats/Nooticer.webp differ diff --git a/files/assets/images/hats/Pimp Hat I.webp b/files/assets/images/hats/Pimp Hat I.webp index c2cb0cbd0..c08b0a8e0 100644 Binary files a/files/assets/images/hats/Pimp Hat I.webp and b/files/assets/images/hats/Pimp Hat I.webp differ diff --git a/files/assets/images/hats/Red Star Cap.webp b/files/assets/images/hats/Red Star Cap.webp index aac5da51c..82a924b91 100644 Binary files a/files/assets/images/hats/Red Star Cap.webp and b/files/assets/images/hats/Red Star Cap.webp differ diff --git a/files/assets/images/hats/Samurai Helmet.webp b/files/assets/images/hats/Samurai Helmet.webp new file mode 100644 index 000000000..c5d55355f Binary files /dev/null and b/files/assets/images/hats/Samurai Helmet.webp differ diff --git a/files/assets/images/hats/Stan.webp b/files/assets/images/hats/Stan.webp index ca18ac747..4f7295471 100644 Binary files a/files/assets/images/hats/Stan.webp and b/files/assets/images/hats/Stan.webp differ diff --git a/files/assets/images/hats/Surgeon.webp b/files/assets/images/hats/Surgeon.webp index 928e23b5c..5bcaa1f72 100644 Binary files a/files/assets/images/hats/Surgeon.webp and b/files/assets/images/hats/Surgeon.webp differ diff --git a/files/assets/images/hats/Taqiyah.webp b/files/assets/images/hats/Taqiyah.webp index 6599a4bfe..01aa95faf 100644 Binary files a/files/assets/images/hats/Taqiyah.webp and b/files/assets/images/hats/Taqiyah.webp differ diff --git a/files/assets/images/hats/The Cat.webp b/files/assets/images/hats/The Cat.webp index 571c7205e..26e921591 100644 Binary files a/files/assets/images/hats/The Cat.webp and b/files/assets/images/hats/The Cat.webp differ diff --git a/files/assets/images/hats/The Tupac.webp b/files/assets/images/hats/The Tupac.webp index dd05c7bb3..4f25da77a 100644 Binary files a/files/assets/images/hats/The Tupac.webp and b/files/assets/images/hats/The Tupac.webp differ diff --git a/files/assets/images/hats/Vexillaurius Helmet.webp b/files/assets/images/hats/Vexillaurius Helmet.webp index b5fc6c628..67f727337 100644 Binary files a/files/assets/images/hats/Vexillaurius Helmet.webp and b/files/assets/images/hats/Vexillaurius Helmet.webp differ diff --git a/files/routes/comments.py b/files/routes/comments.py index f7587cef8..b8f7b686b 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -297,6 +297,19 @@ def comment(v): price=hat["price"] ) g.db.add(hat) + + all_by_author = g.db.query(HatDef).filter_by(author_id=user.id).count() + + # off-by-one: newly added hat isn't counted + if all_by_author >= 250: + badge_grant(badge_id=166, user=user) + elif all_by_author >= 100: + badge_grant(badge_id=165, user=user) + elif all_by_author >= 50: + badge_grant(badge_id=164, user=user) + elif all_by_author >= 10: + badge_grant(badge_id=163, user=user) + except Exception as e: return {"error": str(e)}, 400 body += f"\n\n![]({image})" diff --git a/files/routes/hats.py b/files/routes/hats.py index b6b2f83cf..ac806fdbd 100644 --- a/files/routes/hats.py +++ b/files/routes/hats.py @@ -52,12 +52,12 @@ def buy_hat(v, hat_id): ) hat_count = g.db.query(Hat).filter_by(user_id=v.id).count() - if hat_count >= 24: - badge_grant(user=v.id, badge_id=152) - if hat_count >= 99: - badge_grant(user=ref_user, badge_id=153) if hat_count >= 249: badge_grant(user=ref_user, badge_id=154) + elif hat_count >= 99: + badge_grant(user=ref_user, badge_id=153) + elif hat_count >= 24: + badge_grant(user=v.id, badge_id=152) return {"message": "Hat bought!"} diff --git a/seed-db.sql b/seed-db.sql index d56864385..283ca0434 100644 --- a/seed-db.sql +++ b/seed-db.sql @@ -1600,11 +1600,11 @@ insert into hat_defs (name, description, author_id, price) values ('Waluigi', 'Coming soon to Smash for sure', 1, 500), ('Top Hat (kek)', 'Technically a top hat, shut up', 1, 500), ('Top Hat (white)', 'Oh, how dignified', 1, 500), -('Top Hat (striped)', 'Tim Burton''s take on the top hat', 1, 500), +('Top Hat (striped)', 'Tim Burton''s take on the top hat', 1, 500), ('Top Hat (checkered)', 'Actually chessed, but that''s not really a word.', 1, 500), ('Top Hat (march hare)', 'April hare, May hare, June hare, July hare,', 1, 500), ('Top Hat (mad hatter)', 'Hatters mad [x24]', 1, 500), -('Top Hat', 'Top hat, menstrual edition', 1, 500), +('Top Hat (red)', 'Top hat, menstrual edition', 1, 500), ('Top Hat (uncle sam)', 'THIS HAT WAS FACT-CHECKED BY TRUE AMERICAN PATRIOTS', 1, 500), ('Fireperson I', 'In loving memory of r/HateForFirefighters', 1, 500), ('Constable', 'Useless bong cop nonsense', 1, 500), diff --git a/sql/20220903-hats.sql b/sql/20220903-hats.sql index a443ad7a3..e871ea9f8 100644 --- a/sql/20220903-hats.sql +++ b/sql/20220903-hats.sql @@ -178,11 +178,11 @@ insert into hat_defs (name, description, author_id, price) values ('Waluigi', 'Coming soon to Smash for sure', 1, 500), ('Top Hat (kek)', 'Technically a top hat, shut up', 1, 500), ('Top Hat (white)', 'Oh, how dignified', 1, 500), -('Top Hat (striped)', 'Tim Burton''s take on the top hat', 1, 500), +('Top Hat (striped)', 'Tim Burton''s take on the top hat', 1, 500), ('Top Hat (checkered)', 'Actually chessed, but that''s not really a word.', 1, 500), ('Top Hat (march hare)', 'April hare, May hare, June hare, July hare,', 1, 500), ('Top Hat (mad hatter)', 'Hatters mad [x24]', 1, 500), -('Top Hat', 'Top hat, menstrual edition', 1, 500), +('Top Hat (red)', 'Top hat, menstrual edition', 1, 500), ('Top Hat (uncle sam)', 'THIS HAT WAS FACT-CHECKED BY TRUE AMERICAN PATRIOTS', 1, 500), ('Fireperson I', 'In loving memory of r/HateForFirefighters', 1, 500), ('Constable', 'Useless bong cop nonsense', 1, 500),