using UnityEngine; public class HumanCharacter : Character { public Weapon weaponPrefab; // Assign the weapon prefab in the inspector public GameObject arrowPrefab; // Assign the arrow prefab in the inspector protected override void InitializeStats() { // Only set default stats if they haven't been set by combat data if (Strength == 0) // Assume if Strength is 0, no combat data has been applied { MaxHealth = 20; CurrentHealth = MaxHealth; Attack = 8; Strength = 10; // Default strength Constitution = 5; Dexterity = 3; Wisdom = 2; Perception = 10; // Default perception InitModifier = -2; DamageModifier = 0; SpellModifier = 0; MovementSpeed = 10; ArmorClass = 10; Debug.Log($"🔧 Applied default stats to {CharacterName}"); } else { Debug.Log($"🔧 Skipping default stats for {CharacterName} - combat data already applied (STR:{Strength})"); } } public override Weapon GetWeapon() { // Return null to trigger direct weapon creation in SpawnAndEquipWeapon return weaponPrefab == null ? CreateDirectWeapon() : weaponPrefab; } protected override Weapon CreateDirectWeapon() { // Create weapon directly without prefab system GameObject swordObject = new GameObject("Simple Sword"); swordObject.transform.SetParent(this.transform, false); spawnedWeapon = swordObject.AddComponent(); spawnedWeapon.SetWielder(this); return spawnedWeapon; } public override Character Spawn(int count) { name = "Human"; CharacterName = "Human"; if (count > 1) { name += " " + count; CharacterName += " " + count; } return this; } }