Skip to content

Commit

Permalink
add character resource slots to reported data
Browse files Browse the repository at this point in the history
  • Loading branch information
super-continent committed Nov 25, 2024
1 parent 0da3156 commit aabb202
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/game/offset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ offset_struct! {
tension_pulse @ 0x2D128: i32,
tension_meter @ 0x2D134: u32,
risc_meter @ 0x24E30: i32,
resource_1 @ 0x24CCC: i32,
resource_2 @ 0x24CF0: i32,
resource_3 @ 0x24D14: i32,
resource_4 @ 0x24D5C: i32,
}
}

Expand Down
19 changes: 19 additions & 0 deletions src/sammi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ pub struct PlayerState {
combo_counter: u32,
x_position: i32,
y_position: i32,
character_resource_1: i32,
character_resource_2: i32,
character_resource_3: i32,
character_resource_4: i32,
}

impl PlayerState {
Expand All @@ -286,6 +290,10 @@ impl PlayerState {
combo_counter: 0,
x_position: 0,
y_position: 0,
character_resource_1: 0,
character_resource_2: 0,
character_resource_3: 0,
character_resource_4: 0,
}
}
}
Expand Down Expand Up @@ -511,6 +519,17 @@ pub unsafe fn game_loop_hook_sammi() {
new_state.player_1.y_position = gamestate.player_1().y_position();
new_state.player_2.y_position = gamestate.player_2().y_position();

log::trace!("resource slots");
new_state.player_1.character_resource_1 = gamestate.player_1().resource_1();
new_state.player_1.character_resource_2 = gamestate.player_1().resource_2();
new_state.player_1.character_resource_3 = gamestate.player_1().resource_3();
new_state.player_1.character_resource_4 = gamestate.player_1().resource_4();

new_state.player_2.character_resource_1 = gamestate.player_2().resource_1();
new_state.player_2.character_resource_2 = gamestate.player_2().resource_2();
new_state.player_2.character_resource_3 = gamestate.player_2().resource_3();
new_state.player_2.character_resource_4 = gamestate.player_2().resource_4();

log::trace!("steam player info");
let online_info = *(ONLINE_MATCH_INFO.get_address() as *mut *mut u8);

Expand Down

0 comments on commit aabb202

Please sign in to comment.