// 攻击者攻击被击者 protected void attackTo(SceneCardBase att, SceneCardBase def, EAttackType attackType, stNotifyBattleCardPropertyUserCmd msg) { if (att != null && def != null) { Ctx.m_instance.m_logSys.fightLog(string.Format("[Fight] 被击者详细信息 {0}", def.getDesc())); // 受伤 HurtItemBase hurtItem = null; hurtItem = def.fightData.hurtData.createItem((EHurtType)attackType); hurtItem.initItemData(att, def, msg); def.fightData.hurtData.allHurtExecEndDisp.addEventHandle(onOneAttackAndHurtEndHandle); m_hurtList.Add(def.fightData.hurtData); } }
// 执行队列中的一个 Item,这个必须是有效的,只有执行完后,才会删除者 Item public void getNextItem() { if (m_hurtList.Count() > 0) { foreach (var item in m_hurtList.list) { if (item.delayTime <= 0 && item.execState== EHurtExecState.eNone) { m_curHurtItem = item; m_curHurtItem.startHurt(); return; } } } }
// 执行队列中的一个 Item,这个必须是有效的,只有执行完后,才会删除者 Item public void getNextItem() { if (m_hurtList.Count() > 0) { foreach (var item in m_hurtList.list) { if (item.delayTime <= 0 && item.execState == EHurtExecState.eNone) { m_curHurtItem = item; m_curHurtItem.startHurt(); return; } } } }
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); }
public void removeItem(HurtItemBase item) { m_hurtList.Remove(item); item.dispose(); }
public void addItem(HurtItemBase item) { m_hurtList.Add(item); }