public AttackItemBase createItem(EAttackType type) { AttackItemBase ret = null; if (EAttackType.eCommon == type) { ret = new ComAttackItem(type); } else if (EAttackType.eSkill == type) { ret = new SkillAttackItem(type); } m_attackList.Add(ret); return(ret); }
// 执行技能攻击 public void execAttack(SkillAttackItem item) { Ctx.m_instance.m_logSys.fightLog("[Fight] 开始执行技能攻击 execAttack"); // 技能攻击开始,需要将技能准备特效移除 if (m_card.m_sceneDZData.m_sceneDZAreaArr[(int)m_card.sceneCardItem.playerSide].centerHero.sceneCardItem.svrCard.qwThisID == item.attThisId) { m_card.m_sceneDZData.m_sceneDZAreaArr[(int)m_card.sceneCardItem.playerSide].centerHero.effectControl.stopSkillAttPrepareEffect(); } if (item.skillTableItem.m_bNeedMove > 0) // 如果是有攻击目标的技能攻击 { if (item.skillTableItem != null) { if (item.skillTableItem.m_skillAttackEffect != 0) { foreach (var thisId in item.hurtIdList.list) { if (thisId == m_card.sceneCardItem.svrCard.qwThisID) // 如果攻击者还是被击者,就不播放攻击特效了 { Ctx.m_instance.m_logSys.fightLog("[Fight] 攻击者 thisId 和被记者 thisId 相同,不播放攻击特效"); } else { Ctx.m_instance.m_logSys.fightLog("[Fight] 技能攻击播放攻击特效"); SceneCardBase hurtCard = Ctx.m_instance.m_sceneCardMgr.getCardByThisId(thisId); m_card.effectControl.addMoveEffect((int)item.skillTableItem.m_skillAttackEffect, m_card.transform().localPosition, hurtCard.transform().localPosition, item.skillTableItem.m_effectMoveTime); // 攻击特效 } } } } } else // 没有攻击目标的技能攻击 { if (item.skillTableItem != null) { if (item.skillTableItem.m_skillAttackEffect != 0) { Ctx.m_instance.m_logSys.fightLog("[Fight] 技能攻击播放场景特效"); Ctx.m_instance.m_sceneEffectMgr.addSceneEffect((int)item.skillTableItem.m_skillAttackEffect, m_card.m_sceneDZData.m_placeHolderGo.m_centerGO); // 添加一个场景特效 } } } m_card.sceneCardBaseData.m_effectControl.updateAttHurtStateEffect(item); }
public AttackItemBase createItem(EAttackType type) { AttackItemBase ret = null; if (EAttackType.eCommon == type) { ret = new ComAttackItem(type); } else if(EAttackType.eSkill== type) { ret = new SkillAttackItem(type); } m_attackList.Add(ret); return ret; }