This commit is contained in:
Pfauenauge90 2020-04-14 01:13:03 +02:00 committed by Joshua Barretto
parent 2f53089641
commit 8e7da1e379
48 changed files with 283 additions and 2 deletions

View File

@ -0,0 +1,13 @@
Item(
name: "Mushroom",
description: "Reliable Source of water and fat.
Restores 20 Health.",
kind: Consumable(
kind: Coconut,
effect: Health((
amount: 20,
cause: Item,
)),
),
)

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

View File

@ -272,9 +272,13 @@
(0.0, 0.0, 0.0), (-90.0, 180.0, 0.0), 1.0,
),
// Consumables
Consumable(Apple): VoxTrans(
Consumable(Apple):
VoxTrans(
"element.icons.item_apple",
(0.0, 0.0, 0.0), (-90.0, 90.0, 0.0), 1.0,
),
Consumable(Coconut): Png(
"element.icons.item_coconut",
),
Consumable(PotionMinor): VoxTrans(
"voxel.object.potion_red",

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.

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.

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.

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

@ -16,6 +16,7 @@ use std::{fs::File, io::BufReader};
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Consumable {
Coconut,
Apple,
Cheese,
Potion,
@ -126,6 +127,7 @@ impl Item {
Some(assets::load_expect_cloned("common.items.grasses.medium"))
},
BlockKind::ShortGrass => Some(assets::load_expect_cloned("common.items.grasses.short")),
BlockKind::Coconut => Some(assets::load_expect_cloned("common.items.coconut")),
BlockKind::Chest => Some(assets::load_expect_cloned(
[
"common.items.apple",

View File

@ -41,6 +41,11 @@ pub enum BlockKind {
DeadBush,
Blueberry,
Ember,
Corn,
WheatYellow,
WheatGreen,
Cabbage,
Coconut,
}
impl BlockKind {
@ -83,6 +88,11 @@ impl BlockKind {
BlockKind::DeadBush => true,
BlockKind::Blueberry => true,
BlockKind::Ember => true,
BlockKind::Corn => true,
BlockKind::WheatYellow => true,
BlockKind::WheatGreen => true,
BlockKind::Cabbage => true,
BlockKind::Coconut => true,
_ => false,
}
}
@ -127,6 +137,11 @@ impl BlockKind {
BlockKind::DeadBush => false,
BlockKind::Blueberry => false,
BlockKind::Ember => false,
BlockKind::Corn => false,
BlockKind::WheatYellow => false,
BlockKind::WheatGreen => false,
BlockKind::Cabbage => false,
BlockKind::Coconut => false,
_ => true,
}
}
@ -163,6 +178,11 @@ impl BlockKind {
BlockKind::DeadBush => false,
BlockKind::Blueberry => false,
BlockKind::Ember => false,
BlockKind::Corn => false,
BlockKind::WheatYellow => false,
BlockKind::WheatGreen => false,
BlockKind::Cabbage => false,
BlockKind::Coconut => false,
_ => true,
}
}
@ -185,6 +205,7 @@ impl BlockKind {
BlockKind::VeloriteFrag => true,
BlockKind::Chest => true,
BlockKind::Pumpkin => true,
BlockKind::Coconut => true,
_ => false,
}
}

View File

@ -20,6 +20,7 @@ pub enum StructureBlock {
Water,
GreenSludge,
Fruit,
Coconut,
Chest,
Hollow,
Liana,
@ -114,6 +115,7 @@ impl Asset for Structure {
7 => StructureBlock::Fruit,
9 => StructureBlock::Liana,
10 => StructureBlock::Chest,
11 => StructureBlock::Coconut,
13 => StructureBlock::PalmLeavesOuter,
14 => StructureBlock::PalmLeavesInner,
15 => StructureBlock::Hollow,

View File

@ -174,7 +174,26 @@ fn sprite_config_for(kind: BlockKind) -> Option<SpriteConfig> {
variations: 1,
wind_sway: 0.8,
}),
BlockKind::Corn => Some(SpriteConfig {
variations: 6,
wind_sway: 0.4,
}),
BlockKind::WheatYellow => Some(SpriteConfig {
variations: 10,
wind_sway: 0.4,
}),
BlockKind::WheatGreen => Some(SpriteConfig {
variations: 10,
wind_sway: 0.4,
}),
BlockKind::Cabbage => Some(SpriteConfig {
variations: 3,
wind_sway: 0.0,
}),
BlockKind::Coconut => Some(SpriteConfig {
variations: 1,
wind_sway: 0.0,
}),
_ => None,
}
}
@ -1075,6 +1094,221 @@ impl<V: RectRasterableVol> Terrain<V> {
(BlockKind::Ember, 0),
make_model("voxygen.voxel.sprite.ember.1", Vec3::new(-7.0, -7.0, -2.9)),
),
// Corn
(
(BlockKind::Corn, 0),
make_model(
"voxygen.voxel.sprite.corn.corn-0",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::Corn, 1),
make_model(
"voxygen.voxel.sprite.corn.corn-1",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::Corn, 2),
make_model(
"voxygen.voxel.sprite.corn.corn-2",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::Corn, 3),
make_model(
"voxygen.voxel.sprite.corn.corn-3",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::Corn, 4),
make_model(
"voxygen.voxel.sprite.corn.corn-4",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::Corn, 5),
make_model(
"voxygen.voxel.sprite.corn.corn-5",
Vec3::new(-6.0, -6.0, 0.0),
),
),
// Yellow Wheat
(
(BlockKind::WheatYellow, 0),
make_model(
"voxygen.voxel.sprite.wheat_yellow.wheat-0",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::WheatYellow, 1),
make_model(
"voxygen.voxel.sprite.wheat_yellow.wheat-1",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::WheatYellow, 2),
make_model(
"voxygen.voxel.sprite.wheat_yellow.wheat-2",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::WheatYellow, 3),
make_model(
"voxygen.voxel.sprite.wheat_yellow.wheat-3",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::WheatYellow, 4),
make_model(
"voxygen.voxel.sprite.wheat_yellow.wheat-4",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::WheatYellow, 5),
make_model(
"voxygen.voxel.sprite.wheat_yellow.wheat-5",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::WheatYellow, 6),
make_model(
"voxygen.voxel.sprite.wheat_yellow.wheat-6",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::WheatYellow, 7),
make_model(
"voxygen.voxel.sprite.wheat_yellow.wheat-7",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::WheatYellow, 8),
make_model(
"voxygen.voxel.sprite.wheat_yellow.wheat-8",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::WheatYellow, 9),
make_model(
"voxygen.voxel.sprite.wheat_yellow.wheat-9",
Vec3::new(-6.0, -6.0, 0.0),
),
),
// Green Wheat
(
(BlockKind::WheatGreen, 0),
make_model(
"voxygen.voxel.sprite.wheat_yellow.wheat-0",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::WheatGreen, 1),
make_model(
"voxygen.voxel.sprite.wheat_yellow.wheat-1",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::WheatGreen, 2),
make_model(
"voxygen.voxel.sprite.wheat_yellow.wheat-2",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::WheatGreen, 3),
make_model(
"voxygen.voxel.sprite.wheat_yellow.wheat-3",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::WheatGreen, 4),
make_model(
"voxygen.voxel.sprite.wheat_yellow.wheat-4",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::WheatGreen, 5),
make_model(
"voxygen.voxel.sprite.wheat_yellow.wheat-5",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::WheatGreen, 6),
make_model(
"voxygen.voxel.sprite.wheat_yellow.wheat-6",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::WheatGreen, 7),
make_model(
"voxygen.voxel.sprite.wheat_yellow.wheat-7",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::WheatGreen, 8),
make_model(
"voxygen.voxel.sprite.wheat_yellow.wheat-8",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::WheatGreen, 9),
make_model(
"voxygen.voxel.sprite.wheat_yellow.wheat-9",
Vec3::new(-6.0, -6.0, 0.0),
),
),
// Cabbage
(
(BlockKind::WheatGreen, 0),
make_model(
"voxygen.voxel.sprite.cabbage.cabbage-0",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::WheatGreen, 1),
make_model(
"voxygen.voxel.sprite.cabbage.cabbage-1",
Vec3::new(-6.0, -6.0, 0.0),
),
),
(
(BlockKind::WheatGreen, 2),
make_model(
"voxygen.voxel.sprite.cabbage.cabbage-2",
Vec3::new(-6.0, -6.0, 0.0),
),
),
// Coconut
(
(BlockKind::WheatGreen, 0),
make_model(
"voxygen.voxel.sprite.fruit.coconut",
Vec3::new(-6.0, -6.0, 0.0),
),
),
]
.into_iter()
.collect(),

View File

@ -610,6 +610,11 @@ pub fn block_from_structure(
} else {
Block::new(BlockKind::Apple, Rgb::new(1, 1, 1))
}),
StructureBlock::Coconut => Some(if field.get(pos + structure_pos) % 3 > 0 {
Block::empty()
} else {
Block::new(BlockKind::Coconut, Rgb::new(1, 1, 1))
}),
StructureBlock::Chest => Some(if structure_seed % 10 < 7 {
Block::empty()
} else {