Files
valheim/Assets/_Valheim/Scripts/Data/PetInfo.cs
2025-07-04 14:16:14 +08:00

147 lines
2.7 KiB
C#

using static XPlugin.Data.JsonLiteDB.JsonLiteDB;
public enum PetType
{
Chick = 0,
Chicken = 1,
Dog1 = 2,
Dog2 = 3,
Cat1 = 4,
Cat2 = 5,
Rabbit1 = 6,
Rabbit2 = 7,
Duck1 = 8,
Duck2 = 9,
Monkey1 = 10,
Monkey2 = 11,
Koala = 12,
Raccoon = 13,
Fox = 14,
Leopard1 = 15,
Leopard2 = 16,
Chameleon1 = 17,
Chameleon2 = 18,
Platypus1 = 19,
Platypus2 = 20,
Meerkat = 21,
Porcupine = 22,
Squirrel = 23,
Skunk = 24,
Possum = 25,
Otter = 26,
Redpanda = 27,
Sloth = 28,
Armadillo = 29,
Mole = 30,
Pangolin = 31,
Iguana = 32,
Anteater = 33,
Chipmunk = 34,
Turtle = 35,
//中型动物
Sheep = 36,
Pig = 37,
Goat = 38,
Boar1 = 39,
Boar2 = 40,
Tiger1 = 41,
Tiger2 = 42,
Tiger3 = 43,
Kangaroo = 44,
Crocodile = 45,
Peacock = 46,
Malaya = 47,
Flamingo = 48,
//大型动物
Cow = 49,
Horse = 50,
Alpaca = 51,
Gorilla = 52,
Buffalo1 = 53,
Buffalo2 = 54,
Camel1 = 55,
Camel2 = 56,
Elk = 57,
Bison = 58,
Bull1 = 59,
Bull2 = 60,
Bear1 = 61,
Bear2 = 62,
Deer = 63,
Elephant1 = 64,
Elephant2 = 65,
Giraffe = 66,
Hippo = 67,
Lion = 68,
Lioness = 69,
Rhino = 70,
Zebra = 71,
Mule1 = 72,
Mule2 = 73,
Ostrich = 74
}
public class PetInfo
{
public int ID;
public string Name;
public int BodyType;
public int Hp;
public float Atk;
public float Speed;
public float Rate;
public float Exp;
public int Lvl;
public float Atkarea;
public float ModelScale;
public float Radius;
public float modelHeight;
public float SeekSpeed;
public PetInfo(TableReader table)
{
ID = table["ID"].OptInt();
Name = table["Name"].OptString();
Hp = table["Hp"].OptInt();
Atk = table["Atk"].OptFloat();
Speed = table["Speed"].OptFloat();
Rate = table["Rate"].OptFloat();
Exp = table["Exp"].OptFloat();
Lvl = table["Lvl"].OptInt();
Atkarea = table["AtkArea"].OptFloat();
ModelScale = table["ModelScale"].OptFloat();
Radius = table["Radius"].OptFloat();
modelHeight = table["modelHeight"].OptFloat();
SeekSpeed = table["SeekSpeed"].OptFloat();
}
float[] ParseStringToIntArray(string input)
{
if (input == "")
{
return null;
}
string[] elements = input.Replace("[", "").Replace("]", "").Split(',');
float[] intArray = new float[elements.Length];
for (int i = 0; i < elements.Length; i++)
{
intArray[i] = float.Parse(elements[i]);
}
return intArray;
}
}