mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Made explosions bonk sprites
This commit is contained in:
parent
edf9c59e7d
commit
026a4a07bb
@ -526,7 +526,8 @@ pub fn handle_explosion(server: &Server, pos: Vec3<f32>, explosion: Explosion, o
|
||||
});
|
||||
|
||||
let explosion_volume = 2.5 * explosion.radius;
|
||||
server_eventbus.emit_now(ServerEvent::Sound {
|
||||
let mut emitter = server_eventbus.emitter();
|
||||
emitter.emit(ServerEvent::Sound {
|
||||
sound: Sound::new(SoundKind::Explosion, pos, explosion_volume, time.0),
|
||||
});
|
||||
|
||||
@ -659,6 +660,14 @@ pub fn handle_explosion(server: &Server, pos: Vec3<f32>, explosion: Explosion, o
|
||||
block_change.set(block_pos, Block::new(block.kind(), color));
|
||||
}
|
||||
}
|
||||
|
||||
if block.is_bonkable() {
|
||||
emitter.emit(ServerEvent::Bonk {
|
||||
pos: block_pos.map(|e| e as f32 + 0.5),
|
||||
owner,
|
||||
target: None,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -804,7 +813,7 @@ pub fn handle_explosion(server: &Server, pos: Vec3<f32>, explosion: Explosion, o
|
||||
attack_options,
|
||||
strength,
|
||||
combat::AttackSource::Explosion,
|
||||
|e| server_eventbus.emit_now(e),
|
||||
|e| emitter.emit(e),
|
||||
|o| outcomes.push(o),
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user