make marsify and owoify user-level

remotes/1693045480750635534/spooky-22
Aevann1 2022-08-27 05:22:57 +02:00
parent e507566bc2
commit df022bd003
5 changed files with 39 additions and 47 deletions

View File

@ -133,6 +133,8 @@ class User(Base):
pronouns = Column(String, default='they/them')
bite = Column(Integer)
earlylife = Column(Integer)
owoify = Column(Integer)
marsify = Column(Integer)
badges = relationship("Badge", order_by="Badge.created_utc", back_populates="user")
subscriptions = relationship("Subscription", back_populates="user")

View File

@ -82,6 +82,14 @@ def award_timers(v, bot=False):
v.earlylife = None
notify_if_not_bot("Your earlylife status has expired!")
dirty = True
if v.owoify and v.owoify < now:
v.owoify = None
notify_if_not_bot("Your owoify status has expired!")
dirty = True
if v.marsify and v.marsify < now:
v.marsify = None
notify_if_not_bot("Your marsify status has expired!")
dirty = True
if dirty:
g.db.add(v)

View File

@ -775,7 +775,7 @@ HOUSE_AWARDS = {
"Furry": {
"kind": "Furry",
"title": "OwOify",
"description": "OwOifies the comment. Does not work on posts.",
"description": "OwOifies the recipient's comments for 6 hours.",
"icon": "fas fa-paw-simple",
"color": "text-purple",
"price": 400
@ -783,7 +783,7 @@ HOUSE_AWARDS = {
"Femboy": {
"kind": "Femboy",
"title": "Marsify",
"description": "Emojifies the comment. Does not work on threads.",
"description": "Marsifies the recipient's comments for 6 hours.",
"icon": "fas fa-cat",
"color": "text-white",
"price": 400
@ -791,10 +791,10 @@ HOUSE_AWARDS = {
"Vampire": {
"kind": "Vampire",
"title": "Bite",
"description": "Turns the recipient into a vampire minion for 24 hours.",
"description": "Turns the recipient into a vampire for 24 hours.",
"icon": "fas fa-bat",
"color": "text-gray",
"price": 400
"price": 777
},
"Racist": {
"kind": "Racist",
@ -804,40 +804,14 @@ HOUSE_AWARDS = {
"color": "text-yellow",
"price": 400
},
"Furry Founder": {
"kind": "Furry Founder",
"title": "OwOify",
"description": "OwOifies the comment. Does not work on posts.",
"icon": "fas fa-paw-simple",
"color": "text-purple",
"price": 300
},
"Femboy Founder": {
"kind": "Femboy Founder",
"title": "Marsify",
"description": "Emojifies the comment. Does not work on threads.",
"icon": "fas fa-kiss-wink-heart",
"color": "text-white",
"price": 300
},
"Vampire Founder": {
"kind": "Vampire Founder",
"title": "Bite",
"description": "Turns the recipient into a vampire for 24 hours.",
"icon": "fas fa-bat",
"color": "text-gray",
"price": 500
},
"Racist Founder": {
"kind": "Racist Founder",
"title": "Early Life",
"description": "Checks the recipients Early Life section on Wikipedia. Notices.",
"icon": "fas fa-star-of-david",
"color": "text-yellow",
"price": 300
},
}
temp = deepcopy(HOUSE_AWARDS).items()
for k, val in temp:
HOUSE_AWARDS[f'{k} Founder'] = val
HOUSE_AWARDS[f'{k} Founder']['kind'] += ' Founder'
HOUSE_AWARDS[f'{k} Founder']['price'] = int(HOUSE_AWARDS[f'{k} Founder']['price'] * 0.75)
if SITE_NAME != 'rDrama':
AWARDS_DISABLED.append('progressivestack')

View File

@ -340,24 +340,26 @@ def award_thing(v, thing_type, id):
author.verified = "Verified"
badge_grant(user=author, badge_id=150)
elif "Vampire" in kind and kind == v.house:
if author.bite: author.bite += 21600
else: author.bite = int(time.time()) + 21600
if author.bite: author.bite += 86400
else: author.bite = int(time.time()) + 86400
author.old_house = author.house
author.house = 'Vampire'
elif "Racist" in kind and kind == v.house:
if author.earlylife: author.earlylife += 21600
else: author.earlylife = int(time.time()) + 21600
if author.earlylife: author.earlylife += 86400
else: author.earlylife = int(time.time()) + 86400
elif "Furry" in kind and kind == v.house and thing_type == 'comment':
if author.owoify: author.owoify += 21600
else: author.owoify = int(time.time()) + 21600
body = thing.body
body = owoify.owoify(body)
if thing.award_count('Femboy', v) or thing.award_count('Femboy Founder', v):
body = marsify(body)
if author.marsify: body = marsify(body)
thing.body_html = sanitize(body, limit_pings=5)
g.db.add(thing)
elif "Femboy" in kind and kind == v.house and thing_type == 'comment':
if author.marsify: author.marsify += 21600
else: author.marsify = int(time.time()) + 21600
body = thing.body
if thing.award_count('Furry', v) or thing.award_count('Furry Founder', v):
body = owoify.owoify(body)
if author.owoify: body = owoify.owoify(body)
body = marsify(body)
thing.body_html = sanitize(body, limit_pings=5)
g.db.add(thing)

View File

@ -291,7 +291,13 @@ def comment(v):
if v.agendaposter and not v.marseyawarded and parent_post.id not in ADMIGGERS and parent_post.sub != 'chudrama':
body = torture_ap(body, v.username)
body_html = sanitize(body, limit_pings=5)
body_for_sanitize = body
if v.owoify:
body_for_sanitize = owoify.owoify(body_for_sanitize)
if v.marsify:
body_for_sanitize = marsify(body_for_sanitize)
body_html = sanitize(body_for_sanitize, limit_pings=5)
if parent_post.id not in ADMIGGERS and '!slots' not in body.lower() and '!blackjack' not in body.lower() and '!wordle' not in body.lower() and AGENDAPOSTER_PHRASE not in body.lower() and parent_post.sub != 'chudrama':
@ -722,9 +728,9 @@ def edit_comment(cid, v):
body = body.strip()
body_for_sanitize = body
if c.award_count('Furry', v) or c.award_count('Furry Founder', v):
if v.owoify:
body_for_sanitize = owoify.owoify(body_for_sanitize)
if c.award_count('Femboy', v) or c.award_count('Femboy Founder', v):
if v.marsify:
body_for_sanitize = marsify(body_for_sanitize)
body_html = sanitize(body_for_sanitize, edit=True, limit_pings=5)