Merge branch 'juliancoffee/clay_golem_tweak' into 'master'

clay golem tweak

See merge request veloren/veloren!2478
This commit is contained in:
Samuel Keiffer 2021-06-19 14:49:11 +00:00
commit e7f54d6306
22 changed files with 63 additions and 37 deletions

View File

@ -17,8 +17,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Entity-entity pushback is no longer applied in forced movement states like rolling and leaping. - Entity-entity pushback is no longer applied in forced movement states like rolling and leaping.
- Updated audio library (rodio 0.13 -> 0.14). - Updated audio library (rodio 0.13 -> 0.14).
- Improve entity-terrain physics performance by reducing the number of voxel lookups. - Improve entity-terrain physics performance by reducing the number of voxel lookups.
- Clay Golem uses shockwave only after specific fraction of health and other difficulty adjustments.
### Removed ### Removed
- Enemies no more spawn in dungeon boss room
### Fixed ### Fixed
- Crafting Stations aren't exploadable anymore - Crafting Stations aren't exploadable anymore

View File

@ -15,5 +15,6 @@ BasicBeam(
energy_regen: 0, energy_regen: 0,
energy_drain: 0, energy_drain: 0,
orientation_behavior: Normal, orientation_behavior: Normal,
ori_rate: 0.6,
specifier: Cultist, specifier: Cultist,
) )

View File

@ -10,5 +10,6 @@ BasicBeam(
energy_regen: 0, energy_regen: 0,
energy_drain: 0, energy_drain: 0,
orientation_behavior: Normal, orientation_behavior: Normal,
ori_rate: 0.6,
specifier: Flamethrower, specifier: Flamethrower,
) )

View File

@ -10,5 +10,6 @@ BasicBeam(
energy_regen: 0, energy_regen: 0,
energy_drain: 0, energy_drain: 0,
orientation_behavior: Normal, orientation_behavior: Normal,
ori_rate: 0.6,
specifier: Flamethrower, specifier: Flamethrower,
) )

View File

@ -2,13 +2,19 @@ BasicBeam(
buildup_duration: 0.5, buildup_duration: 0.5,
recover_duration: 0.4, recover_duration: 0.4,
beam_duration: 0.25, beam_duration: 0.25,
damage: 100, damage: 70,
tick_rate: 2.0, tick_rate: 2.0,
range: 40.0, range: 40.0,
max_angle: 1.0, max_angle: 1.0,
damage_effect: None, damage_effect: Some(Buff((
kind: Burning,
dur_secs: 5.0,
strength: DamageFraction(0.75),
chance: 0.75,
))),
energy_regen: 50, energy_regen: 50,
energy_drain: 0, energy_drain: 0,
orientation_behavior: FromOri, orientation_behavior: FromOri,
ori_rate: 0.07,
specifier: ClayGolem, specifier: ClayGolem,
) )

View File

@ -1,11 +1,11 @@
BasicRanged( BasicRanged(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.5, buildup_duration: 0.8,
recover_duration: 0.8, recover_duration: 0.5,
projectile: ClayRocket( projectile: ClayRocket(
damage: 500.0, damage: 500.0,
knockback: 25.0, knockback: 25.0,
radius: 10.0, radius: 5.0,
), ),
projectile_body: Object(ClayRocket), projectile_body: Object(ClayRocket),
projectile_light: None, projectile_light: None,

View File

@ -1,6 +1,6 @@
Shockwave( Shockwave(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.6, buildup_duration: 1.5,
swing_duration: 0.12, swing_duration: 0.12,
recover_duration: 1.2, recover_duration: 1.2,
damage: 500, damage: 500,
@ -9,7 +9,7 @@ Shockwave(
shockwave_angle: 180.0, shockwave_angle: 180.0,
shockwave_vertical_angle: 90.0, shockwave_vertical_angle: 90.0,
shockwave_speed: 15.0, shockwave_speed: 15.0,
shockwave_duration: 2.5, shockwave_duration: 3.5,
requires_ground: true, requires_ground: true,
move_efficiency: 0.0, move_efficiency: 0.0,
damage_kind: Crushing, damage_kind: Crushing,

View File

@ -1,7 +1,7 @@
BasicMelee( BasicMelee(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.8, buildup_duration: 0.8,
swing_duration: 0.2, swing_duration: 0.1,
recover_duration: 0.5, recover_duration: 0.5,
base_damage: 200, base_damage: 200,
base_poise_damage: 50, base_poise_damage: 50,

View File

@ -15,5 +15,6 @@ BasicBeam(
energy_regen: 0, energy_regen: 0,
energy_drain: 0, energy_drain: 0,
orientation_behavior: Normal, orientation_behavior: Normal,
ori_rate: 0.6,
specifier: Cultist, specifier: Cultist,
) )

View File

@ -10,5 +10,6 @@ BasicBeam(
energy_regen: 25, energy_regen: 25,
energy_drain: 0, energy_drain: 0,
orientation_behavior: Normal, orientation_behavior: Normal,
ori_rate: 0.6,
specifier: HealingBeam, specifier: HealingBeam,
) )

View File

@ -10,5 +10,6 @@ BasicBeam(
energy_regen: 0, energy_regen: 0,
energy_drain: 0, energy_drain: 0,
orientation_behavior: Normal, orientation_behavior: Normal,
ori_rate: 0.6,
specifier: Flamethrower, specifier: Flamethrower,
) )

View File

@ -15,5 +15,6 @@ BasicBeam(
energy_regen: 0, energy_regen: 0,
energy_drain: 0, energy_drain: 0,
orientation_behavior: Normal, orientation_behavior: Normal,
ori_rate: 0.6,
specifier: Bubbles, specifier: Bubbles,
) )

View File

@ -15,5 +15,6 @@ BasicBeam(
energy_regen: 0, energy_regen: 0,
energy_drain: 0, energy_drain: 0,
orientation_behavior: Normal, orientation_behavior: Normal,
ori_rate: 0.3,
specifier: Flamethrower, specifier: Flamethrower,
) )

View File

@ -15,5 +15,6 @@ BasicBeam(
energy_regen: 0, energy_regen: 0,
energy_drain: 0, energy_drain: 0,
orientation_behavior: Normal, orientation_behavior: Normal,
ori_rate: 0.6,
specifier: Frost, specifier: Frost,
) )

View File

@ -10,5 +10,6 @@ BasicBeam(
energy_regen: 50, energy_regen: 50,
energy_drain: 0, energy_drain: 0,
orientation_behavior: Normal, orientation_behavior: Normal,
ori_rate: 0.6,
specifier: LifestealBeam specifier: LifestealBeam
) )

