Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
toasterparty committed Feb 28, 2024
1 parent 3e61b82 commit 7b125e4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
20 changes: 11 additions & 9 deletions src/add_modify_obj_patches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -929,20 +929,22 @@ pub fn patch_add_bomb_slot<'r>(
} as usize;

let deps = vec![
(0x82A1E868, b"CMDL"),
(0xD64787E8, b"TXTR"),
(0x53A74797, b"CMDL"),
// platform
(0x3852C9CF, b"CMDL"),
(0x5B4D184E, b"TXTR"),
(0x563799A1, b"TXTR"),
(0xC11B62AF, b"DCLN"),
(0x89CC3758, b"DCLN"),

// glow actor
(0xA88267E6, b"CMDL"),
(0xD64787E8, b"TXTR"),
];
let deps_iter = deps.iter()
.map(|&(file_id, fourcc)| structs::Dependency {
asset_id: file_id,
asset_type: FourCC::from_bytes(fourcc),
}
);
area.add_dependencies(game_resources, 0, deps_iter);
area.add_dependencies(game_resources, layer, deps_iter);

let bomb_slot_id = config.platform_id.unwrap_or(area.new_object_id_from_layer_id(layer));
let glow_ring_id = config.actor_id.unwrap_or(area.new_object_id_from_layer_id(layer));
Expand Down Expand Up @@ -973,7 +975,7 @@ pub fn patch_add_bomb_slot<'r>(
extent: [0.0, 0.0, 0.0].into(),
scan_offset: [0.0, 0.0, 0.0].into(),

cmdl: ResId::<res_id::CMDL>::new(0x3F802F32),
cmdl: ResId::<res_id::CMDL>::new(0x3852C9CF),

ancs: structs::scly_structs::AncsProp {
file_id: ResId::invalid(),
Expand Down Expand Up @@ -1023,7 +1025,7 @@ pub fn patch_add_bomb_slot<'r>(
speed: 1.0,
active: 1,

dcln: ResId::<res_id::DCLN>::new(0xC11B62AF),
dcln: ResId::<res_id::DCLN>::new(0x89CC3758),

health_info: structs::scly_structs::HealthInfo {
health: 1.0,
Expand Down Expand Up @@ -1055,7 +1057,7 @@ pub fn patch_add_bomb_slot<'r>(
knockback_resistance: 1.0
},
damage_vulnerability: DoorType::Disabled.vulnerability(),
cmdl: ResId::<res_id::CMDL>::new(0x9BC5E7C6),
cmdl: ResId::<res_id::CMDL>::new(0xA88267E6),
ancs: structs::scly_structs::AncsProp {
file_id: ResId::invalid(), // None
node_index: 0,
Expand Down
3 changes: 3 additions & 0 deletions src/custom_assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,9 @@ pub fn collect_game_resources<'r>(
(0x5B4D184E, FourCC::from_bytes(b"TXTR")),
(0x563799A1, FourCC::from_bytes(b"TXTR")),
(0xC11B62AF, FourCC::from_bytes(b"DCLN")),
(0x3852C9CF, FourCC::from_bytes(b"CMDL")),
(0x89CC3758, FourCC::from_bytes(b"DCLN")),
(0xA88267E6, FourCC::from_bytes(b"CMDL")),
];
looking_for.extend(bomb_slot_deps);

Expand Down
17 changes: 16 additions & 1 deletion src/generic_edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ pub fn patch_edit_objects<'r>
water.alpha_in_time *= value;
water.alpha_out_time *= value;
},
structs::Thardus::OBJECT_TYPE => {
let thardus = obj.property_data.as_thardus_mut().unwrap();
thardus.values[0] *= value;
},
_ => {},
}

Expand Down Expand Up @@ -193,7 +197,18 @@ pub fn patch_edit_objects<'r>
}

if let Some(value) = config.health {
set_health(obj, value, None);
match obj.property_data.object_type() {
structs::Thardus::OBJECT_TYPE => {
let thardus = obj.property_data.as_thardus_mut().unwrap();
thardus.values[3] *= value;
thardus.values[4] *= value;
},
_ => {},
}

if obj.property_data.supports_health_infos() {
set_health(obj, value, None);
}
}

if let Some(values) = &config.healths {
Expand Down

0 comments on commit 7b125e4

Please sign in to comment.