-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Pazdikan/refactor-to-multiple-files
Refactor to multiple files and rewrite readme
- Loading branch information
Showing
11 changed files
with
321 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from time import time | ||
from enum import Enum | ||
|
||
# THIS IS NOT THE CONFIGURATION YOU ARE LOOKING FOR | ||
# SCROLL DOWN TO FIND THE CONFIGURATION FOR USERS | ||
|
||
ss = None | ||
|
||
State = Enum('State', ['INGAME', 'INLOBBY', 'INQUEUE']) | ||
Killer = Enum('Killer', ['OTHER', "TRAPPER"]) | ||
|
||
current_state = State.INLOBBY | ||
|
||
games = 0 | ||
xp = 0 | ||
total_time_in_game = 0 | ||
|
||
script_start_time = time() | ||
game_started_at = None | ||
|
||
# CONFIGURATION FOR USERS | ||
# EDITING STUFF BETWEEN COMMENTS BELOW IS SAFE AND WILL NOT BREAK THE SCRIPT | ||
|
||
killer = Killer.TRAPPER # From the list above | ||
|
||
xp_limit = 0 # SET TO 0 TO DISABLE | ||
games_limit = 0 # SET TO 0 TO DISABLE | ||
|
||
# END OF CONFIGURATION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import config | ||
from random import randint | ||
|
||
import killer.universal as universal | ||
import killer.trapper as trapper | ||
|
||
def perform_ingame_action(): | ||
if (config.killer == config.Killer.OTHER): | ||
universal.walk_and_attack() | ||
|
||
elif (config.killer == config.Killer.TRAPPER): | ||
random_action = randint(0, 5) | ||
|
||
if random_action == 0: | ||
universal.walk_and_attack() | ||
else: | ||
trapper.place_and_pick_trap() |
Oops, something went wrong.