﻿story_cycle_pet_rock = {
	#by Nick Meredith
	visible = yes

	icon = {
		trigger = {
			always = yes
		}
		reference = "gfx/interface/icons/artifact/artifact_rock.dds"
	}
	
	visualization = {
		custom_string_key = "PET_ROCK_INFORMATION_STRING"
		modifiers = {
			rock_story_modifier
			#Unop: All modifiers below were missing
			sated_stone_modifier
			lost_rock_modifier
			rock_dopey_modifier
			bp2_bed_rock_modifier
			bp2_sore_thumb_modifier
			bp2_valued_friendship_modifier
		}
	}

	on_setup = {
		assign_rock_gender_effect = { GENDER = random }
		assign_rock_color_effect = { COLOR = random }

		story_owner = {
			add_character_modifier = {
				modifier = rock_story_modifier
			}
		}
		if = {
			limit = {
				story_owner = {
					NOT = { has_character_flag = is_naming_rock }
				}
				NOT = { exists = story_owner.var:story_cycle_rock_name }
			}
			story_owner = {
				add_character_flag = is_naming_rock
				trigger_event = {
					id = pet_rock.0002
					days = 2
				}
			}
		}
	}

	on_end = {
		story_owner = {
			remove_rock_story_modifiers_effect = yes
			remove_rock_name_effect = yes
		}
	}

	on_owner_death = {
		scope:story = { end_story = yes }
	}

	# Something happens - random events
	effect_group = {
		days = { 700 1000 }
		chance = 25

		trigger = {
			exists = story_owner.var:story_cycle_rock_name
		}

		first_valid = {
			triggered_effect = {
				trigger = { always = yes }
				effect = {
					story_owner = {
						trigger_event = {
							on_action = ongoing_rock_events
						}
					}
				}
			}
		}
	}
}