Use entityDefs instead of hard-coded item pickups

This commit is contained in:
Marco Cawthorne 2023-05-08 11:17:52 -07:00
parent 6dd45060c2
commit 0b2955695a
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
28 changed files with 223 additions and 134 deletions

View File

@ -456,12 +456,4 @@ weapon_t w_crossbow =
.isempty = w_crossbow_isempty,
.type = w_crossbow_type,
.hudpic = w_crossbow_hudpic
};
#ifdef SERVER
void
weapon_crossbow(void)
{
Weapons_InitItem(WEAPON_CROSSBOW);
}
#endif
};

View File

@ -238,12 +238,3 @@ weapon_t w_crowbar =
.type = w_crowbar_type,
.hudpic = w_crowbar_hudpic
};
/* entity definitions for pickups */
#ifdef SERVER
void
weapon_crowbar(void)
{
Weapons_InitItem(WEAPON_CROWBAR);
}
#endif

View File

@ -342,10 +342,4 @@ weapon_t w_egon =
.isempty = w_egon_isempty,
.type = w_egon_type,
.predraw = w_egon_postdraw
};
#ifdef SERVER
void weapon_egon(void) {
Weapons_InitItem(WEAPON_EGON);
}
#endif
};

View File

@ -472,9 +472,3 @@ weapon_t w_gauss =
.type = w_gauss_type,
.hudpic = w_gauss_hudpic
};
#ifdef SERVER
void weapon_gauss(void) {
Weapons_InitItem(WEAPON_GAUSS);
}
#endif

View File

@ -419,18 +419,3 @@ weapon_t w_glock =
.type = w_glock_type,
.hudpic = w_glock_hudpic
};
/* pickups */
#ifdef SERVER
void
weapon_9mmhandgun(void)
{
Weapons_InitItem(WEAPON_GLOCK);
}
void
weapon_glock(void)
{
Weapons_InitItem(WEAPON_GLOCK);
}
#endif

View File

@ -282,10 +282,4 @@ weapon_t w_handgrenade =
.isempty = w_handgrenade_isempty,
.type = w_handgrenade_type,
.hudpic = w_handgrenade_hudpic
};
#ifdef SERVER
void weapon_handgrenade(void) {
Weapons_InitItem(WEAPON_HANDGRENADE);
}
#endif
};

View File

@ -320,12 +320,4 @@ weapon_t w_hornetgun =
.isempty = w_hornetgun_isempty,
.type = w_hornetgun_type,
.hudpic = w_hornetgun_hudpic
};
#ifdef SERVER
void
weapon_hornetgun(void)
{
Weapons_InitItem(WEAPON_HORNETGUN);
}
#endif
};

View File

@ -460,18 +460,4 @@ weapon_t w_mp5 =
.isempty = w_mp5_isempty,
.type = w_mp5_type,
.hudpic = w_mp5_hudpic
};
#ifdef SERVER
void
weapon_9mmAR(void)
{
Weapons_InitItem(WEAPON_MP5);
}
void
weapon_mp5(void)
{
Weapons_InitItem(WEAPON_MP5);
}
#endif
};

View File

@ -375,19 +375,4 @@ weapon_t w_python =
.isempty = w_python_isempty,
.type = w_python_type,
.hudpic = w_python_hudpic
};
/* pickups */
#ifdef SERVER
void
weapon_357(void)
{
Weapons_InitItem(WEAPON_PYTHON);
}
void
weapon_python(void)
{
Weapons_InitItem(WEAPON_PYTHON);
}
#endif
};

View File

@ -371,9 +371,3 @@ weapon_t w_rpg =
.type = w_rpg_type,
.hudpic = w_rpg_hudpic
};
#ifdef SERVER
void weapon_rpg(void) {
Weapons_InitItem(WEAPON_RPG);
}
#endif

View File

@ -351,11 +351,3 @@ weapon_t w_satchel =
.type = w_satchel_type,
.hudpic = w_satchel_hudpic
};
#ifdef SERVER
void
weapon_satchel(void)
{
Weapons_InitItem(WEAPON_SATCHEL);
}
#endif

View File

@ -447,12 +447,4 @@ weapon_t w_shotgun =
.isempty = w_shotgun_isempty,
.type = w_shotgun_type,
.hudpic = w_shotgun_hudpic
};
#ifdef SERVER
void
weapon_shotgun(void)
{
Weapons_InitItem(WEAPON_SHOTGUN);
}
#endif
};

View File

@ -361,10 +361,4 @@ weapon_t w_snark =
.isempty = w_snark_isempty,
.type = w_snark_type,
.hudpic = w_snark_hudpic
};
#ifdef SERVER
void weapon_snark(void) {
Weapons_InitItem(WEAPON_SNARK);
}
#endif
};

View File

@ -408,14 +408,4 @@ weapon_t w_tripmine =
.isempty = w_tripmine_isempty,
.type = w_tripmine_type,
.hudpic = w_tripmine_hudpic
};
#ifdef SERVER
void
weapon_tripmine(void) {
item_pickup ip = (item_pickup)self;
Weapons_InitItem(WEAPON_TRIPMINE);
ip.SetBody(2);
ip.SetFrame(8);
}
#endif
};

View File

@ -0,0 +1,19 @@
entityDef weapon_357
{
"editor_color" ".3 .3 1"
"editor_mins" "-16 -16 -16"
"editor_maxs" "16 16 16"
"editor_usage" ".367 Revolver"
"editor_rotatable" "1"
"spawnclass" "NSItem"
"model" "models/w_357.mdl"
"inv_item" "3"
"snd_acquire" "weapon.pickup"
"snd_respawn" "item.respawn"
}
entityDef weapon_python
{
"spawnclass" "weapon_357"
}

View File

@ -0,0 +1,19 @@
entityDef weapon_9mmAR
{
"editor_color" ".3 .3 1"
"editor_mins" "-16 -16 -16"
"editor_maxs" "16 16 16"
"editor_usage" "9mm AR"
"editor_rotatable" "1"
"spawnclass" "NSItem"
"model" "models/w_9mmAR.mdl"
"inv_item" "4"
"snd_acquire" "weapon.pickup"
"snd_respawn" "item.respawn"
}
entityDef weapon_mp5
{
"spawnclass" "weapon_9mmAR"
}

View File

@ -0,0 +1,19 @@
entityDef weapon_9mmhandgun
{
"editor_color" ".3 .3 1"
"editor_mins" "-16 -16 -16"
"editor_maxs" "16 16 16"
"editor_usage" "9mm Handgun"
"editor_rotatable" "1"
"spawnclass" "NSItem"
"model" "models/w_9mmhandgun.mdl"
"inv_item" "2"
"snd_acquire" "weapon.pickup"
"snd_respawn" "item.respawn"
}
entityDef weapon_glock
{
"spawnclass" "weapon_9mmhandgun"
}

View File

@ -0,0 +1,14 @@
entityDef weapon_crossbow
{
"editor_color" ".3 .3 1"
"editor_mins" "-16 -16 -16"
"editor_maxs" "16 16 16"
"editor_usage" "Crossbow"
"editor_rotatable" "1"
"spawnclass" "NSItem"
"model" "models/w_crossbow.mdl"
"inv_item" "6"
"snd_acquire" "weapon.pickup"
"snd_respawn" "item.respawn"
}

View File

@ -0,0 +1,14 @@
entityDef weapon_crowbar
{
"editor_color" ".3 .3 1"
"editor_mins" "-16 -16 -16"
"editor_maxs" "16 16 16"
"editor_usage" "Crowbar"
"editor_rotatable" "1"
"spawnclass" "NSItem"
"model" "models/w_crowbar.mdl"
"inv_item" "1"
"snd_acquire" "weapon.pickup"
"snd_respawn" "item.respawn"
}

View File

@ -0,0 +1,14 @@
entityDef weapon_egon
{
"editor_color" ".3 .3 1"
"editor_mins" "-16 -16 -16"
"editor_maxs" "16 16 16"
"editor_usage" "Gluon Gun"
"editor_rotatable" "1"
"spawnclass" "NSItem"
"model" "models/w_egon.mdl"
"inv_item" "9"
"snd_acquire" "weapon.pickup"
"snd_respawn" "item.respawn"
}

