Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on *:text:.ldrules:#: {
- notice $nick Each player has two choices during his turn: make a higher bid, or challenge the previous bid as being wrong. The player may bid an increased quantity of any face, or the same quantity of a higher face.
- notice $nick If the current player thinks the previous player's bid is wrong, he challenges it, and then all dice are revealed to determine whether the bid was valid. If the number of the relevant face revealed is at least as high as the bid, then the bid is valid, in which case the bidder wins.
- notice $nick Commands:
- notice $nick 12.ldstart: start a new game.
- notice $nick 12.ldjoin: join a game that is in the signups phase.
- notice $nick 12.ldbid <quantity> <face>: make a bid.
- notice $nick 12.ldbs: call the current bidder a liar.
- notice $nick 12.ldspot: challenge the bid as spot-on.
- notice $nick 12.ldinfo: get info on the current game.
- notice $nick 12.lddice: get your dice rolls resent to you.
- if ($findtok($enders,$nick,32)) {
- notice $nick Administrator Commands:
- notice $nick 07.ldskip: end the signups phase.
- notice $nick 07.ldend: completely end the game.
- notice $nick 07.ldadd: adds a player to the game.
- }
- }
- alias enders return Charmander Mafe ShakeItUp quinn Engineer
- on *:text:.ldskip:#: {
- if (%ld.round != on && %ldld == on && $findtok($enders,$nick,32)) {
- .timer* off
- trans
- }
- }
- on *:text:.ldstart:#: {
- set %ldchan #
- if (%ldld != on) {
- set %ldld on
- msg # A Liar's Dice game was started by $+(12,$nick,,.) To join, type 12.ldjoin.
- msg # Signups end in 1230 seconds!
- .timer 1 30 trans
- addplayer
- }
- else msg # There is already a game going on!
- }
- alias trans {
- if ($numtok(%ld.players,32) >= 2) {
- set %ld.round on
- set %ld.it $gettok(%ld.players,$r(1,$numtok(%ld.players,32)),32)
- msg %ldchan Time has ended or the signups phase was skipped, and it is time to bid! $+(12,%ld.it,,) will go first!
- }
- else {
- msg %ldchan Not enough players! Game over.
- unset %ld*
- halt
- }
- tokenize 32 %ld.players
- var %ld.count 1
- while ($0 >= %ld.count) {
- notice $ [ $+ [ %ld.count ] ] Your dice rolls are $+(12,%ld.dice [ $+ [ $ [ $+ [ %ld.count ] ] ] ],,.)
- inc %ld.count
- }
- msg %ldchan To bid, type 12.ldbid <quantity> <face>.
- }
- on *:text:.ldjoin:#:if (!%ld.round && !$findtok(%ld.players,$nick,32) && %ldld == on) addplayer
- on $*:text:/^(\.ldbid (\d|\d\d) \d)$/Si:#: {
- if ((%ld.it == $nick) && (%ld.round == on) && ((!%ld.bid) || ($2 >= $gettok(%ld.bid,1,32) && $3 > $gettok(%ld.bid,2,32)) || ($2 > $gettok(%ld.bid,1,32) && $3 <= $gettok(%ld.bid,2,32)))) {
- set %ld.bid $2 $3
- set %ld.person $nick
- set %ld.lie $iif($findtok(%ld.total,$3,0,32) >= $2,true,false)
- msg # $+(12,$nick,) claims there are $+(12,$2,) dice numbered $+(12,$3,,!)
- setturn
- }
- }
- on *:text:.ldbs:#: {
- if (%ld.person != $nick && %ld.person && %ld.it == $nick && %ld.round == on) {
- set %ld.winner $iif(%ld.lie == false,$nick,%ld.person)
- msg # $+(12,%ld.winner,) wins the round!
- inc %ld2. [ $+ [ %ld.winner ] ]
- var %ld.count 1
- while (%ld.count <= $var(%ld2.*,0)) {
- set %ld.score %ld.score $+(12,$right($($var(%ld2.*,%ld.count).name),-5),,:,$chr(32),07,$var(%ld2.*,%ld.count).value,)
- inc %ld.count
- }
- msg # %ld.score
- inc %ld3
- if (%ld2. [ $+ [ %ld.winner ] ] == 5) {
- msg # $+(12,%ld3,) rounds played; $+(12,%ld.winner,) wins!
- unset %ld*
- }
- else {
- msg # Starting game $+(12,$calc(%ld3 + 1),,!)
- set %ld.ld on
- msg # A Liar's Dice game was started! To join, type 12.ldjoin.
- msg # Signups end in 1230 seconds!
- .timer 1 30 trans
- }
- unset %ld.*
- }
- }
- on *:text:.lddice:#:if ($findtok(%ld.players,$nick,32)) notice $nick $+(12,$nick,'s) dice are $+(12,%ld.dice [ $+ [ $nick ] ],,!)
- on *:text:.ldend:#: {
- if (%ldld == on && $findtok($enders,$nick,32)) {
- msg # The game was ended by $+(12,$nick,,.) To start a new game, type 12.ldstart.
- unset %ld*
- halt
- }
- }
- alias setturn {
- if ($findtok(%ld.players,%ld.it,32) == $numtok(%ld.players,32)) set %ld.it $gettok(%ld.players,1,32)
- else set %ld.it $gettok(%ld.players,$calc($findtok(%ld.players,%ld.it,32)+1),32)
- msg %ldchan It is now $+(12,%ld.it,,'s) turn!
- }
- on *:text:.ldinfo:#:if (%ldld == on) msg # Bid: $+(12,$iif(%ld.bid != $null,%ld.bid,0 0),,s) $chr(124) Turn: $+(12,%ld.it,) $chr(124) Players: $+(12,%ld.players,) $chr(124) Phase: $+(12,$iif(%ld.round == on,Bidding,Signups),)
- alias addplayer {
- if (!$findtok(%ld.players,$1,32)) {
- msg %ldchan $+(12,$iif($1,$1,$nick),) has joined the game!
- set %ld.players %ld.players $iif($1,$1,$nick)
- set %ld.dice [ $+ [ $iif($1,$1,$nick) ] ] $sorttok($r(1,6) $r(1,6) $r(1,6) $r(1,6) $r(1,6),32,n)
- set %ld.total %ld.total %ld.dice [ $+ [ $iif($1,$1,$nick) ] ]
- if (%ld.round == on) notice $1 Your dice rolls are $+(12,%ld.dice [ $+ [ $1 ] ])
- }
- }
- on *:text:.ldspot:#: {
- if (%ld.it == $nick && %ld.bid) {
- set %ld.winner $iif($findtok(%ld.total,$gettok(%ld.bid,2,32),0,32) == $gettok(%ld.bid,1,32),$nick,%ld.person)
- msg # $+(12,%ld.winner,) wins the round!
- inc %ld2. [ $+ [ %ld.winner ] ]
- var %ld.count 1
- while (%ld.count <= $var(%ld2.*,0)) {
- set %ld.score %ld.score $+(12,$right($($var(%ld2.*,%ld.count).name),-5),,:,$chr(32),07,$var(%ld2.*,%ld.count).value,)
- inc %ld.count
- }
- msg # %ld.score
- inc %ld3
- if (%ld2. [ $+ [ %ld.winner ] ] == 5) {
- msg # $+(12,%ld3,) rounds played; $+(12,%ld.winner,) wins!
- unset %ld*
- }
- else {
- msg # Starting game $+(12,$calc(%ld3 + 1),,!)
- set %ld.ld on
- msg # A Liar's Dice game was started! To join, type 12.ldjoin.
- msg # Signups end in 1230 seconds!
- .timer 1 30 trans
- }
- unset %ld.*
- }
- }
- on $*:text:\.ldadd +/Si:#: {
- if (%ldld == on && $findtok($enders,$nick,32) && !$3) {
- addplayer $2
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment