mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Particles for healing aura
This commit is contained in:
parent
146f86be2c
commit
997da21001
@ -802,7 +802,7 @@
|
|||||||
],
|
],
|
||||||
threshold: 0.2,
|
threshold: 0.2,
|
||||||
),
|
),
|
||||||
HealingBeam: (
|
SceptreBeam: (
|
||||||
files: [
|
files: [
|
||||||
"voxygen.audio.sfx.abilities.sceptre_channeling",
|
"voxygen.audio.sfx.abilities.sceptre_channeling",
|
||||||
],
|
],
|
||||||
|
@ -52,7 +52,7 @@ const int LEAF = 10;
|
|||||||
const int FIREFLY = 11;
|
const int FIREFLY = 11;
|
||||||
const int BEE = 12;
|
const int BEE = 12;
|
||||||
const int GROUND_SHOCKWAVE = 13;
|
const int GROUND_SHOCKWAVE = 13;
|
||||||
const int HEALING_BEAM = 14;
|
const int ENERGY_HEALING = 14;
|
||||||
const int ENERGY_NATURE = 15;
|
const int ENERGY_NATURE = 15;
|
||||||
const int FLAMETHROWER = 16;
|
const int FLAMETHROWER = 16;
|
||||||
const int FIRE_SHOCKWAVE = 17;
|
const int FIRE_SHOCKWAVE = 17;
|
||||||
@ -380,13 +380,14 @@ void main() {
|
|||||||
spin_in_axis(vec3(1,0,0),0)
|
spin_in_axis(vec3(1,0,0),0)
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case HEALING_BEAM:
|
case ENERGY_HEALING:
|
||||||
f_reflect = 0.0;
|
f_reflect = 0.0;
|
||||||
|
float spiral_radius = start_end(1 - pow(abs(rand5), 5), 1) * length(inst_dir);
|
||||||
attr = Attr(
|
attr = Attr(
|
||||||
spiral_motion(inst_dir, 0.3 * (floor(2 * rand0 + 0.5) - 0.5) * min(linear_scale(10), 1), lifetime / inst_lifespan, 10.0, inst_time),
|
spiral_motion(vec3(0, 0, rand3 + 1), spiral_radius, lifetime, abs(rand0), rand1 * 2 * PI) + vec3(0, 0, rand2),
|
||||||
vec3((1.7 - 0.7 * abs(floor(2 * rand0 - 0.5) + 0.5)) * (1.5 + 0.5 * sin(tick.x * 10 - lifetime * 4))),
|
vec3(6 * abs(rand4) * (1 - slow_start(2)) * pow(spiral_radius / length(inst_dir), 0.5)),
|
||||||
vec4(vec3(0.4, 1.6 + 0.3 * sin(tick.x * 10 - lifetime * 3 + 4), 1.0 + 0.15 * sin(tick.x * 5 - lifetime * 5)), 1 /*0.3*/),
|
vec4(vec3(0, 1.7, 0.7), 1),
|
||||||
spin_in_axis(inst_dir, tick.z)
|
spin_in_axis(vec3(rand6, rand7, rand8), rand9 * 3)
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case LIFESTEAL_BEAM:
|
case LIFESTEAL_BEAM:
|
||||||
@ -402,7 +403,7 @@ void main() {
|
|||||||
break;
|
break;
|
||||||
case ENERGY_NATURE:
|
case ENERGY_NATURE:
|
||||||
f_reflect = 0.0;
|
f_reflect = 0.0;
|
||||||
float spiral_radius = start_end(1 - pow(abs(rand5), 5), 1) * length(inst_dir);
|
spiral_radius = start_end(1 - pow(abs(rand5), 5), 1) * length(inst_dir);
|
||||||
attr = Attr(
|
attr = Attr(
|
||||||
spiral_motion(vec3(0, 0, rand3 + 1), spiral_radius, lifetime, abs(rand0), rand1 * 2 * PI) + vec3(0, 0, rand2),
|
spiral_motion(vec3(0, 0, rand3 + 1), spiral_radius, lifetime, abs(rand0), rand1 * 2 * PI) + vec3(0, 0, rand2),
|
||||||
vec3(6 * abs(rand4) * (1 - slow_start(2)) * pow(spiral_radius / length(inst_dir), 0.5)),
|
vec3(6 * abs(rand4) * (1 - slow_start(2)) * pow(spiral_radius / length(inst_dir), 0.5)),
|
||||||
|
@ -175,7 +175,7 @@ pub enum SfxEvent {
|
|||||||
Parry,
|
Parry,
|
||||||
Block,
|
Block,
|
||||||
BreakBlock,
|
BreakBlock,
|
||||||
HealingBeam,
|
SceptreBeam,
|
||||||
SkillPointGain,
|
SkillPointGain,
|
||||||
ArrowHit,
|
ArrowHit,
|
||||||
ArrowMiss,
|
ArrowMiss,
|
||||||
@ -481,7 +481,7 @@ impl SfxMgr {
|
|||||||
Outcome::Beam { pos, specifier } => match specifier {
|
Outcome::Beam { pos, specifier } => match specifier {
|
||||||
beam::FrontendSpecifier::LifestealBeam => {
|
beam::FrontendSpecifier::LifestealBeam => {
|
||||||
if thread_rng().gen_bool(0.5) {
|
if thread_rng().gen_bool(0.5) {
|
||||||
let sfx_trigger_item = triggers.get_key_value(&SfxEvent::HealingBeam);
|
let sfx_trigger_item = triggers.get_key_value(&SfxEvent::SceptreBeam);
|
||||||
audio.emit_sfx(sfx_trigger_item, *pos, None, false);
|
audio.emit_sfx(sfx_trigger_item, *pos, None, false);
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -64,7 +64,7 @@ pub enum ParticleMode {
|
|||||||
Firefly = 11,
|
Firefly = 11,
|
||||||
Bee = 12,
|
Bee = 12,
|
||||||
GroundShockwave = 13,
|
GroundShockwave = 13,
|
||||||
HealingBeam = 14,
|
EnergyHealing = 14,
|
||||||
EnergyNature = 15,
|
EnergyNature = 15,
|
||||||
FlameThrower = 16,
|
FlameThrower = 16,
|
||||||
FireShockwave = 17,
|
FireShockwave = 17,
|
||||||
|
@ -942,6 +942,28 @@ impl ParticleMgr {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
aura::AuraKind::Buff {
|
||||||
|
kind: buff::BuffKind::Regeneration,
|
||||||
|
..
|
||||||
|
} => {
|
||||||
|
let heartbeats = self.scheduler.heartbeats(Duration::from_millis(5));
|
||||||
|
self.particles.resize_with(
|
||||||
|
self.particles.len()
|
||||||
|
+ aura.radius.powi(2) as usize * usize::from(heartbeats) / 300,
|
||||||
|
|| {
|
||||||
|
let rand_dist = aura.radius * (1.0 - rng.gen::<f32>().powi(100));
|
||||||
|
let init_pos = Vec3::new(rand_dist, 0_f32, 0_f32);
|
||||||
|
let max_dur = Duration::from_secs(1);
|
||||||
|
Particle::new_directed(
|
||||||
|
aura.duration.map_or(max_dur, |dur| dur.min(max_dur)),
|
||||||
|
time,
|
||||||
|
ParticleMode::EnergyHealing,
|
||||||
|
pos.0,
|
||||||
|
pos.0 + init_pos,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
_ => {},
|
_ => {},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user