blob: b3ab59baed26369e11d7cb816dd1bd7c5e94a981 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
FF::Scn::BoidRules.add(
FF::Sys.new('RandomizeAI', priority: 50) do
timer = FF::Cmp::SingletonAITimer[0]
timer.timer += 1
if timer.timer > timer.interval
random_ai_pick = FF::Cmp::SingletonRandomAIPick[0]
random_ai_pick.entities.reverse_each do |entity|
entity.remove random_ai_pick
#puts 'remove pick'
end
FF::Cmp::BoidsSeparation.each do |sep|
if rand < 0.05
sep.entities[0].add random_ai_pick
#puts 'pick'
end
end
x = rand 3
if x == 0
FF::Sys::Scatter.call
#puts 'scatter'
elsif x == 1
FF::Sys::Rejoin.call
#puts 'rejoin'
elsif x == 2
FF::Sys::TargetPlayer.call
#puts 'target'
end
#timer.interval = (300..1200).to_a.sample
timer.interval = (5..20).to_a.sample
#puts timer.interval
timer.timer = 0
end
end
)
|