("troop_get_romantic_chemistry_with_troop", #source is lady, target is man
[
(store_script_param, ":source_lady", 1),
(store_script_param, ":target_lord", 2),
(store_add, ":chemistry_sum", ":source_lady", ":target_lord"),
(val_add, ":chemistry_sum", "$romantic_attraction_seed"),
#This calculates (modula ^ 2) * 3
(store_mod, ":chemistry_remainder", ":chemistry_sum", 5),
(val_mul, ":chemistry_remainder", ":chemistry_remainder"), #0, 1, 4, 9, 16
(val_mul, ":chemistry_remainder", 3), #0, 3, 12, 27, 48
(store_attribute_level, ":romantic_chemistry", ":target_lord", ca_charisma),
(val_sub, ":romantic_chemistry", ":chemistry_remainder"),
(val_mul, ":romantic_chemistry", 2),
(assign, reg0, ":romantic_chemistry"),
#examples :
#For a charisma of 18, yields (18 - 0) * 2 = 36, (18 - 3) * 2 = 30, (18 - 12) * 2 = 12, (18 - 27) * 2 = -18, (18 - 48) * 2 = -60
#For a charisma of 10, yields (10 - 0) * 2 = 20, (10 - 3) * 2 = 14, (10 - 12) * 2 = -4, (10 - 27) * 2 = -34, (10 - 48) * 2 = -76
#For a charisma of 7, yields (7 - 0) * 2 = 14, (7 - 3) * 2 = 8, (7 - 12) * 2 = -10, (7 - 27) * 2 = -40, (7 - 48) * 2 = -82
#15 is high attraction, 0 is moderate attraction, -76 is lowest attraction
]),
("cf_troop_get_romantic_attraction_to_troop", #source is lady, target is man
[
(store_script_param, ":source_lady", 1),
(store_script_param, ":target_lord", 2),
(assign, ":weighted_romantic_assessment", 0),
(troop_get_type, ":source_is_female", ":source_lady"),
(eq, ":source_is_female", 1),
(troop_get_type, ":target_is_female", ":target_lord"),
(eq, ":target_is_female", 0),
(call_script, "script_troop_get_romantic_chemistry_with_troop", ":source_lady", ":target_lord"),
(assign, ":romantic_chemistry", reg0),
#objective attraction - average renown
(troop_get_slot, ":modified_renown", ":target_lord", slot_troop_renown),
(assign, ":lady_status", 60),
(val_div, ":modified_renown", 5),
(val_sub, ":modified_renown", ":lady_status"),
(val_min, ":modified_renown", 60),
#weight values
(try_begin),
(assign, ":personality_match", 0),
(call_script, "script_cf_test_lord_incompatibility_to_s17", ":source_lady", ":target_lord"),
(store_sub, ":personality_match", 0, reg0),
(try_end),
(troop_get_slot, ":lady_reputation", ":source_lady", slot_lord_reputation_type),
(try_begin),
(eq, ":lady_reputation", lrep_ambitious),
(val_mul, ":modified_renown", 2),
(val_div, ":romantic_chemistry", 2),
(else_try),
(eq, ":lady_reputation", lrep_otherworldly),
(val_div, ":modified_renown", 2),
(val_mul, ":romantic_chemistry", 2),
(else_try),
(eq, ":lady_reputation", lrep_adventurous),
(val_div, ":modified_renown", 2),
(else_try),
(eq, ":lady_reputation", lrep_moralist),
(val_div, ":modified_renown", 2),
(val_div, ":romantic_chemistry", 2),
(try_end),
(val_add, ":weighted_romantic_assessment", ":romantic_chemistry"),
(val_add, ":weighted_romantic_assessment", ":personality_match"),
(val_add, ":weighted_romantic_assessment", ":modified_renown"),
(assign, reg0, ":weighted_romantic_assessment"),
]),