# usage:
## set_temp_variable = { alarm_clock_type_other_context = 1 }
## has_alarm_clock_type_with_country_target = yes
has_alarm_clock_type_with_country_target = {
	OR = {
		check_variable = { alarm_clock_type_other_context = 1 }
		check_variable = { alarm_clock_type_other_context = 2 }
		check_variable = { alarm_clock_type_other_context = 3 }
		check_variable = { alarm_clock_type_other_context = 4 }
		check_variable = { alarm_clock_type_other_context = 16 }
		check_variable = { alarm_clock_type_other_context = 18 }
		check_variable = { alarm_clock_type_other_context = 19 }
		check_variable = { alarm_clock_type_other_context = 21 }
	}
}

# usage:
## set_temp_variable = { alarm_clock_type_other_context = 1 }
## has_alarm_clock_type_with_state_target = yes
has_alarm_clock_type_with_state_target = {
	OR = {
		check_variable = { alarm_clock_type_other_context = 5 }
		check_variable = { alarm_clock_type_other_context = 6 }
		check_variable = { alarm_clock_type_other_context = 7 }
		check_variable = { alarm_clock_type_other_context = 8 }
		check_variable = { alarm_clock_type_other_context = 9 }
		check_variable = { alarm_clock_type_other_context = 10 }
		check_variable = { alarm_clock_type_other_context = 17 }
		check_variable = { alarm_clock_type_other_context = 22 }
	}
}

# usage:
## set_temp_variable = { alarm_clock_type_other_context = 1 }
## has_alarm_clock_type_with_custom_title = yes
has_alarm_clock_type_with_custom_title = {
	OR = {
		check_variable = { alarm_clock_type_other_context = 21 }
		check_variable = { alarm_clock_type_other_context = 22 }
		check_variable = { alarm_clock_type_other_context = 23 }
	}
}

# usage:
## set_temp_variable = { alarm_clock_id = 1 }
## has_selected_alarm_clock_target = yes
has_selected_alarm_clock_target = {
	meta_trigger = {
		text = {
			NOT = { check_variable = { alarm_clock_array_[ID]^1 = 0 } }
		}
		ID = "[?alarm_clock_id]"
	}
}

# usage:
## set_temp_variable = { alarm_clock_id = 1 }
## has_reached_date_for_alarm_clock = yes
has_reached_date_for_alarm_clock = {
	meta_trigger = {
		text = {
			NOT = { check_variable = { global.date < alarm_clock_array_[ID]^2 } }
		}
		ID = "[?alarm_clock_id]"
	}
}

# usage:
## has_any_alarm_with_current_settings = yes
has_any_alarm_with_current_settings = {
	any_of = {
		array = alarm_clock_array
		value = value_temp
		index = index_temp
		NOT = { check_variable = { value_temp = 0 } }
		meta_trigger = {
			text = {
				check_variable = { alarm_clock_array_[ID]^0 = create_new_alarm_clock_type }
				check_variable = { alarm_clock_array_[ID]^1 = create_new_alarm_clock_target }
				check_variable = { alarm_clock_array_[ID]^2 = create_new_alarm_clock_date }
				if = {
					limit = {
						set_temp_variable = { alarm_clock_type_other_context = create_new_alarm_clock_type }
						has_alarm_clock_type_with_custom_title = yes
						set_temp_variable = { alarm_clock_type_other_context = alarm_clock_array_[ID]^0 }
						has_alarm_clock_type_with_custom_title = yes
					}
					check_variable = { create_new_alarm_clock_custom_type^num = alarm_clock_custom_type_array_[ID]^num }
					all_of = {
						array = create_new_alarm_clock_custom_type
						value = custom_text_value_temp
						index = custom_text_index_temp
						check_variable = { custom_text_value_temp = alarm_clock_custom_type_array_[ID]^custom_text_index_temp }
					}
				}
			}
			ID = "[?value_temp]"
		}
	}
}