- 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.
39 lines
768 B
GDScript
39 lines
768 B
GDScript
class_name IntentState
|
|
extends RefCounted
|
|
|
|
const ATTACK: int = 0
|
|
const BUFF: int = 1
|
|
const DEBUFF: int = 2
|
|
|
|
var intent_type: int = ATTACK
|
|
var value: int = 0
|
|
|
|
static func attack(amount: int) -> IntentState:
|
|
var intent := IntentState.new()
|
|
intent.intent_type = ATTACK
|
|
intent.value = max(0, amount)
|
|
return intent
|
|
|
|
static func buff(amount: int) -> IntentState:
|
|
var intent := IntentState.new()
|
|
intent.intent_type = BUFF
|
|
intent.value = max(0, amount)
|
|
return intent
|
|
|
|
static func debuff(amount: int) -> IntentState:
|
|
var intent := IntentState.new()
|
|
intent.intent_type = DEBUFF
|
|
intent.value = max(0, amount)
|
|
return intent
|
|
|
|
func code() -> String:
|
|
match intent_type:
|
|
ATTACK:
|
|
return "攻"
|
|
BUFF:
|
|
return "强"
|
|
DEBUFF:
|
|
return "弱"
|
|
_:
|
|
return "未知"
|