Esempio n. 1
0
    /// <summary>
    /// 设置属性
    /// </summary>
    /// <param name="data"></param>
    public void SetAttributes(SkillInfoBean data)
    {
        CptUtil.RemoveChildsByActive(objAttributeContainer);
        CreateItemAttributes("hourglass_1", TextHandler.Instance.manager.GetTextById(510) + " " + data.GetUseNumber());


        if (CheckUtil.StringIsNull(data.effect))
        {
            return;
        }
        List <EffectTypeBean> listEffectData = EffectTypeEnumTools.GetListEffectData(data.effect);

        //获取详情
        EffectDetailsEnumTools.GetEffectDetailsForCombat(data.effect_details, out string effectPSName, out int durationForRound);

        if (listEffectData == null)
        {
            return;
        }
        foreach (EffectTypeBean itemData in listEffectData)
        {
            EffectTypeEnumTools.GetEffectDetails(itemData, null);
            string describe = itemData.effectDescribe;
            if (durationForRound != 0)
            {
                describe += ("\n" + string.Format(TextHandler.Instance.manager.GetTextById(502), "" + durationForRound));
            }
            CreateItemAttributes(itemData.spIcon, itemData.colorIcon, describe);
        }
    }
Esempio n. 2
0
    /// <summary>
    /// 设置属性
    /// </summary>
    /// <param name="data"></param>
    public void SetAttributes(ItemsInfoBean data)
    {
        CptUtil.RemoveChildsByActive(objAttributeContainer);
        CreateItemAttributes("ui_ability_life", data.add_life, AttributesTypeEnumTools.GetAttributesName(AttributesTypeEnum.Life), colorForAttribute);
        CreateItemAttributes("ui_ability_cook", data.add_cook, TextHandler.Instance.manager.GetTextById(1), colorForAttribute);
        CreateItemAttributes("ui_ability_speed", data.add_speed, AttributesTypeEnumTools.GetAttributesName(AttributesTypeEnum.Speed), colorForAttribute);
        CreateItemAttributes("ui_ability_account", data.add_account, AttributesTypeEnumTools.GetAttributesName(AttributesTypeEnum.Account), colorForAttribute);
        CreateItemAttributes("ui_ability_charm", data.add_charm, AttributesTypeEnumTools.GetAttributesName(AttributesTypeEnum.Charm), colorForAttribute);
        CreateItemAttributes("ui_ability_force", data.add_force, AttributesTypeEnumTools.GetAttributesName(AttributesTypeEnum.Force), colorForAttribute);
        CreateItemAttributes("ui_ability_lucky", data.add_lucky, AttributesTypeEnumTools.GetAttributesName(AttributesTypeEnum.Lucky), colorForAttribute);

        if (CheckUtil.StringIsNull(data.effect))
        {
            return;
        }
        List <EffectTypeBean> listEffectData = EffectTypeEnumTools.GetListEffectData(data.effect);

        //获取详情
        EffectDetailsEnumTools.GetEffectDetailsForCombat(data.effect_details, out string effectPSName, out int durationForRound);

        if (listEffectData == null)
        {
            return;
        }
        foreach (EffectTypeBean itemData in listEffectData)
        {
            EffectTypeEnumTools.GetEffectDetails(itemData, null);
            string describe = itemData.effectDescribe;
            if (durationForRound != 0)
            {
                describe += ("\n" + string.Format(TextHandler.Instance.manager.GetTextById(502), "" + durationForRound));
            }
            CreateItemAttributes(itemData.spIcon, describe);
        }
    }
Esempio n. 3
0
    /// <summary>
    /// 增加效果
    /// </summary>
    /// <param name="effectTypeData"></param>
    /// <param name="effectDetailsData"></param>
    public void AddCombatEffect(NpcAIMiniGameCombatCpt actionCharacter, string effectTypeData, string effectDetailsData, Sprite spIcon)
    {
        List <EffectTypeBean> listTypeData = EffectTypeEnumTools.GetListEffectData(effectTypeData);

        EffectDetailsEnumTools.GetEffectDetailsForCombat(effectDetailsData, out string effectPSName, out int durationForRound);
        MiniGameCombatEffectBean gameCombatEffectData = new MiniGameCombatEffectBean();

        gameCombatEffectData.listEffectTypeData = listTypeData;
        gameCombatEffectData.durationForRound   = durationForRound;
        gameCombatEffectData.effectPSName       = effectPSName;
        gameCombatEffectData.iconMarkId         = SystemUtil.GetUUID(SystemUtil.UUIDTypeEnum.N);
        gameCombatEffectData.actionCharacter    = actionCharacter;
        gameCombatEffectData.targetCharacter    = this;

        foreach (EffectTypeBean itemType in listTypeData)
        {
            //设置技能的备用图标
            EffectTypeEnumTools.GetEffectDetails(itemType, spIcon);
            //如果是持续 则需要加上BUFF图标
            if (durationForRound > 0)
            {
                Sprite spEffect;
                if (itemType.spIconRemark != null)
                {
                    spEffect = itemType.spIconRemark;
                }
                else
                {
                    spEffect = itemType.spIcon;
                }
                AddStatusIconForEffect(spEffect, Color.white, gameCombatEffectData.iconMarkId);
            }
        }
        //播放粒子特效
        if (!CheckUtil.StringIsNull(effectPSName))
        {
            MiniGameHandler.Instance.handlerForCombat.miniGameBuilder.CreateCombatEffect(effectPSName, transform.position + new Vector3(0, 0.5f));
        }
        if (durationForRound > 0)
        {
            characterMiniGameData.listCombatEffect.Add(gameCombatEffectData);
        }
        else
        {
            //回合数小于0的立即执行
            CombatEffectExecute(gameCombatEffectData, out bool isDead);
        }
    }