From 6ab6f4ada0c801d0f325427b57df627b9e80b20d Mon Sep 17 00:00:00 2001 From: Giacomand Date: Mon, 6 Jan 2014 17:21:13 +0000 Subject: [PATCH 1/4] Re-added the recycler's emag functionality and changed it so that it does massive brute damage and eats the person's equipped items. The blood on the recycler is now scannable by a forensic scanner. Fingerprints will now properly show up on the recycler. The status effect procs will now properly update the can_move() Admins can now possess the recycler to properly get it to gib people that it moves into. The mineral stacker in disposals will now release stacks of 10. --- code/game/atoms.dm | 36 +++++++++++++++-------------- code/game/machinery/recycler.dm | 41 ++++++++++++++++++++++++--------- code/modules/mob/mob.dm | 12 ++++++++++ maps/tgstation.2.1.2.dmm | 2 +- 4 files changed, 62 insertions(+), 29 deletions(-) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 400d6961ae7..1ab93c49bad 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -239,25 +239,35 @@ var/list/blood_splatter_icons = list() /atom/proc/blood_splatter_index() return "\ref[initial(icon)]-[initial(icon_state)]" +/atom/proc/add_blood_list(mob/living/carbon/M) + // Returns 1 if we had blood already + if(!istype(blood_DNA, /list)) //if our list of DNA doesn't exist yet (or isn't a list) initialise it. + blood_DNA = list() + //if this blood isn't already in the list, add it + if(blood_DNA[M.dna.unique_enzymes]) + return 0 //already bloodied with this blood. Cannot add more. + blood_DNA[M.dna.unique_enzymes] = M.dna.blood_type + return 1 + //returns 1 if made bloody, returns 0 otherwise /atom/proc/add_blood(mob/living/carbon/M) if(rejects_blood()) return 0 - if(!initial(icon) || !initial(icon_state)) - return 0 if(!istype(M)) return 0 if(!check_dna_integrity(M)) //check dna is valid and create/setup if necessary return 0 //no dna! - if(!istype(blood_DNA, /list)) //if our list of DNA doesn't exist yet (or isn't a list) initialise it. - blood_DNA = list() return -/obj/item/add_blood(mob/living/carbon/M) - if(..() == 0) return 0 +/obj/add_blood(mob/living/carbon/M) + if(..() == 0) return 0 + return add_blood_list(M) +/obj/item/add_blood(mob/living/carbon/M) + var/blood_count = blood_DNA == null ? 0 : blood_DNA.len + if(..() == 0) return 0 //apply the blood-splatter overlay if it isn't already in there - if(!blood_DNA.len) + if(!blood_count && initial(icon) && initial(icon_state)) //try to find a pre-processed blood-splatter. otherwise, make a new one var/index = blood_splatter_index() var/icon/blood_splatter_icon = blood_splatter_icons[index] @@ -268,11 +278,6 @@ var/list/blood_splatter_icons = list() blood_splatter_icon = fcopy_rsc(blood_splatter_icon) blood_splatter_icons[index] = blood_splatter_icon overlays += blood_splatter_icon - - //if this blood isn't already in the list, add it - if(blood_DNA[M.dna.unique_enzymes]) - return 0 //already bloodied with this blood. Cannot add more. - blood_DNA[M.dna.unique_enzymes] = M.dna.blood_type return 1 //we applied blood to the item /turf/simulated/add_blood(mob/living/carbon/M) @@ -280,15 +285,12 @@ var/list/blood_splatter_icons = list() var/obj/effect/decal/cleanable/blood/B = locate() in contents //check for existing blood splatter if(!B) B = new /obj/effect/decal/cleanable/blood(src) //make a bloood splatter if we couldn't find one - B.blood_DNA[M.dna.unique_enzymes] = M.dna.blood_type + B.add_blood_list(M) return 1 //we bloodied the floor /mob/living/carbon/human/add_blood(mob/living/carbon/M) if(..() == 0) return 0 - - if(blood_DNA[M.dna.unique_enzymes]) - return 0 //already bloodied with this blood. Cannot add more. - blood_DNA[M.dna.unique_enzymes] = M.dna.blood_type + add_blood_list(M) update_inv_gloves() //handles bloody hands overlays and updating return 1 //we applied blood to the item diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index 5d111fa7cdf..cbe044f3918 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -12,7 +12,7 @@ var/const/SAFETY_COOLDOWN = 100 var/grinding = 0 var/icon_name = "grinder-o" var/blood = 0 - var/eat_from = WEST + var/eat_dir = WEST /obj/machinery/recycler/New() // On us @@ -30,7 +30,7 @@ var/const/SAFETY_COOLDOWN = 100 ..() update_icon() -/* + /obj/machinery/recycler/attackby(var/obj/item/I, var/mob/user) if(istype(I, /obj/item/weapon/card/emag) && !emagged) emagged = 1 @@ -44,7 +44,8 @@ var/const/SAFETY_COOLDOWN = 100 user << "You reset the crusher to its default factory settings." else ..() -*/ + return + add_fingerprint(user) /obj/machinery/recycler/update_icon() ..() @@ -53,9 +54,15 @@ var/const/SAFETY_COOLDOWN = 100 is_powered = 0 icon_state = icon_name + "[is_powered]" + "[(blood ? "bld" : "")]" // add the blood tag at the end +// This is purely for admin possession !FUN!. +/obj/machinery/recycler/Bump(var/atom/movable/AM) + ..() + if(AM) + Bumped(AM) + + /obj/machinery/recycler/Bumped(var/atom/movable/AM) - // Crossed didn't like people lying down. if(stat & (BROKEN|NOPOWER)) return if(safety_mode) @@ -69,7 +76,7 @@ var/const/SAFETY_COOLDOWN = 100 return var/move_dir = get_dir(loc, AM.loc) - if(move_dir == eat_from) + if(move_dir == eat_dir) if(isliving(AM)) if(emagged) eat(AM) @@ -81,7 +88,7 @@ var/const/SAFETY_COOLDOWN = 100 playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0) AM.loc = src.loc -/obj/machinery/recycler/proc/recycle(var/obj/item/I) +/obj/machinery/recycler/proc/recycle(var/obj/item/I, var/sound = 1) I.loc = src.loc if(!istype(I, /obj/item/weapon/disk/nuclear)) del(I) @@ -93,7 +100,8 @@ var/const/SAFETY_COOLDOWN = 100 new /obj/item/stack/sheet/plasteel(loc) if(prob(1)) new /obj/item/stack/sheet/rglass(loc) - playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) + if(sound) + playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) /obj/machinery/recycler/proc/stop(var/mob/living/L) @@ -110,20 +118,31 @@ var/const/SAFETY_COOLDOWN = 100 /obj/machinery/recycler/proc/eat(var/mob/living/L) L.loc = src.loc + if(issilicon(L)) playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) else playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) - if(ishuman(L)) + if(iscarbon(L)) L.say("ARRRRRRRRRRRGH!!!") + add_blood(L) - L.gib() - - if(!blood) + if(!blood && !issilicon(L)) blood = 1 update_icon() + // Remove and recycle the equipped items. + for(var/obj/item/I in L.get_equipped_items()) + L.drop_from_inventory(I) + recycle(I, 0) + L.Paralyse(5) // Instantly lie down, also go unconscious from the pain, before you die. + if(emagged == 1) + L.adjustBruteLoss(1000) + else if(emagged == 2) // For admin fun. + L.gib() + + /obj/item/weapon/paper/recycler name = "paper - 'garbage duty instructions'" diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index f6da8c3b022..058f20b00db 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -770,16 +770,19 @@ note dizziness decrements automatically in the mob's Life() proc. /mob/proc/Stun(amount) if(status_flags & CANSTUN) stunned = max(max(stunned,amount),0) //can't go below 0, getting a low amount of stun doesn't lower your current stun + update_canmove() return /mob/proc/SetStunned(amount) //if you REALLY need to set stun to a set amount without the whole "can't go below current stunned" if(status_flags & CANSTUN) stunned = max(amount,0) + update_canmove() return /mob/proc/AdjustStunned(amount) if(status_flags & CANSTUN) stunned = max(stunned + amount,0) + update_canmove() return /mob/proc/Weaken(amount) @@ -803,38 +806,47 @@ note dizziness decrements automatically in the mob's Life() proc. /mob/proc/Paralyse(amount) if(status_flags & CANPARALYSE) paralysis = max(max(paralysis,amount),0) + update_canmove() return /mob/proc/SetParalysis(amount) if(status_flags & CANPARALYSE) paralysis = max(amount,0) + update_canmove() return /mob/proc/AdjustParalysis(amount) if(status_flags & CANPARALYSE) paralysis = max(paralysis + amount,0) + update_canmove() return /mob/proc/Sleeping(amount) sleeping = max(max(sleeping,amount),0) + update_canmove() return /mob/proc/SetSleeping(amount) sleeping = max(amount,0) + update_canmove() return /mob/proc/AdjustSleeping(amount) sleeping = max(sleeping + amount,0) + update_canmove() return /mob/proc/Resting(amount) resting = max(max(resting,amount),0) + update_canmove() return /mob/proc/SetResting(amount) resting = max(amount,0) + update_canmove() return /mob/proc/AdjustResting(amount) resting = max(resting + amount,0) + update_canmove() return \ No newline at end of file diff --git a/maps/tgstation.2.1.2.dmm b/maps/tgstation.2.1.2.dmm index 582ee1dd271..77e4f7e0827 100644 --- a/maps/tgstation.2.1.2.dmm +++ b/maps/tgstation.2.1.2.dmm @@ -2714,7 +2714,7 @@ "baj" = (/obj/machinery/door/airlock/maintenance{req_access_txt = "12"},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"},/obj/structure/disposalpipe/segment,/turf/simulated/floor/plating,/area/maintenance/asmaint2) "bak" = (/turf/simulated/wall,/area/maintenance/asmaint2) "bal" = (/obj/machinery/conveyor{dir = 1; id = "garbage"},/turf/simulated/floor/plating,/area/maintenance/disposal) -"bam" = (/obj/machinery/mineral/stacking_machine,/turf/simulated/floor/plating,/area/maintenance/disposal) +"bam" = (/obj/machinery/mineral/stacking_machine{stack_amt = 10},/turf/simulated/floor/plating,/area/maintenance/disposal) "ban" = (/obj/structure/grille,/obj/structure/window/reinforced{dir = 1},/obj/structure/window/reinforced,/obj/structure/window/reinforced{dir = 4},/turf/simulated/floor/plating,/area/maintenance/disposal) "bao" = (/obj/machinery/mineral/stacking_unit_console{dir = 2; machinedir = 8},/turf/simulated/wall,/area/maintenance/disposal) "bap" = (/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; pixel_y = 0},/obj/structure/disposalpipe/segment,/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden,/turf/simulated/floor/plating,/area/maintenance/port) From 539f3e04837f044c9caf8707cba33c0b5a0dfba2 Mon Sep 17 00:00:00 2001 From: Giacomand Date: Mon, 6 Jan 2014 17:45:38 +0000 Subject: [PATCH 2/4] All non-carbon mobs will still be gibbed, robots will survive with their MMI. --- code/game/machinery/recycler.dm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index cbe044f3918..56ef42fd84e 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -124,7 +124,10 @@ var/const/SAFETY_COOLDOWN = 100 else playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) + var/gib = 1 + // By default, the emagged recycler will gib all non-carbons. (human simple animal mobs don't count) if(iscarbon(L)) + gib = 0 L.say("ARRRRRRRRRRRGH!!!") add_blood(L) @@ -136,11 +139,15 @@ var/const/SAFETY_COOLDOWN = 100 for(var/obj/item/I in L.get_equipped_items()) L.drop_from_inventory(I) recycle(I, 0) - L.Paralyse(5) // Instantly lie down, also go unconscious from the pain, before you die. - if(emagged == 1) - L.adjustBruteLoss(1000) - else if(emagged == 2) // For admin fun. + + // Instantly lie down, also go unconscious from the pain, before you die. + L.Paralyse(5) + + // For admin fun, var edit emagged to 2. + if(gib || emagged == 2) L.gib() + else if(emagged == 1) + L.adjustBruteLoss(1000) From e3bb626ce949ca51372c3702a4b484b9fe036767 Mon Sep 17 00:00:00 2001 From: Giacomand Date: Mon, 6 Jan 2014 19:01:12 +0000 Subject: [PATCH 3/4] * Removed an unnecessary update_icons() --- code/modules/mob/inventory.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 87930516848..bf2afb319a8 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -88,7 +88,7 @@ T.Entered(W) W.dropped(src) - update_icons() + //update_icons() // Redundant as u_equip will handle updating the specific overlay return 1 return 0 From a5b440d296c2d4b1368e9160f01619f3825a53d4 Mon Sep 17 00:00:00 2001 From: Giacomand Date: Mon, 6 Jan 2014 20:27:59 +0000 Subject: [PATCH 4/4] Added a stat check before say(). --- code/game/machinery/recycler.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index 56ef42fd84e..466a2f52338 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -128,7 +128,8 @@ var/const/SAFETY_COOLDOWN = 100 // By default, the emagged recycler will gib all non-carbons. (human simple animal mobs don't count) if(iscarbon(L)) gib = 0 - L.say("ARRRRRRRRRRRGH!!!") + if(L.stat == CONSCIOUS) + L.say("ARRRRRRRRRRRGH!!!") add_blood(L) if(!blood && !issilicon(L))