public DO_Character[][] GetAllCharacter()
        {
            string jsonFile = File.ReadAllText("Data/D_Character.json");

            s_characterDatas = JsonMapper.ToObject(jsonFile);
            res = new DO_Character[4][];
            for (int i = 0; i < 4; i++)
            {
                res[i] = new DO_Character[100];
            }
            for (int occupation = 0; occupation < 4; occupation++)
            {
                for (int level = 1; level <= 100; level++)
                {
                    DO_Character character = new DO_Character();
                    int          i         = occupation * 100 + level - 1;
                    character.m_occupation =
                        (OccupationType)Enum.Parse(typeof(OccupationType), s_characterDatas[i]["Occupation"].ToString());
                    character.m_level = (short)level;
                    character.m_upgradeExperienceInNeed =
                        int.Parse(s_characterDatas[i]["ExperienceInNeed"].ToString());
                    character.m_mainAttributeArr = new ValueTuple <ActorUnitMainAttributeType, int> [s_characterDatas[i]["MainAttributionTable"].Count];
                    for (int durex = 0; durex < s_characterDatas[i]["MainAttributionTable"].Count; durex++)
                    {
                        character.m_mainAttributeArr[durex] = new ValueTuple <ActorUnitMainAttributeType, int>
                                                                  ((ActorUnitMainAttributeType)Enum.Parse(typeof(ActorUnitMainAttributeType), s_characterDatas[i]["MainAttributionTable"][durex].ToString().Split(' ')[0]), int.Parse(s_characterDatas[i]["MainAttributionTable"][durex].ToString().Split(' ')[1]));
                    }
                    character.m_concreteAttributeArr = new ValueTuple <ActorUnitConcreteAttributeType, int> [s_characterDatas[i]["ConcreteAttributionTable"].Count];
                    for (int durex = 0; durex < s_characterDatas[i]["ConcreteAttributionTable"].Count; durex++)
                    {
                        ActorUnitConcreteAttributeType t = (ActorUnitConcreteAttributeType)Enum.Parse(typeof(ActorUnitConcreteAttributeType), s_characterDatas[i]["ConcreteAttributionTable"][durex].ToString().Split(' ')[0]);
                        if (character.m_occupation == OccupationType.ROGUE && t == ActorUnitConcreteAttributeType.ATTACK)
                        {
                            character.m_concreteAttributeArr[durex] = new ValueTuple <ActorUnitConcreteAttributeType, int>
                                                                          (t, 2 * (int)float.Parse(s_characterDatas[i]["ConcreteAttributionTable"][durex].ToString().Split(' ')[1]));
                        }
                        else
                        {
                            character.m_concreteAttributeArr[durex] = new ValueTuple <ActorUnitConcreteAttributeType, int>
                                                                          (t, (int)float.Parse(s_characterDatas[i]["ConcreteAttributionTable"][durex].ToString().Split(' ')[1]));
                        }
                    }
                    character.m_mainAttrPointNumber = short.Parse(s_characterDatas[i]["GiftPointNumber"].ToString());
                    // Console.WriteLine(occupation+" "+level);
                    res[occupation][level - 1] = character;
                }
            }

            return(res);
        }
        public static NO_EnchantmentItemInfo GetEnchantmentItemInfo(this NetDataReader reader)
        {
            long realId          = reader.GetLong();
            byte enchantAttrNum  = reader.GetByte();
            var  enchantAttrList = new List <(ActorUnitConcreteAttributeType, int)> (enchantAttrNum);

            for (int i = 0; i < enchantAttrNum; i++)
            {
                ActorUnitConcreteAttributeType attrType = (ActorUnitConcreteAttributeType)reader.GetByte();
                int attrValue = reader.GetInt();
                enchantAttrList.Add((attrType, attrValue));
            }
            return(new NO_EnchantmentItemInfo(realId, enchantAttrList));
        }
        public static NO_EquipmentItemInfo GetEquipmentItemInfo(this NetDataReader reader)
        {
            long realId          = reader.GetLong();
            byte strengthNum     = reader.GetByte();
            byte enchantAttrNum  = reader.GetByte();
            var  enchantAttrList = new List <(ActorUnitConcreteAttributeType, int)> (enchantAttrNum);

            for (int i = 0; i < enchantAttrNum; i++)
            {
                ActorUnitConcreteAttributeType attrType = (ActorUnitConcreteAttributeType)reader.GetByte();
                int attrValue = reader.GetInt();
                enchantAttrList.Add((attrType, attrValue));
            }
            byte gemNum    = reader.GetByte();
            var  gemIdList = new List <short> (gemNum);

            for (int i = 0; i < gemNum; i++)
            {
                gemIdList.Add(reader.GetShort());
            }
            return(new NO_EquipmentItemInfo(realId, strengthNum, enchantAttrList, gemIdList));
        }
