Commit graph

1020 commits

Author SHA1 Message Date
mattsc
ec11244c1e Recruiting Micro AIs: rename variables
This is necessary because there is now no distinction between
parameters passed as keys or tags in the [micro_ai] tag setup functions
for all MAIs.  No change in functionality.
2013-07-02 13:18:20 -07:00
mattsc
417a3bb42d [micro_ai] tag setup functions: clean up to eliminate lots of duplicate code
As a side effect, key ca_id= is now an optional parameter for all MAIs.
 It did not make sense to disentangle this into a separate commit.
2013-07-02 13:18:20 -07:00
mattsc
d92d96fd07 Guardian and Patrol MAI: check if unit exists even for Behavior CAs
This works around a bug which causes BCAs not to be removed when a
scenario is reloaded from a middle-of-scenario save.
2013-06-27 13:27:29 -07:00
mattsc
1e02ffc77b Zone Guardian MAI: ensure functionality even if no goal hex is found
In that case, the guardian stays put where it is.
2013-06-27 12:24:45 -07:00
mattsc
79f2147034 Zone Guardian MAI: only use reachable zone hexes as goals for the unit
This is done so that the unit does not leave the zone in order to get
to a far away zone hex.  Exception: if none of the zone hexes are
reachable, then all of them are possible goals, so that the unit moves
toward the zone.
2013-06-27 12:04:36 -07:00
mattsc
59f90c5338 Fix indenting 2013-06-27 07:49:37 -07:00
mattsc
3b3b16ce55 Patrols MAI scenario: add a second Micro AI type (zone guardian) to Side 2
This demonstrates how to set up several MAIs for the same side.
2013-06-27 07:05:17 -07:00
mattsc
e6f69ae056 All MAIs: add optional existing_engine parameter to engine init function
This lets us add the Micro AI candidate actions to an already existing
Lua AI engine and thus combine several MAIs.
2013-06-26 19:15:28 -07:00
mattsc
3e5e317954 Guardians MAI: rename internal engine functions
No change of functionality.  This is done to ensure that function names
are unique, a necessary step toward making different MAIs combinable.
2013-06-26 19:03:32 -07:00
mattsc
6e40d48970 Healer Support MAI: rename internal engine functions
No change of functionality.  This is done to ensure that function names
are unique, a necessary step toward making different MAIs combinable.
2013-06-26 18:52:19 -07:00
mattsc
09bb809e73 Bottleneck MAI: rename internal engine functions
No change of functionality.  This is done to ensure that function names
are unique, a necessary step toward making different MAIs combinable.
2013-06-26 18:23:36 -07:00
mattsc
0caee11712 Goto MAI: rename internal engine functions
No change of functionality.  This is done to ensure that function names
are unique, a necessary step toward making different MAIs combinable.
2013-06-26 17:32:00 -07:00
mattsc
2741dd297b Animals MAIs: rename internal engine functions
No change of functionality.  This is done to ensure that function names
are unique, a necessary step toward making different MAIs combinable.
2013-06-26 15:17:12 -07:00
mattsc
5f5206465e Lurker MAI: rename internal engine functions
No change of functionality.  This is done to ensure that function names
are unique, a necessary step toward making different MAIs combinable.
2013-06-26 15:00:59 -07:00
mattsc
493af0053b Patrol MAI: rename internal engine functions
No change of functionality.  This is done to ensure that function names
are unique, a necessary step toward making different MAIs combinable.
2013-06-26 14:55:30 -07:00
mattsc
0d4383c4ac Messenger Escort MAI: rename internal engine functions
No change of functionality.  This is done to ensure that function names
are unique, a necessary step toward making different MAIs combinable.
2013-06-26 14:51:43 -07:00
mattsc
778ab615d1 Recruit MAIs: rename internal engine functions
No change of functionality.  This is done to ensure that function names
are unique, a necessary step toward making different MAIs combinable.
2013-06-26 14:32:15 -07:00
mattsc
e4bdb188e7 Protect Unit MAI: rename internal engine functions
No change of functionality.  This is done to ensure that function names
are unique, a necessary step toward making different MAIs combinable.
2013-06-26 14:31:21 -07:00
mattsc
b83e68711c Goto MAI: Ensure that persistent data always are in WML table format
This also means that keys cannot contain certain symbols and, as a
result, potentially user-provided strings need to be stored in the
values, not keys.  This fixes bug #20924 about the Goto MAI corrupting
saves.
2013-06-22 07:51:14 -07:00
mattsc
d11edb6ec7 Make Experimental AI available in MP and SP
This is done through a new macro EXPERIMENTAL_AI.  Previously, it was
only available as a multiplayer AI.
2013-06-14 20:35:31 -07:00
Alarantalara
62c2bbcb20 Merge AI-demo and mainline experimental recruit logic
Slight speed improvement when close to unowned vilages. Correct score
for time of day damage estimates for encountering the enemy near end of
game.
2013-06-14 18:03:44 -04:00
mattsc
bf3517d1e4 ExpAI: make recruiting work with all keys of [damage] special
Previously there would be an error, and subsequently no recruiting, if
the multiply= key was not set.
2013-06-13 07:51:06 -07:00
mattsc
66913d3aa8 Return Guardian MAI: bug fix for situation when return hex is occupied 2013-06-10 19:50:13 -07:00
Espreon
7bfe81e824 'End scenario' -> 'End Scenario'. 2013-06-08 20:11:26 -04:00
mattsc
e6ec4152d2 ExpAI: make recruiting work with all keys of [chance_to_hit] special
Previously there would be an error, and subsequently no recruiting, if
the value= key was not set.
2013-06-07 19:17:21 -07:00
mattsc
f06daf98fd Micro AIs: minor grammar fixes 2013-06-07 07:34:17 -07:00
mattsc
ec21fad877 Healer Support MAI: make [filter] work correctly when aggression=0
Previously, all healers were excluded from attacks when aggression=0
was set, not only those specified in [filter].
2013-06-07 06:48:55 -07:00
mattsc
2139c84188 Zone guardian MAI: add optional station_x,station_y= keys 2013-06-06 19:24:13 -07:00
mattsc
3fadf4cc31 Goto Micro AI: do not exclude leaders by default
The MAI accidentally excluded units with canrecruit=yes.  Thanks H-Hour.
2013-06-06 13:20:00 -07:00
flix
2965da1731 Add comments to data/ai/formula/new_recruitment.fai 2013-06-01 23:41:27 +03:00
flix/Felix Bauer
29e8584738 Add new aspect 'advancements'
As part of a GSoC proposal I added a new aspect so a scenario editor can control advancements in two ways:
1. Define a aspect with a string-value like "Swordsman, Knight", so the units of interesst will always advance to this
2. Use the LUA-Engine and return a function of the form advance(x, y) which will itself return a string-value
    like "Swordsman, Knight". Everytime a ai-unit advances advance(x, y) will be called.
