BehaveResult Init(Tree sender) { if (!GetData <Data>(sender, ref m_Data)) { return(BehaveResult.Failure); } mFind = new FindHidePos(m_Data.RunRadius, false, m_Data.RunRadius); startRunTime = Time.time; //make sure frist run time //startHideTime = Time.time; SetCambat(false); return(BehaveResult.Running); }
BehaveResult Init(Tree sender) { if (!NpcTypeDb.CanRun(NpcCmdId, ENpcControlType.Recourse)) { return(BehaveResult.Failure); } float Hp = GetAttribute(AttribType.Hp); float HpMax = GetAttribute(AttribType.HpMax); // Request req = GetRequest(EReqType.FollowPath) as RQFollowPath; // if(req != null && !req.CanRun()) // { // specialRecurse = true; // specialRecursestartTime = Time.time; // } // else // { // specialRecurse = false; // specialRecursestartTime = -1; // if(req != null && req.CanRun()) // { // if(entity.target != null && entity.target.GetAttackEnemy() != null) // entity.target.ClearEnemy(); // // return BehaveResult.Success; // } // } if (Hp / HpMax > 0.25f) //!specialRecurse { return(BehaveResult.Failure); } if (PeCreature.Instance != null && PeCreature.Instance.mainPlayer != null && playerTrans == null) { playerTrans = PeCreature.Instance.mainPlayer.peTrans; } SetCambat(false); hideStarTime = Time.time; checkStarTime = Time.time; mfind = new Pathea.FindHidePos(8.0f, false); return(BehaveResult.Running); }