Catching pokemon.. in Developer Help
|
|
Code:
obj Pokeball name = "Pokeball" icon = 'items.dmi' icon_state = "pokeball" density = 1
Bump(var/mob/M in oview(12)) var/D = src.owner if(M.istype == "Pokemon") M.loc = locate(D.contents) usr << "<b>You caught [M.israce]" del(src) if(istype(M,/mob)) del(src) if(istype(M,/turf)) del(src) if(istype(M,/obj)) del(src) mob verb Throw_Pokeball() usr.ballininvo = 6 if(usr.ballininvo <= 0) usr << "<b>Your out of pokeballs!" else var/C = new/obj/Pokeball oview(8) << "<b>[usr]: Go Pokeball!" C:loc = locate(usr.x,usr.y,usr.z) C:owner = usr usr.ballininvo -= 1 C:dir = usr.dir walk(C,dir) obj var owner = "Noone" mob var istype = "Trainer" ballininvo = 4 israce = "----" mob/Stat() .=..() statpanel("Stats") stat("------Inventory------") stat(src.contents)
|
Problem description: as you probably noticed D.contents is undefined stat(src.contents) made me think that contents was an already defined variable so that i could make the location of the pokemon the contents but i cant so can someone tell me how to get this to do what its supposed to do and that is catch and send a pokemon to my inventory?
|