diff --git a/src/builtin/builtin_data/crab_band.png b/src/builtin/builtin_data/crab_band.png deleted file mode 100644 index 2834ea2..0000000 Binary files a/src/builtin/builtin_data/crab_band.png and /dev/null differ diff --git a/src/builtin/builtin_data/headband/ogph/Casts.png b/src/builtin/builtin_data/headband/ogph/Casts.png new file mode 100644 index 0000000..78a05fc Binary files /dev/null and b/src/builtin/builtin_data/headband/ogph/Casts.png differ diff --git a/src/builtin/builtin_data/headband/ogph/Npc/NpcGuest.png b/src/builtin/builtin_data/headband/ogph/Npc/NpcGuest.png new file mode 100644 index 0000000..c3473d0 Binary files /dev/null and b/src/builtin/builtin_data/headband/ogph/Npc/NpcGuest.png differ diff --git a/src/builtin/builtin_data/headband/ogph/Npc/NpcMiza.png b/src/builtin/builtin_data/headband/ogph/Npc/NpcMiza.png new file mode 100644 index 0000000..98d1353 Binary files /dev/null and b/src/builtin/builtin_data/headband/ogph/Npc/NpcMiza.png differ diff --git a/src/builtin/builtin_data/headband/ogph/Npc/NpcRegu.png b/src/builtin/builtin_data/headband/ogph/Npc/NpcRegu.png new file mode 100644 index 0000000..c1e9d36 Binary files /dev/null and b/src/builtin/builtin_data/headband/ogph/Npc/NpcRegu.png differ diff --git a/src/builtin/builtin_data/headband/plus/casts.png b/src/builtin/builtin_data/headband/plus/casts.png new file mode 100644 index 0000000..bd408c7 Binary files /dev/null and b/src/builtin/builtin_data/headband/plus/casts.png differ diff --git a/src/builtin/builtin_data/headband/plus/npc/npcguest.png b/src/builtin/builtin_data/headband/plus/npc/npcguest.png new file mode 100644 index 0000000..54d3a1e Binary files /dev/null and b/src/builtin/builtin_data/headband/plus/npc/npcguest.png differ diff --git a/src/builtin/builtin_data/headband/plus/npc/npcmiza.png b/src/builtin/builtin_data/headband/plus/npc/npcmiza.png new file mode 100644 index 0000000..e86b69e Binary files /dev/null and b/src/builtin/builtin_data/headband/plus/npc/npcmiza.png differ diff --git a/src/builtin/builtin_data/headband/plus/npc/npcregu.png b/src/builtin/builtin_data/headband/plus/npc/npcregu.png new file mode 100644 index 0000000..6897b3c Binary files /dev/null and b/src/builtin/builtin_data/headband/plus/npc/npcregu.png differ diff --git a/src/builtin_fs.rs b/src/builtin_fs.rs index 90b5ff5..b19f239 100644 --- a/src/builtin_fs.rs +++ b/src/builtin_fs.rs @@ -111,8 +111,76 @@ impl BuiltinFS { "builtin_data", vec![ FSNode::File("buttons.png", include_bytes!("builtin/builtin_data/buttons.png")), - FSNode::File("crab_band.png", include_bytes!("builtin/builtin_data/crab_band.png")), FSNode::File("triangles.png", include_bytes!("builtin/builtin_data/triangles.png")), + FSNode::Directory( + "headband", + vec![ + FSNode::Directory( + "ogph", + vec![ + FSNode::File( + "Casts.png", + include_bytes!("builtin/builtin_data/headband/ogph/Casts.png"), + ), + FSNode::Directory( + "Npc", + vec![ + FSNode::File( + "NpcGuest.png", + include_bytes!( + "builtin/builtin_data/headband/ogph/Npc/NpcGuest.png" + ), + ), + FSNode::File( + "NpcMiza.png", + include_bytes!( + "builtin/builtin_data/headband/ogph/Npc/NpcMiza.png" + ), + ), + FSNode::File( + "NpcRegu.png", + include_bytes!( + "builtin/builtin_data/headband/ogph/Npc/NpcRegu.png" + ), + ), + ], + ), + ], + ), + FSNode::Directory( + "plus", + vec![ + FSNode::File( + "Casts.png", + include_bytes!("builtin/builtin_data/headband/plus/casts.png"), + ), + FSNode::Directory( + "Npc", + vec![ + FSNode::File( + "NpcGuest.png", + include_bytes!( + "builtin/builtin_data/headband/plus/npc/npcguest.png" + ), + ), + FSNode::File( + "NpcMiza.png", + include_bytes!( + "builtin/builtin_data/headband/plus/npc/npcmiza.png" + ), + ), + FSNode::File( + "NpcRegu.png", + include_bytes!( + "builtin/builtin_data/headband/plus/npc/npcregu.png" + ), + ), + ], + ), + ], + ), + ], + ), ], ), FSNode::Directory( diff --git a/src/components/credits.rs b/src/components/credits.rs index 6c05c3f..f7e65ff 100644 --- a/src/components/credits.rs +++ b/src/components/credits.rs @@ -65,13 +65,48 @@ impl GameEntity<()> for Credits { let y = ((line.cast_id / 13) & 0xff) * 24; let rect = Rect::new_size(x, y, 24, 24); - batch.add_rect(line.pos_x - 24.0, line.pos_y - 8.0, &rect); + if state.more_rust && line.cast_id == 1 { + // sue with more rust + batch.add_rect_tinted(line.pos_x - 24.0, line.pos_y - 8.0, (200, 200, 255, 255), &rect); + } else { + batch.add_rect(line.pos_x - 24.0, line.pos_y - 8.0, &rect); + } } batch.draw(ctx)?; + if state.more_rust { + // draw sue's headband separately because rust doesn't let me mutate the texture set multiple times at once + + let headband_spritesheet = { + let base = if state.settings.original_textures { "ogph" } else { "plus" }; + format!("headband/{}/Casts", base) + }; + + let batch = state.texture_set.get_or_load_batch(ctx, &state.constants, headband_spritesheet.as_str())?; + + for line in &state.creditscript_vm.lines { + if line.cast_id != 1 { + continue; + } + + let x = (line.cast_id % 13) * 24; + let y = ((line.cast_id / 13) & 0xff) * 24; + let rect = Rect::new_size(x, y, 24, 24); + + batch.add_rect(line.pos_x - 24.0, line.pos_y - 8.0, &rect); + + break; + } + + batch.draw(ctx)?; + } + for line in &state.creditscript_vm.lines { + let text = + if state.more_rust { line.text.replace("Sue Sakamoto", "Crabby Sue") } else { line.text.clone() }; + state.font.draw_text_with_shadow( - line.text.chars(), + text.chars(), line.pos_x, line.pos_y, &state.constants, diff --git a/src/engine_constants/mod.rs b/src/engine_constants/mod.rs index fb83a16..1707748 100644 --- a/src/engine_constants/mod.rs +++ b/src/engine_constants/mod.rs @@ -1424,6 +1424,14 @@ impl EngineConstants { "Face4" => (288, 240), // switch "Face5" => (288, 240), // switch "Fade" => (256, 32), + "headband/ogph/Casts" => (320, 240), + "headband/ogph/Npc/NpcGuest" => (320, 184), + "headband/ogph/Npc/NpcMiza" => (320, 240), + "headband/ogph/Npc/NpcRegu" => (320, 240), + "headband/plus/Casts" => (320, 240), + "headband/plus/Npc/NpcGuest" => (320, 184), + "headband/plus/Npc/NpcMiza" => (320, 240), + "headband/plus/Npc/NpcRegu" => (320, 240), "ItemImage" => (256, 128), "Loading" => (64, 8), "MyChar" => (200, 64), diff --git a/src/npc/mod.rs b/src/npc/mod.rs index 90da326..8cb7839 100644 --- a/src/npc/mod.rs +++ b/src/npc/mod.rs @@ -222,6 +222,11 @@ impl NPC { fn is_sue(&self) -> bool { [42, 92, 280, 284].contains(&self.npc_type) } + + fn get_headband_spritesheet(&self, state: &SharedGameState, texture_name: &str) -> String { + let base_dir = if state.settings.original_textures { "ogph" } else { "plus" }; + format!("headband/{}/{}", base_dir, texture_name) + } } impl GameEntity<([&mut Player; 2], &NPCList, &mut Stage, &mut BulletManager, &mut Flash, &mut BossNPC)> for NPC { @@ -650,11 +655,9 @@ impl GameEntity<([&mut Player; 2], &NPCList, &mut Stage, &mut BulletManager, &mu return Ok(()); } - let batch = state.texture_set.get_or_load_batch( - ctx, - &state.constants, - &*state.npc_table.get_texture_ref(self.spritesheet_id), - )?; + let texture_ref = state.npc_table.get_texture_ref(self.spritesheet_id); + + let batch = state.texture_set.get_or_load_batch(ctx, &state.constants, &*texture_ref)?; let off_x = if self.direction == Direction::Left { self.display_bounds.left } else { self.display_bounds.right } as i32; @@ -678,9 +681,10 @@ impl GameEntity<([&mut Player; 2], &NPCList, &mut Stage, &mut BulletManager, &mu batch.draw(ctx)?; } - if self.npc_type == 42 && state.more_rust { + if self.is_sue() && state.more_rust { // draw crab headband - let batch = state.texture_set.get_or_load_batch(ctx, &state.constants, "crab_band")?; + let headband_spritesheet = self.get_headband_spritesheet(state, &*texture_ref); + let batch = state.texture_set.get_or_load_batch(ctx, &state.constants, headband_spritesheet.as_str())?; batch.add_rect(final_x, final_y, &self.anim_rect); batch.draw(ctx)?; }