//story public void AddStoryCampByLabel(object sender, LabelMgr.Args arg) { if (arg.add == true) { StaticPoint sp = arg.label as StaticPoint; if (sp != null) { if (sp.campId <= 0) { return; } int campId = sp.campId; if (!CampTradeIdData.IsStoryDetectTradeCamp(campId)) { return; } Vector3 pos = sp.position; Camp camp = Camp.GetCamp(campId); if (camp == null) { return; } DetectedTown dt = new DetectedTown(pos, camp.Name, campId); DTownsDict.Add(dt.PosCenter, dt); if (AddDetectedTownListener != null) { AddDetectedTownListener(dt.PosCenter); } } } }
void TryCreateMonsterSiege() { Camp camp = Camp.GetCamp(PeCreature.Instance.mainPlayer.position); if (m_Beacon == null && camp != null) { if (Time.time - m_LastRandomTime > m_RandTime * 60.0f) { m_LastRandomTime = Time.time; m_RandTime = Random.Range(minMinute, maxMinute); if (Random.value > probability) { m_FailedCout++; } else { m_Beacon = EntityMonsterBeacon.CreateMonsterBeaconByTDID(1, null, null); m_Beacon.TargetPosition = camp.Pos; m_Beacon.transform.position = camp.Pos; m_Beacon.handlerNewWave += OnNewWave; m_FailedCout = 0; } } } }
//story mission public void AddStoryCampByMission(int campId) { if (campId <= 0 || !CampTradeIdData.IsStoryMissionTradeCamp(campId)) { return; } Camp camp = Camp.GetCamp(campId); if (camp == null) { return; } DetectedTown dt = new DetectedTown(camp.Pos, camp.Name, campId); DTownsDict.Add(dt.PosCenter, dt); if (AddDetectedTownListener != null) { AddDetectedTownListener(dt.PosCenter); } }