The corresponding wikipage (http://wiki.wesnoth.org/AiWML) is going to be updated soon.
2013-06-01 17:21:12 +03:00
Espreon
3f20785d02 Split all of the AI-related strings (except for the AI controller's) into a new 'wesnoth-ai' textdomain. Includes a pot-update for 'wesnoth' as a side effect. 2013-05-22 22:19:43 -04:00
Espreon
edcf801caa Ran wmlindent. 2013-05-22 22:19:42 -04:00
Espreon
cadb752ccf Made various strings translatable; disambiguated and split some strings; eliminated an Earth name. 2013-05-22 22:19:42 -04:00
Espreon
5203d7d7b5 Filter for id instead of name; converted some tabs to spaces. 2013-05-22 18:02:43 -04:00
Espreon
30419e93c3 Marked various files as having no translatables. 2013-05-22 17:02:51 -04:00
Espreon
6278b6f312 Eliminated double spaces. 2013-05-20 20:33:53 -04:00
mattsc
29acfbd532 Recruiting AIs: add more combinations to terrain strings for finding keeps 2013-05-16 20:22:02 -07:00
mattsc
a44a9a0d45 Recruiting AIs: add more combinations to terrain strings for finding castles 2013-05-16 20:14:11 -07:00
mattsc
04f7993ed5 Micro and experimental AIs: turn off some debug output 2013-05-16 11:22:39 -07:00
jleldridge
8665d09ac4 Changed healer support mai to use new location_set.of_pairs() method to create avoid_map. 2013-05-16 00:21:40 -04:00
jleldridge
fc7455b81b Added ability for Healer Support mai to avoid certain tiles based on standard ai avoid aspect. 2013-05-14 16:08:12 -04:00
mattsc
78f753e4dc Revert "LuaAI: (1) persistent storage mechanism now available and working properly (2) old/incomplete mechanism not removed, subject to future deprecation"
This reverts commit 754f2c2b3d.
2013-05-13 13:15:22 -07:00
Dmitry K
754f2c2b3d LuaAI: (1) persistent storage mechanism now available and working properly (2) old/incomplete mechanism not removed, subject to future deprecation 2013-05-12 01:12:45 +03:00
jleldridge
7a2c8dbce2 Healer Support MAI: added [filter_second] option to choose healees. 2013-05-08 12:36:10 -04:00
mattsc
a5c8c92b9e Healer Support MAI: fix a typo in a comment 2013-05-06 18:37:58 -07:00
mattsc
ae71a23c7d Animals MAI test scenario: remove SLFs that always evaluate true 2013-05-03 12:25:52 -07:00
mattsc
e7a71a51d7 battle_calcs library: add functions best_defense_map() and get_attack_combos_subset() 2013-05-03 07:06:22 -07:00
mattsc
5fb4dd3816 battle_calcs relative_damage_map: enemy leader needs to have unity weight 2013-05-03 07:02:23 -07:00
mattsc
7e189c1d51 battle_calcs relative_damage_map: add own and enemy damage to output 2013-05-03 07:01:21 -07:00