1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2024-11-22 05:33:02 +00:00

even more rust

sprites by @RedCoder09 and @Krunchy0920
This commit is contained in:
Sallai József 2022-08-20 22:08:15 +03:00
parent e07207b40c
commit 59da01b7b9
13 changed files with 125 additions and 10 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 943 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View file

@ -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(

View file

@ -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,

View file

@ -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),

View file

@ -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)?;
}