Author Topic: IRC Bomb v1.01  (Read 4685 times)

0 Members and 1 Guest are viewing this topic.

Offline freestyler

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 326
IRC Bomb v1.01
« on: June 05, 2009, 03:03:26 pm »
Script Name: IRC Bomb
Script Description: Plant a bomb on someone and watch him trying to defuse it
Author: fri
Compile Test: Passed
Core Version: 2.6.5

Full Description:
If you have planted a bomb on someone on IRC at least once then you know what it is. Given limited amount of time, you have to cut a wire to defuse the bomb. If you cut the wrong one or you don't make it in time, then you explode.
However, if you manage to defuse the bomb, player who had bombed you gets a nice pack of explosives.

I saw another IRC Bomb here on the forums, but this one is more configurable and 'random'.

Commands:
(admin) /bomb - plants a bomb on randomly selected player (except you, unless you're the only one on the server)
(admin) /bomb ID - plants a bomb on player with that ID
/cut 1, /cut 2, ... - cut wire 1/2/...



(procedure 'nova' by Avarax)

Edit - version 1.01:
- fixed resetting values of wireactive (it looped from 1 to 0)
- changed all bomb-specific values to one type (idea by y0uRd34th)
- slight texts changes





« Last Edit: May 10, 2014, 12:41:15 pm by freestyler »

Offline Google [Bot]

  • Major(1)
  • Posts: 18
Re: IRC Bomb
« Reply #1 on: June 05, 2009, 03:08:32 pm »
Nice script
very hot ;o

Offline demoniac93

  • Veteran
  • *****
  • Posts: 1554
Re: IRC Bomb
« Reply #2 on: June 05, 2009, 04:12:25 pm »
This one seems even better, the bomb looks huge, and I like the wire deal...
b&

Offline VinceBros

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 275
Re: IRC Bomb
« Reply #3 on: June 05, 2009, 06:00:29 pm »
It looks damnly nice :O
Does the wires are randoms to defuse them ?
Good work and ideaz d00d! :)

Offline freestyler

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 326
Re: IRC Bomb
« Reply #4 on: June 05, 2009, 06:22:40 pm »
Yes, the bomb timer, number of wires and their 'functions' are all random. If there are more than two wires then one is the defusing one, one doing nothing at all (blank) and the rest make the bomb explode when cut.

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5037
Re: IRC Bomb
« Reply #5 on: June 05, 2009, 07:39:12 pm »
Wow, the random wire to cut thing within a certain time period is an amazingly unique idea! I'm starting to like the direction server scripts are going! :)
There are other worlds than these

Offline Furai

  • Administrator
  • Veteran
  • *****
  • Posts: 1908
    • TransHuman Design
Re: IRC Bomb
« Reply #6 on: June 05, 2009, 08:10:58 pm »
Question here. Can you setup amount of max/min wires? It would be nice if that possibility was there.
Only admins can start the procedure?
"My senses are so powerful that I can hear the blood pumping through your veins."

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: IRC Bomb
« Reply #7 on: June 05, 2009, 10:17:09 pm »
Lol I didn't expect to see defusable ones for scripting. Nice job.

Offline freestyler

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 326
Re: IRC Bomb
« Reply #8 on: June 06, 2009, 03:27:13 am »
Question here. Can you setup amount of max/min wires? It would be nice if that possibility was there.
Yes, you just have to edit const values in ircbomb.pas:
Code: [Select]
const
  maxnum  = 16; // maximum playerID possible on server, set it higher than number of slots (suggested: slots + 2)
  penalty = 5; // how many points (kills) is taken from the player who survives explosion
  bombtimermin = 15; // minimum possible bomb timer
  bombtimermax = 30; // max
  wiremin = 3; // minimum number of wires sticking out of the bomb
  wiremax = 5; // max
The script forces 'extreme' values if they are too low or too high:
- bombtimermin: minimum 5 seconds
- bombtimermax: maximum 180 seconds (3 minutes)
- wiremin: 2 wires
- wiremax: 10 wires


Only admins can start the procedure?

Yes. If you want to allow everyone to use it, delete whole OnCommand and replace OnPlayerCommand with this:
Code: [Select]
function onplayercommand(id: byte; text: string): boolean;
  var whichtocut, target, timer: byte;
  begin
    if lowercase(copy(text, 1, 5)) = '/bomb' then if id <> 255 then begin
      if length(text) <= 6 then target := randomplayer(id) // if player can't decide then (randomly) make someone happy
        else target := strtoint(getpiece(text, ' ', 1));
      if getplayerstat(target, 'active') = false then begin
        writeconsole(id, 'No such player.', cbad);
        exit;
      end;
      if bombtimer[target] > 0 then begin // if target is already happy then don't put a new bomb on him
        writeconsole(id, idtoname(target) + ' has a bomb on him already...', cmid);
        exit;
      end;
      timer := xrandom(minimumtimer, maximumtimer);
      plantbomb(target, timer); // harrr.
      terrorist[target] := id; // terrorist - player who planted a bomb on someone
      writeconsole(id, inttostr(timer) + '-second bomb planted on ' + idtoname(target) + '!', cgood);
    end;
    if lowercase(getpiece(text, ' ', 0)) = '/cut' then begin
      if bombtimer[id] < 0 then exit else begin
        try whichtocut := strtoint(getpiece(text, ' ', 1));
        except
          writeconsole(id, 'This is not a number. Use /cut 1-' + inttostr(wirenum[id]) + ', i.e. /cut 1', cmid);
          exit;
        end;
        if (whichtocut >= 1) and (whichtocut <= wirenum[id]) then begin
          writeconsole(terrorist[id], idtoname(id) + ' is cutting wire no. ' + inttostr(whichtocut) + '...', cmid);
          defuse(id, whichtocut);
        end else writeconsole(id, 'Wrong wire number. Remaining wires: [ ' + remainingwires(id) + ']', cmid);
      end; 
    end;
    result := false;
  end;

Offline y0uRd34th

  • Camper
  • ***
  • Posts: 325
  • [i]Look Signature![/i]
Re: IRC Bomb
« Reply #9 on: June 06, 2009, 05:09:09 am »
Well done, when im looking into the older bomb scripts i see u put work into this :D
You may put all these arrays into one type, if you know how to use it.

DarkCrusade

  • Guest
Re: IRC Bomb
« Reply #10 on: June 06, 2009, 07:12:53 am »
HOT :o wanna see this on some servers :)