Skip to content

Commit

Permalink
More tweaks to the rank reward formula; fixed a bug that would affect…
Browse files Browse the repository at this point in the history
… evil players
  • Loading branch information
In-Vain committed Sep 3, 2020
1 parent 5a43f25 commit 50fc1cc
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 24 deletions.
28 changes: 13 additions & 15 deletions ModuleSystem/module_scripts.py
Expand Up @@ -25400,7 +25400,7 @@ def set_item_score():

(assign, reg71, ":nf_enemy_party_type_sum"), #Debug for A

(val_mul, ":nf_enemy_party_type_sum", 30), #multiply by 10, we do this to bring this value to asimilar level as B and C, then divide all by 200 #InVain Aug 2020: tripled for testing
(val_mul, ":nf_enemy_party_type_sum", 20), #multiply by 10, we do this to bring this value to asimilar level as B and C, then divide all by 200 #InVain Aug 2020: tripled for testing
(assign, "$g_formula_a", ":nf_enemy_party_type_sum"),
(assign, reg67, ":nf_enemy_party_type_sum"), #Debug for A

Expand Down Expand Up @@ -25454,10 +25454,12 @@ def set_item_score():
#Calculate D: Player share in the battle - Player party strength [player] in relation to allied parties' strength [allies]

(try_begin), #side asymmetry: Good side players profit more from fighting with allies, regardless of how much they actually contribute
(faction_get_slot, ":player_side", "$players_kingdom", slot_faction_side),
(eq, ":player_side", faction_side_good),
(store_mul, ":player_with_multiplier", "$g_starting_strength_main_party", 150), #InVain: we later divide it by 100, so we get 120/100=20% bonus to the player's party strength
(try_end),
(faction_get_slot, ":player_side", "$players_kingdom", slot_faction_side),
(eq, ":player_side", faction_side_good),
(store_mul, ":player_with_multiplier", "$g_starting_strength_main_party", 150), #InVain: we later divide it by 100, so we get 120/100=20% bonus to the player's party strength
(else_try),
(store_mul, ":player_with_multiplier", "$g_starting_strength_main_party", 100),
(try_end),
#(store_add, ":player_with_allies", "$g_starting_strength_main_party", "$g_starting_strength_friends"), #InVain: $g_starting_strength_friends already contains the player party
#(val_div, ":player_with_allies", 100), #InVain: We do this part later, to avoid rounding issues
(store_div, ":player_share_of_battle", ":player_with_multiplier", "$g_starting_strength_friends"),
Expand All @@ -25480,20 +25482,16 @@ def set_item_score():

(try_begin),
(gt, "$g_ally_victory_value_point", 0),
(store_mul, ":ally_victory_points", "$g_ally_victory_value_point", 5), #a/20*100
(assign, reg77, "$g_ally_victory_value_point"),
(assign, ":ally_victory_points", "$g_ally_victory_value_point"),

#minuend / first part
(store_mul, ":minuend", ":ally_victory_points", ":enemy_str"),
(val_div, ":minuend", ":ally_str"),

#subtrahend / second part
#(store_mul, ":subtrahend", ":ally_victory_points", ":ally_str"),
#(val_div, ":subtrahend", ":ally_str"),
(val_div, ":minuend", ":ally_str"),

