mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-11 07:05:36 +01:00
4379dd2c1b
Skills being based on "Hard Requirements" absolutely suck, and I wasn't happy with the surgery code being essentially hardcoded around them. So this PR refactors surgery to use soft requirement checks, based on modifiers to the success rate probability. Surgeries still state what skills (if any) they require and at what level, but rather than blocking the surgery, it instead imposes a penalty(or bonus) on the success chance based on how much the user's surgical skill differs from the required level. This actually stacks with the penalties for "non ideal tools", so if you're completely unskilled in surgery and you attempt to make an incision with a shard of glass, you're going to have an extremely hard time. Individual surgeries also can define how much the success rate is modified by "skill diff", with the more advanced "surgeon exclusive" surgeries having extremely large potential modifiers. I have also added a signal based check for modifiers, which the Morale component now hooks into. This can also allow for other components, implants, drugs, etc to modify the surgery chances in the future. I have manually tested this PR and verified by examining debug breakpoints in VSCode that the system correctly applies its modifiers.
34 lines
1.0 KiB
Plaintext
34 lines
1.0 KiB
Plaintext
#define SURGERY_FAILURE -1
|
|
|
|
// organ open flags
|
|
#define ORGAN_CLOSED 0
|
|
#define ORGAN_OPEN_INCISION 1 // skin incision OR hatch unscrewed
|
|
#define ORGAN_OPEN_RETRACTED 2 // skin retracted
|
|
#define ORGAN_ENCASED_OPEN 2.5 // bones e.g. ribcage sawed open
|
|
#define ORGAN_ENCASED_RETRACTED 3 // bones retracted OR hatch opened
|
|
|
|
// facial surgery
|
|
#define FACE_NORMAL 0
|
|
#define FACE_CUT_OPEN 1
|
|
#define FACE_RETRACTED 2
|
|
#define FACE_ALTERED 3
|
|
|
|
//bone repair
|
|
#define BONE_PRE_OP 0
|
|
#define BONE_GLUED 1
|
|
#define BONE_SET 2
|
|
|
|
//cavity
|
|
#define CAVITY_CLOSED 0
|
|
#define CAVITY_OPEN 1
|
|
|
|
//macros
|
|
#define IS_ORGAN_FULLY_OPEN affected.open == ((affected.encased || affected.robotic) ? ORGAN_ENCASED_RETRACTED : ORGAN_OPEN_RETRACTED)
|
|
|
|
//skill difficulty ratings
|
|
#define SURGERY_DIFFICULTY_TRIVIAL 10
|
|
#define SURGERY_DIFFICULTY_EASY 15
|
|
#define SURGERY_DIFFICULTY_MEDIUM 20
|
|
#define SURGERY_DIFFICULTY_HARD 25
|
|
#define SURGERY_DIFFICULTY_EXTREME 33
|