ACR_Traps.TrapDetect.IsTrapDetectedBy C# (CSharp) Метод

IsTrapDetectedBy() приватный статический Метод

private static IsTrapDetectedBy ( CLRScriptBase s, ALFA trap, uint detector ) : bool
s CLRScriptFramework.CLRScriptBase
trap ALFA
detector uint
Результат bool
        private static bool IsTrapDetectedBy(CLRScriptBase s, ALFA.Shared.ActiveTrap trap, uint detector)
        {
            if (trap.Detected)
            {
                return false;
            }
            if(!IsInArea(s, trap, detector))
            {
                return false;
            }

            if (s.GetDetectMode(detector) == FALSE)
            {
                s.DelayCommand(6.0f, delegate { DetectHeartBeat(s, trap, detector); });
                return false;
            }

            if (trap.DetectDC > 20 &&
                s.GetLevelByClass(CLASS_TYPE_ROGUE, detector) == FALSE &&
                s.GetHasSpellEffect(SPELL_FIND_TRAPS, detector) == FALSE)
            {
                s.DelayCommand(6.0f, delegate { DetectHeartBeat(s, trap, detector); }); 
                return false;
            }

            int searchBonus = s.GetSkillRank(SKILL_SEARCH, detector, FALSE);
            int roll = s.d20(1);
            int finalDice = roll + searchBonus;
            if (trap.DetectDC <= finalDice)
            {
                return true;
            }
            s.DelayCommand(6.0f, delegate { DetectHeartBeat(s, trap, detector); });
            return false;
        }