From d278e3556a00193abfbca8eb974f1c2849eba2fc Mon Sep 17 00:00:00 2001 From: Espyo Date: Sun, 5 Jan 2025 13:47:18 +0000 Subject: [PATCH] Fixed bridge spans not updating properly, as well as incorrect wood bridge graphics. --- .../bridges/wood_bridge/animations.txt | 53 ++++++++++--------- source/documents/todo.txt | 1 - source/source/mobs/mob.cpp | 22 ++++---- 3 files changed, 37 insertions(+), 39 deletions(-) diff --git a/game_data/base/mob_types/bridges/wood_bridge/animations.txt b/game_data/base/mob_types/bridges/wood_bridge/animations.txt index ab652f122..e367da1b5 100644 --- a/game_data/base/mob_types/bridges/wood_bridge/animations.txt +++ b/game_data/base/mob_types/bridges/wood_bridge/animations.txt @@ -1,76 +1,78 @@ +name=animations +engine_version=0.25.0 animations{ - idling{ + destroyed{ frames{ - idling{ + destroyed{ duration=0.0000 } } } - destroyed{ + idling{ frames{ - destroyed{ + idling{ duration=0.0000 } } } } sprites{ - idling{ - file=textures/wood_bridge + destroyed{ + file=wood_bridge file_pos=0.0000 0.0000 - file_size=42.0000 192.0000 + file_size=0.0000 0.0000 hitboxes{ center{ coords=0.0000 0.0000 0.0000 - height=64.0000 + height=128.0000 radius=32.0000 - type=0 + type=2 value=1.0000 - can_pikmin_latch=true } left{ coords=0.0000 -60.0000 0.0000 - height=64.0000 + height=128.0000 radius=32.0000 - type=0 + type=2 value=1.0000 - can_pikmin_latch=true } right{ coords=0.0000 60.0000 0.0000 - height=64.0000 + height=128.0000 radius=32.0000 - type=0 + type=2 value=1.0000 - can_pikmin_latch=true } } } - destroyed{ - file=textures/wood_bridge + idling{ + file=wood_bridge file_pos=0.0000 0.0000 - file_size=0.0000 0.0000 + file_size=42.0000 192.0000 hitboxes{ center{ coords=0.0000 0.0000 0.0000 - height=128.0000 + height=64.0000 radius=32.0000 - type=2 + type=0 value=1.0000 + can_pikmin_latch=true } left{ coords=0.0000 -60.0000 0.0000 - height=128.0000 + height=64.0000 radius=32.0000 - type=2 + type=0 value=1.0000 + can_pikmin_latch=true } right{ coords=0.0000 60.0000 0.0000 - height=128.0000 + height=64.0000 radius=32.0000 - type=2 + type=0 value=1.0000 + can_pikmin_latch=true } } } @@ -80,4 +82,3 @@ body_parts{ left right } -engine_version=0.23.2 diff --git a/source/documents/todo.txt b/source/documents/todo.txt index 5b314b020..9e8410eaf 100644 --- a/source/documents/todo.txt +++ b/source/documents/todo.txt @@ -11,7 +11,6 @@ Current tasks (tasks being worked on, but not yet committed) Next tasks (roughly sorted most important first) --- To fix --- Bomb rocks shouldn't do their normal explosion particles if they explode inside a mob - The wood bridge mob's size is all wrong Hitting Home in the animation editor isn't centering properly (at least not with Blue Pikmin it wasn't) If you're on an elevator platform, you won't be able to throw Winged Pikmin This is because the check if there's a clear line notices the leader is standing on a different mob from the Winged Pikmin diff --git a/source/source/mobs/mob.cpp b/source/source/mobs/mob.cpp index 9e44bf632..7c3d4f821 100644 --- a/source/source/mobs/mob.cpp +++ b/source/source/mobs/mob.cpp @@ -2167,7 +2167,7 @@ void mob::get_sprite_bitmap_effects( fade_edges[1].push_back(e_ptr); } } - + dist closest_dist[2] = {dist(FLT_MAX), dist(FLT_MAX)}; for(size_t n = 0; n < 2; n++) { for(size_t e = 0; e < fade_edges[n].size(); e++) { @@ -2183,7 +2183,7 @@ void mob::get_sprite_bitmap_effects( point v2_to_v1 = v2 - v1; closest_pos -= v2_to_v1 * (segment_ratio - 1); } - + dist d = dist(closest_pos, pos); closest_dist[n] = closest_dist[n] <= d ? closest_dist[n] : d; } @@ -2192,8 +2192,8 @@ void mob::get_sprite_bitmap_effects( total_brightness += texture_sector[0]->brightness * (closest_dist[1].to_float() / (closest_dist[0].to_float() + closest_dist[1].to_float())); brightness = total_brightness / 255.0; } - - + + info->tint_color.r *= brightness; info->tint_color.g *= brightness; info->tint_color.b *= brightness; @@ -3101,14 +3101,12 @@ void mob::set_radius(float radius) { */ void mob::set_rectangular_dim(const point &rectangular_dim) { this->rectangular_dim = rectangular_dim; - if(type->anim_db) { - physical_span = - calculate_mob_physical_span( - radius, - type->anim_db->hitbox_span, - rectangular_dim - ); - } + physical_span = + calculate_mob_physical_span( + radius, + type->anim_db ? type->anim_db->hitbox_span : 0.0f, + rectangular_dim + ); update_interaction_span(); }