mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 02:54:41 +01:00
Fixes #5563
This commit is contained in:
@@ -193,9 +193,12 @@
|
||||
// SLIME CORE EXTRACTION //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/surgery_step/slime/
|
||||
/datum/surgery_step/slime
|
||||
is_valid_target(mob/living/carbon/slime/target)
|
||||
return istype(target, /mob/living/carbon/slime/)
|
||||
|
||||
can_use(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
return istype(target, /mob/living/carbon/slime/) && target.stat == 2
|
||||
return target.stat == 2
|
||||
|
||||
/datum/surgery_step/slime/cut_flesh
|
||||
allowed_tools = list(
|
||||
|
||||
@@ -25,8 +25,10 @@
|
||||
return allowed_tools[T]
|
||||
return 0
|
||||
|
||||
// Checks if this step applies to the mutantrace of the user.
|
||||
proc/is_valid_mutantrace(mob/living/carbon/human/target)
|
||||
// Checks if this step applies to the user mob at all
|
||||
proc/is_valid_target(mob/living/carbon/human/target)
|
||||
if(!hasorgans(target))
|
||||
return 0
|
||||
|
||||
if(allowed_species)
|
||||
for(var/species in allowed_species)
|
||||
@@ -40,6 +42,7 @@
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
// checks whether this step can be applied with the given user and target
|
||||
proc/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return 0
|
||||
@@ -81,7 +84,7 @@ proc/do_surgery(mob/living/M, mob/living/user, obj/item/tool)
|
||||
return 0
|
||||
for(var/datum/surgery_step/S in surgery_steps)
|
||||
//check if tool is right or close enough and if this step is possible
|
||||
if( S.tool_quality(tool) && S.can_use(user, M, user.zone_sel.selecting, tool) && S.is_valid_mutantrace(M))
|
||||
if( S.tool_quality(tool) && S.can_use(user, M, user.zone_sel.selecting, tool) && S.is_valid_target(M))
|
||||
S.begin_step(user, M, user.zone_sel.selecting, tool) //start on it
|
||||
//We had proper tools! (or RNG smiled.) and User did not move or change hands.
|
||||
if( prob(S.tool_quality(tool)) && do_mob(user, M, rand(S.min_duration, S.max_duration)))
|
||||
|
||||
Reference in New Issue
Block a user