Exemplo n.º 1
0
    /// <summary>
    /// 填充基础炮弹兵数据
    /// </summary>
    private static void FillBaseSoldierInfo(s_soldier_typeInfo I, ref SoldierInfo Info)
    {
        if (I == null || Info == null)
        {
            return;
        }

        Info.m_resist        = I.resist;
        Info.m_attack_like   = I.attack_like;
        Info.m_attack_type   = I.attacktype;
        Info.m_speed         = 1.0f * I.speed / MapGrid.m_Pixel;
        Info.m_Flyspeed      = 1.0f * I.flyspeed / MapGrid.m_Pixel;
        Info.m_attack_time   = I.attack_time * 0.01f;
        Info.m_jump_distance = I.jump_distance / MapGrid.m_Pixel;

        Info.m_hpstart         = I.hp;
        Info.m_phy_attackstart = I.phy_attack;
        Info.m_phy_defendstart = I.phy_defend;
        Info.m_phy_critstart   = I.phy_crit;

        Info.m_magic_attackstart = I.magic_attack;
        Info.m_magic_defendstart = I.magic_defend;
        Info.m_magic_critstart   = I.magic_crit;
        Info.m_strengthstart     = I.strength;
        Info.m_agilitystart      = I.agility;
        Info.m_intelligencestart = I.intelligence;

        Info.m_dodge         = I.dodge;
        Info.m_soldier_group = I.group;
        Info.m_soldier_type  = I.type;
        Info.m_main_proerty  = I.main_proerty;
        Info.m_loaction      = I.location;
        Info.m_modeltype     = I.modeltype;
        Info.m_name          = I.name;
        Info.m_mp            = I.mp;
        Info.m_passageway    = I.passageway;
        Info.m_concussion    = I.concussion;
        Info.m_desc          = I.description;
        Info.m_shape         = I.shape;
        Info.m_goorder       = I.goorder;
        Info.fragmentTypeID  = I.fragment;
        //附加属性
        Info.m_AddAttr.SetAddAttrInfo(I);


        Info.m_hp         = I.hp;
        Info.m_phy_attack = I.phy_attack;
        Info.m_phy_defend = I.phy_defend;
        Info.m_phy_crit   = I.phy_crit;

        Info.m_magic_attack = I.magic_attack;
        Info.m_magic_defend = I.magic_defend;
        Info.m_magic_crit   = I.magic_crit;
        Info.m_strength     = I.strength;
        Info.m_agility      = I.agility;
        Info.m_intelligence = I.intelligence;
        Info.m_strDieSound  = I.dead_sound;
        Info.m_strDropDesc  = I.dropdes;
    }
Exemplo n.º 2
0
    /// <summary>
    /// 填充基础建筑信息
    /// </summary>
    private static void CalcSoldierInfo(s_soldier_typeInfo I, ref SoldierInfo Info)
    {
        if (I == null || Info == null)
        {
            return;
        }
        //获取三围
        //初始值
        s_soldierstar_typeInfo StarInfo = GetSoldierStarData(Info.SoldierTypeID, Info.StarLevel);

        if (StarInfo != null)
        {
            Info.m_strength_grow     = StarInfo.strength_growth;
            Info.m_agility_grow      = StarInfo.agility_growth;
            Info.m_intelligence_grow = StarInfo.intelligence_growth;
            Info.m_concussion       += StarInfo.concussion;
        }


        //当前-初始.
        int oriStrength = 0;
        int oriAgility  = 0;
        int oriIntell   = 0;

        int oriStar = GetSoldierOriginalStar(Info.SoldierTypeID);
        s_soldierstar_typeInfo OriInfo = GetSoldierStarData(Info.SoldierTypeID, oriStar);

        if (OriInfo != null && StarInfo != null)
        {
            oriStrength = OriInfo.strength_growth;
            oriAgility  = OriInfo.agility_growth;
            oriIntell   = OriInfo.intelligence_growth;
        }
        //被动技能附加属性
        Info.m_Skill.SetAddrData(ref Info.m_AddAttr);

        Info.m_strength     = ScriptM.Formula <int>("CALC_STRENGTH", Info.m_strength_grow, oriStrength, Info.Level, I.strength);
        Info.m_agility      = ScriptM.Formula <int>("CALC_AGILITY", Info.m_agility_grow, oriAgility, Info.Level, I.agility);
        Info.m_intelligence = ScriptM.Formula <int>("CALC_INTELLIGENCE", Info.m_intelligence_grow, oriIntell, Info.Level, I.intelligence);
        //增加进阶属性,目前只有冲击力
        s_soldierqualityInfo qualityinfo = GetqualityInfoData(Info.SoldierTypeID, Info.Quality);

        if (qualityinfo != null)
        {
            Info.m_concussion += qualityinfo.concussion;
        }
        //爆击及闪避
        s_soldier_experienceInfo ExpInfo = SoldierM.GetSoldierExpData(Info.Level);

        if (ExpInfo != null)
        {
            Info.m_critratio  = ExpInfo.critratio;
            Info.m_dodgeratio = ExpInfo.dodgeratio;
        }
        //阶数,添加装备附加属性
        AddEquipAttr(ref Info);
        CalcSoldierAttr(ref Info);
    }
