ID:170634
 
No matter what, this verb never sees that you have a shuriken or fuuma shuriken in your inventory. I don't think I did a stupid mistake, so I'm pretty sure it's something that I don't know how to do correctly.

mob/Jutsu
verb
Kage_Shuriken_No_Jutsu(mob/M in oview(10))
set category = "Taijutsu"
if(usr.attack==1)
return 0
if(/obj/item/Shuriken in usr.contents)
if(/obj/item/FuumaShuriken in usr.contents)
var/a=input("Throw...") in list("Shuriken","Fuuma Shuriken")
if(a=="Shuriken")
usr.attack=1
s_missile(new/obj/projectile/Shuriken,usr,M,1,1,usr.name)
sleep(2)
s_missile(new/obj/projectile/KageShuriken,usr,M,1,1,usr.name)
sleep(1)
usr.attack=0
del(/obj/item/Shuriken in usr.contents)
var/exp1=rand(1,100)
if(exp1==1)
usr << "Taijutsu skill increased."
usr.Taijutsu += 1
if(usr.kageshuriken<100)
usr.kageshuriken+=1
else
usr.attack=1
s_missile(new/obj/projectile/FuumaShuriken,usr,M,3,1,usr.name)
sleep(2)
s_missile(new/obj/projectile/KageFuumaShuriken,usr,M,3,1,usr.name)
sleep(20)
usr.attack=0
del(/obj/item/FuumaShuriken in usr.contents)
var/exp1=rand(1,100)
if(exp1==1)
usr << "Taijutsu skill increased."
usr.Taijutsu += 1
if(usr.kageshuriken<100)
usr.kageshuriken+=1
else
usr.attack=1
s_missile(new/obj/projectile/Shuriken,usr,M,1,1,usr.name)
sleep(2)
s_missile(new/obj/projectile/KageShuriken,usr,M,1,1,usr.name)
sleep(1)
usr.attack=0
del(/obj/item/Shuriken in usr.contents)
var/exp1=rand(1,100)
if(exp1==1)
usr << "Taijutsu skill increased."
usr.Taijutsu += 1
if(usr.kageshuriken<100)
usr.kageshuriken+=1
else
if(/obj/item/FuumaShuriken in usr.contents)
usr.attack=1
s_missile(new/obj/projectile/FuumaShuriken,usr,M,3,1,usr.name)
sleep(2)
s_missile(new/obj/projectile/KageFuumaShuriken,usr,M,3,1,usr.name)
sleep(20)
usr.attack=0
del(/obj/item/FuumaShuriken in usr.contents)
var/exp1=rand(1,100)
if(exp1==1)
usr << "Taijutsu skill increased."
usr.Taijutsu += 1
if(usr.kageshuriken<100)
usr.kageshuriken+=1
else
usr << "You need a shuriken or fuuma shuriken in your pack to perform Kage Shuriken no Jutsu."


Thanks in advance.
You should do a for loop and then do a if(whatevervaruused) check.
In response to XxDohxX
Could you please expand on that? I'm new to the for command.
In response to Newbreedofnerd
Well I will give an example. Say your looking for an apple in "someone's" contents and you want the apple to say hi to the "someone". So first you would make a for list to check for an apple:

for(var/obj/apple/A in src.contents) //runs a check through src.contents and for every apple, it does whats under this.
if(A) //Checks if the apple is there, if there is actually an apple
src << "The apple says: Hi." //This is simple, you should know this.


That basically makes it so it runs a check through the persons contents, then checks if the apple is there, and if so it will tell the 'someone' hi.

This should help you with your problem.





-Doh
In response to XxDohxX
lol, what if you had a million apples in your inventory, then you'd get a million hi's... that's be great.. lol
In response to Zero's Baby
Hopefully the owner of the game or demo, whatever it is in, would have a limit to items.
In response to XxDohxX
XxDohxX wrote:
> for(var/obj/apple/A in src.contents) //runs a loop through src.contents and for ever apple, it does whats under this.
> if(A) //Checks if the apple is there, if there is actually an apple
> src << "The apple says: Hi." //This is simple, you should know this.
>



Actually, that's a for() list, not a for() loop.
In response to Wizkidd0123
Hmm, I will have to look into that, sorry for outputting sorry information.