3 attacks done

This commit is contained in:
Sam 2021-06-09 21:04:19 -05:00
parent 46e93ba563
commit 879aafad5c
11 changed files with 167 additions and 10 deletions

View File

@ -257,6 +257,14 @@
(None, "common.abilities.custom.yeti.snowball"),
],
),
Custom("Harvester"): (
primary: "common.abilities.custom.harvester.scythe",
secondary: "common.abilities.custom.harvester.firebreath",
abilities: [
(None, "common.abilities.custom.harvester.ensnaringvines"),
(None, "common.abilities.custom.harvester.explodingpumpkin"),
],
),
Custom("Bird Large Breathe"): (
primary: "common.abilities.custom.birdlargebreathe.firebomb",
secondary: "common.abilities.custom.birdlargebreathe.triplestrike",

View File

@ -6,7 +6,12 @@ BasicBeam(
tick_rate: 3.0,
range: 15.0,
max_angle: 22.5,
damage_effect: None,
damage_effect: Some(Buff((
kind: Burning,
dur_secs: 10.0,
strength: DamageFraction(0.5),
chance: 0.25,
))),
energy_regen: 0,
energy_drain: 0,
orientation_behavior: Normal,

View File

@ -6,7 +6,12 @@ BasicBeam(
tick_rate: 3.0,
range: 15.0,
max_angle: 22.5,
damage_effect: None,
damage_effect: Some(Buff((
kind: Burning,
dur_secs: 10.0,
strength: DamageFraction(0.5),
chance: 0.25,
))),
energy_regen: 0,
energy_drain: 0,
orientation_behavior: Normal,

View File

@ -0,0 +1,15 @@
BasicRanged(
energy_cost: 0,
buildup_duration: 0.5,
recover_duration: 0.8,
projectile: ExplodingPumpkin(
damage: 500.0,
knockback: 25.0,
radius: 10.0,
),
projectile_body: Object(Pumpkin),
projectile_light: None,
projectile_speed: 30.0,
num_projectiles: 1,
projectile_spread: 0.0,
)

View File

@ -0,0 +1,15 @@
BasicRanged(
energy_cost: 0,
buildup_duration: 0.5,
recover_duration: 0.8,
projectile: ExplodingPumpkin(
damage: 500.0,
knockback: 25.0,
radius: 10.0,
),
projectile_body: Object(Pumpkin),
projectile_light: None,
projectile_speed: 30.0,
num_projectiles: 1,
projectile_spread: 0.0,
)

View File

@ -0,0 +1,19 @@
BasicBeam(
buildup_duration: 0.5,
recover_duration: 0.5,
beam_duration: 1.0,
damage: 35,
tick_rate: 3.0,
range: 20.0,
max_angle: 15.0,
damage_effect: Some(Buff((
kind: Burning,
dur_secs: 10.0,
strength: DamageFraction(0.5),
chance: 0.25,
))),
energy_regen: 0,
energy_drain: 0,
orientation_behavior: Normal,
specifier: Flamethrower,
)

View File

@ -0,0 +1,13 @@
BasicMelee(
energy_cost: 0,
buildup_duration: 0.6,
swing_duration: 0.1,
recover_duration: 0.5,
base_damage: 60,
base_poise_damage: 10,
knockback: ( strength: 10.0, direction: Away),
range: 4.0,
max_angle: 60.0,
damage_effect: None,
damage_kind: Slashing,
)

View File

@ -6,7 +6,12 @@ BasicBeam(
tick_rate: 3.0,
range: 15.0,
max_angle: 22.5,
damage_effect: None,
damage_effect: Some(Buff((
kind: Burning,
dur_secs: 10.0,
strength: DamageFraction(0.5),
chance: 0.25,
))),
energy_regen: 0,
energy_drain: 0,
orientation_behavior: Normal,

View File

@ -6,7 +6,12 @@ BasicBeam(
tick_rate: 3.0,
range: 20.0,
max_angle: 15.0,
damage_effect: None,
damage_effect: Some(Buff((
kind: Burning,
dur_secs: 10.0,
strength: DamageFraction(0.5),
chance: 0.25,
))),
energy_regen: 0,
energy_drain: 350,
orientation_behavior: Normal,

View File

@ -2,11 +2,11 @@ ItemDef(
name: "Harvester Sythe",
description: "Placeholder",
kind: Tool((
kind: Hammer,
kind: Natural,
hands: Two,
stats: Direct((
equip_time_secs: 0.001,
power: 1.6,
power: 1.0,
poise_strength: 1.0,
speed: 1.0,
crit_chance: 0.05078125,
@ -14,5 +14,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_spec: Some(Custom("Hammer Simple")),
ability_spec: Some(Custom("Harvester")),
)

View File

@ -1,9 +1,9 @@
use crate::{
combat::{
Attack, AttackDamage, AttackEffect, CombatBuff, CombatEffect, CombatRequirement, Damage,
DamageKind, DamageSource, GroupTarget, Knockback, KnockbackDir,
Attack, AttackDamage, AttackEffect, CombatBuff, CombatBuffStrength, CombatEffect,
CombatRequirement, Damage, DamageKind, DamageSource, GroupTarget, Knockback, KnockbackDir,
},
comp::item::Reagent,
comp::{buff::BuffKind, item::Reagent},
uid::Uid,
Explosion, RadiusEffect,
};
@ -72,6 +72,11 @@ pub enum ProjectileConstructor {
damage: f32,
radius: f32,
},
ExplodingPumpkin {
damage: f32,
radius: f32,
knockback: f32,
},
}
impl ProjectileConstructor {
@ -298,6 +303,60 @@ impl ProjectileConstructor {
is_point: false,
}
},
ExplodingPumpkin {
damage,
radius,
knockback,
} => {
let knockback = AttackEffect::new(
Some(GroupTarget::OutOfGroup),
CombatEffect::Knockback(Knockback {
strength: knockback,
direction: KnockbackDir::Away,
}),
)
.with_requirement(CombatRequirement::AnyDamage);
let buff = AttackEffect::new(
Some(GroupTarget::OutOfGroup),
CombatEffect::Buff(CombatBuff {
kind: BuffKind::Burning,
dur_secs: 5.0,
strength: CombatBuffStrength::DamageFraction(0.2),
chance: 1.0,
}),
)
.with_requirement(CombatRequirement::AnyDamage);
let damage = AttackDamage::new(
Damage {
source: DamageSource::Explosion,
kind: DamageKind::Energy,
value: damage,
},
Some(GroupTarget::OutOfGroup),
);
let attack = Attack::default()
.with_damage(damage)
.with_crit(crit_chance, crit_mult)
.with_effect(knockback)
.with_effect(buff);
let explosion = Explosion {
effects: vec![
RadiusEffect::Attack(attack),
RadiusEffect::TerrainDestruction(5.0),
],
radius,
reagent: Some(Reagent::Red),
};
Projectile {
hit_solid: vec![Effect::Explode(explosion.clone()), Effect::Vanish],
hit_entity: vec![Effect::Explode(explosion), Effect::Vanish],
time_left: Duration::from_secs(10),
owner,
ignore_group: true,
is_sticky: true,
is_point: true,
}
},
}
}
@ -354,6 +413,14 @@ impl ProjectileConstructor {
*damage *= power;
*radius *= range;
},
ExplodingPumpkin {
ref mut damage,
ref mut radius,
..
} => {
*damage *= power;
*radius *= range;
},
}
self
}