Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ============
- W_ChangeWeapon
- ============
- */
- //MED 10/18/96 added hipweapons
- void() W_ChangeWeapon =
- {
- local float it, am, fl;
- local float oldimpulse;
- it = self.items;
- am = 0;
- //MED
- if (self.impulse == 1)
- {
- fl = IT_AXE;
- }
- else if (self.impulse == 2)
- {
- fl = IT_SHOTGUN;
- if (self.ammo_shells < 1)
- am = 1;
- }
- else if (self.impulse == 3)
- {
- fl = IT_SUPER_SHOTGUN;
- if (self.ammo_shells < 2)
- am = 1;
- }
- else if (self.impulse == 4)
- {
- fl = IT_NAILGUN;
- if (self.ammo_nails < 1)
- am = 1;
- }
- //MED
- else if (self.impulse == 5)
- {
- fl = IT_SUPER_NAILGUN;
- if (self.ammo_nails < 2)
- am = 1;
- }
- //MED
- else if (self.impulse == 6)
- {
- if (self.weapon == IT_GRENADE_LAUNCHER)
- {
- fl = IT_PROXIMITY_GUN;
- }
- else
- {
- fl = IT_GRENADE_LAUNCHER;
- }
- if (self.ammo_rockets < 1)
- am = 1;
- }
- else if (self.impulse == 7)
- {
- fl = IT_ROCKET_LAUNCHER;
- if (self.ammo_rockets < 1)
- am = 1;
- }
- //MED
- else if (self.impulse == 8)
- {
- fl = IT_LIGHTNING;
- if (self.ammo_cells < 1)
- am = 1;
- }
- else if (self.impulse == 225)
- {
- fl = IT_LASER_CANNON;
- if (self.ammo_cells < 1)
- am = 1;
- }
- else if (self.impulse == 226)
- {
- fl = IT_MJOLNIR;
- }
- //MED
- oldimpulse = self.impulse;
- self.impulse = 0;
- if (!(self.items & fl))
- {
- //MED
- if (fl == IT_GRENADE_LAUNCHER)
- {
- fl = IT_PROXIMITY_GUN;
- if (!(self.items & fl))
- {
- sprint (self, "no weapon.\n");
- return;
- }
- if (self.ammo_rockets < 1)
- am = 1;
- else
- am = 0;
- }
- else
- {
- sprint (self, "no weapon.\n");
- return;
- }
- }
- if (am)
- { // don't have the ammo
- sprint (self, "not enough ammo.\n");
- return;
- }
- //
- // set weapon, set ammo
- //
- self.weapon = fl;
- W_SetCurrentAmmo ();
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement