Add missing wrappers for ammo_9mmARclip and ammo_glockclip.

Add 'weaponbox' pickup, which may not be fully complete.
Some FX_ effects make proper use of env_sprite APIs now.
Edited default.cfg to parse skill.cfg itself.
Removed GS_RENDERFX flag in progs.src.
This commit is contained in:
Marco Cawthorne 2022-07-07 09:13:16 -07:00
parent d15d83faa5
commit 454da78b0c
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
9 changed files with 125 additions and 36 deletions

View File

@ -5,7 +5,6 @@
#define CLIENT
#define VALVE
#define CLASSIC_VGUI
#define GS_RENDERFX
#includelist
../../../src/shared/fteextensions.qc

View File

@ -154,6 +154,7 @@ ammo_9mmAR::Touch(entity eToucher)
}
}
CLASSEXPORT(ammo_mp5clip, ammo_9mmAR)
CLASSEXPORT(ammo_9mmARclip, ammo_9mmAR)
/*QUAKED ammo_9mmbox (0 0 0.8) (-16 -16 0) (16 16 32)
@ -230,6 +231,7 @@ ammo_9mmclip::Touch(entity eToucher)
}
}
}
CLASSEXPORT(ammo_glockclip, ammo_9mmclip)
/*QUAKED ammo_ARgrenades (0 0 0.8) (-16 -16 0) (16 16 32)

View File

@ -4,7 +4,6 @@
#define QWSSQC
#define SERVER
#define VALVE
#define GS_RENDERFX
#includelist
../../../src/shared/fteextensions.qc

93
src/server/weaponbox.qc Normal file
View File

@ -0,0 +1,93 @@
/*
* Copyright (c) 2016-2022 Marco Cawthorne <marco@icculus.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/*QUAKED weaponbox (0 0 0.8) (-16 -16 0) (16 16 32)
HALF-LIFE (1998) ENTITY
Ammo container. Used to delvier more than 1 singular ammo type, as well as
more precise control.
-------- KEYS --------
"targetname" : Name
"uranium" : Amount of Uranium (Egon, Gauss) ammo to give
"357" : Amount of 357 Python ammo to give
"9mm" : Amount of 9mm Handgun/MP5 ammo to give
"ARgrenades" : Amount of MP5 grenades to give
"bolts" : Amount of Crossbow bolts
"buckshot" : Amount of Shotgun ammo to give
"rockets" : Amount of RPG ammo to give
"556" : (Oppossing Force only) Amount for the SAW Machine Gun
"762" : (Oppossing Force only) Amount for the Sniper Rifle
"spore" : (Oppossing Force only) Amount for the Spore Launcher
-------- MODEL FOR RADIANT ONLY - DO NOT SET THIS AS A KEY --------
model="models/models/w_weaponbox.mdl"
*/
class
weaponbox:item_weaponbox
{
void(void) weaponbox;
virtual void(string, string) SpawnKey;
};
void
weaponbox::SpawnKey(string strKey, string strValue)
{
switch (strKey) {
case "uranium":
ammo_uranium = stoi(strValue);
break;
case "357":
ammo_357 = stoi(strValue);
break;
case "9mm":
ammo_9mm = stoi(strValue);
break;
case "ARgrenades":
ammo_m203_grenade = stoi(strValue);
break;
case "bolts":
ammo_bolt = stoi(strValue);
break;
case "buckshot":
ammo_buckshot = stoi(strValue);
break;
case "rockets":
ammo_rocket = stoi(strValue);
break;
#ifdef GEARBOX
case "556":
ammo_556 = stoi(strValue);
break;
case "762":
ammo_762 = stoi(strValue);
break;
case "spore":
ammo_spore = stoi(strValue);
break;
#endif
}
}
void
weaponbox::weaponbox(void)
{
// do nothing
}

View File

