feat: 젬 반복 시전 로직 및 테스트 프리셋 추가
- SkillGemData에 카테고리, 시전 속도 배율, 추가 반복 횟수 필드를 추가함 - SkillLoadoutEntry가 젬 합산 기준 최종 속도와 반복 횟수를 계산하도록 확장함 - SkillController가 반복 횟수만큼 스킬을 재시전하고 시작 효과와 OnEffect를 매 반복에 다시 적용하도록 수정함 - 연속 젬과 반복 젬 테스트 프리셋을 추가하고 디버그 메뉴에 적용 및 계산 로그 경로를 보강함 - 공격형 테스트 젬 자산과 추가 대미지 이펙트를 정리하고 무젬 35, 반복 젬 70 피해를 검증함
This commit is contained in:
@@ -56,14 +56,15 @@ namespace Colosseum.Skills
|
||||
private SkillLoadoutEntry currentLoadoutEntry;
|
||||
private readonly List<SkillEffect> currentCastStartEffects = new();
|
||||
private readonly Dictionary<int, List<SkillEffect>> currentTriggeredEffects = new();
|
||||
private bool skillEndRequested; // OnSkillEnd 이벤트 호출 여부
|
||||
private bool waitingForEndAnimation; // EndAnimation 종료 대기 중
|
||||
private int currentRepeatCount = 1;
|
||||
private int currentIterationIndex = 0;
|
||||
|
||||
// 쿨타임 추적
|
||||
private Dictionary<SkillData, float> cooldownTracker = new Dictionary<SkillData, float>();
|
||||
|
||||
|
||||
public bool IsExecutingSkill => currentSkill != null && !skillEndRequested;
|
||||
public bool IsExecutingSkill => currentSkill != null;
|
||||
public bool IsPlayingAnimation => currentSkill != null;
|
||||
public bool IsInEndAnimation => waitingForEndAnimation;
|
||||
public bool UsesRootMotion => currentSkill != null && currentSkill.UseRootMotion;
|
||||
@@ -105,7 +106,7 @@ namespace Colosseum.Skills
|
||||
{
|
||||
if (debugMode) Debug.Log($"[Skill] EndAnimation complete: {currentSkill.SkillName}");
|
||||
RestoreBaseController();
|
||||
currentSkill = null;
|
||||
ClearCurrentSkillState();
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -113,6 +114,9 @@ namespace Colosseum.Skills
|
||||
// 애니메이션 종료 시 처리 (OnSkillEnd 여부와 관계없이 애니메이션 끝까지 재생)
|
||||
if (stateInfo.normalizedTime >= 1f)
|
||||
{
|
||||
if (TryStartNextIteration())
|
||||
return;
|
||||
|
||||
if (currentSkill.EndClip != null)
|
||||
{
|
||||
// EndAnimation 재생 후 종료 대기
|
||||
@@ -125,7 +129,7 @@ namespace Colosseum.Skills
|
||||
// EndAnimation 없으면 바로 종료
|
||||
if (debugMode) Debug.Log($"[Skill] Animation complete: {currentSkill.SkillName}");
|
||||
RestoreBaseController();
|
||||
currentSkill = null;
|
||||
ClearCurrentSkillState();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -172,26 +176,18 @@ namespace Colosseum.Skills
|
||||
|
||||
currentLoadoutEntry = loadoutEntry != null ? loadoutEntry.CreateCopy() : SkillLoadoutEntry.CreateTemporary(skill);
|
||||
currentSkill = skill;
|
||||
skillEndRequested = false;
|
||||
waitingForEndAnimation = false;
|
||||
lastCancelReason = SkillCancelReason.None;
|
||||
BuildResolvedEffects(currentLoadoutEntry);
|
||||
currentRepeatCount = currentLoadoutEntry.GetResolvedRepeatCount();
|
||||
currentIterationIndex = 0;
|
||||
|
||||
if (debugMode) Debug.Log($"[Skill] Cast: {skill.SkillName}");
|
||||
|
||||
// 쿨타임 시작
|
||||
StartCooldown(skill, currentLoadoutEntry.GetResolvedCooldown());
|
||||
|
||||
TriggerCastStartEffects();
|
||||
|
||||
// 스킬 애니메이션 재생
|
||||
if (skill.SkillClip != null && animator != null)
|
||||
{
|
||||
animator.speed = skill.AnimationSpeed;
|
||||
PlaySkillClip(skill.SkillClip);
|
||||
}
|
||||
|
||||
TriggerImmediateSelfEffectsIfNeeded();
|
||||
StartCurrentIteration();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -263,6 +259,51 @@ namespace Colosseum.Skills
|
||||
loadoutEntry.CollectTriggeredEffects(currentTriggeredEffects);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 현재 스킬의 반복 차수 하나를 시작합니다.
|
||||
/// </summary>
|
||||
private void StartCurrentIteration()
|
||||
{
|
||||
if (currentSkill == null)
|
||||
return;
|
||||
|
||||
currentIterationIndex++;
|
||||
waitingForEndAnimation = false;
|
||||
|
||||
if (debugMode && currentRepeatCount > 1)
|
||||
{
|
||||
Debug.Log($"[Skill] Iteration {currentIterationIndex}/{currentRepeatCount}: {currentSkill.SkillName}");
|
||||
}
|
||||
|
||||
TriggerCastStartEffects();
|
||||
|
||||
if (currentSkill.SkillClip != null && animator != null)
|
||||
{
|
||||
float resolvedAnimationSpeed = currentLoadoutEntry != null
|
||||
? currentLoadoutEntry.GetResolvedAnimationSpeed()
|
||||
: currentSkill.AnimationSpeed;
|
||||
animator.speed = resolvedAnimationSpeed;
|
||||
PlaySkillClip(currentSkill.SkillClip);
|
||||
}
|
||||
|
||||
TriggerImmediateSelfEffectsIfNeeded();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 반복 시전이 남아 있으면 다음 차수를 시작합니다.
|
||||
/// </summary>
|
||||
private bool TryStartNextIteration()
|
||||
{
|
||||
if (currentSkill == null)
|
||||
return false;
|
||||
|
||||
if (currentIterationIndex >= currentRepeatCount)
|
||||
return false;
|
||||
|
||||
StartCurrentIteration();
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 스킬 클립으로 Override Controller 생성 후 재생
|
||||
/// </summary>
|
||||
@@ -426,9 +467,7 @@ namespace Colosseum.Skills
|
||||
return;
|
||||
}
|
||||
|
||||
skillEndRequested = true;
|
||||
|
||||
if (debugMode) Debug.Log($"[Skill] End requested: {currentSkill.SkillName} (will complete after animation)");
|
||||
if (debugMode) Debug.Log($"[Skill] End event received: {currentSkill.SkillName}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -445,12 +484,7 @@ namespace Colosseum.Skills
|
||||
Debug.Log($"[Skill] Cancelled: {currentSkill.SkillName} / reason={reason}");
|
||||
|
||||
RestoreBaseController();
|
||||
currentSkill = null;
|
||||
currentLoadoutEntry = null;
|
||||
currentCastStartEffects.Clear();
|
||||
currentTriggeredEffects.Clear();
|
||||
skillEndRequested = false;
|
||||
waitingForEndAnimation = false;
|
||||
ClearCurrentSkillState();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -485,5 +519,19 @@ namespace Colosseum.Skills
|
||||
{
|
||||
cooldownTracker.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 현재 실행 중인 스킬 상태를 정리합니다.
|
||||
/// </summary>
|
||||
private void ClearCurrentSkillState()
|
||||
{
|
||||
currentSkill = null;
|
||||
currentLoadoutEntry = null;
|
||||
currentCastStartEffects.Clear();
|
||||
currentTriggeredEffects.Clear();
|
||||
waitingForEndAnimation = false;
|
||||
currentRepeatCount = 1;
|
||||
currentIterationIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user