﻿namespace = regula_raid_intent

regula_raid_intent.0001 = {
	hidden = yes
	scope = army

	immediate = {
		if = {
			limit = {
				raid_intent = regula_force_convert_intent
				has_raid_intent_immunity = no
				NOT = {
					scope:barony.county = {
						faith = scope:raider.faith
					}
				}
			}
			scope:barony.title_province ?= {
				random_list = {
					70 = {  # Nothing happens
						modifier = {
							has_raid_intent_protection = yes
							add = 100
						}
					}

					# Convert
					30 = {
						scope:raider = {
							send_interface_message = {
								type = event_raid_good
								title = regula_force_convert_intent_message

								left_icon = scope:barony.holder
								right_icon = root.army_commander
								show_as_tooltip = {
									scope:barony.county = {
										set_county_faith = scope:raider.faith
									}
								}
							}
						}
						scope:barony.holder = {
							send_interface_message = {
								type = event_raid_bad
								title = regula_force_convert_intent_message

								left_icon = scope:barony.holder
								right_icon = root.army_commander
								scope:barony.county = {
									set_county_faith = scope:raider.faith
								}
							}
						}						
					}
				}
			}
		}
	}
}