toconnell / kdm-manager

An interactive campaign manager for the game "Monster", by Kingdom Death. Development blog and release notes at https://blog.kdm-manager.com This project has no affiliation with Kingdom Death and is a totally independent, fan-maintained project.
http://kdm-manager.com
Other
26 stars 11 forks source link

Survivor Sheet (Abilities & Impairments): F&T Mastery epithet linked to one of two instances of "Mastery - Fist & Tooth" #506

Closed WayForger closed 6 years ago

WayForger commented 6 years ago

After updating one of my survivors to have F&T Mastery I noticed that the manager forces the survivor to have two instances of "Master - Fist & Tooth." screen shot 2018-07-09 at 11 18 14 pm screen shot 2018-07-09 at 11 20 13 pm This error remains after removing both instances of the mastery and allowing the kdm-manager site to reload. After removing only one of the two, and allowing for things to load after accepting the change, the epithet disappears. screen shot 2018-07-09 at 11 18 39 pm I also discovered that the Mastery text does not join the specialization underneath the Weapon Proficiency area in the survivor sheet overview. screen shot 2018-07-09 at 11 26 29 pm

WayForger commented 6 years ago

I wanted to bring this up for a little while now since first noticing it and thinking it was an odd occurrence for the survivor sheet to be throwing. I believe the Manager is having issues due to a poor interaction between the maxed out (all eight squares) Weapon Proficiency and the A&I section.

toconnell commented 6 years ago

@WayForger Hah! That's a good one: I think I know what might be causing it and I'll take a look at it this week.

Long story short, there's some user-friendliness code that auto-adds the mastery when the eighth box is checked, and some normalization code that attempts to update survivors when they're initialized. I think there's probably some kind of conflict happening there where the normalizer doesn't understand the max number of times a survivor can have the Mastery A&I.

Anyway, yeah, I'll take a look ASAP

WayForger commented 6 years ago

It's actually happening with all masteries I've found.

toconnell commented 6 years ago

@WayForger Yeah, it's a problem with the general logic for maxing out Hunt XP when you've got a proficiency set.

I've got a lot going on right now and I'm not really in a position to do a new release of the Manager until August, but I'm going to try to pull this and a few other minor fixes together for a little bug-fix release that should be out...soonish.

toconnell commented 6 years ago

upon further investigation, it looks like we've got some legacy code that causes the mastery to be added OUTSIDE of the survivor's add_game_asset() method, which is...

SMH

toconnell commented 6 years ago

Hey @WayForger I finally got around to fighting my way through this one and the fix will go out in the release I'm working on for later this week (or potentially early this coming week).

tl;dr The issue was caused by a redundant call to the save() method for survivors that was getting made when the eighth point of Weapon Proficiency gets added. The extra call triggered the clean-up/normalization logic that automatically adds the mastery A&I if the survivor doesn't have it. Once that call was finished, the original call resumed and (you guessed it) finished its job to add the mastery.

At any rate, I fixed it up and cleaned up a few other aspects of adding mastery to a survivor, and things are looking nice and tidy now.

Thanks again for the write-up and the captures and the major assist on this one!