feat: 무기 특성(WeaponTrait) 시스템 및 보조손 장착 구현
- WeaponTrait enum 추가 (Melee/TwoHanded/Defense/Magic/Ranged) - SkillData에 allowedWeaponTraits 필드 및 MatchesWeaponTrait() 검증 메서드 추가 - WeaponEquipment에 보조손(오프핸드) 슬롯 지원 (장착/해제/스탯 보너스/네트워크 동기화) - EquippedWeaponTraits 프로퍼티로 메인+보조 무기 특성 합산 제공 - PlayerSkillInput 4곳(OnSkillInput/RPC/CanUseSkill/DebugExecute)에 무기 trait 제약 검증 추가 - SkillSlotUI에 무기 불호환 시 회색 표시(weaponIncompatibleColor) 지원 - 기존 검 에셋에 weaponTrait=Melee 설정
This commit is contained in:
@@ -3,6 +3,8 @@ using System.Collections.Generic;
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
using Colosseum.Weapons;
|
||||
|
||||
namespace Colosseum.Skills
|
||||
{
|
||||
/// <summary>
|
||||
@@ -94,6 +96,10 @@ namespace Colosseum.Skills
|
||||
[Tooltip("시전 중 다른 스킬 입력 차단 여부")]
|
||||
[SerializeField] private bool blockOtherSkillsWhileCasting = true;
|
||||
|
||||
[Header("무기 조건")]
|
||||
[Tooltip("이 스킬 사용에 필요한 무기 특성. None이면 제약 없음.")]
|
||||
[SerializeField] private WeaponTrait allowedWeaponTraits = WeaponTrait.None;
|
||||
|
||||
[Header("쿨타임 & 비용")]
|
||||
[Min(0f)] [SerializeField] private float cooldown = 1f;
|
||||
[Min(0f)] [SerializeField] private float manaCost = 0f;
|
||||
@@ -131,6 +137,7 @@ namespace Colosseum.Skills
|
||||
public bool BlockOtherSkillsWhileCasting => blockOtherSkillsWhileCasting;
|
||||
public IReadOnlyList<SkillEffect> CastStartEffects => castStartEffects;
|
||||
public IReadOnlyList<SkillEffect> Effects => effects;
|
||||
public WeaponTrait AllowedWeaponTraits => allowedWeaponTraits;
|
||||
|
||||
/// <summary>
|
||||
/// 지정한 장착 조건과 현재 스킬 분류가 맞는지 확인합니다.
|
||||
@@ -147,6 +154,18 @@ namespace Colosseum.Skills
|
||||
|
||||
return matchesRole && matchesActivationType;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 지정한 무기 특성 조합이 이 스킬의 무기 조건을 충족하는지 확인합니다.
|
||||
/// allowedWeaponTraits가 None이면 항상 true입니다.
|
||||
/// </summary>
|
||||
public bool MatchesWeaponTrait(WeaponTrait equippedTraits)
|
||||
{
|
||||
if (allowedWeaponTraits == WeaponTrait.None)
|
||||
return true;
|
||||
|
||||
return (equippedTraits & allowedWeaponTraits) == allowedWeaponTraits;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user