WTS/game/scripts/interface/letter.rpy

245 lines
9.8 KiB
Plaintext
Raw Permalink Normal View History

2022-05-16 23:48:22 +00:00
### Init ###
# Hermione Granger Letters
default letter_hg_1 = Letter(
2024-05-01 18:08:10 +00:00
text = _("{size=-7}From: Hermione Granger\nTo: Professor Dumbledore\n\n{/size}{size=-4}I am sure that you remember the reason why I'm writing you this letter from my last one, sir.\n\nI beg of you, please hear my plea this time. This injustice simply cannot go on...\nNot in this day and age, not in our school.\n\nPlease take action.{/size}\n\n{size=-7}With deepest respect,\nHermione Granger{/size}")
2022-05-16 23:48:22 +00:00
)
default letter_hg_2 = Letter(
2024-05-01 18:08:10 +00:00
text = _("{size=-7}From: Hermione Granger\nTo: Professor Dumbledore\n\n{/size}{size=-4}I am sorry to disturb you again, professor. I just want to make sure that you take this problem seriously.\n\nLast night another classmate confided in me... I gave my word to keep it a secret, so I cannot go into any details.\n\nAll I can say is that one of the Professors was involved.\n\nPlease take action soon.{/size}\n\n{size=-7}With deepest respect,\nHermione Granger.{/size}"),
2022-05-16 23:48:22 +00:00
label = "letter_hg_2",
wait = 3,
)
label letter_hg_2:
gen "This again?" ("base", xpos="far_left", ypos="head")
gen "..........." ("base", xpos="far_left", ypos="head")
return
# Ministry of Magic Letters
default letter_work_unlock = Letter(
2024-05-01 18:08:10 +00:00
text = _("{size=-7}From: Ministry of Magic\nTo: Professor Albus Dumbledore\n\n{/size}{size=-4}Dear professor Dumbledore,\nWe remind you that only upon providing us with a completed report will we be able to make a payment in your name.{/size}\n\n{size=-7}With deepest respect,\nThe Ministry of Magic.{/size}"),
2022-05-16 23:48:22 +00:00
label = "letter_work_unlock",
wait = 4,
)
label letter_work_unlock:
$ states.paperwork_unlocked = True
2022-05-16 23:48:22 +00:00
gen "Payments? *Hmm*..." ("base", xpos="far_left", ypos="head")
2024-05-01 18:08:10 +00:00
call give_reward(_("From now on you can do paperwork at your desk in order to earn additional gold..."),"interface/icons/gold.webp")
2022-05-16 23:48:22 +00:00
call tutorial("workngold")
return
default letter_work_report = Letter(
2024-05-01 18:08:10 +00:00
text = _("{size=-7}From:Ministry of Magic\nTo: Professor Dumbledore\n\n{/size}{size=-4}Thank you for completing a report this week.\n\nYou will find your payment of\n\n{/size}{b}-[reports_gold] gold-{/b}{size=-4}\n\nin the attached purse.{/size}\n\n{size=-7}With deepest respect,\nThe Ministry of Magic.{/size}"),
2022-05-16 23:48:22 +00:00
label = "letter_work_report",
func = calc_reports_gold
)
init python:
def calc_reports_gold():
global reports_gold
2022-05-16 23:48:22 +00:00
progress_factor = math.log(game.day)
progress_flat = (states.her.tier + states.cho.tier + states.ton.tier + states.lun.tier) * 16
2022-05-16 23:48:22 +00:00
# Note: random_gold global var is set at the start of the day and evening
reports_gold = states.paperwork_reports * (int(progress_factor * max(random_gold, progress_flat)) + progress_flat)
2022-05-16 23:48:22 +00:00
if game.difficulty <= 1: # Easy
reports_gold = int(reports_gold * 1.2)
elif game.difficulty == 2: # Normal
pass
else: # Hardcore
reports_gold = int(reports_gold * 0.9)
label letter_work_report:
python:
game.gold += reports_gold
# Reset
states.paperwork_reports = 0
2022-05-16 23:48:22 +00:00
reports_gold = 0
return
default letter_favors = Letter(
2024-05-01 18:08:10 +00:00
text = _("{size=-7}From:Ministry of Magic\nTo: Professor Dumbledore\n\n{/size}{size=-4}Dear professor Dumbledore,\nit has come to the ministry's attention from an anonymous letter, that there has been illicit activities going on between staff members and students within your halls.\n\nAn Auror has been dispatched and will arrive shortly to begin the investigation.{/size}\n\n{size=-7}Yours sincerely,\nAmelia Bones, Department of Magical Law Enforcement.{/size}"),
2022-05-16 23:48:22 +00:00
label = "letter_favors",
wait = 8,
)
label letter_favors:
gen "Amelia...{w=1.0} Bones?" ("base", xpos="far_left", ypos="head")
gen "*He-he-he-he-he*..." ("grin", xpos="far_left", ypos="head")
gen "Wait a second..." ("base", xpos="far_left", ypos="head")
gen "Does that mean I'm in trouble?" ("base", xpos="far_left", ypos="head")
return
# Card Game Letters
default letter_cards_unlock = Letter(
2024-05-01 18:08:10 +00:00
text = _("{size=-3}Sir Albus Dumbledore{/size}\n\n{size=-7}We would like to present to you a great opportunity to become a Wizard Cards champion. Included in this letter is a starter pack to our card game in the hopes that you will consider any of our resellers to stock our cards for your students to purchase and play.\n\nHere's a little bit of information about our cards:\nEvery Wizard card has an enchantment that will personalise its look just for you and show something of your own favourite interest.\n\nDo you like Quidditch? Every card will look like a famous Quidditch player or a sport related print.\nInterested in magical creatures? The cards will have magical creatures on them.\nFind out your unique illustrations today with this starter pack, we don't even know what it is!{/size}\n\n{space=110}{size=-5}Wizard cards inc{/size}"),
2022-05-16 23:48:22 +00:00
label = "letter_cards_unlock",
wait = 24
)
label letter_cards_unlock:
$ states.cardgame.unlocked = True
2022-05-16 23:48:22 +00:00
gen "(That last bit sounds like a scam...)" ("base", xpos="far_left", ypos="head")
gen "(...)" ("base", xpos="far_left", ypos="head")
gen "(I suppose I could take a look at the starter pack at least...)" ("base", xpos="far_left", ypos="head")
2022-05-16 23:48:22 +00:00
show screen blktone
show screen start_deck
with d3
pause
hide screen start_deck
hide screen blktone
with d3
# A stupid hack to fix the initial card unlocks.
# TODO: Refactor.
python:
for i in playerdeck:
i.copies = -1
gen "(Hell yes I'm playing this...)" ("grin", xpos="far_left", ypos="head")
2024-05-01 18:08:10 +00:00
call give_reward(_("You've unlocked Wizard cards.\n\nUse the deck builder available on your desk to learn the rules and edit your deck."),"interface/icons/cards.webp")
2022-05-16 23:48:22 +00:00
return
default letter_cards_store = Letter(
2024-05-01 18:08:10 +00:00
text = _("{size=-7}Weasley's Wizard Wheezes shop emporium is now officially partnering with Wizard cards.\nVisit our shop for the best deals on card packs in all of Hogwarts!{/size}"),
label = "letter_cards_store",
wait = 7
2022-05-16 23:48:22 +00:00
)
label letter_cards_store:
2023-04-03 00:30:15 +00:00
$ states.twi.ev.cardgame.stocked = True
2022-05-16 23:48:22 +00:00
$ poker_outfit_ITEM.unlocked = True
$ lootbox_ITEM.unlocked = True
gen "Great, let's see how they're doing." ("base", xpos="far_left", ypos="head")
2024-05-01 18:08:10 +00:00
call give_reward(_("New items have been unlocked in the store."), "interface/icons/gold.webp")
2022-05-16 23:48:22 +00:00
return
default letter_cards_tier2 = Letter(
2024-05-01 18:08:10 +00:00
text = _("{size=-3}Congratulations!{/size}\n\n{size=-7}You've beaten your first 3 challenges of Wizard Cards.\nWe're currently working on expanding our business and are recruiting even more challengers so that in the future you'll be able to challenge even more people.\nIn the meanwhile, you'll be able to earn even more tokens by making wagers with the ones you've already beaten to complete your collection of items.\nFor wagers both participant needs to be fine with the prize/forfeit before the wager is made, good luck!\n\nYours truly,\nWeasley's Wizard Wheeze's and Team Silver{/size}"),
2022-05-16 23:48:22 +00:00
label = "letter_cards_tier2"
)
label letter_cards_tier2:
gen "Sweet..." ("grin", xpos="far_left", ypos="head")
gen "Fucking love prizes." ("grin", xpos="far_left", ypos="head")
$ advance_tier(2)
return
# Tonks
default letter_nt_1 = Letter(
2024-05-01 18:08:10 +00:00
text = _("{size=-7}From: Tonks\nTo: My beloved headmaster\n\n{/size}{size=-4}As promised, here is a very lewd picture of me.{heart}\n\nI had so much fun making this for you.\nPlease jerk off to it as much as you like! {heart} {heart} {heart}{/size}\n\n{size=-7}With love,\nTonks. {heart}{/size}"),
2022-05-16 23:48:22 +00:00
label = "letter_nt_1"
)
label letter_nt_1:
gen "Well now I'm curious..." ("base", xpos="far_left", ypos="head")
play sound "sounds/paper_rustle.ogg"
nar "You slowly roll out the piece of parchment - getting a good look of it."
2022-05-16 23:48:22 +00:00
pause.2
call kiss_her
pause.5
gen "Nice!" ("grin", xpos="far_left", ypos="head")
2024-05-01 18:08:10 +00:00
call give_reward(text=_("A new room decoration have been unlocked!", gift="interface/icons/tonks_poster.webp"), sound=True)
2022-05-16 23:48:22 +00:00
$ tonks_poster_ITEM.owned = 1
gen "I'll definitely hang this one up!" ("grin", xpos="far_left", ypos="head")
return
### Main ###
init python:
class Letter(object):
"""
text - Contents of the letter.
label - Call label called after the letter was read.
func - A setup function called before the letter is being shown to the player.
Queue is universal for all instanced objects.
"""
def __init__(self, text="Add Text", wait=0, label=None, func=None):
self.mailed = False
self.read = False
self.text = text
self.wait = wait
self.label = label
self.func = func
@property
def queue(self):
return mailbox.letters
2022-05-16 23:48:22 +00:00
def send(self):
self.mailed = True
if not self in self.queue:
self.queue.append(self)
def open(self, silent=False):
self.mailed = True
self.read = True
if self in self.queue:
self.queue.remove(self)
if self.func:
self.func()
if not silent:
renpy.call("letter", self.text, self.label)
label letter(text, lbl):
2022-05-16 23:48:22 +00:00
show screen bld1
show screen blktone
show screen letter(text)
with d3
menu (menu_yalign=.9):
2022-05-16 23:48:22 +00:00
"-Done reading-":
pass
hide screen letter
hide screen blktone
hide screen bld1
with d3
if lbl:
call expression lbl
2022-05-16 23:48:22 +00:00
return
screen letter(text):
zorder 26
tag letter
add "interface/letter.webp" align (0.5, 0.2) zoom 0.5
hbox:
spacing 40
pos (410, 80)
xmaximum 250
text text
label letter_open_all:
while mailbox.get_letters():
$ mailbox.get_letters()[0].open()
$ owl_OBJ.hidden = True
jump main_room_menu