if (!init) { init = 1; with (obj_shortcut_door) reflect_jump_y = -6; if (global.flag[1455] >= 100) { with (obj_doorAny) { if (doorRoom == room_dw_fcastle_right_wing_floweryscene) { doorRoom = room_dw_fcastle_fusumadodge; doorEntrance = 2; } } } doormarker = scr_marker_fromasset(findsprite(spr_fcastle_left_twodoors_orangedoor)); doormarker.depth = 1200400; doormarker.reflect_jump_y = -4; with (obj_castlereflect_manager) { add_reflection(other.doormarker); add_reflection(other.npc_sign_left.marker); add_reflection(other.npc_sign_right.marker); add_reflection(1203); } with (obj_plat_asset) { if (flat) visible = false; } with (obj_plat_hanging_key) { on_hit = function() { obj_dw_fcastle_right_puzzle.keycon = 1; obj_dw_fcastle_right_puzzle.key_x = x; obj_dw_fcastle_right_puzzle.key_y = y; }; } with (obj_plat_stringed_object) { if (extflag == "signery") { on_hit = function() { snd_play_flowery(678); obj_dw_fcastle_right_puzzle.signcon = 1; obj_dw_fcastle_right_puzzle.sign_x = x; obj_dw_fcastle_right_puzzle.sign_y = y; broken = true; with (attached_object) instance_destroy(); }; } } with (obj_solidblocksized_alt) { other.doorinteract = instance_create(x, y, obj_interactable); with (other.doorinteract) { extflag = "door"; sprite_index = other.sprite_index; image_xscale = other.image_xscale; image_yscale = other.image_yscale; visible = 0; on_interact = function() { global.interact = 1; with (obj_dw_fcastle_right_puzzle) doorcon = 1; }; } } with (obj_plat_antisoftlock_zone) { conversation = 1; on_softlock_detected = function() { with (obj_dw_fcastle_right_puzzle) { if (stuckcon == 0) { stuckcon = 1; stucktimer = 0; } } }; on_exit_softlock_zone = function() { with (obj_dw_fcastle_right_puzzle) { if (stuckcon == 2) { stuckcon = 3; stucktimer = 0; } } }; } if (scr_flag_get_ext(_ROOM_FLAG, _BIT_DOOR, 1)) { keycon = 3; with (obj_plat_hanging_key) broken = true; scatter_papers(); with (doormarker) sprite_index = spr_fcastle_left_twodoors_orangedoor_open; with (obj_solidblocksized_alt) instance_destroy(); with (doorinteract) instance_destroy(); } var signery_state = 0; if (scr_flag_get_ext(_ROOM_FLAG, _BIT_SIGNERY_LEFT, 1)) signery_state = -1; else if (scr_flag_get_ext(_ROOM_FLAG, _BIT_SIGNERY_RIGHT, 1)) signery_state = 1; if (global.flag[1862] > 0 && global.flag[1862] != 3) { with (obj_plat_stringed_object) { if (extflag == "signery") { broken = true; with (attached_object) instance_destroy(); } with (other.npc_sign_right) x = -10000; } } else if (signery_state != 0) { with (obj_plat_stringed_object) { if (extflag == "signery") { broken = true; with (attached_object) instance_destroy(); } } with (npc_sign_right) x = (x - 140) + (140 * signery_state); } } if (stuckcon == 1) { if (!global.pause_plat) { stucktimer++; if (stucktimer == 60) { stuckcon = 2; stucktimer = 0; with (obj_plat_block) { if (extflag == "shadowplatform") mask_index = spr_plat_blankmask; } with (obj_shadowplatformController) scr_lerpvar("plat_alpha", 1, 0.3, 5); } } } else if (stuckcon == 2) { if (!i_ex(obj_plat_player)) { stuckcon = 0; with (obj_shadowplatformController) scr_lerpvar("plat_alpha", 0.3, 1, 5); } } else if (stuckcon == 3) { if (i_ex(obj_plat_player)) { stuckcon = 0; with (obj_plat_block) { if (extflag == "shadowplatform") mask_index = -4; } with (obj_shadowplatformController) scr_lerpvar("plat_alpha", 0.3, 1, 5); } } if (doorcon == 1) { doorcon = 2; scr_speaker("no_name"); msgsetloc(0, "* (It's an orange locked orange door^1, orange locked by an orange key.)/%", "obj_dw_fcastle_right_puzzle_slash_Step_0_gml_187_0"); d_make(0); } else if (doorcon == 2 && !instance_exists(obj_dialoguer)) { global.interact = 0; doorcon = 0; } if (keycon == 1) { keycon = 2; scr_flag_set_ext(_ROOM_FLAG, _BIT_DOOR, 1); keymarker = instance_create(key_x, key_y, obj_marker); with (keymarker) { scr_lerpvar("x", xstart, xstart + (60 * sign(obj_plat_player.image_xscale)), 15, 1, "out"); scr_lerpvar("y", ystart, ystart + 200, 15, 1, "in"); scr_script_delayed(scr_lerpvar, 15, "x", xstart + (60 * sign(obj_plat_player.image_xscale)), xstart - 160, 15, 1, "in"); scr_script_delayed(scr_lerpvar, 15, "y", ystart + 200, ystart + 400, 15, 1, "out"); sprite_index = spr_fcastle_orange_key; image_speed = 0; scr_plat_make_pauseable(self); scr_darksize(); } } if (keycon == 2) { if (!global.pause_plat) { keycontimer++; with (keymarker) scr_afterimage_monochrome(4235519, true).image_alpha = 0.3; keymarker.image_angle = keycontimer * 15; if (keycontimer == 30) { with (doormarker) sprite_index = spr_fcastle_left_twodoors_orangedoor_open; snd_play(snd_locker); with (obj_plat_camera) { shakex = 6; shakey = 6; } with (keymarker) instance_destroy(); with (obj_solidblocksized_alt) instance_destroy(); with (doorinteract) instance_destroy(); keycon = 3; } } } if (signcon == 1) { signcon = 2; if (obj_plat_player.image_xscale > 0) scr_flag_set_ext(_ROOM_FLAG, _BIT_SIGNERY_RIGHT, 1); else scr_flag_set_ext(_ROOM_FLAG, _BIT_SIGNERY_LEFT, 1); signmarker = instance_create(sign_x, sign_y, obj_marker); with (signmarker) { hspeed = 2.5 * obj_plat_player.image_xscale; vspeed = max(-5, obj_plat_player.vspeed); gravity = 1.8; friction = 0.1; sprite_index = spr_fcastle_signery_hanging; image_speed = 0; scr_darksize(); scr_plat_make_pauseable(); } } if (signcon == 2) { if (!global.pause_plat) { signcontimer++; with (signmarker) scr_afterimage().image_alpha = 0.3; signmarker.image_angle += signmarker.hspeed; if (signmarker.y >= npc_sign_right.y) { with (npc_sign_right) x -= (1140 - (140 * sign(other.signmarker.hspeed))); snd_play(snd_bump, 1, 1.3); with (signmarker) instance_destroy(); signcon = 3; } } } if (concon == 1 && !d_ex()) { global.interact = 0; concon = 4; } if (concon == 2 && global.choice >= 0) { k_d(); concon = 3; } if (concon == 3 && !instance_exists(obj_cutscene_master)) { concon = 4; scr_delay_var("concon", 0, 1); global.interact = 0; } with (doormarker) image_index = lerp(0, 2.9, array_get(scr_platswap_yscale(), 0));