mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Added bee hives
This commit is contained in:
parent
88add8456f
commit
032ec9ef41
@ -46,6 +46,7 @@ const int FIREWORK_RED = 7;
|
|||||||
const int FIREWORK_YELLOW = 8;
|
const int FIREWORK_YELLOW = 8;
|
||||||
const int LEAF = 9;
|
const int LEAF = 9;
|
||||||
const int FIREFLY = 10;
|
const int FIREFLY = 10;
|
||||||
|
const int BEE = 11;
|
||||||
|
|
||||||
// meters per second squared (acceleration)
|
// meters per second squared (acceleration)
|
||||||
const float earth_gravity = 9.807;
|
const float earth_gravity = 9.807;
|
||||||
@ -227,6 +228,18 @@ void main() {
|
|||||||
vec4(vec3(5, 5, 1.1), 1),
|
vec4(vec3(5, 5, 1.1), 1),
|
||||||
spin_in_axis(vec3(rand6, rand7, rand8), rand9 * 3 + lifetime * 5)
|
spin_in_axis(vec3(rand6, rand7, rand8), rand9 * 3 + lifetime * 5)
|
||||||
);
|
);
|
||||||
|
} else if (inst_mode == BEE) {
|
||||||
|
float lower = pow(sin(3.1416 * lifetime / inst_lifespan), 0.2);
|
||||||
|
attr = Attr(
|
||||||
|
vec3(0, 0, lower * -0.5) + vec3(
|
||||||
|
sin(lifetime * 2.0 + rand0) + sin(lifetime * 9.0 + rand3) * 0.3,
|
||||||
|
sin(lifetime * 3.0 + rand1) + sin(lifetime * 10.0 + rand4) * 0.3,
|
||||||
|
sin(lifetime * 4.0 + rand2) + sin(lifetime * 11.0 + rand5) * 0.3
|
||||||
|
) * 0.5,
|
||||||
|
lower,
|
||||||
|
vec4(vec3(1, 0.7, 0), 1),
|
||||||
|
spin_in_axis(vec3(rand6, rand7, rand8), rand9 * 3 + lifetime * 5)
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
attr = Attr(
|
attr = Attr(
|
||||||
linear_motion(
|
linear_motion(
|
||||||
|
BIN
assets/voxygen/voxel/sprite/beehive/beehive.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/sprite/beehive/beehive.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -1959,4 +1959,16 @@ Reed: Some((
|
|||||||
],
|
],
|
||||||
wind_sway: 0.65,
|
wind_sway: 0.65,
|
||||||
)),
|
)),
|
||||||
|
|
||||||
|
// Beehive
|
||||||
|
Beehive: Some((
|
||||||
|
variations: [
|
||||||
|
(
|
||||||
|
model: "voxygen.voxel.sprite.beehive.beehive",
|
||||||
|
offset: (-5.5, -5.5, 0.0),
|
||||||
|
lod_axes: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
wind_sway: 0.1,
|
||||||
|
)),
|
||||||
)
|
)
|
||||||
|
@ -94,6 +94,7 @@ make_case_elim!(
|
|||||||
DropGateBottom = 0x51,
|
DropGateBottom = 0x51,
|
||||||
GrassSnow = 0x52,
|
GrassSnow = 0x52,
|
||||||
Reed = 0x53,
|
Reed = 0x53,
|
||||||
|
Beehive = 0x54,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -202,6 +203,7 @@ impl BlockKind {
|
|||||||
BlockKind::DropGateBottom => false,
|
BlockKind::DropGateBottom => false,
|
||||||
BlockKind::GrassSnow => true,
|
BlockKind::GrassSnow => true,
|
||||||
BlockKind::Reed => true,
|
BlockKind::Reed => true,
|
||||||
|
BlockKind::Beehive => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -299,6 +301,7 @@ impl BlockKind {
|
|||||||
BlockKind::DropGateBottom => false,
|
BlockKind::DropGateBottom => false,
|
||||||
BlockKind::GrassSnow => false,
|
BlockKind::GrassSnow => false,
|
||||||
BlockKind::Reed => false,
|
BlockKind::Reed => false,
|
||||||
|
BlockKind::Beehive => false,
|
||||||
_ => true,
|
_ => true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -506,7 +509,8 @@ impl Block {
|
|||||||
| BlockKind::Chest
|
| BlockKind::Chest
|
||||||
| BlockKind::DropGate
|
| BlockKind::DropGate
|
||||||
| BlockKind::DropGateBottom
|
| BlockKind::DropGateBottom
|
||||||
| BlockKind::Door => Some(self.color[0] & 0b111),
|
| BlockKind::Door
|
||||||
|
| BlockKind::Beehive => Some(self.color[0] & 0b111),
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ pub fn handle_create_waypoint(server: &mut Server, pos: Vec3<f32>) {
|
|||||||
.state
|
.state
|
||||||
.create_object(Pos(pos), comp::object::Body::CampfireLit)
|
.create_object(Pos(pos), comp::object::Body::CampfireLit)
|
||||||
.with(LightEmitter {
|
.with(LightEmitter {
|
||||||
col: Rgb::new(1.0, 0.6, 0.0),
|
col: Rgb::new(1.0, 0.3, 0.1),
|
||||||
strength: 5.0,
|
strength: 5.0,
|
||||||
flicker: 1.0,
|
flicker: 1.0,
|
||||||
animated: true,
|
animated: true,
|
||||||
|
@ -104,6 +104,7 @@ pub enum ParticleMode {
|
|||||||
FireworkYellow = 8,
|
FireworkYellow = 8,
|
||||||
Leaf = 9,
|
Leaf = 9,
|
||||||
Firefly = 10,
|
Firefly = 10,
|
||||||
|
Bee = 11,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ParticleMode {
|
impl ParticleMode {
|
||||||
|
@ -328,6 +328,14 @@ impl ParticleMgr {
|
|||||||
ParticleMode::Firefly,
|
ParticleMode::Firefly,
|
||||||
|sd| sd.state.get_day_period().is_dark(),
|
|sd| sd.state.get_day_period().is_dark(),
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
|boi| &boi.beehives,
|
||||||
|
3,
|
||||||
|
0.5,
|
||||||
|
30.0,
|
||||||
|
ParticleMode::Bee,
|
||||||
|
|sd| sd.state.get_day_period().is_light(),
|
||||||
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
let mut rng = thread_rng();
|
let mut rng = thread_rng();
|
||||||
|
@ -91,7 +91,6 @@ struct SpriteModelConfig<Model> {
|
|||||||
lod_axes: (f32, f32, f32),
|
lod_axes: (f32, f32, f32),
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
/// Configuration data for a group of sprites (currently associated with a
|
/// Configuration data for a group of sprites (currently associated with a
|
||||||
/// particular BlockKind).
|
/// particular BlockKind).
|
||||||
|
@ -9,6 +9,7 @@ pub struct BlocksOfInterest {
|
|||||||
pub leaves: Vec<Vec3<i32>>,
|
pub leaves: Vec<Vec3<i32>>,
|
||||||
pub grass: Vec<Vec3<i32>>,
|
pub grass: Vec<Vec3<i32>>,
|
||||||
pub embers: Vec<Vec3<i32>>,
|
pub embers: Vec<Vec3<i32>>,
|
||||||
|
pub beehives: Vec<Vec3<i32>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl BlocksOfInterest {
|
impl BlocksOfInterest {
|
||||||
@ -16,6 +17,7 @@ impl BlocksOfInterest {
|
|||||||
let mut leaves = Vec::new();
|
let mut leaves = Vec::new();
|
||||||
let mut grass = Vec::new();
|
let mut grass = Vec::new();
|
||||||
let mut embers = Vec::new();
|
let mut embers = Vec::new();
|
||||||
|
let mut beehives = Vec::new();
|
||||||
|
|
||||||
chunk
|
chunk
|
||||||
.vol_iter(
|
.vol_iter(
|
||||||
@ -33,6 +35,8 @@ impl BlocksOfInterest {
|
|||||||
grass.push(pos);
|
grass.push(pos);
|
||||||
} else if block.kind() == BlockKind::Ember {
|
} else if block.kind() == BlockKind::Ember {
|
||||||
embers.push(pos);
|
embers.push(pos);
|
||||||
|
} else if block.kind() == BlockKind::Beehive {
|
||||||
|
beehives.push(pos);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -40,6 +44,7 @@ impl BlocksOfInterest {
|
|||||||
leaves,
|
leaves,
|
||||||
grass,
|
grass,
|
||||||
embers,
|
embers,
|
||||||
|
beehives,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -574,10 +574,12 @@ pub fn block_from_structure(
|
|||||||
// None of these BlockKinds has an orientation, so we just use zero for the other color
|
// None of these BlockKinds has an orientation, so we just use zero for the other color
|
||||||
// bits.
|
// bits.
|
||||||
StructureBlock::Liana => Some(Block::new(BlockKind::Liana, Rgb::zero())),
|
StructureBlock::Liana => Some(Block::new(BlockKind::Liana, Rgb::zero())),
|
||||||
StructureBlock::Fruit => Some(if field.get(pos + structure_pos) % 3 > 0 {
|
StructureBlock::Fruit => Some(if field.get(pos + structure_pos) % 24 == 0 {
|
||||||
Block::empty()
|
Block::new(BlockKind::Beehive, Rgb::zero())
|
||||||
} else {
|
} else if field.get(pos + structure_pos + 1) % 3 == 0 {
|
||||||
Block::new(BlockKind::Apple, Rgb::zero())
|
Block::new(BlockKind::Apple, Rgb::zero())
|
||||||
|
} else {
|
||||||
|
Block::empty()
|
||||||
}),
|
}),
|
||||||
StructureBlock::Coconut => Some(if field.get(pos + structure_pos) % 3 > 0 {
|
StructureBlock::Coconut => Some(if field.get(pos + structure_pos) % 3 > 0 {
|
||||||
Block::empty()
|
Block::empty()
|
||||||
|
Loading…
Reference in New Issue
Block a user