コード例 #1
0
ファイル: DataController.cs プロジェクト: mycmessia/Pokemon
    void Start()
    {
        _pokemonsDataList = LoadDictListFromXML("Pokemons", "PokemonsGeneration1");
        _skillsDataList   = LoadDictListFromXML("Skills", "SkillsGeneration1");

        Skill skill1 = SkillGenerator.Create();
    }
コード例 #2
0
ファイル: Pokemon.cs プロジェクト: mycmessia/Pokemon
    public Pokemon(int index)
    {
        Dictionary <string, string> dict = DataController.instance.pokemonsDataList[index - 1];

        _id    = IDController.id;
        _nameC = dict["nameC"];
        _nameE = dict["nameE"];

        _lv = 100;

        _charactor = Charactor.Hardy;

        _attr1 = (Attr)int.Parse(dict["attr1"]);
        _attr2 = (Attr)int.Parse(dict["attr2"]);

        attack      = CalcADSValue(dict, "attackRV");
        magicAttack = CalcADSValue(dict, "magicAttackRV");
        defend      = CalcADSValue(dict, "defendRV");
        magicDefend = CalcADSValue(dict, "magicDefendRV");
        speed       = CalcADSValue(dict, "speedRV");

        CharactorCalculator.instance.CharactorRevise(this);

        HP    = CalcHPValue(dict);
        curHP = HP;

        _attackBuff      = new Buff(BuffType.Attack, this);
        _magicAttackBuff = new Buff(BuffType.MagicAttack, this);
        _defendBuff      = new Buff(BuffType.Defend, this);
        _magicDefendBuff = new Buff(BuffType.MagicDefend, this);
        _speedBuff       = new Buff(BuffType.Speed, this);

        _skill1 = SkillGenerator.Create();
        _skill2 = SkillGenerator.Create();
        _skill3 = SkillGenerator.Create();
        _skill4 = SkillGenerator.Create();

        string[] skillIndex = dict["canLearnSkillsList"].Split(',');
        for (int i = 0; i < skillIndex.Length; i++)
        {
            canLearnSkillList.Add(int.Parse(skillIndex[i]));
        }

        _generation = dict["generation"];
    }