Update codebase to be in line with upstream Nuclide. Add scripts/decals.txt and other shenanigans.

This commit is contained in:
Marco Cawthorne 2022-11-08 19:49:53 -08:00
parent f61c7af785
commit 15fa5a8f12
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
19 changed files with 300 additions and 23 deletions

View File

@ -472,8 +472,8 @@ HUD_DrawSpectator(void)
NSClientSpectator spec = (NSClientSpectator)pSeat->m_ePlayer;
drawfont = Font_GetID(FONT_20);
vector vecPos;
string strText;
vector vecPos = [0.0f, 0.0f, 0.0f];
string strText = __NULL__;
float palpha = 1.0f;
if (spec.spec_mode == SPECMODE_FREE) {

View File

@ -18,7 +18,6 @@
void
Game_RunClientCommand(void)
{
Footsteps_Update();
player pl = (player)self;
pl.Physics_Run();
}

View File

@ -54,6 +54,7 @@ class monster_gargantua:NSMonster
void(void) monster_gargantua;
virtual void(void) Spawned;
virtual void(void) Death;
virtual void(void) Pain;
virtual void(void) IdleNoise;

View File

@ -53,6 +53,7 @@ class monster_headcrab:NSMonster
void(void) monster_headcrab;
virtual void(void) Spawned;
virtual void(void) Pain;
virtual void(void) Death;
virtual void(void) IdleNoise;

View File

@ -119,6 +119,7 @@ class monster_human_grunt:NSTalkMonster
virtual void(void) Scream;
virtual void(void) IdleChat;
virtual void(void) Respawn;
virtual void(void) Spawned;
virtual void(void) Pain;
virtual void(void) Death;

View File

@ -39,6 +39,7 @@ class monster_sitting_scientist:NSTalkMonster
void(void) monster_sitting_scientist;
virtual void(void) Respawn;
virtual void(void) Spawned;
virtual void(void) Death;
virtual void(void) Gib;
virtual void(string, string) SpawnKey;

View File

@ -88,6 +88,7 @@ class monster_tentacle:NSMonster
virtual void(void) IdleNoise;
virtual void(void) Respawn;
virtual void(void) Spawned;
};
void

3
src/shared/fx_explosion.qc Executable file → Normal file
View File

@ -74,7 +74,8 @@ FX_Explosion(vector vecPos)
dlight.drawmask = MASK_ENGINE;
dlight.alpha = 2.0f;
Decals_Place(vecPos, sprintf("{scorch%d", floor(random(1,4))));
DecalGroups_Place("ExplosionScorch", vecPos);
vecPos[2] += 48;
env_sprite eExplosion = spawn(env_sprite);
makevectors(view_angles);

View File

@ -70,6 +70,15 @@ Game_Input(player pl)
pl.impulse = 0;
#endif
NSVehicle veh = (NSVehicle)pl.vehicle;
bool canfire = true;
if (veh)
if (veh.PreventPlayerFire() == true)
canfire = false;
if (canfire == false)
return;
if (input_buttons & INPUT_BUTTON0)
Weapons_Primary(pl);
else if (input_buttons & INPUT_BUTTON4)

View File

@ -69,9 +69,9 @@ class player:NSClientPlayer
virtual void(void) Physics_Jump;
#ifdef CLIENT
virtual void(void) draw;
virtual float() predraw;
virtual void(void) postdraw;
////virtual void(void) draw;
//virtual float() predraw;
//virtual void(void) postdraw;
virtual void(float,float) ReceiveEntity;
virtual void(void) PredictPreFrame;
virtual void(void) PredictPostFrame;

View File

@ -277,6 +277,8 @@ w_crossbow_secondary(player pl)
void
w_crossbow_reload(player pl)
{
NSTimer reload = __NULL__;
if (pl.w_attack_next > 0.0) {
return;
}
@ -297,8 +299,7 @@ w_crossbow_reload(player pl)
Weapons_ReloadWeapon(pl, player::crossbow_mag, player::ammo_bolt, 5);
}
pl.think = w_crossbow_reload_done;
pl.nextthink = time + 4.4f;
reload.TemporaryTimer(pl, w_crossbow_reload_done, 4.4f, false);
Sound_Play(pl, CHAN_ITEM, "weapon_crossbow.reload");
#endif

View File

@ -184,7 +184,7 @@ w_glock_primary(player pl)
View_SetMuzzleflash(MUZZLE_SMALL);
View_AddEvent(w_glock_ejectshell, 0.0f);
#else
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, Skill_GetValue("plr_9mm_bullet", 8), [0.01,0.01], WEAPON_GLOCK);
TraceAttack_FireBulletsWithDecal(1, pl.origin + pl.view_ofs, Skill_GetValue("plr_9mm_bullet", 8), [0.01,0.01], WEAPON_GLOCK, "Impact.BigShot");
Sound_Play(pl, CHAN_WEAPON, "weapon_glock.fire");
#endif
@ -228,7 +228,7 @@ w_glock_secondary(player pl)
View_SetMuzzleflash(MUZZLE_SMALL);
View_AddEvent(w_glock_ejectshell, 0.0f);
#else
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, Skill_GetValue("plr_9mm_bullet", 8), [0.1,0.1], WEAPON_GLOCK);
TraceAttack_FireBulletsWithDecal(1, pl.origin + pl.view_ofs, Skill_GetValue("plr_9mm_bullet", 8), [0.1,0.1], WEAPON_GLOCK, "Impact.BigShot");
Sound_Play(pl, CHAN_WEAPON, "weapon_glock.fire");
#endif
@ -297,10 +297,8 @@ w_glock_release(player pl)
if (w_glock_isempty(pl))
return;
if (pl.w_idle_next > 0.0) {
if (pl.w_idle_next > 0.0)
return;
}
r = floor(pseudorandom() * 3.0f);
switch (r) {

View File

@ -201,9 +201,9 @@ w_mp5_primary(player pl)
#else
/* singleplayer is more accurate */
if (cvar("sv_playerslots") == 1) {
TraceAttack_FireBullets(1, Weapons_GetCameraPos(pl), Skill_GetValue("plr_9mmAR_bullet", 5), [0.025,0.025], WEAPON_MP5);
TraceAttack_FireBulletsWithDecal(1, Weapons_GetCameraPos(pl), Skill_GetValue("plr_9mmAR_bullet", 5), [0.025,0.025], WEAPON_MP5, "Impact.BigShot");
} else {
TraceAttack_FireBullets(1, Weapons_GetCameraPos(pl), Skill_GetValue("plr_9mmAR_bullet", 5), [0.05,0.05], WEAPON_MP5);
TraceAttack_FireBulletsWithDecal(1, Weapons_GetCameraPos(pl), Skill_GetValue("plr_9mmAR_bullet", 5), [0.05,0.05], WEAPON_MP5, "Impact.BigShot");
}
Sound_Play(pl, CHAN_WEAPON, "weapon_mp5.shoot");

View File

@ -148,7 +148,7 @@ w_python_primary(player pl)
#ifdef CLIENT
View_SetMuzzleflash(MUZZLE_SMALL);
#else
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, Skill_GetValue("plr_357_bullet", 40), [0.008, 0.008], WEAPON_PYTHON);
TraceAttack_FireBulletsWithDecal(1, pl.origin + pl.view_ofs, Skill_GetValue("plr_357_bullet", 40), [0.008, 0.008], WEAPON_PYTHON, "Impact.BigShot");
Sound_Play(pl, CHAN_WEAPON, "weapon_357.shoot");
#endif

View File

