-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Operations That Cannot Fail Should Use Lowest Quality Medicine #36
base: 1.3
Are you sure you want to change the base?
Conversation
} | ||
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)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
{ | ||
Pawn patient = billGiver as Pawn; | ||
//MedicalCareCategory medicalCareCategory = GetMedicalCareCategory(billGiver); | ||
MedicalCareCategory medicalCareCategory = PharmacistUtility.TendAdvice(patient, InjurySeverity.Operation); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we're here, this line obsoletes the other patch.
This looks like a great change |
DO NOT MERGESee #35 for updates which are not yet reflected in this PR. |
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 false
prefix.DO NOT MERGE
See #35 for updates which are not yet reflected in this PR.