Author: esr
Date: Wed Nov 26 16:37:38 2008
New Revision: 31091

URL: http://svn.gna.org/viewcvs/wesnoth?rev=31091&view=rev
Log:
A round of fixes for recruitment-pattern mismatches.

Modified:
    
trunk/data/campaigns/Heir_To_The_Throne/scenarios/05a_Muff_Malal_Peninsula.cfg
    
trunk/data/campaigns/Heir_To_The_Throne/scenarios/08_The_Princess_of_Wesnoth.cfg
    trunk/data/campaigns/Heir_To_The_Throne/scenarios/09_The_Valley_of_Death.cfg
    trunk/data/campaigns/Heir_To_The_Throne/scenarios/20a_North_Elves.cfg
    trunk/data/campaigns/Legend_of_Wesmere/scenarios/11_Battle_of_the_book.cfg
    
trunk/data/campaigns/Under_the_Burning_Suns/scenarios/02_Across_the_Harsh_Sands.cfg
    
trunk/data/campaigns/Under_the_Burning_Suns/scenarios/04_Descending_into_Darkness.cfg
    
trunk/data/campaigns/Under_the_Burning_Suns/scenarios/06b_In_the_Domain_of_Dwarves.cfg
    trunk/data/tools/wmllint

Modified: 
trunk/data/campaigns/Heir_To_The_Throne/scenarios/05a_Muff_Malal_Peninsula.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Heir_To_The_Throne/scenarios/05a_Muff_Malal_Peninsula.cfg?rev=31091&r1=31090&r2=31091&view=diff
==============================================================================
--- 
trunk/data/campaigns/Heir_To_The_Throne/scenarios/05a_Muff_Malal_Peninsula.cfg 
(original)
+++ 
trunk/data/campaigns/Heir_To_The_Throne/scenarios/05a_Muff_Malal_Peninsula.cfg 
Wed Nov 26 16:37:38 2008
@@ -67,11 +67,7 @@
         recruit=Vampire Bat,Walking Corpse,Dark Adept
 #endif
         [ai]
-#ifdef HARD
-            
recruitment_pattern=fighter,fighter,fighter,fighter,fighter,fighter,fighter,archer
-#else
             
recruitment_pattern=scout,fighter,fighter,fighter,fighter,fighter,fighter,fighter,archer
-#endif
             grouping=no
             aggression=1.0
             caution=-1.0

Modified: 
trunk/data/campaigns/Heir_To_The_Throne/scenarios/08_The_Princess_of_Wesnoth.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Heir_To_The_Throne/scenarios/08_The_Princess_of_Wesnoth.cfg?rev=31091&r1=31090&r2=31091&view=diff
==============================================================================
--- 
trunk/data/campaigns/Heir_To_The_Throne/scenarios/08_The_Princess_of_Wesnoth.cfg
 (original)
+++ 
trunk/data/campaigns/Heir_To_The_Throne/scenarios/08_The_Princess_of_Wesnoth.cfg
 Wed Nov 26 16:37:38 2008
@@ -104,10 +104,10 @@
             #she's a smart leader and thinks deeply
             {ATTACK_DEPTH 4 5 5}
 #ifdef EASY
-            recruitment_pattern=scout,mixed fighter,fighter,fighter
+            recruitment_pattern=scout,mixed fighter,fighter,fighter,archer
 #endif
 #ifdef NORMAL
-            recruitment_pattern=scout,mixed fighter,fighter,fighter
+            recruitment_pattern=scout,mixed fighter,fighter,fighter,archer
 #endif
 #ifdef HARD
             recruitment_pattern=scout,mixed 
fighter,fighter,fighter,fighter,archer

Modified: 
trunk/data/campaigns/Heir_To_The_Throne/scenarios/09_The_Valley_of_Death.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Heir_To_The_Throne/scenarios/09_The_Valley_of_Death.cfg?rev=31091&r1=31090&r2=31091&view=diff
==============================================================================
--- 
trunk/data/campaigns/Heir_To_The_Throne/scenarios/09_The_Valley_of_Death.cfg 
(original)
+++ 
trunk/data/campaigns/Heir_To_The_Throne/scenarios/09_The_Valley_of_Death.cfg 
Wed Nov 26 16:37:38 2008
@@ -128,10 +128,10 @@
         {GOLD 200 400 600}
         [ai]
 #ifdef EASY
-            recruitment_pattern=fighter
+            recruitment_pattern=scout,fighter
 #endif
 #ifdef NORMAL
-            recruitment_pattern=fighter
+            recruitment_pattern=fighter,scout
 #endif
 #ifdef HARD
             recruitment_pattern=fighter,fighter,fighter,scout

Modified: trunk/data/campaigns/Heir_To_The_Throne/scenarios/20a_North_Elves.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Heir_To_The_Throne/scenarios/20a_North_Elves.cfg?rev=31091&r1=31090&r2=31091&view=diff
==============================================================================
--- trunk/data/campaigns/Heir_To_The_Throne/scenarios/20a_North_Elves.cfg 
(original)
+++ trunk/data/campaigns/Heir_To_The_Throne/scenarios/20a_North_Elves.cfg Wed 
Nov 26 16:37:38 2008
@@ -138,9 +138,9 @@
             passive_leader=yes
             simple_targetting=yes
 #ifndef HARD
-            recruitment_pattern=scout,fighter,fighter,mixed fighter
+            recruitment_pattern=scout,fighter,fighter,mixed fighter,archer
 #else
-            recruitment_pattern=scout,fighter,fighter,mixed fighter,healer
+            recruitment_pattern=scout,fighter,fighter,mixed 
fighter,healer,archer
 #endif
             villages_per_scout=0
             village_value=0

