75 lines
2.3 KiB
C#
75 lines
2.3 KiB
C#
using static XPlugin.Data.JsonLiteDB.JsonLiteDB;
|
|
|
|
public enum EnemyType
|
|
{
|
|
OctopusBoss=2001,//章鱼boss
|
|
OctopusTentacle=1,//章鱼boss
|
|
TortoiseBoss = 2002,//乌龟Boss
|
|
FrogBoss = 2003,//青蛙Boss
|
|
FrogBug = 2,//青蛙小怪
|
|
DeathKnightBoss = 2004,//死亡骑士
|
|
|
|
}
|
|
|
|
public class EnemyData
|
|
{
|
|
public int Id;
|
|
public string Name;
|
|
public string NameCN;
|
|
public int Atk_1P;//技能1伤害
|
|
public int Atk_1B;//技能1狂暴伤害
|
|
public int Atk_2;//技能2伤害
|
|
public int Atk_2dot;//技能2持续伤害
|
|
public int Atk_2Time;//技能2持续时间
|
|
public int Atk_3;//技能3伤害
|
|
public float Speed;//移动速度
|
|
public int Speed_C;//冲击速度
|
|
public float Rate_1;//技能1攻击间隔
|
|
public float Rate_2;//技能2攻击间隔
|
|
public float Rate_3;//技能3攻击间隔
|
|
public float Hp;//本体生命值
|
|
public int Hp_CS1;//部件生命力1
|
|
public int Hp_CS2;//部件生命力2
|
|
public EnemyData(TableReader table)
|
|
{
|
|
Id = table["EnemyId"].OptInt();
|
|
Name = table["Name"].OptString();
|
|
NameCN = table["Name_CN"].OptString();
|
|
Atk_1P = table["Atk_1P"].OptInt();
|
|
Atk_1B = table["Atk_1B"].OptInt();
|
|
Atk_2 = table["Atk_2"].OptInt();
|
|
Atk_2dot = table["Atk_2dot"].OptInt();
|
|
Atk_2Time = table["Atk_2Time"].OptInt();
|
|
Atk_3 = table["Atk_3"].OptInt();
|
|
Speed = table["Speed"].OptFloat();
|
|
Speed_C = table["Speed_C"].OptInt();
|
|
Rate_1 = table["Rate_1"].OptFloat();
|
|
Rate_2 = table["Rate_2"].OptFloat();
|
|
Rate_3 = table["Rate_CF"].OptFloat();
|
|
Hp = table["Hp"].OptFloat();
|
|
Hp_CS1 = table["Hp_CS1"].OptInt();
|
|
Hp_CS2 = table["Hp_CS2"].OptInt();
|
|
}
|
|
|
|
int[] ParseStringToIntArray(string input)
|
|
{
|
|
if (input == "")
|
|
{
|
|
return null;
|
|
}
|
|
|
|
// 去除字符串中的括号,并以逗号分割成元素数组
|
|
string[] elements = input.Replace("(", "").Replace(")", "").Split(',');
|
|
int[] intArray = new int[elements.Length];
|
|
|
|
for (int i = 0; i < elements.Length; i++)
|
|
{
|
|
// 将每个元素解析为整数并存入整数数组
|
|
intArray[i] = int.Parse(elements[i]);
|
|
}
|
|
|
|
return intArray;
|
|
}
|
|
|
|
}
|