diff options
Diffstat (limited to 'app/systems/ai/rejoin.rb')
| -rw-r--r-- | app/systems/ai/rejoin.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/systems/ai/rejoin.rb b/app/systems/ai/rejoin.rb index 606a0be..9e06eb7 100644 --- a/app/systems/ai/rejoin.rb +++ b/app/systems/ai/rejoin.rb @@ -1,14 +1,14 @@ FF::Sys.new("Rejoin", priority: 40) do - FF::Cmp::BoidsSeparation.each do |sep| - #puts 'add align/cohesion'.upcase - sep.distance = 150 - alignment_mgr = sep.entities[0].components[FF::Cmp::BoidsAlignment] - cohesion_mgr = sep.entities[0].components[FF::Cmp::BoidsCohesion] + FF::Cmp::SingletonRandomAIPick[0].entities.each do |entity| + sep = entity.components[FF::Cmp::BoidsSeparation][0] + sep.distance = Factory::SampleEnemy.defaults[:boids_seperation_distance] + alignment_mgr = entity.components[FF::Cmp::BoidsAlignment] + cohesion_mgr = entity.components[FF::Cmp::BoidsCohesion] if alignment_mgr.nil? || alignment_mgr.empty? - sep.entities[0].add FF::Cmp::BoidsAlignment.new(strength: 10) + entity.add FF::Cmp::BoidsAlignment.new(strength: Factory::SampleEnemy.defaults[:boids_alignment_strength]) end if cohesion_mgr.nil? || cohesion_mgr.empty? - sep.entities[0].add FF::Cmp::BoidsCohesion.new(strength: 1000) + entity.add FF::Cmp::BoidsCohesion.new(strength: Factory::SampleEnemy.defaults[:boids_cohesion_strength]) end end end |
