diff --git a/assets/common/abilities/adlet/elder/trap.ron b/assets/common/abilities/adlet/elder/trap.ron index 333c7c6aa5..fe54d51e7d 100644 --- a/assets/common/abilities/adlet/elder/trap.ron +++ b/assets/common/abilities/adlet/elder/trap.ron @@ -2,10 +2,15 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.75, recover_duration: 0.75, - projectile: Trap( - damage: 25, - knockback: 4, - energy_regen: 0, + projectile: ( + kind: Hazard( + is_sticky: true, + duration: 10, + ), + attack: Some(( + damage: 25, + energy: 0, + )), ), projectile_body: Object(AdletTrap), projectile_light: None, diff --git a/assets/common/abilities/adlet/hunter/throw.ron b/assets/common/abilities/adlet/hunter/throw.ron index a157aa68c1..87fb6b8b8b 100644 --- a/assets/common/abilities/adlet/hunter/throw.ron +++ b/assets/common/abilities/adlet/hunter/throw.ron @@ -2,10 +2,19 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.8, recover_duration: 0.8, - projectile: Arrow( - damage: 16, - knockback: 1, - energy_regen: 0, + projectile: ( + kind: Pointed, + attack: Some(( + damage: 16, + knockback: Some(1), + energy: 0, + buff: Some(( + kind: Bleeding, + dur_secs: 10, + strength: DamageFraction(0.1), + chance: 0.1, + )), + )), ), projectile_body: Object(AdletSpear), projectile_light: None, diff --git a/assets/common/abilities/adlet/tracker/arrow.ron b/assets/common/abilities/adlet/tracker/arrow.ron index 9b42a8b8ed..0fc72fc17e 100644 --- a/assets/common/abilities/adlet/tracker/arrow.ron +++ b/assets/common/abilities/adlet/tracker/arrow.ron @@ -2,10 +2,18 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.6, recover_duration: 0.4, - projectile: Arrow( - damage: 12, - knockback: 0, - energy_regen: 0, + projectile: ( + kind: Pointed, + attack: Some(( + damage: 12, + energy: 0, + buff: Some(( + kind: Bleeding, + dur_secs: 10, + strength: DamageFraction(0.1), + chance: 0.1, + )), + )), ), projectile_body: Object(Arrow), projectile_light: None, diff --git a/assets/common/abilities/adlet/tracker/trap.ron b/assets/common/abilities/adlet/tracker/trap.ron index cc90b8b842..a9516cc1df 100644 --- a/assets/common/abilities/adlet/tracker/trap.ron +++ b/assets/common/abilities/adlet/tracker/trap.ron @@ -2,10 +2,15 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.75, recover_duration: 0.75, - projectile: Trap( - damage: 12, - knockback: 0, - energy_regen: 0, + projectile: ( + kind: Hazard( + is_sticky: true, + duration: 10, + ), + attack: Some(( + damage: 12, + energy: 0, + )), ), projectile_body: Object(AdletTrap), projectile_light: None, diff --git a/assets/common/abilities/bow/charged.ron b/assets/common/abilities/bow/charged.ron index 8b0697cdfa..bf82e43062 100644 --- a/assets/common/abilities/bow/charged.ron +++ b/assets/common/abilities/bow/charged.ron @@ -1,12 +1,24 @@ ChargedRanged( energy_cost: 0, energy_drain: 0, - initial_regen: 2, - scaled_regen: 14, - initial_damage: 2, - scaled_damage: 12, - initial_knockback: 0, - scaled_knockback: 12, + projectile: ( + kind: Pointed, + attack: Some(( + damage: 2, + energy: 2, + buff: Some(( + kind: Bleeding, + dur_secs: 10, + strength: DamageFraction(0.1), + chance: 0.1, + )), + )), + scaled: Some(( + damage: 12, + knockback: Some(12), + energy: 14, + )), + ), buildup_duration: 0.25, charge_duration: 1.0, recover_duration: 0.4, diff --git a/assets/common/abilities/bow/repeater.ron b/assets/common/abilities/bow/repeater.ron index bca5717269..c46b12923e 100644 --- a/assets/common/abilities/bow/repeater.ron +++ b/assets/common/abilities/bow/repeater.ron @@ -5,10 +5,18 @@ RepeaterRanged( recover_duration: 0.5, max_speed: 4.0, half_speed_at: 3, - projectile: Arrow( - damage: 5.0, - knockback: 0, - energy_regen: 0, + projectile: ( + kind: Pointed, + attack: Some(( + damage: 5, + energy: 0, + buff: Some(( + kind: Bleeding, + dur_secs: 10, + strength: DamageFraction(0.1), + chance: 0.1, + )), + )), ), projectile_body: Object(Arrow), projectile_light: None, diff --git a/assets/common/abilities/bow/shotgun.ron b/assets/common/abilities/bow/shotgun.ron index 66d1115115..6268be77c7 100644 --- a/assets/common/abilities/bow/shotgun.ron +++ b/assets/common/abilities/bow/shotgun.ron @@ -3,10 +3,19 @@ BasicRanged( buildup_duration: 0.3, recover_duration: 0.3, projectile_spread: 0.05, - projectile: Arrow( - damage: 6, - knockback: 5, - energy_regen: 0, + projectile: ( + kind: Pointed, + attack: Some(( + damage: 6, + knockback: Some(5), + energy: 0, + buff: Some(( + kind: Bleeding, + dur_secs: 10, + strength: DamageFraction(0.1), + chance: 0.1, + )), + )), ), projectile_body: Object(Arrow), projectile_light: None, diff --git a/assets/common/abilities/bowsimple/basic.ron b/assets/common/abilities/bowsimple/basic.ron index b820fa9ceb..d682354831 100644 --- a/assets/common/abilities/bowsimple/basic.ron +++ b/assets/common/abilities/bowsimple/basic.ron @@ -2,10 +2,19 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.5, recover_duration: 0.3, - projectile: Arrow( - damage: 3.5, - knockback: 5.0, - energy_regen: 4.0, + projectile: ( + kind: Pointed, + attack: Some(( + damage: 3.5, + knockback: Some(5), + energy: 4, + buff: Some(( + kind: Bleeding, + dur_secs: 10, + strength: DamageFraction(0.1), + chance: 0.1, + )), + )), ), projectile_body: Object(Arrow), projectile_light: None, diff --git a/assets/common/abilities/custom/ancienteffigy/blast.ron b/assets/common/abilities/custom/ancienteffigy/blast.ron index 349e3180bc..3c213aad21 100644 --- a/assets/common/abilities/custom/ancienteffigy/blast.ron +++ b/assets/common/abilities/custom/ancienteffigy/blast.ron @@ -2,11 +2,18 @@ BasicRanged( energy_cost: 0, buildup_duration: 2.5, recover_duration: 1.0, - projectile: ClayRocket( - damage: 75.0, - knockback: 35.0, - radius: 10.0, - min_falloff: 0.75, + projectile: ( + kind: Explosive( + radius: 10, + min_falloff: 0.75, + reagent: Some(Red), + terrain: Some((5, Black)), + ), + attack: Some(( + damage: 75, + knockback: Some(35), + energy: 0, + )), ), projectile_body: Object(FireRainDrop), projectile_speed: 0.0, diff --git a/assets/common/abilities/custom/arthropods/blackwidow/poisonball.ron b/assets/common/abilities/custom/arthropods/blackwidow/poisonball.ron index b4fd4a68c1..998bcfebe1 100644 --- a/assets/common/abilities/custom/arthropods/blackwidow/poisonball.ron +++ b/assets/common/abilities/custom/arthropods/blackwidow/poisonball.ron @@ -2,18 +2,26 @@ BasicRanged( energy_cost: 0, buildup_duration: 1.2, recover_duration: 0.7, - projectile: Poisonball( - damage: 58.0, - radius: 3.5, - knockback: 1.0, - energy_regen: 0, - min_falloff: 0.2, + projectile: ( + kind: Explosive( + radius: 3.5, + min_falloff: 0.2, + reagent: Some(Purple), + terrain: Some((5, Black)), + ), + attack: Some(( + damage: 58, + knockback: Some(1), + energy: 0, + buff: Some(( + kind: Poisoned, + dur_secs: 5, + strength: DamageFraction(0.8), + chance: 1.0, + )), + )), ), projectile_body: Object(SpitPoison), - /*projectile_light: Some(LightEmitter { - col: (1.0, 0.75, 0.11).into(), - ..Default::default() - }),*/ projectile_speed: 25.0, num_projectiles: 1, projectile_spread: 0.3, diff --git a/assets/common/abilities/custom/arthropods/weevil/threadshot.ron b/assets/common/abilities/custom/arthropods/weevil/threadshot.ron index ffdf5a682a..d618eee91d 100644 --- a/assets/common/abilities/custom/arthropods/weevil/threadshot.ron +++ b/assets/common/abilities/custom/arthropods/weevil/threadshot.ron @@ -2,9 +2,13 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.6, recover_duration: 0.9, - projectile: Pebble( - damage: 6, - knockback: 2, + projectile: ( + kind: Blunt, + attack: Some(( + damage: 6, + knockback: Some(2), + energy: 0, + )), ), projectile_body: Object(Pebble), projectile_light: None, diff --git a/assets/common/abilities/custom/asp/firebomb.ron b/assets/common/abilities/custom/asp/firebomb.ron index 452cf492e6..34bd1e95c2 100644 --- a/assets/common/abilities/custom/asp/firebomb.ron +++ b/assets/common/abilities/custom/asp/firebomb.ron @@ -2,17 +2,25 @@ BasicRanged( energy_cost: 0, buildup_duration: 1.6, recover_duration: 0.7, - projectile: Fireball( - damage: 26.0, - radius: 5.0, - energy_regen: 0, - min_falloff: 0.5, + projectile: ( + kind: Explosive( + radius: 5, + min_falloff: 0.5, + reagent: Some(Red), + terrain: Some((2, Black)) + ), + attack: Some(( + damage: 30, + energy: 0, + buff: Some(( + kind: Burning, + dur_secs: 5, + strength: DamageFraction(0.1), + chance: 0.1, + )), + )), ), projectile_body: Object(BoltFire), - /*projectile_light: Some(LightEmitter { - col: (1.0, 0.75, 0.11).into(), - ..Default::default() - }),*/ projectile_speed: 70.0, num_projectiles: 1, projectile_spread: 0.0, diff --git a/assets/common/abilities/custom/biped_large_cultist/bow/basic.ron b/assets/common/abilities/custom/biped_large_cultist/bow/basic.ron index 19b16b56e7..364d71068a 100644 --- a/assets/common/abilities/custom/biped_large_cultist/bow/basic.ron +++ b/assets/common/abilities/custom/biped_large_cultist/bow/basic.ron @@ -2,10 +2,19 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.9, recover_duration: 0.3, - projectile: Arrow( - damage: 12.0, - knockback: 5.0, - energy_regen: 4.0, + projectile: ( + kind: Pointed, + attack: Some(( + damage: 12, + energy: 4, + knockback: Some(5), + buff: Some(( + kind: Bleeding, + dur_secs: 10, + strength: DamageFraction(0.1), + chance: 0.1, + )), + )), ), projectile_body: Object(Arrow), projectile_light: None, diff --git a/assets/common/abilities/custom/biped_large_cultist/staff/firebomb.ron b/assets/common/abilities/custom/biped_large_cultist/staff/firebomb.ron index 3e42c85c8e..a90d92d903 100644 --- a/assets/common/abilities/custom/biped_large_cultist/staff/firebomb.ron +++ b/assets/common/abilities/custom/biped_large_cultist/staff/firebomb.ron @@ -2,17 +2,25 @@ BasicRanged( energy_cost: 0, buildup_duration: 1.0, recover_duration: 1.35, - projectile: Fireball( - damage: 15.0, - radius: 5.0, - energy_regen: 5.0, - min_falloff: 0.5, + projectile: ( + kind: Explosive( + radius: 5, + min_falloff: 0.5, + reagent: Some(Red), + terrain: Some((2, Black)) + ), + attack: Some(( + damage: 15, + energy: 5, + buff: Some(( + kind: Burning, + dur_secs: 5, + strength: DamageFraction(0.1), + chance: 0.1, + )), + )), ), projectile_body: Object(BoltFire), - /*projectile_light: Some(LightEmitter { - col: (1.0, 0.75, 0.11).into(), - ..Default::default() - }),*/ projectile_speed: 60.0, num_projectiles: 1, projectile_spread: 0.0, diff --git a/assets/common/abilities/custom/birdlargebreathe/firebomb.ron b/assets/common/abilities/custom/birdlargebreathe/firebomb.ron index cb309e83ec..cc123d1930 100644 --- a/assets/common/abilities/custom/birdlargebreathe/firebomb.ron +++ b/assets/common/abilities/custom/birdlargebreathe/firebomb.ron @@ -2,17 +2,25 @@ BasicRanged( energy_cost: 0, buildup_duration: 1.0, recover_duration: 0.7, - projectile: Fireball( - damage: 20.0, - radius: 5.0, - energy_regen: 5.0, - min_falloff: 0.5, + projectile: ( + kind: Explosive( + radius: 5, + min_falloff: 0.5, + reagent: Some(Red), + terrain: Some((2, Black)) + ), + attack: Some(( + damage: 20, + energy: 5, + buff: Some(( + kind: Burning, + dur_secs: 5, + strength: DamageFraction(0.1), + chance: 0.1, + )), + )), ), projectile_body: Object(BoltFire), - /*projectile_light: Some(LightEmitter { - col: (1.0, 0.75, 0.11).into(), - ..Default::default() - }),*/ projectile_speed: 60.0, num_projectiles: 1, projectile_spread: 0.0, diff --git a/assets/common/abilities/custom/birdlargefire/firerain.ron b/assets/common/abilities/custom/birdlargefire/firerain.ron index 081d5a79d5..688c84201d 100644 --- a/assets/common/abilities/custom/birdlargefire/firerain.ron +++ b/assets/common/abilities/custom/birdlargefire/firerain.ron @@ -5,12 +5,23 @@ RepeaterRanged( recover_duration: 0.5, max_speed: 8.0, half_speed_at: 5, - projectile: FireDroplet( - damage: 30.0, - radius: 12.0, - min_falloff: 0.5, - energy_regen: 0, - reagent: Some(Phoenix), + projectile: ( + kind: Explosive( + radius: 12, + min_falloff: 0.5, + reagent: Some(Phoenix), + terrain: Some((2, Black)) + ), + attack: Some(( + damage: 31, + energy: 20, + buff: Some(( + kind: Burning, + dur_secs: 4, + strength: DamageFraction(1.0), + chance: 1.0, + )), + )), ), projectile_body: Object(FireRainDrop), projectile_light: Some(LightEmitter( diff --git a/assets/common/abilities/custom/boreal_warrior/bow/charged.ron b/assets/common/abilities/custom/boreal_warrior/bow/charged.ron index ca41f8882e..e5e4f22ca7 100644 --- a/assets/common/abilities/custom/boreal_warrior/bow/charged.ron +++ b/assets/common/abilities/custom/boreal_warrior/bow/charged.ron @@ -1,12 +1,24 @@ ChargedRanged( energy_cost: 0, energy_drain: 0, - initial_regen: 2, - scaled_regen: 14, - initial_damage: 2, - scaled_damage: 12, - initial_knockback: 0, - scaled_knockback: 12, + projectile: ( + kind: Pointed, + attack: Some(( + damage: 2, + energy: 2, + buff: Some(( + kind: Bleeding, + dur_secs: 10, + strength: DamageFraction(0.1), + chance: 0.1, + )), + )), + scaled: Some(( + damage: 12, + knockback: Some(12), + energy: 14, + )), + ), buildup_duration: 0.25, charge_duration: 1.0, recover_duration: 0.4, diff --git a/assets/common/abilities/custom/boreal_warrior/bow/repeater.ron b/assets/common/abilities/custom/boreal_warrior/bow/repeater.ron index 093c131dc8..e812846f80 100644 --- a/assets/common/abilities/custom/boreal_warrior/bow/repeater.ron +++ b/assets/common/abilities/custom/boreal_warrior/bow/repeater.ron @@ -5,10 +5,18 @@ RepeaterRanged( recover_duration: 0.5, max_speed: 4.0, half_speed_at: 3, - projectile: Arrow( - damage: 5.0, - knockback: 0, - energy_regen: 0, + projectile: ( + kind: Pointed, + attack: Some(( + damage: 5, + energy: 0, + buff: Some(( + kind: Bleeding, + dur_secs: 10, + strength: DamageFraction(0.1), + chance: 0.1, + )), + )), ), projectile_body: Object(Arrow), projectile_light: None, diff --git a/assets/common/abilities/custom/boreal_warrior/bow/shotgun.ron b/assets/common/abilities/custom/boreal_warrior/bow/shotgun.ron index fe720e665e..988caefebc 100644 --- a/assets/common/abilities/custom/boreal_warrior/bow/shotgun.ron +++ b/assets/common/abilities/custom/boreal_warrior/bow/shotgun.ron @@ -3,10 +3,19 @@ BasicRanged( buildup_duration: 0.3, recover_duration: 0.3, projectile_spread: 0.05, - projectile: Arrow( - damage: 6, - knockback: 5, - energy_regen: 0, + projectile: ( + kind: Pointed, + attack: Some(( + damage: 6, + knockback: Some(5), + energy: 0, + buff: Some(( + kind: Bleeding, + dur_secs: 10, + strength: DamageFraction(0.1), + chance: 0.1, + )), + )), ), projectile_body: Object(Arrow), projectile_light: None, diff --git a/assets/common/abilities/custom/cloudwyvern/lightningbomb.ron b/assets/common/abilities/custom/cloudwyvern/lightningbomb.ron index b5b6f9db50..e2a9e233c6 100644 --- a/assets/common/abilities/custom/cloudwyvern/lightningbomb.ron +++ b/assets/common/abilities/custom/cloudwyvern/lightningbomb.ron @@ -2,12 +2,18 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.5, recover_duration: 1.5, - projectile: LaserBeam( - damage: 20.0, - radius: 5.0, - knockback: 5.0, - energy_regen: 20.0, - min_falloff: 0.1, + projectile: ( + kind: Explosive( + radius: 5, + min_falloff: 0.1, + reagent: Some(Yellow), + terrain: Some((10, Black)), + ), + attack: Some(( + damage: 20, + knockback: Some(5), + energy: 0, + )), ), projectile_body: Object(LightningBolt), projectile_light: None, diff --git a/assets/common/abilities/custom/cursekeeper/poisonbomb.ron b/assets/common/abilities/custom/cursekeeper/poisonbomb.ron index 80e4db0c28..a7b0b22428 100644 --- a/assets/common/abilities/custom/cursekeeper/poisonbomb.ron +++ b/assets/common/abilities/custom/cursekeeper/poisonbomb.ron @@ -2,12 +2,24 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.3, recover_duration: 0.3, - projectile: Poisonball( - damage: 32.0, - knockback: 10.0, - radius: 6.0, - energy_regen: 5.0, - min_falloff: 0.1, + projectile: ( + kind: Explosive( + radius: 6, + min_falloff: 0.1, + reagent: Some(Purple), + terrain: Some((5, Black)), + ), + attack: Some(( + damage: 32, + knockback: Some(10), + energy: 0, + buff: Some(( + kind: Poisoned, + dur_secs: 5, + strength: DamageFraction(0.8), + chance: 1.0, + )), + )), ), projectile_body: Object(SpitPoison), projectile_light: None, diff --git a/assets/common/abilities/custom/cyclops/optic_blast.ron b/assets/common/abilities/custom/cyclops/optic_blast.ron index e6ff41f675..2e89b6375d 100644 --- a/assets/common/abilities/custom/cyclops/optic_blast.ron +++ b/assets/common/abilities/custom/cyclops/optic_blast.ron @@ -2,12 +2,18 @@ BasicRanged( energy_cost: 0.0, buildup_duration: 1.6, recover_duration: 1.2, - projectile: LaserBeam( - damage: 48.0, - radius: 8.0, - knockback: 5.0, - energy_regen: 20.0, - min_falloff: 0.0, + projectile: ( + kind: Explosive( + radius: 8, + min_falloff: 0.0, + reagent: Some(Yellow), + terrain: Some((10, Black)), + ), + attack: Some(( + damage: 48, + knockback: Some(5), + energy: 0, + )), ), projectile_body: Object(LaserBeam), projectile_speed: 100.0, diff --git a/assets/common/abilities/custom/dagon/dagonbombs.ron b/assets/common/abilities/custom/dagon/dagonbombs.ron index a860ff6e4a..c3fa74b9ce 100644 --- a/assets/common/abilities/custom/dagon/dagonbombs.ron +++ b/assets/common/abilities/custom/dagon/dagonbombs.ron @@ -2,11 +2,24 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.5, recover_duration: 1.5, - projectile: DagonBomb( - damage: 32.0, - knockback: 15.0, - radius: 5.0, - min_falloff: 0.1, + projectile: ( + kind: Explosive( + radius: 5, + min_falloff: 0.1, + reagent: Some(Blue), + terrain: Some((25, Black)), + ), + attack: Some(( + damage: 32, + knockback: Some(15), + energy: 0, + buff: Some(( + kind: Burning, + dur_secs: 5, + strength: DamageFraction(0.2), + chance: 1.0, + )), + )), ), projectile_body: Object(DagonBomb), projectile_light: None, diff --git a/assets/common/abilities/custom/dullahan/fierce_darts.ron b/assets/common/abilities/custom/dullahan/fierce_darts.ron index d9b3b379ce..4d1a03dade 100644 --- a/assets/common/abilities/custom/dullahan/fierce_darts.ron +++ b/assets/common/abilities/custom/dullahan/fierce_darts.ron @@ -2,11 +2,19 @@ BasicRanged( energy_cost: 0.0, buildup_duration: 0.55, recover_duration: 0.45, - projectile: Knife( - damage: 31.0, - knockback: 5.0, - energy_regen: 20.0, - min_falloff: 0.0, + projectile: ( + kind: Pointed, + attack: Some(( + damage: 31, + knockback: Some(5), + energy: 20, + buff: Some(( + kind: Bleeding, + dur_secs: 10, + strength: DamageFraction(0.1), + chance: 0.1, + )), + )), ), projectile_body: Object(SpectralSwordLarge), projectile_speed: 120.0, diff --git a/assets/common/abilities/custom/dullahan/knife_rain.ron b/assets/common/abilities/custom/dullahan/knife_rain.ron index e1400df253..d1b9e7716a 100644 --- a/assets/common/abilities/custom/dullahan/knife_rain.ron +++ b/assets/common/abilities/custom/dullahan/knife_rain.ron @@ -2,12 +2,19 @@ BasicRanged( energy_cost: 0.0, buildup_duration: 1.1, recover_duration: 0.2, - projectile: Knife( - damage: 34.0, - radius: 3.8, - knockback: 5.0, - energy_regen: 20.0, - min_falloff: 0.3, + projectile: ( + kind: Pointed, + attack: Some(( + damage: 34, + knockback: Some(5), + energy: 20, + buff: Some(( + kind: Bleeding, + dur_secs: 10, + strength: DamageFraction(0.1), + chance: 0.1, + )), + )), ), projectile_body: Object(SpectralSwordSmall), projectile_speed: 20.0, diff --git a/assets/common/abilities/custom/dwarves/flamekeeper/mines.ron b/assets/common/abilities/custom/dwarves/flamekeeper/mines.ron index e09e86c937..defcc1da6e 100644 --- a/assets/common/abilities/custom/dwarves/flamekeeper/mines.ron +++ b/assets/common/abilities/custom/dwarves/flamekeeper/mines.ron @@ -2,10 +2,18 @@ BasicRanged( energy_cost: 0, buildup_duration: 1.75, recover_duration: 1.75, - projectile: Mine( - damage: 25.0, - radius: 2.0, - min_falloff: 0.3, + projectile: ( + kind: ExplosiveHazard( + radius: 2, + min_falloff: 0.3, + reagent: Some(Yellow), + is_sticky: false, + duration: 10, + ), + attack: Some(( + damage: 25, + energy: 0, + )), ), projectile_body: Object(Mine), projectile_light: None, diff --git a/assets/common/abilities/custom/dwarves/forgemaster/lava_mortar.ron b/assets/common/abilities/custom/dwarves/forgemaster/lava_mortar.ron index 2bef05d39f..9ab4ebd4be 100644 --- a/assets/common/abilities/custom/dwarves/forgemaster/lava_mortar.ron +++ b/assets/common/abilities/custom/dwarves/forgemaster/lava_mortar.ron @@ -2,11 +2,18 @@ BasicRanged( energy_cost: 0, buildup_duration: 1.5, recover_duration: 2.5, - projectile: ClayRocket( - damage: 25.0, - radius: 15.0, - knockback: 20.0, - min_falloff: 0.1, + projectile: ( + kind: Explosive( + radius: 15, + min_falloff: 0.1, + reagent: Some(Red), + terrain: Some((5, Black)), + ), + attack: Some(( + damage: 25, + knockback: Some(20), + energy: 0, + )), ), projectile_body: Object(Mine), projectile_speed: 50.0, diff --git a/assets/common/abilities/custom/dwarves/snaretongue/bombs.ron b/assets/common/abilities/custom/dwarves/snaretongue/bombs.ron index 8b1d416f13..e777acd4cd 100644 --- a/assets/common/abilities/custom/dwarves/snaretongue/bombs.ron +++ b/assets/common/abilities/custom/dwarves/snaretongue/bombs.ron @@ -2,11 +2,24 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.5, recover_duration: 1.5, - projectile: Poisonball( - damage: 25.0, - knockback: 15.0, - radius: 5.0, - min_falloff: 0.1, + projectile: ( + kind: Explosive( + radius: 5, + min_falloff: 0.1, + reagent: Some(Purple), + terrain: Some((5, Black)), + ), + attack: Some(( + damage: 25, + knockback: Some(15), + energy: 0, + buff: Some(( + kind: Poisoned, + dur_secs: 5, + strength: DamageFraction(0.8), + chance: 1.0, + )), + )), ), projectile_body: Object(BubbleBomb), projectile_light: None, diff --git a/assets/common/abilities/custom/flamewyvern/firebomb.ron b/assets/common/abilities/custom/flamewyvern/firebomb.ron index 3864707904..2120ee173c 100644 --- a/assets/common/abilities/custom/flamewyvern/firebomb.ron +++ b/assets/common/abilities/custom/flamewyvern/firebomb.ron @@ -2,11 +2,23 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.5, recover_duration: 1.5, - projectile: Fireball( - damage: 32.0, - radius: 5.0, - energy_regen: 5.0, - min_falloff: 0.1, + projectile: ( + kind: Explosive( + radius: 5, + min_falloff: 0.1, + reagent: Some(Red), + terrain: Some((2, Black)) + ), + attack: Some(( + damage: 32, + energy: 5, + buff: Some(( + kind: Burning, + dur_secs: 5, + strength: DamageFraction(0.1), + chance: 0.1, + )), + )), ), projectile_body: Object(BoltFire), projectile_light: None, diff --git a/assets/common/abilities/custom/frostwyvern/frostbomb.ron b/assets/common/abilities/custom/frostwyvern/frostbomb.ron index 87916a6fd1..f34077c832 100644 --- a/assets/common/abilities/custom/frostwyvern/frostbomb.ron +++ b/assets/common/abilities/custom/frostwyvern/frostbomb.ron @@ -2,11 +2,16 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.5, recover_duration: 1.5, - projectile: Frostball( - damage: 32.0, - radius: 5.0, - energy_regen: 5.0, - min_falloff: 0.1, + projectile: ( + kind: Explosive( + radius: 5, + min_falloff: 0.1, + reagent: Some(White), + ), + attack: Some(( + damage: 32, + energy: 0, + )), ), projectile_body: Object(SpearIcicle), projectile_light: None, diff --git a/assets/common/abilities/custom/gigas_frost/ice_volley.ron b/assets/common/abilities/custom/gigas_frost/ice_volley.ron index 24c0c41497..d6da1360cf 100644 --- a/assets/common/abilities/custom/gigas_frost/ice_volley.ron +++ b/assets/common/abilities/custom/gigas_frost/ice_volley.ron @@ -2,11 +2,25 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.5, recover_duration: 0.9, - projectile: IceBomb( - damage: 30.0, - radius: 3.0, - knockback: 12.0, - min_falloff: 0.1, + projectile: ( + kind: Explosive( + radius: 3, + min_falloff: 0.1, + reagent: Some(White), + terrain: Some((30, IceBomb)), + ), + attack: Some(( + damage: 30, + knockback: Some(12), + energy: 0, + buff: Some(( + kind: Frozen, + dur_secs: 5, + // TODO: Change from DamageFraction to Value (probably?) + strength: DamageFraction(0.05), + chance: 1.0, + )), + )), ), projectile_body: Object(IceBomb), projectile_speed: 40.0, diff --git a/assets/common/abilities/custom/gravewarden/rocket.ron b/assets/common/abilities/custom/gravewarden/rocket.ron index e5b840bc5a..197e4862ae 100644 --- a/assets/common/abilities/custom/gravewarden/rocket.ron +++ b/assets/common/abilities/custom/gravewarden/rocket.ron @@ -2,11 +2,18 @@ BasicRanged( energy_cost: 0, buildup_duration: 1.2, recover_duration: 1.0, - projectile: ClayRocket( - damage: 75.0, - knockback: 18.0, - radius: 5.0, - min_falloff: 0.75, + projectile: ( + kind: Explosive( + radius: 5, + min_falloff: 0.75, + reagent: Some(Red), + terrain: Some((5, Black)), + ), + attack: Some(( + damage: 75, + knockback: Some(18), + energy: 0, + )), ), projectile_body: Object(ClayRocket), projectile_light: None, diff --git a/assets/common/abilities/custom/harvester/explodingpumpkin.ron b/assets/common/abilities/custom/harvester/explodingpumpkin.ron index 3f8df89196..eb83e298d0 100644 --- a/assets/common/abilities/custom/harvester/explodingpumpkin.ron +++ b/assets/common/abilities/custom/harvester/explodingpumpkin.ron @@ -2,11 +2,24 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.75, recover_duration: 1.6, - projectile: ExplodingPumpkin( - damage: 37.5, - knockback: 25.0, - radius: 5.0, - min_falloff: 0.6, + projectile: ( + kind: Explosive( + radius: 5, + min_falloff: 0.6, + reagent: Some(Red), + terrain: Some((5, Black)), + ), + attack: Some(( + damage: 37.5, + knockback: Some(25), + energy: 0, + buff: Some(( + kind: Burning, + dur_secs: 5, + strength: DamageFraction(0.2), + chance: 1.0, + )), + )), ), projectile_body: Object(Pumpkin), projectile_light: None, diff --git a/assets/common/abilities/custom/icedrake/icebombs.ron b/assets/common/abilities/custom/icedrake/icebombs.ron index d217ba1ab2..995fd614f3 100644 --- a/assets/common/abilities/custom/icedrake/icebombs.ron +++ b/assets/common/abilities/custom/icedrake/icebombs.ron @@ -2,10 +2,16 @@ BasicRanged( energy_cost: 0, buildup_duration: 1.0, recover_duration: 0.6, - projectile: Frostball( - damage: 35.0, - radius: 4.0, - min_falloff: 0.1, + projectile: ( + kind: Explosive( + radius: 4, + min_falloff: 0.1, + reagent: Some(White), + ), + attack: Some(( + damage: 35, + energy: 0, + )), ), projectile_body: Object(IceBomb), projectile_speed: 25.0, diff --git a/assets/common/abilities/custom/irongolemfist/iron_pike_bomb.ron b/assets/common/abilities/custom/irongolemfist/iron_pike_bomb.ron index 3faba11de5..40d0be1391 100644 --- a/assets/common/abilities/custom/irongolemfist/iron_pike_bomb.ron +++ b/assets/common/abilities/custom/irongolemfist/iron_pike_bomb.ron @@ -2,10 +2,18 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.3, recover_duration: 0.5, - projectile: Mine( - damage: 25.0, - radius: 5.0, - min_falloff: 0.75, + projectile: ( + kind: ExplosiveHazard( + radius: 5, + min_falloff: 0.75, + reagent: Some(Yellow), + is_sticky: false, + duration: 10, + ), + attack: Some(( + damage: 25, + energy: 0, + )), ), projectile_body: Object(IronPikeBomb), projectile_light: None, diff --git a/assets/common/abilities/custom/irrwurz/magicball.ron b/assets/common/abilities/custom/irrwurz/magicball.ron index 3ec35b490e..c06152003c 100644 --- a/assets/common/abilities/custom/irrwurz/magicball.ron +++ b/assets/common/abilities/custom/irrwurz/magicball.ron @@ -2,11 +2,22 @@ BasicRanged( energy_cost: 0, buildup_duration: 1.5, recover_duration: 1.0, - projectile: Magicball( - damage: 22.0, - radius: 3.0, - energy_regen: 0, - min_falloff: 0.5, + projectile: ( + kind: Explosive( + radius: 3, + min_falloff: 0.5, + reagent: Some(Green), + ), + attack: Some(( + damage: 22, + energy: 0, + buff: Some(( + kind: Poisoned, + dur_secs: 5, + strength: DamageFraction(0.8), + chance: 1.0, + )), + )), ), projectile_body: Object(FireworkGreen), projectile_speed: 25.0, diff --git a/assets/common/abilities/custom/maneater/poisonball.ron b/assets/common/abilities/custom/maneater/poisonball.ron index e8f2b49247..30a8faba4b 100644 --- a/assets/common/abilities/custom/maneater/poisonball.ron +++ b/assets/common/abilities/custom/maneater/poisonball.ron @@ -2,17 +2,18 @@ BasicRanged( energy_cost: 0, buildup_duration: 1.6, recover_duration: 0.7, - projectile: NecroticSphere( - damage: 26.0, - radius: 3.0, - energy_regen: 0, - min_falloff: 0.5, + projectile: ( + kind: Explosive( + radius: 3, + min_falloff: 0.5, + reagent: Some(Purple), + ), + attack: Some(( + damage: 26, + energy: 0, + )), ), projectile_body: Object(FireworkPurple), - /*projectile_light: Some(LightEmitter { - col: (1.0, 0.75, 0.11).into(), - ..Default::default() - }),*/ projectile_speed: 70.0, num_projectiles: 3, projectile_spread: 0.2, diff --git a/assets/common/abilities/custom/mindflayer/necroticsphere.ron b/assets/common/abilities/custom/mindflayer/necroticsphere.ron index 351ffbc9a8..915a14d133 100644 --- a/assets/common/abilities/custom/mindflayer/necroticsphere.ron +++ b/assets/common/abilities/custom/mindflayer/necroticsphere.ron @@ -1,12 +1,17 @@ BasicRanged( energy_cost: 0, - buildup_duration: 1.00, - recover_duration: 0.70, - projectile: NecroticSphere( - damage: 50, - radius: 7.0, - min_falloff: 0.2, - energy_regen: 40, + buildup_duration: 1.0, + recover_duration: 0.7, + projectile: ( + kind: Explosive( + radius: 7, + min_falloff: 0.2, + reagent: Some(Purple), + ), + attack: Some(( + damage: 50, + energy: 40, + )), ), projectile_body: Object(FireworkPurple), projectile_speed: 100.0, diff --git a/assets/common/abilities/custom/quadlowranged/firebomb.ron b/assets/common/abilities/custom/quadlowranged/firebomb.ron index e04816c4a6..bf7aff6911 100644 --- a/assets/common/abilities/custom/quadlowranged/firebomb.ron +++ b/assets/common/abilities/custom/quadlowranged/firebomb.ron @@ -2,17 +2,18 @@ BasicRanged( energy_cost: 0, buildup_duration: 1.6, recover_duration: 0.7, - projectile: NecroticSphere( - damage: 26.0, - radius: 5.0, - energy_regen: 0, - min_falloff: 0.5, + projectile: ( + kind: Explosive( + radius: 5, + min_falloff: 0.5, + reagent: Some(Purple), + ), + attack: Some(( + damage: 26, + energy: 0, + )), ), projectile_body: Object(FireworkPurple), - /*projectile_light: Some(LightEmitter { - col: (1.0, 0.75, 0.11).into(), - ..Default::default() - }),*/ projectile_speed: 70.0, num_projectiles: 1, projectile_spread: 0.0, diff --git a/assets/common/abilities/custom/seawyvern/inkbomb.ron b/assets/common/abilities/custom/seawyvern/inkbomb.ron index a557d7d7ab..2bc3271f48 100644 --- a/assets/common/abilities/custom/seawyvern/inkbomb.ron +++ b/assets/common/abilities/custom/seawyvern/inkbomb.ron @@ -2,11 +2,23 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.5, recover_duration: 1.5, - projectile: InkBomb( - damage: 32.0, - radius: 5.0, - energy_regen: 5.0, - min_falloff: 0.1, + projectile: ( + kind: Explosive( + radius: 5, + min_falloff: 0.1, + reagent: Some(Blue), + terrain: Some((18, InkBomb)), + ), + attack: Some(( + damage: 32, + energy: 0, + buff: Some(( + kind: Wet, + dur_secs: 8, + strength: Value(0.5), + chance: 1.0, + )), + )), ), projectile_body: Object(SpitPoison), projectile_light: None, diff --git a/assets/common/abilities/custom/terracotta_besieger/multishot.ron b/assets/common/abilities/custom/terracotta_besieger/multishot.ron index 942cf8a248..65c5d12600 100644 --- a/assets/common/abilities/custom/terracotta_besieger/multishot.ron +++ b/assets/common/abilities/custom/terracotta_besieger/multishot.ron @@ -2,10 +2,19 @@ BasicRanged( energy_cost: 0, buildup_duration: 1.0, recover_duration: 2.5, - projectile: Arrow( - damage: 25.0, - knockback: 12.0, - energy_regen: 4.0, + projectile: ( + kind: Pointed, + attack: Some(( + damage: 25, + knockback: Some(12), + energy: 4, + buff: Some(( + kind: Bleeding, + dur_secs: 10, + strength: DamageFraction(0.1), + chance: 0.1, + )), + )), ), projectile_body: Object(BoltBesieger), projectile_light: None, diff --git a/assets/common/abilities/custom/terracotta_demolisher/drop.ron b/assets/common/abilities/custom/terracotta_demolisher/drop.ron index 649fa151ac..1199eee61e 100644 --- a/assets/common/abilities/custom/terracotta_demolisher/drop.ron +++ b/assets/common/abilities/custom/terracotta_demolisher/drop.ron @@ -2,12 +2,23 @@ BasicRanged( energy_cost: 0, buildup_duration: 1.0, recover_duration: 1.5, - projectile: DemolisherBomb( - damage: 30.0, - radius: 10.0, - min_falloff: 0.5, - energy_regen: 0, - reagent: Some(Yellow), + projectile: ( + kind: Explosive( + radius: 10, + min_falloff: 0.5, + reagent: Some(Yellow), + terrain: Some((2, Black)) + ), + attack: Some(( + damage: 30, + energy: 0, + buff: Some(( + kind: Burning, + dur_secs: 4, + strength: DamageFraction(1.0), + chance: 0.6, + )), + )), ), projectile_body: Object(TerracottaDemolisherBomb), projectile_light: None, diff --git a/assets/common/abilities/custom/terracotta_demolisher/throw.ron b/assets/common/abilities/custom/terracotta_demolisher/throw.ron index 29827b146f..a0d9f95bc3 100644 --- a/assets/common/abilities/custom/terracotta_demolisher/throw.ron +++ b/assets/common/abilities/custom/terracotta_demolisher/throw.ron @@ -2,12 +2,23 @@ BasicRanged( energy_cost: 0, buildup_duration: 1.0, recover_duration: 1.5, - projectile: DemolisherBomb( - damage: 30.0, - radius: 10.0, - min_falloff: 0.5, - energy_regen: 0, - reagent: Some(Yellow), + projectile: ( + kind: Explosive( + radius: 10, + min_falloff: 0.5, + reagent: Some(Yellow), + terrain: Some((2, Black)) + ), + attack: Some(( + damage: 30, + energy: 0, + buff: Some(( + kind: Burning, + dur_secs: 4, + strength: DamageFraction(1.0), + chance: 0.6, + )), + )), ), projectile_body: Object(TerracottaDemolisherBomb), projectile_light: None, diff --git a/assets/common/abilities/custom/terracotta_statue/blast.ron b/assets/common/abilities/custom/terracotta_statue/blast.ron index e0e9da10dd..8a3da7a42b 100644 --- a/assets/common/abilities/custom/terracotta_statue/blast.ron +++ b/assets/common/abilities/custom/terracotta_statue/blast.ron @@ -2,12 +2,18 @@ BasicRanged( energy_cost: 0.0, buildup_duration: 1.5, recover_duration: 1.5, - projectile: LaserBeam( - damage: 50.0, - radius: 20.0, - knockback: 50.0, - energy_regen: 0.0, - min_falloff: 0.0, + projectile: ( + kind: Explosive( + radius: 20, + min_falloff: 0.0, + reagent: Some(Yellow), + terrain: Some((10, Black)), + ), + attack: Some(( + damage: 50, + knockback: Some(50), + energy: 0, + )), ), projectile_body: Object(LaserBeamSmall), projectile_speed: 45.0, diff --git a/assets/common/abilities/custom/turret/arrows.ron b/assets/common/abilities/custom/turret/arrows.ron index 01be8cd988..d831925e82 100644 --- a/assets/common/abilities/custom/turret/arrows.ron +++ b/assets/common/abilities/custom/turret/arrows.ron @@ -2,10 +2,19 @@ BasicRanged( energy_cost: 0, buildup_duration: 1.2, recover_duration: 0.5, - projectile: Arrow( - damage: 30.0, - knockback: 5.0, - energy_regen: 10.0, + projectile: ( + kind: Pointed, + attack: Some(( + damage: 30, + knockback: Some(5), + energy: 10, + buff: Some(( + kind: Bleeding, + dur_secs: 10, + strength: DamageFraction(0.1), + chance: 0.1, + )), + )), ), projectile_body: Object(ArrowTurret), projectile_light: None, diff --git a/assets/common/abilities/custom/wealdwyvern/poisonbomb.ron b/assets/common/abilities/custom/wealdwyvern/poisonbomb.ron index e2f74ea2fd..8b3364ace3 100644 --- a/assets/common/abilities/custom/wealdwyvern/poisonbomb.ron +++ b/assets/common/abilities/custom/wealdwyvern/poisonbomb.ron @@ -2,12 +2,24 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.5, recover_duration: 1.5, - projectile: Poisonball( - damage: 32.0, - radius: 5.0, - knockback: 10.0, - energy_regen: 5.0, - min_falloff: 0.1, + projectile: ( + kind: Explosive( + radius: 5, + min_falloff: 0.1, + reagent: Some(Purple), + terrain: Some((5, Black)), + ), + attack: Some(( + damage: 32, + knockback: Some(10), + energy: 0, + buff: Some(( + kind: Poisoned, + dur_secs: 5, + strength: DamageFraction(0.8), + chance: 1.0, + )), + )), ), projectile_body: Object(SpitPoison), projectile_light: None, diff --git a/assets/common/abilities/custom/wendigomagic/frostbomb.ron b/assets/common/abilities/custom/wendigomagic/frostbomb.ron index 8d7494c572..daea7b0206 100644 --- a/assets/common/abilities/custom/wendigomagic/frostbomb.ron +++ b/assets/common/abilities/custom/wendigomagic/frostbomb.ron @@ -2,16 +2,18 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.5, recover_duration: 1.4, - projectile: Frostball( - damage: 24.0, - radius: 5.0, - min_falloff: 0.5, + projectile: ( + kind: Explosive( + radius: 5, + min_falloff: 0.5, + reagent: Some(White), + ), + attack: Some(( + damage: 24, + energy: 0, + )), ), projectile_body: Object(BoltIcicle), - /*projectile_light: Some(LightEmitter { - col: (1.0, 0.75, 0.11).into(), - ..Default::default() - }),*/ projectile_speed: 60.0, num_projectiles: 1, projectile_spread: 0.0, diff --git a/assets/common/abilities/custom/yeti/snowball.ron b/assets/common/abilities/custom/yeti/snowball.ron index a23735dba2..f1a0fcdc71 100644 --- a/assets/common/abilities/custom/yeti/snowball.ron +++ b/assets/common/abilities/custom/yeti/snowball.ron @@ -2,10 +2,18 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.75, recover_duration: 1.8, - projectile: Snowball( - damage: 35.0, - radius: 5.0, - min_falloff: 0.7, + projectile: ( + kind: ExplosiveHazard( + radius: 5, + min_falloff: 0.7, + reagent: Some(White), + is_sticky: false, + duration: 120, + ), + attack: Some(( + damage: 35, + energy: 0, + )), ), projectile_body: Object(Snowball), projectile_speed: 60.0, diff --git a/assets/common/abilities/debug/possess.ron b/assets/common/abilities/debug/possess.ron index 3d274e7938..d0b66c4dc5 100644 --- a/assets/common/abilities/debug/possess.ron +++ b/assets/common/abilities/debug/possess.ron @@ -2,12 +2,10 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.001, recover_duration: 0.01, - projectile: Possess, + projectile: ( + kind: Possess, + ), projectile_body: Object(ArrowSnake), - /*projectile_light: Some(LightEmitter { - col: (0.0, 1.0, 0.33).into(), - ..Default::default() - }),*/ projectile_speed: 100.0, num_projectiles: 1, projectile_spread: 0.0, diff --git a/assets/common/abilities/gnarling/blowgun/dart.ron b/assets/common/abilities/gnarling/blowgun/dart.ron index 448db67ec7..8074efab77 100644 --- a/assets/common/abilities/gnarling/blowgun/dart.ron +++ b/assets/common/abilities/gnarling/blowgun/dart.ron @@ -2,10 +2,18 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.75, recover_duration: 0.45, - projectile: Arrow( - damage: 4, - knockback: 0, - energy_regen: 0, + projectile: ( + kind: Pointed, + attack: Some(( + damage: 4, + energy: 0, + buff: Some(( + kind: Bleeding, + dur_secs: 10, + strength: DamageFraction(0.1), + chance: 0.1, + )), + )), ), projectile_body: Object(Dart), projectile_light: None, diff --git a/assets/common/abilities/gnarling/chieftain/firebarrage.ron b/assets/common/abilities/gnarling/chieftain/firebarrage.ron index aa86a12942..9aa511de43 100644 --- a/assets/common/abilities/gnarling/chieftain/firebarrage.ron +++ b/assets/common/abilities/gnarling/chieftain/firebarrage.ron @@ -2,11 +2,23 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.825, recover_duration: 0.6, - projectile: Fireball( - damage: 13.5, - radius: 2.0, - energy_regen: 10.0, - min_falloff: 0.5, + projectile: ( + kind: Explosive( + radius: 2, + min_falloff: 0.5, + reagent: Some(Red), + terrain: Some((2, Black)) + ), + attack: Some(( + damage: 13.5, + energy: 10, + buff: Some(( + kind: Burning, + dur_secs: 5, + strength: DamageFraction(0.1), + chance: 0.1, + )), + )), ), projectile_body: Object(BoltFire), projectile_speed: 25, diff --git a/assets/common/abilities/haniwa/archer/arrow.ron b/assets/common/abilities/haniwa/archer/arrow.ron index 1fdd599e23..14489b4cbd 100644 --- a/assets/common/abilities/haniwa/archer/arrow.ron +++ b/assets/common/abilities/haniwa/archer/arrow.ron @@ -2,10 +2,19 @@ BasicRanged( energy_cost: 0, buildup_duration: 1.3, recover_duration: 1.2, - projectile: Arrow( - damage: 25, - knockback: 8.0, - energy_regen: 0, + projectile: ( + kind: Pointed, + attack: Some(( + damage: 25, + knockback: Some(8), + energy: 0, + buff: Some(( + kind: Bleeding, + dur_secs: 10, + strength: DamageFraction(0.1), + chance: 0.1, + )), + )), ), projectile_body: Object(ArrowClay), projectile_light: None, diff --git a/assets/common/abilities/haniwa/archer/explosive.ron b/assets/common/abilities/haniwa/archer/explosive.ron index f65793f086..266ebf9aaf 100644 --- a/assets/common/abilities/haniwa/archer/explosive.ron +++ b/assets/common/abilities/haniwa/archer/explosive.ron @@ -2,11 +2,18 @@ BasicRanged( energy_cost: 0, buildup_duration: 2.4, recover_duration: 0.6, - projectile: ClayRocket( - damage: 30, - knockback: 10.0, - radius: 5.0, - min_falloff: 0.75, + projectile: ( + kind: Explosive( + radius: 5, + min_falloff: 0.75, + reagent: Some(Red), + terrain: Some((5, Black)), + ), + attack: Some(( + damage: 30, + knockback: Some(10), + energy: 0, + )), ), projectile_body: Object(GrenadeClay), projectile_light: None, diff --git a/assets/common/abilities/staff/firebomb.ron b/assets/common/abilities/staff/firebomb.ron index 7a8db685c7..b539f2af13 100644 --- a/assets/common/abilities/staff/firebomb.ron +++ b/assets/common/abilities/staff/firebomb.ron @@ -2,11 +2,23 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.35, recover_duration: 0.4, - projectile: Fireball( - damage: 12.0, - radius: 3.0, - energy_regen: 12.0, - min_falloff: 0.5, + projectile: ( + kind: Explosive( + radius: 3, + min_falloff: 0.5, + reagent: Some(Red), + terrain: Some((2, Black)) + ), + attack: Some(( + damage: 12, + energy: 12, + buff: Some(( + kind: Burning, + dur_secs: 5, + strength: DamageFraction(0.1), + chance: 0.1, + )), + )), ), projectile_body: Object(BoltFire), projectile_speed: 60.0, diff --git a/assets/common/abilities/staffsimple/firebomb.ron b/assets/common/abilities/staffsimple/firebomb.ron index 6b816dee4d..bd8df87763 100644 --- a/assets/common/abilities/staffsimple/firebomb.ron +++ b/assets/common/abilities/staffsimple/firebomb.ron @@ -2,17 +2,25 @@ BasicRanged( energy_cost: 0, buildup_duration: 0.5, recover_duration: 0.35, - projectile: Fireball( - damage: 6.0, - radius: 5.0, - energy_regen: 5.0, - min_falloff: 0.5, + projectile: ( + kind: Explosive( + radius: 5, + min_falloff: 0.5, + reagent: Some(Red), + terrain: Some((2, Black)) + ), + attack: Some(( + damage: 6, + energy: 5, + buff: Some(( + kind: Burning, + dur_secs: 5, + strength: DamageFraction(0.1), + chance: 0.1, + )), + )), ), projectile_body: Object(BoltFire), - /*projectile_light: Some(LightEmitter { - col: (1.0, 0.75, 0.11).into(), - ..Default::default() - }),*/ projectile_speed: 60.0, num_projectiles: 1, projectile_spread: 0.0, diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index 87a5680be3..39c2d33a05 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -904,12 +904,7 @@ pub enum CharacterAbility { ChargedRanged { energy_cost: f32, energy_drain: f32, - initial_regen: f32, - scaled_regen: f32, - initial_damage: f32, - scaled_damage: f32, - initial_knockback: f32, - scaled_knockback: f32, + projectile: ProjectileConstructor, buildup_duration: f32, charge_duration: f32, recover_duration: f32, @@ -1329,7 +1324,7 @@ impl CharacterAbility { } => { *buildup_duration /= stats.speed; *recover_duration /= stats.speed; - *projectile = projectile.modified_projectile(stats.power, 1_f32, 1_f32); + *projectile = projectile.adjusted_by_stats(stats); *projectile_speed *= stats.range; *energy_cost /= stats.energy_efficiency; }, @@ -1352,7 +1347,7 @@ impl CharacterAbility { *buildup_duration /= stats.speed; *shoot_duration /= stats.speed; *recover_duration /= stats.speed; - *projectile = projectile.modified_projectile(stats.power, 1_f32, 1_f32); + *projectile = projectile.adjusted_by_stats(stats); *projectile_speed *= stats.range; *energy_cost /= stats.energy_efficiency; }, @@ -1533,12 +1528,7 @@ impl CharacterAbility { ChargedRanged { ref mut energy_cost, ref mut energy_drain, - initial_regen: _, - scaled_regen: _, - ref mut initial_damage, - ref mut scaled_damage, - initial_knockback: _, - scaled_knockback: _, + ref mut projectile, ref mut buildup_duration, ref mut charge_duration, ref mut recover_duration, @@ -1550,8 +1540,7 @@ impl CharacterAbility { move_speed: _, meta: _, } => { - *initial_damage *= stats.power; - *scaled_damage *= stats.power; + *projectile = projectile.adjusted_by_stats(stats); *buildup_duration /= stats.speed; *charge_duration /= stats.speed; *recover_duration /= stats.speed; @@ -2009,12 +1998,7 @@ impl CharacterAbility { let projectile_speed_modifier = SKILL_MODIFIERS.bow_tree.universal.projectile_speed; match self { CharacterAbility::ChargedRanged { - ref mut initial_damage, - ref mut scaled_damage, - ref mut initial_regen, - ref mut scaled_regen, - ref mut initial_knockback, - ref mut scaled_knockback, + ref mut projectile, ref mut move_speed, ref mut initial_projectile_speed, ref mut scaled_projectile_speed, @@ -2028,19 +2012,16 @@ impl CharacterAbility { *scaled_projectile_speed *= projectile_speed_scaling; } if let Ok(level) = skillset.skill_level(Bow(CDamage)) { - let damage_scaling = modifiers.damage_scaling.powi(level.into()); - *initial_damage *= damage_scaling; - *scaled_damage *= damage_scaling; + let power = modifiers.damage_scaling.powi(level.into()); + *projectile = projectile.legacy_modified_by_skills(power, 1_f32, 1_f32, 1_f32); } if let Ok(level) = skillset.skill_level(Bow(CRegen)) { - let regen_scaling = modifiers.regen_scaling.powi(level.into()); - *initial_regen *= regen_scaling; - *scaled_regen *= regen_scaling; + let regen = modifiers.regen_scaling.powi(level.into()); + *projectile = projectile.legacy_modified_by_skills(1_f32, regen, 1_f32, 1_f32); } if let Ok(level) = skillset.skill_level(Bow(CKnockback)) { - let knockback_scaling = modifiers.knockback_scaling.powi(level.into()); - *initial_knockback *= knockback_scaling; - *scaled_knockback *= knockback_scaling; + let kb = modifiers.knockback_scaling.powi(level.into()); + *projectile = projectile.legacy_modified_by_skills(1_f32, 1_f32, 1_f32, kb); } if let Ok(level) = skillset.skill_level(Bow(CSpeed)) { let charge_time = 1.0 / modifiers.charge_rate; @@ -2063,7 +2044,7 @@ impl CharacterAbility { } if let Ok(level) = skillset.skill_level(Bow(RDamage)) { let power = modifiers.power.powi(level.into()); - *projectile = projectile.modified_projectile(power, 1_f32, 1_f32); + *projectile = projectile.legacy_modified_by_skills(power, 1_f32, 1_f32, 1_f32); } if let Ok(level) = skillset.skill_level(Bow(RCost)) { *energy_cost *= modifiers.energy_cost.powi(level.into()); @@ -2086,7 +2067,7 @@ impl CharacterAbility { } if let Ok(level) = skillset.skill_level(Bow(SDamage)) { let power = modifiers.power.powi(level.into()); - *projectile = projectile.modified_projectile(power, 1_f32, 1_f32); + *projectile = projectile.legacy_modified_by_skills(power, 1_f32, 1_f32, 1_f32); } if let Ok(level) = skillset.skill_level(Bow(SCost)) { *energy_cost *= modifiers.energy_cost.powi(level.into()); @@ -2117,7 +2098,7 @@ impl CharacterAbility { let power = modifiers.power.powi(damage_level.into()); let regen = modifiers.regen.powi(regen_level.into()); let range = modifiers.range.powi(range_level.into()); - *projectile = projectile.modified_projectile(power, regen, range); + *projectile = projectile.legacy_modified_by_skills(power, regen, range, 1_f32); }, CharacterAbility::BasicBeam { ref mut damage, @@ -2564,12 +2545,7 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState { CharacterAbility::ChargedRanged { energy_cost: _, energy_drain, - initial_regen, - scaled_regen, - initial_damage, - scaled_damage, - initial_knockback, - scaled_knockback, + projectile, buildup_duration, charge_duration, recover_duration, @@ -2586,12 +2562,7 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState { charge_duration: Duration::from_secs_f32(*charge_duration), recover_duration: Duration::from_secs_f32(*recover_duration), energy_drain: *energy_drain, - initial_regen: *initial_regen, - scaled_regen: *scaled_regen, - initial_damage: *initial_damage, - scaled_damage: *scaled_damage, - initial_knockback: *initial_knockback, - scaled_knockback: *scaled_knockback, + projectile: *projectile, projectile_body: *projectile_body, projectile_light: *projectile_light, initial_projectile_speed: *initial_projectile_speed, diff --git a/common/src/comp/projectile.rs b/common/src/comp/projectile.rs index 555c201319..4e3ec99adc 100644 --- a/common/src/comp/projectile.rs +++ b/common/src/comp/projectile.rs @@ -1,20 +1,17 @@ use crate::{ combat::{ - Attack, AttackDamage, AttackEffect, CombatBuff, CombatBuffStrength, CombatEffect, - CombatRequirement, Damage, DamageKind, DamageSource, GroupTarget, Knockback, KnockbackDir, - }, - comp::{ - buff::BuffKind, - item::{tool, Reagent}, + Attack, AttackDamage, AttackEffect, CombatBuff, CombatEffect, CombatRequirement, Damage, + DamageKind, DamageSource, GroupTarget, Knockback, KnockbackDir, }, + comp::item::{tool, Reagent}, + explosion::{ColorPreset, Explosion, RadiusEffect}, + resources::Secs, uid::Uid, - Explosion, RadiusEffect, }; -use rand::{thread_rng, Rng}; +use common_base::dev_panic; use serde::{Deserialize, Serialize}; use specs::Component; use std::time::Duration; -use vek::Rgb; #[derive(Clone, Debug, Serialize, Deserialize)] pub enum Effect { @@ -48,111 +45,50 @@ impl Component for Projectile { } #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)] -pub enum ProjectileConstructor { - Arrow { - damage: f32, - knockback: f32, - energy_regen: f32, - }, - Knife { - damage: f32, - knockback: f32, - energy_regen: f32, - }, - FireDroplet { - damage: f32, +pub struct ProjectileConstructor { + pub kind: ProjectileConstructorKind, + pub attack: Option, + pub scaled: Option, +} + +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)] +pub struct Scaled { + damage: f32, + knockback: Option, + energy: f32, +} + +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)] +pub struct ProjectileAttack { + pub damage: f32, + pub knockback: Option, + pub energy: f32, + pub buff: Option, +} + +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)] +pub enum ProjectileConstructorKind { + // I want a better name for 'Pointed' and 'Blunt' + Pointed, + Blunt, + Explosive { radius: f32, - energy_regen: f32, min_falloff: f32, reagent: Option, - }, - DemolisherBomb { - damage: f32, - radius: f32, - energy_regen: f32, - min_falloff: f32, - reagent: Option, - }, - Fireball { - damage: f32, - radius: f32, - energy_regen: f32, - min_falloff: f32, - }, - Frostball { - damage: f32, - radius: f32, - min_falloff: f32, - }, - Poisonball { - damage: f32, - radius: f32, - knockback: f32, - min_falloff: f32, - }, - NecroticSphere { - damage: f32, - radius: f32, - min_falloff: f32, - energy_regen: f32, - }, - Magicball { - damage: f32, - radius: f32, - min_falloff: f32, + terrain: Option<(f32, ColorPreset)>, }, Possess, - ClayRocket { - damage: f32, - radius: f32, - knockback: f32, - min_falloff: f32, + Hazard { + is_sticky: bool, + duration: Secs, }, - InkBomb { - damage: f32, + ExplosiveHazard { radius: f32, min_falloff: f32, - }, - Snowball { - damage: f32, - radius: f32, - min_falloff: f32, - }, - ExplodingPumpkin { - damage: f32, - radius: f32, - knockback: f32, - min_falloff: f32, - }, - DagonBomb { - damage: f32, - radius: f32, - knockback: f32, - min_falloff: f32, - }, - IceBomb { - damage: f32, - radius: f32, - knockback: f32, - min_falloff: f32, - }, - LaserBeam { - damage: f32, - radius: f32, - knockback: f32, - min_falloff: f32, - }, - Trap { - damage: f32, - }, - Mine { - damage: f32, - radius: f32, - min_falloff: f32, - }, - Pebble { - damage: f32, - knockback: f32, + reagent: Option, + terrain: Option<(f32, ColorPreset)>, + is_sticky: bool, + duration: Secs, }, } @@ -161,58 +97,92 @@ impl ProjectileConstructor { self, owner: Option, precision_mult: f32, - tool_stats: tool::Stats, damage_effect: Option, ) -> Projectile { + if self.scaled.is_some() { + dev_panic!( + "Attempted to create a projectile that had a provided scaled value without \ + scaling the projectile." + ) + } + let instance = rand::random(); - use ProjectileConstructor::*; - match self { - Arrow { - damage, - knockback, - energy_regen, - } => { - let knockback = AttackEffect::new( + let attack = self.attack.map(|a| { + let knockback = a.knockback.map(|kb| { + AttackEffect::new( Some(GroupTarget::OutOfGroup), CombatEffect::Knockback(Knockback { - strength: knockback, + strength: kb, direction: KnockbackDir::Away, - }) - .adjusted_by_stats(tool_stats), + }), ) + .with_requirement(CombatRequirement::AnyDamage) + }); + + let energy = AttackEffect::new(None, CombatEffect::EnergyReward(a.energy)) .with_requirement(CombatRequirement::AnyDamage); - let energy = AttackEffect::new(None, CombatEffect::EnergyReward(energy_regen)) - .with_requirement(CombatRequirement::AnyDamage); - let buff = CombatEffect::Buff(CombatBuff { - kind: BuffKind::Bleeding, - dur_secs: 10.0, - strength: CombatBuffStrength::DamageFraction(0.1), - chance: 0.1, - }) - .adjusted_by_stats(tool_stats); - let mut damage = AttackDamage::new( - Damage { - source: DamageSource::Projectile, - kind: DamageKind::Piercing, - value: damage, - }, - Some(GroupTarget::OutOfGroup), - instance, - ) - .with_effect(buff); - if let Some(damage_effect) = damage_effect { - damage = damage.with_effect(damage_effect); + + let buff = a.buff.map(CombatEffect::Buff); + + let (damage_source, damage_kind) = match self.kind { + ProjectileConstructorKind::Pointed | ProjectileConstructorKind::Hazard { .. } => { + (DamageSource::Projectile, DamageKind::Piercing) + }, + ProjectileConstructorKind::Blunt => { + (DamageSource::Projectile, DamageKind::Crushing) + }, + ProjectileConstructorKind::Explosive { .. } + | ProjectileConstructorKind::ExplosiveHazard { .. } => { + (DamageSource::Explosion, DamageKind::Energy) + }, + ProjectileConstructorKind::Possess => { + dev_panic!("This should be unreachable"); + (DamageSource::Projectile, DamageKind::Piercing) + }, + }; + + let mut damage = AttackDamage::new( + Damage { + source: damage_source, + kind: damage_kind, + value: a.damage, + }, + Some(GroupTarget::OutOfGroup), + instance, + ); + + if let Some(buff) = buff { + damage = damage.with_effect(buff); + } + + if let Some(damage_effect) = damage_effect { + damage = damage.with_effect(damage_effect); + } + + let mut attack = Attack::default() + .with_damage(damage) + .with_precision(precision_mult) + .with_effect(energy) + .with_combo_increment(); + + if let Some(knockback) = knockback { + attack = attack.with_effect(knockback); + } + + attack + }); + + match self.kind { + ProjectileConstructorKind::Pointed | ProjectileConstructorKind::Blunt => { + let mut hit_entity = vec![Effect::Vanish]; + + if let Some(attack) = attack { + hit_entity.push(Effect::Attack(attack)); } - let attack = Attack::default() - .with_damage(damage) - .with_precision(precision_mult) - .with_effect(energy) - .with_effect(knockback) - .with_combo_increment(); Projectile { hit_solid: vec![Effect::Stick, Effect::Bonk], - hit_entity: vec![Effect::Attack(attack), Effect::Vanish], + hit_entity, time_left: Duration::from_secs(15), owner, ignore_group: true, @@ -220,99 +190,52 @@ impl ProjectileConstructor { is_point: true, } }, - Knife { - damage, - knockback, - energy_regen, + ProjectileConstructorKind::Hazard { + is_sticky, + duration, } => { - let knockback = AttackEffect::new( - Some(GroupTarget::OutOfGroup), - CombatEffect::Knockback(Knockback { - strength: knockback, - direction: KnockbackDir::Away, - }) - .adjusted_by_stats(tool_stats), - ) - .with_requirement(CombatRequirement::AnyDamage); - let energy = AttackEffect::new(None, CombatEffect::EnergyReward(energy_regen)) - .with_requirement(CombatRequirement::AnyDamage); - let buff = CombatEffect::Buff(CombatBuff { - kind: BuffKind::Bleeding, - dur_secs: 10.0, - strength: CombatBuffStrength::DamageFraction(0.1), - chance: 0.1, - }) - .adjusted_by_stats(tool_stats); - let mut damage = AttackDamage::new( - Damage { - source: DamageSource::Projectile, - kind: DamageKind::Piercing, - value: damage, - }, - Some(GroupTarget::OutOfGroup), - instance, - ) - .with_effect(buff); - if let Some(damage_effect) = damage_effect { - damage = damage.with_effect(damage_effect); + let mut hit_entity = vec![Effect::Vanish]; + + if let Some(attack) = attack { + hit_entity.push(Effect::Attack(attack)); } - let attack = Attack::default() - .with_damage(damage) - .with_precision(precision_mult) - .with_effect(energy) - .with_effect(knockback) - .with_combo_increment(); Projectile { hit_solid: vec![Effect::Stick, Effect::Bonk], - hit_entity: vec![Effect::Attack(attack), Effect::Vanish], - time_left: Duration::from_secs(15), + hit_entity, + time_left: Duration::from_secs_f64(duration.0), owner, ignore_group: true, - is_sticky: true, + is_sticky, is_point: true, } }, - FireDroplet { - damage, + ProjectileConstructorKind::Explosive { radius, - energy_regen, min_falloff, reagent, + terrain, } => { - let energy = AttackEffect::new(None, CombatEffect::EnergyReward(energy_regen)) - .with_requirement(CombatRequirement::AnyDamage); - let buff = CombatEffect::Buff(CombatBuff { - kind: BuffKind::Burning, - dur_secs: 4.0, - strength: CombatBuffStrength::DamageFraction(1.0), - chance: 1.0, - }) - .adjusted_by_stats(tool_stats); - let damage = AttackDamage::new( - Damage { - source: DamageSource::Explosion, - kind: DamageKind::Energy, - value: damage, - }, - Some(GroupTarget::OutOfGroup), - instance, - ) - .with_effect(buff); - let attack = Attack::default() - .with_damage(damage) - .with_precision(precision_mult) - .with_effect(energy) - .with_combo_increment(); + let terrain = + terrain.map(|(pow, col)| RadiusEffect::TerrainDestruction(pow, col.to_rgb())); + + let mut effects = Vec::new(); + + if let Some(attack) = attack { + effects.push(RadiusEffect::Attack(attack)); + } + + if let Some(terrain) = terrain { + effects.push(terrain); + } + let explosion = Explosion { - effects: vec![ - RadiusEffect::Attack(attack), - RadiusEffect::TerrainDestruction(2.0, Rgb::black()), - ], + effects, radius, reagent, min_falloff, }; + Projectile { hit_solid: vec![Effect::Explode(explosion.clone()), Effect::Vanish], hit_entity: vec![Effect::Explode(explosion), Effect::Vanish], @@ -323,285 +246,45 @@ impl ProjectileConstructor { is_point: true, } }, - DemolisherBomb { - damage, + ProjectileConstructorKind::ExplosiveHazard { radius, - energy_regen, min_falloff, reagent, + terrain, + is_sticky, + duration, } => { - let energy = AttackEffect::new(None, CombatEffect::EnergyReward(energy_regen)) - .with_requirement(CombatRequirement::AnyDamage); - let buff = CombatEffect::Buff(CombatBuff { - kind: BuffKind::Burning, - dur_secs: 4.0, - strength: CombatBuffStrength::DamageFraction(1.0), - chance: 0.6, - }) - .adjusted_by_stats(tool_stats); - let damage = AttackDamage::new( - Damage { - source: DamageSource::Explosion, - kind: DamageKind::Energy, - value: damage, - }, - Some(GroupTarget::OutOfGroup), - instance, - ) - .with_effect(buff); - let attack = Attack::default() - .with_damage(damage) - .with_precision(precision_mult) - .with_effect(energy) - .with_combo_increment(); + let terrain = + terrain.map(|(pow, col)| RadiusEffect::TerrainDestruction(pow, col.to_rgb())); + + let mut effects = Vec::new(); + + if let Some(attack) = attack { + effects.push(RadiusEffect::Attack(attack)); + } + + if let Some(terrain) = terrain { + effects.push(terrain); + } + let explosion = Explosion { - effects: vec![ - RadiusEffect::Attack(attack), - RadiusEffect::TerrainDestruction(2.0, Rgb::black()), - ], + effects, radius, reagent, min_falloff, }; + Projectile { - hit_solid: vec![Effect::Explode(explosion.clone()), Effect::Vanish], + hit_solid: Vec::new(), hit_entity: vec![Effect::Explode(explosion), Effect::Vanish], - time_left: Duration::from_secs(10), + time_left: Duration::from_secs_f64(duration.0), owner, ignore_group: true, - is_sticky: true, - is_point: true, + is_sticky, + is_point: false, } }, - Fireball { - damage, - radius, - energy_regen, - min_falloff, - } => { - let energy = AttackEffect::new(None, CombatEffect::EnergyReward(energy_regen)) - .with_requirement(CombatRequirement::AnyDamage); - let buff = CombatEffect::Buff(CombatBuff { - kind: BuffKind::Burning, - dur_secs: 5.0, - strength: CombatBuffStrength::DamageFraction(0.1), - chance: 0.1, - }) - .adjusted_by_stats(tool_stats); - let damage = AttackDamage::new( - Damage { - source: DamageSource::Explosion, - kind: DamageKind::Energy, - value: damage, - }, - Some(GroupTarget::OutOfGroup), - instance, - ) - .with_effect(buff); - let attack = Attack::default() - .with_damage(damage) - .with_precision(precision_mult) - .with_effect(energy) - .with_combo_increment(); - let explosion = Explosion { - effects: vec![ - RadiusEffect::Attack(attack), - RadiusEffect::TerrainDestruction(2.0, Rgb::black()), - ], - radius, - reagent: Some(Reagent::Red), - min_falloff, - }; - 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, - } - }, - Frostball { - damage, - radius, - min_falloff, - } => { - let damage = AttackDamage::new( - Damage { - source: DamageSource::Explosion, - kind: DamageKind::Energy, - value: damage, - }, - Some(GroupTarget::OutOfGroup), - instance, - ); - let attack = Attack::default() - .with_damage(damage) - .with_precision(precision_mult) - .with_combo_increment(); - let explosion = Explosion { - effects: vec![RadiusEffect::Attack(attack)], - radius, - reagent: Some(Reagent::White), - min_falloff, - }; - 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, - } - }, - Poisonball { - damage, - radius, - knockback, - min_falloff, - } => { - let knockback = AttackEffect::new( - Some(GroupTarget::OutOfGroup), - CombatEffect::Knockback(Knockback { - strength: knockback, - direction: KnockbackDir::Away, - }) - .adjusted_by_stats(tool_stats), - ) - .with_requirement(CombatRequirement::AnyDamage); - let buff = AttackEffect::new( - Some(GroupTarget::OutOfGroup), - CombatEffect::Buff(CombatBuff { - kind: BuffKind::Poisoned, - dur_secs: 5.0, - strength: CombatBuffStrength::DamageFraction(0.8), - chance: 1.0, - }) - .adjusted_by_stats(tool_stats), - ) - .with_requirement(CombatRequirement::AnyDamage); - let damage = AttackDamage::new( - Damage { - source: DamageSource::Explosion, - kind: DamageKind::Energy, - value: damage, - }, - Some(GroupTarget::OutOfGroup), - instance, - ); - let attack = Attack::default() - .with_damage(damage) - .with_precision(precision_mult) - .with_effect(knockback) - .with_effect(buff); - let explosion = Explosion { - effects: vec![ - RadiusEffect::Attack(attack), - RadiusEffect::TerrainDestruction(5.0, Rgb::black()), - ], - radius, - reagent: Some(Reagent::Purple), - min_falloff, - }; - 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, - } - }, - NecroticSphere { - damage, - radius, - min_falloff, - energy_regen, - } => { - let energy = AttackEffect::new(None, CombatEffect::EnergyReward(energy_regen)) - .with_requirement(CombatRequirement::AnyDamage); - let damage = AttackDamage::new( - Damage { - source: DamageSource::Explosion, - kind: DamageKind::Energy, - value: damage, - }, - Some(GroupTarget::OutOfGroup), - instance, - ); - let attack = Attack::default() - .with_damage(damage) - .with_precision(precision_mult) - .with_combo_increment() - .with_effect(energy); - let explosion = Explosion { - effects: vec![RadiusEffect::Attack(attack)], - radius, - reagent: Some(Reagent::Purple), - min_falloff, - }; - 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, - } - }, - Magicball { - damage, - radius, - min_falloff, - } => { - let buff = AttackEffect::new( - Some(GroupTarget::OutOfGroup), - CombatEffect::Buff(CombatBuff { - kind: BuffKind::Poisoned, - dur_secs: 5.0, - strength: CombatBuffStrength::DamageFraction(0.8), - chance: 1.0, - }) - .adjusted_by_stats(tool_stats), - ) - .with_requirement(CombatRequirement::AnyDamage); - let damage = AttackDamage::new( - Damage { - source: DamageSource::Explosion, - kind: DamageKind::Energy, - value: damage, - }, - Some(GroupTarget::OutOfGroup), - instance, - ); - let attack = Attack::default() - .with_damage(damage) - .with_precision(precision_mult) - .with_effect(buff); - let explosion = Explosion { - effects: vec![ - RadiusEffect::Attack(attack), - RadiusEffect::TerrainDestruction(0.0, Rgb::black()), - ], - radius, - reagent: Some(Reagent::Green), - min_falloff, - }; - 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, - } - }, - Possess => Projectile { + ProjectileConstructorKind::Possess => Projectile { hit_solid: vec![Effect::Stick], hit_entity: vec![Effect::Stick, Effect::Possess], time_left: Duration::from_secs(10), @@ -610,640 +293,97 @@ impl ProjectileConstructor { is_sticky: true, is_point: true, }, - ClayRocket { - damage, - radius, - knockback, - min_falloff, - } => { - let knockback = AttackEffect::new( - Some(GroupTarget::OutOfGroup), - CombatEffect::Knockback(Knockback { - strength: knockback, - direction: KnockbackDir::Away, - }) - .adjusted_by_stats(tool_stats), - ) - .with_requirement(CombatRequirement::AnyDamage); - let damage = AttackDamage::new( - Damage { - source: DamageSource::Explosion, - kind: DamageKind::Energy, - value: damage, - }, - Some(GroupTarget::OutOfGroup), - instance, - ); - let attack = Attack::default() - .with_damage(damage) - .with_precision(precision_mult) - .with_effect(knockback); - let explosion = Explosion { - effects: vec![ - RadiusEffect::Attack(attack), - RadiusEffect::TerrainDestruction(5.0, Rgb::black()), - ], - radius, - reagent: Some(Reagent::Red), - min_falloff, - }; - 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, - } - }, - InkBomb { - damage, - radius, - min_falloff, - } => { - let damage = AttackDamage::new( - Damage { - source: DamageSource::Explosion, - kind: DamageKind::Energy, - value: damage, - }, - Some(GroupTarget::OutOfGroup), - instance, - ); - let buff = AttackEffect::new( - Some(GroupTarget::OutOfGroup), - CombatEffect::Buff(CombatBuff { - kind: BuffKind::Wet, - dur_secs: 8.0, - strength: CombatBuffStrength::Value(0.5), - chance: 1.0, - }) - .adjusted_by_stats(tool_stats), - ) - .with_requirement(CombatRequirement::AnyDamage); - let attack = Attack::default() - .with_damage(damage) - .with_precision(precision_mult) - .with_effect(buff) - .with_combo_increment(); - let explosion = Explosion { - effects: vec![ - RadiusEffect::Attack(attack), - RadiusEffect::TerrainDestruction(18.0, Rgb::new(4.0, 7.0, 32.0)), - ], - radius, - reagent: Some(Reagent::Blue), - min_falloff, - }; - 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, - } - }, - Snowball { - damage, - radius, - min_falloff, - } => { - let damage = AttackDamage::new( - Damage { - source: DamageSource::Explosion, - kind: DamageKind::Energy, - value: damage, - }, - Some(GroupTarget::OutOfGroup), - instance, - ); - let attack = Attack::default() - .with_damage(damage) - .with_precision(precision_mult); - let explosion = Explosion { - effects: vec![RadiusEffect::Attack(attack)], - radius, - reagent: Some(Reagent::White), - min_falloff, - }; - Projectile { - hit_solid: vec![], - hit_entity: vec![Effect::Explode(explosion), Effect::Vanish], - time_left: Duration::from_secs(120), - owner, - ignore_group: true, - is_sticky: false, - is_point: false, - } - }, - ExplodingPumpkin { - damage, - radius, - knockback, - min_falloff, - } => { - let knockback = AttackEffect::new( - Some(GroupTarget::OutOfGroup), - CombatEffect::Knockback(Knockback { - strength: knockback, - direction: KnockbackDir::Away, - }) - .adjusted_by_stats(tool_stats), - ) - .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, - }) - .adjusted_by_stats(tool_stats), - ) - .with_requirement(CombatRequirement::AnyDamage); - let damage = AttackDamage::new( - Damage { - source: DamageSource::Explosion, - kind: DamageKind::Energy, - value: damage, - }, - Some(GroupTarget::OutOfGroup), - instance, - ); - let attack = Attack::default() - .with_damage(damage) - .with_precision(precision_mult) - .with_effect(knockback) - .with_effect(buff); - let explosion = Explosion { - effects: vec![ - RadiusEffect::Attack(attack), - RadiusEffect::TerrainDestruction(5.0, Rgb::black()), - ], - radius, - reagent: Some(Reagent::Red), - min_falloff, - }; - 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, - } - }, - DagonBomb { - damage, - radius, - knockback, - min_falloff, - } => { - let knockback = AttackEffect::new( - Some(GroupTarget::OutOfGroup), - CombatEffect::Knockback(Knockback { - strength: knockback, - direction: KnockbackDir::Away, - }) - .adjusted_by_stats(tool_stats), - ) - .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, - }) - .adjusted_by_stats(tool_stats), - ) - .with_requirement(CombatRequirement::AnyDamage); - let damage = AttackDamage::new( - Damage { - source: DamageSource::Explosion, - kind: DamageKind::Energy, - value: damage, - }, - Some(GroupTarget::OutOfGroup), - instance, - ); - let attack = Attack::default() - .with_damage(damage) - .with_precision(precision_mult) - .with_effect(knockback) - .with_effect(buff); - let explosion = Explosion { - effects: vec![ - RadiusEffect::Attack(attack), - RadiusEffect::TerrainDestruction(25.0, Rgb::black()), - ], - radius, - reagent: Some(Reagent::Blue), - min_falloff, - }; - 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, - } - }, - IceBomb { - damage, - radius, - knockback, - min_falloff, - } => { - 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::Frozen, - dur_secs: 5.0, - strength: CombatBuffStrength::DamageFraction(0.05), - chance: 1.0, - }) - .adjusted_by_stats(tool_stats), - ) - .with_requirement(CombatRequirement::AnyDamage); - let damage = AttackDamage::new( - Damage { - source: DamageSource::Explosion, - kind: DamageKind::Energy, - value: damage, - }, - Some(GroupTarget::OutOfGroup), - instance, - ); - let attack = Attack::default() - .with_damage(damage) - .with_precision(precision_mult) - .with_effect(knockback) - .with_effect(buff); - let variation = thread_rng().gen::(); - let explosion = Explosion { - effects: vec![ - RadiusEffect::Attack(attack), - RadiusEffect::TerrainDestruction( - 30.0, - Rgb::new( - 83.0 - (20.0 * variation), - 212.0 - (52.0 * variation), - 255.0 - (62.0 * variation), - ), - ), - ], - radius, - reagent: Some(Reagent::White), - min_falloff, - }; - 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, - } - }, - LaserBeam { - damage, - radius, - knockback, - min_falloff, - } => { - let knockback = AttackEffect::new( - Some(GroupTarget::OutOfGroup), - CombatEffect::Knockback(Knockback { - strength: knockback, - direction: KnockbackDir::Away, - }) - .adjusted_by_stats(tool_stats), - ) - .with_requirement(CombatRequirement::AnyDamage); - let damage = AttackDamage::new( - Damage { - source: DamageSource::Explosion, - kind: DamageKind::Energy, - value: damage, - }, - Some(GroupTarget::OutOfGroup), - instance, - ); - let attack = Attack::default() - .with_damage(damage) - .with_precision(precision_mult) - .with_effect(knockback); - let explosion = Explosion { - effects: vec![ - RadiusEffect::Attack(attack), - RadiusEffect::TerrainDestruction(10.0, Rgb::black()), - ], - radius, - reagent: Some(Reagent::Yellow), - min_falloff, - }; - 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, - } - }, - 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_precision(precision_mult); - Projectile { - hit_solid: vec![], - hit_entity: vec![Effect::Attack(attack), Effect::Vanish], - time_left: Duration::from_secs(10), - owner, - ignore_group: true, - is_sticky: true, - is_point: false, - } - }, - Mine { - damage, - radius, - min_falloff, - } => { - let damage = AttackDamage::new( - Damage { - source: DamageSource::Explosion, - kind: DamageKind::Energy, - value: damage, - }, - Some(GroupTarget::OutOfGroup), - instance, - ); - let attack = Attack::default() - .with_damage(damage) - .with_precision(precision_mult); - let explosion = Explosion { - effects: vec![RadiusEffect::Attack(attack)], - radius, - reagent: Some(Reagent::Yellow), - min_falloff, - }; - Projectile { - hit_solid: vec![], - hit_entity: vec![Effect::Explode(explosion), Effect::Vanish], - time_left: Duration::from_secs(10), - owner, - ignore_group: true, - is_sticky: false, - is_point: false, - } - }, - Pebble { damage, knockback } => { - let knockback = AttackEffect::new( - Some(GroupTarget::OutOfGroup), - CombatEffect::Knockback(Knockback { - strength: knockback, - direction: KnockbackDir::Away, - }) - .adjusted_by_stats(tool_stats), - ) - .with_requirement(CombatRequirement::AnyDamage); - let damage = AttackDamage::new( - Damage { - source: DamageSource::Projectile, - kind: DamageKind::Crushing, - value: damage, - }, - Some(GroupTarget::OutOfGroup), - instance, - ); - let attack = Attack::default() - .with_damage(damage) - .with_precision(precision_mult) - .with_effect(knockback); - - Projectile { - hit_solid: vec![Effect::Vanish, Effect::Vanish], - hit_entity: vec![Effect::Attack(attack), Effect::Vanish], - time_left: Duration::from_secs(10), - owner, - ignore_group: true, - is_sticky: false, - is_point: false, - } - }, } } - // TODO: split this to three methods per stat - #[must_use] - pub fn modified_projectile(mut self, power: f32, regen: f32, range: f32) -> Self { - use ProjectileConstructor::*; - match self { - Arrow { - ref mut damage, - ref mut energy_regen, - .. - } => { - *damage *= power; - *energy_regen *= regen; - }, - Knife { - ref mut damage, - ref mut energy_regen, - .. - } => { - *damage *= power; - *energy_regen *= regen; - }, - FireDroplet { - ref mut damage, - ref mut energy_regen, - ref mut radius, - .. - } => { - *damage *= power; - *energy_regen *= regen; - *radius *= range; - }, - DemolisherBomb { - ref mut damage, - ref mut energy_regen, - ref mut radius, - .. - } => { - *damage *= power; - *energy_regen *= regen; - *radius *= range; - }, - Fireball { - ref mut damage, - ref mut energy_regen, - ref mut radius, - .. - } => { - *damage *= power; - *energy_regen *= regen; - *radius *= range; - }, - Frostball { - ref mut damage, - ref mut radius, - .. - } => { - *damage *= power; - *radius *= range; - }, - Poisonball { - ref mut damage, - ref mut radius, - .. - } => { - *damage *= power; - *radius *= range; - }, - NecroticSphere { - ref mut damage, - ref mut radius, - .. - } => { - *damage *= power; - *radius *= range; - }, - Magicball { - ref mut damage, - ref mut radius, - .. - } => { - *damage *= power; - *radius *= range; - }, - Possess => {}, - ClayRocket { - ref mut damage, - ref mut radius, - .. - } => { - *damage *= power; - *radius *= range; - }, - InkBomb { - ref mut damage, - ref mut radius, - .. - } => { - *damage *= power; - *radius *= range; - }, - Snowball { - ref mut damage, - ref mut radius, - .. - } => { - *damage *= power; - *radius *= range; - }, - ExplodingPumpkin { - ref mut damage, - ref mut radius, - .. - } => { - *damage *= power; - *radius *= range; - }, - DagonBomb { - ref mut damage, - ref mut radius, - .. - } => { - *damage *= power; - *radius *= range; - }, - IceBomb { - ref mut damage, - ref mut radius, - .. - } => { - *damage *= power; - *radius *= range; - }, - LaserBeam { - ref mut damage, - ref mut radius, - .. - } => { - *damage *= power; - *radius *= range; - }, - Trap { ref mut damage, .. } => { - *damage *= power; - }, - Mine { - ref mut damage, - ref mut radius, - .. - } => { - *damage *= power; - *radius *= range; - }, - Pebble { ref mut damage, .. } => { - *damage *= power; + pub fn handle_scaling(mut self, scaling: f32) -> Self { + let scale_values = |a, b| a + b * scaling; + + if let Some(scaled) = self.scaled { + if let Some(ref mut attack) = self.attack { + attack.damage = scale_values(attack.damage, scaled.damage); + attack.energy = scale_values(attack.energy, scaled.energy); + if let Some(s_kb) = scaled.knockback { + attack.knockback = Some(scale_values(attack.knockback.unwrap_or(0.0), s_kb)); + } + } else { + dev_panic!("Attempted to scale on a projectile that has no attack to scale.") + } + } else { + dev_panic!("Attempted to scale on a projectile that has no provided scaling value.") + } + + self.scaled = None; + + self + } + + pub fn adjusted_by_stats(mut self, stats: tool::Stats) -> Self { + self.attack = self.attack.map(|mut a| { + a.damage *= stats.power; + a.knockback = a.knockback.map(|kb| kb * stats.effect_power); + a.buff = a.buff.map(|mut b| { + b.strength *= stats.buff_strength; + b + }); + a + }); + + self.scaled = self.scaled.map(|mut s| { + s.damage *= stats.power; + s.knockback = s.knockback.map(|kb| kb * stats.effect_power); + s + }); + + match self.kind { + ProjectileConstructorKind::Pointed + | ProjectileConstructorKind::Blunt + | ProjectileConstructorKind::Possess + | ProjectileConstructorKind::Hazard { .. } => {}, + ProjectileConstructorKind::Explosive { ref mut radius, .. } + | ProjectileConstructorKind::ExplosiveHazard { ref mut radius, .. } => { + *radius *= stats.range; }, } + + self + } + + // Remove this function after skill tree overhaul completed for bow and fire + // staff + pub fn legacy_modified_by_skills( + mut self, + power: f32, + regen: f32, + range: f32, + kb: f32, + ) -> Self { + self.attack = self.attack.map(|mut a| { + a.damage *= power; + a.knockback = a.knockback.map(|k| k * kb); + a.energy *= regen; + a + }); + self.scaled = self.scaled.map(|mut s| { + s.damage *= power; + s.knockback = s.knockback.map(|k| k * kb); + s.energy *= regen; + s + }); + if let ProjectileConstructorKind::Explosive { ref mut radius, .. } = self.kind { + *radius *= range; + } self } pub fn is_explosive(&self) -> bool { - use ProjectileConstructor::*; - match self { - Arrow { .. } => false, - Knife { .. } => false, - FireDroplet { .. } => true, - DemolisherBomb { .. } => true, - Fireball { .. } => true, - Frostball { .. } => true, - Poisonball { .. } => true, - NecroticSphere { .. } => true, - Magicball { .. } => true, - Possess => false, - ClayRocket { .. } => true, - Snowball { .. } => true, - ExplodingPumpkin { .. } => true, - DagonBomb { .. } => true, - InkBomb { .. } => true, - IceBomb { .. } => true, - LaserBeam { .. } => true, - Trap { .. } => false, - Mine { .. } => true, - Pebble { .. } => false, + match self.kind { + ProjectileConstructorKind::Pointed + | ProjectileConstructorKind::Blunt + | ProjectileConstructorKind::Possess + | ProjectileConstructorKind::Hazard { .. } => false, + ProjectileConstructorKind::Explosive { .. } + | ProjectileConstructorKind::ExplosiveHazard { .. } => true, } } } diff --git a/common/src/explosion.rs b/common/src/explosion.rs index bb48cd0f5e..778101dddb 100644 --- a/common/src/explosion.rs +++ b/common/src/explosion.rs @@ -1,4 +1,5 @@ use crate::{combat::Attack, comp::item::Reagent, effect::Effect}; +use rand::{thread_rng, Rng}; use serde::{Deserialize, Serialize}; use vek::Rgb; @@ -16,3 +17,27 @@ pub enum RadiusEffect { Entity(Effect), Attack(Attack), } + +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)] +pub enum ColorPreset { + Black, + InkBomb, + IceBomb, +} + +impl ColorPreset { + pub fn to_rgb(&self) -> Rgb { + match self { + Self::Black => Rgb::black(), + Self::InkBomb => Rgb::new(4.0, 7.0, 32.0), + Self::IceBomb => { + let variation = thread_rng().gen::(); + Rgb::new( + 83.0 - (20.0 * variation), + 212.0 - (52.0 * variation), + 255.0 - (62.0 * variation), + ) + }, + } + } +} diff --git a/common/src/states/basic_ranged.rs b/common/src/states/basic_ranged.rs index b04ddcd026..4adb4e3665 100644 --- a/common/src/states/basic_ranged.rs +++ b/common/src/states/basic_ranged.rs @@ -110,11 +110,9 @@ impl CharacterBehavior for Data { if !self.exhausted { // Fire let precision_mult = combat::compute_precision_mult(data.inventory, data.msm); - let tool_stats = get_tool_stats(data, self.static_data.ability_info); let projectile = self.static_data.projectile.create_projectile( Some(*data.uid), precision_mult, - tool_stats, self.static_data.damage_effect, ); // Shoots all projectiles simultaneously diff --git a/common/src/states/charged_ranged.rs b/common/src/states/charged_ranged.rs index 692f8d5276..2771ae174a 100644 --- a/common/src/states/charged_ranged.rs +++ b/common/src/states/charged_ranged.rs @@ -24,19 +24,8 @@ pub struct StaticData { pub recover_duration: Duration, /// How much energy is drained per second when charging pub energy_drain: f32, - /// How much energy is gained with no charge - pub initial_regen: f32, - /// How much the energy gain scales as it is charged - pub scaled_regen: f32, - /// How much damage is dealt with no charge - pub initial_damage: f32, - /// How much the damage scales as it is charged - pub scaled_damage: f32, - /// How much knockback there is with no charge - pub initial_knockback: f32, - /// How much the knockback scales as it is charged - pub scaled_knockback: f32, /// Projectile information + pub projectile: ProjectileConstructor, pub projectile_body: Body, pub projectile_light: Option, pub initial_projectile_speed: f32, @@ -101,28 +90,22 @@ impl CharacterBehavior for Data { StageSection::Charge => { if !input_is_pressed(data, self.static_data.ability_info.input) && !self.exhausted { let charge_frac = self.charge_frac(); - let arrow = ProjectileConstructor::Arrow { - damage: self.static_data.initial_damage - + charge_frac * self.static_data.scaled_damage, - knockback: self.static_data.initial_knockback - + charge_frac * self.static_data.scaled_knockback, - energy_regen: self.static_data.initial_regen - + charge_frac * self.static_data.scaled_regen, - }; // Fire let precision_mult = combat::compute_precision_mult(data.inventory, data.msm); - let tool_stats = get_tool_stats(data, self.static_data.ability_info); // Gets offsets let body_offsets = data .body .projectile_offsets(update.ori.look_vec(), data.scale.map_or(1.0, |s| s.0)); let pos = Pos(data.pos.0 + body_offsets); - let projectile = arrow.create_projectile( - Some(*data.uid), - precision_mult, - tool_stats, - self.static_data.damage_effect, - ); + let projectile = self + .static_data + .projectile + .handle_scaling(charge_frac) + .create_projectile( + Some(*data.uid), + precision_mult, + self.static_data.damage_effect, + ); output_events.emit_server(ShootEvent { entity: data.entity, pos, diff --git a/common/src/states/repeater_ranged.rs b/common/src/states/repeater_ranged.rs index 253f0e4498..f05a890ce5 100644 --- a/common/src/states/repeater_ranged.rs +++ b/common/src/states/repeater_ranged.rs @@ -107,7 +107,6 @@ impl CharacterBehavior for Data { { // Fire if input is pressed still let precision_mult = combat::compute_precision_mult(data.inventory, data.msm); - let tool_stats = get_tool_stats(data, self.static_data.ability_info); // Gets offsets let pos: Pos = self.static_data.properties_of_aoe.as_ref().map_or_else( || { @@ -141,7 +140,6 @@ impl CharacterBehavior for Data { let projectile = self.static_data.projectile.create_projectile( Some(*data.uid), precision_mult, - tool_stats, self.static_data.damage_effect, ); output_events.emit_server(ShootEvent { diff --git a/server/agent/src/action_nodes.rs b/server/agent/src/action_nodes.rs index 4fc442c672..0bf2c20bca 100644 --- a/server/agent/src/action_nodes.rs +++ b/server/agent/src/action_nodes.rs @@ -22,7 +22,7 @@ use common::{ ConsumableKind, Effects, Item, ItemDesc, ItemKind, }, item_drop, - projectile::ProjectileConstructor, + projectile::ProjectileConstructorKind, Agent, Alignment, Body, CharacterState, Content, ControlAction, ControlEvent, Controller, HealthChange, InputKind, InventoryAction, Pos, Scale, UnresolvedChatMsg, UtteranceKind, }, @@ -1271,14 +1271,11 @@ impl<'a> AgentData<'a> { ) }, CharacterState::BasicRanged(c) => { - let offset_z = match c.static_data.projectile { - // Aim fireballs at feet instead of eyes for splash damage - ProjectileConstructor::Fireball { - damage: _, - radius: _, - energy_regen: _, - min_falloff: _, - } => 0.0, + let offset_z = match c.static_data.projectile.kind { + // Aim explosives and hazards at feet instead of eyes for splash damage + ProjectileConstructorKind::Explosive { .. } + | ProjectileConstructorKind::ExplosiveHazard { .. } + | ProjectileConstructorKind::Hazard { .. } => 0.0, _ => tgt_eye_offset, }; let projectile_speed = c.static_data.projectile_speed; diff --git a/server/src/wiring.rs b/server/src/wiring.rs index 1d83efc250..518d5a29b8 100644 --- a/server/src/wiring.rs +++ b/server/src/wiring.rs @@ -1,5 +1,5 @@ use common::{ - comp::{item::tool, object, Body, LightEmitter, PhysicsState, Pos, ProjectileConstructor}, + comp::{object, Body, LightEmitter, PhysicsState, Pos, ProjectileConstructor}, event::{EmitExt, ShootEvent}, terrain::{Block, TerrainChunkSize}, util::Dir, @@ -188,12 +188,7 @@ impl WiringAction { pos, dir: Dir::forward(), body: Body::Object(object::Body::Arrow), - projectile: constr.create_projectile( - None, - 1.0, - tool::Stats::one(), - None, - ), + projectile: constr.create_projectile(None, 1.0, None), light: None, speed: 5.0, object: None,