Merge branch 'master' of https://github.com/PolarisSS13/Polaris into polaris-sync-2017-06-01

# Conflicts:
#	code/game/objects/structures/crates_lockers/closets/secure/security.dm
#	code/modules/multiz/movement.dm
#	code/modules/projectiles/ammunition/magazines.dm
This commit is contained in:
Leshana
2017-06-01 17:27:00 -04:00
72 changed files with 1606 additions and 1106 deletions
+26 -7
View File
@@ -1,5 +1,8 @@
/* SURGERY STEPS */
/obj/
var/surgery_odds = 0 // Used for tables/etc which can have surgery done of them.
/datum/surgery_step
var/priority = 0 //steps with higher priority would be attempted first
@@ -111,13 +114,29 @@
return 1
M.op_stage.in_progress += zone
S.begin_step(user, M, zone, src) //start on it
//We had proper tools! (or RNG smiled.) and user did not move or change hands.
if(prob(S.tool_quality(src)) && do_mob(user, M, rand(S.min_duration, S.max_duration)))
S.end_step(user, M, zone, src) //finish successfully
else if ((src in user.contents) && user.Adjacent(M)) //or
S.fail_step(user, M, zone, src) //malpractice~
else // This failing silently was a pain.
user << "<span class='warning'>You must remain close to your patient to conduct surgery.</span>"
var/success = TRUE
// Bad tools make it less likely to succeed.
if(!prob(S.tool_quality(src)))
success = FALSE
// Bad or no surface may mean failure as well.
var/obj/surface = M.get_surgery_surface()
if(!surface || !prob(surface.surgery_odds))
success = FALSE
// Not staying still fails you too.
if(success)
if(!do_mob(user, M, rand(S.min_duration, S.max_duration)))
success = FALSE
else
to_chat(user, "<span class='warning'>You must remain close to your patient to conduct surgery.</span>")
if(success)
S.end_step(user, M, zone, src)
else
S.fail_step(user, M, zone, src)
M.op_stage.in_progress -= zone // Clear the in-progress flag.
if (ishuman(M))
var/mob/living/carbon/human/H = M