@ -63,43 +63,38 @@ FX_Blood(vector pos, vector color)
}
env_sprite eBlood = spawn(env_sprite);
setorigin(eBlood, pos);
setmodel(eBlood, "sprites/bloodspray.spr");
eBlood.drawmask = MASK_ENGINE;
eBlood.maxframe = modelframecount(eBlood.modelindex);
eBlood.loops = 0;
eBlood.scale = 0.25f;
eBlood.m_vecRenderColor = color;
eBlood.m_iRenderMode = RM_COLOR;
eBlood.m_flRenderAmt = 1.0f;
eBlood.framerate = 20;
eBlood.SetOrigin(pos);
eBlood.SetModel("sprites/bloodspray.spr");
eBlood.SetMaxFrame(modelframecount(eBlood.modelindex));
eBlood.SetFramerate(20);
eBlood.SetLoopFlag(false);
eBlood.SetScale(0.25f);
eBlood.SetRenderColor(color);
eBlood.SetRenderMode(RM_COLOR);
eBlood.SetRenderAmt(1.0f);
eBlood.nextthink = time + 0.05f;
for (int i = 0; i < 3; i++) {
NSRenderableEntity ePart = spawn(NSRenderableEntity);
setorigin(ePart, pos);
setmodel(ePart, "sprites/blood.spr");
ePart.movetype = MOVETYPE_BOUNCE;
ePart.gravity = 0.5f;
ePart.scale = 0.25f;
ePart.drawmask = MASK_ENGINE;
ePart.frame = (random() < 0.5) ? 0 : 1;
ePart.SetOrigin(pos);
ePart.SetModel("sprites/blood.spr");
ePart.SetMovetype(MOVETYPE_BOUNCE);
ePart.SetGravity(0.5f);
ePart.SetScale(0.25f);
ePart.SetFrame((random() < 0.5) ? 0 : 1);
ePart.SetRenderColor(color);
ePart.SetRenderMode(RM_COLOR);
ePart.SetRenderAmt(1.0f);
ePart.SetVelocity(randomvec() * 96 + [0,0,64]);
ePart.SetSolid(SOLID_BBOX);
ePart.SetSize([0,0,0], [0,0,0]);
ePart.m_vecRenderColor = color;
ePart.m_iRenderMode = RM_COLOR;
ePart.m_flRenderAmt = 1.0f;
ePart.velocity = randomvec() * 96 + [0,0,64];
ePart.touch = Blood_Touch;
ePart.solid = SOLID_BBOX;
/* ignore player physics */
ePart.dimension_solid = 1;
ePart.dimension_hit = 1;
ePart.hitcontentsmaski = 0;
setsize(ePart, [0,0,0], [0,0,0]);
}
#endif
}

View File

@ -87,9 +87,9 @@ FX_Explosion(vector vecPos)
eExplosion.SetRenderAmt(1.0f);
eExplosion.SetRenderColor([1,1,1]);
eExplosion.drawmask = MASK_ENGINE;
eExplosion.maxframe = modelframecount(eExplosion.modelindex);
eExplosion.loops = 0;
eExplosion.framerate = 20;
eExplosion.m_iMaxFrame = modelframecount(eExplosion.modelindex);
eExplosion.m_bLoops = 0;
eExplosion.m_flFramerate = 20;
eExplosion.nextthink = time + 0.05f;
eExplosion.scale = 2.0f;

View File

@ -164,9 +164,9 @@ FX_Impact(impactType_t iType, vector vecPos, vector vNormal)
splash.SetRenderAmt(1.0f);
splash.SetRenderColor([1,1,1]);
splash.drawmask = MASK_ENGINE;
splash.maxframe = modelframecount(splash.modelindex);
splash.loops = 0;
splash.framerate = 20;
splash.m_iMaxFrame = modelframecount(splash.modelindex);
splash.m_bLoops = 0;
splash.m_flFramerate = 20;
splash.nextthink = time + 0.05f;
break;

View File

@ -573,5 +573,4 @@ player::SendEntity(entity ePEnt, float fChanged)
void
player::player(void)
{
print("foobar!!!!!\n");
}

View File

@ -55,3 +55,5 @@ alias mp_fraglimit fraglimit
seta gl_overbright 0
seta gl_ldr 1
seta r_lightmap_format rgb8
exec skill.cfg