123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- namespace = tf_events
- pop_event = {
- id = tf_events.1
- hide_window = yes
- trigger = {
- pop_has_trait = trait_tf_viral_morph
- }
- mean_time_to_happen = {
- months = 12
- # Slaves have limited freedom of movement.
- modifier = {
- factor = 4
- has_citizenship_type = { type = citizenship_slavery }
- }
- # Assume that Pops that are being purged are isolated from the general
- # population.
- # Balance-wise, the idea is that purging is a valid strategy to get
- # rid of viral morphers, for those empires that find it ethically
- # acceptable. In particular it is overpowered if infecting an AI that
- # purges the morpher's species means the entire planet will end up
- # depopulated.
- # I haven't yet figured out what the infection rate should be to
- # make purging viable. At 120 months, you sometimes see a pop change,
- # but it's so rare that even large amounts of morphers can be purged
- # without ever risking losing much of the population.
- # TODO: There seems to be individual purging of Pops.
- # Does that still exist in 2.2 or is it leftover code?
- modifier = {
- factor = 10
- has_citizenship_type = { type = citizenship_purge }
- }
- }
- immediate = {
- species = {
- save_global_event_target_as = tf_viral_morphed_species
- }
- planet = {
- random_pop = {
- pop_event = { id = tf_events.2 }
- }
- }
- }
- }
- # TODO: Chance of transforming leaders.
- # TODO: Chance of transforming non-sapients?
- # TODO: Add purge type for transforming?
- pop_event = {
- id = tf_events.2
- hide_window = yes
- is_triggered_only = yes
- trigger = {
- species {
- # Can't transform if Pop is already of the target species.
- NOT = { is_same_species = event_target:tf_viral_morphed_species }
- }
- # Only organic species can transform.
- is_organic_species = yes
- owner = {
- # Don't infect sleeping fallen empires: weird things happen
- # in their jobs tab if they change species.
- NOT = { is_country_type = fallen_empire }
- }
- }
- immediate = {
- create_message = {
- hide_window = yes
- type = MESSAGE_TYPE_POP_VIRAL_MORPHED
- localization = MESSAGE_POP_VIRAL_MORPHED
- days = 30
- target = root
- variable = {
- type = name
- localization = SPECIES
- scope = root.species
- }
- variable = {
- type = name
- localization = MORPHER_SPECIES
- scope = event_target:tf_viral_morphed_species
- }
- variable = {
- type = name
- localization = PLANET
- scope = root.planet
- }
- }
- change_species = event_target:tf_viral_morphed_species
- # Avoid stacking the shock modifiers.
- remove_transformation_shock = yes
- # TODO: Should the duration and the modifier depend on ethics?
- add_modifier = {
- modifier = tf_changed_species_shock
- years = 5
- }
- }
- }
- # Make occupying armies also infect the population.
- planet_event = {
- id = tf_events.3
- hide_window = yes
- trigger = {
- is_occupied_flag = yes
- controller = {
- has_trait = trait_tf_viral_morph
- }
- }
- mean_time_to_happen = {
- months = 12
- }
- immediate = {
- controller = {
- owner_species = {
- save_global_event_target_as = tf_viral_morphed_species
- }
- }
- planet = {
- random_pop = {
- pop_event = { id = tf_events.2 }
- }
- }
- }
- }
|