コード例 #1
0
 public StatList(StatList s)
 {
     for (int i = 0; i < s.statList.Count; i++)
     {
         statList.Add(new Stat(s.statList[i]));
         currentStatList.Add(new Stat(s.statList[i]));
     }
 }
コード例 #2
0
 public Monster(string name, StatList stats, Type type, AbilityList abilities, int idx)
 {
     this.name      = name;
     this.stats     = new StatList(stats);
     this.idx       = idx;
     this.abilities = new AbilityList(abilities);
     this.type      = new Type(type);
 }
コード例 #3
0
 public Monster(Monster m)
 {
     name      = m.name;
     abilities = new AbilityList(m.abilities);
     stats     = new StatList(m.stats);
     level     = m.level;
     idx       = m.idx;
     type      = new Type(m.type);
 }
コード例 #4
0
 public Monster(string monsterName)
 {
     for (int i = 0; i < DataClass.masterMonsterList.Count; i++)
     {
         if (DataClass.masterMonsterList[i].name.Equals(monsterName))
         {
             name      = DataClass.masterMonsterList[i].name;
             abilities = new AbilityList(DataClass.masterMonsterList[i].abilities);
             stats     = DataClass.masterMonsterList[i].stats;
         }
     }
 }
コード例 #5
0
        void loadMasterMonsterList()
        {
            string[] s       = File.ReadAllLines(monsterFile);
            int      numArgs = 10;

            for (int i = 0; i < s.Length; i += numArgs)
            {
                //grabs stat values
                int   offset1;
                int[] statValues = new int[StatList.statNames.Length];
                for (offset1 = 1; offset1 <= statValues.Length; offset1++)
                {
                    statValues[offset1 - 1] = int.Parse(s[i + offset1]);
                }
                Type type = new Type(s[i + offset1]);
                offset1++;
                //gets the names of the monster's abilities
                int      offset2      = offset1;
                string[] abilityNames = new string[AbilityList.getAbilityLimit()];
                for (; offset2 < offset1 + AbilityList.getAbilityLimit(); offset2++)
                {
                    abilityNames[offset2 - offset1] = s[i + offset2];
                }

                //puts the abilities into the monsters ability list
                List <Ability> abilityList = new List <Ability>();
                for (int j = 0; j < AbilityList.getAbilityLimit(); j++)
                {
                    if (!abilityNames[j].Equals("none"))
                    {
                        for (int m = 0; m < masterAbilityList.Count; m++)
                        {
                            if (abilityNames[j].Equals(masterAbilityList[m].name))
                            {
                                abilityList.Add(masterAbilityList[m]);
                            }
                        }
                    }
                }
                StatList    stats     = new StatList(statValues);
                AbilityList abilities = new AbilityList(abilityList);
                Monster     mon       = new Monster(s[i], stats, type, abilities, i / numArgs);
                masterMonsterList.Add(mon);
            }
        }