public bool BeCooperationTarget(PeEntity target) { for (int i = 0; i < mCooperationLists.Count; i++) { AtkCooperation atk = mCooperationLists[i] as AtkCooperation; if (atk == null) { continue; } if (atk.HasBeTarget(target)) { atk.SetAtkTarget(target); return(true); } } for (int i = 0; i < mCooperationLists.Count; i++) { AtkCooperation atk = mCooperationLists[i] as AtkCooperation; if (atk == null) { continue; } if (atk.CanBeTarget(target)) { atk.AddAktTarget(target); return(true); } } return(false); }
public void AddNewMemberAtkCooperation(PeEntity member) { AtkCooperation atk = new AtkCooperation(2, 1); member.target.SetEnityCanAttack(true); //atk.onCooperationEnd += CooperationEnd; atk.AddMember(member); mCooperationLists.Add(atk); }
public bool ChangeCooperTarget(AtkCooperation cooper, PeEntity target) { if (cooper == null) { return(false); } cooper.AddAktTarget(target); return(true); }
public List <PeEntity> GetAtkMemberByTarget(PeEntity target) { AtkCooperation atk = GetAtkCooperByTarget(target); if (atk == null) { return(null); } return(atk.GetAtkCooperMembers()); }
public AtkCooperation GetAtkCooperByMember(PeEntity member) { for (int i = 0; i < mCooperationLists.Count; i++) { AtkCooperation atk = mCooperationLists[i] as AtkCooperation; if (atk != null && atk.ContainMember(member)) { return(atk); } } return(null); }
public AtkCooperation GetAtkCooperByTarget(PeEntity target) { for (int i = 0; i < mCooperationLists.Count; i++) { AtkCooperation atk = mCooperationLists[i] as AtkCooperation; if (atk != null && atk.HasBeTarget(target)) { return(atk); } } return(null); }
public void OnAtkTargetLost(PeEntity entity) { for (int i = 0; i < mCooperationLists.Count; i++) { AtkCooperation atk = mCooperationLists[i] as AtkCooperation; if (atk != null) { atk.OnAtkTargetLost(entity); } } if (entity != null) { if (mAtkTargets.Contains(entity)) { RemoveAtkTarget(entity); } } }
public void DissolveTheline(PeEntity target) { AtkCooperation atk = GetAtkCooperByTarget(target); if (target != null) { if (mAtkTargets.Contains(target)) { RemoveAtkTarget(target); } } if (atk != null) { List <PeEntity> lists = atk.GetCooperMembers(); RemoveOut(lists); mCooperationLists.Remove(atk); atk.DissolveCooper(); } }
public void AddNewTargetAtkCooperation(PeEntity target) { if (target != null && target.monsterProtoDb != null) { int num; if (target.monsterProtoDb.AtkDb.mNumber != 0) { num = target.monsterProtoDb.AtkDb.mNumber; } else { num = CSNpcTeam.CsNpcNumber; } AtkCooperation atk = new AtkCooperation(num, 1); atk.AddAktTarget(target); mCooperationLists.Add(atk); } }
public void OnAtkTargetDestroy(SkillSystem.SkEntity entity) { for (int i = 0; i < mCooperationLists.Count; i++) { AtkCooperation atk = mCooperationLists[i] as AtkCooperation; if (atk != null) { atk.OnAtkTargetDestroy(entity); } } PeEntity target = entity.GetComponent <PeEntity>(); if (target != null) { if (mAtkTargets.Contains(target)) { RemoveAtkTarget(target); } } }
public void OnAtkTargetDeath(SkillSystem.SkEntity skSelf, SkillSystem.SkEntity skCaster) { PeEntity target = skSelf.GetComponent <PeEntity>(); AtkCooperation atk = GetAtkCooperByTarget(target); if (target != null) { if (mAtkTargets.Contains(target)) { RemoveAtkTarget(target); } } if (atk != null) { List <PeEntity> lists = atk.GetCooperMembers(); RemoveOut(lists); mCooperationLists.Remove(atk); atk.DissolveCooper(); } }