Example #1
0
 public VMS_Chao(byte[] file, int index)
 {
     Type      = (ChaoTypeSA1)file[index];
     Garden    = (ChaoLocationSA1)file[index + 1];
     Happiness = (sbyte)file[index + 2];
     Key1      = file[index + 3];
     Name      = ReadChaoName(file, index + 0x04);
     Swim      = BitConverter.ToUInt16(file, index + 0x0C);
     Run       = BitConverter.ToUInt16(file, index + 0x0E);
     Fly       = BitConverter.ToUInt16(file, index + 0x10);
     Power     = BitConverter.ToUInt16(file, index + 0x12);
     HP        = BitConverter.ToUInt16(file, index + 0x14);
     HP_Max    = BitConverter.ToUInt16(file, index + 0x16);
     for (int f = 0; f < 8; f++)
     {
         Fruits[f] = (ChaoFruitsSA1)file[index + 0x18 + f];
     }
     RunOrPower      = BitConverter.ToSingle(file, index + 0x20);
     FlyOrSwim       = BitConverter.ToSingle(file, index + 0x24);
     Magnitude       = BitConverter.ToSingle(file, index + 0x28);
     Affection       = BitConverter.ToUInt16(file, index + 0x2C);
     LifeLeft        = BitConverter.ToUInt16(file, index + 0x2E);
     AgingFactor     = BitConverter.ToUInt16(file, index + 0x30);
     AnimalAbilities = (AnimalFlagsSA1)BitConverter.ToUInt16(file, index + 0x32);
     Jewels          = (ChaoJewelsSA1)file[index + 0x34];
     Key2            = file[index + 0x35];
     Flags           = (ChaoColorFlagsSA1)BitConverter.ToUInt16(file, index + 0x36);
     Position        = new Vertex(file, index + 0x38);
     Age             = BitConverter.ToUInt32(file, index + 0x44);
     ID = BitConverter.ToUInt32(file, index + 0x48);
     for (int p = 0; p < 7; p++)
     {
         AnimalParts[p] = (AnimalPartsSA1)file[index + 0x4C + p];
     }
     Key3        = file[index + 0x53];
     SwimPoints  = BitConverter.ToUInt16(file, index + 0x54);
     FlyPoints   = BitConverter.ToUInt16(file, index + 0x56);
     RunPoints   = BitConverter.ToUInt16(file, index + 0x58);
     PowerPoints = BitConverter.ToUInt16(file, index + 0x5A);
     Kindness    = (sbyte)file[index + 0x5C];
     Aggressive  = (sbyte)file[index + 0x5D];
     Curiosity   = (sbyte)file[index + 0x5E];
     Charm       = file[index + 0x5F];
     Breed       = file[index + 0x60];
     Sleep       = file[index + 0x61];
     Hunger      = file[index + 0x62];
     Tedious     = file[index + 0x63];
     Tiredness   = file[index + 0x64];
     Stress      = file[index + 0x65];
     Narrow      = file[index + 0x66];
     Pleasure    = file[index + 0x67];
     Anger       = file[index + 0x68];
     Sorrow      = file[index + 0x69];
     Fear        = file[index + 0x6A];
     Loneliness  = file[index + 0x6B];
     // IsCPU is at 0x17A in the struct but it's missing in the data, so everything shifts back 1 byte
     Memories       = new ChaoMemoriesSA1(file, index + 0x6C);
     Reincarnations = file[index + 0x178];
     Lane           = file[index + 0x179];
     Key4           = file[index + 0x17A];
     Exists         = (sbyte)file[index + 0x17B];
     CocoonTimer    = BitConverter.ToUInt16(file, index + 0x17C);
     for (int r = 0; r < 20; r++)
     {
         RaceTime[r] = file[index + 0x17E + r];
     }
     JewelBreed = (ChaoJewelBreedsSA1)BitConverter.ToUInt16(file, index + 0x192);
 }
Example #2
0
 public VMS_Chao()
 {
     Name     = "";
     Position = new Vertex();
     Memories = new ChaoMemoriesSA1();
 }