djcev.com

//

Git Repos / fte_dogmode / qc / triggers / take_weapon.qc

Last update to this file was on 2024-03-24 at 02:40.

Show take_weapon.qc

//==============================================================================
// trigger_take_weapon
//==============================================================================

//======================================================================
// GIVE AND TAKE STUFF (WIP)
// This is Axe only at the moment. Need to research removing all weapons.
//======================================================================

//======================================================================
// forward declarations
//======================================================================

void() trigger_take_weapon_touch;
void(entity e) trigger_take_weapon_init;
void() trigger_take_weapon;

//------------------------------------------------------------------------------

/*QUAKED trigger_take_weapon (.5 .5 .5) ? X X X X X X X X NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER X NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY

Removes shotgun upon touch. You can also set "reset_items" in the worldspawn entity to accomplish an axe only start.
*/
//----------------------------------------------------------------------
// class trigger_take_weapon: base_multiple
// {
//--------------------------------------------------------------
// trigger_take_weapon_use
// thanks to ShanJaq and Spike for their help on this.
//--------------------------------------------------------------
void() trigger_take_weapon_touch =
{
// from Copper -- dumptruck_ds
if (sub_checkvalidtouch(other) == FALSE)
return;

if (!(other.flags & FL_CLIENT))
return;

base_multiple_fire ();
other.items &= ~IT_SHOTGUN;
other.currentammo = !other.ammo_shells;
other.ammo_shells = !other.ammo_shells;
other.items = other.items - (other.items & IT_SHELLS);

if (other.classtype == CT_PLAYER)
{
player_set_current_ammo ();
player_best_weapon ();
}
};

//--------------------------------------------------------------
void(entity e) trigger_take_weapon_init =
{
e.classname = "trigger_take_weapon";
e.classtype = CT_TRIGGER_TAKE_WEAPON;
e.touch = trigger_take_weapon_touch;
e.wait = -1;

base_multiple_init (e);
sub_checkwaiting (e);
};

//--------------------------------------------------------------
void() trigger_take_weapon =
{
// new spawnflags for all entities -- iw
if (SUB_Inhibit())
return;

trigger_take_weapon_init (self);
};
// };

Return to the top of this page or return to the overview of this repo.

Log take_weapon.qc

Date Commit Message Author + -
2024-03-24 2nd pass refactor, rework QC class structure cev +39 -19
2024-02-18 Client/player, projectiles, entrypoints refactor cev +2 -2
2024-01-09 Continue OO / Class-based refactor cev +15 -16
2023-12-09 Start OO / class-based refactor, work on items cev +41 -30
2023-11-20 changes to movement, build environment, file reorg cev +44  

Return to the top of this page or return to the overview of this repo.