Arthropods spawns and loots

This commit is contained in:
Snowram 2021-11-10 22:41:44 +01:00
parent 82df5f23c3
commit f6d7ba33ef
25 changed files with 160 additions and 30 deletions

View File

@ -2,12 +2,13 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.8, buildup_duration: 0.8,
recover_duration: 0.35, recover_duration: 0.35,
projectile: PoisonBall( projectile: Poisonball(
damage: 26.0, damage: 26.0,
radius: 5.0, radius: 5.0,
energy_regen: 0, energy_regen: 0,
min_falloff: 0.5,
), ),
projectile_body: Object(FireworkPurple), projectile_body: Object(SpitPoison),
/*projectile_light: Some(LightEmitter { /*projectile_light: Some(LightEmitter {
col: (1.0, 0.75, 0.11).into(), col: (1.0, 0.75, 0.11).into(),
..Default::default() ..Default::default()

View File

@ -7,7 +7,7 @@ BasicRanged(
radius: 5.0, radius: 5.0,
min_falloff: 0.5, min_falloff: 0.5,
), ),
projectile_body: Object(BoltFire), // TODO: Get ice projectile model projectile_body: Object(BoltIcicle),
/*projectile_light: Some(LightEmitter { /*projectile_light: Some(LightEmitter {
col: (1.0, 0.75, 0.11).into(), col: (1.0, 0.75, 0.11).into(),
..Default::default() ..Default::default()

View File

@ -0,0 +1,11 @@
EntityConfig (
name: Automatic,
body: RandomWith("antlion"),
alignment: Alignment(Enemy),
loot: LootTable("common.loot_tables.creature.arthropod.web"),
hands: Uninit,
meta: [],
)

View File

@ -0,0 +1,11 @@
EntityConfig (
name: Automatic,
body: RandomWith("black_window"),
alignment: Alignment(Enemy),
loot: LootTable("common.loot_tables.creature.arthropod.web"),
hands: Uninit,
meta: [],
)

View File

@ -0,0 +1,11 @@
EntityConfig (
name: Automatic,
body: RandomWith("horn_beetle"),
alignment: Alignment(Enemy),
loot: LootTable("common.loot_tables.creature.arthropod.carapace"),
hands: Uninit,
meta: [],
)

View File

@ -0,0 +1,11 @@
EntityConfig (
name: Automatic,
body: RandomWith("stag_beetle"),
alignment: Alignment(Enemy),
loot: LootTable("common.loot_tables.creature.arthropod.carapace"),
hands: Uninit,
meta: [],
)

View File

@ -0,0 +1,11 @@
EntityConfig (
name: Automatic,
body: RandomWith("tarantula"),
alignment: Alignment(Enemy),
loot: LootTable("common.loot_tables.creature.arthropod.web"),
hands: Uninit,
meta: [],
)

View File

@ -0,0 +1,11 @@
EntityConfig (
name: Automatic,
body: RandomWith("leaf_beetle"),
alignment: Alignment(Wild),
loot: LootTable("common.loot_tables.creature.arthropod.leaf"),
hands: Uninit,
meta: [],
)

View File

@ -4,12 +4,8 @@ ItemDef(
kind: Armor(( kind: Armor((
kind: Chest("Arthropod"), kind: Chest("Arthropod"),
stats: ( stats: (
protection: Normal(100.0), protection: Some(Normal(100.0)),
poise_resilience: Normal(1.0), poise_resilience: Some(Normal(1.0)),
energy_max: 0,
energy_reward: 0.0,
crit_power: 0.0,
stealth: 0.0,
), ),
)), )),
quality: Legendary, quality: Legendary,

View File

@ -0,0 +1,3 @@
[
(1.0, ItemQuantity("common.items.crafting_ing.hide.carapace", 1, 3)),
]

View File

@ -0,0 +1,4 @@
[
(1.0, ItemQuantity("common.items.crafting_ing.twigs", 1, 3)),
(1.0, ItemQuantity("common.items.flowers.plant_fiber", 1, 3)),
]

View File

@ -799,4 +799,24 @@
central: ("armor.empty"), central: ("armor.empty"),
) )
), ),
BoltIcicle: (
bone0: (
offset: (-2.5, -6.0, -2.5),
central: ("weapon.projectile.icicle-bolt"),
),
bone1: (
offset: (0.0, 0.0, 0.0),
central: ("armor.empty"),
)
),
SpitPoison: (
bone0: (
offset: (-3.0, -5.0, -3.0),
central: ("weapon.projectile.poison-spit"),
),
bone1: (
offset: (0.0, 0.0, 0.0),
central: ("armor.empty"),
)
),
}) })

BIN
assets/voxygen/voxel/weapon/projectile/icicle-bolt.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/weapon/projectile/poison-spit.vox (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -5,9 +5,10 @@ SpawnEntry (
Pack( Pack(
groups: [ groups: [
// Casual // Casual
(100, (1, 1, "common.entity.wild.aggressive.bonerattler")), (110, (1, 1, "common.entity.wild.aggressive.bonerattler")),
(100, (1, 1, "common.entity.wild.aggressive.sand_raptor")), (100, (1, 1, "common.entity.wild.aggressive.sand_raptor")),
(100, (1, 1, "common.entity.wild.aggressive.sandshark")), (100, (1, 1, "common.entity.wild.aggressive.sandshark")),
(100, (1, 1, "common.entity.wild.aggressive.stag_beetle")),
// Rare // Rare
(20, (1, 1, "common.entity.wild.aggressive.lavadrake")), (20, (1, 1, "common.entity.wild.aggressive.lavadrake")),
(20, (1, 1, "common.entity.wild.aggressive.ntouka")), (20, (1, 1, "common.entity.wild.aggressive.ntouka")),

View File

@ -6,6 +6,7 @@ SpawnEntry (
groups: [ groups: [
(1, (1, 1, "common.entity.wild.aggressive.wendigo")), (1, (1, 1, "common.entity.wild.aggressive.wendigo")),
(1, (1, 1, "common.entity.wild.aggressive.dreadhorn")), (1, (1, 1, "common.entity.wild.aggressive.dreadhorn")),
(1, (1, 1, "common.entity.wild.aggressive.horn_beetle")),
], ],
is_underwater: false, is_underwater: false,
day_period: [Night, Morning, Noon, Evening], day_period: [Night, Morning, Noon, Evening],

View File

@ -30,6 +30,7 @@ SpawnEntry (
(2, (1, 1, "common.entity.wild.peaceful.turtle")), (2, (1, 1, "common.entity.wild.peaceful.turtle")),
(2, (1, 1, "common.entity.wild.peaceful.hirdrasil")), (2, (1, 1, "common.entity.wild.peaceful.hirdrasil")),
(2, (1, 1, "common.entity.wild.peaceful.truffler")), (2, (1, 1, "common.entity.wild.peaceful.truffler")),
(2, (1, 1, "common.entity.wild.peaceful.leaf_beetle")),
], ],
is_underwater: false, is_underwater: false,
day_period: [Morning, Noon, Evening], day_period: [Morning, Noon, Evening],

View File

@ -659,7 +659,7 @@ impl Body {
quadruped_low::Species::Deadwood => 120, quadruped_low::Species::Deadwood => 120,
_ => 70, _ => 70,
}, },
Body::Arthropod(_) => 100, Body::Arthropod(_) => 10000,
Body::Ship(_) => 1000, Body::Ship(_) => 1000,
} }
} }

View File

@ -92,6 +92,8 @@ make_case_elim!(
Apple = 77, Apple = 77,
Hive = 78, Hive = 78,
Coconut = 79, Coconut = 79,
SpitPoison = 80,
BoltIcicle = 81,
} }
); );
@ -272,6 +274,8 @@ impl Body {
Body::Apple => "apple", Body::Apple => "apple",
Body::Hive => "hive", Body::Hive => "hive",
Body::Coconut => "coconut", Body::Coconut => "coconut",
Body::SpitPoison => "spit_poison",
Body::BoltIcicle => "bolt_icicle",
} }
} }
@ -310,7 +314,7 @@ impl Body {
Body::BedBlue => 50.0, Body::BedBlue => 50.0,
Body::Bedroll => 3.0, Body::Bedroll => 3.0,
Body::Bench => 100.0, Body::Bench => 100.0,
Body::BoltFire | Body::BoltFireBig | Body::BoltNature => 1.0, Body::BoltFire | Body::BoltFireBig | Body::BoltNature | Body::BoltIcicle | Body::SpitPoison => 1.0,
Body::Bomb => { Body::Bomb => {
0.5 * IRON_DENSITY * std::f32::consts::PI / 6.0 * self.dimensions().x.powi(3) 0.5 * IRON_DENSITY * std::f32::consts::PI / 6.0 * self.dimensions().x.powi(3)
}, },

View File

@ -61,7 +61,7 @@ pub enum ProjectileConstructor {
radius: f32, radius: f32,
min_falloff: f32, min_falloff: f32,
}, },
PoisonBall { Poisonball {
damage: f32, damage: f32,
radius: f32, radius: f32,
min_falloff: f32, min_falloff: f32,
@ -228,7 +228,7 @@ impl ProjectileConstructor {
is_point: true, is_point: true,
} }
}, },
PoisonBall { Poisonball {
damage, damage,
radius, radius,
min_falloff, min_falloff,
@ -483,7 +483,7 @@ impl ProjectileConstructor {
*damage *= power; *damage *= power;
*radius *= range; *radius *= range;
}, },
PoisonBall { Poisonball {
ref mut damage, ref mut damage,
ref mut radius, ref mut radius,
.. ..

View File

@ -18,7 +18,7 @@ impl Animation for LeapMeleeAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_leapmelee")] #[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_leapmelee")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(_velocity, _global_time, stage_section, _timer): Self::Dependency<'a>, (_velocity, global_time, stage_section, _timer): Self::Dependency<'a>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,
@ -34,6 +34,7 @@ impl Animation for LeapMeleeAnimation {
_ => (0.0, 0.0, 0.0, 0.0), _ => (0.0, 0.0, 0.0, 0.0),
}; };
let pullback = 1.0 - movement4; let pullback = 1.0 - movement4;
let early_pullback = 1.0 - movement3base;
//let subtract = global_time - timer; //let subtract = global_time - timer;
//let check = subtract - subtract.trunc(); //let check = subtract - subtract.trunc();
//let mirror = (check - 0.5).signum(); //let mirror = (check - 0.5).signum();
@ -44,6 +45,8 @@ impl Animation for LeapMeleeAnimation {
//let twitch1 = (movement1base * 10.0).sin() * (1.0 - movement2base); //let twitch1 = (movement1base * 10.0).sin() * (1.0 - movement2base);
//let twitch3 = (movement3base * 5.0).sin() * mirror; //let twitch3 = (movement3base * 5.0).sin() * mirror;
//let twitch1abs = twitch1 * mirror; //let twitch1abs = twitch1 * mirror;
let shortalt = (global_time * 80.0).sin() * movement2base * early_pullback;
dbg!(anim_time);
next.chest.scale = Vec3::one() / s_a.scaler; next.chest.scale = Vec3::one() / s_a.scaler;
@ -74,10 +77,10 @@ impl Animation for LeapMeleeAnimation {
next.leg_fl.position = Vec3::new(-s_a.leg_f.0, s_a.leg_f.1, s_a.leg_f.2); next.leg_fl.position = Vec3::new(-s_a.leg_f.0, s_a.leg_f.1, s_a.leg_f.2);
next.leg_fr.position = Vec3::new(s_a.leg_f.0, s_a.leg_f.1, s_a.leg_f.2); next.leg_fr.position = Vec3::new(s_a.leg_f.0, s_a.leg_f.1, s_a.leg_f.2);
next.leg_fl.orientation = next.leg_fl.orientation =
Quaternion::rotation_x(movement1abs * 0.2 + movement2abs * -1.0 + movement3abs * 0.8) Quaternion::rotation_x(movement1abs * 0.2 + movement2abs * 0.8 + movement3abs * -1.5)
* Quaternion::rotation_z(s_a.leg_ori.0); * Quaternion::rotation_z(s_a.leg_ori.0);
next.leg_fr.orientation = next.leg_fr.orientation =
Quaternion::rotation_x(movement1abs * 0.2 + movement2abs * -1.0 + movement3abs * 0.8) Quaternion::rotation_x(movement1abs * 0.2 + movement2abs * 0.8 + movement3abs * -1.5)
* Quaternion::rotation_z(-s_a.leg_ori.0); * Quaternion::rotation_z(-s_a.leg_ori.0);
next.leg_fcl.position = Vec3::new(-s_a.leg_fc.0, s_a.leg_fc.1, s_a.leg_fc.2); next.leg_fcl.position = Vec3::new(-s_a.leg_fc.0, s_a.leg_fc.1, s_a.leg_fc.2);
@ -104,6 +107,28 @@ impl Animation for LeapMeleeAnimation {
next.leg_br.orientation = Quaternion::rotation_y(movement1abs * -0.2 + movement2abs * 1.0) next.leg_br.orientation = Quaternion::rotation_y(movement1abs * -0.2 + movement2abs * 1.0)
* Quaternion::rotation_z(-s_a.leg_ori.3); * Quaternion::rotation_z(-s_a.leg_ori.3);
next.wing_fl.position = Vec3::new(-s_a.wing_f.0, s_a.wing_f.1, s_a.wing_f.2);
next.wing_fr.position = Vec3::new(s_a.wing_f.0, s_a.wing_f.1, s_a.wing_f.2);
next.wing_fl.orientation =
Quaternion::rotation_x(movement1abs * -0.4 + movement2abs * -0.2)
* Quaternion::rotation_y(movement1abs * 0.5 + movement2abs * 0.1)
* Quaternion::rotation_z(movement1abs * -0.2);
next.wing_fr.orientation =
Quaternion::rotation_x(movement1abs * -0.4 + movement2abs * -0.2)
* Quaternion::rotation_y(movement1abs * -0.5 + movement2abs * -0.1)
* Quaternion::rotation_z(movement1abs * 0.2);
next.wing_bl.position = Vec3::new(-s_a.wing_b.0, s_a.wing_b.1, s_a.wing_b.2);
next.wing_br.position = Vec3::new(s_a.wing_b.0, s_a.wing_b.1, s_a.wing_b.2);
next.wing_bl.orientation =
Quaternion::rotation_x((movement1abs * -0.2 + movement2abs * -0.6) * early_pullback)
* Quaternion::rotation_y(movement1abs * 0.4 + shortalt * 2.0 + movement2abs * 0.1)
* Quaternion::rotation_z(movement1abs * -1.4);
next.wing_br.orientation =
Quaternion::rotation_x((movement1abs * -0.2 + movement2abs * -0.6) * early_pullback)
* Quaternion::rotation_y(movement1abs * -0.4 + shortalt * 2.0 + movement2abs * -0.1)
* Quaternion::rotation_z(movement1abs * 1.4);
next next
} }
} }

View File

@ -1,5 +1,3 @@
use std::f32::consts::PI;
use super::{ use super::{
super::{vek::*, Animation}, super::{vek::*, Animation},
ArthropodSkeleton, SkeletonAttr, ArthropodSkeleton, SkeletonAttr,
@ -18,7 +16,7 @@ impl Animation for ShootAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_shoot")] #[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_shoot")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(_velocity, global_time, stage_section, timer): Self::Dependency<'a>, (_velocity, _global_time, stage_section, _timer): Self::Dependency<'a>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,
@ -31,11 +29,6 @@ impl Animation for ShootAnimation {
_ => (0.0, 0.0, 0.0), _ => (0.0, 0.0, 0.0),
}; };
let pullback = 1.0 - movement2; let pullback = 1.0 - movement2;
let subtract = global_time - timer;
let check = subtract - subtract.trunc();
let mirror = (check - 0.5).signum();
//let movement1 = mirror * movement1base * pullback;
//let movement2 = mirror * movement2base * pullback;
let movement1abs = movement1 * pullback; let movement1abs = movement1 * pullback;
next.chest.scale = Vec3::one() / s_a.scaler; next.chest.scale = Vec3::one() / s_a.scaler;

View File

@ -17,27 +17,33 @@ impl Animation for StunnedAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_stunned")] #[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_stunned")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(_velocity, _global_time, stage_section, _timer): Self::Dependency<'a>, (_velocity, global_time, stage_section, timer): Self::Dependency<'a>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,
) -> Self::Skeleton { ) -> Self::Skeleton {
let mut next = (*skeleton).clone(); let mut next = (*skeleton).clone();
let (_movement1base, _movement2, _twitch) = match stage_section { let (_movement1base, movement2, twitch) = match stage_section {
Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0),
Some(StageSection::Recover) => { Some(StageSection::Recover) => {
(1.0, anim_time.powf(3.0), ((1.0 - anim_time) * 10.0).sin()) (1.0, anim_time.powf(3.0), ((1.0 - anim_time) * 10.0).sin())
}, },
_ => (0.0, 0.0, 0.0), _ => (0.0, 0.0, 0.0),
}; };
//let pullback = 1.0 - movement2;
let pullback = 1.0 - movement2;
//let subtract = global_time - timer; //let subtract = global_time - timer;
//let check = subtract - subtract.trunc(); //let check = subtract - subtract.trunc();
//let mirror = (check - 0.5).signum(); //let mirror = (check - 0.5).signum();
//let movement1 = mirror * movement1base * pullback; //let movement1 = mirror * movement1base * pullback;
//let movement1abs = movement1base * pullback; //let movement1abs = movement1base * pullback;
let subtract = global_time - timer;
let check = subtract - subtract.trunc();
let mirror = (check - 0.5).signum();
let twitch2 = mirror * (twitch * 20.0).sin() * pullback;
next.chest.scale = Vec3::one() / s_a.scaler; next.chest.scale = Vec3::one() / s_a.scaler;
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);

View File

@ -466,9 +466,12 @@ pub fn apply_caves_supplement<'a>(
_ => "common.entity.wild.aggressive.batfox", _ => "common.entity.wild.aggressive.batfox",
} }
} else if cave_depth < 120.0 { } else if cave_depth < 120.0 {
match dynamic_rng.gen_range(0..3) { match dynamic_rng.gen_range(0..6) {
0 => "common.entity.wild.aggressive.rocksnapper", 0 => "common.entity.wild.aggressive.rocksnapper",
1 => "common.entity.wild.aggressive.cave_salamander", 1 => "common.entity.wild.aggressive.cave_salamander",
2 => "common.entity.wild.aggressive.tarantula",
3 => "common.entity.wild.aggressive.antlion",
4 => "common.entity.wild.aggressive.black_widow",
_ => "common.entity.wild.aggressive.asp", _ => "common.entity.wild.aggressive.asp",
} }
} else if cave_depth < 190.0 { } else if cave_depth < 190.0 {