From 1d6b7d6a0320caed8899bc587df1b7c0c9c3b9e8 Mon Sep 17 00:00:00 2001 From: IsseW Date: Sun, 9 Oct 2022 21:35:04 +0200 Subject: [PATCH 01/14] Add Halloween event --- common/src/calendar.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/src/calendar.rs b/common/src/calendar.rs index 830207809c..c2cf2299c4 100644 --- a/common/src/calendar.rs +++ b/common/src/calendar.rs @@ -6,6 +6,7 @@ use serde::{Deserialize, Serialize}; #[repr(u16)] pub enum CalendarEvent { Christmas = 0, + Halloween = 1, } #[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] @@ -37,6 +38,10 @@ impl Calendar { this.events.push(CalendarEvent::Christmas); } + if now.month() == 10 && (01..=31).contains(&now.day()) { + this.events.push(CalendarEvent::Halloween); + } + this } } From 9c4736f47b080fe2982ee0c8c3e464c899127a39 Mon Sep 17 00:00:00 2001 From: IsseW Date: Sun, 9 Oct 2022 22:49:17 +0200 Subject: [PATCH 02/14] Make pumpkins more common for Halloween --- world/src/layer/scatter.rs | 38 +++++++++++++++++++++++++------------- world/src/lib.rs | 2 +- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/world/src/layer/scatter.rs b/world/src/layer/scatter.rs index 044c5e556f..ecb733e1f4 100644 --- a/world/src/layer/scatter.rs +++ b/world/src/layer/scatter.rs @@ -1,5 +1,8 @@ use crate::{column::ColumnSample, sim::SimChunk, Canvas, CONFIG}; -use common::terrain::{Block, BlockKind, SpriteKind}; +use common::{ + calendar::{Calendar, CalendarEvent}, + terrain::{Block, BlockKind, SpriteKind}, +}; use noise::NoiseFn; use num::traits::Pow; use rand::prelude::*; @@ -27,7 +30,7 @@ pub fn density_factor_by_altitude(lower_limit: f32, altitude: f32, upper_limit: const MUSH_FACT: f32 = 1.0e-4; // To balance things around the mushroom spawning rate const GRASS_FACT: f32 = 1.0e-3; // To balance things around the grass spawning rate const DEPTH_WATER_NORM: f32 = 15.0; // Water depth at which regular underwater sprites start spawning -pub fn apply_scatter_to(canvas: &mut Canvas, rng: &mut impl Rng) { +pub fn apply_scatter_to(canvas: &mut Canvas, rng: &mut impl Rng, calendar: Option<&Calendar>) { enum WaterMode { Underwater, Floating, @@ -283,17 +286,26 @@ pub fn apply_scatter_to(canvas: &mut Canvas, rng: &mut impl Rng) { kind: Pumpkin, water_mode: Ground, permit: |b| matches!(b, BlockKind::Grass), - f: |_, col| { - ( - close(col.temp, CONFIG.temperate_temp, 0.5).min(close( - col.humidity, - CONFIG.forest_hum, - 0.5, - )) * MUSH_FACT - * 500.0, - Some((0.0, 512.0, 0.05)), - ) - }, + f: if calendar.map_or(false, |calendar| calendar.is_event(CalendarEvent::Halloween)) { + |_, _| { + ( + 0.1, + Some((0.0003, 128.0, 0.1)), + ) + } + } else { + |_, col| { + ( + close(col.temp, CONFIG.temperate_temp, 0.5).min(close( + col.humidity, + CONFIG.forest_hum, + 0.5, + )) * MUSH_FACT + * 500.0, + Some((0.0, 512.0, 0.05)), + ) + } + }, }, // Collectable Objects // Only spawn twigs in temperate forests diff --git a/world/src/lib.rs b/world/src/lib.rs index 27f7ec5dd5..8ed0228c99 100644 --- a/world/src/lib.rs +++ b/world/src/lib.rs @@ -375,7 +375,7 @@ impl World { layer::apply_trees_to(&mut canvas, &mut dynamic_rng, calendar); } if index.features.scatter { - layer::apply_scatter_to(&mut canvas, &mut dynamic_rng); + layer::apply_scatter_to(&mut canvas, &mut dynamic_rng, calendar); } if index.features.paths { layer::apply_paths_to(&mut canvas); From 3b2eba14577b0cdc11918bd6b971e6446ba338e4 Mon Sep 17 00:00:00 2001 From: Isse Date: Thu, 13 Oct 2022 21:15:22 +0200 Subject: [PATCH 03/14] autumn leaves --- world/src/block/mod.rs | 13 +++++++++++++ world/src/layer/scatter.rs | 37 +++++++++++++++++-------------------- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/world/src/block/mod.rs b/world/src/block/mod.rs index f7390bbde1..df7c234151 100644 --- a/world/src/block/mod.rs +++ b/world/src/block/mod.rs @@ -265,6 +265,19 @@ pub fn block_from_structure( && field.chance(pos + structure_pos, 0.025) { Block::new(BlockKind::GlowingWeakRock, Rgb::new(255, 0, 0)) + } else if calendar.map_or(false, |c| c.is_event(CalendarEvent::Halloween)) + && sblock != StructureBlock::PineLeaves + { + let (c0, c1) = match structure_seed % 6 { + 0 => (Rgb::new(165.0, 150.0, 11.0), Rgb::new(170.0, 165.0, 16.0)), + 1 | 2 => (Rgb::new(218.0, 53.0, 3.0), Rgb::new(226.0, 62.0, 5.0)), + _ => (Rgb::new(230.0, 120.0, 20.0), Rgb::new(242.0, 130.0, 25.0)), + }; + + Block::new( + BlockKind::Leaves, + Rgb::::lerp(c0, c1, lerp).map(|e| e as u8), + ) } else { Block::new( BlockKind::Leaves, diff --git a/world/src/layer/scatter.rs b/world/src/layer/scatter.rs index ecb733e1f4..e59de70cc3 100644 --- a/world/src/layer/scatter.rs +++ b/world/src/layer/scatter.rs @@ -286,26 +286,23 @@ pub fn apply_scatter_to(canvas: &mut Canvas, rng: &mut impl Rng, calendar: Optio kind: Pumpkin, water_mode: Ground, permit: |b| matches!(b, BlockKind::Grass), - f: if calendar.map_or(false, |calendar| calendar.is_event(CalendarEvent::Halloween)) { - |_, _| { - ( - 0.1, - Some((0.0003, 128.0, 0.1)), - ) - } - } else { - |_, col| { - ( - close(col.temp, CONFIG.temperate_temp, 0.5).min(close( - col.humidity, - CONFIG.forest_hum, - 0.5, - )) * MUSH_FACT - * 500.0, - Some((0.0, 512.0, 0.05)), - ) - } - }, + f: if calendar.map_or(false, |calendar| { + calendar.is_event(CalendarEvent::Halloween) + }) { + |_, _| (0.1, Some((0.0003, 128.0, 0.1))) + } else { + |_, col| { + ( + close(col.temp, CONFIG.temperate_temp, 0.5).min(close( + col.humidity, + CONFIG.forest_hum, + 0.5, + )) * MUSH_FACT + * 500.0, + Some((0.0, 512.0, 0.05)), + ) + } + }, }, // Collectable Objects // Only spawn twigs in temperate forests From 1d98050f282490d10aef79f0ce5a138f8bf6b7c8 Mon Sep 17 00:00:00 2001 From: flo666 Date: Wed, 19 Oct 2022 23:25:10 +0200 Subject: [PATCH 04/14] halloween npcs: in forests, spawn harvester or dullahans or tricksters with custom halloween loot: facegourd, pumpkin_spice_brew, honeygourd --- .../aggressive/halloween_dullahan.ron | 11 ++++ .../aggressive/halloween_harvester.ron | 11 ++++ .../halloween/aggressive/trickster.ron | 24 +++++++++ .../items/armor/misc/head/facegourd.ron | 13 +++++ assets/common/items/food/honeycorn.ron | 22 ++++++++ .../common/items/food/pumpkin_spice_brew.ron | 22 ++++++++ .../loadout/calendar/halloween/trickster.ron | 31 +++++++++++ .../calendar/halloween/halloween_dullahan.ron | 4 ++ .../halloween/halloween_harvester.ron | 9 ++++ .../calendar/halloween/trickster.ron | 4 ++ assets/voxygen/item_image_manifest.ron | 12 +++++ .../voxel/armor/misc/head/facegourd.vox | 3 ++ .../voxel/humanoid_armor_head_manifest.ron | 49 +++++++++++++++++ assets/voxygen/voxel/item_drop_manifest.ron | 3 ++ assets/voxygen/voxel/object/honeycorn.vox | 3 ++ .../voxel/object/pumpkin_spice_brew.vox | 3 ++ .../spawn/calendar/halloween/halloween.ron | 17 ++++++ world/src/layer/wildlife.rs | 53 +++++++++++++++++++ 18 files changed, 294 insertions(+) create mode 100644 assets/common/entity/calendar/halloween/aggressive/halloween_dullahan.ron create mode 100644 assets/common/entity/calendar/halloween/aggressive/halloween_harvester.ron create mode 100644 assets/common/entity/calendar/halloween/aggressive/trickster.ron create mode 100644 assets/common/items/armor/misc/head/facegourd.ron create mode 100644 assets/common/items/food/honeycorn.ron create mode 100644 assets/common/items/food/pumpkin_spice_brew.ron create mode 100644 assets/common/loadout/calendar/halloween/trickster.ron create mode 100644 assets/common/loot_tables/calendar/halloween/halloween_dullahan.ron create mode 100644 assets/common/loot_tables/calendar/halloween/halloween_harvester.ron create mode 100644 assets/common/loot_tables/calendar/halloween/trickster.ron create mode 100644 assets/voxygen/voxel/armor/misc/head/facegourd.vox create mode 100644 assets/voxygen/voxel/object/honeycorn.vox create mode 100644 assets/voxygen/voxel/object/pumpkin_spice_brew.vox create mode 100644 assets/world/wildlife/spawn/calendar/halloween/halloween.ron diff --git a/assets/common/entity/calendar/halloween/aggressive/halloween_dullahan.ron b/assets/common/entity/calendar/halloween/aggressive/halloween_dullahan.ron new file mode 100644 index 0000000000..41f19ca040 --- /dev/null +++ b/assets/common/entity/calendar/halloween/aggressive/halloween_dullahan.ron @@ -0,0 +1,11 @@ +#![enable(implicit_some)] +( + name: Name("Dullahan"), + body: RandomWith("dullahan"), + alignment: Alignment(Enemy), + loot: LootTable("common.loot_tables.calendar.halloween.halloween_dullahan"), + inventory: ( + loadout: FromBody, + ), + meta: [], +) \ No newline at end of file diff --git a/assets/common/entity/calendar/halloween/aggressive/halloween_harvester.ron b/assets/common/entity/calendar/halloween/aggressive/halloween_harvester.ron new file mode 100644 index 0000000000..5fbb1d351f --- /dev/null +++ b/assets/common/entity/calendar/halloween/aggressive/halloween_harvester.ron @@ -0,0 +1,11 @@ +#![enable(implicit_some)] +( + name: Name("Harvester"), + body: RandomWith("harvester"), + alignment: Alignment(Enemy), + loot: LootTable("common.loot_tables.calendar.halloween.halloween_harvester"), + inventory: ( + loadout: FromBody, + ), + meta: [], +) \ No newline at end of file diff --git a/assets/common/entity/calendar/halloween/aggressive/trickster.ron b/assets/common/entity/calendar/halloween/aggressive/trickster.ron new file mode 100644 index 0000000000..103b00d8a7 --- /dev/null +++ b/assets/common/entity/calendar/halloween/aggressive/trickster.ron @@ -0,0 +1,24 @@ +#![enable(implicit_some)] +( + name: Name("Trickster"), + body: RandomWith("draugr"), + alignment: Alignment(Enemy), + loot: LootTable("common.loot_tables.calendar.halloween.trickster"), + inventory: ( + loadout: Inline(( + inherit: Asset("common.loadout.calendar.halloween.trickster"), + active_hands: InHands((Choice([ + (1, Item("common.items.weapons.tool.broom")), + (1, Item("common.items.weapons.tool.hoe")), + (1, Item("common.items.weapons.tool.pickaxe")), + (1, Item("common.items.weapons.tool.rake")), + (1, Item("common.items.weapons.tool.shovel-0")), + (1, Item("common.items.weapons.tool.shovel-1")), + ]), None)), + )), + items: [ + (10, "common.items.consumable.potion_big"), + ], + ), + meta: [], +) \ No newline at end of file diff --git a/assets/common/items/armor/misc/head/facegourd.ron b/assets/common/items/armor/misc/head/facegourd.ron new file mode 100644 index 0000000000..90882a7e88 --- /dev/null +++ b/assets/common/items/armor/misc/head/facegourd.ron @@ -0,0 +1,13 @@ +ItemDef( + name: "Pumpkin Head.", + description: "Halloween attire.", + kind: Armor(( + kind: Head, + stats: Direct(( + energy_max: Some(4.0), + energy_reward: Some(0.04), + )), + )), + quality: Common, + tags: [], +) diff --git a/assets/common/items/food/honeycorn.ron b/assets/common/items/food/honeycorn.ron new file mode 100644 index 0000000000..0ce7dd0fb5 --- /dev/null +++ b/assets/common/items/food/honeycorn.ron @@ -0,0 +1,22 @@ +ItemDef( + name: "Honeycorn", + description: "Sweeet", + kind: Consumable( + kind: Food, + effects: [ + Buff(( + kind: Saturation, + data: ( + strength: 4.0, + duration: Some(( + secs: 5, + nanos: 0, + )), + ), + cat_ids: [Natural], + )), + ] + ), + quality: Common, + tags: [Food], +) diff --git a/assets/common/items/food/pumpkin_spice_brew.ron b/assets/common/items/food/pumpkin_spice_brew.ron new file mode 100644 index 0000000000..1d928e84c0 --- /dev/null +++ b/assets/common/items/food/pumpkin_spice_brew.ron @@ -0,0 +1,22 @@ +ItemDef( + name: "Pumpkin Spice Brew", + description: "Brewed from moldy pumpkins.", + kind: Consumable( + kind: Drink, + effects: [ + Buff(( + kind: Saturation, + data: ( + strength: 10.0, + duration: Some(( + secs: 5, + nanos: 0, + )), + ), + cat_ids: [Natural], + )), + ] + ), + quality: Moderate, + tags: [Food], +) diff --git a/assets/common/loadout/calendar/halloween/trickster.ron b/assets/common/loadout/calendar/halloween/trickster.ron new file mode 100644 index 0000000000..d81718ed85 --- /dev/null +++ b/assets/common/loadout/calendar/halloween/trickster.ron @@ -0,0 +1,31 @@ +#![enable(implicit_some)] +( + head: Choice([ + (1, Item("common.items.armor.misc.head.bamboo_twig")), + (1, Item("common.items.armor.misc.head.boreal_warhelm")), + (1, Item("common.items.armor.misc.head.crown")), + (1, Item("common.items.armor.misc.head.facegourd")), + (1, Item("common.items.armor.misc.head.headband")), + (1, Item("common.items.armor.misc.head.helmet")), + (1, Item("common.items.armor.misc.head.hog_hood")), + (1, Item("common.items.armor.misc.head.hood")), + (1, Item("common.items.armor.misc.head.hood_dark")), + (1, Item("common.items.armor.misc.head.mitre")), + (1, Item("common.items.armor.misc.head.spikeguard")), + (1, Item("common.items.armor.misc.head.straw")), + (1, Item("common.items.armor.misc.head.wanderers_hat")), + (1, Item("common.items.armor.misc.head.winged_coronet")), + (1, Item("common.items.armor.misc.head.bandana.red")), + (1, Item("common.items.armor.misc.head.bandana.thief")), + ]), + chest: Choice([ + (1, Item("common.items.armor.leather_plate.chest")), + ]), + legs: Choice([ + (1, Item("common.items.armor.leather_plate.pants")), + ]), + feet: Choice([ + (1, Item("common.items.armor.misc.foot.sandals")), + (1, Item("common.items.armor.cloth_blue.foot")), + ]), +) \ No newline at end of file diff --git a/assets/common/loot_tables/calendar/halloween/halloween_dullahan.ron b/assets/common/loot_tables/calendar/halloween/halloween_dullahan.ron new file mode 100644 index 0000000000..c5bef9a83c --- /dev/null +++ b/assets/common/loot_tables/calendar/halloween/halloween_dullahan.ron @@ -0,0 +1,4 @@ +[ + (1.0, Item("common.items.food.pumpkin_spice_brew")), + (5.0, Item("common.items.food.honeycorn")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/calendar/halloween/halloween_harvester.ron b/assets/common/loot_tables/calendar/halloween/halloween_harvester.ron new file mode 100644 index 0000000000..dbdc8e14d4 --- /dev/null +++ b/assets/common/loot_tables/calendar/halloween/halloween_harvester.ron @@ -0,0 +1,9 @@ +[ + // Weapons + (5.0, LootTable("common.loot_tables.weapons.tier-3")), + // Armor + (5.0, LootTable("common.loot_tables.armor.tier-3")), + // Misc + (2.0, Item("common.items.armor.misc.head.facegourd")), + (2.0, Item("common.items.lantern.pumpkin")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/calendar/halloween/trickster.ron b/assets/common/loot_tables/calendar/halloween/trickster.ron new file mode 100644 index 0000000000..c5bef9a83c --- /dev/null +++ b/assets/common/loot_tables/calendar/halloween/trickster.ron @@ -0,0 +1,4 @@ +[ + (1.0, Item("common.items.food.pumpkin_spice_brew")), + (5.0, Item("common.items.food.honeycorn")), +] \ No newline at end of file diff --git a/assets/voxygen/item_image_manifest.ron b/assets/voxygen/item_image_manifest.ron index b9fd836549..13d82e3621 100644 --- a/assets/voxygen/item_image_manifest.ron +++ b/assets/voxygen/item_image_manifest.ron @@ -2858,6 +2858,10 @@ "voxel.armor.misc.head.spikeguard", (0.0, 0.0, 0.0), (-120.0, 210.0,15.0), 1.3, ), + Simple("common.items.armor.misc.head.facegourd"): VoxTrans( + "voxel.armor.misc.head.facegourd", + (0.0, 0.0, 0.0), (-120.0, 210.0,15.0), 1.3, + ), Simple("common.items.armor.misc.head.winged_coronet"): VoxTrans( "voxel.armor.misc.head.winged_coronet", (0.0, 0.0, 0.0), (-120.0, 210.0,15.0), 1.3, @@ -3129,6 +3133,14 @@ "voxel.object.sunflower_ice_tea", (0.0, 0.0, 0.0), (-50.0, -60.0, -35.0), 0.9, ), + Simple("common.items.food.pumpkin_spice_brew"): VoxTrans( + "voxel.object.pumpkin_spice_brew", + (0.0, 0.0, 0.0), (-50.0, -60.0, -35.0), 0.9, + ), + Simple("common.items.food.honeycorn"): VoxTrans( + "voxel.object.honeycorn", + (0.0, 0.0, 0.0), (-20.0, 10.0, 20.0), 0.9, + ), Simple("common.items.food.carrot"): VoxTrans( "voxel.sprite.carrot.carrot", (0.0, 0.0, 0.0), (-20.0, 10.0, 20.0), 0.9, diff --git a/assets/voxygen/voxel/armor/misc/head/facegourd.vox b/assets/voxygen/voxel/armor/misc/head/facegourd.vox new file mode 100644 index 0000000000..a023cc7088 --- /dev/null +++ b/assets/voxygen/voxel/armor/misc/head/facegourd.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:510deb53420937ac57b054883d213306fd7bea81d7fe19749dac450e67019ddc +size 21464 diff --git a/assets/voxygen/voxel/humanoid_armor_head_manifest.ron b/assets/voxygen/voxel/humanoid_armor_head_manifest.ron index e384d08181..a2ad6c7e07 100644 --- a/assets/voxygen/voxel/humanoid_armor_head_manifest.ron +++ b/assets/voxygen/voxel/humanoid_armor_head_manifest.ron @@ -960,6 +960,55 @@ vox_spec: ("armor.misc.head.spikeguard", (-3.0, -5.0, 7.0)), color: None ), + // + (Human, Female, "common.items.armor.misc.head.facegourd"): ( + vox_spec: ("armor.misc.head.facegourd", (-4.0, -5.0, -1.0)), + color: None + ), + (Human, Male, "common.items.armor.misc.head.facegourd"): ( + vox_spec: ("armor.misc.head.facegourd", (-4.0, -5.0, -1.0)), + color: None + ), + (Elf, Female, "common.items.armor.misc.head.facegourd"): ( + vox_spec: ("armor.misc.head.facegourd", (-3.0, -5.0, -1.0)), + color: None + ), + (Elf, Male, "common.items.armor.misc.head.facegourd"): ( + vox_spec: ("armor.misc.head.facegourd", (-3.0, -5.0, -1.0)), + color: None + ), + (Orc, Female, "common.items.armor.misc.head.facegourd"): ( + vox_spec: ("armor.misc.head.facegourd", (-3.0, -3.0, -1.0)), + color: None + ), + (Orc, Male, "common.items.armor.misc.head.facegourd"): ( + vox_spec: ("armor.misc.head.facegourd", (-3.0, -6.0, 2.0)), + color: None + ), + (Dwarf, Female, "common.items.armor.misc.head.facegourd"): ( + vox_spec: ("armor.misc.head.facegourd", (-5.0, -4.0, -1.0)), + color: None + ), + (Dwarf, Male, "common.items.armor.misc.head.facegourd"): ( + vox_spec: ("armor.misc.head.facegourd", (-3.0, -3.0, -1.0)), + color: None + ), + (Draugr, Female, "common.items.armor.misc.head.facegourd"): ( + vox_spec: ("armor.misc.head.facegourd", (-6.0, -5.0, -1.0)), + color: None + ), + (Draugr, Male, "common.items.armor.misc.head.facegourd"): ( + vox_spec: ("armor.misc.head.facegourd", (-6.0, -5.0, 1.0)), + color: None + ), + (Danari, Female, "common.items.armor.misc.head.facegourd"): ( + vox_spec: ("armor.misc.head.facegourd", (-2.0, -5.0, 1.0)), + color: None + ), + (Danari, Male, "common.items.armor.misc.head.facegourd"): ( + vox_spec: ("armor.misc.head.facegourd", (-2.0, -5.0, -1.0)), + color: None + ), // Merchant Turban (Human, Male, "common.items.armor.merchant.turban"): ( vox_spec: ("armor.merchant.turban", (-4.0, -7.0, -6.0)), diff --git a/assets/voxygen/voxel/item_drop_manifest.ron b/assets/voxygen/voxel/item_drop_manifest.ron index 4e6d908d7a..432766f6ed 100644 --- a/assets/voxygen/voxel/item_drop_manifest.ron +++ b/assets/voxygen/voxel/item_drop_manifest.ron @@ -720,6 +720,7 @@ Simple("common.items.armor.misc.head.crown"): "voxel.armor.misc.head.crown", Simple("common.items.armor.misc.head.mitre"): "voxel.armor.misc.head.mitre", Simple("common.items.armor.misc.head.spikeguard"): "voxel.armor.misc.head.spikeguard", + Simple("common.items.armor.misc.head.facegourd"): "voxel.armor.misc.head.facegourd", Simple("common.items.armor.misc.head.winged_coronet"): "voxel.armor.misc.head.winged_coronet", Simple("common.items.armor.misc.head.boreal_warhelm"): "voxel.armor.misc.head.boreal_warhelm", Simple("common.items.calendar.christmas.armor.misc.head.woolly_wintercap"): "voxel.armor.misc.head.woolly_wintercap", @@ -793,6 +794,8 @@ Simple("common.items.food.apple_stick"): "voxel.object.apple_stick", Simple("common.items.food.mushroom_stick"): "voxel.object.mushroom_stick", Simple("common.items.food.sunflower_icetea"): "voxel.object.sunflower_ice_tea", + Simple("common.items.food.pumpkin_spice_brew"): "voxel.object.pumpkin_spice_brew", + Simple("common.items.food.honeycorn"): "voxel.object.honeycorn", Simple("common.items.food.carrot"): "voxel.sprite.carrot.carrot", Simple("common.items.food.tomato"): "voxel.sprite.tomato.tomato", Simple("common.items.food.lettuce"): "voxel.sprite.cabbage.cabbage", diff --git a/assets/voxygen/voxel/object/honeycorn.vox b/assets/voxygen/voxel/object/honeycorn.vox new file mode 100644 index 0000000000..ad87dc056e --- /dev/null +++ b/assets/voxygen/voxel/object/honeycorn.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f88142e5e06e25dcf7c832d4f7145b3d945d38e266e5eaf2530c50c5a8330e8 +size 1420 diff --git a/assets/voxygen/voxel/object/pumpkin_spice_brew.vox b/assets/voxygen/voxel/object/pumpkin_spice_brew.vox new file mode 100644 index 0000000000..f0402b0fac --- /dev/null +++ b/assets/voxygen/voxel/object/pumpkin_spice_brew.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:47d695c2c8e0a14ffd3cad448e6f5cd12f7139561b8b6b55fb19ddf7b07b3e89 +size 2592 diff --git a/assets/world/wildlife/spawn/calendar/halloween/halloween.ron b/assets/world/wildlife/spawn/calendar/halloween/halloween.ron new file mode 100644 index 0000000000..5322859b7e --- /dev/null +++ b/assets/world/wildlife/spawn/calendar/halloween/halloween.ron @@ -0,0 +1,17 @@ +SpawnEntry ( + name: "Halloween NPCs", + note: "Search for them in forests.", + rules: [ + Pack( + groups: [ + (1, (1, 1, "common.entity.calendar.halloween.aggressive.halloween_harvester")), + (1, (4, 8, "common.entity.calendar.halloween.aggressive.halloween_dullahan")), + (1, (6, 10, "common.entity.calendar.halloween.aggressive.trickster")), + + ], + spawn_mode: Land, + calendar_events: Some([Halloween]), + day_period: [Night, Morning, Noon, Evening], + ), + ], +) diff --git a/world/src/layer/wildlife.rs b/world/src/layer/wildlife.rs index a268ee0472..138e8f3e02 100644 --- a/world/src/layer/wildlife.rs +++ b/world/src/layer/wildlife.rs @@ -167,6 +167,10 @@ pub fn spawn_manifest() -> Vec<(&'static str, DensityFn)> { "world.wildlife.spawn.calendar.christmas.tundra.core", |c, _col| close(c.temp, CONFIG.snow_temp, 0.15) * BASE_DENSITY * 0.5, ), + ( + "world.wildlife.spawn.calendar.halloween.halloween", + |c, _col| close(c.temp, CONFIG.snow_temp, 0.15) * BASE_DENSITY * 0.5, + ), // Snowy animals ("world.wildlife.spawn.tundra.snow", |c, col| { close(c.temp, CONFIG.snow_temp, 0.3) * BASE_DENSITY * col.snow_cover as i32 as f32 * 1.0 @@ -181,6 +185,15 @@ pub fn spawn_manifest() -> Vec<(&'static str, DensityFn)> { * 1.0 }, ), + ( + "world.wildlife.spawn.calendar.halloween.halloween", + |c, col| { + close(c.temp, CONFIG.snow_temp, 0.3) + * BASE_DENSITY + * col.snow_cover as i32 as f32 + * 1.0 + }, + ), // Forest animals ("world.wildlife.spawn.tundra.forest", |c, col| { close(c.temp, CONFIG.snow_temp, 0.3) * col.tree_density * BASE_DENSITY * 1.4 @@ -190,6 +203,10 @@ pub fn spawn_manifest() -> Vec<(&'static str, DensityFn)> { "world.wildlife.spawn.calendar.christmas.tundra.forest", |c, col| close(c.temp, CONFIG.snow_temp, 0.3) * col.tree_density * BASE_DENSITY * 1.4, ), + ( + "world.wildlife.spawn.calendar.halloween.halloween", + |c, col| close(c.temp, CONFIG.snow_temp, 0.3) * col.tree_density * BASE_DENSITY * 1.4, + ), // **Taiga** // Forest core animals ("world.wildlife.spawn.taiga.core_forest", |c, col| { @@ -202,6 +219,12 @@ pub fn spawn_manifest() -> Vec<(&'static str, DensityFn)> { close(c.temp, CONFIG.snow_temp + 0.2, 0.2) * col.tree_density * BASE_DENSITY * 0.4 }, ), + ( + "world.wildlife.spawn.calendar.halloween.halloween", + |c, col| { + close(c.temp, CONFIG.snow_temp + 0.2, 0.2) * col.tree_density * BASE_DENSITY * 0.4 + }, + ), // Core animals ("world.wildlife.spawn.taiga.core", |c, _col| { close(c.temp, CONFIG.snow_temp + 0.2, 0.2) * BASE_DENSITY * 1.0 @@ -243,6 +266,16 @@ pub fn spawn_manifest() -> Vec<(&'static str, DensityFn)> { * BASE_DENSITY * 4.0 }), + // Temperate Rainforest animals event + ( + "world.wildlife.spawn.calendar.halloween.halloween", + |c, _col| { + close(c.temp, CONFIG.temperate_temp + 0.1, 0.6) + * close(c.humidity, CONFIG.forest_hum, 0.6) + * BASE_DENSITY + * 4.0 + }, + ), // Water animals ("world.wildlife.spawn.temperate.water", |c, col| { close(c.temp, CONFIG.temperate_temp, 1.0) * col.tree_density * BASE_DENSITY * 5.0 @@ -262,6 +295,16 @@ pub fn spawn_manifest() -> Vec<(&'static str, DensityFn)> { * BASE_DENSITY * 8.0 }), + // Jungle animals event + ( + "world.wildlife.spawn.calendar.halloween.halloween", + |c, _col| { + close(c.temp, CONFIG.tropical_temp + 0.2, 0.3) + * close(c.humidity, CONFIG.jungle_hum, 0.2) + * BASE_DENSITY + * 8.0 + }, + ), // **Tropical** // Rare river animals ("world.wildlife.spawn.tropical.river_rare", |_c, col| { @@ -308,6 +351,16 @@ pub fn spawn_manifest() -> Vec<(&'static str, DensityFn)> { * BASE_DENSITY * 2.0 }), + // Tropical Rainforest animals event + ( + "world.wildlife.spawn.calendar.halloween.halloween", + |c, _col| { + close(c.temp, CONFIG.tropical_temp + 0.1, 0.4) + * close(c.humidity, CONFIG.desert_hum, 0.4) + * BASE_DENSITY + * 2.0 + }, + ), // Rock animals ("world.wildlife.spawn.tropical.rock", |c, col| { close(c.temp, CONFIG.tropical_temp + 0.1, 0.5) * col.rock_density * BASE_DENSITY * 5.0 From e1bd3854086054f35a607f53cef9d622e91e3a57 Mon Sep 17 00:00:00 2001 From: flo666 Date: Thu, 20 Oct 2022 21:53:38 +0200 Subject: [PATCH 05/14] make draugrs Npcs flee at health below 100%, trickster gear, single spawns (trickster, dullahan), --- .../entity/calendar/halloween/aggressive/trickster.ron | 5 +---- assets/world/wildlife/spawn/calendar/halloween/halloween.ron | 5 ++--- common/src/comp/agent.rs | 3 ++- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/assets/common/entity/calendar/halloween/aggressive/trickster.ron b/assets/common/entity/calendar/halloween/aggressive/trickster.ron index 103b00d8a7..bd4ade1a77 100644 --- a/assets/common/entity/calendar/halloween/aggressive/trickster.ron +++ b/assets/common/entity/calendar/halloween/aggressive/trickster.ron @@ -2,7 +2,7 @@ ( name: Name("Trickster"), body: RandomWith("draugr"), - alignment: Alignment(Enemy), + alignment: Alignment(Npc), loot: LootTable("common.loot_tables.calendar.halloween.trickster"), inventory: ( loadout: Inline(( @@ -16,9 +16,6 @@ (1, Item("common.items.weapons.tool.shovel-1")), ]), None)), )), - items: [ - (10, "common.items.consumable.potion_big"), - ], ), meta: [], ) \ No newline at end of file diff --git a/assets/world/wildlife/spawn/calendar/halloween/halloween.ron b/assets/world/wildlife/spawn/calendar/halloween/halloween.ron index 5322859b7e..f9efbd292c 100644 --- a/assets/world/wildlife/spawn/calendar/halloween/halloween.ron +++ b/assets/world/wildlife/spawn/calendar/halloween/halloween.ron @@ -5,9 +5,8 @@ SpawnEntry ( Pack( groups: [ (1, (1, 1, "common.entity.calendar.halloween.aggressive.halloween_harvester")), - (1, (4, 8, "common.entity.calendar.halloween.aggressive.halloween_dullahan")), - (1, (6, 10, "common.entity.calendar.halloween.aggressive.trickster")), - + (3, (1, 1, "common.entity.calendar.halloween.aggressive.halloween_dullahan")), + (5, (1, 1, "common.entity.calendar.halloween.aggressive.trickster")), ], spawn_mode: Land, calendar_events: Some([Halloween]), diff --git a/common/src/comp/agent.rs b/common/src/comp/agent.rs index 65d000d25a..eeaa00d340 100644 --- a/common/src/comp/agent.rs +++ b/common/src/comp/agent.rs @@ -228,7 +228,8 @@ impl<'a> From<&'a Body> for Psyche { humanoid::Species::Elf => 0.4, humanoid::Species::Human => 0.4, humanoid::Species::Orc => 0.3, - humanoid::Species::Draugr => 0.3, + // set back to 0.3 after halloween event + humanoid::Species::Draugr => 1.0, }, Body::QuadrupedSmall(quadruped_small) => match quadruped_small.species { quadruped_small::Species::Pig => 0.5, From 60a48e450cab8311af9ffd7695ea99e4b3abe07c Mon Sep 17 00:00:00 2001 From: flo666 Date: Thu, 20 Oct 2022 22:35:55 +0200 Subject: [PATCH 06/14] facegourd and helmet offset (Female Orc) --- assets/voxygen/voxel/armor/misc/head/facegourd.vox | 4 ++-- assets/voxygen/voxel/humanoid_armor_head_manifest.ron | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/voxygen/voxel/armor/misc/head/facegourd.vox b/assets/voxygen/voxel/armor/misc/head/facegourd.vox index a023cc7088..905cf58f42 100644 --- a/assets/voxygen/voxel/armor/misc/head/facegourd.vox +++ b/assets/voxygen/voxel/armor/misc/head/facegourd.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:510deb53420937ac57b054883d213306fd7bea81d7fe19749dac450e67019ddc -size 21464 +oid sha256:2627431e333ae9b16e735b8e61d3e9e3a8f7e943b462d1f68302910972065b8b +size 22848 diff --git a/assets/voxygen/voxel/humanoid_armor_head_manifest.ron b/assets/voxygen/voxel/humanoid_armor_head_manifest.ron index a2ad6c7e07..11f2a47220 100644 --- a/assets/voxygen/voxel/humanoid_armor_head_manifest.ron +++ b/assets/voxygen/voxel/humanoid_armor_head_manifest.ron @@ -635,7 +635,7 @@ color: None ), (Orc, Female, "common.items.armor.misc.head.helmet"): ( - vox_spec: ("armor.misc.head.helmet", (-3.0, -3.0, -1.0)), + vox_spec: ("armor.misc.head.helmet", (-3.0, -6.0, -1.0)), color: None ), (Orc, Male, "common.items.armor.misc.head.helmet"): ( @@ -978,7 +978,7 @@ color: None ), (Orc, Female, "common.items.armor.misc.head.facegourd"): ( - vox_spec: ("armor.misc.head.facegourd", (-3.0, -3.0, -1.0)), + vox_spec: ("armor.misc.head.facegourd", (-3.0, -6.0, -1.0)), color: None ), (Orc, Male, "common.items.armor.misc.head.facegourd"): ( From 82026c1acca4285974eace24027a80c664920938 Mon Sep 17 00:00:00 2001 From: flo666 Date: Thu, 20 Oct 2022 22:48:46 +0200 Subject: [PATCH 07/14] remove defunct headband from trickster loadout --- assets/common/loadout/calendar/halloween/trickster.ron | 1 - 1 file changed, 1 deletion(-) diff --git a/assets/common/loadout/calendar/halloween/trickster.ron b/assets/common/loadout/calendar/halloween/trickster.ron index d81718ed85..fc0ee28312 100644 --- a/assets/common/loadout/calendar/halloween/trickster.ron +++ b/assets/common/loadout/calendar/halloween/trickster.ron @@ -5,7 +5,6 @@ (1, Item("common.items.armor.misc.head.boreal_warhelm")), (1, Item("common.items.armor.misc.head.crown")), (1, Item("common.items.armor.misc.head.facegourd")), - (1, Item("common.items.armor.misc.head.headband")), (1, Item("common.items.armor.misc.head.helmet")), (1, Item("common.items.armor.misc.head.hog_hood")), (1, Item("common.items.armor.misc.head.hood")), From 79e6fd58fe5e217466d1785d4322da8be9c1c1d5 Mon Sep 17 00:00:00 2001 From: flo666 Date: Fri, 21 Oct 2022 09:11:59 +0200 Subject: [PATCH 08/14] - make tricksters spawn in groups and play instruments - remove defunct draugr flee --- .../calendar/halloween/aggressive/trickster.ron | 17 ++++++++++------- .../spawn/calendar/halloween/halloween.ron | 4 ++-- common/src/comp/agent.rs | 3 +-- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/assets/common/entity/calendar/halloween/aggressive/trickster.ron b/assets/common/entity/calendar/halloween/aggressive/trickster.ron index bd4ade1a77..e4727c1900 100644 --- a/assets/common/entity/calendar/halloween/aggressive/trickster.ron +++ b/assets/common/entity/calendar/halloween/aggressive/trickster.ron @@ -2,18 +2,21 @@ ( name: Name("Trickster"), body: RandomWith("draugr"), - alignment: Alignment(Npc), + alignment: Alignment(Enemy), loot: LootTable("common.loot_tables.calendar.halloween.trickster"), inventory: ( loadout: Inline(( inherit: Asset("common.loadout.calendar.halloween.trickster"), active_hands: InHands((Choice([ - (1, Item("common.items.weapons.tool.broom")), - (1, Item("common.items.weapons.tool.hoe")), - (1, Item("common.items.weapons.tool.pickaxe")), - (1, Item("common.items.weapons.tool.rake")), - (1, Item("common.items.weapons.tool.shovel-0")), - (1, Item("common.items.weapons.tool.shovel-1")), + (1, Item("common.items.tool.instruments.bass")), + (1, Item("common.items.tool.instruments.flute")), + (1, Item("common.items.tool.instruments.harp")), + (1, Item("common.items.tool.instruments.kalimba")), + (1, Item("common.items.tool.instruments.sitar")), + (1, Item("common.items.tool.instruments.perc")), + (1, Item("common.items.tool.instruments.lute")), + (1, Item("common.items.tool.instruments.guitar")), + (1, Item("common.items.tool.instruments.melodica")), ]), None)), )), ), diff --git a/assets/world/wildlife/spawn/calendar/halloween/halloween.ron b/assets/world/wildlife/spawn/calendar/halloween/halloween.ron index f9efbd292c..692a48082a 100644 --- a/assets/world/wildlife/spawn/calendar/halloween/halloween.ron +++ b/assets/world/wildlife/spawn/calendar/halloween/halloween.ron @@ -5,8 +5,8 @@ SpawnEntry ( Pack( groups: [ (1, (1, 1, "common.entity.calendar.halloween.aggressive.halloween_harvester")), - (3, (1, 1, "common.entity.calendar.halloween.aggressive.halloween_dullahan")), - (5, (1, 1, "common.entity.calendar.halloween.aggressive.trickster")), + (2, (1, 1, "common.entity.calendar.halloween.aggressive.halloween_dullahan")), + (3, (3, 6, "common.entity.calendar.halloween.aggressive.trickster")), ], spawn_mode: Land, calendar_events: Some([Halloween]), diff --git a/common/src/comp/agent.rs b/common/src/comp/agent.rs index eeaa00d340..65d000d25a 100644 --- a/common/src/comp/agent.rs +++ b/common/src/comp/agent.rs @@ -228,8 +228,7 @@ impl<'a> From<&'a Body> for Psyche { humanoid::Species::Elf => 0.4, humanoid::Species::Human => 0.4, humanoid::Species::Orc => 0.3, - // set back to 0.3 after halloween event - humanoid::Species::Draugr => 1.0, + humanoid::Species::Draugr => 0.3, }, Body::QuadrupedSmall(quadruped_small) => match quadruped_small.species { quadruped_small::Species::Pig => 0.5, From 586d0f6dd8426e08ec1f72df88ac79d9b361b1aa Mon Sep 17 00:00:00 2001 From: flo666 Date: Sat, 22 Oct 2022 18:37:18 +0200 Subject: [PATCH 09/14] add bat (created by Gemu) --- assets/common/npc_names.ron | 4 +++ .../voxel/bird_medium_central_manifest.ron | 28 +++++++++++++++ .../voxel/bird_medium_lateral_manifest.ron | 36 +++++++++++++++++++ assets/voxygen/voxel/npc/bat/male/head.vox | 3 ++ assets/voxygen/voxel/npc/bat/male/leg_r.vox | 3 ++ assets/voxygen/voxel/npc/bat/male/tail.vox | 3 ++ assets/voxygen/voxel/npc/bat/male/torso.vox | 3 ++ assets/voxygen/voxel/npc/bat/male/wing_r.vox | 3 ++ common/src/comp/body.rs | 2 ++ common/src/comp/body/bird_medium.rs | 6 +++- voxygen/anim/src/bird_medium/mod.rs | 5 +++ world/src/block/mod.rs | 2 +- 12 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 assets/voxygen/voxel/npc/bat/male/head.vox create mode 100644 assets/voxygen/voxel/npc/bat/male/leg_r.vox create mode 100644 assets/voxygen/voxel/npc/bat/male/tail.vox create mode 100644 assets/voxygen/voxel/npc/bat/male/torso.vox create mode 100644 assets/voxygen/voxel/npc/bat/male/wing_r.vox diff --git a/assets/common/npc_names.ron b/assets/common/npc_names.ron index 99d0b0681b..17d1ef0b11 100644 --- a/assets/common/npc_names.ron +++ b/assets/common/npc_names.ron @@ -824,6 +824,10 @@ keyword: "penguin", generic: "Penguin" ), + bat: ( + keyword: "bat", + generic: "Bat" + ), ) ), biped_large: ( diff --git a/assets/voxygen/voxel/bird_medium_central_manifest.ron b/assets/voxygen/voxel/bird_medium_central_manifest.ron index 398040aac0..acdc812b28 100644 --- a/assets/voxygen/voxel/bird_medium_central_manifest.ron +++ b/assets/voxygen/voxel/bird_medium_central_manifest.ron @@ -223,4 +223,32 @@ central: ("npc.penguin.male.tail"), ) ), + (Bat, Male): ( + head: ( + offset: (-4.5, 2.0, -9.0), + central: ("npc.bat.male.head"), + ), + torso: ( + offset: (-3.5, -5.0, -4.5), + central: ("npc.bat.male.torso"), + ), + tail: ( + offset: (-2.5, -0.5, 1.5), + central: ("npc.bat.male.tail"), + ) + ), + (Bat, Female): ( + head: ( + offset: (-4.5, 2.0, -9.0), + central: ("npc.bat.male.head"), + ), + torso: ( + offset: (-3.5, -5.0, -4.5), + central: ("npc.bat.male.torso"), + ), + tail: ( + offset: (-2.5, -0.5, 1.5), + central: ("npc.bat.male.tail"), + ) + ), }) \ No newline at end of file diff --git a/assets/voxygen/voxel/bird_medium_lateral_manifest.ron b/assets/voxygen/voxel/bird_medium_lateral_manifest.ron index a6da9b68e8..1320966923 100644 --- a/assets/voxygen/voxel/bird_medium_lateral_manifest.ron +++ b/assets/voxygen/voxel/bird_medium_lateral_manifest.ron @@ -287,4 +287,40 @@ lateral: ("npc.penguin.male.leg_r"), ) ), + (Bat, Male): ( + wing_l: ( + offset: (-1.0, 2.5, -18.0), + lateral: ("npc.bat.male.wing_r"), + ), + wing_r: ( + offset: (-1.0, 2.5, -18.0), + lateral: ("npc.bat.male.wing_r"), + ), + foot_l: ( + offset: (-2.0, -2.0, -7.0), + lateral: ("npc.bat.male.leg_r"), + ), + foot_r: ( + offset: (-2.0, -2.0, -7.0), + lateral: ("npc.bat.male.leg_r"), + ) + ), + (Bat, Female): ( + wing_l: ( + offset: (-1.0, 2.5, -18.0), + lateral: ("npc.bat.male.wing_r"), + ), + wing_r: ( + offset: (-1.0, 2.5, -18.0), + lateral: ("npc.bat.male.wing_r"), + ), + foot_l: ( + offset: (-2.0, -2.0, -7.0), + lateral: ("npc.bat.male.leg_r"), + ), + foot_r: ( + offset: (-2.0, -2.0, -7.0), + lateral: ("npc.bat.male.leg_r"), + ) + ), }) \ No newline at end of file diff --git a/assets/voxygen/voxel/npc/bat/male/head.vox b/assets/voxygen/voxel/npc/bat/male/head.vox new file mode 100644 index 0000000000..d7733f4302 --- /dev/null +++ b/assets/voxygen/voxel/npc/bat/male/head.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea2b26e032ad5501031369e5d73db9d5fd64c5e99618c5499f615afdc1f13e06 +size 1832 diff --git a/assets/voxygen/voxel/npc/bat/male/leg_r.vox b/assets/voxygen/voxel/npc/bat/male/leg_r.vox new file mode 100644 index 0000000000..e62c3c300e --- /dev/null +++ b/assets/voxygen/voxel/npc/bat/male/leg_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d17fc3c09de234e00b7e09aecaacec046869820fce9a0bfc42a0bff83b1130e +size 1148 diff --git a/assets/voxygen/voxel/npc/bat/male/tail.vox b/assets/voxygen/voxel/npc/bat/male/tail.vox new file mode 100644 index 0000000000..f880b45f00 --- /dev/null +++ b/assets/voxygen/voxel/npc/bat/male/tail.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3bd93176dfe9fbd1911ce20844e14a0ead0adbbe499ed5b5ff5aa3799ee49056 +size 1184 diff --git a/assets/voxygen/voxel/npc/bat/male/torso.vox b/assets/voxygen/voxel/npc/bat/male/torso.vox new file mode 100644 index 0000000000..29f7688678 --- /dev/null +++ b/assets/voxygen/voxel/npc/bat/male/torso.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:14e56f640010059fda73a406b3a525d8113336ad6a0773a8c9f458c583c29e12 +size 2068 diff --git a/assets/voxygen/voxel/npc/bat/male/wing_r.vox b/assets/voxygen/voxel/npc/bat/male/wing_r.vox new file mode 100644 index 0000000000..787eb63df4 --- /dev/null +++ b/assets/voxygen/voxel/npc/bat/male/wing_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a88f725949d5f42891f3b7cb20e7e13b086632051d6469344cbc728218819e1 +size 1544 diff --git a/common/src/comp/body.rs b/common/src/comp/body.rs index 19ca4810e9..cfe8fa847a 100644 --- a/common/src/comp/body.rs +++ b/common/src/comp/body.rs @@ -280,6 +280,7 @@ impl Body { bird_medium::Species::Parrot => 2.0, bird_medium::Species::Penguin => 8.0, bird_medium::Species::Peacock => 5.0, + bird_medium::Species::Bat => 2.0, }, Body::BirdLarge(_) => 100.0, @@ -702,6 +703,7 @@ impl Body { bird_medium::Species::Eagle => 45, bird_medium::Species::Owl => 45, bird_medium::Species::Duck => 10, + bird_medium::Species::Bat => 20, _ => 15, }, Body::FishMedium(_) => 15, diff --git a/common/src/comp/body/bird_medium.rs b/common/src/comp/body/bird_medium.rs index a5da2ece66..0e64ee7714 100644 --- a/common/src/comp/body/bird_medium.rs +++ b/common/src/comp/body/bird_medium.rs @@ -45,6 +45,7 @@ make_case_elim!( Owl = 5, Parrot = 6, Penguin = 7, + Bat = 8, } ); @@ -61,6 +62,7 @@ pub struct AllSpecies { pub owl: SpeciesMeta, pub parrot: SpeciesMeta, pub penguin: SpeciesMeta, + pub bat: SpeciesMeta, } impl<'a, SpeciesMeta> core::ops::Index<&'a Species> for AllSpecies { @@ -77,11 +79,12 @@ impl<'a, SpeciesMeta> core::ops::Index<&'a Species> for AllSpecies Species::Owl => &self.owl, Species::Parrot => &self.parrot, Species::Penguin => &self.penguin, + Species::Bat => &self.bat, } } } -pub const ALL_SPECIES: [Species; 8] = [ +pub const ALL_SPECIES: [Species; 9] = [ Species::Duck, Species::Chicken, Species::Goose, @@ -90,6 +93,7 @@ pub const ALL_SPECIES: [Species; 8] = [ Species::Owl, Species::Parrot, Species::Penguin, + Species::Bat, ]; impl<'a, SpeciesMeta: 'a> IntoIterator for &'a AllSpecies { diff --git a/voxygen/anim/src/bird_medium/mod.rs b/voxygen/anim/src/bird_medium/mod.rs index 65ce9c1de6..124753f418 100644 --- a/voxygen/anim/src/bird_medium/mod.rs +++ b/voxygen/anim/src/bird_medium/mod.rs @@ -114,6 +114,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Owl, Female) => (2.5, 7.0), (Parrot, _) => (0.5, 4.5), (Penguin, _) => (1.5, 6.0), + (Bat, _) => (2.5, 5.0), }, chest: match (body.species, body.body_type) { (Duck, _) => (0.0, 6.0), @@ -126,6 +127,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Owl, Female) => (0.0, 4.5), (Parrot, _) => (0.0, 5.0), (Penguin, _) => (0.0, 8.0), + (Bat, _) => (0.0, 8.0), }, tail: match (body.species, body.body_type) { (Duck, _) => (-5.0, 1.0), @@ -138,6 +140,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Owl, Female) => (-6.0, -2.5), (Parrot, _) => (-8.0, -2.0), (Penguin, _) => (-3.0, -4.0), + (Bat, _) => (-8.0, -4.0), }, wing: match (body.species, body.body_type) { (Duck, _) => (3.5, -0.5, 2.0), @@ -150,6 +153,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Owl, Female) => (3.5, -6.0, 3.5), (Parrot, _) => (2.0, -4.5, 3.0), (Penguin, _) => (4.0, 0.5, 1.0), + (Bat, _) => (3.0, -8.0, 4.0), }, foot: match (body.species, body.body_type) { (Duck, _) => (2.5, -2.0, 4.0), @@ -162,6 +166,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Owl, Female) => (1.5, -3.0, 6.5), (Parrot, _) => (1.5, -3.0, 3.0), (Penguin, _) => (2.5, -2.0, 6.0), + (Bat, _) => (2.0, -2.0, 8.0), }, feed: match (body.species, body.body_type) { (Chicken, _) => 1.2, diff --git a/world/src/block/mod.rs b/world/src/block/mod.rs index df7c234151..853fb4ee08 100644 --- a/world/src/block/mod.rs +++ b/world/src/block/mod.rs @@ -273,7 +273,7 @@ pub fn block_from_structure( 1 | 2 => (Rgb::new(218.0, 53.0, 3.0), Rgb::new(226.0, 62.0, 5.0)), _ => (Rgb::new(230.0, 120.0, 20.0), Rgb::new(242.0, 130.0, 25.0)), }; - + Block::new( BlockKind::Leaves, Rgb::::lerp(c0, c1, lerp).map(|e| e as u8), From 6bacb487f3f39e10d8c0ca9427d3e3a1a9cb3cb4 Mon Sep 17 00:00:00 2001 From: James Melkonian Date: Sat, 22 Oct 2022 18:18:23 -0700 Subject: [PATCH 10/14] Bat AI --- .../common/abilities/ability_set_manifest.ron | 5 ++ .../custom/simpleflyingmelee/singlestrike.ron | 28 +++++++++ .../npc_weapons/unique/simpleflyingbasic.ron | 21 +++++++ common/src/comp/agent.rs | 1 + common/src/comp/body.rs | 13 ++++- common/src/comp/inventory/loadout_builder.rs | 8 ++- server/agent/src/action_nodes.rs | 47 +++++++++++++++ server/agent/src/attack.rs | 58 +++++++++++++++++++ server/agent/src/data.rs | 1 + server/src/cmd.rs | 1 + 10 files changed, 181 insertions(+), 2 deletions(-) create mode 100644 assets/common/abilities/custom/simpleflyingmelee/singlestrike.ron create mode 100644 assets/common/items/npc_weapons/unique/simpleflyingbasic.ron diff --git a/assets/common/abilities/ability_set_manifest.ron b/assets/common/abilities/ability_set_manifest.ron index f448a5711c..ae616991c8 100644 --- a/assets/common/abilities/ability_set_manifest.ron +++ b/assets/common/abilities/ability_set_manifest.ron @@ -121,6 +121,11 @@ (None, "common.abilities.custom.woodgolem.shockwave") ], ), + Custom("Simple Flying Melee"): ( + primary: "common.abilities.custom.simpleflyingmelee.singlestrike", + secondary: "common.abilities.custom.simpleflyingmelee.singlestrike", + abilities: [], + ), Custom("Sword Simple"): ( primary: "common.abilities.swordsimple.doublestrike", secondary: "common.abilities.swordsimple.dash", diff --git a/assets/common/abilities/custom/simpleflyingmelee/singlestrike.ron b/assets/common/abilities/custom/simpleflyingmelee/singlestrike.ron new file mode 100644 index 0000000000..d78682ef8a --- /dev/null +++ b/assets/common/abilities/custom/simpleflyingmelee/singlestrike.ron @@ -0,0 +1,28 @@ +ComboMelee( + stage_data: [ + ( + stage: 1, + base_damage: 4.0, + damage_increase: 0, + base_poise_damage: 0, + poise_damage_increase: 0, + knockback: 0.0, + range: 2.5, + angle: 150.0, + base_buildup_duration: 0.1, + base_swing_duration: 0.07, + hit_timing: 0.5, + base_recover_duration: 0.2, + forward_movement: 0.0, + damage_kind: Piercing, + ), + ], + initial_energy_gain: 0, + max_energy_gain: 0, + energy_increase: 0, + speed_increase: 0.0, + max_speed_increase: 0.0, + scales_from_combo: 0, + is_interruptible: false, + ori_modifier: 0.6, +) diff --git a/assets/common/items/npc_weapons/unique/simpleflyingbasic.ron b/assets/common/items/npc_weapons/unique/simpleflyingbasic.ron new file mode 100644 index 0000000000..50ccd3585b --- /dev/null +++ b/assets/common/items/npc_weapons/unique/simpleflyingbasic.ron @@ -0,0 +1,21 @@ +ItemDef( + name: "Simple Flying Melee", + description: "I believe I can fly!!!!!", + kind: Tool(( + kind: Natural, + hands: Two, + stats: ( + equip_time_secs: 0.01, + power: 1.0, + effect_power: 1.0, + speed: 1.0, + crit_chance: 0.0625, + range: 1.0, + energy_efficiency: 1.0, + buff_strength: 1.0, + ), + )), + quality: Low, + tags: [], + ability_spec: Some(Custom("Simple Flying Melee")), +) diff --git a/common/src/comp/agent.rs b/common/src/comp/agent.rs index 65d000d25a..96fe88c0e4 100644 --- a/common/src/comp/agent.rs +++ b/common/src/comp/agent.rs @@ -289,6 +289,7 @@ impl<'a> From<&'a Body> for Psyche { bird_medium::Species::Peacock => 0.4, bird_medium::Species::Eagle => 0.3, bird_medium::Species::Parrot => 0.8, + bird_medium::Species::Bat => 0.0, _ => 0.5, }, Body::BirdLarge(_) => 0.1, diff --git a/common/src/comp/body.rs b/common/src/comp/body.rs index cfe8fa847a..c93459c768 100644 --- a/common/src/comp/body.rs +++ b/common/src/comp/body.rs @@ -27,7 +27,7 @@ use specs::{Component, DerefFlaggedStorage}; use strum::Display; use vek::*; -use super::{BuffKind, Collider, Density, Mass}; +use super::{BuffKind, Collider, Density, Mass, Scale}; make_case_elim!( body, @@ -231,6 +231,17 @@ impl Body { ) } + pub fn scale(&self) -> Scale { + let s = match self { + Body::BirdMedium(bird_medium) => match bird_medium.species { + bird_medium::Species::Bat => 0.5, + _ => 1.0, + }, + _ => 1.0, + }; + Scale(s) + } + /// Average density of the body // Units are based on kg/m³ pub fn density(&self) -> Density { diff --git a/common/src/comp/inventory/loadout_builder.rs b/common/src/comp/inventory/loadout_builder.rs index c8334a2ba1..401f4fe850 100644 --- a/common/src/comp/inventory/loadout_builder.rs +++ b/common/src/comp/inventory/loadout_builder.rs @@ -1,7 +1,7 @@ use crate::{ assets::{self, AssetExt}, comp::{ - arthropod, biped_large, biped_small, bird_large, golem, + arthropod, biped_large, biped_small, bird_large, bird_medium, golem, inventory::{ loadout::Loadout, slot::{ArmorSlot, EquipSlot}, @@ -778,6 +778,12 @@ fn default_main_tool(body: &Body) -> Item { "common.items.npc_weapons.unique.birdlargebasic", )), }, + Body::BirdMedium(bird_medium) => match bird_medium.species { + bird_medium::Species::Bat => Some(Item::new_from_asset_expect( + "common.items.npc_weapons.unique.simpleflyingbasic", + )), + _ => None, + }, _ => None, }; diff --git a/server/agent/src/action_nodes.rs b/server/agent/src/action_nodes.rs index 5d85e1927e..b30dc4f07c 100644 --- a/server/agent/src/action_nodes.rs +++ b/server/agent/src/action_nodes.rs @@ -322,6 +322,44 @@ impl<'a> AgentData<'a> { } } } else { + // Bats should fly + // Use a proportional controller as the bouncing effect mimics bat flight + if self.traversal_config.can_fly + && self + .inventory + .equipped(EquipSlot::ActiveMainhand) + .as_ref() + .map_or(false, |item| { + item.ability_spec().map_or(false, |a_s| match &*a_s { + AbilitySpec::Custom(spec) => match spec.as_str() { + "Simple Flying Melee" => true, + _ => false, + }, + _ => false, + }) + }) + { + // Bats don't like the ground, so make sure they are always flying + controller.push_basic_input(InputKind::Fly); + if read_data + .terrain + .ray(self.pos.0, self.pos.0 - (Vec3::unit_z() * 5.0)) + .until(Block::is_solid) + .cast() + .1 + .map_or(true, |b| b.is_some()) + { + // Fly up + controller.inputs.move_z = 1.0; + // If on the ground, jump + if self.physics_state.on_ground.is_some() { + controller.push_basic_input(InputKind::Jump); + } + } else { + // Fly down + controller.inputs.move_z = -1.0; + } + } agent.bearing += Vec2::new(rng.gen::() - 0.5, rng.gen::() - 0.5) * 0.1 - agent.bearing * 0.003 - agent.patrol_origin.map_or(Vec2::zero(), |patrol_origin| { @@ -768,6 +806,7 @@ impl<'a> AgentData<'a> { AbilitySpec::Custom(spec) => match spec.as_str() { "Oni" | "Sword Simple" => Tactic::Sword, "Staff Simple" => Tactic::Staff, + "Simple Flying Melee" => Tactic::SimpleFlyingMelee, "Bow Simple" => Tactic::Bow, "Stone Golem" => Tactic::StoneGolem, "Quad Med Quick" => Tactic::CircleCharge { @@ -1000,6 +1039,14 @@ impl<'a> AgentData<'a> { // Match on tactic. Each tactic has different controls depending on the distance // from the agent to the target. match tactic { + Tactic::SimpleFlyingMelee => self.handle_simple_flying_melee( + agent, + controller, + &attack_data, + tgt_data, + read_data, + rng, + ), Tactic::SimpleMelee => { self.handle_simple_melee(agent, controller, &attack_data, tgt_data, read_data, rng) }, diff --git a/server/agent/src/attack.rs b/server/agent/src/attack.rs index a7360a3100..1c75da5e5a 100644 --- a/server/agent/src/attack.rs +++ b/server/agent/src/attack.rs @@ -53,6 +53,64 @@ impl<'a> AgentData<'a> { } } + // Intended for any agent that has one attack, that attack is a melee attack, + // and the agent is able to freely fly around + pub fn handle_simple_flying_melee( + &self, + agent: &mut Agent, + controller: &mut Controller, + attack_data: &AttackData, + tgt_data: &TargetData, + read_data: &ReadData, + rng: &mut impl Rng, + ) { + // Fly to target + let dir_to_target = ((tgt_data.pos.0 + Vec3::unit_z() * 1.5) - self.pos.0) + .try_normalized() + .unwrap_or_else(Vec3::zero); + let speed = 1.0; + controller.inputs.move_dir = dir_to_target.xy() * speed; + + // Always fly! If the floor can't touch you, it can't hurt you... + controller.push_basic_input(InputKind::Fly); + // Flee from the ground! The internet told me it was lava! + // If on the ground, jump with every last ounce of energy, holding onto all that + // is dear in life and straining for the wide open skies. + if self.physics_state.on_ground.is_some() { + controller.push_basic_input(InputKind::Jump); + } else { + // Only fly down if close enough to target in the xy plane + // Otherwise fly towards the target bouncing around a 5 block altitude + let mut maintain_altitude = |altitude| { + if read_data + .terrain + .ray(self.pos.0, self.pos.0 - (Vec3::unit_z() * altitude)) + .until(Block::is_solid) + .cast() + .1 + .map_or(true, |b| b.is_some()) + { + // Fly up + controller.inputs.move_z = 1.0; + } else { + // Fly down + controller.inputs.move_z = -1.0; + } + }; + if (tgt_data.pos.0 - self.pos.0).xy().magnitude_squared() > (5.0_f32).powi(2) { + // If above 5 blocks, fly down + maintain_altitude(5.0); + } else { + maintain_altitude(2.0); + + // Attack if in range + if attack_data.dist_sqrd < 3.5_f32.powi(2) && attack_data.angle < 150.0 { + controller.push_basic_input(InputKind::Primary); + } + } + } + } + // Intended for any agent that has one attack, that attack is a melee attack, // the agent is able to freely walk around, and the agent is trying to attack // from behind its target diff --git a/server/agent/src/data.rs b/server/agent/src/data.rs index 891aac9b6d..9cae73b4de 100644 --- a/server/agent/src/data.rs +++ b/server/agent/src/data.rs @@ -74,6 +74,7 @@ impl AttackData { pub enum Tactic { // General tactics SimpleMelee, + SimpleFlyingMelee, SimpleBackstab, ElevatedRanged, Turret, diff --git a/server/src/cmd.rs b/server/src/cmd.rs index 7f273b87bf..4160b33e83 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -1212,6 +1212,7 @@ fn handle_spawn( body, ) .with(comp::Vel(vel)) + .with(body.scale()) .with(alignment); if ai { From 9a6a3a05a11a2c37851547c62d8a714b26b9ba03 Mon Sep 17 00:00:00 2001 From: IsseW Date: Tue, 25 Oct 2022 00:31:04 +0200 Subject: [PATCH 11/14] bat config --- .../custom/simpleflyingmelee/singlestrike.ron | 2 +- assets/common/entity/wild/aggressive/bat.ron | 11 +++++++++++ .../loot_tables/calendar/halloween/bat.ron | 4 ++++ assets/common/loot_tables/creature/bat.ron | 9 +++++++++ .../voxel/bird_medium_central_manifest.ron | 12 ++++++------ .../voxel/bird_medium_lateral_manifest.ron | 16 ++++++++-------- assets/voxygen/voxel/npc/bat/male/leg_r.vox | 2 +- assets/voxygen/voxel/npc/bat/male/wing_r.vox | 2 +- .../spawn/calendar/halloween/halloween.ron | 1 + assets/world/wildlife/spawn/desert/hot.ron | 1 + .../wildlife/spawn/jungle/rainforest_area.ron | 1 + .../wildlife/spawn/temperate/rainforest.ron | 1 + common/src/comp/body.rs | 1 + voxygen/anim/src/bird_medium/mod.rs | 4 ++-- world/src/layer/cave.rs | 12 ++++++++++++ 15 files changed, 60 insertions(+), 19 deletions(-) create mode 100644 assets/common/entity/wild/aggressive/bat.ron create mode 100644 assets/common/loot_tables/calendar/halloween/bat.ron create mode 100644 assets/common/loot_tables/creature/bat.ron diff --git a/assets/common/abilities/custom/simpleflyingmelee/singlestrike.ron b/assets/common/abilities/custom/simpleflyingmelee/singlestrike.ron index d78682ef8a..3b15069f86 100644 --- a/assets/common/abilities/custom/simpleflyingmelee/singlestrike.ron +++ b/assets/common/abilities/custom/simpleflyingmelee/singlestrike.ron @@ -2,7 +2,7 @@ ComboMelee( stage_data: [ ( stage: 1, - base_damage: 4.0, + base_damage: 1.0, damage_increase: 0, base_poise_damage: 0, poise_damage_increase: 0, diff --git a/assets/common/entity/wild/aggressive/bat.ron b/assets/common/entity/wild/aggressive/bat.ron new file mode 100644 index 0000000000..a21793f3a3 --- /dev/null +++ b/assets/common/entity/wild/aggressive/bat.ron @@ -0,0 +1,11 @@ +#![enable(implicit_some)] +( + name: Automatic, + body: RandomWith("bat"), + alignment: Alignment(Enemy), + loot: LootTable("common.loot_tables.calendar.halloween.bat"), + inventory: ( + loadout: FromBody, + ), + meta: [], +) \ No newline at end of file diff --git a/assets/common/loot_tables/calendar/halloween/bat.ron b/assets/common/loot_tables/calendar/halloween/bat.ron new file mode 100644 index 0000000000..c5bef9a83c --- /dev/null +++ b/assets/common/loot_tables/calendar/halloween/bat.ron @@ -0,0 +1,4 @@ +[ + (1.0, Item("common.items.food.pumpkin_spice_brew")), + (5.0, Item("common.items.food.honeycorn")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/creature/bat.ron b/assets/common/loot_tables/creature/bat.ron new file mode 100644 index 0000000000..8d6d484afb --- /dev/null +++ b/assets/common/loot_tables/creature/bat.ron @@ -0,0 +1,9 @@ +[ + // halloween event loot + (2.0, Item("common.items.food.pumpkin_spice_brew")), + (5.0, Item("common.items.food.honeycorn")), + + // crafting + (1.0, Item("common.items.crafting_ing.hide.animal_hide")), + (1.0, Item("common.items.crafting_ing.animal_misc.shar_fang")), +] \ No newline at end of file diff --git a/assets/voxygen/voxel/bird_medium_central_manifest.ron b/assets/voxygen/voxel/bird_medium_central_manifest.ron index acdc812b28..418fbaef0e 100644 --- a/assets/voxygen/voxel/bird_medium_central_manifest.ron +++ b/assets/voxygen/voxel/bird_medium_central_manifest.ron @@ -225,29 +225,29 @@ ), (Bat, Male): ( head: ( - offset: (-4.5, 2.0, -9.0), + offset: (-4.5, 2.0, -11.0), central: ("npc.bat.male.head"), ), torso: ( - offset: (-3.5, -5.0, -4.5), + offset: (-3.5, -5.0, -6.5), central: ("npc.bat.male.torso"), ), tail: ( - offset: (-2.5, -0.5, 1.5), + offset: (-2.5, -1.5, -1.5), central: ("npc.bat.male.tail"), ) ), (Bat, Female): ( head: ( - offset: (-4.5, 2.0, -9.0), + offset: (-4.5, 2.0, -11.0), central: ("npc.bat.male.head"), ), torso: ( - offset: (-3.5, -5.0, -4.5), + offset: (-3.5, -5.0, -6.5), central: ("npc.bat.male.torso"), ), tail: ( - offset: (-2.5, -0.5, 1.5), + offset: (-2.5, -1.5, -1.5), central: ("npc.bat.male.tail"), ) ), diff --git a/assets/voxygen/voxel/bird_medium_lateral_manifest.ron b/assets/voxygen/voxel/bird_medium_lateral_manifest.ron index 1320966923..364e8c440b 100644 --- a/assets/voxygen/voxel/bird_medium_lateral_manifest.ron +++ b/assets/voxygen/voxel/bird_medium_lateral_manifest.ron @@ -289,37 +289,37 @@ ), (Bat, Male): ( wing_l: ( - offset: (-1.0, 2.5, -18.0), + offset: (-13.0, 2.5, -3.5), lateral: ("npc.bat.male.wing_r"), ), wing_r: ( - offset: (-1.0, 2.5, -18.0), + offset: (-1.0, 2.5, -3.5), lateral: ("npc.bat.male.wing_r"), ), foot_l: ( - offset: (-2.0, -2.0, -7.0), + offset: (-2.0, 2.0, -8.5), lateral: ("npc.bat.male.leg_r"), ), foot_r: ( - offset: (-2.0, -2.0, -7.0), + offset: (-2.0, 2.0, -8.5), lateral: ("npc.bat.male.leg_r"), ) ), (Bat, Female): ( wing_l: ( - offset: (-1.0, 2.5, -18.0), + offset: (-13.0, 2.5, -3.5), lateral: ("npc.bat.male.wing_r"), ), wing_r: ( - offset: (-1.0, 2.5, -18.0), + offset: (-1.0, 2.5, -3.5), lateral: ("npc.bat.male.wing_r"), ), foot_l: ( - offset: (-2.0, -2.0, -7.0), + offset: (-2.0, 2.0, -8.5), lateral: ("npc.bat.male.leg_r"), ), foot_r: ( - offset: (-2.0, -2.0, -7.0), + offset: (-2.0, 2.0, -8.5), lateral: ("npc.bat.male.leg_r"), ) ), diff --git a/assets/voxygen/voxel/npc/bat/male/leg_r.vox b/assets/voxygen/voxel/npc/bat/male/leg_r.vox index e62c3c300e..17bee2d3a0 100644 --- a/assets/voxygen/voxel/npc/bat/male/leg_r.vox +++ b/assets/voxygen/voxel/npc/bat/male/leg_r.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7d17fc3c09de234e00b7e09aecaacec046869820fce9a0bfc42a0bff83b1130e +oid sha256:6f291cc978b6825689c9144be29efaef6093ed16bf61eb736fc0c8a9db5aedcf size 1148 diff --git a/assets/voxygen/voxel/npc/bat/male/wing_r.vox b/assets/voxygen/voxel/npc/bat/male/wing_r.vox index 787eb63df4..dab3f84466 100644 --- a/assets/voxygen/voxel/npc/bat/male/wing_r.vox +++ b/assets/voxygen/voxel/npc/bat/male/wing_r.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9a88f725949d5f42891f3b7cb20e7e13b086632051d6469344cbc728218819e1 +oid sha256:ded179cd04c8f42c4a8a8e247eb10d1daaf85ac1bcefd815313ed9a2d0969cf3 size 1544 diff --git a/assets/world/wildlife/spawn/calendar/halloween/halloween.ron b/assets/world/wildlife/spawn/calendar/halloween/halloween.ron index 692a48082a..ab70bea12c 100644 --- a/assets/world/wildlife/spawn/calendar/halloween/halloween.ron +++ b/assets/world/wildlife/spawn/calendar/halloween/halloween.ron @@ -6,6 +6,7 @@ SpawnEntry ( groups: [ (1, (1, 1, "common.entity.calendar.halloween.aggressive.halloween_harvester")), (2, (1, 1, "common.entity.calendar.halloween.aggressive.halloween_dullahan")), + (3, (4, 8, "common.entity.wild.aggressive.bat")), (3, (3, 6, "common.entity.calendar.halloween.aggressive.trickster")), ], spawn_mode: Land, diff --git a/assets/world/wildlife/spawn/desert/hot.ron b/assets/world/wildlife/spawn/desert/hot.ron index 9b087d09e7..ad6a707e1b 100644 --- a/assets/world/wildlife/spawn/desert/hot.ron +++ b/assets/world/wildlife/spawn/desert/hot.ron @@ -20,6 +20,7 @@ SpawnEntry ( (1, (1, 1, "common.entity.wild.peaceful.holladon")), (1, (1, 1, "common.entity.wild.peaceful.porcupine")), (1, (1, 1, "common.entity.wild.peaceful.pangolin")), + (1, (4, 8, "common.entity.wild.aggressive.bat")), ], spawn_mode: Land, day_period: [Night], diff --git a/assets/world/wildlife/spawn/jungle/rainforest_area.ron b/assets/world/wildlife/spawn/jungle/rainforest_area.ron index 1bc0dcaccc..03e0f4886d 100644 --- a/assets/world/wildlife/spawn/jungle/rainforest_area.ron +++ b/assets/world/wildlife/spawn/jungle/rainforest_area.ron @@ -22,6 +22,7 @@ SpawnEntry ( groups: [ (5, (1, 1, "common.entity.wild.peaceful.quokka")), (1, (1, 1, "common.entity.wild.peaceful.tortoise")), + (5, (4, 8, "common.entity.wild.aggressive.bat")), ], spawn_mode: Land, day_period: [Night], diff --git a/assets/world/wildlife/spawn/temperate/rainforest.ron b/assets/world/wildlife/spawn/temperate/rainforest.ron index 2e441dc34e..09ef34c004 100644 --- a/assets/world/wildlife/spawn/temperate/rainforest.ron +++ b/assets/world/wildlife/spawn/temperate/rainforest.ron @@ -45,6 +45,7 @@ SpawnEntry ( // Pack (5, (1, 3, "common.entity.wild.peaceful.rat")), (5, (1, 3, "common.entity.wild.peaceful.squirrel")), + (10, (4, 8, "common.entity.wild.aggressive.bat")), ], spawn_mode: Land, day_period: [Night], diff --git a/common/src/comp/body.rs b/common/src/comp/body.rs index c93459c768..3981b75fe5 100644 --- a/common/src/comp/body.rs +++ b/common/src/comp/body.rs @@ -424,6 +424,7 @@ impl Body { bird_medium::Species::Duck => Vec3::new(0.9, 1.0, 1.4), bird_medium::Species::Goose => Vec3::new(1.0, 1.2, 1.5), bird_medium::Species::Peacock => Vec3::new(1.3, 1.1, 1.4), + bird_medium::Species::Bat => Vec3::new(2.0, 2.0, 1.5), _ => Vec3::new(2.0, 1.0, 1.5), }, Body::BirdLarge(body) => match body.species { diff --git a/voxygen/anim/src/bird_medium/mod.rs b/voxygen/anim/src/bird_medium/mod.rs index 124753f418..e5f9694efa 100644 --- a/voxygen/anim/src/bird_medium/mod.rs +++ b/voxygen/anim/src/bird_medium/mod.rs @@ -153,7 +153,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Owl, Female) => (3.5, -6.0, 3.5), (Parrot, _) => (2.0, -4.5, 3.0), (Penguin, _) => (4.0, 0.5, 1.0), - (Bat, _) => (3.0, -8.0, 4.0), + (Bat, _) => (3.0, -8.0, -1.0), }, foot: match (body.species, body.body_type) { (Duck, _) => (2.5, -2.0, 4.0), @@ -166,7 +166,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Owl, Female) => (1.5, -3.0, 6.5), (Parrot, _) => (1.5, -3.0, 3.0), (Penguin, _) => (2.5, -2.0, 6.0), - (Bat, _) => (2.0, -2.0, 8.0), + (Bat, _) => (5.0, -1.0, 8.0), }, feed: match (body.species, body.body_type) { (Chicken, _) => 1.2, diff --git a/world/src/layer/cave.rs b/world/src/layer/cave.rs index d99e4b52d2..932c1b22e9 100644 --- a/world/src/layer/cave.rs +++ b/world/src/layer/cave.rs @@ -828,6 +828,10 @@ fn apply_entity_spawns(canvas: &mut Canvas, wpos: Vec3, biome: &Bio Some("common.entity.wild.peaceful.fungome"), (biome.mushroom + 0.02) * 0.5, ), + ( + Some("common.entity.wild.aggressive.bat"), + (biome.mushroom + 0.1) * 0.5, + ), // Leafy biome ( Some("common.entity.wild.peaceful.holladon"), @@ -869,6 +873,10 @@ fn apply_entity_spawns(canvas: &mut Canvas, wpos: Vec3, biome: &Bio Some("common.entity.wild.aggressive.swamp_troll"), (biome.leafy + 0.0) * 0.1, ), + ( + Some("common.entity.wild.aggressive.bat"), + (biome.leafy + 0.1) * 0.5, + ), // Dusty biome ( Some("common.entity.wild.aggressive.dodarock"), @@ -890,6 +898,10 @@ fn apply_entity_spawns(canvas: &mut Canvas, wpos: Vec3, biome: &Bio Some("common.entity.wild.peaceful.rat"), (biome.dusty + 0.1) * 0.3, ), + ( + Some("common.entity.wild.aggressive.bat"), + (biome.dusty + 0.1) * 0.5, + ), // Icy biome ( Some("common.entity.wild.aggressive.blue_oni"), From 18659f7d098dfa2656d8c47ae3397b1fa3452f47 Mon Sep 17 00:00:00 2001 From: IsseW Date: Tue, 25 Oct 2022 00:31:33 +0200 Subject: [PATCH 12/14] Consumable sounds --- assets/voxygen/audio/sfx.ron | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/assets/voxygen/audio/sfx.ron b/assets/voxygen/audio/sfx.ron index b373f5b9c8..70197f4b5f 100644 --- a/assets/voxygen/audio/sfx.ron +++ b/assets/voxygen/audio/sfx.ron @@ -992,6 +992,18 @@ ], threshold: 0.3, ), + Inventory(Consumed("Honeycorn")): ( + files: [ + "voxygen.audio.sfx.inventory.consumable.food", + ], + threshold: 0.3, + ), + Inventory(Consumed("Pumpkin Spice Brew")): ( + files: [ + "voxygen.audio.sfx.inventory.consumable.liquid", + ], + threshold: 0.3, + ), // //Combat From 9b1efe1bee8d38d7b91979e042f921a2baee150c Mon Sep 17 00:00:00 2001 From: flo666 Date: Sun, 23 Oct 2022 21:04:04 +0200 Subject: [PATCH 13/14] clippy, fmt, remove leftover file, fix sitenames in soundtrack --- assets/common/entity/wild/aggressive/bat.ron | 2 +- assets/common/loot_tables/calendar/halloween/bat.ron | 4 ---- assets/common/loot_tables/creature/bat.ron | 2 +- common/src/calendar.rs | 2 +- server/agent/src/action_nodes.rs | 5 ++--- server/agent/src/attack.rs | 4 ++-- 6 files changed, 7 insertions(+), 12 deletions(-) delete mode 100644 assets/common/loot_tables/calendar/halloween/bat.ron diff --git a/assets/common/entity/wild/aggressive/bat.ron b/assets/common/entity/wild/aggressive/bat.ron index a21793f3a3..fd30d40975 100644 --- a/assets/common/entity/wild/aggressive/bat.ron +++ b/assets/common/entity/wild/aggressive/bat.ron @@ -3,7 +3,7 @@ name: Automatic, body: RandomWith("bat"), alignment: Alignment(Enemy), - loot: LootTable("common.loot_tables.calendar.halloween.bat"), + loot: LootTable("common.loot_tables.creature.bat"), inventory: ( loadout: FromBody, ), diff --git a/assets/common/loot_tables/calendar/halloween/bat.ron b/assets/common/loot_tables/calendar/halloween/bat.ron deleted file mode 100644 index c5bef9a83c..0000000000 --- a/assets/common/loot_tables/calendar/halloween/bat.ron +++ /dev/null @@ -1,4 +0,0 @@ -[ - (1.0, Item("common.items.food.pumpkin_spice_brew")), - (5.0, Item("common.items.food.honeycorn")), -] \ No newline at end of file diff --git a/assets/common/loot_tables/creature/bat.ron b/assets/common/loot_tables/creature/bat.ron index 8d6d484afb..3fee169125 100644 --- a/assets/common/loot_tables/creature/bat.ron +++ b/assets/common/loot_tables/creature/bat.ron @@ -5,5 +5,5 @@ // crafting (1.0, Item("common.items.crafting_ing.hide.animal_hide")), - (1.0, Item("common.items.crafting_ing.animal_misc.shar_fang")), + (1.0, Item("common.items.crafting_ing.animal_misc.sharp_fang")), ] \ No newline at end of file diff --git a/common/src/calendar.rs b/common/src/calendar.rs index c2cf2299c4..6d1aa977f3 100644 --- a/common/src/calendar.rs +++ b/common/src/calendar.rs @@ -38,7 +38,7 @@ impl Calendar { this.events.push(CalendarEvent::Christmas); } - if now.month() == 10 && (01..=31).contains(&now.day()) { + if now.month() == 10 && (24..=31).contains(&now.day()) { this.events.push(CalendarEvent::Halloween); } diff --git a/server/agent/src/action_nodes.rs b/server/agent/src/action_nodes.rs index b30dc4f07c..f8a7301e1e 100644 --- a/server/agent/src/action_nodes.rs +++ b/server/agent/src/action_nodes.rs @@ -331,9 +331,8 @@ impl<'a> AgentData<'a> { .as_ref() .map_or(false, |item| { item.ability_spec().map_or(false, |a_s| match &*a_s { - AbilitySpec::Custom(spec) => match spec.as_str() { - "Simple Flying Melee" => true, - _ => false, + AbilitySpec::Custom(spec) => { + matches!(spec.as_str(), "Simple Flying Melee") }, _ => false, }) diff --git a/server/agent/src/attack.rs b/server/agent/src/attack.rs index 1c75da5e5a..01e6f605e3 100644 --- a/server/agent/src/attack.rs +++ b/server/agent/src/attack.rs @@ -57,12 +57,12 @@ impl<'a> AgentData<'a> { // and the agent is able to freely fly around pub fn handle_simple_flying_melee( &self, - agent: &mut Agent, + _agent: &mut Agent, controller: &mut Controller, attack_data: &AttackData, tgt_data: &TargetData, read_data: &ReadData, - rng: &mut impl Rng, + _rng: &mut impl Rng, ) { // Fly to target let dir_to_target = ((tgt_data.pos.0 + Vec3::unit_z() * 1.5) - self.pos.0) From ada9bd8f3647044e1170be1b1a5da7f0c0cb9ef4 Mon Sep 17 00:00:00 2001 From: flo666 Date: Sun, 23 Oct 2022 22:56:34 +0200 Subject: [PATCH 14/14] fix unitest error: layer::wildlife::tests::test_name_uniqueness' panicked at 'world.wildlife.spawn.calendar.halloween.halloween: --- .../{halloween.ron => jungle/area.ron} | 4 ++-- .../spawn/calendar/halloween/taiga/core.ron | 17 +++++++++++++++++ .../calendar/halloween/temperate/rainforest.ron | 17 +++++++++++++++++ .../calendar/halloween/tropical/rainforest.ron | 17 +++++++++++++++++ .../spawn/calendar/halloween/tundra/core.ron | 17 +++++++++++++++++ .../spawn/calendar/halloween/tundra/forest.ron | 17 +++++++++++++++++ .../spawn/calendar/halloween/tundra/snow.ron | 17 +++++++++++++++++ world/src/layer/wildlife.rs | 14 +++++++------- 8 files changed, 111 insertions(+), 9 deletions(-) rename assets/world/wildlife/spawn/calendar/halloween/{halloween.ron => jungle/area.ron} (89%) create mode 100644 assets/world/wildlife/spawn/calendar/halloween/taiga/core.ron create mode 100644 assets/world/wildlife/spawn/calendar/halloween/temperate/rainforest.ron create mode 100644 assets/world/wildlife/spawn/calendar/halloween/tropical/rainforest.ron create mode 100644 assets/world/wildlife/spawn/calendar/halloween/tundra/core.ron create mode 100644 assets/world/wildlife/spawn/calendar/halloween/tundra/forest.ron create mode 100644 assets/world/wildlife/spawn/calendar/halloween/tundra/snow.ron diff --git a/assets/world/wildlife/spawn/calendar/halloween/halloween.ron b/assets/world/wildlife/spawn/calendar/halloween/jungle/area.ron similarity index 89% rename from assets/world/wildlife/spawn/calendar/halloween/halloween.ron rename to assets/world/wildlife/spawn/calendar/halloween/jungle/area.ron index ab70bea12c..b82d7ed5f2 100644 --- a/assets/world/wildlife/spawn/calendar/halloween/halloween.ron +++ b/assets/world/wildlife/spawn/calendar/halloween/jungle/area.ron @@ -1,6 +1,6 @@ SpawnEntry ( - name: "Halloween NPCs", - note: "Search for them in forests.", + name: "Halloween Jungle Area", + note: "Halloween NPCs", rules: [ Pack( groups: [ diff --git a/assets/world/wildlife/spawn/calendar/halloween/taiga/core.ron b/assets/world/wildlife/spawn/calendar/halloween/taiga/core.ron new file mode 100644 index 0000000000..db63258a74 --- /dev/null +++ b/assets/world/wildlife/spawn/calendar/halloween/taiga/core.ron @@ -0,0 +1,17 @@ +SpawnEntry ( + name: "Halloween Taiga Core", + note: "Halloween NPCs", + rules: [ + Pack( + groups: [ + (1, (1, 1, "common.entity.calendar.halloween.aggressive.halloween_harvester")), + (2, (1, 1, "common.entity.calendar.halloween.aggressive.halloween_dullahan")), + (3, (4, 8, "common.entity.wild.aggressive.bat")), + (3, (3, 6, "common.entity.calendar.halloween.aggressive.trickster")), + ], + spawn_mode: Land, + calendar_events: Some([Halloween]), + day_period: [Night, Morning, Noon, Evening], + ), + ], +) diff --git a/assets/world/wildlife/spawn/calendar/halloween/temperate/rainforest.ron b/assets/world/wildlife/spawn/calendar/halloween/temperate/rainforest.ron new file mode 100644 index 0000000000..717010c3f0 --- /dev/null +++ b/assets/world/wildlife/spawn/calendar/halloween/temperate/rainforest.ron @@ -0,0 +1,17 @@ +SpawnEntry ( + name: "Halloween Temperate Rainforest", + note: "Halloween NPCs", + rules: [ + Pack( + groups: [ + (1, (1, 1, "common.entity.calendar.halloween.aggressive.halloween_harvester")), + (2, (1, 1, "common.entity.calendar.halloween.aggressive.halloween_dullahan")), + (3, (4, 8, "common.entity.wild.aggressive.bat")), + (3, (3, 6, "common.entity.calendar.halloween.aggressive.trickster")), + ], + spawn_mode: Land, + calendar_events: Some([Halloween]), + day_period: [Night, Morning, Noon, Evening], + ), + ], +) diff --git a/assets/world/wildlife/spawn/calendar/halloween/tropical/rainforest.ron b/assets/world/wildlife/spawn/calendar/halloween/tropical/rainforest.ron new file mode 100644 index 0000000000..57bcb07c71 --- /dev/null +++ b/assets/world/wildlife/spawn/calendar/halloween/tropical/rainforest.ron @@ -0,0 +1,17 @@ +SpawnEntry ( + name: "Halloween Tropical Rainforest", + note: "Halloween NPCs", + rules: [ + Pack( + groups: [ + (1, (1, 1, "common.entity.calendar.halloween.aggressive.halloween_harvester")), + (2, (1, 1, "common.entity.calendar.halloween.aggressive.halloween_dullahan")), + (3, (4, 8, "common.entity.wild.aggressive.bat")), + (3, (3, 6, "common.entity.calendar.halloween.aggressive.trickster")), + ], + spawn_mode: Land, + calendar_events: Some([Halloween]), + day_period: [Night, Morning, Noon, Evening], + ), + ], +) diff --git a/assets/world/wildlife/spawn/calendar/halloween/tundra/core.ron b/assets/world/wildlife/spawn/calendar/halloween/tundra/core.ron new file mode 100644 index 0000000000..8f1a0ee81a --- /dev/null +++ b/assets/world/wildlife/spawn/calendar/halloween/tundra/core.ron @@ -0,0 +1,17 @@ +SpawnEntry ( + name: "Halloween Tundra Core", + note: "Halloween NPCs", + rules: [ + Pack( + groups: [ + (1, (1, 1, "common.entity.calendar.halloween.aggressive.halloween_harvester")), + (2, (1, 1, "common.entity.calendar.halloween.aggressive.halloween_dullahan")), + (3, (4, 8, "common.entity.wild.aggressive.bat")), + (3, (3, 6, "common.entity.calendar.halloween.aggressive.trickster")), + ], + spawn_mode: Land, + calendar_events: Some([Halloween]), + day_period: [Night, Morning, Noon, Evening], + ), + ], +) diff --git a/assets/world/wildlife/spawn/calendar/halloween/tundra/forest.ron b/assets/world/wildlife/spawn/calendar/halloween/tundra/forest.ron new file mode 100644 index 0000000000..3cfd48d565 --- /dev/null +++ b/assets/world/wildlife/spawn/calendar/halloween/tundra/forest.ron @@ -0,0 +1,17 @@ +SpawnEntry ( + name: "Halloween Tundra Forest", + note: "Halloween NPCs", + rules: [ + Pack( + groups: [ + (1, (1, 1, "common.entity.calendar.halloween.aggressive.halloween_harvester")), + (2, (1, 1, "common.entity.calendar.halloween.aggressive.halloween_dullahan")), + (3, (4, 8, "common.entity.wild.aggressive.bat")), + (3, (3, 6, "common.entity.calendar.halloween.aggressive.trickster")), + ], + spawn_mode: Land, + calendar_events: Some([Halloween]), + day_period: [Night, Morning, Noon, Evening], + ), + ], +) diff --git a/assets/world/wildlife/spawn/calendar/halloween/tundra/snow.ron b/assets/world/wildlife/spawn/calendar/halloween/tundra/snow.ron new file mode 100644 index 0000000000..dc1b2abbfc --- /dev/null +++ b/assets/world/wildlife/spawn/calendar/halloween/tundra/snow.ron @@ -0,0 +1,17 @@ +SpawnEntry ( + name: "Halloween Tundra Snow", + note: "Halloween NPCs", + rules: [ + Pack( + groups: [ + (1, (1, 1, "common.entity.calendar.halloween.aggressive.halloween_harvester")), + (2, (1, 1, "common.entity.calendar.halloween.aggressive.halloween_dullahan")), + (3, (4, 8, "common.entity.wild.aggressive.bat")), + (3, (3, 6, "common.entity.calendar.halloween.aggressive.trickster")), + ], + spawn_mode: Land, + calendar_events: Some([Halloween]), + day_period: [Night, Morning, Noon, Evening], + ), + ], +) diff --git a/world/src/layer/wildlife.rs b/world/src/layer/wildlife.rs index 138e8f3e02..72872e82a0 100644 --- a/world/src/layer/wildlife.rs +++ b/world/src/layer/wildlife.rs @@ -168,7 +168,7 @@ pub fn spawn_manifest() -> Vec<(&'static str, DensityFn)> { |c, _col| close(c.temp, CONFIG.snow_temp, 0.15) * BASE_DENSITY * 0.5, ), ( - "world.wildlife.spawn.calendar.halloween.halloween", + "world.wildlife.spawn.calendar.halloween.tundra.core", |c, _col| close(c.temp, CONFIG.snow_temp, 0.15) * BASE_DENSITY * 0.5, ), // Snowy animals @@ -186,7 +186,7 @@ pub fn spawn_manifest() -> Vec<(&'static str, DensityFn)> { }, ), ( - "world.wildlife.spawn.calendar.halloween.halloween", + "world.wildlife.spawn.calendar.halloween.tundra.snow", |c, col| { close(c.temp, CONFIG.snow_temp, 0.3) * BASE_DENSITY @@ -204,7 +204,7 @@ pub fn spawn_manifest() -> Vec<(&'static str, DensityFn)> { |c, col| close(c.temp, CONFIG.snow_temp, 0.3) * col.tree_density * BASE_DENSITY * 1.4, ), ( - "world.wildlife.spawn.calendar.halloween.halloween", + "world.wildlife.spawn.calendar.halloween.tundra.forest", |c, col| close(c.temp, CONFIG.snow_temp, 0.3) * col.tree_density * BASE_DENSITY * 1.4, ), // **Taiga** @@ -220,7 +220,7 @@ pub fn spawn_manifest() -> Vec<(&'static str, DensityFn)> { }, ), ( - "world.wildlife.spawn.calendar.halloween.halloween", + "world.wildlife.spawn.calendar.halloween.taiga.core", |c, col| { close(c.temp, CONFIG.snow_temp + 0.2, 0.2) * col.tree_density * BASE_DENSITY * 0.4 }, @@ -268,7 +268,7 @@ pub fn spawn_manifest() -> Vec<(&'static str, DensityFn)> { }), // Temperate Rainforest animals event ( - "world.wildlife.spawn.calendar.halloween.halloween", + "world.wildlife.spawn.calendar.halloween.temperate.rainforest", |c, _col| { close(c.temp, CONFIG.temperate_temp + 0.1, 0.6) * close(c.humidity, CONFIG.forest_hum, 0.6) @@ -297,7 +297,7 @@ pub fn spawn_manifest() -> Vec<(&'static str, DensityFn)> { }), // Jungle animals event ( - "world.wildlife.spawn.calendar.halloween.halloween", + "world.wildlife.spawn.calendar.halloween.jungle.area", |c, _col| { close(c.temp, CONFIG.tropical_temp + 0.2, 0.3) * close(c.humidity, CONFIG.jungle_hum, 0.2) @@ -353,7 +353,7 @@ pub fn spawn_manifest() -> Vec<(&'static str, DensityFn)> { }), // Tropical Rainforest animals event ( - "world.wildlife.spawn.calendar.halloween.halloween", + "world.wildlife.spawn.calendar.halloween.tropical.rainforest", |c, _col| { close(c.temp, CONFIG.tropical_temp + 0.1, 0.4) * close(c.humidity, CONFIG.desert_hum, 0.4)