moretrim / ccHFM

Community Curated HFM
14 stars 3 forks source link

Numerous fixes to the dismantlement system #139

Open rogerburks opened 2 years ago

rogerburks commented 2 years ago

References #138 and part of #16.

These changes were attempted once I noticed that dismantlement was having unexpected results in my playthroughs, such as:

Several changes were made to address these problems, since it appeared that some code passages were not working at all. Establishment of puppets for dismantlement now uses civilized = no to scope the non-existing tags instead of referencing their tech school. This is because referencing the tech school often did not work.

This slightly changed some dynamics, which led to a change to specify that the UK should release New Zealand instead of Aotearoa when dismantled. Release of Russian tags was also adjusted to not release the tags through this route, which would scramble the provinces because of possibly the multiple-cores bug.

Some code was uncommented, and changes were made to address problematic behavior of the coin-flip code in 96011, 96016, and 96017 that awards colonies that do not have cores and overseas states. It seems that these events do not repeat infinitely anymore, and that this problem was likely fixed by the above change to releases.

The problem with random release of tags in Russian dismantlement seemed to be any_core = { owned_by = THIS }, which was removed and which does not seem to have been necessary in the code since it is covered by the event that this code triggers.

After considerable testing, I do not see any remaining problems. However, dismantlement code is complex, it is very possible that I have overlooked issues. Given that I do not see any current problems, I decided to make a pull request.

rogerburks commented 3 months ago

After a number of dismantlements, I see that rarely both an ai tag and the player get an offer for the same puppet. I notice this because the ai had the puppet and I got an event for it. Therefore, this should not be merged until I find and fix the problem.