obj
PC
verb
Deposit()
set src in oview(1)
for(var/mob/P in usr.contents2)
if(usr.PokemonOnHand <= 1)
alert("You must have atleast 1 Pokemon in your party at all times.")
else
usr.contents2 -= P
usr.contents4 += P
P.loc=null
usr << "[P] was deposited."
usr.PokemonOnHand -= 1
Withdraw()
set src in oview(1)
for(var/mob/P in usr.contents4)
if(usr.PokemonOnHand >= 6)
alert("You may not have more than 6 Pokemon on hand at a time.")
else
usr.contents4 -= P
usr.contents2 += P
P.loc=null
usr << "[P] was withdrawn."
usr.PokemonOnHand += 1
obj/Pokeball
icon='pokeball.dmi'
icon_state="Pokeball"
verb
PickUp()
set src in oview(1)
if(usr.pokeballs>=1)
usr.pokeballs += 1
src.loc = usr
var/obj/Pokeball/P = locate(/obj/Pokeball) in usr.contents3
P.name = "Pokeballs x[usr.pokeballs]"
else
usr.pokeballs += 1
src.loc = usr
var/obj/Pokeball/P = new(usr)
usr.contents3.Add(P)
P.name = "Pokeballs x[usr.pokeballs]"
Drop()
if(usr.pokeballs==0)
usr<<"You have no Pokeballs to drop"
else
if(usr.pokeballs>1)
usr.pokeballs -= 1
src.loc=usr.loc
var/obj/Pokeball/P = locate(/obj/Pokeball) in usr.contents3
P.name = "Pokeballs x[usr.pokeballs]"
else
usr.pokeballs -= 1
src.loc=usr.loc
var/obj/Pokeball/P = locate(/obj/Pokeball) in usr.contents3
usr.contents3 -= P
P.name = "Pokeball"
Catch(var/mob/M as mob in oview(1)) //The catch verb.
set category="Pokemon Commands"
if(usr.pokemonout>=1)
usr<<"You cant catch a pokemon until you return your current one"
else
if(istype(M,/mob/Pokemon))
if(usr.pokeballs<=0)
usr<<"You have no Pokeballs"
else
if(prob(25))
M.MHP=100
M.HP=100
M.owner="[usr.key]"
M.loc = null
M.name = input("[M]","Name") as text|null
if(length(M.name)<1)
M.name = "[M.Species]"
usr << "You have successfully named it [M.name]!"
if(usr.PokemonOnHand>=6)
usr.contents4 += M
usr<<"[M.name] was transfered to your PC"
else
usr.contents2 += M
usr.PokemonOnHand +=1
else
usr<<"The Pokemon broke out of the ball"
usr.pokeballs -= 1
if(usr.pokeballs>=1)
var/obj/Pokeball/P = locate(/obj/Pokeball) in usr.contents3
P.name = "Pokeballs x[usr.pokeballs]"
else
var/obj/Pokeball/P = locate(/obj/Pokeball) in usr.contents3
usr.contents3 -= P
else
usr << "You can't catch [M]!"
As you can see, when I catch it adds PokemonOnHand.. But no matter how many pokemon I have; when it deposits it says "You must have more than one pokemon in your party" and it gives me 1 message for each pokemon I have in my party.
Your for() loop is looping through all of your different pokemon. As for the issue with it saying "You must have at least 1..." I'd guess your variable is becoming inconsistent for whatever reason.