Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- immediate = {
- if = {
- limit = { ehof_log_functions = yes }
- log = "EHOF: ehof_travel.80 fired :: EHOF Wormhole Generation & Accuracy Dice"
- }
- # First Dice:
- # Determined from EHOF Phase
- if = {
- # EHOF Phase 1: D10
- limit = { active_ehof_is_phase_1 = yes }
- random_list = {
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d10 value = 1 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d10 value = 2 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d10 value = 3 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d10 value = 4 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d10 value = 5 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d10 value = 6 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d10 value = 7 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d10 value = 8 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d10 value = 9 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d10 value = 10 } } }
- }
- set_variable = {
- which = ehof_acc_r1
- value = ehof_rolled_d10
- }
- if = {
- limit = { ehof_log_travel = yes }
- log = "EHOF: ehof_travel.80 >> Player rolled First Dice: got [this.ehof_acc_r1] from D10"
- }
- } else_if = {
- # EHOF Phase 2: D12
- limit = { active_ehof_is_phase_2 = yes }
- random_list = {
- 25 = {
- random_list = {
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 1 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 2 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 3 } } }
- }
- }
- 25 = {
- random_list = {
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 4 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 5 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 6 } } }
- }
- }
- 25 = {
- random_list = {
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 7 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 8 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 9 } } }
- }
- }
- 25 = {
- random_list = {
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 10 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 11 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 12 } } }
- }
- }
- }
- set_variable = {
- which = ehof_acc_r1
- value = ehof_rolled_d12
- }
- if = {
- limit = { ehof_log_travel = yes }
- log = "EHOF: ehof_travel.80 >> Player rolled First Dice: got [this.ehof_acc_r1] from D12"
- }
- } else_if = {
- # EHOF Phase 3: D20
- limit = { active_ehof_is_phase_3 = yes }
- random_list = {
- 50 = {
- random_list = {
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d20 value = 1 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d20 value = 5 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d20 value = 11 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d20 value = 15 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d20 value = 3 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d20 value = 7 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d20 value = 13 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d20 value = 17 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d20 value = 9 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d20 value = 19 } } }
- }
- }
- 50 = {
- random_list = {
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d20 value = 2 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d20 value = 6 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d20 value = 12 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d20 value = 16 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d20 value = 4 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d20 value = 8 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d20 value = 14 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d20 value = 18 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d20 value = 10 } } }
- 10 = { ROOT = { set_variable = { which = ehof_rolled_d20 value = 20 } } }
- }
- }
- }
- set_variable = {
- which = ehof_acc_r1
- value = ehof_rolled_d12
- }
- if = {
- limit = { ehof_log_travel = yes }
- log = "EHOF: ehof_travel.80 >> Player rolled First Dice: got [this.ehof_acc_r1] from D20"
- }
- }
- # Second Dice:
- # Player rolls a D12 which is modified by Targetted System's Accuracy Modifiers (sub-rolls):
- random_list = {
- 25 = {
- random_list = {
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 4 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 8 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 12 } } }
- }
- }
- 25 = {
- random_list = {
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 3 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 7 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 11 } } }
- }
- }
- 25 = {
- random_list = {
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 2 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 6 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 10 } } }
- }
- }
- 25 = {
- random_list = {
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 1 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 5 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 9 } } }
- }
- }
- }
- if = {
- limit = { ehof_log_travel = yes }
- log = "EHOF: ehof_travel.80 >> Player rolled Second Dice: got [this.ehof_rolled_d12] from D12"
- }
- set_variable = {
- which = ehof_modifiers
- value = 0
- }
- if = {
- limit = { ehof_is_target_black_hole = yes }
- if = {
- limit = { active_ehof_is_phase_1 = yes }
- set_variable = {
- which = ehof_modifiers
- value = 1
- }
- } else_if = {
- limit = { active_ehof_is_phase_2 = yes }
- set_variable = {
- which = ehof_modifiers
- value = 1
- }
- } else_if = {
- limit = { active_ehof_is_phase_3 = yes }
- set_variable = {
- which = ehof_modifiers
- value = 2
- }
- }
- } else_if = {
- limit = { ehof_is_target_neutron = yes }
- if = {
- limit = { active_ehof_is_phase_1 = yes }
- set_variable = {
- which = ehof_modifiers
- value = 1
- }
- } else_if = {
- limit = { active_ehof_is_phase_2 = yes }
- set_variable = {
- which = ehof_modifiers
- value = 1
- }
- } else_if = {
- limit = { active_ehof_is_phase_3 = yes }
- set_variable = {
- which = ehof_modifiers
- value = 2
- }
- }
- } else_if = {
- limit = { ehof_is_target_pulsar = yes }
- if = {
- limit = { active_ehof_is_phase_1 = yes }
- set_variable = {
- which = ehof_modifiers
- value = 1
- }
- } else_if = {
- limit = { active_ehof_is_phase_2 = yes }
- set_variable = {
- which = ehof_modifiers
- value = 1
- }
- } else_if = {
- limit = { active_ehof_is_phase_3 = yes }
- set_variable = {
- which = ehof_modifiers
- value = 2
- }
- }
- } else_if = {
- limit = { ehof_is_target_binary = yes }
- if = {
- limit = { active_ehof_is_phase_2 = yes }
- set_variable = {
- which = ehof_modifiers
- value = 0
- }
- } else_if = {
- limit = { active_ehof_is_phase_3 = yes }
- set_variable = {
- which = ehof_modifiers
- value = 1
- }
- }
- } else_if = {
- limit = { ehof_is_target_trinary = yes }
- if = {
- limit = { active_ehof_is_phase_2 = yes }
- set_variable = {
- which = ehof_modifiers
- value = 0
- }
- } else_if = {
- limit = { active_ehof_is_phase_3 = yes }
- set_variable = {
- which = ehof_modifiers
- value = 1
- }
- }
- } else_if = {
- limit = { ehof_is_target_red_giant = yes }
- if = {
- limit = { active_ehof_is_phase_2 = yes }
- set_variable = {
- which = ehof_modifiers
- value = -1
- }
- } else_if = {
- limit = { active_ehof_is_phase_3 = yes }
- set_variable = {
- which = ehof_modifiers
- value = 1
- }
- }
- } else_if = {
- limit = { ehof_is_target_white_blue = yes }
- if = {
- limit = { active_ehof_is_phase_3 = yes }
- set_variable = {
- which = ehof_modifiers
- value = 0
- }
- }
- } else_if = {
- limit = { ehof_is_target_blue = yes }
- if = {
- limit = { active_ehof_is_phase_3 = yes }
- set_variable = {
- which = ehof_modifiers
- value = 1
- }
- }
- } else_if = {
- limit = { ehof_is_target_yellow_white_dwarf = yes }
- if = {
- limit = { active_ehof_is_phase_3 = yes }
- set_variable = {
- which = ehof_modifiers
- value = -1
- }
- }
- } else_if = {
- limit = { ehof_is_target_yellow_dwarf = yes }
- if = {
- limit = { active_ehof_is_phase_3 = yes }
- set_variable = {
- which = ehof_modifiers
- value = -1
- }
- }
- } else_if = {
- limit = { ehof_is_target_orange_dwarf = yes }
- if = {
- limit = { active_ehof_is_phase_3 = yes }
- set_variable = {
- which = ehof_modifiers
- value = -2
- }
- }
- } else_if = {
- limit = { ehof_is_target_red_dwarf = yes }
- if = {
- limit = { active_ehof_is_phase_3 = yes }
- set_variable = {
- which = ehof_modifiers
- value = 0
- }
- }
- } else_if = {
- limit = { ehof_is_target_brown_dwarf = yes }
- if = {
- limit = { active_ehof_is_phase_3 = yes }
- set_variable = {
- which = ehof_modifiers
- value = -2
- }
- }
- } else_if = {
- limit = { ehof_is_target_wormhole_cohesive = yes }
- if = {
- limit = { active_ehof_is_phase_1 = yes }
- set_variable = {
- which = ehof_modifiers
- value = 2
- }
- } else_if = {
- limit = { active_ehof_is_phase_2 = yes }
- set_variable = {
- which = ehof_modifiers
- value = 2
- }
- } else_if = {
- limit = { active_ehof_is_phase_3 = yes }
- set_variable = {
- which = ehof_modifiers
- value = 3
- }
- }
- }
- if = {
- limit = { NOT = { check_variable = { which = ehof_modifiers value = 0 } } }
- set_variable = {
- which = ehof_counter
- value = 0
- }
- set_variable = {
- which = ehof_modifier_var
- value = 0
- }
- if = {
- limit = { check_variable = { which = ehof_modifiers value < 0 } }
- while = {
- limit = { check_variable = { which = ehof_counter value > ehof_modifiers } }
- random_list = {
- 50 = {
- random_list = {
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = -1 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = -2 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = -3 } } }
- }
- }
- 50 = {
- random_list = {
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = -4 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = -5 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = -6 } } }
- }
- }
- }
- change_variable = {
- which = ehof_modifier_var
- value = ehof_rolled_d6
- }
- subtract_variable = {
- which = ehof_counter
- value = 1
- }
- if = {
- limit = { ehof_log_travel = yes }
- log = "EHOF: ehof_travel.80 >> Second Dice is modified by -[this.ehof_rolled_d12]"
- }
- }
- } else = {
- while = {
- limit = { check_variable = { which = ehof_counter value < ehof_modifiers } }
- random_list = {
- 50 = {
- random_list = {
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = 1 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = 2 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = 3 } } }
- }
- }
- 50 = {
- random_list = {
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = 4 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = 5 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d6 value = 6 } } }
- }
- }
- }
- change_variable = {
- which = ehof_modifier_var
- value = ehof_rolled_d6
- }
- change_variable = {
- which = ehof_counter
- value = 1
- }
- if = {
- limit = { ehof_log_travel = yes }
- log = "EHOF: ehof_travel.80 >> Second Dice is modified by +[this.ehof_rolled_d12]"
- }
- }
- }
- change_variable = {
- which = ehof_rolled_d12
- value = ehof_modifier_var
- }
- }
- set_variable = {
- which = ehof_acc_r2
- value = ehof_rolled_d12
- }
- if = {
- limit = { ehof_log_travel = yes }
- log = "EHOF: ehof_travel.80 >> After modifiers Second Dice = [this.ehof_acc_r2]"
- }
- # Third Dice:
- # Bonus RANDOM D12, rolled then modified by the Base Aiming modifier:
- random_list = {
- 25 = {
- random_list = {
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 4 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 8 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 12 } } }
- }
- }
- 25 = {
- random_list = {
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 3 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 7 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 11 } } }
- }
- }
- 25 = {
- random_list = {
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 2 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 6 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 10 } } }
- }
- }
- 25 = {
- random_list = {
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 1 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 5 } } }
- 33 = { ROOT = { set_variable = { which = ehof_rolled_d12 value = 9 } } }
- }
- }
- }
- if = {
- limit = { ehof_log_travel = yes }
- log = "EHOF: ehof_travel.80 >> Player rolled Third Dice: got [this.ehof_rolled_d12] from d12"
- }
- set_variable = {
- which = ehof_modifier_var
- value = ehof_rolled_d12
- }
- if = {
- limit = { active_ehof_is_phase_1 = yes }
- multiply_variable = {
- which = ehof_modifier_var
- value = 0.02
- }
- } else_if = {
- limit = { active_ehof_is_phase_2 = yes }
- multiply_variable = {
- which = ehof_modifier_var
- value = 0.26
- }
- } else_if = {
- limit = { active_ehof_is_phase_3 = yes }
- multiply_variable = {
- which = ehof_modifier_var
- value = 0.54
- }
- }
- if = {
- limit = { ehof_log_travel = yes }
- log = "EHOF: ehof_travel.80 >> Third Dice is modified by +[this.ehof_modifier_var]"
- }
- change_variable = {
- which = ehof_rolled_d12
- value = ehof_modifier_var
- }
- set_variable = {
- which = ehof_acc_r3
- value = ehof_rolled_d12
- }
- if = {
- limit = { ehof_log_travel = yes }
- log = "EHOF: ehof_travel.80 >> After modifiers Third Dice = [this.ehof_acc_r3]"
- }
- 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
- }
- if = {
- limit = { ehof_log_travel = yes }
- log = "EHOF: ehof_travel.80 >> Total of Dice: [this.ehof_acc_r1] + [this.ehof_acc_r2] + [this.ehof_acc_r3] = [this.ehof_acc_final]"
- }
- @generation_threshold = 10.0
- @accuracy_threshold = 25.0
- if = {
- limit = { check_variable = { which = ehof_acc_final value >= @generation_threshold } }
- # Wormhole is generated successfully
- if = {
- limit = { ehof_log_travel = yes }
- log = "EHOF: ehof_travel.80 >> [this.ehof_acc_final] meets generation threshold. Wormhole will be generated."
- }
- if = {
- limit = { check_variable = { which = ehof_acc_final value >= @accuracy_threshold } }
- # Wormhole is generated accurately
- if = {
- limit = { ehof_log_travel = yes }
- log = "EHOF: ehof_travel.80 >> [this.ehof_acc_final] meets accuracy threshold. Wormhole will be accurate to player's choice."
- }
- event_target:ehof_mega_active = { set_megastructure_flag = ehof_acc_true }
- } else = {
- # Wormhole selects a random destination
- if = {
- limit = { ehof_log_travel = yes }
- log = "EHOF: ehof_travel.80 >> [this.ehof_acc_final] does not meet accuracy threshold. Random destination will be chosen."
- }
- event_target:ehof_mega_active = { set_megastructure_flag = ehof_acc_false }
- }
- } else = {
- # Wormhole generation failure
- if = {
- limit = { ehof_log_travel = yes }
- log = "EHOF: ehof_travel.80 >> [this.ehof_acc_final] does not meet generation threshold. No wormhole will be generated."
- }
- event_target:ehof_mega_active = { set_megastructure_flag = ehof_wormhole_nogo }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement