street lamp particles, ground fire bowl, misc fixes

This commit is contained in:
Monty Marz 2020-11-22 16:32:18 +01:00 committed by Joshua Barretto
parent 8885efd702
commit d069eb9a57
11 changed files with 52 additions and 10 deletions

View File

@ -54,6 +54,7 @@ const int HEALING_BEAM = 13;
const int ENERGY_NATURE = 14; const int ENERGY_NATURE = 14;
const int FLAMETHROWER = 15; const int FLAMETHROWER = 15;
const int FIRE_SHOCKWAVE = 16; const int FIRE_SHOCKWAVE = 16;
const int FIRE_BOWL = 17;
// meters per second squared (acceleration) // meters per second squared (acceleration)
const float earth_gravity = 9.807; const float earth_gravity = 9.807;
@ -163,6 +164,17 @@ void main() {
vec4(2, 1.5 + rand5 * 0.5, 0, start_end(1.0, 0.0)), vec4(2, 1.5 + rand5 * 0.5, 0, start_end(1.0, 0.0)),
spin_in_axis(vec3(rand6, rand7, rand8), rand9 * 3) spin_in_axis(vec3(rand6, rand7, rand8), rand9 * 3)
); );
} else if (inst_mode == FIRE_BOWL) {
f_reflect = 0.0; // Fire doesn't reflect light, it emits it
attr = Attr(
linear_motion(
vec3(normalize(vec2(rand0, rand1)) * 0.1, 0.6),
vec3(rand2 * 0.2, rand3 * 0.5, 0.8 + rand4 * 0.5)
),
vec3(0.2), // Size
vec4(2, 1.5 + rand5 * 0.5, 0, start_end(1.0, 0.0)), // Colour
spin_in_axis(vec3(rand6, rand7, rand8), rand9 * 3)
);
} else if (inst_mode == GUN_POWDER_SPARK) { } else if (inst_mode == GUN_POWDER_SPARK) {
attr = Attr( attr = Attr(
linear_motion( linear_motion(

BIN
assets/voxygen/voxel/sprite/misc/lantern_ground_open.vox (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

View File

@ -2005,6 +2005,17 @@ PotionMinor: Some((
], ],
wind_sway: 0.0, wind_sway: 0.0,
)), )),
// Ground Fire Bowls
FireBowlGround: Some((
variations: [
(
model: "voxygen.voxel.sprite.misc.lantern_ground_open",
offset: (-3.5, -3.5, 0.0),
lod_axes: (1.0, 1.0, 1.0),
),
],
wind_sway: 0.0,
)),
// Underwater Grass // Underwater Grass
GrassBlue: Some(( GrassBlue: Some((
variations: [ variations: [

View File

@ -147,7 +147,7 @@
plot_dirt: (90, 70, 50), plot_dirt: (90, 70, 50),
plot_grass: (100, 200, 0), plot_grass: (100, 200, 0),
plot_water: (100, 150, 250), plot_water: (100, 150, 250),
plot_town: (150, 110, 60), plot_town: (90, 70, 50),
// TODO: Add field furrow stuff. // TODO: Add field furrow stuff.
), ),
), ),

View File

@ -404,9 +404,7 @@ impl LoadoutBuilder {
back: None, back: None,
ring: None, ring: None,
neck: None, neck: None,
lantern: Some(Item::new_from_asset_expect( lantern: None,
"common.items.lantern.black_0",
)),
glider: None, glider: None,
head: None, head: None,
tabard: None, tabard: None,

View File

@ -107,6 +107,7 @@ make_case_elim!(
GrassBlue = 0x51, GrassBlue = 0x51,
ChestBurried = 0x52, ChestBurried = 0x52,
Mud = 0x53, Mud = 0x53,
FireBowlGround = 0x54,
} }
); );
@ -125,6 +126,7 @@ impl SpriteKind {
SpriteKind::StreetLamp => 2.65, SpriteKind::StreetLamp => 2.65,
SpriteKind::Carrot => 0.18, SpriteKind::Carrot => 0.18,
SpriteKind::Radish => 0.18, SpriteKind::Radish => 0.18,
SpriteKind::FireBowlGround => 0.55,
// TODO: Uncomment this when we have a way to open doors // TODO: Uncomment this when we have a way to open doors
// SpriteKind::Door => 3.0, // SpriteKind::Door => 3.0,
SpriteKind::Bed => 1.54, SpriteKind::Bed => 1.54,
@ -234,6 +236,7 @@ impl SpriteKind {
| SpriteKind::Beehive | SpriteKind::Beehive
| SpriteKind::PotionMinor | SpriteKind::PotionMinor
| SpriteKind::VialEmpty | SpriteKind::VialEmpty
| SpriteKind::FireBowlGround
) )
} }
} }