Modified: 
trunk/data/campaigns/Legend_of_Wesmere/scenarios/11_Battle_of_the_book.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Legend_of_Wesmere/scenarios/11_Battle_of_the_book.cfg?rev=31091&r1=31090&r2=31091&view=diff
==============================================================================
--- trunk/data/campaigns/Legend_of_Wesmere/scenarios/11_Battle_of_the_book.cfg 
(original)
+++ trunk/data/campaigns/Legend_of_Wesmere/scenarios/11_Battle_of_the_book.cfg 
Wed Nov 26 16:37:38 2008
@@ -65,7 +65,7 @@
         canrecruit=yes
         controller=ai
 #ifdef EASY
-        recruit=Troll Rocklobber,Troll Whelp,
+        recruit=Troll Rocklobber,Troll Whelp
 #else
         recruit=Troll,Troll Rocklobber, Troll Warrior
 #endif

Modified: 
trunk/data/campaigns/Under_the_Burning_Suns/scenarios/02_Across_the_Harsh_Sands.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Under_the_Burning_Suns/scenarios/02_Across_the_Harsh_Sands.cfg?rev=31091&r1=31090&r2=31091&view=diff
==============================================================================
--- 
trunk/data/campaigns/Under_the_Burning_Suns/scenarios/02_Across_the_Harsh_Sands.cfg
 (original)
+++ 
trunk/data/campaigns/Under_the_Burning_Suns/scenarios/02_Across_the_Harsh_Sands.cfg
 Wed Nov 26 16:37:38 2008
@@ -64,7 +64,7 @@
 #endif
 
 #ifdef NORMAL
-            recruitment_pattern=fighter,mixed fighter,archer,fighter
+            recruitment_pattern=fighter,mixed fighter,archer,scout,fighter
 #endif
 
 #ifdef HARD

Modified: 
trunk/data/campaigns/Under_the_Burning_Suns/scenarios/04_Descending_into_Darkness.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Under_the_Burning_Suns/scenarios/04_Descending_into_Darkness.cfg?rev=31091&r1=31090&r2=31091&view=diff
==============================================================================
--- 
trunk/data/campaigns/Under_the_Burning_Suns/scenarios/04_Descending_into_Darkness.cfg
 (original)
+++ 
trunk/data/campaigns/Under_the_Burning_Suns/scenarios/04_Descending_into_Darkness.cfg
 Wed Nov 26 16:37:38 2008
@@ -82,7 +82,7 @@
 #endif
 
 #ifdef NORMAL
-            recruitment_pattern=scout,scout,fighter,fighter,fighter
+            recruitment_pattern=scout,scout,fighter,fighter,fighter,archer
 #endif
 
 #ifdef HARD

Modified: 
trunk/data/campaigns/Under_the_Burning_Suns/scenarios/06b_In_the_Domain_of_Dwarves.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Under_the_Burning_Suns/scenarios/06b_In_the_Domain_of_Dwarves.cfg?rev=31091&r1=31090&r2=31091&view=diff
==============================================================================
--- 
trunk/data/campaigns/Under_the_Burning_Suns/scenarios/06b_In_the_Domain_of_Dwarves.cfg
 (original)
+++ 
trunk/data/campaigns/Under_the_Burning_Suns/scenarios/06b_In_the_Domain_of_Dwarves.cfg
 Wed Nov 26 16:37:38 2008
@@ -128,7 +128,7 @@
         user_team_name=_"Enemies"
 
 #ifdef EASY
-        recruit=Dwarvish Fighter, Dwarvish Steelclad, Dwarvish Thunderer, 
Dwarvish Berserker, Dwarvish Thunderguard, Dwarvish Guardsman, Dwarvish 
Pathfinder,
+        recruit=Dwarvish Fighter, Dwarvish Steelclad, Dwarvish Thunderer, 
Dwarvish Berserker, Dwarvish Thunderguard, Dwarvish Guardsman, Dwarvish 
Pathfinder
 #endif
 
 #ifdef NORMAL

Modified: trunk/data/tools/wmllint
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wmllint?rev=31091&r1=31090&r2=31091&view=diff
==============================================================================
--- trunk/data/tools/wmllint (original)
+++ trunk/data/tools/wmllint Wed Nov 26 16:37:38 2008
@@ -703,6 +703,24 @@
             lines = [lines[w-1].lstrip()] + lines[:w-1] + lines[w:]
     return lines
 
+def condition_match(p, q):
+    "Do two condition-states match?"
+    # The empty condition state is represented by None 
+    if p is None or q is None or (p == q):
+        return True
+    # Past this point it's all about handling cases with negation
+    sp = p
+    np = False
+    if sp.startswith("!"):
+        sp = sp[1:]
+        np = True
+    sq = q
+    nq = False
+    if sq.startswith("!"):
+        sq = sp[1:]
+        nq == True
+    return (sp != sq) and (np != nq)
+
 def consistency_check():
     "Consistency-check state information picked up by sanity_check"
     #utypes = {}
@@ -722,7 +740,7 @@
                     continue
                 utype = usage[rtype]
                 for (pdifficulty, (pl, recruit_pattern)) in 
patterndict.items():
-                    if pdifficulty is None or rdifficulty is None or 
pdifficulty == rdifficulty or ((rdifficulty[0]=="!") == 
((pdifficulty[0]=="!"))):
+                    if condition_match(pdifficulty, rdifficulty):
                         #utypes[rdifficulty].append(utype)
                         if utype not in recruit_pattern:
                             rshow = ''


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to