Fix more recruitment-pattern glitches.

This commit is contained in:
Eric S. Raymond 2008-11-26 19:08:51 +00:00
parent 4941b95378
commit 46ca08eb38
7 changed files with 24 additions and 11 deletions

View file

@ -82,7 +82,11 @@
{ATTACK_DEPTH 4 5 6}
passive_leader=yes
simple_targetting=yes
#ifdef EASY
recruitment_pattern=scout,fighter,fighter,archer
#else
recruitment_pattern=scout,fighter,fighter,mixed fighter,archer
#endif
villages_per_scout=0
village_value=0
[target]

View file

@ -45,7 +45,7 @@
aggression=0.8
caution=0.2
village_value=10
recruitment_pattern=scout,fighter,fighter,archer,mixed fighter,archer
recruitment_pattern=scout,fighter,fighter,mixed fighter
recruitment_ignore_bad_movement=yes
recruitment_ignore_bad_combat=yes
#grouping causes the dwarves to wait for the elves, who move slower
@ -62,7 +62,7 @@
aggression=1.0
caution=0.0
village_value=10
recruitment_pattern=scout,fighter,fighter,archer,mixed fighter,archer
recruitment_pattern=scout,fighter,fighter,mixed fighter
recruitment_ignore_bad_movement=yes
recruitment_ignore_bad_combat=yes
grouping=none

View file

@ -101,7 +101,7 @@
side=3
canrecruit=yes
[ai]
recruitment_pattern=scout, fighter, fighter, fighter, mixed fighter, archer
recruitment_pattern=scout, fighter, fighter, fighter, mixed fighter
aggression=1.0
villages_per_scout=10
[target]

View file

@ -107,11 +107,9 @@
#ifdef EASY
recruit=Footpad, Thug, Poacher
#endif
#ifdef NORMAL
recruit=Footpad, Thug, Outlaw, Poacher
#endif
#ifdef HARD
recruit=Footpad, Thug, Outlaw, Bandit, Poacher, Trapper
#endif

View file

@ -76,7 +76,11 @@
canrecruit=yes
[ai]
#ifdef EASY
recruitment_pattern=fighter
#else
recruitment_pattern=fighter,archer
#endif
{QUANTITY aggression 0.5 0.6 0.7}
{ATTACK_DEPTH 3 4 5}
[target]
@ -114,7 +118,7 @@
canrecruit=yes
[ai]
recruitment_pattern=fighter,scout,archer
recruitment_pattern=mixed fighter,scout,archer
{QUANTITY aggression 0.2 0.3 0.4}
[target]
id=Ethiliel

View file

@ -81,8 +81,11 @@
#endif
[ai]
recruitment_pattern=scout, healer, archer, scout, archer
#ifdef HARD
recruitment_pattern=scout, healer, scout, archer
#else
recruitment_pattern=scout, healer, scout
#endif
aggression=0.75
caution=0.1

View file

@ -725,20 +725,24 @@ def consistency_check():
"Consistency-check state information picked up by sanity_check"
derivedlist = map(lambda x: x[2], derived_units)
baselist = map(lambda x: x[3], derived_units)
derivations = dict(zip(derivedlist, baselist))
for (filename, recruitdict, patterndict) in sides:
for (rdifficulty, (rl, recruit)) in recruitdict.items():
utypes = []
for rtype in recruit:
base = rtype
if rtype not in unit_types:
# Assume WML coder knew what he was doing if macro reference
if not rtype.startswith("{"):
print '"%s", line %d: %s is not a known unit type' % (filename, rl, rtype)
continue
elif rtype not in usage:
if not rtype in derivedlist:
if rtype in derivedlist:
base = derivations[rtype]
else:
print '"%s", line %d: %s has no usage type' % (filename, rl, rtype)
continue
utype = usage[rtype]
utype = usage[base]
utypes.append(utype)
for (pdifficulty, (pl, recruit_pattern)) in patterndict.items():
if condition_match(pdifficulty, rdifficulty):
@ -760,7 +764,7 @@ def consistency_check():
if utype not in utypes:
rshow = '.'
if rdifficulty is not None:
rshow = ' and difficulty ' + rdifficulty + '.'
rshow = ' at difficulty ' + rdifficulty + '.'
print '"%s", line %d: no %s units recruitable%s' % (filename, pl, utype, rshow)
if movetypes:
for (unit_id, filename, line, movetype) in unit_movetypes: