﻿namespace = orgy_main_blob

############################
# The Blob
# by Ban10
############################

# Bobbily the Blob
# Spell goes wrong, blob goes out of control
# Defeat it to get Bobbily the Blob, an artifact

####
# Weight and Setup Event
####
orgy_main_blob.0001 = {
	type = activity_event
	hidden = yes

	trigger = {
		# Make sure this wasn't triggered last time
		trigger_if = {
			limit = { scope:activity.activity_host = { has_variable = last_orgy_was } }
			NOT = { scope:activity.activity_host.var:last_orgy_was = flag:blob }
		}
	}

	immediate = {
		scope:activity = {
			activity_host = {
				# Set this as last main orgy activity
				set_variable = {
					name = last_orgy_was
					value = flag:blob
				}
				trigger_event = orgy_main_blob.0002
			}
		}
	}
}

###
# Event for Host (Magister)
###
orgy_main_blob.0002 = {
	type = activity_event
	title = orgy_main_blob.0002.t
	desc = {
		desc = orgy_main_blob.0002.intro
		triggered_desc = {
			trigger = {
				exists = scope:important_victim
			}
			desc = orgy_main_blob.0002.important_victim
		}
		triggered_desc = {
			trigger = {
				exists = scope:victim_1
			}
			desc = orgy_main_blob.0002.victim_1
		}
		triggered_desc = {
			trigger = {
				exists = scope:victim_2
			}
			desc = orgy_main_blob.0002.victim_2
		}
		triggered_desc = {
			trigger = {
				exists = scope:knight
			}
			desc = orgy_main_blob.0002.knight_response
		}
		triggered_desc = {
			trigger = {
				NOT = { exists = scope:knight }
			}
			desc = orgy_main_blob.0002.no_knight_response
		}
	}
	theme = regula_orgy_theme

	left_portrait = {
		character = root
		animation = disbelief
	}

	right_portrait = {
		character = scope:knight
		animation = aggressive_sword
	}

	lower_left_portrait = {
		character = scope:important_victim
	}

	lower_center_portrait = {
		character = scope:victim_1
	}

	lower_right_portrait = {
		character = scope:victim_2
	}

	immediate = {
		# Oh noes, blob on the loose!
		play_music_cue = "mx_cue_stress"
		hidden_effect = {
			# Find attending guests
			scope:activity = {
				# First victim is an important spouse (Domina/Paelex)
				random_attending_character = {
					limit = {
						is_regula_leader_devoted_trigger = yes
					}
					save_scope_as = important_victim
				}
				# Second character is one of your knights knight that charges in to help
				random_attending_character = {
					limit = {
						is_knight_of = root
					}
					save_scope_as = knight
				}

				# Then two random random female attendes
				# Just flavour victims
				random_attending_character = {
					limit = {
						is_female = yes
						NOT = {
							this = scope:important_victim
							this = scope:knight
						}
					}
					save_scope_as = victim_1
				}

				random_attending_character = {
					limit = {
						is_female = yes
						NOT = {
							this = scope:important_victim
							this = scope:knight
							this = scope:victim_1
						}
					}
					save_scope_as = victim_2
				}
			}
		}
	}

	# Use your Learning (Magic) to deal with the blob
	# Best case scenario, on sucess gives you blob artifact
	option = {
		name = orgy_main_blob.0002.a
		flavor = orgy_main_blob.0002.a.tt

		duel = {
			skill = learning
			value = decent_skill_rating
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				trigger_event = orgy_main_blob.1001
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				trigger_event = orgy_main_blob.1002
			}
		}
	}

	# Use your Prowess to fight the blobl
	# Can wound you but also gives blob artifact
	option = {
		name = orgy_main_blob.0002.b
		flavor = orgy_main_blob.0002.b.tt

		duel = {
			skill = prowess
			value = decent_skill_rating
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				trigger_event = orgy_main_blob.2001
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				trigger_event = orgy_main_blob.2002
			}
		}
	}

	# Attempt to lead your guards against it
	# Use Martial skill
	option = {
		name = orgy_main_blob.0002.c
		flavor = orgy_main_blob.0002.c.tt

		duel = {
			skill = martial
			value = medium_skill_rating
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				trigger_event = orgy_main_blob.3001
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				trigger_event = orgy_main_blob.3002
			}
		}
	}

	# Reason with the blob
	# Diplomacy
	option = {
		name = orgy_main_blob.0002.d
		flavor = orgy_main_blob.0002.d.tt

		duel = {
			skill = diplomacy
			value = high_skill_rating
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				trigger_event = orgy_main_blob.4001
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				trigger_event = orgy_main_blob.4002
			}
		}
	}

	# Leave and just let the guards "handle" it
	# Lame, but avoid all chance of injury
	option = {
		name = orgy_main_blob.0002.e
		flavor = orgy_main_blob.0002.e.tt
		trigger_event = orgy_main_blob.5001
	}
}

###########################
# Use Magic
# Victory!
orgy_main_blob.1001 = {
	type = activity_event
	title = orgy_main_blob.1001.t
	desc = orgy_main_blob.1001.desc
	theme = regula_orgy_theme
	override_background = {
		reference = regula_bedchamber
	}

	left_portrait = {
		character = root
		animation = personality_content
	}

	after = {
		hidden_effect = {
 			scope:activity = {
				add_activity_log_entry = {
					key = regula_orgy_offering_log
					tags = { good }
					score = 25
					character = root
					target = scope:offering
				}
			}
		}
	}

	option = {
		name = orgy_main_blob.1001.a
	}
}

# Wounded
orgy_main_blob.1002 = {
	type = activity_event
	title = orgy_main_blob.1002.t
	desc = orgy_main_blob.1002.desc
	theme = regula_orgy_theme
	override_background = {
		reference = regula_bedchamber
	}

	left_portrait = {
		character = root
		animation = personality_content
	}

	after = {
		hidden_effect = {
 			scope:activity = {
				add_activity_log_entry = {
					key = regula_orgy_offering_log
					tags = { good }
					score = 25
					character = root
					target = scope:offering
				}
			}
		}
	}

	option = {
		name = orgy_main_blob.1002.a
		regula_sex_with_target_normal = { TARGET = scope:offering }
		add_courtier = scope:offering
		scope:offering = {
			add_to_activity = scope:activity
		}
	}
}

###########################
# Use Prowess
# Victory!
orgy_main_blob.2001 = {
	type = activity_event
	title = orgy_main_blob.2001.t
	desc = orgy_main_blob.2001.desc
	theme = regula_orgy_theme
	override_background = {
		reference = regula_bedchamber
	}

	left_portrait = {
		character = root
		animation = personality_content
	}

	after = {
		hidden_effect = {
 			scope:activity = {
				add_activity_log_entry = {
					key = regula_orgy_offering_log
					tags = { good }
					score = 25
					character = root
					target = scope:offering
				}
			}
		}
	}

	option = {
		name = orgy_main_blob.2001.a
		regula_sex_with_target_normal = { TARGET = scope:offering }
		add_courtier = scope:offering
		scope:offering = {
			add_to_activity = scope:activity
		}
	}
}

# Wounded
orgy_main_blob.2002 = {
	type = activity_event
	title = orgy_main_blob.2002.t
	desc = orgy_main_blob.2002.desc
	theme = regula_orgy_theme
	override_background = {
		reference = regula_bedchamber
	}

	left_portrait = {
		character = root
		animation = personality_content
	}

	after = {
		hidden_effect = {
 			scope:activity = {
				add_activity_log_entry = {
					key = regula_orgy_offering_log
					tags = { good }
					score = 25
					character = root
					target = scope:offering
				}
			}
		}
	}

	option = {
		name = orgy_main_blob.2002.a
		regula_sex_with_target_normal = { TARGET = scope:offering }
		add_courtier = scope:offering
		scope:offering = {
			add_to_activity = scope:activity
		}
	}
}

