Author: dragonking
Date: Mon Jul 28 02:14:13 2008
New Revision: 28244
URL: http://svn.gna.org/viewcvs/wesnoth?rev=28244&view=rev
Log:
Some changes to recruitment test scenario - now it is defaultAI vs formula
recruitment + defaultAI
Modified:
trunk/data/recruitment.fai
trunk/data/scenario-formula-recruitment.cfg
Modified: trunk/data/recruitment.fai
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/recruitment.fai?rev=28244&r1=28243&r2=28244&view=diff
==============================================================================
--- trunk/data/recruitment.fai (original)
+++ trunk/data/recruitment.fai Mon Jul 28 02:14:13 2008
@@ -10,14 +10,29 @@
choose( input_map, value ).value;
def change_numbers_to_percents( input_map )
- map( input_map, (value*100) / highest_value(input_map) );
+ map( input_map,
+ (value*100) / highest_value(input_map)
+ );
+
+def add_number_to_values( input_map, number )
+ map( input_map,
+ value + number
+ );
#make sure we have only positive values in a map #
def make_positive_only( input_map )
- if( lowest_value( input_map ) < 0, map( input_map, value +
abs(lowest_value( input_map ))), input_map );
+ if( lowest_value( input_map ) < 0,
+ add_number_to_values(
+ input_map,
+ abs(lowest_value(input_map))
+ ),
+ input_map
+ );
def sumarize_maps_values( map_A, map_B )
- map( map_A + map_B, value + map_A[key]);
+ map( map_A + map_B,
+ value + map_A[key]
+ );
#===== Evaluation how good unit is on a map ===== #
@@ -101,7 +116,7 @@
['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates'
-> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' ->
15, 'teleport' -> 10, 'steadfast' -> 15 ];
def weapon_specials_weights()
- [ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60
,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' ->
30, 'firststrike' -> 10, 'poison' -> 25 ];
+ [ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60
,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 50 ,'charge' -> 30 ,'drains' ->
30, 'firststrike' -> 10, 'poison' -> 25 ];
def apply_abilities_weights( units_map )
map( units_map, value + (value*max(map( get_unit_type( key ).abilities,
'ability', abilities_weights()[ability] )))/100 );
@@ -135,5 +150,12 @@
# ========== Main formula section ========== #
-[recruit(unit_chooser(self,recruitment_list_builder(eval(self),apply_abilities_weights(apply_weapon_specials_weights(evaluate_attackers(self))),apply_abilities_weights(apply_weapon_specials_weights(evaluate_defenders(self)))))),
-if( teams[my_side].gold>20, [], fallback('human')) ]
+
+if(my_leader.loc = loc(11,23),
+ if( teams[my_side].gold>20,
+
recruit(unit_chooser(self,recruitment_list_builder(eval(self),apply_abilities_weights(apply_weapon_specials_weights(evaluate_attackers(self))),apply_abilities_weights(apply_weapon_specials_weights(evaluate_defenders(self)))))),
+ fallback('default') ),
+ if(vars.check = turn,
+ [set_var('check', 0), fallback('default')],
+ [set_var('check', turn), move(my_leader.loc,
nearest_keep(my_leader.loc))])
+)
Modified: trunk/data/scenario-formula-recruitment.cfg
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/scenario-formula-recruitment.cfg?rev=28244&r1=28243&r2=28244&view=diff
==============================================================================
--- trunk/data/scenario-formula-recruitment.cfg (original)
+++ trunk/data/scenario-formula-recruitment.cfg Mon Jul 28 02:14:13 2008
@@ -46,7 +46,7 @@
canrecruit=1
recruit=Dwarvish Guardsman,Dwarvish Fighter,Dwarvish
Thunderer,Thief,Poacher,Footpad
gold=100
- controller=human
+ controller=ai
[/side]
[side]
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits