Operations That Cannot Fail Should Use Lowest Quality Medicine - #36
Open
maarxx wants to merge 1 commit into
Open
Operations That Cannot Fail Should Use Lowest Quality Medicine#36maarxx wants to merge 1 commit into
maarxx wants to merge 1 commit into
Conversation
maarxx
commented
Dec 8, 2020
| } | ||
| float inverter = 1f; | ||
| if (patient.BillStack.FirstShouldDoNow.recipe.defName == "Anesthetize") { inverter = -1f; } | ||
| tmpMedicine.SortBy((Thing x) => 0f - (x.GetStatValue(StatDefOf.MedicalPotency) * inverter), (Thing x) => x.Position.DistanceToSquared(billGiver.Position)); |
Author
There was a problem hiding this comment.
The inverter variable in the above 3 lines is the only place we intend to affect any change here.
There was a problem hiding this comment.
heya, I know it's been ages since you made this PR, but did you check if this affects op chances? Don't more advanced meds increase success chances? Because pawns will pick up stacks of meds at once, if this affects operations in that they pick up crappy meds for anestesis and whatever affects the op itself, that might be an issue.
maarxx
commented
Dec 8, 2020
| { | ||
| Pawn patient = billGiver as Pawn; | ||
| //MedicalCareCategory medicalCareCategory = GetMedicalCareCategory(billGiver); | ||
| MedicalCareCategory medicalCareCategory = PharmacistUtility.TendAdvice(patient, InjurySeverity.Operation); |
Author
There was a problem hiding this comment.
While we're here, this line obsoletes the other patch.
|
This looks like a great change |
Author
DO NOT MERGESee #35 for updates which are not yet reflected in this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Operations That Cannot Fail Should Use Lowest Quality Medicine
Addresses #35
But doing this was awkward. We're not enforcing a strict limitation here, like "Herbal Medicine", because if a colony literally doesn't have any "Herbal Medicine", they should use the next-cheapest thing. They should, however, work backwards through the available medicine, in the reverse preference order they would typically sort it.
To do this, we had to patch one method higher upstack:
WorkGiver_DoBill.AddEveryMedicineToRelevantThings.This actually obsoleted the existing patch on
WorkGiver_DoBill.GetMedicalCareCategory(new patch was only caller), so we delete it.We do a classic copy/paste of the original method into a
return falseprefix.DO NOT MERGE
See #35 for updates which are not yet reflected in this PR.