Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.49 KB | None | 0 0
  1. immediate = {
  2. event_target:ehof_megastructure_system = {
  3. random_system_megastructure = {
  4. #########################################
  5. ############### First Dice ##############
  6. #########################################
  7. # Phase 1: D10
  8. if = {
  9. limit = { is_megastructure_type = ehof_megastructure_phase1_firing }
  10. random_list = {
  11. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 1 } } }
  12. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 2 } } }
  13. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 3 } } }
  14. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 4 } } }
  15. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 5 } } }
  16. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 6 } } }
  17. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 7 } } }
  18. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 8 } } }
  19. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 9 } } }
  20. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 10 } } }
  21. }
  22. }
  23. # Phase 2: D12
  24. else_if = {
  25. limit = { is_megastructure_type = ehof_megastructure_phase2_firing }
  26. random_list = {
  27. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 1 } } }
  28. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 2 } } }
  29. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 3 } } }
  30. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 4 } } }
  31. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 5 } } }
  32. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 6 } } }
  33. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 7 } } }
  34. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 8 } } }
  35. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 9 } } }
  36. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 10 } } }
  37. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 11 } } }
  38. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 12 } } }
  39. }
  40. }
  41. # Phase 3: D20
  42. else_if = {
  43. limit = { is_megastructure_type = ehof_megastructure_phase3_firing }
  44. random_list = {
  45. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 1 } } }
  46. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 2 } } }
  47. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 3 } } }
  48. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 4 } } }
  49. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 5 } } }
  50. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 6 } } }
  51. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 7 } } }
  52. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 8 } } }
  53. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 9 } } }
  54. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 10 } } }
  55. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 11 } } }
  56. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 12 } } }
  57. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 13 } } }
  58. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 14 } } }
  59. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 15 } } }
  60. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 16 } } }
  61. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 17 } } }
  62. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 18 } } }
  63. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 19 } } }
  64. 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 20 } } }
  65. }
  66. }
  67.  
  68. #########################################
  69. ############## Second Dice ##############
  70. #########################################
  71. # D12
  72. random_list = {
  73. 1 = { ROOT = { set_variable = { which = ehof_acc_r2 value = 1 } } }
  74. 1 = { ROOT = { set_variable = { which = ehof_acc_r2 value = 2 } } }
  75. 1 = { ROOT = { set_variable = { which = ehof_acc_r2 value = 3 } } }
  76. 1 = { ROOT = { set_variable = { which = ehof_acc_r2 value = 4 } } }
  77. 1 = { ROOT = { set_variable = { which = ehof_acc_r2 value = 5 } } }
  78. 1 = { ROOT = { set_variable = { which = ehof_acc_r2 value = 6 } } }
  79. 1 = { ROOT = { set_variable = { which = ehof_acc_r2 value = 7 } } }
  80. 1 = { ROOT = { set_variable = { which = ehof_acc_r2 value = 8 } } }
  81. 1 = { ROOT = { set_variable = { which = ehof_acc_r2 value = 9 } } }
  82. 1 = { ROOT = { set_variable = { which = ehof_acc_r2 value = 10 } } }
  83. 1 = { ROOT = { set_variable = { which = ehof_acc_r2 value = 11 } } }
  84. 1 = { ROOT = { set_variable = { which = ehof_acc_r2 value = 12 } } }
  85. }
  86.  
  87. # Set target system modifier
  88. # Phase 1-3
  89. if = { limit = { is_megastructure_type = ehof_megastructure_phase1_firing has_megastructure_flag = ehof_target_black_hole } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = 1 } } }
  90. else_if = { limit = { is_megastructure_type = ehof_megastructure_phase2_firing has_megastructure_flag = ehof_target_black_hole } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = 1 } } }
  91. else_if = { limit = { is_megastructure_type = ehof_megastructure_phase3_firing has_megastructure_flag = ehof_target_black_hole } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = 2 } } }
  92. else_if = { limit = { is_megastructure_type = ehof_megastructure_phase1_firing has_megastructure_flag = ehof_target_neutron } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = 1 } } }
  93. else_if = { limit = { is_megastructure_type = ehof_megastructure_phase2_firing has_megastructure_flag = ehof_target_neutron } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = 1 } } }
  94. else_if = { limit = { is_megastructure_type = ehof_megastructure_phase3_firing has_megastructure_flag = ehof_target_neutron } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = 2 } } }
  95. else_if = { limit = { is_megastructure_type = ehof_megastructure_phase1_firing has_megastructure_flag = ehof_target_pulsar } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = 1 } } }
  96. else_if = { limit = { is_megastructure_type = ehof_megastructure_phase2_firing has_megastructure_flag = ehof_target_pulsar } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = 1 } } }
  97. else_if = { limit = { is_megastructure_type = ehof_megastructure_phase3_firing has_megastructure_flag = ehof_target_pulsar } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = 2 } } }
  98. else_if = { limit = { is_megastructure_type = ehof_megastructure_phase1_firing has_megastructure_flag = ehof_target_wormhole_cohesive } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = 2 } } }
  99. else_if = { limit = { is_megastructure_type = ehof_megastructure_phase2_firing has_megastructure_flag = ehof_target_wormhole_cohesive } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = 2 } } }
  100. else_if = { limit = { is_megastructure_type = ehof_megastructure_phase3_firing has_megastructure_flag = ehof_target_wormhole_cohesive } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = 3 } } }
  101. # Phase 2-3
  102. else_if = { limit = { is_megastructure_type = ehof_megastructure_phase2_firing has_megastructure_flag = ehof_target_binary } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = 0 } } }
  103. else_if = { limit = { is_megastructure_type = ehof_megastructure_phase3_firing has_megastructure_flag = ehof_target_binary } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = 1 } } }
  104. else_if = { limit = { is_megastructure_type = ehof_megastructure_phase2_firing has_megastructure_flag = ehof_target_trinary } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = 0 } } }
  105. else_if = { limit = { is_megastructure_type = ehof_megastructure_phase3_firing has_megastructure_flag = ehof_target_trinary } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = 1 } } }
  106. else_if = { limit = { is_megastructure_type = ehof_megastructure_phase2_firing has_megastructure_flag = ehof_target_red_giant } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = -1 } } }
  107. else_if = { limit = { is_megastructure_type = ehof_megastructure_phase3_firing has_megastructure_flag = ehof_target_red_giant } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = 1 } } }
  108. # Phase 3 only
  109. else_if = { limit = { is_megastructure_type = ehof_megastructure_phase3_firing has_megastructure_flag = ehof_target_white_blue } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = 0 } } }
  110. else_if = { limit = { is_megastructure_type = ehof_megastructure_phase3_firing has_megastructure_flag = ehof_target_blue } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = 1 } } }
  111. else_if = { limit = { is_megastructure_type = ehof_megastructure_phase3_firing has_megastructure_flag = ehof_target_yellow_white_dwarf } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = -1 } } }
  112. else_if = { limit = { is_megastructure_type = ehof_megastructure_phase3_firing has_megastructure_flag = ehof_target_yellow_dwarf } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = -1 } } }
  113. else_if = { limit = { is_megastructure_type = ehof_megastructure_phase3_firing has_megastructure_flag = ehof_target_orange_dwarf } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = -2 } } }
  114. else_if = { limit = { is_megastructure_type = ehof_megastructure_phase3_firing has_megastructure_flag = ehof_target_red_dwarf } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = 0 } } }
  115. else_if = { limit = { is_megastructure_type = ehof_megastructure_phase3_firing has_megastructure_flag = ehof_target_brown_dwarf } ROOT = { set_variable = { which = ehof_acc_r2_modifier value = -2 } } }
  116. }
  117. }
  118.  
  119. ##################### ??????????????????????????
  120.  
  121. # If the modifier is not 0
  122. if = { limit = { NOT = { check_variable = { which = ehof_acc_r2_modifier value = 0 } } }
  123. set_variable = { which = second_die_counter value = 0 }
  124.  
  125. # If the modifier is greater than 0
  126. if = { limit = { check_variable = { which = ehof_acc_r2_modifier value < 0 } }
  127.  
  128. # Loop until counter is higher than modifier
  129. while = {
  130. limit = { check_variable = { which = second_die_counter value > ehof_acc_r2_modifier } }
  131. random_list = {
  132. 1 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = -1 } } }
  133. 1 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = -2 } } }
  134. 1 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = -3 } } }
  135. 1 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = -4 } } }
  136. 1 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = -5 } } }
  137. 1 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = -6 } } }
  138. }
  139. change_variable = { which = second_die_counter value = -1 }
  140. }
  141. }
  142.  
  143.  
  144. # If the modifier is less than 0
  145. else = {
  146.  
  147. # Loop until counter is higher than modifier
  148. while = {
  149. limit = { check_variable = { which = second_die_counter value < ehof_acc_r2_modifier } }
  150. random_list = {
  151. 1 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = 1 } } }
  152. 1 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = 2 } } }
  153. 1 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = 3 } } }
  154. 1 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = 4 } } }
  155. 1 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = 5 } } }
  156. 1 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = 6 } } }
  157. }
  158. change_variable = { which = second_die_counter value = 1 }
  159. }
  160. }
  161.  
  162.  
  163. change_variable = { which = ehof_acc_r2 value = ehof_rolled_d6 }
  164. }
  165.  
  166. ###########################
  167.  
  168. #########################################
  169. ############### Third Dice ##############
  170. #########################################
  171. # D12
  172.  
  173. random_list = {
  174. 1 = { ROOT = { set_variable = { which = ehof_acc_r3 value = 1 } } }
  175. 1 = { ROOT = { set_variable = { which = ehof_acc_r3 value = 2 } } }
  176. 1 = { ROOT = { set_variable = { which = ehof_acc_r3 value = 3 } } }
  177. 1 = { ROOT = { set_variable = { which = ehof_acc_r3 value = 4 } } }
  178. 1 = { ROOT = { set_variable = { which = ehof_acc_r3 value = 5 } } }
  179. 1 = { ROOT = { set_variable = { which = ehof_acc_r3 value = 6 } } }
  180. 1 = { ROOT = { set_variable = { which = ehof_acc_r3 value = 7 } } }
  181. 1 = { ROOT = { set_variable = { which = ehof_acc_r3 value = 8 } } }
  182. 1 = { ROOT = { set_variable = { which = ehof_acc_r3 value = 9 } } }
  183. 1 = { ROOT = { set_variable = { which = ehof_acc_r3 value = 10 } } }
  184. 1 = { ROOT = { set_variable = { which = ehof_acc_r3 value = 11 } } }
  185. 1 = { ROOT = { set_variable = { which = ehof_acc_r3 value = 12 } } }
  186. }
  187.  
  188. # D12 * Aim modifier for stage
  189. set_variable = { which = third_die_var value = ehof_acc_r3 }
  190. if = { limit = { any_system_within_border = { has_megastructure = ehof_megastructure_phase1_firing } } multiply_variable = { which = third_die_var value = 0.02 } }
  191. else_if = { limit = { any_system_within_border = { has_megastructure = ehof_megastructure_phase2_firing } } multiply_variable = { which = third_die_var value = 0.26 } }
  192. else_if = { limit = { any_system_within_border = { has_megastructure = ehof_megastructure_phase3_firing } } multiply_variable = { which = third_die_var value = 0.54 } }
  193. change_variable = { which = ehof_acc_r3 value = third_die_var }
  194.  
  195. # Add the 3 die
  196. set_variable = { which = ehof_acc_final value = 0 }
  197. change_variable = { which = ehof_acc_final value = ehof_acc_r1 }
  198. change_variable = { which = ehof_acc_final value = ehof_acc_r2 }
  199. change_variable = { which = ehof_acc_final value = ehof_acc_r3 }
  200.  
  201. @generation_threshold = 10.0
  202. @accuracy_threshold = 25.0
  203.  
  204. # Wormhole is generated successfully
  205. if = { limit = { check_variable = { which = ehof_acc_final value >= @generation_threshold } }
  206. # Wormhole is generated accurately
  207. if = { limit = { check_variable = { which = ehof_acc_final value >= @accuracy_threshold } }
  208. event_target:ehof_megastructure_system = {
  209. random_system_megastructure = {
  210. limit = {
  211. OR = {
  212. is_megastructure_type = ehof_megastructure_phase1_firing
  213. is_megastructure_type = ehof_megastructure_phase2_firing
  214. is_megastructure_type = ehof_megastructure_phase3_firing
  215. }
  216. }
  217. set_megastructure_flag = ehof_acc_true
  218. }
  219. }
  220. }
  221. # Wormhole selects a random destination
  222. else = {
  223. event_target:ehof_megastructure_system = {
  224. random_system_megastructure = {
  225. limit = {
  226. OR = {
  227. is_megastructure_type = ehof_megastructure_phase1_firing
  228. is_megastructure_type = ehof_megastructure_phase2_firing
  229. is_megastructure_type = ehof_megastructure_phase3_firing
  230. }
  231. }
  232. set_megastructure_flag = ehof_acc_false
  233. }
  234. }
  235. }
  236. }
  237. # Wormhole generation failure
  238. else = {
  239. event_target:ehof_megastructure_system = {
  240. random_system_megastructure = {
  241. limit = {
  242. OR = {
  243. is_megastructure_type = ehof_megastructure_phase1_firing
  244. is_megastructure_type = ehof_megastructure_phase2_firing
  245. is_megastructure_type = ehof_megastructure_phase3_firing
  246. }
  247. }
  248. set_megastructure_flag = ehof_wormhole_nogo
  249. }
  250. }
  251. }
  252. }
  253. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement