User:Sean

From TowersWiki

pose code

&CMD.POSE me=$+pose *:@emit subeval([setq(1,get(me/color.highlight))][setq(0,get(me/color.normal))][r(0)]%n [edit(%0,%th,r(1),%tn,r(0))])
&CMD.EMIT me=$+emit *:@emit subeval([setq(1,get(me/color.highlight))][setq(0,get(me/color.normal))][r(0)]%t[edit(%0,%th,r(1),%tn,r(0))])
&COLOR.NORMAL me=%x<0 180 0>
&COLOR.HIGHLIGHT me=%x<0 255 0>

Tarot Deck Code

@create Tarot Deck=10
&CMD.SHUFFLE Tarot Deck=$+tarot/shuffle:&var.state me=[shuffle(u(var.cards.[u(var.deck.type)]),|,|)];@pemit %#=You shuffle your Tarot Deck;&var.drawn me=;&var.shown me=;@if [u(fnc.reading)]={@force [owner(me)]=@pemit [u(reading_for)]=%n shuffles %p Tarot Deck}
&VAR.STATE Tarot Deck=23:The Two of Pentacles|51:The Two of Wands|18:The Moon|38:The Three of Cups|6:The Lovers|71:The Eight of Swords|75:The Knight of Swords|43:The Eight of Cups|14:Art|69:The Six of Swords|39:The Four of Cups|22:The Ace of Pentacles|46:The Page of Cups|4:The Emperor|54:The Five of Wands|60:The Page of Wands|12:The Hanged Man|41:The Six of Cups|15:The Devil|53:The Four of Wands|7:The Chariot|9:The Hermit|28:The Seven of Pentacles|24:The Three of Pentacles|45:The Ten of Cups|3:The Empress|21:The Universe|65:The Two of Swords|59:The Ten of Wands|36:The Ace of Cups|52:The Three of Wands|37:The Two of Cups|27:The Six of Pentacles|49:The King of Cups|11:Lust|29:The Eight of Pentacles|62:The Queen of Wands|64:The Ace of Swords|73:The Ten of Swords|47:The Knight of Cups|42:The Seven of Cups|48:The Queen of Cups|8:Ajdustment|2:The Priestess|66:The Three of Swords|72:The Nine of Swords|77:The King of Swords|33:The Knight of Pentacles|70:The Seven of Swords|5:The Heirophant|74:The Page of Swords|58:The Nine of Wands|32:The Page of Pentacles|40:The Five of Cups|35:The King of Pentacles|17:The Star|0:The Fool|76:The Queen of Swords|20:The Aeon|50:The Ace of Wands|57:The Eight of Wands|19:The Sun|44:The Nine of Cups|30:The Nine of Pentacles|34:The Queen of Pentacles|1:The Magus|16:The Tower|31:The Ten of Pentacles|10:The Wheel of Fortune|13:Death|56:The Seven of Wands|25:The Four of Pentacles|61:The Knight of Wands|68:The Five of Swords|63:The King of Wands|67:The Four of Swords|26:The Five of Pentacles|55:The Six of Wands
&CMD.DRAW Tarot Deck=$+tarot/draw:th [pemit(%#,You draw a card and place it face down in front of you)][u(fnc.draw.card)];@if [u(fnc.reading)]={@force [owner(me)]=@pemit [u(reading_for)]=%n draws a card and places it down in front of %o}
&FNC.DRAW.CARD Tarot Deck=[setr(0,extract(extract(setr(1,u(var.state)),1,1,|),2,1,:))][set(me,var.state:[ldelete(%q1,1,|,|)])][set(me,var.drawn:[setunion(u(var.drawn),%q0,|,|)])]
&CMD.DRAW.MULTIPLE Tarot Deck=$+tarot/draw *:th [pemit(%#,You draw [if(lt(1,%0),%0,a)] card[if(lt(1,%0),s)] and place [if(lt(1,%0),them,it)] face down in front of you)][iter(lnum(%0),u(fnc.draw.card))];@if [u(fnc.reading)]={@force [owner(me)]=@pemit [u(reading_for)]=%n draws [if(lt(1,%0),%0,a)] card[if(lt(1,%0),s)] and places [if(lt(1,%0),them,it)] down in front of %o}
&CMD.REVEAL Tarot Deck=$+tarot/reveal:th [setr(0,words(u(var.drawn),|))][setr(1,add(mod(u(var.shown),%q0),1))][set(me,var.shown:%q1)][pemit(%#,The card in position %q1 of %q0 is [extract(u(var.drawn),%q1,1,|)])];@if [u(fnc.reading)]={@force [owner(me)]=@pemit [u(reading_for)]=The card in position [setr(1,u(var.shown))] of [words(u(var.drawn))] is [extract(u(var.drawn),%q1,1,|)]}
&CMD.SPREAD.RESET Tarot Deck=$+tarot/resetSpread:&VAR.SHOWN me=;@pemit %#=You reset the reveal to the first card.
&CMD.REVEAL_N Tarot Deck=$+tarot/reveal *:th [setr(0,words(u(var.drawn),|))][pemit(%#,The card in position %0 of %q0 is [extract(u(var.drawn),%0,1,|)])][case(1,t(u(reading_for)),pemit(num(u(reading_for)),The card in position %0 of %q0 is [extract(u(var.drawn),%0,1,|)]))];@if [u(fnc.reading)]={@force [owner(me)]=@pemit [u(reading_for)]=The card in position %0 of [words(u(var.drawn))] is [extract(u(var.drawn),%0,1,|)]}
&CMD.READ.FOR Tarot Deck=$+tarot/read *:@assert comp(loc(*%0),#-1)={@pemit %#=%0 is not in the room.};@pemit %#=You start a reading for %0;@force [owner(me)]={@pemit [num(*%0)]=%n starts a reading for you.};&reading_for me=[num(*%0)]
&CMD.TAROT.DONE Tarot Deck=$+tarot/done:@pemit %#=You finish your reading for [name(u(reading_for))];&reading_for me=;
&FNC.READING Tarot Deck=[and(t(u(reading_for)),t(comp(u(reading_for), owner(me))))]
@Desc Tarot Deck=%xh[name(owner(me))]'s Tarot Deck%xn%r%rThis object represents, in a very rudamentary manner, a tarot deck and the mechanism for reading it for someone.%r%r%xhCommands:%xn%r%r%xh+tarot/read <person's name>%xn This command sets the person to be the subject of the reading. They will receive notifications of your interactions with the deck, that you shuffle it or lay a card or cards down and what those cards are when you reveal them. This command only works if they are in the same room as you owing to the limitations of @pemit%r%xh+tarot/shuffle%xn At a very high level, this command shuffles the tarot deck. What it really does is shuffle a list of number:string paired values and stores those to the state variable which is then queried for drawing. Any time you shuffle, the untouched raw data is reshuffled and stored in the state variable again.%r%xh+tarot/draw <n>%xn This command slices off the first or nth first card(s) and places them into the drawn variable.%r%xh+tarot/reveal%xn This command reveals the next card in the revealed cards pile. It loops to the first if you reveal the last.%r%xh+tarot/reveal <i>%xn This command reveals a specific card in the list.%r%xh+tarot/done%xn This command stops the reading for a given person and so stops sending them update messages
&VAR.CARDS.THOTH Tarot Deck=0:The Fool|1:The Magus|2:The Priestess|3:The Empress|4:The Emperor|5:The Heirophant|6:The Lovers|7:The Chariot|8:Ajdustment|9:The Hermit|10:The Wheel of Fortune|11:Lust|12:The Hanged Man|13:Death|14:Art|15:The Devil|16:The Tower|17:The Star|18:The Moon|19:The Sun|20:The Aeon|21:The Universe|22:The Ace of Pentacles|23:The Two of Pentacles|24:The Three of Pentacles|25:The Four of Pentacles|26:The Five of Pentacles|27:The Six of Pentacles|28:The Seven of Pentacles|29:The Eight of Pentacles|30:The Nine of Pentacles|31:The Ten of Pentacles|32:The Page of Pentacles|33:The Knight of Pentacles|34:The Queen of Pentacles|35:The King of Pentacles|36:The Ace of Cups|37:The Two of Cups|38:The Three of Cups|39:The Four of Cups|40:The Five of Cups|41:The Six of Cups|42:The Seven of Cups|43:The Eight of Cups|44:The Nine of Cups|45:The Ten of Cups|46:The Page of Cups|47:The Knight of Cups|48:The Queen of Cups|49:The King of Cups|50:The Ace of Wands|51:The Two of Wands|52:The Three of Wands|53:The Four of Wands|54:The Five of Wands|55:The Six of Wands|56:The Seven of Wands|57:The Eight of Wands|58:The Nine of Wands|59:The Ten of Wands|60:The Page of Wands|61:The Knight of Wands|62:The Queen of Wands|63:The King of Wands|64:The Ace of Swords|65:The Two of Swords|66:The Three of Swords|67:The Four of Swords|68:The Five of Swords|69:The Six of Swords|70:The Seven of Swords|71:The Eight of Swords|72:The Nine of Swords|73:The Ten of Swords|74:The Page of Swords|75:The Knight of Swords|76:The Queen of Swords|77:The King of Swords
&VAR.CARDS.STANDARD Tarot Deck=0:The Fool|1:The Magician|2:The High Priestess|3:The Empress|4:The Emperor|5:The Heirophant|6:The Lovers|7:The Chariot|8:The Justice|9:The Hermit|10:The Wheel of Fortune|11:Strength|12:The Hanged Man|13:Death|14:Temperance|15:The Devil|16:The Tower|17:The Star|18:The Moon|19:The Sun|20:Judgement|21:The World|22:The Ace of Pentacles|23:The Two of Pentacles|24:The Three of Pentacles|25:The Four of Pentacles|26:The Five of Pentacles|27:The Six of Pentacles|28:The Seven of Pentacles|29:The Eight of Pentacles|30:The Nine of Pentacles|31:The Ten of Pentacles|32:The Page of Pentacles|33:The Knight of Pentacles|34:The Queen of Pentacles|35:The King of Pentacles|36:The Ace of Cups|37:The Two of Cups|38:The Three of Cups|39:The Four of Cups|40:The Five of Cups|41:The Six of Cups|42:The Seven of Cups|43:The Eight of Cups|44:The Nine of Cups|45:The Ten of Cups|46:The Page of Cups|47:The Knight of Cups|48:The Queen of Cups|49:The King of Cups|50:The Ace of Wands|51:The Two of Wands|52:The Three of Wands|53:The Four of Wands|54:The Five of Wands|55:The Six of Wands|56:The Seven of Wands|57:The Eight of Wands|58:The Nine of Wands|59:The Ten of Wands|60:The Page of Wands|61:The Knight of Wands|62:The Queen of Wands|63:The King of Wands|64:The Ace of Swords|65:The Two of Swords|66:The Three of Swords|67:The Four of Swords|68:The Five of Swords|69:The Six of Swords|70:The Seven of Swords|71:The Eight of Swords|72:The Nine of Swords|73:The Ten of Swords|74:The Page of Swords|75:The Knight of Swords|76:The Queen of Swords|77:The King of Swords
&VAR.DECK.TYPE Tarot Deck=thoth
&CMD.DECK.SET Tarot Deck=$+tarot/deck *:@assert [match(thoth standard, lcstr(%0))]={@pemit %#=Only %xhThoth%xn and %xhStandard%xn type decks currently implemented};@pemit %#=You set the deck to %0;&var.deck.type me=%0
&VAR.SHOWN Tarot Deck=1
@set Tarot Deck=INHERIT
@set Tarot Deck=VISUAL
@rxlevel Tarot Deck= Real
@txlevel Tarot Deck= Real