Beispiel #1
0
    /// <summary>
    /// 获取技能
    /// </summary>
    public static bool  GetSkillInfo(int type, int level, ref SoldierSkill Info)
    {
        s_skillupInfo    up = GetSkillUp(type, level);
        s_skill_typeInfo v  = GetSkillType(type);

        if (v == null || up == null)
        {
            return(false);
        }
        SetSoldierSkill(up, v, ref Info);
        return(true);
    }
Beispiel #2
0
    /// <summary>
    /// 获取技能等级相关数据
    /// </summary>
    private static s_skillupInfo GetSkillUp(int Skillid)
    {
        int nCount = m_LSkillUp.Count;

        for (int nCnt = 0; nCnt < nCount; nCnt++)
        {
            s_skillupInfo v = m_LSkillUp[nCnt];
            if (v.id == Skillid)
            {
                return(v);
            }
        }
        return(null);
    }
Beispiel #3
0
    /// <summary>
    /// 获取技能
    /// </summary>
    private static s_skillupInfo GetSkillUp(int skilltype, int level)
    {
        int nCount = m_LSkillUp.Count;

        for (int nCnt = 0; nCnt < nCount; nCnt++)
        {
            s_skillupInfo v = m_LSkillUp[nCnt];
            if (v.type == skilltype && v.level == level)
            {
                return(v);
            }
        }
        return(null);
    }
Beispiel #4
0
    /// <summary>
    /// 获取技能
    /// </summary>
    public static bool GetSkillInfo(int id, ref SoldierSkill Info)
    {
        s_skillupInfo up = GetSkillUp(id);

        if (up == null)
        {
            return(false);
        }
        s_skill_typeInfo v = GetSkillType(up.type);

        if (v == null)
        {
            return(false);
        }
        SetSoldierSkill(up, v, ref Info);
        return(true);
    }
Beispiel #5
0
    /// <summary>
    /// 设置技能
    /// </summary>
    private static void SetSoldierSkill(s_skillupInfo up, s_skill_typeInfo v, ref SoldierSkill Info)
    {
        if (v == null || Info == null || up == null)
        {
            return;
        }
        Info.m_id    = up.id;
        Info.m_level = up.level;
        //Info.m_soldierid = v.soldierid;
        Info.m_power1 = up.power1;
        Info.m_power2 = up.power2;
        //Info.m_percent = up.percent;
        SetSkillStatus(ref Info.m_own_status, up.own_status);
        SetSkillStatus(ref Info.m_attack_status_own, up.attack_status_own);
        SetSkillStatus(ref Info.m_attack_status_enemy, up.attack_status_enemy);
        SetSkillStatus(ref Info.m_buildstatus, up.buildstatus);
        //Info.m_attr_type = v.at;
        Info.m_data0 = up.data0;
        Info.m_data1 = up.data1;
        Info.m_data2 = up.data2;
        Info.m_data3 = up.data3;
        //Info.m_ldistance = v.ldistance;
        Info.m_rankslevel = up.ranklevel;
        //Info.m_trapbreach = v.trapbreach;
        Info.m_description2 = up.description;
        Info.m_power3       = up.power3;
        Info.m_power4       = up.power4;



        Info.m_ischangetarget = v.ischangetarget;
        Info.m_step_secs      = v.step_secs;
        Info.m_intone_speed   = v.intone_speed;
        SetSkillStatus(ref Info.m_releasedown_status, v.releasedown_status);
        SetSkillStatus(ref Info.m_releasedenemy_status, v.releasedenemy_status);
        SetSkillStatus(ref Info.m_releasedself_status, v.releasedself_status);
        Info.m_type         = v.type;
        Info.m_name         = v.name;
        Info.m_attacktype   = v.attacktype;
        Info.m_priority     = v.priority;
        Info.m_sort         = v.sort;
        Info.m_multiple     = v.multiple;
        Info.m_actiontype   = v.actiontype;
        Info.m_use_mp       = v.use_mp;
        Info.m_target       = v.target;
        Info.m_distance     = v.distance;
        Info.m_term1        = v.term1;
        Info.m_term2        = v.term2;
        Info.m_term3        = v.term3;
        Info.m_cd           = v.cd;
        Info.m_timeinterval = v.timeinterval;
        Info.m_range        = (v.range * MapGrid.m_width / MapGrid.m_Pixel);
        Info.m_attckmodeid  = v.attackmodeid;
        s_attackmodeInfo I = GetAttackMode(Info.m_attckmodeid);

        if (I != null)
        {
            SetAttackPower(I, ref Info.m_lAttackPower);
        }

        Info.m_interrupt_skill = v.interrupt_skill;
        Info.m_condition       = v.condition;
        Info.m_condition_data0 = v.condition_data0;
        Info.m_condition_data1 = v.condition_data1;
        Info.m_ipriority       = v.ipriority;
        Info.m_struckeffect    = v.struckeffect;
        Info.m_ismove          = v.ismove;
        Info.m_blackscreentime = v.blackscreentime * 0.001f;
        s_skilleffectInfo e = GetSkillEffect(Info.m_type);

        if (e != null)
        {
            SetSkillEffect(e, ref Info.m_skilleffectinfo);
        }
        SetSkillAttributeType(ref Info.m_AttributeType, v.attribute);

        Info.m_description1     = v.description1;
        Info.m_status_hitratio  = v.status_hitratio * 0.001f;
        Info.m_targettype       = v.targettype;
        Info.m_damagetargettype = v.damagetargettype;
        Info.m_Screen           = v.screen;
        Info.m_ScreenTime       = v.screentime * 0.001f;
    }