public void Tick(IHTNAgent npc, float deltaTime, float time)
        {
            ScientistAStarContext npcContext = npc.AiDomain.NpcContext as ScientistAStarContext;

            if (npcContext == null)
            {
                return;
            }
            HTNPlayer hTNPlayer = npc as HTNPlayer;

            if (hTNPlayer == null)
            {
                return;
            }
            if (npcContext.GetFact(Facts.FirearmOrder) == 0)
            {
                hTNPlayer.SetPlayerFlag(BasePlayer.PlayerFlags.Relaxed, true);
                return;
            }
            hTNPlayer.SetPlayerFlag(BasePlayer.PlayerFlags.Relaxed, false);
        }
Ejemplo n.º 2
0
        public void Tick(IHTNAgent npc, float deltaTime, float time)
        {
            ScientistAStarContext npcContext = npc.AiDomain.NpcContext as ScientistAStarContext;

            if (npcContext == null)
            {
                return;
            }
            HTNPlayer htnPlayer = npc as HTNPlayer;

            if (Object.op_Equality((Object)htnPlayer, (Object)null))
            {
                return;
            }
            if (npcContext.GetFact(Rust.Ai.HTN.ScientistAStar.Facts.FirearmOrder) == (byte)0)
            {
                htnPlayer.SetPlayerFlag(BasePlayer.PlayerFlags.Relaxed, true);
            }
            else
            {
                htnPlayer.SetPlayerFlag(BasePlayer.PlayerFlags.Relaxed, false);
            }
        }