Random ammo and powerups

Version:

1.0

Added on:

04 Feb 2013 00:39

Tags:

Description:
Does exactly what it says.
  1. int num;
  2.  
  3. void onFunction0() {
  4.    num = (jjRandom()%9) + 1;      //random number from 1 to 9.
  5.        p.powerup[num] = true;
  6.        p.currWeapon = num;
  7.        if (num > 1) p.ammo[num] = 50;  //no ammo for the blaster
  8.        switch (num) {
  9.           case 1: p.showText("Blaster!"); break;
  10.           case 2: p.showText("Bouncer!"); break;
  11.           case 3: p.showText("Freezer!"); break;
  12.           case 4: p.showText("Seeker!"); break;
  13.           case 5: p.showText("RF!"); break;
  14.           case 6: p.showText("Toaster!"); break;
  15.           case 7: p.showText("TNT!"); break;
  16.           case 8: p.showText("Pepper Spray!"); break;
  17.           case 9: p.showText("Electro Blaster"); break;
  18.        }
  19. }