structure work

This commit is contained in:
flo666 2022-07-30 12:28:08 +02:00 committed by Sam
parent 3557f93f1e
commit 1750c9a0f2
26 changed files with 1460 additions and 312 deletions

View File

@ -6,7 +6,7 @@
loot: LootTable("common.loot_tables.dungeon.tier-1.enemy"),
inventory: (
loadout: Inline((
inherit: Asset("common.loadout.dungeon.tier-1.hunter"),
inherit: Asset("common.loadout.dungeon.adlet.hunter"),
active_hands: InHands((Item("common.items.npc_weapons.biped_small.adlet.hunter"), None)),
)),
),

View File

@ -6,7 +6,7 @@
loot: LootTable("common.loot_tables.dungeon.tier-1.enemy"),
inventory: (
loadout: Inline((
inherit: Asset("common.loadout.dungeon.tier-1.icepicker"),
inherit: Asset("common.loadout.dungeon.adlet.icepicker"),
active_hands: InHands((Item("common.items.npc_weapons.biped_small.adlet.icepicker"), None)),
)),
),

View File

@ -6,7 +6,7 @@
loot: LootTable("common.loot_tables.dungeon.tier-1.enemy"),
inventory: (
loadout: Inline((
inherit: Asset("common.loadout.dungeon.tier-1.tracker"),
inherit: Asset("common.loadout.dungeon.adlet.tracker"),
active_hands: InHands((Item("common.items.npc_weapons.biped_small.adlet.tracker"), None)),
)),
),

View File

@ -1,11 +0,0 @@
#![enable(implicit_some)]
(
name: Name("Rat"),
body: RandomWith("rat"),
alignment: Alignment(Enemy),
loot: LootTable("common.loot_tables.creature.quad_small.generic"),
inventory: (
loadout: FromBody,
),
meta: [],
)

View File

@ -0,0 +1,11 @@
ItemDef(
name: "Bone Key",
description: "Used to open bone locks. Will break after use.",
kind: Utility(
kind: Key,
),
amount: 1,
quality: Common,
tags: [Utility],
)

View File

