Example #1
0
    // 주 원소 획득 / 교체
    public void SetMainElement(int slot, SkillElement element)
    {
        if (slot < 0 || slot >= mainElementContainSize)
        {
            return;
        }

        mainElement[slot] = (int)element;
        mainElementLearnEvent.Invoke(slot, (int)element);
    }
Example #2
0
 public Skill(string name, int id, //string desc,
              int maxrank, SkillType type,
              SkillStyle style = SkillStyle.None, SkillElement element = SkillElement.None)
 {
     this.skillName = name;
     this.skillID   = id;
     //this.skillDesc = desc;
     this.skillRank    = 0;
     this.skillMaxRank = maxrank;
     //skillAilments = ailments;
     this.skillType       = type;
     this.skillStyle      = style;
     skillElement         = element;
     skillChannelDuration = 0f;
     extras = new List <int>();
 }
Example #3
0
 public Skill(Skill skill)
 {
     skillName            = skill.skillName;
     skillMana            = skill.skillMana;
     skillID              = skill.skillID;
     skillDesc            = skill.skillDesc;
     skillRank            = skill.skillRank;
     skillMaxRank         = skill.skillMaxRank;
     skillType            = skill.skillType;
     skillStyle           = skill.skillStyle;
     skillElement         = skill.skillElement;
     DamageAmount         = skill.DamageAmount;
     HitChance            = skill.HitChance;
     Knockback            = skill.Knockback;
     Stun                 = skill.Stun;
     skillCooldown        = skill.skillCooldown;
     skillChannelDuration = skill.skillChannelDuration;
     skillActiveDuration  = skill.skillActiveDuration;
     extras               = skill.extras;
 }
Example #4
0
 private SkillTable()
 {
     m_mapElements    = new Dictionary <int, SkillElement>();
     m_emptyItem      = new SkillElement();
     m_vecAllElements = new List <SkillElement>();
 }
Example #5
0
    public bool LoadCsv(string strContent)
    {
        if (strContent.Length == 0)
        {
            return(false);
        }
        m_mapElements.Clear();
        m_vecAllElements.Clear();
        int           contentOffset = 0;
        List <string> vecLine;

        vecLine = GameAssist.readCsvLine(strContent, ref contentOffset);
        if (vecLine.Count != 12)
        {
            Ex.Logger.Log("Skill.csv中列数量与生成的代码不匹配!");
            return(false);
        }
        if (vecLine[0] != "id")
        {
            Ex.Logger.Log("Skill.csv中字段[id]位置不对应"); return(false);
        }
        if (vecLine[1] != "ligic_id")
        {
            Ex.Logger.Log("Skill.csv中字段[ligic_id]位置不对应"); return(false);
        }
        if (vecLine[2] != "charge_or_interval")
        {
            Ex.Logger.Log("Skill.csv中字段[charge_or_interval]位置不对应"); return(false);
        }
        if (vecLine[3] != "cooldown_id")
        {
            Ex.Logger.Log("Skill.csv中字段[cooldown_id]位置不对应"); return(false);
        }
        if (vecLine[4] != "cooldown_time")
        {
            Ex.Logger.Log("Skill.csv中字段[cooldown_time]位置不对应"); return(false);
        }
        if (vecLine[5] != "charge_time")
        {
            Ex.Logger.Log("Skill.csv中字段[charge_time]位置不对应"); return(false);
        }
        if (vecLine[6] != "channel_time")
        {
            Ex.Logger.Log("Skill.csv中字段[channel_time]位置不对应"); return(false);
        }
        if (vecLine[7] != "pars")
        {
            Ex.Logger.Log("Skill.csv中字段[pars]位置不对应"); return(false);
        }
        if (vecLine[8] != "attack_type")
        {
            Ex.Logger.Log("Skill.csv中字段[attack_type]位置不对应"); return(false);
        }
        if (vecLine[9] != "attack_rate")
        {
            Ex.Logger.Log("Skill.csv中字段[attack_rate]位置不对应"); return(false);
        }
        if (vecLine[10] != "attack_value")
        {
            Ex.Logger.Log("Skill.csv中字段[attack_value]位置不对应"); return(false);
        }
        if (vecLine[11] != "attack_range")
        {
            Ex.Logger.Log("Skill.csv中字段[attack_range]位置不对应"); return(false);
        }

        while (true)
        {
            vecLine = GameAssist.readCsvLine(strContent, ref contentOffset);
            if ((int)vecLine.Count == 0)
            {
                break;
            }
            if ((int)vecLine.Count != (int)12)
            {
                return(false);
            }
            SkillElement member = new SkillElement();
            member.id                 = Convert.ToInt32(vecLine[0]);
            member.ligic_id           = Convert.ToInt32(vecLine[1]);
            member.charge_or_interval = Convert.ToInt32(vecLine[2]);
            member.cooldown_id        = Convert.ToInt32(vecLine[3]);
            member.cooldown_time      = Convert.ToInt32(vecLine[4]);
            member.charge_time        = Convert.ToInt32(vecLine[5]);
            member.channel_time       = Convert.ToInt32(vecLine[6]);
            member.pars               = vecLine[7];
            member.attack_type        = Convert.ToInt32(vecLine[8]);
            member.attack_rate        = Convert.ToInt32(vecLine[9]);
            member.attack_value       = Convert.ToInt32(vecLine[10]);
            member.attack_range       = Convert.ToInt32(vecLine[11]);

            member.IsValidate = true;
            m_vecAllElements.Add(member);
            m_mapElements[member.id] = member;
        }
        return(true);
    }
Example #6
0
    public bool LoadBin(byte[] binContent)
    {
        m_mapElements.Clear();
        m_vecAllElements.Clear();
        int nCol, nRow;
        int readPos = 0;

        readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nCol);
        readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nRow);
        List <string> vecLine     = new List <string>(nCol);
        List <int>    vecHeadType = new List <int>(nCol);
        string        tmpStr;
        int           tmpInt;

        for (int i = 0; i < nCol; i++)
        {
            readPos += GameAssist.ReadString(binContent, readPos, out tmpStr);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out tmpInt);
            vecLine.Add(tmpStr);
            vecHeadType.Add(tmpInt);
        }
        if (vecLine.Count != 12)
        {
            Ex.Logger.Log("Skill.csv中列数量与生成的代码不匹配!");
            return(false);
        }
        if (vecLine[0] != "id")
        {
            Ex.Logger.Log("Skill.csv中字段[id]位置不对应"); return(false);
        }
        if (vecLine[1] != "ligic_id")
        {
            Ex.Logger.Log("Skill.csv中字段[ligic_id]位置不对应"); return(false);
        }
        if (vecLine[2] != "charge_or_interval")
        {
            Ex.Logger.Log("Skill.csv中字段[charge_or_interval]位置不对应"); return(false);
        }
        if (vecLine[3] != "cooldown_id")
        {
            Ex.Logger.Log("Skill.csv中字段[cooldown_id]位置不对应"); return(false);
        }
        if (vecLine[4] != "cooldown_time")
        {
            Ex.Logger.Log("Skill.csv中字段[cooldown_time]位置不对应"); return(false);
        }
        if (vecLine[5] != "charge_time")
        {
            Ex.Logger.Log("Skill.csv中字段[charge_time]位置不对应"); return(false);
        }
        if (vecLine[6] != "channel_time")
        {
            Ex.Logger.Log("Skill.csv中字段[channel_time]位置不对应"); return(false);
        }
        if (vecLine[7] != "pars")
        {
            Ex.Logger.Log("Skill.csv中字段[pars]位置不对应"); return(false);
        }
        if (vecLine[8] != "attack_type")
        {
            Ex.Logger.Log("Skill.csv中字段[attack_type]位置不对应"); return(false);
        }
        if (vecLine[9] != "attack_rate")
        {
            Ex.Logger.Log("Skill.csv中字段[attack_rate]位置不对应"); return(false);
        }
        if (vecLine[10] != "attack_value")
        {
            Ex.Logger.Log("Skill.csv中字段[attack_value]位置不对应"); return(false);
        }
        if (vecLine[11] != "attack_range")
        {
            Ex.Logger.Log("Skill.csv中字段[attack_range]位置不对应"); return(false);
        }

        for (int i = 0; i < nRow; i++)
        {
            SkillElement member = new SkillElement();
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.id);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.ligic_id);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.charge_or_interval);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.cooldown_id);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.cooldown_time);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.charge_time);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.channel_time);
            readPos += GameAssist.ReadString(binContent, readPos, out member.pars);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.attack_type);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.attack_rate);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.attack_value);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.attack_range);

            member.IsValidate = true;
            m_vecAllElements.Add(member);
            m_mapElements[member.id] = member;
        }
        return(true);
    }
Example #7
0
    public bool LoadCsv(string strContent)
    {
        if (strContent.Length == 0)
        {
            return(false);
        }
        m_mapElements.Clear();
        m_vecAllElements.Clear();
        int           contentOffset = 0;
        List <string> vecLine;

        vecLine = GameAssist.readCsvLine(strContent, ref contentOffset);
        if (vecLine.Count != 57)
        {
            Ex.Logger.Log("Skill.csv中列数量与生成的代码不匹配!");
            return(false);
        }
        if (vecLine[0] != "SkillID")
        {
            Ex.Logger.Log("Skill.csv中字段[SkillID]位置不对应"); return(false);
        }
        if (vecLine[1] != "Name")
        {
            Ex.Logger.Log("Skill.csv中字段[Name]位置不对应"); return(false);
        }
        if (vecLine[2] != "SourceIcon")
        {
            Ex.Logger.Log("Skill.csv中字段[SourceIcon]位置不对应"); return(false);
        }
        if (vecLine[3] != "Hero")
        {
            Ex.Logger.Log("Skill.csv中字段[Hero]位置不对应"); return(false);
        }
        if (vecLine[4] != "Type")
        {
            Ex.Logger.Log("Skill.csv中字段[Type]位置不对应"); return(false);
        }
        if (vecLine[5] != "SkillType")
        {
            Ex.Logger.Log("Skill.csv中字段[SkillType]位置不对应"); return(false);
        }
        if (vecLine[6] != "FenDuan")
        {
            Ex.Logger.Log("Skill.csv中字段[FenDuan]位置不对应"); return(false);
        }
        if (vecLine[7] != "XuLiStart")
        {
            Ex.Logger.Log("Skill.csv中字段[XuLiStart]位置不对应"); return(false);
        }
        if (vecLine[8] != "XuLiXunHuan")
        {
            Ex.Logger.Log("Skill.csv中字段[XuLiXunHuan]位置不对应"); return(false);
        }
        if (vecLine[9] != "XuLiSkill")
        {
            Ex.Logger.Log("Skill.csv中字段[XuLiSkill]位置不对应"); return(false);
        }
        if (vecLine[10] != "YinChangTime")
        {
            Ex.Logger.Log("Skill.csv中字段[YinChangTime]位置不对应"); return(false);
        }
        if (vecLine[11] != "YinChangSkill")
        {
            Ex.Logger.Log("Skill.csv中字段[YinChangSkill]位置不对应"); return(false);
        }
        if (vecLine[12] != "YinDaoTime")
        {
            Ex.Logger.Log("Skill.csv中字段[YinDaoTime]位置不对应"); return(false);
        }
        if (vecLine[13] != "YinDaoSkill")
        {
            Ex.Logger.Log("Skill.csv中字段[YinDaoSkill]位置不对应"); return(false);
        }
        if (vecLine[14] != "HitType")
        {
            Ex.Logger.Log("Skill.csv中字段[HitType]位置不对应"); return(false);
        }
        if (vecLine[15] != "SkillMana")
        {
            Ex.Logger.Log("Skill.csv中字段[SkillMana]位置不对应"); return(false);
        }
        if (vecLine[16] != "CD")
        {
            Ex.Logger.Log("Skill.csv中字段[CD]位置不对应"); return(false);
        }
        if (vecLine[17] != "AttackRange")
        {
            Ex.Logger.Log("Skill.csv中字段[AttackRange]位置不对应"); return(false);
        }
        if (vecLine[18] != "HitRange")
        {
            Ex.Logger.Log("Skill.csv中字段[HitRange]位置不对应"); return(false);
        }
        if (vecLine[19] != "Tips")
        {
            Ex.Logger.Log("Skill.csv中字段[Tips]位置不对应"); return(false);
        }
        if (vecLine[20] != "Set")
        {
            Ex.Logger.Log("Skill.csv中字段[Set]位置不对应"); return(false);
        }
        if (vecLine[21] != "LVMAX")
        {
            Ex.Logger.Log("Skill.csv中字段[LVMAX]位置不对应"); return(false);
        }
        if (vecLine[22] != "LvUp")
        {
            Ex.Logger.Log("Skill.csv中字段[LvUp]位置不对应"); return(false);
        }
        if (vecLine[23] != "LvUpMoney")
        {
            Ex.Logger.Log("Skill.csv中字段[LvUpMoney]位置不对应"); return(false);
        }
        if (vecLine[24] != "Attributes")
        {
            Ex.Logger.Log("Skill.csv中字段[Attributes]位置不对应"); return(false);
        }
        if (vecLine[25] != "Limit")
        {
            Ex.Logger.Log("Skill.csv中字段[Limit]位置不对应"); return(false);
        }
        if (vecLine[26] != "UnderAttack")
        {
            Ex.Logger.Log("Skill.csv中字段[UnderAttack]位置不对应"); return(false);
        }
        if (vecLine[27] != "AblityID")
        {
            Ex.Logger.Log("Skill.csv中字段[AblityID]位置不对应"); return(false);
        }
        if (vecLine[28] != "FriendNum")
        {
            Ex.Logger.Log("Skill.csv中字段[FriendNum]位置不对应"); return(false);
        }
        if (vecLine[29] != "FriendBuffID")
        {
            Ex.Logger.Log("Skill.csv中字段[FriendBuffID]位置不对应"); return(false);
        }
        if (vecLine[30] != "BuffID")
        {
            Ex.Logger.Log("Skill.csv中字段[BuffID]位置不对应"); return(false);
        }
        if (vecLine[31] != "BuffRate")
        {
            Ex.Logger.Log("Skill.csv中字段[BuffRate]位置不对应"); return(false);
        }
        if (vecLine[32] != "AttBuffEle")
        {
            Ex.Logger.Log("Skill.csv中字段[AttBuffEle]位置不对应"); return(false);
        }
        if (vecLine[33] != "DefBuffEle")
        {
            Ex.Logger.Log("Skill.csv中字段[DefBuffEle]位置不对应"); return(false);
        }
        if (vecLine[34] != "TrapID")
        {
            Ex.Logger.Log("Skill.csv中字段[TrapID]位置不对应"); return(false);
        }
        if (vecLine[35] != "HatredCoefficient")
        {
            Ex.Logger.Log("Skill.csv中字段[HatredCoefficient]位置不对应"); return(false);
        }
        if (vecLine[36] != "SkillHatred")
        {
            Ex.Logger.Log("Skill.csv中字段[SkillHatred]位置不对应"); return(false);
        }
        if (vecLine[37] != "DamageRuduce")
        {
            Ex.Logger.Log("Skill.csv中字段[DamageRuduce]位置不对应"); return(false);
        }
        if (vecLine[38] != "DamageNum")
        {
            Ex.Logger.Log("Skill.csv中字段[DamageNum]位置不对应"); return(false);
        }
        if (vecLine[39] != "AttSpcialEle")
        {
            Ex.Logger.Log("Skill.csv中字段[AttSpcialEle]位置不对应"); return(false);
        }
        if (vecLine[40] != "DefSpcialEle")
        {
            Ex.Logger.Log("Skill.csv中字段[DefSpcialEle]位置不对应"); return(false);
        }
        if (vecLine[41] != "SpcialDamageNum")
        {
            Ex.Logger.Log("Skill.csv中字段[SpcialDamageNum]位置不对应"); return(false);
        }
        if (vecLine[42] != "SkillDistance")
        {
            Ex.Logger.Log("Skill.csv中字段[SkillDistance]位置不对应"); return(false);
        }
        if (vecLine[43] != "TargetOpt")
        {
            Ex.Logger.Log("Skill.csv中字段[TargetOpt]位置不对应"); return(false);
        }
        if (vecLine[44] != "TargetNum")
        {
            Ex.Logger.Log("Skill.csv中字段[TargetNum]位置不对应"); return(false);
        }
        if (vecLine[45] != "ParameterType")
        {
            Ex.Logger.Log("Skill.csv中字段[ParameterType]位置不对应"); return(false);
        }
        if (vecLine[46] != "ParameterNum")
        {
            Ex.Logger.Log("Skill.csv中字段[ParameterNum]位置不对应"); return(false);
        }
        if (vecLine[47] != "TargetGroup")
        {
            Ex.Logger.Log("Skill.csv中字段[TargetGroup]位置不对应"); return(false);
        }
        if (vecLine[48] != "DamageAmend")
        {
            Ex.Logger.Log("Skill.csv中字段[DamageAmend]位置不对应"); return(false);
        }
        if (vecLine[49] != "IsFanXiang")
        {
            Ex.Logger.Log("Skill.csv中字段[IsFanXiang]位置不对应"); return(false);
        }
        if (vecLine[50] != "IsYiDong")
        {
            Ex.Logger.Log("Skill.csv中字段[IsYiDong]位置不对应"); return(false);
        }
        if (vecLine[51] != "HandleType")
        {
            Ex.Logger.Log("Skill.csv中字段[HandleType]位置不对应"); return(false);
        }
        if (vecLine[52] != "Special")
        {
            Ex.Logger.Log("Skill.csv中字段[Special]位置不对应"); return(false);
        }
        if (vecLine[53] != "TargetArea")
        {
            Ex.Logger.Log("Skill.csv中字段[TargetArea]位置不对应"); return(false);
        }
        if (vecLine[54] != "DaoDi")
        {
            Ex.Logger.Log("Skill.csv中字段[DaoDi]位置不对应"); return(false);
        }
        if (vecLine[55] != "HitBack")
        {
            Ex.Logger.Log("Skill.csv中字段[HitBack]位置不对应"); return(false);
        }
        if (vecLine[56] != "ZiDong")
        {
            Ex.Logger.Log("Skill.csv中字段[ZiDong]位置不对应"); return(false);
        }

        while (true)
        {
            vecLine = GameAssist.readCsvLine(strContent, ref contentOffset);
            if ((int)vecLine.Count == 0)
            {
                break;
            }
            if ((int)vecLine.Count != (int)57)
            {
                return(false);
            }
            SkillElement member = new SkillElement();
            member.SkillID           = Convert.ToInt32(vecLine[0]);
            member.Name              = vecLine[1];
            member.SourceIcon        = vecLine[2];
            member.Hero              = Convert.ToInt32(vecLine[3]);
            member.Type              = Convert.ToInt32(vecLine[4]);
            member.SkillType         = Convert.ToInt32(vecLine[5]);
            member.FenDuan           = vecLine[6];
            member.XuLiStart         = vecLine[7];
            member.XuLiXunHuan       = vecLine[8];
            member.XuLiSkill         = vecLine[9];
            member.YinChangTime      = Convert.ToInt32(vecLine[10]);
            member.YinChangSkill     = vecLine[11];
            member.YinDaoTime        = Convert.ToInt32(vecLine[12]);
            member.YinDaoSkill       = vecLine[13];
            member.HitType           = Convert.ToInt32(vecLine[14]);
            member.SkillMana         = vecLine[15];
            member.CD                = Convert.ToInt32(vecLine[16]);
            member.AttackRange       = Convert.ToSingle(vecLine[17]);
            member.HitRange          = Convert.ToInt32(vecLine[18]);
            member.Tips              = vecLine[19];
            member.Set               = Convert.ToInt32(vecLine[20]);
            member.LVMAX             = Convert.ToInt32(vecLine[21]);
            member.LvUp              = Convert.ToInt32(vecLine[22]);
            member.LvUpMoney         = Convert.ToInt32(vecLine[23]);
            member.Attributes        = Convert.ToInt32(vecLine[24]);
            member.Limit             = Convert.ToInt32(vecLine[25]);
            member.UnderAttack       = Convert.ToInt32(vecLine[26]);
            member.AblityID          = vecLine[27];
            member.FriendNum         = Convert.ToInt32(vecLine[28]);
            member.FriendBuffID      = vecLine[29];
            member.BuffID            = vecLine[30];
            member.BuffRate          = vecLine[31];
            member.AttBuffEle        = vecLine[32];
            member.DefBuffEle        = vecLine[33];
            member.TrapID            = vecLine[34];
            member.HatredCoefficient = Convert.ToSingle(vecLine[35]);
            member.SkillHatred       = Convert.ToSingle(vecLine[36]);
            member.DamageRuduce      = Convert.ToInt32(vecLine[37]);
            member.DamageNum         = vecLine[38];
            member.AttSpcialEle      = Convert.ToInt32(vecLine[39]);
            member.DefSpcialEle      = Convert.ToInt32(vecLine[40]);
            member.SpcialDamageNum   = vecLine[41];
            member.SkillDistance     = Convert.ToInt32(vecLine[42]);
            member.TargetOpt         = Convert.ToInt32(vecLine[43]);
            member.TargetNum         = Convert.ToInt32(vecLine[44]);
            member.ParameterType     = vecLine[45];
            member.ParameterNum      = vecLine[46];
            member.TargetGroup       = Convert.ToInt32(vecLine[47]);
            member.DamageAmend       = vecLine[48];
            member.IsFanXiang        = Convert.ToInt32(vecLine[49]);
            member.IsYiDong          = Convert.ToInt32(vecLine[50]);
            member.HandleType        = Convert.ToInt32(vecLine[51]);
            member.Special           = Convert.ToInt32(vecLine[52]);
            member.TargetArea        = Convert.ToInt32(vecLine[53]);
            member.DaoDi             = Convert.ToInt32(vecLine[54]);
            member.HitBack           = Convert.ToInt32(vecLine[55]);
            member.ZiDong            = Convert.ToInt32(vecLine[56]);

            member.IsValidate = true;
            m_vecAllElements.Add(member);
            m_mapElements[member.SkillID] = member;
        }
        return(true);
    }
Example #8
0
    public bool LoadBin(byte[] binContent)
    {
        m_mapElements.Clear();
        m_vecAllElements.Clear();
        int nCol, nRow;
        int readPos = 0;

        readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nCol);
        readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nRow);
        List <string> vecLine     = new List <string>(nCol);
        List <int>    vecHeadType = new List <int>(nCol);
        string        tmpStr;
        int           tmpInt;

        for (int i = 0; i < nCol; i++)
        {
            readPos += GameAssist.ReadString(binContent, readPos, out tmpStr);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out tmpInt);
            vecLine.Add(tmpStr);
            vecHeadType.Add(tmpInt);
        }
        if (vecLine.Count != 57)
        {
            Ex.Logger.Log("Skill.csv中列数量与生成的代码不匹配!");
            return(false);
        }
        if (vecLine[0] != "SkillID")
        {
            Ex.Logger.Log("Skill.csv中字段[SkillID]位置不对应"); return(false);
        }
        if (vecLine[1] != "Name")
        {
            Ex.Logger.Log("Skill.csv中字段[Name]位置不对应"); return(false);
        }
        if (vecLine[2] != "SourceIcon")
        {
            Ex.Logger.Log("Skill.csv中字段[SourceIcon]位置不对应"); return(false);
        }
        if (vecLine[3] != "Hero")
        {
            Ex.Logger.Log("Skill.csv中字段[Hero]位置不对应"); return(false);
        }
        if (vecLine[4] != "Type")
        {
            Ex.Logger.Log("Skill.csv中字段[Type]位置不对应"); return(false);
        }
        if (vecLine[5] != "SkillType")
        {
            Ex.Logger.Log("Skill.csv中字段[SkillType]位置不对应"); return(false);
        }
        if (vecLine[6] != "FenDuan")
        {
            Ex.Logger.Log("Skill.csv中字段[FenDuan]位置不对应"); return(false);
        }
        if (vecLine[7] != "XuLiStart")
        {
            Ex.Logger.Log("Skill.csv中字段[XuLiStart]位置不对应"); return(false);
        }
        if (vecLine[8] != "XuLiXunHuan")
        {
            Ex.Logger.Log("Skill.csv中字段[XuLiXunHuan]位置不对应"); return(false);
        }
        if (vecLine[9] != "XuLiSkill")
        {
            Ex.Logger.Log("Skill.csv中字段[XuLiSkill]位置不对应"); return(false);
        }
        if (vecLine[10] != "YinChangTime")
        {
            Ex.Logger.Log("Skill.csv中字段[YinChangTime]位置不对应"); return(false);
        }
        if (vecLine[11] != "YinChangSkill")
        {
            Ex.Logger.Log("Skill.csv中字段[YinChangSkill]位置不对应"); return(false);
        }
        if (vecLine[12] != "YinDaoTime")
        {
            Ex.Logger.Log("Skill.csv中字段[YinDaoTime]位置不对应"); return(false);
        }
        if (vecLine[13] != "YinDaoSkill")
        {
            Ex.Logger.Log("Skill.csv中字段[YinDaoSkill]位置不对应"); return(false);
        }
        if (vecLine[14] != "HitType")
        {
            Ex.Logger.Log("Skill.csv中字段[HitType]位置不对应"); return(false);
        }
        if (vecLine[15] != "SkillMana")
        {
            Ex.Logger.Log("Skill.csv中字段[SkillMana]位置不对应"); return(false);
        }
        if (vecLine[16] != "CD")
        {
            Ex.Logger.Log("Skill.csv中字段[CD]位置不对应"); return(false);
        }
        if (vecLine[17] != "AttackRange")
        {
            Ex.Logger.Log("Skill.csv中字段[AttackRange]位置不对应"); return(false);
        }
        if (vecLine[18] != "HitRange")
        {
            Ex.Logger.Log("Skill.csv中字段[HitRange]位置不对应"); return(false);
        }
        if (vecLine[19] != "Tips")
        {
            Ex.Logger.Log("Skill.csv中字段[Tips]位置不对应"); return(false);
        }
        if (vecLine[20] != "Set")
        {
            Ex.Logger.Log("Skill.csv中字段[Set]位置不对应"); return(false);
        }
        if (vecLine[21] != "LVMAX")
        {
            Ex.Logger.Log("Skill.csv中字段[LVMAX]位置不对应"); return(false);
        }
        if (vecLine[22] != "LvUp")
        {
            Ex.Logger.Log("Skill.csv中字段[LvUp]位置不对应"); return(false);
        }
        if (vecLine[23] != "LvUpMoney")
        {
            Ex.Logger.Log("Skill.csv中字段[LvUpMoney]位置不对应"); return(false);
        }
        if (vecLine[24] != "Attributes")
        {
            Ex.Logger.Log("Skill.csv中字段[Attributes]位置不对应"); return(false);
        }
        if (vecLine[25] != "Limit")
        {
            Ex.Logger.Log("Skill.csv中字段[Limit]位置不对应"); return(false);
        }
        if (vecLine[26] != "UnderAttack")
        {
            Ex.Logger.Log("Skill.csv中字段[UnderAttack]位置不对应"); return(false);
        }
        if (vecLine[27] != "AblityID")
        {
            Ex.Logger.Log("Skill.csv中字段[AblityID]位置不对应"); return(false);
        }
        if (vecLine[28] != "FriendNum")
        {
            Ex.Logger.Log("Skill.csv中字段[FriendNum]位置不对应"); return(false);
        }
        if (vecLine[29] != "FriendBuffID")
        {
            Ex.Logger.Log("Skill.csv中字段[FriendBuffID]位置不对应"); return(false);
        }
        if (vecLine[30] != "BuffID")
        {
            Ex.Logger.Log("Skill.csv中字段[BuffID]位置不对应"); return(false);
        }
        if (vecLine[31] != "BuffRate")
        {
            Ex.Logger.Log("Skill.csv中字段[BuffRate]位置不对应"); return(false);
        }
        if (vecLine[32] != "AttBuffEle")
        {
            Ex.Logger.Log("Skill.csv中字段[AttBuffEle]位置不对应"); return(false);
        }
        if (vecLine[33] != "DefBuffEle")
        {
            Ex.Logger.Log("Skill.csv中字段[DefBuffEle]位置不对应"); return(false);
        }
        if (vecLine[34] != "TrapID")
        {
            Ex.Logger.Log("Skill.csv中字段[TrapID]位置不对应"); return(false);
        }
        if (vecLine[35] != "HatredCoefficient")
        {
            Ex.Logger.Log("Skill.csv中字段[HatredCoefficient]位置不对应"); return(false);
        }
        if (vecLine[36] != "SkillHatred")
        {
            Ex.Logger.Log("Skill.csv中字段[SkillHatred]位置不对应"); return(false);
        }
        if (vecLine[37] != "DamageRuduce")
        {
            Ex.Logger.Log("Skill.csv中字段[DamageRuduce]位置不对应"); return(false);
        }
        if (vecLine[38] != "DamageNum")
        {
            Ex.Logger.Log("Skill.csv中字段[DamageNum]位置不对应"); return(false);
        }
        if (vecLine[39] != "AttSpcialEle")
        {
            Ex.Logger.Log("Skill.csv中字段[AttSpcialEle]位置不对应"); return(false);
        }
        if (vecLine[40] != "DefSpcialEle")
        {
            Ex.Logger.Log("Skill.csv中字段[DefSpcialEle]位置不对应"); return(false);
        }
        if (vecLine[41] != "SpcialDamageNum")
        {
            Ex.Logger.Log("Skill.csv中字段[SpcialDamageNum]位置不对应"); return(false);
        }
        if (vecLine[42] != "SkillDistance")
        {
            Ex.Logger.Log("Skill.csv中字段[SkillDistance]位置不对应"); return(false);
        }
        if (vecLine[43] != "TargetOpt")
        {
            Ex.Logger.Log("Skill.csv中字段[TargetOpt]位置不对应"); return(false);
        }
        if (vecLine[44] != "TargetNum")
        {
            Ex.Logger.Log("Skill.csv中字段[TargetNum]位置不对应"); return(false);
        }
        if (vecLine[45] != "ParameterType")
        {
            Ex.Logger.Log("Skill.csv中字段[ParameterType]位置不对应"); return(false);
        }
        if (vecLine[46] != "ParameterNum")
        {
            Ex.Logger.Log("Skill.csv中字段[ParameterNum]位置不对应"); return(false);
        }
        if (vecLine[47] != "TargetGroup")
        {
            Ex.Logger.Log("Skill.csv中字段[TargetGroup]位置不对应"); return(false);
        }
        if (vecLine[48] != "DamageAmend")
        {
            Ex.Logger.Log("Skill.csv中字段[DamageAmend]位置不对应"); return(false);
        }
        if (vecLine[49] != "IsFanXiang")
        {
            Ex.Logger.Log("Skill.csv中字段[IsFanXiang]位置不对应"); return(false);
        }
        if (vecLine[50] != "IsYiDong")
        {
            Ex.Logger.Log("Skill.csv中字段[IsYiDong]位置不对应"); return(false);
        }
        if (vecLine[51] != "HandleType")
        {
            Ex.Logger.Log("Skill.csv中字段[HandleType]位置不对应"); return(false);
        }
        if (vecLine[52] != "Special")
        {
            Ex.Logger.Log("Skill.csv中字段[Special]位置不对应"); return(false);
        }
        if (vecLine[53] != "TargetArea")
        {
            Ex.Logger.Log("Skill.csv中字段[TargetArea]位置不对应"); return(false);
        }
        if (vecLine[54] != "DaoDi")
        {
            Ex.Logger.Log("Skill.csv中字段[DaoDi]位置不对应"); return(false);
        }
        if (vecLine[55] != "HitBack")
        {
            Ex.Logger.Log("Skill.csv中字段[HitBack]位置不对应"); return(false);
        }
        if (vecLine[56] != "ZiDong")
        {
            Ex.Logger.Log("Skill.csv中字段[ZiDong]位置不对应"); return(false);
        }

        for (int i = 0; i < nRow; i++)
        {
            SkillElement member = new SkillElement();
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.SkillID);
            readPos += GameAssist.ReadString(binContent, readPos, out member.Name);
            readPos += GameAssist.ReadString(binContent, readPos, out member.SourceIcon);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Hero);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Type);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.SkillType);
            readPos += GameAssist.ReadString(binContent, readPos, out member.FenDuan);
            readPos += GameAssist.ReadString(binContent, readPos, out member.XuLiStart);
            readPos += GameAssist.ReadString(binContent, readPos, out member.XuLiXunHuan);
            readPos += GameAssist.ReadString(binContent, readPos, out member.XuLiSkill);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.YinChangTime);
            readPos += GameAssist.ReadString(binContent, readPos, out member.YinChangSkill);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.YinDaoTime);
            readPos += GameAssist.ReadString(binContent, readPos, out member.YinDaoSkill);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.HitType);
            readPos += GameAssist.ReadString(binContent, readPos, out member.SkillMana);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.CD);
            readPos += GameAssist.ReadFloat(binContent, readPos, out member.AttackRange);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.HitRange);
            readPos += GameAssist.ReadString(binContent, readPos, out member.Tips);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Set);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.LVMAX);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.LvUp);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.LvUpMoney);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Attributes);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Limit);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.UnderAttack);
            readPos += GameAssist.ReadString(binContent, readPos, out member.AblityID);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.FriendNum);
            readPos += GameAssist.ReadString(binContent, readPos, out member.FriendBuffID);
            readPos += GameAssist.ReadString(binContent, readPos, out member.BuffID);
            readPos += GameAssist.ReadString(binContent, readPos, out member.BuffRate);
            readPos += GameAssist.ReadString(binContent, readPos, out member.AttBuffEle);
            readPos += GameAssist.ReadString(binContent, readPos, out member.DefBuffEle);
            readPos += GameAssist.ReadString(binContent, readPos, out member.TrapID);
            readPos += GameAssist.ReadFloat(binContent, readPos, out member.HatredCoefficient);
            readPos += GameAssist.ReadFloat(binContent, readPos, out member.SkillHatred);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.DamageRuduce);
            readPos += GameAssist.ReadString(binContent, readPos, out member.DamageNum);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.AttSpcialEle);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.DefSpcialEle);
            readPos += GameAssist.ReadString(binContent, readPos, out member.SpcialDamageNum);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.SkillDistance);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.TargetOpt);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.TargetNum);
            readPos += GameAssist.ReadString(binContent, readPos, out member.ParameterType);
            readPos += GameAssist.ReadString(binContent, readPos, out member.ParameterNum);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.TargetGroup);
            readPos += GameAssist.ReadString(binContent, readPos, out member.DamageAmend);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.IsFanXiang);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.IsYiDong);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.HandleType);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Special);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.TargetArea);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.DaoDi);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.HitBack);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.ZiDong);

            member.IsValidate = true;
            m_vecAllElements.Add(member);
            m_mapElements[member.SkillID] = member;
        }
        return(true);
    }