#let's do this
(store_sub, ":helping_allies_sum", ":minuend", ":ally_victory_points"),
(val_div, ":helping_allies_sum", 100),
(store_sub, ":helping_allies_sum", ":minuend", ":ally_victory_points"),
(val_max, ":helping_allies_sum", 0),
(val_div, ":helping_allies_sum", 5), #nerf a bit
(val_add, ":helping_allies_sum", 2), #tweak a bit (allows to hit the 4 rank point = 1 inf threshold more often)
(else_try),
(assign, ":helping_allies_sum", 0),
(try_end),
Expand Down
2 changes: 1 addition & 1 deletion _wb/quick_strings.txt
Expand Up @@ -84,7 +84,7 @@ qstr_a_MAN^_subjugated_by a_MAN,^_subjugated_by_Sauron
qstr_an_ORC^_serving_the_W an_ORC,^_serving_the_White_Hand
qstr_an_URUK_HAI^_bred_in an_URUK-HAI,^_bred_in_Isengard
qstr_a_MAN_of_Dunland^_th a_MAN_of_Dunland,^_the_Western_Plains
qstr__rev_77_wb__dev_^_Bu _rev_77_wb_|_dev_^_Built_2020-09-02_08:50___
qstr__rev_78_wb__dev_^_Bu _rev_78_wb_|_dev_^_Built_2020-09-03_19:36___
qstr_Click_the_center_but Click_the_center_button_to_toggle_faction^Click_the_avatars_to_view_details_of_them
qstr_Level:_{reg3}^Health Level:_{reg3}^Health:_{reg4}
qstr_Attributes Attributes
Expand Down
4 changes: 2 additions & 2 deletions _wb/scripts.txt
Expand Up @@ -1249,9 +1249,9 @@ check_num_following_player -1
party_follow_player -1
21 21 1 1224979098644774912 2270 1 1224979098644774913 2120 3 1224979098644774914 1224979098644774913 240 501 3 1224979098644774912 31 1 501 3 1224979098644774912 32 1224979098644774914 501 3 1224979098644774912 30 0 1 4 421 1224979098644774912 11 0 1639 2 1224979098644774912 10 500 3 144115188075855891 16 11 500 3 144115188075855891 17 0 522 3 1224979098644774915 144115188075855893 70 2106 2 1224979098644774915 144115188075855924 502 3 144115188075855893 70 1224979098644774915 2133 2 72057594037928003 144115188075855924 2133 2 72057594037928002 1224979098644774915 2335 2 1 144115188075855893 1106 1 1585267068834415305 521 3 1224979098644774916 0 307 2105 2 1224979098644774916 1 501 3 0 307 1224979098644774916 521 3 1224979098644774916 0 307
calculate_formula_a -1
36 2133 2 144115188075856719 0 2133 2 1224979098644774912 0 11 1 1224979098644774913 1680 2 1224979098644774914 1224979098644774913 1073741855 2 1224979098644774914 144115188075855998 1073741855 2 1224979098644774914 0 31 2 1224979098644774914 144115188075856307 2147483679 2 1224979098644774913 0 521 3 1224979098644774915 1224979098644774913 0 521 3 1224979098644774916 1224979098644774913 1 2204 2 1224979098644774917 1224979098644774913 2190 3 1224979098644774918 1224979098644774917 144115188075855993 4 0 32 2 1224979098644774918 0 2105 2 144115188075856719 1224979098644774916 5 0 31 2 1224979098644774915 18 2105 2 1224979098644774912 10 5 0 2105 2 1224979098644774912 1224979098644774916 3 0 4 0 540 3 0 59 22 2330 2 15 1224979098644774913 2330 2 16 1224979098644774914 1106 2 1585267068834415306 5308240 3 0 3 0 2133 2 72057594037928007 1224979098644774912 2107 2 1224979098644774912 30 2133 2 144115188075856720 1224979098644774912 2133 2 72057594037928003 1224979098644774912 4 0 540 3 0 59 22 1106 2 1585267068834415307 5308240 3 0
36 2133 2 144115188075856719 0 2133 2 1224979098644774912 0 11 1 1224979098644774913 1680 2 1224979098644774914 1224979098644774913 1073741855 2 1224979098644774914 144115188075855998 1073741855 2 1224979098644774914 0 31 2 1224979098644774914 144115188075856307 2147483679 2 1224979098644774913 0 521 3 1224979098644774915 1224979098644774913 0 521 3 1224979098644774916 1224979098644774913 1 2204 2 1224979098644774917 1224979098644774913 2190 3 1224979098644774918 1224979098644774917 144115188075855993 4 0 32 2 1224979098644774918 0 2105 2 144115188075856719 1224979098644774916 5 0 31 2 1224979098644774915 18 2105 2 1224979098644774912 10 5 0 2105 2 1224979098644774912 1224979098644774916 3 0 4 0 540 3 0 59 22 2330 2 15 1224979098644774913 2330 2 16 1224979098644774914 1106 2 1585267068834415306 5308240 3 0 3 0 2133 2 72057594037928007 1224979098644774912 2107 2 1224979098644774912 20 2133 2 144115188075856720 1224979098644774912 2133 2 72057594037928003 1224979098644774912 4 0 540 3 0 59 22 1106 2 1585267068834415307 5308240 3 0
calculate_rank_gain_new -1
84 2133 2 1224979098644774912 144115188075856720 2133 2 72057594037928003 1224979098644774912 2121 3 1224979098644774913 144115188075856328 144115188075856717 2133 2 72057594037928004 1224979098644774913 2107 2 1224979098644774913 2 2133 2 72057594037928005 1224979098644774913 2121 3 1224979098644774914 144115188075856327 144115188075856718 2133 2 72057594037928006 1224979098644774914 2106 2 1224979098644774914 100 2111 2 1224979098644774914 0 4 0 522 3 1224979098644774915 144115188075855993 158 31 2 1224979098644774915 0 2107 2 1224979098644774914 2 3 0 2133 2 72057594037928000 1224979098644774914 4 0 522 3 1224979098644774915 144115188075855993 158 31 2 1224979098644774915 0 2122 3 1224979098644774916 144115188075856327 150 3 0 2123 3 1224979098644774917 1224979098644774916 144115188075856330 2110 2 1224979098644774917 100 2133 2 72057594037927997 1224979098644774917 2121 3 1224979098644774918 144115188075856330 144115188075856327 2111 2 1224979098644774918 1 2133 2 1224979098644774919 144115188075856328 2122 3 1224979098644774920 1224979098644774918 2 2110 2 1224979098644774919 1224979098644774920 4 0 32 2 144115188075856719 0 2122 3 1224979098644774921 144115188075856719 5 2122 3 1224979098644774922 1224979098644774921 1224979098644774919 2108 2 1224979098644774922 1224979098644774918 2121 3 1224979098644774923 1224979098644774922 1224979098644774921 2108 2 1224979098644774923 100 2111 2 1224979098644774923 0 5 0 2133 2 1224979098644774923 0 3 0 2133 2 72057594037927999 1224979098644774923 2120 3 1224979098644774924 1224979098644774912 1224979098644774913 2106 2 1224979098644774924 1224979098644774914 2108 2 1224979098644774924 200 2111 2 1224979098644774924 1 4 0 540 3 0 59 22 1106 2 1585267068834415308 16732240 3 0 4 0 2147483680 2 144115188075856719 0 2133 2 1224979098644774925 1224979098644774924 2133 2 1224979098644774926 1 5 0 32 2 144115188075856719 0 2147483679 2 144115188075856722 1 2122 3 1224979098644774927 1224979098644774924 1224979098644774917 2123 3 1224979098644774925 1224979098644774927 100 2133 2 1224979098644774926 2 5 0 31 2 144115188075856722 1 2122 3 1224979098644774927 1224979098644774924 1224979098644774917 2108 2 1224979098644774927 100 2120 3 1224979098644774925 1224979098644774927 1224979098644774923 2133 2 1224979098644774926 3 3 0 2105 2 1224979098644774925 2 2133 2 72057594037927998 1224979098644774925 4 0 540 3 0 59 22 4 0 31 2 1224979098644774926 1 1106 2 1585267068834415309 16732240 5 0 31 2 1224979098644774926 2 1106 2 1585267068834415310 16732240 5 0 31 2 1224979098644774926 3 1106 2 1585267068834415311 16732240 3 0 1106 2 1585267068834415312 5308240 3 0 2133 2 144115188075856721 1 2133 2 144115188075856722 0
88 2133 2 1224979098644774912 144115188075856720 2133 2 72057594037928003 1224979098644774912 2121 3 1224979098644774913 144115188075856328 144115188075856717 2133 2 72057594037928004 1224979098644774913 2107 2 1224979098644774913 2 2133 2 72057594037928005 1224979098644774913 2121 3 1224979098644774914 144115188075856327 144115188075856718 2133 2 72057594037928006 1224979098644774914 2106 2 1224979098644774914 100 2111 2 1224979098644774914 0 4 0 522 3 1224979098644774915 144115188075855993 158 31 2 1224979098644774915 0 2107 2 1224979098644774914 2 3 0 2133 2 72057594037928000 1224979098644774914 4 0 522 3 1224979098644774915 144115188075855993 158 31 2 1224979098644774915 0 2122 3 1224979098644774916 144115188075856327 150 5 0 2122 3 1224979098644774916 144115188075856327 100 3 0 2123 3 1224979098644774917 1224979098644774916 144115188075856330 2110 2 1224979098644774917 100 2133 2 72057594037927997 1224979098644774917 2121 3 1224979098644774918 144115188075856330 144115188075856327 2111 2 1224979098644774918 1 2133 2 1224979098644774919 144115188075856328 2122 3 1224979098644774920 1224979098644774918 2 2110 2 1224979098644774919 1224979098644774920 4 0 32 2 144115188075856719 0 2133 2 72057594037928013 144115188075856719 2133 2 1224979098644774921 144115188075856719 2122 3 1224979098644774922 1224979098644774921 1224979098644774919 2108 2 1224979098644774922 1224979098644774918 2121 3 1224979098644774923 1224979098644774922 1224979098644774921 2111 2 1224979098644774923 0 2108 2 1224979098644774923 5 2105 2 1224979098644774923 2 5 0 2133 2 1224979098644774923 0 3 0 2133 2 72057594037927999 1224979098644774923 2120 3 1224979098644774924 1224979098644774912 1224979098644774913 2106 2 1224979098644774924 1224979098644774914 2108 2 1224979098644774924 200 2111 2 1224979098644774924 1 4 0 540 3 0 59 22 1106 2 1585267068834415308 16732240 3 0 4 0 2147483680 2 144115188075856719 0 2133 2 1224979098644774925 1224979098644774924 2133 2 1224979098644774926 1 5 0 32 2 144115188075856719 0 2147483679 2 144115188075856722 1 2122 3 1224979098644774927 1224979098644774924 1224979098644774917 2123 3 1224979098644774925 1224979098644774927 100 2133 2 1224979098644774926 2 5 0 31 2 144115188075856722 1 2122 3 1224979098644774927 1224979098644774924 1224979098644774917 2108 2 1224979098644774927 100 2120 3 1224979098644774925 1224979098644774927 1224979098644774923 2133 2 1224979098644774926 3 3 0 2105 2 1224979098644774925 2 2133 2 72057594037927998 1224979098644774925 4 0 540 3 0 59 22 4 0 31 2 1224979098644774926 1 1106 2 1585267068834415309 16732240 5 0 31 2 1224979098644774926 2 1106 2 1585267068834415310 16732240 5 0 31 2 1224979098644774926 3 1106 2 1585267068834415311 16732240 3 0 1106 2 1585267068834415312 5308240 3 0 2133 2 144115188075856721 1 2133 2 144115188075856722 0
attack_party -1
3 21 1 1224979098644774912 22 1 1224979098644774913 1 3 627 1224979098644774912 1224979098644774913
attack_party_aux -1
Expand Down
4 changes: 2 additions & 2 deletions _wb/variable_uses.txt
Expand Up @@ -453,7 +453,7 @@
2
13
17
6
7
5
4
9
Expand Down Expand Up @@ -845,7 +845,7 @@
8
1
1
4
5
1
6
2
Expand Down

0 comments on commit 50fc1cc

Please sign in to comment.