@ -4833,6 +4833,10 @@
"voxel.object.key_rusty-0",
(0.0, 0.0, 0.0), (-100.0, 250.0, 15.0), 1.0,
),
Simple("common.items.keys.bone_key"): VoxTrans(
"voxel.object.key_bone",
(0.0, 0.0, 0.0), (-100.0, 250.0, 15.0), 1.0,
),
// Lockpicks
Simple("common.items.utility.lockpick_0"): VoxTrans(
"voxel.object.lockpick",

BIN
assets/voxygen/voxel/object/key_bone.vox (Stored with Git LFS) Normal file

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

View File

@ -1455,6 +1455,17 @@ Ember: Some((
],
wind_sway: 0.0,
)),
// FireBlock
FireBlock: Some((
variations: [
(
model: "voxygen.voxel.sprite.misc.fireblock",
offset: (-5.5, -5.5, 0.0),
lod_axes: (0.0, 0.0, 0.0),
),
],
wind_sway: 0.0,
)),
// Smoke dummy
SmokeDummy: Some((
variations: [
@ -3828,6 +3839,26 @@ KeyDoor: Some((
],
wind_sway: 0.0,
)),
BoneKeyhole: Some((
variations: [
(
model: "voxygen.voxel.sprite.furniture.bone_keyhole_block",
offset: (-5.5, -5.5, 0.0),
lod_axes: (0.5, 0.5, 0.5),
),
],
wind_sway: 0.0,
)),
BoneKeyDoor: Some((
variations: [
(
model: "voxygen.voxel.sprite.furniture.bone_door_block",
offset: (-5.5, -5.5, 0.0),
lod_axes: (0.5, 0.5, 0.5),
),
],
wind_sway: 0.0,
)),
// Bones
Bones: Some((
variations: [

View File

@ -0,0 +1,8 @@
#![enable(unwrap_newtypes)]
[
(
specifier: "world.structure.natural.bonfire",
center: (10, 10, 2)
),
]

BIN
assets/world/structure/natural/bonfire.vox (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -188,7 +188,7 @@ impl From<SpriteKind> for Option<SpriteInteractKind> {
| SpriteKind::PotionMinor
| SpriteKind::Seashells
| SpriteKind::Bomb => Some(SpriteInteractKind::Collectible),
SpriteKind::Keyhole => Some(SpriteInteractKind::Unlock),
SpriteKind::Keyhole | SpriteKind::BoneKeyhole => Some(SpriteInteractKind::Unlock),
// Collectible checked in addition to container for case that sprite requires a tool to
// collect and cannot be collected by hand, yet still meets the container check
_ if sprite_kind.is_container() && sprite_kind.is_collectible() => {

View File

@ -302,7 +302,7 @@ impl Block {
BlockKind::GlowingMushroom => Some(20),
_ => match self.get_sprite()? {
SpriteKind::StreetLamp | SpriteKind::StreetLampTall => Some(24),
SpriteKind::Ember => Some(20),
SpriteKind::Ember | SpriteKind::FireBlock => Some(20),
SpriteKind::WallLamp
| SpriteKind::WallLampSmall
| SpriteKind::WallSconce
@ -381,7 +381,10 @@ impl Block {
BlockKind::Lava => None,
_ => self.get_sprite().and_then(|sprite| match sprite {
sprite if sprite.is_container() => None,
SpriteKind::Keyhole | SpriteKind::KeyDoor => None,
SpriteKind::Keyhole
| SpriteKind::KeyDoor
| SpriteKind::BoneKeyhole
| SpriteKind::BoneKeyDoor => None,
SpriteKind::Anvil
| SpriteKind::Cauldron
| SpriteKind::CookingPot
@ -405,7 +408,8 @@ impl Block {
| SpriteKind::SeaDecorWindowHor
| SpriteKind::SeaDecorWindowVer
| SpriteKind::Rope
| SpriteKind::GlassBarrier => None,
| SpriteKind::GlassBarrier
| SpriteKind::FireBlock => None,
SpriteKind::EnsnaringVines
| SpriteKind::EnsnaringWeb
| SpriteKind::SeaUrchin

View File

@ -244,6 +244,10 @@ make_case_elim!(
RepairBench = 0xDA,
Helm = 0xDB,
DoorWide = 0xDC,
BoneKeyhole = 0xDD,
BoneKeyDoor = 0xDE,
// FireBlock for Burning Buff
FireBlock = 0xDF,
}
);
@ -335,6 +339,8 @@ impl SpriteKind {
| SpriteKind::GlassBarrier
| SpriteKind::Keyhole
| SpriteKind::KeyDoor
| SpriteKind::BoneKeyhole
| SpriteKind::BoneKeyDoor
| SpriteKind::Bomb => 1.0,
// TODO: Figure out if this should be solid or not.
SpriteKind::Shelf => 1.0,
@ -368,7 +374,7 @@ impl SpriteKind {
SpriteKind::FountainArabic => 2.4,
SpriteKind::Hearth => 2.3,
SpriteKind::ForgeTools => 2.8,
SpriteKind::CliffDecorBlock => 1.0,
SpriteKind::CliffDecorBlock | SpriteKind::FireBlock => 1.0,
SpriteKind::Wood
| SpriteKind::Hardwood
| SpriteKind::Ironwood
@ -461,7 +467,7 @@ impl SpriteKind {
SpriteKind::Frostwood => item("common.items.log.frostwood"),
SpriteKind::Eldwood => item("common.items.log.eldwood"),
SpriteKind::MagicalBarrier => table("common.loot_tables.sprite.chest"),
SpriteKind::Keyhole => return Some(None),
SpriteKind::Keyhole | SpriteKind::BoneKeyhole => return Some(None),
_ => return None,
}))
}
@ -560,6 +566,9 @@ impl SpriteKind {
SpriteKind::CommonLockedChest => UnlockKind::Consumes(
ItemDefinitionId::Simple("common.items.utility.lockpick_0").to_owned(),
),
SpriteKind::BoneKeyhole => UnlockKind::Consumes(
ItemDefinitionId::Simple("common.items.keys.bone_key").to_owned(),
),
_ => UnlockKind::Free,
})
}

View File

@ -42,6 +42,7 @@ make_case_elim!(
RotatedSprite(kind: SpriteKind, ori: u8) = 23,
EntitySpawner(entitykind: String, spawn_chance: f32) = 24,
Keyhole(consumes: String) = 25,
BoneKeyhole(consumes: String) = 26,
}
);

View File

@ -200,6 +200,21 @@ impl<'a> System<'a> for Sys {
)),
});
}
if matches!(
physics_state.on_ground.and_then(|b| b.get_sprite()),
Some(SpriteKind::FireBlock)
) {
// If on FireBlock vines, apply burning buff
server_emitter.emit(ServerEvent::Buff {
entity,
buff_change: BuffChange::Add(Buff::new(
BuffKind::Burning,
BuffData::new(20.0, None, None),
Vec::new(),
BuffSource::World,
)),
});
}
if matches!(
physics_state.in_fluid,
Some(Fluid::Liquid {

View File

@ -320,7 +320,10 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv
// If the block was a keyhole, remove nearby door blocks
// TODO: Abstract this code into a generalised way to do block updates?
if matches!(block.get_sprite(), Some(SpriteKind::Keyhole)) {
if matches!(
block.get_sprite(),
Some(SpriteKind::Keyhole) | Some(SpriteKind::BoneKeyhole)
) {
let dirs = [
Vec3::unit_x(),
-Vec3::unit_x(),
@ -342,17 +345,35 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv
let next_pending = pending.iter().next().copied();
if let Some(pos) = next_pending {
pending.remove(&pos);
if !destroyed.contains(&pos)
&& matches!(
terrain.get(pos).ok().and_then(|b| b.get_sprite()),
Some(SpriteKind::KeyDoor)
)
{
block_change.try_set(pos, Block::empty());
destroyed.insert(pos);
match block.get_sprite() {
Some(SpriteKind::Keyhole) => {
if !destroyed.contains(&pos)
&& matches!(
terrain.get(pos).ok().and_then(|b| b.get_sprite()),
Some(SpriteKind::KeyDoor)
)
{
block_change.try_set(pos, Block::empty());
destroyed.insert(pos);
pending.extend(dirs.into_iter().map(|dir| pos + dir));
}
pending.extend(dirs.into_iter().map(|dir| pos + dir));
}
},
Some(SpriteKind::BoneKeyhole) => {
if !destroyed.contains(&pos)
&& matches!(
terrain.get(pos).ok().and_then(|b| b.get_sprite()),
Some(SpriteKind::BoneKeyDoor)
)
{
block_change.try_set(pos, Block::empty());
destroyed.insert(pos);
pending.extend(dirs.into_iter().map(|dir| pos + dir));
}
},
_ => {},
};
} else {
break;
}

View File

@ -348,6 +348,16 @@ pub fn block_from_structure(
}),
));
},
StructureBlock::BoneKeyhole(consumes) => {
return Some((
Block::air(SpriteKind::BoneKeyhole),
Some(SpriteCfg {
unlock: Some(UnlockKind::Consumes(ItemDefinitionIdOwned::Simple(
consumes.clone(),
))),
}),
));
},
};
Some((block?, None))

View File

@ -132,7 +132,6 @@ impl Environment {
SiteKind::Adlet(_) => {},
SiteKind::ChapelSite(_) => {},
SiteKind::Bridge(_) => {},
SiteKind::Adlet(_) => {},
}
}
if towns.valid() {

File diff suppressed because it is too large Load Diff