- Added BattleState class to manage battle flow, including turn management and event handling. - Introduced BuffInstance class to represent buffs applied to combatants. - Created CardInstance class to handle card definitions and cost calculations. - Developed CombatantState class to manage combatant attributes and actions. - Implemented EffectRegistry to apply effects based on event specifications. - Added various handlers (BlockHandler, DamageHandler, DrawHandler, etc.) to process specific events. - Created IntentPlanner and IntentState classes to manage enemy actions and intents. - Established a queue system for handling battle events with BattleEventQueue and BattleEventTask. - Introduced triggers for applying effects based on game events (e.g., OnCardDrawnGainBlockTrigger). - Added necessary UID files for new scripts to ensure proper resource management.
26 lines
484 B
GDScript
26 lines
484 B
GDScript
class_name BuffInstance
|
|
extends RefCounted
|
|
|
|
var buff_id: String = ""
|
|
var owner = null
|
|
var acquire_index: int = -1
|
|
var stack: int = 1
|
|
var duration: int = -1
|
|
var subscribers: Array = []
|
|
|
|
func _init(
|
|
p_buff_id: String = "",
|
|
p_owner = null,
|
|
p_stack: int = 1,
|
|
p_duration: int = -1
|
|
) -> void:
|
|
buff_id = p_buff_id
|
|
owner = p_owner
|
|
stack = max(1, p_stack)
|
|
duration = p_duration
|
|
|
|
func add_subscriber(subscriber) -> void:
|
|
if subscriber == null:
|
|
return
|
|
subscribers.append(subscriber)
|