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,
buildup_duration: 0.75,
recover_duration: 0.75,
projectile: Trap(
projectile: (
kind: Hazard(
is_sticky: true,
duration: 10,
),
attack: Some((
damage: 25,
knockback: 4,
energy_regen: 0,
energy: 0,
)),
),
projectile_body: Object(AdletTrap),
projectile_light: None,

View File

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

View File

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

View File

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

View File

@ -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,

View File

@ -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,

View File

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

View File

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

View File

@ -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,
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,

View File

@ -2,18 +2,26 @@ BasicRanged(
energy_cost: 0,
buildup_duration: 1.2,
recover_duration: 0.7,
projectile: Poisonball(
damage: 58.0,
projectile: (
kind: Explosive(
radius: 3.5,
knockback: 1.0,
energy_regen: 0,
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,

View File

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

View File

@ -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,
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,

View File

@ -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,

View File

@ -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,
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,

View File

@ -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,
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,

View File

@ -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,
projectile: (
kind: Explosive(
radius: 12,
min_falloff: 0.5,
energy_regen: 0,
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(

View File

@ -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,

View File

@ -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,

View File

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

View File

@ -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,
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,

View File

@ -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,
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,

View File

@ -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,
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,

View File

@ -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,
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,

View File

@ -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,

View File

@ -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,

View File

@ -2,10 +2,18 @@ BasicRanged(
energy_cost: 0,
buildup_duration: 1.75,
recover_duration: 1.75,
projectile: Mine(
damage: 25.0,
radius: 2.0,
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,

View File

@ -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,
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,

View File

@ -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,
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,

View File

@ -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,
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,

View File

@ -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,
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,

View File

@ -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,
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,

View File

@ -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,
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,

View File

@ -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,
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,

View File

@ -2,10 +2,16 @@ BasicRanged(
energy_cost: 0,
buildup_duration: 1.0,
recover_duration: 0.6,
projectile: Frostball(
damage: 35.0,
radius: 4.0,
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,

View File

@ -2,10 +2,18 @@ BasicRanged(
energy_cost: 0,
buildup_duration: 0.3,
recover_duration: 0.5,
projectile: Mine(
damage: 25.0,
radius: 5.0,
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,

View File

@ -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,
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,

View File

@ -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,
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,

View File

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

View File

@ -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,
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,

View File

@ -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,
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,

View File

@ -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,

View File

@ -2,12 +2,23 @@ BasicRanged(
energy_cost: 0,
buildup_duration: 1.0,
recover_duration: 1.5,
projectile: DemolisherBomb(
damage: 30.0,
radius: 10.0,
projectile: (
kind: Explosive(
radius: 10,
min_falloff: 0.5,
energy_regen: 0,
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,

View File

@ -2,12 +2,23 @@ BasicRanged(
energy_cost: 0,
buildup_duration: 1.0,
recover_duration: 1.5,
projectile: DemolisherBomb(
damage: 30.0,
radius: 10.0,
projectile: (
kind: Explosive(
radius: 10,
min_falloff: 0.5,
energy_regen: 0,
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,

View File

@ -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,
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,

View File

@ -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,

View File

@ -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,
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,

View File

@ -2,16 +2,18 @@ BasicRanged(
energy_cost: 0,
buildup_duration: 0.5,
recover_duration: 1.4,
projectile: Frostball(
damage: 24.0,
radius: 5.0,
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,

View File

@ -2,10 +2,18 @@ BasicRanged(
energy_cost: 0,
buildup_duration: 0.75,
recover_duration: 1.8,
projectile: Snowball(
damage: 35.0,
radius: 5.0,
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,

View File

@ -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,

View File

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

View File

@ -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,
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,

View File

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

View File

@ -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,
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,

View File

@ -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,
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,

View File

@ -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,
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,

View File

@ -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,

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 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<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 {
// 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

View File

@ -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<LightEmitter>,
pub initial_projectile_speed: f32,
@ -101,26 +90,20 @@ 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(
let projectile = self
.static_data
.projectile
.handle_scaling(charge_frac)
.create_projectile(
Some(*data.uid),
precision_mult,
tool_stats,
self.static_data.damage_effect,
);
output_events.emit_server(ShootEvent {

View File

@ -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 {

View File

@ -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;

View File

@ -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,