Skip to content

Commit ba73c84

Browse files
committed
fixing small mistakes for 0.1.24
The check for the better save soul DLC for workers was incorrectly checking for the game of crone DLC. You can now also decide how many skulls bodies in graves should have. Upgrading decorations now correctly displays both the sculpture / grave stone and the fence
1 parent 2c8bb4e commit ba73c84

4 files changed

Lines changed: 56 additions & 8 deletions

File tree

changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
Improved:
55

66
* It is now possible to have a worker zombie of any efficiency
7+
* At the same time you can now decide how many skulls the bodies in the graves should have
78
* Utility functions can now be collapsed and expanded
89

910
Fixed:
1011

12+
* Before when upgrading to the highest grave decoration, you still had to manually "repair" the top part, this is now fixed and it directly display correctly
1113
* When saving new indexed strings now, they get added correctly to the save file (Unless you used the application to export your save to JSON and then edit yourself and then reimported it, this problem doesn't matter for you)
1214

1315
0.1.23

data/html/css/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ ul.collapsible {
768768
pointer-events: initial;
769769
}
770770

771-
input#worker-efficiency {
771+
input#worker-efficiency, input#gravebody-skulls {
772772
margin: 0!important;
773773
height: 20px;
774774
width: 50px;

data/html/index.html

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,13 @@
302302
<div class="note hover col s12"><b>WARNING:</b><br>
303303
You can ignore the following warning if the worker you are using is a "big brain" worker (meaning custom efficiency) <br/><br/>
304304
For the perfect bodies/workers/graves to work it is necessary to have the technologies / crafting recipes like embalming because otherwise the game "resets" those bodies / decorations to a state which you could have done with your current tech tree / advancement (exception for this is the big brain worker). For this reason a "Unlock the entire tech tree" button was added. <b>BUT</b> the game save is rather complex, meaning even if you have all technologies and theoretically you couldn't have advanced this far the bodies will be bugged, f.e. broken in the morgue table. I assume (without having looked at the game code) that you need a certain progress in the game. F.e. when I used all technologies + perfect bodies on a completely new save, the bodies had 7 skulls, but actually (when taking a look at the exported save) the bodies where the correct bodies. So progress normally and use the unlock tech tree button or perfect worker button on a late game save (or where you already manually could produce the perfect bodies, but are lacking the resources)</div>
305-
<div class="btn perbody col s12">Replace all the bodies in graves with perfect bodies</div>
305+
<div class="btn perbody col s12">Replace bodies in graves with a body with
306+
<div class="input-field inline worker-efficiency-container">
307+
<input id="gravebody-skulls" type="number" step="1" min="0" value="26">
308+
</div>
309+
<div class="gameicon i-white-skull">
310+
<img src="/rsc/White_Skull_Symbol.png">
311+
</div></div>
306312
<div class="note col s12"><b>Note:</b><br>This is pre version 1.200</div>
307313
<div class="btn perdeco col s12">Set all grave decorations to the highest</div>
308314
<div class="btn perempty col s12">Replace all empty graves with perfect graves</div>
@@ -841,8 +847,20 @@
841847
$("#skull-amount").text(data.workerskullamount);
842848
})
843849

