public bool CheckInVisionRange()
        {
            if (incident.parms.target == null)
            {
                return(false);
            }
            Map map = incident.parms.target as Map;

            if (map == null)
            {
                return(false);
            }
            return(DetectDangerUtilities.GetVisionRangeOfMap(map.Tile) >= 1);
        }
Exemple #2
0
        private static bool TryFindTile(int targetTile, out int tile)
        {
            //IntRange banditCampQuestSiteDistanceRange = SiteTuning.BanditCampQuestSiteDistanceRange;
            int detectionRange = DetectDangerUtilities.GetDetectionRangeOfMap(targetTile);

            detectionRange = Math.Max(detectionRange, DetectDangerUtilities.GetVisionRangeOfMap(targetTile));
            detectionRange = Math.Max(detectionRange, 6);
            IntRange banditCampQuestSiteDistanceRange = new IntRange(detectionRange, detectionRange + 5);

            if (!TileFinder.TryFindNewSiteTile(out tile, banditCampQuestSiteDistanceRange.min, banditCampQuestSiteDistanceRange.max, false, true, -1))
            {
                return(ForceFindTile_Dfs(targetTile, targetTile, detectionRange + 1, out tile));
            }
            return(true);
        }
        protected void TileChangingAction()
        {
            if (!confirmed)
            {
                bool newDetected = detected;
                if (!detected)
                {
                    newDetected = DetectDangerUtilities.TryDetectIncidentCaravan(this);
                }
                else
                {
                    if (DetectDangerUtilities.TryDetectIncidentCaravanDetail(this))
                    {
                        incident.RevealRandomInformation();
                        TryNotifyCaravanIntel();
                    }
                }

                confirmed = DetectDangerUtilities.TryConfirmCaravanWithinVision(this);
                if (confirmed)
                {
                    incident.RevealAllInformation();
                    if (Communicable)
                    {
                        EstablishCommunication();
                    }
                    TryNotifyCaravanIntel();
                    NotifyConfirmed();
                }
                newDetected = newDetected || confirmed;

                if (newDetected != detected)
                {
                    detected = newDetected;
                    if (!confirmed)
                    {
                        NotifyDetected();
                    }
                    EventManger.NotifyCaravanListChange?.Invoke();
                }
            }

            //if(incident is InterceptedIncident_HumanCrowd_RaidEnemy ii)
            //{
            //    if (Communicable && !CommunicationEstablished)
            //        ii.TryActiveMakeContact();
            //}
        }