NotQuiteParadise2

Source code for nqp.core.constants

from __future__ import annotations

from enum import auto, Enum, IntEnum
from pathlib import Path

VERSION: str = "0.0.1"

INFINITE: int = 999

# paths
ROOT_PATH = Path(__file__).parent.parent.parent  # constants.py is 2 directories deep
DATA_PATH = ROOT_PATH / "data/"
ASSET_PATH = ROOT_PATH / "assets/"
SAVE_PATH = DATA_PATH / "saves/"
DEBUGGING_PATH = ROOT_PATH / ".debug"
LOGGING_PATH = DEBUGGING_PATH / "logging"
PROFILING_PATH = DEBUGGING_PATH / "profiling"

# sizes
DEFAULT_IMAGE_SIZE = 16
GAP_SIZE = 10
TILE_SIZE = 16
BARRIER_SIZE = 10

# combat values
WEIGHT_SCALE = 5
DEFENSE_SCALE = 10
PUSH_FORCE = 14
CRIT_MOD = 2.5  # value to multiply by

# ai
PATH_UPDATE_FREQ = 0.4

# UI customisation
TEXT_FADE_OUT_SPEED = 0.5  # make sure it is slower than the fade in
TEXT_FADE_IN_SPEED = 4  # font messes up if this is greater than 4

IMG_FORMATS = ["png", "PNG", "jpg", "jpeg", "JPG"]  # acceptable image formats


# states
[docs]class GameState(IntEnum): LOADING = auto() PLAYING = auto() EXITING = auto()
[docs]class WorldState(IntEnum): CHOOSE_NEXT_ROOM = auto() COMBAT = auto() EVENT = auto() INN = auto() MOVING_NEXT_ROOM = auto() POST_COMBAT = auto() TRAINING = auto()
[docs]class CombatState(IntEnum): IDLE = auto() UNIT_CHOOSE_CARD = auto() UNIT_SELECT_TARGET = auto() ACTION_CHOOSE_CARD = auto() ACTION_SELECT_TARGET_FREE = auto() WATCH = auto() DEFEAT = auto() VICTORY = auto()
[docs]class TrainingState(IntEnum): IDLE = auto() CHOOSE_UPGRADE = auto() CHOOSE_TARGET_UNIT = auto()
[docs]class PostCombatState(IntEnum): DEFEAT = auto() VICTORY = auto() BOSS_VICTORY = auto()
[docs]class InnState(IntEnum): IDLE = auto() CHOOSE_UNIT = auto()
[docs]class EventState(IntEnum): IDLE = auto() SHOW_RESULT = auto()
[docs]class ChooseRoomState(IntEnum): IDLE = auto() CHOOSE_ROOM = auto() INSPECT_STATS = auto()
[docs]class AnimationState(IntEnum): PLAYING = auto() PAUSED = auto() FINISHED = auto()
[docs]class SceneType(IntEnum): MAIN_MENU = auto() VIEW_TROUPE = auto() RUN_SETUP = auto() DEV_DATA_EDITOR = auto() DEV_GALLERY = auto() WORLD = auto()
[docs]class RewardType(IntEnum): UNIT = auto() ACTION = auto() UPGRADE = auto() RESOURCE = auto()
[docs]class StatModifiedStatus(IntEnum): NONE = auto() POSITIVE = auto() NEGATIVE = auto() POSITIVE_AND_NEGATIVE = auto()
[docs]class Direction(IntEnum): UP = auto() DOWN = auto() LEFT = auto() RIGHT = auto()
[docs]class FontType(Enum): DEFAULT = auto() NEGATIVE = auto() DISABLED = auto() POSITIVE = auto() INSTRUCTION = auto() NOTIFICATION = auto()
[docs]class FontEffects(IntEnum): FADE_IN = auto() FADE_OUT = auto()
[docs]class GamepadButton(IntEnum): UP = auto() LEFT = auto() DOWN = auto() RIGHT = auto() NORTH = auto() EAST = auto() SOUTH = auto() WEST = auto() SELECT_OR_BACK = auto() START = auto() LEFT_SHOULDER_1 = auto() LEFT_SHOULDER_2 = auto() RIGHT_SHOULDER_1 = auto() RIGHT_SHOULDER_2 = auto() LEFT_STICK = auto() RIGHT_STICK = auto()
[docs]class GamepadAxes(IntEnum): LEFT_X = auto() LEFT_Y = auto() RIGHT_X = auto() RIGHT_Y = auto() DPAD_X = auto() DPAD_Y = auto()
[docs]class InputType(IntEnum): NONE = auto() KEYS = auto() # keyboard/gamepad MOUSE = auto()
[docs]class WindowType(IntEnum): BASIC = auto() FANCY = auto()
[docs]class EntityFacing(IntEnum): LEFT = auto() RIGHT = auto()
[docs]class GameSpeed(IntEnum): SLOW = 0.5 NORMAL = 1 FAST = 3 FASTEST = 5
[docs]class DamageType(IntEnum): MUNDANE = auto() MAGICAL = auto()
[docs]class Colour(Enum): # basics WHITE = (255, 255, 255) BLACK = (0, 0, 0) RED = (255, 0, 0) GREEN = (0, 255, 0) BLUE = (0, 0, 255) # specifics BLOOD_RED = (143, 3, 3) GREY_SMOKE = (63, 58, 71)
[docs]class ColourPalette(Enum): MAIN_DARK = (12, 13, 12) # black MAIN_MID = (55, 44, 71) # purple MAIN_LIGHT = (62, 63, 59) # grey ACCENT = (107, 74, 107) # light purple CONTRAST = (235, 202, 113) # gold
[docs]class Flags(IntEnum): GODMODE = auto() CHEATED = auto()
[docs]class TextRelativePosition(IntEnum): ABOVE_IMAGE = auto() BELOW_IMAGE = auto() RIGHT_OF_IMAGE = auto() LEFT_OF_IMAGE = auto()
[docs]class HealingSource(IntEnum): SELF = auto() OTHER = auto()