WTS/game/scripts/interface/door.rpy

187 lines
6.7 KiB
Plaintext
Raw Normal View History

2022-05-16 23:48:22 +00:00
####################################
############# Menu #################
####################################
default summon_show_busy = True
define summon_categories_sorted = ("Snape", "Tonks", "Hermione", "Cho", "Luna", "Astoria", "Susan") #"Ginny", "Daphne", "Padma", "Patil", "Myrtle", "Mafkin"
2022-05-16 23:48:22 +00:00
label summon:
$ gui.in_context("summon_menu")
jump main_room_menu
label summon_menu(xx=723, yy=90):
$ renpy.dynamic(
map_transcript_loc = {
"library": "Library",
"room_g": "Gryffindor Dormitory",
"room_s": "Slytherin Dormitory",
"room_r": "Ravenclaw Dormitory",
"room_h": "Hufflepuff Dormitory",
"great_hall": "Great Hall",
"courtyard": "Courtyard",
"forest": "Forest",
"greenhouse": "Greenhouse",
"defense": "D.A.D.A Classroom",
"training_grounds": "Training Grounds",
"Lake": "Lake",
"randomstudent": renpy.random.choice((
"Classroom",
"Bathroom",
"Hagrid's Hut",
"Weasley's Store",
"Mafkin's Store",
"Broom Cupboard",
"Attic")),
"randomsnape": renpy.random.choice((
"Classroom",
"Boathouse",
"Bathroom",
"Snape's Office",
"Hall",
"Slytherin Dormitory",
"Library",
"Attic",
"Forest",
"Lake",
"Dungeons",
"Quidditch Cave",
"Staircase",
"Behind your door",
"Room of Doom")),
"randomtonks": renpy.random.choice((
"Classroom",
"Bathroom",
"Hall",
"Gryffindor Dormitory",
"Slytherin Dormitory",
"Hufflepuff Dormitory",
"Ravenclaw Dormitory",
"Training Grounds",
"Tonks' Room",
"Quidditch Pitch",
"Infirmary",
"Sex Dungeon",
"Hospital Wing",
"Forest",
"Lake",
"Greenhouse",
"Mafkin's Store")),
},
# Door dictionary
summon_dict = {
"Snape": {"ico": "snape", "flag": states.sna.unlocked, "busy": states.sna.busy, "loc": "randomsnape"},
"Tonks": {"ico": "tonks", "flag": states.ton.unlocked, "busy": states.ton.busy, "loc": "randomtonks"},
"Hermione": {"ico": "hermione", "flag": states.her.unlocked, "busy": states.her.busy, "loc": states.her.map_location },
"Cho": {"ico": "cho", "flag": states.cho.unlocked, "busy": states.cho.busy, "loc": states.cho.map_location},
"Luna": {"ico": "luna", "flag": states.lun.unlocked, "busy": states.lun.busy, "loc": states.lun.map_location},
"Astoria": {"ico": "astoria", "flag": states.ast.unlocked, "busy": states.ast.busy, "loc": states.ast.map_location },
"Susan": {"ico": "susan", "flag": states.sus.unlocked, "busy": states.sus.busy, "loc": states.sus.map_location}
},
)
2022-05-16 23:48:22 +00:00
2023-11-17 02:13:17 +00:00
call screen summon(xx, yy)
2022-05-16 23:48:22 +00:00
2023-11-17 02:13:17 +00:00
return
2022-05-16 23:48:22 +00:00
2023-11-17 02:16:28 +00:00
label .summon(char):
$ enable_game_menu()
$ renpy.jump_out_of_context("summon_"+char.lower())
return
label .summon_busy(char):
if game.daytime or char in ["Tonks", "Snape"]:
nar "[char] is currently busy. Try again later."
2022-05-16 23:48:22 +00:00
else:
2023-11-17 02:16:28 +00:00
nar "[char] is currently asleep. Try again tomorrow."
2022-05-16 23:48:22 +00:00
2023-11-17 02:13:17 +00:00
return
2022-05-16 23:48:22 +00:00
screen summon(xx, yy):
tag summon
zorder 15
modal True
add "gui_fade"
if renpy.mobile:
use close_button_background
use close_button(key=["summon", "game_menu"])
fixed:
2023-11-17 02:08:51 +00:00
pos (xx, yy)
2022-05-16 23:48:22 +00:00
if settings.get("animations"):
at gui_animation
2023-11-17 02:08:51 +00:00
use summon_menu
2022-05-16 23:48:22 +00:00
2023-11-17 02:08:51 +00:00
screen summon_menu():
2022-05-16 23:48:22 +00:00
tag summon_menu
modal True
zorder 15
window:
style "empty"
xysize (207, 454)
use invisible_button()
add gui.format("interface/achievements/{}/panel_left.webp")
vbox:
pos (6, 384)
spacing 32
null
frame:
style "empty"
textbutton "Show Busy:":
style gui.theme("overlay_button")
xsize 195 ysize 32
text_align (0.4, 0.5)
text_size 12
action ToggleVariable("summon_show_busy", True, False)
add gui.theme("check_{}").format(str(summon_show_busy).lower()) xalign 0.7 ypos 4
vbox:
pos (6, 6)
2023-11-17 02:29:45 +00:00
$ allbusy = True
2022-05-16 23:48:22 +00:00
for char in summon_categories_sorted:
if summon_dict[char]["flag"]:
if summon_show_busy or not summon_dict[char]["busy"]:
2023-11-17 02:29:45 +00:00
$ allbusy = False
2022-05-16 23:48:22 +00:00
frame:
style "empty"
xsize 195
ysize 50
vbox:
textbutton char:
style "empty"
xsize 195 ysize 46
hover_background gui.format("interface/achievements/{}/highlight_left_b.webp")
text_xalign 0.6 text_yalign 0.5
text_xanchor 0.5
text_size 20
if not summon_dict[char]["busy"]:
2023-11-17 02:16:28 +00:00
action Call("summon_menu.summon", char, from_current=True)
2022-05-16 23:48:22 +00:00
else:
text_color "#8C8C70"
2023-11-17 02:16:28 +00:00
action Call("summon_menu.summon_busy", char, from_current=True)
2022-05-16 23:48:22 +00:00
add gui.format("interface/achievements/{}/spacer_left.webp")
button:
style gui.theme("overlay_button")
background gui.format("interface/achievements/{}/iconbox.webp")
foreground "interface/achievements/glass_iconbox.webp"
xysize (48, 48)
2023-11-17 02:29:45 +00:00
add crop_image_zoom("interface/icons/head/"+summon_dict[char]["ico"]+".webp", 42, 42, summon_dict[char]["busy"]) align (0.5, 0.5)
2022-05-16 23:48:22 +00:00
text map_transcript_loc[summon_dict[char]["loc"]] size 10 xalign 0.625 yalign 0.9 xanchor 0.5
if not states.sna.unlocked:
2022-05-16 23:48:22 +00:00
text "You don't know anyone" size 12 at truecenter
2023-11-17 02:29:45 +00:00
elif allbusy:
text "All characters are busy" size 12 at truecenter