Files
gd-playground/Game/Presentation/Battle/Scripts/EnemyIntentView.gd
54shitaimzf e465f1cbb0 feat: 基础卡牌场景与卡牌逻辑可扩展框架,以及todo文档
- 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.
2026-04-22 21:58:15 +08:00

29 lines
789 B
GDScript

class_name EnemyIntentView
extends HBoxContainer
const IntentStateScript = preload("res://Game/Runtime/IntentState.gd")
@onready var icon_swatch: ColorRect = $IntentIcon
@onready var code_label: Label = $IntentCode
@onready var value_label: Label = $IntentValue
func set_intent(intent) -> void:
if intent == null:
code_label.text = ""
value_label.text = "0"
icon_swatch.color = Color(0.4, 0.4, 0.4)
return
code_label.text = intent.code()
value_label.text = str(intent.value)
match intent.intent_type:
IntentStateScript.ATTACK:
icon_swatch.color = Color(0.85, 0.25, 0.2)
IntentStateScript.BUFF:
icon_swatch.color = Color(0.2, 0.65, 0.25)
IntentStateScript.DEBUFF:
icon_swatch.color = Color(0.2, 0.45, 0.8)
_:
icon_swatch.color = Color(0.4, 0.4, 0.4)