Exemple #1
0
    public void updateFrameInfo()
    {
        do
        {
            currFrame = MemoryAccessor.FrameCount();
        }while (currFrame == prevFrame);

        _player1.characterIndex = MemoryAccessor.ReadStaticInt(_player1._playerNumber);
        _player2.characterIndex = MemoryAccessor.ReadStaticInt(_player2._playerNumber);
        _player1.assignPlayerPtr("Player1Ptr");
        _player2.assignPlayerPtr("Player2Ptr");


        _player1._isBlocking  = MemoryAccessor.ReadInfoInt(ref _player1, MemoryAccessor._BlockstunOffset) != 0;
        _player2._isBlocking  = MemoryAccessor.ReadInfoInt(ref _player2, MemoryAccessor._BlockstunOffset) != 0;
        _player1._isHit       = MemoryAccessor.ReadInfoInt(ref _player1, MemoryAccessor._HitstunOffset) != 0;
        _player2._isHit       = MemoryAccessor.ReadInfoInt(ref _player2, MemoryAccessor._HitstunOffset) != 0;
        _player1._currentAnim = MemoryAccessor.ReadAnimationString(ref _player1);
        _player2._currentAnim = MemoryAccessor.ReadAnimationString(ref _player2);

        frameAdvantage(f, ref _player1, ref _player2);
        gap(g1, ref _player2);
        gap(g2, ref _player1);

        _player1._HP    = MemoryAccessor.ReadInfoInt(ref _player1, MemoryAccessor._HPOffset);
        _player2._HP    = MemoryAccessor.ReadInfoInt(ref _player2, MemoryAccessor._HPOffset);
        _player1._meter = MemoryAccessor.ReadInfoInt(ref _player1, MemoryAccessor._MeterOffset);
        _player2._meter = MemoryAccessor.ReadInfoInt(ref _player2, MemoryAccessor._MeterOffset);
        _player1._RISC  = MemoryAccessor.ReadInfoInt(ref _player1, MemoryAccessor._RISCOffset);
        _player2._RISC  = MemoryAccessor.ReadInfoInt(ref _player2, MemoryAccessor._RISCOffset);
        _player1._stun  = MemoryAccessor.ReadInfoInt(ref _player1, MemoryAccessor._DizzyOffset);
        _player2._stun  = MemoryAccessor.ReadInfoInt(ref _player2, MemoryAccessor._DizzyOffset);

        _player1._pos.x = MemoryAccessor.ReadInfoInt(ref _player1, MemoryAccessor._PositionXOffset);
        _player1._pos.y = MemoryAccessor.ReadInfoInt(ref _player1, MemoryAccessor._PositionYOffset);
        _player2._pos.x = MemoryAccessor.ReadInfoInt(ref _player2, MemoryAccessor._PositionXOffset);
        _player2._pos.y = MemoryAccessor.ReadInfoInt(ref _player2, MemoryAccessor._PositionYOffset);

        if (MemoryAccessor.FrameCount() - currFrame != 0)
        {
            Console.WriteLine("frame skipped");
        }
        prevFrame = currFrame;
    }