Example #9
0
        /*
         *      [XmlAttribute]
         *      [DefaultValue("0")]
         *      public string preeffects_mask;
         *
         *      [XmlIgnore]
         *      public bool preeffects_mask_probSpecified;
         *
         *      [XmlAttribute]
         *      [DefaultValue(1)]
         *      public decimal critical_prob;
         *
         *      [XmlAttribute]
         *      [DefaultValue(TargetState.NONE)]
         *      public TargetState cond_effect;
         */

        //[XmlElement]
        //[DefaultValue(null)]
        //public Conditions conditions;

        #region IDynamicImport<ClientEffect> Members

        public virtual void Import(ClientEffect importObject, IEnumerable <FieldInfo> getters)
        {
            effectid = importObject.effectid;
            e        = importObject.e;
            basiclvl = importObject.basiclv;
            hoptype  = importObject.hop_type;
            hopa     = importObject.hop_a;
            hopb     = importObject.hop_b;
            if (importObject.remain[1].HasValue && importObject.remain[1].Value != 0)
            {
                duration = importObject.remain[1].Value;
            }
            if (importObject.remain[0].HasValue)
            {
                duration += importObject.remain[0].Value;
            }
            randomtime = importObject.randomtime;
            noresist   = importObject.noresist;

            if (importObject.accuracy_modifiers != null && importObject.accuracy_modifiers[0] != null)
            {
                acc_mod1 = importObject.accuracy_modifiers[0].Value;
            }

            /*
             *          if (importObject.accuracy_modifiers != null && importObject.accuracy_modifiers[1] != null)
             *                  acc_mod2 = importObject.accuracy_modifiers[1].Value;
             */
            if (this is OverTimeEffect || this is SpellAtkDrainEffect || this is DiseaseEffect)
            {
                checktime = importObject.checktime;
            }

            if (importObject.reserved[9] != null)
            {
                try {
                    element = (SkillElement)(Enum.Parse(typeof(SkillElement), importObject.reserved[9].Trim(), true));
                    if (!Enum.IsDefined(typeof(SkillElement), element))
                    {
                        element = SkillElement.NONE;
                    }
                }
                catch {
                    Debug.Print("R9: {0}", importObject.reserved[9]);
                }
            }

            /*
             *          if (importObject.cond_preeffect != null) {
             *                  this.preeffects_mask = importObject.cond_preeffect.Substring(1, importObject.cond_preeffect.Length -1);
             *          }
             *
             *           Moved to Conditions List Below
             *          if (importObject.critical_prob_modifiers[1] != null) {
             *                  this.critical_prob = importObject.critical_prob_modifiers[1].Value;
             *          }
             *          else {
             *                  this.critical_prob = 1;
             *          }
             *
             *          if (!String.IsNullOrEmpty(importObject.cond_status)) {
             *                  NamedEnum<TargetState> v = new NamedEnum<TargetState>(importObject.cond_status);
             *                  TargetState state = v;
             *                  this.cond_effect = state;
             *          }
             */

            //if (!String.IsNullOrEmpty(importObject.cond_status)) {
            //    NamedEnum<TargetState> v = new NamedEnum<TargetState>(importObject.cond_status);
            //    TargetState state = v;

            //    if (this.conditions == null)
            //        this.conditions = new Conditions();
            //    if (this.conditions.ConditionList == null)
            //        this.conditions.ConditionList = new List<Condition>();
            //    /*
            //    switch (state) {
            //        case TargetState.NON_FLYING: this.conditions.ConditionList.Add(new NoFlyCondition()); break;
            //        case TargetState.FLYING: this.conditions.ConditionList.Add(new TargetFlyingCondition()); break;
            //        default: this.conditions.ConditionList.Add(new AbnormalCondition(state)); break;
            //    }
            //     */
            //}
        }
