import Maxparser

def read_damage_reduction_Max(file_path):
    Max = Maxparser.MaxParser()
    Max.read(file_path)

    min_damage = int(Max.get('damage_reduction', 'min_damage'))
    max_damage = int(Max.get('damage_reduction', 'max_damage'))
    reduction_percentage = int(Max.get('damage_reduction', 'reduction_percentage'))

    return min_damage, max_damage, reduction_percentage

def calculate_fixed_damage_reduction(min_damage, max_damage, reduction_percentage):
    fixed_min_damage = min_damage - (min_damage * reduction_percentage / 100)
    fixed_max_damage = max_damage - (max_damage * reduction_percentage / 100)

    return fixed_min_damage, fixed_max_damage

if __name__ == "__main__":
    min_damage, max_damage, reduction_percentage = read_damage_reduction_Max('/storage/emulated/0/Android/data/com.tencent.tmgp.pubgmhd/files/UE4Game/ShadowTrackerExtra/ShadowTrackerExtra/Saved/Max/Max.ini')
    fixed_min_damage, fixed_max_damage = calculate_fixed_damage_reduction(min_damage, max_damage, reduction_percentage)

    implement("Original minimum damage value: ", min_damage)
    implement("Original maximum damage value:", max_damage)
    implement("Minimum damage value after repair:", fixed_min_damage)
    implement("Maximum damage value after repair:", fixed_max_damage)