cave changes

This commit is contained in:
jshipsey 2021-05-23 17:07:20 -04:00 committed by Marcel Märtens
parent 754b60d810
commit 1c17d8fe5e
27 changed files with 168 additions and 64 deletions

View File

@ -0,0 +1,16 @@
[
(10, Velorite),
(15, VeloriteFrag),
(1, Stones),
(100, ShortGrass),
(1, CaveMushroom),
(30, AmethystSmall),
(30, TopazSmall),
(16, SapphireSmall),
(60, Crystal),
(12, EmeraldSmall),
(8, RubySmall),
(4, DiamondSmall),
(5, Chest),
(15, Crate),
]

View File

@ -6,6 +6,10 @@ ItemDef(
stats: (
protection: Normal(3.0),
poise_resilience: Normal(1.0),
energy_max: 0,
energy_recovery: 0.0,
crit_power: 0.0,
stealth: 0.0,
),
)),
quality: Epic,

View File

@ -6,6 +6,10 @@ ItemDef(
stats: (
protection: Normal(6.0),
poise_resilience: Normal(1.0),
energy_max: 0,
energy_recovery: 0.0,
crit_power: 0.0,
stealth: 0.0,
),
)),
quality: Epic,

View File

@ -6,6 +6,10 @@ ItemDef(
stats: (
protection: Normal(30.0),
poise_resilience: Normal(1.0),
energy_max: 0,
energy_recovery: 0.0,
crit_power: 0.0,
stealth: 0.0,
),
)),
quality: Epic,

View File

@ -6,6 +6,10 @@ ItemDef(
stats: (
protection: Normal(6.0),
poise_resilience: Normal(1.0),
energy_max: 0,
energy_recovery: 0.0,
crit_power: 0.0,
stealth: 0.0,
),
)),
quality: Epic,

View File

@ -6,6 +6,10 @@ ItemDef(
stats: (
protection: Normal(12.0),
poise_resilience: Normal(1.0),
energy_max: 0,
energy_recovery: 0.0,
crit_power: 0.0,
stealth: 0.0,
),
)),
quality: Epic,

View File

@ -6,6 +6,10 @@ ItemDef(
stats: (
protection: Normal(24.0),
poise_resilience: Normal(1.0),
energy_max: 0,
energy_recovery: 0.0,
crit_power: 0.0,
stealth: 0.0,
),
)),
quality: Epic,

View File

@ -6,6 +6,10 @@ ItemDef(
stats: (
protection: Normal(18.0),
poise_resilience: Normal(1.0),
energy_max: 0,
energy_recovery: 0.0,
crit_power: 0.0,
stealth: 0.0,
),
)),
quality: Epic,

View File