View File

@ -369,11 +369,11 @@ impl<'a> Widget for MiniMap<'a> {
let name_len = chunk.meta().name().chars().count(); let name_len = chunk.meta().name().chars().count();
Text::new(chunk.meta().name()) Text::new(chunk.meta().name())
.mid_top_with_margin_on(state.ids.mmap_frame, match name_len { .mid_top_with_margin_on(state.ids.mmap_frame, match name_len {
16..=30 => 4.0, 15..=30 => 4.0,
_ => 2.0, _ => 2.0,
}) })
.font_size(self.fonts.cyri.scale(match name_len { .font_size(self.fonts.cyri.scale(match name_len {
0..=16 => 18, 0..=15 => 18,
16..=30 => 14, 16..=30 => 14,
_ => 14, _ => 14,
})) }))

View File

@ -113,6 +113,7 @@ pub enum ParticleMode {
EnergyNature = 14, EnergyNature = 14,
FlameThrower = 15, FlameThrower = 15,
FireShockwave = 16, FireShockwave = 16,
FireBowl = 17,
} }
impl ParticleMode { impl ParticleMode {

View File

@ -484,6 +484,14 @@ impl ParticleMgr {
mode: ParticleMode::CampfireFire, mode: ParticleMode::CampfireFire,
cond: |_| true, cond: |_| true,
}, },
BlockParticles {
blocks: |boi| &boi.fire_bowls,
range: 2,
rate: 20.0,
lifetime: 0.25,
mode: ParticleMode::FireBowl,
cond: |_| true,
},
BlockParticles { BlockParticles {
blocks: |boi| &boi.smokers, blocks: |boi| &boi.smokers,
range: 8, range: 8,

View File

@ -15,12 +15,15 @@ pub struct BlocksOfInterest {
pub beehives: Vec<Vec3<i32>>, pub beehives: Vec<Vec3<i32>>,
pub reeds: Vec<Vec3<i32>>, pub reeds: Vec<Vec3<i32>>,
pub flowers: Vec<Vec3<i32>>, pub flowers: Vec<Vec3<i32>>,
pub fire_bowls: Vec<Vec3<i32>>,
// Note: these are only needed for chunks within the iteraction range so this is a potential // Note: these are only needed for chunks within the iteraction range so this is a potential
// area for optimization // area for optimization
pub interactables: Vec<Vec3<i32>>, pub interactables: Vec<Vec3<i32>>,
pub lights: Vec<(Vec3<i32>, u8)>, pub lights: Vec<(Vec3<i32>, u8)>,
} }
use inline_tweak::*;
impl BlocksOfInterest { impl BlocksOfInterest {
pub fn from_chunk(chunk: &TerrainChunk) -> Self { pub fn from_chunk(chunk: &TerrainChunk) -> Self {
span!(_guard, "from_chunk", "BlocksOfInterest::from_chunk"); span!(_guard, "from_chunk", "BlocksOfInterest::from_chunk");
@ -34,6 +37,7 @@ impl BlocksOfInterest {
let mut flowers = Vec::new(); let mut flowers = Vec::new();
let mut interactables = Vec::new(); let mut interactables = Vec::new();
let mut lights = Vec::new(); let mut lights = Vec::new();
let mut fire_bowls = Vec::new();
chunk chunk
.vol_iter( .vol_iter(
@ -68,8 +72,9 @@ impl BlocksOfInterest {
}, },
// Offset positions to account for block height. // Offset positions to account for block height.
// TODO: Is this a good idea? // TODO: Is this a good idea?
Some(SpriteKind::StreetLamp) => fires.push(pos + Vec3::unit_z() * 3), Some(SpriteKind::StreetLamp) => fire_bowls.push(pos + Vec3::unit_z() * 2),
Some(SpriteKind::StreetLampTall) => fires.push(pos + Vec3::unit_z() * 4), Some(SpriteKind::FireBowlGround) => fire_bowls.push(pos + Vec3::unit_z() * 1),
Some(SpriteKind::StreetLampTall) => fire_bowls.push(pos + Vec3::unit_z() * 4),
Some(SpriteKind::Beehive) => beehives.push(pos), Some(SpriteKind::Beehive) => beehives.push(pos),
Some(SpriteKind::Reed) => reeds.push(pos), Some(SpriteKind::Reed) => reeds.push(pos),
Some(SpriteKind::PinkFlower) => flowers.push(pos), Some(SpriteKind::PinkFlower) => flowers.push(pos),
@ -100,6 +105,7 @@ impl BlocksOfInterest {
flowers, flowers,
interactables, interactables,
lights, lights,
fire_bowls,
} }
} }
} }