Esempio n. 1
0
 // Read all enemy types from enemy folder.
 private void ReadEnemyTypes()
 {
     string [] paths = Directory.GetFiles(Environment.CurrentDirectory +
                                          EnemyFolder);
     for (int i = 0; i < paths.Length; i++)
     {
         var    newEnemy = new EnemyType();
         string filename = Tools.FilenameFromPath(paths [i]);
         Tools.TrimFileExtension(ref filename, out string extension);
         if (extension.ToLower() == ".png" && filename.Length > 5)
         {
             newEnemy.EnemyID  = Tools.HexToInt(filename.Substring(0, 4));
             newEnemy.Name     = filename.Substring(5, filename.Length - 5);
             newEnemy.Graphics = new BlitImage(GraphicsIO.LoadBitmap(paths [i]));
             EnemyTypes.Add(newEnemy);
         }
     }
     EnemyTypes.Sort((x, y) => x.EnemyID - y.EnemyID);
     for (int i = 0; i < EnemyTypes.Count; i++)
     {
         EnemyTypes [i].Index = i;
     }
 }
Esempio n. 2
0
        public void InitializeEnemies()
        {
            EnemyTypes.Add(new EnemyType(EEnemyID.Claw_Activator,
                                         new List <byte>()
            {
                0x9D, 0x03
            },
                                         new List <int>()
            {
                3
            },
                                         true,
                                         true));
            EnemyTypes.Add(new EnemyType(EEnemyID.Tanishi,
                                         new List <byte>()
            {
                0x9B, 0x03, 0x9C, 0x03
            },
                                         new List <int>()
            {
                0, 1
            },
                                         false));
            EnemyTypes.Add(new EnemyType(EEnemyID.Kerog,
                                         new List <byte>()
            {
                0x9B, 0x02, 0x9C, 0x02, 0x9D, 0x02
            },
                                         new List <int>()
            {
                0, 1, 2
            },
                                         false,
                                         false,
                                         -4));
            EnemyTypes.Add(new EnemyType(EEnemyID.Batton,
                                         new List <byte>()
            {
                0x94, 0x02, 0x93, 0x02
            },
                                         new List <int>()
            {
                3, 4
            },
                                         false,
                                         true));
            EnemyTypes.Add(new EnemyType(EEnemyID.Robbit,
                                         new List <byte>()
            {
                0x98, 0x02, 0x99, 0x02, 0x9A, 0x02
            },
                                         new List <int>()
            {
                0, 1, 2
            },
                                         false));
            EnemyTypes.Add(new EnemyType(EEnemyID.Monking,
                                         new List <byte>()
            {
                0x98, 0x01, 0x99, 0x01, 0x9A, 0x01, 0x9B, 0x01
            },
                                         new List <int>()
            {
                0, 1, 2, 3
            },
                                         false)); // TODO
            EnemyTypes.Add(new EnemyType(EEnemyID.Kukku_Activator,
                                         new List <byte>()
            {
                0x90, 0x01, 0x91, 0x01, 0x92, 0x01, 0x93, 0x01
            },
                                         new List <int>()
            {
                0, 1, 2, 3
            },
                                         true,
                                         true));
            EnemyTypes.Add(new EnemyType(EEnemyID.Telly,
                                         new List <byte>()
            {
                0x93, 0x01
            },
                                         new List <int>()
            {
                4
            },
                                         false,
                                         true));
            EnemyTypes.Add(new EnemyType(EEnemyID.ChangkeyMaker,
                                         new List <byte>()
            {
                0x90, 0x04, 0x91, 0x04, 0x92, 0x04, 0x93, 0x04
            },
                                         new List <int>()
            {
                0, 1, 2, 4
            },
                                         false,
                                         false,
                                         -4));
            EnemyTypes.Add(new EnemyType(EEnemyID.Pierrobot,
                                         new List <byte>()
            {
                0x96, 0x01, 0x97, 0x01
            },
                                         new List <int>()
            {
                0, 1
            },
                                         false));
            EnemyTypes.Add(new EnemyType(EEnemyID.FlyBoy,
                                         new List <byte>()
            {
                0x94, 0x01, 0x95, 0x01
            },
                                         new List <int>()
            {
                0, 1
            },
                                         false,
                                         true));
            EnemyTypes.Add(new EnemyType(EEnemyID.Press,
                                         new List <byte>()
            {
                0x9E, 0x04
            },
                                         new List <int>()
            {
                3
            },
                                         false,
                                         true));
            EnemyTypes.Add(new EnemyType(EEnemyID.Blocky,
                                         new List <byte>()
            {
                0x9E, 0x03
            },
                                         new List <int>()
            {
                3
            },
                                         false,
                                         false,
                                         -32));
            EnemyTypes.Add(new EnemyType(EEnemyID.NeoMetall,
                                         new List <byte>()
            {
                0x92, 0x02, 0x9A, 0x03
            },
                                         new List <int>()
            {
                2, 3
            },
                                         false));
            EnemyTypes.Add(new EnemyType(EEnemyID.Matasaburo,
                                         new List <byte>()
            {
                0x90, 0x02, 0x91, 0x02, 0x92, 0x02
            },
                                         new List <int>()
            {
                0, 1, 2
            },
                                         false,
                                         false,
                                         -4));
            EnemyTypes.Add(new EnemyType(EEnemyID.Pipi_Activator,
                                         new List <byte>()
            {
                0x9C, 0x01
            },
                                         new List <int>()
            {
                4
            },
                                         true,
                                         true));
            EnemyTypes.Add(new EnemyType(EEnemyID.LightningGoro,
                                         new List <byte>()
            {
                0x9D, 0x01, 0x9E, 0x01, 0x9F, 0x01
            },
                                         new List <int>()
            {
                0, 1, 2
            },
                                         false));
            EnemyTypes.Add(new EnemyType(EEnemyID.Mole_Activator,
                                         new List <byte>()
            {
                0x90, 0x03
            },
                                         new List <int>()
            {
                4
            },
                                         true,
                                         true));
            EnemyTypes.Add(new EnemyType(EEnemyID.Shotman_Left,
                                         new List <byte>()
            {
                0x98, 0x03, 0x99, 0x03
            },
                                         new List <int>()
            {
                0, 1
            },
                                         false));
            EnemyTypes.Add(new EnemyType(EEnemyID.SniperArmor,
                                         new List <byte>()
            {
                0x91, 0x03, 0x92, 0x03, 0x93, 0x03, 0x94, 0x03, 0x95, 0x03
            },
                                         new List <int>()
            {
                0, 1, 2, 3, 4
            },
                                         false,
                                         false,
                                         -16));
            EnemyTypes.Add(new EnemyType(EEnemyID.SniperJoe,
                                         new List <byte>()
            {
                0x94, 0x03, 0x95, 0x03
            },
                                         new List <int>()
            {
                3, 4
            },
                                         false));
            EnemyTypes.Add(new EnemyType(EEnemyID.Scworm,
                                         new List <byte>()
            {
                0x9E, 0x04
            },
                                         new List <int>()
            {
                3
            },
                                         false,
                                         false,
                                         8));
            EnemyTypes.Add(new EnemyType(EEnemyID.Springer,
                                         new List <byte>()
            {
                0x9F, 0x03
            },
                                         new List <int>()
            {
                5
            },
                                         false,
                                         false,
                                         4));
            //EnemyTypes.Add(new EnemyType(EEnemyID.PetitGoblin,
            //    new List<byte>() { 0x96, 0x03 },
            //    new List<int>() { 5 }));
            EnemyTypes.Add(new EnemyType(EEnemyID.Shrink,
                                         new List <byte>()
            {
                0x9E, 0x02, 0x9F, 0x02
            },
                                         new List <int>()
            {
                0, 1
            },
                                         false));
            //EnemyTypes.Add(new EnemyType(EEnemyID.BigFish,
            //    new List<byte>() { 0x94, 0x04, 0x95, 0x04, 0x96, 0x04, 0x97, 0x04 },
            //    new List<int>() { 0, 1, 2, 3 }));
            EnemyTypes.Add(new EnemyType(EEnemyID.M445_Activator,
                                         new List <byte>()
            {
                0x97, 0x02
            },
                                         new List <int>()
            {
                2
            },
                                         true,
                                         true));

            // Copy enemy list to dictionary
            foreach (EnemyType e in EnemyTypes)
            {
                EnemiesByType.Add(e.ID, e);
            }
        }