diff --git a/assets/common/abilities/custom/fiery_tornado/fiery_spin.ron b/assets/common/abilities/custom/fiery_tornado/fiery_spin.ron index af79474a99..1f76ebf63b 100644 --- a/assets/common/abilities/custom/fiery_tornado/fiery_spin.ron +++ b/assets/common/abilities/custom/fiery_tornado/fiery_spin.ron @@ -9,7 +9,7 @@ RapidMelee( knockback: 50, energy_regen: 0, ), - range: 3.5, + range: 2.0, angle: 360, multi_target: Some(Normal), damage_effect: Some(Buff(( diff --git a/common/src/states/basic_summon.rs b/common/src/states/basic_summon.rs index 3fcaaf2354..fc853935c3 100644 --- a/common/src/states/basic_summon.rs +++ b/common/src/states/basic_summon.rs @@ -147,7 +147,14 @@ impl CharacterBehavior for Data { let length = rand::thread_rng().gen_range( self.static_data.summon_distance.0..=self.static_data.summon_distance.1, ); - + let extra_height = + if self.static_data.summon_info.body == Object(FieryTornado) { + 15.0 + } else { + 0.0 + }; + let position = + Vec3::new(data.pos.0.x, data.pos.0.y, data.pos.0.z + extra_height); // Summon in a clockwise fashion let ray_vector = Vec3::new( (summon_frac * 2.0 * PI).sin() * length, @@ -158,16 +165,16 @@ impl CharacterBehavior for Data { // Check for collision on the xy plane, subtract 1 to get point before block let obstacle_xy = data .terrain - .ray(data.pos.0, data.pos.0 + length * ray_vector) + .ray(position, position + length * ray_vector) .until(Block::is_solid) .cast() .0 .sub(1.0); let collision_vector = Vec3::new( - data.pos.0.x + (summon_frac * 2.0 * PI).sin() * obstacle_xy, - data.pos.0.y + (summon_frac * 2.0 * PI).cos() * obstacle_xy, - data.pos.0.z + data.body.eye_height(data.scale.map_or(1.0, |s| s.0)), + position.x + (summon_frac * 2.0 * PI).sin() * obstacle_xy, + position.y + (summon_frac * 2.0 * PI).cos() * obstacle_xy, + position.z + data.body.eye_height(data.scale.map_or(1.0, |s| s.0)), ); // Check for collision in z up to 50 blocks @@ -188,19 +195,11 @@ impl CharacterBehavior for Data { is_sticky: false, is_point: false, }); - let extra_height = - if self.static_data.summon_info.body == Object(FieryTornado) { - 5.0 - } else { - 0.0 - }; let mut rng = rand::thread_rng(); // Send server event to create npc output_events.emit_server(CreateNpcEvent { - pos: comp::Pos( - collision_vector - Vec3::unit_z() * obstacle_z + extra_height, - ), + pos: comp::Pos(collision_vector - Vec3::unit_z() * obstacle_z), ori: comp::Ori::from(Dir::random_2d(&mut rng)), npc: NpcBuilder::new(stats, body, comp::Alignment::Owned(*data.uid)) .with_skill_set(skill_set) diff --git a/server/agent/src/attack.rs b/server/agent/src/attack.rs index e68fad1ce8..d53e2d5c1b 100644 --- a/server/agent/src/attack.rs +++ b/server/agent/src/attack.rs @@ -3000,6 +3000,7 @@ impl<'a> AgentData<'a> { enum ActionStateTimers { AttackTimer1, AttackTimer2, + WaterTimer, } let attack_timer_1 = @@ -3053,7 +3054,20 @@ impl<'a> AgentData<'a> { // Flee from the ground! The internet told me it was lava! // If on the ground, jump with every last ounce of energy, holding onto // all that is dear in life and straining for the wide open skies. - if self.physics_state.on_ground.is_some() { + + // Don't stay in water + if matches!(self.physics_state.in_fluid, Some(Fluid::Liquid { .. })) { + agent.combat_state.timers[ActionStateTimers::WaterTimer as usize] = 2.0; + }; + if agent.combat_state.timers[ActionStateTimers::WaterTimer as usize] > 0.0 { + agent.combat_state.timers[ActionStateTimers::WaterTimer as usize] -= read_data.dt.0; + if agent.combat_state.timers[ActionStateTimers::WaterTimer as usize] > 1.0 { + controller.inputs.move_z = 1.0 + } else { + // heat laser + controller.push_basic_input(InputKind::Ability(3)) + } + } else if self.physics_state.on_ground.is_some() { controller.push_basic_input(InputKind::Jump); } else { // Use a proportional controller with a coefficient of 1.0 to