Skip to content

Commit

Permalink
Add Doctor with static blast and shock therapy actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Pazdikan committed Jan 19, 2025
1 parent 8a0ecc5 commit 3b54a61
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/core/behavior.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from time import time
import data
from random import randint

import core.killer.universal as universal
import core.killer.trapper as trapper
import core.killer.blight as blight
import core.killer.doctor as doctor

debug = True

Expand Down Expand Up @@ -34,4 +36,13 @@ def perform_ingame_action():
random_action = randint(0, 0)

if random_action == 0:
blight.rush()
blight.rush()

elif (selected_killer == data.Killer.DOCTOR):
if (doctor.static_blast_used == None or time() - doctor.static_blast_used > 50):
doctor.static_blast()
else:
random_action = randint(0, 0)

if random_action == 0:
doctor.shock_therapy()
26 changes: 26 additions & 0 deletions src/core/killer/doctor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import pyautogui
from time import sleep, time
from util.console import log

static_blast_used = None

def static_blast():
log("Doctor action: Static Shock")

global static_blast_used
static_blast_used = time()

pyautogui.keyDown("ctrlleft")
sleep(3)
pyautogui.keyUp("ctrlleft")

sleep(3)

def shock_therapy():
log("Doctor action: Shock Therapy")

pyautogui.mouseDown(button="right")
sleep(2)
pyautogui.mouseUp(button="right")

sleep(3)
2 changes: 1 addition & 1 deletion src/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
ss = None

State = Enum('State', ['INGAME', 'INLOBBY', 'INQUEUE'])
Killer = Enum('Killer', ['OTHER', "TRAPPER", "BLIGHT"])
Killer = Enum('Killer', ['OTHER', "TRAPPER", "BLIGHT", "DOCTOR"])

current_state = State.INLOBBY

Expand Down

0 comments on commit 3b54a61

Please sign in to comment.