Merge pull request #8886 from Ghommie/Ghommie-cit137

Ports "Refactors NODROP flag into TRAIT_NODROP"
This commit is contained in:
kevinz000
2019-07-14 14:05:20 -07:00
committed by GitHub
82 changed files with 388 additions and 211 deletions
+4 -4
View File
@@ -275,7 +275,7 @@
/mob/proc/canUnEquip(obj/item/I, force)
if(!I)
return TRUE
if((I.item_flags & NODROP) && !force)
if(HAS_TRAIT(I, TRAIT_NODROP) && !force)
return FALSE
return TRUE
@@ -309,13 +309,13 @@
//DO NOT CALL THIS PROC
//use one of the above 3 helper procs
//you may override it, but do not modify the args
/mob/proc/doUnEquip(obj/item/I, force, newloc, no_move, invdrop = TRUE) //Force overrides NODROP_1 for things like wizarditis and admin undress.
/mob/proc/doUnEquip(obj/item/I, force, newloc, no_move, invdrop = TRUE) //Force overrides TRAIT_NODROP for things like wizarditis and admin undress.
//Use no_move if the item is just gonna be immediately moved afterward
//Invdrop is used to prevent stuff in pockets dropping. only set to false if it's going to immediately be replaced
if(!I) //If there's nothing to drop, the drop is automatically succesfull. If(unEquip) should generally be used to check for NODROP_1.
if(!I) //If there's nothing to drop, the drop is automatically succesfull. If(unEquip) should generally be used to check for TRAIT_NODROP.
return TRUE
if((I.item_flags & NODROP) && !force)
if(HAS_TRAIT(I, TRAIT_NODROP) && !force)
return FALSE
var/hand_index = get_held_index_of_item(I)
+5 -1
View File
@@ -138,7 +138,11 @@
name = "blood crawl"
desc = "You are unable to hold anything while in this form."
icon = 'icons/effects/blood.dmi'
item_flags = NODROP | ABSTRACT
item_flags = ABSTRACT
/obj/item/bloodcrawl/Initialize()
. = ..()
ADD_TRAIT(src, TRAIT_NODROP, ABSTRACT_ITEM_TRAIT)
/mob/living/proc/exit_blood_effect(obj/effect/decal/cleanable/B)
playsound(get_turf(src), 'sound/magic/exit_blood.ogg', 100, 1, -1)
@@ -103,9 +103,13 @@
name = "\improper royal parasite"
desc = "Inject this into one of your grown children to promote her to a Praetorian!"
icon_state = "alien_medal"
item_flags = ABSTRACT | NODROP | DROPDEL
item_flags = ABSTRACT | DROPDEL
icon = 'icons/mob/alien.dmi'
/obj/item/queenpromote/Initialize()
. = ..()
ADD_TRAIT(src, TRAIT_NODROP, ABSTRACT_ITEM_TRAIT)
/obj/item/queenpromote/attack(mob/living/M, mob/living/carbon/alien/humanoid/user)
if(!isalienadult(M) || isalienroyal(M))
to_chat(user, "<span class='noticealien'>You may only use this with your adult, non-royal children!</span>")
+2 -2
View File
@@ -175,7 +175,7 @@
if(start_T && end_T)
log_combat(src, throwable_mob, "thrown", addition="grab from tile in [AREACOORD(start_T)] towards tile at [AREACOORD(end_T)]")
else if(!(I.item_flags & (NODROP | ABSTRACT)))
else if(!CHECK_BITFIELD(I.item_flags, ABSTRACT) && !HAS_TRAIT(I, TRAIT_NODROP))
thrown_thing = I
dropItemToGround(I)
@@ -409,7 +409,7 @@
return initial(pixel_y)
/mob/living/carbon/proc/accident(obj/item/I)
if(!I || (I.item_flags & (NODROP | ABSTRACT)))
if(!I || (I.item_flags & ABSTRACT) || HAS_TRAIT(I, TRAIT_NODROP))
return
//dropItemToGround(I) CIT CHANGE - makes it so the item doesn't drop if the modifier rolls above 100
@@ -252,7 +252,7 @@
var/delay_denominator = 1
if(pocket_item && !(pocket_item.item_flags & ABSTRACT))
if(pocket_item.item_flags & NODROP)
if(HAS_TRAIT(pocket_item, TRAIT_NODROP))
to_chat(usr, "<span class='warning'>You try to empty [src]'s [pocket_side] pocket, it seems to be stuck!</span>")
to_chat(usr, "<span class='notice'>You try to empty [src]'s [pocket_side] pocket.</span>")
else if(place_item && place_item.mob_can_equip(src, usr, pocket_id, 1) && !(place_item.item_flags & ABSTRACT))
@@ -279,7 +279,7 @@ GLOBAL_LIST_EMPTY(roundstart_races)
if(mutanthands)
// Drop items in hands
// If you're lucky enough to have a NODROP_1 item, then it stays.
// If you're lucky enough to have a TRAIT_NODROP item, then it stays.
for(var/V in C.held_items)
var/obj/item/I = V
if(istype(I))
@@ -1072,7 +1072,7 @@ GLOBAL_LIST_EMPTY(roundstart_races)
return FALSE
return equip_delay_self_check(I, H, bypass_equip_delay_self)
if(SLOT_L_STORE)
if(I.item_flags & NODROP) //Pockets aren't visible, so you can't move NODROP_1 items into them.
if(HAS_TRAIT(I, TRAIT_NODROP)) //Pockets aren't visible, so you can't move TRAIT_NODROP items into them.
return FALSE
if(H.l_store)
return FALSE
@@ -1088,7 +1088,7 @@ GLOBAL_LIST_EMPTY(roundstart_races)
if( I.w_class <= WEIGHT_CLASS_SMALL || (I.slot_flags & ITEM_SLOT_POCKET) )
return TRUE
if(SLOT_R_STORE)
if(I.item_flags & NODROP)
if(HAS_TRAIT(I, TRAIT_NODROP))
return FALSE
if(H.r_store)
return FALSE
@@ -1105,7 +1105,7 @@ GLOBAL_LIST_EMPTY(roundstart_races)
return TRUE
return FALSE
if(SLOT_S_STORE)
if(I.item_flags & NODROP)
if(HAS_TRAIT(I, TRAIT_NODROP))
return FALSE
if(H.s_store)
return FALSE
@@ -171,12 +171,13 @@
armour_penetration = 35
lefthand_file = 'icons/mob/inhands/antag/changeling_lefthand.dmi'
righthand_file = 'icons/mob/inhands/antag/changeling_righthand.dmi'
item_flags = ABSTRACT | NODROP | DROPDEL
item_flags = ABSTRACT | DROPDEL
w_class = WEIGHT_CLASS_HUGE
sharpness = IS_SHARP
/obj/item/light_eater/Initialize()
. = ..()
ADD_TRAIT(src, TRAIT_NODROP, HAND_REPLACEMENT_TRAIT)
AddComponent(/datum/component/butchering, 80, 70)
/obj/item/light_eater/afterattack(atom/movable/AM, mob/user, proximity)
@@ -115,7 +115,7 @@
/mob/living/carbon/monkey/proc/handle_combat()
if(pickupTarget)
if(restrained() || blacklistItems[pickupTarget] || (pickupTarget.item_flags & NODROP))
if(restrained() || blacklistItems[pickupTarget] || HAS_TRAIT(pickupTarget, TRAIT_NODROP))
pickupTarget = null
else
pickupTimer++
+3 -3
View File
@@ -281,7 +281,7 @@
var/datum/disease/D = thing
if(D.spread_flags & DISEASE_SPREAD_CONTACT_SKIN)
ContactContractDisease(D)
if(iscarbon(L))
var/mob/living/carbon/C = L
if(HAS_TRAIT(src, TRAIT_STRONG_GRABBER))
@@ -699,7 +699,7 @@
// The src mob is trying to strip an item from someone
// Override if a certain type of mob should be behave differently when stripping items (can't, for example)
/mob/living/stripPanelUnequip(obj/item/what, mob/who, where)
if(what.item_flags & NODROP)
if(HAS_TRAIT(what, TRAIT_NODROP))
to_chat(src, "<span class='warning'>You can't remove \the [what.name], it appears to be stuck!</span>")
return
who.visible_message("<span class='danger'>[src] tries to remove [who]'s [what.name].</span>", \
@@ -724,7 +724,7 @@
// Override if a certain mob should be behave differently when placing items (can't, for example)
/mob/living/stripPanelEquip(obj/item/what, mob/who, where)
what = src.get_active_held_item()
if(what && (what.item_flags & NODROP))
if(what && HAS_TRAIT(what, TRAIT_NODROP))
to_chat(src, "<span class='warning'>You can't put \the [what.name] on [who], it's stuck to your hand!</span>")
return
if(what)
@@ -119,7 +119,7 @@
if(I.loc != src)
I.forceMove(src)
modules += I
I.item_flags |= NODROP
ADD_TRAIT(I, TRAIT_NODROP, CYBORG_ITEM_TRAIT)
I.mouse_opacity = MOUSE_OPACITY_OPAQUE
if(nonstandard)
added_modules += I
@@ -93,7 +93,7 @@
var/obj/item/I = new default_hatmask(src)
equip_to_slot_or_del(I, SLOT_HEAD)
access_card.item_flags |= NODROP
ADD_TRAIT(access_card, TRAIT_NODROP, ABSTRACT_ITEM_TRAIT)
alert_drones(DRONE_NET_CONNECT)