Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Nov 28th, 2012  |  syntax: None  |  size: 114.61 KB  |  views: 48  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. =======================
  2. Triple Triad Global
  3. =======================
  4.  
  5. @@ Triple Triad Global (#300)
  6. @create Triple Triad Global
  7. @link Triple Triad Global = #314
  8. @set Triple Triad Global = TRUST
  9. @set Triple Triad Global = WIZARD
  10. &TT Triple Triad Global=
  11. &TT`CMD Triple Triad Global=
  12. &TT`CMD`ADDCARD Triple Triad Global=$+TTW/Card Add *=*: @assert u(%#/TT`WIZARD) ; th [setq(Data,firstof(switch(hasattr(me,TT`DATA`%0),1,TT`DATA`%0,0),wildgrepi(me,TT`DATA`*,%0)),Num,pmatch(%0))] ; @assert %q<Data>=@pemit %#=[ansi(rD,Triple Triad)] - There are no cards with this name. ; @assert hasattr(%q<Num>,TT`STATS)=@pemit %#=[ansi(rD,Triple Triad)] - This player hasn't initialized the game to play yet. ; @include me/TT`FNC`CHECKCARDS=%# ; th [setq(ID,extract(%q<Data>,3,1,`))][setq(Set,Left(%q<ID>,1),Nb,Right(%q<ID>,3),LV,extract(u(TT`DATA`%q<ID>`STAT),6,1))][setq(Cards,u(%q<Num>/TT`CARDS`%q<Set>))] ; &TT`CARDS`%q<Set> %q<Num>=[replace(%q<Cards>,%q<Nb>,bound(inc(extract(%q<Cards>,%q<Nb>,1)),0,extract(u(TT`DATA`MAX`%q<Set>),%q<LV>,1)))] ; @include me/TT`FNC`CHECKSTASH=%q<Num> ; @pemit %#=[ansi(gD,Triple Triad)] - You have added a %1 Card to %0's stash.
  13. &TT`CMD`ADDPOINTS Triple Triad Global=$+TTW/Points Add *=*:@assert u(%#/TT`WIZARD) ; th [setq(Num,pmatch(%0))][setq(Stats,u(%q<Num>/TT`STATS))] ; @assert hasattr(%q<Num>,TT`STATS)=@pemit %#=[ansi(rD,Triple Triad)] - This player hasn't initialized the game to play yet. ; @assert isnum(%1)=@pemit %#=[ansi(rD,Triple Triad)] - You can only enter numbers for points. ; &TT`STATS %q<Num>=[replace(%q<Stats>,12,bound(add(extract(%q<Stats>,12,1),floor(%1)),0,10000))] ; @pemit %#=[ansi(gD,Triple Triad)] - You have added [floor(trim(%1))] Card Points to %0. They now have [extract(u(%q<Num>/TT`STATS),12,1)] points.
  14. &TT`CMD`ADDSET Triple Triad Global=$+TTW/Series New */*=*,*,*: @break hasttr(me/TT`DATA`SET`%0)=@pemit %#=[ansi(rD,Triple Triad)] - There is already a series with the ID %0. ; @break gt(strlen(%0),1)=@pemit %#=[ansi(gD,Triple Triad)] - ID should only be one letter. ; @break match(%0,0)=@pemit %#=[ansi(gD,Triple Triad)] - ID cannot be number 0. ; &TT`DATA`SETS me=[insert(u(me/TT`DATA`SETS),-1,%0)] ; &TT`DATA`SET`%0 me=%1 ; &TT`DATA`COST`%0`RAND me=%2 ; &TT`DATA`COST`%0`SING me=%3 ; &TT`DATA`MAX`%0 me=%4 ; @pemit %#=[ansi(gD,Triple Triad)] - You have created a %0 Series, costing %2/%3 per level, named [ansi(gD,%1)].
  15. &TT`CMD`CANCELGAME Triple Triad Global=$+TT/Cancel: @assert nattr(me/TT`GAME`%#`GAME)=@pemit %#=[ansi(rD,Triple Triad)] - You are not in a game. ; th [setq(ID,u(me/TT`GAME`%#`GAME))][setq(Blue,u(me/TT`GAME`%q<ID>`BLUE),Red,u(me/TT`GAME`%q<ID>`RED),Rules,u(me/TT`GAME`%q<ID>`RULES))][setq(Opp,switch(%#,%q<Blue>,%q<Red>,%q<Red>,%q<Blue>))] ; @break match(u(me/TT`GAME`%q<ID>`MODE),2) ; @switch/inline and(u(TT`GAME`%q<ID>`MODE),gt(conn(%q<Opp>),1))=1,&TT`STATS %#=[setq(Stats,u(%#/TT`STATS))][replace(%q<Stats>,6,inc(extract(%q<Stats>,6,1)))] ; @pemit [u(me/TT`GAME`%q<ID>`BLUE)]=[ansi(rD,Triple Triad)] - [switch(%#,[u(me/TT`GAME`%q<ID>`BLUE)],You have canceled the game.,[name(%#)] has canceled the game.)] ; @pemit [u(me/TT`GAME`%q<ID>`RED)]=[ansi(rD,Triple Triad)] - [switch(%#,[u(me/TT`GAME`%q<ID>`RED)],You have canceled the game.,[name(%#)] has canceled the game.)] ; @wipe me/TT`GAME`[u(me/TT`GAME`%q<ID>`BLUE)] ; @wipe me/TT`GAME`[u(me/TT`GAME`%q<ID>`RED)] ; @switch/inline and(not(match(%q<Rules>,Private)),not(match(%q<Rules>,Broadcast)),words(u(TT`GAME`%q<ID>`SPECTATE)))=1,@dolist/inline u(TT`GAME`%q<ID>`SPECTATE)=@pemit %i0=[ansi(rD,Triple Triad)] - [name(%#)] has canceled the game %q<ID>. ; @switch/inline and(not(match(%q<Rules>,Private)),match(%q<Rules>,Broadcast))=1,@oemit loc(%q<Blue>)/%q<Blue> %q<Red>=[ansi(rD,Triple Triad)] - [name(%#)] has canceled the game. ; @wipe me/TT`GAME`%q<ID>
  16. &TT`CMD`CHECKCARD Triple Triad Global=$+TT/Card *: th [setq(Att,firstof(switch(hasattr(me,TT`DATA`%0),1,TT`DATA`[ucstr(%0)],0),wildgrepi(me,TT`DATA`*,%0)))] ; @assert %q<Att>=@pemit %#=[ansi(rD,Triple Triad)] - There are no cards that match the name [ansi(gD,%0)]. ; th [setq(ID,extract(%q<Att>,3,1,`))][setq(Set,left(%q<ID>,1),Nb,right(%q<ID>,3),Name,u(TT`DATA`%q<ID>))][setq(NCard,extract(u(%#/TT`CARDS`%q<Set>),%q<Nb>,1),LV,extract(u(TT`DATA`%q<ID>`STAT),6,1))] ; @pemit %#=[align(1 -7 1 40,,u(me/TT`GRID`DRAW`CARD,%q<ID>,B,None,0),,%r[ansi(cD,Card %q<ID>)] : %q<Name>%r[ansi(hrD,Num Owned)] : %q<NCard>%r[ansi(gD,Card Lvl)]%b%b: %q<LV>%r[ansi(yD,Series)] %b%b%b: [u(TT`DATA`SET`%q<Set>)])]
  17. &TT`CMD`DECK Triple Triad Global=
  18. &TT`CMD`DECK`ADD Triple Triad Global=$+TT/Deck Add/*=*: @assert hasattr(%#,TT`DECK`%0)=@pemit %#=[ansi(rD,Triple Triad)] - You don't have a deck with this name. ; th [setq(Deck,u(%#/TT`DECK`%0),Init,u(%#/TT`DECK`%0),Error,0)] ; @dolist/inline/delimit \, %1={ th [setq(Att,firstof(switch(hasattr(me,TT`DATA`[trim(%i0)]),1,TT`DATA`%i0,0),wildgrepi(me,TT`DATA`*,[trim(%i0)])))] ; @assert %q<Att>=@pemit %#=[ansi(rD,Triple Triad)] - There is no card named [ansi(gD,%i0)]. ; th [setq(Card,ucstr(extract(%q<Att>,3,1,`)))][setq(Set,left(%q<Card>,1),Num,Right(%q<Card>,3))][setq(Empty,match(%q<Deck>,0000))] ; @assert gt(%q<Empty>,0)=@pemit %#=[ansi(rD,Triple Triad)] - Your %0 deck is already full. ; th [setq(Deck,replace(%q<Deck>,%q<Empty>,ucstr(%q<Card>)),Found,0,TLV,0)][iter(lnum(1,5),[switch(extract(%q<Deck>,%i0,1),%q<Card>,setq(Found,inc(%q<Found>)))])][setq(Poss,extract(u(%#/TT`CARDS`%q<Set>),%q<Num>,1))] ; @assert gte(%q<Poss>,%q<Found>)=@pemit %#=[ansi(rD,Triple Triad)] -  You don't possess enough [ansi(gD,u(TT`DATA`%i0))] cards to add to your hand. } ; th [iter(%q<Deck>,[setq(TLV,add(%q<TLV>,extract(u(TT`DATA`%i0`STAT),6,1)))])] ; @pemit %#=[ansi(gD,Triple Triad)] - Your %0 deck current setup :%r%rTotal Card Level : %q<TLV>%r[switch(lte(%q<TLV>,u(me/TT`DECK`MAX)),0,Your deck goes over the level limit of [u(me/TT`DECK`MAX)] levels. You cannot use this deck without the [ansi(gD,Limitless)] rule.%r%r)][align(-15 0 -15 0 -15 0 -15 0 -15,[switch(extract(%q<Deck>,1,1,%b),0000,[ansi(wB,u(TT`DECK`DRAW`BLANK,None,0))],u(me/TT`DECK`DRAW`CARD,extract(%q<Deck>,1,1,%b),B,None,0))], ,[switch(extract(%q<Deck>,2,1,%b),0000,[ansi(wB,u(TT`DECK`DRAW`BLANK,None,0))],u(me/TT`DECK`DRAW`CARD,extract(%q<Deck>,2,1,%b),B,None,0))], ,[switch(extract(%q<Deck>,3,1,%b),0000,[ansi(wB,u(TT`DECK`DRAW`BLANK,None,0))],u(me/TT`DECK`DRAW`CARD,extract(%q<Deck>,3,1,%b),B,None,0))], ,[switch(extract(%q<Deck>,4,1,%b),0000,[ansi(wB,u(TT`DECK`DRAW`BLANK,None,0))],u(me/TT`DECK`DRAW`CARD,extract(%q<Deck>,4,1,%b),B,None,0))], ,[switch(extract(%q<Deck>,5,1,%b),0000,[ansi(wB,u(TT`DECK`DRAW`BLANK,None,0))],u(me/TT`DECK`DRAW`CARD,extract(%q<Deck>,5,1,%b),B,None,0))])] ; &TT`DECK`%0 %#=%q<Deck>
  19. &TT`CMD`DECK`CHECK Triple Triad Global=$+TT/Deck Check=*:@assert hasattr(%#,TT`DECK`%0)=@pemit %#=[ansi(rD,Triple Triad)] - You don't have a deck with this name. ; th [setq(Deck,u(%#/TT`DECK`%0))][setq(Found,words(matchall(%q<Deck>,0000)),TLV,0)][setq(Stop,0)][iter(lnum(1,5),[setq(C1,extract(%q<Deck>,%i0,1),Found1,1)][setq(TLV,add(%q<TLV>,extract(u(TT`DATA`%q<C1>`STAT),6,1)))][setq(Set,left(%q<C1>,1),Nb,right(%q<C1>,3))][setq(Num,extract(u(%#/TT`CARDS`%q<Set>),%q<Nb>,1),LV,extract(u(TT`DATA`%q<C1>`STAT),6,1),Found1,words(matchall(%q<Deck>,%q<C1>)))][switch(and(not(match(%q<C1>,0000)),gt(%q<Found1>,%q<Num>)),1,[setq(Stop,%i0)])])] ; @pemit %#=[ansi(gD,Triple Triad)] - Your %0 deck current setup :%r[align(10 15 5 50,,Cards :%rTotal Level :,[sub(5,%q<Found>)]%r%q<TLV>,[switch(%q<Found>,>0,[ansi(rD,You are still missing %q<Found> cards.)])][switch(%q<TLV>,>[u(TT`DECK`MAX)],%r[ansi(rD,Your total level is over [u(TT`DECK`MAX)].)]%r)][switch(and(gt(%q<Stop>,0),not(lt(%q<Found>,5))),1,%r[ansi(rD,You don't have enough [u(me/TT`DATA`[extract(%q<Deck>,%q<Stop>,1)])] cards left in your stash to use in this deck.)]%r)])]%r%r[align(-15 0 -15 0 -15 0 -15 0 -15,[switch(extract(%q<Deck>,1,1,%b),0000,[ansi(wB,u(TT`DECK`DRAW`BLANK,None,0))],u(me/TT`DECK`DRAW`CARD,extract(%q<Deck>,1,1,%b),B,None,0))], ,[switch(extract(%q<Deck>,2,1,%b),0000,[ansi(wB,u(TT`DECK`DRAW`BLANK,None,0))],u(me/TT`DECK`DRAW`CARD,extract(%q<Deck>,2,1,%b),B,None,0))], ,[switch(extract(%q<Deck>,3,1,%b),0000,[ansi(wB,u(TT`DECK`DRAW`BLANK,None,0))],u(me/TT`DECK`DRAW`CARD,extract(%q<Deck>,3,1,%b),B,None,0))], ,[switch(extract(%q<Deck>,4,1,%b),0000,[ansi(wB,u(TT`DECK`DRAW`BLANK,None,0))],u(me/TT`DECK`DRAW`CARD,extract(%q<Deck>,4,1,%b),B,None,0))], ,[switch(extract(%q<Deck>,5,1,%b),0000,[ansi(wB,u(TT`DECK`DRAW`BLANK,None,0))],u(me/TT`DECK`DRAW`CARD,extract(%q<Deck>,5,1,%b),B,None,0))])]
  20. &TT`CMD`DECK`DEL Triple Triad Global=$+TT/Deck Delete=*:@assert hasattr(%#,TT`DECK`%0)=@pemit %#=[ansi(rD,Triple Triad)] - You don't have a deck with this name. ; @wipe %#/TT`DECK`%0 ; @pemit %#=[ansi(gD,Triple Triad)] - You have deleted your [ansi(gD,%0)] deck.
  21. &TT`CMD`DECK`DETAIL Triple Triad Global=$+TT/Detail:@include me/TT`FNC`DECK`DETAIL=1
  22. &TT`CMD`DECK`DETAIL2 Triple Triad Global=$+TT/Detail *:@include me/TT`FNC`DECK`DETAIL=%0
  23. &TT`CMD`DECK`LIST Triple Triad Global=$+TT/Deck List:@pemit %#=[ansi(gD,Triple Triad Decks)] : [iter(wildgrepi(%#,TT`DECK`*,*),extract(%i0,3,1,`))]
  24. &TT`CMD`DECK`MAKE Triple Triad Global=$+TT/Deck Create=*:@break gt(words(%0),1)=@pemit %#=[ansi(rD,Triple Triad)] - Invalid Deck name, you can only use single worded names. Consider using numbers or separators such as ` or _ instead. ; @break hasattr(%#,TT`DECK`%0)=@pemit %#=[ansi(rD,Triple Triad)] - You already have a deck with this name. ; &TT`DECK`%0 %#=0000 0000 0000 0000 0000 ; @pemit %#=[ansi(gD,Triple Triad)] - You have created your [ansi(gD,%0)] deck. Use the [ansi(gD,+TT/Deck Add/%0=<Card1>\,<Card2>\,...)] to add a card to your deck.
  25. &TT`CMD`DECK`REM Triple Triad Global=$+TT/Deck Rem/*=*:@assert hasattr(%#,TT`DECK`%0)=@pemit %#=[ansi(rD,Triple Triad)] - You don't have a deck with this name. ; th [setq(Deck,ucstr(u(%#/TT`DECK`%0)),Init,u(%#/TT`DECK`%0),Error,0)] ; @dolist/inline/delimit \, %1={ th [setq(Att,firstof(switch(hasattr(me,TT`DATA`[trim(%i0)]),1,TT`DATA`%i0,0),wildgrepi(me,TT`DATA`*,[trim(%i0)])))] ; @assert %q<Att>=@pemit %#=[ansi(rD,Triple Triad)] - I don't recognize the [ansi(gD,%i0)] card. ; th [setq(Card,ucstr(extract(%q<Att>,3,1,`)))] ; @assert match(%q<Deck>,%q<Card>)=@pemit %#=[ansi(rD,Triple Triad)] - You don't have the [ansi(gD,u(TT`DATA`%i0))] card in your deck. ; th [setq(Set,left(%q<Card>,1),Num,Right(%q<Card>,3))][setq(Deck,remove(%q<Deck>,%q<Card>))][setq(Deck,insert(%q<Deck>,-1,0000))] } ; @pemit %#=[ansi(gD,Triple Triad)] - Your %0 deck current setup :%r[align(-15 0 -15 0 -15 0 -15 0 -15,[switch(extract(%q<Deck>,1,1,%b),0000,[ansi(wB,u(TT`DECK`DRAW`BLANK,None,0))],u(me/TT`DECK`DRAW`CARD,extract(%q<Deck>,1,1,%b),B,None,0))], ,[switch(extract(%q<Deck>,2,1,%b),0000,[ansi(wB,u(TT`DECK`DRAW`BLANK,None,0))],u(me/TT`DECK`DRAW`CARD,extract(%q<Deck>,2,1,%b),B,None,0))], ,[switch(extract(%q<Deck>,3,1,%b),0000,[ansi(wB,u(TT`DECK`DRAW`BLANK,None,0))],u(me/TT`DECK`DRAW`CARD,extract(%q<Deck>,3,1,%b),B,None,0))], ,[switch(extract(%q<Deck>,4,1,%b),0000,[ansi(wB,u(TT`DECK`DRAW`BLANK,None,0))],u(me/TT`DECK`DRAW`CARD,extract(%q<Deck>,4,1,%b),B,None,0))], ,[switch(extract(%q<Deck>,5,1,%b),0000,[ansi(wB,u(TT`DECK`DRAW`BLANK,None,0))],u(me/TT`DECK`DRAW`CARD,extract(%q<Deck>,5,1,%b),B,None,0))])] ; &TT`DECK`%0 %#=%q<Deck>
  26. &TT`CMD`DECK`STASH Triple Triad Global=$+TT/Stash:@include me/TT`FNC`DECK`STASH=1
  27. &TT`CMD`DECK`STASH2 Triple Triad Global=$+TT/Stash *:@include me/TT`FNC`DECK`STASH=%0
  28. &TT`CMD`GAME Triple Triad Global=
  29. &TT`CMD`GAME`OPTION Triple Triad Global=$+TT/Option *:@assert [nattr(me/TT`GAME`%#`GAME)] ; th [setq(ID,u(me/TT`GAME`%#`GAME))][setq(Rules,u(me/TT`GAME`%q<ID>`RULES))]; @break and(match(%q<Rules>,Broadcast),match(%0,Broadcast))=@pemit %#=[ansi(rD,Triple Triad)] - This game is already broadcasting. ; @break and(match(%q<Rules>,Private),match(%0,Private))=@pemit %#=[ansi(rD,Triple Triad)] - This game is already private. ; @assert or(match(%0,None),match(%0,Private),match(%0,Broadcast))=@pemit %#=[ansi(rD,Triple Triad)] - Invalid option, use Broadcast, Private or None. ; @switch/inline %0=None,th [setq(Rules,remove(%q<Rules>,Broadcast))][setq(Rules,remove(%q<Rules>,Private))],private,th [setq(Rules,remove(%q<Rules>,Broadcast))][setq(Rules,insert(%q<Rules>,-1,Private))],broadcast,th [setq(Rules,remove(%q<Rules>,Private))][setq(Rules,insert(%q<Rules>,-1,Broadcast))] ; &TT`GAME`%q<ID>`RULES me=%q<Rules> ; th [setq(Blue,u(TT`GAME`%q<ID>`BLUE),Red,u(TT`GAME`%q<ID>`RED))] ; @switch/inline %0=Private,@remit loc(%#)=[ansi(gD,Triple Triad)] - [name(%q<Blue>)] is in a match against [name(%q<Red>)] and has made the game private.,None,@remit loc(%#)=[ansi(gD,Triple Triad)] - [name(%q<Blue>)] is in a match against [name(%q<Red>)] and has opened the game for spectating.,Broadcast,{ @remit loc(%#)=[ansi(gD,Triple Triad)] - [name(%q<Blue>)] is in a match against [name(%q<Red>)] and is now broadcasting the game. ; @oemit loc(%q<Blue>)/%q<Blue> %q<Red>=u(TT`GRID`SP,%q<ID>,%q<Blue>,%q<Red>) } ; @wipe me/TT`GAME`%q<ID>`SPECTATE
  30. &TT`CMD`INIT Triple Triad Global=$+TT/Starter:@break [gt([extract(u(%#/TT`STATS),7,1)],4)]=@pemit %#=[ansi(rD,Triple Triad)] - You can only use this command if you have less than 4 cards remaining. Consider using the [ansi(gD,+TT/Buy)] if you wish to get more cards. ; @dol/inline u(TT`DATA`SETS)=&TT`CARDS`%i0 %#=[trim(repeat(0%b,nattr(me/TT`DATA`%i0*)))] ; @dolist/inline lnum(1,9)={ @include me/TT`FNC`RANDCARD=%#,A,1,1 } ; @dolist/inline lnum(1,7)={ @include me/TT`FNC`RANDCARD=%#,A,2,1 } ; @dolist/inline lnum(1,4)={ @include me/TT`FNC`RANDCARD=%#,A,3,1 } ; &TT`STATS %#=[switch(hasattr(%#,TT`STATS),1,replace(u(%#/TT`STATS),7,20),0 0 0 0 0 0 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)] ; @pemit %#=[ansi(gD,Triple Triad)] - You are now ready to play Triple Triad, and have received your initial 20 playing cards.
  31. &TT`CMD`JOINGAME Triple Triad Global=$+TT/Accept *:@assert nattr(me/TT`GAME`%#`GAME)=@pemit %#=[ansi(rD,Triple Triad)] - You have no game invite. ; @assert hasattr(%#,TT`DECK`%0)=@pemit %#=[ansi(rD,Triple Triad)] - You don't have a deck with this name. ; @include me/TT`FNC`CHECKCARDS=%# ; th [setq(ID,u(me/TT`GAME`%#`GAME))][setq(Rules,u(me/TT`GAME`%q<ID>`RULES))] ; @include me/TT`FNC`GAMEDECK=%#,%0,%q<Rules> ; &TT`GAME`%#`SIDE me=Red ; &TT`GAME`%#`HAND me=u(%#/TT`DECK`%0) ; &TT`GAME`%#`INIT me=u(me/TT`GAME`%#`HAND) ; &TT`GAME`%q<ID>`PLAYERS me=[insert(u(TT`GAME`%q<ID>`PLAYERS),-1,%#,%b)] ; &TT`GAME`%q<ID>`RED me=%# ; &TT`GAME`%q<ID>`GRID me=[switch(match(%q<Rules>,Wall),>0,0001 0001 0001 0001 0001 0001 0000 0000 0000 0001 0001 0000 0000 0000 0001 0001 0000 0000 0000 0001 0001 0001 0001 0001 0001,0002 0002 0002 0002 0002 0002 0000 0000 0000 0002 0002 0000 0000 0000 0002 0002 0000 0000 0000 0002 0002 0002 0002 0002 0002)] ; &TT`GAME`%q<ID>`GRIDC me=D D D D D D D D D D D D D D D D D D D D D D D D D ; &TT`GAME`%q<ID>`ELEM me=None None None None None [switch(match(%q<Rules>,Elemental),0,None None None None None None None None None None None None None None None,[u(me/TT`FNC`RANDELEM)])] None None None None None ; &TT`GAME`%q<ID>`TURN me=randword(u(TT`GAME`%q<ID>`PLAYERS)) ; th [setq(Blue,u(me/TT`GAME`%q<ID>`BLUE),Red,u(me/TT`GAME`%q<ID>`Red))] [setq(NRed,5,NBlue,5)] ; @pemit %q<Blue>=u(TT`GRID`P1,%q<ID>,%q<Blue>,%q<Red>) ; @pemit %q<Red>=u(TT`GRID`P2,%q<ID>,%q<Blue>,%q<Red>) ; &TT`GAME`%q<ID>`MODE me=1 ; @include me/TT`FNC`ADDSTATS=%q<ID> ; @switch/inline and(not(match(%q<Rules>,Private)),not(match(%q<Rules>,Broadcast)))=1,@oemit loc(%#)/%q<Blue> %q<Red>=[ansi(gD,Triple Triad)] - [name(%q<Blue>)] has challenged [name(%q<Red>)] to a game. Use +TT/Spectate Join=[name(%q<Blue>)] to view it. ; @switch/inline and(not(match(%q<Rules>,Private)),match(%q<Rules>,Broadcast))=1, { @include me/TT`FNC`SCORE=%q<ID>,%q<Blue>,%q<Red> ; @oemit loc(%#)/%q<Blue> %q<Red>=[ansi(gD,Triple Triad)] - [name(%q<Blue>)] has challenged [name(%q<Red>)] to a game. Game is being broadcasted to the room : %r%r[u(TT`GRID`SP,%q<ID>,u(TT`GAME`%q<ID>`BLUE),u(TT`GAME`%q<ID>`RED))] }
  32. &TT`CMD`NEWCARD Triple Triad Global=$+TTW/Card New */*=*: @assert u(%#/TT`WIZARD) ; th [setq(Set,%0,Name,%1,Stats,%2)][setq(Max,inc(nattr(me/TT`DATA`%q<Set>*`STAT)),LV,extract(%q<Stats>,6,1))][setq(ID,%q<Set>[repeat(0,sub(3,strlen(%q<Max>)))]%q<Max>)] ; @assert match(u(TT`DATA`SETS),%q<Set>)=@pemit %#=[ansi(rD,Triple Triad)] - There are no series with that ID. ; @assert match(lnum(1,10),%q<LV>)=@pemit %#=[ansi(rD,Triple Triad)] - The level is invalid, it has to be between 1 and 10. ; @dolist/inline lnum(1,4)=@assert [setq(A,extract(%q<stats>,%i0,1))] [and(isnum(%qA),match(lnum(1,10),%qA),not(match(%qA,.)))]=@pemit %#=[ansi(rD,Triple Triad)] - Only use numbers between 1 and 10. Use 10 instead of "A" ; @break [setq(A,extract(%q<stats>,5,1))] [not(match(Lightning Fire Ice Water Earth Wind Poison Holy None,%qA))]=@pemit %#=[ansi(rD,Triple Triad)] - Invalid Elemental. Make sure you only use one of the following : [ansi(gD,Lightning Fire Ice Water Wind Earth Poison Holy None)] ; @break wildgrepi(me,TT`DATA`*,%q<Name>)=@pemit %#=[ansi(rD,Triple Triad)] - There's already a card with this name. ;  &TT`DATA`%q<ID>`STAT me=%q<Stats> ; &TT`DATA`%q<ID> me=%q<Name> ; @pemit %#=[ansi(gD,Triple Triad)] - You have created the [ansi(gD,%q<Name>)] Card, ID %q<ID>, in the [ansi(nbD,u(TT`DATA`SET`%q<Set>))] series, with the following stats : [extract(%q<Stats>,1,6)]
  33. &TT`CMD`NEWGAME Triple Triad Global=$+TT/Game *=*,*:@break [nattr(me/TT`GAME`%#`GAME)]=@pemit %#=[ansi(rD,Triple Triad)] - You are already in a game. ; @break [nattr(me/TT`GAME`[pmatch(%0)]`GAME)]=@pemit %#=[ansi(rD,Triple Triad)] - [name(pmatch(%0))] is already in a game, or already has an invite. ; @dolist/inline %2={ @assert match(Open Same Plus Wall Combo Elemental None One Diff All Limitless Private Broadcast,%iL)=@pemit %#=[ansi(rD,Triple Triad)] - The %i0 rule is invalid. Valid rules are [ansi(gD,Open)], [ansi(gD,Same)], [ansi(gD,Same Wall)], [ansi(gD,Plus)], [ansi(gD,Combo)], [ansi(gD,Elemental)] and [ansi(gD,Limitless)]. Trading rules are [ansi(gD,None)], [ansi(gD,One)], [ansi(gD,Diff)] and [ansi(gD,All)].  Spectating options are [ansi(gD,Private)] and [ansi(gD,Broadcast)]. } ; th [setq(Trade,[switch(match(%2,None),>0,1)] [switch(match(%2,One),>0,1)] [switch(match(%2,Diff),>0,1)] [switch(match(%2,All),>0,1)])] ; @break gt(words(%q<Trade>),1)=@pemit %#=[ansi(rD,Triple Triad)] - You can only use one Trading rule at a time. ; th [setq(Trade,[switch(match(%2,Broadcast),>0,1)] [switch(match(%2,Private),>0,1)])] ; @break gt(words(%q<Trade>),1)=@pemit %#=[ansi(rD,Triple Triad)] - You can only use one option between Private or Broadcast at a time. ; @include me/TT`FNC`GAMEDECK=%#,%1,%2 ; @assert [locate(%#,%0,PTmn)]= @pemit %#=[ansi(rD,Triple Triad)] - That person is not in this room. ; @include me/TT`FNC`CHECKCARDS=%# ; th [setq(Rules,%2)][switch(or(match(%q<rules>,None),match(%q<rules>,One),match(%q<rules>,Diff),match(%q<rules>,All)),0,[setq(Rules,One%b%q<rules>)])] ; @include me/TT`FNC`NEWID ; &TT`GAME`%q<ID>`PLAYERS me=%# ; &TT`GAME`%q<ID>`BLUE me=%# ; &TT`GAME`%q<ID>`RULES me=%q<Rules> ; &TT`GAME`%q<ID>`MODE me=0 ; &TT`GAME`%#`GAME me=%q<ID> ; &TT`GAME`%#`SIDE me=Blue ; &TT`GAME`%#`HAND me=u(%#/TT`DECK`%1) ; &TT`GAME`%#`INIT me=u(me/TT`GAME`%#`HAND) ; &TT`GAME`[pmatch(%0)]`GAME me=%q<ID> ; @pemit %#=[ansi(rD,Triple Triad)] - You have have invited [name([locate(%#,%0,PTmn)])] to a game using the rules : [ansi(gD,%q<Rules>)] ; @pemit [pmatch(%0)]=[ansi(gD,Triple Triad)] - [name(%#)] has invited you to a game using the rules : [ansi(gD,Trading : [switch(match(%q<Rules>,none),>0,None%b)][switch(match(%q<Rules>,one),>0,One%b)][switch(match(%q<Rules>,diff),>0,Diff%b)][switch(match(%q<Rules>,all),>0,All%b)]- [switch(match(%q<Rules>,open),>0,Open%b)][switch(match(%q<Rules>,same),>0,Same%b)][switch(match(%q<Rules>,wall),>0,Wall%b)][switch(match(%q<Rules>,plus),>0,Plus%b)][switch(match(%q<Rules>,combo),>0,Combo%b)][switch(match(%q<Rules>,elemental),>0,Elemental%b)][switch(match(%q<Rules>,limitless),>0,[ansi(rD,Limitless)])])]
  34. &TT`CMD`PICKCARD Triple Triad Global=$+TT/Choose *:@assert [nattr(me/TT`GAME`%#`GAME)] ; th [setq(ID,u(TT`GAME`%#`GAME))][setq(Win,u(TT`GAME`%q<ID>`WINNER))] ; @assert match(u(me/TT`GAME`%q<ID>`MODE),2) ; th [setq(Winner,extract(%q<Win>,1,1),Loser,extract(%q<Win>,2,1),Diff,extract(%q<Win>,3,1),Deck,extract(%q<Win>,4,5))] ; @assert match(%q<Winner>,%#) ; th [setq(Pick1,[switch(u(TT`GAME`%q<ID>`RULES),*One*,1,*Diff*,%q<Diff>,*All*,5)],Pick2,words(%0,\,))] ; @break not(match(%q<Pick1>,%q<Pick2>))=@pemit %#=[ansi(rD,Triple Triad)] - You need to pick %q<Pick1> cards using the command [ansi(gD,+TT/Choose Card1\,Card2\,...)]. ; @dolist/delimit/inline \, %0={ @switch/inline %i0=None,,{ th [setq(Found,firstof(switch(hasattr(me,TT`DATA`%0),1,TT`DATA`%i0,0),wildgrepi(me,TT`DATA`*,%i0)))][setq(Card,extract(%q<Found>,3,1,`))][setq(Set,left(%q<Card>,1),Nb,right(%q<Card>,3),LV,extract(u(TT`DATA`%q<Card>`STAT),6,1))] ; @assert %q<Found>=@pemit %#=[ansi(rD,Triple Triad)] - The card %i0 is not a valid name. ; @assert match(%q<Deck>,%q<Card>)=@pemit %#=[ansi(rD,Triple Triad)] - Your opponent did not play with the %i0 card. You can only pick cards used in the game. ; th [setq(Cards,u(%q<Winner>/TT`CARDS`%q<Set>))] ; @break gt(inc(extract(%q<Cards>,%q<Nb>,1)),extract(u(TT`DATA`MAX`%q<Set>),%q<LV>,1))=@pemit %#=[ansi(rD,Triple Triad)] - You already have the limit for the card u[(TT`DATA`%q<Card>)]. ; &TT`GAME`%q<ID>`WINLIST me=[insert(u(me/TT`GAME`%q<ID>`WINLIST),-1,%q<Card>,\,)] } ; } ; th [setq(WinList,u(me/TT`GAME`%q<ID>`WINLIST))] ; @dolist/inline/delimit \, %q<WinList>={ th [setq(Set,left(%i0,1),Nb,right(%i0,3),LV,extract(u(TT`DATA`%i0`STAT),6,1))] ; &TT`CARDS`%q<Set> %q<Winner>=[setq(Cards,u(%q<Winner>/TT`CARDS`%q<Set>))][replace(%q<Cards>,%q<Nb>,bound(inc(extract(%q<Cards>,%q<Nb>,1)),0,extract(u(TT`DATA`MAX`%q<Set>),%q<LV>,1)))] ; &TT`STATS %q<Winner>=[setq(Stats,u(%q<Winner>/TT`STATS))][replace(%q<Stats>,9,inc(extract(%q<Stats>,9,1)))] ; &TT`CARDS`%q<Set> %q<Loser>=[setq(Cards,u(%q<Loser>/TT`CARDS`%q<Set>))][replace(%q<Cards>,%q<Nb>,bound(dec(extract(%q<Cards>,%q<Nb>,1)),0,extract(u(TT`DATA`MAX`%q<Set>),%q<LV>,1)))] ; &TT`STATS %q<Loser>=[setq(Stats,u(%q<Loser>/TT`STATS))][replace(%q<Stats>,11,inc(extract(%q<Stats>,11,1)))] } ; @switch/inline words(%q<WinList>,\,)=0,{ @pemit %q<Winner>=[ansi(gD,Triple Triad)] - You have taken no cards from your opponent. ; @pemit %q<Loser>=[ansi(rD,Triple Triad)] - Your opponent has choosen to take no cards from you. },{ @pemit %q<Winner>=[ansi(gD,Triple Triad)] - You have earned your cards\, they were added to your stash. ; @pemit %q<Loser>=[ansi(rD,Triple Triad)] - You have lost the following cards : [trim(iter(%q<WinList>,%b[u(TT`DATA`%i0)],\,,\,))] ; @include me/TT`FNC`CHECKSTASH=%q<Winner> ; @include me/TT`FNC`CHECKSTASH=%q<Loser> } ; @wipe me/TT`GAME`%q<ID> ; @wipe me/TT`GAME`%q<Blue> ; @wipe me/TT`GAME`%q<Red>
  35. &TT`CMD`PLAYCARD Triple Triad Global=$+TT/Play *=*:@assert nattr(me/TT`GAME`%#`GAME) ; @assert match(1 2 3 4 5,%0)=@pemit %#=[ansi(rD,Triple Triad)] - You need to pick a card between 1 and 5. ; @assert match(1 2 3 4 5 6 7 8 9,%1)=@pemit %#=[ansi(rD,Triple Triad)] - You need to pick a grid position between 1 and 9. ; th [setq(Hand,u(me/TT`GAME`%#`HAND))][setq(Card,extract(%q<Hand>,%0,1,%b))] ; @break match(0000,%q<Card>)=@pemit %#=[ansi(rD,Triple Triad)] - You already played card #%0 from your hand. Please choose another to play. ; th [setq(ID,u(me/TT`GAME`%#`GAME))][setq(Grid,u(me/TT`GAME`%q<ID>`GRID),Color,u(me/TT`GAME`%q<ID>`GRIDC),Turn,u(me/TT`GAME`%q<ID>`TURN),PLAYERS,u(me/TT`GAME`%q<ID>`PLAYERS))][setq(PCol,[switch(u(me/TT`GAME`%#`SIDE),Blue,B,Red,R)])] ; @assert match(%q<Turn>,%#)=@pemit %#=[ansi(rD,Triple Triad)] - It's not your turn to play. ; th [setq(POSX,div(dec(%1),3),POSY,inc(mod(dec(%1),3)))][setq(POS,u(TT`FNC`FINDPOS,%q<POSX>,%q<POSY>))] ; @assert match(0000,extract(%q<Grid>,%q<POS>,1,%b))=@pemit %#=[ansi(rD,Triple Triad)] - There's already a card in the spot #%1 of the grid, please choose another. ; @wipe me/TT`GAME`%q<ID>`COMBO ; &TT`GAME`%q<ID>`GRID me=[replace(%q<Grid>,%q<POS>,%q<Card>,%b)] ; &TT`GAME`%q<ID>`GRIDC me=[replace(%q<Color>,%q<POS>,%q<PCol>,%b)] ; &TT`GAME`%#`HAND me=[replace(%q<Hand>,%0,0000,%b)] ; @include/nobreak me/TT`PLAY`POS=%q<ID>,%1,%q<PCol>,1 ; @switch/inline [and(gt(words(%q<Combo>,%b),0),match(%q<Rules>,Combo))]=>0,{ @include/nobreak me/TT`PLAY`COMBO=%q<ID>,%q<PCol> } ; &TT`GAME`%q<ID>`TURN me=[trim(remove(%q<Players>,%#))] ; @include/clearregs me/TT`FNC`SHOW`GRID=%#
  36. &TT`CMD`REFUSEGAME Triple Triad Global=$+TT/Refuse: @assert nattr(me/TT`GAME`%#`GAME)=@pemit %#=[ansi(rD,Triple Triad)] - You have no game invite. ; th [setq(ID,u(me/TT`GAME`%#`GAME))] ;@pemit %#=[ansi(rD,Triple Triad)] - You have refused the game against [name(u(me/TT`GAME`%q<ID>`BLUE))]. ; @pemit [u(me/TT`GAME`%q<ID>`BLUE)]=[ansi(rD,Triple Triad)] - [name(%#)] has refused your game invite. ; @wipe me/TT`GAME`[u(me/TT`GAME`%q<ID>`BLUE)] ; @wipe me/TT`GAME`%# ; @wipe me/TT`GAME`%q<ID>
  37. &TT`CMD`REMCARD Triple Triad Global=$+TTW/Card Rem *=*: @assert u(%#/TT`WIZARD) ; th [setq(Num,pmatch(%0),Data,wildgrepi(me,TT`DATA`*,%1))] ; @assert %q<Data>=@pemit %#=[ansi(rD,Triple Triad)] - There are no cards with this name. ; @assert hasattr(%q<Num>/TT`STATS)=@pemit %#=[ansi(rD,Triple Triad)] - This player hasn't initialized the game to play yet. ; @include me/TT`FNC`CHECKCARDS=%# ; th [setq(ID,extract(%q<Data>,3,1,`))][setq(Set,Left(%q<ID>,1),Nb,Right(%q<ID>,3),LV,extract(u(TT`DATA`%q<ID>`STAT),6,1))][setq(Cards,u(%q<Num>/TT`CARDS`%q<Set>))] ; &TT`CARDS`%q<Set> %q<Num>=[replace(%q<Cards>,%q<Nb>,bound(dec(extract(%q<Cards>,%q<Nb>,1)),0,extract(u(TT`DATA`MAX`%q<Set>),%q<LV>,1)))] ; @include me/TT`FNC`CHECKSTASH=%q<Num> ; @pemit %#=[ansi(gD,Triple Triad)] - You have removed a %1 Card from %0's stash.
  38. &TT`CMD`REMPOINTS Triple Triad Global=$+TTW/Points Rem *=*:@assert u(%#/TT`WIZARD) ; th [setq(Num,pmatch(%0))][setq(Stats,u(%q<Num>/TT`STATS))] ; @assert isnum(%1)=@pemit %#=[ansi(rD,Triple Triad)] - You can only enter numbers for points. ; @assert hasattr(%q<Num>,TT`STATS)=@pemit %#=[ansi(rD,Triple Triad)] - This player hasn't initialized the game to play yet. ; &TT`STATS %q<Num>=[replace(%q<Stats>,12,bound(sub(extract(%q<Stats>,12,1),floor(%1)),0,10000))] ; @pemit %#=[ansi(gD,Triple Triad)] - You have removed [floor(trim(%1))] Card Points from %0. They now have [extract(u(%q<Num>/TT`STATS),12,1)] points.
  39. &TT`CMD`RNDSTATS Triple Triad Global=$+TT/Help Random=*:@include me/TT`FNC`RNDSTATS=%0 ; th [setq(1,%q<Result>)] ; @include me/TT`FNC`RNDSTATS=%0 ; th [setq(2,%q<Result>)] ; @include me/TT`FNC`RNDSTATS=%0 ; th [setq(3,%q<Result>)] ; @include me/TT`FNC`RNDSTATS=%0 ; th [setq(4,%q<Result>)] ; @include me/TT`FNC`RNDSTATS=%0 ; th [setq(5,%q<Result>)] ; @pemit %#=+[repeat(-,40)]+%r[align(1. -38 1.,|,[ansi(gD,Triple Triad Help%rRandom Card Stats%rLevel %0)],|)]%r+[repeat(-,40)]+%r[align(1. -38 1.,|,%r%q1%r%q2%r%q3%r%q4%r%q5%r%r,|)]%r+[repeat(-,40)]+%r
  40. &TT`CMD`SEEGRID Triple Triad Global=$+TT/Grid:@assert hasattr(me,TT`GAME`%#`GAME) ; th [setq(ID,u(me/TT`GAME`%#`GAME))][setq(Rules,u(me/TT`GAME`%q<ID>`RULES))][setq(Blue,u(TT`GAME`%q<ID>`BLUE),Red,u(TT`GAME`%q<ID>`RED))] ; @include me/TT`FNC`SCORE=%q<ID>,%q<Blue>,%q<Red> ; @pemit %#=u(TT`GRID`[switch(%q<Blue>,%#,P1,P2)],%q<ID>,%q<Blue>,%q<Red>) ; @assert u(TT`GAME`%q<ID>`SPECTATE) ; @dolist/inline u(TT`GAME`%q<ID>`SPECTATE)=@pemit %i0=u(TT`GRID`SP,%q<ID>,%q<Blue>,%q<Red>)
  41. &TT`CMD`SPEC Triple Triad Global=
  42. &TT`CMD`SPEC`LEAVE Triple Triad Global=$+TT/Spectate Leave: th [setq(ID,u(TT`GAME`%#`SPECTATE))] ; @assert %q<ID>=@pemit %#=[ansi(rD,Triple Triad)] - Your are not spectating any games. ; &TT`GAME`%q<ID>`SPECTATE me=remove(u(TT`GAME`%q<ID>`SPECTATE),%#,%b) ; @wipe me/TT`GAME`%#`SPECTATE ; @pemit %#=[ansi(rD,Triple Triad)] - You have stopped spectating this game. ; @pemit u(TT`GAME`%q<ID>`BLUE)=[ansi(gD,Triple Triad)] - [name(%#)] stops spectating the game. ; @pemit u(TT`GAME`%q<ID>`RED)=[ansi(gD,Triple Triad)] - [name(%#)] stops spectating the game.
  43. &TT`CMD`SPECTATE Triple Triad Global=$+TT/Spectate Join=*: @break [nattr(me/TT`GAME`%#`GAME)]=@pemit %#=[ansi(rD,Triple Triad)] - You cannot spectate while you are in a game. ; @assert [nattr(me/TT`GAME`[pmatch(%0)]`GAME)]=@pemit %#=[ansi(rD,Triple Triad)] - [name(pmatch(%0))] is not in a game. ; @assert [locate(%#,%0,PTmn)]= @pemit %#=[ansi(rD,Triple Triad)] - That person is not in this room. ; th [setq(ID,u(me/TT`GAME`[pmatch(%0)]`GAME))][setq(Rules,u(me/TT`GAME`%q<ID>`RULES))] ; @break match(%q<Rules>,Private)=@pemit %#=[ansi(rD,Triple Triad)] - This game is private, spectating is not allowed. ; &TT`GAME`%q<ID>`SPECTATE me=insert(u(TT`GAME`%q<ID>`SPECTATE),-1,%#,%b) ; &TT`GAME`%#`SPECTATE me=%q<ID> ; @pemit %#=[ansi(gD,Triple Triad)] - You are now spectating game #%q<ID> ; th [setq(Blue,u(TT`GAME`%q<ID>`BLUE),Red,u(TT`GAME`%q<ID>`RED))] ; @pemit %q<Blue>=[ansi(gD,Triple Triad)] - [name(%#)] is now spectating the game. ; @pemit %q<Red>=[ansi(gD,Triple Triad)] - [name(%#)] is now spectating the game. ; @include me/TT`FNC`SCORE=%q<ID>,%q<Blue>,%q<Red> ; @pemit %#=u(TT`GRID`SP,%q<ID>,%q<Blue>,%q<Red>)
  44. &TT`CMD`STATS Triple Triad Global=$+TT/Stats:th [setq(Stats,u(%#/TT`STATS))] ; @pemit %#=u(me/TT`FNC`STATS,[name(%#)])
  45. &TT`CMD`STATS2 Triple Triad Global=$+TT/Stats *: th [setq(Num,[locate(%#,%0,PTmn)])][setq(Stats,u(%q<Num>/TT`STATS))] ; @assert %q<Num> ; @pemit %#=u(me/TT`FNC`STATS,[name(%q<Num>)])
  46. &TT`CMD`WINLIST Triple Triad Global=$+TT/Winlist: @assert [nattr(me/TT`GAME`%#`GAME)] ; th [setq(ID,u(TT`GAME`%#`GAME))][setq(Win,u(TT`GAME`%q<ID>`WINNER))][setq(Winner,extract(%q<Win>,1,1),Loser,extract(%q<Win>,2,1),Diff,extract(%q<Win>,3,1),Deck,extract(%q<Win>,4,5))] ; @assert match(u(me/TT`GAME`%q<ID>`MODE),2) ; @assert match(%q<Winner>,%#) ; @pemit %#=[ansi(gD,Triple Triad)] - You have won the game, you can choose %q<Diff> cards from your opponent : %r%r%b[iter(%q<Deck>,[setq(Num,extract(u(%#/TT`CARDS`[left(%i0,1)]),Right(%i0,3),1))][ansi(cD,%i0)][space(6)][u(TT`DATA`%i0)][space(sub(25,strlen(u(TT`DATA`%i0))))]You own %q<Num> of this card.%r)] %r%rUse the command [ansi(gD,+TT/Choose Card[repeat(\,Card,dec(%q<Diff>))])] to pick your cards. You can replace any card by [ansi(gD,None)] if you decide to take less than the amount you have earned, or if there are no cards you can take from your opponent. ; @pemit %q<Red>=[ansi(rD,Triple Triad)] - You have lost the game. Your opponent is currently choosing their winning cards.}
  47. &TT`DATA Triple Triad Global=
  48. &TT`DATA`0001 Triple Triad Global=10 10 10 10 None 0
  49. &TT`DATA`0002 Triple Triad Global=0 0 0 0 None 0
  50. &TT`DATA`A001 Triple Triad Global=Geezard
  51. &TT`DATA`A001`STAT Triple Triad Global=1 5 4 1 None 1
  52. &TT`DATA`A002 Triple Triad Global=Funguar
  53. &TT`DATA`A002`STAT Triple Triad Global=5 3 1 1 None 1
  54. &TT`DATA`A003 Triple Triad Global=Bite Bug
  55. &TT`DATA`A003`STAT Triple Triad Global=1 5 3 3 None 1
  56. &TT`DATA`A004 Triple Triad Global=Red Bat
  57. &TT`DATA`A004`STAT Triple Triad Global=6 2 1 1 None 1
  58. &TT`DATA`A005 Triple Triad Global=Blobra
  59. &TT`DATA`A005`STAT Triple Triad Global=2 5 3 1 None 1
  60. &TT`DATA`A006 Triple Triad Global=Gayla
  61. &TT`DATA`A006`STAT Triple Triad Global=2 4 1 4 Lightning 1
  62. &TT`DATA`A007 Triple Triad Global=Gesper
  63. &TT`DATA`A007`STAT Triple Triad Global=1 1 5 4 None 1
  64. &TT`DATA`A008 Triple Triad Global=Goblin
  65. &TT`DATA`A008`STAT Triple Triad Global=3 1 5 2 Earth 1
  66. &TT`DATA`A009 Triple Triad Global=Blood Soul
  67. &TT`DATA`A009`STAT Triple Triad Global=2 1 1 6 None 1
  68. &TT`DATA`A010 Triple Triad Global=Crawler
  69. &TT`DATA`A010`STAT Triple Triad Global=4 3 2 4 None 1
  70. &TT`DATA`A011 Triple Triad Global=Cockatrice
  71. &TT`DATA`A011`STAT Triple Triad Global=2 6 1 2 Thunder 1
  72. &TT`DATA`A012 Triple Triad Global=Grat
  73. &TT`DATA`A012`STAT Triple Triad Global=7 1 1 3 None 2
  74. &TT`DATA`A013 Triple Triad Global=Buel
  75. &TT`DATA`A013`STAT Triple Triad Global=6 3 2 2 None 2
  76. &TT`DATA`A014 Triple Triad Global=Mesmerize
  77. &TT`DATA`A014`STAT Triple Triad Global=5 4 3 3 None 2
  78. &TT`DATA`A015 Triple Triad Global=Glacial Eye
  79. &TT`DATA`A015`STAT Triple Triad Global=6 3 1 4 Ice 2
  80. &TT`DATA`A016 Triple Triad Global=Belhelmel
  81. &TT`DATA`A016`STAT Triple Triad Global=3 3 4 5 None 2
  82. &TT`DATA`A017 Triple Triad Global=Trustaevis
  83. &TT`DATA`A017`STAT Triple Triad Global=5 5 3 2 Wind 2
  84. &TT`DATA`A018 Triple Triad Global=Anacondaur
  85. &TT`DATA`A018`STAT Triple Triad Global=5 5 1 3 Poison 2
  86. &TT`DATA`A019 Triple Triad Global=Creeps
  87. &TT`DATA`A019`STAT Triple Triad Global=5 2 2 5 Lightning 2
  88. &TT`DATA`A020 Triple Triad Global=Grendel
  89. &TT`DATA`A020`STAT Triple Triad Global=4 2 4 5 Lightning 2
  90. &TT`DATA`A021 Triple Triad Global=Jelly Eye
  91. &TT`DATA`A021`STAT Triple Triad Global=3 7 2 1 None 2
  92. &TT`DATA`A022 Triple Triad Global=Grand Mantis
  93. &TT`DATA`A022`STAT Triple Triad Global=5 3 2 5 Lightning 2
  94. &TT`DATA`A023 Triple Triad Global=Forbidden
  95. &TT`DATA`A023`STAT Triple Triad Global=6 2 6 3 None 3
  96. &TT`DATA`A024 Triple Triad Global=Armadodo
  97. &TT`DATA`A024`STAT Triple Triad Global=6 6 3 1 Earth 3
  98. &TT`DATA`A025 Triple Triad Global=Tri-Face
  99. &TT`DATA`A025`STAT Triple Triad Global=3 5 5 5 Poison 3
  100. &TT`DATA`A026 Triple Triad Global=Fastoticalon
  101. &TT`DATA`A026`STAT Triple Triad Global=7 3 5 1 Earth 3
  102. &TT`DATA`A027 Triple Triad Global=Snow Lion
  103. &TT`DATA`A027`STAT Triple Triad Global=7 3 1 5 Ice 3
  104. &TT`DATA`A028 Triple Triad Global=Ochu
  105. &TT`DATA`A028`STAT Triple Triad Global=5 3 6 3 None 3
  106. &TT`DATA`A029 Triple Triad Global=SAM08G
  107. &TT`DATA`A029`STAT Triple Triad Global=5 4 6 2 Fire 3
  108. &TT`DATA`A030 Triple Triad Global=Death Claw
  109. &TT`DATA`A030`STAT Triple Triad Global=4 2 4 7 Fire 3
  110. &TT`DATA`A031 Triple Triad Global=Cactuar
  111. &TT`DATA`A031`STAT Triple Triad Global=6 3 2 6 None 3
  112. &TT`DATA`A032 Triple Triad Global=Tonberry
  113. &TT`DATA`A032`STAT Triple Triad Global=3 4 6 4 None 3
  114. &TT`DATA`A033 Triple Triad Global=Abyss Worm
  115. &TT`DATA`A033`STAT Triple Triad Global=7 5 2 3 Earth 3
  116. &TT`DATA`A034 Triple Triad Global=Turtapod
  117. &TT`DATA`A034`STAT Triple Triad Global=2 7 3 6 None 4
  118. &TT`DATA`A035 Triple Triad Global=Vysage
  119. &TT`DATA`A035`STAT Triple Triad Global=6 5 5 4 None 4
  120. &TT`DATA`A036 Triple Triad Global=T-Rexaur
  121. &TT`DATA`A036`STAT Triple Triad Global=4 7 6 2 None 4
  122. &TT`DATA`A037 Triple Triad Global=Bomb
  123. &TT`DATA`A037`STAT Triple Triad Global=2 3 7 6 Fire 4
  124. &TT`DATA`A038 Triple Triad Global=Blitz
  125. &TT`DATA`A038`STAT Triple Triad Global=1 7 6 4 Lightning 4
  126. &TT`DATA`A039 Triple Triad Global=Wendigo
  127. &TT`DATA`A039`STAT Triple Triad Global=7 6 3 1 None 4
  128. &TT`DATA`A040 Triple Triad Global=Coeurl
  129. &TT`DATA`A040`STAT Triple Triad Global=7 4 4 4 None 4
  130. &TT`DATA`A041 Triple Triad Global=Imp
  131. &TT`DATA`A041`STAT Triple Triad Global=3 6 7 3 None 4
  132. &TT`DATA`A042 Triple Triad Global=Blue Dragon
  133. &TT`DATA`A042`STAT Triple Triad Global=6 3 2 7 Poison 4
  134. &TT`DATA`A043 Triple Triad Global=Adamantoise
  135. &TT`DATA`A043`STAT Triple Triad Global=4 6 5 5 Earth 4
  136. &TT`DATA`A044 Triple Triad Global=Hexadragon
  137. &TT`DATA`A044`STAT Triple Triad Global=7 3 5 4 Fire 4
  138. &TT`DATA`A045 Triple Triad Global=Iron Giant
  139. &TT`DATA`A045`STAT Triple Triad Global=6 5 5 6 None 5
  140. &TT`DATA`A046 Triple Triad Global=Bememoth
  141. &TT`DATA`A046`STAT Triple Triad Global=3 7 6 5 None 5
  142. &TT`DATA`A047 Triple Triad Global=Chimera
  143. &TT`DATA`A047`STAT Triple Triad Global=7 3 6 5 Water 5
  144. &TT`DATA`A048 Triple Triad Global=Pupu
  145. &TT`DATA`A048`STAT Triple Triad Global=3 1 10 2 None 5
  146. &TT`DATA`A049 Triple Triad Global=Elastoid
  147. &TT`DATA`A049`STAT Triple Triad Global=6 7 2 6 None 5
  148. &TT`DATA`A050 Triple Triad Global=G1M47N
  149. &TT`DATA`A050`STAT Triple Triad Global=5 4 5 7 None 5
  150. &TT`DATA`A051 Triple Triad Global=Malboro
  151. &TT`DATA`A051`STAT Triple Triad Global=7 2 7 4 Poison 5
  152. &TT`DATA`A052 Triple Triad Global=Ruby Dragon
  153. &TT`DATA`A052`STAT Triple Triad Global=7 4 2 7 Fire 5
  154. &TT`DATA`A053 Triple Triad Global=Elnoyle
  155. &TT`DATA`A053`STAT Triple Triad Global=5 6 3 7 None 5
  156. &TT`DATA`A054 Triple Triad Global=Tonberry King
  157. &TT`DATA`A054`STAT Triple Triad Global=4 4 6 7 None 5
  158. &TT`DATA`A055 Triple Triad Global=Evil Eye
  159. &TT`DATA`A055`STAT Triple Triad Global=6 7 6 2 None 5
  160. &TT`DATA`A056 Triple Triad Global=Gizamaluke
  161. &TT`DATA`A056`STAT Triple Triad Global=2 4 8 8 None 6
  162. &TT`DATA`A057 Triple Triad Global=Elvoret
  163. &TT`DATA`A057`STAT Triple Triad Global=7 4 8 3 Wind 6
  164. &TT`DATA`A058 Triple Triad Global=X-ATM092
  165. &TT`DATA`A058`STAT Triple Triad Global=4 3 8 7 None 6
  166. &TT`DATA`A059 Triple Triad Global=Granaldo
  167. &TT`DATA`A059`STAT Triple Triad Global=7 5 2 8 None 6
  168. &TT`DATA`A060 Triple Triad Global=Princess Pudding
  169. &TT`DATA`A060`STAT Triple Triad Global=1 3 8 8 Holy 6
  170. &TT`DATA`A061 Triple Triad Global=Iguion
  171. &TT`DATA`A061`STAT Triple Triad Global=8 2 2 8 None 6
  172. &TT`DATA`A062 Triple Triad Global=Abadon
  173. &TT`DATA`A062`STAT Triple Triad Global=6 5 8 4 None 6
  174. &TT`DATA`A063 Triple Triad Global=Trauma
  175. &TT`DATA`A063`STAT Triple Triad Global=4 6 8 5 None 6
  176. &TT`DATA`A064 Triple Triad Global=Tunnel Armor
  177. &TT`DATA`A064`STAT Triple Triad Global=1 8 8 4 None 6
  178. &TT`DATA`A065 Triple Triad Global=Enkidu
  179. &TT`DATA`A065`STAT Triple Triad Global=6 4 5 8 None 6
  180. &TT`DATA`A066 Triple Triad Global=Calcobrena
  181. &TT`DATA`A066`STAT Triple Triad Global=7 1 5 8 None 6
  182. &TT`DATA`A067 Triple Triad Global=Propagator
  183. &TT`DATA`A067`STAT Triple Triad Global=8 8 4 4 NonE 7
  184. &TT`DATA`A068 Triple Triad Global=Jumbo Cactuar
  185. &TT`DATA`A068`STAT Triple Triad Global=8 4 8 4 None 7
  186. &TT`DATA`A069 Triple Triad Global=Antlion
  187. &TT`DATA`A069`STAT Triple Triad Global=8 8 5 2 Earth 7
  188. &TT`DATA`A070 Triple Triad Global=Lich
  189. &TT`DATA`A070`STAT Triple Triad Global=5 8 6 6 Poison 7
  190. &TT`DATA`A071 Triple Triad Global=Maliris
  191. &TT`DATA`A071`STAT Triple Triad Global=8 3 6 7 Fire 7
  192. &TT`DATA`A072 Triple Triad Global=Kraken
  193. &TT`DATA`A072`STAT Triple Triad Global=8 8 3 5 Water 7
  194. &TT`DATA`A073 Triple Triad Global=Tiamat
  195. &TT`DATA`A073`STAT Triple Triad Global=8 4 8 8 Wind 7
  196. &TT`DATA`A074 Triple Triad Global=Dark Elf
  197. &TT`DATA`A074`STAT Triple Triad Global=5 5 7 8 None 7
  198. &TT`DATA`A075 Triple Triad Global=Red Giant
  199. &TT`DATA`A075`STAT Triple Triad Global=6 7 8 4 None 7
  200. &TT`DATA`A076 Triple Triad Global=Catoblepas
  201. &TT`DATA`A076`STAT Triple Triad Global=1 7 8 7 None 7
  202. &TT`DATA`A077 Triple Triad Global=Demon Wall
  203. &TT`DATA`A077`STAT Triple Triad Global=7 8 7 2 None 7
  204. &TT`DATA`A078 Triple Triad Global=Asura
  205. &TT`DATA`A078`STAT Triple Triad Global=7 8 7 2 None 8
  206. &TT`DATA`A079 Triple Triad Global=Garuda
  207. &TT`DATA`A079`STAT Triple Triad Global=7 8 7 2 Wind 8
  208. &TT`DATA`A080 Triple Triad Global=Ixion
  209. &TT`DATA`A080`STAT Triple Triad Global=7 8 7 2 Lightning 8
  210. &TT`DATA`A081 Triple Triad Global=Minimog
  211. &TT`DATA`A081`STAT Triple Triad Global=7 8 7 2 None 8
  212. &TT`DATA`A082 Triple Triad Global=Chicobo
  213. &TT`DATA`A082`STAT Triple Triad Global=9 4 4 8 None 8
  214. &TT`DATA`A083 Triple Triad Global=Quezacolt
  215. &TT`DATA`A083`STAT Triple Triad Global=2 4 9 9 Lightning 8
  216. &TT`DATA`A084 Triple Triad Global=Shiva
  217. &TT`DATA`A084`STAT Triple Triad Global=6 9 7 4 Ice 8
  218. &TT`DATA`A085 Triple Triad Global=Ifrit
  219. &TT`DATA`A085`STAT Triple Triad Global=9 8 6 2 Fire 8
  220. &TT`DATA`A086 Triple Triad Global=Siren
  221. &TT`DATA`A086`STAT Triple Triad Global=8 2 9 6 None 8
  222. &TT`DATA`A087 Triple Triad Global=Sacred
  223. &TT`DATA`A087`STAT Triple Triad Global=5 9 1 9 Earth 8
  224. &TT`DATA`A088 Triple Triad Global=Minotaur
  225. &TT`DATA`A088`STAT Triple Triad Global=9 9 5 2 Earth 8
  226. &TT`DATA`A089 Triple Triad Global=Carbuncle
  227. &TT`DATA`A089`STAT Triple Triad Global=8 4 4 10 None 9
  228. &TT`DATA`A090 Triple Triad Global=Diabolos
  229. &TT`DATA`A090`STAT Triple Triad Global=5 3 10 8 None 9
  230. &TT`DATA`A091 Triple Triad Global=Leviathan
  231. &TT`DATA`A091`STAT Triple Triad Global=8 7 10 1 Water 9
  232. &TT`DATA`A092 Triple Triad Global=Odin
  233. &TT`DATA`A092`STAT Triple Triad Global=8 5 10 3 None 9
  234. &TT`DATA`A093 Triple Triad Global=Pandemona
  235. &TT`DATA`A093`STAT Triple Triad Global=10 7 1 7 Wind 9
  236. &TT`DATA`A094 Triple Triad Global=Cerberus
  237. &TT`DATA`A094`STAT Triple Triad Global=7 10 4 6 None 9
  238. &TT`DATA`A095 Triple Triad Global=Alexander
  239. &TT`DATA`A095`STAT Triple Triad Global=9 2 10 4 Holy 9
  240. &TT`DATA`A096 Triple Triad Global=Phoenix
  241. &TT`DATA`A096`STAT Triple Triad Global=7 10 2 7 Fire 9
  242. &TT`DATA`A097 Triple Triad Global=Bahamut
  243. &TT`DATA`A097`STAT Triple Triad Global=10 6 8 2 None 9
  244. &TT`DATA`A098 Triple Triad Global=Doomtrain
  245. &TT`DATA`A098`STAT Triple Triad Global=3 10 1 10 Poison 9
  246. &TT`DATA`A099 Triple Triad Global=Eden
  247. &TT`DATA`A099`STAT Triple Triad Global=4 10 3 9 None 9
  248. &TT`DATA`A100 Triple Triad Global=JENOVA
  249. &TT`DATA`A100`STAT Triple Triad Global=10 8 7 2 None 10
  250. &TT`DATA`A101 Triple Triad Global=Zeromus
  251. &TT`DATA`A101`STAT Triple Triad Global=6 10 7 6 None 10
  252. &TT`DATA`A102 Triple Triad Global=Sin
  253. &TT`DATA`A102`STAT Triple Triad Global=5 9 10 3 None 10
  254. &TT`DATA`A103 Triple Triad Global=Ozma
  255. &TT`DATA`A103`STAT Triple Triad Global=10 4 8 6 None 10
  256. &TT`DATA`A104 Triple Triad Global=Goddess
  257. &TT`DATA`A104`STAT Triple Triad Global=9 2 6 10 None 10
  258. &TT`DATA`A105 Triple Triad Global=Demon
  259. &TT`DATA`A105`STAT Triple Triad Global=2 10 6 9 None 10
  260. &TT`DATA`A106 Triple Triad Global=Fiend
  261. &TT`DATA`A106`STAT Triple Triad Global=8 6 5 10 None 10
  262. &TT`DATA`A107 Triple Triad Global=Omega Weapon
  263. &TT`DATA`A107`STAT Triple Triad Global=4 10 10 2 None 10
  264. &TT`DATA`A108 Triple Triad Global=Ultima Weapon
  265. &TT`DATA`A108`STAT Triple Triad Global=10 3 10 5 None 10
  266. &TT`DATA`A109 Triple Triad Global=Giant of Babil
  267. &TT`DATA`A109`STAT Triple Triad Global=6 4 9 10 None 10
  268. &TT`DATA`A110 Triple Triad Global=Chaos
  269. &TT`DATA`A110`STAT Triple Triad Global=10 9 4 6 None 10
  270. &TT`DATA`COST Triple Triad Global=
  271. &TT`DATA`COST`A Triple Triad Global=
  272. &TT`DATA`COST`A`RAND Triple Triad Global=5
  273. &TT`DATA`COST`A`SING Triple Triad Global=10
  274. &TT`DATA`COST`X Triple Triad Global=
  275. &TT`DATA`COST`X`RAND Triple Triad Global=0
  276. &TT`DATA`COST`X`SING Triple Triad Global=20
  277. &TT`DATA`F031 Triple Triad Global=Cactuar
  278. &TT`DATA`F055 Triple Triad Global=Ahriman
  279. &TT`DATA`F056 Triple Triad Global=
  280. &TT`DATA`F056`STAT Triple Triad Global=2 4 8 8 Water 6
  281. &TT`DATA`F066 Triple Triad Global=Calcabrina
  282. &TT`DATA`F067 Triple Triad Global=
  283. &TT`DATA`F067`STAT Triple Triad Global=8 8 4 4 None 7
  284. &TT`DATA`F075 Triple Triad Global=Red Giant
  285. &TT`DATA`F076 Triple Triad Global=Catoblepas
  286. &TT`DATA`F076`STAT Triple Triad Global=1 7 8 7 None 7
  287. &TT`DATA`F077 Triple Triad Global=Demon Wall
  288. &TT`DATA`F077`STAT Triple Triad Global=7 8 7 2 None 7
  289. &TT`DATA`F078 Triple Triad Global=Asura
  290. &TT`DATA`F078`STAT Triple Triad Global=4 9 4 8 None 8
  291. &TT`DATA`F079 Triple Triad Global=Garuda
  292. &TT`DATA`F079`STAT Triple Triad Global=9 3 6 7 Wind 8
  293. &TT`DATA`F080 Triple Triad Global=Ixion
  294. &TT`DATA`F080`STAT Triple Triad Global=3 6 7 9 Lightning 8
  295. &TT`DATA`F081 Triple Triad Global=Minimog
  296. &TT`DATA`F081`STAT Triple Triad Global=9 2 7 9 None 8
  297. &TT`DATA`F082 Triple Triad Global=Chicobo
  298. &TT`DATA`F082`STAT Triple Triad Global=9 4 4 8 None 8
  299. &TT`DATA`F083 Triple Triad Global=
  300. &TT`DATA`F083`STAT Triple Triad Global=2 4 9 9 Lightning 8
  301. &TT`DATA`F108 Triple Triad Global=
  302. &TT`DATA`F108`STAT Triple Triad Global=10 3 10 3 None 10
  303. &TT`DATA`MAX Triple Triad Global=
  304. &TT`DATA`MAX`A Triple Triad Global=9 9 7 7 5 5 2 2 1 1
  305. &TT`DATA`MAX`X Triple Triad Global=1 1 1 1 1 1 1 1 1 1
  306. &TT`DATA`SET Triple Triad Global=
  307. &TT`DATA`SET`A Triple Triad Global=Final Fantasy
  308. &TT`DATA`SET`X Triple Triad Global=Custom Cards
  309. &TT`DATA`SETS Triple Triad Global=A X
  310. &TT`DATA`X001 Triple Triad Global=Ultros
  311. @set Triple Triad Global/TT`DATA`X001=no_command
  312. &TT`DATA`X001`STAT Triple Triad Global=6 5 4 1 Water 3
  313. @set Triple Triad Global/TT`DATA`X001`STAT=no_command
  314. &TT`DATA`X002 Triple Triad Global=Windstorm
  315. @set Triple Triad Global/TT`DATA`X002=no_command
  316. &TT`DATA`X002`STAT Triple Triad Global=7 6 3 4 Wind 5
  317. @set Triple Triad Global/TT`DATA`X002`STAT=no_command
  318. &TT`DECK Triple Triad Global=
  319. &TT`DECK`DRAW Triple Triad Global=
  320. &TT`DECK`DRAW`BLANK Triple Triad Global=None%r%r[switch(%1,0,+,%1)][repeat(-,5)]+%r|%b%b%b%b%b|%r|%b%b%b%b%b|%r|%b%b%b%b%b|%r+[repeat(-,5)]+%r
  321. &TT`DECK`DRAW`CARD Triple Triad Global=[setq(Card,u(v(TT`GLOBAL)/TT`DATA`%0`STAT))][setq(CStats,extract(%q<Card>,1,4,%b),CElem,extract(%q<Card>,5,1,%b),Name,u(v(TT`GLOBAL)/TT`DATA`%0))][setq(Up,bound(extract(%q<CStats>,1,1,%b),1,10),Left,bound(extract(%q<CStats>,2,1,%b),1,10),Right,bound(extract(%q<CStats>,3,1,%b),1,10),Down,bound(extract(%q<CStats>,4,1,%b),1,10))][setq(Up,switch(%q<Up>,10,A,%q<Up>),Left,switch(%q<Left>,10,A,%q<Left>),Right,switch(%q<Right>,10,A,%q<Right>),Down,switch(%q<Down>,10,A,%q<Down>))][ansi(cD,left(%q<Name>,15))]%r[ansi(cD,Card %0)]%r[ansi(hrD,Level [extract(u(v(TT`GLOBAL)/TT`DATA`%0`STAT),6,1)])]%r[ansi(switch(%1,R,xR,B,wB),[switch(%3,0,+,%3)][repeat(-,5)]+%r|[switch(extract(%q<Card>,5,1,%b),Fire,ansi(yR,F),Lightning,ansi(xC,L),Ice,ansi(xC,I),Earth,ansi(xG,E),Wind,ansi(xG,W),Holy,ansi(xW,H),Poison,ansi(xM,P),Water,ansi(wB,W),%b)]%b%q<Up>%b%b|%r|%b%q<Left>%b%q<Right>%b|%r|%b%b%q<Down>%b%b|%r+[repeat(-,3)][switch(%2,None,--,%q<CElem>,ansi(switch(%1,R,w,B,hr),+1),ansi(switch(%1,R,w,B,hr),-1))]+%r)]
  322. &TT`DECK`MAX Triple Triad Global=20
  323. &TT`FNC Triple Triad Global=
  324. &TT`FNC`ADDSTATS Triple Triad Global=th [setq(Blue,u(me/TT`GAME`%0`BLUE),Red,u(me/TT`GAME`%0`RED),Rules,u(me/TT`GAME`%0`RULES))][setq(BStats,u(%q<Blue>/TT`STATS),RStats,u(%q<Red>/TT`STATS))] ; &TT`STATS %q<Blue>=[u(me/TT`FNC`ADDSTATS2,%q<BStats>,%q<Rules>,1)] ; &TT`STATS %q<Red>=[u(me/TT`FNC`ADDSTATS2,%q<RStats>,%q<Rules>,0)]
  325. &TT`FNC`ADDSTATS2 Triple Triad Global=[inc(extract(%0,1,1))] [add(%2,extract(%0,2,1))] [extract(%0,3,9)] [bound(add(5,extract(%0,12,1)),0,10000)] [switch(match(%1,Open),>0,inc(extract(%0,13,1)),extract(%0,13,1))] [switch(match(%1,Same),>0,inc(extract(%0,14,1)),extract(%0,14,1))] [switch(match(%1,Wall),>0,inc(extract(%0,15,1)),extract(%0,15,1))] [switch(match(%1,Plus),>0,inc(extract(%0,16,1)),extract(%0,16,1))] [switch(match(%1,Combo),>0,inc(extract(%0,17,1)),extract(%0,17,1))] [switch(match(%1,Elemental),>0,inc(extract(%0,18,1)),extract(%0,18,1))] [switch(match(%1,None),>0,inc(extract(%0,19,1)),extract(%0,19,1))] [switch(match(%1,One),>0,inc(extract(%0,20,1)),extract(%0,20,1))] [switch(match(%1,Diff),>0,inc(extract(%0,21,1)),extract(%0,21,1))] [switch(match(%1,All),>0,inc(extract(%0,22,1)),extract(%0,22,1))] [switch(match(%1,Limitless),>0,inc(extract(%0,23,1)),extract(%0,23,1))]
  326. &TT`FNC`BLUEWIN Triple Triad Global=th [setq(Blue,u(me/TT`GAME`%0`BLUE),Red,u(me/TT`GAME`%0`RED))][setq(Rules,u(me/TT`GAME`%0`RULES))][setq(Stats,u(%q<Blue>/TT`STATS))][setq(Stats,replace(%q<Stats>,3,inc(extract(%q<Stats>,3,1))))][setq(Stats,replace(%q<Stats>,12,bound(add(5,extract(%q<Stats>,12,1)),0,10000)))] ; &TT`STATS %q<Blue>=%q<Stats> ; &TT`STATS %q<Red>=[setq(Stats,u(%q<Red>/TT`STATS))][replace(%q<Stats>,4,inc(extract(%q<Stats>,4,1)))] ; @switch/inline and(not(match(%q<Rules>,Private)),not(match(%q<Rules>,Broadcast)),words(u(TT`GAME`%q<ID>`SPECTATE)))=1,@dolist/inline u(TT`GAME`%q<ID>`SPECTATE)=@pemit %i0=[ansi(gD,Triple Triad)] - [name(%q<Blue>)] has won the game! ; @switch/inline and(not(match(%q<Rules>,Private)),match(%q<Rules>,Broadcast))=1,@oemit loc(%q<Blue>)/%q<Blue> %q<Red>=[ansi(gD,Triple Triad)] - [name(%q<Blue>)] has won the game! ; @switch/inline %q<Rules>=*None*,{ @pemit %q<Blue>=[ansi(gD,Triple Triad)] - You have won the game! ; @pemit %q<Red>=[ansi(rD,Triple Triad)] - You have lost the game. ; @wipe me/TT`GAME`%q<ID> ; @wipe me/TT`GAME`%q<Blue> ; @wipe me/TT`GAME`%q<Red> },*All*,{ @include me/TT`FNC`TAKECARD=%0,%q<Blue>,%q<Red>,[u(me/TT`GAME`%q<Red>`INIT)] },{ &TT`GAME`%0`MODE me=2 ; th [setq(NbCard,switch(u(TT`GAME`%q<ID>`RULES),*One*,1,*Diff*,[abs(div(sub(%q<NBlue>,%q<NRed>),2))]))] ; &TT`GAME`%0`WINNER me=%q<Blue> %q<Red> %q<NBCards> [u(me/TT`GAME`%q<Red>`INIT)] ; @pemit %q<Blue>=[ansi(gD,Triple Triad)] - You have won the game, you can choose %q<NbCard> cards from your opponent : %r%r%b[iter(u(me/TT`GAME`%q<Red>`INIT),[setq(Num,extract(u(%q<Blue>/TT`CARDS`[left(%i0,1)]),Right(%i0,3),1))][ansi(cD,%i0)][space(6)][u(TT`DATA`%i0)][space(sub(25,strlen(u(TT`DATA`%i0))))]You own %q<Num> of this card.%r)] %r%rUse the command [ansi(gD,+TT/Choose Card[repeat(\,Card,dec(%q<NbCard>))])] to pick your cards. You can replace any card by [ansi(gD,None)] if you decide to take less than the amount you have earned, or if there are no cards you can take from your opponent. ; @pemit %q<Red>=[ansi(rD,Triple Triad)] - You have lost the game. Your opponent is currently choosing their winning cards.} ; @switch/inline gt(words(u(TT`GAME`%q<ID>`SPECTATE)),0)=1,@dolist/inline u(TT`GAME`%q<ID>`SPECTATE)=@Wipe me/TT`GAME`%q<ID>`SPECTATE
  327. &TT`FNC`CARD Triple Triad Global=
  328. &TT`FNC`CARD`DETAIL Triple Triad Global=[setq(Set,left(%q<Card>,1),Nb,right(%q<Card>,3),Data,u(v(TT`GLOBAL)/TT`DATA`%q<Card>`STAT))][setq(Name,u(v(TT`GLOBAL)/TT`DATA`%q<Card>),Qty,extract(u(%#/TT`CARDS`%q<set>),%q<Nb>,1))][setq(Lv,extract(%q<Data>,6,1),Up,extract(%q<Data>,1,1),Left,extract(%q<Data>,2,1),Right,extract(%q<Data>,3,1),Down,extract(%q<Data>,4,1),Elem,extract(%q<Data>,5,1))][setq(Up,switch(%q<Up>,10,A,%q<Up>),Down,switch(%q<Down>,10,A,%q<Down>),Left,switch(%q<Left>,10,A,%q<Left>),Right,switch(%q<Right>,10,A,%q<Right>))][ansi(wB,+-----+)] [ansi(cD,Card : %q<Card>)]%r%b[ansi(wB,|[switch(%q<Elem>,Fire,ansi(yR,F),Lightning,ansi(xC,L),Ice,ansi(xC,I),Earth,ansi(xG,E),Wind,ansi(xG,W),Holy,ansi(xW,H),Poison,ansi(xM,P),Water,ansi(wB,W),%b)]%b%q<Up>%b%b|)] %q<Name>%r%b[ansi(wB,|%b%q<Left>%b%q<Right>%b|)] [ansi(gD,Level :)] %q<Lv>%r%b[ansi(wB,|%b%b%q<Down>%b%b|)] [ansi(gD,Owned :)] %q<Qty>%r%b[ansi(wB,+-----+)]
  329. &TT`FNC`CHECKCARDS Triple Triad Global=@dolist/inline u(TT`DATA`SETS)={ th [setq(Check1,nattr(me/TT`DATA`%i0*),Check2,words(u(%0/TT`CARDS`%i0)))] ; @switch/inline gt(%q<Check1>,%q<Check2>)=&TT`CARDS`%i0 %0=[u(%0/TT`CARDS`%i0)][repeat(%b0,sub(%q<Check1>,%q<Check2>))] }
  330. &TT`FNC`CHECKSTASH Triple Triad Global=th [setq(TCards,0,RCards,0)][trim(iter(u(TT`DATA`SETS),iter(u(%0/TT`CARDS`%i0),[setq(TCards,add(%q<TCards>,%i0))][switch(%i1,X,[setq(RCards,add(%q<RCards>,%i0))])])))] ; &TT`STATS %0=[setq(Stats,u(%0/TT`STATS))][replace(%q<Stats>,7,%q<TCards>)] ; &TT`STATS %0=[setq(Stats,u(%0/TT`STATS))][replace(%q<Stats>,8,%q<RCards>)]
  331. &TT`FNC`DECK Triple Triad Global=
  332. &TT`FNC`DECK`DETAIL Triple Triad Global=th [setq(S,mul(dec(%0),15))][trim(iter(u(TT`DATA`SETS),[switch(words(u(%#/TT`CARDS`%i0)),>0,[iter(lnum(1,words(u(%#/TT`CARDS`%i0))),[setq(Card,extract(u(%#/TT`CARDS`%i1),%i0,1))][setq(CardList,switch(%q<Card>,0,%q<CardList>,insert(%q<CardList>,-1,%i1[repeat(0,sub(3,strlen(%i0)))]%i0)))])])]))][setq(NCard,words(%q<CardList>))] ; @assert gte(%q<NCard>,inc(%qS)) ; @pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad - Your Cards Page %0)],|)]%r+[repeat(-,78)]+%r[u(TT`FNC`SHOW`DETAIL)]%r[switch(%q<NCard>,>[add(15,%qS)],[align(1 -76 1,|,Continued in [ansi(gD,+TT/Detail [inc(%0)])],|)]%r+[repeat(-,78)]+%r)]
  333. &TT`FNC`DECK`STASH Triple Triad Global=th [setq(S,mul(dec(%0),40))][trim(iter(u(TT`DATA`SETS),[switch(words(u(%#/TT`CARDS`%i0)),>0,[iter(lnum(1,words(u(%#/TT`CARDS`%i0))),[setq(Card,extract(u(%#/TT`CARDS`%i1),%i0,1))][setq(CardList,switch(%q<Card>,0,%q<CardList>,insert(%q<CardList>,-1,%i1[repeat(0,sub(3,strlen(%i0)))]%i0)))])])]))][setq(NCard,words(%q<CardList>))] ; @assert gt(%q<NCard>,inc(%qS)) ; @pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad - Your Cards Page %0)],|)]%r+[repeat(-,78)]+%r[align(1. 36 1. 37 1.,|,%r%b[iter(lnum(add(%qS,1),switch(%q<NCard>,<[add(%qS,21)],%q<NCard>,[add(%qS,20)])),[setq(Card,extract(%q<CardList>,%i0,1))][setq(Set,left(%q<Card>,1),Nb,right(%q<Card>,3),Data,u(TT`DATA`%q<Card>`STAT))][setq(Name,u(TT`DATA`%q<Card>),Qty,extract(u(%#/TT`CARDS`%q<set>),%q<Nb>,1))][ansi(cD,%q<Card>)] %q<Name>[space(sub(27,strlen(%q<Name>)))]x%q<Qty>%r)][repeat(%r,sub([add(%qS,21)],switch(%q<NCard>,<[add(%qS,21)],%q<NCard>,[add(%qS,20)])))],|,%r[switch(%q<NCard>,<[add(%qS,21)],%b[repeat(%r,18)],%b[iter(lnum([add(%qS,21)],switch(%q<NCard>,<[add(%qS,41)],%q<NCard>,[add(%qS,40)])),[setq(Card,extract(%q<CardList>,%i0,1))][setq(Set,left(%q<Card>,1),Nb,right(%q<Card>,3),Data,u(TT`DATA`%q<Card>`STAT))][setq(Name,u(TT`DATA`%q<Card>),Qty,extract(u(%#/TT`CARDS`%q<Set>),%q<Nb>,1))][ansi(cD,%q<Card>)] %q<Name>[space(sub(27,strlen(%q<Name>)))]x%q<Qty>%r)][repeat(%r,sub([add(%qS,41)],switch(%q<NCard>,<[add(%qS,41)],%q<NCard>,[add(%qS,40)])))])],|)]%r+[repeat(-,78)]+%r[switch(%q<NCard>,>[add(%qS,40)],[align(1 -76 1,|,Continued in [ansi(gD,+TT/Stash [inc(%0)])],|)]%r+[repeat(-,78)]+%r)]
  334. &TT`FNC`FINDNUM Triple Triad Global=[add(mul(dec(div(%0,5)),3),mod(dec(%0),5))]
  335. &TT`FNC`FINDPOS Triple Triad Global=[add(mul(inc(%0),5),inc(%1))]
  336. &TT`FNC`FINISH Triple Triad Global=th [setq(Blue,u(me/TT`GAME`%0`BLUE),Red,u(me/TT`GAME`%0`RED))] ; @switch/inline %q<NBlue>=%q<NRed>,{ @include me/TT`FNC`TIEGAME=%0 },>%q<NRed>,{ @include/clearregs me/TT`FNC`BLUEWIN=%0 },{ @include/clearregs me/TT`FNC`REDWIN=%0 }
  337. &TT`FNC`GAMEDECK Triple Triad Global=th [setq(Deck,u(%0/TT`DECK`%1),Found,0,TLV,0)] ; @break match(%q<Deck>,0000)=@pemit %0=[ansi(rD,Triple Triad)] - Your deck does not have 5 cards. ; th [setq(Stop,0)][iter(lnum(1,5),[setq(C1,extract(%q<Deck>,%i0,1))][setq(LV,extract(u(TT`DATA`%q<C1>`STAT),6,1),Nb,right(%q<C1>,3),Set,Left(%q<C1>,1))][setq(Num,extract(u(%0/TT`CARDS`%q<Set>),%q<Nb>,1),TLV,add(%q<TLV>,%q<LV>),Found,words(matchall(%q<Deck>,%q<C1>)))][switch(gt(%q<Found>,%q<Num>),1,[setq(Stop,%i0)])])] ; @break %q<Stop>=@pemit %0=[ansi(rD,Triple Triad)] - Your deck is not complete. You don't have enough [u(me/TT`DATA`[extract(%q<Deck>,%q<Stop>,1)])] cards left for your deck. ; @break and(gt(%q<TLV>,u(me/TT`DECK`MAX)),not(match(%2,Limitless)))=@pemit %0=[ansi(rD,Triple Triad)] - Your deck's level is too high, and the game is Limited to [u(me/TT`DECK`MAX)] levels.
  338. &TT`FNC`NEWID Triple Triad Global=th [setq(ID,rand(10,99))] ; @retry nattr(me/TT`GAME`%q<ID>`PLAYERS)
  339. &TT`FNC`POS Triple Triad Global=
  340. &TT`FNC`POS`COMP Triple Triad Global=[switch(%0,>%1,UD,<%1,DU,switch(%2,<%3,RL,>%3,LR))]
  341. &TT`FNC`RANDCARD Triple Triad Global=th [setq(Nb,rand(1,nattr(v(TT`GLOBAL)/TT`DATA`%1*)))][setq(ID,%1[repeat(0,sub(3,strlen(%q<Nb>)))]%q<Nb>)][setq(Name,u(v(TT`GLOBAL)/TT`DATA`%q<ID>),LV,extract(u(v(TT`GLOBAL)/TT`DATA`%q<ID>`STAT),6,1))][setq(Max,extract(u(v(TT`GLOBAL)/TT`DATA`MAX`%1),%q<LV>,1),Num,extract(u(%0/TT`CARDS`%1),%q<Nb>,1))] ; @retry not(match(%q<LV>,%2)) ; @switch/inline  gt(inc(%q<Num>),%q<Max>)=1,{ @switch/inline  %3=1,@retry 1,0,{ @pemit %0=[ansi(rD,Triple Triad)] - You got the [ansi(gD,%q<name>)] card but you already had the maximum amount you can hold. You were given back your points. ; @break 1 } } ; &TT`CARDS`%1 %0=[replace(u(%0/TT`CARDS`%1),%q<Nb>,bound(inc(%q<Num>),1,%q<Max>),%b)]
  342. &TT`FNC`RANDELEM Triple Triad Global=[setq(ListE,Fire Water Ice Lightning Earth Wind Poison Holy)]None [switch(rand(1,100),<91,None,randword(%q<ListE>))] [switch(rand(1,100),<91,None,randword(%q<ListE>))] [switch(rand(1,100),<91,None,randword(%q<ListE>))] None None [switch(rand(1,100),<91,None,randword(%q<ListE>))] [switch(rand(1,100),<91,None,randword(%q<ListE>))] [switch(rand(1,100),<91,None,randword(%q<ListE>))] None None [switch(rand(1,100),<91,None,randword(%q<ListE>))] [switch(rand(1,100),<91,None,randword(%q<ListE>))] [switch(rand(1,100),<91,None,randword(%q<ListE>))] None
  343. &TT`FNC`REDWIN Triple Triad Global=th [setq(Blue,u(me/TT`GAME`%0`BLUE),Red,u(me/TT`GAME`%0`RED))][setq(Rules,u(me/TT`GAME`%0`RULES))][setq(Stats,u(%q<Red>/TT`STATS))][setq(Stats,replace(%q<Stats>,3,inc(extract(%q<Stats>,3,1))))][setq(Stats,replace(%q<Stats>,12,bound(add(5,extract(%q<Stats>,12,1)),0,10000)))] ; &TT`STATS %q<Red>=[setq(Stats,u(%q<Red>/TT`STATS))][replace(%q<Stats>,3,inc(extract(%q<Stats>,3,1)))] ; &TT`STATS %q<Red>=[setq(Stats,u(%q<Red>/TT`STATS))][replace(%q<Stats>,12,add(5,extract(%q<Stats>,12,1)))] ; &TT`STATS %q<Blue>=[setq(Stats,u(%q<Blue>/TT`STATS))][replace(%q<Stats>,4,inc(extract(%q<Stats>,4,1)))] ; @switch/inline and(not(match(%q<Rules>,Private)),not(match(%q<Rules>,Broadcast)),words(u(TT`GAME`%q<ID>`SPECTATE)))=1,@dolist/inline u(TT`GAME`%q<ID>`SPECTATE)=@pemit %i0=[ansi(gD,Triple Triad)] - [name(%q<Red>)] has won the game! ; @switch/inline and(not(match(%q<Rules>,Private)),match(%q<Rules>,Broadcast))=1,@oemit loc(%q<Blue>)/%q<Blue> %q<Red>=[ansi(gD,Triple Triad)] - [name(%q<Red>)] has won the game! ; @switch/inline %q<Rules>=*None*,{ @pemit %q<Red>=[ansi(gD,Triple Triad)] - You have won the game! ; @pemit %q<Blue>=[ansi(rD,Triple Triad)] - You have lost the game. ; @wipe me/TT`GAME`%q<ID> ; @wipe me/TT`GAME`%q<Blue> ; @wipe me/TT`GAME`%q<Red> },*All*,{ @include me/TT`FNC`TAKECARD=%0,%q<Red>,%q<Blue>,[u(me/TT`GAME`%q<Red>`INIT)] },{ &TT`GAME`%0`MODE me=2 ; th [setq(NbCard,switch(u(TT`GAME`%q<ID>`RULES),*One*,1,*Diff*,[abs(div(sub(%q<NBlue>,%q<NRed>),2))]))] ; &TT`GAME`%0`WINNER me=%q<Red> %q<Blue> [abs(div(sub(%q<NBlue>,%q<NRed>),2))] [u(me/TT`GAME`%q<Blue>`INIT)] ; @pemit %q<Red>=[ansi(gD,Triple Triad)] - You have won the game, you can choose %q<NbCard> cards from your opponent : %r%r%b[iter(u(me/TT`GAME`%q<Blue>`INIT),[setq(Num,extract(u(%q<Red>/TT`CARDS`[Left(%i0,1)]),right(%i0,3),1))][ansi(cD,%i0)][space(6)][u(TT`DATA`%i0)][space(sub(25,strlen(u(TT`DATA`%i0))))]You own %q<Num> of this card.%r)]%r%rUse the command [ansi(gD,+TT/Choose Card[repeat(\,Card,dec(%q<NbCard>))])] to pick your cards. You can replace any card by [ansi(gD,None)] if you decide to take less than the amount you have earned, or if there are no cards you can take from your opponent. ; @pemit %q<Blue>=[ansi(rD,Triple Triad)] - You have lost the game. Your opponent is currently choosing their winning cards.} ; @switch/inline gt(words(u(TT`GAME`%q<ID>`SPECTATE)),0)=1,@dolist/inline u(TT`GAME`%q<ID>`SPECTATE)=@Wipe me/TT`GAME`%q<ID>`SPECTATE
  344. &TT`FNC`RNDSTATS Triple Triad Global=th [setq(Min,extract(10 12 14 16 18 20 22 24 24 26,%0,1),Max,extract(13 15 17 19 21 23 25 26 27 29,%0,1))][setq(R1,Rand(1,10),R2,Rand(1,10),R3,Rand(1,10),R4,Rand(1,10))] ; @retry or(lt(add(%q<R1>,%q<R2>,%q<R3>,%q<R4>),%q<Min>),gt(add(%q<R1>,%q<R2>,%q<R3>,%q<R4>),%q<Max>)) ; th [setq(Result,%q<R1> %q<R2> %q<R3> %q<R4>)]
  345. &TT`FNC`SCORE Triple Triad Global=th [setq(NBlue,0,NRed,0)][setq(Color,u(TT`GAME`%0`GRIDC),HandP1,u(TT`GAME`%1`HAND),HandP2,u(TT`GAME`%2`HAND))]  [iter(%q<HandP1>,if(not(match(%i0,0000)),setq(NBlue,inc(%q<NBlue>))))] [iter(%q<HandP2>,if(not(match(%i0,0000)),setq(NRed,inc(%q<NRed>))))] [iter(%q<Color>,if(match(%i0,B),setq(NBlue,inc(%q<NBlue>))))][iter(%q<Color>,if(match(%i0,R),setq(NRed,inc(%q<NRed>))))]
  346. &TT`FNC`SHOW Triple Triad Global=
  347. &TT`FNC`SHOW`DETAIL Triple Triad Global=[align(1. 25 24 25 1.,|,%r%b[iter(lnum(add(%qS,1),switch(%q<NCard>,<[add(%qS,6)],%q<NCard>,[add(%qS,5)])),[setq(Card,extract(%q<CardList>,%i0,1))][u(v(TT`GLOBAL)/TT`FNC`CARD`DETAIL)]%r)][repeat(%r,sub([add(%qS,6)],switch(%q<NCard>,<[add(%qS,6)],%q<NCard>,[add(%qS,5)])))],%r[switch(%q<NCard>,<[add(%qS,6)],%b[repeat(%r,18)],%b[iter(lnum([add(%qS,6)],switch(%q<NCard>,<[add(%qS,11)],%q<NCard>,[add(%qS,10)])),[setq(Card,extract(%q<CardList>,%i0,1))][u(v(TT`GLOBAL)/TT`FNC`CARD`DETAIL)]%r)][repeat(%r,sub([add(%qS,11)],switch(%q<NCard>,<[add(%qS,11)],%q<NCard>,[add(%qS,10)])))])],%r[switch(%q<NCard>,<[add(%qS,11)],%b[repeat(%r,18)],%b[iter(lnum([add(%qS,11)],switch(%q<NCard>,<[add(%qS,16)],%q<NCard>,[add(%qS,15)])),[setq(Card,extract(%q<CardList>,%i0,1))][u(v(TT`GLOBAL)/TT`FNC`CARD`DETAIL)]%r)][repeat(%r,sub([add(%qS,16)],switch(%q<NCard>,<[add(%qS,16)],%q<NCard>,[add(%qS,15)])))])],|)]%r+[repeat(-,78)]+
  348. &TT`FNC`SHOW`GRID Triple Triad Global=th [setq(ID,u(me/TT`GAME`%0`GAME))][setq(Rules,u(me/TT`GAME`%q<ID>`RULES),Blue,u(TT`GAME`%q<ID>`BLUE),Red,u(TT`GAME`%q<ID>`RED))] ; @include me/TT`FNC`SCORE=%q<ID>,%q<Blue>,%q<Red> ; @pemit %q<Blue>=u(TT`GRID`P1,%q<ID>,%q<Blue>,%q<Red>) ; @pemit %q<Red>=u(TT`GRID`P2,%q<ID>,%q<Blue>,%q<Red>) ; @switch/inline and(not(match(%q<Rules>,Private)),not(match(%q<Rules>,Broadcast)),words(u(TT`GAME`%q<ID>`SPECTATE)))=1,@dolist/inline u(TT`GAME`%q<ID>`SPECTATE)=@pemit %i0=u(TT`GRID`SP,%q<ID>,%q<Blue>,%q<Red>) ; @switch/inline and(not(match(%q<Rules>,Private)),match(%q<Rules>,Broadcast))=1,@oemit loc(%q<Blue>)/%q<Blue> %q<Red>=u(TT`GRID`SP,%q<ID>,%q<Blue>,%q<Red>) ; @switch/inline match(u(TT`GAME`%q<ID>`GRID),0000)=0,@include me/TT`FNC`FINISH=%q<ID>
  349. &TT`FNC`STATS Triple Triad Global=%r+[repeat(-,78)+%r[align(1 -76 1,|,[ansi(gD,Triple Triad - %0's Stats)],|)]%r+[repeat(-,39)+[repeat(-,38)+%r[align(1. 27(cD) >4 4 1. 27(cD) >4 3 1.,|,%r[ansi(ngD,Game Stats)]%rPlayed :%rInstigator :%rWin :%rLose :%rTies :%rDid Not Finish :%r%r,%r%r[extract(%q<Stats>,1,1)]%b%r[extract(%q<Stats>,2,1)]%b%r[extract(%q<Stats>,3,1)]%b%r[extract(%q<Stats>,4,1)]%b%r[extract(%q<Stats>,5,1)]%b%r[switch(extract(%q<Stats>,1,1),0,0,round(mul(fdiv(extract(%q<Stats>,6,1),extract(%q<Stats>,1,1)),100),0))][\%]%r%r,%b,|,%r[ansi(ngD,Card Stats)]%rOwned :%rRare :%rWon :%rBought :%rLost :%rPoints Earned :%r%r,%r%r[extract(%q<Stats>,7,1)]%b%r[extract(%q<Stats>,8,1)]%b%r[extract(%q<Stats>,9,1)]%b%r[extract(%q<Stats>,10,1)]%b%r[extract(%q<Stats>,11,1)]%b%r[extract(%q<Stats>,12,1)]%b%r%r,%b,|)]%r+[repeat(-,39)+[repeat(-,38)+%r[align(1. 27(cD) >4 4 1. 27(cD) >4 3 1.,|,%r[ansi(ngD,Rules Stats)]%rOpen :%rSame :%rWall :%rPlus :%rCombo :%rElemental :%r%r,%r%r[switch(extract(%q<Stats>,1,1),0,0,round(mul(fdiv(extract(%q<Stats>,13,1),extract(%q<Stats>,1,1)),100),0))][\%]%r[switch(extract(%q<Stats>,1,1),0,0,round(mul(fdiv(extract(%q<Stats>,14,1),extract(%q<Stats>,1,1)),100),0))][\%]%r[switch(extract(%q<Stats>,1,1),0,0,round(mul(fdiv(extract(%q<Stats>,15,1),extract(%q<Stats>,1,1)),100),0))][\%]%r[switch(extract(%q<Stats>,1,1),0,0,round(mul(fdiv(extract(%q<Stats>,16,1),extract(%q<Stats>,1,1)),100),0))][\%]%r[switch(extract(%q<Stats>,1,1),0,0,round(mul(fdiv(extract(%q<Stats>,17,1),extract(%q<Stats>,1,1)),100),0))][\%]%r[switch(extract(%q<Stats>,1,1),0,0,round(mul(fdiv(extract(%q<Stats>,18,1),extract(%q<Stats>,1,1)),100),0))][\%]%r%r,%b,%b,%r%rNone :%rOne :%rDiff :%rAll :%r%rLimitless :%r%r,%r%r[switch(extract(%q<Stats>,1,1),0,0,round(mul(fdiv(extract(%q<Stats>,19,1),extract(%q<Stats>,1,1)),100),0))][\%]%r[switch(extract(%q<Stats>,1,1),0,0,round(mul(fdiv(extract(%q<Stats>,20,1),extract(%q<Stats>,1,1)),100),0))][\%]%r[switch(extract(%q<Stats>,1,1),0,0,round(mul(fdiv(extract(%q<Stats>,21,1),extract(%q<Stats>,1,1)),100),0))][\%]%r[switch(extract(%q<Stats>,1,1),0,0,round(mul(fdiv(extract(%q<Stats>,22,1),extract(%q<Stats>,1,1)),100),0))][\%]%r%r[switch(extract(%q<Stats>,1,1),0,0,round(mul(fdiv(extract(%q<Stats>,23,1),extract(%q<Stats>,1,1)),100),0))][\%]%r%r,%b,|)]%r+[repeat(-,78)+
  350. &TT`FNC`TAKECARD Triple Triad Global=th [setq(ID,%0)] ; th [setq(Winner,%1,Loser,%2,Deck,%3)] ; @dolist/inline %q<deck>={ th [setq(Set,left(%i0,1),Nb,right(%i0,3),LV,extract(u(TT`DATA`%i0`STAT),6,1))] ; &TT`CARDS`%q<set> %q<Winner>=[setq(Cards,u(%q<Winner>/TT`CARDS`%q<Set>))][replace(%q<Cards>,%q<Nb>,bound(inc(extract(%q<Cards>,%q<Nb>,1)),0,extract(u(TT`DATA`MAX`%q<Set>),%q<LV>,1)))] ; &TT`CARDS`%q<set> %q<Loser>=[setq(Cards,u(%q<Loser>/TT`CARDS`%q<Set>))][replace(%q<Cards>,%q<Nb>,bound(dec(extract(%q<Cards>,%q<Nb>,1)),0,extract(u(TT`DATA`MAX`%q<Set>),%q<LV>,1)))] ; &TT`STATS %q<Winner>=[setq(Stats,u(%q<Winner>/TT`STATS))][replace(%q<Stats>,9,inc(extract(%q<Stats>,9,1)))] ; &TT`STATS %q<Loser>=[setq(Stats,u(%q<Loser>/TT`STATS))][replace(%q<Stats>,11,inc(extract(%q<Stats>,11,1)))] } ; @pemit %q<Winner>=[ansi(bD,Triple Triad)] - You have earned all of the opponent's cards used in this game\, they were added to your stash. ; @pemit %q<Loser>=[ansi(rD,Triple Triad)] - You have lost all of the cards used in this game. ; @wipe #300/TT`GAME`%q<ID> ; @wipe me/TT`GAME`%q<Blue> ; @wipe me/TT`GAME`%q<Red> ; @include me/TT`FNC`CHECKSTASH=%q<Winner> ; @include me/TT`FNC`CHECKSTASH=%q<Loser>
  351. &TT`FNC`TIEGAME Triple Triad Global=th [setq(Blue,u(me/TT`GAME`%0`BLUE),Red,u(me/TT`GAME`%0`RED))] ; @pemit %q<Blue>=%r[ansi(gD,Triple Triad)] - You have tied the game! The cards are reset for a new game.%r ; @pemit %q<Red>=%r[ansi(gD,Triple Triad)] - You have tied the game! The cards are reset for a new game.%r ; @switch/inline and(not(match(%q<Rules>,Private)),not(match(%q<Rules>,Broadcast)),words(u(TT`GAME`%q<ID>`SPECTATE)))=1,@dolist/inline u(TT`GAME`%q<ID>`SPECTATE)=@pemit %i0=[ansi(gD,Triple Triad)] - Tied game! The Cards are reset. ; @switch/inline and(not(match(%q<Rules>,Private)),match(%q<Rules>,Broadcast))=1,@oemit loc(%q<Blue>)/%q<Blue> %q<Red>=[ansi(gD,Triple Triad)] - Tied game! The Cards are reset. ; &TT`GAME`%q<Blue>`HAND me=u(TT`GAME`%q<Blue>`INIT) ; &TT`GAME`%q<Red>`HAND me=u(TT`GAME`%q<Red>`INIT) ; &TT`GAME`%q<ID>`GRID me=[switch(match(%q<Rules>,Wall),>0,0001 0001 0001 0001 0001 0001 0000 0000 0000 0001 0001 0000 0000 0000 0001 0001 0000 0000 0000 0001 0001 0001 0001 0001 0001,0002 0002 0002 0002 0002 0002 0000 0000 0000 0002 0002 0000 0000 0000 0002 0002 0000 0000 0000 0002 0002 0002 0002 0002 0002)] ; &TT`GAME`%0`GRIDC me=D D D D D D D D D D D D D D D D D D D D D D D D D ; &TT`GAME`%q<ID>`ELEM me=None None None None None [switch(match(%q<Rules>,Elemental),0,None None None None None None None None None,[u(me/TT`FNC`RANDELEM)])] None None None None None ; &TT`STATS %q<Blue>=[setq(Stats,u(%q<Blue>/TT`STATS))][replace(%q<Stats>,5,inc(extract(%q<Stats>,5,1)))] ; &TT`STATS %q<Red>=[setq(Stats,u(%q<Red>/TT`STATS))][replace(%q<Stats>,5,inc(extract(%q<Stats>,5,1)))] ; &TT`GAME`%0`TURN me=randword(u(TT`GAME`%0`PLAYERS)) ; @include/clearregs me/TT`FNC`SHOW`GRID=%q<Blue>
  352. &TT`GAME Triple Triad Global=
  353. &TT`GLOBAL Triple Triad Global=#300
  354. &TT`GRID Triple Triad Global=
  355. &TT`GRID`BLANK Triple Triad Global=
  356. &TT`GRID`BLANK`HAND Triple Triad Global=[switch(%1,0,+,%1)][repeat(-,5)]+%r|%b%b%b%b%b|%r|%b%b[switch(%0,Fire,ansi(yR,F),Lightning,ansi(xC,L),Ice,ansi(xC,I),Earth,ansi(xG,E),Wind,ansi(xG,W),Holy,ansi(xW,H),Poison,ansi(xM,P),Water,ansi(wB,W),%b)]%b%b|%r|%b%b%b%b%b|%r+[repeat(-,5)]+%r
  357. &TT`GRID`DRAW Triple Triad Global=
  358. &TT`GRID`DRAW`BLANK Triple Triad Global=[switch(%1,0,+,u(TT`FNC`FINDNUM,%1))][repeat(-,5)]+%r|%b%b%b%b%b|%r|%b%b[switch(%0,Fire,ansi(yR,F),Lightning,ansi(xC,L),Ice,ansi(xC,I),Earth,ansi(xG,E),Wind,ansi(xG,W),Holy,ansi(xW,H),Poison,ansi(xM,P),Water,ansi(wB,W),%b)]%b%b|%r|%b%b%b%b%b|%r+[repeat(-,5)]+%r
  359. &TT`GRID`DRAW`CARD Triple Triad Global=[setq(Card,u(me/TT`DATA`%0`STAT))][setq(CStats,extract(%q<Card>,1,4,%b),CElem,extract(%q<Card>,5,1,%b))][ansi(switch(%1,R,hwR,B,wB),[switch(%3,0,+,u(TT`FNC`FINDNUM,%3))][repeat(-,5)]+%r|[switch(extract(%q<Card>,5,1,%b),Fire,ansi(nyR,F),Lightning,ansi(nxC,L),Ice,ansi(nxC,I),Earth,ansi(nxG,E),Wind,ansi(nxG,W),Holy,ansi(nxW,H),Poison,ansi(nxM,P),Water,ansi(hwB,W),%b)]%b[switch(extract(%q<CStats>,1,1,%b),10,A,extract(%q<CStats>,1,1,%b))]%b%b|%r|%b[switch(extract(%q<CStats>,2,1,%b),10,A,extract(%q<CStats>,2,1,%b))]%b[switch(extract(%q<CStats>,3,1,%b),10,A,extract(%q<CStats>,3,1,%b))]%b|%r|%b%b[switch(extract(%q<CStats>,4,1,%b),10,A,extract(%q<CStats>,4,1,%b))]%b%b|%r+[repeat(-,3)][switch(%2,None,--,%q<CElem>,ansi(switch(%1,R,bW,B,rW),+1),ansi(switch(%1,R,bW,B,rW),-1))]+%r)]
  360. &TT`GRID`DRAW`HAND Triple Triad Global=[setq(Card,u(me/TT`DATA`%0`STAT))][setq(CStats,extract(%q<Card>,1,4,%b),CElem,extract(%q<Card>,5,1,%b))][ansi(switch(%1,R,hwR,B,wB),[switch(%3,0,+,%3)][repeat(-,5)]+%r|[switch(extract(%q<Card>,5,1,%b),Fire,ansi(nyR,F),Lightning,ansi(nxC,L),Ice,ansi(nxC,I),Earth,ansi(nxG,E),Wind,ansi(nxG,W),Holy,ansi(nxW,H),Poison,ansi(nxM,P),Water,ansi(hwB,W),%b)]%b[switch(extract(%q<CStats>,1,1,%b),10,A,extract(%q<CStats>,1,1,%b))]%b%b|%r|%b[switch(extract(%q<CStats>,2,1,%b),10,A,extract(%q<CStats>,2,1,%b))]%b[switch(extract(%q<CStats>,3,1,%b),10,A,extract(%q<CStats>,3,1,%b))]%b|%r|%b%b[switch(extract(%q<CStats>,4,1,%b),10,A,extract(%q<CStats>,4,1,%b))]%b%b|%r+[repeat(-,3)][switch(%2,None,--,%q<CElem>,ansi(switch(%1,R,bW,B,rW),+1),ansi(switch(%1,R,bW,B,rW),-1))]+%r)]
  361. &TT`GRID`P1 Triple Triad Global=[setq(HandP1,u(me/TT`GAME`%1`HAND),HandP2,u(me/TT`GAME`%2`HAND))][setq(Grid,u(me/TT`GAME`%0`GRID),Color,u(me/TT`GAME`%0`GRIDC),Elem,u(me/TT`GAME`%0`ELEM))][ulocal(me/TT`GRID`P1`TOP,%0,%1,%2)][ulocal(me/TT`GRID`P1`CENTER,%0,%1,%2)][ulocal(me/TT`GRID`P1`BOTTOM,,%0,%1,%2)]
  362. &TT`GRID`P1`BOTTOM Triple Triad Global=[align(1 7 0 7 0 7 0 7 0 7 38,,[switch(extract(%q<HandP1>,1,1,%b),0000,[ansi(wB,u(TT`GRID`BLANK`HAND,None,1))],u(me/TT`GRID`DRAW`HAND,extract(%q<HandP1>,1,1,%b),B,None,1))], ,[switch(extract(%q<HandP1>,2,1,%b),0000,[ansi(wB,u(TT`GRID`BLANK`HAND,None,2))],u(me/TT`GRID`DRAW`HAND,extract(%q<HandP1>,2,1,%b),B,None,2))], ,[switch(extract(%q<HandP1>,3,1,%b),0000,[ansi(wB,u(TT`GRID`BLANK`HAND,None,3))],u(me/TT`GRID`DRAW`HAND,extract(%q<HandP1>,3,1,%b),B,None,3))], ,[switch(extract(%q<HandP1>,4,1,%b),0000,[ansi(wB,u(TT`GRID`BLANK`HAND,None,4))],u(me/TT`GRID`DRAW`HAND,extract(%q<HandP1>,4,1,%b),B,None,4))], ,[switch(extract(%q<HandP1>,5,1,%b),0000,[ansi(wB,u(TT`GRID`BLANK`HAND,None,5))],u(me/TT`GRID`DRAW`HAND,extract(%q<HandP1>,5,1,%b),B,None,5))],%b[iter(1 2 3 4 5,[space(2)]%i0. [u(TT`DATA`[extract(%q<HandP1>,%i0,1,%b)])]%r)])]
  363. &TT`GRID`P1`CENTER Triple Triad Global=[align(1 -25 7 7 7 -25 1,%b,%r%r%r%r[switch(u(me/TT`GAME`%0`TURN),%1,[ansi(cD,It's%ryour turn%r to play.)],[ansi(rD,It's%r[name(%2)]'s%r turn to play.)])]%r%r%r%r%r [ansi(gD,Trading : [switch(match(%q<Rules>,none),>0,None%b)][switch(match(%q<Rules>,one),>0,One%b)][switch(match(%q<Rules>,diff),>0,Diff%b)][switch(match(%q<Rules>,all),>0,All%b)]%r-%r [switch(match(%q<Rules>,open),>0,Open%b)][switch(match(%q<Rules>,same),>0,Same%b)][switch(match(%q<Rules>,wall),>0,Wall%b)][switch(match(%q<Rules>,plus),>0,Plus%b)][switch(match(%q<Rules>,combo),>0,Combo%b)][switch(match(%q<Rules>,elemental),>0,Elemental%b)][switch(match(%q<Rules>,limitless),>0,[ansi(rD,Limitless)])])],[iter(7 12 17,[switch(extract(%q<Grid>,%i0,1,%b),0000,[ansi(dD,u(TT`GRID`DRAW`BLANK,extract(%q<Elem>,%i0,1,%b),%i0))],u(me/TT`GRID`DRAW`CARD,extract(%q<Grid>,%i0,1,%b),extract(%q<Color>,%i0,1,%b),extract(%q<Elem>,%i0,1,%b),%i0))])],[iter(8 13 18,[switch(extract(%q<Grid>,%i0,1,%b),0000,[ansi(dD,u(TT`GRID`DRAW`BLANK,extract(%q<Elem>,%i0,1,%b),%i0))],u(me/TT`GRID`DRAW`CARD,extract(%q<Grid>,%i0,1,%b),extract(%q<Color>,%i0,1,%b),extract(%q<Elem>,%i0,1,%b),%i0))])],[iter(9 14 19,[switch(extract(%q<Grid>,%i0,1,%b),0000,[ansi(dD,u(TT`GRID`DRAW`BLANK,extract(%q<Elem>,%i0,1,%b),%i0))],u(me/TT`GRID`DRAW`CARD,extract(%q<Grid>,%i0,1,%b),extract(%q<Color>,%i0,1,%b),extract(%q<Elem>,%i0,1,%b),%i0))])],%r[ansi(rD,Score:%r%q<NRed>)]%r%r%r%r%r%r%r%r%r%r%r%r[ansi(cD,Score:%r%q<NBlue>)],%b)]%r%r
  364. &TT`GRID`P1`TOP Triple Triad Global=[switch(match(u(me/TT`GAME`%0`RULES),Open),>0,[align(39 7 0 7 0 7 0 7 0 7,%b[iter(1 2 3 4 5,[space(2)]%i0. [u(TT`DATA`[extract(%q<HandP2>,%i0,1,%b)])]%r)],[switch(extract(%q<HandP2>,1,1,%b),0000,[ansi(hwR,u(TT`GRID`BLANK`HAND,None,1))],u(me/TT`GRID`DRAW`HAND,extract(%q<HandP2>,1,1,%b),R,None,1))],,[switch(extract(%q<HandP2>,2,1,%b),0000,[ansi(hwR,u(TT`GRID`BLANK`HAND,None,2))],u(me/TT`GRID`DRAW`HAND,extract(%q<HandP2>,2,1,%b),R,None,2))],,[switch(extract(%q<HandP2>,3,1,%b),0000,[ansi(hwR,u(TT`GRID`BLANK`HAND,None,3))],u(me/TT`GRID`DRAW`HAND,extract(%q<HandP2>,3,1,%b),R,None,3))],,[switch(extract(%q<HandP2>,4,1,%b),0000,[ansi(hwR,u(TT`GRID`BLANK`HAND,None,4))],u(me/TT`GRID`DRAW`HAND,extract(%q<HandP2>,4,1,%b),R,None,4))],,[switch(extract(%q<HandP2>,5,1,%b),0000,[ansi(hwR,u(TT`GRID`BLANK`HAND,None,5))],u(me/TT`GRID`DRAW`HAND,extract(%q<HandP2>,5,1,%b),R,None,5))],%b)],[align(40 7 0 7 0 7 0 7 0 7,,[ansi(hwR,u(TT`GRID`BLANK`HAND,None,0))],,[ansi(hwR,u(TT`GRID`BLANK`HAND,None,0))],,[ansi(hwR,u(TT`GRID`BLANK`HAND,None,0))],,[ansi(hwR,u(TT`GRID`BLANK`HAND,None,0))],,[ansi(hwR,u(TT`GRID`BLANK`HAND,None,0))],%b)])]%r%r
  365. &TT`GRID`P2 Triple Triad Global=[setq(HandP1,u(me/TT`GAME`%1`HAND),HandP2,ulocal(me/TT`GAME`%2`HAND))][setq(Grid,u(me/TT`GAME`%0`GRID),Color,u(me/TT`GAME`%0`GRIDC),Elem,u(me/TT`GAME`%0`ELEM))][ulocal(me/TT`GRID`P2`TOP,%0,%1,%2)][ulocal(me/TT`GRID`P2`CENTER,%0,%1,%2)][ulocal(me/TT`GRID`P2`BOTTOM,,%0,%1,%2)]
  366. &TT`GRID`P2`BOTTOM Triple Triad Global=[align(1 7 0 7 0 7 0 7 0 7 38,,[switch(extract(%q<HandP2>,1,1,%b),0000,[ansi(hwR,u(TT`GRID`BLANK`HAND,None,1))],u(me/TT`GRID`DRAW`HAND,extract(%q<HandP2>,1,1,%b),R,None,1))], ,[switch(extract(%q<HandP2>,2,1,%b),0000,[ansi(hwR,u(TT`GRID`BLANK`HAND,None,2))],u(me/TT`GRID`DRAW`HAND,extract(%q<HandP2>,2,1,%b),R,None,2))], ,[switch(extract(%q<HandP2>,3,1,%b),0000,[ansi(hwR,u(TT`GRID`BLANK`HAND,None,3))],u(me/TT`GRID`DRAW`HAND,extract(%q<HandP2>,3,1,%b),R,None,3))], ,[switch(extract(%q<HandP2>,4,1,%b),0000,[ansi(hwR,u(TT`GRID`BLANK`HAND,None,4))],u(me/TT`GRID`DRAW`HAND,extract(%q<HandP2>,4,1,%b),R,None,4))], ,[switch(extract(%q<HandP2>,5,1,%b),0000,[ansi(hwR,u(TT`GRID`BLANK`HAND,None,5))],u(me/TT`GRID`DRAW`HAND,extract(%q<HandP2>,5,1,%b),R,None,5))],%b[iter(1 2 3 4 5,[space(2)]%i0. [u(TT`DATA`[extract(%q<HandP2>,%i0,1,%b)])]%r)])]
  367. &TT`GRID`P2`CENTER Triple Triad Global=[align(1 -25 7 7 7 -25 1,%b,%r%r%r[switch(u(me/TT`GAME`%0`TURN),%1,[ansi(cD,It's%r[name(%1)]'s%r turn to play.)],[ansi(rD,It's%ryour turn%r turn to play.)])]%r%r%r%r%r[ansi(gD,Trading : [switch(match(%q<Rules>,none),>0,None%b)][switch(match(%q<Rules>,one),>0,One%b)][switch(match(%q<Rules>,diff),>0,Diff%b)][switch(match(%q<Rules>,all),>0,All%b)]%r-%r [switch(match(%q<Rules>,open),>0,Open%b)][switch(match(%q<Rules>,same),>0,Same%b)][switch(match(%q<Rules>,wall),>0,Wall%b)][switch(match(%q<Rules>,plus),>0,Plus%b)][switch(match(%q<Rules>,combo),>0,Combo%b)][switch(match(%q<Rules>,elemental),>0,Elemental%b)][switch(match(%q<Rules>,limitless),>0,[ansi(rD,Limitless)])])],[iter(7 12 17,[switch(extract(%q<Grid>,%i0,1,%b),0000,[ansi(dD,u(TT`GRID`DRAW`BLANK,extract(%q<Elem>,%i0,1,%b),%i0))],u(me/TT`GRID`DRAW`CARD,extract(%q<Grid>,%i0,1,%b),extract(%q<Color>,%i0,1,%b),extract(%q<Elem>,%i0,1,%b),%i0))])],[iter(8 13 18,[switch(extract(%q<Grid>,%i0,1,%b),0000,[ansi(dD,u(TT`GRID`DRAW`BLANK,extract(%q<Elem>,%i0,1,%b),%i0))],u(me/TT`GRID`DRAW`CARD,extract(%q<Grid>,%i0,1,%b),extract(%q<Color>,%i0,1,%b),extract(%q<Elem>,%i0,1,%b),%i0))])],[iter(9 14 19,[switch(extract(%q<Grid>,%i0,1,%b),0000,[ansi(dD,u(TT`GRID`DRAW`BLANK,extract(%q<Elem>,%i0,1,%b),%i0))],u(me/TT`GRID`DRAW`CARD,extract(%q<Grid>,%i0,1,%b),extract(%q<Color>,%i0,1,%b),extract(%q<Elem>,%i0,1,%b),%i0))])],%r[ansi(cD,Score:%r%q<NBlue>)]%r%r%r%r%r%r%r%r%r%r%r%r[ansi(rD,Score:%r%q<NRed>)],%b)]%r%r
  368. &TT`GRID`P2`TOP Triple Triad Global=[switch(match(u(me/TT`GAME`%0`RULES),Open),>0,[align(40 7 0 7 0 7 0 7 0 7,%b[iter(1 2 3 4 5,%b[space(2)]%i0. [u(TT`DATA`[extract(%q<HandP1>,%i0,1,%b)])]%r)],[switch(extract(%q<HandP1>,1,1,%b),0000,[ansi(wB,u(TT`GRID`BLANK`HAND,None,1))],u(me/TT`GRID`DRAW`HAND,extract(%q<HandP1>,1,1,%b),B,None,1))],,[switch(extract(%q<HandP1>,2,1,%b),0000,[ansi(wB,u(TT`GRID`BLANK`HAND,None,2))],u(me/TT`GRID`DRAW`HAND,extract(%q<HandP1>,2,1,%b),B,None,2))],,[switch(extract(%q<HandP1>,3,1,%b),0000,[ansi(wB,u(TT`GRID`BLANK`HAND,None,3))],u(me/TT`GRID`DRAW`HAND,extract(%q<HandP1>,3,1,%b),B,None,3))],,[switch(extract(%q<HandP1>,4,1,%b),0000,[ansi(wB,u(TT`GRID`BLANK`HAND,None,4))],u(me/TT`GRID`DRAW`HAND,extract(%q<HandP1>,4,1,%b),B,None,4))],,[switch(extract(%q<HandP1>,5,1,%b),0000,[ansi(wB,u(TT`GRID`BLANK`HAND,None,5))],u(me/TT`GRID`DRAW`HAND,extract(%q<HandP1>,5,1,%b),B,None,5))],%b)],[align(40 7 0 7 0 7 0 7 0 7,,[ansi(wB,u(TT`GRID`BLANK`HAND,None,0))],,[ansi(wB,u(TT`GRID`BLANK`HAND,None,0))],,[ansi(wB,u(TT`GRID`BLANK`HAND,None,0))],,[ansi(wB,u(TT`GRID`BLANK`HAND,None,0))],,[ansi(wB,u(TT`GRID`BLANK`HAND,None,0))],%b)])]%r%r
  369. &TT`GRID`SP Triple Triad Global=[setq(Grid,u(me/TT`GAME`%0`GRID),Color,u(me/TT`GAME`%0`GRIDC),Elem,u(me/TT`GAME`%0`ELEM),Rules,u(me/TT`GAME`%0`RULES))][ulocal(me/TT`GRID`SP`CENTER,%0,%1,%2)]
  370. &TT`GRID`SP`CENTER Triple Triad Global=[align(1 -25 7 7 7 -25 1,%b,%r%r%r%r[switch(u(me/TT`GAME`%0`TURN),%1,[ansi(cD,It's%r[name(%1)]'s%r turn to play.)],[ansi(rD,It's%r[name(%2)]'s%r turn to play.)])]%r%r%r%r%r [ansi(gD,Trading : [switch(match(%q<Rules>,none),>0,None%b)][switch(match(%q<Rules>,one),>0,One%b)][switch(match(%q<Rules>,diff),>0,Diff%b)][switch(match(%q<Rules>,all),>0,All%b)]%r-%r [switch(match(%q<Rules>,open),>0,Open%b)][switch(match(%q<Rules>,same),>0,Same%b)][switch(match(%q<Rules>,wall),>0,Wall%b)][switch(match(%q<Rules>,plus),>0,Plus%b)][switch(match(%q<Rules>,combo),>0,Combo%b)][switch(match(%q<Rules>,elemental),>0,Elemental%b)][switch(match(%q<Rules>,limitless),>0,[ansi(rD,Limitless)])])],[iter(7 12 17,[switch(extract(%q<Grid>,%i0,1,%b),0000,[ansi(dD,u(TT`GRID`DRAW`BLANK,extract(%q<Elem>,%i0,1,%b),0))],u(me/TT`GRID`DRAW`CARD,extract(%q<Grid>,%i0,1,%b),extract(%q<Color>,%i0,1,%b),extract(%q<Elem>,%i0,1,%b),0))])],[iter(8 13 18,[switch(extract(%q<Grid>,%i0,1,%b),0000,[ansi(dD,u(TT`GRID`DRAW`BLANK,extract(%q<Elem>,%i0,1,%b),0))],u(me/TT`GRID`DRAW`CARD,extract(%q<Grid>,%i0,1,%b),extract(%q<Color>,%i0,1,%b),extract(%q<Elem>,%i0,1,%b),0))])],[iter(9 14 19,[switch(extract(%q<Grid>,%i0,1,%b),0000,[ansi(dD,u(TT`GRID`DRAW`BLANK,extract(%q<Elem>,%i0,1,%b),0))],u(me/TT`GRID`DRAW`CARD,extract(%q<Grid>,%i0,1,%b),extract(%q<Color>,%i0,1,%b),extract(%q<Elem>,%i0,1,%b),0))])],%r[ansi(rD,[name(%1)]%rScore:%r%q<NRed>)]%r%r%r%r%r%r%r%r%r%r[ansi(cD,[name(%2)]%rScore:%r%q<NBlue>)],%b)]%r%r
  371. &TT`HELP Triple Triad Global=
  372. &TT`HELP`ALL Triple Triad Global=$+TT/Help All:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Help - All Rule)],|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rSelf-explanatory\, this rule lets the victor take away all of the cards used by their opponent in the game.%r%r,|)]%r+[repeat(-,78)]+%r
  373. &TT`HELP`BASIC Triple Triad Global=$+TT/Help Basic:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Help - The Basics)],|)]%r+[repeat(-,78)]+%r[align(1. 7 68 1.,|,%r[ansi(wB,+-----+%r|[ansi(yR,F)]%b5%b%b|%r|%b3%b2%b|%r|%b%b4%b%b|%r+-----+%r)],%rThis is a standard game card. It features 4 'attack levels'\, or Ranks\, ranging from 1 to 10 (or A). The top left corner also has an elemental\, in this case Fire. We will come back to Elementals later. The cards come in two colors\, Blue and Red.%r,|)]%r[align(1. 76 1.,|,%rWhen you play\, the position of those numbers is important. The direction it faces (Up, Left, Right, Down) will 'attack' in that direction. Like below.%r,|)]%r[align(1. 60 7 7 1.,|,%rIn this example\, the 2 from  the blue card is higher than the 1 of the red card. Which means that the Blue card wins. In a game\, it would flip the Red card to the Blue color. This is the most basic rule\, the 'Attack' rule. It will be refered to in other rules later.%r%r,%r[ansi(wB,+-----+%r|[ansi(yR,F)]%b5%b%b|%r|%b3%b2%b|%r|%b%b4%b%b|%r+-----+%r)],%r[ansi(hwR,+-----+%r|%b%b7%b%b|%r|%b1%b1%b|%r|%b%b2%b%b|%r+-----+%r)],|)]%r[align(1. 76 1.,|,The cards are divided into 10 levels\, which comes in play when you build your deck. You have a limit of [u(TT`DECK`MAX)] levels when you add all 5 cards of your hand\, for the purpose of balancing strength during games. This limit can be bypassed using the [ansi(gD,Limitless)] rule.%r%r,|)]%r+[repeat(-,78)]+%r
  374. &TT`HELP`BROADCAST Triple Triad Global=$+TT/Help Broadcast:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Help - Broadcast Option)],|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rThe game results and grid will be sent to the entire room. This is mostly for use in certain RP or events\, such as a tournament's final. Please avoid using this option unless everyone in the room agrees to it of course!%r%r,|)]%r+[repeat(-,78)]+%r
  375. &TT`HELP`CARDS Triple Triad Global=$+TT/Help Cards:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Help - The Cards)],|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rTo play the game\, you first need to get cards. With these commands you get get more familiarized with the cards you possess and view basic information as well. Note there are limits per card different cards that you can have in your stash\, depending on their level and series. [ansi(rD,If you try to take cards over that limit\, they will be lost without warning.)]%r,|)]%r+[repeat(-,78)+%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Starter)]%r,%b,%rInitializes you for playing\, and gives you a starting set of 20 cards : Level 1 x 5\, Level 2 x 4\, Level 3 x 3\, Level 4 x 2\, Level 5 to 10 x1%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Stash <Page>)]%r,%b,%rChecks on your current stash of cards and their ammount. Page is optional.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Detail <Page>)]%r,%b,%rSimilar to stash\, but shows more details like the card values. Page is optional.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Card <Name>)]%r,%b,%rChecks on a card's Level\, Stats and how much you own of it.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Stats <Name>)]%r,%b,%rChecks on the Game stats of a player. <Name> can be omitted to check on your own statistics.%r,|)]%r+[repeat(-,78)]+%r
  376. &TT`HELP`COMBO Triple Triad Global=$+TT/Help Combo:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Help - Combo Rule)],|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rYou ever seen a game that you were winning by a landslide and a single card from your opponent turned it into a crushing defeat for you? That's the Combo rule. It doesn't work on its own\, it first requires a Same\, Wall or a Plus combination to be used. When Same or Plus is triggered\, the two cards that were flipped to your color are played in as if they had been placed by you\, using the standard 'attack' rule.%r%r,|)]%r[align(1. 7 7 60 1.,|,[ansi(wB,+-----+%r|%b%b5%b%b|%r|%b3%b2%b|%r|%b%b4%b%b|%r+-----+%r)]%r[ansi(hwR,+-----+%r|%b%b8%b%b|%r|%b6%b2%b|%r|%b%b3%b%b|%r+-----+%r)]%r[ansi(hwR,+-----+%r|%b%b1%b%b|%r|%b3%b4%b|%r|%b%b5%b%b|%r+-----+%r)],[ansi(hwR,+-----+%r|%b%b3%b%b|%r|%bA%b6%b|%r|%b%b6%b%b|%r+-----+%r)],This is the same example than the Plus rule\, to which we added one card. In the Plus rule\, only the two nearby cards would be flipped. But by adding the Combo rule\, the bottom-most card will also be flipped. How so? Because the middle card flips to Blue\, and since the Combo rule is in effect\, the '3' on the middle card is higher than the '1' on the lower card. A single card\, and you turned 3 cards to Blue.%r%rFurthermore\, each card that was flipped as part of the Combo will also be considered as played in on that turn. So the bottom card will also try to 'attack' nearby cards. It's possible to flip the entire board in a single card with this.%r,|)]%r+[repeat(-,78)]+%r
  377. &TT`HELP`CUSTOM Triple Triad Global=$+TT/Help Custom:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Help - Custom Cards)],|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rCustom cards are unique cards\, in the "X" series. They are priced higher than standard series of cards\, because of their rarity\, and created by request or need. Each custom card can also reflect the personality of the depicted person\, their style and their elemental. While many people can buy these cards\, each player can only have one of each in their stash. Custom cards are not about the power or level they display\, but about their rarity and collecting value. Few people choose to play with them when using Trading rules. %r%rThe price of creating a Custom card is [div(u(v(TT`GLOBAL)/TT`DATA`COST`X`SING),2)] points per level. The cards can be of any level\, but the total points used on the card need to match with the level :%r%r,|)]%r[align(1. 38 0 37 1.,|,[ansi(gD,Level %b1)] : 10-13%r[ansi(gD,Level %b2)] : 12-15%r[ansi(gD,Level %b3)] : 14-17%r[ansi(gD,Level %b4)] : 16-19%r[ansi(gD,Level %b5)] : 18-21%r,,[ansi(gD,Level %b6)] : 20-23%r[ansi(gD,Level %b7)] : 22-25%r[ansi(gD,Level %b8)] : 24-26%r[ansi(gD,Level %b9)] : 24-27%r[ansi(gD,Level 10)] : 26-29%r,|)]%r[align(1. 76 1.,|,%rThe command to create a new custom card is :%r[ansi(gD,+TT/Custom <Name>/<Level>=<Up> <Left> <Right> <Down> <Elemental>)]%rExample : [ansi(gD,+TT/Custom [name(%#)]/4=3 4 5 6 Fire)]%r%rThe [ansi(gD,+TT/Help Random=<Level>)] command is a tool to help you\, giving you 5 random series of 4 numbers that are within the range of the specified level.%r%r,|)]%r+[repeat(-,78)]+%r
  378. &TT`HELP`DECK Triple Triad Global=$+TT/Help Deck:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Help - The Cards)],|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rAfter getting your cards\, you need a Deck to play. The Decks are referenced by a [ansi(rD,single word name)] that you give it. Decks start as empty\, and then you edit then adding or removing cards. Decks with less than 5 cards cannot be used in a game.%r%rThere is a warning if your deck is higher than [u(TT`DECK`MAX)] levels by adding all 5 cards\, but you can still keep the deck as such\, for use of the [ansi(gD,Limitless)] rule.%r%r,|)]%r+[repeat(-,78)]+%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Deck Create=%r<Deck>)]%r,%b,%rCreates a Deck named <Deck>.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Deck Delete=%r<Deck>)]%r,%b,%rDeletes your <Deck> deck.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Deck List)]%r,%b,%rList your currently saved decks.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Deck Add/<Deck>=%r<Card1>\,<Card2>\,...)]%r,%b,%rAdds the Card <Card> to the <Deck> Deck. You can add many cards in a single command like this.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Deck Rem/<Deck>=%r<Card1>\,<Card2>\,...)]%r,%b,%rRemoves the Card <Card> from the Deck <Deck>. You can remove many cards with a single command.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Deck Check=%r<Deck>)]%r,%b,%rReviews the cards in your <Deck> Deck\, but also the total level of the cards. It also lets you know if you're lacking cards to play with that deck.%r%r,|)]%r+[repeat(-,78)]+%r
  379. &TT`HELP`DIFF Triple Triad Global=$+TT/Help Diff:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Help - Diff Rule)],|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rThis rule allows you to take as many cards as the score difference. The number of cards you get is (Score-5). So with this rule you can choose 1 to 4 cards from your opponent's hand.%r%r,|)]%r+[repeat(-,78)]+%r
  380. &TT`HELP`ELEM Triple Triad Global=$+TT/Help Elemental:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Help - Elemental Rule)],|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rWhen you play a game with the Elemental rule\, some icons will appear on the otherwise empty game grid. Those match the icons that appear in the upper left corner of the cards. Those are Elementals. There are 8 elementals\, and playing a card on that spot will have one of two effects :%r%r-If the card played has the same elemental\, all of the 'attack' values will increase by one (Maximum of 10/A).%r%r-If the card played is different elemental\, or has no elemental\, each value will decrease by one (Minimum of 1).%r%r,|)]%r[align(1. 7 68 1.,|,[ansi(wB,+-----+%r|[ansi(yF,F)]%b5%b%b|%r|%b3%b2%b|%r|%b%b4%b%b|%r+---[ansi(hr,+1)]+%r)],These value changes do NOT affect the use of Same/Plus/Wall combinations\, but it DOES affect the Combo's rule 'attack' values. For Same/Wall/Plus\, only the original value applies.%r%rWhen a card is under the effect of elemental\, the bottom left corner shows a "+1" or a "-1" to show there is a value change\, like you can see on the example on the left. Pay attention!%r%r,|)]%r[align(1. 16 20 1 20 15 1.,|,,[ansi(yR,F)] Fire%r[ansi(xC,I)] Ice%r[ansi(xG,W)] Wind%r[ansi(xG,E)] Earth%r%r,%b,[ansi(xC,L)] Lightning%r[ansi(wB,W)] Water%r[ansi(xW,H)] Holy%r[ansi(xM,P)] Poison%r%r,%b,|)]%r+[repeat(-,78)]+%r
  381. &TT`HELP`GRID Triple Triad Global=$+TT/Help Grid:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Help - The Grid)],|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rHere is a sample of the game grid as you will see during the game.%r%rFirst up\, the Top of the grid.%r%r,|)]%r+[repeat(-,78)]+%r[align(1. 36 7 0 7 0 7 0 7 0 7 1.,|,%r1. Funguar%r2. Bite Bug%r3. Buel%r4. Snow Lion%r5. Phoenix%r,%r[ansi(hwR,1-----+%r|%b%b5%b%b|%r|%b3%b1%b|%r|%b%b1%b%b|%r+-----+)]%r,,%r[ansi(hwR,2-----+%r|%b%b1%b%b|%r|%b5%b3%b|%r|%b%b3%b%b|%r+-----+)]%r,,%r[ansi(hwR,3-----+%r|%b%b6%b%b|%r|%b3%b2%b|%r|%b%b2%b%b|%r+-----+)]%r,,%r[ansi(hwR,4-----+%r|[ansi(xC,I)]%b7%b%b|%r|%b3%b1%b|%r|%b%b5%b%b|%r+-----+)]%r,,%r[ansi(hwR,5-----+%r|[ansi(yR,F)]%b7%b%b|%r|%bA%b2%b|%r|%b%b7%b%b|%r+-----+)]%r,|)]%r[align(1. 76 1.,|,%rThis is where you will see your opponent's cards. If you are using the Open rule\, as in the example\, you will see the card names and their values as well. The left side has the names of the cards still unplayed\, while the right side has the card pictures.%r%rNote the numbers in the upper left corner of each card picture to help you figure out which card is which.%r%r,|)]%r+[repeat(-,78)]+%r[align(1 -76 1,|,Continued in [ansi(gD,+TT/Help Grid2)],|)]%r+[repeat(-,78)]+%r
  382. &TT`HELP`GRID2 Triple Triad Global=$+TT/Help Grid2:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Help - The Grid Part 2)],|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rThis time\, its the middle of the grid.%r%r,|)]%r+[repeat(-,78)]+%r[align(1. -25 7 7 7 -26 1.,|,%r%r%r%r%r%r%r%r[ansi(cD,It's%ryour turn%rto play)],%r[ansi(wB,1-----+%r|%b%b5%b%b|%r|%b3%b1%b|%r|%b%b1%b%b|%r+---[ansi(hr,-1)]+)]%r%r[ansi(dD,4-----+%r|%b%b%b%b%b|%r|%b%b%b%b%b|%r|%b%b%b%b%b|%r+-----+)]%r%r[ansi(dD,7-----+%r|%b%b%b%b%b|%r|%b%b%b%b%b|%r|%b%b%b%b%b|%r+-----+)]%r%r,%r[ansi(hwR,2-----+%r|%b%b5%b%b|%r|%b3%b1%b|%r|%b%b1%b%b|%r+-----+)]%r%r[ansi(dD,5-----+%r|%b%b%b%b%b|%r|%b%b[ansi(yR,F)]%b%b|%r|%b%b%b%b%b|%r+-----+)]%r%r[ansi(dD,8-----+%r|%b%b%b%b%b|%r|%b%b[ansi(xC,I)]%b%b|%r|%b%b%b%b%b|%r+-----+)]%r%r,%r[ansi(dD,3-----+%r|%b%b%b%b%b|%r|%b%b%b%b%b|%r|%b%b%b%b%b|%r+-----+)]%r%r[ansi(dD,6-----+%r|%b%b%b%b%b|%r|%b%b%b%b%b|%r|%b%b%b%b%b|%r+-----+)]%r%r[ansi(dD,9-----+%r|%b%b%b%b%b|%r|%b%b%b%b%b|%r|%b%b%b%b%b|%r+-----+)]%r%r,%r%r[ansi(rD,Score:%r5)]%r%r%r%r%r%r%r%r%r%r%r%r[ansi(cD,Score:%r5)],|)]%r[align(1. 76 1.,|,Things to note\, the card pictures are also numbered for convenience when you play. The empty spots with a colored letter are the Elemental in effect. Thus the spot #5 is Fire and the spot #8 is Ice. Also because of the elemental rule\, you can see that the card in #1 has a '-1' in it.%r%rThe left side shows who's turn it is\, while the right side shows the current score.%r%r,|)]%r+[repeat(-,78)]+%r[align(1 -76 1,|,Continued in [ansi(gD,+TT/Help Grid3)],|)]%r+[repeat(-,78)]+%r
  383. &TT`HELP`GRID3 Triple Triad Global=$+TT/Help Grid3:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Help - The Grid Part 3)],|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rFinally the bottom part.%r%r,|)]%r+[repeat(-,78)]+%r[align(1. 7 0 7 0 7 0 7 0 7 36 1.,|,%r[ansi(wB,1-----+%r|%b%b5%b%b|%r|%b3%b1%b|%r|%b%b1%b%b|%r+-----+)]%r,,%r[ansi(wB,2-----+%r|%b%b1%b%b|%r|%b5%b3%b|%r|%b%b3%b%b|%r+-----+)]%r,,%r[ansi(wB,3-----+%r|%b%b6%b%b|%r|%b3%b2%b|%r|%b%b2%b%b|%r+-----+)]%r,,%r[ansi(wB,4-----+%r|[ansi(xC,I)]%b7%b%b|%r|%b3%b1%b|%r|%b%b5%b%b|%r+-----+)]%r,,%r[ansi(wB,5-----+%r|[ansi(yR,F)]%b7%b%b|%r|%bA%b2%b|%r|%b%b7%b%b|%r+-----+)]%r,%r1. Funguar%r2. Bite Bug%r3. Buel%r4. Snow Lion%r5. Phoenix%r,|)]%r[align(1. 76 1.,|,%rAs you can see\, same basic as the top part\, except you will always be able to see what cards are in your hand\, of course. Your hand is always at the bottom\, no matter if you play Red or Blue.%r%r,|)]%r+[repeat(-,78)]+
  384. &TT`HELP`LIMITLESS Triple Triad Global=$+TT/Help Limitless:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Help - Limitless Rule)],|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rNormally when you build a deck\, you are limited to a total of [u(TT`DECK`MAX)] levels\, by adding all of your cards together. The Limitless rule can be considered as an Exhibition rule\, in which that limit is removed. It allows players to play with high level cards all they wish.%r%r,|)]%r+[repeat(-,78)]+%r
  385. &TT`HELP`MAIN Triple Triad Global=$+TT/Help:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Help)],|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rThe most popular card game in Esthar makes his way to this multiverse\, and now you can enjoy it as well! Collect the cards\, play the game\, buy new ones\, earn them from your opponents\, anything goes! Here's how you can play it too!%r%r,|)]%r+[repeat(-,78)]+%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Help Basic)]%r,%b,%rHere is the basic understanding of the game.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Help Grid)]%r,%b,%rBasic outline and placement of the grid.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Help Rules)]%r,%b,%rWhat are the different rules and how they work.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Help Cards)]%r,%b,%rHow to start the game\, check on cards and statistics.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Help Deck)]%r,%b,%rHow to create and edit your decks.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Help Shop)]%r,%b,%rHow to buy new cards.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Help Play)]%r,%b,%rHow to play the game.%r%r,|)]%r+[repeat(-,78)]+%r
  386. &TT`HELP`NONE Triple Triad Global=$+TT/Help None:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Help - None Rule)],|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rThis Trading rule allows to play others without fear of losing their precious cards. It's considered as an exhibition rule as a result.%r%r,|)]%r+[repeat(-,78)]+%r
  387. &TT`HELP`ONE Triple Triad Global=$+TT/Help One:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Help - One Rule)],|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rThe default trading rule\, if you don't specify any trading rule\, it automatically sets it as [ansi(gD,One)]. This rule allows the victor to take one card of their choosing from the loser's hand. Only cards that are played can be taken like this.%r%r,|)]%r+[repeat(-,78)]+%r
  388. &TT`HELP`OPEN Triple Triad Global=$+TT/Help Open:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Help - Open Rule)],|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rSimple and to the point\, this rule will allow you to see what your opponent's cards are\ in their hands\, before they play it. Beware\, it also means they can see yours.%r%rFrom a gameplay standpoint\, it gives an advantage to see what cards your opponent has left\, so you can try to corner them or block them from earning a card\, or setting up Same/Plus/Wall combinations.%r%r,|)]%r+[repeat(-,78)]+%r
  389. &TT`HELP`PLAY Triple Triad Global=$+TT/Help Play:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Help - The Gameplay)],|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rWhen you are ready to play\, here's how you do it!%r%r,|)]%r+[repeat(-,78)]+%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Game <Name>=%r<Deck>\,%r<Rule> <Rule> <...>)]%r,%b,%rStart a game vs <Name>\, using <Deck>\, and the <Rules> specified. It sends the invite to the requested player. The invite also shows has the rules chosen for the game. Put spaces between each rule.,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Accept <Deck>)]%r,%b,%rThe invited person uses this to start the game using their specified Deck.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Refuse)]%r,%b,%rIf the invited person refuses to play.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Play <Card>=<Pos>)]%r,%b,%rPlays the Card # from your hand into the Grid position #. Use the numbers seen in the top left corner of each card for this.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Grid)]%r,%b,%rIf you lost track of the game\, this will allow you to check the on the table one more.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Choose <Card>\,<Card>\,<...>)]%r,%b,%rAfter winning the game\, if trading rules allow\, you can take cards from your opponent's hand. Put commas between each card.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Cancel)]%r,%b,%rCancels the current game. Cards will not be lost doing this\, but if done in the middle of a game\, a record will be kept in the player's statistics.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Spectate Join=<Name>)]%r,%b,%rEnters spectating mode for the game <Name> is playing.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Spectate Leave)]%r,%b,%rStops spectating the game in progress.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Option <Option>)]%r,%b,%rChanges the Spectation option midgame. Valid options are [ansi(gD,Private\, Broadcast or None)]%r%r,|)]%r+[repeat(-,78)]+%r
  390. &TT`HELP`PLUS Triple Triad Global=$+TT/Help Plus:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Help - Plus Rule)],|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rThe nature of the Plus rule is similar to the Same rule\, as it needs at least one opposing card to trigger. The difference is that it doesn't require 'Same' numbers\, but instead the same 'sum' of numbers in two directions.%r%rThe tactical advantage is the ability to control opponent cards despite using low ranked cards. In fact\, it's possible to turn opponent cards with only '1' and '2' values if you can do the math!%r%r,|)]%r[align(1. 7 7 60 1.,|,[ansi(wB,+-----+%r|%b%b5%b%b|%r|%b3%b2%b|%r|%b%b4%b%b|%r+-----+%r)]%r[ansi(hwR,+-----+%r|%b%b8%b%b|%r|%b6%b2%b|%r|%b%b3%b%b|%r+-----+%r)],[ansi(hwR,+-----+%r|%b%b3%b%b|%r|%bA%b6%b|%r|%b%b6%b%b|%r+-----+%r)],If Blue places his card here\, the opposing values become 8+4 and 10+2\, since both total 12\, the two Red cards would be flipped to Blue. As you can see\, the Blue Cards had smaller attack power in both directions\, but still wins thanks to the Plus rule.%r%rAs with the Same rule\, at least one opposing card is necessary for this\, you can trigger it using one of your own cards.%r,|)]%r+[repeat(-,78)]+%r
  391. &TT`HELP`PRIVATE Triple Triad Global=$+TT/Help Private:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Help - Private Option)],|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rGames can be spectated by other people\, when a game starts the announcement is made to the room. The Private option counters this\, disallowing anyone from spectating your game.%r%r,|)]%r+[repeat(-,78)]+%r
  392. &TT`HELP`RULES Triple Triad Global=$+TT/Help Rules:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Help - The Rules)],|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rThere are two types of rules\, you can view each individual rule using [ansi(gD,+TT/Help <Rule>)].%r%rThere are also Spectating options that can be used.%r%r,|)]%r+[repeat(-,78)]+%r[align(1. -37 1 -36 1.,|,%r[ansi(gD,Game Rules)]%r%rOpen%rSame%rWall%rPlus%rCombo%rElemental%rLimitless%r%r,%b,%r[ansi(gD,Trade Rules)]%r%rNone%rOne%rDiff%rAll%r%r[ansi(gD,Spectating Options)]%r%rPrivate%rBroadcast%r%r,|)]%r+[repeat(-,78)]+%r
  393. &TT`HELP`SAME Triple Triad Global=$+TT/Help Same:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Help - Same Rule)],|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rA bit more complex to play and setup\, this rule allows you to capture cards even when the 'attack' power is lower\, or in this case\, 'Same'.%rTo setup it up\, you need to place a card next to two other cards. And it only works if at least one of the cards is your opponent's. You cannot use the Same rule on two cards that you control\, but if you control only one of the two\, it can still be triggered.%r%r,|)]%r[align(1. 7 7 60 1.,|,[ansi(wB,+-----+%r|%b%b5%b%b|%r|%b3%b2%b|%r|%b%b4%b%b|%r+-----+%r)]%r[ansi(hwR,+-----+%r|%b%b4%b%b|%r|%b6%b2%b|%r|%b%b3%b%b|%r+-----+%r)],[ansi(hwR,+-----+%r|%b%b7%b%b|%r|%b2%b4%b|%r|%b%b1%b%b|%r+-----+%r)],This is an example of the Same rule. Note that the opposing '2' on the Left/Right cards and the opposing '4' on the Up/Down cards. %r%rIf the Blue card is placed there\, the 2 Red cards will turn to blue. But if one of the two Red cards was Blue\, it would still work and make all 3 cards Blue in the end.%r,|)]%r+[repeat(-,78)]+%r
  394. &TT`HELP`SHOP Triple Triad Global=$+TT/Help Shop:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Help - Card Shop)],|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rThere is a Card Shop in town\, allowing you to exchange your points against new cards!%r%rYou earn 5 points per game played\, and another 5 points if you win.%r%r,|)]%r+[repeat(-,78)]+%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/List)]%r,%b,%rLists the known card series. It lets you know of how many cards each set have\, and their price Random/Specific.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/List <Set>/<Level or All>)]%r,%b,%rLists the card from the given series\, for the given level. You can use 'all' instead to see all cards regardless of level. %r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Buy Random=<Set>/<Level>)]%r,%b,%rBuy a card at random from the specified level and series. The cost is dependent on the series\, multipled by the level of the card.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TT/Buy Card=<Name>)]%r,%b,%rBuy a specific card\, going by the name given. The cost is twice as much as the random cards for the same level.%r%r,|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rAlso\, you can use your points to make a custom card of your choice! Check in [ansi(gD,+TT/Help Custom)] for more information.%r%r,|)]%r+[repeat(-,78)]+%r
  395. &TT`HELP`WALL Triple Triad Global=$+TT/Help Wall:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Help - Wall Rule)],|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rThe Wall rule is an extension of the Same rule. In fact\, you cannot play the Wall rule without the Same rule.%r%rImagine that outside of the grid of 9 cards\, there are invisible cards with all 'A' stats. You can trigger a Same rule by using this fact. 'A' being the highest value for cards\, it sacrifices the strongest 'Attack' power to setup a combination instead. This is a tactical choice\, obviously.%r%r,|)]%r[align(1. 7 7 60 1.,|,[ansi(wB,+-----+%r|%b%bA%b%b|%r|%b7%b6%b|%r|%b%b2%b%b|%r+-----+%r)]%r,[ansi(hwR,+-----+%r|%b%b5%b%b|%r|%b6%b3%b|%r|%b%b4%b%b|%r+-----+%r)],As seen in the Same Rule\, normally you need two cards to setup a Same\, but with the Wall rule\, only one card of the opposing color is required\, along with making the 'A' value face the outside of the field. Here\, the 'A' is facing up\, while the '6' are opposing each other\, creating a "Same Wall" combination.%r%r,|)]%r+[repeat(-,78)]+%r
  396. &TT`HELP`WIZARD Triple Triad Global=$+TTW/Help:@assert u(%#/TT`WIZARD) ; @pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad Wizard)],|)]%r+[repeat(-,78)]+%r[align(1. 76 1.,|,%rThese commands are accessible only to appointed 'wizards' of Triple Triad. If you can see this help file\, obviously you're good!%r%r,|)]%r+[repeat(-,78)]+%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TTW/Points Add/Rem <Name>=<Amount>)]%r,%b,%rAdds or Removes points from the player's total. This is mainly used after the creation of Custom cards\, removing the amount of points. Adding points can be in the case of RP rewards as well.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TTW/Card Add/Rem <Name>=<Card>)]%r,%b,%rAdds or Removes cards from <Name>'s stash. This does not break the usual maximum limits for that level\, and cannot go lower than 0 either. Mostly used for custom card acquisition or RP rewards.%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TTW/Card New <Set>/<Name>=<Stats>)]%r,%b,%rCreates a custom card\, adding it to the database. The set is the series it eblongs to. The <Level> is 1 to 10. The <Stats> to be entered are\, in order : %r%rUp Left Right Down Elemental Level%r%rEnter the stats as 1-10\, do not enter "A" instead of 10.%r%rExample :%r[ansi(yD,+TT/Card new 3=4 5 6 7 Lightning Creeps)]%r,|)]%r[align(1. 20 1 53 1.,|,%r[ansi(gD,+TTW/Series New %r<ID>/<Name>=%r<Rand>\,<Single>\,%r<Max>)]%r,%b,%rInitializes a new Series/Set. The ID is only one letter and cannot be 0. The name is a simple description of it\, the title of the series. <Rand> is the cost to buy random cards\, and <Single> is the cost for buying specific. You can set it as '0' to disable either. Max is the amount of each card is allowed to carry\, per level. %rStandard is [ansi(cD,9 9 7 7 5 5 3 3 1 1)].%r,|)]%r+[repeat(-,78)]+%r
  397. &TT`PLAY Triple Triad Global=
  398. &TT`PLAY`COMBO Triple Triad Global=th [setq(ID,%0,PCol,%1)][setq(Combo,u(TT`GAME`%q<ID>`COMBO))][setq(Rules,u(TT`GAME`%q<ID>`RULES))][setq(CCard,extract(%q<Combo>,1,1,%b))][setq(POSX,div(dec(%q<CCard>),3),POSY,inc(mod(dec(%q<CCard>),3)))][setq(POS,u(TT`FNC`FINDPOS,%q<POSX>,%q<POSY>))] ; @include/nobreak me/TT`PLAY`POS=%q<ID>,%q<CCard>,%q<PCol>,0 ; th [setq(Combo,u(TT`GAME`%q<ID>`COMBO))] ; &TT`GAME`%q<ID>`COMBO me=[extract(%q<Combo>,2,8,%b)] ; @retry [gt(words(%q<Combo>,%b),0)] ; @wipe me/TT`GAME`%q<ID>`COMBO
  399. &TT`PLAY`GT Triple Triad Global=th [setq(POSX2,extract(%1,1,1,`),POSY2,extract(%1,2,1,`))][setq(POS2,u(TT`FNC`FINDPOS,%q<POSX2>,%q<POSY2>))][setq(Card2,extract(%q<Grid>,%q<POS2>,1),Color2,extract(%q<Color>,%q<POS2>,1))] ; @break or(match(%q<Color1>,%q<Color2>),match(%q<Card2>,0000),match(%q<Card2>,0002),match(%q<Card2>,0001)) ; th [setq(Check1,u(me/TT`FNC`POS`COMP,%q<POSX1>,%q<POSX2>,%q<POSY1>,%q<POSY2>))][setq(Stats2,u(me/TT`DATA`%q<Card2>`STAT))][setq(CStats1,extract(%q<Stats1>,1,4),CStats2,extract(%q<Stats2>,1,4))][setq(GElem1,extract(%q<Elem>,%q<POS1>,1),GElem2,extract(%q<Elem>,%q<POS2>,1),CElem1,extract(%q<Stats1>,5,1),CElem2,extract(%q<Stats2>,5,1))][setq(CStats1,switch(%q<GElem1>,None,%q<Cstats1>,%q<CElem1>,vadd(1 1 1 1,%q<Cstats1>),vsub(1 1 1 1,%q<Cstats1>)),CStats2,switch(%q<GElem2>,None,%q<Cstats2>,%q<CElem2>,vadd(%q<Cstats2>,1 1 1 1),vsub(%q<Cstats2>,1 1 1 1)))][setq(CStats1,vmin(%q<CStats1>,10 10 10 10),CStats2,vmin(%q<CStats2>,10 10 10 10))][setq(CStats1,vmax(%q<CStats1>,1 1 1 1),CStats2,vmax(%q<CStats2>,1 1 1 1))][switch(gt(extract(%q<CStats1>,switch(%q<Check1>,UD,1,DU,4,RL,3,LR,2),1),extract(%q<CStats2>,switch(%q<Check1>,UD,4,DU,1,RL,2,LR,3),1)),1,[setq(Color,replace(%q<Color>,%q<POS2>,%q<Color1>,%b))][setq(Combo,switch(%2,0,insert(%q<Combo>,-1,u(TT`FNC`FINDNUM,%q<POS2>),%b),%q<Combo>))])]
  400. &TT`PLAY`PLUS Triple Triad Global=@break match(%1,%2) ; th [setq(POSX2,extract(%1,1,1,`),POSY2,extract(%1,2,1,`),POSX3,extract(%2,1,1,`),POSY3,extract(%2,2,1,`))][setq(POS2,u(TT`FNC`FINDPOS,%q<POSX2>,%q<POSY2>))][setq(Card2,extract(%q<Grid>,%q<POS2>,1),Color2,extract(%q<Color>,%q<POS2>,1))][setq(POS3,u(TT`FNC`FINDPOS,%q<POSX3>,%q<POSY3>))][setq(Card3,extract(%q<Grid>,%q<POS3>,1))] ; @break or(match(%q<Color1>,%q<Color2>),match(%q<Card2>,0000),match(%q<Card3>,0000),match(%q<Card2>,0002),match(%q<Card3>,0002),match(%q<Card2>,0001),match(%q<Card3>,0001)) ; th [setq(Check1,u(me/TT`FNC`POS`COMP,%q<POSX1>,%q<POSX2>,%q<POSY1>,%q<POSY2>),Check2,u(me/TT`FNC`POS`COMP,%q<POSX1>,%q<POSX3>,%q<POSY1>,%q<POSY3>))][setq(Stats2,u(me/TT`DATA`%q<Card2>STAT),Stats3,u(me/TT`DATA`%q<Card3>`STAT))][switch(match(add(extract(%q<Stats1>,switch(%q<Check1>,UD,1,DU,4,RL,3,LR,2),1),extract(%q<Stats2>,switch(%q<Check1>,UD,4,DU,1,RL,2,LR,3),1)),add(extract(%q<Stats1>,switch(%q<Check2>,UD,1,DU,4,RL,3,LR,2),1),extract(%q<Stats3>,switch(%q<Check2>,UD,4,DU,1,RL,2,LR,3),1)))),1,[setq(Color,replace(%q<Color>,%q<POS2>,%q<Color1>,%b))][setq(Combo,insert(%q<Combo>,-1,u(TT`FNC`FINDNUM,%q<POS2>),%b))])]
  401. &TT`PLAY`POS Triple Triad Global=th [setq(ID,%0)][setq(POSX1,div(dec(%1),3),POSY1,inc(mod(dec(%1),3)))][setq(POS1,u(TT`FNC`FINDPOS,%q<POSX1>,%q<POSY1>))][setq(Grid,u(me/TT`GAME`%q<ID>`GRID),Color,u(me/TT`GAME`%q<ID>`GRIDC),Elem,u(me/TT`GAME`%q<ID>`ELEM),Rules,u(me/TT`GAME`%q<ID>`RULES),Combo,u(me/TT`GAME`%q<ID>`COMBO))] ; th [setq(Card1,extract(%q<Grid>,%q<POS1>,1),Color1,extract(%q<Color>,%q<POS1>,1),Elem1,extract(%q<Elem>,%q<POS1>,1))][setq(Stats1,u(me/TT`DATA`%q<Card>`STAT))][setq(List,[inc(%q<POSX>)]`%q<POSY> [dec(%q<POSX1>)]`%q<POSY1> %q<POSX1>`[inc(%q<POSY1>)] %q<POSX1>`[dec(%q<POSY1>)])] ; @switch/inline and(switch(match(%q<Rules>,Same),>0,1,0),%3)=1,@dolist/inline %q<List>={ @dolist/inline %q<List>={ @include/nobreak me/TT`PLAY`SAME=%0,%i1,%i0 } } ; @switch/inline and(switch(match(%q<Rules>,Plus),>0,1,0),%2)=1,@dolist/inline %q<List>={ @dolist/inline %q<List>={ @include/nobreak me/TT`PLAY`PLUS=%0,%i1,%i0 } } ; @dolist/inline %q<List>={ @include/nobreak me/TT`PLAY`GT=%0,%i0,%3 } ; &TT`GAME`%q<ID>`GRIDC me=%q<Color> ; &TT`GAME`%q<ID>`COMBO me=[trim(%q<Combo>,%b)]
  402. &TT`PLAY`SAME Triple Triad Global=@break match(%1,%2) ; th [setq(POSX2,extract(%1,1,1,`),POSY2,extract(%1,2,1,`),POSX3,extract(%2,1,1,`),POSY3,extract(%2,2,1,`))][setq(POS2,u(TT`FNC`FINDPOS,%q<POSX2>,%q<POSY2>))][setq(Card2,extract(%q<Grid>,%q<POS2>,1),Color2,extract(%q<Color>,%q<POS2>,1))][setq(POS3,u(TT`FNC`FINDPOS,%q<POSX3>,%q<POSY3>))][setq(Card3,extract(%q<Grid>,%q<POS3>,1))] ; @break or(match(%q<Color1>,%q<Color2>),match(%q<Card2>,0000),match(%q<Card3>,0000)) ; th [setq(Check1,u(me/TT`FNC`POS`COMP,%q<POSX1>,%q<POSX2>,%q<POSY1>,%q<POSY2>),Check2,u(me/TT`FNC`POS`COMP,%q<POSX1>,%q<POSX3>,%q<POSY1>,%q<POSY3>))][setq(Stats2,u(me/TT`DATA`%q<Card2>`STAT),Stats3,u(me/TT`DATA`%q<Card3>`STAT))][switch(and(match(extract(%q<Stats1>,switch(%q<Check1>,UD,1,DU,4,RL,3,LR,2),1),extract(%q<Stats2>,switch(%q<Check1>,UD,4,DU,1,RL,2,LR,3),1)),match(extract(%q<Stats1>,switch(%q<Check2>,UD,1,DU,4,RL,3,LR,2),1),extract(%q<Stats3>,switch(%q<Check2>,UD,4,DU,1,RL,2,LR,3),1))),1,[setq(Color,replace(%q<Color>,%q<POS2>,%q<Color1>,%b))][setq(Combo,insert(%q<Combo>,-1,u(TT`FNC`FINDNUM,%q<POS2>),%b))])]
  403. &TT`WIZARD Triple Triad Global=TestWiz
  404.  
  405.  
  406. =======================
  407. Card Shop
  408. =======================
  409. There is a global reference at the begning.
  410.  
  411. @@ Card Shop (#288)
  412. @create Card Shop
  413. @link Card Shop = #314
  414. @set Card Shop = TRUST
  415. @set Card Shop = WIZARD
  416. &TT`GLOBAL Card Shop=#300
  417. &DESCRIBE Card Shop=%r%tA small stand placed in the middle of Serendipity, but a flashy one no less. The Triple Triad Card Shop has setup here, with a display of many cards, rare and commons, for everyone to glance at and buy. They have a book on the counter, where you can see the list of all of the existing cards, wether its normal cards, promos, or rare cards.%r%rThey also have a photobooth setup on the side of it, so you can get your picture done if you want to create your very own Custom Card! Find the information on how to buy cards or see the list by typing [ansi(gD,+TT/Help Shop)].
  418. @set Card Shop/DESCRIBE=no_command visual prefixmatch public nearby
  419. &TT Card Shop=
  420. &TT`CMD Card Shop=
  421. &TT`CMD`BUY Card Shop=$+TT/Buy Card=*:th [setq(Data,firstof(switch(hasattr(v(TT`GLOBAL),TT`DATA`%0),1,TT`DATA`%0,0),wildgrepi(v(TT`GLOBAL),TT`DATA`*,%0)))] ; @assert %q<Data>=@pemit %#=[ansi(rD,Triple Triad)] - There are no cards with this name. ; th [setq(ID,extract(%q<Data>,3,1,`))][setq(Set,left(%q<ID>,1),Nb,right(%q<ID>,3))][setq(Cards,u(%#/TT`CARDS`%q<Set>),LV,extract(u(v(TT`GLOBAL)/TT`DATA`%q<ID>`STAT),6,1))][setq(Cost,mul(%q<LV>,u(v(TT`GLOBAL)/TT`DATA`COST`%q<Set>`SING)),Points,extract(u(%#/TT`STATS),12,1),Max,extract(u(v(TT`GLOBAL)/TT`DATA`MAX`%q<Set>),%q<LV>,1),CardNum,extract(%q<Cards>,%q<Nb>,1))] ; @break match(%q<Cost>,0)=@pemit %#=[ansi(rD,Triple Triad)] - You cannot buy specific cards from this series. ; @assert gte(%q<Points>,%q<Cost>)=@pemit %#=[ansi(rD,Triple Triad)] - You don't have enough points for this. You have %q<Points> left. ; @break gt(inc(%q<CardNum>),%q<Max>)=@pemit %#=[ansi(rD,Triple Triad)] - You already have the maximum amount allowed for this card. ; &TT`CARDS`%q<Set> %#=[replace(%q<Cards>,%q<Nb>,inc(%q<CardNum>))] ; @include v(TT`GLOBAL)/TT`FNC`CHECKSTASH=%# ; &TT`STATS %#=[setq(Stats,u(%#/TT`STATS))][replace(%q<Stats>,12,sub(extract(%q<Stats>,12,1),%q<Cost>))] ; @pemit %#=[ansi(gD,Triple Triad)] - You have bought a [u(v(TT`GLOBAL)/TT`DATA`%q<ID>)] card!
  422. &TT`CMD`BUY`RANDOM Card Shop=$+TT/Buy Random=*/*: @assert match(u(v(TT`GLOBAL)/TT`DATA`SETS),%0)=@pemit %#=[ansi(rD,Triple Triad)] - This card series is invalid. ; th [setq(Cost,mul(%1,u(v(TT`GLOBAL)/TT`DATA`COST`%0`RAND)),Points,extract(u(%#/TT`STATS),12,1))] ; @break match(%q<Cost>,0)=@pemit %#=[ansi(rD,Triple Triad)] - You cannot buy random cards from this series. ; @assert gte(%q<Points>,%q<Cost>)=@pemit %#=[ansi(rD,Triple Triad)] - You don't have enough points for this. You have %q<Points> left. ; @assert match(lnum(1,10),%1)=@pemit %#=[ansi(rD,Triple Triad)] - You must specify a card Level between 1 and 10. ; @include v(TT`GLOBAL)/TT`FNC`RANDCARD=%#,%0,%1,0 ; &TT`STATS %#=[setq(Stats,u(%#/TT`STATS))][replace(%q<Stats>,12,sub(extract(%q<Stats>,12,1),%q<Cost>))] ; &TT`STATS %#=[setq(Stats,u(%#/TT`STATS))][replace(%q<Stats>,10,inc(extract(%q<Stats>,10,1)))] ; @include me/TT`FNC`CHECKSTASH=%# ; @pemit %#=[ansi(gD,Triple Triad)] - You have bought a Level %1 card from the [ucstr(%0)] series for %q<Cost> points. You have received : %q<Name>
  423. &TT`CMD`CARD Card Shop=
  424. &TT`CMD`CARD`LIST Card Shop=$+TT/List:@pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad - Set List)],|)]%r+[repeat(-,78)]+%r[align(1. 4 3 25 >15 >25 1.,|,%b,%r%b[iter(u(v(TT`GLOBAL)/TT`DATA`SETS),[ansi(gD,%i0)]%r)]%r,%r%b[iter(u(v(TT`GLOBAL)/TT`DATA`SETS),[u(v(TT`GLOBAL)/TT`DATA`SET`%i0)]%r)]%r,%r%b[iter(u(v(TT`GLOBAL)/TT`DATA`SETS),[setq(Count,0)][trim(iter(u(%#/TT`CARDS`%i0),setq(Count,switch(%i0,>0,inc(%q<Count>),%q<Count>))))][ansi(hrD,%q<Count>/[nattr(v(TT`GLOBAL)/TT`DATA`%i0*`STAT)])] Cards%r)]%r,%r%b[iter(u(v(TT`GLOBAL)/TT`DATA`SETS),[setq(Rand,u(v(TT`GLOBAL)/TT`DATA`COST`%i0`RAND),Sing,u(v(TT`GLOBAL)/TT`DATA`COST`%i0`SING))][ansi(cD,[switch(%q<Rand>,0,--,%q<Rand>)]/[switch(%q<Sing>,0,--,%q<Sing>)])] Points x Level%r)]%r,|)]%r+[repeat(-,78)]+%r[align(1 -76 1,|,Use [ansi(gD,+TT/List <Set>/<Level or All>)]   to view the set by level.,|)]%r+[repeat(-,78)]+
  425. &TT`CMD`CARD`LIST2 Card Shop=$+TT/List */*:th [setq(Set,ucstr(%0),Level,extract(%1,1,1),Page,extract(%1,2,1))] ; @include me/TT`FNC`CARD`LIST=[switch(%q<Page>,,1,%q<Page>)]
  426. &TT`CMD`CUSTOM Card Shop=$+TT/Custom */*=*:@include v(TT`GLOBAL)/TT`FNC`CHECKSTASH=%# ; th [setq(Cost,div(mul(%1,u(v(TT`GLOBAL)/TT`DATA`COST`X`SING)),2),Points,extract(u(%#/TT`STATS),12,1))][setq(Data,trim(%2))][setq(Up,extract(%q<Data>,1,1),Down,extract(%q<Data>,2,1),Left,extract(%q<Data>,3,1),Right,extract(%q<Data>,4,1),Elem,extract(%q<Data>,5,1))] ; @assert gte(%q<Points>,%q<Cost>)=@pemit %#=[ansi(rD,Triple Triad)] - You don't have enough points for this. You need %q<Cost> points, and you have %q<Points> points left. ; @break firstof(switch(hasattr(v(TT`GLOBAL),TT`DATA`%0),1,TT`DATA`%0,0),wildgrepi(v(TT`GLOBAL),TT`DATA`*,%0))=@pemit %#=[ansi(rD,Triple Triad)] - There is already a card by this name. ; th [setq(Min,extract(10 12 14 16 18 20 22 24 24 26,%1,1),Max,extract(13 15 17 19 21 23 25 26 27 29,%1,1))] ; @assert gt(add(%q<Up>,%q<Left>,%q<Right>,%q<Down>),%q<Min>)=@pemit %#=[ansi(rD,Triple Triad)] - Your total of points is too low for the level %0. The total points should be between %q<Min> and %q<Max>. ; @assert lt(add(%q<Up>,%q<Left>,%q<Right>,%q<Down>)=@pemit %#=[ansi(rD,Triple Triad)] - Your total of points is too high for the level %0. The total points should be between %q<Min> and %q<Max>. ; @assert and(isnum(%q<Up>),isnum(%q<Left>),isnum(%q<Right>),isnum(%q<Down>))=@pemit %#=[ansi(rD,Triple Triad)] - Only numbers are allowed. Don not use 'A' instead of '10'. ; @assert match(Lightning Fire Ice Water Earth Wind Poison Holy None,%q<Elem>)=@pemit %#=[ansi(rD,Triple Triad)] - Invalid Elemental. Make sure you only use one of the following : [ansi(gD,Lightning Fire Ice Water Wind Earth Poison Holy None)] ; th [setq(CMax,inc(nattr(v(TT`GLOBAL)/TT`DATA`X*`STAT)))][setq(ID,X[repeat(0,sub(3,strlen(%q<CMax>)))]%q<CMax>)] ; &TT`DATA`%q<ID> v(TT`GLOBAL)=%0 ; &TT`DATA`%q<ID>`STAT v(TT`GLOBAL)=%q<Up> %q<Left> %q<Right> %q<Down> %q<Elem> %1 ; &TT`CARDS`X %#=insert(u(%#/TT`CARDS`X),-1,1,%b) ; &TT`STATS %#=[setq(Stats,u(%#/TT`STATS))][replace(%q<Stats>,12,sub(extract(%q<Stats>,12,1),%q<Cost>))] ; @pemit %#=+[repeat(-,55)]+%r[align(1. -53 1.,|,[ansi(gD,Triple Triad)],|)]%r+[repeat(-,55)]+%r[align(1. -20 1 30 1.,|,u(v(TT`GLOBAL)/TT`DECK`DRAW`CARD,%q<ID>,B,None,0),,%rYou have created and received a new Custom Card!,|)]%r+[repeat(-,55)]+%r
  427. &TT`FNC Card Shop=
  428. &TT`FNC`CARD Card Shop=
  429. &TT`FNC`CARD`LIST Card Shop=@assert match(u(v(TT`GLOBAL)/TT`DATA`SETS),%q<Set>)=@pemit %#=[ansi(rD,Triple Triad)] - There are no series with that name. ; @assert or(match(%q<Level>,All),match(lnum(1,10),%q<Level>))=@pemit %#=[ansi(rD,Triple Triad)] - The level must be between 1 and 10, or All. ; th [trim(iter(lnum(1,nattr(v(TT`GLOBAL)/TT`DATA`%q<Set>*`STAT)),[setq(ID,%q<Set>[repeat(0,sub(3,strlen(%i0)))]%i0)][setq(LV,extract(u(v(TT`GLOBAL)/TT`DATA`%q<ID>`STAT),6,1))][switch(or(match(%q<level>,All),match(%q<LV>,%q<Level>)),1,setq(CardList,insert(%q<CardList>,-1,%q<ID>)))]))][setq(NCard,words(%q<CardList>))][setq(S,mul(dec(%0),15))] ; @assert gte(%q<NCard>,inc(%qS)) ; @pemit %#=+[repeat(-,78)]+%r[align(1 -76 1,|,[ansi(gD,Triple Triad - Card Shop List - Level [%q<Level>] - Page %0 )],|)]%r+[repeat(-,78)]+%r[u(v(TT`GLOBAL)/TT`FNC`SHOW`DETAIL)]%r[switch(%q<NCard>,>[add(15,%qS)],[align(1 -76 1,|,Continued in [ansi(gD,+TT/List %q<Set>/%q<Level> [inc(%0)])],|)]%r+[repeat(-,78)]+%r)]