WTS/game/scripts/interface/map.rpy
LoafyLemon db86910a8e Seed Randomisation, Map, Refactoring, Bug Fixes
* Added seeded randomisation w/ cache
* Updated help menu hotkeys section
* Decoupled map from the desk (New map artwork to be added)
* Removed old desk menu
* Removed old desk images
* Removed/Fixed door_randomobj and map_randomobj causing pickling issues
2024-04-27 00:41:38 +01:00

430 lines
13 KiB
Plaintext

# NOTE: This entire file will be scrapped once the new map is added.
default map_animated = "once"
define map_scale = 0.35
define map_ani_time = 0.8
transform map_fadein:
alpha 0
pause (map_ani_time)
linear 1 alpha 1
image map_unfold:
"interface/map/anim/map_03.webp"
pause map_ani_time/3
"interface/map/anim/map_02.webp" with Dissolve(map_ani_time/3)
pause map_ani_time/3
"interface/map/anim/map_01.webp" with Dissolve(map_ani_time/3)
pause map_ani_time/3
"interface/map/map.webp" with Dissolve(1)
pause 1
"interface/map/map.webp"
label map:
call update_character_map_locations
call screen map
$ renpy.dynamic(__choice = _return)
if __choice == "Close":
jump main_room_menu
else:
call gen_chibi("stand", "desk", "base")
with d3
call gen_walk(action="leave", speed=1.5)
jump expression __choice
screen map():
tag map
zorder 4
use close_button_background(keysym="game_menu")
# Default avoids changing the screen if the animation is toggled quickly
default unfold = map_animated
# Disable animation after first time (can still be toggled)
if map_animated == "once":
timer map_ani_time+1 action SetVariable("map_animated", False)
fixed:
fit_first True
align (0.5, 0.5)
if unfold:
add "map_unfold" zoom map_scale # 588x420
else:
add "interface/map/map.webp" zoom map_scale # 588x420
fixed:
if unfold:
at map_fadein
use map_buttons
use map_screen_characters
screen map_buttons():
tag map
zorder 4
#Office
imagebutton:
xpos 112
ypos 234
idle "interface/map/room_office_idle.webp"
hover "interface/map/room_office_hover.webp"
action Return("main_room_menu")
#Gryffindor
imagebutton:
xpos 148
ypos 214
idle "interface/map/room_gryffindor_idle.webp"
#Ravenclaw
imagebutton:
xpos 286
ypos 256
idle "interface/map/room_ravenclaw_idle.webp"
#Hufflepuff
imagebutton:
xpos 76
ypos 295
idle "interface/map/room_hufflepuff_idle.webp"
#Slytherin
imagebutton:
xpos 214
ypos 136
idle "interface/map/room_slytherin_idle.webp"
#Weasley Store 15 x 15
if not item_store_intro_done:
add "interface/achievements/glow.webp" xycenter (246, 231) offset (15, 15) zoom 0.15 alpha 0.5 at rotate_circular
imagebutton:
xpos 246
ypos 231
idle "interface/map/room_weasley_store_idle.webp"
hover "interface/map/room_weasley_store_hover.webp"
action Return("item_store")
tooltip "Weasley's Store"
#Clothing Store
if not clothing_store_intro_done:
add "interface/achievements/glow.webp" xycenter (462, 231) offset (15, 15) zoom 0.15 alpha 0.5 at rotate_circular
imagebutton:
xpos 462
ypos 231
idle "interface/map/room_clothing_store_idle.webp"
hover "interface/map/room_clothing_store_hover.webp"
action Return("clothing_store")
tooltip "Mafkin's Emporium"
# Snape's Office
if not states.map.snape_office.visited:
add "interface/achievements/glow.webp" xycenter (314, 331) offset (15, 15) zoom 0.15 alpha 0.5 at rotate_circular
imagebutton:
xpos 314
ypos 331
idle "interface/map/room_potions_idle.webp"
hover "interface/map/room_potions_hover.webp"
action Return("snape_office")
tooltip "Snape's Office"
#Room of Requirement
if states.map.seventh_floor.unlocked:
if not states.map.room_of_requirement.intro_e1:
add "interface/achievements/glow.webp" xycenter (116, 160) offset (15, 15) zoom 0.15 alpha 0.5 at rotate_circular
imagebutton:
xpos 116
ypos 160
action Return("seventh_floor")
if not states.map.seventh_floor.visited:
idle "interface/map/room_ror_empty_idle.webp"
hover "interface/map/room_ror_empty_hover.webp"
else:
idle "interface/map/room_ror_idle.webp"
hover "interface/map/room_ror_hover.webp"
tooltip "Seventh Floor"
#Lake
imagebutton:
xpos 131
ypos 367
idle "interface/map/room_boat_house_idle.webp"
#Forest
imagebutton:
xpos 103
ypos 12
idle "interface/map/room_north_courtyard_idle.webp"
#Attic
if states.her.ev.sealed_scroll.examined:
if not states.her.ev.sealed_scroll.sample:
add "interface/achievements/glow.webp" xycenter (340, 226) offset (15, 15) zoom 0.15 alpha 0.5 at rotate_circular
imagebutton:
xpos 340
ypos 226
idle "interface/map/room_attic_closed_idle.webp"
hover "interface/map/room_attic_closed_hover.webp"
action Return("map_attic")
tooltip "???"
else:
imagebutton:
xpos 340
ypos 226
idle "interface/map/room_attic_open_idle.webp"
hover "interface/map/room_attic_open_hover.webp"
action Return("map_attic")
tooltip Attic
# Map animation toggle
textbutton "Animation":
style gui.theme("check_button")
pos (470, 380)
selected map_animated
tooltip "Toggles map folding animation"
action ToggleVariable("map_animated", True, False)
label set_all_map_locations:
call set_her_map_location()
call set_lun_map_location()
call set_cho_map_location()
call set_ast_map_location()
call set_sus_map_location()
call update_character_map_locations
return
label set_her_map_location(location=""):
if location != "":
if location == "library":
$ states.her.map_location = "library"
elif location in ["gryffindor_room","gryff_room","room_g"]:
$ states.her.map_location = "room_g"
elif location in ["slytherin_room","slyth_room","room_s"]:
$ states.her.map_location = "room_s"
elif location == "great_hall":
$ states.her.map_location = "great_hall"
elif location == "courtyard":
$ states.her.map_location = "courtyard"
else: #Random
if states.her.level < 11:
$ states.her.map_location = states.env.random.choice(("library", "library", "great_hall", "room_g", "room_g"))
else:
if states.her.status.blowjob == True and states.env.weather in ("clear", "cloudy") and not states.env.daytime and not states.her.busy:
$ states.her.map_location = "forest"
elif states.her.public_level < 12:
$ states.her.map_location = states.env.random.choice(("great_hall", "courtyard", "room_g", "room_g", "room_g"))
else:
$ states.her.map_location = states.env.random.choice(("room_s", "courtyard", "room_g", "room_g", "room_g"))
if location:
call update_character_map_locations
return
label set_lun_map_location(location = ""):
if location != "":
if location == "greenhouse":
$ states.lun.map_location = "greenhouse"
elif location == "forest":
$ states.lun.map_location = "forest"
elif location in ["ravenclaw_room","raven_room","room_r"]:
$ states.lun.map_location = "room_r"
else: #Random
$ states.lun.map_location = states.env.random.choice(("greenhouse", "forest", "forest", "room_r", "room_r"))
if location:
call update_character_map_locations
return
label set_ast_map_location(location = ""):
if location != "":
if location == "courtyard":
$ states.ast.map_location = "courtyard"
elif location in ["slytherin_room","slyth_room","room_s"]:
$ states.ast.map_location = "room_s"
elif location in ["defense_classroom"]:
$ states.ast.map_location = "defense"
else: #Random
$ states.ast.map_location = states.env.random.choice(("courtyard", "courtyard", "room_s", "room_s", "room_s"))
if location:
call update_character_map_locations
return
label set_sus_map_location(location = ""):
if location != "":
if location == "great_hall":
$ states.sus.map_location = "great_hall"
elif location in ["hufflepuff_room","huffl_room","room_h"]:
$ states.sus.map_location = "room_r"
else: #Random
$ states.sus.map_location = states.env.random.choice(("great_hall", "great_hall", "room_h", "room_h", "room_h"))
if location:
call update_character_map_locations
return
label set_cho_map_location(location = ""):
if location != "":
if location == "training_grounds":
$ states.cho.map_location = "training_grounds"
elif location in ["ravenclaw_room","raven_room","room_r"]:
$ states.cho.map_location = "room_r"
else: #Random
$ states.cho.map_location = states.env.random.choice(("training_grounds", "training_grounds", "room_r", "room_r", "room_r"))
if location:
call update_character_map_locations
return
label update_character_map_locations:
if states.her.map_location == "library":
$ her_map_xpos = 455
$ her_map_ypos = 94
elif states.her.map_location == "room_g":
$ her_map_xpos = 110
$ her_map_ypos = 212
elif states.her.map_location == "room_s":
$ her_map_xpos = 210
$ her_map_ypos = 184
elif states.her.map_location == "great_hall":
$ her_map_xpos = 70
$ her_map_ypos = 240
elif states.her.map_location == "courtyard":
$ her_map_xpos = 444
$ her_map_ypos = 216
elif states.her.map_location == "forest":
$ her_map_xpos = 60
$ her_map_ypos = 40
#Luna
if states.lun.map_location == "room_r":
$ lun_map_xpos = 306
$ lun_map_ypos = 242
elif states.lun.map_location == "forest":
$ lun_map_xpos = 200
$ lun_map_ypos = 50
elif states.lun.map_location == "greenhouse":
$ lun_map_xpos = 450
$ lun_map_ypos = 320
#Astoria
if states.ast.map_location == "room_s":
$ ast_map_xpos = 246
$ ast_map_ypos = 118
elif states.ast.map_location == "courtyard":
$ ast_map_xpos = 404
$ ast_map_ypos = 254
elif states.ast.map_location == "defense": #Event
$ ast_map_xpos = 300
$ ast_map_ypos = 190
#Susan
if states.sus.map_location == "room_h":
$ sus_map_xpos = 130
$ sus_map_ypos = 320
elif states.sus.map_location == "great_hall":
$ sus_map_xpos = 70
$ sus_map_ypos = 280
#Cho
if states.cho.map_location == "room_r":
$ cho_map_xpos = 264
$ cho_map_ypos = 276
elif states.cho.map_location == "training_grounds":
$ cho_map_xpos = 520
$ cho_map_ypos = 50
#Tonks
$ ton_map_xpos = 318
$ ton_map_ypos = 156
#Snape
if states.env.daytime:
$ sna_map_xpos = 365
$ sna_map_ypos = 270
else:
$ sna_map_xpos = 368
$ sna_map_ypos = 348
return
screen map_screen_characters():
tag map
zorder 5
#Hermione
if states.her.unlocked:
if states.her.map_location == "forest": # Mark forest event.
add "interface/achievements/glow.webp" xycenter (her_map_xpos, her_map_ypos) zoom 0.15 alpha 0.5 at rotate_circular
imagebutton:
xcenter her_map_xpos
ycenter her_map_ypos
idle "interface/map/name_hermione.webp"
hover "interface/map/name_hermione_hover.webp"
action (Return("hermione_map_BJ") if states.her.map_location else None)
#Luna
if states.lun.unlocked:
imagebutton:
xcenter lun_map_xpos
ycenter lun_map_ypos
idle "interface/map/name_luna.webp"
hover "interface/map/name_luna_hover.webp"
#Astoria
if states.ast.unlocked:
imagebutton:
xcenter ast_map_xpos
ycenter ast_map_ypos
idle "interface/map/name_astoria.webp"
hover "interface/map/name_astoria_hover.webp"
#Susan
if states.sus.unlocked:
imagebutton:
xcenter sus_map_xpos
ycenter sus_map_ypos
idle "interface/map/name_susan.webp"
hover "interface/map/name_susan_hover.webp"
#Cho
if states.cho.unlocked:
imagebutton:
xcenter cho_map_xpos
ycenter cho_map_ypos
idle "interface/map/name_cho.webp"
hover "interface/map/name_cho_hover.webp"
#Snape
if states.sna.unlocked:
imagebutton:
xcenter sna_map_xpos
ycenter sna_map_ypos
idle "interface/map/name_snape.webp"
hover "interface/map/name_snape_hover.webp"
#Tonks
if states.ton.unlocked:
imagebutton:
xcenter ton_map_xpos
ycenter ton_map_ypos
idle "interface/map/name_tonks.webp"
hover "interface/map/name_tonks_hover.webp"