Example #1
0
        /// <summary>
        /// This call refreshes everything. This should be used less often. Inventory rendering can be more expensive and doesn't change as often.
        /// </summary>
        /// <param name="cToken"></param>
        public void Refresh()
        {
            // Perform slim lookups first.
            RefreshSlim();

            // Other lookups that don't need to update as often.
            // Player HP
            PlayerMaxHealth     = PointerPlayerHP.DerefInt(0x54);
            PlayerCurrentHealth = PointerPlayerHP.DerefInt(0x58);
            PlayerPoisoned      = PointerPlayerPoison.DerefByte(0x258) == 0x01;
            Rank      = PointerRank.DerefInt(0x58);
            RankScore = PointerRank.DerefFloat(0x5C);

            // Enemy HP
            GenerateEnemyEntries();
            for (int i = 0; i < PointerEnemyEntries.Length; ++i)
            {
                EnemyHealth[i] = new EnemyHP(PointerEnemyEntries[i].DerefInt(0x54), PointerEnemyEntries[i].DerefInt(0x58));
            }

            // Inventory
            for (int i = 0; i < PointerInventoryEntries.Length; ++i)
            {
                long   invDataPointer = PointerInventoryEntries[i].DerefLong(0x10);
                long   invDataOffset  = invDataPointer - PointerInventoryEntries[i].Address;
                int    invSlot        = PointerInventoryEntries[i].DerefInt(0x28);
                byte[] invData        = PointerInventoryEntries[i].DerefByteArray(invDataOffset + 0x10, 0x14);
                PlayerInventory[i] = new InventoryEntry(invSlot, (invData != null) ? invData : new byte[20] {
                    0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00
                });
            }

            HasScanned = true;
        }
        /// <summary>
        ///
        /// </summary>
        internal void UpdatePointers()
        {
            PointerEventActionType.UpdatePointers();
            PointerIsMotionPlay.UpdatePointers();
            PointerEventActionTask.UpdatePointers();

            PointerPlayerStatus.UpdatePointers();
            PointerPlayerHP.UpdatePointers();
            PointerPlayerPosition.UpdatePointers();

            PointerRankManager.UpdatePointers();
            PointerInventory.UpdatePointers();

            try
            {
                PointerEnemyCount.UpdatePointers();
                PointerEnemyEntryList.UpdatePointers();

                GenerateEnemyEntries();

                PointerInventoryCount.UpdatePointers();
                PointerInventoryEntryList.UpdatePointers();
                GenerateItemEntries();
            }
            catch
            {
                // May fail in main menu
            }
        }
Example #3
0
        /// <summary>
        ///
        /// </summary>
        public void UpdatePointers()
        {
            PointerIGT.UpdatePointers();
            PointerPlayerHP.UpdatePointers();
            PointerPlayerPoison.UpdatePointers();
            PointerRank.UpdatePointers();

            for (int i = 0; i < PointerEnemyEntries.Length; ++i)
            {
                PointerEnemyEntries[i].UpdatePointers();
            }

            for (int i = 0; i < PointerInventoryEntries.Length; ++i)
            {
                PointerInventoryEntries[i].UpdatePointers();
            }
        }
Example #4
0
        /// <summary>
        ///
        /// </summary>
        public void UpdatePointers()
        {
            PointerIGT.UpdatePointers();
            PointerPlayerHP.UpdatePointers();
            PointerPlayerPoison.UpdatePointers();
            PointerRank.UpdatePointers();

            PointerEnemyEntryCount.UpdatePointers();
            GenerateEnemyEntries(); // This has to be here for the next part.
            for (int i = 0; i < PointerEnemyEntries.Length; ++i)
            {
                PointerEnemyEntries[i].UpdatePointers();
            }

            for (int i = 0; i < PointerInventoryEntries.Length; ++i)
            {
                PointerInventoryEntries[i].UpdatePointers();
            }
        }