Example #10
0
 public BattleSkill(string _skillName, SkillEffect[] _skillEffects, SkillElement _skillElement)
 {
     skillName = _skillName;
 }
Example #11
0
    public bool LoadCsv(string strContent)
    {
        if (strContent.Length == 0)
        {
            return(false);
        }
        m_mapElements.Clear();
        m_vecAllElements.Clear();
        int           contentOffset = 0;
        List <string> vecLine;

        vecLine = GameAssist.readCsvLine(strContent, ref contentOffset);
        if (vecLine.Count != 27)
        {
            Debug.Log("Skill.csv中列数量与生成的代码不匹配!");
            return(false);
        }
        if (vecLine[0] != "SkillID")
        {
            Debug.Log("Skill.csv中字段[SkillID]位置不对应"); return(false);
        }
        if (vecLine[1] != "Name")
        {
            Debug.Log("Skill.csv中字段[Name]位置不对应"); return(false);
        }
        if (vecLine[2] != "SourceIcon")
        {
            Debug.Log("Skill.csv中字段[SourceIcon]位置不对应"); return(false);
        }
        if (vecLine[3] != "Hero")
        {
            Debug.Log("Skill.csv中字段[Hero]位置不对应"); return(false);
        }
        if (vecLine[4] != "Type")
        {
            Debug.Log("Skill.csv中字段[Type]位置不对应"); return(false);
        }
        if (vecLine[5] != "SkillMana")
        {
            Debug.Log("Skill.csv中字段[SkillMana]位置不对应"); return(false);
        }
        if (vecLine[6] != "CD")
        {
            Debug.Log("Skill.csv中字段[CD]位置不对应"); return(false);
        }
        if (vecLine[7] != "Tips")
        {
            Debug.Log("Skill.csv中字段[Tips]位置不对应"); return(false);
        }
        if (vecLine[8] != "Lv")
        {
            Debug.Log("Skill.csv中字段[Lv]位置不对应"); return(false);
        }
        if (vecLine[9] != "LvUp")
        {
            Debug.Log("Skill.csv中字段[LvUp]位置不对应"); return(false);
        }
        if (vecLine[10] != "Attributes")
        {
            Debug.Log("Skill.csv中字段[Attributes]位置不对应"); return(false);
        }
        if (vecLine[11] != "JieSuo")
        {
            Debug.Log("Skill.csv中字段[JieSuo]位置不对应"); return(false);
        }
        if (vecLine[12] != "UnderAttack")
        {
            Debug.Log("Skill.csv中字段[UnderAttack]位置不对应"); return(false);
        }
        if (vecLine[13] != "AblityID")
        {
            Debug.Log("Skill.csv中字段[AblityID]位置不对应"); return(false);
        }
        if (vecLine[14] != "FriendNum")
        {
            Debug.Log("Skill.csv中字段[FriendNum]位置不对应"); return(false);
        }
        if (vecLine[15] != "FriendBuffID")
        {
            Debug.Log("Skill.csv中字段[FriendBuffID]位置不对应"); return(false);
        }
        if (vecLine[16] != "BuffID")
        {
            Debug.Log("Skill.csv中字段[BuffID]位置不对应"); return(false);
        }
        if (vecLine[17] != "TrapID")
        {
            Debug.Log("Skill.csv中字段[TrapID]位置不对应"); return(false);
        }
        if (vecLine[18] != "DamageRuduce")
        {
            Debug.Log("Skill.csv中字段[DamageRuduce]位置不对应"); return(false);
        }
        if (vecLine[19] != "DamageNum")
        {
            Debug.Log("Skill.csv中字段[DamageNum]位置不对应"); return(false);
        }
        if (vecLine[20] != "SkillDistance")
        {
            Debug.Log("Skill.csv中字段[SkillDistance]位置不对应"); return(false);
        }
        if (vecLine[21] != "TargetOpt")
        {
            Debug.Log("Skill.csv中字段[TargetOpt]位置不对应"); return(false);
        }
        if (vecLine[22] != "TargetNum")
        {
            Debug.Log("Skill.csv中字段[TargetNum]位置不对应"); return(false);
        }
        if (vecLine[23] != "ParameterType")
        {
            Debug.Log("Skill.csv中字段[ParameterType]位置不对应"); return(false);
        }
        if (vecLine[24] != "ParameterNum")
        {
            Debug.Log("Skill.csv中字段[ParameterNum]位置不对应"); return(false);
        }
        if (vecLine[25] != "TargetGroup")
        {
            Debug.Log("Skill.csv中字段[TargetGroup]位置不对应"); return(false);
        }
        if (vecLine[26] != "DamageAmend")
        {
            Debug.Log("Skill.csv中字段[DamageAmend]位置不对应"); return(false);
        }

        while (true)
        {
            vecLine = GameAssist.readCsvLine(strContent, ref contentOffset);
            if ((int)vecLine.Count == 0)
            {
                break;
            }
            if ((int)vecLine.Count != (int)27)
            {
                return(false);
            }
            SkillElement member = new SkillElement();
            member.SkillID       = Convert.ToInt32(vecLine[0]);
            member.Name          = vecLine[1];
            member.SourceIcon    = vecLine[2];
            member.Hero          = Convert.ToInt32(vecLine[3]);
            member.Type          = Convert.ToInt32(vecLine[4]);
            member.SkillMana     = vecLine[5];
            member.CD            = Convert.ToInt32(vecLine[6]);
            member.Tips          = vecLine[7];
            member.Lv            = Convert.ToInt32(vecLine[8]);
            member.LvUp          = Convert.ToInt32(vecLine[9]);
            member.Attributes    = Convert.ToInt32(vecLine[10]);
            member.JieSuo        = vecLine[11];
            member.UnderAttack   = Convert.ToInt32(vecLine[12]);
            member.AblityID      = vecLine[13];
            member.FriendNum     = Convert.ToInt32(vecLine[14]);
            member.FriendBuffID  = Convert.ToInt32(vecLine[15]);
            member.BuffID        = Convert.ToInt32(vecLine[16]);
            member.TrapID        = Convert.ToInt32(vecLine[17]);
            member.DamageRuduce  = Convert.ToInt32(vecLine[18]);
            member.DamageNum     = vecLine[19];
            member.SkillDistance = Convert.ToInt32(vecLine[20]);
            member.TargetOpt     = Convert.ToInt32(vecLine[21]);
            member.TargetNum     = Convert.ToInt32(vecLine[22]);
            member.ParameterType = Convert.ToInt32(vecLine[23]);
            member.ParameterNum  = vecLine[24];
            member.TargetGroup   = Convert.ToInt32(vecLine[25]);
            member.DamageAmend   = vecLine[26];

            member.IsValidate = true;
            m_vecAllElements.Add(member);
            m_mapElements[member.SkillID] = member;
        }
        return(true);
    }
