31 lines
No EOL
908 B
GDScript
31 lines
No EOL
908 B
GDScript
class_name Modifier extends Resource
|
|
|
|
enum ModifierType {
|
|
ADDITIVE, # Simply adds values (e.g., +5 damage)
|
|
MULTIPLICATIVE, # Multiplies by a percentage (e.g., 20% more damage)
|
|
OVERRIDE, # Completely replaces the value
|
|
CONDITIONAL # Applies under certain conditions
|
|
}
|
|
|
|
@export var id: String
|
|
@export var display_name: String
|
|
@export var description: String
|
|
@export var icon: Texture
|
|
@export var rarity: int
|
|
@export var modifier_type: ModifierType = ModifierType.ADDITIVE
|
|
@export var priority: int = 0 # Higher priority modifiers apply first
|
|
|
|
# Called when the modifier is added to a weapon or ability
|
|
func on_equip(_owner) -> void:
|
|
pass
|
|
|
|
# Called when the modifier is removed
|
|
func on_unequip(_owner) -> void:
|
|
pass
|
|
|
|
# Override in child classes for specific modification logic
|
|
func modify_projectile(_projectile) -> void:
|
|
pass
|
|
|
|
func modify_ability(_ability) -> void:
|
|
pass |