mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Use Golem Shockwave only after loosing 30% health
+ Make shockwave buildup longer
This commit is contained in:
parent
4dc14dbe66
commit
36fa8bf4f7
@ -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,
|
||||||
|
@ -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
|
||||||
@ -3517,8 +3520,9 @@ impl<'a> AgentData<'a> {
|
|||||||
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)));
|
||||||
|
Loading…
Reference in New Issue
Block a user