public IEntity FindNearestTarget(eCombatType targetType, Vector3 myPosition, float radius) { List <ICombatOwner> combatList = new List <ICombatOwner>(); if (targetType == eCombatType.Hero || targetType == eCombatType.PC) { combatList.Add(m_hero); } CombatRepository repository = GetRepository(targetType); repository.GetCombats(ref combatList); float minDistant = float.MaxValue; IEntity actor = null; for (int i = 0; i < combatList.Count; i++) { float sqrDistant = (myPosition - combatList[i].GetOwnerPosition()).sqrMagnitude; if (sqrDistant < radius * radius && sqrDistant < minDistant) { minDistant = sqrDistant; actor = combatList[i] as IEntity; } } return(actor); }
private CombatRepository GetRepository(eCombatType actorType) { if (actorType >= eCombatType.Max) { return(null); } return(m_combatRepositories[(int)actorType]); }
public MonsterInfo(eCombatType combatType, EntityAssetInfo assetInfo, string name, long netid, DB_Character tableMonster) : base(combatType, assetInfo, name, netid) { m_tableMonster = tableMonster; Debug.Assert(null != m_tableMonster); //m_spriteData = ActorTableHelper.GetAssetActorData(m_tableMonster.AssetID); //Debug.Assert(null != m_spriteData); m_playerStatInfo = new MonsterStatInfo(m_tableMonster, name); //m_playerStatInfo.SetStatus(StatInfo.Type.MOVE_SPEED, m_spriteData.MoveSpeed); BattleTeam = BattleTeamNum.MONSTER; }
public PCInfo(eCombatType combatType, EntityAssetInfo assetInfo, string name, long netid, DB_Character pcData) : base(combatType, assetInfo, name, netid) { m_pcData = pcData;//DataManager.Instance.GetScriptData<CharacterData>().GetCharacter(tableid); //Debug.Assert(null != m_pcData); //m_spriteData = ActorTableHelper.GetAssetActorData(m_pcData.AssetID); //Debug.Assert(null != m_spriteData); PcStatInfo pcStatInfo = new PcStatInfo(m_pcData, Name); m_playerStatInfo = pcStatInfo; //m_playerStatInfo.SetStatus(StatInfo.Type.MOVE_SPEED, m_spriteData.MoveSpeed); }
public IEntity GetPlayer(eCombatType nodeType, long id) { if (m_hero.NetID == id) { return(m_hero); } IEntity actor = null; CombatRepository repository = GetRepository(nodeType); if (repository.Get(id, out actor)) { return(actor); } return(null); }
public BaseEntityInfo(eCombatType combatType, EntityAssetInfo assetInfo, string name, long netid) { m_name = name; m_NetID = netid; AssetInfo = assetInfo; m_combatType = combatType; if (combatType == eCombatType.Hero) { m_isUser = true; } else { m_isUser = false; } Init(); }
public void DestroyPlayer(IEntity entity) { eCombatType combatType = entity.CombatType; IGraphNodeGroup parentnode = entity.Main.Parent as IGraphNodeGroup; Debug.Assert(parentnode != null); entity.Terminate(); Remove(entity.CombatType, entity.NetID); LevelBase level = Global.NodeGraphMgr.WorldLevelRoot.ActorLevel; DetachActor(level, parentnode); //Global.FactoryMgr.Node.Destroy(actor); }
public void SetAutoAttack(AutoAttackSetModel attackSet) //, EffectModel autoAttackProc = null) { _attackSet = attackSet; _combatType = _attackSet.IsRanged ? eCombatType.Ranged : eCombatType.Melee; if (_characterModel.isPlayer) { _attackSet.Preload(); } SendEffectEvent(eEffectEvent.AutoAttackChanged); //if (autoAttackProc != null) //{ // autoAttackProc.Preload(); // EffectContext newContext = EffectContext.Create(); // newContext.Initialize(gameObject, gameObject, this); // autoAttackProc.CreateAndCast(gameObject, gameObject, newContext); //} if (AutoAttackChangedEvent != null) { AutoAttackChangedEvent(); } }
public bool Remove(eCombatType actorType, long id) { CombatRepository repository = GetRepository(actorType); return(repository.Remove(id)); }
/// <summary> /// 인자로 주어진 battleTeam과 다른 team의 actor 목록을 얻어옴. - 17.07.21. #jonghyuk /// </summary> /// <param name="nodeType"></param> /// <param name="lstActor"></param> /// <param name="battleTeam"></param> /// <returns></returns> public bool GetCombatsInOtherTeam(eCombatType nodeType, ref List <ICombatOwner> lstActor, int battleTeam) { CombatRepository repository = GetRepository(nodeType); return(repository.GetCombatsByCondition(ref lstActor, (combatOwner) => combatOwner.BattleTeam != battleTeam)); }
public bool GetCombatTransforms(eCombatType nodeType, ref List <Transform> lstTransforms) { CombatRepository repository = GetRepository(nodeType); return(repository.GetTransforms(ref lstTransforms)); }
public bool GetCombats(eCombatType nodeType, ref List <ICombatOwner> lstActor) { CombatRepository repository = GetRepository(nodeType); return(repository.GetCombats(ref lstActor)); }
public int GetCombatCount(eCombatType nodeType) { CombatRepository repository = GetRepository(nodeType); return(repository.GetCount()); }
public CombatRepository(eCombatType combatType) { m_combatType = combatType; }