

# ####################
#  Critter Utilities - All
# ####################


# Auto-Repair / Hull Regeneration

utility_component_template = {
	key = "B_REPAIR1"
	size = small
	icon = "GFX_ship_part_auto_repair"
	icon_frame = 1
	power = 0
	cost = 30
	modifier = {
		ship_hull_regen_add_static = 1.00 # Regenerates 10% ship-health per month
	}
	prerequisites = {  }
	component_set = "REPAIR"
	military_power = 1
	should_ai_use = no

}

utility_component_template = {
	key = "B_REPAIR2"
	size = aux
	icon = "GFX_ship_part_auto_repair"
	icon_frame = 1
	power = 0
	cost = 40

	modifier = {
		ship_hull_regen_add_static = 2.00 # Regenerates 20% ship-health per month
	}
	
	prerequisites = {  }
	component_set = "REPAIR"
	military_power = 1
	should_ai_use = no

}

utility_component_template = {
	key = "B_REPAIR3"
	size = large
	icon = "GFX_ship_part_auto_repair"
	icon_frame = 1
	power = 0
	cost = 50

	modifier = {
		ship_hull_regen_add_static = 4.00 # Regenerates 40% ship-health per month
	}
	
	prerequisites = {  }
	component_set = "REPAIR"
	military_power = 1
	should_ai_use = no

}

utility_component_template = {
	key = "ENIGMATIC_DECODER1"
	size = aux
	icon = "GFX_ship_part_enigmatic_decoder"
	icon_frame = 1
	power = -20
	cost = 20
        prerequisites = { }
	component_set = "ENIGMATIC_DECODER1"

	ship_modifier = {
		ship_tracking_add = 30
		ship_accuracy_add = 30
	}
	
	ai_weight = {
		weight = 10
		modifier = {
			factor = 2
			has_country_flag = ai_flag_aggressive_personality
		}
	}
}

utility_component_template = {
	key = "ENIGMATIC_ENCODER1"
	size = aux
	icon = "GFX_ship_part_enigmatic_encoder"
	icon_frame = 1
	power = -20
	cost = 20
        prerequisites = { }
	component_set = "ENIGMATIC_ENCODER1"

	ship_modifier = {
		ship_evasion_add = 30
	}
	
	ai_weight = {
		weight = 10
		modifier = {
			factor = 2
			has_country_flag = ai_flag_aggressive_personality
		}
	}
}
#########
# DRIVE #
#########

### N drive
utility_component_template = {
	key = "B_DRIVE"
	size = small
	icon = "GFX_ship_part_psi_jump_drive_1"
	icon_frame = 1
	power = -40
	cost = 20
	ftl = yes
	jumpdrive = yes
	
	ai_weight = {
		weight = 0
	}
	
	ship_modifier = {
		ship_ftl_jumpdrive_range_mult = 1
		ship_windup_mult = -1.0
		ship_winddown_mult = -1.0
	}

	class_restriction = { shipclass_military shipclass_military_special shipclass_constructor shipclass_colonizer shipclass_science_ship shipclass_transport }
	prerequisites = {  }
	is_reverse_engineerable = no
	component_set = "ftl_components"
}
############
# THRUSTER #
############

utility_component_template = {
	key = "B_PULSE_THRUSTER"
	size = small
	icon = "GFX_ship_part_thruster_4"
	icon_frame = 1
	power = -40
	cost = 25
	modifier = {
		ship_speed_mult = 1.20
		ship_combat_speed_mult = 1.20
		ship_evasion_add = 40
	}

	prerequisites = {  }
	is_reverse_engineerable = no
	component_set = "thruster_components"
	
	ai_weight = {
		weight = 0
	}
	should_ai_use = no	
}
######################
# 'ARTILLERY' COMPUTERS #
######################
utility_component_template = {
	key = "B_COMBAT_COMPUTER_ARTILLERY_PRECOG"
	size = small
	icon = "GFX_ship_part_computer_artillery_sapient"
	icon_frame = 1
	power = 60
	cost = 60
	class_restriction = { shipclass_military }
	component_set = "combat_computers"
	ship_behavior = "artillery"
	prerequisites = {  }

	ship_modifier = {
		ship_fire_rate_mult = 0.45
		ship_weapon_range_mult = 0.45
		ship_tracking_add = 30
	}
	
	ai_weight = {
		weight = 0
	}	
}
utility_component_template = {
	key = "B2_COMBAT_COMPUTER_ARTILLERY_PRECOG"
	size = small
	icon = "GFX_ship_part_computer_artillery_sapient"
	icon_frame = 1
	power = 100
	cost = 100
	class_restriction = { shipclass_military }
	component_set = "combat_computers"
	ship_behavior = "artillery"
	prerequisites = {  }

	ship_modifier = {
		ship_fire_rate_mult = 0.9
		ship_weapon_range_mult = 0.9
		ship_tracking_add = 60
	}
	
	ai_weight = {
		weight = 0
	}	
}
########################
# Zero-Point Reactors
########################
utility_component_template = {
	key = "B_ZERO_POINT_REACTOR"
	size = small
	icon = "GFX_ship_part_reactor_5"
	icon_frame = 1
	power = 4200
	cost = 22
	
	prerequisites = {  }
	component_set = "power_core"
	
	ai_weight = {
		weight = 0
	}
}
utility_component_template = {
	key = "B2_ZERO_POINT_REACTOR"
	size = small
	icon = "GFX_ship_part_dark_matter_power_core"
	icon_frame = 1
	power = 8400
	cost = 40
	
	prerequisites = {  }
	component_set = "power_core"
	
	ai_weight = {
		weight = 0
	}
}
###########
# SENSOR  #
###########
utility_component_template = {
	key = "B_SENSOR"
	size = medium
	icon = "GFX_ship_part_sensor_4"
	icon_frame = 1
	power = -25
	cost = 10
	sensor_range = 7
	
	ship_modifier = {
		ship_tracking_add = 20
	}
	
	prerequisites = {  }
	component_set = "sensor_components"
	
	ai_weight = {
		weight = 1000
	}	
}
# #################
#  Reworked Auras
# #################

#Offensive
utility_component_template = {
	key = "B_SHIP_AURA_SHIELD_DAMPENER"
	size = medium
	icon = "GFX_ship_part_aura_shield_dampener"
	icon_frame = 1
	power = 0
	cost = 0
	
	prerequisites = {  }
	component_set = "ship_aura_components"
	
	hostile_aura = {
		name = "aura_shield_dampener"
		radius = @shipAuraRange
		apply_on = ships
		
		stack_info = {			#A ship can only be affected by one aura of a certain id. If multiple auras have the same ID the one with the highest priority will be applied.
			id = hostile_shield_dampener
			priority = 1
		}
		
		modifier = {
			ship_shield_mult = -0.60
		}
		
		graphics = {
			area_effect = {
				entity = "circle_area_entity"
				dynamic_scale = yes
			}
			ship_effect = {
				entity = "ship_aura_negative_entity"
				dynamic_scale = no
			}
		}
	}
	
	ai_weight = {
		weight = 0
		modifier = {
			factor = 2
			is_ai = yes
			is_preferred_weapons = weapon_type_energy
		}
	}
}

utility_component_template = {
	key = "B_SHIP_AURA_QUANTUM_DESTABILIZER"
	size = medium
	icon = "GFX_ship_part_aura_quantum_destabilizer"
	icon_frame = 1
	power = 0
	cost = 0
	
	prerequisites = {  }
	component_set = "ship_aura_components"
	
	hostile_aura = {
		name = "aura_quantum_destabilizer"
		radius = @shipAuraRange
		apply_on = ships
		
		stack_info = {			#A ship can only be affected by one aura of a certain id. If multiple auras have the same ID the one with the highest priority will be applied.
			id = hostile_quantum_destabilizer
			priority = 10
		}
		
		modifier = {
			ship_fire_rate_mult = -0.50
		}
		
		graphics = {
			area_effect = {
				entity = "circle_area_entity"
				dynamic_scale = yes
			}
			ship_effect = {
				entity = "ship_aura_negative_entity" 
				dynamic_scale = no
			}
		}
	}
	
	ai_weight = {
		weight = 0
	}
}

utility_component_template = {
	key = "B_SHIP_AURA_SUBSPACE_SNARE"
	size = medium
	icon = "GFX_ship_part_aura_snare"
	icon_frame = 1
	power = 0
	cost = 0
	
	prerequisites = {  }
	component_set = "ship_aura_components"
	
	hostile_aura = {
		name = "aura_ship_subspace_snare"
		radius = @shipAuraRange
		apply_on = fleets
		
		stack_info = {			#A ship can only be affected by one aura of a certain id. If multiple auras have the same ID the one with the highest priority will be applied.
			id = hostile_snare_aura
			priority = 1
		}
		
		modifier = {
			ship_emergency_ftl_min_days_mult = 5
			ship_disengage_chance_mult = -0.60
		}
		
		graphics = {
			area_effect = {
				entity = "circle_area_entity"
				dynamic_scale = yes
			}
			ship_effect = {
				entity = "ship_aura_negative_entity"   
				dynamic_scale = no
			}
		}
	}
	
	ai_weight = {
		weight = 0
	}
}

#Defensive
utility_component_template = {
	key = "B_SHIP_AURA_INSPIRING_PRESENCE"
	size = medium
	icon = "GFX_ship_part_aura_nanobot"
	icon_frame = 1
	power = 0
	cost = 0
	
	prerequisites = {  }
	component_set = "ship_aura_components"
	
	friendly_aura = {
		name = "aura_inspiring_presence"
		radius = @shipAuraRange
		apply_on = ships
		
		stack_info = {			#A ship can only be affected by one aura of a certain id. If multiple auras have the same ID the one with the highest priority will be applied.
			id = friendly_inspiring_presence
			priority = 20
		}
		
		modifier = {
			ship_fire_rate_mult = 0.5
		}
		
		graphics = {
			area_effect = {
				entity = "circle_area_entity"
				dynamic_scale = yes
			}
			ship_effect = {
				entity = "ship_aura_positive_entity"
				dynamic_scale = no
			}
		}
	}
	
	ai_weight = {
		weight = 0
	}
}

utility_component_template = {
	key = "B_SHIP_AURA_TARGETING_GRID"
	size = medium
	icon = "GFX_ship_part_aura_nanobot"
	icon_frame = 1
	power = 0
	cost = 0
	
	prerequisites = {  }
	component_set = "ship_aura_components"
	
	friendly_aura = {
		name = "aura_targeting_grid"
		radius = @shipAuraRange
		apply_on = ships
		
		stack_info = {			#A ship can only be affected by one aura of a certain id. If multiple auras have the same ID the one with the highest priority will be applied.
			id = friendly_targeting_grid
			priority = 20
		}
		
		modifier = {
			ship_tracking_add = 50
		}
		
		graphics = {
			area_effect = {
				entity = "circle_area_entity"
				dynamic_scale = yes
			}
			ship_effect = {
				entity = "ship_aura_positive_entity"
				dynamic_scale = no
			}
		}
	}
	
	ai_weight = {
		weight = 0
		modifier = {
			factor = 2.0
			is_ai = yes
			is_preferred_weapons = weapon_type_kinetic
		}
	}
}

utility_component_template = {
	key = "B_SHIP_AURA_NANOBOT_CLOUD"
	size = medium
	icon = "GFX_ship_part_aura_nanobot"
	icon_frame = 1
	power = 0
	cost = 0
	
	prerequisites = {  }
	component_set = "ship_aura_components"
	
	friendly_aura = {
		name = "aura_nanobot_cloud"
		radius = @shipAuraRange
		apply_on = ships
		
		stack_info = {			#A ship can only be affected by one aura of a certain id. If multiple auras have the same ID the one with the highest priority will be applied.
			id = friendly_nanobot_cloud
			priority = 20
		}
		
		modifier = {
			ship_hull_regen_add_static = 10
			ship_armor_regen_add_static = 30
		}
		
		graphics = {
			area_effect = {
				entity = "circle_area_entity"
				dynamic_scale = yes
			}
			ship_effect = {
				entity = "ship_aura_positive_entity"
				dynamic_scale = no
			}
		}
	}
	
	ai_weight = {
		weight = 0
	}
}

# #################
#  Hostile Auras
# #################

utility_component_template = {
	key = "B_STATION_MEDIUM_AURA_SHIELD_DAMPENER"
	size = medium
	icon = "GFX_ship_part_aura_shield_dampener"
	icon_frame = 1
	power = 0
	cost = 0
	hidden = yes

	prerequisites = {  }	
	component_set = "station_medium_aura_components"
	
	hostile_aura = {
		name = "aura_shield_dampener"
		radius = @stationMediumAuraRange
		apply_on = ships
		
		stack_info = {			#A ship can only be affected by one aura of a certain id. If multiple auras have the same ID the one with the highest priority will be applied.
			id = hostile_inhibitor_aura
			priority = 1
		}
		
		modifier = {
			ship_shield_mult = -1.25
			ship_shield_regen_add_perc = -0.25
		}
		
		graphics = {
			area_effect = {
				entity = "circle_area_entity"
				dynamic_scale = yes
			}
			ship_effect = {
				entity = "ship_aura_negative_entity"
				dynamic_scale = no
			}
		}
	}
	
	ai_weight = {
		weight = 0
	}
}