850+
// When setting skulls for the graves change the internal value
851+
$("#gravebody-skulls").change((e) => {
852+
853+
// Round to steps of 2.5
854+
data.gravebodyskullamount = Math.round(Math.max(0, Number($("#gravebody-skulls").val())));
855+
856+
// Force the value to be steps of 2.5
857+
$("#worker-efficiency").val(data.gravebodyskullamount)
858+
})
859+
860+
861+
844862
// Prevent the button from firing if we just change the text value
845-
$("#worker-efficiency").click((e) => {
863+
$("#worker-efficiency, #gravebody-skulls").click((e) => {
846864
e.preventDefault();
847865
e.stopPropagation();
848866
})

main.py

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ def modify_save(data, shash):
499499
reference_inventory = jsongamedata["inventory"]
500500

501501
# Otherwise if the user wants 65% and has the Better Save Soul DLC we use the prepared Worker of that DLC
502-
if data["workerskullamount"] == 26 and options["gameofcrone"]:
502+
if data["workerskullamount"] == 26 and options["bettersavesoul"]:
503503
adjust_skull_value = False
504504
reference_inventory = jsongamedata["worker_inventory_65%_1400+"]
505505

@@ -543,7 +543,34 @@ def modify_save(data, shash):
543543
# We iterate the items until we found the body and then change the inventory of the body
544544
for item in it["-1126421579"]["v"]["inventory"]["v"]:
545545
if item["v"]["id"]["v"] == "body":
546-
item["v"]["inventory"]["v"] = jsongamedata["inventory"]
546+
547+
# By default we use the custom rating inventory
548+
reference_inventory = jsongamedata["worker_inventory_custom_rating"]
549+
550+
# Whether we are using the an inventory with just one manipulated item
551+
adjust_skull_value = True
552+
553+
# If the user wants 16 skulls and has the Game Of Crone DLC
554+
if data["gravebodyskullamount"] == 16 and options["gameofcrone"]:
555+
adjust_skull_value = False
556+
reference_inventory = jsongamedata["inventory"]
557+
558+
# Otherwise if the user wants 26 skulls and has the Better Save Soul DLC
559+
if data["gravebodyskullamount"] == 26 and options["bettersavesoul"]:
560+
adjust_skull_value = False
561+
reference_inventory = jsongamedata["worker_inventory_65%_1400+"]
562+
563+
# If we have the inventory with the single modified item
564+
if adjust_skull_value:
565+
# We create a copy of the object just to not modify the in memory version which is used
566+
reference_inventory = deepcopy(reference_inventory)
567+
568+
# The inventory only contains 1 item, so we can directly access that item and its parameter
569+
# to set the correct skull amount
570+
# The -1 is caused because the brain already has one white skull
571+
reference_inventory[0]["v"]["_params"]["v"]["_res_v"]["v"][0]["v"] = data["workerskullamount"] - 1
572+
573+
item["v"]["inventory"]["v"] = reference_inventory
547574
item["v"]["_params"]["v"]["_durability"]["v"] = 1
548575
break
549576

@@ -554,19 +581,19 @@ def modify_save(data, shash):
554581
if options["bettersavesoul"]:
555582
jsongamedata["fence"]["v"]["id"]["v"] = "grave_bot_mrb_8"
556583
jsongamedata["decoration"]["v"]["id"]["v"] = "grave_top_sculpt_mrb_5"
557-
jsongamedata["_res_type"]["v"][2]["v"] = "grave_top_sculpt_mrb_5"
584+
jsongamedata["_res_type"]["v"][1]["v"] = "grave_top_sculpt_mrb_5"
558585
jsongamedata["_res_type"]["v"][2]["v"] = "grave_bot_mrb_8"
559586
# Else If the game of crone DLC is enabled use its decorations
560587
elif options["gameofcrone"]:
561588
jsongamedata["fence"]["v"]["id"]["v"] = "grave_bot_mrb_5"
562589
jsongamedata["decoration"]["v"]["id"]["v"] = "grave_top_highangel_mrb_1"
563-
jsongamedata["_res_type"]["v"][2]["v"] = "grave_top_highangel_mrb_1"
590+
jsongamedata["_res_type"]["v"][1]["v"] = "grave_top_highangel_mrb_1"
564591
jsongamedata["_res_type"]["v"][2]["v"] = "grave_bot_mrb_5"
565592
# Otherwise use base game decoration
566593
else:
567594
jsongamedata["fence"]["v"]["id"]["v"] = "grave_bot_mrb_2"
568595
jsongamedata["decoration"]["v"]["id"]["v"] = "grave_top_sculpt_mrb_1"
569-
jsongamedata["_res_type"]["v"][2]["v"] = "grave_top_sculpt_mrb_1"
596+
jsongamedata["_res_type"]["v"][1]["v"] = "grave_top_sculpt_mrb_1"
570597
jsongamedata["_res_type"]["v"][2]["v"] = "grave_bot_mrb_2"
571598

572599
# We iterate the items to delete all but the body so we can add the new ones
@@ -817,6 +844,7 @@ def editable_values(shash):
817844
}
818845

819846
obj["workerskullamount"] = 26
847+
obj["gravebodyskullamount"] = 26
820848

821849
return obj
822850

0 commit comments

Comments
 (0)