-
Notifications
You must be signed in to change notification settings - Fork 211
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
refact(surgery): make surgery a bit less painful to modify #10689
Merged
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
7534d21
make surgery_steps variable a GLOB
intercepti0n f027e32
disable old & enable new surgery_step
intercepti0n e5e53e4
update surgery_status field init
intercepti0n 61ffe89
temporary disable medical integrated circuits
intercepti0n a0e6c94
properly disable medical circuits
intercepti0n 3343211
improve surgery step code & add documentation
intercepti0n 81f6a28
add more proc checks to surgery step
intercepti0n b7fde68
convert bone surgery steps
intercepti0n 864b5b0
convert limb surgery steps
intercepti0n d40dc76
convert generic surgery steps
intercepti0n 944f08f
update do_surgery proc logic
intercepti0n 773ad71
remove old encased steps
intercepti0n e46e088
prettify old surgery helper procs
intercepti0n c3d961a
add extra checks to prevent tool switching during step
intercepti0n f798355
convert internal surgery steps
intercepti0n bda4fa6
convert face surgery steps
intercepti0n 5162ba2
convert misc surgery steps
intercepti0n 87fd190
purge metroid surgery steps
intercepti0n 17220b6
purge remaining old surgery files
intercepti0n 8220c02
fix associative issues
intercepti0n 773b351
convert robotic surgery steps
intercepti0n 4b90fb1
fix checks and proc calls in internal steps
intercepti0n 25676b5
convert implant surgery steps
intercepti0n e22a083
fix logic in surgery status
intercepti0n 5a87b05
add comments
intercepti0n d40717b
include surgery step files
intercepti0n ae39346
probably make integrated circuits work
intercepti0n 6b604f5
fix integrated circuits not performing operations
intercepti0n 669e39e
add fluff to some surgery errors
intercepti0n cf3e0e1
make Toby hate me less, at least i hope so
intercepti0n 6f259fb
prettify radial menu canceling
intercepti0n 37f7e61
make internal circuits work
intercepti0n f51b001
squash multiline comment
intercepti0n 2a3bf74
fix zone check in head bone surgery step
intercepti0n b9db91c
add defines 'cause idk they're cool
intercepti0n 6a0e91d
remove unhandled tool type
intercepti0n 19cf19d
fix inability to cut limbs and insert organs
intercepti0n File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/// Sorts GLOB surgeries list by priority. | ||
/proc/sort_surgeries() | ||
var/gap = length(GLOB.surgery_steps) | ||
var/swapped = TRUE | ||
while(gap > 1 || swapped) | ||
swapped = FALSE | ||
if(gap > 1) | ||
gap = round(gap / 1.247330950103979) | ||
if(gap < 1) | ||
gap = 1 | ||
for(var/i = 1; gap + i <= length(GLOB.surgery_steps); i++) | ||
var/datum/surgery_step/l = GLOB.surgery_steps[i] | ||
var/datum/surgery_step/r = GLOB.surgery_steps[gap + i] | ||
if(l.priority < r.priority) | ||
GLOB.surgery_steps.Swap(i, gap + i) | ||
swapped = TRUE | ||
|
||
/// Creates and "centers" organ image for later use inside radial menu. | ||
/proc/agjust_organ_image(obj/item/organ/O) | ||
var/image/I = image(icon = O.icon, icon_state = O.icon_state) | ||
I.overlays = O.overlays | ||
I.pixel_y = -5 | ||
return I |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#define SURGERY_FAILURE -1 | ||
|
||
/// Causes hands to become bloody. | ||
#define BLOODY_HANDS (1 << 0) | ||
/// Causes body to become bloody. | ||
#define BLOODY_BODY (1 << 1) | ||
|
||
/// Delta multiplier for all surgeries, ranges from 0.9 to 1.1. | ||
#define SURGERY_DURATION_DELTA rand(9, 11) / 10 | ||
|
||
#define CUT_DURATION 30 | ||
#define AMPUTATION_DURATION 125 | ||
#define CLAMP_DURATION 35 | ||
#define RETRACT_DURATION 25 | ||
#define CAUTERIZE_DURATION 35 | ||
#define GLUE_BONE_DURATION 35 | ||
#define BONE_MEND_DURATION 40 | ||
#define SAW_DURATION 50 | ||
#define DRILL_DURATION 70 | ||
#define ATTACH_DURATION 50 | ||
#define ORGAN_FIX_DURATION 35 | ||
#define CONNECT_DURATION 50 | ||
#define STERILIZATION_DURATION 55 | ||
#define DETATCH_DURATION 52 | ||
#define TREAT_NECROSIS_DURATION 26 |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
какой нахуй DETATCH
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.
Как же он издевается...