added a few more singletons and started reorganization/refactoring

This commit is contained in:
tonydero 2024-10-18 09:39:14 -06:00
parent 4d67f43f3b
commit dac8e73f01
7 changed files with 49 additions and 39 deletions

View File

@ -17,7 +17,10 @@ config/icon="res://assets/icon.svg"
[autoload]
WorldState="*res://scripts/WorldState.gd"
SignalBus="*res://scripts/SignalBus.gd"
GlobalTypes="*res://scripts/GlobalTypes.gd"
Styling="*res://scripts/Styling.gd"
[display]

View File

@ -12,36 +12,11 @@ enum TargTypes {
AREA,
RAY,
}
enum PDmgTypes {
SLICE,
PUNCTURE,
BASH,
HACK,
SHRED,
}
enum MDmgTypes {
BURN,
FREEZE,
SHOCK,
POISON,
LIFE,
MENTAL,
RADIANT,
ARCANE,
FORCE
}
enum SModTypes {
STUN,
SLOW,
ABSORB,
SHIELD,
DOTB,
DOTE
}
@export var attack_range := 0
@export var attack_type := TargTypes.SINGLE
@export var damage_type := GlobalTypes.Ability.PDmgTypes.SLICE
@export var attack_damage := 200
@export var attack_speed := 1.0
@export var base_cooldown := 0.0

31
scripts/GlobalTypes.gd Normal file
View File

@ -0,0 +1,31 @@
# file containing type information to be referrenced by other classes
extends Node
class Ability:
enum PDmgTypes {
SLICE,
PUNCTURE,
BASH,
HACK,
SHRED,
}
enum MDmgTypes {
BURN,
FREEZE,
SHOCK,
POISON,
LIFE,
MENTAL,
RADIANT,
ARCANE,
FORCE
}
enum SModTypes {
STUN,
SLOW,
ABSORB,
SHIELD,
DOTB,
DOTE
}

View File

@ -1,25 +1,25 @@
extends NPC
extends Node
func format_label_difficulty(label: Node, difficulty: NPC.NPCDifficulties) -> void:
label.label_settings.outline_size = 4
match difficulty:
NPCDifficulties.MINION:
NPC.NPCDifficulties.MINION:
label.label_settings.outline_color = Color.BLACK
label.label_settings.font_color = Color.LIGHT_GRAY
NPCDifficulties.NORMAL:
NPC.NPCDifficulties.NORMAL:
label.label_settings.outline_color = Color.DARK_GREEN
label.label_settings.font_color = Color.LIME_GREEN
NPCDifficulties.ELITE:
NPC.NPCDifficulties.ELITE:
label.label_settings.outline_color = Color.DARK_BLUE
label.label_settings.font_color = Color.DARK_CYAN
NPCDifficulties.BOSS:
NPC.NPCDifficulties.BOSS:
label.label_settings.outline_color = Color.PURPLE
label.label_settings.font_color = Color.MAGENTA
NPCDifficulties.ELITEBOSS:
NPC.NPCDifficulties.ELITEBOSS:
label.label_settings.outline_color = Color.ORANGE_RED
label.label_settings.font_color = Color.ORANGE
NPCDifficulties.BBEG:
NPC.NPCDifficulties.BBEG:
label.label_settings.font_color = Color.GOLD
label.label_settings.outline_size = 8
label.label_settings.outline_color = Color.DARK_RED

View File

@ -1,5 +1,4 @@
# defines the parameters for spawning enemies within an area and handles
# enemy death signals
# defines the parameters for quests and spawning enemies within an area
class_name WorldArea
extends PanelContainer

2
scripts/WorldState.gd Normal file
View File

@ -0,0 +1,2 @@
# file containing the world state for the player
extends Node

View File

@ -1,5 +1,5 @@
class_name WorldZone
extends Sprite2D
# zone class defines all parameters for creating areas within itself
class_name WorldZone
extends PanelContainer