public static void Perform(GameDriver driver) { var currentToy = driver.CurrentToy; if (!currentToy.IsFixed) { return; } HandleHotspotInteraction.SendCurrentToolToStart(); driver.ChangeState(GameState.ClientPayment); }
public static void Perform(GameDriver driver, FrameTime time) { if (!Paid) { driver.Money.AddMoney(1); Paid = true; } if (Delay > 0.0f) { Delay -= time.Elapsed; return; } driver.CurrentToy.Active = false; driver.ChangeState(GameState.ClientLeaving); }
public static void Perform(GameDriver driver, FrameTime time) { if (WaitTime > 0.0f) { WaitTime -= time.Elapsed; return; } var speechSprite = driver.GameInterface.SpeechSprite; speechSprite.Tint = new Color(speechSprite.Tint, 0.8f); var customerIndex = GetRandom.Int(0, 2); driver.Customer.Transform.Position = driver.GameInterface.CustomerLocation.Position; driver.Customer.Sprite.ImageId = $"Customer_00{customerIndex}"; foreach (var toy in driver.Toys) { toy.Active = false; } if (driver.WaitingToyLine == null || driver.WaitingToyLine.Count == 0) { driver.WaitingToyLine = RegenerateToyLine(driver.Toys); } var selectedToy = driver.WaitingToyLine.PopRandom(); foreach (var damagePoint in selectedToy.DamagePoints) { var activationChance = GetRandom.Float(0.0f, 100.0f); damagePoint.Active = activationChance < 50.0f; } selectedToy.Active = true; driver.CurrentToy = selectedToy; driver.ChangeState(GameState.FixingToy); }