Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into proc-define-shit
This commit is contained in:
@@ -61,7 +61,7 @@
|
||||
return FALSE
|
||||
source.visible_message("<span class='warning'>[user] starts picking up [source].</span>", \
|
||||
"<span class='userdanger'>[user] starts picking you up!</span>")
|
||||
if(!do_after(user, 20, target = source) || source.buckled)
|
||||
if(!do_after(user, 2 SECONDS, target = source) || source.buckled)
|
||||
return FALSE
|
||||
|
||||
source.visible_message("<span class='warning'>[user] picks up [source]!</span>", \
|
||||
@@ -95,6 +95,7 @@
|
||||
dynamic_hair_suffix = ""
|
||||
var/mob/living/held_mob
|
||||
var/escape_on_find
|
||||
var/destroying = FALSE
|
||||
|
||||
/obj/item/clothing/head/mob_holder/Initialize(mapload, mob/living/target, worn_state, alt_worn, right_hand, left_hand, slots = NONE)
|
||||
. = ..()
|
||||
@@ -134,45 +135,54 @@
|
||||
w_class = WEIGHT_CLASS_HUGE
|
||||
|
||||
/obj/item/clothing/head/mob_holder/Destroy()
|
||||
destroying = TRUE
|
||||
if(held_mob)
|
||||
release()
|
||||
release(FALSE)
|
||||
return ..()
|
||||
|
||||
/obj/item/clothing/head/mob_holder/examine(mob/user)
|
||||
return held_mob?.examine(user) || ..()
|
||||
|
||||
/obj/item/clothing/head/mob_holder/Exited(atom/movable/AM, atom/newloc)
|
||||
. = ..()
|
||||
if(AM == held_mob)
|
||||
held_mob.reset_perspective()
|
||||
held_mob = null
|
||||
QDEL_IN(src, 1) //To avoid a qdel loop.
|
||||
/obj/item/clothing/head/mob_holder/on_thrown(mob/living/carbon/user, atom/target)
|
||||
if((item_flags & ABSTRACT) || HAS_TRAIT(src, TRAIT_NODROP))
|
||||
return
|
||||
if(HAS_TRAIT(user, TRAIT_PACIFISM))
|
||||
to_chat(user, span_notice("You set [src] down gently on the ground."))
|
||||
release()
|
||||
return
|
||||
|
||||
/obj/item/clothing/head/mob_holder/Entered(atom/movable/AM, atom/newloc)
|
||||
. = ..()
|
||||
if(AM != held_mob)
|
||||
var/destination = loc
|
||||
if(isliving(loc)) //the mob is held or worn, drop things on the floor
|
||||
destination = get_turf(loc)
|
||||
AM.forceMove(destination)
|
||||
var/mob/living/throw_mob = held_mob
|
||||
release()
|
||||
return throw_mob
|
||||
|
||||
/obj/item/clothing/head/mob_holder/dropped(mob/user)
|
||||
. = ..()
|
||||
if(held_mob && !ismob(loc) && !istype(loc,/obj/item/storage))//don't release on soft-drops
|
||||
if(held_mob && isturf(loc))
|
||||
release()
|
||||
|
||||
/obj/item/clothing/head/mob_holder/proc/release()
|
||||
if(held_mob)
|
||||
var/mob/living/L = held_mob
|
||||
held_mob = null
|
||||
L.forceMove(get_turf(L))
|
||||
L.reset_perspective()
|
||||
L.setDir(SOUTH)
|
||||
if(!QDELETED(src))
|
||||
/obj/item/clothing/head/mob_holder/proc/release(del_on_release = TRUE, display_messages = TRUE)
|
||||
if(!held_mob)
|
||||
if(del_on_release && !destroying)
|
||||
qdel(src)
|
||||
return FALSE
|
||||
var/mob/living/released_mob = held_mob
|
||||
held_mob = null // stops the held mob from being release()'d twice.
|
||||
if(isliving(loc))
|
||||
var/mob/living/L = loc
|
||||
if(display_messages)
|
||||
to_chat(L, span_warning("[released_mob] wriggles free!"))
|
||||
L.dropItemToGround(src)
|
||||
released_mob.forceMove(drop_location())
|
||||
released_mob.reset_perspective()
|
||||
released_mob.setDir(SOUTH)
|
||||
if(display_messages)
|
||||
released_mob.visible_message(span_warning("[released_mob] uncurls!"))
|
||||
if(del_on_release && !destroying)
|
||||
qdel(src)
|
||||
return TRUE
|
||||
|
||||
/obj/item/clothing/head/mob_holder/relaymove(mob/user)
|
||||
return
|
||||
/obj/item/clothing/head/mob_holder/relaymove(mob/living/user, direction)
|
||||
container_resist()
|
||||
|
||||
/obj/item/clothing/head/mob_holder/container_resist()
|
||||
if(isliving(loc))
|
||||
@@ -180,6 +190,11 @@
|
||||
L.visible_message("<span class='warning'>[held_mob] escapes from [L]!</span>", "<span class='warning'>[held_mob] escapes your grip!</span>")
|
||||
release()
|
||||
|
||||
/obj/item/clothing/head/mob_holder/Exited(atom/movable/gone, direction)
|
||||
. = ..()
|
||||
if(held_mob && held_mob == gone)
|
||||
release()
|
||||
|
||||
/obj/item/clothing/head/mob_holder/mob_can_equip(M, equipper, slot, disable_warning, bypass_equip_delay_self)
|
||||
if(M == held_mob || !ishuman(M)) //monkeys holding monkeys holding monkeys...
|
||||
return FALSE
|
||||
@@ -232,7 +247,9 @@
|
||||
return location.transfer_air(taker, ratio)
|
||||
|
||||
// escape when found if applicable
|
||||
/obj/item/clothing/head/mob_holder/on_found(mob/living/finder)
|
||||
/obj/item/clothing/head/mob_holder/on_found(mob/finder)
|
||||
if(escape_on_find)
|
||||
finder.visible_message("[finder] accidentally releases the [held_mob]!")
|
||||
release()
|
||||
to_chat(finder, span_warning("\A [held_mob.name] pops out! "))
|
||||
finder.visible_message(span_warning("\A [held_mob.name] pops out of the container [finder] is opening!"), ignored_mobs = finder)
|
||||
release(TRUE, FALSE)
|
||||
return
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
icon = to_reskin.unique_reskin[reskin_option]["icon"] ? to_reskin.unique_reskin[reskin_option]["icon"] : to_reskin.icon,
|
||||
icon_state = to_reskin.unique_reskin[reskin_option]["icon_state"] ? to_reskin.unique_reskin[reskin_option]["icon_state"] : to_reskin.icon_state)
|
||||
items += list("[reskin_option]" = item_image)
|
||||
sortList(items)
|
||||
items = sort_list(items)
|
||||
|
||||
// Display to the user
|
||||
var/pick = show_radial_menu(user, to_reskin, items, custom_check = CALLBACK(src, PROC_REF(check_reskin_menu), user, to_reskin), radius = 38, require_near = TRUE)
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
if(suits_with_helmet_typecache[A.type])
|
||||
RegisterSignal(A, COMSIG_SUIT_MADE_HELMET, PROC_REF(register_helmet)) //you better work now you slut
|
||||
else if(_flags & POLYCHROMIC_ACTION && ismob(A)) //in the event mob update icon procs are ever standarized.
|
||||
var/datum/action/polychromic/P = new(A)
|
||||
var/datum/action/item_action/polychromic/P = new(A)
|
||||
RegisterSignal(P, COMSIG_ACTION_TRIGGER, PROC_REF(activate_action))
|
||||
actions_by_atom[A] = P
|
||||
P.Grant(A)
|
||||
@@ -73,7 +73,7 @@
|
||||
/datum/element/polychromic/Detach(atom/A)
|
||||
. = ..()
|
||||
colors_by_atom -= A
|
||||
var/datum/action/polychromic/P = actions_by_atom[A]
|
||||
var/datum/action/item_action/polychromic/P = actions_by_atom[A]
|
||||
if(P)
|
||||
actions_by_atom -= A
|
||||
qdel(P)
|
||||
@@ -146,7 +146,7 @@
|
||||
/datum/element/polychromic/proc/grant_user_action(atom/source, mob/user, slot)
|
||||
if(slot == ITEM_SLOT_BACKPACK || slot == ITEM_SLOT_LEGCUFFED || slot == ITEM_SLOT_HANDCUFFED || slot == ITEM_SLOT_DEX_STORAGE)
|
||||
return
|
||||
var/datum/action/polychromic/P = actions_by_atom[source]
|
||||
var/datum/action/item_action/polychromic/P = actions_by_atom[source]
|
||||
if(!P)
|
||||
P = new (source)
|
||||
P.name = "Modify [source]'\s Colors"
|
||||
@@ -156,7 +156,7 @@
|
||||
P.Grant(user)
|
||||
|
||||
/datum/element/polychromic/proc/remove_user_action(atom/source, mob/user)
|
||||
var/datum/action/polychromic/P = actions_by_atom[source]
|
||||
var/datum/action/item_action/polychromic/P = actions_by_atom[source]
|
||||
P?.Remove(user)
|
||||
|
||||
/datum/element/polychromic/proc/activate_action(datum/action/source, atom/target)
|
||||
@@ -197,9 +197,14 @@
|
||||
helmet_by_suit -= S
|
||||
colors_by_atom -= source
|
||||
|
||||
/datum/action/polychromic
|
||||
/datum/action/item_action/polychromic
|
||||
name = "Modify Polychromic Colors"
|
||||
background_icon_state = "bg_polychromic"
|
||||
use_target_appearance = TRUE
|
||||
button_icon_state = null
|
||||
target_appearance_matrix = list(0.8,0,0,0,0.8,0)
|
||||
check_flags = NONE
|
||||
|
||||
/datum/action/item_action/polychromic/ApplyIcon(atom/movable/screen/movable/action_button/current_button, force)
|
||||
var/matrix/save_matrix = target.transform
|
||||
target.transform = matrix(0.8, 0, 0, 0, 0.8, 0)
|
||||
. = ..()
|
||||
target.transform = save_matrix
|
||||
|
||||
Reference in New Issue
Block a user