using System.Collections; using UnityEngine; namespace GrassCutter { public partial class DemoBot { /// /// -demoend (in a GC_DEMO build): the menu with its wishlist button, the goal on screen, the thank-you screen once /// the goal is shipped, and a purchase refused after it. /// IEnumerator DemoEndDemo() { Log($"demo build: {Demo.On}, app {SteamManager.AppId}, version {NetSession.Version}, data {Application.persistentDataPath}"); BotCapture.From = null; yield return new WaitForSeconds(3f); yield return Shot("demo_0_menu"); TeamState.DeleteSave(); NetSession.Instance.HostLocal(); while (!Me || !Ts) yield return null; yield return new WaitForSeconds(3f); Ts.ServerSetMoney(1000d); yield return new WaitForSeconds(0.5f); yield return Shot("demo_1_goal"); Ts.BuyToolRpc((byte)ToolId.Scythe); yield return new WaitForSeconds(1f); Log($"before the goal: scythe bought {(Me.Owns(ToolId.Scythe) ? "yes" : "NO")}, over {Demo.Over}"); Ts.Shipped.Value = Demo.GoalKg + 3; yield return new WaitForSeconds(2f); Log($"at the goal: over {Demo.Over}"); yield return Shot("demo_2_end"); UIRoot.I.CloseTopModal(); yield return new WaitForSeconds(0.5f); double cash = Ts.Money.Value; Ts.BuyToolRpc((byte)ToolId.LongScythe); Ts.BuyBeltSlotRpc(); yield return new WaitForSeconds(1f); Log($"after the goal: long scythe {(Me.Owns(ToolId.LongScythe) ? "BOUGHT" : "refused")}, money {cash:0} -> {Ts.Money.Value:0}"); yield return Shot("demo_3_refused"); Log("demoend done"); Application.Quit(); } } }