Advertisement
contr0l

AMSSM - (Anchor, Map, Sword, Shark, Mruno) - RELEASED

Nov 24th, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 25.66 KB | None | 0 0
  1. ; [AMS] :: Anchor Map Sword (AMSsm) -AKA- Rock Paper Scissors shark mruno
  2. ; Tue July 03 10:38 CST 2018
  3.  
  4. on :load: { ams-reset }
  5. on :start: { ams-reset }
  6. on :exit: { unset %ams-* }
  7.  
  8. alias ams-reset {
  9.   unset %ams-*
  10.   set %ams-status idle
  11.   .timerams.* off
  12. }
  13. alias amsl { return $lower($1-) }
  14. alias amsm { epirate.public.msg $1- }
  15. alias amsb { return  $+ $1- $+  }
  16. alias ams-logo { return $amsb([AMSSM]) $+  }
  17.  
  18. alias EPirate.AMS.Installed return $true
  19.  
  20. ;This ON TEXT is located in the PIRATES EVENTS FILE
  21. ;on *:text:!p*:#: {
  22. ;  if ($chr(37) isin $1-) || ($chr(36) isin $1-) || ($chan != $EPirate.Chan) || ($EPirate.network !isin $network) return
  23. ;  if ($1 == !p) || ($1 == !pirate) || ($1 == !pirates) {
  24. ;    if $2 == ams epirate.ams $nick $2-
  25. ;  }
  26. ;}
  27.  
  28. on *:text:!p*:?: {
  29.   ;privmsg protection
  30.   if ($chr(37) isin $1-) || ($chr(36) isin $1-) || ($EPirate.network !isin $network) return
  31.  
  32.   if ($1 == !p) || ($1 == !pirate) || ($1 == !pirates) {
  33.     if $amsl($2) == ams || $amsl($2) == amssm {
  34.  
  35.       ;if (!%ams-status) ams-reset
  36.  
  37.       if $3 {
  38.         var %start 0
  39.         ;%start is used to determine if game progress to finish
  40.         if %ams-status == inprogress {
  41.           .timer 1 0 set -u90 %ams-status pending
  42.           inc %start
  43.         }
  44.         elseif (%ams-status == pending) {
  45.           if ($nick == %ams-p1) {
  46.             ;lets player1 choose selection before player2 accepts
  47.             inc %start
  48.           }
  49.           elseif ($nick == %ams-p2) {
  50.             ;deducts wagers from players
  51.             if (%ams-p2 != $epirate.bot) epirate.pay %ams-p2 - $+ %ams-wager games
  52.             epirate.pay %ams-p1 - $+ %ams-wager games
  53.  
  54.             ;lets player2 skip the "!P AMS Accept" trigger
  55.             inc %start
  56.           }
  57.         }
  58.         else { .timerepirate.ams. $+ $nick 1 3 epirate.personal.msg $nick Thar not be a game bein' played! Start one by typing !Pirates AMSMS help in $epirate.chan | return }
  59.         if (%start)  {
  60.           if %ams-p1 ison $epirate.chan && %ams-p1 ison $epirate.chan {
  61.             if $nick == %ams-p1 {
  62.               if $amsl($3) == $amsl(Anchor) || $amsl($3) == $amsl(Map) || $amsl($3) == $amsl(Sword) || $amsl($3) == $amsl(Shark) || $amsl($3) == $amsl(Mruno) {
  63.                 set %ams-p1-answer $remove($amsl($3),<,>)
  64.                 hinc EPirate.stats $+(%ams-p1,.AMS.Plays)
  65.                 hinc EPirate.stats $+(%ams-p1,.AMS.Selection.,%ams-p1-answer)
  66.                 if (!$epirate.reduce.spam) epirate.public.msg $ams-logo $amsb(%ams-p1) has given $epirate.hisorher($nick) answer...
  67.                 if %ams-p2-answer {
  68.                   if %ams-p1-answer == anchor {
  69.                     if %ams-p2-answer == anchor { set %ams-winner Cat }
  70.                     if %ams-p2-answer == map { set %ams-winner %ams-p2 }
  71.                     if %ams-p2-answer == sword { set %ams-winner %ams-p1 }
  72.                     if %ams-p2-answer == shark { set %ams-winner %ams-p1 }
  73.                     if %ams-p2-answer == mruno { set %ams-winner %ams-p2 }
  74.                     ams-announcewinner
  75.                     halt
  76.                   }
  77.                   if %ams-p1-answer == map {
  78.                     if %ams-p2-answer == anchor { set %ams-winner %ams-p1 }
  79.                     if %ams-p2-answer == map { set %ams-winner Cat }
  80.                     if %ams-p2-answer == sword { set %ams-winner %ams-p2 }
  81.                     if %ams-p2-answer == shark { set %ams-winner %ams-p2 }
  82.                     if %ams-p2-answer == mruno { set %ams-winner %ams-p1 }
  83.                     ams-announcewinner
  84.                     halt
  85.                   }
  86.                   if %ams-p1-answer == shark {
  87.                     if %ams-p2-answer == anchor { set %ams-winner %ams-p2 }
  88.                     if %ams-p2-answer == map { set %ams-winner %ams-p1 }
  89.                     if %ams-p2-answer == sword { set %ams-winner %ams-p2 }
  90.                     if %ams-p2-answer == shark { set %ams-winner Cat }
  91.                     if %ams-p2-answer == mruno { set %ams-winner %ams-p1 }
  92.                     ams-announcewinner
  93.                     halt
  94.                   }
  95.                   if %ams-p1-answer == sword {
  96.                     if %ams-p2-answer == anchor { set %ams-winner %ams-p2 }
  97.                     if %ams-p2-answer == map { set %ams-winner %ams-p1 }
  98.                     if %ams-p2-answer == sword { set %ams-winner Cat }
  99.                     if %ams-p2-answer == shark { set %ams-winner %ams-p1 }
  100.                     if %ams-p2-answer == mruno { set %ams-winner %ams-p2 }
  101.                     ams-announcewinner
  102.                     return
  103.                   }
  104.                   if %ams-p1-answer == mruno {
  105.                     if %ams-p2-answer == anchor { set %ams-winner %ams-p1 }
  106.                     if %ams-p2-answer == map { set %ams-winner %ams-p2 }
  107.                     if %ams-p2-answer == sword { set %ams-winner %ams-p1 }
  108.                     if %ams-p2-answer == shark { set %ams-winner %ams-p2 }
  109.                     if %ams-p2-answer == mruno { set %ams-winner Cat }
  110.                     ams-announcewinner
  111.                     halt
  112.                   }
  113.                 }
  114.                 elseif !%ams-p2-answer { epirate.notice %ams-p1 $ams-logo Waitin' fer $+($amsb(%ams-p2),'s) answer... }
  115.               }
  116.               else epirate.personal.msg $nick $ams-logo Choose one: Anchor, Map, Sword, Shark or Mruno. Use: /msg $me !Pirates AMSSM <selection> - Ex: /msg $me !Pirates AMSSM Sword
  117.             }
  118.             if $nick == %ams-p2 {
  119.               if $amsl($3) == $amsl(Anchor) || $amsl($3) == $amsl(Map) || $amsl($3) == $amsl(Sword) || $amsl($3) == $amsl(Shark) || $amsl($3) == $amsl(Mruno) {
  120.                 set %ams-p2-answer $amsl($3)
  121.                 if (!$epirate.reduce.spam) epirate.public.msg $ams-logo $amsb(%ams-p2) has given $epirate.hisorher($nick) answer...
  122.                 if %ams-p1-answer {
  123.                   if %ams-p2-answer == anchor {
  124.                     if %ams-p1-answer == anchor { set %ams-winner Cat }
  125.                     if %ams-p1-answer == map { set %ams-winner %ams-p1 }
  126.                     if %ams-p1-answer == sword { set %ams-winner %ams-p2 }
  127.                     if %ams-p1-answer == shark { set %ams-winner %ams-p2 }
  128.                     if %ams-p1-answer == mruno { set %ams-winner %ams-p1 }
  129.                     ams-announcewinner
  130.                     halt
  131.                   }
  132.                   if %ams-p2-answer == map {
  133.                     if %ams-p1-answer == anchor { set %ams-winner %ams-p2 }
  134.                     if %ams-p1-answer == map { set %ams-winner Cat }
  135.                     if %ams-p1-answer == sword { set %ams-winner %ams-p1 }
  136.                     if %ams-p1-answer == shark { set %ams-winner %ams-p1 }
  137.                     if %ams-p1-answer == mruno { set %ams-winner %ams-p2 }
  138.                     ams-announcewinner
  139.                     halt
  140.                   }
  141.                   if %ams-p2-answer == sword {
  142.                     if %ams-p1-answer == anchor { set %ams-winner %ams-p1 }
  143.                     if %ams-p1-answer == map { set %ams-winner %ams-p2 }
  144.                     if %ams-p1-answer == sword { set %ams-winner Cat }
  145.                     if %ams-p1-answer == shark { set %ams-winner %ams-p2 }
  146.                     if %ams-p1-answer == mruno { set %ams-winner %ams-p1 }
  147.                     ams-announcewinner
  148.                     halt
  149.                   }
  150.                   if %ams-p2-answer == shark {
  151.                     if %ams-p1-answer == anchor { set %ams-winner %ams-p1 }
  152.                     if %ams-p1-answer == map { set %ams-winner %ams-p2 }
  153.                     if %ams-p1-answer == sword { set %ams-winner %ams-p1 }
  154.                     if %ams-p1-answer == shark { set %ams-winner Cat }
  155.                     if %ams-p1-answer == mruno { set %ams-winner %ams-p2 }
  156.                     ams-announcewinner
  157.                     halt
  158.                   }
  159.                   if %ams-p2-answer == mruno {
  160.                     if %ams-p1-answer == anchor { set %ams-winner %ams-p2 }
  161.                     if %ams-p1-answer == map { set %ams-winner %ams-p1 }
  162.                     if %ams-p1-answer == sword { set %ams-winner %ams-p2 }
  163.                     if %ams-p1-answer == shark { set %ams-winner %ams-p1 }
  164.                     if %ams-p1-answer == mruno { set %ams-winner Cat }
  165.                     ams-announcewinner
  166.                     halt
  167.                   }
  168.                 }
  169.                 elseif !%ams-p1-answer {
  170.                   epirate.notice %ams-p2 Waitin' fer $+($amsb(%ams-p1),'s) answer...
  171.                   epirate.notice %ams-p1 It be yer turn! Anchor, Map, Sword, Shark, or Mruno. Use: /msg $me !Pirates AMSSM <selection> - Ex: /msg $me !Pirates AMSSM Map
  172.                 }
  173.               }
  174.               else epirate.personal.msg $nick $ams-logo Choose one: Anchor, Map, Sword, Shark or Mruno. Use: /msg $me !Pirates AMSSM <selection> - Ex: /msg $me !Pirates AMSSM Map
  175.             }
  176.           }
  177.         }
  178.       }
  179.     }
  180.   }
  181. }
  182. alias EPirate.Bot.Game.AMS.Start {
  183.   ;/EPirate.Bot.Game.AMS.Start <player> - bot start a game of AMS with the player
  184.   if (!$epirate.bot) || ($EPirate.Special.Event) || ($timer(EPirate.BlackJack.Start1)) return
  185.   if (%ams-status) && (%ams-status != idle) return
  186.   var %player $1
  187.   if ($epirate.isuser(%player)) {
  188.     var %wager $epirate.player.percentage(%player,$calc($rand(5,50) / 100))
  189.     if (%wager isnum) EPirate.AMS.Start $epirate.bot AMS %player %wager
  190.   }
  191. }
  192. alias epirate.ams.start {
  193.   ;/epirate.ams.start <player1> AMS <player2> <wager> - starts up a game of AMS
  194.   ;flood checks
  195.   if ($timer(EPirate.Flood).secs) { EPirate.Flood.Check $1 | return }
  196.   else .timerEPirate.Flood -m 1 1000 noop
  197.  
  198.   ;player flood check
  199.   EPirate.Flood.Check $1
  200.  
  201.   if ($3 == stats) {
  202.     var %player $iif($4,$4,$1)
  203.     var %games $hget(EPirate.stats,$+(%player,.AMS.Plays)), %notice
  204.     if (%games) {
  205.       epirate.notice $1 %player has played AMSSM %games times n' has the followin' tendencies: Anchor $epirate.percentage($hget(EPirate.stats,$+(%player,.AMS.Selection.Anchor)),%games) $+ $chr(37) Map $epirate.percentage($hget(EPirate.stats,$+(%player,.AMS.Selection.Map)),%games) $+ $chr(37) Sword $epirate.percentage($hget(EPirate.stats,$+(%player,.AMS.Selection.Sword)),%games) $+ $chr(37) Shark $epirate.percentage($hget(EPirate.stats,$+(%player,.AMS.Selection.Shark)),%games) $+ $chr(37) Mruno $epirate.percentage($hget(EPirate.stats,$+(%player,.AMS.Selection.Mruno)),%games) $+ $chr(37)
  206.     }
  207.     else epirate.notice $1 %player has never played AMS!
  208.     return
  209.   }
  210.  
  211.   if (!%ams-status) ams-reset
  212.  
  213.   ;checks if player is specified and onboard
  214.   if (!$3) ams-help $1
  215.   if $3 {
  216.     ;ams cooldown
  217.     if ($timer(EPirate.AMS.Cooldown)) { epirate.notice $1 Coolin' off... try again in a minute! | return }
  218.  
  219.     ;too many games played today check
  220.     if ($hget(epirate.daily,Games.Played. $+ $1) >= $EPirate.Max.Games.Per.Day) { epirate.notice $1 Ye played enough games today! New day starts in $EPirate.Time.Until.New.Day | return }
  221.  
  222.     if $3 !ison $epirate.chan && $3 != accept && $3 != decline && $3 != help && $3 != stats { epirate.notice $1 $ams-logo The format be !Pirates AMSSM <pirate> <wager>  - Use !Pirates AMSSM help fer Commands. | return }
  223.  
  224.     if (!%ams-status) || (%ams-status == idle) {
  225.       if ($1 == $3) { epirate.notice $1 Stop tryin' to play wit' yeself n' play wit' others! | return }
  226.       if ($3 ison $epirate.chan) && ($EPirate.Onboard($3)) || ($3 == $epirate.bot) {
  227.  
  228.         ;too many games played today check
  229.         if ($hget(epirate.daily,Games.Played. $+ $3) >= $EPirate.Max.Games.Per.Day) { epirate.notice $1 $3 played enough games today! New day starts in $EPirate.Time.Until.New.Day | return }
  230.  
  231.         set %ams-p1 $1
  232.         ;$2 is AMS
  233.         set %ams-p2 $3
  234.         if (%ams-status) || (%ams-status == idle) {
  235.  
  236.           if (%ams-p1 == $epirate.bot) {
  237.             var %r $rand(1,5)
  238.             if (%r == 1) set %ams-p1-answer $amsl(Anchor)
  239.             elseif (%r == 2) set %ams-p1-answer $amsl(Map)
  240.             elseif (%r == 3) set %ams-p1-answer $amsl(Shark)
  241.             elseif (%r == 4) set %ams-p1-answer $amsl(Mruno)
  242.             else set %ams-p1-answer $amsl(Sword)
  243.             hinc EPirate.stats $+(%ams-p1,.AMS.Plays)
  244.             hinc EPirate.stats $+(%ams-p1,.AMS.Selection.,%ams-p1-answer)
  245.           }
  246.  
  247.           ;player needs to buy a bribe to play more games
  248.           if ($hget(EPirate.Games,%ams-p1) >= $Epirate.Games.Before.Bribe.Needed) {
  249.             EPirate.Notice %ams-p1 Th' Cap'n will catch ye if ye keep playin' those games 'n nah scrubbin' th' poop deck. Play later, ye blaggard!
  250.             EPirate.Notice %ams-p1 I may be able t' help ye play some more games. Type !Pirates store bribe
  251.             return
  252.           }
  253.  
  254.           ;wager checks
  255.           var %wager $EPirate.Convert.Wager($4)
  256.           if ($4) && (%wager isnum) && (%wager >= 1) set %ams-wager %wager
  257.           else { epirate.notice $1 How much do ye want to wager? !Pirates AMS <pirate> <wager> | return }
  258.           if (%ams-p1 != $epirate.bot) && (%wager > $epirate.player.percentage(%ams-p1,$EPirate.Max.Percentage.Wager)) { EPirate.Notice $1 The buy-in be too rich fer ye blood n' ye won't have drinkin' money if ye lose! Try $EPirate.Round($v2) doubloons or less | return }
  259.  
  260.           ;bot playing game
  261.           if (%ams-p2 == $epirate.bot) {
  262.             var %r $rand(1,5)
  263.             if (%r == 1) set %ams-p2-answer $amsl(Anchor)
  264.             if (%r == 2) set %ams-p2-answer $amsl(Map)
  265.             if (%r == 3) set %ams-p2-answer $amsl(Shark)
  266.             elseif (%r == 4) set %ams-p2-answer $amsl(Mruno)
  267.             else set %ams-p2-answer $amsl(Sword)
  268.             hinc EPirate.stats $+(%ams-p2,.AMS.Plays)
  269.             hinc EPirate.stats $+(%ams-p2,.AMS.Selection.,%ams-p2-answer)
  270.             set -u90 %ams-status inprogress
  271.             epirate.pay %ams-p1 - $+ %ams-wager games
  272.           }
  273.  
  274.           ;additional wager checks
  275.           if (%ams-p2 != $epirate.bot) && (%wager > $epirate.player.percentage(%ams-p2,$EPirate.Max.Percentage.Wager)) { EPirate.Notice $1 The wager be too much fer %ams-p2 $+ ! Try $EPirate.Round($v2) doubloons or less | return }
  276.           if (%ams-p2 != $epirate.bot) && (%wager > $hget(epirate.players.all,%ams-p2)) { EPirate.notice $1 Ye too poor to play tis game! | return }
  277.  
  278.           if (%wager < $epirate.player.percentage(%ams-p1,0.1)) EPirate.Achievement %ams-p1 Game.Low.Wager
  279.  
  280.           .timer 1 0 set -u90 %ams-status pending
  281.           epirate.public.msg $epirate.nick($1) $amsb($1) has challenged $amsb($3) to a game of $ams-logo $+ . (Anchor, Map, Sword, Shark, Mruno) -AKA- Rock, Paper, Scissors, Lizard, Spock.
  282.  
  283.           var %games $hget(EPirate.stats,$+(%ams-p1,.AMS.Plays)), %notice
  284.           if (%games) {
  285.             set %notice %ams-p1 has played AMS %games times n' has the followin' tendencies: Anchor $epirate.percentage($hget(EPirate.stats,$+(%ams-p1,.AMS.Selection.Anchor)),%games) $+ $chr(37) Map $epirate.percentage($hget(EPirate.stats,$+(%ams-p1,.AMS.Selection.Map)),%games) $+ $chr(37) Sword $epirate.percentage($hget(EPirate.stats,$+(%ams-p1,.AMS.Selection.Sword)),%games) $+ $chr(37) Shark $epirate.percentage($hget(EPirate.stats,$+(%ams-p1,.AMS.Selection.Shark)),%games) $+ $chr(37) Mruno $epirate.percentage($hget(EPirate.stats,$+(%ams-p1,.AMS.Selection.Mruno)),%games) $+ $chr(37)
  286.           }
  287.           else set %notice This be %ams-p2 $+ 's first time playin' AMSSM.
  288.  
  289.  
  290.           epirate.notice %ams-p2 %ams-p1 has challenged ye to AMS wit' a wager o' $epirate.round(%ams-wager) doubloons! Ye must accept or decline this challenge with either: $amsb(!Pirates AMS Accept) or $amsb(!Pirates AMS Decline)
  291.           epirate.notice %ams-p2 %notice
  292.  
  293.           var %games $hget(EPirate.stats,$+(%ams-p2,.AMS.Plays))
  294.           if (%games) {
  295.             epirate.notice %ams-p1 %ams-p2 has played AMS %games times n' has the followin' tendencies: Anchor $epirate.percentage($hget(EPirate.stats,$+(%ams-p2,.AMS.Selection.Anchor)),%games) $+ $chr(37) Map $epirate.percentage($hget(EPirate.stats,$+(%ams-p2,.AMS.Selection.Map)),%games) $+ $chr(37) Sword $epirate.percentage($hget(EPirate.stats,$+(%ams-p2,.AMS.Selection.Sword)),%games) $+ $chr(37) Shark $epirate.percentage($hget(EPirate.stats,$+(%ams-p1,.AMS.Selection.Shark)),%games) $+ $chr(37) Mruno $epirate.percentage($hget(EPirate.stats,$+(%ams-p1,.AMS.Selection.Mruno)),%games) $+ $chr(37)
  296.           }
  297.           else epirate.notice %ams-p1 This be %ams-p2 $+ 's first time playin' AMS.
  298.  
  299.           ;check if anything in pot from previous draw
  300.           if ($hget(epirate.games,AMS.pot)) set %ams-pot $ifmatch
  301.  
  302.           .timerams.cancel 1 90 ams-cancel
  303.           if (%ams-p2 == $epirate.bot) .timer 1 3 epirate.notice $1 $epirate.bot has made a selection... make yers! Anchor, Map, Sword, Shark or Mruno. Use: /msg $me !Pirates AMSSM <selection> - Ex: /msg $me !Pirates AMSSM Anchor
  304.           else epirate.notice $1 Waitin' $duration($timer(ams.cancel).secs) fer %ams-p2 to respond...
  305.           return
  306.         }
  307.         else { epirate.notice $1 A game already be in progress! | return }
  308.       }
  309.       else {
  310.         if ($3 == accept) || ($3 == decline) epirate.notice $1 Thar not be a game bein' played! Start one wit' !Pirates AMSSM help
  311.         elseif ($3 == help) ams-help $1
  312.         else epirate.notice $1 $amsb($3) not be onboard!
  313.         return
  314.       }
  315.     }
  316.   }
  317.   if %ams-status == pending {
  318.     if ($hget(EPirate.Games,%ams-p2) >= $Epirate.Games.Before.Bribe.Needed) {
  319.       ;player needs to buy a bribe to play more games
  320.       EPirate.Notice %ams-p1 Th' Cap'n caught %ams-p2 playin' games 'n be now scrubbin' th' poop deck. Try again later.
  321.       EPirate.Notice %ams-p2 I may be able t' help ye play some more games. Type !Pirates store bribe
  322.       return
  323.     }
  324.  
  325.     if $3 == accept {
  326.       .timerams.* off
  327.       set -u90 %ams-status inprogress
  328.       epirate.notice %ams-p1 %ams-p2 accepted ye challenge!
  329.       .timerams.noanswer 1 60 ams-cancel noanswer
  330.       if (!%ams-p1-answer) epirate.notice %ams-p1 Ye 'ave $duration($timer(ams.noanswer).secs) to tell me what ye playin' wit'! Anchor, Map, Sword, Shark or Mruno. Use: /msg $me !Pirates AMSSM <selection> - Ex: /msg $me !Pirates AMSSM Map
  331.       if (!%ams-p2-answer) epirate.notice %ams-p2 Ye 'ave $duration($timer(ams.noanswer).secs) to tell me what ye playin' wit'! Anchor, Map, Sword, Shark or Mruno. Use: /msg $me !Pirates AMSSM <selection> - Ex: /msg $me !Pirates AMSSM Anchor
  332.  
  333.       ;if no answer, wager still deducted
  334.       epirate.pay %ams-p2 - $+ %ams-wager games
  335.       if (%ams-p1 != $epirate.bot) epirate.pay %ams-p1 - $+ %ams-wager games
  336.       return
  337.     }
  338.     elseif $3 == decline {
  339.       if ($epirate.reduce.spam) epirate.notice %ams-p1 %ams-p2 declined ye challenge request!
  340.       else epirate.public.msg $epirate.nick(%ams-p2) %ams-p2 declined the challenge from %ams-p1 to play $ams-logo $+ .
  341.       ams-cancel decline
  342.       return
  343.     }
  344.     else {
  345.       if (%ams-p1 == $1) { epirate.notice $1 Waitin' on %ams-p2 to accept ye challenge! | return }
  346.       if (%ams-p2 == $1) { epirate.notice $1 Waitin' on ye to accept the challenge from %ams-p1 $+ !  !Pirates AMS Accept | return }
  347.       ;epirate.notice $1 $ams-logo game not in progress.
  348.     }
  349.   }
  350.   if $3 == help {
  351.     ams-help $1
  352.     return
  353.   }
  354.   else epirate.notice $1 AMS be %ams-status
  355. }
  356. alias ams-help {
  357.   if ($1) {
  358.     ;epirate.notice $1 $ams-Logo $asmb(Anchor, Map, Sword) - Just like Rock Paper Scissors, the same rules apply:
  359.     ;epirate.notice $1 $ams-logo Normal Rules Apply: $asmb(Anchor beats Sword, Map beats Anchor, and Sword beats Map)
  360.     ;epirate.notice $1 $ams-logo - $amsb(!p ams Challenge <pirate>) to Challenge a Pirate to a game o' $ams-logo
  361.     ;epirate.notice $1 $ams-logo - $amsb(!p ams accept) to accept a Challenge from another pirate.
  362.     ;epirate.notice $1 $ams-logo - $amsb(!p ams decline) to decline a Challenge from another pirate.
  363.     ;epirate.notice $1 $ams-logo - $amsb(!p ams stats <pirate>) to show a pirate's stats
  364.     ;epirate.notice $1 $ams-logo Once a game has been accepted, players must /msg $me AMS Answer - Answers being: $amsb(Anchor, Map, Sword.) (Like Rock, Paper, Scissors.)
  365.  
  366.     epirate.notice $1 $ams-Logo $asmb(Anchor, Map, Sword, Shark, Mruno) - Just like Rock Paper Scissors Lizard Spock. The Exact Same Rules apply:
  367.     epirate.notice $1 $ams-logo Normal Rules Apply: $asmb(Sword cuts Map covers Anchor crushes Shark eats Mruno breaks Sword impales Shark rips through Map confuses Mruno is harder than an Anchor breaks Sword)
  368.     epirate.notice $1 $ams-logo - $amsb(!p amssm Challenge Nick) to Challenge Nick to a game of $ams-logo
  369.     epirate.notice $1 $ams-logo - $amsb(!p amssm accept) to accept a Challenge from another pirate.
  370.     epirate.notice $1 $ams-logo - $amsb(!p amssm decline) to decline a Challenge from another pirate.
  371.     epirate.notice $1 $ams-logo Once a game has been accepted, players must /msg $me !Pirates AMSSM Answer - Answers being: $amsb(Anchor, Map, Sword, Shark, Mruno.) (Like Rock, Paper, Scissors, Lizard, Spock.)
  372.     epirate.notice $1 Ex: /msg $me !Pirates AMSSM Anchor OR /msg $me !Pirates AMSSM Map OR /msg $me !Pirates AMSSM Sword  OR /msg $me !Pirates AMSSM Shark  OR /msg $me !Pirates AMSSM Mruno
  373.   }
  374. }
  375. alias beats {
  376.   var %a anchor.map.sword.shark.mruno
  377.   var %b Cuts.Covers.Crushes.Eats.Breaks.Impales.Tears.Confuses.Shatters
  378.   if ($2) {
  379.     if ($+(*,$1,*) iswm %a) && ($+(*,$2,*) iswm %a) {
  380.       if (($1 == anchor) && ($2 == map)) || (($1 == map) && ($2 == anchor)) { return $gettok(%b,2,46) }
  381.       if (($1 == anchor) && ($2 == sword)) || (($1 == sword) && ($2 == anchor)) { return $gettok(%b,5,46) }
  382.       if (($1 == anchor) && ($2 == shark)) || (($1 == shark) && ($2 == anchor)) { return $gettok(%b,3,46) }
  383.       if (($1 == anchor) && ($2 == mruno)) || (($1 == mruno) && ($2 == anchor)) { return $gettok(%b,9,46) }
  384.       if (($1 == map) && ($2 == sword)) || (($1 == sword) && ($2 == map)) { return $gettok(%b,1,46) }
  385.       if (($1 == map) && ($2 == shark)) || (($1 == shark) && ($2 == map)) { return $gettok(%b,7,46) }
  386.       if (($1 == map) && ($2 == mruno)) || (($1 == mruno) && ($2 == map)) { return $gettok(%b,8,46) }
  387.       if (($1 == sword) && ($2 == shark)) || (($1 == shark) && ($2 == sword)) { return $gettok(%b,6,46) }
  388.       if (($1 == sword) && ($2 == mruno)) || (($1 == mruno) && ($2 == sword)) { return $gettok(%b,5,46) }
  389.       if (($1 == shark) && ($2 == mruno)) || (($1 == mruno) && ($2 == shark)) { return $gettok(%b,4,46) }
  390.     }
  391.   }
  392. }
  393. alias ams-announcewinner {
  394.   var %winner, %loser, %winner-answer, %tax 0, %msg, %loser-answer, %sum $calc(%ams-wager * 2)
  395.   if %ams-winner == Cat {
  396.     ;no winners add to pot
  397.     hinc epirate.games AMS.pot %sum
  398.     set %msg Both %ams-p1 n' %ams-p2 chose %ams-p1-answer $+ ! $epirate.round($hget(epirate.games,AMS.pot)) doubloons be added to the pot for the next game!
  399.   }
  400.   elseif %ams-winner == %ams-p1 {
  401.     set %winner %ams-p1
  402.     set %winner-answer %ams-p1-answer
  403.     set %loser %ams-p2
  404.     set %loser-answer %ams-p2-answer
  405.   }
  406.   elseif %ams-winner == %ams-p2 {
  407.     set %winner %ams-p2
  408.     set %winner-answer %ams-p2-answer
  409.     set %loser %ams-p1
  410.     set %loser-answer %ams-p1-answer
  411.   }
  412.  
  413.   if (%winner) {
  414.     if (%ams-pot) inc %sum %ams-pot
  415.  
  416.     ;reduces amount if too much being paid to winner because of previous pot
  417.     if (%winner != $epirate.bot) && (%sum > $epirate.player.percentage(%winner,$EPirate.Max.Percentage.Bonus)) {
  418.       inc %tax
  419.       set %ams-wager $v2
  420.       .timer 1 3 epirate.notice %winner Ye payout be reduced due to taxes from the Cap'n!
  421.     }
  422.  
  423.     set %msg $upper(%winner-answer) $beats($amsl(%winner-answer),$amsl(%loser-answer)) $upper(%loser-answer) - $epirate.nick(%winner) $amsb(%winner) wins $epirate.round(%sum) doubloons $+ $iif(%tax,$chr(32) after taxes!,!)
  424.     hdel epirate.games AMS.pot
  425.  
  426.     ;pays winner if not bot. pay is doubled since wager was deducted ealier
  427.     if (%winner != $epirate.bot) epirate.pay %winner $calc(%ams-pot + $calc(%ams-wager * 2)) games
  428.   }
  429.  
  430.   ;after game commands
  431.   epirate.public.msg $ams-logo %msg
  432.   hinc EPirate.Stats ship.games
  433.  
  434.   if (%ams-p1 != $epirate.bot) {
  435.     hinc epirate.daily Games.Played. $+ %ams-p1
  436.     EPirate.Achievement %ams-p1 game
  437.     EPirate.Skills.Check %ams-p1 Luck
  438.     EPirate.Command.Age.Check %ams-p1 AMS
  439.     if (!$timer(EPirate.Party)) hinc EPirate.Games %ams-p1
  440.     EPirate.Task.Check %ams-p1 play.game
  441.   }
  442.  
  443.   if (%ams-p2 != $epirate.bot) {
  444.     ;skips bot from the below commands
  445.     hinc epirate.daily Games.Played. $+ %ams-p2
  446.     EPirate.Achievement %ams-p2 game
  447.     EPirate.Skills.Check %ams-p2 Luck
  448.     EPirate.Command.Age.Check %ams-p2 AMS
  449.     if (!$timer(EPirate.Party)) hinc EPirate.Games %ams-p2
  450.     EPirate.Task.Check %ams-p2 play.game
  451.   }
  452.  
  453.   .timerEPirate.AMS.Cooldown 1 60 noop
  454.   ams-reset
  455. }
  456. alias ams-cancel {
  457.   if (!$1) {
  458.     if (!$epirate.reduce.spam) epirate.public.msg $ams-logo $epirate.nick(%ams-p2) %ams-p2 did not accept the challenge from %ams-p1 in time!
  459.     if (%ams-p1) .timerepirate.ams.cancel. $+ %ams-p1 1 1 epirate.notice %ams-p1 $amsb(%ams-p2) did not accept ye challenge in AMS!
  460.     if (%ams-p2) .timerepirate.ams.cancel. $+ %ams-p2 1 1 epirate.notice %ams-p2 The AMSSM challenge from %ams-p1 timed out!
  461.     ams-reset
  462.   }
  463.   if $1 == decline {
  464.     if (!$epirate.reduce.spam) epirate.public.msg $ams-logo $amsb(%ams-p2) declined the game with %ams-p1
  465.     if (%ams-p1) .timerepirate.ams.cancel. $+ %ams-p1 1 1 epirate.notice %ams-p1 %ams-p2 did not accept ye challenge in AMS!
  466.     ams-reset
  467.   }
  468.   elseif $1 == noanswer {
  469.     if (!$epirate.reduce.spam) epirate.public.msg $ams-logo %ams-p1 n' %ams-p2 did not reply with their answer in time. $ams-logo Game Cancelled.
  470.     if (%ams-p1) epirate.notice %ams-p1 The game o' AMSSM has timed out!
  471.     if (%ams-p2) epirate.notice %ams-p2 The game o' AMSSM has timed out!
  472.     ams-reset
  473.   }
  474. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement