fai -> wfl in FormulaAI files

This commit is contained in:
Celtic Minstrel 2016-07-29 12:49:13 -04:00
parent 53fd31554a
commit 95c4556a59
14 changed files with 1649 additions and 26 deletions

1623
data/ai/formula/engine.lua Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
fai 'level_up_attack_move.fai'
wfl 'level_up_attack_move.fai'
# Score will be the probability * 100 of attacker unit (me) killing target unit #
# (target) if attacker can level up and if the highest probable outcome #
@ -25,4 +25,4 @@ if(calc_exp(target.level) > (me.max_experience - me.experience),
-5)
where battle_outcome = calculate_outcome(me.loc, get_best_defense_loc(my_moves.moves, me, target), target.loc)
faiend
wflend

View file

@ -1,4 +1,4 @@
fai 'level_up_attack_move.fat'
wfl 'level_up_attack_move.fat'
# If move is chosen, attacker (me) will attack enemy unit (target) from the hex #
# with highest defensive value. This move will only be chosen if the attacker #
@ -7,4 +7,4 @@ fai 'level_up_attack_move.fat'
attack(me.loc, get_best_defense_loc(my_moves.moves, me, target), target.loc)
faiend
wflend

View file

@ -1,4 +1,4 @@
fai 'ai/formula/lib/map_evaluation.fai' #===== Evaluation how good unit is on a map ===== #
wfl 'ai/formula/lib/map_evaluation.fai' #===== Evaluation how good unit is on a map ===== #
# filter out important locations #
@ -104,4 +104,4 @@ def units_average_defense(ai*, units_list, terrain_min_percent)
units_list
);
faiend
wflend

View file

@ -1,4 +1,4 @@
fai 'ai/formula/lib/recruitment.fai'
wfl 'ai/formula/lib/recruitment.fai'
def recruit_army(ai*,unit_map)
choose(
@ -29,4 +29,4 @@ def recruit_army(ai*,unit_map)
faiend
wflend

View file

@ -1,4 +1,4 @@
fai 'ai/formula/lib/util.fai'
wfl 'ai/formula/lib/util.fai'
def sumarize_values( input_map )
sum(
@ -49,4 +49,4 @@ def sumarize_maps_values( map_A, map_B )
value + map_A[key]
);
faiend
wflend

View file

@ -1,4 +1,4 @@
fai 'new_recruitment.fai'
wfl 'new_recruitment.fai'
{ai/formula/lib/map_evaluation.fai}
{ai/formula/lib/util.fai}
@ -365,4 +365,4 @@ if( vars.side_terrain,
)
faiend
wflend

View file

@ -1,4 +1,4 @@
fai 'patrol.fai'
wfl 'patrol.fai'
def closest_unit(ai*, me)
choose(
@ -70,4 +70,4 @@ where path_to = if( enemy_units,
shortest_path( me.loc, closest_unit(self, me).loc ),
[]
)
faiend
wflend

View file

@ -1,4 +1,4 @@
fai 'poisoner_attack.fai'
wfl 'poisoner_attack.fai'
def get_best_defense_loc(moves, attacker, enemy)
choose(filter(map(filter(moves, src=attacker.loc), dst),
@ -10,4 +10,4 @@ def get_best_defense_loc(moves, attacker, enemy)
where att_weap = index_of(['poison'],map(me.attacks,specials))
faiend
wflend

View file

@ -1,4 +1,4 @@
fai 'poisoner_eval.fai'
wfl 'poisoner_eval.fai'
{AI_CA_COMBAT_SCORE} + 100 +
#rate units with regeneration as worse targets #
@ -26,5 +26,5 @@ if( target.abilities,
0
)
faiend
wflend

View file

@ -1,4 +1,4 @@
fai 'recruitment.fai'
wfl 'recruitment.fai'
{ai/formula/lib/map_evaluation.fai}
{ai/formula/lib/util.fai}
@ -332,4 +332,4 @@ if( vars.side_terrain,
)
faiend
wflend

View file

@ -1,4 +1,4 @@
fai 'scouting_eval.fai'
wfl 'scouting_eval.fai'
if(me.loc = my_leader.loc,
-5,
@ -12,4 +12,4 @@ if( me.max_moves > 5,
where enemies_in_range = filter( enemy_units, 'enemy', distance_between( me.loc, enemy.loc ) < me.max_moves),
shroud = find_shroud()
faiend
wflend

View file

@ -1,4 +1,4 @@
fai 'scouting_move.fai'
wfl 'scouting_move.fai'
if(size(villages) != 0,
move(me.loc, nearest_loc(nearest_loc(me.loc,villages),unit_moves(me.loc))),
@ -6,4 +6,4 @@ if(size(villages) != 0,
where villages = filter(unit_moves(me.loc),is_unowned_village(map,x,y)),
shroud = find_shroud()
faiend
wflend

View file

@ -1,4 +1,4 @@
fai 'lurker_moves.fai'
wfl 'lurker_moves.fai'
# run_file('ai/micro_ais/engines/lurker_moves.fai') #
def is_swamp(map, xx, yy)
@ -45,4 +45,4 @@ where possible_attacks = reachable_enemies_next_to_swamp( me.loc, my_attacks,map
where swamp_in_reach = reachable_swamp(me.loc,map)
faiend
wflend