From df6bee335b5fad0168ac405d39521b085e5817ae Mon Sep 17 00:00:00 2001 From: Squirgenheimer Date: Sat, 20 Oct 2018 21:07:37 -0400 Subject: [PATCH 1/3] Various guardian_bomb fixes -they will now respect opacity and direction of the atom they are disguised as -they will no longer be triggered by objs and will instead trigger on the mob correctly -automatic disarming now uses timer ss so no more deletion of the contained obj after already being triggered -replaces loc assignments with forceMove --- .../miniantags/guardian/types/bomb.dm | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/code/game/gamemodes/miniantags/guardian/types/bomb.dm b/code/game/gamemodes/miniantags/guardian/types/bomb.dm index 0503806b196..0484ade1142 100644 --- a/code/game/gamemodes/miniantags/guardian/types/bomb.dm +++ b/code/game/gamemodes/miniantags/guardian/types/bomb.dm @@ -37,32 +37,36 @@ /obj/item/guardian_bomb/proc/disguise(var/obj/A) A.forceMove(src) stored_obj = A + opacity = A.opacity anchored = A.anchored density = A.density appearance = A.appearance - spawn(600) - if(src) - stored_obj.loc = get_turf(loc) - if(spawner) - to_chat(spawner, "Failure! Your trap on [stored_obj] didn't catch anyone this time.") - qdel(src) + dir = A.dir + addtimer(CALLBACK(src, .proc/disable), 600) + +/obj/item/guardian_bomb/proc/disable() + stored_obj.forceMove(get_turf(src)) + to_chat(spawner, "Failure! Your trap on [stored_obj] didn't catch anyone this time.") + qdel(src) /obj/item/guardian_bomb/proc/detonate(var/mob/living/user) + if(!istype(user)) + return to_chat(user, "The [src] was boobytrapped!") if(istype(spawner, /mob/living/simple_animal/hostile/guardian)) var/mob/living/simple_animal/hostile/guardian/G = spawner if(user == G.summoner) to_chat(user, "You knew this because of your link with your guardian, so you smartly defuse the bomb.") - stored_obj.loc = get_turf(loc) + stored_obj.forceMove(get_turf(loc)) qdel(src) return to_chat(spawner, "Success! Your trap on [src] caught [user]!") - stored_obj.loc = get_turf(loc) + stored_obj.forceMove(get_turf(loc)) playsound(get_turf(src),'sound/effects/Explosion2.ogg', 200, 1) user.ex_act(2) qdel(src) -/obj/item/guardian_bomb/attackby(mob/living/user) +/obj/item/guardian_bomb/attackby(obj/item/W, mob/living/user) detonate(user) return From 4bbe0a3f223c32113dce00933f1a6aa8a5d44f11 Mon Sep 17 00:00:00 2001 From: Squirgenheimer Date: Sat, 20 Oct 2018 21:22:50 -0400 Subject: [PATCH 2/3] removes trailing returns --- code/game/gamemodes/miniantags/guardian/types/bomb.dm | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/game/gamemodes/miniantags/guardian/types/bomb.dm b/code/game/gamemodes/miniantags/guardian/types/bomb.dm index 0484ade1142..f8c3898ed9c 100644 --- a/code/game/gamemodes/miniantags/guardian/types/bomb.dm +++ b/code/game/gamemodes/miniantags/guardian/types/bomb.dm @@ -68,11 +68,9 @@ /obj/item/guardian_bomb/attackby(obj/item/W, mob/living/user) detonate(user) - return /obj/item/guardian_bomb/pickup(mob/living/user) detonate(user) - return /obj/item/guardian_bomb/examine(mob/user) stored_obj.examine(user) From 5d4ada3ff209447dbef8b3ede08f5e20b3e02fa1 Mon Sep 17 00:00:00 2001 From: Squirgenheimer Date: Sat, 20 Oct 2018 21:38:33 -0400 Subject: [PATCH 3/3] adds another sanity check --- code/game/gamemodes/miniantags/guardian/types/bomb.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/game/gamemodes/miniantags/guardian/types/bomb.dm b/code/game/gamemodes/miniantags/guardian/types/bomb.dm index f8c3898ed9c..23f922687a2 100644 --- a/code/game/gamemodes/miniantags/guardian/types/bomb.dm +++ b/code/game/gamemodes/miniantags/guardian/types/bomb.dm @@ -46,7 +46,8 @@ /obj/item/guardian_bomb/proc/disable() stored_obj.forceMove(get_turf(src)) - to_chat(spawner, "Failure! Your trap on [stored_obj] didn't catch anyone this time.") + if(spawner) + to_chat(spawner, "Failure! Your trap on [stored_obj] didn't catch anyone this time.") qdel(src) /obj/item/guardian_bomb/proc/detonate(var/mob/living/user)