Example #1
0
 private static void ReadMonster()
 {
     Init_debugger_battle.Encounter enc = Memory.encounters[Memory.battle_encounter];
     if (enc.bNumOfEnemies == 0)
     {
         return;
     }
     //DEBUG BELOW; I just want to draw any model
     //MONSTERS ARE STILL IN DEBUG PHASE. They are NOT read from encounters!
     monstersData = new Debug_battleDat[3];
     //for (int n = 0; n < monstersData.Length; n++)
     //    monstersData[n] = new Debug_battleDat(n, Debug_battleDat.EntityType.Monster);
     monstersData[0] = new Debug_battleDat(92, Debug_battleDat.EntityType.Monster);
     monstersData[1] = new Debug_battleDat(73, Debug_battleDat.EntityType.Monster);
     monstersData[2] = new Debug_battleDat(74, Debug_battleDat.EntityType.Monster);
     //END OF DEBUG
 }
Example #2
0
        private static void InitBattle()
        {
            //MakiExtended.Debugger_Spawn();
            //MakiExtended.Debugger_Feed(typeof(Module_battle_debug), System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic);
            Input.OverrideLockMouse = true;
            Input.CurrentMode       = Input.MouseLockMode.Center;

            Init_debugger_battle.Encounter enc = Memory.encounters[Memory.battle_encounter];
            int stage = enc.bScenario;

            battlename = $"a0stg{stage.ToString("000")}.x";
            Console.WriteLine($"BS_DEBUG: Loading stage {battlename}");
            Console.WriteLine($"BS_DEBUG/ENC: Encounter: {Memory.battle_encounter}\t cEnemies: {enc.bNumOfEnemies}\t Enemies: {string.Join(",", enc.BEnemies.Where(x => x != 0x00).Select(x => $"0x{(x - 0x10).ToString("X02")}").ToArray())}");


            //init renderer
            effect           = new BasicEffect(Memory.graphics.GraphicsDevice);
            camTarget        = new Vector3(41.91198f, 33.59995f, 6.372305f);
            camPosition      = new Vector3(40.49409f, 39.70397f, -43.321299f);
            projectionMatrix = Matrix.CreatePerspectiveFieldOfView(
                MathHelper.ToRadians(45f),
                Memory.graphics.GraphicsDevice.DisplayMode.AspectRatio,
                1f, 1000f);
            viewMatrix = Matrix.CreateLookAt(camPosition, camTarget,
                                             new Vector3(0f, 1f, 0f));// Y up
            worldMatrix = Matrix.CreateWorld(camTarget, Vector3.
                                             Forward, Vector3.Up);
            battleModule++;
            RasterizerState rasterizerState = new RasterizerState
            {
                CullMode = CullMode.None
            };

            ate = new AlphaTestEffect(Memory.graphics.GraphicsDevice)
            {
                Projection = projectionMatrix,
                View       = viewMatrix,
                World      = worldMatrix
            };
            return;
        }