Files
bansonic_beta_main/Assets/scripts/Data/EnemyData_SO.cs
T

78 lines
2.6 KiB
C#

using UnityEngine;
using System.Collections.Generic;
[CreateAssetMenu(fileName = "NewEnemyData", menuName = "SO_Data/EnemyData")]
public class EnemyData_SO : ScriptableObject
{
[Header("基本信息")]
[Tooltip("敌人名称")]
public string enemyName;
public Sprite enemy_Image;
public Sprite enemy_Profile;
[Tooltip("敌人ID")]
public int enemyID;
[Header("类型")]
public EnemyType enemyType = EnemyType.Simple;
public enum EnemyType
{
Simple,
Elite,
Boss,
Legend
}
[Header("Stats")]
[Tooltip("最大生命值")]
public int enemy_maxHP;
[Tooltip("敌人伤害抗性")]
public float enemy_damageResistance;
[Tooltip("基础攻击力")]
public int enemy_baseAttack;
// 最大法力值(仅当 enemyType == Boss 或 Legend 时才生效)
[Tooltip("最大法力值(仅当类型为 Boss 或 Legend 时生效)")]
public int enemy_maxMana = 0;
[Header("死亡时提供的分数")]
public int scoreOnBeingDefeated;
// Skills (same idea as AllyHero_SO)
[Header("Skills")]
public SkillDefinition[] availableSkills;
[Tooltip("Indexes into availableSkills for preselected skills; empty means none selected")]
public int[] selectedSkillIndices = new int[0];
[Tooltip("Primary selected skill index into availableSkills (-1 = none)")]
public int primarySkillIndex = -1;
public SkillDefinition GetPrimarySkill()
{
if (availableSkills == null || primarySkillIndex < 0 || primarySkillIndex >= availableSkills.Length) return null;
return availableSkills[primarySkillIndex];
}
// New: groups of skills. Each group contains a numeric skillGroupID and a variable-length list of SkillDefinitions.
[Tooltip("Skill groups defined on this enemy. Each SkillGroup has a numeric skillGroupID which can be equipped into slots to allow activation of the entire group via that ID.")]
public SkillGroup[] skillGroups = new SkillGroup[0];
[Tooltip("Equipped skill group IDs for this enemy. Each int references a skillGroupID defined in skillGroups. Use 0 to indicate empty.")]
public int[] equippedSkillGroupIDs = new int[0];
// Helper to query effective max mana based on type
public int GetEffectiveMaxMana()
{
// Treat configured enemy_maxMana as authoritative for runtime; designers can set to 0 if not used.
return enemy_maxMana;
}
[Header("Combat Settings")]
[Tooltip("受到伤害回复法力的比例(0-1),例如 0.2 表示根据所受伤害的 20% 回复法力,向上取整)")]
[Range(0f, 1f)]
public float manaGainOnDamagePercent = 0.2f; // default 20%
}