From 92e28f09fcd3feeca878210e2cbfd8bb4e6b3edf Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 20 Mar 2023 21:34:18 -0400 Subject: [PATCH] Adlet abilities --- .../common/abilities/ability_set_manifest.ron | 22 ++++++++++++++ assets/common/abilities/adlet/hunter/stab.ron | 17 +++++++++++ .../common/abilities/adlet/hunter/throw.ron | 15 ++++++++++ .../common/abilities/adlet/icepicker/leap.ron | 19 ++++++++++++ .../abilities/adlet/icepicker/spike.ron | 17 +++++++++++ .../common/abilities/adlet/tracker/arrow.ron | 15 ++++++++++ .../common/abilities/adlet/tracker/trap.ron | 12 ++++++++ .../npc_weapons/biped_small/adlet/hunter.ron | 10 +++---- .../biped_small/adlet/icepicker.ron | 16 +++++----- .../npc_weapons/biped_small/adlet/tracker.ron | 12 ++++---- assets/voxygen/voxel/object_manifest.ron | 10 +++++++ .../voxel/weapon/projectile/adlet-spear.vox | 3 ++ common/src/comp/body/object.rs | 18 +++++++---- common/src/comp/projectile.rs | 30 +++++++++++++++++++ common/systems/src/buff.rs | 3 ++ rtsim/src/gen/site.rs | 5 +++- rtsim/src/rule/npc_ai.rs | 3 +- world/src/site/mod.rs | 1 + 18 files changed, 202 insertions(+), 26 deletions(-) create mode 100644 assets/common/abilities/adlet/hunter/stab.ron create mode 100644 assets/common/abilities/adlet/hunter/throw.ron create mode 100644 assets/common/abilities/adlet/icepicker/leap.ron create mode 100644 assets/common/abilities/adlet/icepicker/spike.ron create mode 100644 assets/common/abilities/adlet/tracker/arrow.ron create mode 100644 assets/common/abilities/adlet/tracker/trap.ron create mode 100644 assets/voxygen/voxel/weapon/projectile/adlet-spear.vox diff --git a/assets/common/abilities/ability_set_manifest.ron b/assets/common/abilities/ability_set_manifest.ron index b3b32f0b4f..ba01f355a5 100644 --- a/assets/common/abilities/ability_set_manifest.ron +++ b/assets/common/abilities/ability_set_manifest.ron @@ -745,4 +745,26 @@ secondary: Simple(None, "common.abilities.empty.basic"), abilities: [], ), + // Adlets + // TODO: Do we want to eventually convert these to simple variants of weapons? + Custom("Adlet Hunter"): ( + primary: "common.abilities.adlet.hunter.stab", + secondary: "common.abilities.adlet.hunter.throw", + abilities: [], + ), + Custom("Adlet Icepicker"): ( + primary: "common.abilities.adlet.icepicker.spike", + secondary: "common.abilities.adlet.icepicker.leap", + abilities: [], + ), + Custom("Adlet Tracker"): ( + primary: "common.abilities.adlet.tracker.arrow", + secondary: "common.abilities.adlet.tracker.trap", + abilities: [], + ), + // Custom("Adlet Alpha"): ( + // primary: "common.abilities.adlet.alpha", + // secondary: "common.abilities.adlet.alpha", + // abilities: [], + // ), }) diff --git a/assets/common/abilities/adlet/hunter/stab.ron b/assets/common/abilities/adlet/hunter/stab.ron new file mode 100644 index 0000000000..46827ce974 --- /dev/null +++ b/assets/common/abilities/adlet/hunter/stab.ron @@ -0,0 +1,17 @@ +BasicMelee( + energy_cost: 0, + buildup_duration: 0.15, + swing_duration: 0.05, + recover_duration: 0.55, + melee_constructor: ( + kind: Stab( + damage: 10, + poise: 5, + knockback: 0, + energy_regen: 0, + ), + range: 5, + angle: 5, + ), + ori_modifier: 1.0, +) diff --git a/assets/common/abilities/adlet/hunter/throw.ron b/assets/common/abilities/adlet/hunter/throw.ron new file mode 100644 index 0000000000..4f5d0d1d87 --- /dev/null +++ b/assets/common/abilities/adlet/hunter/throw.ron @@ -0,0 +1,15 @@ +BasicRanged( + energy_cost: 0, + buildup_duration: 0.8, + recover_duration: 0.8, + projectile: Arrow( + damage: 16, + knockback: 0, + energy_regen: 0, + ), + projectile_body: Object(AdletSpear), + projectile_light: None, + projectile_speed: 40.0, + num_projectiles: 1, + projectile_spread: 0.0, +) diff --git a/assets/common/abilities/adlet/icepicker/leap.ron b/assets/common/abilities/adlet/icepicker/leap.ron new file mode 100644 index 0000000000..59dc111fe7 --- /dev/null +++ b/assets/common/abilities/adlet/icepicker/leap.ron @@ -0,0 +1,19 @@ +LeapMelee( + energy_cost: 0.0, + buildup_duration: 0.6, + movement_duration: 0.2, + swing_duration: 0.1, + recover_duration: 0.3, + melee_constructor: ( + kind: Stab( + damage: 20, + poise: 20, + knockback: 0, + energy_regen: 0, + ), + range: 4, + angle: 30, + ), + forward_leap_strength: 18, + vertical_leap_strength: 8, +) diff --git a/assets/common/abilities/adlet/icepicker/spike.ron b/assets/common/abilities/adlet/icepicker/spike.ron new file mode 100644 index 0000000000..3ed89aada9 --- /dev/null +++ b/assets/common/abilities/adlet/icepicker/spike.ron @@ -0,0 +1,17 @@ +BasicMelee( + energy_cost: 0, + buildup_duration: 0.4, + swing_duration: 0.1, + recover_duration: 0.45, + melee_constructor: ( + kind: Stab( + damage: 12, + poise: 10, + knockback: 0, + energy_regen: 0, + ), + range: 3, + angle: 15, + ), + ori_modifier: 1.0, +) diff --git a/assets/common/abilities/adlet/tracker/arrow.ron b/assets/common/abilities/adlet/tracker/arrow.ron new file mode 100644 index 0000000000..12c767ca34 --- /dev/null +++ b/assets/common/abilities/adlet/tracker/arrow.ron @@ -0,0 +1,15 @@ +BasicRanged( + energy_cost: 0, + buildup_duration: 0.6, + recover_duration: 0.4, + projectile: Arrow( + damage: 12, + knockback: 0, + energy_regen: 0, + ), + projectile_body: Object(Arrow), + projectile_light: None, + projectile_speed: 100.0, + num_projectiles: 1, + projectile_spread: 0.0, +) diff --git a/assets/common/abilities/adlet/tracker/trap.ron b/assets/common/abilities/adlet/tracker/trap.ron new file mode 100644 index 0000000000..eb89f6ba28 --- /dev/null +++ b/assets/common/abilities/adlet/tracker/trap.ron @@ -0,0 +1,12 @@ +BasicRanged( + energy_cost: 0, + buildup_duration: 0.75, + recover_duration: 0.75, + projectile: Trap( + damage: 25, + ), + projectile_body: Object(Snowball), + projectile_speed: 10.0, + num_projectiles: 1, + projectile_spread: 0.0, +) diff --git a/assets/common/items/npc_weapons/biped_small/adlet/hunter.ron b/assets/common/items/npc_weapons/biped_small/adlet/hunter.ron index b44ff0ba1e..201ecef4be 100644 --- a/assets/common/items/npc_weapons/biped_small/adlet/hunter.ron +++ b/assets/common/items/npc_weapons/biped_small/adlet/hunter.ron @@ -5,11 +5,11 @@ ItemDef( kind: Spear, hands: Two, stats: ( - equip_time_secs: 0.0, - power: 1.05, + equip_time_secs: 0.1, + power: 1.0, effect_power: 1.0, - speed: 0.75, - crit_chance: 0.07589286, + speed: 1.0, + crit_chance: 0.1, range: 1.0, energy_efficiency: 1.0, buff_strength: 1.0, @@ -17,5 +17,5 @@ ItemDef( )), quality: Low, tags: [], - ability_spec: None, + ability_spec: Some(Custom("Adlet Hunter")), ) \ No newline at end of file diff --git a/assets/common/items/npc_weapons/biped_small/adlet/icepicker.ron b/assets/common/items/npc_weapons/biped_small/adlet/icepicker.ron index 8cc7147596..ce4731aae5 100644 --- a/assets/common/items/npc_weapons/biped_small/adlet/icepicker.ron +++ b/assets/common/items/npc_weapons/biped_small/adlet/icepicker.ron @@ -1,15 +1,15 @@ ItemDef( - name: "Icepicker Axe", + name: "Icepicker Pick", description: "", kind: Tool(( - kind: Axe, + kind: Pick, hands: Two, stats: ( - equip_time_secs: 0.0, - power: 0.7, - effect_power: 0.8, - speed: 0.7, - crit_chance: 0.05059524, + equip_time_secs: 0.1, + power: 1.0, + effect_power: 1.0, + speed: 1.0, + crit_chance: 0.1, range: 1.0, energy_efficiency: 1.0, buff_strength: 1.0, @@ -17,5 +17,5 @@ ItemDef( )), quality: Low, tags: [], - ability_spec: Some(Custom("Axe Simple")), + ability_spec: Some(Custom("Adlet Icepicker")), ) \ No newline at end of file diff --git a/assets/common/items/npc_weapons/biped_small/adlet/tracker.ron b/assets/common/items/npc_weapons/biped_small/adlet/tracker.ron index 6bce3d66e8..189ff272e3 100644 --- a/assets/common/items/npc_weapons/biped_small/adlet/tracker.ron +++ b/assets/common/items/npc_weapons/biped_small/adlet/tracker.ron @@ -6,16 +6,16 @@ ItemDef( hands: Two, stats: ( equip_time_secs: 0.0, - power: 1.05, - effect_power: 0.8, - speed: 0.4, - crit_chance: 0.08406594, + power: 1.0, + effect_power: 1.0, + speed: 1.0, + crit_chance: 0.1, range: 1.0, energy_efficiency: 1.0, buff_strength: 1.0, ), )), - quality: Moderate, + quality: Low, tags: [], - ability_spec: Some(Custom("Bow Simple")), + ability_spec: Some(Custom("Adlet Tracker")), ) \ No newline at end of file diff --git a/assets/voxygen/voxel/object_manifest.ron b/assets/voxygen/voxel/object_manifest.ron index c21739a238..bc46c0668e 100644 --- a/assets/voxygen/voxel/object_manifest.ron +++ b/assets/voxygen/voxel/object_manifest.ron @@ -919,4 +919,14 @@ central: ("armor.empty"), ) ), + AdletSpear: ( + bone0: ( + offset: (-12.5, -12.5, 0.0), + central: ("weapon.projectile.adlet-spear"), + ), + bone1: ( + offset: (0.0, 0.0, 0.0), + central: ("armor.empty"), + ) + ), }) diff --git a/assets/voxygen/voxel/weapon/projectile/adlet-spear.vox b/assets/voxygen/voxel/weapon/projectile/adlet-spear.vox new file mode 100644 index 0000000000..fdd2d0bd3e --- /dev/null +++ b/assets/voxygen/voxel/weapon/projectile/adlet-spear.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c691f98dee4882cbca0e81ca89998259369f55c49b03b6f43d5b546d69b93bc8 +size 1288 diff --git a/common/src/comp/body/object.rs b/common/src/comp/body/object.rs index f0983ee475..1e410b2c26 100644 --- a/common/src/comp/body/object.rs +++ b/common/src/comp/body/object.rs @@ -104,6 +104,7 @@ make_case_elim!( SpectralSwordSmall = 89, SpectralSwordLarge = 90, LaserBeam = 91, + AdletSpear = 92, } ); @@ -114,7 +115,7 @@ impl Body { } } -pub const ALL_OBJECTS: [Body; 92] = [ +pub const ALL_OBJECTS: [Body; 93] = [ Body::Arrow, Body::Bomb, Body::Scarecrow, @@ -207,6 +208,7 @@ pub const ALL_OBJECTS: [Body; 92] = [ Body::BarrelOrgan, Body::IceBomb, Body::LaserBeam, + Body::AdletSpear, ]; impl From for super::Body { @@ -308,6 +310,7 @@ impl Body { Body::SpectralSwordSmall => "spectral_sword_small", Body::SpectralSwordLarge => "spectral_sword_large", Body::LaserBeam => "laser_beam", + Body::AdletSpear => "adlet_spear", } } @@ -332,7 +335,8 @@ impl Body { | Body::Dart | Body::DagonBomb | Body::SpectralSwordSmall - | Body::SpectralSwordLarge => 500.0, + | Body::SpectralSwordLarge + | Body::AdletSpear => 500.0, Body::Bomb => 2000.0, // I have no idea what it's supposed to be Body::Crate => 300.0, // let's say it's a lot of wood and maybe some contents Body::Scarecrow => 900.0, @@ -427,6 +431,7 @@ impl Body { Body::GnarlingTotemRed | Body::GnarlingTotemGreen | Body::GnarlingTotemWhite => 100.0, Body::IceBomb => 12298.0, // 2.5 m diamter but ice Body::LaserBeam => 80000.0, + Body::AdletSpear => 1.5, }; Mass(m) @@ -434,9 +439,12 @@ impl Body { pub fn dimensions(&self) -> Vec3 { match self { - Body::Arrow | Body::ArrowSnake | Body::MultiArrow | Body::ArrowTurret | Body::Dart => { - Vec3::new(0.01, 0.8, 0.01) - }, + Body::Arrow + | Body::ArrowSnake + | Body::MultiArrow + | Body::ArrowTurret + | Body::Dart + | Body::AdletSpear => Vec3::new(0.01, 0.8, 0.01), Body::BoltFire => Vec3::new(0.1, 0.1, 0.1), Body::SpectralSwordSmall => Vec3::new(0.2, 0.9, 0.1), Body::SpectralSwordLarge => Vec3::new(0.2, 1.5, 0.1), diff --git a/common/src/comp/projectile.rs b/common/src/comp/projectile.rs index 5dd38e7160..0ef3cc60a9 100644 --- a/common/src/comp/projectile.rs +++ b/common/src/comp/projectile.rs @@ -125,6 +125,9 @@ pub enum ProjectileConstructor { knockback: f32, min_falloff: f32, }, + Trap { + damage: f32, + }, } impl ProjectileConstructor { @@ -790,6 +793,29 @@ impl ProjectileConstructor { is_point: true, } }, + Trap { damage } => { + let damage = AttackDamage::new( + Damage { + source: DamageSource::Explosion, + kind: DamageKind::Piercing, + value: damage, + }, + Some(GroupTarget::OutOfGroup), + instance, + ); + let attack = Attack::default() + .with_damage(damage) + .with_crit(crit_chance, crit_mult); + Projectile { + hit_solid: vec![], + hit_entity: vec![Effect::Attack(attack), Effect::Vanish], + time_left: Duration::from_secs(300), + owner, + ignore_group: true, + is_sticky: true, + is_point: false, + } + }, } } @@ -913,6 +939,9 @@ impl ProjectileConstructor { *damage *= power; *radius *= range; }, + Trap { ref mut damage } => { + *damage *= power; + }, } self } @@ -935,6 +964,7 @@ impl ProjectileConstructor { WindBomb { .. } => true, IceBomb { .. } => true, LaserBeam { .. } => true, + Trap { .. } => false, } } } diff --git a/common/systems/src/buff.rs b/common/systems/src/buff.rs index 8afcb48c23..07463dbdd2 100644 --- a/common/systems/src/buff.rs +++ b/common/systems/src/buff.rs @@ -212,6 +212,9 @@ impl<'a> System<'a> for Sys { BuffData::new(20.0, None, None), Vec::new(), BuffSource::World, + *read_data.time, + Some(&stat), + Some(health), )), }); } diff --git a/rtsim/src/gen/site.rs b/rtsim/src/gen/site.rs index f398a26aef..a32b4bf088 100644 --- a/rtsim/src/gen/site.rs +++ b/rtsim/src/gen/site.rs @@ -27,7 +27,10 @@ impl Site { | SiteKind::DesertCity(_) | SiteKind::SavannahPit(_) => Some(true), // Evil - SiteKind::Dungeon(_) | SiteKind::ChapelSite(_) | SiteKind::Gnarling(_) => Some(false), + SiteKind::Dungeon(_) + | SiteKind::ChapelSite(_) + | SiteKind::Gnarling(_) + | SiteKind::Adlet(_) => Some(false), // Neutral SiteKind::Settlement(_) | SiteKind::Castle(_) diff --git a/rtsim/src/rule/npc_ai.rs b/rtsim/src/rule/npc_ai.rs index d3b6bac726..fd747beaf6 100644 --- a/rtsim/src/rule/npc_ai.rs +++ b/rtsim/src/rule/npc_ai.rs @@ -73,7 +73,8 @@ fn path_in_site(start: Vec2, end: Vec2, site: &site2::Site) -> PathRes | TileKind::Tower(_) | TileKind::Keep(_) | TileKind::Gate - | TileKind::GnarlingFortification => 5.0, + | TileKind::GnarlingFortification + | TileKind::AdletStronghold => 5.0, }; let is_door_tile = |plot: Id, tile: Vec2| match site.plot(plot).kind() { site2::PlotKind::House(house) => house.door_tile == tile, diff --git a/world/src/site/mod.rs b/world/src/site/mod.rs index 8dec1e98c1..644c126a50 100644 --- a/world/src/site/mod.rs +++ b/world/src/site/mod.rs @@ -336,6 +336,7 @@ impl Site { SiteKind::GiantTree(site2) => Some(site2), SiteKind::Gnarling(site2) => Some(site2), SiteKind::Bridge(site2) => Some(site2), + SiteKind::Adlet(site2) => Some(site2), } } }