-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refact(surgery): make surgery a bit less painful to modify
- Loading branch information
1 parent
8beb0cd
commit dc1bd56
Showing
35 changed files
with
3,284 additions
and
3,035 deletions.
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.