Exemplo n.º 1
0
        private static EntryCollection <FF9MIX_DATA> LoadSynthesis()
        {
            try
            {
                String inputPath = DataResources.Items.SynthesisFile;
                if (!File.Exists(inputPath))
                {
                    throw new FileNotFoundException($"[ff9mix] Cannot load synthesis info because a file does not exist: [{inputPath}].", inputPath);
                }

                FF9MIX_DATA[] items = CsvReader.Read <FF9MIX_DATA>(inputPath);
                if (items.Length < 64)
                {
                    throw new NotSupportedException($"You must set at least 64 synthesis info, but there {items.Length}. Any number of items will be available after a game stabilization.");
                }

                return(EntryCollection.CreateWithDefaultElement(items, i => i.Id));
            }
            catch (Exception ex)
            {
                Log.Error(ex, "[ff9mix] Load synthesis info failed.");
                UIManager.Input.ConfirmQuit();
                return(null);
            }
        }
Exemplo n.º 2
0
        private static EntryCollection <ShopItems> LoadShopItems()
        {
            try
            {
                String inputPath = DataResources.Items.ShopItems;
                if (!File.Exists(inputPath))
                {
                    throw new FileNotFoundException($"File with shop items not found: [{inputPath}]");
                }

                ShopItems[] shopItems = CsvReader.Read <ShopItems>(inputPath);
                if (shopItems.Length < FF9BUY_SHOP_MAX)
                {
                    throw new NotSupportedException($"You must set an assortment for {FF9BUY_SHOP_MAX} shops, but there {shopItems.Length}.");
                }

                return(EntryCollection.CreateWithDefaultElement(shopItems, e => e.Id));
            }
            catch (Exception ex)
            {
                Log.Error(ex, "[ff9buy] Load shop items failed.");
                UIManager.Input.ConfirmQuit();
                return(null);
            }
        }
Exemplo n.º 3
0
    private static EntryCollection <AA_DATA> LoadActions()
    {
        try
        {
            String inputPath = DataResources.Battle.ActionsFile;
            if (!File.Exists(inputPath))
            {
                throw new FileNotFoundException($"File with character actions not found: [{inputPath}]");
            }

            BattleActionEntry[] statusSets = CsvReader.Read <BattleActionEntry>(inputPath);
            if (statusSets.Length < BattleStatusEntry.SetsCount)
            {
                throw new NotSupportedException($"You must set {BattleStatusEntry.SetsCount} status sets, but there {statusSets.Length}.");
            }

            return(EntryCollection.CreateWithDefaultElement(statusSets, e => e.Id, e => e.ActionData));
        }
        catch (Exception ex)
        {
            Log.Error(ex, "[ff9level] Load base stats of characters failed.");
            UIManager.Input.ConfirmQuit();
            return(null);
        }
    }
Exemplo n.º 4
0
        private static EntryCollection <ItemDefence> LoadArmors()
        {
            try
            {
                String inputPath = DataResources.Items.ArmorsFile;
                if (!File.Exists(inputPath))
                {
                    throw new FileNotFoundException($"[ff9armor] Cannot load armors because a file does not exist: [{inputPath}].", inputPath);
                }

                ItemDefence[] items = CsvReader.Read <ItemDefence>(inputPath);
                if (items.Length < 136)
                {
                    throw new NotSupportedException($"You must set at least 136 armors, but there {items.Length}. Any number of items will be available after a game stabilization.");
                }

                return(EntryCollection.CreateWithDefaultElement(items, i => i.Id));
            }
            catch (Exception ex)
            {
                Log.Error(ex, "[ff9armor] Load armors failed.");
                UIManager.Input.ConfirmQuit();
                return(null);
            }
        }
Exemplo n.º 5
0
    private static EntryCollection <IdMap> LoadBattleCommandTitles()
    {
        try
        {
            String inputPath = DataResources.Characters.CommandTitlesFile;
            if (!File.Exists(inputPath))
            {
                throw new FileNotFoundException($"[BattleHUD] Cannot load character command titles because a file does not exist: [{inputPath}].", inputPath);
            }

            IdMap[] maps = CsvReader.Read <IdMap>(inputPath);
            if (maps.Length < 192)
            {
                throw new NotSupportedException($"You must set titles for 192 battle commands, but there {maps.Length}.");
            }

            return(EntryCollection.CreateWithDefaultElement(maps, g => g.Id));
        }
        catch (Exception ex)
        {
            Log.Error(ex, "[BattleHUD] Load character command titles failed.");
            UIManager.Input.ConfirmQuit();
            return(null);
        }
    }
Exemplo n.º 6
0
        private static EntryCollection <ItemStats> LoadStats()
        {
            try
            {
                String inputPath = DataResources.Items.StatsFile;
                if (!File.Exists(inputPath))
                {
                    throw new FileNotFoundException($"[{nameof(ff9equip)}] Cannot load items stats because a file does not exist: [{inputPath}].", inputPath);
                }

                ItemStats[] items = CsvReader.Read <ItemStats>(inputPath);
                if (items.Length < 88)
                {
                    throw new NotSupportedException($"[{nameof(ff9equip)}] You must set at least 176 item stats, but there {items.Length}. Any number of items will be available after a game stabilization.");
                }

                return(EntryCollection.CreateWithDefaultElement(items, i => i.Id));
            }
            catch (Exception ex)
            {
                Log.Error(ex, $"[{nameof(ff9equip)}] Load weapons failed.");
                UIManager.Input.ConfirmQuit();
                return(null);
            }
        }
