- 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.
14 lines
415 B
GDScript
14 lines
415 B
GDScript
class_name EndTurnCommand
|
|
extends RefCounted
|
|
|
|
const BattleEventTypeScript = preload("res://Game/Runtime/Queue/BattleEventType.gd")
|
|
|
|
func execute(state, effect_registry, intent_planner) -> void:
|
|
if not state.is_player_turn:
|
|
return
|
|
|
|
state.event_queue.enqueue_event(BattleEventTypeScript.TURN_END_REQUESTED, {
|
|
"intent_planner": intent_planner
|
|
}, "EndTurnCommand")
|
|
state.event_queue.run(state, state.event_bus)
|