Merge pull request #11074 from farie82/refactor-pickup-and-fix-bomb

Refactored pickup code and fixed the bomb guardian bug
This commit is contained in:
variableundefined
2019-03-23 20:04:15 +08:00
committed by GitHub
16 changed files with 26 additions and 21 deletions
+1 -1
View File
@@ -121,7 +121,7 @@
return
/obj/item/assembly_holder/pickup()
..()
. = ..()
process_movement()
/obj/item/assembly_holder/Bump()
+1
View File
@@ -478,4 +478,5 @@
update_icon()
/obj/item/cardhand/pickup(mob/user as mob)
. = ..()
update_icon()
+1 -1
View File
@@ -199,7 +199,7 @@
qdel(src)
/obj/item/grown/novaflower/pickup(mob/living/carbon/human/user)
..()
. = ..()
if(!user.gloves)
to_chat(user, "<span class='danger'>The [name] burns your bare hand!</span>")
user.adjustFireLoss(rand(1, 5))
+6 -5
View File
@@ -50,17 +50,17 @@
/obj/item/grown/nettle/pickup(mob/living/user)
..()
if(!ishuman(user))
return 0
return TRUE
var/mob/living/carbon/human/H = user
if(H.gloves)
return 0
return TRUE
var/organ = ((H.hand ? "l_":"r_") + "arm")
var/obj/item/organ/external/affecting = H.get_organ(organ)
if(affecting)
if(affecting.receive_damage(0, force))
H.UpdateDamageIcon()
to_chat(H, "<span class='userdanger'>The nettle burns your bare hand!</span>")
return 1
return TRUE
@@ -95,8 +95,9 @@
force = round((5 + seed.potency / 2.5), 1)
/obj/item/grown/nettle/death/pickup(mob/living/carbon/user)
if(..())
if(prob(50))
if(..() && ishuman(user)) // If the pickup succeeded and is humanoid
var/mob/living/carbon/human/H = user
if(!H.gloves && prob(50))
user.Paralyse(5)
to_chat(user, "<span class='userdanger'>You are stunned by the Deathnettle when you try picking it up!</span>")
@@ -157,6 +157,7 @@ old_ue: Set this to a UE string, and this proc will overwrite the dna of organs
var/list/all_bits = internal_organs|bodyparts
for(var/obj/item/organ/O in all_bits)
if(assimilate || O.dna.unique_enzymes == ue_to_compare)
message_admins("organ: [O.name]")
O.set_dna(dna)
/*
+1 -1
View File
@@ -711,7 +711,7 @@
H.reagents.add_reagent(contact_poison, contact_poison_volume)
contact_poison = null
add_attack_logs(src, user, "Picked up [src], the paper poisoned by [contact_poison_poisoner]")
..()
. = ..()
/obj/item/paper/researchnotes
name = "paper - 'Research Notes'"
+1 -1
View File
@@ -311,7 +311,7 @@ obj/item/gun/proc/newshot()
visible_message("<span class='danger'>[src]'s light fades and turns off.</span>")
/obj/item/gun/pickup(mob/user)
..()
. = ..()
if(azoom)
azoom.Grant(user)
@@ -24,7 +24,7 @@
update_icon()
/obj/item/reagent_containers/iv_bag/pickup(mob/user)
..()
. = ..()
update_icon()
/obj/item/reagent_containers/iv_bag/dropped(mob/user)
@@ -31,7 +31,7 @@
update_icon()
/obj/item/reagent_containers/syringe/pickup(mob/user)
..()
. = ..()
update_icon()
/obj/item/reagent_containers/syringe/dropped(mob/user)
@@ -197,7 +197,7 @@
update_icon()
/obj/item/reagent_containers/ld50_syringe/pickup(mob/user)
..()
. = ..()
update_icon()
/obj/item/reagent_containers/ld50_syringe/dropped(mob/user)