Skip to content

Commit

Permalink
Simple Attack MAI test scenario: move Lua filter function into preloa…
Browse files Browse the repository at this point in the history
…d event

… so that it is available after a reload as well.
  • Loading branch information
mattsc committed Feb 21, 2014
1 parent 38afe48 commit 47e7847
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions data/ai/micro_ais/scenarios/simple_attack.cfg
Expand Up @@ -46,6 +46,22 @@
hidden=yes
[/side]

[event]
name=preload
first_time_only=no
[lua]
code=<<
function close_to_advancing(unit)
if (unit.experience >= unit.max_experience-1) then
return true
else
return false
end
end
>>
[/lua]
[/event]

[event]
name=prestart

Expand All @@ -64,18 +80,6 @@
{SCATTER_UNITS 12 "Soulless" 1 (x,y=5-9,8-22) (side=2)}
{SCATTER_UNITS 6 "Skeleton,Skeleton Archer" 1 (x,y=5-9,8-22) (side=2)}

[lua]
code=<<
function close_to_advancing(unit)
if (unit.experience >= unit.max_experience-1) then
return true
else
return false
end
end
>>
[/lua]

[micro_ai]
side=2
ai_type=simple_attack
Expand Down

0 comments on commit 47e7847

Please sign in to comment.