Example #12
0
    public bool LoadBin(byte[] binContent)
    {
        m_mapElements.Clear();
        m_vecAllElements.Clear();
        int nCol, nRow;
        int readPos = 0;

        readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nCol);
        readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nRow);
        List <string> vecLine     = new List <string>(nCol);
        List <int>    vecHeadType = new List <int>(nCol);
        string        tmpStr;
        int           tmpInt;

        for (int i = 0; i < nCol; i++)
        {
            readPos += GameAssist.ReadString(binContent, readPos, out tmpStr);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out tmpInt);
            vecLine.Add(tmpStr);
            vecHeadType.Add(tmpInt);
        }
        if (vecLine.Count != 27)
        {
            Debug.Log("Skill.csv中列数量与生成的代码不匹配!");
            return(false);
        }
        if (vecLine[0] != "SkillID")
        {
            Debug.Log("Skill.csv中字段[SkillID]位置不对应"); return(false);
        }
        if (vecLine[1] != "Name")
        {
            Debug.Log("Skill.csv中字段[Name]位置不对应"); return(false);
        }
        if (vecLine[2] != "SourceIcon")
        {
            Debug.Log("Skill.csv中字段[SourceIcon]位置不对应"); return(false);
        }
        if (vecLine[3] != "Hero")
        {
            Debug.Log("Skill.csv中字段[Hero]位置不对应"); return(false);
        }
        if (vecLine[4] != "Type")
        {
            Debug.Log("Skill.csv中字段[Type]位置不对应"); return(false);
        }
        if (vecLine[5] != "SkillMana")
        {
            Debug.Log("Skill.csv中字段[SkillMana]位置不对应"); return(false);
        }
        if (vecLine[6] != "CD")
        {
            Debug.Log("Skill.csv中字段[CD]位置不对应"); return(false);
        }
        if (vecLine[7] != "Tips")
        {
            Debug.Log("Skill.csv中字段[Tips]位置不对应"); return(false);
        }
        if (vecLine[8] != "Lv")
        {
            Debug.Log("Skill.csv中字段[Lv]位置不对应"); return(false);
        }
        if (vecLine[9] != "LvUp")
        {
            Debug.Log("Skill.csv中字段[LvUp]位置不对应"); return(false);
        }
        if (vecLine[10] != "Attributes")
        {
            Debug.Log("Skill.csv中字段[Attributes]位置不对应"); return(false);
        }
        if (vecLine[11] != "JieSuo")
        {
            Debug.Log("Skill.csv中字段[JieSuo]位置不对应"); return(false);
        }
        if (vecLine[12] != "UnderAttack")
        {
            Debug.Log("Skill.csv中字段[UnderAttack]位置不对应"); return(false);
        }
        if (vecLine[13] != "AblityID")
        {
            Debug.Log("Skill.csv中字段[AblityID]位置不对应"); return(false);
        }
        if (vecLine[14] != "FriendNum")
        {
            Debug.Log("Skill.csv中字段[FriendNum]位置不对应"); return(false);
        }
        if (vecLine[15] != "FriendBuffID")
        {
            Debug.Log("Skill.csv中字段[FriendBuffID]位置不对应"); return(false);
        }
        if (vecLine[16] != "BuffID")
        {
            Debug.Log("Skill.csv中字段[BuffID]位置不对应"); return(false);
        }
        if (vecLine[17] != "TrapID")
        {
            Debug.Log("Skill.csv中字段[TrapID]位置不对应"); return(false);
        }
        if (vecLine[18] != "DamageRuduce")
        {
            Debug.Log("Skill.csv中字段[DamageRuduce]位置不对应"); return(false);
        }
        if (vecLine[19] != "DamageNum")
        {
            Debug.Log("Skill.csv中字段[DamageNum]位置不对应"); return(false);
        }
        if (vecLine[20] != "SkillDistance")
        {
            Debug.Log("Skill.csv中字段[SkillDistance]位置不对应"); return(false);
        }
        if (vecLine[21] != "TargetOpt")
        {
            Debug.Log("Skill.csv中字段[TargetOpt]位置不对应"); return(false);
        }
        if (vecLine[22] != "TargetNum")
        {
            Debug.Log("Skill.csv中字段[TargetNum]位置不对应"); return(false);
        }
        if (vecLine[23] != "ParameterType")
        {
            Debug.Log("Skill.csv中字段[ParameterType]位置不对应"); return(false);
        }
        if (vecLine[24] != "ParameterNum")
        {
            Debug.Log("Skill.csv中字段[ParameterNum]位置不对应"); return(false);
        }
        if (vecLine[25] != "TargetGroup")
        {
            Debug.Log("Skill.csv中字段[TargetGroup]位置不对应"); return(false);
        }
        if (vecLine[26] != "DamageAmend")
        {
            Debug.Log("Skill.csv中字段[DamageAmend]位置不对应"); return(false);
        }

        for (int i = 0; i < nRow; i++)
        {
            SkillElement member = new SkillElement();
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.SkillID);
            readPos += GameAssist.ReadString(binContent, readPos, out member.Name);
            readPos += GameAssist.ReadString(binContent, readPos, out member.SourceIcon);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Hero);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Type);
            readPos += GameAssist.ReadString(binContent, readPos, out member.SkillMana);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.CD);
            readPos += GameAssist.ReadString(binContent, readPos, out member.Tips);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Lv);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.LvUp);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Attributes);
            readPos += GameAssist.ReadString(binContent, readPos, out member.JieSuo);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.UnderAttack);
            readPos += GameAssist.ReadString(binContent, readPos, out member.AblityID);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.FriendNum);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.FriendBuffID);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.BuffID);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.TrapID);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.DamageRuduce);
            readPos += GameAssist.ReadString(binContent, readPos, out member.DamageNum);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.SkillDistance);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.TargetOpt);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.TargetNum);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.ParameterType);
            readPos += GameAssist.ReadString(binContent, readPos, out member.ParameterNum);
            readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.TargetGroup);
            readPos += GameAssist.ReadString(binContent, readPos, out member.DamageAmend);

            member.IsValidate = true;
            m_vecAllElements.Add(member);
            m_mapElements[member.SkillID] = member;
        }
        return(true);
    }
