mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fixed gaining combo by shooting loot bags
This commit is contained in:
parent
1afe3b7de5
commit
92c9e8c477
@ -53,6 +53,7 @@ pub struct TargetInfo<'a> {
|
||||
pub entity: EcsEntity,
|
||||
pub inventory: Option<&'a Inventory>,
|
||||
pub stats: Option<&'a Stats>,
|
||||
pub health: Option<&'a Health>,
|
||||
}
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
@ -229,7 +230,7 @@ impl Attack {
|
||||
.filter(|e| !(matches!(e.target, Some(GroupTarget::OutOfGroup)) && target_dodging))
|
||||
{
|
||||
if effect.requirements.iter().all(|req| match req {
|
||||
CombatRequirement::AnyDamage => accumulated_damage > 0.0,
|
||||
CombatRequirement::AnyDamage => accumulated_damage > 0.0 && target.health.is_some(),
|
||||
CombatRequirement::Energy(r) => {
|
||||
if let Some(AttackerInfo {
|
||||
entity,
|
||||
|
@ -169,6 +169,7 @@ impl<'a> System<'a> for Sys {
|
||||
entity: target,
|
||||
inventory: read_data.inventories.get(target),
|
||||
stats: read_data.stats.get(target),
|
||||
health: read_data.healths.get(target),
|
||||
};
|
||||
|
||||
beam_segment.properties.attack.apply_attack(
|
||||
|
@ -124,6 +124,7 @@ impl<'a> System<'a> for Sys {
|
||||
entity: target,
|
||||
inventory: read_data.inventories.get(target),
|
||||
stats: read_data.stats.get(target),
|
||||
health: read_data.healths.get(target),
|
||||
};
|
||||
|
||||
melee_attack.attack.apply_attack(
|
||||
|
@ -1,7 +1,7 @@
|
||||
use common::{
|
||||
combat::{AttackerInfo, TargetInfo},
|
||||
comp::{
|
||||
projectile, Combo, Energy, Group, HealthSource, Inventory, Ori, PhysicsState, Pos,
|
||||
projectile, Combo, Energy, Group, Health, HealthSource, Inventory, Ori, PhysicsState, Pos,
|
||||
Projectile, Stats, Vel,
|
||||
},
|
||||
event::{EventBus, ServerEvent},
|
||||
@ -31,6 +31,7 @@ pub struct ReadData<'a> {
|
||||
energies: ReadStorage<'a, Energy>,
|
||||
stats: ReadStorage<'a, Stats>,
|
||||
combos: ReadStorage<'a, Combo>,
|
||||
healths: ReadStorage<'a, Health>,
|
||||
}
|
||||
|
||||
/// This system is responsible for handling projectile effect triggers
|
||||
@ -119,6 +120,7 @@ impl<'a> System<'a> for Sys {
|
||||
entity: target,
|
||||
inventory: read_data.inventories.get(target),
|
||||
stats: read_data.stats.get(target),
|
||||
health: read_data.healths.get(target),
|
||||
};
|
||||
|
||||
attack.apply_attack(
|
||||
|
@ -188,6 +188,7 @@ impl<'a> System<'a> for Sys {
|
||||
entity: target,
|
||||
inventory: read_data.inventories.get(target),
|
||||
stats: read_data.stats.get(target),
|
||||
health: read_data.healths.get(target),
|
||||
};
|
||||
|
||||
shockwave.properties.attack.apply_attack(
|
||||
|
@ -697,8 +697,7 @@ pub fn handle_explosion(server: &Server, pos: Vec3<f32>, explosion: Explosion, o
|
||||
RadiusEffect::Attack(attack) => {
|
||||
let energies = &ecs.read_storage::<comp::Energy>();
|
||||
let combos = &ecs.read_storage::<comp::Combo>();
|
||||
for (entity_b, pos_b, _health_b, inventory_b_maybe, stats_b_maybe, body_b_maybe) in
|
||||
(
|
||||
for (entity_b, pos_b, health_b, inventory_b_maybe, stats_b_maybe, body_b_maybe) in (
|
||||
&ecs.entities(),
|
||||
&ecs.read_storage::<comp::Pos>(),
|
||||
&ecs.read_storage::<comp::Health>(),
|
||||
@ -749,6 +748,7 @@ pub fn handle_explosion(server: &Server, pos: Vec3<f32>, explosion: Explosion, o
|
||||
entity: entity_b,
|
||||
inventory: inventory_b_maybe,
|
||||
stats: stats_b_maybe,
|
||||
health: Some(health_b),
|
||||
};
|
||||
|
||||
let server_eventbus = ecs.read_resource::<EventBus<ServerEvent>>();
|
||||
|
Loading…
Reference in New Issue
Block a user