-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTestBrain.py
30 lines (26 loc) · 1.12 KB
/
TestBrain.py
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
from Brain import *
class TestBrain(Brain):
def __init__(self):
Brain.__init__(self, "TestBrain")
self.actions = [
[AttackMonster(), 4000],
[FixStatus(), 3000],
[RestoreHP(), 2500],
[SearchSpot(), 2000],
[OpenDoors(), 1750],
[DipForExcalibur(), 1600],
[GetPhatz(), 1500],
[Explore(), 1000],
[Descend(), 500],
[Search(), 400],
[RandomWalk(), 1],
]
def executeNext(self):
for action in [x[0] for x in sorted(self.actions, cmp=lambda x,y:y[1]-x[1])]:
Kernel.instance.log("### TestBrain -> "+str(action))
if action.can():
action.execute()
break
def s_isWeak(self):
Kernel.instance.log("Praying because I'm weak")
Kernel.instance.send("#pray\n")