From 5722bbe714690e7f7745aa1ff1d92fb0348ed73b Mon Sep 17 00:00:00 2001 From: Jack Edge Date: Wed, 15 Jun 2016 21:12:39 +0100 Subject: [PATCH] Sentience balloon added --- code/modules/admin/fun_balloon.dm | 52 +++++++++++++++++++++-- code/modules/spells/spell_types/wizard.dm | 13 ++---- tgstation.dme | 1 + 3 files changed, 53 insertions(+), 13 deletions(-) diff --git a/code/modules/admin/fun_balloon.dm b/code/modules/admin/fun_balloon.dm index b66169d44a1..a398d25528a 100644 --- a/code/modules/admin/fun_balloon.dm +++ b/code/modules/admin/fun_balloon.dm @@ -1,7 +1,9 @@ /obj/effect/fun_balloon name = "fun balloon" desc = "This is going to be a laugh riot." - anchoured = TRUE + icon = 'icons/obj/weapons.dmi' + icon_state = "syndballoon" + anchored = TRUE /obj/effect/fun_balloon/New() . = ..() @@ -14,11 +16,55 @@ /obj/effect/fun_balloon/process() if(check()) pop() + visible_message("[src] pops!") + playsound(get_turf(src), 'sound/items/party_horn.ogg', 50, 1, -1) + qdel(src) /obj/effect/fun_balloon/proc/check() return TRUE /obj/effect/fun_balloon/proc/pop() - visual_message("[src] pops!") - playsound(get_turf(src), 'sound/items/party_horn.ogg', 50, 1, -1) + return + +/obj/effect/fun_balloon/sentience + name = "sentience fun balloon" + desc = "When this pops, things are gonna get more aware around here." + var/effect_range = 3 + var/group_name = "a bunch of giant spiders" + +/obj/effect/fun_balloon/sentience/pop() + var/list/bodies = list() + for(var/mob/living/M in range(effect_range, get_turf(src))) + bodies += M + + var/question = "Would you like to be [group_name]?" + var/list/candidates = pollCandidates(question, "pAI", null, FALSE, 100) + while(candidates.len && bodies.len) + var/mob/dead/observer/ghost = pick_n_take(candidates) + var/mob/living/body = pick_n_take(bodies) + + body << "Your mob has been taken over by a ghost!" + message_admins("[key_name_admin(ghost)] has taken control \ + of ([key_name_admin(body)])") + body.ghostize(0) + body.key = ghost.key + new /obj/effect/overlay/sparkle(null, body) + +/obj/effect/overlay/sparkle + icon = 'icons/effects/effects.dmi' + icon_state = "shieldsparkles" + mouse_opacity = 0 + density = 0 + var/lifetime = 10 + +/obj/effect/overlay/sparkle/New(atom/movable/AM) + . = ..(null) + AM.overlays += src + addtimer(src, "expire", lifetime, FALSE, AM) + +/obj/effect/overlay/sparkle/proc/expire(atom/movable/AM) + AM.overlays -= src qdel(src) + +/obj/effect/overlay/sparkle/tailsweep + icon_state = "tailsweep" diff --git a/code/modules/spells/spell_types/wizard.dm b/code/modules/spells/spell_types/wizard.dm index 7643044a24b..96f05020bba 100644 --- a/code/modules/spells/spell_types/wizard.dm +++ b/code/modules/spells/spell_types/wizard.dm @@ -298,7 +298,7 @@ selection_type = "view" sound = 'sound/magic/Repulse.ogg' var/maxthrow = 5 - var/animation = "shieldsparkles" + var/sparkle_path = /obj/effect/overlay/sparkle action_icon_state = "repulse" @@ -314,12 +314,9 @@ for(var/atom/movable/AM in thrownatoms) if(AM == user || AM.anchored) continue - var/obj/effect/overlay/targeteffect = new /obj/effect/overlay{icon='icons/effects/effects.dmi'; icon_state="shieldsparkles"; mouse_opacity=0; density = 0}() - targeteffect.icon_state = animation - AM.overlays += targeteffect + new sparkle_path(AM) // created sparkles will disappear on their own throwtarget = get_edge_target_turf(user, get_dir(user, get_step_away(AM, user))) distfromcaster = get_dist(user, AM) - addtimer(src, "remove_sparkles", 10, FALSE, AM, targeteffect) if(distfromcaster == 0) if(istype(AM, /mob/living)) var/mob/living/M = AM @@ -333,10 +330,6 @@ M << "You're thrown back by [user]!" AM.throw_at_fast(throwtarget, ((Clamp((maxthrow - (Clamp(distfromcaster - 2, 0, distfromcaster))), 3, maxthrow))), 1,user)//So stuff gets tossed around at the same time. -/obj/effect/proc_holder/spell/aoe_turf/repulse/proc/remove_sparkles(atom/movable/AM, obj/effect/overlay/targeteffect) - AM.overlays -= targeteffect - qdel(targeteffect) - /obj/effect/proc_holder/spell/aoe_turf/repulse/xeno //i fixed conflicts only to find out that this is in the WIZARD file instead of the xeno file?! name = "Tail Sweep" desc = "Throw back attackers with a sweep of your tail." @@ -346,7 +339,7 @@ range = 2 cooldown_min = 150 invocation_type = "none" - animation = "tailsweep" + sparkle_path = /obj/effect/overlay/sparkle/tailsweep action_icon_state = "tailsweep" action_background_icon_state = "bg_alien" diff --git a/tgstation.dme b/tgstation.dme index e2da9e92263..2357a0627a0 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -828,6 +828,7 @@ #include "code\modules\admin\create_object.dm" #include "code\modules\admin\create_poll.dm" #include "code\modules\admin\create_turf.dm" +#include "code\modules\admin\fun_balloon.dm" #include "code\modules\admin\holder2.dm" #include "code\modules\admin\IsBanned.dm" #include "code\modules\admin\NewBan.dm"