tf_events.txt 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. namespace = tf_events
  2. pop_event = {
  3. id = tf_events.1
  4. hide_window = yes
  5. trigger = {
  6. pop_has_trait = trait_tf_viral_morph
  7. }
  8. mean_time_to_happen = {
  9. months = 12
  10. # Slaves have limited freedom of movement.
  11. modifier = {
  12. factor = 4
  13. has_citizenship_type = { type = citizenship_slavery }
  14. }
  15. # Assume that Pops that are being purged are isolated from the general
  16. # population.
  17. # Balance-wise, the idea is that purging is a valid strategy to get
  18. # rid of viral morphers, for those empires that find it ethically
  19. # acceptable. In particular it is overpowered if infecting an AI that
  20. # purges the morpher's species means the entire planet will end up
  21. # depopulated.
  22. # I haven't yet figured out what the infection rate should be to
  23. # make purging viable. At 120 months, you sometimes see a pop change,
  24. # but it's so rare that even large amounts of morphers can be purged
  25. # without ever risking losing much of the population.
  26. # TODO: There seems to be individual purging of Pops.
  27. # Does that still exist in 2.2 or is it leftover code?
  28. modifier = {
  29. factor = 10
  30. has_citizenship_type = { type = citizenship_purge }
  31. }
  32. }
  33. immediate = {
  34. species = {
  35. save_global_event_target_as = tf_viral_morphed_species
  36. }
  37. planet = {
  38. random_pop = {
  39. pop_event = { id = tf_events.2 }
  40. }
  41. }
  42. }
  43. }
  44. # TODO: Chance of transforming leaders.
  45. # TODO: Chance of transforming non-sapients?
  46. # TODO: Add purge type for transforming?
  47. pop_event = {
  48. id = tf_events.2
  49. hide_window = yes
  50. is_triggered_only = yes
  51. trigger = {
  52. species {
  53. # Can't transform if Pop is already of the target species.
  54. NOT = { is_same_species = event_target:tf_viral_morphed_species }
  55. }
  56. # Only organic species can transform.
  57. is_organic_species = yes
  58. owner = {
  59. # Don't infect sleeping fallen empires: weird things happen
  60. # in their jobs tab if they change species.
  61. NOT = { is_country_type = fallen_empire }
  62. }
  63. }
  64. immediate = {
  65. create_message = {
  66. hide_window = yes
  67. type = MESSAGE_TYPE_POP_VIRAL_MORPHED
  68. localization = MESSAGE_POP_VIRAL_MORPHED
  69. days = 30
  70. target = root
  71. variable = {
  72. type = name
  73. localization = SPECIES
  74. scope = root.species
  75. }
  76. variable = {
  77. type = name
  78. localization = MORPHER_SPECIES
  79. scope = event_target:tf_viral_morphed_species
  80. }
  81. variable = {
  82. type = name
  83. localization = PLANET
  84. scope = root.planet
  85. }
  86. }
  87. change_species = event_target:tf_viral_morphed_species
  88. # Avoid stacking the shock modifiers.
  89. remove_transformation_shock = yes
  90. # TODO: Should the duration and the modifier depend on ethics?
  91. add_modifier = {
  92. modifier = tf_changed_species_shock
  93. years = 5
  94. }
  95. }
  96. }
  97. # Make occupying armies also infect the population.
  98. planet_event = {
  99. id = tf_events.3
  100. hide_window = yes
  101. trigger = {
  102. is_occupied_flag = yes
  103. controller = {
  104. has_trait = trait_tf_viral_morph
  105. }
  106. }
  107. mean_time_to_happen = {
  108. months = 12
  109. }
  110. immediate = {
  111. controller = {
  112. owner_species = {
  113. save_global_event_target_as = tf_viral_morphed_species
  114. }
  115. }
  116. planet = {
  117. random_pop = {
  118. pop_event = { id = tf_events.2 }
  119. }
  120. }
  121. }
  122. }