Everything damage

This commit is contained in:
Joshua Barretto 2023-05-24 21:33:40 +01:00
parent 8a8a5526f1
commit 6a2796dc17
4 changed files with 10 additions and 10 deletions

BIN
assets/common/voxel/carriage/structure.vox (Stored with Git LFS)

Binary file not shown.

View File

@ -146,7 +146,7 @@ impl Body {
quadruped_low::Species::Deadwood => 140.0,
quadruped_low::Species::Mossdrake => 100.0,
},
Body::Ship(ship::Body::Carriage) => 250.0,
Body::Ship(ship::Body::Carriage) => 350.0,
Body::Ship(_) => 0.0,
Body::Arthropod(arthropod) => match arthropod.species {
arthropod::Species::Tarantula => 135.0,

View File

@ -1593,14 +1593,14 @@ fn box_voxel_collision<T: BaseVol<Vox = Block> + ReadVol>(
/* if resolve_dir.z > 0.0 && vel.0.z <= 0.0 { */
if resolve_dir.z > 0.0 {
on_ground = Some(block);
if !was_on_ground {
land_on_ground(entity, *vel);
}
} else if resolve_dir.z < 0.0 && vel.0.z >= 0.0 {
on_ceiling = true;
}
if resolve_dir.magnitude_squared() > 0.0 {
land_on_ground(entity, *vel);
}
// When the resolution direction is non-vertical, we must be colliding
// with a wall
//

View File

@ -602,7 +602,7 @@ pub fn handle_land_on_ground(server: &Server, entity: EcsEntity, vel: Vec3<f32>)
// water. This was added as a *temporary* fix a bug that causes you to take
// fall damage while swimming downwards. FIXME: Fix the actual bug and
// remove the following relevant part of the if statement.
if vel.z <= -30.0
if vel.magnitude() >= 30.0
&& ecs
.read_storage::<PhysicsState>()
.get(entity)
@ -611,9 +611,9 @@ pub fn handle_land_on_ground(server: &Server, entity: EcsEntity, vel: Vec3<f32>)
let char_states = ecs.read_storage::<CharacterState>();
let reduced_vel_z = if let Some(CharacterState::DiveMelee(c)) = char_states.get(entity) {
(vel.z + c.static_data.vertical_speed).min(0.0)
(vel.magnitude() + c.static_data.vertical_speed).min(0.0)
} else {
vel.z
vel.magnitude()
};
let mass = ecs