Exemplo n.º 7
0
    private static EntryCollection <CharacterEquipment> LoadCharacterDefaultEquipment()
    {
        try
        {
            String inputPath = DataResources.Characters.DefaultEquipmentsFile;
            if (!File.Exists(inputPath))
            {
                throw new FileNotFoundException($"File with characters default equipments not found: [{inputPath}]");
            }

            CharacterEquipment[] equipment = CsvReader.Read <CharacterEquipment>(inputPath);
            if (equipment.Length < 15)
            {
                throw new NotSupportedException($"You must set at least 15 different entries, but there {equipment.Length}.");
            }

            return(EntryCollection.CreateWithDefaultElement(equipment, e => e.Id));
        }
        catch (Exception ex)
        {
            Log.Error(ex, "[ff9play] Load characters default equipments failed.");
            UIManager.Input.ConfirmQuit();
            return(null);
        }
    }
Exemplo n.º 8
0
        private static EntryCollection <CharacterAbilityGems> LoadCharacterAbilityGems()
        {
            try
            {
                String inputPath = DataResources.Characters.Abilities.GemsFile;
                if (!File.Exists(inputPath))
                {
                    throw new FileNotFoundException($"File with ability gems not found: [{inputPath}]");
                }

                CharacterAbilityGems[] gems = CsvReader.Read <CharacterAbilityGems>(inputPath);
                if (gems.Length != 64)
                {
                    throw new NotSupportedException($"You must set number of gems for 64 abilities, but there {gems.Length}. Any number of abilities will be available after a game stabilization.");
                }

                return(EntryCollection.CreateWithDefaultElement(gems, g => g.Id));
            }
            catch (Exception ex)
            {
                Log.Error(ex, "[ff9abil] Load abilitiy gems failed.");
                UIManager.Input.ConfirmQuit();
                return(null);
            }
        }
Exemplo n.º 9
0
    private static EntryCollection <CharacterBaseStats> LoadBaseStats()
    {
        try
        {
            String inputPath = DataResources.Characters.BaseStatsFile;
            if (!File.Exists(inputPath))
            {
                throw new FileNotFoundException($"File with base stats of characters not found: [{inputPath}]");
            }

            CharacterBaseStats[] baseStats = CsvReader.Read <CharacterBaseStats>(inputPath);
            if (baseStats.Length < CharacterId.CharacterCount)
            {
                throw new NotSupportedException($"You must set base stats for {CharacterId.CharacterCount} characters, but there {baseStats.Length}.");
            }

            return(EntryCollection.CreateWithDefaultElement(baseStats, e => e.Id));
        }
        catch (Exception ex)
        {
            Log.Error(ex, "[ff9level] Load base stats of characters failed.");
            UIManager.Input.ConfirmQuit();
            return(null);
        }
    }
Exemplo n.º 10
0
 public FF9StateBattleSystem()
 {
     this.p_mot = new String[][]
     {
         new String[34],
         new String[34],
         new String[34],
         new String[34]
     };
     this.enemy = new ENEMY[4];
     for (Int32 i = 0; i < (Int32)this.enemy.Length; i++)
     {
         this.enemy[i] = new ENEMY();
     }
     this.enemy_type = new ENEMY_TYPE[3];
     for (Int32 j = 0; j < (Int32)this.enemy_type.Length; j++)
     {
         this.enemy_type[j] = new ENEMY_TYPE();
     }
     this.enemy_attack = new AA_DATA[18];
     this.btl_list     = new BTL_DATA();
     this.btl_data     = new BTL_DATA[8];
     for (Int32 k = 0; k < (Int32)this.btl_data.Length; k++)
     {
         this.btl_data[k] = new BTL_DATA();
     }
     this.cmd_buffer = new CMD_DATA[36];
     for (Int32 l = 0; l < (Int32)this.cmd_buffer.Length; l++)
     {
         this.cmd_buffer[l] = new CMD_DATA();
     }
     this.cmd_escape     = new CMD_DATA();
     this.cmd_queue      = new CMD_DATA();
     this.cur_cmd        = new CMD_DATA();
     this.fx_req         = new BTL_VFX_REQ();
     this.seq_work_set   = new SEQ_WORK_SET();
     this.btl_scene      = new BTL_SCENE();
     this.btl2d_work_set = new BTL2D_WORK();
     this.status_data    = new STAT_DATA[32];
     this.aa_data        = EntryCollection.CreateWithDefaultElement <AA_DATA>(192);
     this.add_status     = EntryCollection.CreateWithDefaultElement <BattleStatusEntry>(64);
     this.map            = new FF9StateBattleMap();
 }