/// <summary> /// Tries to find hazardous material. /// If player is deeper the chance is higher. /// Player also has to move from already checked spots. /// </summary> /// <param name="timer">Not used now</param> private void TryToFindMaterial(GTRPTimer timer) { if (this.IsPlayerInWorkVehicle()) { float zPos = this.workVehicle.position.Z; if (zPos <= maxZPos && zPos >= minZPos) { if (!checkedSpots.Any(x => x.DistanceTo(this.workVehicle.position) <= minDist)) { int chanceToFind = (int)Math.Abs(zPos / 3); int roll = rnd.Next(0, 101); if (roll <= chanceToFind) { character.SendNotification("You discovered some dangerous material!"); dangerousMaterialFound++; CheckFinish(); } else { character.SendNotification("No waste found, try moving around. Deeper levels have more waste."); } checkedSpots.Add(this.workVehicle.position); } } else if (zPos > maxZPos) { character.SendNotification("There is no waste this close to the surface. Go deeper."); } else { character.SendNotification("You are too deep to find waste. Go towards the surface."); } } }
public void RPTimerEvent(GTRPTimer timer) { KeyValuePair <int, int> pAndCar = (KeyValuePair <int, int>)timer.data; UpdateTaxiFeeForCharacterInTaxi(pAndCar.Key, pAndCar.Value); }
public TaxiMeter(int setterId, int money, GTRPTimer timer) { this.setterId = setterId; this.money = money; this.taxiTimer = timer; }
public UnderwaterScavengerJob(Character character) : base(character) { this.searchTimer = new GTRPTimer(this.TryToFindMaterial, (int)TimeSpan.FromSeconds(10).TotalMilliseconds, true); }