Exemplo n.º 3
0
 /// <summary>
 /// 获取炮弹兵数据
 /// </summary>
 /// <param name="I">炮弹兵类型静态数据</param>
 /// <param name="Info">炮弹兵数据</param>
 private static void SetSoldierSkill(s_soldier_typeInfo I, ref SoldierInfo Info)
 {
     if (I == null || Info == null || Info.m_Skill == null)
     {
         return;
     }
     Info.m_Skill.SetSkillType(I);
     Info.m_Skill.InitSkill();
     SkillM.SetSkillOrder(ref Info.m_Skill, I.id);
 }
Exemplo n.º 4
0
 /// <summary>
 /// 设置附加属性
 /// </summary>
 public void SetAddAttrInfo(s_soldier_typeInfo Info)
 {
     if (Info == null)
     {
         Debug.LogError("SetAddAttrInfo is null");
         return;
     }
     AddAttr(AddAttrType.Main, Info.add_attr1, Info.value1);
     AddAttr(AddAttrType.Main, Info.add_attr2, Info.value2);
     AddAttr(AddAttrType.Main, Info.add_attr3, Info.value3);
     AddAttr(AddAttrType.Main, Info.add_attr4, Info.value4);
     AddAttr(AddAttrType.Main, Info.add_attr5, Info.value5);
 }
Exemplo n.º 5
0
 /// <summary>
 /// 用于战斗奖励的炮弹兵数据初始化
 /// </summary>
 public void SetSkillType(s_soldier_typeInfo Info)
 {
     if (Info == null)
     {
         return;
     }
     m_gskilltype  = Info.gskilltype;
     m_lskilltype  = Info.lskilltype;
     m_skill1_type = Info.skill1_type;
     m_skill2_type = Info.skill2_type;
     m_skill3_type = Info.skill3_type;
     m_skill4_type = Info.skill4_type;
     m_skill5_type = Info.skill5_type;
     m_askilltype  = Info.askilltype;
 }
Exemplo n.º 6
0
 public void SetRewardItem(int itemType, int id, int num)
 {
     if (itemType == 1)        //英雄整卡
     {
         s_soldier_typeInfo info = SoldierM.GetSoldierType(id);
         if (info == null)
         {
             NGUIUtil.DebugLog("s_soldiertype id = " + id + " 静态表数据未配置!");
             return;
         }
         else
         {
             SetHead(itemType, 0, info.modeltype);
             MyHead.SprQuality.spriteName = "1";
             MyHead.SprQuality.gameObject.SetActive(true);
         }
     }
     else if (itemType == 2)        //道具/碎片
     {
         s_itemtypeInfo info = ItemM.GetItemInfo(id);
         if (info == null)
         {
             NGUIUtil.DebugLog("s_itemtype id = " + id + " 静态表数据未配置!");
             return;
         }
         else
         {
             SetHead(info.gtype, info.icon, info.gid);
             int quality = ConfigM.GetBigQuality(info.quality);
             MyHead.SprQuality.spriteName = quality.ToString();
         }
     }
     else if (itemType == 3)        //陷阱
     {
         s_building_typeInfo buildinfo = buildingM.GetBuildType(id);
         MyHead.Roomhead.gameObject.SetActive(true);
         NGUIUtil.Set2DSprite(MyHead.Roomhead, "Textures/room/", buildinfo.modeltype.ToString());
         MyHead.SprQuality.spriteName = "1";
     }
     else if (itemType == 4)        //黑科技
     {
         string icon = "Textures/role/" + id;
         MyHead.SprQuality.gameObject.SetActive(true);
         MyHead.CaptainHead.gameObject.SetActive(true);
         NGUIUtil.Set2DSprite(MyHead.CaptainHead, icon);
         MyHead.SprQuality.spriteName = "1";
     }
 }
