Bomb game

By Tidum on Nov 26, 2010

It's a bomb game played in a window. It saves the scores and is very fun.

on 1:LOAD:{
  set %bwin 0
  set %blose 0
  set %buse 0
  echo -a ***Bomb game loaded. Type /bomb to start.
}
on 1:INPUT:@Bomb:{
  if ($1 == bomb) {
    set %bomb on
    set %bomb.time $r(15,45)
    set %bomb.color $r(1,4)
    window -xe0 @Bomb
    aline -h @Bomb A bomb has just been placed in front of you.
    .timer 1 1 aline -h @Bomb You have %bomb.time seconds to defuse it.
    .timer 1 2 aline -h @Bomb Colors are 04Red00, 12Blue00, 08Yellow00, and 09Green00.
    .timerbomb 1 %bomb.time bomb.time.lose
  }
  elseif ($1 == red) {
    if (%bomb == on) {
      if (%bomb.color == 1) {
        aline -x @Bomb You defused the bomb!
        inc %bwin
        .timer 1 2 aline -x @Bomb You've defused the bomb %bwin $iif(%bwin == 1,time,times) $+ .
        .timerbomb off
        unset %bomb*
        unset %bomb
      }
      else {
        aline -x @Bomb BOOM! You died.
        inc %blose
        .timer 1 2 aline -x @Bomb You've died by the bomb %blose $iif(%blose == 1,time,times) $+ .
        .timerbomb off
        unset %bomb*
        unset %bomb
      }
    }
  }
  elseif ($1 == blue) {
    if (%bomb == on) {
      if (%bomb.color == 2) {
        aline -x @Bomb You defused the bomb!
        inc %bwin
        .timer 1 2 aline -x @Bomb You've defused the bomb %bwin $iif(%bwin == 1,time,times) $+ .
        .timerbomb off
        unset %bomb*
        unset %bomb
      }
      else {
        aline -x @Bomb BOOM! You died.
        inc %blose
        .timer 1 2 aline -x @Bomb You've died by the bomb %blose $iif(%blose == 1,time,times) $+ .
        .timerbomb off
        unset %bomb*
        unset %bomb
      }
    }
  }
  elseif ($1 == yellow) {
    if (%bomb == on) {
      if (%bomb.color == 3) {
        aline -x @Bomb You defused the bomb!
        inc %bwin
        .timer 1 2 aline -x @Bomb You've defused the bomb %bwin $iif(%bwin == 1,time,times) $+ .
        .timerbomb off
        unset %bomb*
        unset %bomb
      }
      else {
        aline -x @Bomb BOOM! You died.
        inc %blose
        .timer 1 2 aline -x @Bomb You've died by the bomb %blose $iif(%blose == 1,time,times) $+ .
        .timerbomb off
        unset %bomb.*
        unset %bomb
      }
    }
  }
  elseif ($1 == green) {
    if (%bomb == on) {
      if (%bomb.color == 4) {
        aline -x @Bomb You defused the bomb!
        inc %bwin
        .timer 1 2 aline -x @Bomb You've defused the bomb %bwin $iif(%bwin == 1,time,times) $+ .
        .timerbomb off
        unset %bomb.*
        unset %bomb
      }
      else {
        aline -x @Bomb BOOM! You died.
        inc %blose
        .timer 1 2 aline -x @Bomb You've died by the bomb %blose $iif(%blose == 1,time,times) $+ .
        .timerbomb off
        unset %bomb.*
        unset %bomb
      }
    }
  }
  elseif ($1 == stats) {
    aline -x @Bomb The bomb has been used %buse $iif(%buse == 1,time,times) $+ . You've defused it %bwin times and died %blose $iif(%blose == 1,time,times) $+ .
  }
}
menu @Bomb {
  Bomb:bomb
  Colors
  .Red:.msg @Bomb Red
  .Blue:.msg @Bomb Blue
  .Yellow:.msg @Bomb Yellow
  .Green:.msg @Bomb Green
  Stats:aline -x @Bomb The bomb has been used %buse $iif(%buse == 1,time,times) $+ . You've defused it %bwin $iif(%bwin == 1,time,times) $+  and died %blose $iif(%blose == 1,time,times) $+ .
  Reset Stats:{ 
    set %buse 0
    set %bwin 0
    set %blose 0
    aline -x @Bomb Stats have been reset.
  }
}
alias bomb {
  inc %buse
  set %bomb on
  set %bomb.time $r(15,45)
  set %bomb.color $r(1,4)
  window -xe0 @Bomb
  aline -h @Bomb A bomb has just been placed in front of you.
  .timer 1 1 aline -h @Bomb You have %bomb.time seconds to defuse it.
  .timer 1 2 aline -h @Bomb Colors are 04Red00, 12Blue00, 08Yellow00, and 09Green00.
  .timerbomb 1 %bomb.time bomb.time.lose
}
alias -l bomb.time.lose {
  .timerbomb off
  aline -x @Bomb BOOM! You died.
  inc %blose
  .timer 1 2 aline -x @Bomb You've died by the bomb %blose times.
  unset %bomb.*
  unset %bomb
}

Comments

Sign in to comment.
Dark|   -  Nov 26, 2010

;D

 Respond  
Tidum   -  Nov 26, 2010

Thanks.

 Respond  
Dark|   -  Nov 26, 2010

Yep, Nice job btw

 Respond  
Tidum   -  Nov 26, 2010

Yeah, especially the ones that are buggy.

 Respond  
Dark|   -  Nov 26, 2010

Most are fun yea, :P the ones that kick are kinda annoying

 Respond  
Tidum   -  Nov 26, 2010

lol yeah, I love them.

 Respond  
Dark|   -  Nov 26, 2010

Hmmm Alot of bomb gams xD

 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.