diff --git a/assets/common/abilities/custom/claygolem/laser.ron b/assets/common/abilities/custom/claygolem/laser.ron index bf3d4b75a0..7c4574d9c6 100644 --- a/assets/common/abilities/custom/claygolem/laser.ron +++ b/assets/common/abilities/custom/claygolem/laser.ron @@ -2,13 +2,13 @@ BasicBeam( buildup_duration: 0.20, recover_duration: 0.20, beam_duration: 0.25, - damage: 30, - tick_rate: 5.0, + damage: 100, + tick_rate: 2.0, range: 40.0, max_angle: 1.0, damage_effect: None, energy_regen: 50, energy_drain: 0, - orientation_behavior: Normal, + orientation_behavior: FromOri, specifier: ClayGolem, ) \ No newline at end of file diff --git a/assets/common/abilities/custom/claygolem/shockwave.ron b/assets/common/abilities/custom/claygolem/shockwave.ron index 921b879e1f..61c4a77289 100644 --- a/assets/common/abilities/custom/claygolem/shockwave.ron +++ b/assets/common/abilities/custom/claygolem/shockwave.ron @@ -6,10 +6,10 @@ Shockwave( damage: 500, poise_damage: 50, knockback: (strength: 40.0, direction: TowardsUp), - shockwave_angle: 360.0, + shockwave_angle: 180.0, shockwave_vertical_angle: 90.0, shockwave_speed: 15.0, - shockwave_duration: 3.0, + shockwave_duration: 2.5, requires_ground: true, move_efficiency: 0.0, damage_kind: Crushing, diff --git a/assets/common/abilities/custom/claygolem/strike.ron b/assets/common/abilities/custom/claygolem/strike.ron index d8e2a91320..5b412456c7 100644 --- a/assets/common/abilities/custom/claygolem/strike.ron +++ b/assets/common/abilities/custom/claygolem/strike.ron @@ -6,8 +6,8 @@ BasicMelee( base_damage: 200, base_poise_damage: 50, knockback: 10.0, - range: 5.0, - max_angle: 60.0, + range: 4.0, + max_angle: 45.0, damage_effect: None, damage_kind: Crushing, ) diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index 4ff76486b2..21d9550d80 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -243,7 +243,7 @@ pub enum CharacterAbility { damage_effect: Option, energy_regen: f32, energy_drain: f32, - orientation_behavior: basic_beam::MovementBehavior, + orientation_behavior: basic_beam::OrientationBehavior, specifier: beam::FrontendSpecifier, }, BasicAura { diff --git a/common/src/comp/ori.rs b/common/src/comp/ori.rs index 3dea6afb8c..f6cc9b75c6 100644 --- a/common/src/comp/ori.rs +++ b/common/src/comp/ori.rs @@ -239,6 +239,16 @@ impl From for Ori { } } +impl From> for Ori { + fn from(dir: Vec3) -> Self { + let dir = Dir::from_unnormalized(dir).unwrap_or_default(); + let from = Dir::default(); + let q = Quaternion::::rotation_from_to_3d(*from, *dir).normalized(); + + Self(q).uprighted() + } +} + impl From> for Ori { fn from(quat: Quaternion) -> Self { Self::new(quat) } } diff --git a/common/src/comp/projectile.rs b/common/src/comp/projectile.rs index 3d277fd074..5bc5daeffb 100644 --- a/common/src/comp/projectile.rs +++ b/common/src/comp/projectile.rs @@ -228,7 +228,6 @@ impl ProjectileConstructor { source: DamageSource::Explosion, kind: DamageKind::Energy, value: damage, - kind: DamageKind::Energy, }, Some(GroupTarget::OutOfGroup), ); diff --git a/common/src/states/basic_beam.rs b/common/src/states/basic_beam.rs index f0ee1b698e..ca87e53375 100644 --- a/common/src/states/basic_beam.rs +++ b/common/src/states/basic_beam.rs @@ -39,7 +39,7 @@ pub struct StaticData { /// Energy drained per second pub energy_drain: f32, /// Used to dictate how orientation functions in this state - pub orientation_behavior: MovementBehavior, + pub orientation_behavior: OrientationBehavior, /// What key is used to press ability pub ability_info: AbilityInfo, /// Used to specify the beam to the frontend @@ -61,14 +61,16 @@ impl CharacterBehavior for Data { fn behavior(&self, data: &JoinData) -> StateUpdate { let mut update = StateUpdate::from(data); - match self.static_data.orientation_behavior { - MovementBehavior::Normal => {}, - MovementBehavior::Turret => { + let ori_rate = match self.static_data.orientation_behavior { + OrientationBehavior::Normal => 0.6, + OrientationBehavior::Turret => { update.ori = Ori::from(data.inputs.look_dir); + 0.6 }, - } + OrientationBehavior::FromOri => 0.1, + }; - handle_orientation(data, &mut update, 0.6); + handle_orientation(data, &mut update, ori_rate); handle_move(data, &mut update, 0.4); handle_jump(data, &mut update, 1.0); @@ -143,17 +145,34 @@ impl CharacterBehavior for Data { _ => data.body.height() * 0.5, }; // Gets offsets - let body_offsets = Vec3::new( - (data.body.radius() + 1.0) * data.inputs.look_dir.x, - (data.body.radius() + 1.0) * data.inputs.look_dir.y, - body_offsets_z, - ); + let (body_offsets, ori) = match self.static_data.orientation_behavior { + OrientationBehavior::Normal | OrientationBehavior::Turret => ( + Vec3::new( + (data.body.radius() + 1.0) * data.inputs.look_dir.x, + (data.body.radius() + 1.0) * data.inputs.look_dir.y, + body_offsets_z, + ), + Ori::from(data.inputs.look_dir), + ), + OrientationBehavior::FromOri => ( + Vec3::new( + (data.body.radius() + 1.0) * update.ori.look_vec().x, + (data.body.radius() + 1.0) * update.ori.look_vec().y, + body_offsets_z, + ), + Ori::from(Vec3::new( + update.ori.look_vec().x, + update.ori.look_vec().y, + data.inputs.look_dir.z, + )), + ), + }; let pos = Pos(data.pos.0 + body_offsets); // Create beam segment update.server_events.push_front(ServerEvent::BeamSegment { properties, pos, - ori: Ori::from(data.inputs.look_dir), + ori, }); update.character = CharacterState::BasicBeam(Data { timer: self @@ -210,7 +229,13 @@ impl CharacterBehavior for Data { } #[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)] -pub enum MovementBehavior { +pub enum OrientationBehavior { + /// Uses look_dir as direction of beam Normal, + /// Uses look_dir as direction of beam, sets orientation to same direction + /// as look_dir Turret, + /// Uses orientation x and y and look_dir z as direction of beam (z from + /// look_dir as orientation will only go through 2d rotations naturally) + FromOri, } diff --git a/server/src/sys/agent.rs b/server/src/sys/agent.rs index 553915ba8f..b88418221b 100644 --- a/server/src/sys/agent.rs +++ b/server/src/sys/agent.rs @@ -3470,7 +3470,7 @@ impl<'a> AgentData<'a> { tgt_data: &TargetData, read_data: &ReadData, ) { - const GOLEM_MELEE_RANGE: f32 = 5.0; + const GOLEM_MELEE_RANGE: f32 = 4.0; const GOLEM_LASER_RANGE: f32 = 30.0; const GOLEM_LONG_RANGE: f32 = 50.0; const GOLEM_TARGET_SPEED: f32 = 8.0; diff --git a/voxygen/src/audio/sfx/mod.rs b/voxygen/src/audio/sfx/mod.rs index 8454a83a0f..b43417ed10 100644 --- a/voxygen/src/audio/sfx/mod.rs +++ b/voxygen/src/audio/sfx/mod.rs @@ -402,9 +402,7 @@ impl SfxMgr { audio.emit_sfx(sfx_trigger_item, *pos, None, false); } }, - beam::FrontendSpecifier::ClayGolem => { - // TODO: Get sfx for this - }, + beam::FrontendSpecifier::ClayGolem => {}, }, Outcome::BreakBlock { pos, .. } => { let sfx_trigger_item = triggers.get_key_value(&SfxEvent::BreakBlock);