@ -4,7 +4,7 @@ ItemDef(
kind: Armor((
kind: Chest("Orichalcum"),
stats: (
protection: Normal(250.0),
protection: Normal(240.0),
poise_resilience: Normal(0.0),
energy_max: 1000,
energy_recovery: 3.0,

View File

@ -187,14 +187,14 @@
"gold ingot": (
output: ("common.items.mineral.ingot.gold", 1),
inputs: [
(Item("common.items.mineral.ore.gold_ore"), 1),
(Item("common.items.mineral.ore.gold"), 1),
],
craft_sprite: Some(Forge),
),
"silver ingot": (
output: ("common.items.mineral.ingot.silver", 1),
inputs: [
(Item("common.items.mineral.ore.silver_ore"), 1),
(Item("common.items.mineral.ore.silver"), 1),
],
craft_sprite: Some(Forge),
),
@ -202,44 +202,44 @@
"iron ingot": (
output: ("common.items.mineral.ingot.iron", 1),
inputs: [
(Item("common.items.mineral.ore.iron_ore"), 1),
(Item("common.items.mineral.ore.iron"), 1),
],
craft_sprite: Some(Forge),
),
"cobalt ingot": (
output: ("common.items.mineral.ingot.cobalt", 1),
inputs: [
(Item("common.items.mineral.ore.cobalt_ore"), 1),
(Item("common.items.mineral.ore.cobalt"), 1),
],
craft_sprite: Some(Forge),
),
"tin ingot": (
output: ("common.items.mineral.ingot.tin", 2),
inputs: [
(Item("common.items.mineral.ore.tin_ore"), 1),
(Item("common.items.mineral.ore.tin"), 1),
],
craft_sprite: Some(Forge),
),
"orichalcum ingot": (
output: ("common.items.mineral.ingot.orichalcum", 2),
inputs: [
(Item("common.items.mineral.ore.gold_ore"), 1),
(Item("common.items.mineral.ore.silver_ore"), 1),
(Item("common.items.mineral.ore.gold"), 1),
(Item("common.items.mineral.ore.silver"), 1),
],
craft_sprite: Some(Forge),
),
"copper ingot": (
output: ("common.items.mineral.ingot.copper", 2),
inputs: [
(Item("common.items.mineral.ore.copper_ore"), 1),
(Item("common.items.mineral.ore.copper"), 1),
],
craft_sprite: Some(Forge),
),
"bloodsteel ingot": (
output: ("common.items.mineral.ingot.bloodsteel", 2),
inputs: [
(Item("common.items.mineral.ore.bloodstone_ore"), 1),
(Item("common.items.mineral.ore.iron_ore"), 1),
(Item("common.items.mineral.ore.bloodstone"), 1),
(Item("common.items.mineral.ore.iron"), 1),
(Item("common.items.mineral.ore.coal"), 1),
],
craft_sprite: Some(Forge),
@ -247,7 +247,7 @@
"steel ingot": (
output: ("common.items.mineral.ingot.steel", 1),
inputs: [
(Item("common.items.mineral.ore.iron_ore"), 1),
(Item("common.items.mineral.ore.iron"), 1),
(Item("common.items.mineral.ore.coal"), 1),
],
craft_sprite: Some(Forge),
@ -255,8 +255,8 @@
"bronze ingot": (
output: ("common.items.mineral.ingot.bronze", 2),
inputs: [
(Item("common.items.mineral.ore.copper_ore"), 1),
(Item("common.items.mineral.ore.tin_ore"), 1),
(Item("common.items.mineral.ore.copper"), 1),
(Item("common.items.mineral.ore.tin"), 1),
],
craft_sprite: Some(Forge),
),

View File

@ -659,20 +659,20 @@
central: ("armor.empty"),
)
),
MeatDrop: (
ToughMeat: (
bone0: (
offset: (-3.5, -8.0, 0.0),
central: ("object.meat_drop"),
offset: (-4.5, -4.0, 0.0),
central: ("sprite.food.meat.tough_raw"),
),
bone1: (
offset: (0.0, 0.0, 0.0),
central: ("armor.empty"),
)
),
Steak: (
BeastMeat: (
bone0: (
offset: (-3.5, -6.0, 0.0),
central: ("object.steak"),
offset: (-6.5, -4.5, 0.0),
central: ("sprite.food.meat.beast_large_raw"),
),
bone1: (
offset: (0.0, 0.0, 0.0),
@ -743,6 +743,30 @@
bone0: (
offset: (-4.5, -4.5, 0.0),
central: ("object.sea_lantern"),
BirdMeat: (
bone0: (
offset: (-5.5, -3.0, 0.0),
central: ("sprite.food.meat.bird_raw"),
),
bone1: (
offset: (0.0, 0.0, 0.0),
central: ("armor.empty"),
)
),
FishMeat: (
bone0: (
offset: (-5.5, -5.5, 0.0),
central: ("sprite.food.meat.fish_raw"),
),
bone1: (
offset: (0.0, 0.0, 0.0),
central: ("armor.empty"),
)
),
SmallMeat: (
bone0: (
offset: (-6.5, -3.5, 0.0),
central: ("sprite.food.meat.beast_small_raw"),
),
bone1: (
offset: (0.0, 0.0, 0.0),

BIN
assets/voxygen/voxel/sprite/mineral/gem/crystal-0.vox (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -2902,7 +2902,16 @@ SapphireSmall: Some((
],
wind_sway: 0.0,
)),
Crystal: Some((
variations: [
(
model: "voxygen.voxel.sprite.mineral.gem.crystal-0",
offset: (-8.5, -8.5, 0.0),
lod_axes: (0.0, 0.0, 0.0),
),
],
wind_sway: 0.0,
)),
// Lantern
Lantern: Some((
variations: [

View File

@ -74,8 +74,8 @@ make_case_elim!(
FireworkYellow = 59,
MultiArrow = 60,
BoltNature = 61,
MeatDrop = 62,
Steak = 63,
ToughMeat = 62,
BeastMeat = 63,
Crossbow = 64,
ArrowTurret = 65,
Coins = 66,
@ -85,6 +85,9 @@ make_case_elim!(
HaniwaSentry = 70,
SeaLantern = 71,
Snowball = 72,
BirdMeat = 73,
FishMeat = 74,
SmallMeat = 75,
}
);
@ -95,7 +98,7 @@ impl Body {
}
}
pub const ALL_OBJECTS: [Body; 73] = [
pub const ALL_OBJECTS: [Body; 76] = [
Body::Arrow,
Body::Bomb,
Body::Scarecrow,
@ -158,8 +161,8 @@ pub const ALL_OBJECTS: [Body; 73] = [
Body::FireworkYellow,
Body::MultiArrow,
Body::BoltNature,
Body::MeatDrop,
Body::Steak,
Body::ToughMeat,
Body::BeastMeat,
Body::Crossbow,
Body::ArrowTurret,
Body::Coins,
@ -169,6 +172,9 @@ pub const ALL_OBJECTS: [Body; 73] = [
Body::HaniwaSentry,
Body::SeaLantern,
Body::Snowball,
Body::BirdMeat,
Body::FishMeat,
Body::SmallMeat,
];
impl From<Body> for super::Body {
@ -243,8 +249,8 @@ impl Body {
Body::FireworkYellow => "firework_yellow",
Body::MultiArrow => "multi_arrow",
Body::BoltNature => "bolt_nature",
Body::MeatDrop => "meat_drop",
Body::Steak => "steak",
Body::ToughMeat => "tough_meat",
Body::BeastMeat => "beast_meat",
Body::Crossbow => "crossbow",
Body::ArrowTurret => "arrow_turret",
Body::Coins => "coins",
@ -254,6 +260,9 @@ impl Body {
Body::HaniwaSentry => "haniwa_sentry",
Body::SeaLantern => "sea_lantern",
Body::Snowball => "snowball",
Body::BirdMeat => "bird_meat",
Body::FishMeat => "fish_meat",
Body::SmallMeat => "small_meat",
}
}
@ -333,14 +342,14 @@ impl Body {
| Body::LanternGroundOpen
| Body::LanternStanding
| Body::LanternStanding2 => 3.0,
Body::MeatDrop => 5.0,
Body::ToughMeat => 50.0,
Body::BeastMeat => 50.0,
Body::PotionBlue | Body::PotionGreen | Body::PotionRed => 5.0,
Body::Pouch => 1.0,
Body::Pumpkin | Body::Pumpkin2 | Body::Pumpkin3 | Body::Pumpkin4 | Body::Pumpkin5 => {
10.0
},
Body::Scarecrow => 50.0,
Body::Steak => 2.0,
Body::Table | Body::Table2 | Body::Table3 => 50.0,
Body::Tent => 50.0,
Body::TrainingDummy => 60.0,
@ -351,6 +360,9 @@ impl Body {
Body::HaniwaSentry => 300.0,
Body::SeaLantern => 1000.0,
Body::Snowball => 7360.0, // 2.5 m diamter
Body::FishMeat => 10.0,
Body::BirdMeat => 10.0,
Body::SmallMeat => 10.0,
};
Mass(m)

View File

@ -740,7 +740,7 @@ pub fn get_crit_data(data: &JoinData, ai: AbilityInfo) -> (f32, f32) {
let slot = match ai.hand {
Some(TwoHanded) | Some(MainHand) => EquipSlot::ActiveMainhand,
Some(OffHand) => EquipSlot::ActiveOffhand,
None => return DEFAULT_CRIT_CHANCE, crit_mult),
None => return (DEFAULT_CRIT_CHANCE, crit_mult),
};
if let Some(item) = data.inventory.equipped(slot) {
if let ItemKind::Tool(tool) = item.kind() {

View File

@ -176,7 +176,7 @@ impl Block {
| SpriteKind::WallSconce
| SpriteKind::FireBowlGround => Some(16),
SpriteKind::Velorite | SpriteKind::VeloriteFrag => Some(6),
SpriteKind::CaveMushroom | SpriteKind::CookingPot => Some(12),
SpriteKind::CaveMushroom | SpriteKind::CookingPot | SpriteKind::Crystal => Some(16),
SpriteKind::Amethyst
| SpriteKind::Ruby
| SpriteKind::Sapphire

View File

@ -156,6 +156,7 @@ make_case_elim!(
DungeonChest5 = 0x81,
Loom = 0x82,
SpinningWheel = 0x83,
Crystal = 0x84,
}
);

View File

@ -438,9 +438,16 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc
Some(common::comp::Body::Humanoid(_)) => object::Body::Pouch,
Some(common::comp::Body::BipedSmall(_)) => object::Body::Pouch,
Some(common::comp::Body::Golem(_)) => object::Body::Chest,
Some(common::comp::Body::QuadrupedSmall(_)) => object::Body::SmallMeat,
Some(common::comp::Body::FishMedium(_))
| Some(common::comp::Body::FishSmall(_)) => object::Body::FishMeat,
Some(common::comp::Body::QuadrupedMedium(_)) => object::Body::BeastMeat,
Some(common::comp::Body::BipedLarge(_))
| Some(common::comp::Body::QuadrupedLow(_)) => object::Body::MeatDrop,
_ => object::Body::Steak,
| Some(common::comp::Body::QuadrupedLow(_)) => object::Body::ToughMeat,
Some(common::comp::Body::BirdLarge(_))
| Some(common::comp::Body::BirdMedium(_)) => object::Body::BirdMeat,
_ => object::Body::BeastMeat,
})
.maybe_with(vel)
.with(item)

View File

@ -180,15 +180,29 @@ pub fn apply_caves_to(canvas: &mut Canvas, rng: &mut impl Rng) {
let difficulty = cave_depth / 100.0;
// Scatter things in caves
if rng.gen::<f32>() < 0.001 * difficulty.powf(1.5) && cave_base < surface_z as i32 - 25
{
let kind = *Lottery::<SpriteKind>::load_expect("common.cave_scatter")
.read()
.choose();
canvas.map(Vec3::new(wpos2d.x, wpos2d.y, cave_base), |block| {
block.with_sprite(kind)
});
}
if difficulty.round() < 2.0 {
if rng.gen::<f32>() < 0.3 * difficulty.powf(1.5) * (cave_x.max(0.5).powf(4.0))
&& cave_base < surface_z as i32 - 25
{
let kind = *Lottery::<SpriteKind>::load_expect("common.cave_scatter.shallow")
.read()
.choose();
canvas.map(Vec3::new(wpos2d.x, wpos2d.y, cave_base), |block| {
block.with_sprite(kind)
});
}
} else {
if rng.gen::<f32>() < 0.1 * difficulty.powf(1.5) * (cave_x.max(0.5).powf(4.0))
&& cave_base < surface_z as i32 - 25
{
let kind = *Lottery::<SpriteKind>::load_expect("common.cave_scatter.deep")
.read()
.choose();
canvas.map(Vec3::new(wpos2d.x, wpos2d.y, cave_base), |block| {
block.with_sprite(kind)
});
}
};
}
});
}
@ -229,7 +243,7 @@ pub fn apply_caves_supplement<'a>(
let cave_base = (cave.alt + cave_floor) as i32;
let cave_depth = (col_sample.alt - cave.alt).max(0.0);
let difficulty = cave_depth / 200.0;
let difficulty = cave_depth / 50.0;
// Scatter things in caves
if RandomField::new(index.seed).chance(wpos2d.into(), 0.001 * difficulty)
@ -241,8 +255,8 @@ pub fn apply_caves_supplement<'a>(
wpos2d.y as f32,
cave_base as f32,
))
.with_body(match dynamic_rng.gen_range(0..5) {
0 => {
.with_body(match difficulty.round() as i32 {
0 | 1 | 2 => {
is_hostile = false;
let species = match dynamic_rng.gen_range(0..4) {
0 => comp::quadruped_small::Species::Truffler,
@ -252,34 +266,24 @@ pub fn apply_caves_supplement<'a>(
};
comp::quadruped_small::Body::random_with(dynamic_rng, &species).into()
},
1 => {
3 => {
is_hostile = true;
let species = match dynamic_rng.gen_range(0..2) {
0 => comp::quadruped_medium::Species::Tarasque,
_ => comp::quadruped_medium::Species::Bonerattler,
let species = match dynamic_rng.gen_range(0..3) {
0 => comp::quadruped_low::Species::Rocksnapper,
1 => comp::quadruped_low::Species::Salamander,
_ => comp::quadruped_low::Species::Asp,
};
comp::quadruped_medium::Body::random_with(dynamic_rng, &species).into()
comp::quadruped_low::Body::random_with(dynamic_rng, &species).into()
},
2 => {
4 => {
is_hostile = true;
let species = match dynamic_rng.gen_range(0..3) {
0 => comp::quadruped_low::Species::Rocksnapper,
1 => comp::quadruped_low::Species::Lavadrake,
_ => comp::quadruped_low::Species::Salamander,
_ => comp::quadruped_low::Species::Basilisk,
};
comp::quadruped_low::Body::random_with(dynamic_rng, &species).into()
},
3 => {
is_hostile = true;
let species = match dynamic_rng.gen_range(0..5) {
0 => comp::theropod::Species::Sandraptor,
1 => comp::theropod::Species::Snowraptor,
2 => comp::theropod::Species::Woodraptor,
3 => comp::theropod::Species::Odonto,
_ => comp::theropod::Species::Archaeos,
};
comp::theropod::Body::random_with(dynamic_rng, &species).into()
},
_ => {
is_hostile = true;
let species = match dynamic_rng.gen_range(0..5) {