LoW::2: slightly changed ai macros.

LoW::3: added orc strategy selection
This commit is contained in:
Iurii Chernyi 2009-09-01 07:15:11 +00:00
parent fabb57d0e4
commit 63ec22c53d
3 changed files with 571 additions and 177 deletions

View file

@ -70,9 +70,9 @@
{ai/aliases/stable_singleplayer.cfg} #note that this MUST be given OUTSIDE the [ai] tag
[ai]
{AI_ASPECT caution 0}
{AI_ASPECT village_value 0}
{AI_ASPECT leader_value 0}
{AI_ALWAYS_ASPECT caution 0}
{AI_ALWAYS_ASPECT village_value 0}
{AI_ALWAYS_ASPECT leader_value 0}
[/ai]
[/side]
#wmllint: validate-on
@ -470,7 +470,7 @@
value=1.5
[/goal]
{AI_ASPECT aggression 0.75}
{AI_SIMPLE_ASPECT aggression 0.75}
[aspect]
id=caution
[facet]

View file

@ -1,5 +1,7 @@
#textdomain wesnoth-low
#NOTE: Orcish plans: The orcs are somewhat wary of the forest, and do not want to commit their entire army from the start. So, they decided to send a part of their army (under the command of the Orcish Slayer), to test the defenses of Ka'lian. If the slayer dies (he's not supposed to die, as he is not taking part in the battle, but oversees it from a distance, and he'll flee if any orc dies), it means that the orcs should will not attempt further attack on Ka'lian, but, instead, hold position and wait for their army to arrive"
#TODO make the ugly map border nicer
[scenario]
id=03_Kalian
@ -23,7 +25,7 @@
{INTRO_AND_SCENARIO_MUSIC northerners.ogg elvish-theme.ogg}
{EXTRA_SCENARIO_MUSIC siege_of_laurelmor.ogg}
{EXTRA_SCENARIO_MUSIC wanderer.ogg}
#TODO add some more titles
#TODO add some more titles
{EXTRA_SCENARIO_MUSIC suspense.ogg}
{DEFAULT_SCHEDULE}
@ -69,76 +71,77 @@
recruit={ELVES}
gold=0
{ai/aliases/stable_singleplayer.cfg} #note that this MUST be given OUTSIDE the [ai] tag
[ai]
#{AI_NO_SCOUTS}
#{AI_ASPECT_FOR_TIME_OF_DAY aggression "night" dusk,first_watch,second_watch 1}
#{AI_ASPECT_FOR_TIME_OF_DAY caution "night" dusk,first_watch,second_watch 0}
#{AI_ASPECT_FOR_TIME_OF_DAY grouping "night" dusk,first_watch,second_watch offensive}
#{AI_ASPECT village_value 0}
#{AI_ASPECT recruitment_ignore_bad_movement yes}
#{AI_ASPECT recruitment_pattern "scout,fighter,fighter,archer,mixed fighter"}
recruitment_pattern=healer,archer,fighter,archer,fighter,archer,healer,scout
villages_per_scout=10
grouping=defensive
caution=0.5
aggression=0.5
{AI_NO_SCOUTS}
{AI_ALWAYS_ASPECT recruitment_pattern "healer,archer,fighter,archer,fighter,archer,healer,scout"}
[/ai]
[/side]
#### Side3 code ####
[side]
side=3
no_leader=yes
team_name=orcs
shroud=yes
fog=yes
shroud=yes
share_view=yes
[unit]
type=Orcish Warlord
id=Mutaf-uru
name= _ "Mutaf-uru"
profile=portraits/orcs/warlord3.png
canrecruit=yes
x=17
y=6
[/unit]
#ifdef EASY
recruit={ORCS1}, Orcish Crossbowman, Goblin Pillager, Goblin Knight
#endif
#ifdef NORMAL
recruit={ORCS1}, Orcish Crossbowman, Goblin Pillager, Goblin Knight, Orcish Slayer, Goblin Impaler, Goblin Rouser, Orcish Warrior
#endif
#ifdef HARD
recruit={ORCS1}, Orcish Crossbowman, Goblin Pillager, Goblin Knight, Orcish Slayer, Goblin Impaler, Goblin Rouser, Orcish Warrior
#endif
gold=0
{INCOME 4 8 12}
[unit]
type="Orcish Slayer"
id=orcish_slayer
name= _ "Urudin" #TODO ESR: this slayer needs a good name
canrecruit=yes
x=29
y=15
hitpoints=45
max_hitpoints=45
[/unit]
recruit=""
[ai]
{AI_NO_SCOUTS}
{AI_ASPECT_FOR_TIME_OF_DAY aggression "night" dusk,first_watch,second_watch 1}
{AI_ASPECT_FOR_TIME_OF_DAY caution "night" dusk,first_watch,second_watch 0}
{AI_ASPECT_FOR_TIME_OF_DAY grouping "night" dusk,first_watch,second_watch offensive}
{AI_ASPECT village_value 0}
{AI_ASPECT recruitment_ignore_bad_movement yes}
{AI_ASPECT recruitment_pattern "scout,fighter,fighter,archer,mixed fighter"}
version=10703
[stage]
id=leader_retreat
engine=fai
name=side_formulas
#retreat on > half HP lost or turn>=3
move="if(my_leader!=null,if( (my_leader.hitpoints<my_leader.max_hitpoints/2) or (turn>=3),move(my_leader.loc,next_hop(my_leader.loc,loc(20,6))),move(my_leader.loc,my_leader.loc)),null)"
[/stage]
[stage]
engine=cpp
name=testing_ai_default::candidate_action_evaluation_loop
[candidate_action]
engine=cpp
name=testing_ai_default::combat_phase
score=40
[/candidate_action]
[candidate_action]
engine=cpp
name=testing_ai_default::simple_move_and_targeting_phase
score=15
[/candidate_action]
[/stage]
[/ai]
{ai/dev/formula_ai_poisoning.cfg}
[/side]
[event]
name=last breath
[filter]
id=Mutaf-uru
id=orcish_slayer
[/filter]
[message]
speaker=unit
message= _ "We die, but more come after us, Orcs will rule all!"
message= _ "Boss, the elves are too strong!" #TODO ESR
[/message]
[fire_event]
name=orcs_select_strategy
[/fire_event]
[/event]
#### /Side3 code ####
#### Side4 code ####
[side]
side=4
no_leader=yes
@ -163,57 +166,422 @@
#ifdef HARD
recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Knight, Goblin Pillager, Goblin Spearman, Orcish Slayer, Orcish Warrior
#endif
gold=0
{GOLD 0 40 80}
{INCOME 4 8 12}
[ai]
aggression=1
villages_per_scout=3
village_value=0
scout_village_targeting=0
recruitment_pattern=scout,scout,scout,fighter,archer,mixed fighter
{AI_NIGHT_ASPECT aggression 1}
{AI_NIGHT_ASPECT caution 0}
{AI_NIGHT_ASPECT grouping offensive}
{AI_ALWAYS_ASPECT villages_per_scout 5}
{AI_ALWAYS_ASPECT recruitment_pattern "scout,scout,scout,fighter,archer,mixed fighter"}
[/ai]
{ai/dev/formula_ai_poisoning.cfg}
[/side]
#### /Side4 code ####
#### Side5 code ####
[side]
side=5
no_leader=yes
team_name=orcs
fog=yes
shroud=yes
fog=yes
share_view=yes
gold=0
[unit]
type="Orcish Slayer"
id=orc_leader
name= _ "Urudin" #TODO ESR: this slayer needs a name
type=Orcish Warlord
id=Mutaf-uru
name= _ "Mutaf-uru"
profile=portraits/orcs/warlord3.png
canrecruit=yes
x=29
y=15
hitpoints=45
max_hitpoints=45
x=17
y=6
[/unit]
recruit=""
#ifdef EASY
recruit={ORCS1}, Orcish Crossbowman, Goblin Pillager, Goblin Knight
#endif
#ifdef NORMAL
recruit={ORCS1}, Orcish Crossbowman, Goblin Pillager, Goblin Knight, Orcish Slayer, Goblin Impaler, Goblin Rouser, Orcish Warrior
#endif
#ifdef HARD
recruit={ORCS1}, Orcish Crossbowman, Goblin Pillager, Goblin Knight, Orcish Slayer, Goblin Impaler, Goblin Rouser, Orcish Warrior
#endif
{GOLD 0 40 80}
{INCOME 4 8 12}
{ai/dev/formula_ai_poisoning.cfg}
[ai]
version=10703
[stage]
engine=cpp
#TODO CRAB: add 'move leader to target' phase
name=testing_ai_default::candidate_action_evaluation_loop
[candidate_action]
engine=cpp
name=testing_ai_default::combat_phase
score=40
[/candidate_action]
[candidate_action]
engine=cpp
name=testing_ai_default::simple_move_and_targeting_phase
score=15
[/candidate_action]
[/stage]
{AI_NIGHT_ASPECT aggression 1}
{AI_NIGHT_ASPECT caution 0}
{AI_NIGHT_ASPECT grouping offensive}
{AI_ALWAYS_ASPECT villages_per_scout 5}
{AI_ALWAYS_ASPECT recruitment_pattern "scout,fighter,fighter,archer,mixed fighter"}
[/ai]
[/side]
[event]
name=last breath
[filter]
id=Mutaf-uru
[/filter]
[message]
speaker=unit
message= _ "We die, but more come after us, Orcs will rule all!"
[/message]
[/event]
#### /Side5 code ####
#### Orc AI ####
#define ORC_BATTLEFIELD_EVALUATION
{VARIABLE orc_battlefield_evaluation 0}
# slayer dead: -1000
[if]
[not]
[have_unit]
id=orcish_slayer
side=3
[/have_unit]
[/not]
[then]
{VARIABLE_OP orc_battlefield_evaluation add -1000}
[/then]
[/if]
# orcs in Ka'lian: +3 +4 +5 per orc
[store_unit]
variable=eval_orcs_in_kalian
[filter]
side=3,4,5
[filter_location]
[and]
x,y=31,25
radius=5
[/and]
[not]
terrain=W*
[/not]
[/filter_location]
[/filter]
[/store_unit]
{VARIABLE eval_orcs_in_kalian_score 0}
{VARIABLE_OP eval_orcs_in_kalian_score add $eval_orcs_in_kalian.length}
#ifdef EASY
{VARIABLE_OP eval_orcs_in_kalian_score multiply 3}
#endif
#ifdef NORMAL
{VARIABLE_OP eval_orcs_in_kalian_score multiply 4}
#endif
#ifdef HARD
{VARIABLE_OP eval_orcs_in_kalian_score multiply 5}
#endif
{VARIABLE_OP orc_battlefield_evaluation add $eval_orcs_in_kalian_score}
# elven units: -1 per unit
[store_unit]
variable=eval_elves
[filter]
side=1,2
[/filter]
[/store_unit]
{VARIABLE_OP orc_battlefield_evaluation sub $eval_elves.length}
{CLEAR_VARIABLE eval_elves}
{CLEAR_VARIABLE eval_orcs_in_kalian}
{CLEAR_VARIABLE eval_orcs_in_kalian_score}
#enddef
#define ORC_BATTLEFIELD_EVALUATION_SUCCESS
[variable]
name=orc_battlefield_evaluation
greater_than_equal_to=11
[/variable]
#enddef
#define ORC_BATTLEFIELD_EVALUATION_FAILURE
[variable]
name=orc_battlefield_evaluation
less_than_equal_to=-25
[/variable]
#enddef
[event]
name=prestart
{VARIABLE orc_reserve_used no}
{VARIABLE orc_battlefield_strategy 'wait'}
[/event]
[event]
name=moveto
[filter]
x=20
y=6
id=orcish_slayer
[/filter]
[if]
[variable]
name=orc_reserve_used
boolean_equals=no
[/variable]
[then]
{CLEAR_FOG 1 17 7 4}
[message]
id=Mutaf-uru
message=_ "Ah, you're back. Report the situation!" #TODO ESR
[/message]
[message]
id=orcish_slayer
message=_ "They refused to surrender, Warlord. So we have attacked that elvish scum, exactly as planned" #TODO ESR
[/message]
[message]
id=Mutaf-uru
message=_ "Were you able to get a foothold in the citadel ?" #TODO ESR
[/message]
{ORC_BATTLEFIELD_EVALUATION}
[if]
{ORC_BATTLEFIELD_EVALUATION_SUCCESS}
[then]
[message]
id=orcish_slayer
message=_ "Yes. They were unable to resist our attack." #TODO ESR slayer reports success of orc attack
[/message]
[/then]
[else]
[if]
{ORC_BATTLEFIELD_EVALUATION_FAILURE}
[then]
[message]
id=orcish_slayer
message=_ "No, the citadel is too well-defended." #TODO ESR slayer reports failure of orc attack
[/message]
[/then]
[else]
[message]
id=orcish_slayer
message=_ "They resisted us fiercely" #TODO ESR slayer reports neutral outcome of orc attack
[/message]
[/else]
[/if]
[/else]
[/if]
{CLEAR_VARIABLE orc_battlefield_evaluation}
[fire_event]
name=orcs_select_strategy
[/fire_event]
[/then]
{UNCLEAR_FOG}
[/if]
[message]
id=Mutaf-uru
message=_ "Go, and report the situation to warlord Grubr." #TODO ESR. note: Grubr is from LoW 7
[/message]
[message]
id=orcish_slayer
message=_ "Yes, boss." #TODO ESR
[/message]
[store_unit]
[filter]
id=orcish_slayer
[/filter]
variable=orcish_slayer_from_low3
kill=yes
[/store_unit]
[/event]
# triggered by slayer dying, or slayer reaching his boss, or kalenz arriving
[event]
name=orcs_select_strategy
first_time_only=no
[if]
[variable]
name=orc_reserve_used
boolean_equals=no
[/variable]
[then]
# evaluate the battlefield. TODO Crab : consider using fai for evaluation
{ORC_BATTLEFIELD_EVALUATION}
[if]
{ORC_BATTLEFIELD_EVALUATION_SUCCESS}
[then]
{VARIABLE orc_battlefield_strategy 'attack'}
[/then]
[/if]
[if]
{ORC_BATTLEFIELD_EVALUATION_FAILURE}
[then]
{VARIABLE orc_battlefield_strategy 'defend'}
[/then]
[/if]
{CLEAR_VARIABLE orc_battlefield_evaluation}
# if fog is gone (thus, kalenz is here), then do not wait
[message]
message=" $orc_battlefield_strategy "
[/message]
[if]
[have_unit]
id=kalenz
side=1
[/have_unit]
[variable]
name=orc_battlefield_strategy
equals='wait'
[/variable]
[then]
[message]
message=" $orc_battlefield_strategy changed to attack "
[/message]
{VARIABLE orc_battlefield_strategy 'attack'}
[/then]
[/if]
[switch]
variable=orc_battlefield_strategy
[case]
value='wait'
# do nothing
[/case]
[case]
value='attack'
{CLEAR_FOG 1 17 7 4}
[fire_event]
name=orc_commit_reserves
[/fire_event]
[fire_event]
name=orc_attack
[/fire_event]
{UNCLEAR_FOG}
[/case]
[case]
value='defend'
{CLEAR_FOG 1 17 7 4}
[fire_event]
name=orc_commit_reserves
[/fire_event]
[fire_event]
name=orc_defend
[/fire_event]
{UNCLEAR_FOG}
[/case]
[/switch]
[/then]
[/if]
[/event]
[event]
name=orc_commit_reserves
first_time_only=yes
{VARIABLE orc_reserve_used yes}
[modify_side]
side=4
{GOLD 200 320 420}
[/modify_side]
[modify_side]
side=5
{GOLD 200 240 380}
[/modify_side]
[/event]
[event]
name=orc_attack
first_time_only=no
[message]
id=Mutaf-uru
message= _ "These elves are nothing more than meat for my troops! Get them!" #TODO ESR
[/message]
[modify_ai]
side=4
action=add
path=goal
[cfg]
[criteria]
race=elf
[/criteria]
value=2
[/cfg]
[/modify_ai]
[modify_ai]
side=5
action=add
path=goal
[cfg]
[criteria]
race=elf
[/criteria]
value=2
[/cfg]
[/modify_ai]
[/event]
[event]
name=orc_defend
first_time_only=no
[message]
id=Mutaf-uru
message= _ "Stupid elves! Let us wait for the main part of our grand army" #TODO ESR
[/message]
[modify_ai]
side=4
action=add
path=aspect['aggression'].facet
[cfg]
value=0.3
[/cfg]
[/modify_ai]
[modify_ai]
side=4
action=add
path=aspect['caution'].facet
[cfg]
value=0.4
[/cfg]
[/modify_ai]
[modify_ai]
side=5
action=add
path=aspect['aggression'].facet
[cfg]
value=0.3
[/cfg]
[/modify_ai]
[modify_ai]
side=5
action=add
path=aspect['caution'].facet
[cfg]
value=0.4
[/cfg]
[/modify_ai]
[modify_ai]
side=4
action=add
path=goal
[cfg]
[criteria]
id=Mutaf-uru
[/criteria]
value=200
[/cfg]
[/modify_ai]
[modify_ai]
side=5
action=add
path=goal
[cfg]
[criteria]
id=Mutaf-uru
[/criteria]
value=200
[/cfg]
[/modify_ai]
[/event]
#### /Orc AI ####
#### Player's code ####
[event]
@ -258,7 +626,7 @@
#### Kalenz arrives ####
#wml_disabled_lint: validate-on
[event]
name="time over"
name="time over"
[modify_turns]
#ifdef EASY
@ -272,8 +640,8 @@
#endif
[/modify_turns]
{MODIFY_UNIT (side=1
x=1-99
{MODIFY_UNIT (side=1
x=1-99
y=1-99) side 2}
[store_villages]
@ -287,7 +655,7 @@
x=$villages[$village].x
y=$villages[$village].y
[/capture_village]
{NEXT village}
{NEXT village}
{CLEAR_VARIABLE villages}
@ -297,8 +665,7 @@
x=recall
y=recall
[/unstore_unit]
{NEXT elf}
{NEXT elf}
{CLEAR_VARIABLE kalenz}
@ -361,10 +728,10 @@
#TODO ESR
speaker=narrator
image=wesnoth-icon.png
message= _ "For days, Kalenz traveled with his small host of followers, moving closer and closer to Ka'lian... Thanks to the dense fog, he was able to evade the orcs who were trying to hunt down his small company. Then, the north wind blew, and the fog finally lifted..."
message= _ "For days, Kalenz traveled with his small host of followers, moving closer and closer to Ka'lian... Thanks to the dense fog, he was able to evade the orcs who were trying to hunt down his small company. Then, the north wind blew, and the fog finally lifted..."
[/message]
[message]
#TODO ESR
#TODO ESR
id=Kalenz
message= _ "Oh no! The Ka'lian is under attack! We must help them!"
[/message]
@ -384,31 +751,35 @@
message= _ "Then you have not heard. King Haldric has broken the treaty. The humans will not come to our help!"
[/message]
#TODO: CRAB add strategy selection
[message]
#TODO ESR
id=Mutaf-uru
message= _ "What's that? More meat for my troops? Get them!"
[/message]
[modify_side]
side=3
{GOLD 200 280 460}
[/modify_side]
[modify_side]
side=4
{GOLD 200 360 500}
[/modify_side]
[fire_event]
name=orcs_select_strategy
[/fire_event]
[modify_ai]
side=2
action=add
path=goal
[cfg]
[criteria]
id=Mutaf-uru
[or]
id=Murudin
[/or]
[/criteria]
value=2
[/cfg]
[/modify_ai]
[event]
name="time over"
name="time over"
[message]
id=Kalenz
#TODO ESR
#TODO ESR
message= _ "We have lost for some reason!"
[/message]
[/event]
[/event]
#### /Kalenz arrives ####
[event]
name=prestart
@ -421,6 +792,11 @@
description= _ "Turns run out"
condition=win
[/objective]
[objective]
description= _ "<span color='gold'>Bonus objective:</span>
<span color='#00ff00'>Defeat Urudin </span>"
condition=win
[/objective]
[/objectives]
[/event]
@ -429,23 +805,23 @@
[scroll_to]
x,y=31,26
[/scroll_to]
#TODO ESR : the player should know : 1) that the elves have learned that the orcish attack is imminent. 2) that elves expect elven reinforcements, so they holed up in the Ka'lian until they come.
#NOTE ESR : The initial player's objective is 'hold until end of turns' - i.e. 'hold until those reinforcement arrive'. Of course, those reinforcements won't arrive (maybe, because of the attack on the treasury). Luckily for the elves, Kalenz will arrive instead, and save the day.
#TODO ESR : the player should know : 1) that the elves have learned that the orcish attack is imminent. 2) that elves expect elven reinforcements, so they holed up in the Ka'lian until they come.
#NOTE ESR : The initial player's objective is 'hold until end of turns' - i.e. 'hold until those reinforcement arrive'. Of course, those reinforcements won't arrive (maybe, because of the attack on the treasury). Luckily for the elves, Kalenz will arrive instead, and save the day.
[delay]
time=3000 #this delay is to give the player the sightseening opportunity
[/delay]
[scroll_to_unit]
id=orc_leader
id=orcish_slayer
[/scroll_to_unit]
{MOVE_UNIT (id=orc_leader) 29 15}
{MOVE_UNIT (id=orcish_slayer) 29 15}
[message]
id=guard
#TODO ESR
#TODO ESR
message= _ "Watch out! Someone is sneaking around in the mist."
[/message]
[message]
id=orc_leader
#TODO ESR
id=orcish_slayer
#TODO ESR
message= _ "Hand over the stone and we <i>might</i> not destroy your pinky Elvencitadel and we <i>might</i> spare you. Or, at the very least, we'll give you a quick and painless death."
[/message]
[message]
@ -454,63 +830,63 @@
message= _ "What stone? The Ka'lian is older than you foul creatures walk under the sun and it was never raided. It will still stand after the last of you beasts have vanished and your wrongdoings are long forgotten."
[/message]
{MOVE_UNIT (id=orc_leader) 29 17}
{MOVE_UNIT (id=orcish_slayer) 29 17}
[terrain]
terrain = Gg^Dr
x,y=29,17
terrain = Gg^Dr
x,y=29,17
[/terrain]
{MOVE_UNIT (id=orc_leader) 29 17}
{MOVE_UNIT (id=orcish_slayer) 29 17}
[message]
id=orc_leader
#TODO ESR
id=orcish_slayer
#TODO ESR
message= _ "Punch his arrogant words back down his throat!"
[/message]
{GENERIC_UNIT 3 "Orcish Assassin" 25 19}
{GENERIC_UNIT 5 "Orcish Assassin" 25 19}
{MOVE_UNIT (x,y=25,19) 27 21}
{GENERIC_UNIT 3 "Orcish Assassin" 25 18}
{GENERIC_UNIT 5 "Orcish Assassin" 25 18}
{MOVE_UNIT (x,y=25,18) 29 19}
{GENERIC_UNIT 4 "Orcish Assassin" 21 21}
{GENERIC_UNIT 4 "Orcish Assassin" 21 21}
{MOVE_UNIT (x,y=21,21) 24 22}
{GENERIC_UNIT 4 "Orcish Assassin" 19 23}
{GENERIC_UNIT 4 "Orcish Assassin" 19 23}
{MOVE_UNIT (x,y=19,23) 24 23}
{GENERIC_UNIT 4 "Orcish Assassin" 20 24}
{GENERIC_UNIT 4 "Orcish Assassin" 20 24}
{MOVE_UNIT (x,y=20,24) 23 25}
{GENERIC_UNIT 4 "Orcish Assassin" 20 26}
{GENERIC_UNIT 4 "Orcish Assassin" 20 26}
{MOVE_UNIT (x,y=20,26) 24 26}
{GENERIC_UNIT 4 "Orcish Assassin" 21 32}
{GENERIC_UNIT 4 "Orcish Assassin" 21 32}
{MOVE_UNIT (x,y=21,32) 25 30}
{GENERIC_UNIT 4 "Orcish Assassin" 28 34}
{GENERIC_UNIT 4 "Orcish Assassin" 28 34}
{MOVE_UNIT (x,y=28,34) 30 31}
{GENERIC_UNIT 4 "Orcish Assassin" 35 34}
{GENERIC_UNIT 4 "Orcish Assassin" 35 34}
{MOVE_UNIT (x,y=35,34) 32 31}
{GENERIC_UNIT 4 "Orcish Assassin" 34 34}
{GENERIC_UNIT 4 "Orcish Assassin" 34 34}
{MOVE_UNIT (x,y=34,34) 32 32}
{GENERIC_UNIT 3 "Orcish Assassin" 38 19}
{GENERIC_UNIT 5 "Orcish Assassin" 38 19}
{MOVE_UNIT (x,y=38,19) 36 21}
{GENERIC_UNIT 3 "Orcish Assassin" 41 22}
{GENERIC_UNIT 5 "Orcish Assassin" 41 22}
{MOVE_UNIT (x,y=41,22) 38 23}
{GENERIC_UNIT 3 "Orcish Assassin" 41 23}
{GENERIC_UNIT 5 "Orcish Assassin" 41 23}
{MOVE_UNIT (x,y=41,23) 39 25}
{GENERIC_UNIT 3 "Orcish Assassin" 42 26}
{GENERIC_UNIT 5 "Orcish Assassin" 42 26}
{MOVE_UNIT (x,y=42,26) 38 26}
[message]
id=Galtrid
#TODO ESR
#TODO ESR
message= _ "To arms, brothers and sisters! Hopefully, our army will return to aid us soon."
[/message]
[scroll_to]
@ -531,38 +907,36 @@
{GENERIC_UNIT 1 "Elvish Archer" 33 29}
#village grabbers
{GENERIC_UNIT 3 "Wolf Rider" 25 13}
{GENERIC_UNIT 5 "Wolf Rider" 25 13}
{GENERIC_UNIT 4 "Wolf Rider" 13 16}
#spotter
{GENERIC_UNIT 3 "Wolf Rider" 20 9}
{GENERIC_UNIT 5 "Wolf Rider" 20 9}
{GENERIC_UNIT 4 "Wolf Rider" 16 16}
#second wave - north
{GENERIC_UNIT 5 "Orcish Archer" 26 13}
{GENERIC_UNIT 5 "Orcish Grunt" 27 13}
{GENERIC_UNIT 5 "Orcish Grunt" 29 13}
{GENERIC_UNIT 5 "Orcish Archer" 30 13}
{GENERIC_UNIT 3 "Orcish Archer" 26 13}
{GENERIC_UNIT 3 "Orcish Grunt" 27 13}
{GENERIC_UNIT 3 "Orcish Grunt" 29 13}
{GENERIC_UNIT 3 "Orcish Archer" 30 13}
#second wave - east
{GENERIC_UNIT 5 "Orcish Archer" 41 21}
{GENERIC_UNIT 5 "Orcish Grunt" 42 22}
{GENERIC_UNIT 5 "Orcish Grunt" 43 25}
{GENERIC_UNIT 5 "Orcish Archer" 43 26}
{GENERIC_UNIT 3 "Orcish Archer" 41 21}
{GENERIC_UNIT 3 "Orcish Grunt" 42 22}
{GENERIC_UNIT 3 "Orcish Grunt" 43 25}
{GENERIC_UNIT 3 "Orcish Archer" 43 26}
#second wave - west
{GENERIC_UNIT 5 "Orcish Archer" 19 23}
{GENERIC_UNIT 5 "Orcish Grunt" 19 25}
{GENERIC_UNIT 5 "Orcish Grunt" 19 26}
{GENERIC_UNIT 5 "Orcish Archer" 19 27}
{GENERIC_UNIT 3 "Orcish Archer" 19 23}
{GENERIC_UNIT 3 "Orcish Grunt" 19 25}
{GENERIC_UNIT 3 "Orcish Grunt" 19 26}
{GENERIC_UNIT 3 "Orcish Archer" 19 27}
#second wave - south
{GENERIC_UNIT 5 "Orcish Archer" 29 38}
{GENERIC_UNIT 5 "Orcish Grunt" 30 37}
{GENERIC_UNIT 5 "Orcish Grunt" 32 37}
{GENERIC_UNIT 5 "Orcish Archer" 33 38}
{GENERIC_UNIT 3 "Orcish Archer" 29 38}
{GENERIC_UNIT 3 "Orcish Grunt" 30 37}
{GENERIC_UNIT 3 "Orcish Grunt" 32 37}
{GENERIC_UNIT 3 "Orcish Archer" 33 38}
[/event]
[event]
@ -635,6 +1009,11 @@
[/not]
[/filter]
[/store_unit]
{CLEAR_VARIABLE orc_reserve_used}
{CLEAR_VARIABLE orc_battlefield_strategy}
#undef ORC_BATTLEFIELD_EVALUATION
#undef ORC_BATTLEFIELD_EVALUATION_SUCCESS
#undef ORC_BATTLEFIELD_EVALUATION_FAILURE
[/event]
{campaigns/Legend_of_Wesmere/utils/deaths.cfg}

View file

@ -1,43 +1,58 @@
#define AI_ASPECT ID VALUE
#macro to define a simple facet of ai aspect
#define AI_ASPECT ID FACETID VALUE
#macro to define a named facet of ai aspect
[aspect]
id={ID}
[facet]
id=simple
id={FACETID}
value={VALUE}
[/facet]
[/aspect]
#enddef
#define AI_ALWAYS_ASPECT ID VALUE
#macro to add aspect[ID].facet['always'] with value VALUE which is always active
{AI_ASPECT {ID} "always" {VALUE}}
#enddef
#define AI_ASPECT_FOR_TIME_OF_DAY ID FACETID TIMEOFDAY VALUE
#macro to define a simple facet of ai aspect which has an id of FACETID an is active during time of day TIMEOFDAY
#macro to define a facet of ai aspect[ID] which has an id of FACETID an is active during time of day TIMEOFDAY
[aspect]
id={ID}
[facet]
id={FACETID}
time_of_day={TIMEOFDAY}
value={VALUE}
time_of_day={TIMEOFDAY}
[/facet]
[/aspect]
#enddef
#define AI_NIGHT_ASPECT ID VALUE
#macro to add aspect[ID].facet['night'] with value VALUE which is active during the night
{AI_ASPECT_FOR_TIME_OF_DAY {ID} "night" "dusk,first_watch,second_watch" {VALUE} }
#enddef
#define AI_NO_SCOUTS
# Macro to make an AI team not recruit scouts.
{AI_ASPECT villages_per_scout 0}
#define AI_DAY_ASPECT ID VALUE
#macro to add aspect[ID].facet['day'] with value VALUE which is active during the night
{AI_ASPECT_FOR_TIME_OF_DAY {ID} "day" "dawn,morning,afternoon" {VALUE} }
#enddef
# #define AI_CANDIDATE_ACTION_POISONING
# [candidate_action]
# engine=fai
# name=poisoner
# type=attack
# [filter]
# me="filter( input, 'me', filter(me.attacks,'att',filter(att.special,'spe',contains_string(spe,'poison'))))"
# target="filter( input, 'target', target.undead = 0 and target.hitpoints > 5 and index_of('poisoned',keys(target.states)) = -1)"
# [/filter]
# evaluation="{ai/formula/poisoner_eval.fai}"
# action="{ai/formula/poisoner_attack.fai}"
# [/candidate_action]
# #enddef
#define AI_NO_SCOUTS
#Macro to make an AI team not recruit scouts.
{AI_SIMPLE_ASPECT villages_per_scout 0}
#enddef
#define AI_CANDIDATE_ACTION_POISONING
[candidate_action]
engine=fai
name=poisoner
type=attack
[filter]
me="filter( input, 'me', filter(me.attacks,'att',filter(att.special,'spe',contains_string(spe,'poison'))))"
target="filter( input, 'target', target.undead = 0 and target.hitpoints > 5 and index_of('poisoned',keys(target.states)) = -1)"
[/filter]
evaluation="{ai/formula/poisoner_eval.fai}"
action="{ai/formula/poisoner_attack.fai}"
[/candidate_action]
#enddef