@ -148,7 +148,7 @@ void w_rpg_primary(player pl)
rocket.solid = SOLID_BBOX;
//bolt.flags |= FL_LAGGEDMOVE;
rocket.gravity = 0.5f;
rocket.velocity = (v_forward * 250);
rocket.velocity = (pl.WaterLevel() >= WATERLEVEL_SUBMERGED) ? (v_forward * 100): (v_forward * 250);
rocket.angles = vectoangles(rocket.velocity);
rocket.avelocity[2] = 10;
rocket.touch = Rocket_Touch;
@ -286,7 +286,7 @@ void w_rpg_hud(player pl)
/* crosshair/laser */
if (pl.ammo_rpg_state == 1) {
float lerp;
vector jitter;
vector jitter = [0.0f, 0.0f, 0.0f];
Weapons_MakeVectors(pl);
vector src = pl.origin + pl.view_ofs;
traceline(src, src + (v_forward * 256), FALSE, pl);

View File

@ -212,9 +212,9 @@ w_shotgun_primary(player pl)
#ifdef SERVER
/* Singleplayer is more accurate */
if (serverkeyfloat("sv_playerslots") == 1) {
TraceAttack_FireBullets(6, pl.origin + pl.view_ofs, Skill_GetValue("plr_buckshot", 5), [0.08716,0.08716], WEAPON_SHOTGUN);
TraceAttack_FireBulletsWithDecal(6, pl.origin + pl.view_ofs, Skill_GetValue("plr_buckshot", 5), [0.08716,0.08716], WEAPON_SHOTGUN, "Impact.BigShot");
} else {
TraceAttack_FireBullets(4, pl.origin + pl.view_ofs, Skill_GetValue("plr_buckshot", 5), [0.08716,0.04362], WEAPON_SHOTGUN);
TraceAttack_FireBulletsWithDecal(4, pl.origin + pl.view_ofs, Skill_GetValue("plr_buckshot", 5), [0.08716,0.04362], WEAPON_SHOTGUN, "Impact.BigShot");
}
Sound_Play(pl, CHAN_WEAPON, "weapon_shotgun.single");
#else
@ -286,9 +286,9 @@ w_shotgun_secondary(player pl)
#ifdef SERVER
/* Singleplayer is more accurate */
if (serverkeyfloat("sv_playerslots") == 1) {
TraceAttack_FireBullets(12, pl.origin + pl.view_ofs, 5, [0.08716,0.08716], WEAPON_SHOTGUN);
TraceAttack_FireBulletsWithDecal(12, pl.origin + pl.view_ofs, 5, [0.08716,0.08716], WEAPON_SHOTGUN, "Impact.BigShot");
} else {
TraceAttack_FireBullets(8, pl.origin + pl.view_ofs, 5, [0.17365,0.04362], WEAPON_SHOTGUN);
TraceAttack_FireBulletsWithDecal(8, pl.origin + pl.view_ofs, 5, [0.17365,0.04362], WEAPON_SHOTGUN, "Impact.BigShot");
}
Sound_Play(pl, CHAN_WEAPON, "weapon_shotgun.double");
#else

View File

@ -0,0 +1,58 @@
// black bits
r_part main
{
type ball
texture ball
tcoords 1 65 31 95 256 8 32
scale 4
count 18
scalefactor 1
alpha 1
die 0.8
rgb 25 25 25
spawnmode ball
spawnorg 1
spawnvel 100
veladd 100
friction 0.3
gravity 800
}
// smoke
r_part +main
{
texture ball
tcoords 1 65 31 95 256 8 32
count 3
scale 25
scalefactor 1
die 1
alpha 0.5
rgb 25 25 25
blend add
spawnmode ball
spawnorg 2
spawnvel 20
veladd 20
}
// spark
r_part +main
{
type texturedspark
texture ball
tcoords 1 65 31 95 256 8 32
scale 1
count 8
scalefactor 1
alpha 0.5
die 0.8
rgb 255 115 0
blend add
spawnmode ball
spawnorg 1
spawnvel 100
veladd 100
friction 0.5
gravity 800
}

View File

@ -0,0 +1,31 @@
Impact.Shot
{
"{shot1" "1"
"{shot2" "1"
"{shot3" "1"
"{shot3" "1"
"{shot3" "1"
}
Impact.BigShot
{
"{bigshot1" "1"
"{bigshot2" "1"
"{bigshot3" "1"
"{bigshot4" "1"
"{bigshot5" "1"
}
Impact.Break
{
"{break1" "1"
"{break1" "1"
"{break1" "1"
}
ExplosionScorch
{
"{scorch1" "1"
"{scorch2" "1"
"{scorch3" "1"
}

View File

@ -0,0 +1,175 @@
default
{
part_bulletimpact "impact_default.main"
bulletimpact "sfx_impact.default"
stepleft "step_default.left"
stepright "step_default.right"
}
gs_material_glass
{
gamematerial Y
part_bulletimpact "impact_default.main"
bulletimpact "sfx_impact.glass"
stepleft "step_glass.left"
stepright "step_glass.right"
}
gs_material_wood
{
gamematerial W
part_bulletimpact "impact_default.main"
bulletimpact "sfx_impact.wood"
stepleft "step_wood.left"
stepright "step_wood.right"
}
gs_material_metal
{
gamematerial M
part_bulletimpact "impact_default.main"
bulletimpact "sfx_impact.metal"
stepleft "step_metal.left"
stepright "step_metal.right"
}
gs_material_flesh
{
gamematerial F
part_bulletimpact "impact_default.main"
bulletimpact "sfx_impact.flesh"
stepleft "step_flesh.left"
stepright "step_flesh.right"
}
gs_material_cinderblock
{
part_bulletimpact "impact_default.main"
bulletimpact "sfx_impact.concrete"
stepleft "step_default.left"
stepright "step_default.right"
}
gs_material_tile
{
gamematerial T
part_bulletimpact "impact_default.main"
bulletimpact "sfx_impact.tile"
stepleft "step_tile.left"
stepright "step_tile.right"
}
gs_material_computer
{
gamematerial P
part_bulletimpact "impact_default.main"
bulletimpact "sfx_impact.computer"
stepleft "step_computer.left"
stepright "step_computer.right"
}
gs_material_unbreakableglass
{
part_bulletimpact "impact_default.main"
bulletimpact "sfx_impact.glass"
stepleft "step_glass.left"
stepright "step_glass.right"
}
gs_material_rock
{
part_bulletimpact "impact_default.main"
bulletimpact "sfx_impact.rock"
stepleft "step_default.left"
stepright "step_default.right"
}
gs_material_flesh
{
gamematerial F
part_bulletimpact "impact_default.main"
bulletimpact "sfx_impact.flesh"
stepleft "step_flesh.left"
stepright "step_flesh.right"
}
gs_material_concrete
{
gamematerial C
part_bulletimpact "impact_default.main"
bulletimpact "sfx_impact.concrete"
stepleft "step_concrete.left"
stepright "step_concrete.right"
}
gs_material_dirt
{
gamematerial D
part_bulletimpact "impact_default.main"
bulletimpact "sfx_impact.dirt"
stepleft "step_dirt.left"
stepright "step_dirt.right"
}
gs_material_grate
{
gamematerial G
part_bulletimpact "impact_default.main"
bulletimpact "sfx_impact.grate"
stepleft "step_grate.left"
stepright "step_grate.right"
}
gs_material_alien
{
gamematerial H
part_bulletimpact "impact_default.main"
bulletimpact "sfx_impact.alien"
stepleft "step_alien.left"
stepright "step_alien.right"
}
gs_material_snow
{
gamematerial K
part_bulletimpact "impact_default.main"
bulletimpact "sfx_impact.snow"
stepleft "step_snow.left"
stepright "step_snow.right"
}
gs_material_sand
{
gamematerial N
part_bulletimpact "impact_default.main"
bulletimpact "sfx_impact.sand"
stepleft "step_sand.left"
stepright "step_sand.right"
}
gs_material_foliage
{
gamematerial O
part_bulletimpact "impact_default.main"
bulletimpact "sfx_impact.foliage"
stepleft "step_foliage.left"
stepright "step_foliage.right"
}
gs_material_slosh
{
gamematerial S
part_bulletimpact "impact_default.main"
bulletimpact "sfx_impact.slosh"
stepleft "step_slosh.left"
stepright "step_slosh.right"
}
gs_material_vent
{
gamematerial V
part_bulletimpact "impact_default.main"
bulletimpact "sfx_impact.snow"
stepleft "step_vent.left"
stepright "step_vent.right"
}