示例#1
0
        public async Task <bool> IsEggReady(SwordShieldDaycare daycare, CancellationToken token)
        {
            var ofs = GetDaycareEggIsReadyOffset(daycare);
            // Read a single byte of the Daycare metadata to check the IsEggReady flag.
            var data = await Connection.ReadBytesAsync(ofs, 1, token).ConfigureAwait(false);

            return(data[0] == 1);
        }
示例#2
0
 public async Task SetEggStepCounter(SwordShieldDaycare daycare, CancellationToken token)
 {
     // Set the step counter in the Daycare metadata to 180. This is the threshold that triggers the "Should I create a new egg" subroutine.
     // When the game executes the subroutine, it will generate a new seed and set the IsEggReady flag.
     // Just setting the IsEggReady flag won't refresh the seed; we want a different egg every time.
     var data = new byte[] { 0xB4, 0, 0, 0 }; // 180
     var ofs  = GetDaycareStepCounterOffset(daycare);
     await Connection.WriteBytesAsync(data, ofs, token).ConfigureAwait(false);
 }