Skip to content

Commit

Permalink
EI S13: Rewrite dragon's AI
Browse files Browse the repository at this point in the history
Most part of the old AI had no evident effect: the dragon just
moved here and there without attacking you, and since he flied
over shallow water, it was impossible to chase him. The micro
ai makes Khrakhras wander around and attack you when you
approach his castle.

(cherry-picked from commit 64917b7)
  • Loading branch information
DisherProject authored and ln-zookeeper committed Oct 7, 2018
1 parent 3c1dd4d commit fdfdb0a
Showing 1 changed file with 14 additions and 81 deletions.
95 changes: 14 additions & 81 deletions data/campaigns/Eastern_Invasion/scenarios/13_The_Drowned_Plains.cfg
Expand Up @@ -45,87 +45,6 @@
user_team_name=_"Evil"
gold=0
no_leader=yes
[ai]
#don't target any of the default things
village_value=0
leader_value=0
[goal]
name=protect_unit
[criteria]
side=3
canrecruit=yes
[/criteria]
value=0
[/goal]
#stay in the middle of the map
[avoid]
[not]
x=14-32
y=10-45
[/not]
[/avoid]
#and target anyone in it (otherwise it will have nothing to do when
#it can't attack in the current turn)
[goal]
name=target
[criteria]
#who knows what would happen if it targetted itself
[not]
type="Skeletal Dragon"
[/not]
x=14-32
y=10-45
[/criteria]
value=100
[/goal]
#I don't know if this is needed, but it sure would be stupid to use
#any grouping behavior when there's only one unit on this side!
grouping=no
#not sure if this really does anything; it was copied from IP's code
aggression=1.0
leader_aggression=0.4
caution=0.0
[/ai]

#give the skeletal dragon something to do when there are no
#enemies available let it look like it's wandering around
#semi-randomly
[ai]
[leader_goal]
x,y=14,10
[/leader_goal]
time_of_day=dawn
[/ai]
[ai]
[leader_goal]
x,y=23,26
[/leader_goal]
time_of_day=morning
[/ai]
[ai]
[leader_goal]
x,y=23,26
[/leader_goal]
time_of_day=afternoon
[/ai]
[ai]
[leader_goal]
x,y=32,32
[/leader_goal]
time_of_day=dusk
[/ai]
[ai]
[leader_goal]
x,y=32,10
[/leader_goal]
time_of_day=first_watch
[/ai]
[ai]
[leader_goal]
x,y=14,32
[/leader_goal]
time_of_day=second_watch
[/ai]
[/side]

[event]
Expand Down Expand Up @@ -167,6 +86,20 @@
canrecruit=yes
[/unit]

[micro_ai]
side=3
ai_type=big_animals
action=add

[filter]
id="Khrakrahs"
[/filter]
[filter_location]
x=23-32
y=21-26
[/filter_location]
[/micro_ai]

#buff the dragon with some magic resistances
[object]
name= _ "Null Stone"
Expand Down

0 comments on commit fdfdb0a

Please sign in to comment.