feat: 드로그 BT 및 전투 패턴 재구성
- 드로그 BT를 페이즈 전환, 부활 트리거, 가중치 근접 패턴 중심으로 재구성 - 땅 울리기 및 콤보-기본기1_3 패턴/스킬/이펙트를 추가하고 기존 평타 파생 자산을 정리 - 드로그 행동 검증용 PlayMode/Editor 테스트와 관련 런타임 상태 추적을 추가
This commit is contained in:
95
Assets/_Game/Tests/Editor/WeightedPatternSelectorTests.cs
Normal file
95
Assets/_Game/Tests/Editor/WeightedPatternSelectorTests.cs
Normal file
@@ -0,0 +1,95 @@
|
||||
using NUnit.Framework;
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
using Colosseum.AI;
|
||||
|
||||
namespace Colosseum.Tests
|
||||
{
|
||||
/// <summary>
|
||||
/// 가중치 패턴 선택기의 후보 필터링과 가중치 분배를 검증합니다.
|
||||
/// </summary>
|
||||
public class WeightedPatternSelectorTests
|
||||
{
|
||||
[Test]
|
||||
public void TrySelectPattern_ReadyCandidatesOnly_AppliesWeightsAfterFiltering()
|
||||
{
|
||||
BossPatternData first = ScriptableObject.CreateInstance<BossPatternData>();
|
||||
BossPatternData second = ScriptableObject.CreateInstance<BossPatternData>();
|
||||
BossPatternData third = ScriptableObject.CreateInstance<BossPatternData>();
|
||||
|
||||
try
|
||||
{
|
||||
WeightedPatternCandidate[] candidates =
|
||||
{
|
||||
new WeightedPatternCandidate(first, 50f),
|
||||
new WeightedPatternCandidate(second, 30f),
|
||||
new WeightedPatternCandidate(third, 20f),
|
||||
};
|
||||
|
||||
bool result = WeightedPatternSelector.TrySelectPattern(
|
||||
candidates,
|
||||
pattern => pattern != first,
|
||||
0.1f,
|
||||
out BossPatternData selectedPattern);
|
||||
|
||||
Assert.IsTrue(result, "준비된 후보가 있는데 선택에 실패했습니다.");
|
||||
Assert.AreSame(second, selectedPattern, "준비되지 않은 후보를 제외한 뒤 첫 번째 가중치 후보가 선택되어야 합니다.");
|
||||
}
|
||||
finally
|
||||
{
|
||||
Object.DestroyImmediate(first);
|
||||
Object.DestroyImmediate(second);
|
||||
Object.DestroyImmediate(third);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TrySelectPattern_UsesDeclaredWeightBands()
|
||||
{
|
||||
BossPatternData combo = ScriptableObject.CreateInstance<BossPatternData>();
|
||||
BossPatternData pressure = ScriptableObject.CreateInstance<BossPatternData>();
|
||||
BossPatternData tertiary = ScriptableObject.CreateInstance<BossPatternData>();
|
||||
BossPatternData secondary = ScriptableObject.CreateInstance<BossPatternData>();
|
||||
BossPatternData primary = ScriptableObject.CreateInstance<BossPatternData>();
|
||||
|
||||
try
|
||||
{
|
||||
WeightedPatternCandidate[] candidates =
|
||||
{
|
||||
new WeightedPatternCandidate(combo, 26f),
|
||||
new WeightedPatternCandidate(pressure, 24f),
|
||||
new WeightedPatternCandidate(primary, 22f),
|
||||
new WeightedPatternCandidate(secondary, 16f),
|
||||
new WeightedPatternCandidate(tertiary, 12f),
|
||||
};
|
||||
|
||||
Assert.AreSame(combo, Select(candidates, 0.20f));
|
||||
Assert.AreSame(pressure, Select(candidates, 0.40f));
|
||||
Assert.AreSame(primary, Select(candidates, 0.60f));
|
||||
Assert.AreSame(secondary, Select(candidates, 0.80f));
|
||||
Assert.AreSame(tertiary, Select(candidates, 0.95f));
|
||||
}
|
||||
finally
|
||||
{
|
||||
Object.DestroyImmediate(combo);
|
||||
Object.DestroyImmediate(pressure);
|
||||
Object.DestroyImmediate(tertiary);
|
||||
Object.DestroyImmediate(secondary);
|
||||
Object.DestroyImmediate(primary);
|
||||
}
|
||||
}
|
||||
|
||||
private static BossPatternData Select(WeightedPatternCandidate[] candidates, float roll)
|
||||
{
|
||||
bool result = WeightedPatternSelector.TrySelectPattern(
|
||||
candidates,
|
||||
pattern => pattern != null,
|
||||
roll,
|
||||
out BossPatternData selectedPattern);
|
||||
|
||||
Assert.IsTrue(result, "테스트용 선택이 실패했습니다.");
|
||||
return selectedPattern;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user