Merge pull request #3188 from Crazylemon64/poor-communication-kills

Bomb guardians notify their master when they ready a bomb
This commit is contained in:
Fox McCloud
2016-01-11 21:06:51 -05:00
2 changed files with 25 additions and 8 deletions
@@ -564,17 +564,19 @@
if(!istype(A))
return
if(src.loc == summoner)
src << "<span class='danger'><B>You must be manifested to create bombs!</span></B>"
src << "<span class='danger'><B>You must be manifested to create bombs!</B></span>"
return
if(istype(A, /obj/))
if(bomb_cooldown <= world.time && !stat)
var/obj/item/weapon/guardian_bomb/B = new /obj/item/weapon/guardian_bomb(get_turf(A))
src << "<span class='danger'><B>Success! Bomb armed!</span></B>"
src << "<span class='danger'><B>Success! Bomb on \the [A] armed!</B></span>"
if(summoner)
summoner << "<span class='warning'>Your guardian has primed \the [A] to explode!</span>"
bomb_cooldown = world.time + 200
B.spawner = src
B.disguise (A)
else
src << "<span class='danger'><B>Your powers are on cooldown! You must wait 20 seconds between bombs.</span></B>"
src << "<span class='danger'><B>Your powers are on cooldown! You must wait 20 seconds between bombs.</B></span>"
/obj/item/weapon/guardian_bomb
name = "bomb"
@@ -590,13 +592,21 @@
density = A.density
appearance = A.appearance
spawn(600)
stored_obj.loc = get_turf(src.loc)
spawner << "<span class='danger'><B>Failure! Your trap didn't catch anyone this time.</span></B>"
qdel(src)
if(src)
stored_obj.loc = get_turf(src.loc)
spawner << "<span class='danger'><B>Failure! Your trap on \the [stored_obj] didn't catch anyone this time.</B></span>"
qdel(src)
/obj/item/weapon/guardian_bomb/proc/detonate(var/mob/living/user)
user << "<span class='danger'><B>The [src] was boobytrapped!</span></B>"
spawner << "<span class='danger'><B>Success! Your trap caught [user]</span></B>"
user << "<span class='danger'><B>The [src] was boobytrapped!</B></span>"
if(istype(spawner, /mob/living/simple_animal/hostile/guardian))
var/mob/living/simple_animal/hostile/guardian/G = spawner
if(user == G.summoner)
user << "<span class='danger'>You knew this because of your link with your guardian, so you smartly defuse the bomb.</span>"
stored_obj.loc = get_turf(src.loc)
qdel(src)
return
spawner << "<span class='danger'><B>Success! Your trap on \the [src] caught [user]!</B></span>"
stored_obj.loc = get_turf(src.loc)
playsound(get_turf(src),'sound/effects/Explosion2.ogg', 200, 1)
user.ex_act(2)