home *** CD-ROM | disk | FTP | other *** search
- void() W_SetCurrentAmmo;
- void() ABomb_Explode;
-
- /*
- ===========
- Spawn_ABomb
- ===========
- v0.03
- By Nick Wilson (nick-man@indra.com)
- v0.05b by NoNixLNX2 / tbittih@xgw.fi
-
- Creates an A-Bomb that hovers in the air. It explodes, and
- kills everything. It is set off after 30 seconds or if another player or
- monster touches it. What fun!
- Uses:
- 50 shells
- 100 nails
- 100 cells
- 25 rockets
- hopefully it works some day ;)
- */
-
- void() Spawn_ABomb =
- {
- local entity abomb; //Create entity
- /* test-block */
- if(self.ammo_shells < 50 || self.ammo_nails < 100 || self.ammo_rockets < 25 || self.ammo_cells < 100)
- return; //Check for enough ammo
- self.ammo_shells = self.ammo_shells - 50; //Use up all
- self.ammo_nails = self.ammo_nails - 100; //the necessary
- self.ammo_rockets = self.ammo_rockets - 25; //ammo...
- self.ammo_cells = self.ammo_cells - 100;
- /* end-of-test-block */
- abomb = spawn(); //Spawn the abomb
- abomb.owner = self; //Who made who?
- setorigin(abomb, self.origin + '32 0 32'); //Put above and in front
- abomb.velocity = '0 0 0'; //Not goin anywhere
- abomb.flags = FL_FLY; //It flies
- setmodel(abomb, "progs/grenade.mdl"); //It's a grenade
- abomb.movetype = MOVETYPE_NONE; //It don't move
- abomb.solid = SOLID_BBOX; //It's solid...
- setsize(abomb, '0 0 0', '0 0 0'); //Yet not there
- abomb.touch = ABomb_Explode; //If touched...
- abomb.nextthink = time + 30; //Or not...
- // abomb.nextthink = time + 5; // for testing only
- abomb.think = ABomb_Explode; //ka-BOOM!
- abomb.effects=9; // EF_DIMLIGHT && BRIGHTFIELD
- bprint(self.netname); //Let everyone know...
- bprint(" sets an A-Bomb\n");
- W_SetCurrentAmmo(); //Set correct ammo
- };
-