From c11891bf117c0f455db3347168d292c045dc3c8e Mon Sep 17 00:00:00 2001 From: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com> Date: Wed, 15 Nov 2023 01:07:16 +0100 Subject: [PATCH] Factorize jumps in the elif --- game/scripts/rooms/main_room/objects/desk.rpy | 25 ++++++------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/game/scripts/rooms/main_room/objects/desk.rpy b/game/scripts/rooms/main_room/objects/desk.rpy index 5627dd5e..5b45cbce 100644 --- a/game/scripts/rooms/main_room/objects/desk.rpy +++ b/game/scripts/rooms/main_room/objects/desk.rpy @@ -51,10 +51,9 @@ label desk: if states.her.busy: if game.daytime: nar "Hermione is taking classes." - jump main_room_menu else: nar "Hermione is already asleep." - jump main_room_menu + jump main_room_menu else: if states.her.map_location == "forest": nar "Hermione is currently at the Forbidden Forest.\n>Would you like to go there?" @@ -71,10 +70,9 @@ label desk: if states.lun.busy: if game.daytime: nar "Luna is taking classes." - jump main_room_menu else: nar "Luna is already asleep." - jump main_room_menu + jump main_room_menu else: jump summon_luna @@ -83,10 +81,9 @@ label desk: if states.ast.busy: if game.daytime: nar "Astoria is taking classes." - jump main_room_menu else: nar "Astoria is already asleep." - jump main_room_menu + jump main_room_menu else: #Summoning after intro events done. jump summon_astoria @@ -95,10 +92,9 @@ label desk: if states.sus.busy: if game.daytime: nar "Susan is taking classes." - jump main_room_menu else: nar "Susan is already asleep." - jump main_room_menu + jump main_room_menu else: jump summon_susan @@ -107,10 +103,9 @@ label desk: if states.cho.busy: if game.daytime: nar "Cho is taking classes." - jump main_room_menu else: nar "Cho is already asleep." - jump main_room_menu + jump main_room_menu else: jump summon_cho @@ -118,10 +113,7 @@ label desk: elif __choice == "snape": if states.sna.busy: nar "Professor Snape is unavailable." - if game.daytime: - jump main_room_menu - else: - jump main_room_menu + jump main_room_menu else: jump summon_snape @@ -129,10 +121,7 @@ label desk: elif __choice == "tonks": if states.ton.busy: nar "Tonks is unavailable." - if game.daytime: - jump main_room_menu - else: - jump main_room_menu + jump main_room_menu else: jump summon_tonks