diff --git a/src/loot/mod.rs b/src/loot/mod.rs index 93eb18bc..ae653866 100644 --- a/src/loot/mod.rs +++ b/src/loot/mod.rs @@ -1,5 +1,6 @@ //! Exposes resources with methods to compute loot drops from killed mobs. use bevy::prelude::{App, EventWriter, Plugin, Resource, Vec2}; +use consumable::ConsumableLootDrop; use ron::de::from_bytes; use serde::Deserialize; use std::collections::HashMap; @@ -9,7 +10,7 @@ mod consumable; use crate::spawnable::SpawnConsumableEvent; -pub use self::consumable::*; +pub(crate) use self::consumable::DropListType; pub(super) struct LootPlugin; diff --git a/src/spawnable/behavior_sequence.rs b/src/spawnable/behavior_sequence.rs index a036b9bd..b84f1f43 100644 --- a/src/spawnable/behavior_sequence.rs +++ b/src/spawnable/behavior_sequence.rs @@ -1,6 +1,9 @@ use super::{ - mob::BehaviorSequenceTracker, mob::MobBehavior, mob::MobComponent, mob::MobSegmentComponent, - mob::MobSegmentControlBehavior, SpawnableBehavior, SpawnableComponent, + mob::{ + BehaviorSequenceTracker, MobBehavior, MobComponent, MobSegmentComponent, + MobSegmentControlBehavior, + }, + SpawnableBehavior, SpawnableComponent, }; use bevy::{ prelude::{Entity, Event, EventReader, EventWriter, Query, Res, Resource}, diff --git a/src/spawnable/consumable/mod.rs b/src/spawnable/consumable/mod.rs index 31a57e84..f30be219 100644 --- a/src/spawnable/consumable/mod.rs +++ b/src/spawnable/consumable/mod.rs @@ -25,7 +25,7 @@ use crate::{ mod behavior; -pub use self::behavior::{consumable_execute_behavior_system, ConsumableBehavior}; +pub(crate) use self::behavior::{consumable_execute_behavior_system, ConsumableBehavior}; use thetawave_interface::spawnable::AttractToClosestPlayerComponent; diff --git a/src/spawnable/mob/mob_segment/mod.rs b/src/spawnable/mob/mob_segment/mod.rs index 6736e45a..823a16e4 100644 --- a/src/spawnable/mob/mob_segment/mod.rs +++ b/src/spawnable/mob/mob_segment/mod.rs @@ -32,12 +32,14 @@ use crate::{ }; mod behavior; -pub use self::behavior::*; - use super::{ ColliderData, CompoundColliderData, JointType, MobSegmentAnchorPointData, MobSpawner, MobSpawnerData, }; +pub(in crate::spawnable) use behavior::{ + mob_segment_apply_disconnected_behaviors_system, mob_segment_execute_behavior_system, + MobSegmentBehavior, +}; #[derive(Resource, Deserialize)] pub struct MobSegmentsResource { @@ -79,7 +81,7 @@ impl From<&MobSegmentData> for MobSegmentComponent { MobSegmentComponent { mob_segment_type: mob_segment_data.mob_segment_type.clone(), collision_damage: mob_segment_data.collision_damage, - collision_sound: mob_segment_data.collision_sound.clone(), + collision_sound: mob_segment_data.collision_sound, defense_interaction: mob_segment_data.defense_interaction.clone(), consumable_drops: mob_segment_data.consumable_drops.clone(), behaviors: mob_segment_data.behaviors.clone(), diff --git a/src/spawnable/mob/mod.rs b/src/spawnable/mob/mod.rs index e1138da5..dc03ef86 100644 --- a/src/spawnable/mob/mod.rs +++ b/src/spawnable/mob/mod.rs @@ -17,6 +17,7 @@ use bevy_rapier2d::{ LockedAxes, Restitution, RevoluteJointBuilder, RigidBody, Velocity, }, }; +use mob_segment::{spawn_mob_segment, MobSegmentBehavior}; use serde::Deserialize; use std::collections::{hash_map::Entry, HashMap}; @@ -30,7 +31,14 @@ use crate::{ mod behavior; mod mob_segment; -pub use self::{behavior::*, mob_segment::*}; +pub(crate) use self::mob_segment::MobSegmentComponent; +pub(in crate::spawnable) use self::{ + behavior::{mob_execute_behavior_system, MobBehavior, MobSegmentControlBehavior}, + mob_segment::{ + mob_segment_apply_disconnected_behaviors_system, mob_segment_execute_behavior_system, + MobSegmentsResource, + }, +}; use super::{behavior_sequence::MobBehaviorSequenceType, InitialMotion}; use crate::collision::{ diff --git a/src/spawnable/mod.rs b/src/spawnable/mod.rs index 92ea2e77..69c1942b 100644 --- a/src/spawnable/mod.rs +++ b/src/spawnable/mod.rs @@ -42,14 +42,16 @@ use self::{ }; // TODO: move to interface, or change to use events for sending information between modules -pub use self::behavior::SpawnableBehavior; -pub use self::behavior_sequence::{BehaviorSequenceResource, MobBehaviorUpdateEvent}; -pub use self::consumable::{ +pub(crate) use self::behavior::SpawnableBehavior; +pub(crate) use self::behavior_sequence::{BehaviorSequenceResource, MobBehaviorUpdateEvent}; +pub(crate) use self::consumable::{ ConsumableComponent, ConsumableData, ConsumableResource, SpawnConsumableEvent, }; -pub use self::effect::{EffectsResource, SpawnEffectEvent}; -pub use self::mob::{BossComponent, BossesDestroyedEvent, MobComponent, MobSegmentComponent}; -pub use self::projectile::{ +pub(crate) use self::effect::{EffectsResource, SpawnEffectEvent}; +pub(crate) use self::mob::{ + BossComponent, BossesDestroyedEvent, MobComponent, MobSegmentComponent, +}; +pub(crate) use self::projectile::{ FireWeaponEvent, ProjectileComponent, ProjectileData, ProjectileResource, }; diff --git a/src/spawnable/projectile/mod.rs b/src/spawnable/projectile/mod.rs index 5aa10935..024bbcba 100644 --- a/src/spawnable/projectile/mod.rs +++ b/src/spawnable/projectile/mod.rs @@ -35,7 +35,9 @@ use crate::{ mod behavior; -pub use self::behavior::{projectile_execute_behavior_system, ProjectileBehavior}; +pub(in crate::spawnable) use self::behavior::{ + projectile_execute_behavior_system, ProjectileBehavior, +}; use super::{mob::ColliderData, InitialMotion};