Skip to content

Commit

Permalink
Fixed bridge spans not updating properly, as well as incorrect wood b…
Browse files Browse the repository at this point in the history
…ridge graphics.
  • Loading branch information
Espyo committed Jan 5, 2025
1 parent 4100a84 commit d278e35
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 39 deletions.
53 changes: 27 additions & 26 deletions game_data/base/mob_types/bridges/wood_bridge/animations.txt
Original file line number Diff line number Diff line change
@@ -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
}
}
}
Expand All @@ -80,4 +82,3 @@ body_parts{
left
right
}
engine_version=0.23.2
1 change: 0 additions & 1 deletion source/documents/todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 10 additions & 12 deletions source/source/mobs/mob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand All @@ -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;
}
Expand All @@ -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;
Expand Down Expand Up @@ -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();
}

Expand Down

0 comments on commit d278e35

Please sign in to comment.