Two player Russian Roulette

By Callison1 on May 14, 2007

It's a game that allows to people to play in a russian roulette face off. People can type !rroulette to start a game, and wait for someone else to type it to join them in the game, the first person who typed it goes first, the second goes second. Type !trigger to progress throught the game.

alias rrover { 
  unset %rroul | unset %rroul1 | unset %rroul2 | unset %rroulturn | unset %chamber
}
on *:TEXT:!rroulette*:#: {
  if (( %rroul1 == $null )) {
    set %rroul1 $nick
    set %rroulturn $nick
    msg # $nick is ready to face another person in a russian roulette face off, type !rroulette to join them.
   timerrroulette 1 20 /msg # I'm afraid no-one wanted to face $nick $+ .
    timerrroulette2 1 20 /2prover
  }
  elseif (( %rroul2 == $null )) && (( $nick != %rroul1 )) {
    set %rroul2 $nick
    set %rroul on
    msg # $nick joins %rroul1 in a russian roulette face off! %rroul1 will go first!
    msg # %rroul1 loads 1 bullet, and puts the cylinder inside the revolver, and spins it around
    set %chamber $rand(1,6)
    timerrroulette off
    timerrroulette2 off
  }
}
on *:TEXT:!trigger*:#: {
  if (( %rroul == on )) {
    if (( %rroulturn == $nick )) && (( %2proul1 == $nick )) {
      if (( %chamber == 1 )) {
        msg # BANG!!!
        msg # $nick dies so %rroul2 wins!!
        rrover
      }
      else {
        msg # CLICK!!!
        msg # $nick lives! They pass the revolver to %rroul2
        dec %chamber
        set %rroulturn %rroul2
      }
    }
    if (( %rroulturn == $nick )) && (( %rroul2 == $nick )) {
      if (( %chamber == 1 )) {
        msg # BANG!!!
        msg # $nick dies so %rroul1 wins!!
        rrover
      }
      else {
        msg # CLICK!!!
        msg # $nick lives! They pass the revolver to %rroul1
        dec %chamber
        set %rroulturn %rroul1
      }
    }
  }
elseif (( $nick == %2proul1 )) && (( %2proul != on )) {
    msg # Sorry, there is no second player for you to face $nick $+ .
  }
}

Comments

Sign in to comment.
Callison1   -  May 16, 2007

I added in a message that reads \"Sorry, there is no second player for you to face $nick $+ .\" If the person is set as player 1 but there is no player 2. Also I put two 20 second timers that are activated when player 1 is set. One messages the channel to say that nobody wanted to face this person and the other unsets the variables. These timers are halted if a second player joins. It works fine for me.

 Respond  
|MELIORITE|   -  May 16, 2007

Yeah i think having the elseif condition on nick2 joining to turn it on is interfering with the process. I don\'t see it as an elseif condition.... basically it can\'t work unless two nicks join... granted, but on trigger if there are not two nicks it should msg nick1 something like \"sorry, nobody else is playing\" or an option to play against yourself, which means that nick1 can turn the game on. A timer and message stating \"Waiting 15 seconds for other to join\" could be useful, and then otherwise \" You\'re playing agaisnt yourself\" ... something like that. Setting a roulturn for nick2 might also be necessary to get it going? On !rroulette the chamber might also need to be set.

 Respond  
Bouncer   -  May 15, 2007

Actually I did remove Calibot and just left the #. It still did not work for me. At first it wouldn\'t let a second person join... then when it finally did !trigger did nothing.

 Respond  
Callison1   -  May 15, 2007

Yes sorry about that, i\'ve edited that now, should work now, I deleted the /\'s too.

 Respond  
|MELIORITE|   -  May 15, 2007

Probably because you didn\'t change the #Calibot to your channel. This might have been better served by either a # for any chan, $chan usage, or even $active.

 Respond  
Bouncer   -  May 14, 2007

I had trouble getting it to log two people but when it finally did !trigger did nothing at all.

 Respond  
BackoffJackson   -  May 14, 2007

Strange way to go about it, you don\'t need the /\'s.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.