[AI] 보스 스킬 사용 액션 추가
- UseSkillAction: Behavior Tree에서 스킬 사용을 위한 액션 노드 - Melee_Slash_Boss: 보스 근접 공격 스킬 데이터 - Melee_Slash_Boss_0: 스킬 대미지 효과 (부채꼴 범위) Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
69
Assets/Scripts/AI/BehaviorActions/Actions/UseSkillAction.cs
Normal file
69
Assets/Scripts/AI/BehaviorActions/Actions/UseSkillAction.cs
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
using System;
|
||||||
|
using Colosseum.Skills;
|
||||||
|
using Unity.Behavior;
|
||||||
|
using UnityEngine;
|
||||||
|
using Action = Unity.Behavior.Action;
|
||||||
|
using Unity.Properties;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 지정된 스킬을 사용하는 Behavior Tree Action.
|
||||||
|
/// 스킬 실행이 완료될 때까지 Running 상태를 유지합니다.
|
||||||
|
/// </summary>
|
||||||
|
[Serializable, GeneratePropertyBag]
|
||||||
|
[NodeDescription(name: "Use Skill", story: "[스킬] 사용", category: "Action", id: "799f1e8cfafa78b2d52ef61a6bbb29b9")]
|
||||||
|
public partial class UseSkillAction : Action
|
||||||
|
{
|
||||||
|
[SerializeReference] public BlackboardVariable<SkillData> 스킬;
|
||||||
|
|
||||||
|
private SkillController skillController;
|
||||||
|
|
||||||
|
protected override Status OnStart()
|
||||||
|
{
|
||||||
|
// 스킬 데이터 확인
|
||||||
|
if (스킬?.Value == null)
|
||||||
|
{
|
||||||
|
Debug.LogWarning("[UseSkillAction] 스킬이 null입니다.");
|
||||||
|
return Status.Failure;
|
||||||
|
}
|
||||||
|
|
||||||
|
// SkillController 컴포넌트 가져오기
|
||||||
|
skillController = GameObject.GetComponent<SkillController>();
|
||||||
|
if (skillController == null)
|
||||||
|
{
|
||||||
|
Debug.LogWarning($"[UseSkillAction] SkillController를 찾을 수 없습니다: {GameObject.name}");
|
||||||
|
return Status.Failure;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 스킬 실행 시도
|
||||||
|
bool success = skillController.ExecuteSkill(스킬.Value);
|
||||||
|
if (!success)
|
||||||
|
{
|
||||||
|
// 이미 다른 스킬 사용 중이거나 쿨타임
|
||||||
|
return Status.Failure;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Status.Running;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Status OnUpdate()
|
||||||
|
{
|
||||||
|
// SkillController가 해제된 경우
|
||||||
|
if (skillController == null)
|
||||||
|
{
|
||||||
|
return Status.Failure;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 스킬 애니메이션이 종료되면 성공
|
||||||
|
if (!skillController.IsPlayingAnimation)
|
||||||
|
{
|
||||||
|
return Status.Success;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Status.Running;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnEnd()
|
||||||
|
{
|
||||||
|
skillController = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: cf140a11f5104674fb8367f4eb5702cb
|
||||||
28
Assets/Skills/Effects/Melee_Slash_Boss_0.asset
Normal file
28
Assets/Skills/Effects/Melee_Slash_Boss_0.asset
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 58efb3c775496fa40b801b21127a011e, type: 3}
|
||||||
|
m_Name: Melee_Slash_Boss_0
|
||||||
|
m_EditorClassIdentifier: Colosseum.Game::Colosseum.Skills.Effects.DamageEffect
|
||||||
|
targetType: 1
|
||||||
|
targetTeam: 0
|
||||||
|
areaCenter: 0
|
||||||
|
areaShape: 1
|
||||||
|
targetLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
areaRadius: 3
|
||||||
|
fanOriginDistance: 0
|
||||||
|
fanRadius: 3
|
||||||
|
fanHalfAngle: 45
|
||||||
|
baseDamage: 10
|
||||||
|
damageType: 0
|
||||||
|
statScaling: 1
|
||||||
8
Assets/Skills/Effects/Melee_Slash_Boss_0.asset.meta
Normal file
8
Assets/Skills/Effects/Melee_Slash_Boss_0.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 86bf7e282c1639c4889910475aaccdef
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
25
Assets/Skills/Melee_Slash_Boss.asset
Normal file
25
Assets/Skills/Melee_Slash_Boss.asset
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 94f0a76cebcac2f4fb5daf1b675fd79f, type: 3}
|
||||||
|
m_Name: Melee_Slash_Boss
|
||||||
|
m_EditorClassIdentifier: Colosseum.Game::Colosseum.Skills.SkillData
|
||||||
|
skillName: "\uBCA0\uAE30"
|
||||||
|
description:
|
||||||
|
icon: {fileID: 0}
|
||||||
|
skillClip: {fileID: -7717634560727564301, guid: 0f6fd9302e489b94d96774e2713b1317, type: 3}
|
||||||
|
endClip: {fileID: -8265974341663887746, guid: fbcbf9c09792c924296ac6036e76f6dc, type: 3}
|
||||||
|
useRootMotion: 1
|
||||||
|
ignoreRootMotionY: 1
|
||||||
|
cooldown: 1
|
||||||
|
manaCost: 5
|
||||||
|
effects:
|
||||||
|
- {fileID: 11400000, guid: 86bf7e282c1639c4889910475aaccdef, type: 2}
|
||||||
8
Assets/Skills/Melee_Slash_Boss.asset.meta
Normal file
8
Assets/Skills/Melee_Slash_Boss.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4f40629d4d334434285e8fdec3714536
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Reference in New Issue
Block a user