forked from rDrama/rDrama
add grinch
parent
69dee20918
commit
373a6cf0db
|
@ -1135,3 +1135,11 @@ class User(Base):
|
||||||
@lazy
|
@lazy
|
||||||
def shadowbanner(self):
|
def shadowbanner(self):
|
||||||
return g.db.query(User.username).filter_by(id=self.shadowbanned).one()[0]
|
return g.db.query(User.username).filter_by(id=self.shadowbanned).one()[0]
|
||||||
|
|
||||||
|
if HOLIDAY_EVENT:
|
||||||
|
@property
|
||||||
|
@lazy
|
||||||
|
def event_music(self):
|
||||||
|
if SITE_NAME != 'rDrama': return False
|
||||||
|
if self.has_badge(91): return False
|
||||||
|
return True
|
||||||
|
|
|
@ -11,7 +11,6 @@ class EventUser(Base):
|
||||||
__tablename__ = "event_users"
|
__tablename__ = "event_users"
|
||||||
id = Column(Integer, ForeignKey("users.id"), primary_key=True)
|
id = Column(Integer, ForeignKey("users.id"), primary_key=True)
|
||||||
user = relationship("User", primaryjoin="EventUser.id == User.id")
|
user = relationship("User", primaryjoin="EventUser.id == User.id")
|
||||||
event_music = Column(Boolean, default=True, nullable=False)
|
|
||||||
|
|
||||||
# start event specific columns
|
# start event specific columns
|
||||||
event_darkmode = Column(Boolean, default=default_darkmode, nullable=False)
|
event_darkmode = Column(Boolean, default=default_darkmode, nullable=False)
|
||||||
|
|
|
@ -69,6 +69,16 @@ EVENT_AWARDS = {
|
||||||
"deflectable": False,
|
"deflectable": False,
|
||||||
"cosmetic": True
|
"cosmetic": True
|
||||||
},
|
},
|
||||||
|
"grinch": {
|
||||||
|
"kind": "grinch",
|
||||||
|
"title": "Grinch",
|
||||||
|
"description": "",
|
||||||
|
"icon": "fas fa-angry",
|
||||||
|
"color": "text-green-500",
|
||||||
|
"price": 1000,
|
||||||
|
"deflectable": True,
|
||||||
|
"cosmetic": False
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -85,16 +85,6 @@ AWARDS = {
|
||||||
"deflectable": False,
|
"deflectable": False,
|
||||||
"cosmetic": True
|
"cosmetic": True
|
||||||
},
|
},
|
||||||
"grinch": {
|
|
||||||
"kind": "grinch",
|
|
||||||
"title": "Grinch",
|
|
||||||
"description": "",
|
|
||||||
"icon": "fas fa-angry",
|
|
||||||
"color": "text-green-500",
|
|
||||||
"price": 1000,
|
|
||||||
"deflectable": True,
|
|
||||||
"cosmetic": False
|
|
||||||
},
|
|
||||||
### Homoween 2021 & 2022
|
### Homoween 2021 & 2022
|
||||||
"haunt": {
|
"haunt": {
|
||||||
"kind": "haunt",
|
"kind": "haunt",
|
||||||
|
|
|
@ -407,6 +407,9 @@ def award_thing(v, thing_type, id):
|
||||||
from files.events import EVENT_AWARDS, award_thing_event
|
from files.events import EVENT_AWARDS, award_thing_event
|
||||||
if kind in EVENT_AWARDS:
|
if kind in EVENT_AWARDS:
|
||||||
award_thing_event(v, kind, author)
|
award_thing_event(v, kind, author)
|
||||||
|
if kind == "grinch":
|
||||||
|
badge_grant(badge_id=91, user=author)
|
||||||
|
|
||||||
|
|
||||||
if author.received_award_count: author.received_award_count += 1
|
if author.received_award_count: author.received_award_count += 1
|
||||||
else: author.received_award_count = 1
|
else: author.received_award_count = 1
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% if not (v and v.poor) and (not g.event_v or g.event_v.event_music) and not (sub and sub.name == 'music') %}
|
{% if not (v and v.poor) and (not v or v.event_music) and not (sub and sub.name == 'music') %}
|
||||||
{% if not song %}
|
{% if not song %}
|
||||||
{% set path = "assets/event/media/music" %}
|
{% set path = "assets/event/media/music" %}
|
||||||
{% set song = "/" ~ path ~ "/" ~ listdir('files/' ~ path)|random() ~ '?v=45' %}
|
{% set song = "/" ~ path ~ "/" ~ listdir('files/' ~ path)|random() ~ '?v=45' %}
|
||||||
|
|
Loading…
Reference in New Issue