Exemplo n.º 7
0
    /// <summary>
    /// 更新炮弹兵数据,星级,等级,阶数的变更。
    /// </summary>
    /// <param name="Info">炮弹兵数据</param>
    public static void UpdataSoldier(ref SoldierInfo Info)
    {
        if (Info == null)
        {
            return;
        }
        s_soldier_typeInfo BaseInfo = GetSoldierType(Info.SoldierTypeID);

        if (BaseInfo == null)
        {
            NGUIUtil.DebugLog("获取不到该类型的炮弹兵数据:" + Info.SoldierTypeID);
            return;
        }
        //计算升级,升星,升阶 数据。
        CalcSoldierInfo(BaseInfo, ref Info);
    }
Exemplo n.º 8
0
    /// <summary>
    /// 新手引导可用的简化接口
    /// </summary>
    public void SetTropiesData(int soldierTypeID)
    {
        s_itemtypeInfo              itypeInfo   = new s_itemtypeInfo();
        s_soldier_typeInfo          soldierInfo = SoldierM.GetSoldierType(soldierTypeID);
        List <sdata.s_itemtypeInfo> l           = new List <s_itemtypeInfo>();

        if (soldierInfo != null)
        {
            itypeInfo.name  = soldierInfo.name;
            itypeInfo.gtype = 1;
            itypeInfo.gid   = soldierTypeID;
        }
        if (itypeInfo != null)
        {
            l.Add(itypeInfo);
            AddTropiesData(l);
        }
    }
Exemplo n.º 9
0
    /// <summary>
    /// 获取初级建筑数据
    /// </summary>
    /// <param name="Type">炮弹兵类型</param>
    /// <returns>炮弹兵数据,null 获取失败</returns>
    public static SoldierInfo GetStartSoldierInfo(int Type)
    {
        s_soldier_typeInfo BaseInfo = GetSoldierType(Type);

        if (BaseInfo == null)
        {
            NGUIUtil.DebugLog("获取不到该类型的建筑数据:" + Type);
            return(null);
        }
        SoldierInfo Info = new SoldierInfo();

        Info.ID            = 0;
        Info.SoldierTypeID = Type;
        Info.Level         = 1;
        Info.StarLevel     = BaseInfo.starlevel;
        Info.EXP           = 0;
        Info.Quality       = 10;
        Info.CX            = 0;
        Info.CY            = 0;
        //装备
        Info.Equipment0 = 0;
        Info.Equipment1 = 0;
        Info.Equipment2 = 0;
        Info.Equipment3 = 0;
        Info.Equipment4 = 0;
        Info.Equipment5 = 0;
        //技能
        List <int> lSkillLevel = new List <int>();

        lSkillLevel.Add(1);
        lSkillLevel.Add(1);
        lSkillLevel.Add(1);
        lSkillLevel.Add(1);
        lSkillLevel.Add(1);
        lSkillLevel.Add(1);
        Info.m_Skill.SetSkillLevel(lSkillLevel);

        GetSoldierInfo(ref Info);

        return(Info);
    }
Exemplo n.º 10
0
    private void SoldierSummonResponse(int nErrorCode)
    {
        if (nErrorCode == 0 && m_iWndType == 1)
        {
            GameObjectActionExcute gae      = GameObjectActionExcute.CreateExcute(gameObject);
            s_itemtypeInfo         info     = new s_itemtypeInfo();
            s_soldier_typeInfo     TypeInfo = SoldierM.GetSoldierType(m_soldierInfo.SoldierTypeID);
            if (TypeInfo != null)
            {
                info.name = TypeInfo.name;
            }
            info.gtype = 1;
            info.gid   = m_soldierInfo.SoldierTypeID;

            if (info == null)
            {
#if UNITY_EDITOR_LOG
                NGUIUtil.DebugLog("SoldierSummonResponse soldTypeId get s_itemtypeInfo is null" + soldTypeId.ToString());
#endif

                return;
            }
            List <s_itemtypeInfo> l = new List <s_itemtypeInfo>();
            l.Add(info);

            TrophiesActionWnd TropWnd = WndManager.GetDialog <TrophiesActionWnd>();
            if (TropWnd)
            {
                TropWnd.ClearTropiesData();
                TropWnd.AddTropiesData(l);
                TropWnd.SetWndType(3);
                TropWnd.MyHead.LblDes.gameObject.SetActive(false);
            }

            WndManager.DestoryDialog <SummonHeroWnd>();
        }
    }
