From 879aafad5cc63ab951ac2d0188a8d056dbeac9aa Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 9 Jun 2021 21:04:19 -0500 Subject: [PATCH] 3 attacks done --- .../common/abilities/ability_set_manifest.ron | 8 ++ .../custom/birdlargebreathe/flamethrower.ron | 7 +- .../custom/birdlargefire/flamethrower.ron | 7 +- .../custom/harvester/ensnaringvines.ron | 15 ++++ .../custom/harvester/explodingpumpkin.ron | 15 ++++ .../abilities/custom/harvester/firebreath.ron | 19 +++++ .../abilities/custom/harvester/scythe.ron | 13 ++++ .../custom/quadlowbreathe/flamethrower.ron | 7 +- .../abilities/staffsimple/flamethrower.ron | 7 +- .../npc_weapons/hammer/harvester_scythe.ron | 6 +- common/src/comp/projectile.rs | 73 ++++++++++++++++++- 11 files changed, 167 insertions(+), 10 deletions(-) create mode 100644 assets/common/abilities/custom/harvester/ensnaringvines.ron create mode 100644 assets/common/abilities/custom/harvester/explodingpumpkin.ron create mode 100644 assets/common/abilities/custom/harvester/firebreath.ron create mode 100644 assets/common/abilities/custom/harvester/scythe.ron diff --git a/assets/common/abilities/ability_set_manifest.ron b/assets/common/abilities/ability_set_manifest.ron index 12eb751aad..cdbfd1ac58 100644 --- a/assets/common/abilities/ability_set_manifest.ron +++ b/assets/common/abilities/ability_set_manifest.ron @@ -257,6 +257,14 @@ (None, "common.abilities.custom.yeti.snowball"), ], ), + Custom("Harvester"): ( + primary: "common.abilities.custom.harvester.scythe", + secondary: "common.abilities.custom.harvester.firebreath", + abilities: [ + (None, "common.abilities.custom.harvester.ensnaringvines"), + (None, "common.abilities.custom.harvester.explodingpumpkin"), + ], + ), Custom("Bird Large Breathe"): ( primary: "common.abilities.custom.birdlargebreathe.firebomb", secondary: "common.abilities.custom.birdlargebreathe.triplestrike", diff --git a/assets/common/abilities/custom/birdlargebreathe/flamethrower.ron b/assets/common/abilities/custom/birdlargebreathe/flamethrower.ron index 1cb6d4fdf8..705bfc0247 100644 --- a/assets/common/abilities/custom/birdlargebreathe/flamethrower.ron +++ b/assets/common/abilities/custom/birdlargebreathe/flamethrower.ron @@ -6,7 +6,12 @@ BasicBeam( tick_rate: 3.0, range: 15.0, max_angle: 22.5, - damage_effect: None, + damage_effect: Some(Buff(( + kind: Burning, + dur_secs: 10.0, + strength: DamageFraction(0.5), + chance: 0.25, + ))), energy_regen: 0, energy_drain: 0, orientation_behavior: Normal, diff --git a/assets/common/abilities/custom/birdlargefire/flamethrower.ron b/assets/common/abilities/custom/birdlargefire/flamethrower.ron index 1cb6d4fdf8..705bfc0247 100644 --- a/assets/common/abilities/custom/birdlargefire/flamethrower.ron +++ b/assets/common/abilities/custom/birdlargefire/flamethrower.ron @@ -6,7 +6,12 @@ BasicBeam( tick_rate: 3.0, range: 15.0, max_angle: 22.5, - damage_effect: None, + damage_effect: Some(Buff(( + kind: Burning, + dur_secs: 10.0, + strength: DamageFraction(0.5), + chance: 0.25, + ))), energy_regen: 0, energy_drain: 0, orientation_behavior: Normal, diff --git a/assets/common/abilities/custom/harvester/ensnaringvines.ron b/assets/common/abilities/custom/harvester/ensnaringvines.ron new file mode 100644 index 0000000000..88b2b2d48a --- /dev/null +++ b/assets/common/abilities/custom/harvester/ensnaringvines.ron @@ -0,0 +1,15 @@ +BasicRanged( + energy_cost: 0, + buildup_duration: 0.5, + recover_duration: 0.8, + projectile: ExplodingPumpkin( + damage: 500.0, + knockback: 25.0, + radius: 10.0, + ), + projectile_body: Object(Pumpkin), + projectile_light: None, + projectile_speed: 30.0, + num_projectiles: 1, + projectile_spread: 0.0, +) diff --git a/assets/common/abilities/custom/harvester/explodingpumpkin.ron b/assets/common/abilities/custom/harvester/explodingpumpkin.ron new file mode 100644 index 0000000000..88b2b2d48a --- /dev/null +++ b/assets/common/abilities/custom/harvester/explodingpumpkin.ron @@ -0,0 +1,15 @@ +BasicRanged( + energy_cost: 0, + buildup_duration: 0.5, + recover_duration: 0.8, + projectile: ExplodingPumpkin( + damage: 500.0, + knockback: 25.0, + radius: 10.0, + ), + projectile_body: Object(Pumpkin), + projectile_light: None, + projectile_speed: 30.0, + num_projectiles: 1, + projectile_spread: 0.0, +) diff --git a/assets/common/abilities/custom/harvester/firebreath.ron b/assets/common/abilities/custom/harvester/firebreath.ron new file mode 100644 index 0000000000..e7a23ad6de --- /dev/null +++ b/assets/common/abilities/custom/harvester/firebreath.ron @@ -0,0 +1,19 @@ +BasicBeam( + buildup_duration: 0.5, + recover_duration: 0.5, + beam_duration: 1.0, + damage: 35, + tick_rate: 3.0, + range: 20.0, + max_angle: 15.0, + damage_effect: Some(Buff(( + kind: Burning, + dur_secs: 10.0, + strength: DamageFraction(0.5), + chance: 0.25, + ))), + energy_regen: 0, + energy_drain: 0, + orientation_behavior: Normal, + specifier: Flamethrower, +) diff --git a/assets/common/abilities/custom/harvester/scythe.ron b/assets/common/abilities/custom/harvester/scythe.ron new file mode 100644 index 0000000000..ac8f1cef3e --- /dev/null +++ b/assets/common/abilities/custom/harvester/scythe.ron @@ -0,0 +1,13 @@ +BasicMelee( + energy_cost: 0, + buildup_duration: 0.6, + swing_duration: 0.1, + recover_duration: 0.5, + base_damage: 60, + base_poise_damage: 10, + knockback: ( strength: 10.0, direction: Away), + range: 4.0, + max_angle: 60.0, + damage_effect: None, + damage_kind: Slashing, +) diff --git a/assets/common/abilities/custom/quadlowbreathe/flamethrower.ron b/assets/common/abilities/custom/quadlowbreathe/flamethrower.ron index 5eba0f6226..7b376b28b5 100644 --- a/assets/common/abilities/custom/quadlowbreathe/flamethrower.ron +++ b/assets/common/abilities/custom/quadlowbreathe/flamethrower.ron @@ -6,7 +6,12 @@ BasicBeam( tick_rate: 3.0, range: 15.0, max_angle: 22.5, - damage_effect: None, + damage_effect: Some(Buff(( + kind: Burning, + dur_secs: 10.0, + strength: DamageFraction(0.5), + chance: 0.25, + ))), energy_regen: 0, energy_drain: 0, orientation_behavior: Normal, diff --git a/assets/common/abilities/staffsimple/flamethrower.ron b/assets/common/abilities/staffsimple/flamethrower.ron index 14eead7fa6..82cedf954f 100644 --- a/assets/common/abilities/staffsimple/flamethrower.ron +++ b/assets/common/abilities/staffsimple/flamethrower.ron @@ -6,7 +6,12 @@ BasicBeam( tick_rate: 3.0, range: 20.0, max_angle: 15.0, - damage_effect: None, + damage_effect: Some(Buff(( + kind: Burning, + dur_secs: 10.0, + strength: DamageFraction(0.5), + chance: 0.25, + ))), energy_regen: 0, energy_drain: 350, orientation_behavior: Normal, diff --git a/assets/common/items/npc_weapons/hammer/harvester_scythe.ron b/assets/common/items/npc_weapons/hammer/harvester_scythe.ron index 7156218a30..8ac2bd7abe 100644 --- a/assets/common/items/npc_weapons/hammer/harvester_scythe.ron +++ b/assets/common/items/npc_weapons/hammer/harvester_scythe.ron @@ -2,11 +2,11 @@ ItemDef( name: "Harvester Sythe", description: "Placeholder", kind: Tool(( - kind: Hammer, + kind: Natural, hands: Two, stats: Direct(( equip_time_secs: 0.001, - power: 1.6, + power: 1.0, poise_strength: 1.0, speed: 1.0, crit_chance: 0.05078125, @@ -14,5 +14,5 @@ ItemDef( )), quality: Low, tags: [], - ability_spec: Some(Custom("Hammer Simple")), + ability_spec: Some(Custom("Harvester")), ) \ No newline at end of file diff --git a/common/src/comp/projectile.rs b/common/src/comp/projectile.rs index a3e716e1be..68ccee18a6 100644 --- a/common/src/comp/projectile.rs +++ b/common/src/comp/projectile.rs @@ -1,9 +1,9 @@ use crate::{ combat::{ - Attack, AttackDamage, AttackEffect, CombatBuff, CombatEffect, CombatRequirement, Damage, - DamageKind, DamageSource, GroupTarget, Knockback, KnockbackDir, + Attack, AttackDamage, AttackEffect, CombatBuff, CombatBuffStrength, CombatEffect, + CombatRequirement, Damage, DamageKind, DamageSource, GroupTarget, Knockback, KnockbackDir, }, - comp::item::Reagent, + comp::{buff::BuffKind, item::Reagent}, uid::Uid, Explosion, RadiusEffect, }; @@ -72,6 +72,11 @@ pub enum ProjectileConstructor { damage: f32, radius: f32, }, + ExplodingPumpkin { + damage: f32, + radius: f32, + knockback: f32, + }, } impl ProjectileConstructor { @@ -298,6 +303,60 @@ impl ProjectileConstructor { is_point: false, } }, + ExplodingPumpkin { + damage, + radius, + knockback, + } => { + let knockback = AttackEffect::new( + Some(GroupTarget::OutOfGroup), + CombatEffect::Knockback(Knockback { + strength: knockback, + direction: KnockbackDir::Away, + }), + ) + .with_requirement(CombatRequirement::AnyDamage); + let buff = AttackEffect::new( + Some(GroupTarget::OutOfGroup), + CombatEffect::Buff(CombatBuff { + kind: BuffKind::Burning, + dur_secs: 5.0, + strength: CombatBuffStrength::DamageFraction(0.2), + chance: 1.0, + }), + ) + .with_requirement(CombatRequirement::AnyDamage); + let damage = AttackDamage::new( + Damage { + source: DamageSource::Explosion, + kind: DamageKind::Energy, + value: damage, + }, + Some(GroupTarget::OutOfGroup), + ); + let attack = Attack::default() + .with_damage(damage) + .with_crit(crit_chance, crit_mult) + .with_effect(knockback) + .with_effect(buff); + let explosion = Explosion { + effects: vec![ + RadiusEffect::Attack(attack), + RadiusEffect::TerrainDestruction(5.0), + ], + radius, + reagent: Some(Reagent::Red), + }; + Projectile { + hit_solid: vec![Effect::Explode(explosion.clone()), Effect::Vanish], + hit_entity: vec![Effect::Explode(explosion), Effect::Vanish], + time_left: Duration::from_secs(10), + owner, + ignore_group: true, + is_sticky: true, + is_point: true, + } + }, } } @@ -354,6 +413,14 @@ impl ProjectileConstructor { *damage *= power; *radius *= range; }, + ExplodingPumpkin { + ref mut damage, + ref mut radius, + .. + } => { + *damage *= power; + *radius *= range; + }, } self }