View File

@ -15,5 +15,6 @@ BasicBeam(
energy_regen: 0, energy_regen: 0,
energy_drain: 350, energy_drain: 350,
orientation_behavior: Normal, orientation_behavior: Normal,
ori_rate: 0.6,
specifier: Flamethrower, specifier: Flamethrower,
) )

View File

@ -10,5 +10,6 @@ BasicBeam(
energy_regen: 0, energy_regen: 0,
energy_drain: 350, energy_drain: 350,
orientation_behavior: Normal, orientation_behavior: Normal,
ori_rate: 0.6,
specifier: Flamethrower, specifier: Flamethrower,
) )

View File

@ -247,6 +247,7 @@ pub enum CharacterAbility {
energy_regen: f32, energy_regen: f32,
energy_drain: f32, energy_drain: f32,
orientation_behavior: basic_beam::OrientationBehavior, orientation_behavior: basic_beam::OrientationBehavior,
ori_rate: f32,
specifier: beam::FrontendSpecifier, specifier: beam::FrontendSpecifier,
}, },
BasicAura { BasicAura {
@ -1651,6 +1652,7 @@ impl From<(&CharacterAbility, AbilityInfo)> for CharacterState {
energy_regen, energy_regen,
energy_drain, energy_drain,
orientation_behavior, orientation_behavior,
ori_rate,
specifier, specifier,
} => CharacterState::BasicBeam(basic_beam::Data { } => CharacterState::BasicBeam(basic_beam::Data {
static_data: basic_beam::StaticData { static_data: basic_beam::StaticData {
@ -1666,6 +1668,7 @@ impl From<(&CharacterAbility, AbilityInfo)> for CharacterState {
energy_drain: *energy_drain, energy_drain: *energy_drain,
ability_info, ability_info,
orientation_behavior: *orientation_behavior, orientation_behavior: *orientation_behavior,
ori_rate: *ori_rate,
specifier: *specifier, specifier: *specifier,
}, },
timer: Duration::default(), timer: Duration::default(),

View File

@ -511,7 +511,7 @@ impl Body {
_ => 10000, _ => 10000,
}, },
Body::Golem(golem) => match golem.species { Body::Golem(golem) => match golem.species {
golem::Species::ClayGolem => 7500, golem::Species::ClayGolem => 4500,
_ => 10000, _ => 10000,
}, },
Body::Theropod(theropod) => match theropod.species { Body::Theropod(theropod) => match theropod.species {
@ -676,7 +676,7 @@ impl Body {
_ => 1.0, _ => 1.0,
}, },
Body::Golem(g) => match g.species { Body::Golem(g) => match g.species {
golem::Species::ClayGolem => 1.2, golem::Species::ClayGolem => 2.0,
_ => 1.0, _ => 1.0,
}, },
_ => 1.0, _ => 1.0,

View File

@ -40,6 +40,8 @@ pub struct StaticData {
pub energy_drain: f32, pub energy_drain: f32,
/// Used to dictate how orientation functions in this state /// Used to dictate how orientation functions in this state
pub orientation_behavior: OrientationBehavior, pub orientation_behavior: OrientationBehavior,
/// How fast enemy can rotate with beam
pub ori_rate: f32,
/// What key is used to press ability /// What key is used to press ability
pub ability_info: AbilityInfo, pub ability_info: AbilityInfo,
/// Used to specify the beam to the frontend /// Used to specify the beam to the frontend
@ -61,14 +63,10 @@ impl CharacterBehavior for Data {
fn behavior(&self, data: &JoinData) -> StateUpdate { fn behavior(&self, data: &JoinData) -> StateUpdate {
let mut update = StateUpdate::from(data); let mut update = StateUpdate::from(data);
let ori_rate = match self.static_data.orientation_behavior { let ori_rate = self.static_data.ori_rate;
OrientationBehavior::Normal => 0.6, if self.static_data.orientation_behavior == OrientationBehavior::Turret {
OrientationBehavior::Turret => {
update.ori = Ori::from(data.inputs.look_dir); update.ori = Ori::from(data.inputs.look_dir);
0.6 }
},
OrientationBehavior::FromOri => 0.1,
};
handle_orientation(data, &mut update, ori_rate); handle_orientation(data, &mut update, ori_rate);
handle_move(data, &mut update, 0.4); handle_move(data, &mut update, 0.4);

View File

@ -3477,6 +3477,9 @@ impl<'a> AgentData<'a> {
const GOLEM_LONG_RANGE: f32 = 50.0; const GOLEM_LONG_RANGE: f32 = 50.0;
const GOLEM_TARGET_SPEED: f32 = 8.0; const GOLEM_TARGET_SPEED: f32 = 8.0;
let golem_melee_range = self.body.map_or(0.0, |b| b.radius()) + GOLEM_MELEE_RANGE; let golem_melee_range = self.body.map_or(0.0, |b| b.radius()) + GOLEM_MELEE_RANGE;
// Fraction of health, used for activation of shockwave
// If golem don't have health for some reason, assume it's full
let health_fraction = self.health.map_or(1.0, |h| h.fraction());
// Magnitude squared of cross product of target velocity with golem orientation // Magnitude squared of cross product of target velocity with golem orientation
let target_speed_cross_sqd = agent let target_speed_cross_sqd = agent
.target .target
@ -3502,7 +3505,7 @@ impl<'a> AgentData<'a> {
} }
} }
} else if attack_data.dist_sqrd < GOLEM_LASER_RANGE.powi(2) { } else if attack_data.dist_sqrd < GOLEM_LASER_RANGE.powi(2) {
if matches!(self.char_state, CharacterState::BasicBeam(c) if c.timer < Duration::from_secs(10)) if matches!(self.char_state, CharacterState::BasicBeam(c) if c.timer < Duration::from_secs(5))
|| target_speed_cross_sqd < GOLEM_TARGET_SPEED.powi(2) || target_speed_cross_sqd < GOLEM_TARGET_SPEED.powi(2)
&& can_see_tgt( && can_see_tgt(
&*read_data.terrain, &*read_data.terrain,
@ -3512,13 +3515,14 @@ impl<'a> AgentData<'a> {
) )
&& attack_data.angle < 45.0 && attack_data.angle < 45.0
{ {
// If target in range threshold and haven't been lasering for more than 10 // If target in range threshold and haven't been lasering for more than 5
// seconds already or if target is moving slow-ish, laser them // seconds already or if target is moving slow-ish, laser them
controller controller
.actions .actions
.push(ControlAction::basic_input(InputKind::Secondary)); .push(ControlAction::basic_input(InputKind::Secondary));
} else { } else if health_fraction < 0.7 {
// Else target moving too fast for laser, shockwave time // Else target moving too fast for laser, shockwave time.
// But only if damaged enough
controller controller
.actions .actions
.push(ControlAction::basic_input(InputKind::Ability(0))); .push(ControlAction::basic_input(InputKind::Ability(0)));
@ -3536,8 +3540,9 @@ impl<'a> AgentData<'a> {
controller controller
.actions .actions
.push(ControlAction::basic_input(InputKind::Ability(1))); .push(ControlAction::basic_input(InputKind::Ability(1)));
} else { } else if health_fraction < 0.7 {
// Else target moving too fast for laser, shockwave time // Else target moving too fast for laser, shockwave time.
// But only if damaged enough
controller controller
.actions .actions
.push(ControlAction::basic_input(InputKind::Ability(0))); .push(ControlAction::basic_input(InputKind::Ability(0)));

View File

@ -541,7 +541,7 @@ impl Floor {
.map(|density| dynamic_rng.gen_range(0..density.recip() as usize) == 0) .map(|density| dynamic_rng.gen_range(0..density.recip() as usize) == 0)
.unwrap_or(false) .unwrap_or(false)
&& !tile_is_pillar && !tile_is_pillar
&& !(room.boss && room.difficulty == 5) && !room.boss
{ {
// Randomly displace them a little // Randomly displace them a little
let raw_entity = EntityInfo::at( let raw_entity = EntityInfo::at(