use super::super::super::*;

pub(in crate::inspect::smp) fn special_condition_world_scalar_descriptor_metadata(
    descriptor_id: u32,
) -> Option<RealGroupedEffectDescriptorMetadata> {
    let slot_index = descriptor_id.checked_sub(110)? as usize;
    if slot_index != 12 {
        return None;
    }
    let definition = KNOWN_SPECIAL_CONDITION_DEFINITIONS.get(slot_index)?;
    if definition.hidden {
        return None;
    }
    Some(RealGroupedEffectDescriptorMetadata {
        descriptor_id,
        label: definition.label,
        target_mask_bits: 0x08,
        parameter_family: "world_track_build_limit_scalar",
        runtime_key: None,
        runtime_status: RealGroupedEffectRuntimeStatus::Executable,
        executable_in_runtime: true,
    })
}

pub(in crate::inspect::smp) fn special_condition_world_toggle_descriptor_metadata(
    descriptor_id: u32,
) -> Option<RealGroupedEffectDescriptorMetadata> {
    let slot_index = descriptor_id.checked_sub(110)? as usize;
    if !(1..=34).contains(&slot_index) || matches!(slot_index, 12 | 31) {
        return None;
    }
    let definition = KNOWN_SPECIAL_CONDITION_DEFINITIONS.get(slot_index)?;
    if definition.hidden {
        return None;
    }
    Some(RealGroupedEffectDescriptorMetadata {
        descriptor_id,
        label: definition.label,
        target_mask_bits: 0x08,
        parameter_family: "world_flag_toggle",
        runtime_key: None,
        runtime_status: RealGroupedEffectRuntimeStatus::Executable,
        executable_in_runtime: true,
    })
}
