This repository has been archived by the owner on Jul 31, 2021. It is now read-only.
forked from roguelike2d/TekkenBot
-
Notifications
You must be signed in to change notification settings - Fork 4
/
BotData.py
38 lines (30 loc) · 1.47 KB
/
BotData.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
31
32
33
34
35
36
37
38
from TekkenGameState import TekkenGameState
from BasicCommands import BotCommands
class BotBehaviors:
def Basic(gameState, botCommands):
BotBehaviors.StopPressingButtonsAfterGettingHit(gameState, botCommands)
BotBehaviors.GetUp(gameState, botCommands)
BotBehaviors.TechCombos(gameState, botCommands)
def StopPressingButtonsAfterGettingHit(gameState, botCommands):
if gameState.IsBotStartedGettingHit():
botCommands.ClearCommands()
if gameState.IsBotStartedBeingThrown():
botCommands.ClearCommands()
def TechThrows(gameState, botCommands):
if gameState.IsBotBeingThrown():
botCommands.ThrowTech()
def GetUp(gameState, botCommands):
if gameState.IsBotOnGround():
botCommands.GetUp()
def TechCombos(gameState, botCommands):
if gameState.IsBotBeingJuggled():
botCommands.MashTech()
def BlockAllAttacks(gameState: TekkenGameState, botCommands:BotCommands):
if gameState.IsOppAttacking():
if gameState.IsOppAttackLow():
botCommands.BlockLowFull(max(0, gameState.GetOppTimeUntilImpact()))
else:
botCommands.BlockMidFull(max(0, gameState.GetOppTimeUntilImpact()))
def UnblockIncomingAttacks(self, gameState: TekkenGameState):
if gameState.IsOppAttacking():
self.botCommands.WalkForward(max(0, gameState.GetOppTimeUntilImpact()))