-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathReferenceBot.py
More file actions
31 lines (22 loc) · 845 Bytes
/
ReferenceBot.py
File metadata and controls
31 lines (22 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import reflib.nphlt as hlt
import logging
from reflib.resolver import Resolver
from reflib.movement import Combatant, MoveMaker, Moveset
# logging.basicConfig(filename='wtf.info', level=logging.DEBUG, filemode="w")
game_map = hlt.ImprovedGameMap(8)
hlt.send_init("ReferenceBot")
game_map.get_frame()
game_map.update()
k = 1.5 - game_map.num_enemies * 0.1
bord_eval = MoveMaker(game_map, wait=4, glob_k=k)
combatant = Combatant(4)
resolver = Resolver(game_map)
while True:
# logging.debug('TURN ------------' + str(game_map.turn))
game_map.update()
moveset = Moveset(game_map)
moveset = combatant.decide_combat_moves(game_map, moveset)
moveset = bord_eval.decide_noncombat_moves(game_map, moveset)
moveset = resolver.resolve(game_map, moveset)
hlt.send_frame(moveset.process_moves())
game_map.get_frame()