View File

@ -0,0 +1,14 @@
entityDef weapon_gauss
{
"editor_color" ".3 .3 1"
"editor_mins" "-16 -16 -16"
"editor_maxs" "16 16 16"
"editor_usage" "Tau Cannon"
"editor_rotatable" "1"
"spawnclass" "NSItem"
"model" "models/w_gauss.mdl"
"inv_item" "8"
"snd_acquire" "weapon.pickup"
"snd_respawn" "item.respawn"
}

View File

@ -0,0 +1,14 @@
entityDef weapon_handgrenade
{
"editor_color" ".3 .3 1"
"editor_mins" "-16 -16 -16"
"editor_maxs" "16 16 16"
"editor_usage" "Hand Grenade"
"editor_rotatable" "1"
"spawnclass" "NSItem"
"model" "models/w_grenade.mdl"
"inv_item" "11"
"snd_acquire" "weapon.pickup"
"snd_respawn" "item.respawn"
}

View File

@ -0,0 +1,14 @@
entityDef weapon_hornetgun
{
"editor_color" ".3 .3 1"
"editor_mins" "-16 -16 -16"
"editor_maxs" "16 16 16"
"editor_usage" "Hornet Gun"
"editor_rotatable" "1"
"spawnclass" "NSItem"
"model" "models/w_hgun.mdl"
"inv_item" "10"
"snd_acquire" "weapon.pickup"
"snd_respawn" "item.respawn"
}

View File

@ -0,0 +1,14 @@
entityDef weapon_rpg
{
"editor_color" ".3 .3 1"
"editor_mins" "-16 -16 -16"
"editor_maxs" "16 16 16"
"editor_usage" "Rocket Launcher"
"editor_rotatable" "1"
"spawnclass" "NSItem"
"model" "models/w_rpg.mdl"
"inv_item" "7"
"snd_acquire" "weapon.pickup"
"snd_respawn" "item.respawn"
}

View File

@ -0,0 +1,14 @@
entityDef weapon_satchel
{
"editor_color" ".3 .3 1"
"editor_mins" "-16 -16 -16"
"editor_maxs" "16 16 16"
"editor_usage" "Satchel"
"editor_rotatable" "1"
"spawnclass" "NSItem"
"model" "models/w_satchel.mdl"
"inv_item" "12"
"snd_acquire" "weapon.pickup"
"snd_respawn" "item.respawn"
}

View File

@ -0,0 +1,14 @@
entityDef weapon_shotgun
{
"editor_color" ".3 .3 1"
"editor_mins" "-16 -16 -16"
"editor_maxs" "16 16 16"
"editor_usage" "Shotgun"
"editor_rotatable" "1"
"spawnclass" "NSItem"
"model" "models/w_shotgun.mdl"
"inv_item" "5"
"snd_acquire" "weapon.pickup"
"snd_respawn" "item.respawn"
}

View File

@ -0,0 +1,15 @@
entityDef weapon_snark
{
"editor_color" ".3 .3 1"
"editor_mins" "-16 -16 -16"
"editor_maxs" "16 16 16"
"editor_usage" "Snark"
"editor_rotatable" "1"
"spawnclass" "NSItem"
"model" "models/w_sqknest.mdl"
"frame" "1"
"inv_item" "14"
"snd_acquire" "weapon.pickup"
"snd_respawn" "item.respawn"
}

View File

@ -0,0 +1,16 @@
entityDef weapon_tripmine
{
"editor_color" ".3 .3 1"
"editor_mins" "-16 -16 -16"
"editor_maxs" "16 16 16"
"editor_usage" "Tripmine"
"editor_rotatable" "1"
"spawnclass" "NSItem"
"model" "models/v_tripmine.mdl"
"body" "2"
"frame" "8"
"inv_item" "13"
"snd_acquire" "weapon.pickup"
"snd_respawn" "item.respawn"
}