37 lines
1010 B
C#
37 lines
1010 B
C#
using System;
|
|
using SepCore.Definition;
|
|
using UnityEngine;
|
|
|
|
namespace SepCore.Entity
|
|
{
|
|
[Serializable]
|
|
public class EnemyData : TargetableObjectData
|
|
{
|
|
public EnemyConfig Config { get; }
|
|
|
|
public EnemyData(int entityId, EnemyConfig enemyConfig, int level)
|
|
: base(enemyConfig.Prefab, entityId, CampType.Enemy)
|
|
{
|
|
Config = enemyConfig;
|
|
int effectiveLevel = Mathf.Max(1, level);
|
|
MaxHealthBase = enemyConfig.MaxHealth + enemyConfig.HpAddPerLevel * (effectiveLevel - 1);
|
|
}
|
|
|
|
public EnemyType EnemyType => Config.EnemyType;
|
|
|
|
public string LogicType => Config.LogicType;
|
|
|
|
public override int MaxHealthBase { get; }
|
|
|
|
public int AttackDamage => Config.AttackDamage;
|
|
|
|
public float AttackCooldown => Config.AttackCooldown;
|
|
|
|
public float AttackRange => Config.AttackRange;
|
|
|
|
public float SpeedBase => Config.Speed;
|
|
|
|
public float DropPercent => Config.DropPercent;
|
|
}
|
|
}
|