From 867f2d77af2009c72fd9e2642ee80d70a78118be Mon Sep 17 00:00:00 2001 From: Ren Erthilo Date: Sun, 22 Apr 2012 03:03:05 +0100 Subject: [PATCH] TG: - Added water balloons (sprites courtesy of Sieve,) these can be filled with most reagents and burst on throwing if filled, applying the reagents to whatever is hit (along with everything else on that tile.) These are winnable from the arcade, for now. I'll probably think of a better way to implement them. Revision: r3075 Author: quartz235 --- code/defines/obj/toy.dm | 62 ++++++++++++++++++++++++- code/game/machinery/computer/arcade.dm | 2 + icons/obj/toy.dmi | Bin 2324 -> 2327 bytes 3 files changed, 63 insertions(+), 1 deletion(-) diff --git a/code/defines/obj/toy.dm b/code/defines/obj/toy.dm index 9011ac00c0d..00ac66c93cc 100644 --- a/code/defines/obj/toy.dm +++ b/code/defines/obj/toy.dm @@ -387,4 +387,64 @@ set src in usr usr << text("\icon[] [] units of water left!", src, src.reagents.total_volume) ..() - return \ No newline at end of file + return + +/obj/item/toy/balloon + name = "water balloon" + desc = "A translucent balloon. There's nothing in it." + icon = 'toy.dmi' + icon_state = "waterballoon-e" + item_state = "balloon-empty" + +/obj/item/toy/balloon/New() + var/datum/reagents/R = new/datum/reagents(10) + reagents = R + R.my_atom = src + +/obj/item/toy/balloon/attack(mob/living/carbon/human/M as mob, mob/user as mob) + return + +/obj/item/toy/balloon/afterattack(atom/A as mob|obj, mob/user as mob) + if (istype(A, /obj/structure/reagent_dispensers/watertank) && get_dist(src,A) <= 1) + A.reagents.trans_to(src, 10) + user << "\blue You fill the balloon with the contents of [A]." + src.desc = "A translucent balloon with some form of liquid sloshing around in it." + src.update_icon() + return + +/obj/item/toy/balloon/attackby(obj/O as obj, mob/user as mob) + if(istype(O, /obj/item/weapon/reagent_containers/glass)) + if(O.reagents) + if(O.reagents.total_volume < 1) + user << "The [O] is empty." + else if(O.reagents.total_volume >= 1) + if(O.reagents.has_reagent("pacid", 1)) + user << "The acid chews through the balloon!" + O.reagents.reaction(user) + del(src) + else + src.desc = "A translucent balloon with some form of liquid sloshing around in it." + user << "\blue You fill the balloon with the contents of [O]." + O.reagents.trans_to(src, 10) + src.update_icon() + return + +/obj/item/toy/balloon/throw_impact(atom/hit_atom) + if(src.reagents.total_volume >= 1) + src.visible_message("\red The [src] bursts!","You hear a pop and a splash.") + src.reagents.reaction(get_turf(hit_atom)) + for(var/atom/A in get_turf(hit_atom)) + src.reagents.reaction(A) + src.icon_state = "burst" + spawn(5) + if(src) + del(src) + return + +/obj/item/toy/balloon/update_icon() + if(src.reagents.total_volume >= 1) + icon_state = "waterballoon" + item_state = "balloon" + else + icon_state = "waterballoon-e" + item_state = "balloon-empty" \ No newline at end of file diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index c6c2eac9296..083c12c5378 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -146,6 +146,8 @@ new /obj/item/toy/crayonbox(src.loc) if(9) new /obj/item/toy/spinningtoy(src.loc) + // if(10) //Commented out on Urist-chan's orders~ + // new /obj/item/toy/balloon(src.loc) //Until it gets a better sprite~ else var/atom/movable/Prize = pick(contents) Prize.loc = src.loc diff --git a/icons/obj/toy.dmi b/icons/obj/toy.dmi index 907789f99ca96b312e1917fa7f6dee80ec6814fb..8650435b56e1329fdc4016ed479c9b51acced2b9 100644 GIT binary patch delta 26 icmbOtG+k(dG7}@yMpb4;_5%kFM9r(Xxmkzt1v>z4FbP2b delta 23 fcmbO(G(~8FG84o9jjGIyECClQoHy$;zF-FcStbXN