Example #1
0
        // 执行技能受伤
        public void execHurt(SkillHurtItem item)
        {
            Ctx.m_instance.m_logSys.fightLog("[Fight] 开始执行技能被击 execHurt");

            LinkEffect effect = null;

            if (item.bDamage)                                                              // 检查是否是伤血
            {
                effect = m_card.effectControl.addLinkEffect(HurtItemBase.DAMAGE_EFFECTID); // 掉血特效必然播放
                effect.addEffectPlayEndHandle(item.onHurtExecEnd);

                // 播放伤害数字
                if (item.svrCard.popDamValue > 0)
                {
                    m_card.playFlyNum((int)-item.svrCard.popDamValue);
                }
            }
            else if ((int)item.svrCard.popHpValue > 0)       // 回血
            {
                //if (!item.bStateChange())
                //{
                m_card.playFlyNum((int)item.svrCard.popHpValue);
                item.onHurtExecEnd(null);           // 直接结束当前技能被击 Item
                //}
            }
            else                          // 不伤血也不加血,直接结束
            {
                item.onHurtExecEnd(null); // 直接结束当前技能被击 Item
            }

            m_card.sceneCardBaseData.m_effectControl.updateAttHurtStateEffect(item);

            // 更新自己的属性显示
            m_card.updateCardDataChangeBySvr(item.svrCard);
        }
Example #2
0
        public HurtItemBase createItem(EHurtType type)
        {
            HurtItemBase ret = null;

            if (EHurtType.eCommon == type)
            {
                ret           = new ComHurtItem(type);
                ret.delayTime = AttackItemBase.ComAttMoveTime;
            }
            else if (EHurtType.eSkill == type)
            {
                ret           = new SkillHurtItem(type);
                ret.delayTime = 1;  // 技能攻击延迟时间有技能攻击飞行特效的时间决定,这里赋值一个默认的值
            }
            else if (EHurtType.eDie == type)
            {
                ret = new DieItem(type);
            }

            m_hurtList.Add(ret);
            ret.hurtExecEndDisp.addEventHandle(onOneHurtExecEnd);

            return(ret);
        }
Example #3
0
        public HurtItemBase createItem(EHurtType type)
        {
            HurtItemBase ret = null;
            if(EHurtType.eCommon == type)
            {
                ret = new ComHurtItem(type);
                ret.delayTime = AttackItemBase.ComAttMoveTime;
            }
            else if (EHurtType.eSkill == type)
            {
                ret = new SkillHurtItem(type);
                ret.delayTime = 1;  // 技能攻击延迟时间有技能攻击飞行特效的时间决定,这里赋值一个默认的值
            }
            else if (EHurtType.eDie == type)
            {
                ret = new DieItem(type);
            }

            m_hurtList.Add(ret);
            ret.hurtExecEndDisp.addEventHandle(onOneHurtExecEnd);

            return ret;
        }
Example #4
0
        // 执行技能受伤
        public void execHurt(SkillHurtItem item)
        {
            Ctx.m_instance.m_logSys.fightLog("[Fight] 开始执行技能被击 execHurt");

            LinkEffect effect = null;

            if (item.bDamage)// 检查是否是伤血
            {
                effect = m_card.effectControl.addLinkEffect(HurtItemBase.DAMAGE_EFFECTID);  // 掉血特效必然播放
                effect.addEffectPlayEndHandle(item.onHurtExecEnd);

                // 播放伤害数字
                if (item.svrCard.popDamValue > 0)
                {
                    m_card.playFlyNum((int)-item.svrCard.popDamValue);
                }
            }
            else if ((int)item.svrCard.popHpValue > 0)       // 回血
            {
                //if (!item.bStateChange())
                //{
                    m_card.playFlyNum((int)item.svrCard.popHpValue);
                    item.onHurtExecEnd(null);       // 直接结束当前技能被击 Item
                //}
            }
            else    // 不伤血也不加血,直接结束
            {
                item.onHurtExecEnd(null);       // 直接结束当前技能被击 Item
            }

            m_card.sceneCardBaseData.m_effectControl.updateAttHurtStateEffect(item);

            // 更新自己的属性显示
            m_card.updateCardDataChangeBySvr(item.svrCard);
        }