Rewrote projectile constructor

This commit is contained in:
Sam 2024-05-12 20:47:48 -04:00
parent d920facfb2
commit 7a7e6391b4
63 changed files with 1063 additions and 1502 deletions

View File

@ -2,10 +2,15 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.75, buildup_duration: 0.75,
recover_duration: 0.75, recover_duration: 0.75,
projectile: Trap( projectile: (
damage: 25, kind: Hazard(
knockback: 4, is_sticky: true,
energy_regen: 0, duration: 10,
),
attack: Some((
damage: 25,
energy: 0,
)),
), ),
projectile_body: Object(AdletTrap), projectile_body: Object(AdletTrap),
projectile_light: None, projectile_light: None,

View File

@ -2,10 +2,19 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.8, buildup_duration: 0.8,
recover_duration: 0.8, recover_duration: 0.8,
projectile: Arrow( projectile: (
damage: 16, kind: Pointed,
knockback: 1, attack: Some((
energy_regen: 0, 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_body: Object(AdletSpear),
projectile_light: None, projectile_light: None,

View File

@ -2,10 +2,18 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.6, buildup_duration: 0.6,
recover_duration: 0.4, recover_duration: 0.4,
projectile: Arrow( projectile: (
damage: 12, kind: Pointed,
knockback: 0, attack: Some((
energy_regen: 0, damage: 12,
energy: 0,
buff: Some((
kind: Bleeding,
dur_secs: 10,
strength: DamageFraction(0.1),
chance: 0.1,
)),
)),
), ),
projectile_body: Object(Arrow), projectile_body: Object(Arrow),
projectile_light: None, projectile_light: None,

View File

@ -2,10 +2,15 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.75, buildup_duration: 0.75,
recover_duration: 0.75, recover_duration: 0.75,
projectile: Trap( projectile: (
damage: 12, kind: Hazard(
knockback: 0, is_sticky: true,
energy_regen: 0, duration: 10,
),
attack: Some((
damage: 12,
energy: 0,
)),
), ),
projectile_body: Object(AdletTrap), projectile_body: Object(AdletTrap),
projectile_light: None, projectile_light: None,

View File

@ -1,12 +1,24 @@
ChargedRanged( ChargedRanged(
energy_cost: 0, energy_cost: 0,
energy_drain: 0, energy_drain: 0,
initial_regen: 2, projectile: (
scaled_regen: 14, kind: Pointed,
initial_damage: 2, attack: Some((
scaled_damage: 12, damage: 2,
initial_knockback: 0, energy: 2,
scaled_knockback: 12, 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, buildup_duration: 0.25,
charge_duration: 1.0, charge_duration: 1.0,
recover_duration: 0.4, recover_duration: 0.4,

View File

@ -5,10 +5,18 @@ RepeaterRanged(
recover_duration: 0.5, recover_duration: 0.5,
max_speed: 4.0, max_speed: 4.0,
half_speed_at: 3, half_speed_at: 3,
projectile: Arrow( projectile: (
damage: 5.0, kind: Pointed,
knockback: 0, attack: Some((
energy_regen: 0, damage: 5,
energy: 0,
buff: Some((
kind: Bleeding,
dur_secs: 10,
strength: DamageFraction(0.1),
chance: 0.1,
)),
)),
), ),
projectile_body: Object(Arrow), projectile_body: Object(Arrow),
projectile_light: None, projectile_light: None,

View File

@ -3,10 +3,19 @@ BasicRanged(
buildup_duration: 0.3, buildup_duration: 0.3,
recover_duration: 0.3, recover_duration: 0.3,
projectile_spread: 0.05, projectile_spread: 0.05,
projectile: Arrow( projectile: (
damage: 6, kind: Pointed,
knockback: 5, attack: Some((
energy_regen: 0, 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_body: Object(Arrow),
projectile_light: None, projectile_light: None,

View File

@ -2,10 +2,19 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.5, buildup_duration: 0.5,
recover_duration: 0.3, recover_duration: 0.3,
projectile: Arrow( projectile: (
damage: 3.5, kind: Pointed,
knockback: 5.0, attack: Some((
energy_regen: 4.0, 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_body: Object(Arrow),
projectile_light: None, projectile_light: None,

View File

@ -2,11 +2,18 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 2.5, buildup_duration: 2.5,
recover_duration: 1.0, recover_duration: 1.0,
projectile: ClayRocket( projectile: (
damage: 75.0, kind: Explosive(
knockback: 35.0, radius: 10,
radius: 10.0, min_falloff: 0.75,
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_body: Object(FireRainDrop),
projectile_speed: 0.0, projectile_speed: 0.0,

View File

@ -2,18 +2,26 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 1.2, buildup_duration: 1.2,
recover_duration: 0.7, recover_duration: 0.7,
projectile: Poisonball( projectile: (
damage: 58.0, kind: Explosive(
radius: 3.5, radius: 3.5,
knockback: 1.0, min_falloff: 0.2,
energy_regen: 0, reagent: Some(Purple),
min_falloff: 0.2, 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_body: Object(SpitPoison),
/*projectile_light: Some(LightEmitter {
col: (1.0, 0.75, 0.11).into(),
..Default::default()
}),*/
projectile_speed: 25.0, projectile_speed: 25.0,
num_projectiles: 1, num_projectiles: 1,
projectile_spread: 0.3, projectile_spread: 0.3,

View File

@ -2,9 +2,13 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.6, buildup_duration: 0.6,
recover_duration: 0.9, recover_duration: 0.9,
projectile: Pebble( projectile: (
damage: 6, kind: Blunt,
knockback: 2, attack: Some((
damage: 6,
knockback: Some(2),
energy: 0,
)),
), ),
projectile_body: Object(Pebble), projectile_body: Object(Pebble),
projectile_light: None, projectile_light: None,

View File

@ -2,17 +2,25 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 1.6, buildup_duration: 1.6,
recover_duration: 0.7, recover_duration: 0.7,
projectile: Fireball( projectile: (
damage: 26.0, kind: Explosive(
radius: 5.0, radius: 5,
energy_regen: 0, min_falloff: 0.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_body: Object(BoltFire),
/*projectile_light: Some(LightEmitter {
col: (1.0, 0.75, 0.11).into(),
..Default::default()
}),*/
projectile_speed: 70.0, projectile_speed: 70.0,
num_projectiles: 1, num_projectiles: 1,
projectile_spread: 0.0, projectile_spread: 0.0,

View File

@ -2,10 +2,19 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.9, buildup_duration: 0.9,
recover_duration: 0.3, recover_duration: 0.3,
projectile: Arrow( projectile: (
damage: 12.0, kind: Pointed,
knockback: 5.0, attack: Some((
energy_regen: 4.0, 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_body: Object(Arrow),
projectile_light: None, projectile_light: None,

View File

@ -2,17 +2,25 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 1.0, buildup_duration: 1.0,
recover_duration: 1.35, recover_duration: 1.35,
projectile: Fireball( projectile: (
damage: 15.0, kind: Explosive(
radius: 5.0, radius: 5,
energy_regen: 5.0, min_falloff: 0.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_body: Object(BoltFire),
/*projectile_light: Some(LightEmitter {
col: (1.0, 0.75, 0.11).into(),
..Default::default()
}),*/
projectile_speed: 60.0, projectile_speed: 60.0,
num_projectiles: 1, num_projectiles: 1,
projectile_spread: 0.0, projectile_spread: 0.0,

View File

@ -2,17 +2,25 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 1.0, buildup_duration: 1.0,
recover_duration: 0.7, recover_duration: 0.7,
projectile: Fireball( projectile: (
damage: 20.0, kind: Explosive(
radius: 5.0, radius: 5,
energy_regen: 5.0, min_falloff: 0.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_body: Object(BoltFire),
/*projectile_light: Some(LightEmitter {
col: (1.0, 0.75, 0.11).into(),
..Default::default()
}),*/
projectile_speed: 60.0, projectile_speed: 60.0,
num_projectiles: 1, num_projectiles: 1,
projectile_spread: 0.0, projectile_spread: 0.0,

View File

@ -5,12 +5,23 @@ RepeaterRanged(
recover_duration: 0.5, recover_duration: 0.5,
max_speed: 8.0, max_speed: 8.0,
half_speed_at: 5, half_speed_at: 5,
projectile: FireDroplet( projectile: (
damage: 30.0, kind: Explosive(
radius: 12.0, radius: 12,
min_falloff: 0.5, min_falloff: 0.5,
energy_regen: 0, reagent: Some(Phoenix),
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_body: Object(FireRainDrop),
projectile_light: Some(LightEmitter( projectile_light: Some(LightEmitter(

View File

@ -1,12 +1,24 @@
ChargedRanged( ChargedRanged(
energy_cost: 0, energy_cost: 0,
energy_drain: 0, energy_drain: 0,
initial_regen: 2, projectile: (
scaled_regen: 14, kind: Pointed,
initial_damage: 2, attack: Some((
scaled_damage: 12, damage: 2,
initial_knockback: 0, energy: 2,
scaled_knockback: 12, 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, buildup_duration: 0.25,
charge_duration: 1.0, charge_duration: 1.0,
recover_duration: 0.4, recover_duration: 0.4,

View File

@ -5,10 +5,18 @@ RepeaterRanged(
recover_duration: 0.5, recover_duration: 0.5,
max_speed: 4.0, max_speed: 4.0,
half_speed_at: 3, half_speed_at: 3,
projectile: Arrow( projectile: (
damage: 5.0, kind: Pointed,
knockback: 0, attack: Some((
energy_regen: 0, damage: 5,
energy: 0,
buff: Some((
kind: Bleeding,
dur_secs: 10,
strength: DamageFraction(0.1),
chance: 0.1,
)),
)),
), ),
projectile_body: Object(Arrow), projectile_body: Object(Arrow),
projectile_light: None, projectile_light: None,

View File

@ -3,10 +3,19 @@ BasicRanged(
buildup_duration: 0.3, buildup_duration: 0.3,
recover_duration: 0.3, recover_duration: 0.3,
projectile_spread: 0.05, projectile_spread: 0.05,
projectile: Arrow( projectile: (
damage: 6, kind: Pointed,
knockback: 5, attack: Some((
energy_regen: 0, 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_body: Object(Arrow),
projectile_light: None, projectile_light: None,

View File

@ -2,12 +2,18 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.5, buildup_duration: 0.5,
recover_duration: 1.5, recover_duration: 1.5,
projectile: LaserBeam( projectile: (
damage: 20.0, kind: Explosive(
radius: 5.0, radius: 5,
knockback: 5.0, min_falloff: 0.1,
energy_regen: 20.0, reagent: Some(Yellow),
min_falloff: 0.1, terrain: Some((10, Black)),
),
attack: Some((
damage: 20,
knockback: Some(5),
energy: 0,
)),
), ),
projectile_body: Object(LightningBolt), projectile_body: Object(LightningBolt),
projectile_light: None, projectile_light: None,

View File

@ -2,12 +2,24 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.3, buildup_duration: 0.3,
recover_duration: 0.3, recover_duration: 0.3,
projectile: Poisonball( projectile: (
damage: 32.0, kind: Explosive(
knockback: 10.0, radius: 6,
radius: 6.0, min_falloff: 0.1,
energy_regen: 5.0, reagent: Some(Purple),
min_falloff: 0.1, 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_body: Object(SpitPoison),
projectile_light: None, projectile_light: None,

View File

@ -2,12 +2,18 @@ BasicRanged(
energy_cost: 0.0, energy_cost: 0.0,
buildup_duration: 1.6, buildup_duration: 1.6,
recover_duration: 1.2, recover_duration: 1.2,
projectile: LaserBeam( projectile: (
damage: 48.0, kind: Explosive(
radius: 8.0, radius: 8,
knockback: 5.0, min_falloff: 0.0,
energy_regen: 20.0, reagent: Some(Yellow),
min_falloff: 0.0, terrain: Some((10, Black)),
),
attack: Some((
damage: 48,
knockback: Some(5),
energy: 0,
)),
), ),
projectile_body: Object(LaserBeam), projectile_body: Object(LaserBeam),
projectile_speed: 100.0, projectile_speed: 100.0,

View File

@ -2,11 +2,24 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.5, buildup_duration: 0.5,
recover_duration: 1.5, recover_duration: 1.5,
projectile: DagonBomb( projectile: (
damage: 32.0, kind: Explosive(
knockback: 15.0, radius: 5,
radius: 5.0, min_falloff: 0.1,
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_body: Object(DagonBomb),
projectile_light: None, projectile_light: None,

View File

@ -2,11 +2,19 @@ BasicRanged(
energy_cost: 0.0, energy_cost: 0.0,
buildup_duration: 0.55, buildup_duration: 0.55,
recover_duration: 0.45, recover_duration: 0.45,
projectile: Knife( projectile: (
damage: 31.0, kind: Pointed,
knockback: 5.0, attack: Some((
energy_regen: 20.0, damage: 31,
min_falloff: 0.0, knockback: Some(5),
energy: 20,
buff: Some((
kind: Bleeding,
dur_secs: 10,
strength: DamageFraction(0.1),
chance: 0.1,
)),
)),
), ),
projectile_body: Object(SpectralSwordLarge), projectile_body: Object(SpectralSwordLarge),
projectile_speed: 120.0, projectile_speed: 120.0,

View File

@ -2,12 +2,19 @@ BasicRanged(
energy_cost: 0.0, energy_cost: 0.0,
buildup_duration: 1.1, buildup_duration: 1.1,
recover_duration: 0.2, recover_duration: 0.2,
projectile: Knife( projectile: (
damage: 34.0, kind: Pointed,
radius: 3.8, attack: Some((
knockback: 5.0, damage: 34,
energy_regen: 20.0, knockback: Some(5),
min_falloff: 0.3, energy: 20,
buff: Some((
kind: Bleeding,
dur_secs: 10,
strength: DamageFraction(0.1),
chance: 0.1,
)),
)),
), ),
projectile_body: Object(SpectralSwordSmall), projectile_body: Object(SpectralSwordSmall),
projectile_speed: 20.0, projectile_speed: 20.0,

View File

@ -2,10 +2,18 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 1.75, buildup_duration: 1.75,
recover_duration: 1.75, recover_duration: 1.75,
projectile: Mine( projectile: (
damage: 25.0, kind: ExplosiveHazard(
radius: 2.0, radius: 2,
min_falloff: 0.3, min_falloff: 0.3,
reagent: Some(Yellow),
is_sticky: false,
duration: 10,
),
attack: Some((
damage: 25,
energy: 0,
)),
), ),
projectile_body: Object(Mine), projectile_body: Object(Mine),
projectile_light: None, projectile_light: None,

View File

@ -2,11 +2,18 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 1.5, buildup_duration: 1.5,
recover_duration: 2.5, recover_duration: 2.5,
projectile: ClayRocket( projectile: (
damage: 25.0, kind: Explosive(
radius: 15.0, radius: 15,
knockback: 20.0, min_falloff: 0.1,
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_body: Object(Mine),
projectile_speed: 50.0, projectile_speed: 50.0,

View File

@ -2,11 +2,24 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.5, buildup_duration: 0.5,
recover_duration: 1.5, recover_duration: 1.5,
projectile: Poisonball( projectile: (
damage: 25.0, kind: Explosive(
knockback: 15.0, radius: 5,
radius: 5.0, min_falloff: 0.1,
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_body: Object(BubbleBomb),
projectile_light: None, projectile_light: None,

View File

@ -2,11 +2,23 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.5, buildup_duration: 0.5,
recover_duration: 1.5, recover_duration: 1.5,
projectile: Fireball( projectile: (
damage: 32.0, kind: Explosive(
radius: 5.0, radius: 5,
energy_regen: 5.0, min_falloff: 0.1,
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_body: Object(BoltFire),
projectile_light: None, projectile_light: None,

View File

@ -2,11 +2,16 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.5, buildup_duration: 0.5,
recover_duration: 1.5, recover_duration: 1.5,
projectile: Frostball( projectile: (
damage: 32.0, kind: Explosive(
radius: 5.0, radius: 5,
energy_regen: 5.0, min_falloff: 0.1,
min_falloff: 0.1, reagent: Some(White),
),
attack: Some((
damage: 32,
energy: 0,
)),
), ),
projectile_body: Object(SpearIcicle), projectile_body: Object(SpearIcicle),
projectile_light: None, projectile_light: None,

View File

@ -2,11 +2,25 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.5, buildup_duration: 0.5,
recover_duration: 0.9, recover_duration: 0.9,
projectile: IceBomb( projectile: (
damage: 30.0, kind: Explosive(
radius: 3.0, radius: 3,
knockback: 12.0, min_falloff: 0.1,
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_body: Object(IceBomb),
projectile_speed: 40.0, projectile_speed: 40.0,

View File

@ -2,11 +2,18 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 1.2, buildup_duration: 1.2,
recover_duration: 1.0, recover_duration: 1.0,
projectile: ClayRocket( projectile: (
damage: 75.0, kind: Explosive(
knockback: 18.0, radius: 5,
radius: 5.0, min_falloff: 0.75,
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_body: Object(ClayRocket),
projectile_light: None, projectile_light: None,

View File

@ -2,11 +2,24 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.75, buildup_duration: 0.75,
recover_duration: 1.6, recover_duration: 1.6,
projectile: ExplodingPumpkin( projectile: (
damage: 37.5, kind: Explosive(
knockback: 25.0, radius: 5,
radius: 5.0, min_falloff: 0.6,
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_body: Object(Pumpkin),
projectile_light: None, projectile_light: None,

View File

@ -2,10 +2,16 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 1.0, buildup_duration: 1.0,
recover_duration: 0.6, recover_duration: 0.6,
projectile: Frostball( projectile: (
damage: 35.0, kind: Explosive(
radius: 4.0, radius: 4,
min_falloff: 0.1, min_falloff: 0.1,
reagent: Some(White),
),
attack: Some((
damage: 35,
energy: 0,
)),
), ),
projectile_body: Object(IceBomb), projectile_body: Object(IceBomb),
projectile_speed: 25.0, projectile_speed: 25.0,

View File

@ -2,10 +2,18 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.3, buildup_duration: 0.3,
recover_duration: 0.5, recover_duration: 0.5,
projectile: Mine( projectile: (
damage: 25.0, kind: ExplosiveHazard(
radius: 5.0, radius: 5,
min_falloff: 0.75, min_falloff: 0.75,
reagent: Some(Yellow),
is_sticky: false,
duration: 10,
),
attack: Some((
damage: 25,
energy: 0,
)),
), ),
projectile_body: Object(IronPikeBomb), projectile_body: Object(IronPikeBomb),
projectile_light: None, projectile_light: None,

View File

@ -2,11 +2,22 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 1.5, buildup_duration: 1.5,
recover_duration: 1.0, recover_duration: 1.0,
projectile: Magicball( projectile: (
damage: 22.0, kind: Explosive(
radius: 3.0, radius: 3,
energy_regen: 0, min_falloff: 0.5,
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_body: Object(FireworkGreen),
projectile_speed: 25.0, projectile_speed: 25.0,

View File

@ -2,17 +2,18 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 1.6, buildup_duration: 1.6,
recover_duration: 0.7, recover_duration: 0.7,
projectile: NecroticSphere( projectile: (
damage: 26.0, kind: Explosive(
radius: 3.0, radius: 3,
energy_regen: 0, min_falloff: 0.5,
min_falloff: 0.5, reagent: Some(Purple),
),
attack: Some((
damage: 26,
energy: 0,
)),
), ),
projectile_body: Object(FireworkPurple), projectile_body: Object(FireworkPurple),
/*projectile_light: Some(LightEmitter {
col: (1.0, 0.75, 0.11).into(),
..Default::default()
}),*/
projectile_speed: 70.0, projectile_speed: 70.0,
num_projectiles: 3, num_projectiles: 3,
projectile_spread: 0.2, projectile_spread: 0.2,

View File

@ -1,12 +1,17 @@
BasicRanged( BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 1.00, buildup_duration: 1.0,
recover_duration: 0.70, recover_duration: 0.7,
projectile: NecroticSphere( projectile: (
damage: 50, kind: Explosive(
radius: 7.0, radius: 7,
min_falloff: 0.2, min_falloff: 0.2,
energy_regen: 40, reagent: Some(Purple),
),
attack: Some((
damage: 50,
energy: 40,
)),
), ),
projectile_body: Object(FireworkPurple), projectile_body: Object(FireworkPurple),
projectile_speed: 100.0, projectile_speed: 100.0,

View File

@ -2,17 +2,18 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 1.6, buildup_duration: 1.6,
recover_duration: 0.7, recover_duration: 0.7,
projectile: NecroticSphere( projectile: (
damage: 26.0, kind: Explosive(
radius: 5.0, radius: 5,
energy_regen: 0, min_falloff: 0.5,
min_falloff: 0.5, reagent: Some(Purple),
),
attack: Some((
damage: 26,
energy: 0,
)),
), ),
projectile_body: Object(FireworkPurple), projectile_body: Object(FireworkPurple),
/*projectile_light: Some(LightEmitter {
col: (1.0, 0.75, 0.11).into(),
..Default::default()
}),*/
projectile_speed: 70.0, projectile_speed: 70.0,
num_projectiles: 1, num_projectiles: 1,
projectile_spread: 0.0, projectile_spread: 0.0,

View File

@ -2,11 +2,23 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.5, buildup_duration: 0.5,
recover_duration: 1.5, recover_duration: 1.5,
projectile: InkBomb( projectile: (
damage: 32.0, kind: Explosive(
radius: 5.0, radius: 5,
energy_regen: 5.0, min_falloff: 0.1,
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_body: Object(SpitPoison),
projectile_light: None, projectile_light: None,

View File

@ -2,10 +2,19 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 1.0, buildup_duration: 1.0,
recover_duration: 2.5, recover_duration: 2.5,
projectile: Arrow( projectile: (
damage: 25.0, kind: Pointed,
knockback: 12.0, attack: Some((
energy_regen: 4.0, 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_body: Object(BoltBesieger),
projectile_light: None, projectile_light: None,

View File

@ -2,12 +2,23 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 1.0, buildup_duration: 1.0,
recover_duration: 1.5, recover_duration: 1.5,
projectile: DemolisherBomb( projectile: (
damage: 30.0, kind: Explosive(
radius: 10.0, radius: 10,
min_falloff: 0.5, min_falloff: 0.5,
energy_regen: 0, reagent: Some(Yellow),
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_body: Object(TerracottaDemolisherBomb),
projectile_light: None, projectile_light: None,

View File

@ -2,12 +2,23 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 1.0, buildup_duration: 1.0,
recover_duration: 1.5, recover_duration: 1.5,
projectile: DemolisherBomb( projectile: (
damage: 30.0, kind: Explosive(
radius: 10.0, radius: 10,
min_falloff: 0.5, min_falloff: 0.5,
energy_regen: 0, reagent: Some(Yellow),
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_body: Object(TerracottaDemolisherBomb),
projectile_light: None, projectile_light: None,

View File

@ -2,12 +2,18 @@ BasicRanged(
energy_cost: 0.0, energy_cost: 0.0,
buildup_duration: 1.5, buildup_duration: 1.5,
recover_duration: 1.5, recover_duration: 1.5,
projectile: LaserBeam( projectile: (
damage: 50.0, kind: Explosive(
radius: 20.0, radius: 20,
knockback: 50.0, min_falloff: 0.0,
energy_regen: 0.0, reagent: Some(Yellow),
min_falloff: 0.0, terrain: Some((10, Black)),
),
attack: Some((
damage: 50,
knockback: Some(50),
energy: 0,
)),
), ),
projectile_body: Object(LaserBeamSmall), projectile_body: Object(LaserBeamSmall),
projectile_speed: 45.0, projectile_speed: 45.0,

View File

@ -2,10 +2,19 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 1.2, buildup_duration: 1.2,
recover_duration: 0.5, recover_duration: 0.5,
projectile: Arrow( projectile: (
damage: 30.0, kind: Pointed,
knockback: 5.0, attack: Some((
energy_regen: 10.0, 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_body: Object(ArrowTurret),
projectile_light: None, projectile_light: None,

View File

@ -2,12 +2,24 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.5, buildup_duration: 0.5,
recover_duration: 1.5, recover_duration: 1.5,
projectile: Poisonball( projectile: (
damage: 32.0, kind: Explosive(
radius: 5.0, radius: 5,
knockback: 10.0, min_falloff: 0.1,
energy_regen: 5.0, reagent: Some(Purple),
min_falloff: 0.1, 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_body: Object(SpitPoison),
projectile_light: None, projectile_light: None,

View File

@ -2,16 +2,18 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.5, buildup_duration: 0.5,
recover_duration: 1.4, recover_duration: 1.4,
projectile: Frostball( projectile: (
damage: 24.0, kind: Explosive(
radius: 5.0, radius: 5,
min_falloff: 0.5, min_falloff: 0.5,
reagent: Some(White),
),
attack: Some((
damage: 24,
energy: 0,
)),
), ),
projectile_body: Object(BoltIcicle), projectile_body: Object(BoltIcicle),
/*projectile_light: Some(LightEmitter {
col: (1.0, 0.75, 0.11).into(),
..Default::default()
}),*/
projectile_speed: 60.0, projectile_speed: 60.0,
num_projectiles: 1, num_projectiles: 1,
projectile_spread: 0.0, projectile_spread: 0.0,

View File

@ -2,10 +2,18 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.75, buildup_duration: 0.75,
recover_duration: 1.8, recover_duration: 1.8,
projectile: Snowball( projectile: (
damage: 35.0, kind: ExplosiveHazard(
radius: 5.0, radius: 5,
min_falloff: 0.7, min_falloff: 0.7,
reagent: Some(White),
is_sticky: false,
duration: 120,
),
attack: Some((
damage: 35,
energy: 0,
)),
), ),
projectile_body: Object(Snowball), projectile_body: Object(Snowball),
projectile_speed: 60.0, projectile_speed: 60.0,

View File

@ -2,12 +2,10 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.001, buildup_duration: 0.001,
recover_duration: 0.01, recover_duration: 0.01,
projectile: Possess, projectile: (
kind: Possess,
),
projectile_body: Object(ArrowSnake), projectile_body: Object(ArrowSnake),
/*projectile_light: Some(LightEmitter {
col: (0.0, 1.0, 0.33).into(),
..Default::default()
}),*/
projectile_speed: 100.0, projectile_speed: 100.0,
num_projectiles: 1, num_projectiles: 1,
projectile_spread: 0.0, projectile_spread: 0.0,

View File

@ -2,10 +2,18 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.75, buildup_duration: 0.75,
recover_duration: 0.45, recover_duration: 0.45,
projectile: Arrow( projectile: (
damage: 4, kind: Pointed,
knockback: 0, attack: Some((
energy_regen: 0, damage: 4,
energy: 0,
buff: Some((
kind: Bleeding,
dur_secs: 10,
strength: DamageFraction(0.1),
chance: 0.1,
)),
)),
), ),
projectile_body: Object(Dart), projectile_body: Object(Dart),
projectile_light: None, projectile_light: None,

View File

@ -2,11 +2,23 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.825, buildup_duration: 0.825,
recover_duration: 0.6, recover_duration: 0.6,
projectile: Fireball( projectile: (
damage: 13.5, kind: Explosive(
radius: 2.0, radius: 2,
energy_regen: 10.0, min_falloff: 0.5,
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_body: Object(BoltFire),
projectile_speed: 25, projectile_speed: 25,

View File

@ -2,10 +2,19 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 1.3, buildup_duration: 1.3,
recover_duration: 1.2, recover_duration: 1.2,
projectile: Arrow( projectile: (
damage: 25, kind: Pointed,
knockback: 8.0, attack: Some((
energy_regen: 0, 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_body: Object(ArrowClay),
projectile_light: None, projectile_light: None,

View File

@ -2,11 +2,18 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 2.4, buildup_duration: 2.4,
recover_duration: 0.6, recover_duration: 0.6,
projectile: ClayRocket( projectile: (
damage: 30, kind: Explosive(
knockback: 10.0, radius: 5,
radius: 5.0, min_falloff: 0.75,
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_body: Object(GrenadeClay),
projectile_light: None, projectile_light: None,

View File

@ -2,11 +2,23 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.35, buildup_duration: 0.35,
recover_duration: 0.4, recover_duration: 0.4,
projectile: Fireball( projectile: (
damage: 12.0, kind: Explosive(
radius: 3.0, radius: 3,
energy_regen: 12.0, min_falloff: 0.5,
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_body: Object(BoltFire),
projectile_speed: 60.0, projectile_speed: 60.0,

View File

@ -2,17 +2,25 @@ BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.5, buildup_duration: 0.5,
recover_duration: 0.35, recover_duration: 0.35,
projectile: Fireball( projectile: (
damage: 6.0, kind: Explosive(
radius: 5.0, radius: 5,
energy_regen: 5.0, min_falloff: 0.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_body: Object(BoltFire),
/*projectile_light: Some(LightEmitter {
col: (1.0, 0.75, 0.11).into(),
..Default::default()
}),*/
projectile_speed: 60.0, projectile_speed: 60.0,
num_projectiles: 1, num_projectiles: 1,
projectile_spread: 0.0, projectile_spread: 0.0,

View File

@ -904,12 +904,7 @@ pub enum CharacterAbility {
ChargedRanged { ChargedRanged {
energy_cost: f32, energy_cost: f32,
energy_drain: f32, energy_drain: f32,
initial_regen: f32, projectile: ProjectileConstructor,
scaled_regen: f32,
initial_damage: f32,
scaled_damage: f32,
initial_knockback: f32,
scaled_knockback: f32,
buildup_duration: f32, buildup_duration: f32,
charge_duration: f32, charge_duration: f32,
recover_duration: f32, recover_duration: f32,
@ -1329,7 +1324,7 @@ impl CharacterAbility {
} => { } => {
*buildup_duration /= stats.speed; *buildup_duration /= stats.speed;
*recover_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; *projectile_speed *= stats.range;
*energy_cost /= stats.energy_efficiency; *energy_cost /= stats.energy_efficiency;
}, },
@ -1352,7 +1347,7 @@ impl CharacterAbility {
*buildup_duration /= stats.speed; *buildup_duration /= stats.speed;
*shoot_duration /= stats.speed; *shoot_duration /= stats.speed;
*recover_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; *projectile_speed *= stats.range;
*energy_cost /= stats.energy_efficiency; *energy_cost /= stats.energy_efficiency;
}, },
@ -1533,12 +1528,7 @@ impl CharacterAbility {
ChargedRanged { ChargedRanged {
ref mut energy_cost, ref mut energy_cost,
ref mut energy_drain, ref mut energy_drain,
initial_regen: _, ref mut projectile,
scaled_regen: _,
ref mut initial_damage,
ref mut scaled_damage,
initial_knockback: _,
scaled_knockback: _,
ref mut buildup_duration, ref mut buildup_duration,
ref mut charge_duration, ref mut charge_duration,
ref mut recover_duration, ref mut recover_duration,
@ -1550,8 +1540,7 @@ impl CharacterAbility {
move_speed: _, move_speed: _,
meta: _, meta: _,
} => { } => {
*initial_damage *= stats.power; *projectile = projectile.adjusted_by_stats(stats);
*scaled_damage *= stats.power;
*buildup_duration /= stats.speed; *buildup_duration /= stats.speed;
*charge_duration /= stats.speed; *charge_duration /= stats.speed;
*recover_duration /= stats.speed; *recover_duration /= stats.speed;
@ -2009,12 +1998,7 @@ impl CharacterAbility {
let projectile_speed_modifier = SKILL_MODIFIERS.bow_tree.universal.projectile_speed; let projectile_speed_modifier = SKILL_MODIFIERS.bow_tree.universal.projectile_speed;
match self { match self {
CharacterAbility::ChargedRanged { CharacterAbility::ChargedRanged {
ref mut initial_damage, ref mut projectile,
ref mut scaled_damage,
ref mut initial_regen,
ref mut scaled_regen,
ref mut initial_knockback,
ref mut scaled_knockback,
ref mut move_speed, ref mut move_speed,
ref mut initial_projectile_speed, ref mut initial_projectile_speed,
ref mut scaled_projectile_speed, ref mut scaled_projectile_speed,
@ -2028,19 +2012,16 @@ impl CharacterAbility {
*scaled_projectile_speed *= projectile_speed_scaling; *scaled_projectile_speed *= projectile_speed_scaling;
} }
if let Ok(level) = skillset.skill_level(Bow(CDamage)) { if let Ok(level) = skillset.skill_level(Bow(CDamage)) {
let damage_scaling = modifiers.damage_scaling.powi(level.into()); let power = modifiers.damage_scaling.powi(level.into());
*initial_damage *= damage_scaling; *projectile = projectile.legacy_modified_by_skills(power, 1_f32, 1_f32, 1_f32);
*scaled_damage *= damage_scaling;
} }
if let Ok(level) = skillset.skill_level(Bow(CRegen)) { if let Ok(level) = skillset.skill_level(Bow(CRegen)) {
let regen_scaling = modifiers.regen_scaling.powi(level.into()); let regen = modifiers.regen_scaling.powi(level.into());
*initial_regen *= regen_scaling; *projectile = projectile.legacy_modified_by_skills(1_f32, regen, 1_f32, 1_f32);
*scaled_regen *= regen_scaling;
} }
if let Ok(level) = skillset.skill_level(Bow(CKnockback)) { if let Ok(level) = skillset.skill_level(Bow(CKnockback)) {
let knockback_scaling = modifiers.knockback_scaling.powi(level.into()); let kb = modifiers.knockback_scaling.powi(level.into());
*initial_knockback *= knockback_scaling; *projectile = projectile.legacy_modified_by_skills(1_f32, 1_f32, 1_f32, kb);
*scaled_knockback *= knockback_scaling;
} }
if let Ok(level) = skillset.skill_level(Bow(CSpeed)) { if let Ok(level) = skillset.skill_level(Bow(CSpeed)) {
let charge_time = 1.0 / modifiers.charge_rate; let charge_time = 1.0 / modifiers.charge_rate;
@ -2063,7 +2044,7 @@ impl CharacterAbility {
} }
if let Ok(level) = skillset.skill_level(Bow(RDamage)) { if let Ok(level) = skillset.skill_level(Bow(RDamage)) {
let power = modifiers.power.powi(level.into()); 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)) { if let Ok(level) = skillset.skill_level(Bow(RCost)) {
*energy_cost *= modifiers.energy_cost.powi(level.into()); *energy_cost *= modifiers.energy_cost.powi(level.into());
@ -2086,7 +2067,7 @@ impl CharacterAbility {
} }
if let Ok(level) = skillset.skill_level(Bow(SDamage)) { if let Ok(level) = skillset.skill_level(Bow(SDamage)) {
let power = modifiers.power.powi(level.into()); 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)) { if let Ok(level) = skillset.skill_level(Bow(SCost)) {
*energy_cost *= modifiers.energy_cost.powi(level.into()); *energy_cost *= modifiers.energy_cost.powi(level.into());
@ -2117,7 +2098,7 @@ impl CharacterAbility {
let power = modifiers.power.powi(damage_level.into()); let power = modifiers.power.powi(damage_level.into());
let regen = modifiers.regen.powi(regen_level.into()); let regen = modifiers.regen.powi(regen_level.into());
let range = modifiers.range.powi(range_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 { CharacterAbility::BasicBeam {
ref mut damage, ref mut damage,
@ -2564,12 +2545,7 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState {
CharacterAbility::ChargedRanged { CharacterAbility::ChargedRanged {
energy_cost: _, energy_cost: _,
energy_drain, energy_drain,
initial_regen, projectile,
scaled_regen,
initial_damage,
scaled_damage,
initial_knockback,
scaled_knockback,
buildup_duration, buildup_duration,
charge_duration, charge_duration,
recover_duration, recover_duration,
@ -2586,12 +2562,7 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState {
charge_duration: Duration::from_secs_f32(*charge_duration), charge_duration: Duration::from_secs_f32(*charge_duration),
recover_duration: Duration::from_secs_f32(*recover_duration), recover_duration: Duration::from_secs_f32(*recover_duration),
energy_drain: *energy_drain, energy_drain: *energy_drain,
initial_regen: *initial_regen, projectile: *projectile,
scaled_regen: *scaled_regen,
initial_damage: *initial_damage,
scaled_damage: *scaled_damage,
initial_knockback: *initial_knockback,
scaled_knockback: *scaled_knockback,
projectile_body: *projectile_body, projectile_body: *projectile_body,
projectile_light: *projectile_light, projectile_light: *projectile_light,
initial_projectile_speed: *initial_projectile_speed, initial_projectile_speed: *initial_projectile_speed,

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,5 @@
use crate::{combat::Attack, comp::item::Reagent, effect::Effect}; use crate::{combat::Attack, comp::item::Reagent, effect::Effect};
use rand::{thread_rng, Rng};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use vek::Rgb; use vek::Rgb;
@ -16,3 +17,27 @@ pub enum RadiusEffect {
Entity(Effect), Entity(Effect),
Attack(Attack), Attack(Attack),
} }
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
pub enum ColorPreset {
Black,
InkBomb,
IceBomb,
}
impl ColorPreset {
pub fn to_rgb(&self) -> Rgb<f32> {
match self {
Self::Black => Rgb::black(),
Self::InkBomb => Rgb::new(4.0, 7.0, 32.0),
Self::IceBomb => {
let variation = thread_rng().gen::<f32>();
Rgb::new(
83.0 - (20.0 * variation),
212.0 - (52.0 * variation),
255.0 - (62.0 * variation),
)
},
}
}
}

View File

@ -110,11 +110,9 @@ impl CharacterBehavior for Data {
if !self.exhausted { if !self.exhausted {
// Fire // Fire
let precision_mult = combat::compute_precision_mult(data.inventory, data.msm); 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( let projectile = self.static_data.projectile.create_projectile(
Some(*data.uid), Some(*data.uid),
precision_mult, precision_mult,
tool_stats,
self.static_data.damage_effect, self.static_data.damage_effect,
); );
// Shoots all projectiles simultaneously // Shoots all projectiles simultaneously

View File

@ -24,19 +24,8 @@ pub struct StaticData {
pub recover_duration: Duration, pub recover_duration: Duration,
/// How much energy is drained per second when charging /// How much energy is drained per second when charging
pub energy_drain: f32, 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 /// Projectile information
pub projectile: ProjectileConstructor,
pub projectile_body: Body, pub projectile_body: Body,
pub projectile_light: Option<LightEmitter>, pub projectile_light: Option<LightEmitter>,
pub initial_projectile_speed: f32, pub initial_projectile_speed: f32,
@ -101,28 +90,22 @@ impl CharacterBehavior for Data {
StageSection::Charge => { StageSection::Charge => {
if !input_is_pressed(data, self.static_data.ability_info.input) && !self.exhausted { if !input_is_pressed(data, self.static_data.ability_info.input) && !self.exhausted {
let charge_frac = self.charge_frac(); 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 // Fire
let precision_mult = combat::compute_precision_mult(data.inventory, data.msm); 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 // Gets offsets
let body_offsets = data let body_offsets = data
.body .body
.projectile_offsets(update.ori.look_vec(), data.scale.map_or(1.0, |s| s.0)); .projectile_offsets(update.ori.look_vec(), data.scale.map_or(1.0, |s| s.0));
let pos = Pos(data.pos.0 + body_offsets); let pos = Pos(data.pos.0 + body_offsets);
let projectile = arrow.create_projectile( let projectile = self
Some(*data.uid), .static_data
precision_mult, .projectile
tool_stats, .handle_scaling(charge_frac)
self.static_data.damage_effect, .create_projectile(
); Some(*data.uid),
precision_mult,
self.static_data.damage_effect,
);
output_events.emit_server(ShootEvent { output_events.emit_server(ShootEvent {
entity: data.entity, entity: data.entity,
pos, pos,

View File

@ -107,7 +107,6 @@ impl CharacterBehavior for Data {
{ {
// Fire if input is pressed still // Fire if input is pressed still
let precision_mult = combat::compute_precision_mult(data.inventory, data.msm); 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 // Gets offsets
let pos: Pos = self.static_data.properties_of_aoe.as_ref().map_or_else( 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( let projectile = self.static_data.projectile.create_projectile(
Some(*data.uid), Some(*data.uid),
precision_mult, precision_mult,
tool_stats,
self.static_data.damage_effect, self.static_data.damage_effect,
); );
output_events.emit_server(ShootEvent { output_events.emit_server(ShootEvent {

View File

@ -22,7 +22,7 @@ use common::{
ConsumableKind, Effects, Item, ItemDesc, ItemKind, ConsumableKind, Effects, Item, ItemDesc, ItemKind,
}, },
item_drop, item_drop,
projectile::ProjectileConstructor, projectile::ProjectileConstructorKind,
Agent, Alignment, Body, CharacterState, Content, ControlAction, ControlEvent, Controller, Agent, Alignment, Body, CharacterState, Content, ControlAction, ControlEvent, Controller,
HealthChange, InputKind, InventoryAction, Pos, Scale, UnresolvedChatMsg, UtteranceKind, HealthChange, InputKind, InventoryAction, Pos, Scale, UnresolvedChatMsg, UtteranceKind,
}, },
@ -1271,14 +1271,11 @@ impl<'a> AgentData<'a> {
) )
}, },
CharacterState::BasicRanged(c) => { CharacterState::BasicRanged(c) => {
let offset_z = match c.static_data.projectile { let offset_z = match c.static_data.projectile.kind {
// Aim fireballs at feet instead of eyes for splash damage // Aim explosives and hazards at feet instead of eyes for splash damage
ProjectileConstructor::Fireball { ProjectileConstructorKind::Explosive { .. }
damage: _, | ProjectileConstructorKind::ExplosiveHazard { .. }
radius: _, | ProjectileConstructorKind::Hazard { .. } => 0.0,
energy_regen: _,
min_falloff: _,
} => 0.0,
_ => tgt_eye_offset, _ => tgt_eye_offset,
}; };
let projectile_speed = c.static_data.projectile_speed; let projectile_speed = c.static_data.projectile_speed;

View File

@ -1,5 +1,5 @@
use common::{ use common::{
comp::{item::tool, object, Body, LightEmitter, PhysicsState, Pos, ProjectileConstructor}, comp::{object, Body, LightEmitter, PhysicsState, Pos, ProjectileConstructor},
event::{EmitExt, ShootEvent}, event::{EmitExt, ShootEvent},
terrain::{Block, TerrainChunkSize}, terrain::{Block, TerrainChunkSize},
util::Dir, util::Dir,
@ -188,12 +188,7 @@ impl WiringAction {
pos, pos,
dir: Dir::forward(), dir: Dir::forward(),
body: Body::Object(object::Body::Arrow), body: Body::Object(object::Body::Arrow),
projectile: constr.create_projectile( projectile: constr.create_projectile(None, 1.0, None),
None,
1.0,
tool::Stats::one(),
None,
),
light: None, light: None,
speed: 5.0, speed: 5.0,
object: None, object: None,