From a29ad93fea26a41501f91b2a496a07bf68035065 Mon Sep 17 00:00:00 2001 From: MrMiguel211 <60329473+MrMiguel211@users.noreply.github.com> Date: Wed, 24 Jul 2024 03:23:14 -0700 Subject: [PATCH] Rotate Hive Totem Door --- src/add_modify_obj_patches.rs | 300 ++++++++++---------- src/patches.rs | 441 ++++++++++++++++++------------ src/pickup_meta.rs | 2 +- structs/src/scly_props/actor.rs | 28 +- structs/src/scly_props/structs.rs | 38 +-- 5 files changed, 449 insertions(+), 360 deletions(-) diff --git a/src/add_modify_obj_patches.rs b/src/add_modify_obj_patches.rs index e96a8a25..1cca16c6 100644 --- a/src/add_modify_obj_patches.rs +++ b/src/add_modify_obj_patches.rs @@ -1246,20 +1246,20 @@ pub fn patch_add_bomb_slot<'r>( }, actor_params: structs::scly_structs::ActorParameters { light_params: structs::scly_structs::LightParameters { - unknown0: 1, - unknown1: 1.0, + cast_shadow: 1, + shadow_scale: 1.0, shadow_tessellation: 0, - unknown2: 1.0, - unknown3: 20.0, + shadow_alpha: 1.0, + max_shadow_light: 20.0, color: [1.0, 1.0, 1.0, 1.0].into(), - unknown4: 1, - world_lighting: 3, + make_lights: 1, + use_world_lighting: 3, light_recalculation: 1, - unknown5: [0.0, 0.0, 0.0].into(), - unknown6: 4, - unknown7: 4, - unknown8: 0, - light_layer_id: 0, + lightning_position: [0.0, 0.0, 0.0].into(), + num_dynamic_lights: 4, + num_area_lights: 4, + ignore_ambient_lightning: 0, + use_light_set: 0, }, scan_params: structs::scly_structs::ScannableParameters { scan: ResId::invalid(), // None @@ -1269,19 +1269,19 @@ pub fn patch_add_bomb_slot<'r>( thermal_cmdl: ResId::invalid(), // None thermal_cskr: ResId::invalid(), // None - unknown0: 1, - unknown1: 1.0, - unknown2: 1.0, + use_global_render_time: 1, + fade_in_time: 1.0, + fade_out_time: 1.0, visor_params: structs::scly_structs::VisorParameters { unknown0: 0, target_passthrough: 0, visor_mask: 15, // Combat|Scan|Thermal|XRay }, - enable_thermal_heat: 0, - unknown3: 0, - unknown4: 0, - unknown5: 1.0, + thermal_hot: 0, + force_render_unsorted: 0, + no_sort_thermal: 0, + thermal_damage_mag: 1.0, }, speed: 1.0, @@ -1312,10 +1312,10 @@ pub fn patch_add_bomb_slot<'r>( .into(), rotation: config.rotation.into(), scale: [1.034, 1.0, 1.034].into(), - hitbox: [0.0, 0.0, 0.0].into(), - scan_offset: [0.0, 0.0, 0.0].into(), - unknown1: 1.0, - unknown2: 0.0, + collision_box: [0.0, 0.0, 0.0].into(), + collision_offset: [0.0, 0.0, 0.0].into(), + mass: 1.0, + momentum: 0.0, health_info: structs::scly_structs::HealthInfo { health: 5.0, knockback_resistance: 1.0, @@ -1329,20 +1329,20 @@ pub fn patch_add_bomb_slot<'r>( }, actor_params: structs::scly_structs::ActorParameters { light_params: structs::scly_structs::LightParameters { - unknown0: 1, - unknown1: 1.0, + cast_shadow: 1, + shadow_scale: 1.0, shadow_tessellation: 0, - unknown2: 1.0, - unknown3: 20.0, + shadow_alpha: 1.0, + max_shadow_light: 20.0, color: [1.0, 1.0, 1.0, 1.0].into(), - unknown4: 1, - world_lighting: 3, + make_lights: 1, + use_world_lighting: 3, light_recalculation: 1, - unknown5: [0.0, 0.0, 0.0].into(), - unknown6: 4, - unknown7: 4, - unknown8: 0, - light_layer_id: 0, + lightning_position: [0.0, 0.0, 0.0].into(), + num_dynamic_lights: 4, + num_area_lights: 4, + ignore_ambient_lightning: 0, + use_light_set: 0, }, scan_params: structs::scly_structs::ScannableParameters { scan: ResId::invalid(), // None @@ -1352,31 +1352,31 @@ pub fn patch_add_bomb_slot<'r>( thermal_cmdl: ResId::invalid(), // None thermal_cskr: ResId::invalid(), // None - unknown0: 1, - unknown1: 1.0, - unknown2: 1.0, + use_global_render_time: 1, + fade_in_time: 1.0, + fade_out_time: 1.0, visor_params: structs::scly_structs::VisorParameters { unknown0: 0, target_passthrough: 0, visor_mask: 15, // Combat|Scan|Thermal|XRay }, - enable_thermal_heat: 1, - unknown3: 0, - unknown4: 0, - unknown5: 1.0, + thermal_hot: 1, + force_render_unsorted: 0, + no_sort_thermal: 0, + thermal_damage_mag: 1.0, }, - looping: 1, - snow: 1, - solid: 0, - camera_passthrough: 0, + is_loop: 1, + immovable: 1, + is_solid: 0, + is_camera_through: 0, active, - unknown8: 0, - unknown9: 1.0, - unknown10: 0, - unknown11: 0, - unknown12: 0, - unknown13: 0, + render_texture_set: 0, + xray_alpha: 1.0, + thermal_visible_through_geometry: 0, + draws_shadow: 0, + scale_animation: 0, + material_flag_54: 0, } .into(), connections: vec![].into(), @@ -2124,20 +2124,20 @@ pub fn patch_add_platform<'r>( }, actor_params: structs::scly_structs::ActorParameters { light_params: structs::scly_structs::LightParameters { - unknown0: 1, - unknown1: 1.0, + cast_shadow: 1, + shadow_scale: 1.0, shadow_tessellation: 0, - unknown2: 1.0, - unknown3: 20.0, + shadow_alpha: 1.0, + max_shadow_light: 20.0, color: [1.0, 1.0, 1.0, 1.0].into(), - unknown4: 1, - world_lighting: 1, + make_lights: 1, + use_world_lighting: 1, light_recalculation: 1, - unknown5: [0.0, 0.0, 0.0].into(), - unknown6: 4, - unknown7: 4, - unknown8: 0, - light_layer_id: 0, + lightning_position: [0.0, 0.0, 0.0].into(), + num_dynamic_lights: 4, + num_area_lights: 4, + ignore_ambient_lightning: 0, + use_light_set: 0, }, scan_params: structs::scly_structs::ScannableParameters { scan: ResId::invalid(), // None @@ -2147,19 +2147,19 @@ pub fn patch_add_platform<'r>( thermal_cmdl: ResId::invalid(), // None thermal_cskr: ResId::invalid(), // None - unknown0: 1, - unknown1: 1.0, - unknown2: 1.0, + use_global_render_time: 1, + fade_in_time: 1.0, + fade_out_time: 1.0, visor_params: structs::scly_structs::VisorParameters { unknown0: 0, target_passthrough: 0, visor_mask: 15, // Combat|Scan|Thermal|XRay }, - enable_thermal_heat: 1, - unknown3: 0, - unknown4: 0, - unknown5: 1.0, + thermal_hot: 1, + force_render_unsorted: 0, + no_sort_thermal: 0, + thermal_damage_mag: 1.0, }, speed: 5.0, @@ -2244,20 +2244,20 @@ pub fn patch_add_platform<'r>( }, actor_params: structs::scly_structs::ActorParameters { light_params: structs::scly_structs::LightParameters { - unknown0: 1, - unknown1: 1.0, + cast_shadow: 1, + shadow_scale: 1.0, shadow_tessellation: 0, - unknown2: 1.0, - unknown3: 20.0, + shadow_alpha: 1.0, + max_shadow_light: 20.0, color: [1.0, 1.0, 1.0, 1.0].into(), - unknown4: 1, - world_lighting: 1, + make_lights: 1, + use_world_lighting: 1, light_recalculation: 1, - unknown5: [0.0, 0.0, 0.0].into(), - unknown6: 4, - unknown7: 4, - unknown8: 0, - light_layer_id: 0, + lightning_position: [0.0, 0.0, 0.0].into(), + num_dynamic_lights: 4, + num_area_lights: 4, + ignore_ambient_lightning: 0, + use_light_set: 0, }, scan_params: structs::scly_structs::ScannableParameters { scan: ResId::invalid(), // None @@ -2267,19 +2267,19 @@ pub fn patch_add_platform<'r>( thermal_cmdl: ResId::invalid(), // None thermal_cskr: ResId::invalid(), // None - unknown0: 1, - unknown1: 1.0, - unknown2: 1.0, + use_global_render_time: 1, + fade_in_time: 1.0, + fade_out_time: 1.0, visor_params: structs::scly_structs::VisorParameters { unknown0: 0, target_passthrough: 0, visor_mask: 15, // Combat|Scan|Thermal|XRay }, - enable_thermal_heat: 1, - unknown3: 0, - unknown4: 0, - unknown5: 1.0, + thermal_hot: 1, + force_render_unsorted: 0, + no_sort_thermal: 0, + thermal_damage_mag: 1.0, }, speed: 5.0, @@ -2688,10 +2688,10 @@ pub fn add_block( position: position.into(), rotation: [0.0, 0.0, 0.0].into(), scale: scale.into(), - hitbox: [0.0, 0.0, 0.0].into(), - scan_offset: [0.0, 0.0, 0.0].into(), - unknown1: 1.0, - unknown2: 0.0, + collision_box: [0.0, 0.0, 0.0].into(), + collision_offset: [0.0, 0.0, 0.0].into(), + mass: 1.0, + momentum: 0.0, health_info: structs::scly_structs::HealthInfo { health: 5.0, knockback_resistance: 1.0, @@ -2705,20 +2705,20 @@ pub fn add_block( }, actor_params: structs::scly_structs::ActorParameters { light_params: structs::scly_structs::LightParameters { - unknown0: 1, - unknown1: 1.0, + cast_shadow: 1, + shadow_scale: 1.0, shadow_tessellation: 0, - unknown2: 1.0, - unknown3: 20.0, + shadow_alpha: 1.0, + max_shadow_light: 20.0, color: [1.0, 1.0, 1.0, 1.0].into(), - unknown4: 1, - world_lighting: 1, + make_lights: 1, + use_world_lighting: 1, light_recalculation: 1, - unknown5: [0.0, 0.0, 0.0].into(), - unknown6: 4, - unknown7: 4, - unknown8: 0, - light_layer_id: 0, + lightning_position: [0.0, 0.0, 0.0].into(), + num_dynamic_lights: 4, + num_area_lights: 4, + ignore_ambient_lightning: 0, + use_light_set: 0, }, scan_params: structs::scly_structs::ScannableParameters { scan: ResId::invalid(), // None @@ -2728,31 +2728,31 @@ pub fn add_block( thermal_cmdl: ResId::invalid(), // None thermal_cskr: ResId::invalid(), // None - unknown0: 1, - unknown1: 1.0, - unknown2: 1.0, + use_global_render_time: 1, + fade_in_time: 1.0, + fade_out_time: 1.0, visor_params: structs::scly_structs::VisorParameters { unknown0: 0, target_passthrough: 0, visor_mask: 15, // Combat|Scan|Thermal|XRay }, - enable_thermal_heat: 1, - unknown3: 0, - unknown4: 0, - unknown5: 1.0, + thermal_hot: 1, + force_render_unsorted: 0, + no_sort_thermal: 0, + thermal_damage_mag: 1.0, }, - looping: 1, - snow: 1, - solid: is_tangible, - camera_passthrough: 0, + is_loop: 1, + immovable: 1, + is_solid: is_tangible, + is_camera_through: 0, active: active as u8, - unknown8: 0, - unknown9: 1.0, - unknown10: 1, - unknown11: 0, - unknown12: 0, - unknown13: 0, + render_texture_set: 0, + xray_alpha: 1.0, + thermal_visible_through_geometry: 1, + draws_shadow: 0, + scale_animation: 0, + material_flag_54: 0, } .into(), connections: vec![].into(), @@ -2840,10 +2840,10 @@ pub fn patch_lock_on_point<'r>( position: position.into(), rotation: [0.0, 0.0, 0.0].into(), scale: [8.0, 8.0, 8.0].into(), - hitbox: [0.0, 0.0, 0.0].into(), - scan_offset: [0.0, 0.0, 0.0].into(), - unknown1: 1.0, - unknown2: 0.0, + collision_box: [0.0, 0.0, 0.0].into(), + collision_offset: [0.0, 0.0, 0.0].into(), + mass: 1.0, + momentum: 0.0, health_info: structs::scly_structs::HealthInfo { health: 5.0, knockback_resistance: 1.0, @@ -2857,20 +2857,20 @@ pub fn patch_lock_on_point<'r>( }, actor_params: structs::scly_structs::ActorParameters { light_params: structs::scly_structs::LightParameters { - unknown0: 1, - unknown1: 1.0, + cast_shadow: 1, + shadow_scale: 1.0, shadow_tessellation: 0, - unknown2: 1.0, - unknown3: 20.0, + shadow_alpha: 1.0, + max_shadow_light: 20.0, color: [1.0, 1.0, 1.0, 1.0].into(), - unknown4: 1, - world_lighting: 1, + make_lights: 1, + use_world_lighting: 1, light_recalculation: 1, - unknown5: [0.0, 0.0, 0.0].into(), - unknown6: 4, - unknown7: 4, - unknown8: 0, - light_layer_id: 0, + lightning_position: [0.0, 0.0, 0.0].into(), + num_dynamic_lights: 4, + num_area_lights: 4, + ignore_ambient_lightning: 0, + use_light_set: 0, }, scan_params: structs::scly_structs::ScannableParameters { scan: ResId::invalid(), // None @@ -2880,31 +2880,31 @@ pub fn patch_lock_on_point<'r>( thermal_cmdl: ResId::invalid(), // None thermal_cskr: ResId::invalid(), // None - unknown0: 1, - unknown1: 1.0, - unknown2: 1.0, + use_global_render_time: 1, + fade_in_time: 1.0, + fade_out_time: 1.0, visor_params: structs::scly_structs::VisorParameters { unknown0: 0, target_passthrough: 1, visor_mask: 15, // Combat|Scan|Thermal|XRay }, - enable_thermal_heat: 1, - unknown3: 0, - unknown4: 0, - unknown5: 1.0, + thermal_hot: 1, + force_render_unsorted: 0, + no_sort_thermal: 0, + thermal_damage_mag: 1.0, }, - looping: 1, - snow: 1, - solid: 0, - camera_passthrough: 1, + is_loop: 1, + immovable: 1, + is_solid: 0, + is_camera_through: 1, active: config.active1.unwrap_or(true) as u8, - unknown8: 0, - unknown9: 1.0, - unknown10: 1, - unknown11: 0, - unknown12: 0, - unknown13: 0, + render_texture_set: 0, + xray_alpha: 1.0, + thermal_visible_through_geometry: 1, + draws_shadow: 0, + scale_animation: 0, + material_flag_54: 0, } .into(), connections: vec![].into(), diff --git a/src/patches.rs b/src/patches.rs index 94d98cd6..b338d138 100644 --- a/src/patches.rs +++ b/src/patches.rs @@ -370,6 +370,91 @@ fn patch_thermal_conduits_damage_vulnerabilities( Ok(()) } +fn patch_hive_totem_door_rotation( + _ps: &mut PatcherState, + area: &mut mlvl_wrapper::MlvlArea, +) -> Result<(), String> { + let layer = area + .mrea() + .scly_section_mut() + .layers + .iter_mut() + .next() + .unwrap(); + + let objects = layer.objects.as_mut_vec(); + // Blast Shield + objects + .iter_mut() + .find(|obj: &&mut structs::SclyObject| obj.instance_id & 0x00FFFFFF == 0x2401F7) + .and_then(|obj| obj.property_data.as_actor_mut()) + .unwrap() + .rotation = [0.019047, 0.480051, 90.001442].into(); + + objects + .iter_mut() + .find(|obj: &&mut structs::SclyObject| obj.instance_id & 0x00FFFFFF == 0x2401F7) + .and_then(|obj| obj.property_data.as_actor_mut()) + .unwrap() + .collision_box = [5.1, 1.35, 4.1].into(); + + // Door + objects + .iter_mut() + .find(|obj| obj.instance_id & 0x00FFFFFF == 0x240233) + .and_then(|obj| obj.property_data.as_door_mut()) + .unwrap() + .rotation = [0.019047, 0.480051, 90.001442].into(); + + // Actor_DoorShield + objects + .iter_mut() + .find(|obj| obj.instance_id & 0x00FFFFFF == 0x240236) + .and_then(|obj| obj.property_data.as_actor_mut()) + .unwrap() + .position = [94.626328, 335.605164, -4.333776].into(); + + objects + .iter_mut() + .find(|obj| obj.instance_id & 0x00FFFFFF == 0x240236) + .and_then(|obj| obj.property_data.as_actor_mut()) + .unwrap() + .rotation = [0.019047, 0.480051, 90.001442].into(); + + // Actor_DoorShield_Key + objects + .iter_mut() + .find(|obj| obj.instance_id & 0x00FFFFFF == 0x24022F) + .and_then(|obj| obj.property_data.as_actor_mut()) + .unwrap() + .position = [94.626328, 335.605164, -4.333776].into(); + + objects + .iter_mut() + .find(|obj| obj.instance_id & 0x00FFFFFF == 0x24022F) + .and_then(|obj| obj.property_data.as_actor_mut()) + .unwrap() + .rotation = [0.019047, 0.480051, 90.001442].into(); + + // Trigger_DoorUnlock + objects + .iter_mut() + .find(|obj| obj.instance_id & 0x00FFFFFF == 0x240234) + .and_then(|obj| obj.property_data.as_damageable_trigger_mut()) + .unwrap() + .position = [94.410385, 335.469147, -4.128055].into(); + + // Trigger_DoorKey + objects + .iter_mut() + .find(|obj| obj.instance_id & 0x00FFFFFF == 0x24022E) + .and_then(|obj| obj.property_data.as_damageable_trigger_mut()) + .unwrap() + .position = [94.410385, 335.469147, -4.128055].into(); + + Ok(()) +} + fn is_door_lock(obj: &structs::SclyObject) -> bool { let actor = obj.property_data.as_actor(); @@ -768,12 +853,10 @@ fn patch_door<'r>( // Calculate placement // let rotation: GenericArray; - // this is actually scan offset let scale: GenericArray; - // this is actually hitbox - let scan_offset: GenericArray = [0.0, 0.0, 0.0].into(); - let hitbox: GenericArray = [0.0, 0.0, 0.0].into(); + let collision_box: GenericArray = [0.0, 0.0, 0.0].into(); + let collision_offset: GenericArray = [0.0, 0.0, 0.0].into(); let door_rotation = door_loc.door_rotation.unwrap(); let mut is_ceiling = false; @@ -894,10 +977,10 @@ fn patch_door<'r>( position, rotation, scale, - hitbox, - scan_offset, - unknown1: 1.0, // mass - unknown2: 0.0, // momentum + collision_box, + collision_offset, + mass: 1.0, + momentum: 0.0, health_info: structs::scly_structs::HealthInfo { health: 1.0, knockback_resistance: 1.0, @@ -911,20 +994,20 @@ fn patch_door<'r>( }, actor_params: structs::scly_structs::ActorParameters { light_params: structs::scly_structs::LightParameters { - unknown0: 1, - unknown1: 1.0, + cast_shadow: 1, + shadow_scale: 1.0, shadow_tessellation: 0, - unknown2: 1.0, - unknown3: 20.0, + shadow_alpha: 1.0, + max_shadow_light: 20.0, color: [1.0, 1.0, 1.0, 1.0].into(), // RGBA - unknown4: 1, - world_lighting: 1, + make_lights: 1, + use_world_lighting: 1, light_recalculation: 1, - unknown5: [0.0, 0.0, 0.0].into(), - unknown6: 4, - unknown7: 4, - unknown8: 0, - light_layer_id: 0, + lightning_position: [0.0, 0.0, 0.0].into(), + num_dynamic_lights: 4, + num_area_lights: 4, + ignore_ambient_lightning: 0, + use_light_set: 0, }, scan_params: structs::scly_structs::ScannableParameters { scan: ResId::invalid(), @@ -933,30 +1016,30 @@ fn patch_door<'r>( xray_cskr: ResId::invalid(), thermal_cmdl: ResId::invalid(), thermal_cskr: ResId::invalid(), - unknown0: 1, - unknown1: 1.0, - unknown2: 1.0, + use_global_render_time: 1, + fade_in_time: 1.0, + fade_out_time: 1.0, visor_params: structs::scly_structs::VisorParameters { unknown0: 0, target_passthrough: 1, visor_mask: 15, // Visor Flags : Combat|Scan|Thermal|XRay }, - enable_thermal_heat: 0, - unknown3: 0, - unknown4: 0, - unknown5: 1.0, + thermal_hot: 0, + force_render_unsorted: 0, + no_sort_thermal: 0, + thermal_damage_mag: 1.0, }, - looping: 1, - snow: 1, // immovable - solid: 0, - camera_passthrough: 0, + is_loop: 1, + immovable: 1, + is_solid: 0, + is_camera_through: 0, active: 1, - unknown8: 0, - unknown9: 1.0, - unknown10: 0, - unknown11: 0, - unknown12: 0, - unknown13: 0, + render_texture_set: 0, + xray_alpha: 1.0, + thermal_visible_through_geometry: 0, + draws_shadow: 0, + scale_animation: 0, + material_flag_54: 0, })), }; @@ -1421,20 +1504,20 @@ fn patch_door<'r>( xray_visor_visible: 1, die_when_systems_done: 0, light_params: structs::scly_structs::LightParameters { - unknown0: 1, - unknown1: 1.0, + cast_shadow: 1, + shadow_scale: 1.0, shadow_tessellation: 0, - unknown2: 1.0, - unknown3: 20.0, + shadow_alpha: 1.0, + max_shadow_light: 20.0, color: [1.0, 1.0, 1.0, 1.0].into(), // RGBA - unknown4: 0, - world_lighting: 1, + make_lights: 0, + use_world_lighting: 1, light_recalculation: 1, - unknown5: [0.0, 0.0, 0.0].into(), - unknown6: 4, - unknown7: 4, - unknown8: 0, - light_layer_id: 0, + lightning_position: [0.0, 0.0, 0.0].into(), + num_dynamic_lights: 4, + num_area_lights: 4, + ignore_ambient_lightning: 0, + use_light_set: 0, }, } .into(), @@ -3702,10 +3785,10 @@ fn patch_add_scan_actor<'r>( position: position.into(), rotation: [0.0, 90.0, rotation].into(), scale: [1.0, 1.0, 1.0].into(), - hitbox: [0.0, 0.0, 0.0].into(), - scan_offset: [0.0, 0.0, 0.0].into(), - unknown1: 1.0, // mass - unknown2: 0.0, // momentum + collision_box: [0.0, 0.0, 0.0].into(), + collision_offset: [0.0, 0.0, 0.0].into(), + mass: 1.0, + momentum: 0.0, health_info: structs::scly_structs::HealthInfo { health: 5.0, knockback_resistance: 1.0, @@ -3719,20 +3802,20 @@ fn patch_add_scan_actor<'r>( }, actor_params: structs::scly_structs::ActorParameters { light_params: structs::scly_structs::LightParameters { - unknown0: 0, - unknown1: 1.0, + cast_shadow: 0, + shadow_scale: 1.0, shadow_tessellation: 0, - unknown2: 1.0, - unknown3: 20.0, + shadow_alpha: 1.0, + max_shadow_light: 20.0, color: [1.0, 1.0, 1.0, 1.0].into(), // RGBA - unknown4: 0, - world_lighting: 0, + make_lights: 0, + use_world_lighting: 0, light_recalculation: 1, - unknown5: [0.0, 0.0, 0.0].into(), - unknown6: 4, - unknown7: 4, - unknown8: 0, - light_layer_id: 0, + lightning_position: [0.0, 0.0, 0.0].into(), + num_area_lights: 4, + num_dynamic_lights: 4, + ignore_ambient_lightning: 0, + use_light_set: 0, }, scan_params: structs::scly_structs::ScannableParameters { scan: ResId::invalid(), @@ -3741,30 +3824,30 @@ fn patch_add_scan_actor<'r>( xray_cskr: ResId::invalid(), thermal_cmdl: ResId::invalid(), thermal_cskr: ResId::invalid(), - unknown0: 1, - unknown1: 1.0, - unknown2: 1.0, + use_global_render_time: 1, + fade_in_time: 1.0, + fade_out_time: 1.0, visor_params: structs::scly_structs::VisorParameters { unknown0: 0, target_passthrough: 0, visor_mask: 15, // Visor Flags : Combat|Scan|Thermal|XRay }, - enable_thermal_heat: 1, - unknown3: 0, - unknown4: 0, - unknown5: 1.0, + thermal_hot: 1, + force_render_unsorted: 0, + no_sort_thermal: 0, + thermal_damage_mag: 1.0, }, - looping: 1, - snow: 0, // immovable - solid: 0, - camera_passthrough: 0, + is_loop: 1, + immovable: 0, + is_solid: 0, + is_camera_through: 0, active: 1, - unknown8: 0, - unknown9: 1.0, - unknown10: 0, - unknown11: 0, - unknown12: 0, - unknown13: 0, + render_texture_set: 0, + xray_alpha: 1.0, + thermal_visible_through_geometry: 0, + draws_shadow: 0, + scale_animation: 0, + material_flag_54: 0, })), }); @@ -7241,10 +7324,10 @@ fn make_main_plaza_locked_door_two_ways( position: [151.951_19, 86.462_58, 24.503178].into(), rotation: [0.0, 0.0, 0.0].into(), scale: [1.0, 1.0, 1.0].into(), - hitbox: [0.0, 0.0, 0.0].into(), - scan_offset: [0.0, 0.0, 0.0].into(), - unknown1: 1.0, - unknown2: 0.0, + collision_box: [0.0, 0.0, 0.0].into(), + collision_offset: [0.0, 0.0, 0.0].into(), + mass: 1.0, + momentum: 0.0, health_info: structs::scly_structs::HealthInfo { health: 5.0, knockback_resistance: 1.0, @@ -7258,20 +7341,20 @@ fn make_main_plaza_locked_door_two_ways( }, actor_params: structs::scly_structs::ActorParameters { light_params: structs::scly_structs::LightParameters { - unknown0: 1, - unknown1: 1.0, + cast_shadow: 1, + shadow_scale: 1.0, shadow_tessellation: 0, - unknown2: 1.0, - unknown3: 20.0, + shadow_alpha: 1.0, + max_shadow_light: 20.0, color: [1.0, 1.0, 1.0, 1.0].into(), - unknown4: 1, - world_lighting: 1, + make_lights: 1, + use_world_lighting: 1, light_recalculation: 1, - unknown5: [0.0, 0.0, 0.0].into(), - unknown6: 4, - unknown7: 4, - unknown8: 0, - light_layer_id: 0, + lightning_position: [0.0, 0.0, 0.0].into(), + num_dynamic_lights: 4, + num_area_lights: 4, + ignore_ambient_lightning: 0, + use_light_set: 0, }, scan_params: structs::scly_structs::ScannableParameters { scan: ResId::invalid(), // None @@ -7281,31 +7364,31 @@ fn make_main_plaza_locked_door_two_ways( thermal_cmdl: ResId::invalid(), // None thermal_cskr: ResId::invalid(), // None - unknown0: 1, - unknown1: 1.0, - unknown2: 1.0, + use_global_render_time: 1, + fade_in_time: 1.0, + fade_out_time: 1.0, visor_params: structs::scly_structs::VisorParameters { unknown0: 0, target_passthrough: 0, visor_mask: 15, // Combat|Scan|Thermal|XRay }, - enable_thermal_heat: 1, - unknown3: 0, - unknown4: 1, - unknown5: 1.0, + thermal_hot: 1, + force_render_unsorted: 0, + no_sort_thermal: 1, + thermal_damage_mag: 1.0, }, - looping: 1, - snow: 1, - solid: 0, - camera_passthrough: 0, + is_loop: 1, + immovable: 1, + is_solid: 0, + is_camera_through: 0, active: 1, - unknown8: 0, - unknown9: 1.0, - unknown10: 1, - unknown11: 0, - unknown12: 0, - unknown13: 0, + render_texture_set: 0, + xray_alpha: 1.0, + thermal_visible_through_geometry: 1, + draws_shadow: 0, + scale_animation: 0, + material_flag_54: 0, } .into(), connections: vec![].into(), @@ -8681,7 +8764,7 @@ fn patch_remove_cutscenes( // central dynamo collision blocker // the power bomb rock collision should not extend beyond the door let actor = obj.property_data.as_actor_mut().unwrap(); - actor.hitbox[1] = 0.4; + actor.collision_box[1] = 0.4; actor.position[1] -= 0.8; } else if obj_id == 0x0002023E { // main plaza turn crane left relay @@ -12401,10 +12484,10 @@ fn patch_final_boss_permadeath<'r>( position: [52.0, -298.0, -375.5].into(), rotation: [0.0, 0.0, 0.0].into(), scale: [1.0, 1.0, 1.0].into(), - hitbox: [0.0, 0.0, 0.0].into(), - scan_offset: [0.0, 0.0, 0.0].into(), - unknown1: 1.0, - unknown2: 0.0, + collision_box: [0.0, 0.0, 0.0].into(), + collision_offset: [0.0, 0.0, 0.0].into(), + mass: 1.0, + momentum: 0.0, health_info: structs::scly_structs::HealthInfo { health: 5.0, knockback_resistance: 1.0, @@ -12418,20 +12501,20 @@ fn patch_final_boss_permadeath<'r>( }, actor_params: structs::scly_structs::ActorParameters { light_params: structs::scly_structs::LightParameters { - unknown0: 1, - unknown1: 1.0, + cast_shadow: 1, + shadow_scale: 1.0, shadow_tessellation: 0, - unknown2: 1.0, - unknown3: 20.0, + shadow_alpha: 1.0, + max_shadow_light: 20.0, color: [1.0, 1.0, 1.0, 1.0].into(), - unknown4: 1, - world_lighting: 1, + make_lights: 1, + use_world_lighting: 1, light_recalculation: 1, - unknown5: [0.0, 0.0, 0.0].into(), - unknown6: 4, - unknown7: 4, - unknown8: 0, - light_layer_id: 0, + lightning_position: [0.0, 0.0, 0.0].into(), + num_dynamic_lights: 4, + num_area_lights: 4, + ignore_ambient_lightning: 0, + use_light_set: 0, }, scan_params: structs::scly_structs::ScannableParameters { scan: ResId::invalid(), // None @@ -12441,31 +12524,31 @@ fn patch_final_boss_permadeath<'r>( thermal_cmdl: ResId::invalid(), // None thermal_cskr: ResId::invalid(), // None - unknown0: 1, - unknown1: 1.0, - unknown2: 1.0, + use_global_render_time: 1, + fade_in_time: 1.0, + fade_out_time: 1.0, visor_params: structs::scly_structs::VisorParameters { unknown0: 0, target_passthrough: 0, visor_mask: 15, // Combat|Scan|Thermal|XRay }, - enable_thermal_heat: 1, - unknown3: 0, - unknown4: 1, - unknown5: 1.0, + thermal_hot: 1, + force_render_unsorted: 0, + no_sort_thermal: 1, + thermal_damage_mag: 1.0, }, - looping: 1, - snow: 1, - solid: 0, - camera_passthrough: 0, + is_loop: 1, + immovable: 1, + is_solid: 0, + is_camera_through: 0, active: 1, - unknown8: 0, - unknown9: 1.0, - unknown10: 0, - unknown11: 0, - unknown12: 0, - unknown13: 0, + render_texture_set: 0, + xray_alpha: 1.0, + thermal_visible_through_geometry: 0, + draws_shadow: 0, + scale_animation: 0, + material_flag_54: 0, } .into(), connections: vec![].into(), @@ -18260,6 +18343,12 @@ fn build_and_run_patches<'r>( } } + if config.qol_cosmetic { + patcher.add_scly_patch(resource_info!("19_hive_totem.MREA").into(), move |ps, area| { + patch_hive_totem_door_rotation(ps, area) + }); + } + if !config.force_vanilla_layout { patch_qol_logical(&mut patcher, config, config.version); } @@ -19065,10 +19154,10 @@ fn patch_elite_research_door_lock<'r>( position: [21.35, 166.275_13, 51.825].into(), rotation: [0.0, 0.0, 0.0].into(), scale: [1.45, 1.45, 1.45].into(), - hitbox: [1.75, 5.0, 5.0].into(), - scan_offset: [0.0, 0.0, 0.0].into(), - unknown1: 1.0, // mass - unknown2: 0.0, // momentum + collision_box: [1.75, 5.0, 5.0].into(), + collision_offset: [0.0, 0.0, 0.0].into(), + mass: 1.0, + momentum: 0.0, health_info: structs::scly_structs::HealthInfo { health: 5.0, knockback_resistance: 1.0, @@ -19116,20 +19205,20 @@ fn patch_elite_research_door_lock<'r>( }, actor_params: structs::scly_structs::ActorParameters { light_params: structs::scly_structs::LightParameters { - unknown0: 1, - unknown1: 1.0, + cast_shadow: 1, + shadow_scale: 1.0, shadow_tessellation: 0, - unknown2: 1.0, - unknown3: 20.0, + shadow_alpha: 1.0, + max_shadow_light: 20.0, color: [1.0, 1.0, 1.0, 1.0].into(), // RGBA - unknown4: 1, - world_lighting: 1, + make_lights: 1, + use_world_lighting: 1, light_recalculation: 1, - unknown5: [0.0, 0.0, 0.0].into(), - unknown6: 4, - unknown7: 4, - unknown8: 0, - light_layer_id: 0, + lightning_position: [0.0, 0.0, 0.0].into(), + num_dynamic_lights: 4, + num_area_lights: 4, + ignore_ambient_lightning: 0, + use_light_set: 0, }, scan_params: structs::scly_structs::ScannableParameters { scan: ResId::invalid(), @@ -19138,30 +19227,30 @@ fn patch_elite_research_door_lock<'r>( xray_cskr: ResId::invalid(), thermal_cmdl: ResId::invalid(), thermal_cskr: ResId::invalid(), - unknown0: 1, - unknown1: 1.0, - unknown2: 1.0, + use_global_render_time: 1, + fade_in_time: 1.0, + fade_out_time: 1.0, visor_params: structs::scly_structs::VisorParameters { unknown0: 0, target_passthrough: 1, visor_mask: 15, // Visor Flags : Combat|Scan|Thermal|XRay }, - enable_thermal_heat: 0, - unknown3: 0, - unknown4: 0, - unknown5: 1.0, + thermal_hot: 0, + force_render_unsorted: 0, + no_sort_thermal: 0, + thermal_damage_mag: 1.0, }, - looping: 1, - snow: 1, // immovable - solid: 1, - camera_passthrough: 0, + is_loop: 1, + immovable: 1, + is_solid: 1, + is_camera_through: 0, active: 0, - unknown8: 0, - unknown9: 1.0, - unknown10: 0, - unknown11: 0, - unknown12: 0, - unknown13: 0, + render_texture_set: 0, + xray_alpha: 1.0, + thermal_visible_through_geometry: 0, + draws_shadow: 0, + scale_animation: 0, + material_flag_54: 0, })), }; diff --git a/src/pickup_meta.rs b/src/pickup_meta.rs index 27046717..b20825f3 100644 --- a/src/pickup_meta.rs +++ b/src/pickup_meta.rs @@ -427,7 +427,7 @@ impl PickupModel { pickup.scale[1] = 0.475; pickup.scale[2] = 0.475; } else if self.name() == PickupModel::PowerBomb.name() { - pickup.actor_params.enable_thermal_heat = 1; + pickup.actor_params.thermal_hot = 1; } else if self.name() == PickupModel::Cog.name() { pickup.scale[0] = 0.7; pickup.scale[1] = 0.7; diff --git a/structs/src/scly_props/actor.rs b/structs/src/scly_props/actor.rs index 9bc2f2d9..538b394c 100644 --- a/structs/src/scly_props/actor.rs +++ b/structs/src/scly_props/actor.rs @@ -18,11 +18,11 @@ pub struct Actor<'r> { pub position: GenericArray, pub rotation: GenericArray, pub scale: GenericArray, - pub hitbox: GenericArray, - pub scan_offset: GenericArray, + pub collision_box: GenericArray, + pub collision_offset: GenericArray, - pub unknown1: f32, - pub unknown2: f32, + pub mass: f32, + pub momentum: f32, pub health_info: HealthInfo, pub damage_vulnerability: DamageVulnerability, @@ -31,17 +31,17 @@ pub struct Actor<'r> { pub ancs: AncsProp, pub actor_params: ActorParameters, - pub looping: u8, - pub snow: u8, - pub solid: u8, - pub camera_passthrough: u8, + pub is_loop: u8, + pub immovable : u8, + pub is_solid: u8, + pub is_camera_through: u8, pub active: u8, - pub unknown8: u32, - pub unknown9: f32, - pub unknown10: u8, - pub unknown11: u8, - pub unknown12: u8, - pub unknown13: u8, + pub render_texture_set: u32, + pub xray_alpha: f32, + pub thermal_visible_through_geometry: u8, + pub draws_shadow: u8, + pub scale_animation: u8, + pub material_flag_54: u8, } use crate::{impl_position, impl_rotation, impl_scale}; diff --git a/structs/src/scly_props/structs.rs b/structs/src/scly_props/structs.rs index 843d2353..57d8ef2a 100644 --- a/structs/src/scly_props/structs.rs +++ b/structs/src/scly_props/structs.rs @@ -27,16 +27,16 @@ pub struct ActorParameters { pub thermal_cmdl: ResId, pub thermal_cskr: ResId, - pub unknown0: u8, - pub unknown1: f32, - pub unknown2: f32, + pub use_global_render_time: u8, + pub fade_in_time: f32, + pub fade_out_time: f32, pub visor_params: VisorParameters, - pub enable_thermal_heat: u8, - pub unknown3: u8, - pub unknown4: u8, - pub unknown5: f32, + pub thermal_hot: u8, + pub force_render_unsorted: u8, + pub no_sort_thermal: u8, + pub thermal_damage_mag: f32, } #[auto_struct(Readable, Writable, FixedSize)] @@ -61,20 +61,20 @@ pub struct LightParameters { #[auto_struct(expect = 14)] prop_count: u32, - pub unknown0: u8, - pub unknown1: f32, + pub cast_shadow: u8, + pub shadow_scale: f32, pub shadow_tessellation: u32, - pub unknown2: f32, - pub unknown3: f32, - pub color: GenericArray, // RGBA - pub unknown4: u8, - pub world_lighting: u32, + pub shadow_alpha: f32, + pub max_shadow_light: f32, + pub color: GenericArray, + pub make_lights: u8, + pub use_world_lighting: u32, pub light_recalculation: u32, - pub unknown5: GenericArray, - pub unknown6: u32, - pub unknown7: u32, - pub unknown8: u8, - pub light_layer_id: u32, + pub lightning_position: GenericArray, + pub num_dynamic_lights: u32, + pub num_area_lights: u32, + pub ignore_ambient_lightning: u8, + pub use_light_set: u32, } #[auto_struct(Readable, Writable, FixedSize)]