mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-11 10:22:13 +00:00
Merge pull request #14086 from Citadel-Station-13/silicons-patch-25
officially adds the functionality to insert holdable mobs into colormate
This commit is contained in:
@@ -6,10 +6,12 @@
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
circuit = /obj/item/circuitboard/machine/colormate
|
||||
var/obj/item/inserted
|
||||
var/atom/movable/inserted
|
||||
var/activecolor = "#FFFFFF"
|
||||
var/list/color_matrix_last
|
||||
var/matrix_mode = FALSE
|
||||
/// Allow holder'd mobs
|
||||
var/allow_mobs = TRUE
|
||||
/// Minimum lightness for normal mode
|
||||
var/minimum_normal_lightness = 50
|
||||
/// Minimum lightness for matrix mode, tested using 4 test colors of full red, green, blue, white.
|
||||
@@ -57,6 +59,15 @@
|
||||
return
|
||||
if(user.a_intent == INTENT_HARM)
|
||||
return ..()
|
||||
if(allow_mobs && istype(I, /obj/item/clothing/head/mob_holder))
|
||||
var/obj/item/clothing/head/mob_holder/H = I
|
||||
var/mob/victim = H.held_mob
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
to_chat(user, "<span class='warning'>[I] is stuck to your hand!</span>")
|
||||
return
|
||||
if(!QDELETED(H))
|
||||
H.release()
|
||||
insert_mob(victim, user)
|
||||
|
||||
if(is_type_in_list(I, allowed_types) && is_operational())
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
@@ -71,6 +82,14 @@
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/gear_painter/proc/insert_mob(mob/victim, mob/user)
|
||||
if(inserted)
|
||||
return
|
||||
if(user)
|
||||
visible_message("<span class='warning'>[user] stuffs [victim] into [src]!</span>")
|
||||
inserted = victim
|
||||
inserted.forceMove(src)
|
||||
|
||||
/obj/machinery/gear_painter/AllowDrop()
|
||||
return FALSE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user