Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- immediate = {
- event_target:ehof_megastructure_system = {
- random_system_megastructure = {
- #########################################
- ############### First Dice ##############
- #########################################
- # Phase 1: D10
- if = {
- limit = { is_megastructure_type = ehof_megastructure_phase1_firing }
- random_list = {
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 1 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 2 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 3 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 4 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 5 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 6 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 7 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 8 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 9 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 10 } } }
- }
- }
- # Phase 2: D12
- else_if = {
- limit = { is_megastructure_type = ehof_megastructure_phase2_firing }
- random_list = {
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 1 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 2 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 3 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 4 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 5 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 6 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 7 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 8 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 9 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 10 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 11 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 12 } } }
- }
- }
- # Phase 3: D20
- else_if = {
- limit = { is_megastructure_type = ehof_megastructure_phase3_firing }
- random_list = {
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 1 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 2 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 3 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 4 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 5 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 6 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 7 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 8 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 9 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 10 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 11 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 12 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 13 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 14 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 15 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 16 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 17 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 18 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 19 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r1 value = 20 } } }
- }
- }
- #########################################
- ############## Second Dice ##############
- #########################################
- # D12
- random_list = {
- 1 = { ROOT = { set_variable = { which = ehof_acc_r2 value = 1 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r2 value = 2 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r2 value = 3 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r2 value = 4 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r2 value = 5 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r2 value = 6 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r2 value = 7 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r2 value = 8 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r2 value = 9 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r2 value = 10 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r2 value = 11 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r2 value = 12 } } }
- }
- # Set target system modifier
- # Phase 1-3
- 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 } } }
- 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 } } }
- 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 } } }
- 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 } } }
- 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 } } }
- 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 } } }
- 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 } } }
- 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 } } }
- 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 } } }
- 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 } } }
- 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 } } }
- 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 } } }
- # Phase 2-3
- 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 } } }
- 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 } } }
- 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 } } }
- 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 } } }
- 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 } } }
- 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 } } }
- # Phase 3 only
- 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 } } }
- 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 } } }
- 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 } } }
- 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 } } }
- 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 } } }
- 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 } } }
- 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 } } }
- }
- }
- ##################### ??????????????????????????
- # If the modifier is not 0
- if = { limit = { NOT = { check_variable = { which = ehof_acc_r2_modifier value = 0 } } }
- set_variable = { which = second_die_counter value = 0 }
- # If the modifier is greater than 0
- if = { limit = { check_variable = { which = ehof_acc_r2_modifier value < 0 } }
- # Loop until counter is higher than modifier
- while = {
- limit = { check_variable = { which = second_die_counter value > ehof_acc_r2_modifier } }
- random_list = {
- 1 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = -1 } } }
- 1 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = -2 } } }
- 1 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = -3 } } }
- 1 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = -4 } } }
- 1 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = -5 } } }
- 1 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = -6 } } }
- }
- change_variable = { which = second_die_counter value = -1 }
- }
- }
- # If the modifier is less than 0
- else = {
- # Loop until counter is higher than modifier
- while = {
- limit = { check_variable = { which = second_die_counter value < ehof_acc_r2_modifier } }
- random_list = {
- 1 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = 1 } } }
- 1 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = 2 } } }
- 1 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = 3 } } }
- 1 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = 4 } } }
- 1 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = 5 } } }
- 1 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = 6 } } }
- }
- change_variable = { which = second_die_counter value = 1 }
- }
- }
- change_variable = { which = ehof_acc_r2 value = ehof_rolled_d6 }
- }
- ###########################
- #########################################
- ############### Third Dice ##############
- #########################################
- # D12
- random_list = {
- 1 = { ROOT = { set_variable = { which = ehof_acc_r3 value = 1 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r3 value = 2 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r3 value = 3 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r3 value = 4 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r3 value = 5 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r3 value = 6 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r3 value = 7 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r3 value = 8 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r3 value = 9 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r3 value = 10 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r3 value = 11 } } }
- 1 = { ROOT = { set_variable = { which = ehof_acc_r3 value = 12 } } }
- }
- # D12 * Aim modifier for stage
- set_variable = { which = third_die_var value = ehof_acc_r3 }
- if = { limit = { any_system_within_border = { has_megastructure = ehof_megastructure_phase1_firing } } multiply_variable = { which = third_die_var value = 0.02 } }
- else_if = { limit = { any_system_within_border = { has_megastructure = ehof_megastructure_phase2_firing } } multiply_variable = { which = third_die_var value = 0.26 } }
- else_if = { limit = { any_system_within_border = { has_megastructure = ehof_megastructure_phase3_firing } } multiply_variable = { which = third_die_var value = 0.54 } }
- change_variable = { which = ehof_acc_r3 value = third_die_var }
- # Add the 3 die
- set_variable = { which = ehof_acc_final value = 0 }
- change_variable = { which = ehof_acc_final value = ehof_acc_r1 }
- change_variable = { which = ehof_acc_final value = ehof_acc_r2 }
- change_variable = { which = ehof_acc_final value = ehof_acc_r3 }
- @generation_threshold = 10.0
- @accuracy_threshold = 25.0
- # Wormhole is generated successfully
- if = { limit = { check_variable = { which = ehof_acc_final value >= @generation_threshold } }
- # Wormhole is generated accurately
- if = { limit = { check_variable = { which = ehof_acc_final value >= @accuracy_threshold } }
- event_target:ehof_megastructure_system = {
- random_system_megastructure = {
- limit = {
- OR = {
- is_megastructure_type = ehof_megastructure_phase1_firing
- is_megastructure_type = ehof_megastructure_phase2_firing
- is_megastructure_type = ehof_megastructure_phase3_firing
- }
- }
- set_megastructure_flag = ehof_acc_true
- }
- }
- }
- # Wormhole selects a random destination
- else = {
- event_target:ehof_megastructure_system = {
- random_system_megastructure = {
- limit = {
- OR = {
- is_megastructure_type = ehof_megastructure_phase1_firing
- is_megastructure_type = ehof_megastructure_phase2_firing
- is_megastructure_type = ehof_megastructure_phase3_firing
- }
- }
- set_megastructure_flag = ehof_acc_false
- }
- }
- }
- }
- # Wormhole generation failure
- else = {
- event_target:ehof_megastructure_system = {
- random_system_megastructure = {
- limit = {
- OR = {
- is_megastructure_type = ehof_megastructure_phase1_firing
- is_megastructure_type = ehof_megastructure_phase2_firing
- is_megastructure_type = ehof_megastructure_phase3_firing
- }
- }
- set_megastructure_flag = ehof_wormhole_nogo
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement