Added spot loot

This commit is contained in:
Joshua Barretto 2021-08-29 12:50:35 +01:00
parent e05ca1f308
commit 87f4efd65b
18 changed files with 48 additions and 31 deletions

View File

@ -4,5 +4,9 @@
(
specifier: "world.structure.natural.saurok-altar",
center: (10, 13, 3),
custom_indices: {
105: Filled(GlowingRock, (r: 161, g: 255, b: 133)),
113: Filled(GlowingRock, (r: 139, g: 245, b: 104)),
},
),
]

View File

@ -3,6 +3,9 @@
[
(
specifier: "world.structure.natural.gnarling_totem",
center: (9, 5, 5)
center: (9, 5, 5),
custom_indices: {
217: Filled(GlowingRock, (r: 0, g: 255, b: 246)),
},
),
]

View File

@ -1,8 +1,8 @@
#![enable(unwrap_newtypes)]
[
[
(
specifier: "world.structure.natural.airship-crashsite_0",
center: (28, 40, 14)
center: (28, 40, 14),
),
]

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -237,6 +237,7 @@ impl Block {
BlockKind::Snow => Some(0.1),
BlockKind::Lava => None,
_ => self.get_sprite().and_then(|sprite| match sprite {
sprite if sprite.is_container() => None,
SpriteKind::Anvil
| SpriteKind::Cauldron
| SpriteKind::CookingPot

View File

@ -13,7 +13,7 @@ use vek::*;
make_case_elim!(
structure_block,
#[derive(Copy, Clone, PartialEq, Debug, Deserialize)]
#[repr(u32)]
#[repr(u8)]
pub enum StructureBlock {
None = 0,
Grass = 1,

View File

@ -239,7 +239,7 @@ pub fn block_from_structure(
match sblock {
StructureBlock::None => None,
StructureBlock::Hollow => Some(with_sprite(SpriteKind::Empty)),
StructureBlock::Hollow => Some(Block::air(SpriteKind::Empty)),
StructureBlock::Grass => Some(Block::new(
BlockKind::Grass,
sample.surface_color.map(|e| (e * 255.0) as u8),
@ -270,10 +270,16 @@ pub fn block_from_structure(
}
},
StructureBlock::Chest => {
if structure_seed % 10 < 7 {
Some(Block::empty())
let old_block = with_sprite(SpriteKind::Empty);
let block = if old_block.is_fluid() {
old_block
} else {
Some(with_sprite(SpriteKind::Chest))
Block::air(SpriteKind::Empty)
};
if field.get(pos + structure_pos) % 16 < 8 {
Some(block)
} else {
Some(block.with_sprite(SpriteKind::Chest))
}
},
StructureBlock::Log => Some(Block::new(BlockKind::Wood, Rgb::new(60, 30, 0))),

View File

@ -279,7 +279,7 @@ impl Spot {
/ 1000.0f32.powi(2))
.ceil() as u64
{
let pos = world_size.map(|e| world.rng.gen_range(0..e as i32));
let pos = world_size.map(|e| (world.rng.gen_range(0..e) & !0b11) as i32);
if let Some((_, chunk)) = world
.get_gradient_approx(pos)
.zip(world.get_mut(pos))
@ -367,7 +367,7 @@ pub fn apply_spots_to(canvas: &mut Canvas, _dynamic_rng: &mut impl Rng) {
Spot::LionRock => SpotConfig {
base_structures: Some("spots_savannah.lion_rock"),
entity_radius: 20.0,
entities: &[(0..8, "common.entity.wild.aggressive.lion")],
entities: &[(5..8, "common.entity.wild.aggressive.lion")],
},
Spot::TreeStumpForest => SpotConfig {
base_structures: Some("trees.oak_stumps"),

View File

@ -2065,7 +2065,10 @@ impl WorldSim {
let env = Environment {
humid: chunk.humidity,
temp: chunk.temp,
near_water: if chunk.river.is_lake() || chunk.river.near_river() {
near_water: if chunk.river.is_lake()
|| chunk.river.near_river()
|| chunk.alt < CONFIG.sea_level + 3.0
{
1.0
} else {
0.0