Merge branch 'master' of github.com:wesnoth/wesnoth-old
This commit is contained in:
commit
2aa6c2477c
4 changed files with 34 additions and 9 deletions
|
@ -1,4 +1,6 @@
|
|||
Version 1.11.8+dev:
|
||||
* AI:
|
||||
* Wolves Micro AI: new optional parameter attack_only_prey=
|
||||
* Campaigns:
|
||||
* Heir to the Throne:
|
||||
* Gave Li'sar a new ability "initiative" (grants adjacent allies first
|
||||
|
|
|
@ -346,14 +346,33 @@ function wesnoth.wml_actions.micro_ai(cfg)
|
|||
|
||||
elseif (cfg.ai_type == 'wolves') then
|
||||
required_keys = { "filter", "filter_second" }
|
||||
optional_keys = { "avoid_type" }
|
||||
optional_keys = { "attack_only_prey", "avoid_type" }
|
||||
local score = cfg.ca_score or 90000
|
||||
CA_parms = {
|
||||
{ ca_id = "mai_wolves_move", location = 'ai/micro_ais/cas/ca_wolves_move.lua', score = score },
|
||||
{ ca_id = "mai_wolves_wander", location = 'ai/micro_ais/cas/ca_wolves_wander.lua', score = score - 1 }
|
||||
}
|
||||
|
||||
if cfg.avoid_type then
|
||||
if cfg.attack_only_prey then
|
||||
local wolves_aspects = {
|
||||
{
|
||||
aspect = "attacks",
|
||||
facet = {
|
||||
name = "ai_default_rca::aspect_attacks",
|
||||
id = "dont_attack",
|
||||
invalidate_on_gamestate_change = "yes",
|
||||
{ "filter_enemy", {
|
||||
{ "and", H.get_child(cfg, "filter_second") }
|
||||
} }
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cfg.action == "delete") then
|
||||
delete_aspects(cfg.side, wolves_aspects)
|
||||
else
|
||||
add_aspects(cfg.side, wolves_aspects)
|
||||
end
|
||||
elseif cfg.avoid_type then
|
||||
local wolves_aspects = {
|
||||
{
|
||||
aspect = "attacks",
|
||||
|
|
|
@ -1169,7 +1169,6 @@ def html_postprocess_file(filename, isocode, batchlist):
|
|||
else:
|
||||
eids[1].append(e)
|
||||
|
||||
|
||||
for i in xrange(2):
|
||||
eras = eids[i]
|
||||
eras.sort(key = lambda x: x[2])
|
||||
|
|
|
@ -102,17 +102,17 @@ def list_contents():
|
|||
info[-1]["name"] = name
|
||||
info[-1]["units"] = "?"
|
||||
info[-1]["translations"] = {}
|
||||
|
||||
info[-1]["translations"] = {}
|
||||
|
||||
for isocode in languages:
|
||||
translation = html_output.Translation(options.transdir, isocode)
|
||||
def translate(string, domain):
|
||||
return translation.translate(string, domain)
|
||||
if c:
|
||||
info[-1]["translations"][isocode] = c.get_text_val("name",
|
||||
translation = translate)
|
||||
t = c.get_text_val("name", translation = translate)
|
||||
else:
|
||||
info[-1]["translations"][isocode] = translate(name, domain)
|
||||
t = translate(name, domain)
|
||||
if t != info[-1]["name"]:
|
||||
info[-1]["translations"][isocode] = t
|
||||
|
||||
def list_eras(addon):
|
||||
eras = local.wesnoth.parser.get_all(tag = "era")
|
||||
|
@ -260,6 +260,7 @@ def list_contents():
|
|||
info["eras"] = list_eras(addon)
|
||||
info["campaigns"] = list_campaigns(addon)
|
||||
info["version"] = version
|
||||
info["dependencies"] = get_dependencies(addon)
|
||||
sys.stdout.write("ok\n")
|
||||
except wmlparser2.WMLError as e:
|
||||
ef = open(logname, "w")
|
||||
|
@ -371,6 +372,8 @@ def batch_process():
|
|||
worked = True
|
||||
else:
|
||||
worked = (move(options.addons, options.config_dir + "/data/add-ons", name) == 0)
|
||||
for d in addon.get("dependencies", []):
|
||||
move(options.addons, options.config_dir + "/data/add-ons", d)
|
||||
d = options.output + "/" + name
|
||||
try: os.makedirs(d)
|
||||
except OSError: pass
|
||||
|
@ -418,6 +421,8 @@ def batch_process():
|
|||
finally:
|
||||
if name != "mainline":
|
||||
move(options.config_dir + "/data/add-ons", options.addons, name)
|
||||
for d in addon.get("dependencies", []):
|
||||
move(options.config_dir + "/data/add-ons", options.addons, d)
|
||||
|
||||
addon["parsed"] = True
|
||||
|
||||
|
@ -516,7 +521,7 @@ if __name__ == '__main__':
|
|||
|
||||
if not options.output and not options.wiki:
|
||||
sys.stderr.write("Need --output (or --wiki).\n")
|
||||
op.print_help()
|
||||
ap.print_help()
|
||||
sys.exit(-1)
|
||||
|
||||
if options.output:
|
||||
|
|
Loading…
Add table
Reference in a new issue