###########################
# Use Martial
# Victory!
orgy_main_blob.3001 = {
	type = activity_event
	title = orgy_main_blob.3001.t
	desc = orgy_main_blob.3001.desc
	theme = regula_orgy_theme
	override_background = {
		reference = regula_bedchamber
	}

	left_portrait = {
		character = root
		animation = personality_content
	}

	after = {
		hidden_effect = {
 			scope:activity = {
				add_activity_log_entry = {
					key = regula_orgy_offering_log
					tags = { good }
					score = 25
					character = root
					target = scope:offering
				}
			}
		}
	}

	option = {
		name = orgy_main_blob.3001.a
		regula_sex_with_target_normal = { TARGET = scope:offering }
		add_courtier = scope:offering
		scope:offering = {
			add_to_activity = scope:activity
		}
	}
}

# Wounded
orgy_main_blob.3002 = {
	type = activity_event
	title = orgy_main_blob.3002.t
	desc = orgy_main_blob.3002.desc
	theme = regula_orgy_theme
	override_background = {
		reference = regula_bedchamber
	}

	left_portrait = {
		character = root
		animation = personality_content
	}

	after = {
		hidden_effect = {
 			scope:activity = {
				add_activity_log_entry = {
					key = regula_orgy_offering_log
					tags = { good }
					score = 25
					character = root
					target = scope:offering
				}
			}
		}
	}

	option = {
		name = orgy_main_blob.3002.a
		regula_sex_with_target_normal = { TARGET = scope:offering }
		add_courtier = scope:offering
		scope:offering = {
			add_to_activity = scope:activity
		}
	}
}

###########################
# Use Diplomacy
# Victory!
orgy_main_blob.4001 = {
	type = activity_event
	title = orgy_main_blob.4001.t
	desc = orgy_main_blob.4001.desc
	theme = regula_orgy_theme
	override_background = {
		reference = regula_bedchamber
	}

	left_portrait = {
		character = root
		animation = personality_content
	}

	after = {
		hidden_effect = {
 			scope:activity = {
				add_activity_log_entry = {
					key = regula_orgy_offering_log
					tags = { good }
					score = 25
					character = root
					target = scope:offering
				}
			}
		}
	}

	option = {
		name = orgy_main_blob.4001.a
		regula_sex_with_target_normal = { TARGET = scope:offering }
		add_courtier = scope:offering
		scope:offering = {
			add_to_activity = scope:activity
		}
	}
}

# Wounded
orgy_main_blob.4002 = {
	type = activity_event
	title = orgy_main_blob.4002.t
	desc = orgy_main_blob.4002.desc
	theme = regula_orgy_theme
	override_background = {
		reference = regula_bedchamber
	}

	left_portrait = {
		character = root
		animation = personality_content
	}

	after = {
		hidden_effect = {
 			scope:activity = {
				add_activity_log_entry = {
					key = regula_orgy_offering_log
					tags = { good }
					score = 25
					character = root
					target = scope:offering
				}
			}
		}
	}

	option = {
		name = orgy_main_blob.4002.a
		regula_sex_with_target_normal = { TARGET = scope:offering }
		add_courtier = scope:offering
		scope:offering = {
			add_to_activity = scope:activity
		}
	}
}

###########################
# Slip out the door
orgy_main_blob.5001 = {
	type = activity_event
	title = orgy_main_blob.5001.t
	desc = orgy_main_blob.5001.desc
	theme = regula_orgy_theme
	override_background = {
		reference = council_chamber
	}

	left_portrait = {
		character = root
		animation = worry
	}

	after = {
		hidden_effect = {
 			scope:activity = {
				add_activity_log_entry = {
					key = regula_orgy_offering_log
					tags = { bad }
					score = 25
					character = root
				}
			}
		}
	}

	option = {
		name = orgy_main_blob.5001.a
	}
}
