GAME - Pass the H-Bomb

By Alfreido on Oct 04, 2005

A simple game of Hot Potato called 'Pass the H Bomb' which I designed while bored at work. The basic premise is you have an imaginary bomb which can be passed around the channel with a random fuse. The person who is caught with it when it goes off gets punished. Instructions are included at the top of the snippet, along with settings to change the way the game is played. To enable the game, use /enablehbomb, making sure you have checked the settings first, especially the channel setting. To start a game in the channel designated, type `passthehbomb.

alias enablehbomb {
  ;------------------------------------------------------------------------------
  ;Pass the H Bomb
  ;Script by Alfreido
  ;Wednesday, 5th October 2005

  ;All settings you can change are below, followed by a description of what they do
  ;If you change settings, you must type /enablehbomb to set the new settings
  ;------------------------------------------------------------------------------

  set %lowbombtimer 5
  ;-- Set's the least amount of time the fuse of the bomb can have --

  set %highbombtimer 20
  ;-- Set's the most amount of time the fuse of the bomb can have --

  set %chan #alfpriv
  ;-- Set's the channel the script will run in --

  set %punishment 1
  ;-- Set's the punishment of being the person to hold the bomb when it explodes
  ;it can be one of 3 values:
  ;0 = Nothing happens
  ;1 = Devoice
  ;2 = Kicked from channel
  ;Note that you must have ops if you want the bottom 2 to work --

  set %noreturn 1
  ;-- Sets whether you can return the bomb to the person who passed it to you.
  ;1 = No returns, 0 = Yes, you can return --

  set %idleprotection 1
  ;-- If equals 1, you cannot throw the bomb to anyone who has been idling more than
  ;the value of %idlethreshold. If 0, you can throw the bomb to idlers --

  set %idlethreshold 300
  ;-- Sets the amount of seconds that a person has to idle for before being protected
  ;by idle protection, only useful if %idleprotection = 1 --

  set %easymode 0
  ;-- If %easymode 1, the game goes into easy mode, where the fuse of the bomb is given
  ;when the game starts. I strongly recommend you don't play this, there is more
  ;suspense when you don't know when the bomb will explode --

  set %meplaying 0
  ;-- If 1, people can throw the bomb to you as well. --

  ;-- END OF SETTINGS --

  ;-- COMMANDS --
  ;/enablehbomb - Saves settings and allows the game to be played
  ;`passthehbomb - Starts a new game
  ;`pass <name> - Passes the H-Bomb to <name>
  ;`endgame - Ends the game prematurely, doesn't blow up the bomb. Only the person who started
  ;           the game may end it.
  ;`settings - Will PM the person a list of the current settings

  msg %chan 4PASS THE H-BOMB is now enabled. To start a game, type `passthehbomb. For settings list, type `settings.
}

on *:TEXT:*:# {
  if ($1 == `passthehbomb && $chan == %chan) {
    if (%game == 0 || %game == $null) {
      %game = 1
      msg %chan Let's play 4PASS THE H-BOMB! Type `pass <name> to pass it to someone else. You better keep passing it, the bomb will go off randomly.
      set %random $rand(%lowbombtimer,%highbombtimer)
      if (%easymode == 1) {
        msg %chan The fuse is %random seconds
      }
      %nick = $nick
      %startnick = $nick
      %previous = $null
      timer 1 %random blowup
      timer 1 %random endgame
    }
    else {
      notice $nick There is already a game in progress.
    }
  }
  elseif ($1 == `pass && %game == 1 && $chan == %chan) {
    if ($nick == %nick) {
      if ($2 == $null) {
        notice $nick You must pass to SOMEONE!
      }
      elseif ($2 == $nick) {
        notice $nick You can't pass to yourself
      }
      elseif ($2 == $me && %meplaying == 0) {
        notice $nick You can't pass to me.
      }
      elseif ($2 == %previous && %noreturn == 1) {
        %nick = $nick
        returntosender
      }
      elseif ($nick(%chan, $2).idle > %idlethreshold && %idleprotection == 1) {
        msg %chan 4 $+ $nick tries to throw to4 $2 but he is 4miles away (Idle for more than %idlethreshold seconds)
      }
      elseif ($2 ison %chan) {
        %nick = $2
        %previous = $nick
        msg %chan $nick 4passes the H-Bomb to %nick
        echo -s Pass to %nick
      }
      else {
        notice $nick You must pass to someone in the channel.
      }
    }
    else {
      notice $nick You don't have the bomb.
    }
  }
  elseif ($1 == `endgame && %game == 1 && $chan == %chan) {
    if ($nick == %startnick) {
      endgame
    }
    else {
      notice $nick You didn't start the bomb, so you can't stop it.
    }
  }
  elseif ($1 == `settings && $chan == %chan) {
    msg $nick 4PASS THE H-BOMB SETTINGS
    msg $nick - Fuse can be in between %lowbombtimer and %highbombtimer
    if (%punishment == 0) {
      msg $nick - There is no punishment for being the one with the bomb when it explodes.
    }
    elseif (%punishment == 1) {
      msg $nick - You will be devoiced if you are caught with the bomb when it explodes.
    }
    elseif (%punishment == 2) {
      msg $nick - You will be kicked if you are caught with the bomb when it explodes.
    }
    if (%noreturn == 1) {
      msg $nick - You cannot return the bomb to the person who passed it to you.
    }
    else {
      msg $nick - You can return the bomb to the person who passed it to you.
    }
    if (%idleprotection == 1) {
      msg $nick - Idle protection is on. You must be idle for %idlethreshold seconds before being protected.
    }
    else {
      msg $nick - Idle protection is off.
    }
    if (%easymode == 1) {
      msg $nick - Easy mode is on. The fuse will be revealed when the game starts.
    }
    else {
      msg $nick - Easy mode is off. The fuse will not be revealed until it is too late.
    }
  }
}

alias endgame {
  %nick = $null
  %random = $null
  %startnick = $null
  %previous = $null
  %game = 0
  timers off
  msg %chan 4Game over.
}

alias blowup {
  if (%punishment = 0) {
    msg %chan 7BOOOOOOOOM! (Victim = %nick $+ )
  }
  elseif (%punishment = 1) {
    msg %chan 7BOOOOOOOOM! (Victim = %nick $+ )
    mode %chan -v %nick
  }
  elseif (%punishment = 2) {
    kick %chan %nick 7BOOOOOOOOM!
  }
}

alias returntosender {
  if (%punishment = 0) {
    msg %chan Return to sender.... 7BOOOOOOOOM! (Victim = %nick $+ )
  }
  elseif (%punishment = 1) {
    msg %chan Return to sender.... 7BOOOOOOOOM! (Victim = %nick $+ )
    mode %chan -v %nick
  }
  elseif (%punishment = 2) {
    kick %chan %nick Return to sender.... 7BOOOOOOOOM!
  }
  %nick = $null
  %random = $null
  %startnick = $null
  %previous = $null
  %game = 0
  timers off
  msg %chan 4Game over.
}

Comments

Sign in to comment.
cptpan   -  Jun 18, 2015

Yeah this doesn't work.

 Respond  
guest598594   -  Sep 22, 2007
set %chan #alfpriv

you should make it

set %chan $$?=\"Channel?\"

cuz were not gonna be in that channel

and rather than doing

else {
  notice ...

u can just do

else notice nick...
 Respond  
guest598594   -  Sep 22, 2007

nope, everything there goes in remotes

is this like hot potato?

 Respond  
Gforce20   -  Sep 22, 2007

Conipto, I believe this is an alias, not a remote. Correct me if I\'m wrong.

 Respond  
Conipto   -  Mar 09, 2007

I don\'t understand. \"ENABLEHBOMB UNKNOWN COMMAND\" and it doesn\'t respond on the settings command, nor thepassthebomb one.

 Respond  
Conipto   -  Mar 09, 2007

I don\'t understand. \"ENABLEHBOMB UNKNOWN COMMAND\" and it doesn\'t respond on the settings command, nor thepassthebomb one.

 Respond  
Alfreido   -  Jan 23, 2007

It was a feature I added in very late which I didn\'t test out. It\'s probably one I would remove, since this was designed with the idea that the person would run a bot seperately and the bot would not get involved.

 Respond  
CaptainHollyShort   -  Aug 23, 2006

Well, I like the idea. It even inspired me to make my game (not a ripoff from your though!!) and put it on my bot. One question though... what\'s the point of %meplays, really? The events are all On Text...you\'d have to do an on input the exact same as the on text.

 Respond  
KuTsuM   -  Oct 05, 2005

not bad, a little sloppy, but it\'s good

 Respond  
Alfreido   -  Oct 05, 2005

Thanks, RaPiD. Yeah, first script I\'ve released, don\'t be too harsh on the scoring :P

I\'ve just added in a new settings, %meplaying, which allows people to throw the bomb to you, the person hosting the script, if it\'s 0, people can\'t throw to you.

 Respond  
Noutrious   -  Oct 05, 2005

Pretty good due ;) continue like this!

 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.