Beispiel #4
0
 public void SetMainPointConAttr(ActorUnitConcreteAttributeType type, int value)
 {
     m_mainPointConcreteAttr.SetAttr(type, value);
 }
Beispiel #5
0
 public void AddEquipConAttr(ActorUnitConcreteAttributeType type, int value)
 {
     m_equipConcreteAttr.AddAttr(type, value);
 }
Beispiel #6
0
 public void AddAttr(ActorUnitConcreteAttributeType type, int value)
 {
     m_attrDict[type] += value;
 }
Beispiel #7
0
 public int GetAttr(ActorUnitConcreteAttributeType type)
 {
     return(m_attrDict[type]);
 }
Beispiel #8
0
 public void AddBattleConAttr(ActorUnitConcreteAttributeType type, int value)
 {
     m_battleConcreteAttr.AddAttr(type, value);
 }
Beispiel #9
0
        public DO_Monster[] GetAllMonster()
        {
            string jsonFile = File.ReadAllText("Data/D_Monster.json");

            s_monsterDatas = JsonMapper.ToObject(jsonFile);
            res            = new DO_Monster[s_monsterDatas.Count];
            for (int durex = 0; durex < s_monsterDatas.Count; durex++)
            {
                DO_Monster monster = new DO_Monster();
                monster.m_monsterId     = short.Parse(s_monsterDatas[durex]["MonsterID"].ToString());
                monster.m_level         = short.Parse(s_monsterDatas[durex]["Level"].ToString());
                monster.m_dropItemIdArr = new short[s_monsterDatas[durex]["DropList"].Count];
                for (int i = 0; i < s_monsterDatas[durex]["DropList"].Count; i++)
                {
                    monster.m_dropItemIdArr[i] = short.Parse(s_monsterDatas[durex]["DropList"][i].ToString());
                }
                monster.m_skillIdAndLevelArr = new ValueTuple <short, short> [s_monsterDatas[durex]["SkillList"].Count];
                for (int i = 0; i < monster.m_skillIdAndLevelArr.Length; i++)
                {
                    monster.m_skillIdAndLevelArr[i] = new ValueTuple <short, short>
                                                          (short.Parse(s_monsterDatas[durex]["SkillList"][i].ToString().Split(' ')[0]), short.Parse(s_monsterDatas[durex]["SkillList"][i].ToString().Split(' ')[1]));
                }
                monster.m_attrArr = new ValueTuple <ActorUnitConcreteAttributeType, int> [s_monsterDatas[durex]["ConcreteAttributionTable"].Count];
                int tpe = int.Parse(s_monsterDatas[durex]["Type"].ToString());
                for (int x = 0; x < s_monsterDatas[durex]["ConcreteAttributionTable"].Count; x++)
                {
                    ActorUnitConcreteAttributeType type = (ActorUnitConcreteAttributeType)Enum.Parse(typeof(ActorUnitConcreteAttributeType), s_monsterDatas[durex]["ConcreteAttributionTable"][x].ToString().Split(' ')[0]);
                    int num = int.Parse(s_monsterDatas[durex]["ConcreteAttributionTable"][x].ToString().Split(' ')[1]);
                    if (type == ActorUnitConcreteAttributeType.ATTACK || type == ActorUnitConcreteAttributeType.MAGIC)
                    {
                        if (tpe > 1)
                        {
                            monster.m_attrArr[x] = new ValueTuple <ActorUnitConcreteAttributeType, int>
                                                       (type, (int)(num / 1.5) / 5);
                        }
                        else
                        {
                            monster.m_attrArr[x] = new ValueTuple <ActorUnitConcreteAttributeType, int>
                                                       (type, (int)(num / 1.5));
                        }
                    }
                    else if (type == ActorUnitConcreteAttributeType.MAX_HP)
                    {
                        if (tpe > 1)
                        {
                            monster.m_attrArr[x] = new ValueTuple <ActorUnitConcreteAttributeType, int>
                                                       (type, (int)(num * 1.2) * 10);
                        }
                        else
                        {
                            monster.m_attrArr[x] = new ValueTuple <ActorUnitConcreteAttributeType, int>
                                                       (type, (int)(num * 1.2));
                        }
                    }
                    else
                    {
                        monster.m_attrArr[x] = new ValueTuple <ActorUnitConcreteAttributeType, int>
                                                   (type, num);
                    }
                }
                monster.m_monsterType = (MonsterType)tpe;
                res[durex]            = monster;
            }
            return(res);
        }