From: bcantric@nyx10.cs.du.edu (Macky Stingray)

In game.con, you can put this in instead of the usual "actor RUBBERCAN":
 

[ ... first 25-30 or so lines of game.con here ...]

// Rubber-maid trash can. Grey with red top. Seen in movie theater mostly.
actor RUBBERCAN WEAK
  // If we've been shot with something that's not the flame thrower or RPG.
  ifaction RUBCANDENT
  { ifactioncount 16                     // Can breaks after 16 hits.
    { strength 0 action RUBCAN break }
  }
  // If we're being hit with a weapon of any sort, check for...
  else ifhitweapon
  {
   // When hit by flame thrower, 4/5 chance of putting down flamer ammo.
   ifwasweapon THROWFLAME {
     state rats                           // Spawn some rats.
     // About one in 10 chance the flamethrower starts trash can burning.
     // If it does burn, the ammo burns up and an explosion happens.
     ifrnd 128 {
       hitradius 1024 WEAKEST WEAK MEDIUMSTRENGTH TOUGH  // Big explosion.
       spawn EXPLOSION2
       debris SCRAP2 2                       // Some junk flies, of course.
       sound PIPEBOMB_EXPLODE                // Sounds like an explosion to me!
       spawn BURNING                         // Burn baby burn!
     }
     // If it's not burning, then give them the ammo!
     else {
       debris SCRAP3 12                      // Throw some debris,
       spawn FUELCAN                         //  and put some flamer ammo.
     }
     killit                                  // Then always kill trash can.
   }
   // If we were hit by the RPG or trip-bomb explosion...
   else ifwasweapon RADIUSEXPLOSION {     
     state rats                              // Always do rats.
     // When a can blows, put down tripbomb (about 9/10 chance) or
     // flame-thrower. (about 1/10 chance) 
     ifrnd 25 { 
       spawn FLAMETHROWERSPRITE              // 1/10: Put out a flamer.
     }
     else {
       spawn TRIPBOMBSPRITE                  // But usually put out a t-bomb.
     }
     debris SCRAP3 12                       // Some debris always scatter.
     killit                                 // Then always kill trash can.
   }
   // Otherwise we were hit by some normal kind of weapon. Do the usual
   // dent-and-rebound thing.
   else action RUBCANDENT
  }
enda

[ ... rest of game.con here ... ]

  This only modifies those red-grey trash-cans in the theater lobby. Other
trash-cans will do their usual things. I think the comments in the code
explain what the modification does pretty well, but let me lay it out
explicitly:

  If you shoot a trash can with any normal kind of weapon (that is to say,
anything that doesn't cause an explosion: pistol, shotgun, chaingun) it'll
just dent and bounce back.  (Don't you wish everything was made like
rubber-maid? ;])

  If you hit a trash can with a "radius" weapon (that is, anything that
causes an explosion: rpg, pipe-bomb explosion, trip-mine explosion) then
the trashcan has a 1/10 chance of dropping a flame-thrower. It also has a
9/10 chance of dropping some laser trip-bombs. Of course, because there
are no sprites for the flame-thrower or trip-bomb, you can't tell which
the trash-can has dropped. (Actually, since there are no sprites, you
can't tell that the trash can has dropped ANYTHING, but it has.)

  When you hit a trash-can with a flame-thrower burst, it always turns
into flame-thrower ammo. This is good and bad... it's good because you
have a 9/10 chance of getting some more ammo for the flame-thrower, which
is a real ammo-hog. However, it's bad because once in a while (random
1/10 chance) the flame-thrower ammo inside the trash-can is highly
flammable and will, due to weak packaging (nobody ever expected anybody
to aim a flame-thrower at flame-thrower ammo) will explode violently!

         --Ben Cantrick. Email to cantrick@nyx10.nyx.net--

