Пример #1
0
    /// <summary>
    ///协程意图-技能
    /// </summary>
    public IEnumerator CoroutineForIntentSkill(SkillInfoBean skillInfo, List <NpcAIMiniGameCombatCpt> relativeOurList, List <NpcAIMiniGameCombatCpt> relativeEnemyList)
    {
        if (skillInfo == null)
        {
            //如果没有技能则战斗
            StartCoroutine(CoroutineForIntentFight(relativeOurList, relativeEnemyList));
        }
        else
        {
            MiniGameHandler.Instance.handlerForCombat.miniGameData.SetRoundActionCommand(MiniGameCombatCommand.Skill);
            MiniGameHandler.Instance.handlerForCombat.miniGameData.SetRoundActionSkill(skillInfo);
            EffectDetailsEnumTools.GetEffectRange(skillInfo.effect_details, out int impactNumber, out int impactType);

            List <NpcAIMiniGameCombatCpt> listSelectTargetNpc = new List <NpcAIMiniGameCombatCpt>();
            if (impactType == 0)
            {
                //如果选择是选择自己
                listSelectTargetNpc.Add(this);
            }
            else if (impactType == 1)
            {
                //如果选择是选择友方
                listSelectTargetNpc.AddRange(GetSelectTargetByNumber(impactNumber, relativeOurList));
            }
            else if (impactType == 2)
            {
                //如果选择是选择敌人
                listSelectTargetNpc.AddRange(GetSelectTargetByNumber(impactNumber, relativeEnemyList));
            }
            MiniGameHandler.Instance.handlerForCombat.miniGameData.SetRoundTargetCharacter(listSelectTargetNpc);
            yield return(new WaitForSeconds(1f));

            MiniGameHandler.Instance.handlerForCombat.RoundForAction();
        }
    }
Пример #2
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);
        }
    }
Пример #3
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);
        }
    }
Пример #4
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);
        }
    }
Пример #5
0
 public void PickSkillComplete(SkillInfoBean skillInfo)
 {
     EffectDetailsEnumTools.GetEffectRange(skillInfo.effect_details, out int impactNumber, out int impactType);
     OpenSelectCharacter(impactNumber, impactType);
 }
Пример #6
0
 public void PickItemsComplete(ItemsInfoBean itemsInfo)
 {
     EffectDetailsEnumTools.GetEffectRange(itemsInfo.effect_details, out int impactNumber, out int impactType);
     OpenSelectCharacter(impactNumber, impactType);
 }