function scr_plat_set_group(arg0, arg1 = infinity) { __depthgroup = arg0; if (arg0 < 0) { if (arg0 == UnknownEnum.Value_m1) depth = 1960; if (arg0 == UnknownEnum.Value_m2) depth = 1950; } if (arg1 != infinity) scr_plat_set_depth_offset(arg1); } function scr_plat_set_depth_offset(arg0 = 1) { __depth_offset = 0; if (arg0 == 1) { var floortex = collision_rectangle(bbox_left, bbox_bottom - 1, bbox_right, bbox_bottom, obj_plat_floortex, false, true); if (floortex != -4) { if (variable_instance_exists(floortex, "y_ow")) __depth_offset = bbox_bottom - floortex.y_ow_anchor; else __depth_offset = bbox_bottom - floortex.bbox_bottom; } } else { __depth_offset = arg0; } } function scr_plat_wallcast(arg0 = -1) { var _depth_group = 0; if (variable_instance_exists(id, "__depthgroup")) _depth_group = __depthgroup; var _depth_offset = 0; if (variable_instance_exists(id, "__depth_offset")) _depth_offset = __depth_offset; if (!variable_instance_exists(id, "__depthcast__results") || !ds_exists(__depthcast__results, ds_type_list)) __depthcast__results = scr_ds_list_create_managed(); ds_list_clear(__depthcast__results); if (arg0 == -1) { var best = -4; instance_place_list(x, y, 445, __depthcast__results, false); var __size = ds_list_size(__depthcast__results); for (var i = 0; i < __size; i++) { if (best == -4 || best.depth < ds_list_find_value(__depthcast__results, i).depth) best = ds_list_find_value(__depthcast__results, i); } if (best == -4) { ds_list_clear(__depthcast__results); instance_place_list(x, y, 1305, __depthcast__results, false); __size = ds_list_size(__depthcast__results); for (var i = 0; i < __size; i++) { if (best == -4 || best.depth < ds_list_find_value(__depthcast__results, i).depth) best = ds_list_find_value(__depthcast__results, i); } if (best != -4 && best.floortex != -4) { __floortex = best.floortex; scr_calculate_floortex_background_depth(best.floortex, _depth_offset + _depth_group); exit; } } else if (best.floortex != -4) { __floortex = best.floortex; scr_calculate_floortex_foreground_depth(best.floortex, _depth_offset + _depth_group); exit; } } else { var best = -4; instance_place_list(x, y, 445, __depthcast__results, false); var __size = ds_list_size(__depthcast__results); for (var i = 0; i < __size; i++) { if (best == -4 || best.depth > ds_list_find_value(__depthcast__results, i).depth) best = ds_list_find_value(__depthcast__results, i); } if (best == -4) { ds_list_clear(__depthcast__results); instance_place_list(x, y, 1305, __depthcast__results, false); __size = ds_list_size(__depthcast__results); for (var i = 0; i < __size; i++) { if (best == -4 || best.depth > ds_list_find_value(__depthcast__results, i).depth) best = ds_list_find_value(__depthcast__results, i); } if (best != -4 && best.floortex != -4) { __floortex = best.floortex; scr_calculate_floortex_background_depth(best.floortex, _depth_offset + _depth_group); exit; } } else if (best.floortex != -4) { __floortex = best.floortex; scr_calculate_floortex_foreground_depth(best.floortex, _depth_offset + _depth_group); exit; } } scr_plat_depthcast(); } function scr_plat_depthcast() { var _depth_group = 0; if (variable_instance_exists(id, "__depthgroup")) _depth_group = __depthgroup; if (_depth_group < 0) exit; var _depth_offset = 0; if (variable_instance_exists(id, "__depth_offset")) _depth_offset = __depth_offset; if (!variable_instance_exists(id, "__depthcast__results") || !ds_exists(__depthcast__results, ds_type_list)) __depthcast__results = scr_ds_list_create_managed(); ds_list_clear(__depthcast__results); collision_rectangle_list(bbox_left, bbox_bottom, bbox_right, room_height, obj_plat_floortex_FLOOR, false, false, __depthcast__results, false); var __dist = 99999999; var __closest = -4; var __size = ds_list_size(__depthcast__results); for (var i = 0; i < __size; i++) { if (!ds_list_find_value(__depthcast__results, i).depthcast_ignore && (ds_list_find_value(__depthcast__results, i).y_ow - bbox_bottom) < __dist) { __dist = ds_list_find_value(__depthcast__results, i).y_ow - bbox_bottom; __closest = ds_list_find_value(__depthcast__results, i); } } if (__closest != -4) { scr_calculate_floortex_depth(__closest, _depth_offset + _depth_group); __storeddepth = depth; __floortex = __closest; } else { if (!variable_instance_exists(id, "__storeddepth")) __storeddepth = 100000 - ((y * 10) + (sprite_height * 10)); depth = __storeddepth; } } function scr_calculate_floortex_depth(arg0 = self, arg1 = 0) { depth = ((1200000 - (arg0.y_ow_anchor * 10)) + arg0.depthbonus + 200000) - arg1; } function scr_calculate_floortex_foreground_depth(arg0 = self, arg1 = 0) { depth = ((1200000 - (arg0.bbox_bottom * 10)) + arg0.depthbonus + 200000) - arg1; } function scr_calculate_floortex_background_depth(arg0 = self, arg1 = 0) { depth = ((1200000 - (arg0.bbox_top * 10)) + arg0.depthbonus + 200000) - arg1; } enum UnknownEnum { Value_m2 = -2, Value_m1 }