diff --git a/files/assets/css/main.css b/files/assets/css/main.css index 2558b0464..6be4b3756 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -6266,4 +6266,8 @@ div.markdown { ::-webkit-input-placeholder { opacity: 0.7 !important; +} + +.text-brown { + color: #433722; } \ No newline at end of file diff --git a/files/assets/js/spider.js b/files/assets/js/spider.js new file mode 100644 index 000000000..2fc576b9f --- /dev/null +++ b/files/assets/js/spider.js @@ -0,0 +1,7 @@ +new SpiderController({ + imageSprite: "/i/spider-sprite.webp", + canDie: false, + minBugs: 1, + maxBugs: 1, + mouseOver: "fly" +}) \ No newline at end of file diff --git a/files/classes/user.py b/files/classes/user.py index 4357f8c2d..017725a9c 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -142,6 +142,7 @@ class User(Base): owoify = Column(Integer) marsify = Column(Integer, default=0) rainbow = Column(Integer) + spider = Column(Integer) badges = relationship("Badge", order_by="Badge.created_utc", back_populates="user") subscriptions = relationship("Subscription", back_populates="user") diff --git a/files/helpers/const.py b/files/helpers/const.py index e5a991b5b..f088b01ad 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -585,6 +585,14 @@ AWARDS = { "color": "text-blue", "price": 1500 }, + "spider": { + "kind": "Spider!", + "title": "Spider!", + "description": f"Summons a spider to terrorize the recipient for 24 hours.", + "icon": "fas fa-spider", + "color": "text-brown", + "price": 2000 + }, "agendaposter": { "kind": "agendaposter", "title": "Chud", diff --git a/files/routes/awards.py b/files/routes/awards.py index 9af1a3666..6db3f1cf5 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -405,6 +405,12 @@ def award_thing(v, thing_type, id): if author.rainbow: author.rainbow += 86400 else: author.rainbow = int(time.time()) + 86400 badge_grant(user=author, badge_id=171) + elif kind == "spider": + if author.id == CARP_ID: + return {"error": "Carp is immune to the spider award!"}, 403 + if author.spider: author.spider += 86400 + else: author.spider = int(time.time()) + 86400 + badge_grant(user=author, badge_id=179) if author.received_award_count: author.received_award_count += 1 else: author.received_award_count = 1 diff --git a/files/templates/default.html b/files/templates/default.html index e31bb48fc..6cd77df38 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -385,6 +385,10 @@ +{% if v and v.spider %} + + +{% endif %} diff --git a/files/templates/util/assetcache.html b/files/templates/util/assetcache.html index 4e930f0b4..1c117e3ce 100644 --- a/files/templates/util/assetcache.html +++ b/files/templates/util/assetcache.html @@ -1,6 +1,6 @@ {%- set CACHE_VER = { - 'css/main.css': 4032, + 'css/main.css': 4033, 'css/catalog.css': 4007, 'css/4chan.css': 4007, 'css/classic.css': 4030, diff --git a/sql/20220916-remove-winnings-column.sql b/sql/20220916-remove-winnings-column.sql index cf698ff5f..1b9e75110 100644 --- a/sql/20220916-remove-winnings-column.sql +++ b/sql/20220916-remove-winnings-column.sql @@ -1 +1 @@ -alter table users drop column winnings; \ No newline at end of file +alter table users drop column winnings; diff --git a/sql/20220920-spider-award.sql b/sql/20220920-spider-award.sql new file mode 100644 index 000000000..b4fd56bbc --- /dev/null +++ b/sql/20220920-spider-award.sql @@ -0,0 +1 @@ +alter table users add column spider int;