ID:141382
 
Code:
mob
var
CanPerform = 1
verb
TestSeals()
usr << "[usr.Seal1] [usr.Seal2]"
PerformJutsu()
if(usr.ComboUsed>0&&usr.SealsUsed==0)
if(usr.ComboUsed>0)
if(usr.CombosUsed==list("High Kick","Low Punch"))
if(usr.TestTai1==0)
usr << "<FONT FACE=Arial COLOR=#FFFFFF>You learned a new jutsu, check it in the jutsu reference!</FONT>"
usr.JutsuReference += "<B>Test Taijutsu 1:</B> - Rank: - - Type: Test Taijutsu - Element: Blank - Seals: High Kick, Low Punch(Up+E, Down+Q)<BR><BR>"
usr.TestTai1 = 1
TestTaijutsu(usr)
ResetCombo(usr)
return
else if(usr.CombosUsed==list("High Kick","High Defense"))
if(usr.TestTai2==0)
usr << "<FONT FACE=Arial COLOR=#FFFFFF>You learned a new jutsu, check it in the jutsu reference!</FONT>"
usr.JutsuReference += "<B>Test Taijutsu 2:</B>- Rank: - - Type: Test Taijutsu - Element: Blank - Seals: High Kick, High Defense(Up+E, Up+F)<BR><BR>"
usr.TestTai2=1
TestTaijutsu2(usr)
ResetCombo(usr)
return
usr << "<FONT FACE=Arial COLOR=#FFFFFF>There are no Taijutsu for that combo</FONT>"
ResetCombo(usr)
else
usr << "<FONT FACE=Arial COLOR=#FFFFFF>You haven't used any Attacks yet</FONT>"
ResetCombo(usr)
else
usr << "<FONT FACE=Arial COLOR=#FFFFFF>Seals above 0.</FONT>"
if(usr.SealsUsed>0&&usr.ComboUsed==0)
if(usr.SealsUsed>0)
if(usr.Element=="")
if(usr.SealsUsedd==list("Dog","Boar","Rat","Dog","Dragon","Snake"))
if(usr.GrandWaterfall==0)
usr << "<FONT FACE=Arial COLOR=#FFFFFF>You learned a new jutsu, check it in the jutsu reference!</FONT>"
usr.JutsuReference += "<B>Test Grand Waterfall:</B> - Rank: A - Type: Test Jutsu - Element: Blank - Seals: Dog, Boar, Rat, Dog, Dragon, Snake(-, =, 1, -, 5, 6)<BR><BR>"
usr.GrandWaterfall=1
ResetSeals(usr)
NinjutsuTrain(usr)
JutsuTrain(usr,2)
GrandWaterfall(usr)
return
else if(usr.SealsUsedd==list("Dog","Boar"))
if(usr.TestJutsu1==0)
usr << "<FONT FACE=Arial COLOR=#FFFFFF>You learned a new jutsu, check it in the jutsu reference!</FONT>"
usr.JutsuReference += "<B>Test Jutsu:</B> - Rank: - - Type: Test Jutsu - Element: Blank - Seals: Dog, Boar(-, =)<BR><BR>"
usr.TestJutsu1=1
ResetSeals(usr)
NinjutsuTrain(usr)
JutsuTrain(usr,1)
TestJutsu(usr)
return
else if(usr.SealsUsedd==list("Boar","Dog"))
if(usr.TestJutsu2==0)
usr << "<FONT FACE=Arial COLOR=#FFFFFF>You learned a new jutsu, check it in the jutsu reference!</FONT>"
usr.JutsuReference += "<B>Test Jutsu 2</B> - Rank: - - Type:Test Jutsu - Element: Blank - Seals: Boar, Dog(=,-)<BR><BR>"
usr.TestJutsu2=1
ResetSeals(usr)
NinjutsuTrain(usr)
TestJutsu2(usr)
return
else if(usr.SealsUsedd==list("Boar","Dog","Dog"))
if(usr.TestJutsu2==0)
usr << "<FONT FACE=Arial COLOR=#FFFFFF>You learned a new jutsu, check it in the jutsu reference!</FONT>"
usr.JutsuReference += "<B>Test Jutsu 3:</B> - Rank: - - Type: Test Jutsu - Element: Blank - Seals: Boar, Dog, Dog(=, -, -)<BR><BR>"
usr.TestJutsu2=1
ResetSeals(usr)
GenjutsuTrain(usr)
TestJutsu3(usr)
return
usr << "<FONT FACE=Arial COLOR=#FFFFFF>There are no jutsu for those hand seals.</FONT>"
ResetSeals(usr)
else
usr << "<FONT FACE=Arial COLOR=#FFFFFF>You haven't used any hand seals!</FONT>"
else
usr << "<FONT FACE=Arial COLOR=#FFFFFF>Combo above 0.</FONT>"


Example Handseal:
Dog()
if(usr.HandSealTimer == 0)
ResetCombo(usr)
usr.CombatMode=0
usr.SealMode=1
usr.ComboUsed=0
usr.icon = 'HandSealBase.dmi'
usr.icon_state = ""
sleep(2)
usr.icon_state = "dog"
usr.HandSealTimer = usr.SealSpeed
usr.HandFadeDown = 10
usr.SealsUsedd+="Dog"
usr.SealsUsed++
spawn(1)HandSealTimer(usr)
FadeTimerHand(usr)


Variables:
list/CombosUsed = list()
list/SealsUsedd = list()


Problem description:
I feel really dumb, as i've programmed a Save Server with minimal use of a library for reference, a 3 slot one with character previews, but a simple list is baffling me.

First, let me say I KNOW that the code is inefficient, i'm working on slimming it down more (Actually how this mess got started, didn't use a list before, worked fine, but was very inefficient)

What is happening is, it pulls the "There are no jutsu for those hand seals" message everytime.

I used a verb to check the list, and it outputs /list



You're trying to compare a list to another list. The problem is, "list()" creates a new /list object. As far as I know, you can't compare two different objects alike.

proc/compareLists(list/a,list/b) //a is what you have. b is what is required.
for(var/o in b)if(!(o in a))return 0
return 1

Untested, of course. Ideally, it should loop through all items in list b and check if they are in group a. If any thing in list b isn't in list a, the proc returns false.
In response to Kaiochao
Kaiochao wrote:
You're trying to compare a list to another list. The problem is, "list()" creates a new /list object. As far as I know, you can't compare two different objects alike.

> proc/compareLists(list/a,list/b) //a is what you have. b is what is required.
> for(var/o in b)if(!(o in a))return 0
> return 1

Untested, of course. Ideally, it should loop through all items in list b and check if they are in group a. If any thing in list b isn't in list a, the proc returns false.

That won't show if the lists are actually equal though. Just even with duplicates, or different order it will completely fail to know.
proc/compareLists(list/a,list/b)
if(a.len!=b.len)return 0
for(var/c in 1 to a.len)
if(a[c]!=b[c])return 0
return 1
In response to T3h P3ngu1n
Thank you very much Penguin!

I feel a bit silly ><