public override float Score(IAIContext context, BasePlayer option)
        {
            PlayerTargetContext playerTargetContext = context as PlayerTargetContext;

            if (playerTargetContext != null)
            {
                Scientist self = playerTargetContext.Self as Scientist;
                if (self)
                {
                    Memory.ExtendedInfo extendedInfo = self.AiContext.Memory.GetExtendedInfo(option);
                    if (extendedInfo.Entity == null)
                    {
                        if (!self.HostilityConsideration(option))
                        {
                            return(0f);
                        }
                        return(this.score);
                    }
                    if (Time.time < extendedInfo.LastHurtUsTime + this.Timeout)
                    {
                        return(this.score);
                    }
                    if (!self.HostilityConsideration(option))
                    {
                        return(0f);
                    }
                    return(this.score);
                }
            }
            return(0f);
        }
Пример #2
0
        public virtual float Score(IAIContext context, BasePlayer option)
        {
            PlayerTargetContext playerTargetContext = context as PlayerTargetContext;

            if (playerTargetContext != null)
            {
                Scientist self = playerTargetContext.Self as Scientist;
                if (Object.op_Implicit((Object)self))
                {
                    Memory.ExtendedInfo extendedInfo = self.AiContext.Memory.GetExtendedInfo((BaseEntity)option);
                    if (Object.op_Inequality((Object)extendedInfo.Entity, (Object)null))
                    {
                        if ((double)Time.get_time() < (double)extendedInfo.LastHurtUsTime + (double)this.Timeout || self.HostilityConsideration(option))
                        {
                            return(this.score);
                        }
                        return(0.0f);
                    }
                    if (!self.HostilityConsideration(option))
                    {
                        return(0.0f);
                    }
                    return(this.score);
                }
            }
            return(0.0f);
        }