Files
FablishRPG/Assets/Scripts/NPCData.cs

34 lines
1.1 KiB
C#

using UnityEngine;
[CreateAssetMenu(fileName = "New NPC Data", menuName = "RPG/NPC Data")]
public class NPCData : ScriptableObject
{
[Header("Stats")]
public float maxHealth = 100f;
[Header("Combat Settings")]
public NPCFaction defaultFaction = NPCFaction.Enemy;
public float aggroRadius = 15f;
public float attackRadius = 2.0f;
public float attackCooldown = 2.5f;
[Tooltip("Chance (0 to 1) the NPC will block an incoming attack if they see the player attacking.")]
[Range(0f, 1f)] public float blockChance = 0.5f;
[Tooltip("How much damage the NPC blocks (0 to 1).")]
[Range(0f, 1f)] public float blockReductionPercentage = 0.5f;
[Header("Movement")]
public float walkSpeed = 2.0f;
public float runSpeed = 5.0f;
[Header("Equipment")]
[Tooltip("Base damage dealt if no weapon is equipped.")]
public float baseDamage = 15f;
[Tooltip("The weapon data for damage calculations and hit shape.")]
public Weapon weaponData;
[Tooltip("The visual weapon prefab to spawn in the NPC's hand.")]
public GameObject weaponPrefab;
}