import unreal


MOVEMENT_DEFAULTS = {
    "WalkSpeed": 140.0,
    "SprintSpeed": 550.0,
    "SprintStaminaCostPerSecond": 28.0,
    "MinSprintStamina": 5.0,
    "AgeYears": 25.0,
    "PhysicalConditionMultiplier": 1.0,
    "StrengthMultiplier": 1.0,
    "EnduranceMultiplier": 1.0,
    "ComfortableCarryWeight": 25.0,
    "HeavyCarryWeight": 60.0,
    "TerrainMovementMultiplier": 1.0,
}


def load(path):
    asset = unreal.EditorAssetLibrary.load_asset(path)
    if not asset:
        raise RuntimeError(f"Could not load {path}")
    return asset


def main():
    character_bp = load("/Game/Agrarian/Blueprints/Characters/BP_AgrarianPlayerCharacter")
    character_cdo = unreal.get_default_object(character_bp.generated_class())

    for property_name, value in MOVEMENT_DEFAULTS.items():
        character_cdo.set_editor_property(property_name, value)
        unreal.log(f"Set {property_name} to {value}")

    unreal.EditorAssetLibrary.save_loaded_asset(character_bp)
    unreal.log("Agrarian movement baseline setup complete.")


main()