Example #13
0
        public virtual void Import(ClientEffect importObject, IEnumerable <FieldInfo> getters)
        {
            effectid = importObject.effectid;
            e        = importObject.e;
            basiclvl = importObject.basiclv;
            hoptype  = importObject.hop_type;
            hopa     = importObject.hop_a;
            hopb     = importObject.hop_b;
            if (importObject.remain[1].HasValue && importObject.remain[1].Value != 0)
            {
                duration = importObject.remain[1].Value;
            }
            if (importObject.remain[0].HasValue)
            {
                duration += importObject.remain[0].Value;
            }
            randomtime = importObject.randomtime;
            noresist   = importObject.noresist;

            if (importObject.accuracy_modifiers != null && importObject.accuracy_modifiers[1] != null)
            {
                acc_mod = importObject.accuracy_modifiers[1].Value;
            }

            if (this is OverTimeEffect || this is SpellAtkDrainEffect || this is DiseaseEffect)
            {
                checktime = importObject.checktime;
            }
            if (importObject.reserved[8] != null)
            {
                onfly = importObject.reserved[8].Trim() == "1";
            }
            if (importObject.reserved[9] != null)
            {
                try {
                    element = (SkillElement)(Enum.Parse(typeof(SkillElement), importObject.reserved[9].Trim(), true));
                    if (!Enum.IsDefined(typeof(SkillElement), element))
                    {
                        element = SkillElement.NONE;
                    }
                } catch {
                    Debug.Print("R9: {0}", importObject.reserved[9]);
                }
            }

            if (importObject.cond_preeffect != PreeffectNumber.NONE)
            {
                this.preeffects_mask = (int)importObject.cond_preeffect;
                if (importObject.cond_preeffect_prob[1] != null)
                {
                    this.preeffect_prob = importObject.cond_preeffect_prob[1].Value / 100m;
                }
                else
                {
                    this.preeffect_prob = 1;
                }
            }

            if (this.preeffect_prob != 1 && e > 1)
            {
                this.preeffect_probSpecified = true;
            }

            if (importObject.critical_prob_modifiers[1] != null)
            {
                this.critical_prob = importObject.critical_prob_modifiers[1].Value / 100m;
            }
            else
            {
                this.critical_prob = 1;
            }

            if (!String.IsNullOrEmpty(importObject.cond_status))
            {
                NamedEnum <TargetState> v     = new NamedEnum <TargetState>(importObject.cond_status);
                TargetState             state = v;
                this.cond_effect = state;
            }
        }