Add battle stuff

This commit is contained in:
2026-01-14 21:54:38 -06:00
parent 8a599a054c
commit d916e65990
14 changed files with 99 additions and 20 deletions

View File

@@ -1,4 +1,6 @@
@tool
class_name Entity extends CharacterBody3D
const UUID = preload("res://util/UUID.gd")
enum MovementType {
NONE,
@@ -9,8 +11,14 @@ enum MovementType {
enum InteractType {
NONE,
CONVERSATION,
TEST_BATTLE
};
@export_category("Identification")
@export var entityId:String = UUID.uuidv4()
@export_tool_button("Regenerate ID")
var button := func():
entityId = UUID.uuidv4()
# Movement settings
@export_category("Movement")
@@ -20,3 +28,6 @@ enum InteractType {
@export_category("Interactions")
@export var interactType:InteractType = InteractType.NONE
@export var conversation:Array[ConversationElement] = []
# TEST BATTLE
@export_category("Test Battle")

View File

@@ -1,4 +1,5 @@
class_name EntityInteractableArea extends Area3D
# const BattleStartAction = preload("res://cutscene/battle/BattleStartAction.gd")
@export var entity:Entity
@@ -10,13 +11,18 @@ func isInteractable() -> bool:
return false
if entity.interactType == Entity.InteractType.CONVERSATION:
if entity.conversation.size() == 0:
return false
if entity.conversation.size() != 0:
return true
if entity.interactType == Entity.InteractType.TEST_BATTLE:
return true
return true
return false
func _onConversationInteract(_other:Entity) -> void:
CUTSCENE.setConversation(entity.conversation)
var cutscene:Cutscene = Cutscene.new()
cutscene.addConversation(entity.conversation)
cutscene.start()
func onInteract(other:Entity) -> void:
if entity.interactType == Entity.InteractType.NONE:
@@ -26,5 +32,14 @@ func onInteract(other:Entity) -> void:
Entity.InteractType.CONVERSATION:
_onConversationInteract(other)
return
Entity.InteractType.TEST_BATTLE:
var cutscene:Cutscene = Cutscene.new()
cutscene.addCallable(BattleStartAction.getStartBattleCallable({
BATTLE.BattlePosition.RIGHT_TOP_FRONT: PartySingleton.PARTY_JOHN,
}))
cutscene.start()
return
_:
pass

View File

@@ -82,4 +82,4 @@ func _physics_process(delta:float) -> void:
_applyGravity()
_applyFriction(delta)
_applyMovement(delta)
entity.move_and_slide()
entity.move_and_slide()