Exemplo n.º 11
0
    /// <summary>
    /// 获取炮弹兵数据
    /// </summary>
    /// <param name="Info">炮弹兵类型</param>
    /// <returns>建筑数据,null 获取失败</returns>
    public static void GetSoldierInfo(ref SoldierInfo Info)
    {
        if (Info == null)
        {
            return;
        }
        s_soldier_typeInfo BaseInfo = GetSoldierType(Info.SoldierTypeID);

        if (BaseInfo == null)
        {
            NGUIUtil.DebugLog("获取不到该类型的炮弹兵数据:" + Info.SoldierTypeID);
            return;
        }
        FillBaseSoldierInfo(BaseInfo, ref Info);
        //设置炮弹兵技能
        SetSoldierSkill(BaseInfo, ref Info);
        //计算升级,升星,升阶 数据。
        CalcSoldierInfo(BaseInfo, ref Info);
        if (Info.SoldierTypeID == 102003)
        {
            Info.m_TurnInfo = new SoldierInfo();
            Info.m_TurnInfo.Copy(Info);
            Info.m_TurnInfo.SoldierTypeID = 902003;
            BaseInfo = GetSoldierType(Info.m_TurnInfo.SoldierTypeID);
            if (BaseInfo == null)
            {
                NGUIUtil.DebugLog("获取不到该类型的炮弹兵数据:" + Info.m_TurnInfo.SoldierTypeID);
                return;
            }
            FillBaseSoldierInfo(BaseInfo, ref Info.m_TurnInfo);
            //设置炮弹兵技能
            SetSoldierSkill(BaseInfo, ref Info.m_TurnInfo);
            //计算升级,升星,升阶 数据。
            CalcSoldierInfo(BaseInfo, ref Info.m_TurnInfo);
        }
    }
Exemplo n.º 12
0
    // isSoul是为了兼容闪亮登场界面的信息。
    public static ItemIconInfo GetIconInfo(IconType iconType, int id, bool isSoul, bool isBook)
    {
        ItemIconInfo iconInfo = new ItemIconInfo();

        if (iconType == IconType.IconType_Fragment)
        {
            if (isSoul)
            {
                int soldierTypeId       = SoldierM.GetSoldierStarID(id);
                s_soldier_typeInfo info = SoldierM.GetSoldierType(soldierTypeId);
                if (info == null)
                {
                    NGUIUtil.DebugLog("s_soldiertype id = " + id + " 静态表数据未配置!");
                    return(null);
                }
                else
                {
                    iconType = IconType.IconType_Soldier;
                    id       = info.modeltype;
                }
            }
            else if (isBook)
            {
                iconType = IconType.IconType_Captain;
                int godSkillType = GodSkillM.GetGodSkillType(id);
                id = GodSkillM.GetCaptainID(godSkillType);
            }
        }

        if (iconType == IconType.IconType_Soldier)        //英雄整卡
        {
            s_soldier_typeInfo info = SoldierM.GetSoldierType(id);
            if (info == null)
            {
                NGUIUtil.DebugLog("s_soldiertype id = " + id + " 静态表数据未配置!");
                return(null);
            }
            else
            {
                iconInfo.mType = iconType;
                iconInfo.mName = info.name;
                iconInfo.mID   = info.modeltype;
            }
        }
        else if (iconType == IconType.IconType_Fragment)        //道具/碎片
        {
            s_itemtypeInfo info = ItemM.GetItemInfo(id);
            if (info == null)
            {
                NGUIUtil.DebugLog("s_itemtype id = " + id + " 静态表数据未配置!");
                return(null);
            }
            else
            {
                iconInfo.mType = iconType;
                iconInfo.mName = info.name;
                int soldierTypeId = SoldierM.GetSoldierStarID(id);
                iconInfo.mID = info.gid;
            }
        }
        else if (iconType == IconType.IconType_Bulding)        //陷阱
        {
            s_building_typeInfo buildinfo = buildingM.GetBuildType(id);

            iconInfo.mType = iconType;
            iconInfo.mName = buildinfo.name;
            iconInfo.mID   = buildinfo.modeltype;
        }
        else if (iconType == IconType.IconType_Captain)        //黑科技
        {
            iconInfo.mType = iconType;
            CaptionInfo captionInfo = new CaptionInfo();
            GodSkillM.GetCaption(id, ref captionInfo);
            GodSkillInfo godSkillInfo = new GodSkillInfo();
            GodSkillM.GetGodSkill(captionInfo.m_godskilltype1, 1, ref godSkillInfo);
            iconInfo.mName = godSkillInfo.m_name;
            iconInfo.mID   = id;
        }
        iconInfo.mIsSoul = isSoul;
        iconInfo.mIsBook = isBook;
        return(iconInfo);
    }