obj
Pokeball
var/Gowner = "nobody"
var/Capture = "nobody"
name = "Pokeball"
icon = 'Pokeballs.dmi'
icon_state = "Pokeball"
density = 1
New()
..()
verb
Drop()
for(var/obj/Pokeball/O in usr.contents)
if(O.ammount<=0)
del(src)
else
var/drop = input("How many pokeballs do you wish to drop?")as num
if(src.ammount<drop)
usr<<"You don't have that many to drop."
return
if(drop<=0)
usr<<"You cannot do that."
return
if(src.ammount>=drop)
src.ammount-=drop
var/obj/Pokeball/B = new/obj/Pokeball
B.loc=locate(usr.x,usr.y-1,usr.z)
B.ammount=drop
view(usr)<<"[usr] drops [drop] a pokeball."
O.name = "Pokeball"
O.name= "[O.name]: [O.ammount]"
usr.Save()
Get()
set src in oview(1)
usr<<"You picked up [src]"
for(var/obj/Pokeball/O in usr.contents)
counter+=1
if(counter<=0)
Move(usr)
else
for(var/obj/Pokeball/O in usr.contents)
O.ammount+=src.ammount
O.name = "Pokeball"
O.name= "[O.name]: [O.ammount]"
del(src)
Throw()
set src in usr.contents
usr<<"You have throwed a pokeball"
var/obj/Pokeball/A = new/obj/Pokeball
A.loc=locate(usr.x,usr.y,usr.z)
A.Gowner=usr
A.dir = usr.dir
walk(A,usr.dir)
Sent_out(mob/M in world)
if(M.name == "[Capture]")
M.loc = locate(usr.x,usr.y,usr.z)
else
return
Bump(A)
if(ismob(A))
var/mob/M = A
if(Gowner == A)
del(src)
if(M.hp >= 50)
usr.random = rand(1,10)
if(usr.random == 10)
world << "[usr] captured [M]"
src.Capture = "[M]"
src.name = "Pokeball [Capture]"
src.loc = usr
else
world << "The pokemon broke out"
return
if(M.hp <= 49)
usr.random = rand(1,3)
if(usr.random == 3)
world << "[usr] captured [M]"
src.Capture = "[M]"
src.name = "Pokeball [Capture]"
src.loc = usr
else
world << "The pokemon broke out"
return
if(istype(A,/turf/))
del(src)
if(istype(A,/obj/))
del(src)
Problem description:The pokeball won't move,it just stands still.How do I put that Bump under Throw command if i try, it just says Proc definition not allowed inside another proc for the line below bump, and is there a better way to do this thing?
Shouldn't the second argument be the number of steps?