Added pokeballs. Sadly, adminspawn-only for now.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2855 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
heisen51@gmail.com
2011-12-29 09:11:02 +00:00
parent c54c517886
commit 300f16cd65
2 changed files with 124 additions and 0 deletions

View File

@@ -139,4 +139,128 @@
C.icon_state = "soulstone2"
T << "Your soul has been recaptured by the soul stone, it's arcane energies reknitting your ethereal form"
U << "\blue <b>Capture successful!</b>: \black [T.name]'s has been recaptured and stored within the soul stone."
return
/obj/item/device/soulstone/pokeball
name = "Pokeball"
icon_state = "pokeball"
desc = "Gotta catch 'em all!"
attack(mob/living/carbon/human/M as mob, mob/user as mob)
if(!istype(M, /mob/living/carbon/human))//If target is not a human.
return ..()
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their soul captured with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to capture the soul of [M.name] ([M.ckey])</font>")
transfer_pokemon("VICTIM", M, user)
return
attack_self(mob/user)
if (!in_range(src, user))
return
user.machine = src
var/dat = "<TT><B>Pokeball</B><BR>"
for(var/mob/living/simple_animal/shade/A in src)
dat += "Pokemon: [A.name]<br>"
dat += {"<A href='byond://?src=\ref[src];choice=Summon'>Choose Pokemon</A>"}
dat += "<br>"
dat += {"<a href='byond://?src=\ref[src];choice=Close'> Close</a>"}
user << browse(dat, "window=aicard")
onclose(user, "aicard")
return
Topic(href, href_list)
var/mob/U = usr
if (!in_range(src, U)||U.machine!=src)
U << browse(null, "window=aicard")
U.machine = null
return
add_fingerprint(U)
U.machine = src
switch(href_list["choice"])//Now we switch based on choice.
if ("Close")
U << browse(null, "window=aicard")
U.machine = null
return
if ("Summon")
for(var/mob/living/simple_animal/shade/A in src)
A.nodamage = 0
A.canmove = 1
A << "<b>[U.name] has chosen you!</b>"
A.loc = U.loc
A.cancel_camera()
src.icon_state = "pokeball"
attack_self(U)
////////////////////////////Proc for moving soul in and out off stone//////////////////////////////////////
/obj/item/proc/transfer_pokemon(var/choice as text, var/target, var/mob/U as mob).
switch(choice)
if("VICTIM")
var/mob/living/carbon/human/T = target
var/obj/item/device/soulstone/C = src
if(C.imprinted != "empty")
U << "\red <b>Darn! Capture failed!</b>: \black The pokeball already contains [C.imprinted]!"
else
if (T.stat == 0)
U << "\red <b>Darn! Capture failed!</b>: \black The pokemon is too strong!"
else
if(T.client == null)
U << "\red <b>Darn! Capture failed!</b>: \black The pokemon has already fainted!"
else
if(C.contents.len)
U << "\red <b>Darn! Capture failed!</b>: \black The pokeball is full! Use or free an existing pokemon to make room."
else
for(var/obj/item/W in T)
T.drop_from_slot(W)
new /obj/effect/decal/remains/human(T.loc) //Spawns a skeleton
T.invisibility = 101
var/atom/movable/overlay/animation = new /atom/movable/overlay( T.loc )
animation.icon_state = "blank"
animation.icon = 'mob.dmi'
animation.master = T
flick("dust-h", animation)
del(animation)
var/mob/living/simple_animal/shade/S = new /mob/living/simple_animal/shade( T.loc )
S.loc = C //put shade in stone
S.nodamage = 1 //So they won't die inside the stone somehow
S.canmove = 0//Can't move out of the soul stone
S.name = "Shade of [T.name]"
if (T.client)
T.client.mob = S
S.cancel_camera()
C.icon_state = "pokeball2"
C.name = "Pokeball: [S.name]"
S << "You have been captured! [U.name] is now your trainer!"
U << "\blue <b>Alright!</b>: \black [T.name] was caught!"
S << "The pokeball now contains [S.name], it will no longer react to other pokemon."
C.imprinted = "[S.name]"
del T
if("SHADE")
var/mob/living/simple_animal/shade/T = target
var/obj/item/device/soulstone/C = src
if (T.alive == 0)
U << "\red <b>Darn! Capture failed!</b>: \black The pokemon has already fainted!"
else
if(C.contents.len)
U << "\red <b>Darn! Capture failed!</b>: \black The pokeball is full! Use or free an existing pokemon to make room."
else
if(T.name != C.imprinted)
U << "\red <b>Darn! Capture failed!</b>: \black The pokeball already contains [C.imprinted]!"
else
T.loc = C //put shade in stone
T.nodamage = 1
T.canmove = 0
T.health = T.max_health
C.icon_state = "pokeball2"
T << "<b>[T.name]! That's enough!</b> You return to the pokeball."
U << "\blue <b>[T.name]! That's enough!</b>: \black [T.name] has been recaptured and stored within the pokeball."
return