comment addressing, cave tweaks

This commit is contained in:
jshipsey 2021-06-02 00:26:19 -04:00 committed by Marcel Märtens
parent 0e269b59d7
commit 9034d0f25d
50 changed files with 542 additions and 159 deletions

View File

@ -1,12 +1,12 @@
BasicMelee(
energy_cost: 0,
buildup_duration: 0.6,
swing_duration: 0.1,
recover_duration: 0.15,
buildup_duration: 0.25,
swing_duration: 0.05,
recover_duration: 0.075,
base_damage: 50,
base_poise_damage: 0,
knockback: ( strength: 0.0, direction: Away),
range: 3.5,
range: 4.5,
max_angle: 20.0,
damage_effect: None,
damage_kind: Piercing,

View File

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

View File

@ -6,7 +6,7 @@
(10, AmethystSmall),
(10, TopazSmall),
(16, SapphireSmall),
(60, Crystal),
(60, CrystalLow),
(12, EmeraldSmall),
(30, Cobalt),
(10, Bloodstone),

View File

@ -0,0 +1,5 @@
[
(120, Liana),
(30, AmethystSmall),
(15, TopazSmall),
]

View File

@ -29,7 +29,7 @@ loot_tables: [
(0.2, true, "common.loot_tables.food.prepared"),
// TODO: Change consumables and split them up
(1.0, true, "common.loot_tables.consumable.default"),
(0.5, false, "common.loot_tables.trading"),
(10.5, true, "common.loot_tables.trading"),
],
// this is the amount of that good the most common item represents
// so basically this table balances the goods against each other (higher=less valuable)

View File

@ -1,9 +0,0 @@
ItemDef(
name: "Cloth Scraps",
description: "Looted from humanoids and their houses.",
kind: Ingredient(
kind: "ClothScraps",
),
quality: Common,
tags: [Textile],
)

View File

@ -1,9 +0,0 @@
ItemDef(
name: "Red Cloth Scraps",
description: "Dyed red with flower pigments.",
kind: Ingredient(
kind: "ClothScrapsRed",
),
quality: Common,
tags: [Textile],
)

View File

@ -1,6 +1,6 @@
ItemDef(
name: "Linen",
description: "A textile made from the fibers of a plant.",
description: "A textile made from flax fibers.",
kind: Ingredient(
kind: "Linen",
),

View File

@ -0,0 +1,9 @@
ItemDef(
name: "Red Linen",
description: "A flax fiber textile, dyed to stand out.",
kind: Ingredient(
kind: "LinenRed",
),
quality: Low,
tags: [Textile],
)

View File

@ -8,7 +8,7 @@ ItemDef(
equip_time_secs: 0.25,
power: 0.75,
poise_strength: 0.25,
speed: 0.75,
speed: 1.3,
crit_chance: 0.0,
crit_mult: 1.0,
)),

View File

@ -1,3 +1,3 @@
[
(1.0, Item("common.items.crafting_ing.cloth.wool", 2, 5)),
(1.0, ItemQuantity("common.items.crafting_ing.cloth.wool", 2, 5)),
]

View File

@ -1,6 +1,5 @@
[
(1.0, Item("common.items.crafting_ing.bowl")),
(1.0, Item("common.items.crafting_ing.empty_vial")),
(2.0, Item("common.items.crafting_ing.cloth.cloth_scraps")),
(1.0, Item("common.items.crafting_ing.leather.leather_strips")),
]

View File

@ -1,5 +1,20 @@
// Loot table that exists purely for price rationalisation
[
(1.0, Item("common.items.crafting_ing.honey")),
(0.5, Item("common.items.crafting_ing.animal_misc.icy_fang")),
(0.2, Item("common.items.mineral.ore.bloodstone")),
(1.0, Item("common.items.mineral.ore.coal")),
(0.4, Item("common.items.mineral.ore.cobalt")),
(2.5, Item("common.items.mineral.ore.copper")),
(0.05, Item("common.items.mineral.ore.gold")),
(1.2, Item("common.items.mineral.ore.iron")),
(0.07, Item("common.items.mineral.ore.silver")),
(2.5, Item("common.items.mineral.ore.tin")),
(1.2, Item("common.items.mineral.ore.velorite")),
(0.6, Item("common.items.mineral.ore.veloritefrag")),
(0.8, Item("common.items.mineral.gem.amethyst")),
(0.2, Item("common.items.mineral.gem.diamond")),
(0.6, Item("common.items.mineral.gem.emerald")),
(0.4, Item("common.items.mineral.gem.ruby")),
(0.4, Item("common.items.mineral.gem.sapphire")),
(0.9, Item("common.items.mineral.gem.topaz")),
]

View File

@ -20,7 +20,7 @@
output: ("common.items.crafting_tools.sewing_set", 1),
inputs: [
(Item("common.items.crafting_ing.cloth.linen"), 1),
(Item("common.items.mineral.ore.tin"), 1),
(Item("common.items.mineral.ingot.tin"), 1),
],
craft_sprite: Some(CraftingBench),
),
@ -269,8 +269,8 @@
"bronze ingot": (
output: ("common.items.mineral.ingot.bronze", 2),
inputs: [
(Item("common.items.mineral.ore.copper"), 1),
(Item("common.items.mineral.ore.tin"), 1),
(Item("common.items.mineral.ingot.copper"), 1),
(Item("common.items.mineral.ingot.tin"), 1),
],
craft_sprite: Some(Forge),
),
@ -361,7 +361,7 @@
inputs: [
(Item("common.items.crafting_ing.twigs"), 5),
(Item("common.items.crafting_ing.leather.leather_strips"), 5),
(Item("common.items.crafting_ing.cloth.cloth_scraps"), 10),
(Item("common.items.crafting_ing.cloth.linen"), 10),
(Item("common.items.tool.craftsman_hammer"), 0),
(Item("common.items.crafting_tools.sewing_set"), 0),
],
@ -371,7 +371,7 @@
output: ("common.items.glider.glider_basic_red", 1),
inputs: [
(Item("common.items.crafting_ing.twigs"), 5),
(Item("common.items.crafting_ing.cloth.cloth_scraps_red"), 10),
(Item("common.items.crafting_ing.cloth.linen_red"), 10),
(Item("common.items.crafting_ing.leather.thick_leather"), 4),
(Item("common.items.tool.craftsman_hammer"), 0),
(Item("common.items.crafting_tools.sewing_set"), 0),
@ -383,7 +383,7 @@
inputs: [
(Item("common.items.crafting_ing.twigs"), 5),
(Item("common.items.crafting_ing.leather.thick_leather"), 4),
(Item("common.items.crafting_ing.cloth.cloth_scraps"), 5),
(Item("common.items.crafting_ing.cloth.linen"), 5),
(Item("common.items.mineral.gem.emerald"), 1),
(Item("common.items.tool.craftsman_hammer"), 0),
(Item("common.items.crafting_tools.sewing_set"), 0),
@ -396,7 +396,7 @@
(Item("common.items.crafting_ing.animal_misc.raptor_feather"), 6),
(Item("common.items.crafting_ing.twigs"), 5),
(Item("common.items.crafting_ing.leather.thick_leather"), 4),
(Item("common.items.crafting_ing.cloth.cloth_scraps"), 5),
(Item("common.items.crafting_ing.cloth.linen"), 5),
(Item("common.items.mineral.gem.ruby"), 1),
(Item("common.items.tool.craftsman_hammer"), 0),
(Item("common.items.crafting_tools.sewing_set"), 0),
@ -409,7 +409,7 @@
(Item("common.items.crafting_ing.animal_misc.raptor_feather"), 6),
(Item("common.items.crafting_ing.twigs"), 5),
(Item("common.items.crafting_ing.leather.thick_leather"), 4),
(Item("common.items.crafting_ing.cloth.cloth_scraps"), 5),
(Item("common.items.crafting_ing.cloth.linen"), 5),
(Item("common.items.crafting_ing.animal_misc.icy_fang"), 1),
(Item("common.items.mineral.gem.ruby"), 1),
(Item("common.items.tool.craftsman_hammer"), 0),
@ -423,7 +423,7 @@
(Item("common.items.crafting_ing.animal_misc.raptor_feather"), 6),
(Item("common.items.crafting_ing.twigs"), 15),
(Item("common.items.crafting_ing.leather.leather_strips"), 5),
(Item("common.items.crafting_ing.cloth.cloth_scraps"), 5),
(Item("common.items.crafting_ing.cloth.linen"), 5),
(Item("common.items.mineral.gem.ruby"), 1),
(Item("common.items.tool.craftsman_hammer"), 0),
(Item("common.items.crafting_tools.sewing_set"), 0),
@ -1590,7 +1590,7 @@
"Seashell Necklace": (
output: ("common.items.armor.misc.neck.shell", 1),
inputs: [
(Item("common.items.crafting_ing.cloth.cloth_scraps"), 2),
(Item("common.items.crafting_ing.cloth.linen"), 2),
(Item("common.items.mineral.gem.sapphire"), 1),
(Item("common.items.crafting_ing.seashells"), 3),
(Item("common.items.crafting_tools.sewing_set"), 0),
@ -1598,9 +1598,9 @@
craft_sprite: Some(CraftingBench),
),
"red cloth": (
output: ("common.items.crafting_ing.cloth.cloth_scraps_red", 1),
output: ("common.items.crafting_ing.cloth.linen_red", 1),
inputs: [
(Item("common.items.crafting_ing.cloth.cloth_scraps"), 1),
(Item("common.items.crafting_ing.cloth.linen"), 1),
(Item("common.items.flowers.red"), 1),
(Item("common.items.crafting_tools.mortar_pestle"), 0),
],
@ -1608,7 +1608,7 @@
"tiny red pouch": (
output: ("common.items.armor.misc.bag.tiny_red_pouch", 1),
inputs: [
(Item("common.items.crafting_ing.cloth.cloth_scraps_red"), 3),
(Item("common.items.crafting_ing.cloth.linen_red"), 3),
(Item("common.items.crafting_tools.sewing_set"), 0),
],
),
@ -1622,7 +1622,7 @@
"knitted red pouch": (
output: ("common.items.armor.misc.bag.knitted_red_pouch", 1),
inputs: [
(Item("common.items.crafting_ing.cloth.cloth_scraps_red"), 3),
(Item("common.items.crafting_ing.cloth.linen_red"), 3),
(Item("common.items.armor.misc.bag.tiny_red_pouch"), 2),
(Item("common.items.crafting_tools.sewing_set"), 0),
],
@ -1630,7 +1630,7 @@
"woven red bag": (
output: ("common.items.armor.misc.bag.woven_red_bag", 1),
inputs: [
(Item("common.items.crafting_ing.cloth.cloth_scraps_red"), 6),
(Item("common.items.crafting_ing.cloth.linen_red"), 6),
(Item("common.items.armor.misc.bag.knitted_red_pouch"), 1),
(Item("common.items.crafting_tools.sewing_set"), 0),
],
@ -1640,7 +1640,7 @@
inputs: [
(Item("common.items.mineral.gem.diamond"), 2),
(Item("common.items.crafting_ing.twigs"), 2),
(Item("common.items.crafting_ing.cloth.cloth_scraps"), 3),
(Item("common.items.crafting_ing.cloth.linen"), 3),
(Item("common.items.crafting_ing.leather.leather_strips"), 3),
(Item("common.items.armor.misc.bag.tiny_leather_pouch"), 2),
(Item("common.items.crafting_tools.sewing_set"), 0),
@ -1651,7 +1651,7 @@
output: ("common.items.armor.misc.bag.sturdy_red_backpack", 1),
inputs: [
(Item("common.items.mineral.gem.diamond"), 2),
(Item("common.items.crafting_ing.cloth.cloth_scraps_red"), 3),
(Item("common.items.crafting_ing.cloth.linen_red"), 3),
(Item("common.items.crafting_ing.leather.thick_leather"), 3),
(Item("common.items.armor.misc.bag.woven_red_bag"), 1),
(Item("common.items.crafting_tools.sewing_set"), 0),
@ -1679,14 +1679,14 @@
"pickaxe": (
output: ("common.items.tool.pick", 1),
inputs: [
(Item("common.items.crafting_ing.cloth.cloth_scraps"), 1), // TODO: Replace with plant fiber when obtainable
(Item("common.items.crafting_ing.cloth.linen"), 1), // TODO: Replace with plant fiber when obtainable
(Item("common.items.crafting_ing.stones"), 5), // TODO: Replace with iron ingots when obtainable
(Item("common.items.crafting_ing.twigs"), 4),
(Item("common.items.tool.craftsman_hammer"), 0),
],
craft_sprite: Some(Anvil),
),
"cloth_scraps": (
"linen": (
output: ("common.items.crafting_ing.cloth.linen", 1),
inputs: [
(Tag(Material((material: Linen))), 1),

View File

@ -2573,6 +2573,10 @@
"voxel.sprite.crafting_ing.cloth.sunsilk",
(0.0, 0.0, 0.0), (-65.0, 0.0, 20.0), 0.9,
),
Ingredient("LinenRed"): VoxTrans(
"voxel.sprite.crafting_ing.cloth.linen_red",
(0.0, 0.0, 0.0), (-65.0, 0.0, 20.0), 0.9,
),
Ingredient("SilverIngot"): VoxTrans(
"voxel.sprite.mineral.ingot.silver",
(0.0, 0.0, 0.0), (70.0, 30.0, 170.0), 0.85,
@ -2651,12 +2655,6 @@
Ingredient("TrollLeather"): Png(
"element.items.item_leather_green",
),
Ingredient("ClothScraps"): Png(
"element.items.item_cloth0",
),
Ingredient("ClothScrapsRed"): Png(
"element.items.item_cloth_red",
),
Ingredient("MortarPestle"): Png(
"element.items.item_mortarpestlecoco",
),

View File

@ -70,6 +70,7 @@ const int LASER = 28;
const int BUBBLES = 29;
const int WATER = 30;
const int ICE_SPIKES = 31;
const int DUST = 31;
// meters per second squared (acceleration)
const float earth_gravity = 9.807;
@ -531,6 +532,17 @@ void main() {
spin_in_axis(vec3(1,0,0),0)
);
break;
case DUST:
attr = Attr(
linear_motion(
vec3(0),
normalize(vec3(rand4, rand5, rand6)) + grav_vel(earth_gravity)
),
vec3((2.0 * (1 - slow_start(0.2)))),
vec4(1, 1, 0, 1),
spin_in_axis(vec3(1,0,0),0)
);
break;
default:
attr = Attr(
linear_motion(

BIN
assets/voxygen/voxel/sprite/crafting_ing/cloth/linen_red.vox (Stored with Git LFS) Normal file

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

@ -574,7 +574,7 @@ Liana: Some((
lod_axes: (0.0, 0.0, 0.5),
),
],
wind_sway: 0.05,
wind_sway: 0.0,
)),
// Velorite
@ -2982,15 +2982,110 @@ Gold: Some((
],
wind_sway: 0.0,
)),
Crystal: Some((
CrystalHigh: 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),
model: "voxygen.voxel.sprite.mineral.deposit.crystal.ceiling.blue-0",
offset: (-8.5, -9.0, -7.0),
lod_axes: (1.0, 1.0, 1.0),
),
],
wind_sway: 0.0,
(
model: "voxygen.voxel.sprite.mineral.deposit.crystal.ceiling.blue-1",
offset: (-8.0, -8.0, -10.0),
lod_axes: (1.0, 1.0, 1.0),
),
(
model: "voxygen.voxel.sprite.mineral.deposit.crystal.ceiling.blue-2",
offset: (-11.5, -12.5, -9.0),
lod_axes: (1.0, 1.0, 1.0),
),
(
model: "voxygen.voxel.sprite.mineral.deposit.crystal.ceiling.purple-0",
offset: (-8.5, -9.0, -7.0),
lod_axes: (1.0, 1.0, 1.0),
),
(
model: "voxygen.voxel.sprite.mineral.deposit.crystal.ceiling.purple-1",
offset: (-8.0, -8.0, -10.0),
lod_axes: (1.0, 1.0, 1.0),
),
(
model: "voxygen.voxel.sprite.mineral.deposit.crystal.ceiling.purple-2",
offset: (-11.5, -12.5, -9.0),
lod_axes: (1.0, 1.0, 1.0),
),
(
model: "voxygen.voxel.sprite.mineral.deposit.crystal.ceiling.purple-3",
offset: (-11.5, -12.5, -49.0),
lod_axes: (1.0, 1.0, 1.0),
),
(
model: "voxygen.voxel.sprite.mineral.deposit.crystal.ceiling.green-0",
offset: (-8.5, -9.0, -7.0),
lod_axes: (1.0, 1.0, 1.0),
),
(
model: "voxygen.voxel.sprite.mineral.deposit.crystal.ceiling.green-1",
offset: (-8.0, -8.0, -10.0),
lod_axes: (1.0, 1.0, 1.0),
),
(
model: "voxygen.voxel.sprite.mineral.deposit.crystal.ceiling.green-2",
offset: (-11.5, -12.5, -9.0),
lod_axes: (1.0, 1.0, 1.0),
)
],
wind_sway: 0.0,
)),
CrystalLow: Some((
variations: [
(
model: "voxygen.voxel.sprite.mineral.deposit.crystal.floor.blue-0",
offset: (-8.5, -9.0, 0.0),
lod_axes: (1.0, 1.0, 1.0),
),
(
model: "voxygen.voxel.sprite.mineral.deposit.crystal.floor.blue-1",
offset: (-8.0, -8.0, 0.0),
lod_axes: (1.0, 1.0, 1.0),
),
(
model: "voxygen.voxel.sprite.mineral.deposit.crystal.floor.blue-2",
offset: (-11.5, -12.5, 0.0),
lod_axes: (1.0, 1.0, 1.0),
),
(
model: "voxygen.voxel.sprite.mineral.deposit.crystal.floor.purple-0",
offset: (-8.5, -9.0, 0.0),
lod_axes: (1.0, 1.0, 1.0),
),
(
model: "voxygen.voxel.sprite.mineral.deposit.crystal.floor.purple-1",
offset: (-8.0, -8.0, 0.0),
lod_axes: (1.0, 1.0, 1.0),
),
(
model: "voxygen.voxel.sprite.mineral.deposit.crystal.floor.purple-2",
offset: (-11.5, -12.5, 0.0),
lod_axes: (1.0, 1.0, 1.0),
),
(
model: "voxygen.voxel.sprite.mineral.deposit.crystal.floor.green-0",
offset: (-8.5, -9.0, 0.0),
lod_axes: (1.0, 1.0, 1.0),
),
(
model: "voxygen.voxel.sprite.mineral.deposit.crystal.floor.green-1",
offset: (-8.0, -8.0, 0.0),
lod_axes: (1.0, 1.0, 1.0),
),
(
model: "voxygen.voxel.sprite.mineral.deposit.crystal.floor.green-2",
offset: (-11.5, -12.5, 0.0),
lod_axes: (1.0, 1.0, 1.0),
)
],
wind_sway: 0.0,
)),
Cotton: Some((
variations: [
@ -3000,7 +3095,7 @@ Cotton: Some((
lod_axes: (0.0, 0.0, 0.0),
),
],
wind_sway: 0.0,
wind_sway: 0.4,
)),
Moonbell: Some((
variations: [

View File

@ -59,7 +59,12 @@
deep_stone_color: (125, 120, 130),
layer: (
bridge: (80, 80, 100),
stalagtite: (77, 91, 161),
stalagtite: (90, 71, 112),
cave_floor: (42, 39, 82),
cave_roof: (38, 21, 79),
dirt: (69, 48, 15),
scaffold: (195, 190, 212),
vein: (222, 140, 39),
),
site: (
castle: (),

View File

@ -859,12 +859,12 @@ impl Item {
SpriteKind::Diamond => "common.items.mineral.gem.diamond",
SpriteKind::Sapphire => "common.items.mineral.gem.sapphire",
SpriteKind::Topaz => "common.items.mineral.gem.topaz",
SpriteKind::Emerald => "common.items.mineral.emerald",
SpriteKind::Emerald => "common.items.mineral.gem.emerald",
SpriteKind::AmethystSmall => "common.items.mineral.gem.amethyst",
SpriteKind::TopazSmall => "common.items.mineral.gem.topaz",
SpriteKind::DiamondSmall => "common.items.mineral.gem.diamond",
SpriteKind::RubySmall => "common.items.mineral.gem.ruby",
SpriteKind::EmeraldSmall => "common.items.mineral.emerald",
SpriteKind::EmeraldSmall => "common.items.mineral.gem.emerald",
SpriteKind::SapphireSmall => "common.items.mineral.gem.sapphire",
SpriteKind::Bloodstone => "common.items.mineral.ore.bloodstone",
SpriteKind::Coal => "common.items.mineral.ore.coal",

View File

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

View File

@ -156,7 +156,7 @@ make_case_elim!(
DungeonChest5 = 0x81,
Loom = 0x82,
SpinningWheel = 0x83,
Crystal = 0x84,
CrystalHigh = 0x84,
Bloodstone = 0x85,
Coal = 0x86,
Cobalt = 0x87,
@ -170,6 +170,7 @@ make_case_elim!(
Pyrebloom = 0x8F,
TanningRack = 0x90,
WildFlax = 0x91,
CrystalLow = 0x92,
}
);
@ -244,7 +245,7 @@ impl SpriteKind {
// TODO: Figure out if this should be solid or not.
SpriteKind::Shelf => 1.0,
SpriteKind::Lantern => 0.9,
SpriteKind::Crystal => 1.5,
SpriteKind::CrystalHigh | SpriteKind::CrystalLow => 1.5,
SpriteKind::Bloodstone
| SpriteKind::Coal
| SpriteKind::Cobalt

View File

@ -90,9 +90,9 @@ SET item_definition_id = 'common.items.crafting_ing.hide.carapace' WHERE item_de
UPDATE item
SET item_definition_id = 'common.items.crafting_ing.animal_misc.claw' WHERE item_definition_id = 'common.items.crafting_ing.claw';
UPDATE item
SET item_definition_id = 'common.items.crafting_ing.cloth.cloth_scraps' WHERE item_definition_id = 'common.items.crafting_ing.cloth_scraps';
SET item_definition_id = 'common.items.crafting_ing.cloth.cloth_scraps' WHERE item_definition_id = 'common.items.crafting_ing.linen';
UPDATE item
SET item_definition_id = 'common.items.crafting_ing.cloth.cloth_scraps_red' WHERE item_definition_id = 'common.items.crafting_ing.cloth_scraps_red';
SET item_definition_id = 'common.items.crafting_ing.cloth.cloth_scraps_red' WHERE item_definition_id = 'common.items.crafting_ing.linen_red';
UPDATE item
SET item_definition_id = 'common.items.mineral.ore.coal' WHERE item_definition_id = 'common.items.crafting_ing.coal';
UPDATE item

View File

@ -82,6 +82,7 @@ pub enum ParticleMode {
Bubbles = 29,
Water = 30,
IceSpikes = 31,
Dust = 32,
}
impl ParticleMode {

View File

@ -1047,6 +1047,14 @@ impl ParticleMgr {
mode: ParticleMode::Leaf,
cond: |_| true,
},
BlockParticles {
blocks: |boi| &boi.dust,
range: 4,
rate: 0.004,
lifetime: 20.0,
mode: ParticleMode::Dust,
cond: |_| true,
},
BlockParticles {
blocks: |boi| &boi.fires,
range: 2,

View File

@ -16,6 +16,7 @@ pub enum Interaction {
#[derive(Default)]
pub struct BlocksOfInterest {
pub leaves: Vec<Vec3<i32>>,
pub dust: Vec<Vec3<i32>>,
pub grass: Vec<Vec3<i32>>,
pub river: Vec<Vec3<i32>>,
pub fires: Vec<Vec3<i32>>,
@ -41,6 +42,7 @@ impl BlocksOfInterest {
pub fn from_chunk(chunk: &TerrainChunk) -> Self {
span!(_guard, "from_chunk", "BlocksOfInterest::from_chunk");
let mut leaves = Vec::new();
let mut dust = Vec::new();
let mut grass = Vec::new();
let mut river = Vec::new();
let mut fires = Vec::new();
@ -70,6 +72,7 @@ impl BlocksOfInterest {
.for_each(|(pos, block)| {
match block.kind() {
BlockKind::Leaves if thread_rng().gen_range(0..16) == 0 => leaves.push(pos),
BlockKind::WeakRock if thread_rng().gen_range(0..6) == 0 => dust.push(pos),
BlockKind::Grass => {
if thread_rng().gen_range(0..16) == 0 {
grass.push(pos);
@ -101,6 +104,7 @@ impl BlocksOfInterest {
},
Some(SpriteKind::WallSconce) => fire_bowls.push(pos + Vec3::unit_z()),
Some(SpriteKind::Beehive) => beehives.push(pos),
Some(SpriteKind::CrystalHigh) => fireflies.push(pos),
Some(SpriteKind::Reed) => {
reeds.push(pos);
fireflies.push(pos);
@ -152,6 +156,7 @@ impl BlocksOfInterest {
Self {
leaves,
dust,
grass,
river,
fires,

View File

@ -30,6 +30,11 @@ use vek::*;
pub struct Colors {
pub bridge: (u8, u8, u8),
pub stalagtite: (u8, u8, u8),
pub cave_floor: (u8, u8, u8),
pub cave_roof: (u8, u8, u8),
pub dirt: (u8, u8, u8),
pub scaffold: (u8, u8, u8),
pub vein: (u8, u8, u8),
}
const EMPTY_AIR: Block = Block::air(SpriteKind::Empty);
@ -118,6 +123,8 @@ pub fn apply_caves_to(canvas: &mut Canvas, rng: &mut impl Rng) {
let cave_x = (cave_dist / cave.width).min(1.0);
// Relative units
let cave_depth = (col.alt - cave.alt).max(0.0);
let cave_floor = 0.0 - 0.5 * (1.0 - cave_x.powi(2)).max(0.0).sqrt() * cave.width;
let cave_height = (1.0 - cave_x.powi(2)).max(0.0).sqrt() * cave.width;
@ -144,7 +151,26 @@ pub fn apply_caves_to(canvas: &mut Canvas, rng: &mut impl Rng) {
});
}
}
let noisy_color = |color: Rgb<u8>, factor: u32| {
let nz = RandomField::new(0).get(Vec3::new(wpos2d.x, wpos2d.y, surface_z));
color.map(|e| {
(e as u32 + nz % (factor * 2))
.saturating_sub(factor)
.min(255) as u8
})
};
let difficulty = cave_depth / 100.0;
let ridge_condition = cave_depth % 10.0 > 8.0;
let pit_condition = cave_depth % 35.0 > 30.0 && cave_x > 0.4 && cave_depth > 200.0;
let pit_depth = 30;
let floor_dist = pit_condition as i32 * pit_depth as i32;
let vein_condition =
cave_depth % 12.0 > 11.8 && cave_x > 0.4 && cave_x < 0.65 && cave_depth > 200.0;
let stalagtite_condition = cave_depth > 150.0;
let vein_dist = 2;
let vein_floor = cave_base - vein_dist;
// Stalagtites
let stalagtites = info
.index()
@ -164,61 +190,216 @@ pub fn apply_caves_to(canvas: &mut Canvas, rng: &mut impl Rng) {
if canvas
.get(Vec3::new(wpos2d.x, wpos2d.y, cave_roof))
.is_filled()
&& stalagtite_condition
{
for z in cave_roof - stalagtites..cave_roof {
canvas.set(
Vec3::new(wpos2d.x, wpos2d.y, z),
Block::new(
BlockKind::WeakRock,
info.index().colors.layer.stalagtite.into(),
noisy_color(info.index().colors.layer.stalagtite.into(), 8),
),
);
}
}
let cave_depth = (col.alt - cave.alt).max(0.0);
let difficulty = cave_depth / 100.0;
let ground_colors = if cave_roof - cave_base > 23 {
noisy_color(info.index().colors.layer.cave_floor.into(), 8)
} else {
noisy_color(info.index().colors.layer.dirt.into(), 8)
};
//make pits
for z in cave_base - pit_depth..cave_base {
if pit_condition && (cave_roof - cave_base) > 10 {
canvas.set(
Vec3::new(wpos2d.x, wpos2d.y, z),
Block::new(
BlockKind::Air,
noisy_color(info.index().colors.layer.scaffold.into(), 8),
),
);
}
}
//fill bottom of pits
for z in cave_base - pit_depth
..cave_base - pit_depth + ((cave_x.powf(4.0) * pit_depth as f32 + 3.0) as i32) + 1
{
if (cave_roof - cave_base) > 10 && pit_condition {
canvas.set(
Vec3::new(wpos2d.x, wpos2d.y, z),
Block::new(BlockKind::WeakRock, ground_colors),
);
}
}
//empty veins
for z in cave_base - vein_dist..cave_base {
if vein_condition {
canvas.set(
Vec3::new(wpos2d.x, wpos2d.y, z),
Block::new(
BlockKind::Air,
noisy_color(info.index().colors.layer.scaffold.into(), 8),
),
);
}
}
//fill veins except bottom later
for z in cave_base - vein_dist + 1..cave_base {
if vein_condition {
canvas.set(
Vec3::new(wpos2d.x, wpos2d.y, z),
Block::new(
BlockKind::WeakRock,
noisy_color(info.index().colors.layer.vein.into(), 8),
),
);
}
}
//fill some of bottom
for z in cave_base - vein_dist..cave_base - vein_dist + 1 {
if rng.gen::<f32>() < 0.5 && vein_condition {
canvas.set(
Vec3::new(wpos2d.x, wpos2d.y, z),
Block::new(
BlockKind::WeakRock,
noisy_color(info.index().colors.layer.vein.into(), 8),
),
);
}
}
if vein_condition && cave_base < surface_z as i32 - 25 {
let kind = *Lottery::<SpriteKind>::load_expect("common.cave_scatter.deep_floor")
.read()
.choose();
canvas.map(Vec3::new(wpos2d.x, wpos2d.y, vein_floor), |block| {
block.with_sprite(kind)
});
}
//fill normal floor
for z in cave_base..cave_base + 1 {
if cave_depth > 15.0
&& (cave_roof - cave_base) > 10
&& !pit_condition
&& !vein_condition
{
canvas.set(
Vec3::new(wpos2d.x, wpos2d.y, z),
Block::new(BlockKind::WeakRock, ground_colors),
);
}
}
//fill roof
for z in cave_roof - 1..cave_roof {
if cave_depth > 30.0 && (cave_roof - cave_base) > 10 {
canvas.set(
Vec3::new(wpos2d.x, wpos2d.y, z),
Block::new(
BlockKind::WeakRock,
noisy_color(info.index().colors.layer.cave_roof.into(), 8),
),
);
}
}
//add ridges
for z in cave_roof - 4..cave_roof {
if cave_depth > 50.0 && ridge_condition && (cave_roof - cave_base) > 10 {
canvas.set(
Vec3::new(wpos2d.x, wpos2d.y, z),
Block::new(
BlockKind::WeakRock,
noisy_color(info.index().colors.layer.scaffold.into(), 8),
),
);
}
}
let cave_roof_adjusted = if (cave_roof - cave_base) > 10 {
cave_roof - 1
} else {
cave_roof
};
let cave_floor_adjusted = if (cave_roof - cave_base) > 10 {
cave_base + 1 - floor_dist
} else {
cave_base - floor_dist
};
// Scatter things in caves
if difficulty.round() < 2.0 {
if cave_depth < 80.0 {
if rng.gen::<f32>()
< 0.75 * (difficulty / 2.0).powf(2.5) * (cave_x.max(0.5).powf(4.0))
&& cave_base < surface_z as i32 - 25
< 0.3 * (difficulty / 3.0).powf(2.5) * (cave_x.max(0.5).powf(4.0))
&& !vein_condition
{
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)
});
let kind2 = *Lottery::<SpriteKind>::load_expect("common.cave_scatter.shallow")
.read()
.choose();
canvas.map(Vec3::new(wpos2d.x, wpos2d.y, cave_roof - 1), |block| {
block.with_sprite(kind2)
});
let kind =
*Lottery::<SpriteKind>::load_expect("common.cave_scatter.deep_floor")
.read()
.choose();
canvas.map(
Vec3::new(wpos2d.x, wpos2d.y, cave_floor_adjusted),
|block| block.with_sprite(kind),
);
}
if rng.gen::<f32>() < 0.3 * (difficulty / 3.0).powf(2.5) && !ridge_condition {
let kind =
*Lottery::<SpriteKind>::load_expect("common.cave_scatter.shallow_ceiling")
.read()
.choose();
canvas.map(
Vec3::new(wpos2d.x, wpos2d.y, cave_roof_adjusted - 1),
|block| block.with_sprite(kind),
);
}
} else if cave_depth < 150.0 {
if rng.gen::<f32>()
< 0.3 * (difficulty / 3.0).powf(2.5) * (cave_x.max(0.5).powf(4.0))
&& !vein_condition
{
let kind =
*Lottery::<SpriteKind>::load_expect("common.cave_scatter.deep_floor")
.read()
.choose();
canvas.map(
Vec3::new(wpos2d.x, wpos2d.y, cave_floor_adjusted),
|block| block.with_sprite(kind),
);
}
if rng.gen::<f32>() < 0.3 * (difficulty / 3.0).powf(2.5) && !ridge_condition {
let kind =
*Lottery::<SpriteKind>::load_expect("common.cave_scatter.deep_ceiling")
.read()
.choose();
canvas.map(
Vec3::new(wpos2d.x, wpos2d.y, cave_roof_adjusted - 1),
|block| block.with_sprite(kind),
);
}
} else {
if rng.gen::<f32>()
< 0.3 * (difficulty / 3.0).powf(2.5) * (cave_x.max(0.5).powf(4.0))
&& cave_base < surface_z as i32 - 25
&& !vein_condition
{
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)
});
let kind =
*Lottery::<SpriteKind>::load_expect("common.cave_scatter.shallow_floor")
.read()
.choose();
canvas.map(
Vec3::new(wpos2d.x, wpos2d.y, cave_floor_adjusted),
|block| block.with_sprite(kind),
);
}
if rng.gen::<f32>() < 0.3 * (difficulty / 3.0).powf(2.5)
&& 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_roof - 1), |block| {
block.with_sprite(kind)
});
if rng.gen::<f32>() < 0.3 * (difficulty / 3.0).powf(2.5) && !ridge_condition {
let kind =
*Lottery::<SpriteKind>::load_expect("common.cave_scatter.shallow_ceiling")
.read()
.choose();
canvas.map(
Vec3::new(wpos2d.x, wpos2d.y, cave_roof_adjusted - 1),
|block| block.with_sprite(kind),
);
}
};
}
@ -260,7 +441,7 @@ pub fn apply_caves_supplement<'a>(
// Abs units
let cave_base = (cave.alt + cave_floor) as i32;
let cave_depth = (col_sample.alt - cave.alt).max(0.0);
let cave_depth = (col_sample.alt - cave.alt).max(0.0); //slightly different from earlier cave depth?
let difficulty = cave_depth / 50.0;
// Scatter things in caves
@ -273,49 +454,44 @@ pub fn apply_caves_supplement<'a>(
wpos2d.y as f32,
cave_base as f32,
))
.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,
1 => comp::quadruped_small::Species::Dodarock,
2 => comp::quadruped_small::Species::Holladon,
_ => comp::quadruped_small::Species::Batfox,
};
comp::quadruped_small::Body::random_with(dynamic_rng, &species).into()
},
3 => {
is_hostile = true;
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_low::Body::random_with(dynamic_rng, &species).into()
},
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::Basilisk,
};
comp::quadruped_low::Body::random_with(dynamic_rng, &species).into()
},
_ => {
is_hostile = true;
let species = match dynamic_rng.gen_range(0..5) {
0 => comp::biped_large::Species::Ogre,
1 => comp::biped_large::Species::Cyclops,
2 => comp::biped_large::Species::Wendigo,
3 => match dynamic_rng.gen_range(0..2) {
0 => comp::biped_large::Species::Blueoni,
_ => comp::biped_large::Species::Redoni,
},
_ => comp::biped_large::Species::Troll,
};
comp::biped_large::Body::random_with(dynamic_rng, &species).into()
},
.with_body(if cave_depth < 80.0 {
is_hostile = false;
let species = match dynamic_rng.gen_range(0..4) {
0 => comp::quadruped_small::Species::Truffler,
1 => comp::quadruped_small::Species::Dodarock,
2 => comp::quadruped_small::Species::Holladon,
_ => comp::quadruped_small::Species::Batfox,
};
comp::quadruped_small::Body::random_with(dynamic_rng, &species).into()
} else if cave_depth < 130.0 {
is_hostile = true;
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_low::Body::random_with(dynamic_rng, &species).into()
} else if cave_depth < 250.0 {
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::Basilisk,
};
comp::quadruped_low::Body::random_with(dynamic_rng, &species).into()
} else {
is_hostile = true;
let species = match dynamic_rng.gen_range(0..5) {
0 => comp::biped_large::Species::Ogre,
1 => comp::biped_large::Species::Cyclops,
2 => comp::biped_large::Species::Wendigo,
3 => match dynamic_rng.gen_range(0..2) {
0 => comp::biped_large::Species::Blueoni,
_ => comp::biped_large::Species::Redoni,
},
_ => comp::biped_large::Species::Troll,
};
comp::biped_large::Body::random_with(dynamic_rng, &species).into()
})
.with_alignment(if is_hostile {
comp::Alignment::Enemy
@ -397,10 +573,7 @@ pub fn apply_coral_to(canvas: &mut Canvas) {
});
if is_coral {
let _ = canvas.set(
wpos,
Block::new(BlockKind::WeakRock, Rgb::new(170, 220, 210)),
);
let _ = canvas.set(wpos, Block::new(BlockKind::Rock, Rgb::new(170, 220, 210)));
}
}
});

View File

@ -163,7 +163,7 @@ pub fn apply_scatter_to(canvas: &mut Canvas, rng: &mut impl Rng) {
((c.rockiness - 0.5).max(0.025) * 1.0e-3, None)
}),
(Copper, false, |c, _| {
((c.rockiness - 0.5).max(0.025) * 1.5e-3, None)
((c.rockiness - 0.1).max(0.025) * 1.5e-3, None)
}),
(Tin, false, |c, _| {
((c.rockiness - 0.5).max(0.025) * 1.5e-3, None)
@ -283,7 +283,7 @@ pub fn apply_scatter_to(canvas: &mut Canvas, rng: &mut impl Rng) {
}),
(Pyrebloom, false, |c, _| {
(
close(c.temp, 1.0, 0.95).min(close(c.humidity, 0.0, 0.3)) * MUSH_FACT * 0.75,
close(c.temp, 1.0, 0.95).min(close(c.humidity, 0.0, 0.3)) * MUSH_FACT * 0.35,
None,
)
}),

View File

@ -1224,7 +1224,7 @@ fn mini_boss_1(dynamic_rng: &mut impl Rng, tile_wcenter: Vec3<i32>) -> Vec<Entit
}
fn mini_boss_2(dynamic_rng: &mut impl Rng, tile_wcenter: Vec3<i32>) -> Vec<EntityInfo> {
let chosen = Lottery::<LootSpec>::load_expect("common.loot_tables.creature.quad_low.default");
let chosen = Lottery::<LootSpec>::load_expect("common.loot_tables.creature.quad_low.fanged");
let mut entities = Vec::new();
entities.resize_with(6, || {
EntityInfo::at(tile_wcenter.map(|e| e as f32))
@ -1242,7 +1242,7 @@ fn mini_boss_2(dynamic_rng: &mut impl Rng, tile_wcenter: Vec3<i32>) -> Vec<Entit
fn mini_boss_3(dynamic_rng: &mut impl Rng, tile_wcenter: Vec3<i32>) -> Vec<EntityInfo> {
let chosen =
Lottery::<LootSpec>::load_expect("common.loot_tables.creature.quad_medium.default");
Lottery::<LootSpec>::load_expect("common.loot_tables.creature.quad_medium.carapace");
let mut entities = Vec::new();
entities.resize_with(3, || {
EntityInfo::at(tile_wcenter.map(|e| e as f32))