예제 #1
0
        public override bool Check(InputCondition inputCondition, Agent agent, Mapping mapping, Entity target, bool isRecheck)
        {
            Agent otherAgent = target as Agent;

            if (otherAgent == null)
            {
                return(false);
            }

            // Condition is satisfied if agent is the target and the other agent is performing the correct action
            if (otherAgent.decider.CurrentMapping != null && otherAgent.decider.CurrentMapping.target == agent &&
                otherAgent.decider.CurrentMapping.mappingType.actionType == inputCondition.levelType &&
                (inputCondition.floatValue <= 0f || Time.time - otherAgent.decider.PlanStartTime < inputCondition.floatValue))
            {
                // Possible to also have an R level requirement - set max to 0 to ignore this check
                if (inputCondition.max == 0)
                {
                    return(true);
                }
                else
                {
                    MemoryType.EntityInfo entityInfo = agent.memoryType.KnownEntity(agent, target);
                    if (entityInfo != null && entityInfo.rLevel >= inputCondition.min && entityInfo.rLevel <= inputCondition.max)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
예제 #2
0
        public bool CanJoin(Agent agent)
        {
            MemoryType.EntityInfo entityInfo = creator.memoryType.KnownEntity(creator, agent);

            // TODO: Figure out if non-faction AgentEvents should be allowed?
            return(state == State.Waiting && (!agentEventType.onlyFactionMembers || creator.faction == agent.faction) &&
                   ((agent.faction == null && creator.faction == null) || agent.faction.AllowEventType(agent.roleTypes, agentEventType, false)) &&
                   (creator == agent || (AttendeeCount() < agentEventType.maxAttendees &&
                                         entityInfo != null && entityInfo.rLevel >= agentEventType.rLevelMin)));
        }
예제 #3
0
 public override bool Check(InputCondition inputCondition, Agent agent, Mapping mapping, Entity target, bool isRecheck)
 {
     if (target != null)
     {
         MemoryType.EntityInfo entityInfo = agent.memoryType.KnownEntity(agent, target);
         if (entityInfo != null && entityInfo.rLevel >= inputCondition.min && entityInfo.rLevel <= inputCondition.max)
         {
             return(true);
         }
     }
     return(false);
 }