Went over weapon-drop logic to handle ammo, undroppable weapons.

Added basic intermission logic to HL:DM for fraglimit/timelimit being hit.
Cleaned up WeaponAPI to get rid of killicons, which should be handled
elsewhere.
This commit is contained in:
Marco Cawthorne 2020-04-26 13:17:19 +02:00
parent 46f720d562
commit 0c0b9938b7
128 changed files with 765 additions and 739 deletions

View File

@ -63,6 +63,7 @@ var int MUZZLE_WEIRD;
vector video_mins;
vector video_res;
vector mouse_pos;
int g_iIntermission;
int g_iWorldInitialized;

View File

@ -248,6 +248,11 @@ CSQC_UpdateView(float w, float h, float focus)
setproperty(VF_MIN, video_mins);
setproperty(VF_SIZE, video_res);
setproperty(VF_ANGLES, view_angles + pl.punchangle);
if (g_iIntermission) {
view_angles = pSeat->m_vecCameraAngle + [sin(time), sin(time * 2)] * 5;
}
setproperty(VF_DRAWWORLD, 1);
if (g_skyscale != 0 && g_skypos) {
@ -296,7 +301,9 @@ CSQC_UpdateView(float w, float h, float focus)
#endif
View_PostDraw();
if (focus == TRUE) {
if (g_iIntermission) {
Scores_Draw();
} else if (focus == TRUE) {
GameText_Draw();
// The spectator sees things... differently
@ -456,6 +463,11 @@ CSQC_Parse_Event(void)
float fHeader = readbyte();
switch (fHeader) {
case EV_INTERMISSION:
g_iIntermission = TRUE;
pSeat->m_vecCameraOrigin = getproperty(VF_ORIGIN);
pSeat->m_vecCameraAngle = getproperty(VF_ANGLES);
break;
case EV_MUSICTRACK:
Music_ParseTrack();
break;

View File

@ -42,14 +42,14 @@ Obituary_KillIcon(int id, float w)
/* fill in the entries and calculate some in advance */
if (w > 0) {
mtrsize = drawgetimagesize(g_weapons[w].ki_spr);
/*mtrsize = drawgetimagesize(g_weapons[w].ki_spr);
g_obituary[id].mtr = g_weapons[w].ki_spr;
g_obituary[id].pos = g_weapons[w].ki_xy;
g_obituary[id].size = g_weapons[w].ki_size;
g_obituary[id].coord[0] = g_weapons[w].ki_xy[0] / mtrsize[0];
g_obituary[id].coord[1] = g_weapons[w].ki_xy[1] / mtrsize[1];
g_obituary[id].bounds[0] = g_weapons[w].ki_size[0] / mtrsize[0];
g_obituary[id].bounds[1] = g_weapons[w].ki_size[1] / mtrsize[1];
g_obituary[id].bounds[1] = g_weapons[w].ki_size[1] / mtrsize[1];*/
} else {
/* generic splat icon */
g_obituary[id].mtr = "sprites/640hud1.spr_0.tga";

View File

@ -119,7 +119,7 @@ armoury_entity::touch(void)
if (m_iItem == 17 || m_iItem == 16)
return;
if (Weapons_AddItem((player)other, m_iItem) == FALSE) {
if (Weapons_AddItem((player)other, m_iItem, -1) == FALSE) {
return;
}

View File

@ -94,7 +94,7 @@ CSEv_BuyWeapon_f(float fWeapon)
}
}
Weapons_AddItem(pl, iWeapon);
Weapons_AddItem(pl, iWeapon, -1);
Money_AddMoney(pl, -g_cstrikeWeaponPrice[iWeapon]);
Sound_Play(pl, CHAN_ITEM, "buy.weapon");
} else {
@ -142,15 +142,15 @@ CSEv_BuyEquipment_f(float fUtil)
Sound_Play(pl, CHAN_ITEM, "buy.kevlar");
break;
case 2:
Weapons_AddItem(pl, WEAPON_FLASHBANG);
Weapons_AddItem(pl, WEAPON_FLASHBANG, -1);
Sound_Play(pl, CHAN_ITEM, "buy.weapon");
break;
case 3:
Weapons_AddItem(pl, WEAPON_HEGRENADE);
Weapons_AddItem(pl, WEAPON_HEGRENADE, -1);
Sound_Play(pl, CHAN_ITEM, "buy.weapon");
break;
case 4:
Weapons_AddItem(pl, WEAPON_SMOKEGRENADE);
Weapons_AddItem(pl, WEAPON_SMOKEGRENADE, -1);
Sound_Play(pl, CHAN_ITEM, "buy.weapon");
break;
case 5:

View File

@ -27,6 +27,32 @@ CSMultiplayerRules::MaxItemPerSlot(int slot)
void
CSMultiplayerRules::PlayerDeath(player pl)
{
/* obituary networking */
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EV_OBITUARY);
if (g_dmg_eAttacker.netname)
WriteString(MSG_MULTICAST, g_dmg_eAttacker.netname);
else
WriteString(MSG_MULTICAST, g_dmg_eAttacker.classname);
WriteString(MSG_MULTICAST, pl.netname);
WriteByte(MSG_MULTICAST, g_dmg_iWeapon);
WriteByte(MSG_MULTICAST, 0);
msg_entity = world;
multicast([0,0,0], MULTICAST_ALL);
/* death-counter */
pl.deaths++;
forceinfokey(pl, "*deaths", ftos(pl.deaths));
/* update score-counter */
if (g_dmg_eTarget.flags & FL_CLIENT || g_dmg_eTarget.flags & FL_MONSTER)
if (g_dmg_eAttacker.flags & FL_CLIENT) {
if (g_dmg_eTarget == g_dmg_eAttacker || g_dmg_eTarget.team == g_dmg_eAttacker.team)
g_dmg_eAttacker.frags--;
else
g_dmg_eAttacker.frags++;
}
/* clear all ammo and inventory... */
PlayerClearWeaponry(pl);
@ -356,7 +382,7 @@ CSMultiplayerRules::BuyingPossible(player pl)
void
CSMultiplayerRules::MakeBomber(player pl)
{
Weapons_AddItem(pl, WEAPON_C4BOMB);
Weapons_AddItem(pl, WEAPON_C4BOMB, -1);
centerprint(pl, "You have the bomb!\nFind the target zone or DROP\nthe bomb for another Terrorist.");
}
@ -778,13 +804,13 @@ CSMultiplayerRules::PlayerMakePlayable(player pl, int chara)
}
pl.g_items |= ITEM_SUIT;
Weapons_AddItem(pl, WEAPON_KNIFE);
Weapons_AddItem(pl, WEAPON_KNIFE, -1);
if (chara < 5) {
/* terrorists */
pl.team = TEAM_T;
if (autocvar_fcs_knifeonly == FALSE) {
Weapons_AddItem(pl, WEAPON_GLOCK18);
Weapons_AddItem(pl, WEAPON_GLOCK18, -1);
/*Weapon_GiveAmmo(WEAPON_GLOCK18, 40);*/
/*Weapon_Draw(WEAPON_GLOCK18);*/
} else {
@ -794,9 +820,8 @@ CSMultiplayerRules::PlayerMakePlayable(player pl, int chara)
/* counter */
pl.team = TEAM_CT;
Weapons_AddItem(pl, WEAPON_KNIFE);
if (autocvar_fcs_knifeonly == FALSE) {
Weapons_AddItem(pl, WEAPON_USP45);
Weapons_AddItem(pl, WEAPON_USP45, -1);
/*Weapon_GiveAmmo(WEAPON_USP45, 24);*/
/*Weapon_Draw(WEAPON_USP45);*/
} else {

View File

@ -53,33 +53,33 @@ Game_Input(void)
pl.health = 100;
pl.armor = 100;
Weapons_AddItem(pl, WEAPON_M3);
Weapons_AddItem(pl, WEAPON_XM1014);
Weapons_AddItem(pl, WEAPON_MP5);
Weapons_AddItem(pl, WEAPON_P90);
Weapons_AddItem(pl, WEAPON_UMP45);
Weapons_AddItem(pl, WEAPON_MAC10);
Weapons_AddItem(pl, WEAPON_TMP);
Weapons_AddItem(pl, WEAPON_AK47);
Weapons_AddItem(pl, WEAPON_SG552);
Weapons_AddItem(pl, WEAPON_M4A1);
Weapons_AddItem(pl, WEAPON_AUG);
Weapons_AddItem(pl, WEAPON_SCOUT);
Weapons_AddItem(pl, WEAPON_AWP);
Weapons_AddItem(pl, WEAPON_G3SG1);
Weapons_AddItem(pl, WEAPON_SG550);
Weapons_AddItem(pl, WEAPON_PARA);
Weapons_AddItem(pl, WEAPON_C4BOMB);
Weapons_AddItem(pl, WEAPON_FLASHBANG);
Weapons_AddItem(pl, WEAPON_HEGRENADE);
Weapons_AddItem(pl, WEAPON_SMOKEGRENADE);
Weapons_AddItem(pl, WEAPON_USP45);
Weapons_AddItem(pl, WEAPON_GLOCK18);
Weapons_AddItem(pl, WEAPON_DEAGLE);
Weapons_AddItem(pl, WEAPON_P228);
Weapons_AddItem(pl, WEAPON_ELITES);
Weapons_AddItem(pl, WEAPON_FIVESEVEN);
Weapons_AddItem(pl, WEAPON_KNIFE);
Weapons_AddItem(pl, WEAPON_M3, -1);
Weapons_AddItem(pl, WEAPON_XM1014, -1);
Weapons_AddItem(pl, WEAPON_MP5, -1);
Weapons_AddItem(pl, WEAPON_P90, -1);
Weapons_AddItem(pl, WEAPON_UMP45, -1);
Weapons_AddItem(pl, WEAPON_MAC10, -1);
Weapons_AddItem(pl, WEAPON_TMP, -1);
Weapons_AddItem(pl, WEAPON_AK47, -1);
Weapons_AddItem(pl, WEAPON_SG552, -1);
Weapons_AddItem(pl, WEAPON_M4A1, -1);
Weapons_AddItem(pl, WEAPON_AUG, -1);
Weapons_AddItem(pl, WEAPON_SCOUT, -1);
Weapons_AddItem(pl, WEAPON_AWP, -1);
Weapons_AddItem(pl, WEAPON_G3SG1, -1);
Weapons_AddItem(pl, WEAPON_SG550, -1);
Weapons_AddItem(pl, WEAPON_PARA, -1);
Weapons_AddItem(pl, WEAPON_C4BOMB, -1);
Weapons_AddItem(pl, WEAPON_FLASHBANG, -1);
Weapons_AddItem(pl, WEAPON_HEGRENADE, -1);
Weapons_AddItem(pl, WEAPON_SMOKEGRENADE, -1);
Weapons_AddItem(pl, WEAPON_USP45, -1);
Weapons_AddItem(pl, WEAPON_GLOCK18, -1);
Weapons_AddItem(pl, WEAPON_DEAGLE, -1);
Weapons_AddItem(pl, WEAPON_P228, -1);
Weapons_AddItem(pl, WEAPON_ELITES, -1);
Weapons_AddItem(pl, WEAPON_FIVESEVEN, -1);
Weapons_AddItem(pl, WEAPON_KNIFE, -1);
}
if (self.impulse == 102) {

View File

@ -69,3 +69,11 @@ enumflags
GF_SEMI_TOGGLED,
GF_GAMESTARTS
};
/* damage related tempglobals, like trace_* */
entity g_dmg_eAttacker;
entity g_dmg_eTarget;
int g_dmg_iDamage;
int g_dmg_iHitBody;
int g_dmg_iFlags;
int g_dmg_iWeapon;

View File

@ -110,6 +110,36 @@ CGameRules::MaxItemPerSlot(int slot)
return -1;
}
void
CGameRules::IntermissionStart(void)
{
if (m_iIntermission)
return;
m_iIntermission = TRUE;
m_flIntermissionTime = time + 5.0f;
/* make the clients aware */
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EV_INTERMISSION);
msg_entity = world;
multicast([0,0,0], MULTICAST_ALL);
}
void
CGameRules::IntermissionEnd(void)
{
if (!m_iIntermission)
return;
if (time < m_flIntermissionTime)
return;
if (!(input_buttons & INPUT_BUTTON0) && !(input_buttons & INPUT_BUTTON2))
return;
localcmd("restart\n");
}
void
CGameRules::CGameRules(void)
{

View File

@ -16,6 +16,9 @@
class CGameRules
{
int m_iIntermission;
float m_flIntermissionTime;
void() CGameRules;
virtual void(void) InitPostEnts;
@ -40,6 +43,10 @@ class CGameRules
virtual int(int) MaxItemPerSlot;
/* end of a game */
virtual void(void) IntermissionStart;
virtual void(void) IntermissionEnd;
/* spectator */
/*virtual void(player) SpectatorConnect;
virtual void(player) SpectatorDisconnect;

View File

@ -43,30 +43,30 @@ Game_Input(void)
pl.health = 100;
pl.armor = 100;
pl.g_items |= ITEM_SUIT;
Weapons_AddItem(pl, WEAPON_CROWBAR);
Weapons_AddItem(pl, WEAPON_GLOCK);
Weapons_AddItem(pl, WEAPON_PYTHON);
Weapons_AddItem(pl, WEAPON_MP5);
Weapons_AddItem(pl, WEAPON_SHOTGUN);
Weapons_AddItem(pl, WEAPON_CROSSBOW);
Weapons_AddItem(pl, WEAPON_RPG);
Weapons_AddItem(pl, WEAPON_GAUSS);
Weapons_AddItem(pl, WEAPON_EGON);
Weapons_AddItem(pl, WEAPON_HORNETGUN);
Weapons_AddItem(pl, WEAPON_HANDGRENADE);
Weapons_AddItem(pl, WEAPON_SATCHEL);
Weapons_AddItem(pl, WEAPON_TRIPMINE);
Weapons_AddItem(pl, WEAPON_SNARK);
Weapons_AddItem(pl, WEAPON_PENGUIN);
Weapons_AddItem(pl, WEAPON_PIPEWRENCH);
Weapons_AddItem(pl, WEAPON_KNIFE);
Weapons_AddItem(pl, WEAPON_GRAPPLE);
Weapons_AddItem(pl, WEAPON_EAGLE);
Weapons_AddItem(pl, WEAPON_M249);
Weapons_AddItem(pl, WEAPON_SHOCKRIFLE);
Weapons_AddItem(pl, WEAPON_SPORELAUNCHER);
Weapons_AddItem(pl, WEAPON_SNIPERRIFLE);
Weapons_AddItem(pl, WEAPON_DISPLACER);
Weapons_AddItem(pl, WEAPON_CROWBAR, -1);
Weapons_AddItem(pl, WEAPON_GLOCK, -1);
Weapons_AddItem(pl, WEAPON_PYTHON, -1);
Weapons_AddItem(pl, WEAPON_MP5, -1);
Weapons_AddItem(pl, WEAPON_SHOTGUN, -1);
Weapons_AddItem(pl, WEAPON_CROSSBOW, -1);
Weapons_AddItem(pl, WEAPON_RPG, -1);
Weapons_AddItem(pl, WEAPON_GAUSS, -1);
Weapons_AddItem(pl, WEAPON_EGON, -1);
Weapons_AddItem(pl, WEAPON_HORNETGUN, -1);
Weapons_AddItem(pl, WEAPON_HANDGRENADE, -1);
Weapons_AddItem(pl, WEAPON_SATCHEL, -1);
Weapons_AddItem(pl, WEAPON_TRIPMINE, -1);
Weapons_AddItem(pl, WEAPON_SNARK, -1);
Weapons_AddItem(pl, WEAPON_PENGUIN, -1);
Weapons_AddItem(pl, WEAPON_PIPEWRENCH, -1);
Weapons_AddItem(pl, WEAPON_KNIFE, -1);
Weapons_AddItem(pl, WEAPON_GRAPPLE, -1);
Weapons_AddItem(pl, WEAPON_EAGLE, -1);
Weapons_AddItem(pl, WEAPON_M249, -1);
Weapons_AddItem(pl, WEAPON_SHOCKRIFLE, -1);
Weapons_AddItem(pl, WEAPON_SPORELAUNCHER, -1);
Weapons_AddItem(pl, WEAPON_SNIPERRIFLE, -1);
Weapons_AddItem(pl, WEAPON_DISPLACER, -1);
}
if (self.impulse == 102) {

View File

@ -49,27 +49,27 @@ void Game_Input(void)
pl.health = 100;
pl.armor = 100;
pl.g_items |= ITEM_SUIT;
Weapons_AddItem(pl, WEAPON_CROWBAR);
Weapons_AddItem(pl, WEAPON_SHOVEL);
Weapons_AddItem(pl, WEAPON_SPANNER);
Weapons_AddItem(pl, WEAPON_GLOCK);
Weapons_AddItem(pl, WEAPON_PYTHON);
Weapons_AddItem(pl, WEAPON_AP9);
Weapons_AddItem(pl, WEAPON_TAURUS);
Weapons_AddItem(pl, WEAPON_MP5);
Weapons_AddItem(pl, WEAPON_SHOTGUN);
Weapons_AddItem(pl, WEAPON_CROSSBOW);
Weapons_AddItem(pl, WEAPON_SNIPER);
Weapons_AddItem(pl, WEAPON_SNIPER2);
Weapons_AddItem(pl, WEAPON_RPG);
Weapons_AddItem(pl, WEAPON_GAUSS);
Weapons_AddItem(pl, WEAPON_EGON);
Weapons_AddItem(pl, WEAPON_CHAINGUN);
Weapons_AddItem(pl, WEAPON_HANDGRENADE);
Weapons_AddItem(pl, WEAPON_SATCHEL);
Weapons_AddItem(pl, WEAPON_TRIPMINE);
Weapons_AddItem(pl, WEAPON_SNARK);
Weapons_AddItem(pl, WEAPON_MEDKIT);
Weapons_AddItem(pl, WEAPON_CROWBAR, -1);
Weapons_AddItem(pl, WEAPON_SHOVEL, -1);
Weapons_AddItem(pl, WEAPON_SPANNER, -1);
Weapons_AddItem(pl, WEAPON_GLOCK, -1);
Weapons_AddItem(pl, WEAPON_PYTHON, -1);
Weapons_AddItem(pl, WEAPON_AP9, -1);
Weapons_AddItem(pl, WEAPON_TAURUS, -1);
Weapons_AddItem(pl, WEAPON_MP5, -1);
Weapons_AddItem(pl, WEAPON_SHOTGUN, -1);
Weapons_AddItem(pl, WEAPON_CROSSBOW, -1);
Weapons_AddItem(pl, WEAPON_SNIPER, -1);
Weapons_AddItem(pl, WEAPON_SNIPER2, -1);
Weapons_AddItem(pl, WEAPON_RPG, -1);
Weapons_AddItem(pl, WEAPON_GAUSS, -1);
Weapons_AddItem(pl, WEAPON_EGON, -1);
Weapons_AddItem(pl, WEAPON_CHAINGUN, -1);
Weapons_AddItem(pl, WEAPON_HANDGRENADE, -1);
Weapons_AddItem(pl, WEAPON_SATCHEL, -1);
Weapons_AddItem(pl, WEAPON_TRIPMINE, -1);
Weapons_AddItem(pl, WEAPON_SNARK, -1);
Weapons_AddItem(pl, WEAPON_MEDKIT, -1);
}
if (self.impulse == 102) {

View File

@ -14,6 +14,15 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
void
HLMultiplayerRules::FrameStart(void)
{
if (cvar("mp_timelimit") != 0)
if (time >= (cvar("mp_timelimit") * 60)) {
IntermissionStart();
}
}
void
HLMultiplayerRules::PlayerDeath(player pl)
{

View File

@ -42,13 +42,13 @@ Game_Input(void)
if (self.impulse == 101) {
pl.health = 100;
pl.armor = 100;
Weapons_AddItem(pl, WEAPON_HEATERPIPE);
Weapons_AddItem(pl, WEAPON_BRADNAILER);
Weapons_AddItem(pl, WEAPON_NAILGUN);
Weapons_AddItem(pl, WEAPON_SHOTGUN);
Weapons_AddItem(pl, WEAPON_CMLWBR);
Weapons_AddItem(pl, WEAPON_XS);
Weapons_AddItem(pl, WEAPON_SATCHEL);
Weapons_AddItem(pl, WEAPON_HEATERPIPE, -1);
Weapons_AddItem(pl, WEAPON_BRADNAILER, -1);
Weapons_AddItem(pl, WEAPON_NAILGUN, -1);
Weapons_AddItem(pl, WEAPON_SHOTGUN, -1);
Weapons_AddItem(pl, WEAPON_CMLWBR, -1);
Weapons_AddItem(pl, WEAPON_XS, -1);
Weapons_AddItem(pl, WEAPON_SATCHEL, -1);
}
if (self.impulse == 102) {

View File

@ -14,6 +14,15 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
void
HLMultiplayerRules::FrameStart(void)
{
if (cvar("mp_timelimit") != 0)
if (time >= (cvar("mp_timelimit") * 60)) {
IntermissionStart();
}
}
void
HLMultiplayerRules::PlayerDeath(player pl)
{

View File

@ -42,15 +42,15 @@ Game_Input(void)
if (self.impulse == 101) {
pl.health = 100;
pl.armor = 100;
Weapons_AddItem(pl, WEAPON_FISTS);
Weapons_AddItem(pl, WEAPON_GAUSSPISTOL);
Weapons_AddItem(pl, WEAPON_BEAMGUN);
Weapons_AddItem(pl, WEAPON_CHEMICALGUN);
Weapons_AddItem(pl, WEAPON_DML);
Weapons_AddItem(pl, WEAPON_MINIGUN);
Weapons_AddItem(pl, WEAPON_AICORE);
Weapons_AddItem(pl, WEAPON_SHOTGUN);
Weapons_AddItem(pl, WEAPON_GRENADE);
Weapons_AddItem(pl, WEAPON_FISTS, -1);
Weapons_AddItem(pl, WEAPON_GAUSSPISTOL, -1);
Weapons_AddItem(pl, WEAPON_BEAMGUN, -1);
Weapons_AddItem(pl, WEAPON_CHEMICALGUN, -1);
Weapons_AddItem(pl, WEAPON_DML, -1);
Weapons_AddItem(pl, WEAPON_MINIGUN, -1);
Weapons_AddItem(pl, WEAPON_AICORE, -1);
Weapons_AddItem(pl, WEAPON_SHOTGUN, -1);
Weapons_AddItem(pl, WEAPON_GRENADE, -1);
}
if (self.impulse == 102) {

View File

@ -94,23 +94,23 @@ void SHData_GetItems(player pl)
pl.ammo_m203_grenade = 3;
pl.ammo_rocket = 5;
pl.ammo_snark = 10;
Weapons_AddItem(pl, WEAPON_CROWBAR);
Weapons_AddItem(pl, WEAPON_GLOCK);
Weapons_AddItem(pl, WEAPON_PYTHON);
Weapons_AddItem(pl, WEAPON_MP5);
Weapons_AddItem(pl, WEAPON_SHOTGUN);
Weapons_AddItem(pl, WEAPON_CROSSBOW);
Weapons_AddItem(pl, WEAPON_RPG);
Weapons_AddItem(pl, WEAPON_GAUSS);
Weapons_AddItem(pl, WEAPON_EGON);
Weapons_AddItem(pl, WEAPON_HORNETGUN);
Weapons_AddItem(pl, WEAPON_HANDGRENADE);
Weapons_AddItem(pl, WEAPON_SATCHEL);
Weapons_AddItem(pl, WEAPON_TRIPMINE);
Weapons_AddItem(pl, WEAPON_SNARK);
Weapons_AddItem(pl, WEAPON_CANNON);
Weapons_AddItem(pl, WEAPON_CHAINSAW);
Weapons_AddItem(pl, WEAPON_HAMMER);
Weapons_AddItem(pl, WEAPON_CROWBAR, -1);
Weapons_AddItem(pl, WEAPON_GLOCK, -1);
Weapons_AddItem(pl, WEAPON_PYTHON, -1);
Weapons_AddItem(pl, WEAPON_MP5, -1);
Weapons_AddItem(pl, WEAPON_SHOTGUN, -1);
Weapons_AddItem(pl, WEAPON_CROSSBOW, -1);
Weapons_AddItem(pl, WEAPON_RPG, -1);
Weapons_AddItem(pl, WEAPON_GAUSS, -1);
Weapons_AddItem(pl, WEAPON_EGON, -1);
Weapons_AddItem(pl, WEAPON_HORNETGUN, -1);
Weapons_AddItem(pl, WEAPON_HANDGRENADE, -1);
Weapons_AddItem(pl, WEAPON_SATCHEL, -1);
Weapons_AddItem(pl, WEAPON_TRIPMINE, -1);
Weapons_AddItem(pl, WEAPON_SNARK, -1);
Weapons_AddItem(pl, WEAPON_CANNON, -1);
Weapons_AddItem(pl, WEAPON_CHAINSAW, -1);
Weapons_AddItem(pl, WEAPON_HAMMER, -1);
}
void SHData_Parse(string map)

View File

@ -109,64 +109,64 @@ CSEv_TeamJoin_f(float f)
switch (f) {
case CLASS_SCOUT:
Weapons_AddItem(pl, WEAPON_CROWBAR);
Weapons_AddItem(pl, WEAPON_SBS);
Weapons_AddItem(pl, WEAPON_NAILGUN);
Weapons_AddItem(pl, WEAPON_CROWBAR, -1);
Weapons_AddItem(pl, WEAPON_SBS, -1);
Weapons_AddItem(pl, WEAPON_NAILGUN, -1);
env_message_single(pl, "HELP_SCOUT");
break;
case CLASS_SNIPER:
Weapons_AddItem(pl, WEAPON_CROWBAR);
Weapons_AddItem(pl, WEAPON_SNIPER);
Weapons_AddItem(pl, WEAPON_AUTORIFLE);
Weapons_AddItem(pl, WEAPON_NAILGUN);
Weapons_AddItem(pl, WEAPON_CROWBAR, -1);
Weapons_AddItem(pl, WEAPON_SNIPER, -1);
Weapons_AddItem(pl, WEAPON_AUTORIFLE, -1);
Weapons_AddItem(pl, WEAPON_NAILGUN, -1);
env_message_single(pl, "HELP_SNIPER");
break;
case CLASS_SOLDIER:
Weapons_AddItem(pl, WEAPON_CROWBAR);
Weapons_AddItem(pl, WEAPON_SBS);
Weapons_AddItem(pl, WEAPON_DBS);
Weapons_AddItem(pl, WEAPON_RPG);
Weapons_AddItem(pl, WEAPON_CROWBAR, -1);
Weapons_AddItem(pl, WEAPON_SBS, -1);
Weapons_AddItem(pl, WEAPON_DBS, -1);
Weapons_AddItem(pl, WEAPON_RPG, -1);
env_message_single(pl, "HELP_SOLDIER");
break;
case CLASS_DEMO:
Weapons_AddItem(pl, WEAPON_CROWBAR);
Weapons_AddItem(pl, WEAPON_SBS);
Weapons_AddItem(pl, WEAPON_GLAUNCHER);
Weapons_AddItem(pl, WEAPON_PIPEBOMB);
Weapons_AddItem(pl, WEAPON_CROWBAR, -1);
Weapons_AddItem(pl, WEAPON_SBS, -1);
Weapons_AddItem(pl, WEAPON_GLAUNCHER, -1);
Weapons_AddItem(pl, WEAPON_PIPEBOMB, -1);
env_message_single(pl, "HELP_DEMOMAN");
break;
case CLASS_MEDIC:
Weapons_AddItem(pl, WEAPON_MEDKIT);
Weapons_AddItem(pl, WEAPON_SBS);
Weapons_AddItem(pl, WEAPON_DBS);
Weapons_AddItem(pl, WEAPON_SUPERNAIL);
Weapons_AddItem(pl, WEAPON_MEDKIT, -1);
Weapons_AddItem(pl, WEAPON_SBS, -1);
Weapons_AddItem(pl, WEAPON_DBS, -1);
Weapons_AddItem(pl, WEAPON_SUPERNAIL, -1);
env_message_single(pl, "HELP_MEDIC");
break;
case CLASS_HVYWEAPON:
Weapons_AddItem(pl, WEAPON_CROWBAR);
Weapons_AddItem(pl, WEAPON_SBS);
Weapons_AddItem(pl, WEAPON_DBS);
Weapons_AddItem(pl, WEAPON_ASSCAN);
Weapons_AddItem(pl, WEAPON_CROWBAR, -1);
Weapons_AddItem(pl, WEAPON_SBS, -1);
Weapons_AddItem(pl, WEAPON_DBS, -1);
Weapons_AddItem(pl, WEAPON_ASSCAN, -1);
env_message_single(pl, "HELP_HWGUY");
break;
case CLASS_PYRO:
Weapons_AddItem(pl, WEAPON_CROWBAR);
Weapons_AddItem(pl, WEAPON_SBS);
Weapons_AddItem(pl, WEAPON_FLAMER);
Weapons_AddItem(pl, WEAPON_INCENDIARY);
Weapons_AddItem(pl, WEAPON_CROWBAR, -1);
Weapons_AddItem(pl, WEAPON_SBS, -1);
Weapons_AddItem(pl, WEAPON_FLAMER, -1);
Weapons_AddItem(pl, WEAPON_INCENDIARY, -1);
env_message_single(pl, "HELP_PYRO");
break;
case CLASS_SPY:
Weapons_AddItem(pl, WEAPON_KNIFE);
Weapons_AddItem(pl, WEAPON_TRANQUIL);
Weapons_AddItem(pl, WEAPON_DBS);
Weapons_AddItem(pl, WEAPON_NAILGUN);
Weapons_AddItem(pl, WEAPON_KNIFE, -1);
Weapons_AddItem(pl, WEAPON_TRANQUIL, -1);
Weapons_AddItem(pl, WEAPON_DBS, -1);
Weapons_AddItem(pl, WEAPON_NAILGUN, -1);
env_message_single(pl, "HELP_SPY");
break;
case CLASS_ENGINEER:
Weapons_AddItem(pl, WEAPON_WRENCH);
Weapons_AddItem(pl, WEAPON_RAILGUN);
Weapons_AddItem(pl, WEAPON_DBS);
Weapons_AddItem(pl, WEAPON_WRENCH, -1);
Weapons_AddItem(pl, WEAPON_RAILGUN, -1);
Weapons_AddItem(pl, WEAPON_DBS, -1);
env_message_single(pl, "HELP_ENGINEER");
break;
}

View File

@ -14,24 +14,6 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* someone dieded */
void
Damage_Obituary(entity c, entity t, float weapon, float flags)
{
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EV_OBITUARY);
if (c.netname) {
WriteString(MSG_MULTICAST, c.netname);
} else {
WriteString(MSG_MULTICAST, c.classname);
}
WriteString(MSG_MULTICAST, t.netname);
WriteByte(MSG_MULTICAST, weapon);
WriteByte(MSG_MULTICAST, flags);
msg_entity = self;
multicast([0,0,0], MULTICAST_ALL);
}
/* generic function that applies damage, pain and suffering */
void
Damage_Apply(entity t, entity c, float dmg, int w, int type)
@ -69,6 +51,14 @@ Damage_Apply(entity t, entity c, float dmg, int w, int type)
dmg = rint(dmg);
t.health -= dmg;
/* the globals... */
g_dmg_eAttacker = c;
g_dmg_eTarget = t;
g_dmg_iDamage = dmg;
g_dmg_iHitBody = trace_surface_id;
g_dmg_iFlags = type;
g_dmg_iWeapon = w;
if (dmg > 0) {
t.dmg_take = dmg;
t.dmg_inflictor = c;
@ -76,30 +66,12 @@ Damage_Apply(entity t, entity c, float dmg, int w, int type)
t.health = t.max_health;
}
// Target is dead and a client....
if (t.health <= 0) {
if (t.flags & FL_CLIENT) {
t.deaths++;
forceinfokey(t, "*deaths", ftos(t.deaths));
}
if (t.flags & FL_CLIENT || t.flags & FL_MONSTER)
if (c.flags & FL_CLIENT)
if (t == c)
c.frags--;
else
c.frags++;
}
/* set this global in case we need it later */
g_eAttacker = c;
CBaseEntity s = (CBaseEntity)t;
if (s.health <= 0) {
if (t.flags & FL_MONSTER || t.flags & FL_CLIENT) {
Damage_Obituary(c, t, w, 0);
}
if (s.flags & FL_CLIENT) {
rules.PlayerDeath((player)s);
} else {

View File

@ -37,6 +37,11 @@ class HLSingleplayerRules:HLGameRules
class HLMultiplayerRules:HLGameRules
{
int m_iIntermission;
int m_iIntermissionTime;
virtual void(void) FrameStart;
/* client */
virtual void(player) PlayerSpawn;
virtual void(player) PlayerDeath;

View File

@ -14,9 +14,50 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
void
HLMultiplayerRules::FrameStart(void)
{
if (cvar("mp_timelimit"))
if (time >= (cvar("mp_timelimit") * 60)) {
IntermissionStart();
}
}
void
HLMultiplayerRules::PlayerDeath(player pl)
{
/* obituary networking */
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EV_OBITUARY);
if (g_dmg_eAttacker.netname)
WriteString(MSG_MULTICAST, g_dmg_eAttacker.netname);
else
WriteString(MSG_MULTICAST, g_dmg_eAttacker.classname);
WriteString(MSG_MULTICAST, pl.netname);
WriteByte(MSG_MULTICAST, g_dmg_iWeapon);
WriteByte(MSG_MULTICAST, 0);
msg_entity = world;
multicast([0,0,0], MULTICAST_ALL);
/* death-counter */
pl.deaths++;
forceinfokey(pl, "*deaths", ftos(pl.deaths));
/* update score-counter */
if (pl.flags & FL_CLIENT || pl.flags & FL_MONSTER)
if (g_dmg_eAttacker.flags & FL_CLIENT) {
if (pl == g_dmg_eAttacker)
g_dmg_eAttacker.frags--;
else
g_dmg_eAttacker.frags++;
}
/* in DM we only care about the frags */
if (cvar("mp_fraglimit"))
if (g_dmg_eAttacker.frags >= cvar("mp_fraglimit")) {
IntermissionStart();
}
weaponbox_spawn(pl);
pl.movetype = MOVETYPE_NONE;
pl.solid = SOLID_NOT;

View File

@ -23,6 +23,13 @@ Handles impulse and whatnot
*/
void Game_Input(void)
{
CGameRules rules = (CGameRules)g_grMode;
if (rules.m_iIntermission) {
rules.IntermissionEnd();
return;
}
if (input_buttons & INPUT_BUTTON0) {
Weapons_Primary();
} else if (input_buttons & INPUT_BUTTON4) {
@ -52,20 +59,20 @@ void Game_Input(void)
pl.health = 100;
pl.armor = 100;
pl.g_items |= ITEM_SUIT;
Weapons_AddItem(pl, WEAPON_CROWBAR);
Weapons_AddItem(pl, WEAPON_GLOCK);
Weapons_AddItem(pl, WEAPON_PYTHON);
Weapons_AddItem(pl, WEAPON_MP5);
Weapons_AddItem(pl, WEAPON_SHOTGUN);
Weapons_AddItem(pl, WEAPON_CROSSBOW);
Weapons_AddItem(pl, WEAPON_RPG);
Weapons_AddItem(pl, WEAPON_GAUSS);
Weapons_AddItem(pl, WEAPON_EGON);
Weapons_AddItem(pl, WEAPON_HORNETGUN);
Weapons_AddItem(pl, WEAPON_HANDGRENADE);
Weapons_AddItem(pl, WEAPON_SATCHEL);
Weapons_AddItem(pl, WEAPON_TRIPMINE);
Weapons_AddItem(pl, WEAPON_SNARK);
Weapons_AddItem(pl, WEAPON_CROWBAR, -1);
Weapons_AddItem(pl, WEAPON_GLOCK, -1);
Weapons_AddItem(pl, WEAPON_PYTHON, -1);
Weapons_AddItem(pl, WEAPON_MP5, -1);
Weapons_AddItem(pl, WEAPON_SHOTGUN, -1);
Weapons_AddItem(pl, WEAPON_CROSSBOW, -1);
Weapons_AddItem(pl, WEAPON_RPG, -1);
Weapons_AddItem(pl, WEAPON_GAUSS, -1);
Weapons_AddItem(pl, WEAPON_EGON, -1);
Weapons_AddItem(pl, WEAPON_HORNETGUN, -1);
Weapons_AddItem(pl, WEAPON_HANDGRENADE, -1);
Weapons_AddItem(pl, WEAPON_SATCHEL, -1);
Weapons_AddItem(pl, WEAPON_TRIPMINE, -1);
Weapons_AddItem(pl, WEAPON_SNARK, -1);
}
if (self.impulse == 102) {

View File

@ -34,7 +34,7 @@ void item_pickup::touch(void)
}
/* don't remove if AddItem fails */
if (Weapons_AddItem((player)other, id) == FALSE) {
if (Weapons_AddItem((player)other, id, m_iClip) == FALSE) {
return;
}
@ -75,8 +75,10 @@ void item_pickup::Respawn(void)
think = __NULL__;
nextthink = -1;
if (!m_iWasDropped)
if (!m_iWasDropped) {
sound(this, CHAN_ITEM, "items/suitchargeok1.wav", 1, ATTN_NORM, 150);
m_iClip = -1;
}
droptofloor();
}

View File

@ -56,7 +56,7 @@ void Vox_Broadcast(string sMessage)
WriteByte(MSG_MULTICAST, EV_CHAT_VOX);
WriteString(MSG_MULTICAST, sMessage);
msg_entity = world;
multicast([0,0,0], MULTICAST_ALL);
multicast([0,0,0], MULTICAST_ALL);
}
/*

View File

@ -75,13 +75,16 @@ w_ak47_deathmsg(void)
}
int
w_ak47_pickup(int new)
w_ak47_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
if (new) {
pl.ak47_mag = 30;
if (startammo == -1)
pl.ak47_mag = 30;
else
pl.ak47_mag = startammo;
} else {
if (pl.ammo_762mm < 90) {
pl.ammo_762mm = bound(0, pl.ammo_762mm + 30, 90);
@ -244,12 +247,11 @@ w_ak47_hudpic(int selected, vector pos, float a)
weapon_t w_ak47 =
{
.id = ITEM_AK47,
.name = "ak47",
.id = ITEM_AK47,
.slot = 0,
.slot_pos = 7,
.ki_spr = "sprites/640hud1.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [192,80],
.allow_drop = TRUE,
.draw = w_ak47_draw,
.holster = __NULL__,
.primary = w_ak47_primary,

View File

@ -75,13 +75,16 @@ w_aug_deathmsg(void)
}
int
w_aug_pickup(int new)
w_aug_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
if (new) {
pl.aug_mag = 30;
if (startammo == -1)
pl.aug_mag = 30;
else
pl.aug_mag = startammo;
} else {
if (pl.ammo_762mm < 90) {
pl.ammo_762mm = bound(0, pl.ammo_762mm + 30, 90);
@ -269,27 +272,26 @@ w_aug_hudpic(int selected, vector pos, float a)
weapon_t w_aug =
{
ITEM_AUG,
0,
10,
"sprites/640hud1.spr_0.tga",
[44,16],
[148,240],
w_aug_draw,
__NULL__,
w_aug_primary,
w_aug_secondary,
w_aug_reload,
w_cstrike_weaponrelease,
w_aug_hud,
w_aug_precache,
w_aug_pickup,
w_aug_updateammo,
w_aug_wmodel,
w_aug_pmodel,
w_aug_deathmsg,
w_aug_aimanim,
w_aug_hudpic
.name = "aug",
.id = ITEM_AUG,
.slot = 0,
.slot_pos = 10,
.allow_drop = TRUE,
.draw = w_aug_draw,
.holster = __NULL__,
.primary = w_aug_primary,
.secondary = w_aug_secondary,
.reload = w_aug_reload,
.release = w_cstrike_weaponrelease,
.crosshair = w_aug_hud,
.precache = w_aug_precache,
.pickup = w_aug_pickup,
.updateammo = w_aug_updateammo,
.wmodel = w_aug_wmodel,
.pmodel = w_aug_pmodel,
.deathmsg = w_aug_deathmsg,
.aimanim = w_aug_aimanim,
.hudpic = w_aug_hudpic
};
#ifdef SERVER

View File

@ -75,13 +75,16 @@ w_awp_deathmsg(void)
}
int
w_awp_pickup(int new)
w_awp_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
if (new) {
pl.awp_mag = 10;
if (startammo == -1)
pl.awp_mag = 10;
else
pl.awp_mag = startammo;
} else {
if (pl.ammo_338mag < 20) {
pl.ammo_338mag = bound(0, pl.ammo_338mag + 10, 20);
@ -295,12 +298,11 @@ w_awp_hudpic(int selected, vector pos, float a)
weapon_t w_awp =
{
"awp",
ITEM_AWP,
0,
12,
"sprites/640hud1.spr_0.tga",
[48,16],
[192,128],
TRUE,
w_awp_draw,
__NULL__,
w_awp_primary,

View File

@ -305,12 +305,11 @@ w_c4bomb_hudpic(int selected, vector pos, float a)
weapon_t w_c4bomb =
{
"c4",
ITEM_C4BOMB,
4,
0,
"sprites/640hud1.spr_0.tga",
[32,16],
[224,240],
TRUE,
w_c4bomb_draw,
__NULL__,
w_c4bomb_primary,

View File

@ -74,13 +74,16 @@ w_deagle_deathmsg(void)
}
int
w_deagle_pickup(int new)
w_deagle_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
if (new) {
pl.deagle_mag = 7;
if (startammo == -1)
pl.deagle_mag = 7;
else
pl.deagle_mag = startammo;
} else {
if (pl.ammo_50ae < AMMO_MAX_50AE) {
pl.ammo_50ae = bound(0, pl.ammo_50ae + 7, AMMO_MAX_50AE);
@ -249,12 +252,11 @@ w_deagle_hudpic(int selected, vector pos, float a)
weapon_t w_deagle =
{
"deagle",
ITEM_DEAGLE,
1,
2,
"sprites/640hud1.spr_0.tga",
[32,16],
[224,16],
TRUE,
w_deagle_draw,
__NULL__,
w_deagle_primary,

View File

@ -83,13 +83,16 @@ w_elites_deathmsg(void)
}
int
w_elites_pickup(int new)
w_elites_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
if (new) {
pl.elites_mag = 30;
if (startammo == -1)
pl.elites_mag = 30;
else
pl.elites_mag = startammo;
} else {
if (pl.ammo_9mm < 90) {
pl.ammo_9mm = bound(0, pl.ammo_9mm + 30, 90);
@ -300,12 +303,11 @@ w_elites_hudpic(int selected, vector pos, float a)
weapon_t w_elites =
{
"elites",
ITEM_ELITES,
1,
4,
"sprites/640hud1.spr_0.tga",
[57,16],
[52,240],
TRUE,
w_elites_draw,
__NULL__,
w_elites_primary,

View File

@ -74,13 +74,16 @@ w_fiveseven_deathmsg(void)
}
int
w_fiveseven_pickup(int new)
w_fiveseven_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
if (new) {
pl.fiveseven_mag = 20;
if (startammo == -1)
pl.fiveseven_mag = 20;
else
pl.fiveseven_mag = startammo;
} else {
if (pl.ammo_57mm < 40) {
pl.ammo_57mm = bound(0, pl.ammo_57mm + 20, 40);
@ -249,12 +252,11 @@ w_fiveseven_hudpic(int selected, vector pos, float a)
weapon_t w_fiveseven =
{
"fiveseven",
ITEM_FIVESEVEN,
1,
5,
"sprites/640hud16.spr_0.tga",
[48,16],
[192,0],
TRUE,
w_fiveseven_draw,
__NULL__,
w_fiveseven_primary,

View File

@ -57,7 +57,7 @@ w_flashbang_updateammo(player pl)
}
int
w_flashbang_pickup(int new)
w_flashbang_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -263,12 +263,11 @@ w_flashbang_hudpic(int selected, vector pos, float a)
weapon_t w_flashbang =
{
"flashbang",
ITEM_FLASHBANG,
3,
1,
"sprites/640hud1.spr_0.tga",
[48,16],
[192,192],
FALSE,
w_flashbang_draw,
__NULL__,
w_flashbang_primary,

View File

@ -73,13 +73,16 @@ w_g3sg1_deathmsg(void)
}
int
w_g3sg1_pickup(int new)
w_g3sg1_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
if (new) {
pl.g3sg1_mag = 20;
if (startammo == -1)
pl.g3sg1_mag = 20;
else
pl.g3sg1_mag = startammo;
} else {
if (pl.ammo_762mm < 60) {
pl.ammo_762mm = bound(0, pl.ammo_762mm + 20, 60);
@ -260,12 +263,11 @@ w_g3sg1_hudpic(int selected, vector pos, float a)
weapon_t w_g3sg1 =
{
"g3sg1",
ITEM_G3SG1,
0,
13,
"sprites/640hud1.spr_0.tga",
[48,16],
[192,144],
TRUE,
w_g3sg1_draw,
__NULL__,
w_g3sg1_primary,

View File

@ -84,13 +84,16 @@ w_glock18_deathmsg(void)
}
int
w_glock18_pickup(int new)
w_glock18_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
if (new) {
pl.glock18_mag = 20;
if (startammo == -1)
pl.glock18_mag = 20;
else
pl.glock18_mag = startammo;
} else {
if (pl.ammo_9mm < 40) {
pl.ammo_9mm = bound(0, pl.ammo_9mm + 20, 40);
@ -308,12 +311,11 @@ w_glock18_hudpic(int selected, vector pos, float a)
weapon_t w_glock18 =
{
"glock18",
ITEM_GLOCK18,
1,
1,
"sprites/640hud1.spr_0.tga",
[32,16],
[192,16],
TRUE,
w_glock18_draw,
__NULL__,
w_glock18_primary,

View File

@ -57,7 +57,7 @@ w_hegrenade_updateammo(player pl)
}
int
w_hegrenade_pickup(int new)
w_hegrenade_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -265,12 +265,11 @@ w_hegrenade_hudpic(int selected, vector pos, float a)
weapon_t w_hegrenade =
{
"hegrenade",
ITEM_HEGRENADE,
3,
0,
"sprites/640hud1.spr_0.tga",
[32,16],
[224,192],
FALSE,
w_hegrenade_draw,
__NULL__,
w_hegrenade_primary,

View File

@ -212,12 +212,11 @@ w_knife_hudpic(int selected, vector pos, float a)
weapon_t w_knife =
{
"knife",
ITEM_KNIFE,
2,
0,
"sprites/640hud1.spr_0.tga",
[48,16],
[192,0],
FALSE,
w_knife_draw,
__NULL__,
w_knife_primary,

View File

@ -83,13 +83,16 @@ w_m3_deathmsg(void)
}
int
w_m3_pickup(int new)
w_m3_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
if (new) {
pl.m3_mag = 8;
if (startammo == -1)
pl.m3_mag = 8;
else
pl.m3_mag = startammo;
} else {
if (pl.ammo_buckshot < AMMO_MAX_BUCKSHOT) {
pl.ammo_buckshot = bound(0, pl.ammo_buckshot + 8, AMMO_MAX_BUCKSHOT);
@ -284,12 +287,11 @@ w_m3_hudpic(int selected, vector pos, float a)
weapon_t w_m3 =
{
"m3",
ITEM_M3,
0,
0,
"sprites/640hud1.spr_0.tga",
[48,16],
[192,48],
TRUE,
w_m3_draw,
__NULL__,
w_m3_primary,

View File

@ -84,13 +84,16 @@ w_m4a1_deathmsg(void)
}
int
w_m4a1_pickup(int new)
w_m4a1_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
if (new) {
pl.m4a1_mag = 30;
if (startammo == -1)
pl.m4a1_mag = 30;
else
pl.m4a1_mag = startammo;
} else {
if (pl.ammo_556mm < AMMO_MAX_762MM) {
pl.ammo_556mm = bound(0, pl.ammo_556mm + 30, AMMO_MAX_762MM);
@ -334,12 +337,11 @@ w_m4a1_hudpic(int selected, vector pos, float a)
weapon_t w_m4a1 =
{
.id = ITEM_M4A1,
.name = "m4a1",
.id = ITEM_M4A1,
.slot = 0,
.slot_pos = 9,
.ki_spr = "sprites/640hud1.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [192,96],
.allow_drop = TRUE,
.draw = w_m4a1_draw,
.holster = __NULL__,
.primary = w_m4a1_primary,

View File

@ -74,13 +74,16 @@ w_mac10_deathmsg(void)
}
int
w_mac10_pickup(int new)
w_mac10_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
if (new) {
pl.mac10_mag = 30;
if (startammo == -1)
pl.mac10_mag = 30;
else
pl.mac10_mag = startammo;
} else {
if (pl.ammo_45acp < 90) {
pl.ammo_45acp = bound(0, pl.ammo_45acp + 30, 90);
@ -243,12 +246,11 @@ w_mac10_hudpic(int selected, vector pos, float a)
weapon_t w_mac10 =
{
"mac10",
ITEM_MAC10,
0,
5,
"sprites/640hud1.spr_0.tga",
[34,16],
[109,240],
TRUE,
w_mac10_draw,
__NULL__,
w_mac10_primary,

View File

@ -74,13 +74,16 @@ w_mp5_deathmsg(void)
}
int
w_mp5_pickup(int new)
w_mp5_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
if (new) {
pl.mp5_mag = 30;
if (startammo == -1)
pl.mp5_mag = 30;
else
pl.mp5_mag = startammo;
} else {
if (pl.ammo_9mm < AMMO_MAX_9MM) {
pl.ammo_9mm = bound(0, pl.ammo_9mm + 30, AMMO_MAX_9MM);
@ -248,12 +251,11 @@ w_mp5_hudpic(int selected, vector pos, float a)
weapon_t w_mp5 =
{
"mp5",
ITEM_MP5,
0,
2,
"sprites/640hud1.spr_0.tga",
[32,16],
[192,64],
TRUE,
w_mp5_draw,
__NULL__,
w_mp5_primary,

View File

@ -77,13 +77,16 @@ w_p228_deathmsg(void)
}
int
w_p228_pickup(int new)
w_p228_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
if (new) {
pl.p228_mag = 13;
if (startammo == -1)
pl.p228_mag = 13;
else
pl.p228_mag = startammo;
} else {
if (pl.ammo_357sig < 26) {
pl.ammo_357sig = bound(0, pl.ammo_357sig + 13, 26);
@ -256,12 +259,11 @@ w_p228_hudpic(int selected, vector pos, float a)
weapon_t w_p228 =
{
"p228",
ITEM_P228,
1,
3,
"sprites/640hud1.spr_0.tga",
[32,16],
[224,32],
TRUE,
w_p228_draw,
__NULL__,
w_p228_primary,

View File

@ -74,13 +74,16 @@ w_p90_deathmsg(void)
}
int
w_p90_pickup(int new)
w_p90_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
if (new) {
pl.p90_mag = 50;
if (startammo == -1)
pl.p90_mag = 50;
else
pl.p90_mag = startammo;
} else {
if (pl.ammo_57mm < 100) {
pl.ammo_57mm = bound(0, pl.ammo_57mm + 50, 100);
@ -244,12 +247,11 @@ w_p90_hudpic(int selected, vector pos, float a)
weapon_t w_p90 =
{
"p90",
ITEM_P90,
0,
3,
"sprites/640hud1.spr_0.tga",
[48,16],
[192,176],
TRUE,
w_p90_draw,
__NULL__,
w_p90_primary,

View File

@ -73,13 +73,16 @@ w_para_deathmsg(void)
}
int
w_para_pickup(int new)
w_para_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
if (new) {
pl.para_mag = 100;
if (startammo == -1)
pl.para_mag = 100;
else
pl.para_mag = startammo;
} else {
if (pl.ammo_556mmbox < 200) {
pl.ammo_556mmbox = bound(0, pl.ammo_556mmbox + 100, 200);
@ -240,12 +243,11 @@ w_para_hudpic(int selected, vector pos, float a)
weapon_t w_para =
{
"para",
ITEM_PARA,
0,
15,
"sprites/640hud1.spr_0.tga",
[48,16],
[192,160],
TRUE,
w_para_draw,
__NULL__,
w_para_primary,

View File

@ -73,13 +73,16 @@ w_scout_deathmsg(void)
}
int
w_scout_pickup(int new)
w_scout_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
if (new) {
pl.scout_mag = 10;
if (startammo == -1)
pl.scout_mag = 10;
else
pl.scout_mag = startammo;
} else {
if (pl.ammo_762mm < 30) {
pl.ammo_762mm = bound(0, pl.ammo_762mm + 10, 30);
@ -292,12 +295,11 @@ w_scout_hudpic(int selected, vector pos, float a)
weapon_t w_scout =
{
"scout",
ITEM_SCOUT,
0,
11,
"sprites/640hud1.spr_0.tga",
[48,16],
[192,208],
TRUE,
w_scout_draw,
__NULL__,
w_scout_primary,

View File

@ -73,13 +73,16 @@ w_sg550_deathmsg(void)
}
int
w_sg550_pickup(int new)
w_sg550_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
if (new) {
pl.sg550_mag = 30;
if (startammo == -1)
pl.sg550_mag = 30;
else
pl.sg550_mag = startammo;
} else {
if (pl.ammo_556mm < 90) {
pl.ammo_556mm = bound(0, pl.ammo_556mm + 30, 90);
@ -261,12 +264,11 @@ w_sg550_hudpic(int selected, vector pos, float a)
weapon_t w_sg550 =
{
"sg550",
ITEM_SG550,
0,
14,
"sprites/640hud16.spr_0.tga",
[48,16],
[192,48],
TRUE,
w_sg550_draw,
__NULL__,
w_sg550_primary,

View File

@ -74,13 +74,16 @@ w_sg552_deathmsg(void)
}
int
w_sg552_pickup(int new)
w_sg552_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
if (new) {
pl.sg552_mag = 30;
if (startammo == -1)
pl.sg552_mag = 30;
else
pl.sg552_mag = startammo;
} else {
if (pl.ammo_556mm < 90) {
pl.ammo_556mm = bound(0, pl.ammo_556mm + 30, 90);
@ -269,12 +272,11 @@ w_sg552_hudpic(int selected, vector pos, float a)
weapon_t w_sg552 =
{
"sg552",
ITEM_SG552,
0,
8,
"sprites/640hud1.spr_0.tga",
[48,16],
[192,112],
TRUE,
w_sg552_draw,
__NULL__,
w_sg552_primary,

View File

@ -57,7 +57,7 @@ w_smokegrenade_updateammo(player pl)
}
int
w_smokegrenade_pickup(int new)
w_smokegrenade_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -261,12 +261,11 @@ w_smokegrenade_hudpic(int selected, vector pos, float a)
weapon_t w_smokegrenade =
{
"smokegrenade",
ITEM_SMOKEGRENADE,
3,
2,
"sprites/640hud1.spr_0.tga",
[32,16],
[224,192],
FALSE,
w_smokegrenade_draw,
__NULL__,
w_smokegrenade_primary,

View File

@ -74,13 +74,16 @@ w_tmp_deathmsg(void)
}
int
w_tmp_pickup(int new)
w_tmp_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
if (new) {
pl.tmp_mag = 30;
if (startammo == -1)
pl.tmp_mag = 30;
else
pl.tmp_mag = startammo;
} else {
if (pl.ammo_9mm < 90) {
pl.ammo_9mm = bound(0, pl.ammo_9mm + 30, 90);
@ -244,12 +247,11 @@ w_tmp_hudpic(int selected, vector pos, float a)
weapon_t w_tmp =
{
"tmp",
ITEM_TMP,
0,
6,
"sprites/640hud1.spr_0.tga",
[32,16],
[224,64],
TRUE,
w_tmp_draw,
__NULL__,
w_tmp_primary,

View File

@ -74,13 +74,16 @@ w_ump45_deathmsg(void)
}
int
w_ump45_pickup(int new)
w_ump45_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
if (new) {
pl.ump45_mag = 25;
if (startammo == -1)
pl.ump45_mag = 25;
else
pl.ump45_mag = startammo;
} else {
if (pl.ammo_45acp < AMMO_MAX_45ACP) {
pl.ammo_45acp = bound(0, pl.ammo_45acp + 25, AMMO_MAX_45ACP);
@ -244,12 +247,11 @@ w_ump45_hudpic(int selected, vector pos, float a)
weapon_t w_ump45 =
{
"ump45",
ITEM_UMP45,
0,
4,
"sprites/640hud16.spr_0.tga",
[48,16],
[192,80],
TRUE,
w_ump45_draw,
__NULL__,
w_ump45_primary,

View File

@ -87,13 +87,16 @@ w_usp45_deathmsg(void)
}
int
w_usp45_pickup(int new)
w_usp45_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
if (new) {
pl.usp45_mag = 12;
if (startammo == -1)
pl.usp45_mag = 12;
else
pl.usp45_mag = startammo;
} else {
if (pl.ammo_45acp < AMMO_MAX_45ACP) {
pl.ammo_45acp = bound(0, pl.ammo_45acp + 12, AMMO_MAX_45ACP);
@ -329,12 +332,11 @@ w_usp45_hudpic(int selected, vector pos, float a)
weapon_t w_usp45 =
{
"usp",
ITEM_USP45,
1,
0,
"sprites/640hud1.spr_0.tga",
[32,16],
[192,32],
TRUE,
w_usp45_draw,
__NULL__,
w_usp45_primary,

View File

@ -84,13 +84,16 @@ w_xm1014_deathmsg(void)
}
int
w_xm1014_pickup(int new)
w_xm1014_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
if (new) {
pl.xm1014_mag = 7;
if (startammo == -1)
pl.xm1014_mag = 7;
else
pl.xm1014_mag = startammo;
} else {
if (pl.ammo_buckshot < AMMO_MAX_BUCKSHOT) {
pl.ammo_buckshot = bound(0, pl.ammo_buckshot + 7, AMMO_MAX_BUCKSHOT);
@ -287,27 +290,26 @@ w_xm1014_hudpic(int selected, vector pos, float a)
weapon_t w_xm1014 =
{
ITEM_XM1014,
0,
1,
"sprites/640hud1.spr_0.tga",
[48,16],
[192,224],
w_xm1014_draw,
__NULL__,
w_xm1014_primary,
__NULL__,
w_xm1014_reload,
w_xm1014_release,
w_xm1014_hud,
w_xm1014_precache,
w_xm1014_pickup,
w_xm1014_updateammo,
w_xm1014_wmodel,
w_xm1014_pmodel,
w_xm1014_deathmsg,
w_xm1014_aimanim,
w_xm1014_hudpic
.name = "xm1014",
.id = ITEM_XM1014,
.slot = 0,
.slot_pos = 1,
.allow_drop = TRUE,
.draw = w_xm1014_draw,
.holster = __NULL__,
.primary = w_xm1014_primary,
.secondary = __NULL__,
.reload = w_xm1014_reload,
.release = w_xm1014_release,
.crosshair = w_xm1014_hud,
.precache = w_xm1014_precache,
.pickup = w_xm1014_pickup,
.updateammo = w_xm1014_updateammo,
.wmodel = w_xm1014_wmodel,
.pmodel = w_xm1014_pmodel,
.deathmsg = w_xm1014_deathmsg,
.aimanim = w_xm1014_aimanim,
.hudpic = w_xm1014_hudpic
};
#ifdef SERVER

View File

@ -17,6 +17,7 @@
// Network Events
enum
{
EV_INTERMISSION,
EV_MUSICTRACK,
EV_MUSICLOOP,
EV_WEAPON_DRAW,

View File

@ -82,7 +82,7 @@ w_displacer_deathmsg(void)
}
int
w_displacer_pickup(int new)
w_displacer_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -356,12 +356,10 @@ w_displacer_hudpic(int selected, vector pos, float a)
weapon_t w_displacer =
{
.id = ITEM_DISPLACER,
.name = "displacer",
.id = ITEM_DISPLACER,
.slot = 5,
.slot_pos = 1,
.ki_spr = "sprites/320hudof01.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [48,208],
.draw = w_displacer_draw,
.holster = w_displacer_holster,
.primary = w_displacer_primary,

View File

@ -51,7 +51,7 @@ w_eagle_precache(void)
}
int
w_eagle_pickup(int new)
w_eagle_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -365,12 +365,10 @@ w_eagle_hudpic(int selected, vector pos, float a)
weapon_t w_eagle =
{
.id = ITEM_EAGLE,
.name = "eagle",
.id = ITEM_EAGLE,
.slot = 1,
.slot_pos = 2,
.ki_spr = "sprites/320hudof01.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [0,240],
.draw = w_eagle_draw,
.holster = w_eagle_holster,
.primary = w_eagle_primary,

View File

@ -282,12 +282,10 @@ w_grapple_hudpic(int selected, vector pos, float a)
weapon_t w_grapple =
{
.id = ITEM_GRAPPLE,
.name = "grapple",
.id = ITEM_GRAPPLE,
.slot = 0,
.slot_pos = 3,
.ki_spr = "sprites/320hudof01.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [0,224],
.draw = w_grapple_draw,
.holster = w_grapple_holster,
.primary = w_grapple_primary,

View File

@ -244,12 +244,10 @@ w_knife_hudpic(int selected, vector pos, float a)
weapon_t w_knife =
{
.id = ITEM_KNIFE,
.name = "knife",
.id = ITEM_KNIFE,
.slot = 0,
.slot_pos = 2,
.ki_spr = "sprites/320hudof01.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [96,224],
.draw = w_knife_draw,
.holster = w_knife_holster,
.primary = w_knife_primary,

View File

@ -49,7 +49,7 @@ w_m249_precache(void)
}
int
w_m249_pickup(int new)
w_m249_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -303,12 +303,10 @@ w_m249_hudpic(int selected, vector pos, float a)
weapon_t w_m249 =
{
.id = ITEM_M249,
.name = "m249",
.id = ITEM_M249,
.slot = 5,
.slot_pos = 0,
.ki_spr = "sprites/320hudof01.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [96,208],
.draw = w_m249_draw,
.holster = w_m249_holster,
.primary = w_m249_primary,

View File

@ -34,7 +34,7 @@ enum
};
int
w_penguin_pickup(int new)
w_penguin_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -338,12 +338,10 @@ w_penguin_hudpic(int s, vector pos, float a)
weapon_t w_penguin =
{
.id = ITEM_PENGUIN,
.name = "penguin",
.id = ITEM_PENGUIN,
.slot = 4,
.slot_pos = 4,
.ki_spr = "sprites/320hudof01.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [144,224],
.draw = w_penguin_draw,
.holster = w_penguin_holster,
.primary = w_penguin_primary,

View File

@ -318,12 +318,10 @@ w_pipewrench_hudpic(int selected, vector pos, float a)
weapon_t w_pipewrench =
{
.id = ITEM_PIPEWRENCH,
.name = "pipewrench",
.id = ITEM_PIPEWRENCH,
.slot = 0,
.slot_pos = 1,
.ki_spr = "sprites/320hudof01.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [0,208],
.draw = w_pipewrench_draw,
.holster = w_pipewrench_holster,
.primary = w_pipewrench_primary,

View File

@ -55,7 +55,7 @@ w_shockrifle_precache(void)
}
int
w_shockrifle_pickup(int new)
w_shockrifle_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -295,12 +295,10 @@ w_shockrifle_hudpic(int selected, vector pos, float a)
weapon_t w_shockrifle =
{
.id = ITEM_SHOCKRIFLE,
.name = "shockrifle",
.id = ITEM_SHOCKRIFLE,
.slot = 6,
.slot_pos = 1,
.ki_spr = "sprites/320hudof01.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [48,240],
.draw = w_shockrifle_draw,
.holster = w_shockrifle_holster,
.primary = w_shockrifle_primary,

View File

@ -47,7 +47,7 @@ w_sniperrifle_precache(void)
}
int
w_sniperrifle_pickup(int new)
w_sniperrifle_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -278,12 +278,10 @@ w_sniperrifle_hudpic(int s, vector pos, float a)
weapon_t w_sniperrifle =
{
.id = ITEM_SNIPERRIFLE,
.name = "sniperrifle",
.id = ITEM_SNIPERRIFLE,
.slot = 5,
.slot_pos = 2,
.ki_spr = "sprites/320hudof01.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [144,208],
.draw = w_sniperrifle_draw,
.holster = w_sniperrifle_holster,
.primary = w_sniperrifle_primary,

View File

@ -181,7 +181,7 @@ w_sporelauncher_deathmsg(void)
}
int
w_sporelauncher_pickup(int new)
w_sporelauncher_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -442,12 +442,10 @@ w_sporelauncher_hudpic(int selected, vector pos, float a)
weapon_t w_sporelauncher =
{
.id = ITEM_SPORELAUNCHER,
.name = "sporelauncher",
.id = ITEM_SPORELAUNCHER,
.slot = 6,
.slot_pos = 0,
.ki_spr = "sprites/320hudof01.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [48,224],
.draw = w_sporelauncher_draw,
.holster = w_sporelauncher_holster,
.primary = w_sporelauncher_primary,

View File

@ -66,7 +66,7 @@ w_ap9_deathmsg(void)
}
int
w_ap9_pickup(int new)
w_ap9_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -294,12 +294,10 @@ w_ap9_hudpic(int selected, vector pos, float a)
weapon_t w_ap9 =
{
.id = ITEM_AP9,
.name = "ap9",
.id = ITEM_AP9,
.slot = 1,
.slot_pos = 2,
.ki_spr = "sprites/640hud1.spr_0.tga",
.ki_size = [32,16],
.ki_xy = [192,16],
.draw = w_ap9_draw,
.holster = w_ap9_holster,
.primary = w_ap9_primary,

View File

@ -42,7 +42,7 @@ w_chaingun_precache(void)
}
int
w_chaingun_pickup(int new)
w_chaingun_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -273,12 +273,10 @@ w_chaingun_hudpic(int selected, vector pos, float a)
weapon_t w_chaingun =
{
.name = "chaingun",
.id = ITEM_CHAINGUN,
.slot = 3,
.slot_pos = 3,
.ki_spr = "sprites/tfc_dmsg.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [0,16],
.draw = w_chaingun_draw,
.holster = w_chaingun_holster,
.primary = w_chaingun_primary,

View File

@ -69,7 +69,7 @@ w_flame_deathmsg(void)
}
int
w_flame_pickup(int new)
w_flame_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -231,12 +231,10 @@ w_flame_hudpic(int selected, vector pos, float a)
weapon_t w_flame =
{
.id = ITEM_EGON,
.name = "flame",
.id = ITEM_EGON,
.slot = 3,
.slot_pos = 2,
.ki_spr = "sprites/640hud1.spr_0.tga",
.ki_size = [32,16],
.ki_xy = [0,192],
.draw = w_flame_draw,
.holster = w_egon_holster,
.primary = w_flame_primary,

View File

@ -63,7 +63,7 @@ w_medkit_deathmsg(void)
}
int
w_medkit_pickup(int new)
w_medkit_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -212,12 +212,10 @@ w_medkit_hudpic(int selected, vector pos, float a)
weapon_t w_medkit =
{
.name = "medkit",
.id = ITEM_MEDKIT2,
.slot = 4,
.slot_pos = 4,
.ki_spr = "sprites/tfc_dmsg.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [0,192],
.draw = w_medkit_draw,
.holster = __NULL__,
.primary = w_medkit_primary,

View File

@ -127,12 +127,10 @@ w_shovel_hudpic(int selected, vector pos, float a)
weapon_t w_shovel =
{
.id = ITEM_SHOVEL,
.name = "shovel",
.id = ITEM_SHOVEL,
.slot = 0,
.slot_pos = 1,
.ki_spr = "sprites/640hud1.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [192,0],
.draw = w_shovel_draw,
.holster = w_shovel_holster,
.primary = w_shovel_primary,

View File

@ -67,9 +67,9 @@ w_silencer_deathmsg(void)
}
int
w_silencer_pickup(int new)
w_silencer_pickup(int new, int startammo)
{
return w_glock_pickup(new);
return w_glock_pickup(new, startammo);
}
void
@ -240,12 +240,10 @@ w_silencer_hudpic(int selected, vector pos, float a)
weapon_t w_silencer =
{
.id = ITEM_GLOCK,
.name = "silencer",
.id = ITEM_GLOCK,
.slot = 1,
.slot_pos = 0,
.ki_spr = "sprites/640hud1.spr_0.tga",
.ki_size = [32,16],
.ki_xy = [192,16],
.draw = w_silencer_draw,
.holster = w_silencer_holster,
.primary = w_silencer_primary,

View File

@ -38,7 +38,7 @@ w_sniper_precache(void)
}
int
w_sniper_pickup(int new)
w_sniper_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -322,12 +322,10 @@ w_sniper_hudpic(int selected, vector pos, float a)
weapon_t w_sniper =
{
.id = ITEM_SNIPER,
.name = "sniper",
.id = ITEM_SNIPER,
.slot = 2,
.slot_pos = 3,
.ki_spr = "sprites/tfc_dmsg.spr_0.tga",
.ki_size = [60,16],
.ki_xy = [0,96],
.draw = w_sniper_draw,
.holster = w_sniper_holster,
.primary = w_sniper_primary,

View File

@ -35,7 +35,7 @@ w_sniper2_precache(void)
}
int
w_sniper2_pickup(int new)
w_sniper2_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -219,12 +219,10 @@ w_sniper2_hudpic(int selected, vector pos, float a)
weapon_t w_sniper2 =
{
.name = "sniper2",
.id = ITEM_SNIPER2,
.slot = 2,
.slot_pos = 4,
.ki_spr = "sprites/tfc_dmsg.spr_0.tga",
.ki_size = [60,16],
.ki_xy = [0,96],
.draw = w_sniper2_draw,
.holster = w_sniper2_holster,
.primary = w_sniper2_primary,

View File

@ -180,12 +180,10 @@ w_spanner_hudpic(int selected, vector pos, float a)
weapon_t w_spanner =
{
.id = ITEM_SPANNER,
.name = "spanner",
.id = ITEM_SPANNER,
.slot = 0,
.slot_pos = 2,
.ki_spr = "sprites/tfc_dmsg.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [0,48],
.draw = w_spanner_draw,
.holster = w_spanner_holster,
.primary = w_spanner_primary,

View File

@ -68,7 +68,7 @@ w_taurus_deathmsg(void)
}
int
w_taurus_pickup(int new)
w_taurus_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -239,12 +239,10 @@ w_taurus_hudpic(int selected, vector pos, float a)
weapon_t w_taurus =
{
.id = ITEM_TAURUS,
.name = "taurus",
.id = ITEM_TAURUS,
.slot = 1,
.slot_pos = 3,
.ki_spr = "sprites/640hud1.spr_0.tga",
.ki_size = [32,16],
.ki_xy = [192,16],
.draw = w_taurus_draw,
.holster = w_taurus_holster,
.primary = w_taurus_primary,

View File

@ -57,9 +57,9 @@ string w_tnt_deathmsg(void)
return w_handgrenade_deathmsg();
}
int w_tnt_pickup(int new)
int w_tnt_pickup(int new, int startammo)
{
return w_handgrenade_pickup(new);
return w_handgrenade_pickup(new, startammo);
}
#ifdef SERVER
@ -200,12 +200,10 @@ w_tnt_hudpic(int selected, vector pos, float a)
weapon_t w_tnt =
{
.id = ITEM_HANDGRENADE,
.name = "tnt",
.id = ITEM_HANDGRENADE,
.slot = 4,
.slot_pos = 0,
.ki_spr = "sprites/640hud1.spr_0.tga",
.ki_size = [32,16],
.ki_xy = [192,160],
.draw = w_tnt_draw,
.holster = w_tnt_holster,
.primary = w_tnt_primary,

View File

@ -68,7 +68,7 @@ w_bradnailer_wmodel(void)
}
int
w_bradnailer_pickup(int new)
w_bradnailer_pickup(int new, int startammo)
{
/* TODO */
return TRUE;
@ -239,12 +239,10 @@ w_bradnailer_hudpic(int selected, vector pos, float a)
weapon_t w_bradnailer =
{
.id = ITEM_BRADNAILER,
.name = "bradnailer",
.id = ITEM_BRADNAILER,
.slot = 1,
.slot_pos = 0,
.ki_spr = __NULL__,
.ki_size = __NULL__,
.ki_xy = __NULL__,
.draw = w_bradnailer_draw,
.holster = w_bradnailer_holster,
.primary = w_bradnailer_primary,

View File

@ -120,12 +120,10 @@ w_cmlwbr_hudpic(int selected, vector pos, float a)
weapon_t w_cmlwbr =
{
.id = ITEM_CMLWBR,
.name = "cmlwbr",
.id = ITEM_CMLWBR,
.slot = 2,
.slot_pos = 1,
.ki_spr = __NULL__,
.ki_size = __NULL__,
.ki_xy = __NULL__,
.draw = w_cmlwbr_draw,
.holster = w_cmlwbr_holster,
.primary = w_cmlwbr_primary,

View File

@ -109,12 +109,10 @@ w_heaterpipe_hudpic(int selected, vector pos, float a)
weapon_t w_heaterpipe =
{
.id = ITEM_HEATERPIPE,
.name = "heaterpipe",
.id = ITEM_HEATERPIPE,
.slot = 0,
.slot_pos = 0,
.ki_spr = __NULL__,
.ki_size = __NULL__,
.ki_xy = __NULL__,
.draw = w_heaterpipe_draw,
.holster = w_heaterpipe_holster,
.primary = w_heaterpipe_primary,

View File

@ -165,12 +165,10 @@ w_nailgun_hudpic(int selected, vector pos, float a)
weapon_t w_nailgun =
{
.id = ITEM_NAILGUN,
.name = "nailgun",
.id = ITEM_NAILGUN,
.slot = 1,
.slot_pos = 1,
.ki_spr = __NULL__,
.ki_size = __NULL__,
.ki_xy = __NULL__,
.draw = w_nailgun_draw,
.holster = __NULL__,
.primary = w_nailgun_primary,

View File

@ -68,9 +68,9 @@ void w_pipebomb_precache(void)
precache_model("models/p_pipebomb.mdl");
}
int w_pipebomb_pickup(int new)
int w_pipebomb_pickup(int new, int startammo)
{
return w_satchel_pickup(new);
return w_satchel_pickup(new, startammo);
}
void w_pipebomb_draw(void)
@ -248,12 +248,10 @@ void w_pipebomb_hudpic(int selected, vector pos, float a)
weapon_t w_pipebomb =
{
.id = ITEM_SATCHEL,
.name = "pipebomb",
.id = ITEM_SATCHEL,
.slot = 4,
.slot_pos = 1,
.ki_spr = __NULL__,
.ki_size = __NULL__,
.ki_xy = __NULL__,
.draw = w_pipebomb_draw,
.holster = w_pipebomb_holster,
.primary = w_pipebomb_primary,

View File

@ -63,7 +63,7 @@ string w_shotgun_deathmsg(void)
return "";
}
int w_shotgun_pickup(int new)
int w_shotgun_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -245,12 +245,10 @@ void w_shotgun_hudpic(int s, vector pos, float a)
weapon_t w_shotgun =
{
.id = ITEM_SHOTGUN,
.name = "shotgun",
.id = ITEM_SHOTGUN,
.slot = 2,
.slot_pos = 1,
.ki_spr = __NULL__,
.ki_size = __NULL__,
.ki_xy = __NULL__,
.draw = w_shotgun_draw,
.holster = w_shotgun_holster,
.primary = w_shotgun_primary,

View File

@ -122,12 +122,10 @@ w_xs_hudpic(int selected, vector pos, float a)
weapon_t w_xs =
{
.id = ITEM_XS,
.name = "xs",
.id = ITEM_XS,
.slot = 3,
.slot_pos = 0,
.ki_spr = __NULL__,
.ki_size = __NULL__,
.ki_xy = __NULL__,
.draw = w_xs_draw,
.holster = w_xs_holster,
.primary = w_xs_primary,

View File

@ -121,12 +121,10 @@ w_aicore_precache(void)
weapon_t w_aicore =
{
.id = ITEM_AICORE,
.name = "aicore",
.id = ITEM_AICORE,
.slot = 0,
.slot_pos = 1,
.ki_spr = "sprites/640hud1.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [192,0],
.draw = w_aicore_draw,
.holster = w_aicore_holster,
.primary = w_aicore_primary,

View File

@ -256,12 +256,10 @@ w_beamgun_precache(void)
weapon_t w_beamgun =
{
.id = ITEM_BEAMGUN,
.name = "beamgun",
.id = ITEM_BEAMGUN,
.slot = 3,
.slot_pos = 0,
.ki_spr = "sprites/640hud1.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [192,0],
.draw = w_beamgun_draw,
.holster = w_beamgun_holster,
.primary = w_beamgun_primary,

View File

@ -139,7 +139,7 @@ w_chemicalgun_aimanim(void)
}
int
w_chemicalgun_pickup(int new)
w_chemicalgun_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -358,12 +358,10 @@ w_chemicalgun_precache(void)
weapon_t w_chemicalgun =
{
.id = ITEM_CHEMICALGUN,
.name = "chemicalgun",
.id = ITEM_CHEMICALGUN,
.slot = 4,
.slot_pos = 1,
.ki_spr = "sprites/640hud1.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [192,0],
.draw = w_chemicalgun_draw,
.holster = w_chemicalgun_holster,
.primary = w_chemicalgun_primary,

View File

@ -224,7 +224,7 @@ w_dml_aimanim(void)
}
int
w_dml_pickup(int new)
w_dml_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -378,12 +378,10 @@ w_dml_precache(void)
weapon_t w_dml =
{
.id = ITEM_DML,
.name = "dml",
.id = ITEM_DML,
.slot = 3,
.slot_pos = 1,
.ki_spr = "sprites/640hud1.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [192,0],
.draw = w_dml_draw,
.holster = w_dml_holster,
.primary = w_dml_primary,

View File

@ -221,7 +221,7 @@ w_fists_aimanim(void)
}
int
w_fists_pickup(int new)
w_fists_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -265,12 +265,10 @@ w_fists_precache(void)
weapon_t w_fists =
{
.id = ITEM_FISTS,
.name = "fists",
.id = ITEM_FISTS,
.slot = 0,
.slot_pos = 0,
.ki_spr = "sprites/640hud1.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [192,0],
.draw = w_fists_draw,
.holster = w_fists_holster,
.primary = w_fists_primary,

View File

@ -199,7 +199,7 @@ w_gausspistol_aimanim(void)
}
int
w_gausspistol_pickup(int new)
w_gausspistol_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -366,12 +366,10 @@ w_gausspistol_precache(void)
weapon_t w_gausspistol =
{
.id = ITEM_GAUSSPISTOL,
.name = "gausspistol",
.id = ITEM_GAUSSPISTOL,
.slot = 1,
.slot_pos = 0,
.ki_spr = "sprites/640hud1.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [192,0],
.draw = w_gausspistol_draw,
.holster = w_gausspistol_holster,
.primary = w_gausspistol_primary,

View File

@ -220,12 +220,10 @@ w_grenade_precache(void)
weapon_t w_grenade =
{
.id = ITEM_GRENADE,
.name = "grenade",
.id = ITEM_GRENADE,
.slot = 4,
.slot_pos = 0,
.ki_spr = "sprites/640hud1.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [192,0],
.draw = w_grenade_draw,
.holster = w_grenade_holster,
.primary = w_grenade_primary,

View File

@ -186,7 +186,7 @@ w_minigun_aimanim(void)
}
int
w_minigun_pickup(int new)
w_minigun_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -264,12 +264,10 @@ w_minigun_precache(void)
weapon_t w_minigun =
{
.id = ITEM_MINIGUN,
.name = "minigun",
.id = ITEM_MINIGUN,
.slot = 2,
.slot_pos = 1,
.ki_spr = "sprites/640hud1.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [192,0],
.draw = w_minigun_draw,
.holster = w_minigun_holster,
.primary = w_minigun_primary,

View File

@ -217,7 +217,7 @@ w_shotgun_aimanim(void)
}
int
w_shotgun_pickup(int new)
w_shotgun_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -331,12 +331,10 @@ w_shotgun_precache(void)
weapon_t w_shotgun =
{
.id = ITEM_SHOTGUN,
.name = "shotgun",
.id = ITEM_SHOTGUN,
.slot = 2,
.slot_pos = 0,
.ki_spr = "sprites/640hud1.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [192,0],
.draw = w_shotgun_draw,
.holster = w_shotgun_holster,
.primary = w_shotgun_primary,

View File

@ -81,7 +81,7 @@ void w_cannon_reload(void)
pl.w_idle_next = 3.0f;
}
int w_cannon_pickup(int new)
int w_cannon_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -230,12 +230,10 @@ void w_cannon_hudpic(int s, vector pos, float a)
weapon_t w_cannon =
{
.id = ITEM_CANNON,
.name = "cannon",
.id = ITEM_CANNON,
.slot = 2,
.slot_pos = 3,
.ki_spr = "sprites/w_cannon.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [192,0],
.draw = w_cannon_draw,
.holster = w_cannon_holster,
.primary = w_cannon_primary,

View File

@ -153,12 +153,10 @@ void w_chainsaw_hudpic(int s, vector pos, float a)
weapon_t w_chainsaw =
{
.id = ITEM_CHAINSAW,
.name = "chainsaw",
.id = ITEM_CHAINSAW,
.slot = 0,
.slot_pos = 2,
.ki_spr = "sprites/chainsaw.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [192,0],
.draw = w_chainsaw_draw,
.holster = w_chainsaw_holster,
.primary = w_chainsaw_primary,

View File

@ -215,12 +215,10 @@ void w_hammer_hudpic(int s, vector pos, float a)
weapon_t w_hammer =
{
.id = ITEM_HAMMER,
.name = "hammer",
.id = ITEM_HAMMER,
.slot = 0,
.slot_pos = 1,
.ki_spr = "sprites/hammer.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [192,0],
.draw = w_hammer_draw,
.holster = w_hammer_holster,
.primary = w_hammer_primary,

View File

@ -92,12 +92,10 @@ w_asscan_hudpic(int selected, vector pos, float a)
weapon_t w_asscan =
{
.id = ITEM_ASSCAN,
.name = "asscan",
.id = ITEM_ASSCAN,
.slot = 4,
.slot_pos = 2,
.ki_spr = "sprites/tfc_dmsg.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [0,16],
.draw = w_asscan_draw,
.holster = __NULL__,
.primary = __NULL__,

View File

@ -92,12 +92,10 @@ w_autorifle_hudpic(int selected, vector pos, float a)
weapon_t w_autorifle =
{
.id = ITEM_AUTORIFLE,
.name = "autorifle",
.id = ITEM_AUTORIFLE,
.slot = 2,
.slot_pos = 0,
.ki_spr = "sprites/640hud1.spr_0.tga",
.ki_size = [60,16],
.ki_xy = [0,80],
.draw = w_autorifle_draw,
.holster = __NULL__,
.primary = __NULL__,

View File

@ -210,12 +210,10 @@ w_crowbar_hudpic(int selected, vector pos, float a)
weapon_t w_crowbar =
{
.id = ITEM_CROWBAR,
.name = "crowbar",
.id = ITEM_CROWBAR,
.slot = 0,
.slot_pos = 0,
.ki_spr = "sprites/640hud1.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [192,0],
.draw = w_crowbar_draw,
.holster = w_crowbar_holster,
.primary = w_crowbar_primary,

View File

@ -69,7 +69,7 @@ string w_dbs_deathmsg(void)
}
int
w_dbs_pickup(int new)
w_dbs_pickup(int new, int startammo)
{
#ifdef SERVER
player pl = (player)self;
@ -251,25 +251,23 @@ w_dbs_hudpic(int s, vector pos, float a)
weapon_t w_dbs =
{
ITEM_DBS,
2,
1,
"sprites/640hud1.spr_0.tga",
[48,16],
[192,64],
w_dbs_draw,
w_dbs_holster,
w_dbs_primary,
w_dbs_release,
w_dbs_reload,
w_dbs_release,
w_dbs_crosshair,
w_dbs_precache,
w_dbs_pickup,
w_dbs_updateammo,
w_dbs_wmodel,
w_dbs_pmodel,
w_dbs_deathmsg,
w_dbs_aimanim,
w_dbs_hudpic
.name = "sbs",
.id = ITEM_DBS,
.slot = 2,
.slot_pos = 1,
.draw = w_dbs_draw,
.holster = w_dbs_holster,
.primary = w_dbs_primary,
.secondary = w_dbs_release,
.reload = w_dbs_reload,
.release = w_dbs_release,
.crosshair = w_dbs_crosshair,
.precache = w_dbs_precache,
.pickup = w_dbs_pickup,
.updateammo = w_dbs_updateammo,
.wmodel = w_dbs_wmodel,
.pmodel = w_dbs_pmodel,
.deathmsg = w_dbs_deathmsg,
.aimanim = w_dbs_aimanim,
.hudpic = w_dbs_hudpic
};

View File

@ -92,12 +92,10 @@ w_flamer_hudpic(int selected, vector pos, float a)
weapon_t w_flamer =
{
.id = ITEM_FLAMER,
.name = "flamer",
.id = ITEM_FLAMER,
.slot = 3,
.slot_pos = 3,
.ki_spr = "sprites/tfc_dmsg.spr_0.tga",
.ki_size = [64,16],
.ki_xy = [112,24],
.draw = w_flamer_draw,
.holster = __NULL__,
.primary = __NULL__,

View File

@ -92,12 +92,10 @@ w_glauncher_hudpic(int selected, vector pos, float a)
weapon_t w_glauncher =
{
.id = ITEM_GLAUNCHER,
.name = "glauncher",
.id = ITEM_GLAUNCHER,
.slot = 3,
.slot_pos = 1,
.ki_spr = "sprites/tfc_dmsg.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [0,128],
.draw = w_glauncher_draw,
.holster = __NULL__,
.primary = __NULL__,

View File

@ -92,12 +92,10 @@ w_grapple_hudpic(int selected, vector pos, float a)
weapon_t w_grapple =
{
.id = ITEM_GRAPPLE,
.name = "grapple",
.id = ITEM_GRAPPLE,
.slot = 5,
.slot_pos = 0,
.ki_spr = "sprites/640hud1.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [192,0],
.draw = w_grapple_draw,
.holster = __NULL__,
.primary = __NULL__,

View File

@ -92,12 +92,10 @@ w_incendiary_hudpic(int selected, vector pos, float a)
weapon_t w_incendiary =
{
.id = ITEM_INCENDIARY,
.name = "incendiary",
.id = ITEM_INCENDIARY,
.slot = 4,
.slot_pos = 3,
.ki_spr = "sprites/tfc_dmsg.spr_0.tga",
.ki_size = [48,16],
.ki_xy = [0,160],
.draw = w_incendiary_draw,
.holster = __NULL__,
.primary = __NULL__,

Some files were not shown because too many files have changed in this diff Show More