import pyMeow as pm

class MTP57Hack:
    # 008438F0 is MTP-57 Ammo -> offset 0x140 from local_player (0x8437B0)
    # 008438CC is MTP-57 Mag -> offset 0x11C from local_player (0x8437B0)
    offset_ammo = 0x140
    offset_mag = 0x11C

    @classmethod
    def apply(cls, proc, local_player_addr, ammo_value=999, mag_value=99):
        """local_player의 MTP-57 총알 및 탄창 개수를 고정시킵니다."""
        try:
            pm.w_int(proc, local_player_addr + cls.offset_ammo, ammo_value)
            pm.w_int(proc, local_player_addr + cls.offset_mag, mag_value)
        except Exception as e:
            pass
