rework of ai macros comments,
...added a macro to limit attack_depth depending on difficulty level
This commit is contained in:
parent
f36decea40
commit
22c6537c93
1 changed files with 70 additions and 110 deletions
|
@ -6,12 +6,11 @@
|
|||
############################################################
|
||||
|
||||
|
||||
####
|
||||
# modify ai, add facet to an aspect
|
||||
#
|
||||
# example: {MODIFY_AI_ADD_ASPECT 1 aggression (id=always value=0.5)}
|
||||
# example: {MODIFY_AI_ADD_ASPECT 1 leader_goal (id=always [value]x=1 y=2[/value])}
|
||||
#define MODIFY_AI_ADD_ASPECT SIDE ASPECT_ID FACET
|
||||
# modify ai, add facet to an aspect
|
||||
#
|
||||
# example: {MODIFY_AI_ADD_ASPECT 1 aggression (id=always value=0.5)}
|
||||
# example: {MODIFY_AI_ADD_ASPECT 1 leader_goal (id=always [value]x=1 y=2[/value])}
|
||||
|
||||
[modify_ai]
|
||||
side={SIDE}
|
||||
|
@ -22,10 +21,8 @@
|
|||
#enddef
|
||||
|
||||
|
||||
####
|
||||
# modify ai, add stage
|
||||
#
|
||||
#define MODIFY_AI_ADD_STAGE SIDE STAGE
|
||||
# modify ai, add stage
|
||||
|
||||
[modify_ai]
|
||||
side={SIDE}
|
||||
|
@ -36,10 +33,8 @@
|
|||
#enddef
|
||||
|
||||
|
||||
####
|
||||
# modify ai, add goal
|
||||
#
|
||||
#define MODIFY_AI_ADD_GOAL SIDE GOAL
|
||||
# modify ai, add goal
|
||||
|
||||
[modify_ai]
|
||||
side={SIDE}
|
||||
|
@ -50,10 +45,8 @@
|
|||
#enddef
|
||||
|
||||
|
||||
####
|
||||
# modify ai, add candidate action to a stage
|
||||
#
|
||||
#define MODIFY_AI_ADD_CANDIDATE_ACTION SIDE CANDIDATE_ACTION
|
||||
# modify ai, add candidate action to a stage
|
||||
|
||||
[modify_ai]
|
||||
side={SIDE}
|
||||
|
@ -69,11 +62,10 @@
|
|||
############################################################
|
||||
|
||||
|
||||
####
|
||||
# modify ai, delete facet from aspect
|
||||
#
|
||||
# example: {MODIFY_AI_DELETE_ASPECT 1 aggression night}
|
||||
#define MODIFY_AI_DELETE_ASPECT SIDE ASPECT_ID FACET_ID
|
||||
# modify ai, delete facet from aspect
|
||||
#
|
||||
# example: {MODIFY_AI_DELETE_ASPECT 1 aggression night}
|
||||
|
||||
[modify_ai]
|
||||
side={SIDE}
|
||||
|
@ -83,12 +75,11 @@
|
|||
#enddef
|
||||
|
||||
|
||||
####
|
||||
# modify ai, delete a stage
|
||||
#
|
||||
# example: {MODIFY_AI_DELETE_STAGE 1 fallback}
|
||||
# example: {MODIFY_AI_DELETE_STAGE 1 3}
|
||||
#define MODIFY_AI_DELETE_STAGE SIDE STAGE_ID
|
||||
# modify ai, delete a stage
|
||||
#
|
||||
# example: {MODIFY_AI_DELETE_STAGE 1 fallback}
|
||||
# example: {MODIFY_AI_DELETE_STAGE 1 3}
|
||||
|
||||
[modify_ai]
|
||||
side={SIDE}
|
||||
|
@ -98,12 +89,11 @@
|
|||
#enddef
|
||||
|
||||
|
||||
####
|
||||
# modify ai, delete a goal
|
||||
#
|
||||
# example: {MODIFY_AI_DELETE_GOAL 1 kill_undead}
|
||||
# example: {MODIFY_AI_DELETE_GOAL 1 0}
|
||||
#define MODIFY_AI_DELETE_GOAL SIDE GOAL_ID
|
||||
# modify ai, delete a goal
|
||||
#
|
||||
# example: {MODIFY_AI_DELETE_GOAL 1 kill_undead}
|
||||
# example: {MODIFY_AI_DELETE_GOAL 1 0}
|
||||
|
||||
|
||||
[modify_ai]
|
||||
|
@ -114,12 +104,11 @@
|
|||
#enddef
|
||||
|
||||
|
||||
####
|
||||
# modify ai, delete candidate action from a stage
|
||||
#
|
||||
# example: {MODIFY_AI_DELETE_CANDIDATE_ACTION 1 special_poisoning_formula}
|
||||
# example: {MODIFY_AI_DELETE_CANDIDATE_ACTION 1 0}
|
||||
#define MODIFY_AI_DELETE_CANDIDATE_ACTION SIDE STAGE_ID CANDIDATE_ACTION_ID
|
||||
# modify ai, delete candidate action from a stage
|
||||
#
|
||||
# example: {MODIFY_AI_DELETE_CANDIDATE_ACTION 1 special_poisoning_formula}
|
||||
# example: {MODIFY_AI_DELETE_CANDIDATE_ACTION 1 0}
|
||||
|
||||
[modify_ai]
|
||||
side={SIDE}
|
||||
|
@ -135,7 +124,7 @@
|
|||
|
||||
|
||||
#define AI_ASPECT ASPECT_ID FACET
|
||||
#macro to define a named facet of ai aspect
|
||||
#macro to define a named facet of ai aspect
|
||||
[aspect]
|
||||
id={ASPECT_ID}
|
||||
{FACET}
|
||||
|
@ -149,10 +138,8 @@
|
|||
# note: simple aspects are supposed to be used without a preamble
|
||||
|
||||
|
||||
####
|
||||
# simple aspect
|
||||
#
|
||||
#define AI_SIMPLE_ASPECT ASPECT_ID FACET_ID VALUE
|
||||
# simple aspect with value=VALUE
|
||||
|
||||
{AI_ASPECT {ASPECT_ID}
|
||||
(
|
||||
|
@ -164,19 +151,15 @@
|
|||
#enddef
|
||||
|
||||
|
||||
####
|
||||
# simple aspect which is always active
|
||||
#
|
||||
#define AI_SIMPLE_ALWAYS_ASPECT ASPECT_ID VALUE
|
||||
# simple aspect which is always active
|
||||
|
||||
{AI_SIMPLE_ASPECT {ASPECT_ID} "always" {VALUE}}
|
||||
#enddef
|
||||
|
||||
|
||||
####
|
||||
# simple aspect which is active during a specified time of day
|
||||
#
|
||||
#define AI_SIMPLE_ASPECT_FOR_TIME_OF_DAY ASPECT_ID FACET_ID TIMEOFDAY VALUE
|
||||
# simple aspect which is active during a specified time of day
|
||||
|
||||
{AI_ASPECT {ASPECT_ID}
|
||||
(
|
||||
|
@ -189,28 +172,22 @@
|
|||
#enddef
|
||||
|
||||
|
||||
####
|
||||
# simple aspect which is active during the night
|
||||
#
|
||||
#define AI_SIMPLE_NIGHT_ASPECT ASPECT_ID VALUE
|
||||
# simple aspect which is active during the night
|
||||
|
||||
{AI_SIMPLE_ASPECT_FOR_TIME_OF_DAY {ASPECT_ID} "night" "dusk,first_watch,second_watch" {VALUE} }
|
||||
#enddef
|
||||
|
||||
|
||||
####
|
||||
# simple aspect which is active during the day
|
||||
#
|
||||
#define AI_SIMPLE_DAY_ASPECT ASPECT_ID VALUE
|
||||
# simple aspect which is active during the day
|
||||
|
||||
{AI_SIMPLE_ASPECT_FOR_TIME_OF_DAY {ASPECT_ID} "day" "dawn,morning,afternoon" {VALUE} }
|
||||
#enddef
|
||||
|
||||
|
||||
####
|
||||
# simple aspect
|
||||
#
|
||||
#define AI_SIMPLE_ASPECT_VALUE ASPECT_ID FACET_ID VALUE
|
||||
# simple aspect
|
||||
|
||||
{AI_ASPECT {ASPECT_ID}
|
||||
(
|
||||
|
@ -224,19 +201,15 @@
|
|||
#enddef
|
||||
|
||||
|
||||
####
|
||||
# simple aspect which is always active
|
||||
#
|
||||
#define AI_SIMPLE_ALWAYS_ASPECT_VALUE ASPECT_ID VALUE
|
||||
# simple aspect which is always active
|
||||
|
||||
{AI_SIMPLE_ASPECT_VALUE {ASPECT_ID} "always" {VALUE}}
|
||||
#enddef
|
||||
|
||||
|
||||
####
|
||||
# simple aspect which is active during a specified time of day
|
||||
#
|
||||
#define AI_SIMPLE_ASPECT_FOR_TIME_OF_DAY_VALUE ASPECT_ID FACET_ID TIMEOFDAY VALUE
|
||||
# simple aspect which is active during a specified time of day
|
||||
|
||||
{AI_ASPECT {ASPECT_ID}
|
||||
(
|
||||
|
@ -251,19 +224,15 @@
|
|||
#enddef
|
||||
|
||||
|
||||
####
|
||||
# simple aspect which is active during the night
|
||||
#
|
||||
#define AI_SIMPLE_NIGHT_ASPECT_VALUE ASPECT_ID VALUE
|
||||
# simple aspect which is active during the night
|
||||
|
||||
{AI_SIMPLE_ASPECT_FOR_TIME_OF_DAY_VALUE {ASPECT_ID} "night" "dusk,first_watch,second_watch" {VALUE} }
|
||||
#enddef
|
||||
|
||||
|
||||
####
|
||||
# simple aspect which is active during the day
|
||||
#
|
||||
#define AI_SIMPLE_DAY_ASPECT_VALUE ASPECT_ID VALUE
|
||||
# simple aspect which is active during the day
|
||||
|
||||
{AI_SIMPLE_ASPECT_FOR_TIME_OF_DAY_VALUE {ASPECT_ID} "day" "dawn,morning,afternoon" {VALUE} }
|
||||
#enddef
|
||||
|
@ -273,10 +242,8 @@
|
|||
# ASPECTS - SIMPLE - ADD (NO PREAMBLE NEEDED)
|
||||
############################################################
|
||||
|
||||
####
|
||||
# modify ai, add simple facet to an aspect
|
||||
#
|
||||
#define MODIFY_AI_ADD_SIMPLE_ASPECT SIDE ASPECT_ID FACET_ID VALUE
|
||||
# modify ai, add simple facet to an aspect
|
||||
|
||||
{MODIFY_AI_ADD_ASPECT {SIDE} {ASPECT_ID}
|
||||
(
|
||||
|
@ -289,19 +256,15 @@
|
|||
|
||||
|
||||
|
||||
####
|
||||
# modify ai, add simple aspect which is always active
|
||||
#
|
||||
#define MODIFY_AI_ADD_SIMPLE_ALWAYS_ASPECT SIDE ASPECT_ID VALUE
|
||||
# modify ai, add simple aspect which is always active
|
||||
|
||||
{MODIFY_AI_ADD_SIMPLE_ASPECT {SIDE} {ASPECT_ID} "always" {VALUE}}
|
||||
#enddef
|
||||
|
||||
|
||||
####
|
||||
# modify ai, add simple aspect which is active during a specified time of day
|
||||
#
|
||||
#define MODIFY_AI_ADD_SIMPLE_ASPECT_FOR_TIME_OF_DAY SIDE ASPECT_ID FACET_ID TIMEOFDAY VALUE
|
||||
# modify ai, add simple aspect which is active during a specified time of day
|
||||
|
||||
{MODIFY_AI_ADD_ASPECT {SIDE} {ASPECT_ID}
|
||||
(
|
||||
|
@ -314,29 +277,23 @@
|
|||
#enddef
|
||||
|
||||
|
||||
####
|
||||
# modify ai, add simple aspect which is active during the night
|
||||
#
|
||||
#define MODIFY_AI_ADD_SIMPLE_NIGHT_ASPECT SIDE ASPECT_ID VALUE
|
||||
# modify ai, add simple aspect which is active during the night
|
||||
|
||||
{MODIFY_AI_ADD_SIMPLE_ASPECT_FOR_TIME_OF_DAY {SIDE} {ASPECT_ID} "night" "dusk,first_watch,second_watch" {VALUE} }
|
||||
#enddef
|
||||
|
||||
|
||||
####
|
||||
# modify ai, add simple aspect which is active during the day
|
||||
#
|
||||
#define MODIFY_AI_ADD_SIMPLE_DAY_ASPECT SIDE ASPECT_ID VALUE
|
||||
# modify ai, add simple aspect which is active during the day
|
||||
|
||||
{MODIFY_AI_ADD_SIMPLE_ASPECT_FOR_TIME_OF_DAY {SIDE} {ASPECT_ID} "day" "dawn,morning,afternoon" {VALUE} }
|
||||
#enddef
|
||||
|
||||
|
||||
|
||||
####
|
||||
# modify ai, add simple facet to an aspect
|
||||
#
|
||||
#define MODIFY_AI_ADD_SIMPLE_ASPECT_VALUE SIDE ASPECT_ID FACET_ID VALUE
|
||||
# modify ai, add simple facet to an aspect
|
||||
|
||||
{MODIFY_AI_ADD_ASPECT {SIDE} {ASPECT_ID}
|
||||
(
|
||||
|
@ -351,19 +308,15 @@
|
|||
|
||||
|
||||
|
||||
####
|
||||
# modify ai, add simple aspect which is always active
|
||||
#
|
||||
#define MODIFY_AI_ADD_SIMPLE_ALWAYS_ASPECT_VALUE SIDE ASPECT_ID VALUE
|
||||
# modify ai, add simple aspect which is always active
|
||||
|
||||
{MODIFY_AI_ADD_SIMPLE_ASPECT_VALUE {SIDE} {ASPECT_ID} "always" {VALUE}}
|
||||
#enddef
|
||||
|
||||
|
||||
####
|
||||
# modify ai, add simple aspect which is active during a specified time of day
|
||||
#
|
||||
#define MODIFY_AI_ADD_SIMPLE_ASPECT_FOR_TIME_OF_DAY_VALUE SIDE ASPECT_ID FACET_ID TIMEOFDAY VALUE
|
||||
# modify ai, add simple aspect which is active during a specified time of day
|
||||
|
||||
{MODIFY_AI_ADD_ASPECT {SIDE} {ASPECT_ID}
|
||||
(
|
||||
|
@ -378,38 +331,49 @@
|
|||
#enddef
|
||||
|
||||
|
||||
####
|
||||
# modify ai, add simple aspect which is active during the night
|
||||
#
|
||||
#define MODIFY_AI_ADD_SIMPLE_NIGHT_ASPECT_VALUE SIDE ASPECT_ID VALUE
|
||||
# modify ai, add simple aspect which is active during the night
|
||||
|
||||
{MODIFY_AI_ADD_SIMPLE_ASPECT_FOR_TIME_OF_DAY_VALUE {SIDE} {ASPECT_ID} "night" "dusk,first_watch,second_watch" {VALUE} }
|
||||
#enddef
|
||||
|
||||
|
||||
####
|
||||
# modify ai, add simple aspect which is active during the day
|
||||
#
|
||||
#define MODIFY_AI_ADD_SIMPLE_DAY_ASPECT_VALUE SIDE ASPECT_ID VALUE
|
||||
# modify ai, add simple aspect which is active during the day
|
||||
|
||||
{MODIFY_AI_ADD_SIMPLE_ASPECT_FOR_TIME_OF_DAY_VALUE {SIDE} {ASPECT_ID} "day" "dawn,morning,afternoon" {VALUE} }
|
||||
#enddef
|
||||
|
||||
|
||||
####
|
||||
# make the AI team not recruit scouts.
|
||||
#
|
||||
#define AI_NO_SCOUTS
|
||||
# make the AI team not recruit scouts.
|
||||
|
||||
{AI_SIMPLE_ALWAYS_ASPECT villages_per_scout 0}
|
||||
#enddef
|
||||
|
||||
|
||||
#define AI_SCALE_ATTACK_DEPTH_BY_DIFFICULTY
|
||||
# change attack depth depending on difficulty
|
||||
#ifdef EASY
|
||||
{AI_SIMPLE_ALWAYS_ASPECT attack_depth 3}
|
||||
#endif
|
||||
|
||||
#ifdef MEDIUM
|
||||
{AI_SIMPLE_ALWAYS_ASPECT attack_depth 4}
|
||||
#endif
|
||||
|
||||
#ifdef HARD
|
||||
{AI_SIMPLE_ALWAYS_ASPECT attack_depth 5}
|
||||
#endif
|
||||
|
||||
#enddef
|
||||
|
||||
############################################################
|
||||
# NO RECRUITMENT
|
||||
############################################################
|
||||
|
||||
#define AI_NO_RECRUITMENT
|
||||
# disable recruitment
|
||||
[facet]
|
||||
id="always"
|
||||
[value]
|
||||
|
@ -435,6 +399,7 @@
|
|||
#enddef
|
||||
|
||||
#define AI_SIMPLE_FORMULA_AI_EXPERIMENTAL_RECRUITMENT
|
||||
#enable new formula-ai recruitment made by Dragonking (experimental!)
|
||||
{AI_ASPECT recruitment {AI_FORMULA_AI_EXPERIMENTAL_RECRUITMENT} }
|
||||
#enddef
|
||||
|
||||
|
@ -443,10 +408,8 @@
|
|||
############################################################
|
||||
|
||||
|
||||
####
|
||||
# poisoners should spread poison around
|
||||
#
|
||||
#define AI_CANDIDATE_ACTION_POISONING
|
||||
# candidate action for poisoners to spread poison around
|
||||
|
||||
[candidate_action]
|
||||
engine=fai
|
||||
|
@ -482,32 +445,29 @@
|
|||
[/facet]
|
||||
#enddef
|
||||
|
||||
####
|
||||
# move and be free;
|
||||
#
|
||||
#define AI_ASPECT_LEADER_GOAL_MOVE_TO X Y
|
||||
# leader goal: move to X Y and be free
|
||||
|
||||
{_AI_ASPECT_LEADER_GOAL_MOVE_TO {X} {Y} "yes"}
|
||||
#enddef
|
||||
|
||||
|
||||
####
|
||||
# move and stay;
|
||||
#
|
||||
#define AI_ASPECT_LEADER_GOAL_MOVE_TO_AND_STAY_THERE X Y
|
||||
# leader goal: move to X Y and stay there
|
||||
|
||||
{_AI_ASPECT_LEADER_GOAL_MOVE_TO {X} {Y} "no"}
|
||||
#enddef
|
||||
|
||||
|
||||
####
|
||||
# AI leader goal "always" is cleared
|
||||
#
|
||||
#define CLEAR_AI_ALWAYS_ASPECT_LEADER_GOAL SIDE
|
||||
# clear AI leader goal "always"
|
||||
|
||||
{MODIFY_AI_DELETE_ASPECT {SIDE} leader_goal always}
|
||||
#enddef
|
||||
|
||||
############################################################
|
||||
# AI CONTROLLER SUPPORT
|
||||
############################################################
|
||||
|
||||
#define AI_CONTROLLER_ALLOW_LEADER_CONTROL SIDE_CONTROLLER SIDE_CONTROLLED
|
||||
|
||||
|
@ -544,7 +504,7 @@
|
|||
[/if]
|
||||
|
||||
[event]
|
||||
name=victory
|
||||
name=victory #TODO: any scenario change
|
||||
[set_menu_item]
|
||||
id=ai_controller_leader_control_{SIDE_CONTROLLED}
|
||||
[show_if]
|
||||
|
|
Loading…
Add table
Reference in a new issue