djcev.com

//

Git Repos / fte_dogmode / commit fcbb9b7

Commit: fcbb9b7c8d5ad7002dcc085040bd1a21516d2a7a
Parent: d5ecdd6a98f23c3ec3a1c8396d1c4cde9989976e
Author: Cameron Vanderzanden, 2024-06-15 19:50
Committer: Cameron Vanderzanden, 2024-06-15 19:50

Commit Message

Major update, committing as-is, will have bugs

I don't remember the state of the last commit so summarizing the
changes will be difficult.

CSQC has been partially re-written and new features have been
added. Player movement prediction has changed (and will likely
change again). Step smoothing now takes player speed into
account (and the speed of any MOVETYPE_PUSH entities the player
is standing on). View rolling has been implemented as well as
v_gunkick and punchangle (in the Z axis at least). The player
can now see their own EF_MUZZLEFLASH effects as well as their
EF_DIMLIGHT (powerup glow) effects. There are still visual
effects missing (view bob comes to mind); I'll be adding them
slowly as I go.

Crouching and crouchsliding have been added. There are unresolved
state tracking issues with crouchsliding but it otherwise works as
intended. Sounds TBD; I have some I'm using now but have elected
to not commit them to the repository (they're from another game).
Crouching works with Quake 3 maps, Quake 2 maps (presumably), and
any Quake map compiled with -wrbrushes .

PM_DanceMove now checks both prev_plane and prev_plan2 when
looking for plane interactions to clip velocity. Might as well,
since we're storing both, though velocity rarely needs to be
clipped to prev_plane2 in this way. There are still issues with
PM_DanceMove I haven't figured out (geometry it doesn't correctly
handle).

I've made an attempt at separating Q1 air control turning radius
from acceleration. Seems to function OK, though can feel a little
funky.

A number of func_ and trigger_ entities are now networked to CSQC
to improve movement prediction (and so I can control the drawing
and interpolation of func_ entities on the client). As implemented
here it works but is wonky, particularly in high (simulated) ping
environments. I don't yet know how to correctly handle clientside
SOLID_BSP MOVETYPE_PUSH entities.

cshift.qc has been rewritten to transmit a custom message to the
client rather than executed a string of stuffcmds. See CSQC_Parse_Event
and csf_draw. The fog controller will be rewritten in a similar
way eventually.

More deadstuff entities have been added to the base_gore framework
(though, I think, not all of them).

I've written a wonky and slow system to return a material type based
on the texture name at a given position. This is specifically for
varied player footsteps on different surfaces (metal, grass, stone,
etc). The texture name to material type matching function can be
found in compat/id1.qc. (I have no idea how this works in later games,
something about shaders and material types I assume).

I had started to overhaul the game's sounds but quit halfway;
evidence of this can be seen in the usage of VOL_ volume constants
(and a large number of sounds missing from this repo). Not sure
what to do about the missing sounds just yet, whether I'll commit
them or not. It'll be time to make a decision soon.

I'm sure there's more changes I'm forgetting here. I'll try to not
let the next commit get away from me again.

Change List

?File Add Del
M README.md +9 -5
M autoexec.cfg +5
M qc/base_entities.qc +322 -23
M qc/base_func.qc +182 -4
M qc/base_gore.qc +141 -62
M qc/base_item.qc +15 -6
M qc/base_monster.qc +221 -46
M qc/base_proj.qc +25 -4
M qc/base_trigger.qc +38 -2
M qc/cl_entry.qc +267 -137
M qc/cl_hud.qc +16 -6
D qc/cl_player.qc -329
M qc/cl_progs.src +31 -4
A qc/compat/id1.qc +165
A qc/compat/quake3.qc +175
D qc/compat_quake3.qc -163
M qc/cshift.qc +114 -72
M qc/custom_mdls.qc +6
M qc/custom_snd.qc +6
M qc/cutscene.qc +2 -2
M qc/defs_builtins.qc +88
M qc/defs_const.qc +240 -9
M qc/defs_ctypes.qc +29 -20
M qc/func/bob.qc +17 -1
M qc/func/bossgate.qc +6
M qc/func/breakable.qc +16 -2
M qc/func/brush.qc +6 -2
M qc/func/button.qc +5 -1
M qc/func/counter.qc +10
M qc/func/door.qc +114 -11
M qc/func/door_secret.qc +21 -13
M qc/func/elvtr_button.qc +9 -1
M qc/func/episodegate.qc +6
M qc/func/explobox.qc +7 -2
M qc/func/fall.qc +9 -3
M qc/func/fall2.qc +15 -3
M qc/func/illusionary.qc +4
M qc/func/laser.qc +14 -2
M qc/func/monster_spawner.qc +148 -135
M qc/func/new_plat.qc +120 -15
M qc/func/particlefield.qc +13 -10
M qc/func/plat.qc +101 -8
M qc/func/rotate.qc +150 -17
M qc/func/shadow.qc +12
M qc/func/togglevisiblewall.qc +7 -1
M qc/func/togglewall.qc +112 -4
M qc/func/train.qc +112 -7
M qc/func/wall.qc +8
M qc/hazards/ltrail.qc +19 -1
M qc/hazards/shooter.qc +25 -8
M qc/info/path_corner.qc +1 -1
M qc/items/ammo.qc +24 -3
M qc/items/armor.qc +26 -4
M qc/items/backpacks.qc +12 -6
M qc/items/health.qc +22 -2
M qc/items/keys.qc +27 -1
M qc/items/powerups.qc +21 -1
M qc/items/runes.qc +6 -2
M qc/items/weapons.qc +44 -1
M qc/keylock.qc +17 -1
M qc/math.qc +16 -2
M qc/misc/air_bubbles.qc +8
M qc/misc/ambient_sound.qc +20 -13
D qc/misc/deadstuff.qc -1
M qc/misc/explobox.qc +123 -1
M qc/misc/fireball.qc +4
M qc/misc/infight.qc +6
M qc/misc/light_candle.qc +8
M qc/misc/lights.qc +6
M qc/misc/model.qc +182 -4
M qc/misc/modeltrain.qc +22
M qc/misc/noisemaker.qc +11 -7
M qc/misc/particle_stream.qc +5 -1
M qc/misc/particles.qc +10
M qc/misc/particlespray.qc +10 -2
M qc/misc/play.qc +24 -11
M qc/misc/sparks.qc +12 -2
M qc/misc/target_autosave.qc +4
M qc/misc/teleporttrain.qc +7 -1
M qc/misc/viewthing.qc +4
M qc/monsters/boss.qc +12 -7
M qc/monsters/boss2.qc +20 -13
M qc/monsters/demon.qc +91 -35
M qc/monsters/dog.qc +104 -37
M qc/monsters/enforcer.qc +106 -59
M qc/monsters/fish.qc +68 -28
M qc/monsters/hknight.qc +113 -58
M qc/monsters/knight.qc +104 -55
M qc/monsters/ogre.qc +134 -66
M qc/monsters/oldone.qc +8 -5
M qc/monsters/oldone2.qc +9 -7
M qc/monsters/playerclient.qc +848 -211
M qc/monsters/shalrath.qc +80 -36
M qc/monsters/shambler.qc +95 -53
M qc/monsters/soldier.qc +105 -52
M qc/monsters/wizard.qc +89 -33
M qc/monsters/zombie.qc +34 -24
M qc/newflags.qc +7 -1
M qc/obituary.qc +6
M qc/pmove.qc +623 -230
M qc/projectiles/bullet.qc +3
M qc/projectiles/flak.qc +5 -1
M qc/projectiles/grenade.qc +8 -7
M qc/projectiles/laser.qc +1 -1
M qc/projectiles/lavaball.qc +2 -2
M qc/projectiles/multigrenade.qc +9 -6
M qc/projectiles/rocket.qc +7 -6
M qc/projectiles/voreball.qc +9 -7
M qc/projectiles/wizardspell.qc +1 -1
M qc/projectiles/zombiechunk.qc +4 -2
M qc/sv_entry.qc +39 -14
M qc/sv_progs.src +5 -3
M qc/triggers/changelevel.qc +8 -1
M qc/triggers/changemusic.qc +12
M qc/triggers/changetarget.qc +5
M qc/triggers/counter.qc +7
M qc/triggers/cvarset.qc +5
M qc/triggers/everything.qc +5
M qc/triggers/filter.qc +9
M qc/triggers/fog.qc +30 -2
M qc/triggers/heal.qc +11 -2
M qc/triggers/hurt.qc +7
M qc/triggers/ladder.qc +113
M qc/triggers/look.qc +9 -4
M qc/triggers/monsterface.qc +5
M qc/triggers/monsterjump.qc +7
M qc/triggers/multiple.qc +25 -4
M qc/triggers/onlyregistered.qc +6 -1
M qc/triggers/push.qc +187 -9
M qc/triggers/relay.qc +4
M qc/triggers/secret.qc +5
M qc/triggers/setcount.qc +5
M qc/triggers/setgravity.qc +117 -6
M qc/triggers/setskill.qc +4
M qc/triggers/setstate.qc +6
M qc/triggers/shake.qc +10 -2
M qc/triggers/take_weapon.qc +4
M qc/triggers/teleport.qc +12 -2
M qc/triggers/textstory.qc +21 -3
M qc/triggers/usekey.qc +7
M qc/triggers/void.qc +7
M qc/utility.qc -101
M qc/world.qc +169 -22
D sound/items/item_respawn_q3.wav
A sound/items/respawn.wav

Diff README.md

diff --git a/README.md b/README.md
index 8b4ed6d..acb488a 100644
--- a/README.md
+++ b/README.md
@@ -14,16 +14,20 @@ Server side Quake C based on progs_dump version 3.0, which can be found at:
Both above sources licensed GPL 2.0; Dog Mode (this mod, and the Quake C
source in this repo) is presented under the same license.

-#### Models & Sounds
+#### Models

-Models
+#### Sounds

-Sounds
+All included sounds have been adjusted, edited, filtered, or re-mixed in
+some way (hopefully for the better) and are presented in 16bit 22050hz
+mono format.

-* sound/items/armor_shard_q3.wav Armor shard sound from Quake 3 (id Software).
-* sound/items/item_respawn_q3.wav item repsawning sound from Q3 (id Software).
* sound/oldone2/pd_pop2.wav from progs_dump version 3.0

+Footsteps
+
+TODO
+
### The Name "Dog Mode"

I have a (now foggy) memory of a night of PQL duels where, inbetween

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

Diff autoexec.cfg

diff --git a/autoexec.cfg b/autoexec.cfg
index ed12c6c..8e765b3 100644
--- a/autoexec.cfg
+++ b/autoexec.cfg
@@ -1,5 +1,8 @@
// don't autoswitch weapons
seta cg_autoswitch 0
+//
+seta cl_rollangle 0.5
+seta cl_rollspeed 200
//
seta cl_run 0
// enable air stepping
@@ -10,3 +13,5 @@ seta pm_walljump 1
seta sv_bigcoords 1
// save in FTE format
seta sv_savefmt 1
+//
+seta v_gunkick 1

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

Diff qc/base_entities.qc

diff --git a/qc/base_entities.qc b/qc/base_entities.qc
index 6f8e3c3..59502f5 100644
--- a/qc/base_entities.qc
+++ b/qc/base_entities.qc
@@ -6,9 +6,11 @@
// constants
//======================================================================

+#if defined(CSQC) || defined(SSQC)
const float STATE_ACTIVE = 0; // .estate field values
const float STATE_INACTIVE = 1;
const float STATE_INVISIBLE = 8;
+#endif

//======================================================================
// globals
@@ -20,14 +22,19 @@ entity damage_attacker; // set by T_Damage
// string lastnameused; // targetname last used to trigger
#endif

+// float trace_surfaceflags; // TODO CEV
+
//======================================================================
// fields
//======================================================================

+#if defined(CSQC) || defined(SSQC)
.float aflag; // trigger_filter, func_counter, item_
.float alpha; // translucency in supported engines
.float cnt; // misc flag
.float color; // Hipnotic
+.float conlevel; // engine clobbers .waterlevel -- CEV
+.float contype; // engine clobbers .watertype -- CEV
.float count; // for counting triggers
.float damage_mod; // dumptruck_ds
.float delay; // time from activation to firing
@@ -42,6 +49,7 @@ entity damage_attacker; // set by T_Damage
.float speed2;
.float state; // plats / doors / buttons
.float style, style2;
+.float sveffects; // engine clobbers .effects -- CEV
.float t_length, t_width; // func_, monster face, player LG, etc
.float wait; // time from firing to restarting
.float waitmin; // sounds (removed: waitmax)
@@ -58,6 +66,7 @@ entity damage_attacker; // set by T_Damage
.string origmodel; // switchables brushes (added by bmFbr)

.vector mangle; // angle at start
+.vector neworigin; // prediction, hipnotic rotation
.vector pos1; // used by some func_ classes
.vector pos2;

@@ -77,8 +86,9 @@ entity damage_attacker; // set by T_Damage
.string killtarget2; // second target to kill
.string pain_target; // dumptruck_ds

-.void(entity src, float amount) pain; // th_pain
+.void(entity src, float amount) th_pain;
.void(vector dir) destroy; // th_die
+#endif

#ifdef SSQC
// Called by the engine whenever an entity needs to be (re)sent to a client's
@@ -93,11 +103,29 @@ entity damage_attacker; // set by T_Damage
.float SendFlags;
#endif

+#ifdef CSQC
+.vector origin_net; // entity networking / prediction;
+.vector velocity_net; // based on the implementation in
+.vector angles_net; // Nuclide -- CEV
+.float flags_net;
+.float pmove_flags_net;
+.float crouchslide_timer_net;
+.float doublejump_timer_net;
+#endif
+
//======================================================================
// forward declarations
//======================================================================

// base entity
+#ifdef CSQC
+float() base_entity_parsemapdata;
+#endif
+#if defined(CSQC) || defined(SSQC)
+void(entity e) base_entity_aligntoground;
+void(entity e, entity p, float maxspeed) base_entity_push;
+void(entity e) base_entity_positioncontents;
+#endif
#ifdef SSQC
float(entity src, entity dest) can_damage;
void(entity targ, entity inflictor, entity attacker, vector dir) killed;
@@ -137,9 +165,11 @@ strip void() temp_delayed_targets;
#endif

// base_mapentity
-#ifdef SSQC
+#if defined(CSQC) || defined(SSQC)
void(entity e) sub_setmovedir;
+#ifdef SSQC
void() sub_useandforgettargets;
+#endif
void(entity e) base_mapentity_init;
strip void() base_mapentity;
#endif
@@ -155,11 +185,264 @@ void() noclass;
// class base_entity: entity
// {
//==============================================================
+ // Misc Functions
+ //==============================================================
+
+#ifdef CSQC
+ //--------------------------------------------------------------
+ // Called from CSQC_WorldLoaded to parse the map entity lump;
+ // here on the client-side we mostly care about entities that
+ // are solid or can affect movement -- CEV
+ //--------------------------------------------------------------
+ float() base_entity_parsemapdata =
+ {
+ local string field, value = "";
+ local entity e = spawn ();
+ local entity oself;
+ local void(entity e) initfunc = __NULL__;
+
+ while (1)
+ {
+ field = getentitytoken ();
+
+ if (field == __NULL__ || field == "")
+ break;
+
+ if (field == "}")
+ {
+ if (e.classname == __NULL__ ||
+ e.classname == "")
+ {
+ break;
+ }
+
+ if (e.classname == "worldspawn")
+ {
+ // manually copy a couple fields
+ world.fog_color = e.fog_color;
+ world.fog_density = e.fog_density;
+ // initialize world
+ oself = self;
+ self = world;
+ worldspawn ();
+ self = oself;
+ // don't need ent e anymore
+ remove (e);
+ return TRUE;
+ }
+ else if (initfunc)
+ {
+ initfunc (e);
+ return TRUE;
+ }
+
+ // past here we're ignoring the entity -- CEV
+ remove (e);
+ return TRUE;
+ }
+
+ value = getentitytoken ();
+
+ if (value == __NULL__ || value == "")
+ break;
+
+ // dprint (sprintf("CSQC_WorldLoaded: field %s, "
+ // "value %s\n", field, value));
+
+ switch (field)
+ {
+ case "classname":
+ e.classname = value;
+ break;
+ case "origin":
+ e.origin = stov (value);
+ break;
+ case "angles":
+ e.angles = stov (value);
+ break;
+ case "angle":
+ e.angles_x = 0;
+ e.angles_y = stof (value);
+ e.angles_z = 0;
+ break;
+ case "mangle":
+ e.mangle = stov (value);
+ break;
+ case "model":
+ e.model = value;
+ break;
+ case "fog_color":
+ e.fog_color = stov (value);
+ break;
+ case "fog_density":
+ e.fog_density = stof (value);
+ break;
+ }
+ }
+
+ // unhandled entity or something went wrong -- CEV
+ remove (e);
+ return FALSE;
+ };
+#endif
+
+#if defined(CSQC) || defined(SSQC)
+ //--------------------------------------------------------------
+ // Align an entity to the ground plane. Code by Spike, found here:
+ // https://forums.insideqc.com/viewtopic.php?f=2&t=5585#p55093
+ //--------------------------------------------------------------
+ void(entity e) base_entity_aligntoground =
+ {
+ traceline (e.origin, e.origin - '0 0 128', TRUE, e);
+
+ if (trace_fraction == 1)
+ return;
+
+ local vector ang = e.angles;
+ ang_x *= -1;
+ makevectors (ang);
+ local vector coplanar = v_forward -
+ (v_forward * trace_plane_normal) * trace_plane_normal;
+ e.angles = vectoangles (coplanar, trace_plane_normal);
+ // e.angles = vectoangles (coplanar);
+ };
+
+ //--------------------------------------------------------------
+ // Push entity e away from entity p at a rate based on p's
+ // velocity (no higher than maxspeed) -- CEV
+ //--------------------------------------------------------------
+ void(entity e, entity p, float maxspeed) base_entity_push =
+ {
+ local float espeed, newspeed, zspeed;
+
+ if (p.classtype == CT_PLAYER && p.speed)
+ newspeed = p.speed;
+ else
+ newspeed = vlen ([p.velocity_x, p.velocity_y, 0]);
+
+ zspeed = e.velocity_z;
+
+ // entities usually won't move if they're ONGROUND -- CEV
+ e.flags &= ~FL_ONGROUND;
+
+ // move away from the pushing entity; this is the same method
+ // t_damage uses to find damage knockback direction -- CEV
+ local vector dir;
+ dir = e.origin - (p.absmin + p.absmax) * 0.5;
+ dir = normalize (dir);
+ e.velocity += dir * newspeed;
+
+ // limit speed to argument maxspeed -- CEV
+ e.velocity_z = 0;
+ espeed = vlen (e.velocity);
+ if (espeed > maxspeed)
+ {
+ e.velocity = normalize (e.velocity);
+ e.velocity *= maxspeed;
+ }
+
+ if (e.movetype == MOVETYPE_BOUNCE)
+ // MOVETYPE_BOUNCE entities stop when impacting the
+ // ground if Z velocity is 60 or less. Let's not
+ // bounce around too much, so set a Z velocity a
+ // little above that threshhold. -- CEV
+ e.velocity_z = 70;
+ else
+ // restore Z speed as normal
+ e.velocity_z = zspeed;
+ };
+
+ //--------------------------------------------------------------
+ // Set waterlevel and watertype; based on checks from purecsqc's
+ // pmove.qc. Called by both monsters and players. -- CEV
+ //--------------------------------------------------------------
+ void(entity e) base_entity_positioncontents =
+ {
+ local vector v = e.origin;
+ #ifdef SSQC
+ local float oldtype = e.contype;
+ #endif
+
+ // check contents at e's feet + 1
+ v_z = e.origin_z + e.mins_z + 1;
+ e.contype = pointcontents (v);
+ if (e.contype < CONTENT_SOLID)
+ {
+ if (e.classtype == CT_PLAYER)
+ {
+ v_z = e.origin_z + (e.mins_z + e.maxs_z) * 0.5;
+ if (pointcontents(v) < CONTENT_SOLID)
+ {
+ v_z = e.origin_z + e.maxs_z;
+ if (pointcontents(v) < CONTENT_SOLID)
+ e.conlevel = WATERLEVEL_EYES;
+ else
+ e.conlevel = WATERLEVEL_WAIST;
+ }
+ else
+ {
+ e.conlevel = WATERLEVEL_FEET;
+ }
+ }
+ else if (e.classgroup & CG_MONSTER)
+ {
+ // only check contents past feet if the
+ // monster is in water
+ if (e.contype == CONTENT_WATER)
+ {
+ v_z = e.origin_z + e.maxs_z;
+ if (pointcontents(v) < CONTENT_SOLID)
+ e.conlevel = WATERLEVEL_EYES;
+ else
+ e.conlevel = WATERLEVEL_FEET;
+ }
+ else
+ {
+ e.conlevel = WATERLEVEL_FEET;
+ }
+ }
+ else
+ {
+ // all other entities only check to feet level
+ e.conlevel = WATERLEVEL_FEET;
+ }
+ }
+ else
+ {
+ e.conlevel = WATERLEVEL_NONE;
+ if (e.classgroup & CG_MONSTER)
+ e.air_finished = time + 12;
+ }
+
+ #ifdef SSQC
+ // do our content transition checks right here -- CEV
+ if (e.contype <= CONTENT_WATER && oldtype == CONTENT_EMPTY)
+ {
+ if (e.classtype != CT_PLAYER)
+ {
+ if (e.swim_time < time)
+ {
+ e.swim_time = time + 2;
+ sound (e, CHAN_AUTO, "misc/h2ohit1.wav",
+ VOL_MID, ATTN_NORM);
+ }
+ }
+ }
+
+ if (e.contype == CONTENT_EMPTY)
+ {
+ e.watertype = e.contype;
+ e.waterlevel = e.conlevel;
+ }
+ #endif
+ };
+#endif
+
+ //==============================================================
// Damage Functions
//==============================================================

#ifdef SSQC
-
//--------------------------------------------------------------
// CanDamage
// Returns true if the source (inflictor) can directly damage
@@ -167,11 +450,14 @@ void() noclass;
//--------------------------------------------------------------
float(entity src, entity dest) can_damage =
{
+ if (dest.takedamage == DAMAGE_NO)
+ return FALSE;
+
// bmodels need special checking because their origin is 0,0,0
if (dest.movetype == MOVETYPE_PUSH)
{
traceline (src.origin,
- 0.5 * (dest.absmin + dest.absmax), TRUE, self);
+ 0.5 * (dest.absmin + dest.absmax), TRUE, src);
if (trace_fraction == 1)
return TRUE;
if (trace_ent == dest)
@@ -179,19 +465,19 @@ void() noclass;
return FALSE;
}

- traceline (src.origin, dest.origin, TRUE, self);
+ traceline (src.origin, dest.origin, TRUE, src);
if (trace_fraction == 1)
return TRUE;
- traceline (src.origin, dest.origin + '15 15 0', TRUE, self);
+ traceline (src.origin, dest.origin + '15 15 0', TRUE, src);
if (trace_fraction == 1)
return TRUE;
- traceline (src.origin, dest.origin + '-15 -15 0', TRUE, self);
+ traceline (src.origin, dest.origin + '-15 -15 0', TRUE, src);
if (trace_fraction == 1)
return TRUE;
- traceline (src.origin, dest.origin + '-15 15 0', TRUE, self);
+ traceline (src.origin, dest.origin + '-15 15 0', TRUE, src);
if (trace_fraction == 1)
return TRUE;
- traceline (src.origin, dest.origin + '15 -15 0', TRUE, self);
+ traceline (src.origin, dest.origin + '15 -15 0', TRUE, src);
if (trace_fraction == 1)
return TRUE;

@@ -218,13 +504,17 @@ void() noclass;
self.movetype == MOVETYPE_BOUNCE)
{
// doors, triggers, missiles, etc
- if (self.destroy)
+ if (self.th_die)
{
- // origin, absmin/max, and other properties
- // are different for brush entities so figure
- // dir from the inflictor's angles -- CEV
- makevectors (inflictor.angles);
- self.destroy (normalize(v_forward));
+ self.th_die ();
+ }
+ else if (self.destroy)
+ {
+ // rework for MOVETYPE_NONE, PUSH, etc -- CEV
+ dir = ((targ.absmin + targ.absmax) * 0.5) -
+ ((inflictor.absmin + inflictor.absmax)
+ * 0.5);
+ self.destroy (normalize(dir));
}
self = stemp;
return;
@@ -247,7 +537,9 @@ void() noclass;
if (self.classgroup & CG_MONSTER)
sub_death_use ();

- if (self.destroy)
+ if (self.th_die)
+ self.th_die ();
+ else if (self.destroy)
self.destroy (dir);

self = stemp;
@@ -455,7 +747,7 @@ void() noclass;
}

// apply momentum change to players and monsters -- CEV
- if (inflictor != world && (
+ if (inflictor != world && targ.solid != SOLID_CORPSE && (
targ.movetype == MOVETYPE_WALK ||
targ.movetype == MOVETYPE_STEP ||
targ.movetype == MOVETYPE_FLY))
@@ -463,6 +755,7 @@ void() noclass;
// figure momentum direction
dir = targ.origin -
(inflictor.absmin + inflictor.absmax) * 0.5;
+ dir_z = dir_z * 0.7;
dir = normalize (dir);

if (targ.flags & FL_MONSTER && targ.flags & FL_ONGROUND)
@@ -485,12 +778,13 @@ void() noclass;
// check for godmode or invincibility
if (targ.flags & FL_GODMODE)
return;
+
if (targ.invincible_finished >= time)
{
if (self.invincible_sound < time)
{
sound (targ, CHAN_ITEM, "items/protect3.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
self.invincible_sound = time + 2;
}
return;
@@ -582,9 +876,9 @@ void() noclass;
}
}

- if (self.pain)
+ if (self.th_pain)
{
- self.pain (attacker, take);
+ self.th_pain (attacker, take);
// nightmare mode monsters don't go into
// pain frames often
if (skill == 3)
@@ -678,8 +972,10 @@ void() noclass;
if (toucher.classtype != CT_PLAYER)
return FALSE;

+ #ifdef SSQC
if (toucher.health <= 0)
return FALSE;
+ #endif

if (toucher.movetype == MOVETYPE_NOCLIP)
return FALSE;
@@ -720,7 +1016,7 @@ void() noclass;
if (!self.noise)
sound (t, CHAN_VOICE,
"misc/talk.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
t = findfloat (t, classtype, CT_PLAYER);
}
}
@@ -729,7 +1025,8 @@ void() noclass;
centerprint (activator, self.message);
if (!self.noise)
sound (activator, CHAN_VOICE,
- "misc/talk.wav", 1, ATTN_NORM);
+ "misc/talk.wav",
+ VOL_HIGH, ATTN_NORM);
}
}

@@ -912,7 +1209,7 @@ void() noclass;
// };
#endif

-#ifdef SSQC
+#if defined(CSQC) || defined(SSQC)
//----------------------------------------------------------------------
// base_mapentity -- spawnable mapper-placeable entities
//----------------------------------------------------------------------
@@ -944,6 +1241,7 @@ void() noclass;
e.angles = '0 0 0';
};

+#ifdef SSQC
//--------------------------------------------------------------
void() sub_useandforgettargets =
{
@@ -958,6 +1256,7 @@ void() noclass;
self.target3 = "";
self.target4 = "";
};
+#endif

//==============================================================
// Initialization

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

Diff qc/base_func.qc

diff --git a/qc/base_func.qc b/qc/base_func.qc
index 6a88388..a3c25b5 100644
--- a/qc/base_func.qc
+++ b/qc/base_func.qc
@@ -6,31 +6,64 @@
// Constants
//======================================================================

+#if defined(CSQC) || defined(SSQC)
const float FUNC_STATE_TOP = 0; // button, door, elevator states
const float FUNC_STATE_BOTTOM = 1;
const float FUNC_STATE_UP = 2;
const float FUNC_STATE_DOWN = 3;
+#endif
+
+#if defined(CSQC) || defined(SSQC)
+const float BASE_FUNC_NET_ORIGIN = 1<<0;// origin has changed
+const float BASE_FUNC_NET_SIZE = 1<<1; // size (mins, maxs) has changed
+const float BASE_FUNC_NET_VELOCITY = 1<<2; // velocity has changed
+const float BASE_FUNC_NET_MODEL = 1<<3; // model has changed
+const float BASE_FUNC_NET_SPEED = 1<<4; // speed has changed
+#endif

//======================================================================
// fields
//======================================================================

-.float lip; //
+#ifdef CSQC
+.float movetime; // timestamp this func started moving
+.vector origin_start;
+#endif

+#if defined(CSQC) || defined(SSQC)
.void() think1; // called by calcmove_done
.vector finaldest, finalangle;
+#endif
+
+#ifdef SSQC
+.float lip; //
+#endif

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

+// base_func
+#ifdef CSQC
+void(float isnew, float netflags) base_func_netreceive_read;
+float() base_func_predraw_solidpush;
+#endif
+#ifdef SSQC
+float(entity to, float netflags) base_func_netsend;
+#endif
+#ifdef SSQC
void() sub_calcmove_done_think;
void(entity e, vector tdest, float tspeed, void() newthink) sub_calcmove;
void() sub_calcanglemovecontroller_done;
void(entity e, vector destangle, float tspeed, void() func, entity c)
sub_calcanglemovecontroller;
+#endif
+#if defined(CSQC) || defined(SSQC)
void(entity e) base_func_init;
+#endif
+#ifdef SSQC
strip void() base_func;
+#endif

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

@@ -38,9 +71,149 @@ strip void() base_func;
// class base_func: base_mapentity
// {
//==============================================================
+ // Drawing & Networking
+ //==============================================================
+
+#ifdef CSQC
+ //--------------------------------------------------------------
+ // returns a FUNC_STATE to be handled by the func's netreceive
+ //--------------------------------------------------------------
+ void(float isnew, float netflags) base_func_netreceive_read =
+ {
+ if (netflags & BASE_FUNC_NET_MODEL)
+ self.modelindex = ReadFloat ();
+
+ if (netflags & BASE_FUNC_NET_ORIGIN)
+ {
+ self.origin_x = ReadCoord ();
+ self.origin_y = ReadCoord ();
+ self.origin_z = ReadCoord ();
+ }
+
+ if (netflags & BASE_FUNC_NET_VELOCITY)
+ {
+ self.velocity_x = ReadCoord ();
+ self.velocity_y = ReadCoord ();
+ self.velocity_z = ReadCoord ();
+ }
+
+ if (netflags & BASE_FUNC_NET_SIZE)
+ {
+ self.mins_x = ReadCoord ();
+ self.mins_y = ReadCoord ();
+ self.mins_z = ReadCoord ();
+ self.maxs_x = ReadCoord ();
+ self.maxs_y = ReadCoord ();
+ self.maxs_z = ReadCoord ();
+ }
+
+ if (netflags & BASE_FUNC_NET_SPEED)
+ self.speed = ReadFloat ();
+ };
+
+ //--------------------------------------------------------------
+ // manually move SOLID_BSP MOVETYPE_PUSH entities based on their
+ // velocity and the timestamp of the last related server message.
+ // interpolates and kinda- sorta- predicts the move. (hopefully.)
+ // does not play well in (simulated) high ping environments.
+ //
+ // this took a really long time to figure out. -- CEV
+ //--------------------------------------------------------------
+ float() base_func_predraw_solidpush =
+ {
+ if (self.movetime)
+ {
+ // calculate new origin from the last origin
+ // the server sent us, the rate we're moving,
+ // and the timestamp of that server message.
+ // this only works with entities that maintain
+ // a constant velocity while moving -- CEV
+ self.neworigin = self.origin_start + self.velocity *
+ (time - self.movetime);
+
+ // must be careful to handle speed = 0 -- CEV
+ local float f;
+ if (self.speed)
+ f = bound (0, frametime * (self.speed*0.2), 1);
+ else
+ f = bound (0, frametime * 30, 1);
+
+ // final origin is an interpolation of neworigin
+ // above and the previous calculated origin -- CEV
+ self.origin = self.oldorigin +
+ ((self.neworigin - self.oldorigin) * f);
+
+ // save off oldorigin -- CEV
+ self.oldorigin = self.origin;
+
+ /*
+ dprint (sprintf("base_func_predraw_solidpush: "
+ "entity %g, time %g, frametime %g, "
+ "lerpfrac %g\n",
+ self.entnum, time, frametime, f));
+ */
+
+ addentity (self);
+
+ // rewind to the last origin sent by the server
+ // for collision detection -- CEV
+ setorigin (self, self.origin_net);
+ }
+ else
+ {
+ addentity (self);
+ }
+
+ return PREDRAW_NEXT;
+ };
+#endif
+
+#ifdef SSQC
+ //--------------------------------------------------------------
+ float(entity to, float netflags) base_func_netsend =
+ {
+ WriteFloat (MSG_ENTITY, self.classtype);
+ WriteFloat (MSG_ENTITY, netflags);
+
+ if (netflags & BASE_FUNC_NET_MODEL)
+ WriteFloat (MSG_ENTITY, self.modelindex);
+
+ if (netflags & BASE_FUNC_NET_ORIGIN)
+ {
+ WriteCoord (MSG_ENTITY, self.origin_x);
+ WriteCoord (MSG_ENTITY, self.origin_y);
+ WriteCoord (MSG_ENTITY, self.origin_z);
+ }
+
+ if (netflags & BASE_FUNC_NET_VELOCITY)
+ {
+ WriteCoord (MSG_ENTITY, self.velocity_x);
+ WriteCoord (MSG_ENTITY, self.velocity_y);
+ WriteCoord (MSG_ENTITY, self.velocity_z);
+ }
+
+ if (netflags & BASE_FUNC_NET_SIZE)
+ {
+ WriteCoord (MSG_ENTITY, self.mins_x);
+ WriteCoord (MSG_ENTITY, self.mins_y);
+ WriteCoord (MSG_ENTITY, self.mins_z);
+ WriteCoord (MSG_ENTITY, self.maxs_x);
+ WriteCoord (MSG_ENTITY, self.maxs_y);
+ WriteCoord (MSG_ENTITY, self.maxs_z);
+ }
+
+ if (netflags & BASE_FUNC_NET_SPEED)
+ WriteFloat (MSG_ENTITY, self.speed);
+
+ return TRUE;
+ };
+#endif
+
+ //==============================================================
// Subs
//==============================================================

+#ifdef SSQC
//--------------------------------------------------------------
void() sub_calcmove_done_think =
{
@@ -136,9 +309,9 @@ strip void() base_func;
destdelta = normalize_angles180 (destangle - e.angles);

/*
- dprint3 ("destangle: ", vtos(destangle), "\n");
- dprint3 ("self.angles: ", vtos(self.angles), "\n");
- dprint3 ("destdelta: ", vtos(destdelta), "\n");
+ dprint (sprintf("destangle: %v\n", destangle));
+ dprint (sprintf("self.angles: %v\n", self.angles));
+ dprint (sprintf("destdelta: %v\n", destdelta));
*/

// calculate length of vector
@@ -161,21 +334,26 @@ strip void() base_func;
c.finalangle = destangle;
c.think = sub_calcanglemovecontroller_done;
};
+#endif

//==============================================================
// Constructor & Spawn Functions
//==============================================================

+#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void(entity e) base_func_init =
{
base_mapentity_init (e);
e.classgroup |= CG_FUNC;
};
+#endif

+#ifdef SSQC
//--------------------------------------------------------------
strip void() base_func =
{
base_func_init (self);
};
+#endif
// };

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

Diff qc/base_gore.qc

diff --git a/qc/base_gore.qc b/qc/base_gore.qc
index 3205da7..5e559df 100644
--- a/qc/base_gore.qc
+++ b/qc/base_gore.qc
@@ -13,62 +13,83 @@
// constants
//======================================================================

+#ifdef SSQC
const float GIB_SOLID = 1; // spawnflags: solid
const float GIB_DYNAMIC = 2; // non-static, moveable gibs

+const float CORPSE_HEALTH = 30; // static corpse health
+
const vector GIB_1_MINS = '-3.57 -8.06 -3.34';
const vector GIB_1_MAXS = '3.69 8.31 30';
const vector GIB_2_MINS = '-12.68 -14.83 -6.19';
const vector GIB_2_MAXS = '13.53 14.57 30';
const vector GIB_3_MINS = '-18.95 -15.92 -3.13';
const vector GIB_3_MAXS = '13.17 15.66 30';
+#endif

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

+#ifdef SSQC
void(vector org, vector vel, float damage) spawn_blood;
void(float damage) spawn_touchblood;
void(vector org, vector vel) spawn_chunk;
entity(vector org, vector vel) spawn_meatspray;
vector(vector dir, float dmg) velocity_for_damage;
+#endif

+#ifdef SSQC
// base_corpse
+void(entity e, float corpse_health) become_base_corpse;
+void(entity e) base_corpse_init;
strip void() base_corpse;
+#endif

+#ifdef SSQC
// base_gib
void() base_gib_touch;
entity(entity src, vector org, vector vel, float sflags, .string gibfield,
void(entity) initfn) spawn_base_gib;
void(entity e) base_gib_init;
strip void() base_gib;
+#endif

+#ifdef SSQC
// gib_misc_1
void(entity src, vector dir, float dmg) throw_gib_1;
entity(entity src, vector org, vector vel, float sflags) spawn_gib_misc_1;
void(entity e) gib_misc_1_init;
void() gib_misc_1;
+#endif

+#ifdef SSQC
// gib_misc_2
void(entity src, vector dir, float dmg) throw_gib_2;
entity(entity src, vector org, vector vel, float sflags) spawn_gib_misc_2;
void(entity e) gib_misc_2_init;
void() gib_misc_2;
+#endif

+#ifdef SSQC
// gib_misc_3
void(entity src, vector dir, float dmg) throw_gib_3;
entity(entity src, vector org, vector vel, float sflags) spawn_gib_misc_3;
void(entity e) gib_misc_3_init;
void() gib_misc_3;
+#endif

+#ifdef SSQC
// base_gib_head
-void(entity act, vector dir, float dmg, void(entity e) initfn)
+void(entity e, vector dir, float dmg, void(entity e) initfn)
base_gib_head_throw;
void(entity e) base_gib_head_init;
strip void() base_gib_head;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// SpawnBlood
//----------------------------------------------------------------------
@@ -121,51 +142,113 @@ entity(vector org, vector vel) spawn_meatspray =
//----------------------------------------------------------------------
vector(vector dir, float dmg) velocity_for_damage =
{
- local vector startdir = dir;
+ // local vector startdir = dir;
+ local vector v;

- if (dmg == 0 || dir == '0 0 0')
- {
- // original id1 behavior -- CEV
- dir_x = 100 * crandom ();
- dir_y = 100 * crandom ();
- dir_z = 200 + 100 * random ();
-
- if (dmg > -50)
- dir = dir * 0.7;
- else if (dmg > -200)
- dir = dir * 2;
- else
- dir = dir * 10;
- }
- else
+ // next three lines original id1 behavior -- CEV
+ v_x = 100 * crandom ();
+ v_y = 100 * crandom ();
+ v_z = 200 + 100 * random ();
+ // damage response scaling from Alkaline, presumably by bmFbr -- CEV
+ v *= max (1, min(10, dmg * dmg / 5000));
+
+ if (dir != '0 0 0')
{
- // I'm sure there's a better way to do this -- CEV
- dir_x = dir_x * (4 * fabs(dmg) * random());
- dir_y = dir_y * (4 * fabs(dmg) * random());
- if (dir_z > 0)
- dir_z = 250 + 2 * ((fabs(dmg) * fabs(dir_z)));
- else
- dir_z = 250 + 2 * ((fabs(dmg) * (random() * 0.5)));
+ // directional gib behavior from Alkaline (which appears to
+ // be by bmFbr according to the commit log, see Alkaline
+ // commit 083f87c18a2d2be645ba197c1f23fc6533afca81).
+ // dir is set by killed () and is already normalized -- CEV
+ dir *= bound (10, dmg * dmg / 22, 800);
+ dir_x *= 2.5;
+ dir_y *= 2.5;
+ dir_z *= 0.7;
+ v += dir;
}

- dprint (sprintf("velocity_for_damage: damage is %g, startdir is %v, "
- "dir is %v\n", dmg, startdir, dir));
+ // velocity limiting code again from Alkaline and written by bmFbr.
+ // I'm leaning on Alkaline here and above because the implementation
+ // I came up with was way worse. -- CEV
+ local float vspeed = vlen (v);
+ if (vspeed > 500)
+ v *= 500 / vspeed;
+ v_z = min (500, v_z);

- return dir;
+ // dprint (sprintf("velocity_for_damage: damage is %g, startdir is %v, "
+ // "v is %v\n", dmg, startdir, v));
+
+ return v;
};
+#endif

+#ifdef SSQC
+//----------------------------------------------------------------------
+// Corpse base class, used for both converting dead monsters into corpses
+// and for DeadStuff mod mapper-placeable corpses -- CEV
//----------------------------------------------------------------------
// class base_corpse: base_mapentity
// {
-// https://www.insideqc.com/qctut/qctut-33.shtml
-// TODO CEV
+ //--------------------------------------------------------------
+ // Convert an entity into a shootable corpse. Call at the end of
+ // a monster's death think. Uses FTE's SOLID_CORPSE. Inspired by
+ // / based on Kryten's gibbable corpse tutorial found at
+ // https://www.insideqc.com/qctut/qctut-33.shtml -- CEV
+ //--------------------------------------------------------------
+ void(entity e, float corpse_health) become_base_corpse =
+ {
+ e.classgroup |= CG_CORPSE;
+
+ // set up trigger interaction
+ e.flags &= ~FL_MONSTER;
+ if (corpse_health)
+ e.health = corpse_health;
+ else
+ e.health = CORPSE_HEALTH;
+ // e.movetype = MOVETYPE_STEP;
+ e.solid = SOLID_CORPSE;
+ e.takedamage = DAMAGE_YES;
+
+ // clear targets
+ e.killtarget = e.killtarget2 = __NULL__;
+ e.pain_target = __NULL__;
+ e.target = e.target2 = e.target3 = e.target4 = __NULL__;
+
+ // clear everything but destroy
+ // leave e.destroy alone, the existing destroy will handle it
+ e.th_pain = sub_nullpain;
+ // leave e.think alone so e's animation can finish
+ e.touch = sub_null;
+ e.use = sub_null;
+
+ // clear monster think functions
+ e.th_melee = sub_null;
+ e.th_missile = sub_null;
+ e.th_run = sub_null;
+ e.th_stand = sub_null;
+ e.th_turret = sub_null;
+ e.th_walk = sub_null;
+ };
+
+ //--------------------------------------------------------------
+ void(entity e) base_corpse_init =
+ {
+ base_mapentity_init (e);
+ e.classgroup |= CG_CORPSE;
+
+ if (e.spawnflags & GIB_SOLID)
+ e.solid = SOLID_BBOX;
+ else
+ e.solid = SOLID_NOT;
+ };
+
//--------------------------------------------------------------
strip void() base_corpse =
{
base_corpse_init (self);
};
// };
+#endif

+#ifdef SSQC
//----------------------------------------------------------------------
// class base_gib: base_mapentity
// {
@@ -184,39 +267,19 @@ vector(vector dir, float dmg) velocity_for_damage =
if (other.classtype != CT_PLAYER && !(other.flags & FL_MONSTER))
return;

- local float other_spd;
- other_spd = vlen ([other.velocity_x, other.velocity_y, 0]);
-
// only run if other is moving fast enough to disturb
// stationary objects -- CEV
- if (other_spd < 200)
+ if (other.classtype == CT_PLAYER && other.speed < 200)
return;

- // clamp speed to PM_MAXSPEED (320) -- CEV
- other_spd = min (other_spd, PM_MAXSPEED);
-
- // this is the same method t_damage uses to find damage
- // knockback direction -- CEV
- local vector dir;
- dir = self.origin - (other.absmin + other.absmax) * 0.5;
- dir = normalize (dir);
-
- self.flags &= ~FL_ONGROUND;
+ // push self horizontally according to other's direction and
+ // speed, maximum of 160ups -- CEV
+ base_entity_push (self, other, PM_MAXSPEED * 0.5);

if (self.avelocity_y == 0)
// a little spin, as a treat. Rotating in the other
// axes seem to cause gibs to move into the floor -- CEV
self.avelocity_y = 100 * crandom ();
-
- // move in direction at half of other's speed (so this will
- // usually be 160) -- CEV
- self.velocity += dir * (other_spd * 0.5);
-
- // MOVETYPE_BOUNCE entities stop when impacting the ground if
- // Z velocity is 60 or less. I don't want moveable gibs to
- // be flying around, so set a fixed Z velocity a little above
- // that 60 threshold -- CEV
- self.velocity_z = 75;
};

//--------------------------------------------------------------
@@ -240,6 +303,13 @@ vector(vector dir, float dmg) velocity_for_damage =
if (!(e.flags & FL_CLIENT))
base_mapentity_init (e);

+ e.classgroup |= CG_CORPSE;
+
+ // if we're converting an existing entity and it has a destroy
+ // function make sure that destroy func is sub_null -- CEV
+ if (e.destroy)
+ e.destroy = sub_nulldestroy;
+
if (e.spawnflags & GIB_SOLID)
{
e.solid = SOLID_BBOX;
@@ -266,7 +336,9 @@ vector(vector dir, float dmg) velocity_for_damage =
base_gib_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED gib_misc_1 (0 0.5 0.8) (-8 -8 -8) (8 8 8) SOLID 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
{
model ("progs/gib1.mdl");
@@ -334,7 +406,9 @@ model ("progs/gib1.mdl");
gib_misc_1_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED gib_misc_2 (0 0.5 0.8) (-8 -8 -8) (8 8 8) SOLID 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
{
model ("progs/gib2.mdl");
@@ -401,7 +475,9 @@ model ("progs/gib2.mdl");
gib_misc_2_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED gib_misc_3 (0 0.5 0.8) (-8 -8 -8) (8 8 8) SOLID 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
{
model ("progs/gib3.mdl");
@@ -468,27 +544,29 @@ model ("progs/gib3.mdl");
gib_misc_3_init (self);
};
// };
+#endif

+#ifdef SSQC
//----------------------------------------------------------------------
// class base_gib_head: base_gib
// {
//--------------------------------------------------------------
// ThrowHead
//--------------------------------------------------------------
- void(entity act, vector dir, float dmg, void(entity e) initfn)
+ void(entity e, vector dir, float dmg, void(entity e) initfn)
base_gib_head_throw =
{
- act.skin = act.skin_head;
- act.nextthink = -1;
- act.spawnflags = GIB_DYNAMIC;
- act.view_ofs = '0 0 8';
+ e.skin = e.skin_head;
+ e.nextthink = -1;
+ e.spawnflags = GIB_DYNAMIC;
+ e.view_ofs = '0 0 8';

- act.origin_z = act.origin_z - 24;
- act.avelocity = crandom() * '0 600 0';
- act.velocity = velocity_for_damage (dir, dmg);
+ e.origin_z = e.origin_z - 24;
+ e.avelocity = crandom() * '0 600 0';
+ e.velocity = velocity_for_damage (dir, dmg);

if (initfn)
- initfn (act);
+ initfn (e);
};

//--------------------------------------------------------------
@@ -503,3 +581,4 @@ model ("progs/gib3.mdl");
base_gib_head_init (self);
};
// };
+#endif

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

Diff qc/base_item.qc

diff --git a/qc/base_item.qc b/qc/base_item.qc
index ff2e106..6c8863d 100644
--- a/qc/base_item.qc
+++ b/qc/base_item.qc
@@ -6,17 +6,19 @@
// constants
//======================================================================

+#ifdef SSQC
const float ITEM_SPAWNSILENT = 32; // item spawnflags
const float ITEM_SPAWNED = 64;
const float ITEM_SUSPENDED = 128;
const float ITEM_RESPAWNDM = 16384;
const float ITEM_DONTDROP = 8388608;

-const float ITEM_ALPHA_WAITSPAWN = 0.1; // alpha values (respawn feedback)
-const float ITEM_ALPHA_NEARSPAWN = 0.25;
+const float ITEM_ALPHA_WAITSPAWN = 0.00001; // alpha values (respawn feedback)
+const float ITEM_ALPHA_NEARSPAWN = 0.2;
const float ITEM_ALPHA_OPAQUE = 1.0;

-const string ITEM_SOUND_SPAWN = "items/item_respawn_q3.wav";
+const string ITEM_SOUND_SPAWN = "items/respawn.ogg";
+#endif

//======================================================================
// fields
@@ -31,16 +33,19 @@ const string ITEM_SOUND_SPAWN = "items/item_respawn_q3.wav";
// respawn, all we need to do is give a nextthink time in order
// to trigger it

+#ifdef SSQC
.float ritem; // legacy SP item respawn flag
.float respawndelay; // legacy SP respawn delay
.float respawncount; // legacy SP respawn limit

.vector particles_offset;
+#endif

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

+#ifdef SSQC
void(entity actor) base_item_drop_stuff;
float(entity item, float delay_sp, float delay_dm) base_item_check_respawn;
void() base_item_think_respawn;
@@ -50,12 +55,14 @@ void() base_item_think_place;
void() base_item_use_delayspawn;
void(entity e) base_item_init;
strip void() base_item;
+#endif

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

//----------------------------------------------------------------------
// class base_item: base_mapentity
// {
+#ifdef SSQC
//==============================================================
// Static Helper Functions
//==============================================================
@@ -231,10 +238,11 @@ strip void() base_item;
self.solid = SOLID_TRIGGER;

// new respawning effects -- CEV
- sound (self, CHAN_VOICE, ITEM_SOUND_SPAWN, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, ITEM_SOUND_SPAWN, VOL_HIGH, ATTN_NORM);

setorigin (self, self.origin);
- setsize (self, self.pos1, self.pos2);
+ if (self.pos1 && self.pos2)
+ setsize (self, self.pos1, self.pos2);
};

//--------------------------------------------------------------
@@ -368,7 +376,7 @@ strip void() base_item;
if (!(self.spawnflags & ITEM_SPAWNSILENT))
// SILENT, gb
// sound (self, CHAN_VOICE, "items/itembk2.wav",
- // 1, ATTN_NORM);
+ // VOL_HIGH, ATTN_NORM);
spawn_tfog (self.origin + self.particles_offset);

if (self.spawnflags & ITEM_SUSPENDED)
@@ -403,4 +411,5 @@ strip void() base_item;
{
base_item_init (self);
};
+#endif
// };

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

Diff qc/base_monster.qc

diff --git a/qc/base_monster.qc b/qc/base_monster.qc
index 594a2a6..46a7bd1 100644
--- a/qc/base_monster.qc
+++ b/qc/base_monster.qc
@@ -6,6 +6,7 @@
// constants
//======================================================================

+#ifdef SSQC
const float NO_SIGHT_SOUND = 32; // spawnflags
const float PASSIVE_UNTIL_ATTACKED = 64;
const float PASSIVE_ALWAYS = 128;
@@ -21,11 +22,13 @@ const float RANGE_MELEE = 0; // range values; see ai_range ()
const float RANGE_NEAR = 1;
const float RANGE_MID = 2;
const float RANGE_FAR = 3;
+#endif

//======================================================================
// globals
//======================================================================

+#ifdef SSQC
float enemy_vis; // was in fight.qc
float enemy_infront; // was in fight.qc
float enemy_range; // was in fight.qc
@@ -34,11 +37,16 @@ float movedist; // base_monster
float sight_entity_time; // was in ai.qc

entity sight_entity; // was in ai.qc
+#endif

//======================================================================
// fields
//======================================================================

+#if defined(CSQC) || defined(SSQC)
+.float air_finished; // when time > air_finished, drown
+#endif
+#ifdef SSQC
.float attack_elevation; // Preach's Z-aware nades -- CEV
.float attack_state;
.float berserk; // dumptruck_ds
@@ -50,31 +58,43 @@ entity sight_entity; // was in ai.qc
.float search_time;
.float sight_trigger; // dumptruck_ds
.float spawn_angry; // dumptruck_ds
+.float swim_time; // monster swimming sound flag
.float touch_time;
+#endif

+#ifdef SSQC
.entity infight_activator;
.entity movetarget;
+#endif

+#ifdef SSQC
.string tele_model; // Preach's new fields -- dumptruck_ds
.vector tele_mins; // TODO CEV
.vector tele_maxs;
.float tele_solid;
.float tele_movetype;
-
-.void() think_stand; // the typical th_ monster functions
-.void() think_walk;
-.void() think_run;
-.void() think_missile;
-.void() think_melee;
-.void() think_turret;
-
+#endif
+
+#ifdef SSQC
+.void() th_stand; // the typical th_ monster functions
+.void() th_walk;
+.void() th_run;
+.void() th_missile;
+.void() th_melee;
+.void() th_turret;
+#endif
+
+#ifdef SSQC
.float() checkattack; // per-monster CheckAttack -- CEV
+.void(float old, float new) contentstransition; // liquid -> air and reverse
.void() sightsound; // per-monster SightSound -- CEV
+#endif

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

+#ifdef SSQC
void(float n) monster_update_total;

// base_monster // generic projectile firing
@@ -93,7 +113,9 @@ void(vector org, vector dir, float damage, float projspeed)
void(vector org, vector dir) base_monster_fire_voreball;
void() base_monster_fire_wizardspell;
void(vector offset, float elevation) base_monster_fire_zombiechunk;
-float() ai_checkattack; // monster AI
+void() base_monster_liquiddamage; // monster AI
+void(float old, float new) base_monster_contentstransition;
+float() ai_checkattack;
float(entity targ) ai_infront;
float(entity targ) ai_range;
float(entity targ) ai_visible;
@@ -127,6 +149,8 @@ void() base_monster_think_teleport_go; // monster interaction
void() base_monster_touch;
void() base_monster_use_teledelay;
void() base_monster_use_angry;
+entity(vector org, vector ang, float sflags, float yaw, float angry,
+ void(entity e) initfn) spawn_base_monster;
void() base_monster_init_teleport_check;// monster initialization
float(entity e, void() start_fn) base_monster_init_teleport;
void(entity e) base_monster_init;
@@ -146,9 +170,11 @@ strip void() base_swimmonster;
void() base_walkmonster_think_start;
void(entity e) base_walkmonster_init;
strip void() base_walkmonster;
+#endif

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

+#ifdef SSQC
//======================================================================
// .enemy
// Will be world if not currently angry at anyone.
@@ -190,7 +216,9 @@ void(float n) monster_update_total =
WriteByte (MSG_ALL, STAT_TOTALMONSTERS);
WriteLong (MSG_ALL, total_monsters);
};
+#endif

+#ifdef SSQC
//----------------------------------------------------------------------
// class base_monster: base_mapentity
// {
@@ -207,7 +235,8 @@ void(float n) monster_update_total =
local vector dir, ang;

self.effects = self.effects | EF_MUZZLEFLASH;
- sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM);
+ sound (self, CHAN_WEAPON, "weapons/spike2.wav",
+ VOL_HIGH, ATTN_NORM);

// make angles out of the current displacement vector...
ang = vectoangles (self.enemy.origin - self.origin);
@@ -241,7 +270,8 @@ void(float n) monster_update_total =
local vector missile_velocity = '0 0 0';

self.effects = self.effects | EF_MUZZLEFLASH;
- sound (self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM);
+ sound (self, CHAN_WEAPON, "weapons/grenade.wav",
+ VOL_HIGH, ATTN_NORM);

// set missile speed
if (elevation)
@@ -276,7 +306,7 @@ void(float n) monster_update_total =

spawn_projectile_hknightspell (self, org, dir, off);
sound_attack (self, CHAN_WEAPON, "hknight/attack1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
@@ -286,7 +316,7 @@ void(float n) monster_update_total =
{
self.effects = self.effects | EF_MUZZLEFLASH;
sound_attack (self, CHAN_WEAPON, "enforcer/enfire.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

dir = normalize (dir);
// SetSpeed (newmis, vec, projspeed);
@@ -315,9 +345,8 @@ void(float n) monster_update_total =
{
local vector missile_velocity;

- sound (self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM);
-
- // self.punchangle_x = -2;
+ sound (self, CHAN_WEAPON, "weapons/grenade.wav",
+ VOL_HIGH, ATTN_NORM);

// set missile speed
missile_velocity = normalize (self.enemy.origin - self.origin);
@@ -334,7 +363,7 @@ void(float n) monster_update_total =
{
self.effects = self.effects | EF_MUZZLEFLASH;
sound_attack (self, CHAN_WEAPON, "weapons/sgun1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

dir = normalize (dir);
// SetSpeed
@@ -386,7 +415,7 @@ void(float n) monster_update_total =

self.effects = self.effects | EF_MUZZLEFLASH;
sound_misc (self, CHAN_WEAPON, "shalrath/attack2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

dir = normalize (dir);
// SetSpeed
@@ -432,7 +461,7 @@ void(float n) monster_update_total =
local vector vel = '0 0 0';

sound_attack (self, CHAN_WEAPON, "zombie/z_shot1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

// set missile speed
if (elevation)
@@ -464,6 +493,78 @@ void(float n) monster_update_total =
//==============================================================

//--------------------------------------------------------------
+ // Damage the monster according to the liquid type it's in
+ // based on AD code & id1 player/client watermove -- CEV
+ //--------------------------------------------------------------
+ void() base_monster_liquiddamage =
+ {
+ if (self.conlevel == WATERLEVEL_NONE)
+ return;
+
+ if (self.contype == CONTENT_WATER &&
+ self.air_finished < time)
+ {
+ if (self.classtype == CT_MONSTER_ZOMBIE)
+ // zombies can't drown
+ return;
+
+ // monsters can drown
+ if (self.pain_finished < time)
+ {
+ self.deathtype = "drowning";
+ t_damage2 (self, world, world, 10);
+ self.deathtype = "";
+ self.pain_finished = time + 1;
+ }
+ }
+ else if (self.contype == CONTENT_LAVA)
+ {
+ // monsters damaged by lava
+ if (self.damage_time < time)
+ {
+ self.damage_time = time + 0.2;
+
+ self.deathtype = "lava";
+ if (self.classtype == CT_MONSTER_ZOMBIE)
+ // lava kills zombies -- CEV
+ t_damage2 (self, world, world, 150);
+ else
+ // fixed damage multiplier for monsters
+ t_damage2 (self, world, world, 10 * 5);
+ self.deathtype = "";
+ }
+ }
+ else if (self.contype == CONTENT_SLIME)
+ {
+ if (self.classtype == CT_MONSTER_ZOMBIE)
+ // zombies aren't damaged by slime
+ return;
+
+ // monsters damaged by slime
+ if (self.damage_time < time)
+ {
+ self.damage_time = time + 1;
+
+ self.deathtype = "slime";
+ // fixed damage multiplier for monsters
+ t_damage2 (self, world, world, 4 * 5);
+ self.deathtype = "";
+ }
+ }
+ };
+
+ //--------------------------------------------------------------
+ // a no-op to prevent the engine from playing h2ohit1.wav when
+ // an entity enters water -- CEV
+ //--------------------------------------------------------------
+ void(float old, float new) base_monster_contentstransition =
+ {
+ dprint (sprintf("base_monster_contentstransition: "
+ "entering; self %s, old %g, new %g\n",
+ self.classname, old, new));
+ };
+
+ //--------------------------------------------------------------
// ai_checkattack - MonsterCheckAttack & CheckAttack
// override in monster code if other behavior is desired
//
@@ -515,17 +616,17 @@ void(float n) monster_update_total =
return FALSE;
}
// self.attack_state = AS_MISSILE;
- self.think_turret ();
+ self.th_turret ();
}
else if (self.classtype == CT_MONSTER_VORE)
{
- self.think_turret ();
+ self.th_turret ();
}
else if (self.classtype == CT_MONSTER_ZOMBIE)
{
// dprint ("CheckAttack...\n");
// zombie_turret_missile ();
- self.think_turret ();
+ self.th_turret ();
}
sub_attackfinished (2 * random());
return TRUE;
@@ -557,19 +658,19 @@ void(float n) monster_update_total =
if (enemy_range == RANGE_MELEE)
{
// melee attack
- if (self.think_melee)
+ if (self.th_melee)
{
// TODO CEV
if (self.classtype == CT_MONSTER_KNIGHT)
monster_knight_attack ();
else
- self.think_melee ();
+ self.th_melee ();
return TRUE;
}
}

// missile attack
- if (!self.think_missile)
+ if (!self.th_missile)
return FALSE;

if (time < self.attack_finished)
@@ -585,14 +686,14 @@ void(float n) monster_update_total =
}
else if (enemy_range == RANGE_NEAR)
{
- if (self.think_melee)
+ if (self.th_melee)
chance = 0.2;
else
chance = 0.4;
}
else if (enemy_range == RANGE_MID)
{
- if (self.think_melee)
+ if (self.th_melee)
chance = 0.05;
else
chance = 0.1;
@@ -604,7 +705,7 @@ void(float n) monster_update_total =

if (random() < chance)
{
- self.think_missile ();
+ self.th_missile ();
sub_attackfinished (2 * random());
return TRUE;
}
@@ -682,7 +783,7 @@ void(float n) monster_update_total =
{
self.goalentity = self.enemy;
self.ideal_yaw = vectoyaw (self.enemy.origin - self.origin);
- self.think = self.think_run;
+ self.think = self.th_run;
self.nextthink = time + 0.1;
// wait a while before first attack
sub_attackfinished (1);
@@ -738,6 +839,10 @@ void(float n) monster_update_total =
//--------------------------------------------------------------
float() ai_findtarget =
{
+ // don't attempt to find a target during intermission -- CEV
+ if (intermission)
+ return FALSE;
+
local entity client;
local float r;

@@ -895,6 +1000,19 @@ void(float n) monster_update_total =
//--------------------------------------------------------------
void(float dist) ai_walk =
{
+ if (self.health < 1)
+ return;
+
+ // find waterlevel and watertype for walking monsters -- CEV
+ if (!(self.classgroup & CG_MONSTER_SWIM) &&
+ !(self.classgroup & CG_MONSTER_FLY))
+ {
+ base_entity_positioncontents (self);
+ base_monster_liquiddamage ();
+ if (self.health < 1)
+ return;
+ }
+
movedist = dist;

if (self.classname == "monster_dragon")
@@ -916,12 +1034,25 @@ void(float n) monster_update_total =
//--------------------------------------------------------------
void() ai_stand =
{
+ if (self.health < 1)
+ return;
+
+ // find waterlevel and watertype for walking monsters -- CEV
+ if (!(self.classgroup & CG_MONSTER_SWIM) &&
+ !(self.classgroup & CG_MONSTER_FLY))
+ {
+ base_entity_positioncontents (self);
+ base_monster_liquiddamage ();
+ if (self.health < 1)
+ return;
+ }
+
if (ai_findtarget())
return;

if (time > self.pausetime)
{
- self.think_walk ();
+ self.th_walk ();
return;
}
// change angle slightly -- TODO CEV this comment was
@@ -950,7 +1081,7 @@ void(float n) monster_update_total =

if (ai_facing_ideal())
{
- self.think_melee ();
+ self.th_melee ();
self.attack_state = AS_STRAIGHT;
}
};
@@ -968,12 +1099,12 @@ void(float n) monster_update_total =
{
if (self.spawnflags & I_AM_TURRET)
{
- self.think_turret ();
+ self.th_turret ();
// dprint ("th_turret...\n");
}
else
{
- self.think_missile ();
+ self.th_missile ();
// dprint ("th_missile\n");
}
self.attack_state = AS_STRAIGHT;
@@ -1009,9 +1140,25 @@ void(float n) monster_update_total =
void(float dist) ai_run =
{
// dprint ("ai_run\n");
+ if (self.health < 1)
+ return;
+
+ // find waterlevel and watertype for walking monsters -- CEV
+ if (!(self.classgroup & CG_MONSTER_SWIM) &&
+ !(self.classgroup & CG_MONSTER_FLY))
+ {
+ base_entity_positioncontents (self);
+ base_monster_liquiddamage ();
+ if (self.health < 1)
+ return;
+ }
+
movedist = dist;
- // see if the enemy is dead
+
+ // see if the enemy is a corpse, dead, or if we're passive
if ((self.enemy.health <= 0) ||
+ (self.enemy.solid == SOLID_NOT) ||
+ (self.enemy.solid == SOLID_CORPSE) ||
(self.spawnflags & PASSIVE_ALWAYS))
{
self.enemy = world;
@@ -1024,11 +1171,11 @@ void(float n) monster_update_total =
else
{
if (self.spawnflags & I_AM_TURRET)
- self.think_stand ();
+ self.th_stand ();
else if (self.movetarget)
- self.think_walk ();
+ self.th_walk ();
else
- self.think_stand ();
+ self.th_stand ();
return;
}
}
@@ -1400,11 +1547,15 @@ void(float n) monster_update_total =
if ((!(other.flags & FL_ONGROUND)) &&
((other.absmin_z >= self.absmax_z - 2)))
{
- other.flags = other.flags + FL_ONGROUND;
+ other.flags |= FL_ONGROUND;
+ return;
}

// you can add other stuff like pushable players/monsters here

+ // will do Kryten, thanks for the tip -- CEV
+ base_entity_push (self, other, PM_MAXSPEED);
+
// 1998-09-16 Sliding/not-jumping on monsters/boxes/players
// fix by Maddes/Kryten end
};
@@ -1458,6 +1609,22 @@ void(float n) monster_update_total =
//==============================================================

//--------------------------------------------------------------
+ entity(vector org, vector ang, float sflags, float yaw, float angry,
+ void(entity e) initfn) spawn_base_monster =
+ {
+ local entity e = spawn ();
+ e.spawnflags = sflags;
+ e.origin = org;
+ e.angles = ang;
+ e.yaw_speed = yaw;
+ e.spawn_angry = angry;
+ setorigin (e, e.origin);
+ if (initfn)
+ initfn (e);
+ return e;
+ };
+
+ //--------------------------------------------------------------
// monster_teleport_check
//
// This detects and eliminates a common map bug: a trigger-spawned
@@ -1528,7 +1695,9 @@ void(float n) monster_update_total =
base_monster_init (self);
};
// };
+#endif

+#ifdef SSQC
//----------------------------------------------------------------------
// class base_flymonster: base_monster
// {
@@ -1569,18 +1738,18 @@ void(float n) monster_update_total =

if (self.movetarget.classtype == CT_PATH_CORNER)
{
- self.think_walk ();
+ self.th_walk ();
}
else
{
self.pausetime = 99999999;
- self.think_stand ();
+ self.th_stand ();
}
}
else
{
self.pausetime = 99999999;
- self.think_stand ();
+ self.th_stand ();
}

// 1998-08-14 Monsters sometimes don't move fix by Lord Sméagol
@@ -1647,7 +1816,9 @@ void(float n) monster_update_total =
base_flymonster_init (self);
};
// };
+#endif

+#ifdef SSQC
//----------------------------------------------------------------------
// class base_swimmonster: base_monster
// {
@@ -1690,12 +1861,12 @@ void(float n) monster_update_total =

self.ideal_yaw = vectoyaw (
self.goalentity.origin - self.origin);
- self.think_walk ();
+ self.th_walk ();
}
else
{
self.pausetime = 99999999;
- self.think_stand ();
+ self.th_stand ();
}

// spread think times so they don't all happen at same time
@@ -1767,7 +1938,9 @@ void(float n) monster_update_total =
base_swimmonster_init (self);
};
// };
+#endif

+#ifdef SSQC
//----------------------------------------------------------------------
// class base_walkmonster: base_monster
// {
@@ -1822,18 +1995,18 @@ void(float n) monster_update_total =

if (self.movetarget.classtype == CT_PATH_CORNER)
{
- self.think_walk ();
+ self.th_walk ();
}
else
{
self.pausetime = 99999999;
- self.think_stand ();
+ self.th_stand ();
}
}
else
{
self.pausetime = 99999999;
- self.think_stand ();
+ self.th_stand ();
}

// spread think times so they don't all happen at once
@@ -1888,6 +2061,7 @@ void(float n) monster_update_total =
// spread think times so they don't all happen at same time

total_monsters = total_monsters + 1;
+ e.contentstransition = base_monster_contentstransition;
e.think = base_walkmonster_think_start;
// 1998-08-14 Monsters sometimes do not move fix
// by Lord Sméagol start
@@ -1903,3 +2077,4 @@ void(float n) monster_update_total =
base_walkmonster_init (self);
};
// };
+#endif

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

Diff qc/base_proj.qc

diff --git a/qc/base_proj.qc b/qc/base_proj.qc
index 2d15315..d8474ab 100644
--- a/qc/base_proj.qc
+++ b/qc/base_proj.qc
@@ -29,6 +29,7 @@ see the files in projectiles/ for examples -- CEV
// Constants
//======================================================================

+#ifdef SSQC
enum
{
EXPLOSION_THINK_1, // explosion frame/think tracking
@@ -48,11 +49,13 @@ enumflags

const float BP_BOUNCE_BACKOFF = 1.5; // MOVETYPE_BOUNCE clipvel mult; id1 1.5
const float BP_BOUNCE_MIN_ZVEL = 60; // MOVETYPE_BOUNCE stop if _z less than
+#endif

//======================================================================
// fields
//======================================================================

+#ifdef SSQC
.float direct_damage; // for t_damage
.float splash_damage; // for t_radiusdamage

@@ -64,11 +67,13 @@ const float BP_BOUNCE_MIN_ZVEL = 60; // MOVETYPE_BOUNCE stop if _z less than
.float proj_speed_mod; // projectile speed modifier
.float proj_basespeed; // projectile base speed
.vector cust_avelocity; // projectile custom avelocity
+#endif

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

+#ifdef SSQC
// base_explosion
void(vector org) write_explosion;
void(vector org) write_explosion2;
@@ -77,7 +82,9 @@ void(entity e) become_base_explosion;
entity(vector org) spawn_base_explosion;
void(entity e) base_explosion_init;
strip void() base_explosion;
+#endif

+#ifdef SSQC
// base_projectile
float(float testexpl, float offset) base_projectile_parse_projexpl;
void(entity p) write_projectile_impact;
@@ -89,14 +96,18 @@ float() base_projectile_check_touch;
void() base_projectile_touch;
void(entity e) base_projectile_init;
strip void() base_projectile;
+#endif

+#ifdef SSQC
// base_projectile_qcphys
void() base_projectile_qcphys_physics;
void(entity e) base_projectile_qcphys_init;
strip void() base_projectile_qcphys;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// standard id1 explosion sprite + a few helper functions -- CEV
//----------------------------------------------------------------------
@@ -155,7 +166,7 @@ strip void() base_projectile_qcphys;
{
e.customphysics = __NULL__;
e.destroy = __NULL__;
- e.pain = __NULL__;
+ e.th_pain = __NULL__;
e.takedamage = DAMAGE_NO;
base_explosion_init (e);
};
@@ -199,7 +210,9 @@ strip void() base_projectile_qcphys;
base_explosion_init (self);
};
// };
+#endif

+#ifdef SSQC
//----------------------------------------------------------------------
// class base_projectile: base_tempentity
// {
@@ -221,7 +234,8 @@ strip void() base_projectile_qcphys;
if (p.snd_hit != __NULL__ && p.snd_hit != "")
{
// dumptruck_ds
- sound (p, CHAN_WEAPON, p.snd_hit, 1, ATTN_STATIC);
+ sound (p, CHAN_WEAPON, p.snd_hit,
+ VOL_HIGH, ATTN_STATIC);
WriteByte (MSG_BROADCAST, TE_GUNSHOT);
}
else if (p.classtype == CT_PROJECTILE_BULLET)
@@ -376,7 +390,7 @@ strip void() base_projectile_qcphys;
t_radiusdamage2 (self, self.owner, self.splash_damage, other);

// sound (self, CHAN_WEAPON, "weapons/r_exp3.wav",
- // 1, ATTN_NORM);
+ // VOL_HIGH, ATTN_NORM);
self.origin = self.origin - 8 * normalize (self.velocity);

// BecomeExplosion
@@ -420,8 +434,12 @@ strip void() base_projectile_qcphys;
return TRUE;
}

+ // corpses are SOLID_TRIGGER & we want to touch them -- CEV
+ if (other.classgroup & CG_CORPSE)
+ return FALSE;
+
+ // don't touch trigger fields
if (other.solid == SOLID_TRIGGER)
- // trigger field, do nothing
return TRUE;

return FALSE;
@@ -463,7 +481,9 @@ strip void() base_projectile_qcphys;
base_projectile_init (self);
};
// };
+#endif

+#ifdef SSQC
//----------------------------------------------------------------------
// Custom Physics for projectiles. Subclass this if you want a projectile
// to have one size for other objects to collide with but another size
@@ -635,3 +655,4 @@ strip void() base_projectile_qcphys;
base_projectile_qcphys_init (self);
};
// };
+#endif

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

Diff qc/base_trigger.qc

diff --git a/qc/base_trigger.qc b/qc/base_trigger.qc
index bbb35a0..999f265 100644
--- a/qc/base_trigger.qc
+++ b/qc/base_trigger.qc
@@ -3,15 +3,34 @@
//==============================================================================

//======================================================================
+// constants
+//======================================================================
+
+#if defined(CSQC) || defined(SSQC)
+const float BASE_TRIGGER_NET_ORIGIN = 1<<0; // origin has changed
+const float BASE_TRIGGER_NET_SIZE = 1<<1; // size (mins, maxs) has changed
+const float BASE_TRIGGER_NET_STATE = 1<<2; // state has changed
+const float BASE_TRIGGER_NET_ESTATE = 1<<3; // estate has changed
+const float BASE_TRIGGER_NET_MOVEDIR = 1<<4; // movedir has changed
+const float BASE_TRIGGER_NET_SPEED = 1<<5; // speed has changed
+#endif
+
+//======================================================================
// forward declarations
//======================================================================

// base_trigger
+#ifdef SSQC
void(entity e) sub_checkwaiting;
void() sub_endwaiting;
+#endif
+#if defined(CSQC) || defined(SSQC)
void(entity e) base_trigger_point_init;
void(entity e) base_trigger_init;
+#endif
+#ifdef SSQC
strip void() base_trigger;
+#endif

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

@@ -22,6 +41,7 @@ strip void() base_trigger;
// Subs
//==============================================================

+#ifdef SSQC
//--------------------------------------------------------------
void(entity e) sub_checkwaiting =
{
@@ -33,9 +53,12 @@ strip void() base_trigger;
e.use = sub_endwaiting;
e.estate = STATE_INACTIVE;

- dprint (sprintf("sub_checkwaiting: spawned a waiting %s "
- "with targetname %s and target %s\n",
+ dprint (sprintf("sub_checkwaiting: spawned a waiting "
+ "%s with targetname %s and target %s\n",
e.classname, e.targetname, e.target));
+
+ if (e.SendEntity)
+ e.SendFlags |= BASE_TRIGGER_NET_ESTATE;
};

//--------------------------------------------------------------
@@ -51,12 +74,17 @@ strip void() base_trigger;
// fact that it has a targetname when touched
if (self.classtype == CT_TRIGGER_TELEPORT)
self.is_waiting = -1;
+
+ if (self.SendEntity)
+ self.SendFlags |= BASE_TRIGGER_NET_ESTATE;
};
+#endif

//==============================================================
// Constructor & Spawn Functions
//==============================================================

+#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
// InitPointTrigger -- Drake -- dumptruck_ds
// PM: The point trigger version of InitTrigger.
@@ -86,23 +114,31 @@ strip void() base_trigger;

e.classgroup |= CG_TRIGGER;

+ #ifdef SSQC
// trigger angles are used for one-way touches.
// An angle of 0 is assumed to mean no restrictions, so use a
// yaw of 360 instead.
if (e.angles != '0 0 0')
sub_setmovedir (e);
+ #endif

e.solid = SOLID_TRIGGER;
+
+ #ifdef SSQC
// set size and link into world
setmodel (e, e.model);
e.movetype = MOVETYPE_NONE;
e.modelindex = 0;
e.model = "";
+ #endif
};
+#endif

+#ifdef SSQC
//--------------------------------------------------------------
strip void() base_trigger =
{
base_trigger_init (self);
};
// };
+#endif

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

Diff qc/cl_entry.qc

diff --git a/qc/cl_entry.qc b/qc/cl_entry.qc
index 361f7af..fd0e5a3 100644
--- a/qc/cl_entry.qc
+++ b/qc/cl_entry.qc
@@ -22,7 +22,6 @@ float numclientseats; // coop or splitscreen?
float maxclients; // max players possible on this server
float cltime; // inc. regardless of pause or gamespeed

-// float player_localnum; // Player slot that is assigned to us
float player_localentnum; // Ent number that csqc is attached to

float sb_showscores; // Show lower tab scores
@@ -35,26 +34,20 @@ float clientcommandframe;
// Input frames greater than this should be applied to the player's entity.
float servercommandframe;

-string CSQC_PING = "csqcping"; // Test command to check if CSCQ alive
+// Reports which ssqc entnum was hit when a csqc traceline impacts an
+// ssqc-based brush entity.
+// float trace_networkentity;

+entity view_pl; // handle to the local player entity
entity viewentity; // camera -- CEV
vector view_origin; // origin for viewentity -- CEV
vector view_angles; // +x=DOWN
+float view_step;
+float view_step_adjust;
+float view_step_oldz;
+float view_step_time;

-entity player_local; // handle to the local player entity
-
-vector player_org; // prediction -- from CSQCTest -- CEV
-vector player_vel;
-float player_flags;
-float player_doublejump_timer;
-float player_pmove_flags;
-float player_sequence;
-float player_step;
-float player_steptime;
-float player_step_oldz;
-vector pmove_error;
-float pmove_errortime;
-float pmove_frame;
+__used var float physics_mode = 2; // 0 = not run, 1 = DP, 2 = movetypes
#endif

//======================================================================
@@ -64,7 +57,6 @@ float pmove_frame;
#ifdef CSQC
.float drawmask; // a filter in the addentities call
.float entnum; // The entnum as its known on the server
-.float ext_csqc; // Client Server Quake C HUD alive!
.float renderflags;

// The current frame the entity is meant to be displayed in. In CSQC,
@@ -85,7 +77,9 @@ float pmove_frame;
// the PREDRAW_* constants.
.float() predraw;

-.void() removefunc;
+.void(entity e) preframe; // called before setting up view
+.void(entity e) postframe; // called after renderscene
+.void() removefunc; // called when ent removed on the server
#endif

//======================================================================
@@ -95,15 +89,15 @@ float pmove_frame;
#ifdef CSQC
float(string cmd) CSQC_ConsoleCommand;
// float(float evtype, float scanx, float chary, float devid) CSQC_InputEvent;
-// float(float save, float take, vector dir) CSQC_Parse_Damage;
-void(string printmsg, float printlvl) CSQC_Parse_Print;
-void(string str) SV_ParseClientCommand;
+float(float save, float take, vector dir) CSQC_Parse_Damage;
+void() CSQC_Parse_Event;
+// void(string printmsg, float printlvl) CSQC_Parse_Print;
void(entity ent) CSQC_DrawViewModel;
void(float vwidth, float vheight, float notmenu) CSQC_UpdateView;
-// float() CSQC_Parse_TempEntity;
+float() CSQC_Parse_TempEntity;
void(float isnew) CSQC_Ent_Update;
+void() CSQC_Ent_Remove;
void(float apilevel, string enginename, float engineversion) CSQC_Init;
-__wrap void(float apilevel, string enginename, float engineversion) CSQC_Init;
__wrap float(string str) CSQC_ConsoleCommand;
#endif

@@ -150,54 +144,60 @@ float(float evtype, float scanx, float chary, float devid) CSQC_InputEvent =

// This is linked to client dmg_take / dmg_save / dmg_inflictor fields
// returning TRUE will block the red flash damage stuff
-/*
float(float save, float take, vector dir) CSQC_Parse_Damage =
{
+ dprint (sprintf("CSQC_Parse_Damage: save %g, take %g, dir %v\n",
+ save, take, dir));
painfinishtime = time + 0.2;
return FALSE;
};
-*/

+//----------------------------------------------------------------------
// Can query/check server MSG events
// CSQC_Parse_Event is called when the client sees a
// #define svcfte_cgamepacket (83) message from the server
// Not supported for DP, is called from only QSS/FTE
-// void() CSQC_Parse_Event = { };
+//----------------------------------------------------------------------
+void() CSQC_Parse_Event =
+{
+ local float event = ReadByte ();
+ switch (event)
+ {
+ case EVENT_INTERMISSION:
+ intermission = ReadFloat ();
+ return;
+ case EVENT_CSHIFT_FADE:
+ csf_fade_netreceive (view_pl);
+ return;
+ case EVENT_CSHIFT_SET:
+ csf_set_netreceive (view_pl);
+ return;
+ default:
+ dprint ("CSQC_Parse_Event: received unknown event "
+ "type!\n");
+ return;
+ }
+};

+//----------------------------------------------------------------------
// Can intercept printed messages from the server (top of screen)
// printlvl (text filtering) 0=low, 1=medium, 2=high, 3=chat
// con_notifytime = amount of time the text remains on screen
// ONLY define this function, if doing something with the text!!
+//----------------------------------------------------------------------
+/*
void(string printmsg, float printlvl) CSQC_Parse_Print =
{
print (printmsg);
};
-
-// Running on the Server side of CSQC listening for commands back
-// This is never called on the client side of the progs
-void(string str) SV_ParseClientCommand =
-{
- local string ostr, cmd;
- // Save command string for later
- ostr = str;
- // Search for tokens in string
- tokenize_console (str);
- // Find the first argument of the command
- cmd = argv (0);
- // Is this my (AD CSQC) command?
- if (cmd == CSQC_PING)
- self.ext_csqc = TRUE;
- else
- // Pass through original command
- clientcommand (self, ostr);
-};
+*/

//----------------------------------------------------------------------
// TODO CEV
//----------------------------------------------------------------------
void(entity ent) CSQC_DrawViewModel =
{
- float newframe, newmodel;
+ local float newframe, newmodel;

newframe = getstatf (STAT_WEAPONFRAME);
newmodel = getstatf (STAT_WEAPONMODELI);
@@ -218,9 +218,10 @@ void(entity ent) CSQC_DrawViewModel =

ent.lerpfrac = 1 - (time - ent.lerptime) * 10;

- ent.origin = '0 0 0';
+ // apply user's configured viewmodel offset -- CEV
+ ent.origin = [0 + autocvar(cl_gunx, 0), 0 + autocvar(cl_guny, 0),
+ 0 + autocvar(cl_gunz, 0)];
ent.angles = '0 0 0';
- ent.effects = player_local.effects;

addentity (ent);
};
@@ -228,66 +229,118 @@ void(entity ent) CSQC_DrawViewModel =
//----------------------------------------------------------------------
void(float vwidth, float vheight, float notmenu) CSQC_UpdateView =
{
- local vector ssize;
-
- ssize_x = vwidth;
- ssize_y = vheight;
- ssize_z = 0;
+ local vector ssize = [vwidth, vheight, 0];

// Is the CSQC functionality enabled/disabled?
nocsqc = cvar ("cl_nocsqc");

clearscene ();

- // TODO CEV
- // addentities (MASK_ENGINE|MASK_VIEWMODEL);
- // addentities (MASK_NORMAL | MASK_ENGINE);
- setproperty (VF_DRAWWORLD, (float)1);
setproperty (VF_MIN, '0 0');
setproperty (VF_SIZE, ssize);

// If hud is disabled, draw engine hud instead
setproperty (VF_DRAWENGINESBAR, nocsqc);
- setproperty (VF_DRAWCROSSHAIR, TRUE);

- // TODO CEV
- if (self.entnum == player_localentnum)
+ if (view_pl)
{
+ // call the preframe function for every entity with one.
+ // used for movement prediction & smoothing -- CEV
+ player_prediction_preframe (view_pl);
+
// read our smoothed & predicted view origin
- setproperty (VF_VIEWENTITY, viewentity.entnum);
- setproperty (VF_ORIGIN, viewentity.origin);
- setproperty (VF_ANGLES, viewentity.angles);
- setproperty (VF_CL_VIEWANGLES, view_angles);
+ setproperty (VF_ORIGIN, view_origin);

- makevectors (viewentity.angles);
- SetListener (view_origin, v_forward, v_right, v_up);
+ makevectors (view_angles);

if (intermission)
{
- // don't draw crosshair in intermission
+ // camera wobble
+ view_angles_x += autocvar(v_ipitch_level, 0.3) *
+ sin(time * autocvar(v_ipitch_cycle, 1));
+ view_angles_y += autocvar(v_iyaw_level, 0.3) *
+ sin(time * autocvar(v_iyaw_cycle, 2));
+ view_angles_z += autocvar(v_iroll_level, 0.1) *
+ sin(time * autocvar(v_iroll_cycle, 0.5));
+
setproperty (VF_DRAWCROSSHAIR, FALSE);
+ setproperty (VF_ANGLES, view_angles);
+ SetListener (view_origin, v_forward, v_right, v_up);
}
else
{
- // draw view model when not in intermission
- CSQC_DrawViewModel (viewentity);
+ // punchangle code from Ironwail -- CEV
+ if (autocvar(v_gunkick, 1) &&
+ (view_pl.punch2 || view_pl.punch1))
+ {
+ view_angles_x += view_pl.punch2 + bound (0,
+ (time - view_pl.punch_time) / 0.1f, 1) *
+ (view_pl.punch1 - view_pl.punch2);
+ }
+
+ // roll code from Ironwail -- CEV
+ local float rollspeed = autocvar (cl_rollspeed, 200);
+ local float rollangle = autocvar (cl_rollangle, 2.0f);
+
+ if (rollspeed && rollangle)
+ {
+ local float roll = view_pl.velocity * v_right;
+ local float sign = roll < 0 ? -1 : 1;
+ roll = fabs (roll);
+
+ if (roll < rollspeed)
+ roll *= rollangle / rollspeed;
+ else
+ roll = rollangle;
+
+ view_angles_z += roll * sign;
+ }
+
+ setproperty (VF_ANGLES, view_angles);
+ SetListener (view_origin, v_forward, v_right, v_up);
+
+ // draw view model when not invisible
+ if (!(sitems & IT_INVISIBILITY))
+ {
+ setproperty (VF_VIEWENTITY, viewentity.entnum);
+ CSQC_DrawViewModel (viewentity);
+ }
+
+ setproperty (VF_DRAWCROSSHAIR, TRUE);
}

- if (player_local.effects & EF_MUZZLEFLASH)
- dprint ("CSQC_UpdateView: muzzleflash\n");
+ addentities (DRAWMASK_ENGINE | DRAWMASK_NORMAL);
+ renderscene ();

- // setproperty (VF_VIEWENTITY, player_localentnum);
- addentities (MASK_ENGINE | MASK_VIEWMODEL | MASK_NORMAL);
+ // call postframe for every entity with one; used for
+ // prediction rollback -- CEV
+ player_prediction_postframe (view_pl);
}
else
{
- // engine didn't tell us about our player entity.
- // that's not right...
- dprint ("CSQC_UpdateView: no player_local\n");
- addentities (MASK_ENGINE | MASK_VIEWMODEL | MASK_NORMAL);
+ dprint ("CSQC_UpdateView: no local player!\n");
+ if (intermission)
+ {
+ setproperty (VF_DRAWCROSSHAIR, FALSE);
+ addentities (DRAWMASK_ENGINE | DRAWMASK_NORMAL);
+ }
+ else
+ {
+ setproperty (VF_DRAWCROSSHAIR, TRUE);
+ addentities (DRAWMASK_ENGINE | DRAWMASK_VIEWMODEL |
+ DRAWMASK_NORMAL);
+ }
+ renderscene ();
}

- renderscene ();
+ #if 0
+ local entity t = world;
+ while ((t = nextent(t)))
+ {
+ dprint (sprintf("CSQC_UpdateView: found %s, model %s\n",
+ t.classname, modelnameforindex(t.modelindex)));
+ }
+ #endif

// Revert back to using engine HUD?
if (nocsqc > 0)
@@ -302,12 +355,12 @@ void(float vwidth, float vheight, float notmenu) CSQC_UpdateView =
deathmatch = stof (serverkey("deathmatch"));
coop = !deathmatch && maxclients > 1;

- // Draw the HUDs and scoreboards
+ // Draw the HUDs, scoreboards, and any requested colorshifts
CSQC_DrawHud (ssize, sb_showscores);
CSQC_DrawScores (ssize, sb_showscores);
+ csf_draw (ssize);
};

-/*
//----------------------------------------------------------------------
// Handle SVC_TEMPENTITY data from the server -- CEV
//
@@ -316,34 +369,33 @@ void(float vwidth, float vheight, float notmenu) CSQC_UpdateView =
//----------------------------------------------------------------------
float() CSQC_Parse_TempEntity =
{
- float teid, eid;
- vector pos, end, vel;
- entity e;
-
- teid = ReadByte ();
+ local float teid = ReadByte ();

switch (teid)
{
- case 6:
- eid = ReadEntityNum ();
- pos_x = ReadCoord ();
- pos_y = ReadCoord ();
- pos_z = ReadCoord ();
- end_x = ReadCoord ();
- end_y = ReadCoord ();
- end_z = ReadCoord ();
-
- trailparticles (particleeffectnum("TE_LIGHTNING2"),
- edict_num(eid), pos, end);
-
- // pointparticles (
- // particleeffectnum("TE_LIGHTNING2"),
- // pos, end, 1);
-
- // if (player_local && player_local.entnum == eid)
- // te_lightning2 (player_local, pos, end);
- // else
- // return FALSE;
+ case TE_LIGHTNING2:
+ local float eid = ReadEntityNum ();
+ local vector lgpos, lgend;
+ lgpos_x = ReadCoord ();
+ lgpos_y = ReadCoord ();
+ lgpos_z = ReadCoord ();
+ lgend_x = ReadCoord ();
+ lgend_y = ReadCoord ();
+ lgend_z = ReadCoord ();
+
+ /*
+ dprint (sprintf("CSQC_Parse_TempEntity: TE_LIGHTNING2: "
+ "pos %v, end %v, eid %g, player %g\n",
+ lgpos, lgend, eid, edict_num(eid)));
+ */
+
+ /*
+ trailparticles (particleeffectnum("te_lightning2"),
+ view_pl, getentity(eid, GE_ORIGIN), lgend);
+ */
+
+ // TODO CEV fix FTE particle effect te_lightning2
+ te_lightning2 (edict_num(eid), lgpos, lgend);

return TRUE;
default:
@@ -352,31 +404,120 @@ float() CSQC_Parse_TempEntity =

return FALSE;
};
-*/

//----------------------------------------------------------------------
-// Handle incoming MSG_ENTITY data from the server -- CEV
+// Handle incoming MSG_ENTITY data from the server
+// Entities are networked in this way either because they need movement
+// prediction or they can affect movement prediction -- CEV
//----------------------------------------------------------------------
void(float isnew) CSQC_Ent_Update =
{
- local float classtype;
+ local float type = ReadFloat ();

- classtype = ReadByte ();
+ if (self.classtype && self.classtype != type)
+ {
+ if (self.classtype != type)
+ {
+ dprint (sprintf("CSQC_Ent_Update: classtype "
+ "mismatch, calling removefunc for entity "
+ "of type %s\n", self.classname));
+
+ if (self.removefunc)
+ self.removefunc ();
+ isnew = TRUE;
+ self.classtype = type;
+ }
+ }
+ else
+ {
+ self.classtype = type;
+ }

- switch (classtype)
+ switch (self.classtype)
{
+ case CT_FUNC_DOOR:
+ func_door_netreceive (isnew);
+ return;
+ case CT_FUNC_MOVEWALL:
+ func_movewall_netreceive (isnew);
+ return;
+ case CT_FUNC_NEW_PLAT:
+ func_new_plat_netreceive (isnew);
+ return;
+ case CT_FUNC_PLAT:
+ func_plat_netreceive (isnew);
+ return;
+ case CT_FUNC_TOGGLEWALL:
+ func_togglewall_netreceive (isnew);
+ return;
+ case CT_FUNC_TRAIN:
+ func_train_netreceive (isnew);
+ return;
+ case CT_MISC_EXPLOBOX:
+ case CT_MISC_EXPLOBOX2:
+ base_explobox_netreceive (isnew);
+ return;
+ case CT_MISC_MODEL:
+ base_misc_model_netreceive (isnew);
+ return;
case CT_PLAYER:
- PlayerUpdate (isnew);
- break;
+ player_netreceive (isnew);
+ return;
case CT_TRIGGER_LADDER:
- break;
+ trigger_ladder_netreceive (isnew);
+ return;
+ case CT_TRIGGER_PUSH:
+ case CT_TRIGGER_PUSH_CUSTOM:
+ base_trigger_push_netreceive (isnew);
+ return;
+ case CT_TRIGGER_SETGRAVITY:
+ trigger_setgravity_netreceive (isnew);
+ return;
}
};

//----------------------------------------------------------------------
+// Entity has been removed on the server
+//----------------------------------------------------------------------
+void() CSQC_Ent_Remove =
+{
+ if (self.removefunc)
+ self.removefunc ();
+ remove (self);
+};
+
+//----------------------------------------------------------------------
void() CSQC_WorldLoaded =
{
+ // set latched-at-map-load-time cvars -- CEV
world_latched_cvars ();
+
+ // now read (some, not many) entities from the map file.
+ // the following is based on CSQC_WorldLoaded in CSQCTest
+ // and CSQC_WorldLoaded in Nuclide -- CEV
+ local string token = "";
+ getentitytoken (0);
+
+ while (1)
+ {
+ token = getentitytoken ();
+ if (token == "")
+ break;
+
+ if (token != "{")
+ {
+ dprint (sprintf("CSQC_WorldLoaded: bad entity data!, "
+ "token %s\n", token));
+ return;
+ }
+
+ if (base_entity_parsemapdata() == FALSE)
+ {
+ dprint (sprintf("CSQC_WorldLoaded: bad map data %s!\n",
+ token));
+ return;
+ }
+ }
};

//----------------------------------------------------------------------
@@ -388,15 +529,11 @@ void(float apilevel, string enginename, float engineversion) CSQC_Init =

// Is the CSQC functionality enabled/disabled?
nocsqc = cvar ("cl_nocsqc");
+
// Revert back to using engine HUD?
if (nocsqc > 0)
return;

- // Send ping back to server that CSQC client is alive
- // This can be used on the server side to detect CSQC
- // and change functions for new features
- localcmd (strcat("cmd ", CSQC_PING, "\n"));
-
// precache from gfx.wad ONLY!?!
wadonly = TRUE;

@@ -441,24 +578,17 @@ void(float apilevel, string enginename, float engineversion) CSQC_Init =
}

// TODO CEV
- precache_model ("progs/player.mdl");
+ // precache_model ("progs/player.mdl");

- viewentity = spawn ();
- viewentity.renderflags = RF_VIEWMODEL|RF_DEPTHHACK|RF_NOSHADOW;
-};
-
-//----------------------------------------------------------------------
-// Wrapper for CSQC_Init to try and detect DP engine
-//----------------------------------------------------------------------
-__wrap void(float apilevel, string enginename, float engineversion) CSQC_Init =
-{
- // Execute previous CSQC_Init function
- prior (apilevel, enginename, engineversion);
-
- registercommand ("+showscores");
- registercommand ("+showscores");
- registercommand ("+showteamscores");
- registercommand ("+showteamscores");
+ // spawn the view entity now -- CEV
+ if (!viewentity)
+ {
+ viewentity = spawn ();
+ viewentity.classname = "viewentity";
+ viewentity.renderflags = RF_DEPTHHACK | RF_NOSHADOW |
+ RF_VIEWMODEL;
+ viewentity.think = sub_null;
+ }
};

//----------------------------------------------------------------------
@@ -474,11 +604,11 @@ __wrap float(string str) CSQC_ConsoleCommand =
if (c == "+showscores")
sb_showscores |= 1;
else if (c == "-showscores")
- sb_showscores &~= 1;
+ sb_showscores &= ~1;
else if (c == "+showteamscores")
sb_showscores |= 2;
else if (c == "-showteamscores")
- sb_showscores &~= 2;
+ sb_showscores &= ~2;
else
return FALSE;

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

Diff qc/cl_hud.qc

diff --git a/qc/cl_hud.qc b/qc/cl_hud.qc
index 5a3023c..d3ef595 100644
--- a/qc/cl_hud.qc
+++ b/qc/cl_hud.qc
@@ -858,6 +858,9 @@ void(vector virtmin, vector virtsize) Hud_Intermission =
//----------------------------------------------------------------------
void(vector pos) Hud_InputMonitor =
{
+ // TODO CEV
+ // getinputstate (servercommandframe);
+
if (input_movevalues_x)
if (input_movevalues_x < 0)
// backward
@@ -883,6 +886,7 @@ void(vector pos) Hud_InputMonitor =
HUDSIZE_8, HUDRGB_DEF, hudalpha, 0);

if (input_movevalues_z)
+ {
if (input_movevalues_z < 0)
// down
drawcharacter ([pos_x - 38, pos_y, pos_z],
@@ -893,11 +897,19 @@ void(vector pos) Hud_InputMonitor =
drawcharacter ([pos_x - 24, pos_y, pos_z],
str2chr ("^", 0),
HUDSIZE_8, HUDRGB_DEF, hudalpha, 0);
+ }
+ else if (input_buttons & INPUT_BUTTON8)
+ {
+ // INPUT_BUTTON8 crouching
+ drawcharacter ([pos_x - 38, pos_y, pos_z], str2chr ("#", 0),
+ HUDSIZE_8, HUDRGB_DEF, hudalpha, 0);
+ }

- if (input_buttons & 0x00000002)
+ if (input_buttons & INPUT_BUTTON2)
// INPUT_BUTTON2 jumping
drawcharacter ([pos_x - 24, pos_y, pos_z], str2chr ("^", 0),
- HUDSIZE_8, HUDRGB_DEF, hudalpha, 0);
+ HUDSIZE_8, HUDRGB_DEF, hudalpha, 0);
+
};

//----------------------------------------------------------------------
@@ -905,10 +917,8 @@ void(vector pos) Hud_InputMonitor =
//----------------------------------------------------------------------
void(vector pos) Hud_Speedometer =
{
- // fancy -- CEV
- local vector v = [player_local.velocity_x, player_local.velocity_y, 0];
-
- Hud_DrawNoFont8 (pos, ceil(vlen(v)), 3, FALSE, HUDFONT_WHITE);
+ Hud_DrawNoFont8 (pos, floor(view_pl.speed), 3,
+ FALSE, HUDFONT_WHITE);
};

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

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

Diff qc/cl_player.qc

diff --git a/qc/cl_player.qc b/qc/cl_player.qc
deleted file mode 100644
index ae3b75d..0000000
--- a/qc/cl_player.qc
+++ /dev/null
@@ -1,329 +0,0 @@
-//==============================================================================
-// CSQC PLAYER MOVEMENT & PREDICTION
-//
-// This is based on code by Eukara [1] and the CSQCTest code shipped with
-// FTEQW [2].
-//
-// [1]: https://icculus.org/~marco/quakec/csqc/prediction.html
-// [2]: https://sourceforge.net/p/fteqw/code/HEAD/tree/trunk/quakec/csqctest/src
-//==============================================================================
-
-//======================================================================
-// constants
-//======================================================================
-
-#ifdef CSQC
-const float PRED_ERRORTIME = 20; //
-const float PRED_STEPTIME = 8;
-#endif
-
-//======================================================================
-// forward declarations
-//======================================================================
-
-#ifdef CSQC
-void(entity ent) PlayerResetPrediction;
-void(entity ent, float endframe) PlayerRunMovement;
-float() PlayerPreDraw;
-static void() PlayerRemove;
-void() PlayerNew;
-void(float isnew) PlayerUpdate;
-#endif
-
-//------------------------------------------------------------------------------
-
-#ifdef CSQC
-//----------------------------------------------------------------------
-// PlayerResetPrediction
-// was Pred_ResetPlayerPrediction in CSQCTest cs/prediction.qc
-//----------------------------------------------------------------------
-void(entity e) PlayerResetPrediction =
-{
- e.origin = player_org;
- e.velocity = player_vel;
- e.flags = player_flags;
- e.pmove_flags = player_pmove_flags;
- e.doublejump_timer = player_doublejump_timer;
-
- // +1 because the received frame has the move already done (server side)
- pmove_frame = player_sequence + 1;
-
- if (pmove_frame < clientcommandframe - 128)
- // avoid an infinite loop
- pmove_frame = clientcommandframe - 128;
-};
-
-//----------------------------------------------------------------------
-// PlayerRunMovement
-// was Pred_RunMovement in CSQCTest cs/prediction.qc
-//----------------------------------------------------------------------
-void(entity e, float endframe) PlayerRunMovement =
-{
- if (servercommandframe >= player_sequence + 63)
- {
- // we're meant to be updating the player faster than
- // this. hopefully its just that we're throttled...
-
- // you can comment out this block and the player will
- // continue to be predicted locally. But its best to
- // freeze them
-
- // as a note we also hit this block when the console is
- // down -- CEV
-
- player_sequence = servercommandframe - 63;
- return;
- }
-
- PlayerResetPrediction (e);
-
- if (getstatf(STAT_HEALTH) <= 0)
- {
- // dead, so don't run prediction. :D
- pmove_frame = clientcommandframe;
- if (!getinputstate(pmove_frame - 1))
- {
- dprint ("PlayerRunMovement: no-op if statement?\n");
- // no-op ? -- CEV
- }
- return;
- }
-
- /*
- if (getinputstate(pmove_frame - 1))
- // from CSQCTest; what is this doing? -- TODO CEV;
- e.pmove_flags |= PMF_JUMP_HELD;
- */
-
- while (pmove_frame <= endframe)
- {
- if (!getinputstate(pmove_frame))
- {
- // no input from client
- // pmove_frame++;
- break;
- }
-
- if (world_standardphysics)
- // for testing
- runstandardplayerphysics (e);
- else
- // for real
- PM_Move (e);
- pmove_frame++;
- }
-
- // add anything that was applied after (for low packet
- // rate protocols)
- // TODO CEV
- input_angles = view_angles;
-};
-
-//----------------------------------------------------------------------
-// PlayerPreDraw
-// Incorporates Pred_UpdateLocalMovement from CSQCTest.
-//----------------------------------------------------------------------
-float() PlayerPreDraw =
-{
- local float viewheight;
-
- if (self.entnum != player_localentnum)
- {
- self.renderflags = 0;
- }
- else
- {
- PlayerRunMovement (self, clientcommandframe);
-
- if (self.origin_z >= player_step_oldz + 6 &&
- self.origin_z < player_step_oldz + 24 &&
- self.velocity_z == 0)
- {
- // evaluate out the remaining old step
- if (player_steptime - time > 0)
- player_step = (player_steptime - time) *
- PRED_STEPTIME * player_step;
- else
- player_step = 0;
-
- // work out the new step
- player_step += (player_step_oldz - self.origin_z);
- player_steptime = time + 1 / PRED_STEPTIME;
- }
- player_step_oldz = self.origin_z;
-
- // allow the user to move the viewheight down 6 units so
- // it's at +16, where projectiles come from.
- viewheight = autocvar (v_viewheight, 0);
- if (viewheight < -7)
- viewheight = -7;
- else if (viewheight > 7)
- viewheight = 7;
-
- view_origin = self.origin;
- view_origin_z += getstatf (STAT_VIEWHEIGHT) + viewheight;
-
- // correct the view position to compensate for any errors,
- // slowly over time, 0.1 seconds.
- if (pmove_errortime - time > 0)
- {
- dprint ("PlayerPreDraw: pmove error\n");
- view_origin += (pmove_errortime - time) *
- PRED_ERRORTIME * pmove_error;
- }
-
- if (player_steptime - time > 0)
- view_origin_z += (player_steptime - time) *
- PRED_STEPTIME * player_step;
-
- if (self.lerptime)
- self.lerpfrac = 1 - (time - self.lerptime) * 10;
-
- self.renderflags |= RF_EXTERNALMODEL;
- }
-
- viewentity.angles = view_angles;
- viewentity.origin = view_origin;
-
- addentity (self);
- return PREDRAW_NEXT;
-};
-
-//----------------------------------------------------------------------
-// PlayerRemove
-//----------------------------------------------------------------------
-static void() PlayerRemove =
-{
- if (player_local == self)
- player_local = world;
-
- setmodel (self, "");
- self.oldskin = "";
- self.predraw = __NULL__;
-};
-
-//----------------------------------------------------------------------
-// PlayerNew
-//----------------------------------------------------------------------
-void() PlayerNew =
-{
- self.classname = "player";
- self.customphysics = sub_null;
- // MASK_NORMAL ?
- self.drawmask = MASK_ENGINE;
- self.movetype = MOVETYPE_WALK;
- self.predraw = PlayerPreDraw;
- self.removefunc = PlayerRemove;
- self.solid = SOLID_SLIDEBOX;
- setmodel (self, "progs/player.mdl");
-};
-
-//----------------------------------------------------------------------
-// PlayerUpdate
-// called from CSQC_Ent_Update for CT_PLAYER entities
-//----------------------------------------------------------------------
-void(float isnew) PlayerUpdate =
-{
- local float f;
-
- f = ReadByte ();
- self.origin_x = ReadCoord ();
- self.origin_y = ReadCoord ();
- self.origin_z = ReadCoord ();
- self.angles_x = ReadShort () / (32767 / 360);
- self.angles_y = ReadShort () / (32767 / 360);
- self.angles_z = ReadShort () / (32767 / 360);
- self.velocity_x = ReadShort ();
- self.velocity_y = ReadShort ();
- self.velocity_z = ReadShort ();
- self.effects = ReadFloat ();
- self.flags = ReadFloat ();
- self.pmove_flags = ReadFloat ();
- self.doublejump_timer = ReadFloat ();
-
- if (isnew && !(self.predraw))
- PlayerNew ();
-
- if (intermission)
- {
- // zero out velocity if in intermission -- CEV
- world_gravity = 0.0f;
- input_movevalues = '0 0 0';
- self.velocity = '0 0 0';
- viewentity.velocity = '0 0 0';
- // viewentity.angles = self.angles;
- // viewentity.origin = self.origin;
- // setorigin (self, self.origin);
- // setorigin (viewentity, viewentity.origin);
- return;
- }
-
- if (f != self.frame || isnew)
- {
- self.frame2 = self.frame;
- self.lerptime = time;
- self.frame = f;
- }
-
- if (self.entnum == player_localentnum)
- {
- local vector o, v;
- local float djt, gbt, pmflags, tempflags;
-
- // this is us; save for later
- player_local = self;
- o = self.origin;
- v = self.velocity;
- djt = self.doublejump_timer;
- tempflags = self.flags;
- pmflags = self.pmove_flags;
-
- // PlayerRunMovement calls ResetPrediction -- CEV
- // PlayerResetPrediction (self);
- PlayerRunMovement (self, servercommandframe + 1);
-
- // TODO CEV ????
- player_doublejump_timer = djt;
- player_flags = tempflags;
- player_pmove_flags = pmflags;
- player_org = o;
- player_vel = v;
- player_sequence = servercommandframe;
-
- if (autocvar(cg_noerror, TRUE))
- {
- pmove_error = '0 0 0';
- pmove_errortime = time;
- PlayerResetPrediction (self);
- }
- else
- {
- PlayerRunMovement (self, clientcommandframe);
- o = self.origin;
- // again: PlayerRunMovement calls ResetPrediction
- // PlayerResetPrediction (self);
- PlayerRunMovement (self, clientcommandframe);
-
- if (vlen(o - self.origin) > 64)
- {
- // teleport
- pmove_error = '0 0 0';
- pmove_errortime = time;
- }
- else
- {
- pmove_error = (pmove_errortime - time) *
- PRED_ERRORTIME * pmove_error +
- (o - self.origin);
- if (vlen(pmove_error) < 1)
- pmove_error = '0 0 0';
- pmove_errortime = time + 1 / PRED_ERRORTIME;
- }
- }
- }
-
- setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
- self.oldframe = self.frame;
- // setorigin (self, self.origin);
-};
-#endif

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

Diff qc/cl_progs.src

diff --git a/qc/cl_progs.src b/qc/cl_progs.src
index 4e98d66..4e36570 100644
--- a/qc/cl_progs.src
+++ b/qc/cl_progs.src
@@ -1,9 +1,10 @@
-#pragma target fte
+#pragma target FTE
#pragma progs_dat "../csprogs.dat"
#pragma autoproto

#define FTE
#define CSQC
+#define DP_QC_GETSURFACE

#includelist
//----------------------------------------------------------------------
@@ -16,16 +17,42 @@ defs_const.qc // program-wide constants
defs_ctypes.qc // global class list

//----------------------------------------------------------------------
+// utility & helper functions
+//----------------------------------------------------------------------
+math.qc // Code by Joshua Skelton + misc
+cshift.qc // overlay color shift controller
+
+//----------------------------------------------------------------------
// object bootstrapping
//----------------------------------------------------------------------
base_entities.qc //
+base_func.qc //
+base_monster.qc //
+base_trigger.qc // trigger initialization & helper functions
world.qc //

//----------------------------------------------------------------------
-// movement & client prediction, HUD, entity handling
+// movement, CSQC HUD, CSQC entrypoints
//----------------------------------------------------------------------
pmove.qc // player movement code
-cl_player.qc // clientside player prediction
-cl_hud.qc // modified AD HUD (originally by Sock)
+cl_hud.qc // modified AD vanilla HUD (originally by Sock)
cl_entry.qc // modified AD CSQC (originally by Sock)
+
+//----------------------------------------------------------------------
+// CSQC networked entities
+//----------------------------------------------------------------------
+func/door.qc // id1 doors
+func/new_plat.qc // rogue plats
+func/plat.qc // id1 platforms
+func/rotate.qc // hipnotic rotation (needed for func_movewall)
+func/togglewall.qc // hipnotic togglewalls
+func/train.qc // id1 trains
+misc/explobox.qc // id1 explosive boxes are solid
+misc/model.qc // networked because misc_model can be solid
+misc/modeltrain.qc // networked because modeltrain can be solid
+monsters/playerclient.qc // player entities, client prediction
+triggers/fog.qc // world fog
+triggers/ladder.qc // rubicon ladders
+triggers/push.qc // id1 push brushes
+triggers/setgravity.qc // hipnotic setgravity
#endlist

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

Diff qc/compat/id1.qc

diff --git a/qc/compat/id1.qc b/qc/compat/id1.qc
new file mode 100644
index 0000000..9cdd56a
--- /dev/null
+++ b/qc/compat/id1.qc
@@ -0,0 +1,165 @@
+//==============================================================================
+// KNOWN_RELEASE_ID1 specific compatibility
+//==============================================================================
+
+//======================================================================
+// fields
+//======================================================================
+
+#ifdef SSQC
+.void() th_die; // maphacks
+#endif
+
+//======================================================================
+// forward declarations
+//======================================================================
+
+#ifdef SSQC
+float(string tex) id1_surface_type; // material type for texture name
+
+void() boss_awake; // support for jam6_scampie
+void() boss_missile1;
+void() SUB_regen;
+void() plat_hit_bottom;
+void() train_wait;
+void() enforcer_fire;
+void() walkmonster_start_go;
+void() walkmonster_start;
+void() OgreGrenadeExplode;
+void() barrel_explode;
+#endif
+
+//------------------------------------------------------------------------------
+
+#ifdef SSQC
+//----------------------------------------------------------------------
+// given a texture name return a surface type. currently used for floor
+// types (footstep sounds) -- CEV
+//----------------------------------------------------------------------
+float(string tex) id1_surface_type =
+{
+ // this is a lot of string comparisons -- CEV
+ switch (tex)
+ {
+ case "grave01_3":
+ case "grave01_4":
+ case "ground1_2":
+ case "ground1_5":
+ case "ground1_6":
+ case "ground1_8":
+ case "wall11_6":
+ case "wgrass1_1":
+ case "wgrnd1_5":
+ case "wgrnd1_6":
+ return SURFACE_DIRT;
+ case "cop1_1":
+ case "cop1_2":
+ case "cop1_4":
+ case "cop1_6":
+ case "cop2_3":
+ case "cop3_4":
+ case "ecop1_1":
+ case "ecop1_4":
+ case "ecop1_6":
+ case "lgmetal2":
+ case "met5_1":
+ case "metal1_2": // the dirtiest & brownest metal
+ case "metal1_3":
+ case "metal1_4":
+ case "metal1_5":
+ case "metal1_6":
+ case "metal1_7":
+ case "metal2_1":
+ case "metal2_4":
+ case "metal2_5":
+ case "metal2_6":
+ case "metal4_4":
+ case "metal4_5":
+ case "metal4_7":
+ case "metal4_8":
+ case "metal5_1":
+ case "metal5_2":
+ case "metal5_4":
+ case "metalt2_6":
+ case "metflor2_1": // could be dirt instead
+ case "mmetal1_1":
+ case "mmetal1_3":
+ case "nmetal1_2":
+ case "nmetal2_1":
+ case "nmetal2_6":
+ case "plat_top2":
+ case "sfloor4_1":
+ case "sfloor4_2":
+ case "sfloor4_6":
+ case "wiz1_1":
+ case "wizmet1_1":
+ case "wizmet1_2":
+ case "wizmet1_6":
+ case "wizmet1_7":
+ case "wmet1_1":
+ case "wmet2_1":
+ case "wmet2_2": // could be dirt or wood
+ case "wmet2_3":
+ case "wmet2_4":
+ case "wmet4_4":
+ case "wmet4_7":
+ return SURFACE_METAL;
+ case "azwall3_2":
+ case "city1_7":
+ case "wizwood1_2":
+ case "wizwood1_4":
+ case "wizwood1_5":
+ case "wizwood1_6":
+ case "wizwood1_7":
+ case "wizwood1_8":
+ case "wood1_1":
+ case "wood1_5":
+ case "wood1_7":
+ case "woodflr1_4":
+ return SURFACE_WOOD;
+ default:
+ return SURFACE_STONE;
+ }
+};
+
+//----------------------------------------------------------------------
+// generic support for func map jam 6, mostly the excellent jam6_scampie
+//----------------------------------------------------------------------
+
+//----------------------------------------------------------------------
+void() boss_awake = { monster_boss_use (); };
+void() boss_missile1 = { boss_atk1 (); };
+void() SUB_regen = { base_item_think_respawn (); };
+void() plat_hit_bottom = { func_plat_hit_bottom (); };
+void() train_wait = { base_func_train_wait (); };
+void() enforcer_fire = { monster_enforcer_attack (); };
+void() walkmonster_start_go = { base_walkmonster_think_start (); };
+
+//----------------------------------------------------------------------
+void() walkmonster_start =
+{
+ base_monster_init (self);
+ self.think = base_walkmonster_think_start;
+ self.nextthink = self.nextthink + random() * 0.5;
+ total_monsters = total_monsters + 1;
+};
+
+//----------------------------------------------------------------------
+void() OgreGrenadeExplode =
+{
+ sound (self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM);
+
+ self.velocity = '0 0 0';
+ self.destroy = sub_nulldestroy;
+ self.think = sub_null;
+ self.touch = sub_null;
+
+ projectile_grenade_think ();
+};
+
+//----------------------------------------------------------------------
+void() barrel_explode =
+{
+ base_explobox_destroy ('0 0 0');
+};
+#endif

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

Diff qc/compat/quake3.qc

diff --git a/qc/compat/quake3.qc b/qc/compat/quake3.qc
new file mode 100644
index 0000000..943e1c6
--- /dev/null
+++ b/qc/compat/quake3.qc
@@ -0,0 +1,175 @@
+//==============================================================================
+// Quake 3 compatibility entrypoints / functions
+//==============================================================================
+
+#ifdef SSQC
+//----------------------------------------------------------------------
+void() spawnfunc_item_quad =
+{
+ item_artifact_super_damage ();
+};
+#endif
+
+//======================================================================
+// Quake 3 armor item support -- CEV
+//======================================================================
+
+#ifdef SSQC
+//----------------------------------------------------------------------
+// Green Armor
+//----------------------------------------------------------------------
+void() spawnfunc_item_armor_jacket =
+{
+ item_armor1 ();
+};
+
+//----------------------------------------------------------------------
+// Yellow Armor
+//----------------------------------------------------------------------
+void() spawnfunc_item_armor_combat =
+{
+ item_armor2 ();
+};
+
+//----------------------------------------------------------------------
+// Red Armor
+//----------------------------------------------------------------------
+void() spawnfunc_item_armor_body =
+{
+ item_armorInv ();
+};
+#endif
+
+//======================================================================
+// Quake 3 health item support -- CEV
+//======================================================================
+
+#ifdef SSQC
+//----------------------------------------------------------------------
+void() spawnfunc_item_health_mega =
+{
+ // new spawnflags for all entities -- iw
+ if (SUB_Inhibit ())
+ return;
+
+ self.classname = "item_health";
+ self.spawnflags |= 2;
+ item_health_init (self);
+};
+
+//----------------------------------------------------------------------
+void() spawnfunc_item_health_small =
+{
+ // new spawnflags for all entities -- iw
+ if (SUB_Inhibit ())
+ return;
+
+ self.classname = "item_health_vial";
+ item_health_vial_init (self);
+};
+#endif
+
+//======================================================================
+// Quake 3 ammo & weapons -- CEV
+//======================================================================
+
+#ifdef SSQC
+//----------------------------------------------------------------------
+void() spawnfunc_ammo_cells =
+{
+ item_spikes ();
+};
+
+//----------------------------------------------------------------------
+void() spawnfunc_ammo_grenades =
+{
+ item_rockets ();
+};
+
+//----------------------------------------------------------------------
+void() spawnfunc_ammo_lightning =
+{
+ item_cells ();
+};
+
+//----------------------------------------------------------------------
+void() spawnfunc_ammo_rockets =
+{
+ item_rockets ();
+};
+
+//----------------------------------------------------------------------
+void() spawnfunc_ammo_shells =
+{
+ item_shells ();
+};
+
+//----------------------------------------------------------------------
+void() spawnfunc_weapon_plasmagun =
+{
+ // new spawnflags for all entities -- iw
+ if (SUB_Inhibit ())
+ return;
+
+ self.classname = "weapon_supernailgun";
+ weapon_supernailgun_init (self);
+};
+#endif
+
+//======================================================================
+// Quake 3 push target entities -- CEV
+//======================================================================
+
+#ifdef SSQC
+//----------------------------------------------------------------------
+void() spawnfunc_target_push =
+{
+ // new spawnflags for all entities -- iw
+ if (SUB_Inhibit ())
+ return;
+
+ if (!self.targetname)
+ if (self.target != __NULL__ && self.target != "")
+ // quake 3 compat -- CEV
+ self.targetname = self.target;
+ else
+ objerror ("no targetname");
+};
+
+//----------------------------------------------------------------------
+void() spawnfunc_target_position =
+{
+ self.classname = "target_push";
+ spawnfunc_target_push ();
+};
+#endif
+
+//======================================================================
+// Quake 3 Teleporter targets -- CEV
+//======================================================================
+
+#ifdef SSQC
+//----------------------------------------------------------------------
+void() spawnfunc_misc_teleport_dest =
+{
+ info_teleport_destination ();
+};
+
+//----------------------------------------------------------------------
+void() spawnfunc_misc_teleporter_dest =
+{
+ info_teleport_destination ();
+};
+
+//----------------------------------------------------------------------
+void() spawnfunc_misc_teleporter_destination =
+{
+ info_teleport_destination ();
+};
+
+//----------------------------------------------------------------------
+void() spawnfunc_target_teleporter =
+{
+ info_teleport_destination ();
+};
+#endif

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

Diff qc/compat_quake3.qc

diff --git a/qc/compat_quake3.qc b/qc/compat_quake3.qc
deleted file mode 100644
index 57231ef..0000000
--- a/qc/compat_quake3.qc
+++ /dev/null
@@ -1,163 +0,0 @@
-//==============================================================================
-// Quake 3 compatibility entrypoints / functions
-//==============================================================================
-
-//----------------------------------------------------------------------
-void() spawnfunc_item_quad =
-{
- item_artifact_super_damage ();
-};
-
-//======================================================================
-// Quake 3 armor item support -- CEV
-//======================================================================
-
-//----------------------------------------------------------------------
-// Green Armor
-//----------------------------------------------------------------------
-void() spawnfunc_item_armor_jacket =
-{
- item_armor1 ();
-};
-
-//----------------------------------------------------------------------
-// Yellow Armor
-//----------------------------------------------------------------------
-void() spawnfunc_item_armor_combat =
-{
- item_armor2 ();
-};
-
-//----------------------------------------------------------------------
-// Red Armor
-//----------------------------------------------------------------------
-void() spawnfunc_item_armor_body =
-{
- item_armorInv ();
-};
-
-//======================================================================
-// Quake 3 health item support -- CEV
-//======================================================================
-
-//----------------------------------------------------------------------
-void() spawnfunc_item_health_mega =
-{
- // new spawnflags for all entities -- iw
- if (SUB_Inhibit ())
- return;
-
- self.classname = "item_health";
- self.spawnflags |= 2;
- item_health_init (self);
-};
-
-//----------------------------------------------------------------------
-void() spawnfunc_item_health_small =
-{
- // new spawnflags for all entities -- iw
- if (SUB_Inhibit ())
- return;
-
- self.classname = "item_health_vial";
- item_health_vial_init (self);
-};
-
-//======================================================================
-// Quake 3 ammo & weapons -- CEV
-//======================================================================
-
-//----------------------------------------------------------------------
-void() spawnfunc_ammo_cells =
-{
- item_spikes ();
-};
-
-//----------------------------------------------------------------------
-void() spawnfunc_ammo_grenades =
-{
- item_rockets ();
-};
-
-//----------------------------------------------------------------------
-void() spawnfunc_ammo_lightning =
-{
- item_cells ();
-};
-
-//----------------------------------------------------------------------
-void() spawnfunc_ammo_rockets =
-{
- item_rockets ();
-};
-
-//----------------------------------------------------------------------
-void() spawnfunc_ammo_shells =
-{
- item_shells ();
-};
-
-//----------------------------------------------------------------------
-void() spawnfunc_weapon_plasmagun =
-{
- // new spawnflags for all entities -- iw
- if (SUB_Inhibit ())
- return;
-
- self.classname = "weapon_supernailgun";
- weapon_supernailgun_init (self);
-};
-
-//======================================================================
-// Quake 3 push target entities -- CEV
-//======================================================================
-
-//----------------------------------------------------------------------
-void() spawnfunc_target_push =
-{
- // new spawnflags for all entities -- iw
- if (SUB_Inhibit ())
- return;
-
- if (!self.targetname)
- if (self.target != __NULL__ && self.target != "")
- // quake 3 compat -- CEV
- self.targetname = self.target;
- else
- objerror ("no targetname");
-};
-
-//----------------------------------------------------------------------
-void() spawnfunc_target_position =
-{
- self.classname = "target_push";
- spawnfunc_target_push ();
-};
-
-//======================================================================
-// Quake 3 Teleporter targets -- CEV
-//======================================================================
-
-//----------------------------------------------------------------------
-void() spawnfunc_misc_teleport_dest =
-{
- info_teleport_destination ();
-};
-
-//----------------------------------------------------------------------
-void() spawnfunc_misc_teleporter_dest =
-{
- info_teleport_destination ();
-};
-
-//----------------------------------------------------------------------
-void() spawnfunc_misc_teleporter_destination =
-{
- info_teleport_destination ();
-};
-
-//----------------------------------------------------------------------
-void() spawnfunc_target_teleporter =
-{
- info_teleport_destination ();
-};

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

Diff qc/cshift.qc

diff --git a/qc/cshift.qc b/qc/cshift.qc
index 182f594..b8d808b 100644
--- a/qc/cshift.qc
+++ b/qc/cshift.qc
@@ -6,106 +6,148 @@
// fields
//======================================================================

-.entity csf_controller; // cshift controller
-.vector csf_color;
-.float csf_density;
-.float fade_amt;
+#ifdef CSQC
+.vector csf_color; // color target requested by sv progs
+.vector csf_color_cur; // current color
+.float csf_density; // alpha target requested by sv progs
+.float csf_density_cur; // current alpha
+.float csf_finished; // finish fade at this time
+.float csf_speed; // fade at this speed
+#endif
+#ifdef SSQC
+.float fade_amt; // see trigger_textstory
+#endif

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

-inline void(entity client, float density, vector color) csf_save;
-inline void(entity client) csf_apply;
-void(entity client, float density, vector color) csf_set;
-void() csf_controller_think;
-void(entity client) csf_controller_start;
-void(entity client, float density, vector color, float spd) csf_fade;
+#ifdef SSQC
+void(entity c, float d, vector col) csf_set_netsend;
+void(entity c, float d, vector col) csf_set;
+void(entity c, float d, vector col, float spd) csf_fade_netsend;
+void(entity c, float d, vector col, float spd) csf_fade;
+#endif
+#ifdef CSQC
+void(entity c) csf_set_netreceive;
+void(entity c) csf_fade_netreceive;
+void(vector ssize) csf_draw;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
-inline void(entity client, float density, vector color) csf_save =
+// transmit instant colorshift request to client c -- CEV
+//----------------------------------------------------------------------
+void(entity c, float d, vector col) csf_set_netsend =
{
- client.csf_color = color;
- client.csf_density = density;
+ WriteByte (MSG_MULTICAST, SVC_CGAMEPACKET);
+ WriteByte (MSG_MULTICAST, EVENT_CSHIFT_SET);
+ WriteShort (MSG_MULTICAST, col_x);
+ WriteShort (MSG_MULTICAST, col_y);
+ WriteShort (MSG_MULTICAST, col_z);
+ WriteFloat (MSG_MULTICAST, d);
+ msg_entity = c;
+ multicast (c.origin, MULTICAST_ONE_R);
};

//----------------------------------------------------------------------
-inline void(entity client) csf_apply =
-{
- stuffcmd (client, "\nv_cshift ");
- stuffcmd (client, ftos(client.csf_color_x));
- stuffcmd (client, " ");
- stuffcmd (client, ftos(client.csf_color_y));
- stuffcmd (client, " ");
- stuffcmd (client, ftos(client.csf_color_z));
- stuffcmd (client, " ");
- stuffcmd (client, ftos(client.csf_density));
- stuffcmd (client, "\n");
-};
+// alias for csf_set_netsend
+//----------------------------------------------------------------------
+void(entity client, float density, vector color) csf_set = csf_set_netsend;

//----------------------------------------------------------------------
-void(entity client, float density, vector color) csf_set =
+// transmit our colorshift fade request to client c -- CEV
+//----------------------------------------------------------------------
+void(entity c, float d, vector col, float spd) csf_fade_netsend =
{
- csf_save (client, density, color);
- csf_apply (client);
+ WriteByte (MSG_MULTICAST, SVC_CGAMEPACKET);
+ WriteByte (MSG_MULTICAST, EVENT_CSHIFT_FADE);
+ WriteShort (MSG_MULTICAST, col_x);
+ WriteShort (MSG_MULTICAST, col_y);
+ WriteShort (MSG_MULTICAST, col_z);
+ WriteFloat (MSG_MULTICAST, d);
+ WriteFloat (MSG_MULTICAST, spd);
+ msg_entity = c;
+ multicast (c.origin, MULTICAST_ONE_R);
};

//----------------------------------------------------------------------
-void() csf_controller_think =
-{
- entity e = self.owner;
-
- if (self.pain_finished > time && e.csf_density != self.csf_density)
- {
- local float density, fraction;
- local vector color;
-
- // wat
- fraction = 1 - (self.pain_finished - time) / self.speed;
-
- density = lerp_hermite (e.csf_density, self.csf_density,
- fraction);
- color = lerp_vector_hermite (e.csf_color, self.csf_color,
- fraction);
+// alias for csf_fade_netsend
+//----------------------------------------------------------------------
+void(entity c, float d, vector col, float spd) csf_fade = csf_fade_netsend;
+#endif

- csf_set (e, density, color);
+#ifdef CSQC
+//----------------------------------------------------------------------
+void(entity c) csf_set_netreceive =
+{
+ c.csf_color_x = bound (0, ReadShort(), 256);
+ c.csf_color_y = bound (0, ReadShort(), 256);
+ c.csf_color_z = bound (0, ReadShort(), 256);
+ c.csf_density = bound (0, ReadFloat(), 256);

- self.nextthink = time + 0.04;
- }
- else
- {
- csf_set (e, self.csf_density, self.csf_color);
- }
+ // dprint (sprintf("csf_set_netreceive color %v, density %g, "
+ // "speed %g\n", c.csf_color, c.csf_density, c.csf_speed));
};

//----------------------------------------------------------------------
-void(entity client) csf_controller_start =
+void(entity c) csf_fade_netreceive =
{
- if (client.csf_controller.classname == "csfcontroller" &&
- client.csf_controller.owner == client)
- {
- return;
- }
-
- entity e = spawn ();
- client.csf_controller = e;
- e.owner = client;
- e.classname = "csfcontroller";
- e.think = csf_controller_think;
+ c.csf_color_x = bound (0, ReadShort(), 256);
+ c.csf_color_y = bound (0, ReadShort(), 256);
+ c.csf_color_z = bound (0, ReadShort(), 256);
+ c.csf_density = bound (0, ReadFloat(), 256);
+ c.csf_speed = max (0, ReadFloat());
+ c.csf_finished = time + c.csf_speed;
+
+ // dprint (sprintf("csf_fade_netreceive color %v, density %g, "
+ // "speed %g\n", c.csf_color, c.csf_density, c.csf_speed));
};

//----------------------------------------------------------------------
-void(entity client, float density, vector color, float spd) csf_fade =
+// csf_draw
+// called every video frame to draw an overlay of csf_color at alpha
+// csf_density. Will blend from one color and density value to another
+// if csf_finished and csf_speed are set appropriately. -- CEV
+//----------------------------------------------------------------------
+void(vector ssize) csf_draw =
{
- csf_controller_start (client);
-
- entity ct = client.csf_controller;
+ // the logic from csf_controller_think will work fine here on
+ // the client-side -- CEV
+ if (view_pl.csf_finished > time)
+ {
+ if (view_pl.csf_density != view_pl.csf_density_cur)
+ {
+ local float density, fraction;
+ local vector color;
+
+ // wat
+ fraction = 1 - (view_pl.csf_finished - time) /
+ view_pl.csf_speed;
+
+ density = lerp_hermite (view_pl.csf_density_cur,
+ view_pl.csf_density, fraction);
+ color = lerp_vector_hermite (view_pl.csf_color_cur,
+ view_pl.csf_color, fraction);
+
+ view_pl.csf_density_cur = density;
+ view_pl.csf_color_cur = color;
+ }
+ }
+ else
+ {
+ if (view_pl.csf_density_cur != view_pl.csf_density)
+ view_pl.csf_density_cur = view_pl.csf_density;
+ if (view_pl.csf_color_cur != view_pl.csf_color)
+ view_pl.csf_color_cur = view_pl.csf_color;
+ }

- ct.speed = spd;
- ct.pain_finished = time + spd;
- ct.csf_color = color;
- ct.csf_density = density;
- ct.nextthink = time + 0.04;
+ if (view_pl.csf_density_cur > 0)
+ // draw a rectangle starting at 0,0 of size ssize of color
+ // csf_color_cur of alpha csf_density_cur / 256.0 -- CEV
+ drawfill ([0, 0], ssize, view_pl.csf_color_cur,
+ view_pl.csf_density_cur / 256, 0);
};
+#endif

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

Diff qc/custom_mdls.qc

diff --git a/qc/custom_mdls.qc b/qc/custom_mdls.qc
index ecfc592..ef1da80 100644
--- a/qc/custom_mdls.qc
+++ b/qc/custom_mdls.qc
@@ -6,6 +6,7 @@
// fields -- custom models -- dumptruck_ds
//======================================================================

+#ifdef SSQC
.string mdl_head;
.string mdl_body;
.string mdl_proj; // projectile
@@ -19,11 +20,13 @@

.vector mdlsz; // additions by bmFbr for custom bbox
.vector centeroffset;
+#endif

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

+#ifdef SSQC
void(entity e, .string mdl_field, string default_file) precache_model_custom;
void(entity e, string default_file) precache_head_model;
void(entity e, string default_file) precache_body_model;
@@ -40,9 +43,11 @@ void(entity e, .string mdl_field, string default_file) model_custom;
void(entity e, string default_file) body_model;
// void(entity e, string default_file) head_model;
void(entity e, string default_file) proj_model;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// precache_model_custom
//----------------------------------------------------------------------
@@ -160,3 +165,4 @@ void(entity e, string default_file) proj_model =
{
model_custom (e, mdl_proj, default_file);
};
+#endif

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

Diff qc/custom_snd.qc

diff --git a/qc/custom_snd.qc b/qc/custom_snd.qc
index b0dd7f1..e5c95aa 100644
--- a/qc/custom_snd.qc
+++ b/qc/custom_snd.qc
@@ -14,6 +14,7 @@ TODO: iw to add descriptive comments to this file.
// fields -- Custom Monster Sounds -- dumptruck_ds
//======================================================================

+#ifdef SSQC
.string snd_death;
.string snd_pain;
.string snd_sight;
@@ -26,11 +27,13 @@ TODO: iw to add descriptive comments to this file.
.string snd_misc1;
.string snd_misc2;
.string snd_misc3;
+#endif

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

+#ifdef SSQC
void(entity e, .string snd_field, string default_file) precache_sound_custom;
void(entity e, string default_file) precache_sound_attack;
void(entity e, string default_file) precache_sound_death;
@@ -70,9 +73,11 @@ void(entity e, float chan, string def, float vol, float atten) sound_misc3;
void(entity e, float chan, string def, float vol, float atten) sound_move;
void(entity e, float chan, string def, float vol, float atten) sound_pain;
void(entity e, float chan, string def, float vol, float atten) sound_sight;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// precache_sound_custom
//----------------------------------------------------------------------
@@ -334,3 +339,4 @@ void(entity e, float chan, string default_file, float vol, float atten)
{
sound_custom (snd_sight, e, chan, default_file, vol, atten);
};
+#endif

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

Diff qc/cutscene.qc

diff --git a/qc/cutscene.qc b/qc/cutscene.qc
index c0039bf..3299cce 100644
--- a/qc/cutscene.qc
+++ b/qc/cutscene.qc
@@ -813,9 +813,9 @@ void() Cutscene_Think =
void() script_sound_play =
{
if (self.noise != "")
- sound (other, CHAN_AUTO, self.noise, 1, ATTN_NONE);
+ sound (other, CHAN_AUTO, self.noise, VOL_HIGH, ATTN_NONE);
else
- sound (other, CHAN_AUTO, self.noise1, 1, ATTN_NONE);
+ sound (other, CHAN_AUTO, self.noise1, VOL_HIGH, ATTN_NONE);
};

/*QUAKED info_script_sound (.5 .5 .5) (-8 -8 -8) (8 8 32) 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

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

Diff qc/defs_builtins.qc

diff --git a/qc/defs_builtins.qc b/qc/defs_builtins.qc
index 386b875..95ed7c5 100644
--- a/qc/defs_builtins.qc
+++ b/qc/defs_builtins.qc
@@ -433,7 +433,17 @@ void(entity ent, entity ignore) tracetoss = #64;

// Part of FRIK_FILE, FTE_QC_INFOKEY, FTE_STRINGS, QW_ENGINE, ZQ_QC_STRINGS
float(string) stof = #81;
+#endif

+#ifdef SSQC
+// Part of FTE_QC_MULTICAST -- copied from fteextensions.qc -- CEV
+// Once the MSG_MULTICAST network message buffer has been filled with data,
+// this builtin is used to dispatch it to the given target, filtering by
+// pvs for reduced network bandwidth.
+void(vector where, float set) multicast = #82;
+#endif
+
+#if defined(CSQC) || defined(SSQC)
// Part of DP_QC_TRACEBOX -- copied from fteextensions.qc -- CEV
// Exactly like traceline, but a box instead of a uselessly thin point.
// Acceptable sizes are limited by bsp format, q1bsp has strict acceptable
@@ -512,6 +522,17 @@ string(float ccase, float redalpha, float redchars, string str, ...)
strconv = #224;
#endif

+#ifdef SSQC
+// Specifies what data to use in order to send various stats, in a
+// client-specific way.
+// 'num' should be a value between 32 and 127, other values are reserved.
+// 'type' must be set to one of the EV_* constants, one of EV_FLOAT,
+// EV_STRING, EV_INTEGER, EV_ENTITY.
+// fld must be a reference to the field used, each player will be sent
+// only their own copy of these fields.
+void(float num, float type, .__variant fld) clientstat = #232;
+#endif
+
#if defined(CSQC) || defined(SSQC)
// copied from fteextensions.qc -- CEV
float(float dividend, float divisor) mod = #245;
@@ -563,6 +584,19 @@ float(float property, ...) setproperty = #303;
void() renderscene = #304;

// copied from fteextensions.qc -- CEV
+// Adds a temporary dlight, ready to be drawn via addscene.
+// Cubemap orientation will be read from v_forward/v_right/v_up.
+float(vector org, float radius, vector lightcolours, optional float style,
+ optional string cubemapname, optional float pflags)
+ dynamiclight_add = #305;
+
+// copied from fteextensions.qc -- CEV
+// Retrieve a currently-set (typically view) property, allowing you to
+// read the current viewport or other things. Due to cheat protection,
+// certain values may be unretrievable.
+__variant(float property) getproperty = #309;
+
+// copied from fteextensions.qc -- CEV
// Forces the engine to load the named image. If trywad is specified,
// the specified name must any lack path and extension.
string(string name, optional float trywad) precache_pic = #317;
@@ -651,6 +685,18 @@ float(float stnum, optional float firstbit, optional float bitcount)
// chars (yes, really. 15.), but FTE Quake uses a separate namespace for
// string stats and has a much higher length limit.
string(float stnum) getstats = #332;
+
+// copied from fteextension.qc -- CEV
+// Sets a model by precache index instead of by name. Otherwise identical
+// to setmodel.
+void(entity e, float mdlindex) setmodelindex = #333;
+#endif
+
+#ifdef CSQC
+// copied from fteextension.qc -- CEV
+// Retrieves the name of the model based upon a precache index.
+// This can be used to reduce csqc network traffic by enabling model matching.
+string(float mdlindex) modelnameforindex = #334;
#endif

#if defined(CSQC) || defined(SSQC)
@@ -741,6 +787,18 @@ string(string key) serverkey = #354;

#ifdef CSQC
// copied from fteextensions.qc -- CEV
+// Grab the next token in the map's entity lump.
+// If resetstring is not specified, the next token will be returned
+// with no other sideeffects.
+// If empty, will reset from the map before returning the first
+// token, probably {.
+// If not empty, will tokenize from that string instead.
+// Always returns tempstrings.
+string(optional string resetstring) getentitytoken = #355;
+#endif
+
+#ifdef CSQC
+// copied from fteextensions.qc -- CEV
float() ReadByte = #360;
float() ReadChar = #361;
float() ReadShort = #362;
@@ -762,10 +820,21 @@ float(string modelname, float(float isnew) updatecallback, float flags)
#endif

#if defined(CSQC) || defined(SSQC)
+// copied from fteextensions.qc -- CEV
+// Part of DP_QC_COPYENTITY Copies all fields from one entity to another.
+entity(entity from, optional entity to) copyentity = #400;
+#endif
+
+#if defined(CSQC) || defined(SSQC)
// Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS
// copied from fteextensions.qc -- CEV
+void(vector org, optional float count) te_gunshot = #418;
void(entity own, vector start, vector end) te_lightning2 = #429;

+// Part of DP_QC_GETSURFACE
+string(entity e, float s) getsurfacetexture = #437;
+float(entity e, vector p) getsurfacenearpoint = #438;
+
// Part of KRIMZON_SV_PARSECLIENTCOMMAND -- copied from fteextensions.qc -- CEV
void(entity e, string s) clientcommand = #440;
float(string s) tokenize = #441;
@@ -783,6 +852,14 @@ float(float a) tan = #475;
#endif

#ifdef CSQC
+// Looks up fields from non-csqc-visible entities. The entity will need to
+// be within the player's pvs. fieldnum should be one of the GE_ constants.
+__variant(float entnum, float fieldnum) getentity = #504;
+
+float(entity ent) num_for_edict = #512;
+#endif
+
+#ifdef CSQC
// copied from fteextensions.qc -- CEV
// Tokenize a string exactly as the console's tokenizer would do so.
// The regular tokenize builtin became bastardized for convienient string
@@ -812,3 +889,14 @@ vector(vector v1, vector v2) crossproduct = #0:crossproduct;
// otherwise equivalent).
void(float buf, int fl) WriteInt = #0:WriteInt;
#endif
+
+#if defined(CSQC) || defined(SSQC)
+// Version of serverkey that returns the value as a float (which avoids
+// tempstrings). -- comment from fteextensions.qc
+float(string key, optional float assumevalue)
+ serverkeyfloat = #0:serverkeyfloat;
+#endif
+
+#if defined(CSQC) || defined(SSQC)
+float(entity pusher, vector move, vector amove) pushmove = #0:pushmove;
+#endif

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

Diff qc/defs_const.qc

diff --git a/qc/defs_const.qc b/qc/defs_const.qc
index db4138b..6c73c04 100644
--- a/qc/defs_const.qc
+++ b/qc/defs_const.qc
@@ -2,6 +2,8 @@
// Global Program Constants
//==============================================================================

+#pragma target FTE
+
//======================================================================
// constants
//======================================================================
@@ -47,6 +49,11 @@ const float SOLID_TRIGGER = 1; // touch on edge, but not blocking
const float SOLID_BBOX = 2; // touch on edge, block
const float SOLID_SLIDEBOX = 3; // touch on edge, but not an onground
const float SOLID_BSP = 4; // bsp clip, touch on edge, block
+// Non-solid to SOLID_SLIDEBOX or other SOLID_CORPSE entities. For hitscan
+// weapons to hit corpses, change the player's .solid value to
+// SOLID_BBOX or so, perform the traceline, then revert the player's
+// .solid value.
+const float SOLID_CORPSE = 5;

// the following block from fteextensions.qc was originally ifdef CSQC;
// I've removed that check because these are just constants -- CEV
@@ -84,6 +91,7 @@ const float STAT_PUNCHANGLE_Y = 27;
const float STAT_PUNCHANGLE_Z = 28;
// Custom user stats start here (lower values are reserved for engine use).
// const float STAT_USER = 32;
+const float STAT_PLAYERSPEED = 33; // player's horizontal speed -- CEV

const float IT_AXE = 4096; // .items flag values
const float IT_SHOTGUN = 1; // this is pretty much maxed out at
@@ -142,6 +150,7 @@ const float SVC_FINALE = 31;
const float SVC_CDTRACK = 32;
const float SVC_SELLSCREEN = 33;
const float SVC_CUTSCENE = 34; // Hipnotic Drake devkit -- dumptruck_ds
+const float SVC_CGAMEPACKET = 83; // FTE CSQC_Parse_Event -- CEV

const float TE_SPIKE = 0; // temporary entity protocol bytes
const float TE_SUPERSPIKE = 1;
@@ -157,18 +166,27 @@ const float TE_LAVASPLASH = 10;
const float TE_TELEPORT = 11;
const float TE_EXPLOSION2 = 12; // from doe -- dumptruck_ds

+const float ATTN_NONE = 0; // sound attenuation; no attenuation
+const float ATTN_NORM = 1; // standard attenuation
+const float ATTN_IDLE = 2; // extra attenuation
+const float ATTN_FEET = 2;
+const float ATTN_STATIC = 3; // even more attn. (good for torches)
+
const float CHAN_AUTO = 0; // sound channels; 0 never overrides
const float CHAN_WEAPON = 1; // 1-7 always override a sound on that
const float CHAN_VOICE = 2; // channel
const float CHAN_ITEM = 3;
const float CHAN_BODY = 4;
const float CHAN_FEET = 5; // dedicated channel for steps -- CEV
+const float CHAN_SLIDE = 6; // dedicated channel for steps -- CEV

-const float ATTN_NONE = 0; // sound attenuation; no attenuation
-const float ATTN_NORM = 1; // standard attenuation
-const float ATTN_IDLE = 2; // extra attenuation
-const float ATTN_FEET = 2;
-const float ATTN_STATIC = 3; // even more attn. (good for torches)
+const float VOL_MAX = 1.0; // sound volume: maximum
+const float VOL_HIGH = 0.9; // sound volume: high
+const float VOL_MHI = 0.7; // sound volume: medium-high
+const float VOL_MID = 0.5; // sound volume: middle
+const float VOL_LOW = 0.25; // low volume; ambient sounds
+const float VOL_MIN = 0.1; // minimal volume
+const float VOL_SILENT = 0.0; // silent

const float EF_BRIGHTFIELD = 1; // entity .effects values
const float EF_MUZZLEFLASH = 2;
@@ -186,6 +204,15 @@ const float MSG_INIT = 3; // write to the init string
const float MSG_MULTICAST = 4;
const float MSG_ENTITY = 5; // used only in 'SendEntity' functions

+const float MULTICAST_ALL = 0; // unreliable to all players
+const float MULTICAST_PHS = 1; // unreliable to players that can hear
+const float MULTICAST_PVS = 2; // unreliable to players that can see
+const float MULTICAST_ONE = 6; // unreliable to msg_entity global
+const float MULTICAST_ALL_R = 3; // reliable to all players
+const float MULTICAST_PHS_R = 4; // reliable to players that can hear
+const float MULTICAST_PVS_R = 5; // reliable to players that can see
+const float MULTICAST_ONE_R = 7; // reliable to msg_entity global
+
const float TRIGGER_CENTERPRINTALL = 1048576; // program-wide spawnflags
const float SPAWN_SILENTLY = 2097152;

@@ -215,6 +242,54 @@ const float EV_FUNCTION = 6;
const float EV_POINTER = 7;
const float EV_INTEGER = 8;

+const float INPUT_BUTTON0 = 1<<0; // attack 1
+// const float INPUT_BUTTON1 = 0; // not supported by the network protocol
+const float INPUT_BUTTON2 = 1<<1; // jump
+const float INPUT_BUTTON3 = 1<<2; //
+const float INPUT_BUTTON4 = 1<<3; //
+const float INPUT_BUTTON5 = 1<<4; //
+const float INPUT_BUTTON6 = 1<<5; //
+const float INPUT_BUTTON7 = 1<<6; //
+const float INPUT_BUTTON8 = 1<<7; // crouch
+
+enum
+{
+ EVENT_INTERMISSION, // SVC_CGAMEPACKET flags
+ EVENT_CSHIFT_FADE, // csf_fade
+ EVENT_CSHIFT_SET // csf_set
+};
+
+#ifdef SSQC
+// The sound will be sent reliably, and without regard to phs.
+const float SOUNDFLAG_RELIABLE = 1;
+#endif
+#ifdef CSQC
+// The sample's volume is not scaled by the volume cvar. Use with caution
+const float SOUNDFLAG_ABSVOLUME = 16;
+#endif
+#if defined(CSQC) || defined(SSQC)
+// The sound will restart once it reaches the end of the sample.
+const float SOUNDFLAG_FORCELOOP = 2;
+#endif
+#ifdef CSQC
+// The different audio channels are played at the same volume regardless of
+// which way the player is facing, without needing to use 0 attenuation.
+const float SOUNDFLAG_NOSPACIALISE = 4;
+#endif
+#if defined(CSQC) || defined(SSQC)
+// Disables the use of underwater/reverb effects on this sound effect.
+const float SOUNDFLAG_NOREVERB = 32;
+// The sound's origin will updated to follow the emitting entity.
+const float SOUNDFLAG_FOLLOW = 64;
+#endif
+#ifdef SSQC
+// The sound will be heard only by the player specified by msg_entity.
+const float SOUNDFLAG_UNICAST = 256;
+// The entity's current velocity will be sent to the client, only useful
+// if doppler is enabled.
+const float SOUNDFLAG_SENDVELOCITY = 512;
+#endif
+
#ifdef CSQC
//----------------------------------------------------------------------
// Valid as a return value from the predraw function. Returning this will
@@ -227,9 +302,20 @@ const float PREDRAW_NEXT = 1;
//----------------------------------------------------------------------
// These constants are only used in CSQC_UpdateView
//----------------------------------------------------------------------
-const float MASK_ENGINE = 1;
-const float MASK_VIEWMODEL = 2;
-const float MASK_NORMAL = 4;
+const float DRAWMASK_NONE = 0;
+const float DRAWMASK_ENGINE = 1;
+const float DRAWMASK_VIEWMODEL = 2;
+const float DRAWMASK_NORMAL = 4;
+
+// Valid as a return value from the predraw function. Returning this will
+// cause the engine to automatically invoke addentity(self) for you.
+const float PREDRAW_AUTOADD = 0;
+
+// Valid as a return value from the predraw function. Returning this will
+// simply move on to the next entity without the autoadd behaviour, so can
+// be used for particle/invisible/special entites, or entities that were
+// explicitly drawn with addentity.
+const float PREDRAW_NEXT = 1;

//----------------------------------------------------------------------
const float VF_MIN = 1;
@@ -251,7 +337,8 @@ const float VF_CL_VIEWANGLES_Y = 35;
const float VF_CL_VIEWANGLES_Z = 36;
const float VF_VIEWENTITY = 206;

-enumflags {
+enumflags
+{
RF_VIEWMODEL,
RF_EXTERNALMODEL,
RF_DEPTHHACK,
@@ -260,3 +347,147 @@ enumflags {
RF_NOSHADOW
};
#endif
+
+#if defined(CSQC) || defined(SSQC)
+// Associated RT lights attached will not cast shadows, making them
+// significantly faster to draw.
+const float PFLAGS_NOSHADOW = 1;
+// Enables support of coronas on the associated rtlights.
+const float PFLAGS_CORONA = 2;
+#endif
+
+#if defined(CSQC) || defined(SSQC)
+enum
+{
+ SURFACE_UNKNOWN, // surface types -- CEV
+ SURFACE_DIRT,
+ SURFACE_GRASS,
+ SURFACE_METAL,
+ SURFACE_STONE, // the default type (in most cases)
+ SURFACE_WOOD,
+ SURFACE_WATER,
+ SURFACE_WADING
+};
+#endif
+
+#ifdef CSQC
+// The address of the server we connected to
+const string SERVERKEY_IP = "ip";
+// The hostname that was last passed to the connect command
+const string SERVERKEY_SERVERNAME = "servername";
+// The current connection state. Will be set to one of:
+// disconnected (menu-only mode),
+// active (gamestate received and loaded),
+// connecting (connecting, downloading, or precaching content)
+const string SERVERKEY_CONSTATE = "constate";
+// Set to the hostname of the server that we are attempting to
+// connect or transfer to.
+const string SERVERKEY_TRANSFERRING = "transferring";
+// loadstage, loading image name, current step, max steps
+// Stages are: 1=connecting, 2=serverside, 3=clientside
+// Key will be empty if we are not loading.
+const string SERVERKEY_LOADSTATE = "loadstate";
+// 1 if the server claimed to be paused. 0 otherwise
+const string SERVERKEY_PAUSESTATE = "pausestate";
+// The progress of any current downloads. Empty string if no download is
+// active, otherwise a tokenizable string containing this info:
+// files-remaining, total-size, unknown-sizes-flag, file-localname,
+// file-remotename, file-percent, file-rate, file-received-bytes,
+// file-total-bytes
+// If the current file info is omitted, then we are waiting for a
+// download to start.
+const string SERVERKEY_DLSTATE = "dlstate";
+// The protocol we are connected to the server with.
+const string SERVERKEY_PROTOCOL = "protocol";
+// The number of player/spectator slots allocated on the server.
+const string SERVERKEY_MAXPLAYERS = "maxplayers";
+#endif
+
+#ifdef CSQC
+// Valid for getentity, ignores the entity argument. Returns the maximum
+// number of entities which may be valid, to avoid having to poll 65k
+// when only 100 are used.
+const float GE_MAXENTS = -1;
+// Valid for getentity. Returns whether this entity is known to the client
+// or not.
+const float GE_ACTIVE = 0;
+// Valid for getentity. Returns the interpolated .origin.
+const float GE_ORIGIN = 1;
+// Valid for getentity. Returns the interpolated forward vector.
+const float GE_FORWARD = 2;
+// Valid for getentity. Returns the entity's right vector.
+const float GE_RIGHT = 3;
+// Valid for getentity. Returns the entity's up vector.
+const float GE_UP = 4;
+// Valid for getentity. Returns the entity .scale.
+const float GE_SCALE = 5;
+// Valid for getentity. Returns interpolated .origin, but also sets
+// v_forward, v_right, and v_up accordingly. Use vectoangles(v_forward,v_up)
+// to determine the angles.
+const float GE_ORIGINANDVECTORS = 6;
+// Valid for getentity. Returns the entity alpha.
+const float GE_ALPHA = 7;
+// Valid for getentity. Returns the colormod vector.
+const float GE_COLORMOD = 8;
+// Valid for getentity. Returns the entity's lower color (from .colormap),
+// as a palette range value.
+const float GE_PANTSCOLOR = 9;
+// Valid for getentity. Returns the entity's lower color (from .colormap),
+// as a palette range value.
+const float GE_SHIRTCOLOR = 10;
+// Valid for getentity. Returns the entity's .skin index.
+const float GE_SKIN = 11;
+// Valid for getentity. Guesses the entity's .min vector.
+const float GE_MINS = 12;
+// Valid for getentity. Guesses the entity's .max vector.
+const float GE_MAXS = 13;
+// Valid for getentity. Guesses the entity's .absmin vector.
+const float GE_ABSMIN = 14;
+// Valid for getentity. Guesses the entity's .absmax vector.
+const float GE_ABSMAX = 15;
+// Valid for getentity. Guesses the entity's .modelindex float.
+const float GE_MODELINDEX = 200;
+// Valid for getentity. Guesses the entity's .vw_index float.
+const float GE_MODELINDEX2 = 201;
+// Valid for getentity. Guesses the entity's .effects float.
+const float GE_EFFECTS = 202;
+// Valid for getentity. Guesses the entity's .frame float.
+const float GE_FRAME = 203;
+// Valid for getentity. Guesses the entity's .angles vector.
+const float GE_ANGLES = 204;
+// Valid for getentity. Guesses the entity's .fatness float.
+const float GE_FATNESS = 205;
+// Valid for getentity. Guesses the entity's .drawflags float.
+const float GE_DRAWFLAGS = 206;
+// Valid for getentity. Guesses the entity's .abslight float.
+const float GE_ABSLIGHT = 207;
+// Valid for getentity. Guesses the entity's .glowmod vector.
+const float GE_GLOWMOD = 208;
+// Valid for getentity. Guesses the entity's .glowsize float.
+const float GE_GLOWSIZE = 209;
+// Valid for getentity. Guesses the entity's .glowcolor float.
+const float GE_GLOWCOLOUR = 210;
+// Valid for getentity. Guesses the entity's .style float.
+const float GE_RTSTYLE = 211;
+// Valid for getentity. Guesses the entity's .pflags float.
+const float GE_RTPFLAGS = 212;
+// Valid for getentity. Guesses the entity's .color vector.
+const float GE_RTCOLOUR = 213;
+// Valid for getentity. Guesses the entity's .light_lev float.
+const float GE_RTRADIUS = 214;
+// Valid for getentity. Guesses the entity's .tag_entity float.
+const float GE_TAGENTITY = 215;
+// Valid for getentity. Guesses the entity's .tag_index float.
+const float GE_TAGINDEX = 216;
+// Valid for getentity. Guesses the entity's .gravitydir vector.
+const float GE_GRAVITYDIR = 217;
+// Valid for getentity. Guesses the entity's .traileffectnum float.
+const float GE_TRAILEFFECTNUM = 218;
+#endif
+
+#ifdef CSQC
+const float RSES_NOLERP = 1;
+const float RSES_NOROTATE = 2;
+const float RSES_NOTRAILS = 4;
+const float RSES_NOLIGHTS = 8;
+#endif

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

Diff qc/defs_ctypes.qc

diff --git a/qc/defs_ctypes.qc b/qc/defs_ctypes.qc
index 662008c..7982cc5 100644
--- a/qc/defs_ctypes.qc
+++ b/qc/defs_ctypes.qc
@@ -6,17 +6,22 @@
// fields
//======================================================================

+#if defined(CSQC) || defined(SSQC)
.float classgroup; // used to identify base classes
.float classtype; // used to identify an entity's type
+#endif
+
+//======================================================================
+// constants
+//======================================================================

//----------------------------------------------------------------------
// classtype list; shared by client & server
//----------------------------------------------------------------------
+#if defined(CSQC) || defined(SSQC)
enum
{
CT_WORLD, // world entity
-
- // monsters
CT_PLAYER, // player (client)

// info
@@ -67,23 +72,23 @@ enum
CT_FUNC_TRAIN, // id1 train
CT_FUNC_WALL, // func_wall

- // gibs
- CT_GORE_HEAD, // deadstuff
- CT_GORE_HEAD_ARMY, //
- CT_GORE_HEAD_DEMON, //
- CT_GORE_HEAD_DOG, //
- CT_GORE_HEAD_ENFORCER, //
- CT_GORE_HEAD_HELL_KNIGHT, //
- CT_GORE_HEAD_KNIGHT, //
- CT_GORE_HEAD_OGRE, //
- CT_GORE_HEAD_PLAYER, //
- CT_GORE_HEAD_SHALRATH, //
- CT_GORE_HEAD_SHAMBLER, //
- CT_GORE_HEAD_WIZARD, //
- CT_GORE_HEAD_ZOMBIE, //
- CT_GORE_GIB1, //
- CT_GORE_GIB2, //
- CT_GORE_GIB3, //
+ // corpses, gibs
+ CT_GORE_HEAD, //
+ CT_GORE_HEAD_ARMY, // deadstuff
+ CT_GORE_HEAD_DEMON, // deadstuff
+ CT_GORE_HEAD_DOG, // deadstuff
+ CT_GORE_HEAD_ENFORCER, // deadstuff
+ CT_GORE_HEAD_HELL_KNIGHT, // deadstuff
+ CT_GORE_HEAD_KNIGHT, // deadstuff
+ CT_GORE_HEAD_OGRE, // deadstuff
+ CT_GORE_HEAD_PLAYER, // deadstuff
+ CT_GORE_HEAD_SHALRATH, // deadstuff
+ CT_GORE_HEAD_SHAMBLER, // deadstuff
+ CT_GORE_HEAD_WIZARD, // deadstuff
+ CT_GORE_HEAD_ZOMBIE, // deadstuff
+ CT_GORE_GIB1, // id1
+ CT_GORE_GIB2, // id1
+ CT_GORE_GIB3, // id1

// hazards
CT_HAZARD_LTRAIL_START, // DOE lightning trail
@@ -277,16 +282,19 @@ enum
CT_TEMP_SPARK, // misc_sparks
CT_TEMP_WIZARDSPELL // id1 wizard spell (spawns missiles)
};
+#endif

//----------------------------------------------------------------------
// classgroups, defined as needed; I did not want to do this -- CEV
// go no higher than 24 bits (according to the FTEQCC manual) -- CEV
-// current count: 16 -- CEV
+// current count: 17 -- CEV
//----------------------------------------------------------------------
+#if defined(CSQC) || defined(SSQC)
enumflags
{
CG_TEMPENTITY, // temporary entities
CG_MAPENTITY, // mapper-placeable entities
+ CG_CORPSE, // corpses, gibs, heads
CG_FUNC, // func_*
CG_FUNC_ROTATE, // rotation objects
CG_ITEM, // items
@@ -302,3 +310,4 @@ enumflags
CG_PROJECTILE, // missiles & projectiles
CG_TRIGGER // trigger_*
};
+#endif

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

Diff qc/func/bob.qc

diff --git a/qc/func/bob.qc b/qc/func/bob.qc
index cad3032..16ef734 100644
--- a/qc/func/bob.qc
+++ b/qc/func/bob.qc
@@ -6,41 +6,52 @@
// Constants
//======================================================================

+#ifdef SSQC
const float BOB_STYLE_START_OFF = 1; // start off
const float BOB_COLLISION = 2; // Collision for misc_bob
const float BOB_NONSOLID = 4; // Non solid for func_bob
+#endif

//======================================================================
// fields
//======================================================================
+
+#ifdef SSQC
.float bsporigin; // bmodel origins are 0,0,0; check first
.float waitmin2;
+#endif

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

// base_func_bob
+#ifdef SSQC
void() base_func_bob_on;
void() base_func_bob_off;
void() base_func_bob_think_timer;
void(entity e) base_func_bob_init;
strip void() base_func_bob;
+#endif

// func_bob
+#ifdef SSQC
void(entity e) func_bob_init;
void() func_bob;
+#endif

// misc_bob
+#ifdef SSQC
void(entity e) misc_bob_init;
void() misc_bob;
+#endif

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

//----------------------------------------------------------------------
// class base_func_bob: base_func
// {
-
+#ifdef SSQC
//--------------------------------------------------------------
void() base_func_bob_on =
{
@@ -201,6 +212,7 @@ void() misc_bob;
{
base_func_bob_init (self);
};
+#endif
// };

/*QUAKED func_bob (0 .5 .8) 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
@@ -227,6 +239,7 @@ A SOLID bmodel that gently moves back and forth
//----------------------------------------------------------------------
// class func_bob: base_func_bob
// {
+#ifdef SSQC
//--------------------------------------------------------------
void(entity e) func_bob_init =
{
@@ -244,6 +257,7 @@ A SOLID bmodel that gently moves back and forth

func_bob_init (self);
};
+#endif
// };

/*QUAKED misc_bob (0 0.5 0.8) (-8 -8 -8) (8 8 8) X BOB_COLLISION BOB_NONSOLID 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
@@ -255,6 +269,7 @@ Same as func_bob but uses a custom model instead of a brush. Use the mdl key to
//----------------------------------------------------------------------
// class misc_bob: base_func_bob
// {
+#ifdef SSQC
//--------------------------------------------------------------
void(entity e) misc_bob_init =
{
@@ -278,4 +293,5 @@ Same as func_bob but uses a custom model instead of a brush. Use the mdl key to

misc_bob_init (self);
};
+#endif
// };

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

Diff qc/func/bossgate.qc

diff --git a/qc/func/bossgate.qc b/qc/func/bossgate.qc
index 0dddf4f..a66d8ee 100644
--- a/qc/func/bossgate.qc
+++ b/qc/func/bossgate.qc
@@ -6,16 +6,20 @@
// Constants
//======================================================================

+#ifdef SSQC
// For func_episodegate and func_bossgate appear when player has all runes
const float BOSSGATE_REVERSE = 16;
+#endif

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

// func_bossgate
+#ifdef SSQC
void(entity e) func_bossgate_init;
void() func_bossgate;
+#endif

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

@@ -25,6 +29,7 @@ This bmodel appears unless players have all of the episode sigils.
//----------------------------------------------------------------------
// class func_bossgate: base_func_wall
// {
+#ifdef SSQC
//--------------------------------------------------------------
void(entity e) func_bossgate_init =
{
@@ -65,4 +70,5 @@ This bmodel appears unless players have all of the episode sigils.

func_bossgate_init (self);
};
+#endif
// };

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

Diff qc/func/breakable.qc

diff --git a/qc/func/breakable.qc b/qc/func/breakable.qc
index 616db69..07a98d1 100644
--- a/qc/func/breakable.qc
+++ b/qc/func/breakable.qc
@@ -6,16 +6,19 @@
// constants
//======================================================================

+#ifdef SSQC
const float BREAKABLE_NO_MONSTERS = 1;
const float BREAK_EXPLODE = 2;
const float BREAK_CUSTOM = 4;

const float BREAKABLE_NO_MONSTERS = 1;
+#endif

//======================================================================
// fields
//======================================================================

+#ifdef SSQC
.float brk_obj_count1;
.float brk_obj_count2;
.float brk_obj_count3;
@@ -29,12 +32,14 @@ const float BREAKABLE_NO_MONSTERS = 1;
.string break_template5;

.string mdl_debris; // dumptruck_ds
+#endif

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

// base_breakable
+#ifdef SSQC
void() sub_dislodge_resting_entities;
void(vector dir, string templatename) base_breakable_template_single_debris;
void(vector dir) base_breakable_single_debris;
@@ -46,10 +51,13 @@ void() base_breakable_use;
void(entity e) base_breakable_template_setup;
void(entity e) base_breakable_init;
void() base_breakable;
+#endif

// func_breakable
+#ifdef SSQC
void(entity e) func_breakable_init;
void() func_breakable;
+#endif

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

@@ -58,6 +66,7 @@ void() func_breakable;
//----------------------------------------------------------------------
// class base_breakable: base_func
// {
+#ifdef SSQC
//--------------------------------------------------------------
// SUB_DislodgeRestingEntities
// This clears the FL_ONGROUND flag from any entities that are on
@@ -250,7 +259,8 @@ void() func_breakable;
// ent.ltime = time;
ent.nextthink = time + 60;

- sound (ent, CHAN_AUTO, self.noise1, 1, ATTN_NORM);
+ sound (ent, CHAN_AUTO, self.noise1,
+ VOL_HIGH, ATTN_NORM);
// remove (self);
}

@@ -277,7 +287,8 @@ void() func_breakable;

// this is broken as of 1.1.0 no custom explosion
// sound for now -- dumptruck_ds
- // sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
+ // sound (self, CHAN_VOICE, self.noise2,
+ // VOL_HIGH, ATTN_NORM);
remove (self);
}
else
@@ -351,6 +362,7 @@ void() func_breakable;
{
base_breakable_init (self);
};
+#endif
// };

/*QUAKED func_breakable (0 .5 .8) ? NO_MONSTERS 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
@@ -420,6 +432,7 @@ brk_obj_count5(integer) : "Template 5 spawn count"
//----------------------------------------------------------------------
// class func_breakable: base_breakable
// {
+#ifdef SSQC
//--------------------------------------------------------------
void(entity e) func_breakable_init =
{
@@ -546,4 +559,5 @@ brk_obj_count5(integer) : "Template 5 spawn count"

func_breakable_init (self);
};
+#endif
// };

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

Diff qc/func/brush.qc

diff --git a/qc/func/brush.qc b/qc/func/brush.qc
index 55a1de6..cd912d4 100644
--- a/qc/func/brush.qc
+++ b/qc/func/brush.qc
@@ -10,21 +10,25 @@
// constants
//======================================================================

+#if 0
const float BRUSH_START_INVISIBLE = 1;
const float BRUSH_START_NONSOLID = 2;
const float BRUSH_START_ALTFRAMES = 4;
const float BRUSH_TOGGLE_VISIBILITY = 8;
const float BRUSH_TOGGLE_SOLIDITY = 16;
const float BRUSH_TOGGLE_FRAMES = 32;
+#endif

//======================================================================
// fields
//======================================================================

-/*
+#if 0
.float solidstate;
.float visiblestate;
-*/
+#endif
+
+//------------------------------------------------------------------------------

#if 0
//----------------------------------------------------------------------

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

Diff qc/func/button.qc

diff --git a/qc/func/button.qc b/qc/func/button.qc
index 4d79c87..501a323 100644
--- a/qc/func/button.qc
+++ b/qc/func/button.qc
@@ -7,6 +7,7 @@
//======================================================================

// func_button
+#ifdef SSQC
void() func_button_think_wait;
void() func_button_think_done;
void() func_button_think_return;
@@ -19,6 +20,7 @@ void(entity b) func_button_lock;
void(entity b, float dontresetstate) func_button_unlock;
void(entity e) func_button_init;
void() func_button;
+#endif

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

@@ -40,6 +42,7 @@ When a button is touched, it moves some distance in the direction of it's angle,
//----------------------------------------------------------------------
// class func_button: base_func
// {
+#ifdef SSQC
//--------------------------------------------------------------
void() func_button_think_wait =
{
@@ -94,7 +97,7 @@ When a button is touched, it moves some distance in the direction of it's angle,
if (self.state == FUNC_STATE_UP || self.state == FUNC_STATE_TOP)
return;

- sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise, VOL_MID, ATTN_NORM);

self.state = FUNC_STATE_UP;
sub_calcmove (self, self.pos2, self.speed,
@@ -255,4 +258,5 @@ When a button is touched, it moves some distance in the direction of it's angle,

func_button_init (self);
};
+#endif
// };

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

Diff qc/func/counter.qc

diff --git a/qc/func/counter.qc b/qc/func/counter.qc
index 7bf6a39..e82a780 100644
--- a/qc/func/counter.qc
+++ b/qc/func/counter.qc
@@ -12,6 +12,7 @@
// constants
//======================================================================

+#ifdef SSQC
const float COUNTER_TOGGLE = 1;
const float COUNTER_LOOP = 2;
const float COUNTER_STEP = 4;
@@ -19,12 +20,14 @@ const float COUNTER_RESET = 8;
const float COUNTER_RANDOM = 16;
const float COUNTER_FINISHCOUNT = 32;
const float COUNTER_START_ON = 64;
+#endif

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

// func_counter
+#ifdef SSQC
void() func_counter_think_starton;
void() func_counter_think;
void() func_counter_use_on;
@@ -32,11 +35,14 @@ void() func_counter_use_off;
float(entity e) func_counter_getcount;
void(entity e) func_counter_init;
void() func_counter;
+#endif

// func_oncount
+#ifdef SSQC
void() func_oncount_use;
void(entity e) func_oncount_init;
void() func_oncount;
+#endif

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

@@ -70,6 +76,7 @@ it specifies how high to count before reseting to zero. Default is 10.
//----------------------------------------------------------------------
// class func_counter: base_func
// {
+#ifdef SSQC
//--------------------------------------------------------------
void() func_counter_think_starton =
{
@@ -210,6 +217,7 @@ it specifies how high to count before reseting to zero. Default is 10.

func_counter_init (self);
};
+#endif
// };

/*QUAKED func_oncount (0 0 0.5) (0 0 0) (16 16 16)
@@ -223,6 +231,7 @@ reaches the value set by count, func_oncount triggers its targets.
//----------------------------------------------------------------------
// class func_oncount: base_func
// {
+#ifdef SSQC
//--------------------------------------------------------------
void() func_oncount_use =
{
@@ -260,4 +269,5 @@ reaches the value set by count, func_oncount triggers its targets.

func_oncount_init (self);
};
+#endif
// };

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

Diff qc/func/door.qc

diff --git a/qc/func/door.qc b/qc/func/door.qc
index 6cc66a2..7e8e385 100644
--- a/qc/func/door.qc
+++ b/qc/func/door.qc
@@ -16,31 +16,41 @@
// constants
//======================================================================

+#ifdef SSQC
const float DOOR_START_OPEN = 1; // spawnflags
const float DOOR_DONT_LINK = 4;
const float DOOR_GOLD_KEY = 8;
const float DOOR_SILVER_KEY = 16;
const float DOOR_TOGGLE = 32;
const float DOOR_DOOM_STYLE_UNLOCK = 64;
+#endif

//======================================================================
// fields
//======================================================================

+#ifdef SSQC
.float last_setstate_frame = light_lev;
.entity last_setstate = aiment;
+#endif

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

+#ifdef SSQC
// temp_door_trigger
void() temp_door_trigger_touch;
entity(entity own, vector nmins, vector nmaxs) spawn_temp_door_trigger;
void(entity e) temp_door_trigger_init;
strip void() temp_door_trigger;
+#endif

// func_door
+#ifdef CSQC
+void(float isnew) func_door_netreceive;
+#endif
+#ifdef SSQC
float(entity e1, entity e2) func_door_entities_touching;
void() func_door_blocked;
void() func_door_hit_top;
@@ -57,11 +67,17 @@ void() func_door_touch;
void(entity e, float closealldoors) func_door_estate_lock;
void(entity e, float openalldoors) func_door_estate_unlock;
void() func_door_think_link;
+#endif
+#if defined(CSQC) || defined(SSQC)
void(entity e) func_door_init;
+#endif
+#ifdef SSQC
void() func_door;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// class temp_door_trigger: base_tempentity
// {
@@ -120,6 +136,7 @@ void() func_door;
temp_door_trigger_init (self);
};
// };
+#endif

/*QUAKED func_door (0 .5 .8) ? START_OPEN x DOOR_DONT_LINK GOLD_KEY SILVER_KEY TOGGLE 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

@@ -155,6 +172,47 @@ Key doors are always wait -1.
//----------------------------------------------------------------------
// class func_door: base_func
// {
+#ifdef CSQC
+ //--------------------------------------------------------------
+ void(float isnew) func_door_netreceive =
+ {
+ local float netflags = ReadFloat ();
+ base_func_netreceive_read (isnew, netflags);
+
+ if (isnew)
+ func_door_init (self);
+
+ if (netflags & BASE_FUNC_NET_VELOCITY)
+ {
+ if (self.velocity != self.velocity_net)
+ {
+ if (self.velocity)
+ {
+ self.origin_start = self.origin;
+ self.movetime = time;
+ }
+ else
+ {
+ self.movetime = 0;
+ }
+ }
+ }
+
+ self.origin_net = self.origin;
+ self.velocity_net = self.velocity;
+
+ if (netflags & BASE_FUNC_NET_MODEL)
+ setmodelindex (self, self.modelindex);
+
+ if (netflags & BASE_FUNC_NET_SIZE)
+ setsize (self, self.mins, self.maxs);
+
+ if (netflags & BASE_FUNC_NET_ORIGIN)
+ setorigin (self, self.origin);
+ };
+#endif
+
+#ifdef SSQC
//--------------------------------------------------------------
float(entity e1, entity e2) func_door_entities_touching =
{
@@ -195,7 +253,15 @@ Key doors are always wait -1.
return;
}

- t_damage2 (other, self, self, self.dmg);
+ if (other.classgroup & CG_CORPSE &&
+ other.takedamage >= DAMAGE_YES)
+ {
+ t_damage2 (other, self, self, self.dmg * 10);
+ }
+ else
+ {
+ t_damage2 (other, self, self, self.dmg);
+ }

// if a door has a negative wait, it would never come back
// if blocked, so let it just squash the object to death
@@ -212,27 +278,33 @@ Key doors are always wait -1.
//--------------------------------------------------------------
void() func_door_hit_top =
{
- sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise1, VOL_MHI, ATTN_NORM);
self.state = FUNC_STATE_TOP;
- if (self.spawnflags & DOOR_TOGGLE)
- // don't come down automatically
- return;

- self.think = func_door_think_go_down;
- self.nextthink = self.ltime + self.wait;
+ // automatically return if DOOR_TOGGLE spawnflag not set
+ if (!(self.spawnflags & DOOR_TOGGLE))
+ {
+ self.think = func_door_think_go_down;
+ self.nextthink = self.ltime + self.wait;
+ }
+
+ self.SendFlags |= BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_VELOCITY;
};

//--------------------------------------------------------------
void() func_door_hit_bottom =
{
- sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise1, VOL_MHI, ATTN_NORM);
self.state = FUNC_STATE_BOTTOM;
+ self.SendFlags |= BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_VELOCITY;
};

//--------------------------------------------------------------
void() func_door_think_go_down =
{
- sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise2, VOL_MHI, ATTN_NORM);
if (self.max_health)
{
self.takedamage = DAMAGE_YES;
@@ -243,6 +315,9 @@ Key doors are always wait -1.
sub_calcmove (self, self.pos1, self.speed,
func_door_hit_bottom);

+ self.SendFlags |= BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_VELOCITY;
+
if (self.switchshadstyle && self.shadowcontroller)
{
if (self.spawnflags & DOOR_START_OPEN)
@@ -274,10 +349,13 @@ Key doors are always wait -1.
return;
}

- sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise2, VOL_MHI, ATTN_NORM);
self.state = FUNC_STATE_UP;
sub_calcmove (self, self.pos2, self.speed, func_door_hit_top);

+ self.SendFlags |= BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_VELOCITY;
+
sub_usetargets ();

if (self.switchshadstyle && self.shadowcontroller)
@@ -436,7 +514,7 @@ Key doors are always wait -1.
{
centerprint (other, self.owner.message);
sound (other, CHAN_VOICE, "misc/talk.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
}

// key door stuff
@@ -640,7 +718,9 @@ Key doors are always wait -1.
}
}
};
+#endif

+#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void(entity e) func_door_init =
{
@@ -651,6 +731,7 @@ Key doors are always wait -1.
e.classtype = CT_FUNC_DOOR;
base_func_init (e);

+ #ifdef SSQC
// this.noise3 and this.noise4 can now be overridden by
// the mapper, but will be set to default values in
// keylock_init if necessary -- iw
@@ -693,11 +774,19 @@ Key doors are always wait -1.
sub_setmovedir (e);

e.max_health = e.health;
+ #endif
+
e.solid = SOLID_BSP;
e.movetype = MOVETYPE_PUSH;
setorigin (e, e.origin);
+
+ #if defined(SSQC)
setmodel (e, e.model);
+ #elif defined(CSQC)
+ setmodelindex (e, e.modelindex);
+ #endif

+ #ifdef SSQC
e.blocked = func_door_blocked;
e.use = func_door_use;

@@ -789,8 +878,21 @@ Key doors are always wait -1.
vlen (e.pos2 - e.pos1) / e.speed,
e.spawnflags & DOOR_START_OPEN ? 1 : 0);
}
+
+ // network func_door to the CSQC client -- CEV
+ e.SendEntity = base_func_netsend;
+ e.SendFlags = BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_SIZE |
+ BASE_FUNC_NET_MODEL | BASE_FUNC_NET_SPEED;
+ #endif
+
+ #ifdef CSQC
+ e.drawmask = DRAWMASK_NORMAL;
+ e.predraw = base_func_predraw_solidpush;
+ #endif
};
+#endif

+#ifdef SSQC
//--------------------------------------------------------------
void() func_door =
{
@@ -800,4 +902,5 @@ Key doors are always wait -1.

func_door_init (self);
};
+#endif
// };

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

Diff qc/func/door_secret.qc

diff --git a/qc/func/door_secret.qc b/qc/func/door_secret.qc
index 415b59c..eb5bb02 100644
--- a/qc/func/door_secret.qc
+++ b/qc/func/door_secret.qc
@@ -6,17 +6,20 @@
// constants
//======================================================================

+#ifdef SSQC
const float SECRET_OPEN_ONCE = 1; // stays open
const float SECRET_1ST_LEFT = 2; // 1st move is left of arrow
const float SECRET_1ST_DOWN = 4; // 1st move is down from arrow
const float SECRET_NO_SHOOT = 8; // only opened by trigger
const float SECRET_YES_SHOOT = 16; // shootable even if targeted
+#endif

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

// func_door_secret
+#ifdef SSQC
void() func_door_secret_blocked;
void(entity attacker, float damage) func_door_secret_pain;
void(vector dir) func_door_secret_destroy;
@@ -25,6 +28,7 @@ void() func_door_secret_touch;
void() func_door_secret_use;
void(entity e) func_door_secret_init;
void() func_door_secret;
+#endif

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

@@ -48,6 +52,7 @@ If a secret door has a targetname, it will only be opened by it's botton or trig
//----------------------------------------------------------------------
// class func_door_secret: base_func
// {
+#ifdef SSQC
//--------------------------------------------------------------
void() func_door_secret_blocked =
{
@@ -86,26 +91,26 @@ If a secret door has a targetname, it will only be opened by it's botton or trig
// fd_secret_move1: Wait after first movement
self.nextthink = self.ltime + 1.0;
sound (self, CHAN_VOICE, self.noise3,
- 1, ATTN_NORM);
+ VOL_MHI, ATTN_NORM);
break;
case 2:
// fd_secret_move2: move sideways w/sound
sound (self, CHAN_VOICE, self.noise2,
- 1, ATTN_NORM);
+ VOL_MHI, ATTN_NORM);
sub_calcmove (self, self.pos2, self.speed,
func_door_secret_think);
break;
case 3:
// fd_secret_move3: wait until time to go back
sound (self, CHAN_VOICE, self.noise3,
- 1, ATTN_NORM);
+ VOL_MHI, ATTN_NORM);
if (!(self.spawnflags & SECRET_OPEN_ONCE))
self.nextthink = self.ltime + self.wait;
break;
case 4:
// fd_secret_move4: move backward...
sound (self, CHAN_VOICE, self.noise2,
- 1, ATTN_NORM);
+ VOL_MHI, ATTN_NORM);
sub_calcmove (self, self.pos1, self.speed,
func_door_secret_think);
break;
@@ -113,12 +118,12 @@ If a secret door has a targetname, it will only be opened by it's botton or trig
// fd_secret_move5: wait 1 second...
self.nextthink = self.ltime + 1.0;
sound (self, CHAN_VOICE, self.noise3,
- 1, ATTN_NORM);
+ VOL_MHI, ATTN_NORM);
break;
case 6:
// fd_secret_move6
sound (self, CHAN_VOICE, self.noise2,
- 1, ATTN_NORM);
+ VOL_MHI, ATTN_NORM);
sub_calcmove (self, self.oldorigin, self.speed,
func_door_secret_think);
break;
@@ -129,11 +134,13 @@ If a secret door has a targetname, it will only be opened by it's botton or trig
{
self.health = 10000;
self.takedamage = DAMAGE_YES;
- self.pain = sub_nullpain;
+ self.destroy = func_door_secret_destroy;
+ self.th_pain = func_door_secret_pain;
+ // self.th_pain = sub_nullpain;
}

sound (self, CHAN_VOICE, self.noise3,
- 1, ATTN_NORM);
+ VOL_MHI, ATTN_NORM);
break;
default:
dprint (sprintf("func_door_secret_think: "
@@ -166,7 +173,7 @@ If a secret door has a targetname, it will only be opened by it's botton or trig
{
centerprint (other, self.message);
sound (other, CHAN_BODY, "misc/talk.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
}
};

@@ -189,14 +196,14 @@ If a secret door has a targetname, it will only be opened by it's botton or trig

if (!(self.spawnflags & SECRET_NO_SHOOT))
{
- self.pain = sub_nullpain;
+ self.th_pain = sub_nullpain;
self.takedamage = DAMAGE_NO;
}

self.velocity = '0 0 0';

// Make a sound, wait a little...
- sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise1, VOL_MHI, ATTN_NORM);
self.nextthink = self.ltime + 0.1;

// 1 or -1
@@ -224,7 +231,7 @@ If a secret door has a targetname, it will only be opened by it's botton or trig
self.state = 1;
sub_calcmove (self, self.pos1, self.speed,
func_door_secret_think);
- sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise2, VOL_MHI, ATTN_NORM);
};

//--------------------------------------------------------------
@@ -286,7 +293,7 @@ If a secret door has a targetname, it will only be opened by it's botton or trig
{
e.health = 10000;
e.takedamage = DAMAGE_YES;
- e.pain = func_door_secret_pain;
+ e.th_pain = func_door_secret_pain;
e.destroy = func_door_secret_destroy;
}

@@ -306,4 +313,5 @@ If a secret door has a targetname, it will only be opened by it's botton or trig

func_door_secret_init (self);
};
+#endif
// };

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

Diff qc/func/elvtr_button.qc

diff --git a/qc/func/elvtr_button.qc b/qc/func/elvtr_button.qc
index 8fbe437..5087e73 100644
--- a/qc/func/elvtr_button.qc
+++ b/qc/func/elvtr_button.qc
@@ -10,19 +10,24 @@
// constants
//======================================================================

+#ifdef SSQC
const float BUTTON_ELVTR_DOWN = 1;
+#endif

//======================================================================
// globals
//======================================================================

+#ifdef SSQC
float elv_butn_dir;
+#endif

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

// func_elvtr_button
+#ifdef SSQC
void() func_elvtr_button_wait;
void() func_elvtr_button_done;
void() func_elvtr_button_return;
@@ -33,6 +38,7 @@ void() func_elvtr_button_touch;
void() func_elvtr_button_use;
void(entity e) func_elvtr_button_init;
void() func_elvtr_button;
+#endif

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

@@ -60,6 +66,7 @@ When a button is touched, it moves some distance in the direction of it's angle,
//----------------------------------------------------------------------
// class func_elvtr_button: base_func
// {
+#ifdef SSQC
//--------------------------------------------------------------
void() func_elvtr_button_wait =
{
@@ -107,7 +114,7 @@ When a button is touched, it moves some distance in the direction of it's angle,
if (self.state == FUNC_STATE_UP || self.state == FUNC_STATE_TOP)
return;

- sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise, VOL_MID, ATTN_NORM);

self.state = FUNC_STATE_UP;
sub_calcmove (self, self.pos2, self.speed,
@@ -224,4 +231,5 @@ When a button is touched, it moves some distance in the direction of it's angle,

func_elvtr_button_init (self);
};
+#endif
// };

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

Diff qc/func/episodegate.qc

diff --git a/qc/func/episodegate.qc b/qc/func/episodegate.qc
index f74f93f..ae7f7a1 100644
--- a/qc/func/episodegate.qc
+++ b/qc/func/episodegate.qc
@@ -6,16 +6,20 @@
// constants
//======================================================================

+#ifdef SSQC
// For func_episodegate and func_bossgate appear when player has all runes
const float EPISODEGATE_REVERSE = 16;
+#endif

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

// func_episodegate
+#ifdef SSQC
void(entity e) func_episodegate_init;
void() func_episodegate;
+#endif

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

@@ -25,6 +29,7 @@ This bmodel will appear if the episode has allready been completed, so players c
//----------------------------------------------------------------------
// class func_episodegate: base_func_wall
// {
+#ifdef SSQC
//--------------------------------------------------------------
void(entity e) func_episodegate_init =
{
@@ -63,4 +68,5 @@ This bmodel will appear if the episode has allready been completed, so players c

func_episodegate_init (self);
};
+#endif
// };

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

Diff qc/func/explobox.qc

diff --git a/qc/func/explobox.qc b/qc/func/explobox.qc
index 0fd07a8..eb1c2b7 100644
--- a/qc/func/explobox.qc
+++ b/qc/func/explobox.qc
@@ -7,11 +7,13 @@
//======================================================================

// func_explobox
+#ifdef SSQC
void() func_explobox_explode_silent;
void(vector dir) func_explobox_destroy;
-// void() func_explobox_think =
+// void() func_explobox_think;
void(entity e) func_explobox_init;
void() func_explobox;
+#endif

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

@@ -29,6 +31,7 @@ Keys:
//----------------------------------------------------------------------
// class func_explobox: base_func
// {
+#ifdef SSQC
//--------------------------------------------------------------
void() func_explobox_explode_silent =
{
@@ -53,7 +56,8 @@ Keys:
/*
void() func_explobox_think =
{
- // sound (this, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM);
+ // sound (this, CHAN_VOICE, "weapons/r_exp3.wav",
+ // VOL_HIGH, ATTN_NORM);
func_explobox_explode_silent ();
};
*/
@@ -89,4 +93,5 @@ Keys:

func_explobox_init (self);
};
+#endif
// };

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

Diff qc/func/fall.qc

diff --git a/qc/func/fall.qc b/qc/func/fall.qc
index 0f4db43..2a28dce 100644
--- a/qc/func/fall.qc
+++ b/qc/func/fall.qc
@@ -12,19 +12,23 @@
// constants
//======================================================================

+#ifdef SSQC
const float FUNCFADE_DONT_FADE = 1;
const float FUNCFADE_SILENT = 2;
+#endif

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

// func_fall
+#ifdef SSQC
void() func_fall_think;
void() func_fall_touch;
void() func_fall_use;
void(entity e) func_fall_init;
void() func_fall;
+#endif

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

@@ -42,6 +46,7 @@ Falling brush upon touch
//----------------------------------------------------------------------
// class func_fall: base_func
// {
+#ifdef SSQC
//--------------------------------------------------------------
void() func_fall_think =
{
@@ -93,10 +98,10 @@ Falling brush upon touch
{
if (self.noise != "")
sound (self, CHAN_AUTO, self.noise,
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
else
sound (self, CHAN_AUTO, "buttons/switch21.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
}
};

@@ -111,7 +116,7 @@ Falling brush upon touch
sound (self, CHAN_AUTO, self.noise, 1, ATTN_NORM);
else
sound (self, CHAN_AUTO, "buttons/switch21.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
@@ -145,4 +150,5 @@ Falling brush upon touch

func_fall_init (self);
};
+#endif
// };

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

Diff qc/func/fall2.qc

diff --git a/qc/func/fall2.qc b/qc/func/fall2.qc
index e31f0bd..e7f3a43 100644
--- a/qc/func/fall2.qc
+++ b/qc/func/fall2.qc
@@ -6,34 +6,41 @@
// constants
//======================================================================

+#ifdef SSQC
const float FALL2_PLAYER_TRIGGERED = 1;
const float FALL2_MONSTER_TRIGGERED = 2;
const float FALL2_BREAKABLE = 8; // VR
// const float FALL2_SOLID = 16; // VR
+#endif

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

// temp_fall2_field
+#ifdef SSQC
void() temp_fall2_field_touch;
entity(entity own, vector nmins, vector nmaxs) spawn_temp_fall2_field;
void(entity e) temp_fall2_field_init;
strip void() temp_fall2_field;
+#endif

// func_fall2
+#ifdef SSQC
void() func_fall2_think;
void() func_fall2_touch;
void() func_fall2_use;
void(entity e) func_fall2_breakable_fields;
void(entity e) func_fall2_init;
void() func_fall2;
+#endif

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

//----------------------------------------------------------------------
// class temp_fall2_field: base_tempentity
// {
+#ifdef SSQC
//--------------------------------------------------------------
void() temp_fall2_field_touch =
{
@@ -83,6 +90,7 @@ void() func_fall2;
{
temp_fall2_field_init (self);
};
+#endif
// };

/*QUAKED func_fall2 (0 .5 .8) ? 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
@@ -110,6 +118,7 @@ Able to .target other entities, including other func_fall2s
//----------------------------------------------------------------------
// class func_fall2: base_breakable
// {
+#ifdef SSQC
//--------------------------------------------------------------
void() func_fall2_think =
{
@@ -172,7 +181,7 @@ Able to .target other entities, including other func_fall2s
{
sound (self, CHAN_AUTO,
self.noise2,
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
}
remove (self);
return;
@@ -234,7 +243,8 @@ Able to .target other entities, including other func_fall2s
// }

if (self.noise != __NULL__ && self.noise != "")
- sound (self, CHAN_AUTO, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_AUTO, self.noise,
+ VOL_HIGH, ATTN_NORM);

// disable touch, only do self once!
self.touch = sub_null;
@@ -264,7 +274,8 @@ Able to .target other entities, including other func_fall2s

self.attack_finished = time + self.wait;
if (self.noise != __NULL__ && self.noise != "")
- sound (self, CHAN_AUTO, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_AUTO, self.noise,
+ VOL_HIGH, ATTN_NORM);
};

// You may have to modify your multi_touch(); command in triggers.qc
@@ -423,4 +434,5 @@ Able to .target other entities, including other func_fall2s

func_fall2_init (self);
};
+#endif
// };

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

Diff qc/func/illusionary.qc

diff --git a/qc/func/illusionary.qc b/qc/func/illusionary.qc
index 1fd2bcf..d8c0040 100644
--- a/qc/func/illusionary.qc
+++ b/qc/func/illusionary.qc
@@ -7,8 +7,10 @@
//======================================================================

// func_illusionary
+#ifdef SSQC
void(entity e) func_illusionary_init;
void() func_illusionary;
+#endif

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

@@ -18,6 +20,7 @@ A simple entity that looks solid but lets you walk through it.
//----------------------------------------------------------------------
// class func_illusionary: base_func
// {
+#ifdef SSQC
//--------------------------------------------------------------
void(entity e) func_illusionary_init =
{
@@ -41,4 +44,5 @@ A simple entity that looks solid but lets you walk through it.

func_illusionary_init (self);
};
+#endif
// };

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

Diff qc/func/laser.qc

diff --git a/qc/func/laser.qc b/qc/func/laser.qc
index 484be85..9401b62 100644
--- a/qc/func/laser.qc
+++ b/qc/func/laser.qc
@@ -6,30 +6,37 @@
// constants
//======================================================================

+#ifdef SSQC
const float LASER_START_OFF = 1;
const float LASER_SOLID = 2;
+#endif

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

// temp_laser_helper
+#ifdef SSQC
void() temp_laser_helper_think;
entity(entity own, float newalpha) spawn_temp_laser_helper;
void(entity e) temp_laser_helper_init;
strip void() temp_laser_helper;
+#endif

// func_laser
+#ifdef SSQC
void() func_laser_touch;
void() func_laser_use;
void(entity e) func_laser_init;
void() func_laser;
+#endif

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

//----------------------------------------------------------------------
// class temp_laser_helper: base_tempentity
// {
+#ifdef SSQC
//--------------------------------------------------------------
void() temp_laser_helper_think =
{
@@ -72,6 +79,7 @@ void() func_laser;
{
temp_laser_helper_init (self);
};
+#endif
// };

/*QUAKED func_laser (0 .5 .8) ? LASER_START_OFF LASER_SOLID 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
@@ -96,6 +104,7 @@ Keys:
//----------------------------------------------------------------------
// class func_laser: base_func
// {
+#ifdef SSQC
//--------------------------------------------------------------
void() func_laser_touch =
{
@@ -122,7 +131,8 @@ Keys:
// changed for progs_dump: the laser sound is now
// emitted from the func_laser itself instead of
// from the activator -- iw
- sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise,
+ VOL_HIGH, ATTN_NORM);

if (activator.classtype == CT_PLAYER &&
self.message != "")
@@ -135,7 +145,8 @@ Keys:
// changed for progs_dump: the laser sound is now
// emitted from the func_laser itself instead of
// from the activator -- iw
- sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise1,
+ VOL_HIGH, ATTN_NORM);

setorigin (self, '0 0 9000');
self.spawnflags = self.spawnflags + LASER_START_OFF;
@@ -209,4 +220,5 @@ Keys:

func_laser_init (self);
};
+#endif
// };

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

Diff qc/func/monster_spawner.qc

diff --git a/qc/func/monster_spawner.qc b/qc/func/monster_spawner.qc
index 9dce926..d0d70bc 100644
--- a/qc/func/monster_spawner.qc
+++ b/qc/func/monster_spawner.qc
@@ -15,15 +15,27 @@
// constants
//======================================================================

+#ifdef SSQC
const float MOBOT_SPAWNER_RESET = 1;
-const float MOBOT_DONT_SPAWN_ANGRY = 2;
+const float MOBOT_PASSIVE = 2; // MOBOT_DONT_SPAWN_ANGRY
const float MOBOT_DONT_ADD_KILL_COUNT = 4;
const float MOBOT_SILENT_SPAWN = 32;
+#endif

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

+// func_monster_spawner
+#ifdef SSQC
+entity() func_monster_spawner_find_spawnpoint;
+void(entity e) func_monster_spawner_tfrag;
+void() func_monster_spawner_create;
+void() func_monster_spawner_think;
+void(entity e) func_monster_spawner_init; // Initialization
+void() func_monster_spawner;
+#endif
+
//------------------------------------------------------------------------------

/*QUAKED func_monster_spawner (.75 0 .75) (-8 -8 -8) (8 8 8) REUSABLE 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
@@ -53,11 +65,12 @@ Can only use default health, models and sounds.
//----------------------------------------------------------------------
// class func_monster_spawner: base_func
// {
+#ifdef SSQC
//--------------------------------------------------------------
// find_spawnpoint -- Returns the entity to spawn at; was named
// MobotSpawnPoint
//--------------------------------------------------------------
- entity() find_spawnpoint =
+ entity() func_monster_spawner_find_spawnpoint =
{
local entity spot;

@@ -65,188 +78,177 @@ Can only use default health, models and sounds.
spot = find (world, targetname, self.target);

if (!spot)
- objerror ("func_monster_spawner::find_spawnpoint: "
+ objerror ("func_monster_spawner_find_spawnpoint: "
"couldn't find target!\n");

return spot;
};

//--------------------------------------------------------------
- void(base_monster bot) create_mobot_tfrag =
+ void(entity e) func_monster_spawner_tfrag =
{
if (!(self.spawnflags & MOBOT_SILENT_SPAWN))
// SILENT
- spawn_tfog (bot.origin);
- spawn_tdeath (bot.origin, bot);
+ spawn_tfog (e.origin);
+ spawn_tdeath (e.origin, e);
};

//--------------------------------------------------------------
- void() create_mobot =
+ void() func_monster_spawner_create =
{
- // let's not use deathmatch points for self -- dumptruck_ds
+ // let's not use deathmatch points for this -- dumptruck_ds
// spawn_spot = SelectSpawnPoint ();
- local entity spawn_spot = find_spawnpoint ();
- local float angry;
-
- if (self.spawnflags & MOBOT_DONT_SPAWN_ANGRY)
- angry = FALSE;
- else
- angry = TRUE;
+ local entity spawn_spot =
+ func_monster_spawner_find_spawnpoint ();
+ local float angry = self.spawnflags & MOBOT_PASSIVE ? 0 : 1;
+ local entity e = __NULL__;

switch (self.style)
{
case 1:
// spawn a Doggo
- monster_dog bot1 = spawn (monster_dog,
- origin: spawn_spot.origin + '0 0 1',
- angles: spawn_spot.angles,
- yaw_speed: 120,
- spawn_angry: angry,
- fixangle: TRUE,
- view_ofs: '0 0 22');
- create_mobot_tfrag (bot1);
+ e = spawn_monster_dog (
+ spawn_spot.origin + '0 0 1',
+ spawn_spot.angles,
+ 0,
+ 120,
+ angry);
+ e.view_ofs = '0 0 22';
break;
case 2:
// spawn a Grunt
- monster_army bot2 = spawn (monster_army,
- origin: spawn_spot.origin + '0 0 1',
- angles: spawn_spot.angles,
- yaw_speed: 120,
- spawn_angry: angry,
- fixangle: TRUE,
- view_ofs: '0 0 22');
- create_mobot_tfrag (bot2);
+ e = spawn_monster_army (
+ spawn_spot.origin + '0 0 1',
+ spawn_spot.angles,
+ 0,
+ 120,
+ angry);
+ e.view_ofs = '0 0 22';
break;
case 3:
// spawn an Enforcer
- monster_enforcer bot3 = spawn (monster_enforcer,
- origin: spawn_spot.origin + '0 0 1',
- angles: spawn_spot.angles,
- yaw_speed: 120,
- spawn_angry: angry,
- fixangle: TRUE,
- view_ofs: '0 0 22');
- create_mobot_tfrag (bot3);
+ e = spawn_monster_enforcer (
+ spawn_spot.origin + '0 0 1',
+ spawn_spot.angles,
+ 0,
+ 120,
+ angry);
+ e.view_ofs = '0 0 22';
break;
case 4:
// spawn an Ogre
- monster_ogre bot4 = spawn (monster_ogre,
- origin: spawn_spot.origin + '0 0 1',
- angles: spawn_spot.angles,
- yaw_speed: 120,
- spawn_angry: angry,
- fixangle: TRUE,
- view_ofs: '0 0 22');
- create_mobot_tfrag (bot4);
+ e = spawn_monster_ogre (
+ spawn_spot.origin + '0 0 1',
+ spawn_spot.angles,
+ 0,
+ 120,
+ angry);
+ e.view_ofs = '0 0 22';
break;
case 5:
// spawn a Fiend
- monster_demon1 bot5 = spawn (monster_demon1,
- origin: spawn_spot.origin + '0 0 1',
- angles: spawn_spot.angles,
- yaw_speed: 120,
- spawn_angry: angry,
- fixangle: TRUE,
- view_ofs: '0 0 22');
- create_mobot_tfrag (bot5);
+ e = spawn_monster_demon1 (
+ spawn_spot.origin + '0 0 1',
+ spawn_spot.angles,
+ 0,
+ 120,
+ angry);
+ e.view_ofs = '0 0 22';
break;
case 6:
// spawn a Wizard / Scrag
- monster_wizard bot6 = spawn (monster_wizard,
- origin: spawn_spot.origin + '0 0 1',
- angles: spawn_spot.angles,
- mdl_proj: "progs/w_spike.mdl",
- yaw_speed: 120,
- spawn_angry: angry,
- fixangle: TRUE,
- view_ofs: '0 0 22');
- create_mobot_tfrag (bot6);
+ e = spawn_monster_wizard (
+ spawn_spot.origin + '0 0 1',
+ spawn_spot.angles,
+ 0,
+ 120,
+ angry);
+ // e.mdl_proj = "progs/w_spike.mdl";
+ e.view_ofs = '0 0 22';
break;
case 7:
// spawn a Shambler
- monster_shambler bot7 = spawn (monster_shambler,
- origin: spawn_spot.origin + '0 0 1',
- angles: spawn_spot.angles,
- yaw_speed: 120,
- spawn_angry: angry,
- fixangle: TRUE,
- view_ofs: '0 0 2');
- create_mobot_tfrag (bot7);
+ e = spawn_monster_shambler (
+ spawn_spot.origin + '0 0 1',
+ spawn_spot.angles,
+ 0,
+ 120,
+ angry);
+ e.view_ofs = '0 0 2';
break;
case 8:
// spawn a Knight
- monster_knight bot8 = spawn (monster_knight,
- origin: spawn_spot.origin + '0 0 1',
- angles: spawn_spot.angles,
- yaw_speed: 120,
- spawn_angry: angry,
- fixangle: TRUE,
- view_ofs: '0 0 22');
- create_mobot_tfrag (bot8);
+ e = spawn_monster_knight (
+ spawn_spot.origin + '0 0 1',
+ spawn_spot.angles,
+ 0,
+ 120,
+ angry);
+ e.view_ofs = '0 0 22';
break;
case 9:
// spawn a HellKnight
- monster_hell_knight bot9 = spawn (
- monster_hell_knight,
- origin: spawn_spot.origin + '0 0 1',
- angles: spawn_spot.angles,
- yaw_speed: 120,
- spawn_angry: angry,
- fixangle: TRUE,
- view_ofs: '0 0 22');
- create_mobot_tfrag (bot9);
+ e = spawn_monster_hell_knight (
+ spawn_spot.origin + '0 0 1',
+ spawn_spot.angles,
+ 0,
+ 120,
+ angry);
+ e.view_ofs = '0 0 22';
break;
case 11:
// spawn a Zombie
- monster_zombie botB = spawn (monster_zombie,
- origin: spawn_spot.origin + '0 0 1',
- angles: spawn_spot.angles,
- yaw_speed: 120,
- spawn_angry: angry,
- fixangle: TRUE,
- view_ofs: '0 0 2');
- create_mobot_tfrag (botB);
+ e = spawn_monster_zombie (
+ spawn_spot.origin + '0 0 1',
+ spawn_spot.angles,
+ 0,
+ 120,
+ angry);
+ e.view_ofs = '0 0 2';
break;
case 12:
// spawn a Shalrath
- monster_shalrath botC = spawn (monster_shalrath,
- origin: spawn_spot.origin + '0 0 1',
- angles: spawn_spot.angles,
- yaw_speed: 120,
- spawn_angry: angry,
- fixangle: TRUE,
- view_ofs: '0 0 22');
- create_mobot_tfrag (botC);
+ e = spawn_monster_shalrath (
+ spawn_spot.origin + '0 0 1',
+ spawn_spot.angles,
+ 0,
+ 120,
+ angry);
+ e.view_ofs = '0 0 22';
break;
default:
- dprint (sprintf("func_monster_spawner::"
- "create_mobot: unknown style %g!\n",
- self.style));
+ dprint (sprintf("func_monster_spawner_create: "
+ "unknown style %g!\n", self.style));
}

- if (!(self.spawnflags & MOBOT_DONT_ADD_KILL_COUNT))
- // replacement function from iw -- dumptruck_ds
- monster_update_total (1);
+ if (e)
+ {
+ e.fixangle = TRUE;
+ func_monster_spawner_tfrag (e);
+
+ if (!(self.spawnflags & MOBOT_DONT_ADD_KILL_COUNT))
+ // replacement function from iw -- dumptruck_ds
+ monster_update_total (1);
+ }
};

//--------------------------------------------------------------
- void() do_think =
+ void() func_monster_spawner_think =
{
dprint ("mobot thinking\n");
- // telefrag check thanks to ryanscissorhands for self code!
+ // telefrag check thanks to ryanscissorhands for this code!
// -- dumptruck_ds
- local entity nearby;
-
// findradius (vector origin, float radius in Quake units)
- nearby = findradius (self.origin, 128);
+ local entity nearby = findradius (self.origin, 128);

while (nearby)
{
- if (nearby.takedamage)
+ if (nearby.takedamage && nearby.solid != SOLID_CORPSE)
{
dprint ("monster waiting to spawn\n");
// qss crash fix from paavohuhtala
// -- dumptruck_ds
+ self.think = func_monster_spawner_think;
// delay the spawn by some amount;
self.nextthink = time + 1;
return;
@@ -277,11 +279,11 @@ Can only use default health, models and sounds.

// thanks whirledtsar for your help on this
// -- dumptruck_ds
- create_mobot ();
+ func_monster_spawner_create ();
}
else
{
- create_mobot ();
+ func_monster_spawner_create ();
}
}
else
@@ -289,41 +291,52 @@ Can only use default health, models and sounds.
if (self.spawnflags & MOBOT_SPAWNER_RESET)
{
self.count = self.cnt;
- self.interaction_flags |= DISABLE_THINK;
+ self.think = sub_null;
}
}
- };

- //--------------------------------------------------------------
- void(entity caller) do_use =
- {
- self.do_think ();
+ self.think = func_monster_spawner_think;
};

+ //==============================================================
+ // Initialization
+ //==============================================================
+
//--------------------------------------------------------------
- void() init_spawned =
+ void(entity e) func_monster_spawner_init =
{
- if !(this.target)
+ if !(e.target)
{
objerror ("func_monster_spawner needs a target");
- remove (this);
+ remove (e);
return;
}

- if !(this.style)
- this.style = 1;
+ e.classname = "func_monster_spawner";
+ e.classtype = CT_FUNC_MONSTER_SPAWNER;
+ base_mapentity_init (e);
+
+ if !(e.style)
+ e.style = 1;

- if (!this.count)
- this.count = 5;
+ if (!e.count)
+ e.count = 5;
// fixes count display
- this.count = this.count + 1;
+ e.count = e.count + 1;
// hold original count
- this.cnt = this.count;
+ e.cnt = e.count;
+
+ e.use = func_monster_spawner_think;
};

//--------------------------------------------------------------
void() func_monster_spawner =
{
- this.classtype = CT_FUNC_MONSTER_SPAWNER;
+ // new spawnflags for all entities -- iw
+ if (SUB_Inhibit())
+ return;
+
+ func_monster_spawner_init (self);
};
+#endif
// };

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

Diff qc/func/new_plat.qc

diff --git a/qc/func/new_plat.qc b/qc/func/new_plat.qc
index 764274b..ebf20af 100644
--- a/qc/func/new_plat.qc
+++ b/qc/func/new_plat.qc
@@ -10,24 +10,32 @@
// constants
//======================================================================

+#ifdef SSQC
const float NEWPLAT_DN_N_WAIT = 1; // spawnflags
const float NEWPLAT_PLT_TOGGLE = 2;
const float NEWPLAT_ELEVATOR = 4;
const float NEWPLAT_START_AT_TOP = 8;
const float NEWPLAT_PLAT2 = 16;
const float NEWPLAT_PLAT2_BOTTOM = 32;
+#endif

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

// temp_new_plat_trigger
+#ifdef SSQC
void() temp_new_plat_trigger_touch;
entity(entity own) spawn_temp_new_plat_trigger;
void(entity e) temp_new_plat_trigger_init;
strip void() temp_new_plat_trigger;
+#endif

// func_new_plat
+#ifdef CSQC
+void(float isnew) func_new_plat_netreceive;
+#endif
+#ifdef SSQC
void() func_new_plat_downandwait_hit_top; // down and wait style
void() func_new_plat_downandwait_hit_bottom;
void() func_new_plat_downandwait_go_down;
@@ -50,14 +58,20 @@ void() func_new_plat_plat2_go_down;
void() func_new_plat_plat2_go_up;
void() func_new_plat_plat2_use;
void() func_new_plat_plat2_blocked;
+#endif
+#if defined(CSQC) || defined(SSQC)
void(entity e) func_new_plat_init; // initialization & spawn function
+#endif
+#ifdef SSQC
void() func_new_plat;
+#endif

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

//----------------------------------------------------------------------
// class temp_new_plat_trigger: base_tempentity
// {
+#ifdef SSQC
//--------------------------------------------------------------
// plat2_center_touch
//--------------------------------------------------------------
@@ -189,6 +203,7 @@ void() func_new_plat;
{
temp_new_plat_trigger_init (self);
};
+#endif
// };

/*QUAKED func_new_plat (0 .5 .8) ? DN_N_WAIT PLT_TOGGLE ELEVATOR START_AT_TOP PLAT2 P2_BOTTOM 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
@@ -229,42 +244,91 @@ Set "sounds" to one of the following:
//----------------------------------------------------------------------
// class func_new_plat: base_func
// {
+#ifdef CSQC
+ //--------------------------------------------------------------
+ void(float isnew) func_new_plat_netreceive =
+ {
+ local float netflags = ReadFloat ();
+ base_func_netreceive_read (isnew, netflags);
+
+ if (isnew)
+ func_new_plat_init (self);
+
+ if (netflags & BASE_FUNC_NET_VELOCITY)
+ {
+ if (self.velocity != self.velocity_net)
+ {
+ if (self.velocity)
+ {
+ self.origin_start = self.origin;
+ self.movetime = time;
+ }
+ else
+ {
+ self.movetime = 0;
+ }
+ }
+ }
+
+ self.origin_net = self.origin;
+ self.velocity_net = self.velocity;
+
+ if (netflags & BASE_FUNC_NET_MODEL)
+ setmodelindex (self, self.modelindex);
+
+ if (netflags & BASE_FUNC_NET_SIZE)
+ setsize (self, self.mins, self.maxs);
+
+ if (netflags & BASE_FUNC_NET_ORIGIN)
+ setorigin (self, self.origin);
+ };
+#endif
+
//==============================================================
// down N and wait code
//==============================================================

+#ifdef SSQC
//--------------------------------------------------------------
void() func_new_plat_downandwait_hit_top =
{
- sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise1, VOL_MHI, ATTN_NORM);
self.state = FUNC_STATE_TOP;
+ self.SendFlags = BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_VELOCITY;
};

//--------------------------------------------------------------
void() func_new_plat_downandwait_hit_bottom =
{
- sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise1, VOL_MHI, ATTN_NORM);
self.state = FUNC_STATE_BOTTOM;
self.think = func_new_plat_downandwait_go_up;
self.nextthink = self.ltime + self.health;
+ self.SendFlags = BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_VELOCITY;
};

//--------------------------------------------------------------
void() func_new_plat_downandwait_go_down =
{
- sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise, VOL_MHI, ATTN_NORM);
self.state = FUNC_STATE_DOWN;
sub_calcmove (self, self.pos2, self.speed,
func_new_plat_downandwait_hit_bottom);
+ self.SendFlags = BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_VELOCITY;
};

//--------------------------------------------------------------
void() func_new_plat_downandwait_go_up =
{
- sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise, VOL_MHI, ATTN_NORM);
self.state = FUNC_STATE_UP;
sub_calcmove (self, self.pos1, self.speed,
func_new_plat_downandwait_hit_top);
+ self.SendFlags = BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_VELOCITY;
};

//--------------------------------------------------------------
@@ -304,33 +368,41 @@ Set "sounds" to one of the following:
//--------------------------------------------------------------
void() func_new_plat_toggle_hit_top =
{
- sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise1, VOL_MHI, ATTN_NORM);
self.state = FUNC_STATE_TOP;
+ self.SendFlags = BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_VELOCITY;
};

//--------------------------------------------------------------
void() func_new_plat_toggle_hit_bottom =
{
- sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise1, VOL_MHI, ATTN_NORM);
self.state = FUNC_STATE_BOTTOM;
+ self.SendFlags = BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_VELOCITY;
};

//--------------------------------------------------------------
void() func_new_plat_toggle_go_down =
{
- sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise, VOL_MHI, ATTN_NORM);
self.state = FUNC_STATE_DOWN;
sub_calcmove (self, self.pos2, self.speed,
func_new_plat_toggle_hit_bottom);
+ self.SendFlags = BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_VELOCITY;
};

//--------------------------------------------------------------
void() func_new_plat_toggle_go_up =
{
- sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise, VOL_MHI, ATTN_NORM);
self.state = FUNC_STATE_UP;
sub_calcmove (self, self.pos1, self.speed,
func_new_plat_toggle_hit_top);
+ self.SendFlags = BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_VELOCITY;
};

//--------------------------------------------------------------
@@ -376,9 +448,11 @@ Set "sounds" to one of the following:
void() func_new_plat_elvtr_stop =
{
self.style = self.style2;
- sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise1, VOL_MHI, ATTN_NORM);
self.state = FUNC_STATE_BOTTOM;
self.rad_time = time;
+ self.SendFlags = BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_VELOCITY;
};

//--------------------------------------------------------------
@@ -387,11 +461,13 @@ Set "sounds" to one of the following:
self.finaldest = self.pos2;
self.finaldest_z = self.pos2_z +
(self.height * self.style2);
- sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise, VOL_MHI, ATTN_NORM);
self.state = FUNC_STATE_UP;
sub_calcmove (self, self.finaldest, self.speed,
func_new_plat_elvtr_stop);
self.rad_time = time;
+ self.SendFlags = BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_VELOCITY;
};

//--------------------------------------------------------------
@@ -499,7 +575,7 @@ Set "sounds" to one of the following:
//--------------------------------------------------------------
void() func_new_plat_plat2_hit_top =
{
- sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise1, VOL_MHI, ATTN_NORM);
self.state = FUNC_STATE_TOP;

self.invincible_time = time;
@@ -517,12 +593,14 @@ Set "sounds" to one of the following:
self.think = func_new_plat_plat2_go_down;
self.nextthink = self.ltime + self.delay;
}
+ self.SendFlags = BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_VELOCITY;
};

//--------------------------------------------------------------
void() func_new_plat_plat2_hit_bottom =
{
- sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise1, VOL_MHI, ATTN_NORM);
self.state = FUNC_STATE_BOTTOM;

self.invincible_time = time;
@@ -540,24 +618,30 @@ Set "sounds" to one of the following:
self.think = func_new_plat_plat2_go_up;
self.nextthink = self.ltime + self.delay;
}
+ self.SendFlags = BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_VELOCITY;
};

//--------------------------------------------------------------
void() func_new_plat_plat2_go_down =
{
- sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise, VOL_MHI, ATTN_NORM);
self.state = FUNC_STATE_DOWN;
sub_calcmove (self, self.pos2, self.speed,
func_new_plat_plat2_hit_bottom);
+ self.SendFlags = BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_VELOCITY;
};

//--------------------------------------------------------------
void() func_new_plat_plat2_go_up =
{
- sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise, VOL_MHI, ATTN_NORM);
self.state = FUNC_STATE_UP;
sub_calcmove (self, self.pos1, self.speed,
func_new_plat_plat2_hit_top);
+ self.SendFlags = BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_VELOCITY;
};

//--------------------------------------------------------------
@@ -589,11 +673,13 @@ Set "sounds" to one of the following:
objerror ("func_new_plat_plat2_blocked: "
"bad self.state\n");
};
+#endif

//==============================================================
// Common Plat Code
//==============================================================

+#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void(entity e) func_new_plat_init =
{
@@ -601,7 +687,7 @@ Set "sounds" to one of the following:
e.classtype = CT_FUNC_NEW_PLAT;
base_func_init (e);

- // local entity t;
+ #ifdef SSQC
local float negative_height = 0;

if (!e.t_length)
@@ -657,13 +743,19 @@ Set "sounds" to one of the following:

e.mangle = e.angles;
e.angles = '0 0 0';
+ #endif

e.solid = SOLID_BSP;
e.movetype = MOVETYPE_PUSH;
setorigin (e, e.origin);
+ #if defined(SSQC)
setmodel (e, e.model);
+ #elif defined(CSQC)
+ setmodelindex (e, e.modelindex);
+ #endif
setsize (e, e.mins , e.maxs);

+ #ifdef SSQC
if (!e.speed)
e.speed = 150;

@@ -788,8 +880,20 @@ Set "sounds" to one of the following:
// the "start moving" trigger
e.trigger_field = spawn_temp_new_plat_trigger (e);
}
+
+ e.SendEntity = base_func_netsend;
+ e.SendFlags = BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_SIZE |
+ BASE_FUNC_NET_MODEL | BASE_FUNC_NET_SPEED;
+ #endif
+
+ #ifdef CSQC
+ e.drawmask = DRAWMASK_NORMAL;
+ e.predraw = base_func_predraw_solidpush;
+ #endif
};
+#endif

+#ifdef SSQC
//--------------------------------------------------------------
void() func_new_plat =
{
@@ -799,4 +903,5 @@ Set "sounds" to one of the following:

func_new_plat_init (self);
};
+#endif
// };

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

Diff qc/func/particlefield.qc

diff --git a/qc/func/particlefield.qc b/qc/func/particlefield.qc
index caa0f8b..3e818c2 100644
--- a/qc/func/particlefield.qc
+++ b/qc/func/particlefield.qc
@@ -12,20 +12,24 @@
// constants
//======================================================================

+#ifdef SSQC
// float PARTICLEFIELD_START_OFF = 1;
const float PARTICLEFIELD_USE_COUNT = 1;
+#endif

//======================================================================
-// forward declaration
+// forward declarations
//======================================================================

// func_particlefield
+#ifdef SSQC
void() func_particlefield_xz;
void() func_particlefield_yz;
void() func_particlefield_xy;
void() func_particlefield_touch;
void(entity e) func_particlefield_init;
void() func_particlefield;
+#endif

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

@@ -47,6 +51,7 @@ to trigger.
//----------------------------------------------------------------------
// class func_particlefield: base_func
// {
+#ifdef SSQC
//--------------------------------------------------------------
void() func_particlefield_xz =
{
@@ -67,9 +72,8 @@ to trigger.
self.ltime = time + 0.25;

if (self.noise != "")
- {
- sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
- }
+ sound (self, CHAN_VOICE, self.noise,
+ VOL_HIGH, ATTN_NORM);

// Only show particles if client is visible.
// This helps to keep network traffic down to a minimum.
@@ -114,9 +118,8 @@ to trigger.
self.ltime = time + 0.25;

if (self.noise != "")
- {
- sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
- }
+ sound (self, CHAN_VOICE, self.noise,
+ VOL_HIGH, ATTN_NORM);

// Only show particles if client is visible.
// This helps to keep network traffic down to a minimum.
@@ -160,9 +163,8 @@ to trigger.
self.ltime = time + 0.25;

if (self.noise != "")
- {
- sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
- }
+ sound (self, CHAN_VOICE, self.noise,
+ VOL_HIGH, ATTN_NORM);

// Only show particles if client is visible.
// This helps to keep network traffic down to a minimum.
@@ -270,4 +272,5 @@ to trigger.

func_particlefield_init (self);
};
+#endif
// };

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

Diff qc/func/plat.qc

diff --git a/qc/func/plat.qc b/qc/func/plat.qc
index 207b0a9..28cc1a1 100644
--- a/qc/func/plat.qc
+++ b/qc/func/plat.qc
@@ -6,30 +6,44 @@
// constants
//======================================================================

+#ifdef SSQC
const float PLAT_LOW_TRIGGER = 1;
+#endif

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

+#ifdef SSQC
// temp_plat_trigger
void() temp_plat_trigger_touch;
entity(entity own) spawn_temp_plat_trigger;
void(entity e) temp_plat_trigger_init;
strip void() temp_plat_trigger;
+#endif

// func_plat
+#ifdef CSQC
+void(float isnew) func_plat_netreceive;
+#endif
+#ifdef SSQC
void() func_plat_hit_top;
void() func_plat_hit_bottom;
void() func_plat_go_down;
void() func_plat_go_up;
void() func_plat_blocked;
void() func_plat_use;
+#endif
+#if defined(CSQC) || defined(SSQC)
void(entity e) func_plat_init;
+#endif
+#ifdef SSQC
void() func_plat;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// class temp_plat_trigger: base_tempentity
// {
@@ -103,6 +117,7 @@ void() func_plat;
temp_plat_trigger_init (self);
};
// };
+#endif

/*QUAKED func_plat (0 .5 .8) ? PLAT_LOW_TRIGGER 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

@@ -120,37 +135,90 @@ Set "sounds" to one of the following:
//----------------------------------------------------------------------
// class func_plat: base_func
// {
+#ifdef CSQC
+ //--------------------------------------------------------------
+ void(float isnew) func_plat_netreceive =
+ {
+ local float netflags = ReadFloat ();
+ base_func_netreceive_read (isnew, netflags);
+
+ if (isnew)
+ func_plat_init (self);
+
+ if (netflags & BASE_FUNC_NET_VELOCITY)
+ {
+ if (self.velocity != self.velocity_net)
+ {
+ if (self.velocity)
+ {
+ self.origin_start = self.origin;
+ self.movetime = time;
+ }
+ else
+ {
+ self.movetime = 0;
+ }
+ }
+ }
+
+ self.origin_net = self.origin;
+ self.velocity_net = self.velocity;
+
+ if (netflags & BASE_FUNC_NET_MODEL)
+ setmodelindex (self, self.modelindex);
+
+ if (netflags & BASE_FUNC_NET_SIZE)
+ setsize (self, self.mins, self.maxs);
+
+ if (netflags & BASE_FUNC_NET_ORIGIN)
+ setorigin (self, self.origin);
+ };
+#endif
+
+#ifdef SSQC
//--------------------------------------------------------------
void() func_plat_hit_top =
{
- sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
self.state = FUNC_STATE_TOP;
+
+ sound (self, CHAN_VOICE, self.noise1, VOL_MHI, ATTN_NORM);
self.think = func_plat_go_down;
self.nextthink = self.ltime + 3;
+ self.SendFlags = BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_VELOCITY;
};

//--------------------------------------------------------------
void() func_plat_hit_bottom =
{
- sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
self.state = FUNC_STATE_BOTTOM;
+
+ sound (self, CHAN_VOICE, self.noise1, VOL_MHI, ATTN_NORM);
+ self.SendFlags = BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_VELOCITY;
};

//--------------------------------------------------------------
void() func_plat_go_down =
{
- sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
self.state = FUNC_STATE_DOWN;
sub_calcmove (self, self.pos2, self.speed,
func_plat_hit_bottom);
+
+ sound (self, CHAN_VOICE, self.noise, VOL_MHI, ATTN_NORM);
+ self.SendFlags = BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_VELOCITY;
};

//--------------------------------------------------------------
void() func_plat_go_up =
{
- sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
self.state = FUNC_STATE_UP;
sub_calcmove (self, self.pos1, self.speed, func_plat_hit_top);
+
+ sound (self, CHAN_VOICE, self.noise, VOL_MHI, ATTN_NORM);
+ self.SendFlags = BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_VELOCITY;
};

//--------------------------------------------------------------
@@ -201,7 +269,9 @@ Set "sounds" to one of the following:
func_plat_go_down ();
}
};
+#endif

+#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void(entity e) func_plat_init =
{
@@ -209,6 +279,7 @@ Set "sounds" to one of the following:
e.classtype = CT_FUNC_PLAT;
base_func_init (e);

+ #ifdef SSQC
if (!e.t_length)
e.t_length = 80;
if (!e.t_width)
@@ -236,13 +307,21 @@ Set "sounds" to one of the following:

e.mangle = e.angles;
e.angles = '0 0 0';
+ #endif

+ setorigin (e, e.origin);
+ // SOLID_BSP and MOVETYPE_PUSH on both client and server -- CEV
e.solid = SOLID_BSP;
e.movetype = MOVETYPE_PUSH;
- setorigin (e, e.origin);
+ #if defined(SSQC)
setmodel (e, e.model);
- setsize (e, e.mins , e.maxs);
+ #elif defined(CSQC)
+ self.oldorigin = self.origin;
+ setmodelindex (e, e.modelindex);
+ #endif
+ setsize (e, e.mins, e.maxs);

+ #ifdef SSQC
e.blocked = func_plat_blocked;
e.use = func_plat_use;

@@ -257,8 +336,8 @@ Set "sounds" to one of the following:
else
e.pos2_z = e.origin_z - e.size_z + 8;

- dprint (sprintf("func_plat_init: pos1 %v, pos2 %v, "
- "origin %v\n", e.pos1, e.pos2, e.origin));
+ // dprint (sprintf("func_plat_init: pos1 %v, pos2 %v, "
+ // "origin %v\n", e.pos1, e.pos2, e.origin));

// the "start moving" trigger
spawn_temp_plat_trigger (e);
@@ -272,8 +351,21 @@ Set "sounds" to one of the following:
setorigin (e, e.pos2);
e.state = FUNC_STATE_BOTTOM;
}
+
+ // network func_plat to the CSQC client -- CEV
+ e.SendEntity = base_func_netsend;
+ e.SendFlags = BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_SIZE |
+ BASE_FUNC_NET_MODEL | BASE_FUNC_NET_SPEED;
+ #endif
+
+ #ifdef CSQC
+ e.drawmask = DRAWMASK_NORMAL;
+ e.predraw = base_func_predraw_solidpush;
+ #endif
};
+#endif

+#ifdef SSQC
//--------------------------------------------------------------
void() func_plat =
{
@@ -283,4 +375,5 @@ Set "sounds" to one of the following:

func_plat_init (self);
};
+#endif
// };

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

Diff qc/func/rotate.qc

diff --git a/qc/func/rotate.qc b/qc/func/rotate.qc
index c85954b..0f96eee 100644
--- a/qc/func/rotate.qc
+++ b/qc/func/rotate.qc
@@ -14,6 +14,7 @@
// constants
//======================================================================

+#ifdef SSQC
const float ROTATE_STATE_ACTIVE = 0;
const float ROTATE_STATE_INACTIVE = 1;
const float ROTATE_STATE_SPEEDINGUP = 2;
@@ -49,51 +50,66 @@ const float ROTATE_DOOR_STAYOPEN = 1; // spawnflags for func_rotate_door
const float MOVEWALL_VISIBLE = 1; // spawnflags for func_movewall
const float MOVEWALL_TOUCH = 2;
const float MOVEWALL_NONBLOCKING = 4;
+#endif

//======================================================================
// fields
//======================================================================

+#ifdef SSQC
.float duration;
.float endtime;
.float rotate_type;

-.vector neworigin;
.vector rotate;

.string event;
.string group;
.string path;
+#endif

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

// base_rotate
+#ifdef SSQC
vector(vector ang) base_rotate_normalizeangles;
void() base_rotate_targets;
void() base_rotate_targets_final;
void() base_rotate_set_target_origin;
void() base_rotate_link_targets;
void(float amount) base_rotate_set_damage_on_targets;
+#endif
+#if defined(CSQC) || defined(SSQC)
void(entity e) base_rotate_init;
+#endif
+#ifdef SSQC
strip void() base_rotate;
+#endif

+#ifdef SSQC
// rotate_object
void(entity e) rotate_object_init
void() rotate_object;
+#endif

+#ifdef SSQC
// func_rotate_entity
void() func_rotate_entity_firstthink;
void() func_rotate_entity_think;
void() func_rotate_entity_use;
void(entity e) func_rotate_entity_init;
void() func_rotate_entity;
+#endif

+#ifdef SSQC
// path_rotate
void(entity e) path_rotate_init;
void() path_rotate;
+#endif

+#ifdef SSQC
// func_rotate_train
void() func_rotate_train_think_wait;
void() func_rotate_train_think_stop;
@@ -103,17 +119,30 @@ void() func_rotate_train_think;
void() func_rotate_train_use;
void(entity e) func_rotate_train_init;
void() func_rotate_train;
+#endif

+#ifdef SSQC
// rotate_train
void() rotate_train;
+#endif

// func_movewall
+#ifdef CSQC
+void(float isnew) func_movewall_netreceive;
+#endif
+#ifdef SSQC
void() func_movewall_touch;
void() func_movewall_blocked;
void() func_movewall_think;
+#endif
+#if defined(CSQC) || defined(SSQC)
void(entity e) func_movewall_init;
+#endif
+#ifdef SSQC
void() func_movewall;
+#endif

+#ifdef SSQC
// func_rotate_door
void() func_rotate_door_reversedirection;
void() func_rotate_door_group_reversedirection;
@@ -122,12 +151,14 @@ void() func_rotate_door_think2;
void() func_rotate_door_use;
void(entity e) func_rotate_door_init;
void() func_rotate_door;
+#endif

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

//----------------------------------------------------------------------
// class base_rotate: base_func
// {
+#ifdef SSQC
//--------------------------------------------------------------
// SUB_NormalizeAngles
//--------------------------------------------------------------
@@ -202,6 +233,11 @@ void() func_rotate_door;
e.neworigin = self.origin - self.oldorigin +
(e.neworigin - e.oldorigin);
e.velocity = (e.neworigin - e.origin) * 25;
+
+ if (e.rotate_type == ROTATE_OBJECT_MOVEWALL)
+ e.SendFlags |= BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN |
+ BASE_FUNC_NET_VELOCITY;
}
e = find (e, targetname, self.target);
}
@@ -231,6 +267,12 @@ void() func_rotate_door;
if (e.rotate_type == ROTATE_OBJECT_ROTATE)
e.angles = self.angles;

+ if (e.rotate_type == ROTATE_OBJECT_MOVEWALL)
+ e.SendFlags |= BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN |
+ BASE_FUNC_NET_VELOCITY;
+
+
e = find (e, targetname, self.target);
}
};
@@ -258,6 +300,9 @@ void() func_rotate_door;
{
setorigin (e, self.origin - self.oldorigin +
(e.neworigin - e.oldorigin));
+ e.SendFlags |= BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN |
+ BASE_FUNC_NET_VELOCITY;
}
else
{
@@ -328,7 +373,9 @@ void() func_rotate_door;
e = find (e, targetname, self.target);
}
};
+#endif

+#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void(entity e) base_rotate_init =
{
@@ -336,14 +383,18 @@ void() func_rotate_door;

base_func_init (e);
};
+#endif

+#ifdef SSQC
//--------------------------------------------------------------
strip void() base_rotate =
{
base_rotate_init (self);
};
+#endif
// };

+#ifdef SSQC
/*QUAKED rotate_object (0 .5 .8) ? 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
This defines an object to be rotated. Used as the target of func_rotate_door.
*/
@@ -375,11 +426,13 @@ This defines an object to be rotated. Used as the target of func_rotate_door.
rotate_object_init (self);
};
// };
+#endif

//----------------------------------------------------------------------
// Simple continual rotatation
//----------------------------------------------------------------------

+#ifdef SSQC
/*QUAKED func_rotate_entity (0 .5 .8) (-8 -8 -8) (8 8 8) TOGGLE START_ON 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

Creates an entity that continually rotates. Can be toggled on and
@@ -539,11 +592,13 @@ If "deathtype" is set with a string, this is the message that will appear when a
func_rotate_entity_init (self);
};
// };
+#endif

//----------------------------------------------------------------------
// Train with rotation functionality
//----------------------------------------------------------------------

+#ifdef SSQC
/*QUAKED path_rotate (0.5 0.3 0) (-8 -8 -8) (8 8 8) ROTATION ANGLES STOP NO_ROTATE DAMAGE MOVETIME SET_DAMAGE
Path for rotate_train.

@@ -592,7 +647,9 @@ If "deathtype" is set with a string, this is the message that will appear when a
path_rotate_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED func_rotate_train (0 .5 .8) (-8 -8 -8) (8 8 8) 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

In path_rotate, set speed to be the new speed of the train after it reaches
@@ -631,9 +688,10 @@ sounds

if (self.goalentity.noise != "")
sound (self, CHAN_VOICE, self.goalentity.noise,
- 1, ATTN_NORM);
+ VOL_MHI, ATTN_NORM);
else
- sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise,
+ VOL_MHI, ATTN_NORM);

if (self.goalentity.spawnflags & PATH_ROTATE_ANGLES)
{
@@ -655,9 +713,10 @@ sounds

if (self.goalentity.noise != "")
sound (self, CHAN_VOICE, self.goalentity.noise,
- 1, ATTN_NORM);
+ VOL_MHI, ATTN_NORM);
else
- sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise,
+ VOL_MHI, ATTN_NORM);

if (self.goalentity.spawnflags & PATH_ROTATE_ANGLES)
{
@@ -691,7 +750,7 @@ sounds

if (self.goalentity.noise1 != "")
self.noise1 = self.goalentity.noise1;
- sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise1, VOL_MHI, ATTN_NORM);

self.goalentity = targ;
self.path = targ.target;
@@ -994,13 +1053,16 @@ sounds
func_rotate_train_init (self);
};
// };
+#endif

+#ifdef SSQC
//----------------------------------------------------------------------
void() rotate_train =
{
objerror ("rotate_train entities should be changed to "
"rotate_object with\nfunc_rotate_train controllers\n");
};
+#endif

//----------------------------------------------------------------------
// Moving clip walls
@@ -1021,6 +1083,47 @@ NONBLOCKING makes the brush non-solid. This is useless if VISIBLE is set.
//----------------------------------------------------------------------
// class func_movewall: base_rotate
// {
+#ifdef CSQC
+ //--------------------------------------------------------------
+ void(float isnew) func_movewall_netreceive =
+ {
+ local float netflags = ReadFloat ();
+ base_func_netreceive_read (isnew, netflags);
+
+ if (isnew)
+ func_movewall_init (self);
+
+ if (netflags & BASE_FUNC_NET_VELOCITY)
+ {
+ if (self.velocity != self.velocity_net)
+ {
+ if (self.velocity)
+ {
+ self.origin_start = self.origin;
+ self.movetime = time;
+ }
+ else
+ {
+ self.movetime = 0;
+ }
+ }
+ }
+
+ self.origin_net = self.origin;
+ self.velocity_net = self.velocity;
+
+ if (netflags & BASE_FUNC_NET_MODEL)
+ setmodelindex (self, self.modelindex);
+
+ if (netflags & BASE_FUNC_NET_SIZE)
+ setsize (self, self.mins, self.maxs);
+
+ if (netflags & BASE_FUNC_NET_ORIGIN)
+ setorigin (self, self.origin);
+ };
+#endif
+
+#ifdef SSQC
//--------------------------------------------------------------
void() func_movewall_touch =
{
@@ -1069,7 +1172,9 @@ NONBLOCKING makes the brush non-solid. This is useless if VISIBLE is set.
self.owner.attack_finished = time + 0.5;
}
};
+#endif

+#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void() func_movewall_think =
{
@@ -1088,29 +1193,54 @@ NONBLOCKING makes the brush non-solid. This is useless if VISIBLE is set.
e.angles = '0 0 0';
e.movetype = MOVETYPE_PUSH;

- if (e.spawnflags & MOVEWALL_NONBLOCKING)
- {
- e.solid = SOLID_NOT;
- }
- else
+ #ifdef CSQC
+ // only solid movewalls are networked to CSQC -- CEV
+ e.solid = SOLID_BSP;
+ e.customphysics = sub_null;
+ local vector savemin = e.mins;
+ local vector savemax = e.maxs;
+ setmodelindex (e, e.modelindex);
+ setsize (e, savemin, savemax);
+ setorigin (e, e.origin);
+ if (e.model && e.model != "")
{
- e.solid = SOLID_BSP;
- e.blocked = func_movewall_blocked;
+ // set a mask and predraw if we're visible -- CEV
+ e.drawmask = DRAWMASK_NORMAL;
+ e.predraw = base_func_predraw_solidpush;
}
+ #endif

+ #ifdef SSQC
if (e.spawnflags & MOVEWALL_TOUCH)
e.touch = func_movewall_touch;

- setmodel (e,e.model);
+ setmodel (e, e.model);

if (!(e.spawnflags & MOVEWALL_VISIBLE))
e.model = __NULL__;

+ if (e.spawnflags & MOVEWALL_NONBLOCKING)
+ {
+ e.solid = SOLID_NOT;
+ }
+ else
+ {
+ e.solid = SOLID_BSP;
+ e.blocked = func_movewall_blocked;
+ e.SendEntity = base_func_netsend;
+ e.SendFlags = BASE_FUNC_NET_ORIGIN |
+ BASE_FUNC_NET_SIZE | BASE_FUNC_NET_MODEL |
+ BASE_FUNC_NET_SPEED;
+ }
+
e.think = func_movewall_think;
e.nextthink = time + 0.02;
e.ltime = time;
+ #endif
};
+#endif

+#ifdef SSQC
//--------------------------------------------------------------
void() func_movewall =
{
@@ -1120,12 +1250,14 @@ NONBLOCKING makes the brush non-solid. This is useless if VISIBLE is set.

func_movewall_init (self);
};
+#endif
// };

//----------------------------------------------------------------------
// Rotating doors
//----------------------------------------------------------------------

+#ifdef SSQC
/*QUAKED func_rotate_door (0 .5 .8) (-8 -8 -8) (8 8 8) STAYOPEN 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

Creates a door that rotates between two positions around a point of
@@ -1166,7 +1298,7 @@ once door from closing again when it's blocked.
self.state = ROTATE_STATE_CLOSING;
}

- sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise2, VOL_MHI, ATTN_NORM);

self.rotate = (self.finaldest - start) * (1 / self.speed);
self.think = func_rotate_door_think;
@@ -1244,7 +1376,7 @@ once door from closing again when it's blocked.
self.state = ROTATE_STATE_CLOSED;
}

- sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise3, VOL_MHI, ATTN_NORM);
self.think = sub_null;

base_rotate_targets_final ();
@@ -1283,7 +1415,7 @@ once door from closing again when it's blocked.
self.state = ROTATE_STATE_CLOSING;
}

- sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise2, VOL_MHI, ATTN_NORM);

self.rotate = (self.finaldest - start) * (1 / self.speed);
self.think = func_rotate_door_think;
@@ -1387,3 +1519,4 @@ once door from closing again when it's blocked.
func_rotate_door_init (self);
};
// };
+#endif

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

Diff qc/func/shadow.qc

diff --git a/qc/func/shadow.qc b/qc/func/shadow.qc
index 0da150c..8dceb87 100644
--- a/qc/func/shadow.qc
+++ b/qc/func/shadow.qc
@@ -6,21 +6,26 @@
// constants
//======================================================================

+#ifdef SSQC
const float SHADOWCONTROLLER_STARTOFF = 1;
+#endif

//======================================================================
// fields
//======================================================================

+#ifdef SSQC
.float switchshadstyle;
.float shadowoff;
.entity shadowcontroller;
+#endif

//======================================================================
// forward declaration
//======================================================================

// misc_shadowcontroller
+#ifdef SSQC
void() misc_shadowcontroller_fade_out;
void() misc_shadowcontroller_fade_in;
void(entity sc, float speed) misc_shadowcontroller_setsteps;
@@ -29,10 +34,13 @@ entity(entity own, float sss, float spd, float sflags)
spawn_misc_shadowcontroller;
void(entity e) misc_shadowcontroller_init;
void() misc_shadowcontroller;
+#endif

// func_shadow
+#ifdef SSQC
void(entity e) func_shadow_init;
void() func_shadow;
+#endif

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

@@ -50,6 +58,7 @@ void() func_shadow;
//----------------------------------------------------------------------
// class misc_shadowcontroller: base_mapentity
// {
+#ifdef SSQC
//--------------------------------------------------------------
void() misc_shadowcontroller_fade_out =
{
@@ -260,11 +269,13 @@ void() func_shadow;

misc_shadowcontroller_init (self);
};
+#endif
// };

//----------------------------------------------------------------------
// class func_shadow: base_func
// {
+#ifdef SSQC
//--------------------------------------------------------------
void(entity e) func_shadow_init =
{
@@ -289,4 +300,5 @@ void() func_shadow;

func_shadow_init (self);
};
+#endif
// };

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

Diff qc/func/togglevisiblewall.qc

diff --git a/qc/func/togglevisiblewall.qc b/qc/func/togglevisiblewall.qc
index df01d45..bcfbca9 100644
--- a/qc/func/togglevisiblewall.qc
+++ b/qc/func/togglevisiblewall.qc
@@ -14,23 +14,28 @@
// constants
//======================================================================

+#ifdef SSQC
const float TOGGLEVISWALL_STARTOFF = 1;
const float TOGGLEVISWALL_NOTSOLID = 2;
+#endif

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

// func_togglevisiblewall
+#ifdef SSQC
void() func_togglevisiblewall_use;
void(entity e) func_togglevisiblewall_init;
void() func_togglevisiblewall;
+#endif

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

//----------------------------------------------------------------------
// class func_togglevisiblewall: base_func
// {
+#ifdef SSQC
//--------------------------------------------------------------
void() func_togglevisiblewall_use =
{
@@ -65,8 +70,8 @@ void() func_togglevisiblewall;
base_func_init (e);

e.angles = '0 0 0';
- e.use = func_togglevisiblewall_use;

+ e.use = func_togglevisiblewall_use;
e.origmodel = e.model;

if (e.spawnflags & TOGGLEVISWALL_STARTOFF)
@@ -92,4 +97,5 @@ void() func_togglevisiblewall;

func_togglevisiblewall_init (self);
};
+#endif
// };

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

Diff qc/func/togglewall.qc

diff --git a/qc/func/togglewall.qc b/qc/func/togglewall.qc
index 00f6078..2834cd9 100644
--- a/qc/func/togglewall.qc
+++ b/qc/func/togglewall.qc
@@ -12,17 +12,38 @@
// constants
//======================================================================

+#ifdef SSQC
const float TOGGLEWALL_START_OFF = 1;
+#endif
+
+#if defined(CSQC) || defined(SSQC)
+enumflags
+{
+ TOGGLEWALL_NET_MODEL, // wall model has changed
+ TOGGLEWALL_NET_ORIGIN, // wall origin has changed
+ TOGGLEWALL_NET_SIZE // wall size has changed
+};
+#endif

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

// func_togglewall
+#ifdef CSQC
+void(float isnew) func_togglewall_netreceive;
+#endif
+#ifdef SSQC
+float(entity to, float netflags) func_togglewall_netsend;
void() func_togglewall_touch;
void() func_togglewall_use;
+#endif
+#if defined(CSQC) || defined(SSQC)
void(entity e) func_togglewall_init;
+#endif
+#ifdef SSQC
void() func_togglewall;
+#endif

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

@@ -39,6 +60,76 @@ TOGGLEWALL_START_OFF wall doesn't block until triggered.
//----------------------------------------------------------------------
// class func_togglewall: base_func
// {
+#ifdef CSQC
+ //--------------------------------------------------------------
+ void(float isnew) func_togglewall_netreceive =
+ {
+ local float netflags = ReadFloat ();
+
+ if (netflags & TOGGLEWALL_NET_MODEL)
+ self.modelindex = ReadFloat ();
+
+ if (netflags & TOGGLEWALL_NET_ORIGIN)
+ {
+ self.origin_x = ReadCoord ();
+ self.origin_y = ReadCoord ();
+ self.origin_z = ReadCoord ();
+ }
+
+ if (netflags & TOGGLEWALL_NET_SIZE)
+ {
+ self.mins_x = ReadCoord ();
+ self.mins_y = ReadCoord ();
+ self.mins_z = ReadCoord ();
+ self.maxs_x = ReadCoord ();
+ self.maxs_y = ReadCoord ();
+ self.maxs_z = ReadCoord ();
+ }
+
+ if (isnew)
+ func_togglewall_init (self);
+
+ if (netflags & TOGGLEWALL_NET_MODEL)
+ setmodelindex (self, self.modelindex);
+
+ if (netflags & TOGGLEWALL_NET_SIZE)
+ setsize (self, self.mins, self.maxs);
+
+ if (netflags & TOGGLEWALL_NET_ORIGIN)
+ setorigin (self, self.origin);
+ };
+#endif
+
+#ifdef SSQC
+ //--------------------------------------------------------------
+ float(entity to, float netflags) func_togglewall_netsend =
+ {
+ WriteFloat (MSG_ENTITY, self.classtype);
+ WriteFloat (MSG_ENTITY, netflags);
+
+ if (netflags & TOGGLEWALL_NET_MODEL)
+ WriteFloat (MSG_ENTITY, self.modelindex);
+
+ if (netflags & TOGGLEWALL_NET_ORIGIN)
+ {
+ WriteCoord (MSG_ENTITY, self.origin_x);
+ WriteCoord (MSG_ENTITY, self.origin_y);
+ WriteCoord (MSG_ENTITY, self.origin_z);
+ }
+
+ if (netflags & TOGGLEWALL_NET_SIZE)
+ {
+ WriteCoord (MSG_ENTITY, self.mins_x);
+ WriteCoord (MSG_ENTITY, self.mins_y);
+ WriteCoord (MSG_ENTITY, self.mins_z);
+ WriteCoord (MSG_ENTITY, self.maxs_x);
+ WriteCoord (MSG_ENTITY, self.maxs_y);
+ WriteCoord (MSG_ENTITY, self.maxs_z);
+ }
+
+ return TRUE;
+ };
+
//--------------------------------------------------------------
void() func_togglewall_touch =
{
@@ -50,7 +141,7 @@ TOGGLEWALL_START_OFF wall doesn't block until triggered.

self.attack_finished = time + 0.5;
t_damage2 (other, self, self, self.dmg);
- sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise1, VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
@@ -60,16 +151,22 @@ TOGGLEWALL_START_OFF wall doesn't block until triggered.
{
self.state = 1;
setorigin (self, self.origin - '8000 8000 8000');
- // sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
+ // sound (self, CHAN_VOICE, self.noise1,
+ // VOL_HIGH, ATTN_NORM);
}
else
{
self.state = 0;
setorigin (self, self.origin + '8000 8000 8000');
- sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise,
+ VOL_HIGH, ATTN_NORM);
}
+
+ self.SendFlags = TOGGLEWALL_NET_ORIGIN;
};
+#endif

+#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void(entity e) func_togglewall_init =
{
@@ -77,6 +174,7 @@ TOGGLEWALL_START_OFF wall doesn't block until triggered.
e.classtype = CT_FUNC_TOGGLEWALL;
base_func_init (e);

+ #ifdef SSQC
e.movetype = MOVETYPE_PUSH;
e.mdl = e.model;
setmodel (e, e.model);
@@ -94,10 +192,12 @@ TOGGLEWALL_START_OFF wall doesn't block until triggered.

precache_sound (e.noise);
precache_sound (e.noise1);
+ #endif

e.solid = SOLID_BSP;
e.model = __NULL__;

+ #ifdef SSQC
if (e.spawnflags & TOGGLEWALL_START_OFF)
{
e.state = 0;
@@ -106,10 +206,17 @@ TOGGLEWALL_START_OFF wall doesn't block until triggered.
else
{
e.state = 1;
- sound (e, CHAN_VOICE, e.noise1, 1, ATTN_NORM);
+ sound (e, CHAN_VOICE, e.noise1, VOL_HIGH, ATTN_NORM);
}
+
+ e.SendEntity = func_togglewall_netsend;
+ e.SendFlags = TOGGLEWALL_NET_MODEL | TOGGLEWALL_NET_ORIGIN |
+ TOGGLEWALL_NET_SIZE;
+ #endif
};
+#endif

+#ifdef SSQC
//--------------------------------------------------------------
void() func_togglewall =
{
@@ -119,4 +226,5 @@ TOGGLEWALL_START_OFF wall doesn't block until triggered.

func_togglewall_init (self);
};
+#endif
// };

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

Diff qc/func/train.qc

diff --git a/qc/func/train.qc b/qc/func/train.qc
index 8add9e9..085f156 100644
--- a/qc/func/train.qc
+++ b/qc/func/train.qc
@@ -6,6 +6,7 @@
// constants
//======================================================================

+#ifdef SSQC
const float TRAIN_RETRIGGER = 1;
const float TRAIN_MOVEONTRIGGER = 2;
const float TRAIN_STOPONTRIGGER = 4;
@@ -18,30 +19,45 @@ const float TRAIN_NEXT_WAIT = 0; // normal movement
const float TRAIN_NEXT_STOP = 1; // force a stop on the next path_corner
const float TRAIN_NEXT_CONTINUE = 2; // force continue on the next
// path_corner (ignores wait time)
+#endif

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

// base_func_train
+#ifdef SSQC
void() base_func_train_blocked;
void() base_func_train_use_stopped;
void() base_func_train_use_moving;
void() base_func_train_wait;
void() base_func_train_next;
void() base_func_train_find;
+#endif
+#if defined(CSQC) || defined(SSQC)
void(entity e) base_func_train_init;
+#endif
+#ifdef SSQC
strip void() base_func_train;
+#endif

// func_train
+#ifdef CSQC
+void(float isnew) func_train_netreceive;
+#endif
+#if defined(CSQC) || defined(SSQC)
void(entity e) func_train_init;
+#endif
+#ifdef SSQC
void() func_train;
+#endif

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

//----------------------------------------------------------------------
// class base_func_train: base_func
// {
+#ifdef SSQC
//--------------------------------------------------------------
void() base_func_train_blocked =
{
@@ -168,6 +184,10 @@ void() func_train;
// state: stopped
self.state = 0;

+ self.SendFlags |= BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN |
+ BASE_FUNC_NET_VELOCITY;
+
// oof -- CEV
if (self.classtype == CT_MISC_MODELTRAIN)
{
@@ -181,10 +201,10 @@ void() func_train;
// sound, play that instead
if (self.enemy.noise != "")
sound (self, CHAN_WEAPON, self.enemy.noise,
- 1, ATTN_NORM);
+ VOL_MHI, ATTN_NORM);
else
sound (self, CHAN_VOICE, self.noise,
- 1, ATTN_NORM);
+ VOL_MHI, ATTN_NORM);
}
// train is moving normally and path_corner has no wait time,
// or has been forced to move instantly through a triggering.
@@ -195,10 +215,10 @@ void() func_train;
// a custom one, play that instead
if (self.enemy.noise2 != "")
sound (self, CHAN_WEAPON, self.enemy.noise2,
- 1, ATTN_NORM);
+ VOL_MHI, ATTN_NORM);
else if (self.noise2 != "")
sound (self, CHAN_WEAPON, self.noise2,
- 1, ATTN_NORM);
+ VOL_MHI, ATTN_NORM);

// move instantly
self.nextthink = -1;
@@ -213,14 +233,18 @@ void() func_train;
// sound, play that instead
if (self.enemy.noise != "")
sound (self, CHAN_WEAPON, self.enemy.noise,
- 1, ATTN_NORM);
+ VOL_MHI, ATTN_NORM);
else
sound (self, CHAN_VOICE, self.noise,
- 1, ATTN_NORM);
+ VOL_MHI, ATTN_NORM);

// state: stopped
self.state = 0;

+ self.SendFlags |= BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN |
+ BASE_FUNC_NET_VELOCITY;
+
// oof -- CEV
if (self.classtype == CT_MISC_MODELTRAIN)
{
@@ -268,7 +292,7 @@ void() func_train;

self.enemy = targ;

- sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise1, VOL_MHI, ATTN_NORM);

if (!(!self.wait && self.cnt == TRAIN_NEXT_CONTINUE))
self.cnt = TRAIN_NEXT_WAIT;
@@ -334,6 +358,9 @@ void() func_train;

sub_calcmove (self, targ.origin - (displ * do_displace),
self.speed2, base_func_train_wait);
+
+ self.SendFlags |= BASE_FUNC_NET_SPEED |
+ BASE_FUNC_NET_ORIGIN | BASE_FUNC_NET_VELOCITY;
};

//--------------------------------------------------------------
@@ -365,6 +392,11 @@ void() func_train;

self.enemy = targ;
setorigin (self, targ.origin - (displ * do_displace));
+
+ // If you set SendFlags here it will cause a movement error
+ // on the client; let the next think take care of it -- CEV
+ self.SendFlags |= BASE_FUNC_NET_ORIGIN;
+
if (targ.speed)
// uses speed from the 1st path corner if set
self.speed2 = targ.speed;
@@ -376,12 +408,15 @@ void() func_train;
self.nextthink = localtime + 0.1;
}
};
+#endif

+#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void(entity e) base_func_train_init =
{
base_func_init (e);

+ #ifdef SSQC
if (!e.speed)
e.speed = 100;
if (!e.target)
@@ -461,13 +496,39 @@ void() func_train;
e.nextthink = e.ltime + 0.1;
else
e.nextthink = time + 0.1;
+
+ if (e.solid == SOLID_BSP)
+ {
+ e.SendEntity = base_func_netsend;
+ e.SendFlags = BASE_FUNC_NET_ORIGIN |
+ BASE_FUNC_NET_SIZE | BASE_FUNC_NET_MODEL |
+ BASE_FUNC_NET_SPEED;
+ }
+ #endif
+
+ #ifdef CSQC
+ // networked trains are always SOLID_BSP & MOVETYPE_PUSH
+ e.drawmask = DRAWMASK_NORMAL;
+ e.predraw = base_func_predraw_solidpush;
+ e.solid = SOLID_BSP;
+ e.movetype = MOVETYPE_PUSH;
+
+ // make sure model, size, and origin are set -- CEV
+ setmodelindex (e, e.modelindex);
+ setsize (e, e.mins , e.maxs);
+ setorigin (e, e.origin);
+ #endif
+
};
+#endif

+#ifdef SSQC
//--------------------------------------------------------------
strip void() base_func_train =
{
base_func_train_init (self);
};
+#endif
// };

/*QUAKED func_train (0 .5 .8) ? RETRIGGER
@@ -488,6 +549,47 @@ sounds
//----------------------------------------------------------------------
// class func_train: base_func_train
// {
+#ifdef CSQC
+ //--------------------------------------------------------------
+ void(float isnew) func_train_netreceive =
+ {
+ local float netflags = ReadFloat ();
+ base_func_netreceive_read (isnew, netflags);
+
+ if (isnew)
+ func_train_init (self);
+
+ if (netflags & BASE_FUNC_NET_VELOCITY)
+ {
+ if (self.velocity != self.velocity_net)
+ {
+ if (self.velocity)
+ {
+ self.origin_start = self.origin;
+ self.movetime = time;
+ }
+ else
+ {
+ self.movetime = 0;
+ }
+ }
+ }
+
+ self.origin_net = self.origin;
+ self.velocity_net = self.velocity;
+
+ if (netflags & BASE_FUNC_NET_MODEL)
+ setmodelindex (self, self.modelindex);
+
+ if (netflags & BASE_FUNC_NET_SIZE)
+ setsize (self, self.mins, self.maxs);
+
+ if (netflags & BASE_FUNC_NET_ORIGIN)
+ setorigin (self, self.origin);
+ };
+#endif
+
+#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void(entity e) func_train_init =
{
@@ -496,7 +598,9 @@ sounds

base_func_train_init (e);
};
+#endif

+#ifdef SSQC
//--------------------------------------------------------------
void() func_train =
{
@@ -506,4 +610,5 @@ sounds

func_train_init (self);
};
+#endif
// };

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

Diff qc/func/wall.qc

diff --git a/qc/func/wall.qc b/qc/func/wall.qc
index 87d5f6e..6af3038 100644
--- a/qc/func/wall.qc
+++ b/qc/func/wall.qc
@@ -6,17 +6,22 @@
// forward declarations
//======================================================================

+#ifdef SSQC
// base_func_wall
void() base_func_wall_use;
void(entity e) base_func_wall_init;
strip void() base_func_wall;
+#endif

+#ifdef SSQC
// func_wall
void(entity e) func_wall_init;
void() func_wall;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// class base_func_wall: base_func
// {
@@ -44,7 +49,9 @@ void() func_wall;
base_func_wall_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED func_wall (0 .5 .8) ? 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
This is just a solid wall if not inhibitted
*/
@@ -77,3 +84,4 @@ This is just a solid wall if not inhibitted
func_wall_init (self);
};
// };
+#endif

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

Diff qc/hazards/ltrail.qc

diff --git a/qc/hazards/ltrail.qc b/qc/hazards/ltrail.qc
index 43da3bd..72bb99e 100644
--- a/qc/hazards/ltrail.qc
+++ b/qc/hazards/ltrail.qc
@@ -12,37 +12,48 @@
// constants
//======================================================================

+#ifdef SSQC
const float LTRAIL_TOGGLE = 1;
const float LTRAIL_ACTIVE = 2;
+#endif

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

// base_hazard_ltrail
+#ifdef SSQC
void() base_hazard_ltrail_chain;
void() base_hazard_ltrail_fire;
void() base_hazard_ltrail_use;
void(entity e) base_hazard_ltrail_init;
strip void() base_hazard_ltrail;
+#endif

// ltrail_start
+#ifdef SSQC
void(entity e) ltrail_start_init;
void() ltrail_start;
+#endif

// ltrail_relay
+#ifdef SSQC
void(entity e) ltrail_relay_init;
void() ltrail_relay;
+#endif

// ltrail_end
+#ifdef SSQC
void(entity e) ltrail_end_init;
void() ltrail_end;
+#endif

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

//----------------------------------------------------------------------
// class base_hazard_ltrail: base_mapentity
// {
+#ifdef SSQC
//--------------------------------------------------------------
void() base_hazard_ltrail_chain =
{
@@ -59,7 +70,7 @@ void() ltrail_end;

if (!self.sounds)
sound (self, CHAN_VOICE, "weapons/lhit.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

targent = find (world, targetname, self.target);
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
@@ -168,6 +179,7 @@ void() ltrail_end;
{
base_hazard_ltrail_init (self);
};
+#endif
// };

/*QUAKED ltrail_start (0 1 0) (-8 -8 -8) (8 8 8) LT_TOGGLE START_ON 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
@@ -187,6 +199,7 @@ Set the LT_TOGGLE checkbox if you want the lightning shooter to continuously fir
//----------------------------------------------------------------------
// class ltrail_start: base_hazard_ltrail
// {
+#ifdef SSQC
//--------------------------------------------------------------
void(entity e) ltrail_start_init =
{
@@ -215,6 +228,7 @@ Set the LT_TOGGLE checkbox if you want the lightning shooter to continuously fir

ltrail_start_init (self);
};
+#endif
// };

/*QUAKED ltrail_relay (0 1 0) (-8 -8 -8) (8 8 8) 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
@@ -231,6 +245,7 @@ Default is 0.3 seconds.
//----------------------------------------------------------------------
// class ltrail_relay: base_hazard_ltrail
// {
+#ifdef SSQC
//--------------------------------------------------------------
void(entity e) ltrail_relay_init =
{
@@ -249,6 +264,7 @@ Default is 0.3 seconds.

ltrail_relay_init (self);
};
+#endif
// };

/*QUAKED ltrail_end (0 1 0) (-8 -8 -8) (8 8 8) 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
@@ -261,6 +277,7 @@ Default is 0.3 seconds.
//----------------------------------------------------------------------
// class ltrail_end: base_hazard_ltrail
// {
+#ifdef SSQC
//--------------------------------------------------------------
void(entity e) ltrail_end_init =
{
@@ -279,4 +296,5 @@ Default is 0.3 seconds.

ltrail_end_init (self);
};
+#endif
// };

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

Diff qc/hazards/shooter.qc

diff --git a/qc/hazards/shooter.qc b/qc/hazards/shooter.qc
index 6cfa1e5..3a3f348 100644
--- a/qc/hazards/shooter.qc
+++ b/qc/hazards/shooter.qc
@@ -8,6 +8,7 @@
// constants
//======================================================================

+#ifdef SSQC
const float SHOOTER_SPAWNFLAG_SUPERSPIKE = 1;
const float SHOOTER_SPAWNFLAG_LASER = 2;
const float SHOOTER_SPAWNFLAG_LAVABALL = 4;
@@ -16,35 +17,45 @@ const float SHOOTER_SPAWNFLAG_VOREBALL = 16;
const float SHOOTER_SPAWNFLAG_GRENADE = 32;
const float SHOOTER_SPAWNFLAG_GIBS = 64;
const float SHOOTER_SPAWNFLAG_SILENT = 128;
+#endif

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

// base_hazard_shooter
+#ifdef SSQC
void() base_hazard_shooter_think;
void() base_hazard_shooter_use;
void(entity e) base_hazard_shooter_init;
strip void() base_hazard_shooter;
+#endif

// trap_spikeshooter
+#ifdef SSQC
void(entity e) trap_spikeshooter_init;
void() trap_spikeshooter;
+#endif

// trap_shooter
+#ifdef SSQC
void(entity e) trap_shooter_init;
void() trap_shooter;
+#endif

// trap_switched_shooter
+#ifdef SSQC
void() trap_switched_shooter_use;
void(entity e) trap_switched_shooter_init;
void() trap_switched_shooter;
+#endif

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

//----------------------------------------------------------------------
// class base_hazard_shooter: base_mapentity
// {
+#ifdef SSQC
//--------------------------------------------------------------
// shooter_think -- MED 11/01/96 added state capability
//--------------------------------------------------------------
@@ -68,7 +79,7 @@ void() trap_switched_shooter;
{
if (!(self.spawnflags & SHOOTER_SPAWNFLAG_SILENT))
sound (self, CHAN_VOICE, "enforcer/enfire.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

local vector laser_velocity = normalize (self.movedir);
// SetSpeed
@@ -85,7 +96,7 @@ void() trap_switched_shooter;
if (!(self.spawnflags & SHOOTER_SPAWNFLAG_SILENT))
// dms
sound (self, CHAN_VOICE, "boss1/throw.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

spawn_projectile_lavaball (self, self.origin,
self.movedir * 600);
@@ -94,7 +105,7 @@ void() trap_switched_shooter;
{
if (!(self.spawnflags & SHOOTER_SPAWNFLAG_SILENT))
sound (self, CHAN_VOICE, "weapons/sgun1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

spawn_projectile_rocket (self, self.origin,
self.movedir * ROCKET_SPEED,
@@ -104,7 +115,7 @@ void() trap_switched_shooter;
{
if (!(self.spawnflags & SHOOTER_SPAWNFLAG_SILENT))
sound (self, CHAN_VOICE, "shalrath/attack2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

spawn_projectile_voreball (self, self.origin,
self.movedir * VOREBALL_SPEED,
@@ -114,7 +125,7 @@ void() trap_switched_shooter;
{
if (!(self.spawnflags & SHOOTER_SPAWNFLAG_SILENT))
sound (self, CHAN_VOICE, "weapons/grenade.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

local vector gnade_velocity = self.movedir * 600 +
v_up * 200 + crandom() * v_right * 10 +
@@ -127,7 +138,7 @@ void() trap_switched_shooter;
{
if (!(self.spawnflags & SHOOTER_SPAWNFLAG_SILENT))
sound (self, CHAN_VOICE, "zombie/z_shot1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

local vector znade_velocity = self.movedir * 600 +
v_up * 200 + crandom() * v_right * 10 +
@@ -141,7 +152,7 @@ void() trap_switched_shooter;
if (!(self.spawnflags & SHOOTER_SPAWNFLAG_SILENT))
// changed vol fromt 1 to 0.666 -- CEV
sound (self, CHAN_VOICE, "weapons/spike2.wav",
- 0.666, ATTN_NORM);
+ VOL_MID, ATTN_NORM);

local float damage;

@@ -216,6 +227,7 @@ void() trap_switched_shooter;
{
base_hazard_shooter_init (self);
};
+#endif
// };

/*QUAKED trap_spikeshooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser lavaball rocket silent 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
@@ -226,7 +238,7 @@ Laser is only for REGISTERED.
//----------------------------------------------------------------------
// class trap_spikeshooter: base_hazard_shooter
// {
-
+#ifdef SSQC
//--------------------------------------------------------------
void(entity e) trap_spikeshooter_init =
{
@@ -244,6 +256,7 @@ Laser is only for REGISTERED.

trap_spikeshooter_init (self);
};
+#endif
// };

/*QUAKED trap_shooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser lavaball rocket silent 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
@@ -254,6 +267,7 @@ Continuously fires spikes.
//----------------------------------------------------------------------
// class trap_shooter: base_hazard_shooter
// {
+#ifdef SSQC
//--------------------------------------------------------------
void(entity e) trap_shooter_init =
{
@@ -278,6 +292,7 @@ Continuously fires spikes.

trap_shooter_init (self);
};
+#endif
// };

//MED 11/01/96 added new function
@@ -290,6 +305,7 @@ Continuously fires spikes.
//----------------------------------------------------------------------
// class trap_switched_shooter: base_hazard_shooter
// {
+#ifdef SSQC
//--------------------------------------------------------------
// trap_shooter_use -- MED 11/01/96 added new use function
//--------------------------------------------------------------
@@ -322,4 +338,5 @@ Continuously fires spikes.

trap_switched_shooter_init (self);
};
+#endif
// };

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

Diff qc/info/path_corner.qc

diff --git a/qc/info/path_corner.qc b/qc/info/path_corner.qc
index dc8ff3d..5c5b038 100644
--- a/qc/info/path_corner.qc
+++ b/qc/info/path_corner.qc
@@ -44,7 +44,7 @@ Monsters will continue walking towards the next target corner.
if (self.classtype == CT_MONSTER_OGRE)
// chainsaw drag sound -- sound_custom -- dumptruck_ds
sound_misc (self, CHAN_VOICE, "ogre/ogdrag.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);

// dprint ("t_movetarget\n");
self.goalentity = self.movetarget = find (world, targetname,

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

Diff qc/items/ammo.qc

diff --git a/qc/items/ammo.qc b/qc/items/ammo.qc
index cb32cb4..f4072f4 100644
--- a/qc/items/ammo.qc
+++ b/qc/items/ammo.qc
@@ -6,6 +6,7 @@
// constants
//======================================================================

+#ifdef SSQC
const float WEAPON_BIG2 = 1;

const float AMMO_RESPAWN_TIME = 30; // ammo respawn time; id1 30s
@@ -21,40 +22,52 @@ const float AMMO_ROCKETS_MAX = 100; // id1 maximum 100
const float AMMO_SHELLS_SMALL = 20; // id1 20; small box of shells
const float AMMO_SHELLS_BIG = 40; // id1 40; large box of shells
const float AMMO_SHELLS_MAX = 100; // id1 maximum 100
+#endif

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

+#ifdef SSQC
// base_item_ammo
entity(entity src, vector org, float flags, void(entity) initfn)
spawn_item_ammo_n;
void() base_item_ammo_touch;
void(entity e) base_item_ammo_init;
strip void() base_item_ammo;
+#endif

+#ifdef SSQC
// item_shells
entity(entity src, vector org, float flags) spawn_item_shells;
void(entity e) item_shells_init;
void() item_shells;
+#endif

+#ifdef SSQC
// item_spikes
entity(entity src, vector org, float flags) spawn_item_spikes;
void(entity e) item_spikes_init;
void() item_spikes;
+#endif

+#ifdef SSQC
// item_rockets
entity(entity src, vector org, float flags) spawn_item_rockets;
void(entity e) item_rockets_init;
void() item_rockets;
+#endif

+#ifdef SSQC
// item_cells
entity(entity src, vector org, float flags) spawn_item_cells;
void(entity e) item_cells_init;
void() item_cells;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// class base_item_ammo: base_item
// {
@@ -124,7 +137,8 @@ void() item_cells;

sprint (other, sprintf("You got the %s\n", self.netname));
// ammo touch sound
- sound (other, CHAN_ITEM, "weapons/lock4.wav", 1, ATTN_NORM);
+ sound (other, CHAN_ITEM, "items/ammo_pickup.ogg",
+ VOL_MHI, ATTN_NORM);
stuffcmd (other, "bf\n");

// change to a better weapon if appropriate
@@ -138,9 +152,7 @@ void() item_cells;

// if changed current ammo, update it
if (other.classtype == CT_PLAYER)
- {
sub_runvoidas (other, player_set_current_ammo);
- }

// remove it in single player, or setup for respawning in DM
self.solid = SOLID_NOT;
@@ -167,7 +179,9 @@ void() item_cells;
base_item_ammo_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED item_shells (0 .5 .8) (0 0 0) (32 32 32) LARGE_BOX X X X X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER RESPAWN_WITH_DM_EFFECTS NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{
model ( {{ spawnflags & 1 -> { "path" : "maps/b_shell1.bsp" }, "maps/b_shell0.bsp" }} );
@@ -248,7 +262,9 @@ LARGE_BOX is a box of 40 shells.
item_shells_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED item_spikes (0 .5 .8) (0 0 0) (32 32 32) LARGE_BOX X X X X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER RESPAWN_WITH_DM_EFFECTS NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{
model ( {{ spawnflags & 1 -> { "path" : "maps/b_nail1.bsp" }, "maps/b_nail0.bsp" }} );
@@ -327,7 +343,9 @@ LARGE_BOX is a box of 50 nails.
item_spikes_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED item_rockets (0 .5 .8) (0 0 0) (32 32 32) LARGE_BOX X X X X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER RESPAWN_WITH_DM_EFFECTS NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{
model ( {{ spawnflags & 1 -> { "path" : "maps/b_rock1.bsp" }, "maps/b_rock0.bsp" }} );
@@ -404,7 +422,9 @@ LARGE_BOX is a box of 50 nails.
item_rockets_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED item_cells (0 .5 .8) (0 0 0) (32 32 32) LARGE_BOX X X X X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER RESPAWN_WITH_DM_EFFECTS NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{
model ( {{ spawnflags & 1 -> { "path" : "maps/b_batt1.bsp" }, "maps/b_batt0.bsp" }} );
@@ -484,3 +504,4 @@ LARGE_BOX is a box of 12 cells.
item_cells_init (self);
};
// };
+#endif

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

Diff qc/items/armor.qc

diff --git a/qc/items/armor.qc b/qc/items/armor.qc
index 3642917..4fda159 100644
--- a/qc/items/armor.qc
+++ b/qc/items/armor.qc
@@ -6,6 +6,7 @@
// constants
//======================================================================

+#ifdef SSQC
const float ARMOR_GREEN_ABSORB = 0.3; // absorb percent; id1 0.3
const float ARMOR_GREEN_AMOUNT = 100; // amount per pickup; id1 100
const float ARMOR_GREEN_MAX = 125; // id1 125
@@ -22,42 +23,54 @@ const float ARMOR_SHARD_AMOUNT = 5; // Q3 5

const float ARMOR_RESPAWN_SP = 30; // id1 30s
const float ARMOR_RESPAWN_DM = 20; // id1 20s
+#endif

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

+#ifdef SSQC
// base_item_armor
entity(entity src, vector org, vector vel, void(entity) initfn)
spawn_item_armor;
void() base_item_armor_touch;
void(entity e) base_item_armor_init;
strip void() base_item_armor;
+#endif

+#ifdef SSQC
// item_armor1
entity(entity src, vector org, vector vel) spawn_item_armor1;
void(entity e) item_armor1_init;
void() item_armor1;
+#endif

+#ifdef SSQC
// item_armor2
entity(entity src, vector org, vector vel) spawn_item_armor2;
void(entity e) item_armor2_init;
void() item_armor2;
+#endif

+#ifdef SSQC
// item_armorInv
entity(entity src, vector org, vector vel) spawn_item_armorInv;
void(entity e) item_armorInv_init;
void() item_armorInv;
+#endif

+#ifdef SSQC
// item_armor_shard
void() item_armor_shard_touch;
entity(entity src) item_armor_shard_drop;
entity(entity src, vector org, vector vel) spawn_item_armor_shard;
void(entity e) item_armor_shard_init;
void() item_armor_shard;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// class base_item_armor: base_item
// {
@@ -136,10 +149,10 @@ void() item_armor_shard;
// dumptruck_ds custom models and sounds START
if (self.snd_misc != "")
sound_misc (other, CHAN_ITEM, self.snd_misc,
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
else
sound_misc (other, CHAN_ITEM,"items/armor1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
// dumptruck_ds custom models and sounds END

stuffcmd (other, "bf\n");
@@ -162,7 +175,9 @@ void() item_armor_shard;
base_item_armor_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED item_armor1 (0 .5 .8) (-16 -16 0) (16 16 32) X X X X X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER RESPAWN_WITH_DM_EFFECTS NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{
model ("progs/armor.mdl");
@@ -210,7 +225,9 @@ model ("progs/armor.mdl");
item_armor1_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED item_armor2 (0 .5 .8) (-16 -16 0) (16 16 32) X X X X X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER RESPAWN_WITH_DM_EFFECTS NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{ model({ "path": ":progs/armor.mdl", "skin": 1 }); }
*/
@@ -256,7 +273,9 @@ model ("progs/armor.mdl");
item_armor2_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED item_armorInv (0 .5 .8) (-16 -16 0) (16 16 32) X X X X X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER RESPAWN_WITH_DM_EFFECTS NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{
model({ "path": ":progs/armor.mdl", "skin": 2 });
@@ -304,7 +323,9 @@ model({ "path": ":progs/armor.mdl", "skin": 2 });
item_armorInv_init (self);
};
// };
+#endif

+#ifdef SSQC
//------------------------------------------------------------------------------
// item_armor_shard
//------------------------------------------------------------------------------
@@ -387,10 +408,10 @@ model({ "path": ":progs/armor.mdl", "skin": 2 });
// dumptruck_ds custom models and sounds START
if (self.snd_misc != "")
sound_misc (other, CHAN_AUTO, self.snd_misc,
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
else
sound_misc (other, CHAN_AUTO,
- "items/armor_shard_q3.wav", 1, ATTN_NORM);
+ "items/shard_pickup.ogg", VOL_MID, ATTN_NORM);

// dumptruck_ds custom models and sounds END
stuffcmd (other, "bf\n");
@@ -449,3 +470,4 @@ model({ "path": ":progs/armor.mdl", "skin": 2 });
item_armor_shard_init (self);
};
// };
+#endif

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

Diff qc/items/backpacks.qc

diff --git a/qc/items/backpacks.qc b/qc/items/backpacks.qc
index 2f2936f..0da8475 100644
--- a/qc/items/backpacks.qc
+++ b/qc/items/backpacks.qc
@@ -6,28 +6,33 @@
// constants -- dumptruck_ds
//======================================================================

+#ifdef SSQC
const float BACKPACK_DEFAULT = 1;
const float BACKPACK_SHELLS = 2;
const float BACKPACK_NAILS = 4;
const float BACKPACK_ROCKETS = 8;
const float BACKPACK_CELLS = 16;
const float BACKPACK_DROPPED = 32;
+#endif

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

+#ifdef SSQC
// item_backpack
void() item_backpack_touch;
entity(entity src) item_backpack_drop;
entity(entity src, vector org, vector vel) spawn_item_backpack;
void(entity e) item_backpack_init;
void() item_backpack;
+#endif

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

// Some of this text is from Drake -- dumptruck_ds

+#ifdef SSQC
/*QUAKED item_backpack (0 .5 .8) (-16 -16 0) (16 16 72) SHELLS NAILS ROCKETS CELLS X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR 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
{ model("progs/backpack.mdl"); }
By default, gives roughly half the ammo from the 4 standard pickups:
@@ -158,8 +163,8 @@ e.g. For 'You got a bunch of rockets!' the netname key would be

sprint (other, "\n");
// backpack touch sound
- sound (other, CHAN_ITEM, "weapons/lock4.wav",
- 1, ATTN_NORM);
+ sound (other, CHAN_ITEM, "items/backpack_pickup.wav",
+ VOL_HIGH, ATTN_NORM);
stuffcmd (other, "bf\n");

if (other.classtype == CT_PLAYER)
@@ -207,10 +212,10 @@ e.g. For 'You got a bunch of rockets!' the netname key would be
}

// backpack touch sound
- // sound (other, CHAN_ITEM, "weapons/lock4.wav",
- // 1, ATTN_NORM);
+ // sound (other, CHAN_ITEM, "items/backpack_pickup.wav",
+ // VOL_HIGH, ATTN_NORM);
sound_misc (other, CHAN_ITEM, self.snd_misc,
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
remove (self);

if (other.classtype == CT_PLAYER)
@@ -330,7 +335,7 @@ e.g. For 'You got a bunch of rockets!' the netname key would be

// set the custom noise in editor -- dumptruck_ds
if (!e.snd_misc)
- e.snd_misc = "weapons/lock4.wav";
+ e.snd_misc = "items/backpack_pickup.wav";
precache_sound_misc (e, e.snd_misc);

if (e.spawnflags & BACKPACK_DROPPED)
@@ -370,3 +375,4 @@ e.g. For 'You got a bunch of rockets!' the netname key would be
};

// };
+#endif

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

Diff qc/items/health.qc

diff --git a/qc/items/health.qc b/qc/items/health.qc
index d318739..3612eaa 100644
--- a/qc/items/health.qc
+++ b/qc/items/health.qc
@@ -6,6 +6,7 @@
// constants
//======================================================================

+#ifdef SSQC
// constants spawnflags
const float HEALTH_ROTTEN = 1; // rotten health box
const float HEALTH_MEGA = 2; // megahealth
@@ -24,39 +25,51 @@ const float HEALTH_VIAL_AMOUNT = 5; // vial heal amount; Quake3 5
const float HEALTH_RESPAWN_DM = 20; // deathmatch respawn time; id1 20
const float HEALTH_RESPAWN_SP = 30; // singleplayer respawn time; id1 30
const float HEALTH_RESPAWN_MEGA = 125; // fixed mega respawn time; pd3 125
+#endif

//======================================================================
// fields
//======================================================================

+#ifdef SSQC
.float healamount;
.float healtype;
+#endif

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

+#ifdef SSQC
// TODO CEV rework the damage system
float (entity e, float healamount, float ignore) T_Heal;
+#endif

+#ifdef SSQC
// base_item_health
void() base_item_health_touch;
void(entity e) base_item_health_init;
strip void() base_item_health;
+#endif

+#ifdef SSQC
// item_health
entity(entity src, vector org, vector vel, float flags) spawn_item_health;
void(entity e) item_health_init;
void() item_health;
+#endif

+#ifdef SSQC
// item_health_vial
entity(entity src) item_health_vial_drop;
entity(entity src, vector org, vector vel) spawn_item_health_vial;
void(entity e) item_health_vial_init;
void() item_health_vial;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// T_Heal: add health to an entity, limiting health to max_health
// "ignore" will ignore max_health limit
@@ -77,7 +90,9 @@ float (entity e, float healamount, float ignore) T_Heal =
e.health = 250;
return 1;
};
+#endif

+#ifdef SSQC
//----------------------------------------------------------------------
// class base_item_health: base_item
// {
@@ -110,9 +125,9 @@ float (entity e, float healamount, float ignore) T_Heal =
sprint (other, sprintf("You receive %g health\n", amount));

// health touch sound
- // sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM);
+ // sound (other, CHAN_ITEM, self.noise, VOL_HIGH, ATTN_NORM);
// custom sounds -- dumptruck_ds
- sound_misc (other, CHAN_AUTO, self.noise, 1, ATTN_NORM);
+ sound_misc (other, CHAN_AUTO, self.noise, VOL_HIGH, ATTN_NORM);

stuffcmd (other, "bf\n");

@@ -170,7 +185,9 @@ float (entity e, float healamount, float ignore) T_Heal =
base_item_health_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED item_health (.3 .3 1) (0 0 0) (32 32 32) ROTTEN MEGAHEALTH X X X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER RESPAWN_WITH_DM_EFFECTS NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{
model ( {{ spawnflags & 1 -> { "path" : "maps/b_bh10.bsp" }, spawnflags & 2 -> { "path" : "maps/b_bh100.bsp" },
@@ -325,7 +342,9 @@ rot the player back down to 100 health after 5 seconds.
item_health_init (self);
};
// };
+#endif

+#ifdef SSQC
//----------------------------------------------------------------------
// item_health_vial
//----------------------------------------------------------------------
@@ -391,3 +410,4 @@ rot the player back down to 100 health after 5 seconds.
item_health_vial_init (self);
};
// };
+#endif

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

Diff qc/items/keys.qc

diff --git a/qc/items/keys.qc b/qc/items/keys.qc
index 9e13577..76ec860 100644
--- a/qc/items/keys.qc
+++ b/qc/items/keys.qc
@@ -6,32 +6,41 @@
// constants
//======================================================================

+#ifdef SSQC
// The highest bitflag that will be assigned to a custom key.
const float FINAL_CUSTOM_KEY = 4194304;
+#endif

//======================================================================
// globals
//======================================================================

+#ifdef SSQC
// The highest bitflag that has been assigned to a custom key.
float highest_custom_key;
+#endif

//======================================================================
// fields
//======================================================================

+#ifdef SSQC
.float customkeys; // support for item_key_custom -- iw
.string keyname;
+#endif

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

+#ifdef SSQC
// temp_keydef
entity(string key_name) spawn_temp_keydef;
void(entity e) temp_keydef_init;
strip void() temp_keydef;
+#endif

+#ifdef SSQC
// base_item_key
string() base_item_key_silvername;
string() base_item_key_goldname;
@@ -44,26 +53,34 @@ void(entity client, float flags, float custom_flags) base_item_key_removekeys;
void() base_item_key_touch;
void(entity e) base_item_key_init;
strip void() base_item_key;
+#endif

+#ifdef SSQC
// item_key1
entity(entity src) item_key1_drop;
entity(entity src, vector org, vector vel) spawn_item_key1;
void(entity e) item_key1_init;
void() item_key1;
+#endif

+#ifdef SSQC
// item_key2
entity(entity src) item_key2_drop;
entity(entity src, vector org, vector vel) spawn_item_key2;
void(entity e) item_key2_init;
void() item_key2;
+#endif

+#ifdef SSQC
// item_key_custom
entity(entity src, vector org, vector vel, string kname) spawn_item_key_custom;
void(entity e) item_key_custom_init;
void() item_key_custom;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// class temp_keydef: base_tempentity
// {
@@ -107,7 +124,9 @@ void() item_key_custom;
temp_keydef_init (self);
};
// };
+#endif

+#ifdef SSQC
//----------------------------------------------------------------------
// class base_item_key: base_item
// {
@@ -280,7 +299,7 @@ void() item_key_custom;

sprint (other, sprintf("You got the %s\n", self.netname));

- sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM);
+ sound (other, CHAN_ITEM, self.noise, VOL_HIGH, ATTN_NORM);
stuffcmd (other, "bf\n");

// support for item_key_custom -- iw
@@ -346,7 +365,9 @@ void() item_key_custom;
base_item_key_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED item_key1 (0 .5 .8) (-16 -16 -24) (16 16 32) X X X X X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR 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
{ model("progs/w_s_key.mdl"); }
SILVER key
@@ -430,7 +451,9 @@ In order for keys to work you MUST set your map's worldtype to one of the follow
item_key1_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED item_key2 (0 .5 .8) (-16 -16 -24) (16 16 32) X X X X X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR 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
{
model ("progs/w_g_key.mdl");
@@ -516,12 +539,14 @@ In order for keys to work you MUST set your map's worldtype to one of the follow
item_key2_init (self);
};
// };
+#endif

//======================================================================
// item_key_custom is a brand-spanking-new entity class created for
// progs_dump -- iw
//======================================================================

+#ifdef SSQC
/*QUAKED item_key_custom (0 .5 .8) (-16 -16 -24) (16 16 32) X X X X X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR 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
{
model ({"path" : "progs/pd_w_key.mdl", "skin" : 1});
@@ -614,3 +639,4 @@ picked up. This is a limitation of the engine.
item_key_custom_init (self);
};
// };
+#endif

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

Diff qc/items/powerups.qc

diff --git a/qc/items/powerups.qc b/qc/items/powerups.qc
index 937b8ee..a8a1c3d 100644
--- a/qc/items/powerups.qc
+++ b/qc/items/powerups.qc
@@ -6,35 +6,46 @@
// forward declarations
//======================================================================

+#ifdef SSQC
// base_item_powerup
void() base_item_powerup_touch;
entity(entity src, vector org, vector vel, void(entity) init_fn)
spawn_base_item_powerup;
void(entity e) base_item_powerup_init;
strip void() base_item_powerup;
+#endif

+#ifdef SSQC
// item_artifact_invulnerability
entity(entity src, vector org, vector vel) spawn_item_artifact_invulnerability;
void(entity e) item_artifact_invulnerability_init;
void() item_artifact_invulnerability;
+#endif

+#ifdef SSQC
// item_artifact_envirosuit
entity(entity src, vector org, vector vel) spawn_item_artifact_envirosuit;
void(entity e) item_artifact_envirosuit_init;
void() item_artifact_envirosuit;
+#endif

+#ifdef SSQC
// item_artifact_invisibility
entity(entity src, vector org, vector vel) spawn_item_artifact_invisibility;
void(entity e) item_artifact_invisibility_init;
void() item_artifact_invisibility;
+#endif

+#ifdef SSQC
// item_artifact_super_damage
entity(entity src, vector org, vector vel) spawn_item_artifact_super_damage;
void(entity e) item_artifact_super_damage_init;
void() item_artifact_super_damage;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// class base_item_powerup: base_item
// {
@@ -74,7 +85,7 @@ void() item_artifact_super_damage;
}
}

- sound (other, CHAN_VOICE, self.noise, 1, ATTN_NORM);
+ sound (other, CHAN_VOICE, self.noise, VOL_HIGH, ATTN_NORM);
stuffcmd (other, "bf\n");
other.items = other.items | self.items;

@@ -139,7 +150,9 @@ void() item_artifact_super_damage;
base_item_powerup_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED item_artifact_invulnerability (0 .5 .8) (-16 -16 -24) (16 16 32) X X X X X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER RESPAWN_WITH_DM_EFFECTS NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{ model("progs/invulner.mdl"); }
Pentagram of Protection
@@ -194,7 +207,9 @@ Player is invulnerable for 30 seconds
item_artifact_invulnerability_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED item_artifact_envirosuit (0 .5 .8) (-16 -16 -24) (16 16 32) X X X X X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER RESPAWN_WITH_DM_EFFECTS NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{ model("progs/suit.mdl"); }
Biosuit
@@ -246,7 +261,9 @@ Player takes no damage from water or slime for 30 seconds
item_artifact_envirosuit_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED item_artifact_invisibility (0 .5 .8) (-16 -16 -24) (16 16 32) X X X X X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER RESPAWN_WITH_DM_EFFECTS NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{ model("progs/invisibl.mdl"); }
Ring of Shadows
@@ -299,7 +316,9 @@ Player is invisible for 30 seconds
item_artifact_invisibility_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED item_artifact_super_damage (0 .5 .8) (-16 -16 -24) (16 16 32) X X X X X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER RESPAWN_WITH_DM_EFFECTS NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{ model("progs/quaddama.mdl"); }
Quad Damage
@@ -355,3 +374,4 @@ Player does 4x damage for 30 seconds
item_artifact_super_damage_init (self);
};
// };
+#endif

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

Diff qc/items/runes.qc

diff --git a/qc/items/runes.qc b/qc/items/runes.qc
index 9707468..65e116e 100644
--- a/qc/items/runes.qc
+++ b/qc/items/runes.qc
@@ -6,14 +6,17 @@
// forward declarations
//======================================================================

+#ifdef SSQC
void() item_sigil_touch2;
void() item_sigil_touch;
entity(entity src, vector org, vector vel, float flags) spawn_item_sigil;
void(entity e) item_sigil_init;
void() item_sigil;
+#endif

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

+#ifdef SSQC
/*QUAKED item_sigil (0 .5 .8) (-16 -16 -24) (16 16 32) E1 E2 E3 E4 X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR 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
{
model ( {{ spawnflags & 1 -> { "path" : "progs/end1.mdl" }, spawnflags & 2 -> { "path" : "progs/end2.mdl" },
@@ -43,7 +46,7 @@ Episode 4 - The Elder World - Run of Elder Magic

// centerprint (other, "You got the rune!");

- // sound (other, CHAN_ITEM, this.noise, 1, ATTN_NORM);
+ // sound (other, CHAN_ITEM, this.noise, VOL_HIGH, ATTN_NORM);
// stuffcmd (other, "bf\n");
self.solid = SOLID_NOT;
self.model = __NULL__;
@@ -64,7 +67,7 @@ Episode 4 - The Elder World - Run of Elder Magic

centerprint (other, "You got the rune!");

- sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM);
+ sound (other, CHAN_ITEM, self.noise, VOL_HIGH, ATTN_NORM);
stuffcmd (other, "bf\n");
self.solid = SOLID_NOT;
self.model = __NULL__;
@@ -146,3 +149,4 @@ Episode 4 - The Elder World - Run of Elder Magic
item_sigil_init (self);
};
// };
+#endif

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

Diff qc/items/weapons.qc

diff --git a/qc/items/weapons.qc b/qc/items/weapons.qc
index b0cc0a6..09e278a 100644
--- a/qc/items/weapons.qc
+++ b/qc/items/weapons.qc
@@ -6,71 +6,94 @@
// constants
//======================================================================

+#ifdef SSQC
const float AMMO_CELLS_WP = 15; // cells on weapon pickup; id1 15
const float AMMO_NAILS_WP = 30; // nails on weapon pickup; id1 30
const float AMMO_ROCKETS_WP = 5; // rockets on weapon pickup; id1 5
const float AMMO_SHELLS_WP = 5; // shells on weapon pickup; id1 5

const float WEAPON_RESPAWN_TIME = 30; // as the name suggests; id1 30
+#endif

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

+#ifdef SSQC
void(entity e) bound_entity_ammo;
float(entity e, float w) rank_for_weapon;
void(entity e, float old, float new) deathmatch_weapon;
+#endif

+#ifdef SSQC
// base_item_weapon
void() base_item_weapon_touch;
entity(entity src, vector org, vector vel, void(entity) init_fn)
spawn_base_item_weapon;
void(entity e) base_item_weapon_init;
strip void() base_item_weapon;
+#endif

+#ifdef SSQC
// weapon_axe
entity(entity src, vector org, vector vel) spawn_weapon_axe;
void(entity e) weapon_axe_init;
void() weapon_axe;
+#endif

+#ifdef SSQC
// weapon_shotgun
entity(entity src, vector org, vector vel) spawn_weapon_shotgun;
void(entity e) weapon_shotgun_init;
void() weapon_shotgun;
+#endif

+#ifdef SSQC
// weapon_supershotgun
entity(entity src, vector org, vector vel) spawn_weapon_supershotgun;
void(entity e) weapon_supershotgun_init;
void() weapon_supershotgun;
+#endif

+#ifdef SSQC
// weapon_nailgun
entity(entity src, vector org, vector vel) spawn_weapon_nailgun;
void(entity e) weapon_nailgun_init;
void() weapon_nailgun;
+#endif

+#ifdef SSQC
// weapon_supernailgun
entity(entity src, vector org, vector vel) spawn_weapon_supernailgun;
void(entity e) weapon_supernailgun_init;
void() weapon_supernailgun;
+#endif

+#ifdef SSQC
// weapon_grenadelauncher
entity(entity src, vector org, vector vel) spawn_weapon_grenadelauncher;
void(entity e) weapon_grenadelauncher_init;
void() weapon_grenadelauncher;
+#endif

+#ifdef SSQC
// weapon_rocketlauncher
entity(entity src, vector org, vector vel) spawn_weapon_rocketlauncher;
void(entity e) weapon_rocketlauncher_init;
void() weapon_rocketlauncher;
+#endif

+#ifdef SSQC
// weapon_lightning
void(vector p1, vector p2, entity from, float damage) fire_lightning;
entity(entity src, vector org, vector vel) spawn_weapon_lightning;
void(entity e) weapon_lightning_init;
void() weapon_lightning;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
void(entity e) bound_entity_ammo =
{
@@ -119,7 +142,9 @@ void(entity e, float old, float new) deathmatch_weapon =
if (nr < or)
e.weapon = new;
};
+#endif

+#ifdef SSQC
//----------------------------------------------------------------------
// class base_item_weapon: base_item
// {
@@ -232,7 +257,8 @@ void(entity e, float old, float new) deathmatch_weapon =

sprint (other, sprintf("You got the %s\n", self.netname));
// weapon touch sound
- sound (other, CHAN_ITEM, "weapons/pkup.wav", 1, ATTN_NORM);
+ sound (other, CHAN_ITEM, "items/weapon_pickup.ogg",
+ VOL_MHI, ATTN_NORM);
stuffcmd (other, "bf\n");

bound_entity_ammo (other);
@@ -299,11 +325,13 @@ void(entity e, float old, float new) deathmatch_weapon =
base_item_weapon_init (self);
};
// };
+#endif

//======================================================================
// Weapon 1: Ranger's Axe -- johnfitz -- dumptruck_ds from RRP and rubicon2
//======================================================================

+#ifdef SSQC
/*QUAKED weapon_axe (0 .5 .8) (-16 -16 0) (16 16 32)
Axe
*/
@@ -344,11 +372,13 @@ Axe
weapon_axe_init (self);
};
// };
+#endif

//======================================================================
// Weapon 2: Shotgun -- johnfitz -- dumptruck_ds from RRP and rubicon2
//======================================================================

+#ifdef SSQC
/*QUAKED weapon_shotgun (0 .5 .8) (-16 -16 0) (16 16 32) X STYLE_1 STYLE_2 X X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER RESPAWN_WITH_DM_EFFECTS NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{ model("progs/g_shotgn.mdl"); }
This is a pickup model that should be used when you want a player to spawn with only an axe and then later get the shotgun: (trigger_take_weapon or reset_items 2 in worldspawn). There are two models to choose from. Spawnflag 2 (the default) selects an unused “classic look” model from Rubicon 2 by metlslime. Spawnflag 4 is an alternate from Slapmap and has been used in a few mods.
@@ -394,11 +424,13 @@ Shotgun
weapon_shotgun_init (self);
};
// };
+#endif

//======================================================================
// Weapon 3: Super Shotgun
//======================================================================

+#ifdef SSQC
/*QUAKED weapon_supershotgun (0 .5 .8) (-16 -16 0) (16 16 32) X X X X X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER RESPAWN_WITH_DM_EFFECTS NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{ model("progs/g_shot.mdl"); }
Double-barrelled Shotgun
@@ -442,11 +474,13 @@ Double-barrelled Shotgun
weapon_supershotgun_init (self);
};
// };
+#endif

//======================================================================
// Weapon 4: Nailgun
//======================================================================

+#ifdef SSQC
/*QUAKED weapon_nailgun (0 .5 .8) (-16 -16 0) (16 16 32) X X X X X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER RESPAWN_WITH_DM_EFFECTS NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{ model("progs/g_nail.mdl"); }
Nailgun
@@ -490,11 +524,13 @@ Nailgun
weapon_nailgun_init (self);
};
// };
+#endif

//======================================================================
// Weapon 5: Super Nailgun
//======================================================================

+#ifdef SSQC
/*QUAKED weapon_supernailgun (0 .5 .8) (-16 -16 0) (16 16 32) X X X X X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER RESPAWN_WITH_DM_EFFECTS NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{ model("progs/g_nail2.mdl"); }
Perforator
@@ -538,11 +574,13 @@ Perforator
weapon_supernailgun_init (self);
};
// };
+#endif

//======================================================================
// Weapon 6: Grenade Launcher
//======================================================================

+#ifdef SSQC
/*QUAKED weapon_grenadelauncher (0 .5 .8) (-16 -16 0) (16 16 32) X X X X X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER RESPAWN_WITH_DM_EFFECTS NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{ model("progs/g_rock.mdl"); }
Grenade Launcher
@@ -587,11 +625,13 @@ Grenade Launcher
weapon_grenadelauncher_init (self);
};
// };
+#endif

//======================================================================
// Weapon 7: Rocket Launcher
//======================================================================

+#ifdef SSQC
/*QUAKED weapon_rocketlauncher (0 .5 .8) (-16 -16 0) (16 16 32) X X X X X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER RESPAWN_WITH_DM_EFFECTS NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{ model("progs/g_rock2.mdl"); }
Rocket Launcher
@@ -635,11 +675,13 @@ Rocket Launcher
weapon_rocketlauncher_init (self);
};
// };
+#endif

//======================================================================
// Weapon 8: Lightning Gun
//======================================================================

+#ifdef SSQC
/*QUAKED weapon_lightning (0 .5 .8) (-16 -16 0) (16 16 32) X X X X X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER RESPAWN_WITH_DM_EFFECTS NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{ model("progs/g_light.mdl"); }
Thunderbolt
@@ -730,3 +772,4 @@ Thunderbolt
weapon_lightning_init (self);
};
// };
+#endif

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

Diff qc/keylock.qc

diff --git a/qc/keylock.qc b/qc/keylock.qc
index 1662d19..3fdd1f1 100644
--- a/qc/keylock.qc
+++ b/qc/keylock.qc
@@ -36,8 +36,23 @@ calling these functions must not use these fields for other purposes:
========================================================================
*/

+//======================================================================
+// forward declarations
+//======================================================================
+
+#ifdef SSQC
+void(entity e) keylock_init;
+void(entity e) keylock_set_silver_key;
+void(entity e) keylock_set_gold_key;
+void(entity e, string key_name) keylock_set_custom_key;
+float(entity e) keylock_has_key_set;
+void(entity client, string custom_message,
+ void() success_func) keylock_try_to_unlock;
+#endif
+
//------------------------------------------------------------------------------

+#ifdef SSQC
/*
------------------------------------------------------------------------
keylock_init
@@ -183,7 +198,7 @@ void(entity client, string custom_message,
centerprint (client, custom_message);
else
centerprint2 (client, "You need the ", self.netname);
- sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise3, VOL_HIGH, ATTN_NORM);
return;
}

@@ -210,3 +225,4 @@ void(entity client, string custom_message,

success_func ();
};
+#endif

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

Diff qc/math.qc

diff --git a/qc/math.qc b/qc/math.qc
index b97ebf2..c2f5830 100644
--- a/qc/math.qc
+++ b/qc/math.qc
@@ -8,31 +8,38 @@
// forward declarations
//======================================================================

+#if defined(CSQC) || defined (SSQC)
float(float value, float minValue, float maxValue) clamp;
// float(float a, float b) mod; // available as an engine builtin
float(float x) sign;
float(float value, float minValue, float maxValue) wrap;
+#endif

+#if defined(CSQC) || defined (SSQC)
float(float a, float b, float mix) lerp;
vector(vector a, vector b, float mix) lerp_vector;
float(float a, float b, float mix) lerp_hermite;
vector(vector a, vector b, float mix) lerp_vector_hermite;
+#endif

+#if defined(CSQC) || defined (SSQC)
float(float anga, float angb) angledif;
float(vector ang, vector base_ang, vector offset) is_in_angle;
-
vector(vector ang) normalize_angles;
vector(vector ang) normalize_angles180;
-
float() crandom;
float(float v) anglemod;
+#endif

+#ifdef SSQC
float(float theta) preach_tan;
float(float y, float x) preach_atan2;
float(float theta, vector source, vector dest) preach_iterate_elevation;
+#endif

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

+#if defined(CSQC) || defined (SSQC)
//----------------------------------------------------------------------
// clamp
//
@@ -104,7 +111,9 @@ float(float value, float minValue, float maxValue) wrap =
local float range = maxValue - minValue;
return mod (value - minValue, range + 1) + minValue;
};
+#endif

+#if defined(CSQC) || defined (SSQC)
//----------------------------------------------------------------------
float(float a, float b, float mix) lerp =
{
@@ -158,7 +167,9 @@ vector(vector a, vector b, float mix) lerp_vector_hermite =

return (b * h01 + a * (1 - h01));
};
+#endif

+#if defined(CSQC) || defined (SSQC)
//----------------------------------------------------------------------
float(float anga, float angb) angledif =
{
@@ -231,6 +242,7 @@ float(float v) anglemod =
v = v + 360;
return v;
};
+#endif

//----------------------------------------------------------------------
// the next three functions were in ogre.qc -- CEV
@@ -240,6 +252,7 @@ float(float v) anglemod =
// start Preach Ogre Marksman tutorial here -- dumptruck_ds //
//////////////////////////////////////////////////////////////

+#ifdef SSQC
// uses QuakeC builtins to calculate tan of angle
// WARNING: uses makevectors! This overwrites the v_forward... globals
float(float theta) preach_tan =
@@ -303,4 +316,5 @@ float(float theta, vector source, vector dest) preach_iterate_elevation =
theta = theta - 180;
return theta;
};
+#endif
// end Preach tutorial

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

Diff qc/misc/air_bubbles.qc

diff --git a/qc/misc/air_bubbles.qc b/qc/misc/air_bubbles.qc
index 07ba68c..16335d0 100644
--- a/qc/misc/air_bubbles.qc
+++ b/qc/misc/air_bubbles.qc
@@ -6,6 +6,7 @@
// forward declarations
//======================================================================

+#ifdef SSQC
// temp_bubbles
void() temp_bubbles_think;
void() temp_bubbles_touch;
@@ -13,18 +14,22 @@ void() temp_bubbles_split;
entity(entity own, vector org, vector v, float fr, float c) spawn_temp_bubbles;
void(entity e) temp_bubbles_init;
strip void() temp_bubbles;
+#endif

+#ifdef SSQC
// air_bubbles
void() air_bubbles_think;
entity(entity own, vector org, float num) spawn_air_bubbles;
void(entity e) air_bubbles_init;
void() air_bubbles;
+#endif

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

//----------------------------------------------------------------------
// class temp_bubbles: base_tempentity
// {
+#ifdef SSQC
//--------------------------------------------------------------
// was bubble_bob -- CEV
//--------------------------------------------------------------
@@ -136,6 +141,7 @@ void() air_bubbles;
{
temp_bubbles_init (self);
};
+#endif
// };

/*QUAKED air_bubbles (0 .5 .8) (-8 -8 -8) (8 8 8) 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
@@ -146,6 +152,7 @@ air bubbles entity
//----------------------------------------------------------------------
// class air_bubbles: base_mapentity
// {
+#ifdef SSQC
//--------------------------------------------------------------
// was make_bubbles -- CEV
//--------------------------------------------------------------
@@ -234,4 +241,5 @@ air bubbles entity

air_bubbles_init (self);
};
+#endif
// };

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

Diff qc/misc/ambient_sound.qc

diff --git a/qc/misc/ambient_sound.qc b/qc/misc/ambient_sound.qc
index fb50719..1104026 100644
--- a/qc/misc/ambient_sound.qc
+++ b/qc/misc/ambient_sound.qc
@@ -6,6 +6,7 @@
// Constants
//======================================================================

+#ifdef SSQC
const string SND_AMBIENTCOMPHUM = "ambience/comp1.wav";
const string SND_AMBIENTDRIP = "ambience/drip1.wav";
const string SND_AMBIENTDRONE = "ambience/drone6.wav";
@@ -18,11 +19,13 @@ const string SND_AMBIENTSWAMP2 = "ambience/swamp2.wav";
const string SND_AMBIENTWATER1 = "ambience/water1.wav";
const string SND_AMBIENTWIND2 = "ambience/wind2.wav";
const string SND_AMBIENTHUNDER = "ambience/thunder1.wav";
+#endif

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

+#ifdef SSQC
// base_ambient_sound
void(vector source) ambient_sound_comphum;
void(vector source) ambient_sound_drip;
@@ -94,9 +97,11 @@ void() ambient_wind2;
void() ambient_thunder_think;
void(entity e) ambient_thunder_init;
void() ambient_thunder;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// class base_ambient_sound: base_mapentity
// {
@@ -104,28 +109,29 @@ void() ambient_thunder;
void(vector source) ambient_sound_comphum =
{
precache_sound (SND_AMBIENTCOMPHUM);
- ambientsound (source, SND_AMBIENTCOMPHUM, 1, ATTN_STATIC);
+ ambientsound (source, SND_AMBIENTCOMPHUM,
+ VOL_HIGH, ATTN_STATIC);
};

//--------------------------------------------------------------
void(vector source) ambient_sound_drip =
{
precache_sound (SND_AMBIENTDRIP);
- ambientsound (source, SND_AMBIENTDRIP, 0.5, ATTN_STATIC);
+ ambientsound (source, SND_AMBIENTDRIP, VOL_MID, ATTN_STATIC);
};

//--------------------------------------------------------------
void(vector source) ambient_sound_drone =
{
precache_sound (SND_AMBIENTDRONE);
- ambientsound (source, SND_AMBIENTDRONE, 0.5, ATTN_STATIC);
+ ambientsound (source, SND_AMBIENTDRONE, VOL_MID, ATTN_STATIC);
};

//--------------------------------------------------------------
void(vector source) ambient_sound_fbuzz =
{
precache_sound (SND_AMBIENTFBUZZ);
- ambientsound (source, SND_AMBIENTFBUZZ, 1, ATTN_STATIC);
+ ambientsound (source, SND_AMBIENTFBUZZ, VOL_HIGH, ATTN_STATIC);
};

//--------------------------------------------------------------
@@ -133,49 +139,49 @@ void() ambient_thunder;
{
precache_sound (SND_AMBIENTFIRE);
// attenuate fast
- ambientsound (source, SND_AMBIENTFIRE, 0.5, ATTN_STATIC);
+ ambientsound (source, SND_AMBIENTFIRE, VOL_MID, ATTN_STATIC);
};

//--------------------------------------------------------------
void(vector source) ambient_sound_lbuzz =
{
precache_sound (SND_AMBIENTLBUZZ);
- ambientsound (source, SND_AMBIENTLBUZZ, 0.5, ATTN_STATIC);
+ ambientsound (source, SND_AMBIENTLBUZZ, VOL_MID, ATTN_STATIC);
};

//--------------------------------------------------------------
void(vector source) ambient_sound_suckwind =
{
precache_sound (SND_AMBIENTSWIND);
- ambientsound (source, SND_AMBIENTSWIND, 1, ATTN_STATIC);
+ ambientsound (source, SND_AMBIENTSWIND, VOL_HIGH, ATTN_STATIC);
};

//--------------------------------------------------------------
void(vector source) ambient_sound_swamp1 =
{
precache_sound (SND_AMBIENTSWAMP1);
- ambientsound (source, SND_AMBIENTSWAMP1, 0.5, ATTN_STATIC);
+ ambientsound (source, SND_AMBIENTSWAMP1, VOL_MID, ATTN_STATIC);
};

//--------------------------------------------------------------
void(vector source) ambient_sound_swamp2 =
{
precache_sound (SND_AMBIENTSWAMP1);
- ambientsound (source, SND_AMBIENTSWAMP2, 0.5, ATTN_STATIC);
+ ambientsound (source, SND_AMBIENTSWAMP2, VOL_MID, ATTN_STATIC);
};

//--------------------------------------------------------------
void(vector source) ambient_sound_water1 =
{
precache_sound (SND_AMBIENTWATER1);
- ambientsound (source, SND_AMBIENTWATER1, 1, ATTN_STATIC);
+ ambientsound (source, SND_AMBIENTWATER1, VOL_HIGH, ATTN_STATIC);
};

//--------------------------------------------------------------
void(vector source) ambient_sound_wind2 =
{
precache_sound (SND_AMBIENTWIND2);
- ambientsound (source, SND_AMBIENTWIND2, 1, ATTN_STATIC);
+ ambientsound (source, SND_AMBIENTWIND2, VOL_HIGH, ATTN_STATIC);
};

//--------------------------------------------------------------
@@ -613,10 +619,10 @@ only need one of these in your level. It will play everywhere.
{
if (random() < 0.5)
sound (self, CHAN_AUTO, SND_AMBIENTHUNDER,
- 0.7, ATTN_NONE);
+ VOL_MID, ATTN_NONE);
else
sound (self, CHAN_AUTO, SND_AMBIENTHUNDER,
- 1, ATTN_NONE);
+ VOL_HIGH, ATTN_NONE);

self.nextthink = time + 40 * random ();
};
@@ -647,3 +653,4 @@ only need one of these in your level. It will play everywhere.
ambient_thunder_init (self);
};
// };
+#endif

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

Diff qc/misc/deadstuff.qc

diff --git a/qc/misc/deadstuff.qc b/qc/misc/deadstuff.qc
deleted file mode 100644
index 8b13789..0000000
--- a/qc/misc/deadstuff.qc
+++ /dev/null
@@ -1 +0,0 @@
-

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

Diff qc/misc/explobox.qc

diff --git a/qc/misc/explobox.qc b/qc/misc/explobox.qc
index 68bd5ab..f19a2e4 100644
--- a/qc/misc/explobox.qc
+++ b/qc/misc/explobox.qc
@@ -3,27 +3,101 @@
//==============================================================================

//======================================================================
+// constants
+//======================================================================
+
+#if defined(CSQC) || defined(SSQC)
+enumflags
+{
+ MISC_EXPLOBOX_NET_ORIGIN, // origin has changed
+ MISC_EXPLOBOX_NET_MODEL // model has changed
+};
+#endif
+
+//======================================================================
// forward declarations
//======================================================================

// base_explobox
+#ifdef CSQC
+void(float isnew) base_explobox_netreceive;
+#endif
+#ifdef SSQC
+float(entity to, float netflags) base_explobox_netsend;
void(vector dir) base_explobox_destroy;
+#endif
+#if defined(CSQC) || defined(SSQC)
void(entity e) base_explobox_init;
+#endif
+#ifdef SSQC
strip void() base_explobox;
+#endif

// misc_explobox
+#if defined(CSQC) || defined(SSQC)
void(entity e) misc_explobox_init;
+#endif
+#ifdef SSQC
void() misc_explobox;
+#endif

// misc_explobox2
+#if defined(CSQC) || defined(SSQC)
void(entity e) misc_explobox2_init;
+#endif
+#ifdef SSQC
void() misc_explobox2;
+#endif

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

//----------------------------------------------------------------------
// class base_explobox: base_mapentity
// {
+#ifdef CSQC
+ //--------------------------------------------------------------
+ void(float isnew) base_explobox_netreceive =
+ {
+ local float netflags = ReadFloat ();
+
+ if (netflags & MISC_EXPLOBOX_NET_ORIGIN)
+ {
+ self.origin_x = ReadCoord ();
+ self.origin_y = ReadCoord ();
+ self.origin_z = ReadCoord ();
+ }
+
+ if (netflags & MISC_EXPLOBOX_NET_MODEL)
+ self.modelindex = ReadFloat ();
+
+ if (isnew)
+ if (self.classtype == CT_MISC_EXPLOBOX)
+ misc_explobox_init (self);
+ else if (self.classtype == CT_MISC_EXPLOBOX2)
+ misc_explobox2_init (self);
+ };
+#endif
+
+#ifdef SSQC
+ //--------------------------------------------------------------
+ float(entity to, float netflags) base_explobox_netsend =
+ {
+ WriteFloat (MSG_ENTITY, self.classtype);
+ WriteFloat (MSG_ENTITY, netflags);
+
+ if (netflags & MISC_EXPLOBOX_NET_ORIGIN)
+ {
+ WriteCoord (MSG_ENTITY, self.origin_x);
+ WriteCoord (MSG_ENTITY, self.origin_y);
+ WriteCoord (MSG_ENTITY, self.origin_z);
+ }
+
+ if (netflags & MISC_EXPLOBOX_NET_MODEL)
+ WriteFloat (MSG_ENTITY, self.modelindex);
+
+ return TRUE;
+ };
+
//--------------------------------------------------------------
void(vector dir) base_explobox_destroy =
{
@@ -31,7 +105,8 @@ void() misc_explobox2;
self.classname = "explo_box";
// did say self.owner
t_radiusdamage2 (self, self, 160, world);
- sound (self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, "weapons/r_exp3.wav",
+ VOL_HIGH, ATTN_NORM);
particle (self.origin, '0 0 0', 75, 255);

self.origin_z = self.origin_z + 32;
@@ -40,19 +115,26 @@ void() misc_explobox2;
spawn_base_explosion (self.origin);
remove (self);
};
+#endif

+#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void(entity e) base_explobox_init =
{
+ #ifdef SSQC
e.destroy = base_explobox_destroy;
+ #endif
base_mapentity_init (e);
};
+#endif

+#ifdef SSQC
//--------------------------------------------------------------
void() base_explobox =
{
base_explobox_init (self);
};
+#endif
// };

/*QUAKED misc_explobox (0 .5 .8) (0 0 0) (32 32 64) 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
@@ -64,6 +146,7 @@ Explosive box
//----------------------------------------------------------------------
// class misc_explobox: base_explobox
// {
+#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void(entity e) misc_explobox_init =
{
@@ -74,6 +157,17 @@ Explosive box

e.solid = SOLID_BBOX;
e.movetype = MOVETYPE_NONE;
+
+ #ifdef CSQC
+ // setmodelindex will take care of size (mins & maxs) -- CEV
+ e.solid = SOLID_BSP;
+ e.movetype = MOVETYPE_PUSH;
+ setmodelindex (e, e.modelindex);
+ setorigin (e, e.origin);
+ e.drawmask = DRAWMASK_NORMAL;
+ #endif
+
+ #ifdef SSQC
precache_model ("maps/b_explob.bsp");
setmodel (e, "maps/b_explob.bsp");
precache_sound ("weapons/r_exp3.wav");
@@ -93,8 +187,15 @@ Explosive box
"of level at %v\n", e.origin));
remove (e);
}
+
+ e.SendEntity = base_explobox_netsend;
+ e.SendFlags = e.SendFlags | MISC_EXPLOBOX_NET_ORIGIN |
+ MISC_EXPLOBOX_NET_MODEL;
+ #endif
};
+#endif

+#ifdef SSQC
//--------------------------------------------------------------
void() misc_explobox =
{
@@ -104,6 +205,7 @@ Explosive box

misc_explobox_init (self);
};
+#endif
// };

/*QUAKED misc_explobox2 (0 .5 .8) (0 0 0) (32 32 64) 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
@@ -115,6 +217,7 @@ Smaller explosive box
//----------------------------------------------------------------------
// class misc_explobox2: base_explobox
// {
+#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void(entity e) misc_explobox2_init =
{
@@ -125,11 +228,22 @@ Smaller explosive box

e.solid = SOLID_BBOX;
e.movetype = MOVETYPE_NONE;
+
+ #ifdef CSQC
+ e.solid = SOLID_BSP;
+ e.movetype = MOVETYPE_PUSH;
+ setmodelindex (e, e.modelindex);
+ setorigin (e, e.origin);
+ e.drawmask = DRAWMASK_NORMAL;
+ #endif
+
+ #ifdef SSQC
precache_model2 ("maps/b_exbox2.bsp");
setmodel (e, "maps/b_exbox2.bsp");
precache_sound ("weapons/r_exp3.wav");
e.health = 20;
e.takedamage = DAMAGE_AIM;
+
// 1998-09-16 Sliding/not-jumping on monsters/boxes/players
// fix by Maddes/Kryten
// TODO CEV
@@ -144,8 +258,15 @@ Smaller explosive box
"of level at %v\n", e.origin));
remove (e);
}
+
+ e.SendEntity = base_explobox_netsend;
+ e.SendFlags = e.SendFlags | MISC_EXPLOBOX_NET_ORIGIN |
+ MISC_EXPLOBOX_NET_MODEL;
+ #endif
};
+#endif

+#ifdef SSQC
//--------------------------------------------------------------
void() misc_explobox2 =
{
@@ -155,4 +276,5 @@ Smaller explosive box

misc_explobox2_init (self);
};
+#endif
// };

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

Diff qc/misc/fireball.qc

diff --git a/qc/misc/fireball.qc b/qc/misc/fireball.qc
index 3e38cc4..4aa53f3 100644
--- a/qc/misc/fireball.qc
+++ b/qc/misc/fireball.qc
@@ -6,10 +6,12 @@
// forward declarations
//======================================================================

+#ifdef SSQC
// misc_fireball
void() misc_fireball_think;
void(entity e) misc_fireball_init;
void() misc_fireball;
+#endif

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

@@ -21,6 +23,7 @@ speed - set vertical speed of fireballs. default 1000.
//----------------------------------------------------------------------
// class misc_fireball: base_mapentity
// {
+#ifdef SSQC
//--------------------------------------------------------------
// was fire_fly -- CEV
//--------------------------------------------------------------
@@ -68,4 +71,5 @@ speed - set vertical speed of fireballs. default 1000.

misc_fireball_init (self);
};
+#endif
// };

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

Diff qc/misc/infight.qc

diff --git a/qc/misc/infight.qc b/qc/misc/infight.qc
index 25e4c68..98556fd 100644
--- a/qc/misc/infight.qc
+++ b/qc/misc/infight.qc
@@ -17,24 +17,29 @@
// constants
//======================================================================

+#ifdef SSQC
const float INFIGHT_MUTUAL = 1;
const float INFIGHT_PLAYER_ACTIVATION = 2;
+#endif

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

+#ifdef SSQC
// misc_infight
void(entity t1, entity t2) misc_infight_make_angry_at;
void() misc_infight_use;
void(entity e) misc_infight_init;
void() misc_infight;
+#endif

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

//----------------------------------------------------------------------
// class misc_infight: base_mapentity
// {
+#ifdef SSQC
//--------------------------------------------------------------
void(entity t1, entity t2) misc_infight_make_angry_at =
{
@@ -160,4 +165,5 @@ void() misc_infight;

misc_infight_init (self);
};
+#endif
// };

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

Diff qc/misc/light_candle.qc

diff --git a/qc/misc/light_candle.qc b/qc/misc/light_candle.qc
index e5a0c43..15c1144 100644
--- a/qc/misc/light_candle.qc
+++ b/qc/misc/light_candle.qc
@@ -6,14 +6,18 @@
// forward declarations
//======================================================================

+#ifdef SSQC
// light_candle
void(entity e) light_candle_init;
void() light_candle;
+#endif

+#ifdef SSQC
// model_candle
void() model_candle_think;
void(entity e) model_candle_init;
void() model_candle;
+#endif

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

@@ -132,6 +136,7 @@ White candle
//----------------------------------------------------------------------
// class light_candle: base_mapentity
// {
+#ifdef SSQC
//--------------------------------------------------------------
void(entity e) light_candle_init =
{
@@ -154,11 +159,13 @@ White candle

light_candle_init (self);
};
+#endif
// };

//----------------------------------------------------------------------
// class model_candle: base_mapentity
// {
+#ifdef SSQC
//--------------------------------------------------------------
// was model_candle_think
//--------------------------------------------------------------
@@ -193,4 +200,5 @@ White candle

model_candle_init (self);
};
+#endif
// };

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

Diff qc/misc/lights.qc

diff --git a/qc/misc/lights.qc b/qc/misc/lights.qc
index c672379..b835147 100644
--- a/qc/misc/lights.qc
+++ b/qc/misc/lights.qc
@@ -6,17 +6,20 @@
// constants
//======================================================================

+#ifdef SSQC
const float LIGHT_START_OFF = 1;
const float LIGHT_FADE_IN_OUT = 2;
const float LIGHT_SILENT_TORCH = 4; // for silent torch -- dumptruck_ds

const float LIGHT_THINK_FADE_IN = 1;
const float LIGHT_THINK_FADE_OUT = 2;
+#endif

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

+#ifdef SSQC
string(float num) lightstyle_lookup;
void() setup_lightstyles;
string(float num) lightstyle_fade_lookup;
@@ -63,9 +66,11 @@ void() light_flame_small_white;
// light_sprite_flame
void(entity e) light_sprite_flame_init;
void() light_sprite_flame;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// lightstyle_lookup
//----------------------------------------------------------------------
@@ -679,3 +684,4 @@ Large flame spite*/
light_sprite_flame_init (self);
};
// };
+#endif

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

Diff qc/misc/model.qc

diff --git a/qc/misc/model.qc b/qc/misc/model.qc
index e34c690..0a50130 100644
--- a/qc/misc/model.qc
+++ b/qc/misc/model.qc
@@ -11,35 +11,173 @@
// constants
//======================================================================

+#ifdef SSQC
const float MISC_MODEL_GRAVITY = 1;
const float MISC_MODEL_SOLID = 2;
const float MISC_MODEL_BACK_AND_FORTH = 4;
const float MISC_MODEL_ONLY_ONCE = 8;
const float MISC_MODEL_PLAY_COUNT = 16;
const float MISC_MODEL_STARTOFF = 32;
+#endif
+
+#if defined(CSQC) || defined(SSQC)
+enumflags
+{
+ MISC_MODEL_NET_ORIGIN, // origin has changed
+ MISC_MODEL_NET_MINS, // model size has changed
+ MISC_MODEL_NET_MAXS, // ^^^
+ MISC_MODEL_NET_MODEL, // .model has changed
+ MISC_MODEL_NET_FRAME, // frame has changed
+ MISC_MODEL_NET_FIRSTFRAME, // first frame
+ MISC_MODEL_NET_LASTFRAME, // last frame
+ MISC_MODEL_NET_STATE // active, inactive
+};
+#endif

//======================================================================
// fields
//======================================================================

+#if defined(CSQC) || defined(SSQC)
.float first_frame; // The starting frame of the animation
.float last_frame; // The ending frame of the animation
+#endif

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

// base_misc_model
+#ifdef CSQC
+void(float isnew) base_misc_model_netreceive;
+float() base_misc_model_predraw;
+#endif
+#ifdef SSQC
+float(entity to, float netflags) base_misc_model_netsend;
void() base_misc_model_think;
void() base_misc_model_use;
+#endif
+#if defined(CSQC) || defined(SSQC)
+void(entity e) base_misc_model_init;
+#endif

// misc_model
+#if defined(CSQC) || defined(SSQC)
+void(entity e) misc_model_init;
+#endif
+#ifdef SSQC
+void() misc_model;
+#endif

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

//----------------------------------------------------------------------
// class base_misc_model: base_mapentity
// {
+#ifdef CSQC
+ //--------------------------------------------------------------
+ void(float isnew) base_misc_model_netreceive =
+ {
+ local float netflags = ReadFloat ();
+
+ if (netflags & MISC_MODEL_NET_ORIGIN)
+ {
+ self.origin_x = ReadCoord ();
+ self.origin_y = ReadCoord ();
+ self.origin_z = ReadCoord ();
+ }
+
+ if (netflags & MISC_MODEL_NET_MINS)
+ {
+ self.mins_x = ReadCoord ();
+ self.mins_y = ReadCoord ();
+ self.mins_z = ReadCoord ();
+ }
+
+ if (netflags & MISC_MODEL_NET_MAXS)
+ {
+ self.maxs_x = ReadCoord ();
+ self.maxs_y = ReadCoord ();
+ self.maxs_z = ReadCoord ();
+ }
+
+ if (netflags & MISC_MODEL_NET_MODEL)
+ self.modelindex = ReadFloat ();
+
+ if (netflags & MISC_MODEL_NET_FRAME)
+ self.frame = ReadFloat ();
+
+ if (netflags & MISC_MODEL_NET_FIRSTFRAME)
+ self.first_frame = ReadFloat ();
+
+ if (netflags & MISC_MODEL_NET_LASTFRAME)
+ self.last_frame = ReadFloat ();
+
+ if (netflags & MISC_MODEL_NET_STATE)
+ self.state = ReadFloat ();
+
+ if (isnew)
+ if (self.classtype == CT_MISC_MODEL)
+ misc_model_init (self);
+ };
+
+ //--------------------------------------------------------------
+ float() base_misc_model_predraw =
+ {
+ // TODO CEV interpolation? animate on the client-side?
+ if (self.state == STATE_ACTIVE)
+ return PREDRAW_AUTOADD;
+ else
+ return PREDRAW_NEXT;
+ };
+#endif
+
+#ifdef SSQC
+ //--------------------------------------------------------------
+ float(entity to, float netflags) base_misc_model_netsend =
+ {
+ WriteFloat (MSG_ENTITY, self.classtype);
+ WriteFloat (MSG_ENTITY, netflags);
+
+ if (netflags & MISC_MODEL_NET_ORIGIN)
+ {
+ WriteCoord (MSG_ENTITY, self.origin_x);
+ WriteCoord (MSG_ENTITY, self.origin_y);
+ WriteCoord (MSG_ENTITY, self.origin_z);
+ }
+
+ if (netflags & MISC_MODEL_NET_MINS)
+ {
+ WriteCoord (MSG_ENTITY, self.mins_x);
+ WriteCoord (MSG_ENTITY, self.mins_y);
+ WriteCoord (MSG_ENTITY, self.mins_z);
+ }
+
+ if (netflags & MISC_MODEL_NET_MAXS)
+ {
+ WriteCoord (MSG_ENTITY, self.maxs_x);
+ WriteCoord (MSG_ENTITY, self.maxs_y);
+ WriteCoord (MSG_ENTITY, self.maxs_z);
+ }
+
+ if (netflags & MISC_MODEL_NET_MODEL)
+ WriteFloat (MSG_ENTITY, self.modelindex);
+
+ if (netflags & MISC_MODEL_NET_FRAME)
+ WriteFloat (MSG_ENTITY, self.frame);
+
+ if (netflags & MISC_MODEL_NET_FIRSTFRAME)
+ WriteFloat (MSG_ENTITY, self.first_frame);
+
+ if (netflags & MISC_MODEL_NET_LASTFRAME)
+ WriteFloat (MSG_ENTITY, self.last_frame);
+
+ if (netflags & MISC_MODEL_NET_STATE)
+ WriteFloat (MSG_ENTITY, self.state);
+
+ return TRUE;
+ };
+
//--------------------------------------------------------------
// misc_model_think -- Handles animation for misc_model entity.
//--------------------------------------------------------------
@@ -69,6 +207,9 @@ void() base_misc_model_use;
self.last_frame);
}

+ // signal CSQC that the frame has changed -- CEV
+ self.SendFlags = MISC_MODEL_NET_FRAME;
+
if (self.spawnflags & MISC_MODEL_ONLY_ONCE &&
self.frame == self.last_frame &&
self.last_frame != self.first_frame)
@@ -114,13 +255,19 @@ void() base_misc_model_use;
self.state = STATE_ACTIVE;
setorigin (self, self.origin);
}
+
+ // update CSQC
+ self.SendFlags = MISC_MODEL_NET_STATE;
};
+#endif

+#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void(entity e) base_misc_model_init =
{
base_mapentity_init (e);
};
+#endif
// };

/*QUAKED misc_model (0 0.5 0.8) (-8 -8 -8) (8 8 8) 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
@@ -141,6 +288,7 @@ last_frame: The last frame of the animation.
//----------------------------------------------------------------------
// class misc_model: base_misc_model
// {
+#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void(entity e) misc_model_init =
{
@@ -148,16 +296,31 @@ last_frame: The last frame of the animation.
e.classtype = CT_MISC_MODEL;
base_misc_model_init (e);

+ local vector vmin, vmax;
+
+ #ifdef CSQC
+ // only SOLID_BBOX misc_model entities are networked -- CEV
+ e.movetype = MOVETYPE_NONE;
+ e.solid = SOLID_BBOX;
+ vmin = e.mins;
+ vmax = e.maxs;
+ setmodelindex (e, e.modelindex);
+ setorigin (e, e.origin);
+ setsize (e, vmin, vmax);
+ e.drawmask = DRAWMASK_NORMAL;
+ e.predraw = base_misc_model_predraw;
+ #endif
+
+ #ifdef SSQC
if (!e.mdl || e.mdl == "")
objerror ("Model not defined");

if (!e.centeroffset)
e.centeroffset = '0 0 0';
+
if (!e.mdlsz)
e.mdlsz = '32 32 32';

- vector vmin, vmax;
-
vmin_x = e.centeroffset_x - (e.mdlsz_x / 2);
vmin_y = e.centeroffset_y - (e.mdlsz_y / 2);
vmin_z = e.centeroffset_z - (e.mdlsz_z / 2);
@@ -168,7 +331,6 @@ last_frame: The last frame of the animation.

precache_model (e.mdl);
setmodel (e, e.mdl);
-
setsize (e, vmin, vmax);

if (e.spawnflags & MISC_MODEL_SOLID)
@@ -203,7 +365,7 @@ last_frame: The last frame of the animation.
// if (!e.last_frame &&
// !(e.spawnflags & MISC_MODEL_GRAVITY))
// {
- // makestatic(e);
+ // makestatic (e);
// return;
// }

@@ -223,8 +385,23 @@ last_frame: The last frame of the animation.
e.state = STATE_INVISIBLE;

sub_runvoidas (e, base_misc_model_use);
+
+ // network solid misc_model entities to CSQC -- CEV
+ if (e.solid == SOLID_BBOX)
+ {
+ e.SendEntity = base_misc_model_netsend;
+ // send everything (at first)
+ e.SendFlags = e.SendFlags | MISC_MODEL_NET_ORIGIN |
+ MISC_MODEL_NET_MINS | MISC_MODEL_NET_MAXS |
+ MISC_MODEL_NET_MODEL | MISC_MODEL_NET_FRAME |
+ MISC_MODEL_NET_FIRSTFRAME |
+ MISC_MODEL_NET_LASTFRAME;
+ }
+ #endif
};
+#endif

+#ifdef SSQC
//--------------------------------------------------------------
void() misc_model =
{
@@ -234,4 +411,5 @@ last_frame: The last frame of the animation.

misc_model_init (self);
};
+#endif
// };

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

Diff qc/misc/modeltrain.qc

diff --git a/qc/misc/modeltrain.qc b/qc/misc/modeltrain.qc
index 1cfee59..83a47d0 100644
--- a/qc/misc/modeltrain.qc
+++ b/qc/misc/modeltrain.qc
@@ -6,15 +6,18 @@
// constants
//======================================================================

+#ifdef SSQC
const float TRAIN_STYLE_SINGLEANIM = 1; // modeltrain with one animation

const float TRAIN_ANIMTYPE_FORWARD = 1;
const float TRAIN_ANIMTYPE_BACKFORTH = 2;
+#endif

//======================================================================
// fields
//======================================================================

+#ifdef SSQC
.float first_frame2;
.float last_frame2;
.float frtime;
@@ -28,28 +31,38 @@ const float TRAIN_ANIMTYPE_BACKFORTH = 2;

.entity animcontroller;
.entity rotatecontroller;
+#endif

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

+#ifdef SSQC
// temp_anim_controller
void() temp_anim_controller_think;
entity(entity own) spawn_temp_anim_controller;
void(entity e) temp_anim_controller_init;
strip void() temp_anim_controller;
+#endif

+#ifdef SSQC
// temp_rotate_controller
entity(entity own) spawn_temp_rotate_controller;
void(entity e) temp_rotate_controller_init;
strip void() temp_rotate_controller;
+#endif

// misc_modeltrain
+#if defined(CSQC) || defined(SSQC)
void(entity e) misc_modeltrain_init;
+#endif
+#ifdef SSQC
void() misc_modeltrain;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// class temp_anim_controller: base_tempentity
// {
@@ -166,7 +179,9 @@ void() misc_modeltrain;
temp_anim_controller_init (self);
};
// };
+#endif

+#ifdef SSQC
//----------------------------------------------------------------------
// class temp_rotate_controller: base_tempentity
// {
@@ -193,16 +208,19 @@ void() misc_modeltrain;
temp_rotate_controller_init (self);
};
// };
+#endif

//----------------------------------------------------------------------
// class misc_modeltrain: base_func_train
// {
+#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void(entity e) misc_modeltrain_init =
{
e.classname = "misc_modeltrain";
e.classtype = CT_MISC_MODELTRAIN;

+ #ifdef SSQC
precache_model (e.mdl);
base_func_train_init (e);

@@ -256,8 +274,11 @@ void() misc_modeltrain;
e.animtype2 = e.animtype;

e.frame = e.first_frame;
+ #endif
};
+#endif

+#ifdef SSQC
//--------------------------------------------------------------
void() misc_modeltrain =
{
@@ -267,4 +288,5 @@ void() misc_modeltrain;

misc_modeltrain_init (self);
};
+#endif
// };

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

Diff qc/misc/noisemaker.qc

diff --git a/qc/misc/noisemaker.qc b/qc/misc/noisemaker.qc
index 018f2ba..a69b50a 100644
--- a/qc/misc/noisemaker.qc
+++ b/qc/misc/noisemaker.qc
@@ -6,10 +6,12 @@
// forward declarations
//======================================================================

+#ifdef SSQC
// misc_noisemaker
void() misc_noisemaker_think;
void(entity e) misc_noisemaker_init;
void() misc_noisemaker;
+#endif

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

@@ -20,17 +22,18 @@ For optimzation testing, starts a lot of sounds.
//----------------------------------------------------------------------
// class misc_noisemaker: base_mapentity
// {
+#ifdef SSQC
//--------------------------------------------------------------
void() misc_noisemaker_think =
{
self.nextthink = time + 0.5;
- sound (self, 1, "enforcer/enfire.wav", 1, ATTN_NORM);
- sound (self, 2, "enforcer/enfstop.wav", 1, ATTN_NORM);
- sound (self, 3, "enforcer/sight1.wav", 1, ATTN_NORM);
- sound (self, 4, "enforcer/sight2.wav", 1, ATTN_NORM);
- sound (self, 5, "enforcer/sight3.wav", 1, ATTN_NORM);
- sound (self, 6, "enforcer/sight4.wav", 1, ATTN_NORM);
- sound (self, 7, "enforcer/pain1.wav", 1, ATTN_NORM);
+ sound (self, 1, "enforcer/enfire.wav", VOL_HIGH, ATTN_NORM);
+ sound (self, 2, "enforcer/enfstop.wav", VOL_HIGH, ATTN_NORM);
+ sound (self, 3, "enforcer/sight1.wav", VOL_HIGH, ATTN_NORM);
+ sound (self, 4, "enforcer/sight2.wav", VOL_HIGH, ATTN_NORM);
+ sound (self, 5, "enforcer/sight3.wav", VOL_HIGH, ATTN_NORM);
+ sound (self, 6, "enforcer/sight4.wav", VOL_HIGH, ATTN_NORM);
+ sound (self, 7, "enforcer/pain1.wav", VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
@@ -64,4 +67,5 @@ For optimzation testing, starts a lot of sounds.

misc_noisemaker_init (self);
};
+#endif
// };

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

Diff qc/misc/particle_stream.qc

diff --git a/qc/misc/particle_stream.qc b/qc/misc/particle_stream.qc
index 5002fc5..c9689ae 100644
--- a/qc/misc/particle_stream.qc
+++ b/qc/misc/particle_stream.qc
@@ -6,6 +6,7 @@
// forward declarations
//======================================================================

+#ifdef SSQC
// misc_particle_stream
void(vector start, vector end, float color1, float color2, float pdensity)
misc_particle_stream_beam;
@@ -13,6 +14,7 @@ void() misc_particle_stream_think;
void() misc_particle_stream_use;
void(entity e) misc_particle_stream_init;
void() misc_particle_stream;
+#endif

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

@@ -32,6 +34,7 @@ I used the info_notnull, but you should be able to target anything
//----------------------------------------------------------------------
// class misc_particle_stream: base_mapentity
// {
+#ifdef SSQC
//--------------------------------------------------------------
void(vector start, vector end, float color1, float color2,
float pdensity) misc_particle_stream_beam =
@@ -80,7 +83,7 @@ I used the info_notnull, but you should be able to target anything
//--------------------------------------------------------------
void() misc_particle_stream_use =
{
- sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise, VOL_HIGH, ATTN_NORM);
// was 40 - too many particles for my taste -- dumptruck_ds
misc_particle_stream_beam (self.origin, self.enemy.origin,
self.dmg, self.cnt, 15);
@@ -119,4 +122,5 @@ I used the info_notnull, but you should be able to target anything

misc_particle_stream_init (self);
};
+#endif
// };

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

Diff qc/misc/particles.qc

diff --git a/qc/misc/particles.qc b/qc/misc/particles.qc
index e57898e..7741f52 100644
--- a/qc/misc/particles.qc
+++ b/qc/misc/particles.qc
@@ -8,20 +8,26 @@
// constants
//======================================================================

+#ifdef SSQC
const float PARTICLES_START_OFF = 1;
+#endif

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

+#ifdef SSQC
// misc_particles
void() misc_particles_think;
void() misc_particles_use;
void(entity e) misc_particles_init;
void() misc_particles;
+#endif

+#ifdef SSQC
// misc_splash
void() misc_splash;
+#endif

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

@@ -40,6 +46,7 @@ Produces a continuous particle splash for waterfalls and other effects
//----------------------------------------------------------------------
// class misc_particles: base_mapentity
// {
+#ifdef SSQC
//--------------------------------------------------------------
// was splash_think -- CEV
//--------------------------------------------------------------
@@ -110,11 +117,13 @@ Produces a continuous particle splash for waterfalls and other effects

misc_particles_init (self);
};
+#endif
// };

//----------------------------------------------------------------------
// class misc_splash: misc_particles
// {
+#ifdef SSQC
//--------------------------------------------------------------
void() misc_splash =
{
@@ -124,4 +133,5 @@ Produces a continuous particle splash for waterfalls and other effects

misc_particles_init (self);
};
+#endif
// };

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

Diff qc/misc/particlespray.qc

diff --git a/qc/misc/particlespray.qc b/qc/misc/particlespray.qc
index 9d9b593..4aef172 100644
--- a/qc/misc/particlespray.qc
+++ b/qc/misc/particlespray.qc
@@ -8,18 +8,22 @@
// fields
//======================================================================

+#ifdef SSQC
.float endtime;
.float duration;
+#endif

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

+#ifdef SSQC
// misc_particlespray
void() misc_particlespray_think;
void() misc_particlespray_use;
void(entity e) misc_particlespray_init;
void() misc_particlespray;
+#endif

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

@@ -40,6 +44,7 @@ Shoots particles either when triggered, or contiuously when not triggered by any
//----------------------------------------------------------------------
// class misc_particlespray: base_mapentity
// {
+#ifdef SSQC
//--------------------------------------------------------------
void() misc_particlespray_think =
{
@@ -49,9 +54,11 @@ Shoots particles either when triggered, or contiuously when not triggered by any
self.nextthink = time + self.delay;

if (self.noise != "")
- sound (self, CHAN_AUTO, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_AUTO, self.noise,
+ VOL_HIGH, ATTN_NORM);
else
- sound (self, CHAN_AUTO, "misc/null.wav", 1, ATTN_NORM);
+ sound (self, CHAN_AUTO, "misc/null.wav",
+ VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
@@ -101,4 +108,5 @@ Shoots particles either when triggered, or contiuously when not triggered by any

misc_particlespray_init (self);
};
+#endif
// };

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

Diff qc/misc/play.qc

diff --git a/qc/misc/play.qc b/qc/misc/play.qc
index e999bf4..fdb145d 100644
--- a/qc/misc/play.qc
+++ b/qc/misc/play.qc
@@ -13,6 +13,7 @@
// forward declarations
//======================================================================

+#ifdef SSQC
// base_play_sound
void() base_play_sound_think;
void() base_play_sound_use;
@@ -80,9 +81,11 @@ void() play_brlight;
void() play_dimlight_use;
void(entity e) play_dimlight_init;
void() play_dimlight;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// class base_play_sound: base_mapentity
// {
@@ -395,9 +398,11 @@ Use noise key for a custom sound.
{
// thanks Khreathor -- dumptruck_ds
if (self.noise != "")
- sound (self, CHAN_AUTO, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_AUTO, self.noise,
+ VOL_HIGH, ATTN_NORM);
else
- sound (self, CHAN_AUTO, "boss1/out1.wav", 1, ATTN_NORM);
+ sound (self, CHAN_AUTO, "boss1/out1.wav",
+ VOL_HIGH, ATTN_NORM);

WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_LAVASPLASH);
@@ -461,10 +466,10 @@ Use noise key for a custom sound.

if (random() < 0.5)
sound (self, CHAN_VOICE, "player/gib.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
else
sound (self, CHAN_VOICE, "player/udeath.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
@@ -548,7 +553,8 @@ triggable muzzle flash effect entity
self.effects = self.effects | EF_MUZZLEFLASH;

if (self.noise != "")
- sound (self, CHAN_AUTO, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_AUTO, self.noise,
+ VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
@@ -597,14 +603,16 @@ state 1 = start on
{
self.state = 1;
self.effects = self.effects | EF_BRIGHTFIELD;
- sound (self, CHAN_AUTO, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_AUTO, self.noise,
+ VOL_HIGH, ATTN_NORM);
}
else
{
self.state = 0;
self.effects = self.effects -
(self.effects & EF_BRIGHTFIELD);
- sound (self, CHAN_AUTO, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_AUTO, self.noise,
+ VOL_HIGH, ATTN_NORM);
}
};

@@ -657,14 +665,16 @@ state 1 = start on
{
self.state = 1;
self.effects = self.effects | EF_BRIGHTLIGHT;
- sound (self, CHAN_AUTO, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_AUTO, self.noise,
+ VOL_HIGH, ATTN_NORM);
}
else
{
self.state = 0;
self.effects = self.effects -
(self.effects & EF_BRIGHTLIGHT);
- sound (self, CHAN_AUTO, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_AUTO, self.noise,
+ VOL_HIGH, ATTN_NORM);
}
};

@@ -716,14 +726,16 @@ state 1 = start on
{
self.state = 1;
self.effects = self.effects | EF_DIMLIGHT;
- sound (self, CHAN_AUTO, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_AUTO, self.noise,
+ VOL_HIGH, ATTN_NORM);
}
else
{
self.state = 0;
self.effects = self.effects -
(self.effects & EF_DIMLIGHT);
- sound (self, CHAN_AUTO, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_AUTO, self.noise,
+ VOL_HIGH, ATTN_NORM);
}
};

@@ -761,3 +773,4 @@ state 1 = start on
play_dimlight_init (self);
};
// };
+#endif

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

Diff qc/misc/sparks.qc

diff --git a/qc/misc/sparks.qc b/qc/misc/sparks.qc
index 96421ab..e2fbd15 100644
--- a/qc/misc/sparks.qc
+++ b/qc/misc/sparks.qc
@@ -6,6 +6,7 @@
// constants
//======================================================================

+#ifdef SSQC
const float MISC_SPARKS_START_OFF = 1;
const float MISC_SPARKS_BLUE = 2;
const float MISC_SPARKS_PALE = 4;
@@ -18,23 +19,28 @@ enum
TEMP_SPARK_FADE4,
TEMP_SPARK_REMOVE
};
+#endif

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

+#ifdef SSQC
// temp_spark
void() temp_spark_think;
entity(entity own, vector org, float sflags) spawn_temp_spark;
void(entity e) temp_spark_init;
strip void() temp_spark;
+#endif

+#ifdef SSQC
// misc_sparks
void() misc_sparks_think_make;
void() misc_sparks_think_turnofflight;
void() misc_sparks_use;
void(entity e) misc_sparks_init;
void() misc_sparks;
+#endif

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

@@ -43,6 +49,7 @@ void() misc_sparks;
//----------------------------------------------------------------------
// class temp_spark: base_tempentity
// {
+#ifdef SSQC
//--------------------------------------------------------------
void() temp_spark_think =
{
@@ -112,6 +119,7 @@ void() misc_sparks;
{
temp_spark_init (self);
};
+#endif
// };

/*QUAKED misc_sparks (0 .5 .8) (-8 -8 -8) (8 8 8) MISC_SPARKS_START_OFF MISC_SPARKS_BLUE MISC_SPARKS_PALE 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
@@ -135,6 +143,7 @@ Keys:
//----------------------------------------------------------------------
// class misc_sparks: base_mapentity
// {
+#ifdef SSQC
//--------------------------------------------------------------
void() misc_sparks_think_make =
{
@@ -156,10 +165,10 @@ Keys:
if (self.sounds == 1)
if (self.noise != "")
sound (self, CHAN_AUTO, self.noise,
- 1, ATTN_STATIC);
+ VOL_HIGH, ATTN_STATIC);
else
sound (self, CHAN_AUTO, "enforcer/enfstop.wav",
- 1, ATTN_STATIC);
+ VOL_HIGH, ATTN_STATIC);

sub_usetargets ();
self.think = misc_sparks_think_turnofflight;
@@ -221,4 +230,5 @@ Keys:

misc_sparks_init (self);
};
+#endif
// };

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

Diff qc/misc/target_autosave.qc

diff --git a/qc/misc/target_autosave.qc b/qc/misc/target_autosave.qc
index 7bb2ef6..21478fd 100644
--- a/qc/misc/target_autosave.qc
+++ b/qc/misc/target_autosave.qc
@@ -6,12 +6,14 @@
// forward declarations
//======================================================================

+#ifdef SSQC
// target_autosave
void(entity client, string savename) target_autosave_save;
void() target_autosave_toggle; // not used? -- CEV
void() target_autosave_use;
void(entity e) target_autosave_init;
void() target_autosave;
+#endif

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

@@ -32,6 +34,7 @@ the bprint tends to stomp any other prints on screen in most quake clients, so u
//----------------------------------------------------------------------
// class target_autosave: base_mapentity
// {
+#ifdef SSQC
//--------------------------------------------------------------
// autosave -- was in client.qc
//--------------------------------------------------------------
@@ -143,4 +146,5 @@ the bprint tends to stomp any other prints on screen in most quake clients, so u

target_autosave_init (self);
};
+#endif
// };

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

Diff qc/misc/teleporttrain.qc

diff --git a/qc/misc/teleporttrain.qc b/qc/misc/teleporttrain.qc
index 85fe74c..2896037 100644
--- a/qc/misc/teleporttrain.qc
+++ b/qc/misc/teleporttrain.qc
@@ -7,17 +7,20 @@
// constants
//======================================================================

-enum
+#ifdef SSQC
+enum // teleporttrain states
{
TELEPORTTRAIN_NEXT,
TELEPORTTRAIN_WAIT,
TELEPORTTRAIN_FIND
};
+#endif

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

+#ifdef SSQC
// misc_teleporttrain
void() misc_teleporttrain_calcmove;
void() misc_teleporttrain_next;
@@ -26,9 +29,11 @@ void() misc_teleporttrain_find;
void() misc_teleporttrain_use;
void(entity e) misc_teleporttrain_init;
void() misc_teleporttrain;
+#endif

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

+#ifdef SSQC
/*QUAKED misc_teleporttrain (.5 .5 .5) (-16 -16 -16) (16 16 16) X DONT_ROTATE START_ON_WITH_TARGETNAME INVISIBLE 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
{ model("progs/teleport.mdl"); }
This was used for the final boss level in the original game. In progs_dump you can use this as a moving decoration or even target it as a spawn point for a func_monster_spawner. Make sure and select the Don't Rotate spawnflag though or you'll experience a pretty hilarious effect!
@@ -234,3 +239,4 @@ If a targetname is set, it must be triggered to start moving, otherwise it will
misc_teleporttrain_init (self);
};
// };
+#endif

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

Diff qc/misc/viewthing.qc

diff --git a/qc/misc/viewthing.qc b/qc/misc/viewthing.qc
index 76a84fd..4ba61dd 100644
--- a/qc/misc/viewthing.qc
+++ b/qc/misc/viewthing.qc
@@ -6,9 +6,11 @@
// forward declarations
//======================================================================

+#ifdef SSQC
// viewthing
void(entity e) viewthing_init;
void() viewthing;
+#endif

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

@@ -19,6 +21,7 @@ Just for the debugging level. Don't use
//----------------------------------------------------------------------
// class viewthing: base_mapentity
// {
+#ifdef SSQC
//--------------------------------------------------------------
void(entity e) viewthing_init =
{
@@ -42,4 +45,5 @@ Just for the debugging level. Don't use

viewthing_init (self);
};
+#endif
// };

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

Diff qc/monsters/boss.qc

diff --git a/qc/monsters/boss.qc b/qc/monsters/boss.qc
index dc13a82..abb6eb8 100644
--- a/qc/monsters/boss.qc
+++ b/qc/monsters/boss.qc
@@ -145,7 +145,7 @@ $frame shockc9 shockc10
base_monster_fire_lavaball (org, d - org, LAVABALL_SPEED);

sound_attack (self, CHAN_WEAPON, "boss1/throw.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

// check for dead enemy
if (self.enemy.health <= 0)
@@ -195,11 +195,13 @@ $frame shockc9 shockc10
//--------------------------------------------------------------
void() boss_rise1 = [$rise1, boss_rise2]
{
- sound_move (self, CHAN_WEAPON, "boss1/out1.wav", 1, ATTN_NORM);
+ sound_move (self, CHAN_WEAPON, "boss1/out1.wav",
+ VOL_HIGH, ATTN_NORM);
};
void() boss_rise2 = [$rise2, boss_rise3]
{
- sound_sight (self, CHAN_VOICE, "boss1/sight1.wav", 1,ATTN_NORM);
+ sound_sight (self, CHAN_VOICE, "boss1/sight1.wav",
+ VOL_HIGH, ATTN_NORM);
};
void() boss_rise3 = [$rise3, boss_rise4] { };
void() boss_rise4 = [$rise4, boss_rise5] { };
@@ -297,7 +299,8 @@ $frame shockc9 shockc10
//--------------------------------------------------------------
void() boss_death1 = [$death1, boss_death2]
{
- sound_death (self, CHAN_VOICE, "boss1/death.wav", 1, ATTN_NORM);
+ sound_death (self, CHAN_VOICE, "boss1/death.wav",
+ VOL_HIGH, ATTN_NORM);
};
void() boss_death2 = [$death2, boss_death3] { };
void() boss_death3 = [$death3, boss_death4] { };
@@ -308,7 +311,8 @@ $frame shockc9 shockc10
void() boss_death8 = [$death8, boss_death9] { };
void() boss_death9 = [$death9, boss_death10]
{
- sound_move (self, CHAN_BODY, "boss1/out1.wav", 1, ATTN_NORM);
+ sound_move (self, CHAN_BODY, "boss1/out1.wav",
+ VOL_HIGH, ATTN_NORM);
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_LAVASPLASH);
WriteCoord (MSG_BROADCAST, self.origin_x);
@@ -485,7 +489,8 @@ Just for boss level.
le2.nextthink = -1;
lightning_end = time + 1;

- sound (self, CHAN_VOICE, "misc/power.wav", 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, "misc/power.wav",
+ VOL_HIGH, ATTN_NORM);
event_lightning_fire ();

// advance the boss pain if down
@@ -498,7 +503,7 @@ Just for boss level.
if (le1.state == FUNC_STATE_TOP && boss.health > 0)
{
sound_pain (boss, CHAN_VOICE, "boss1/pain.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
boss.health = boss.health - 1;
if (boss.health >= 2)
sub_runvoidas (boss, boss_shocka1);

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

Diff qc/monsters/boss2.qc

diff --git a/qc/monsters/boss2.qc b/qc/monsters/boss2.qc
index ec1cc69..9cc982b 100644
--- a/qc/monsters/boss2.qc
+++ b/qc/monsters/boss2.qc
@@ -9,6 +9,9 @@
// supress lava splash effect when raising, lowering or gibbing -- dumptruck_ds
const float NO_LAVASPLASH = 2;

+const float BOSS2_HEALTH_EASY = 1000; // pd3 1000
+const float BOSS2_HEALTH_NORM = 3000; // pd3 3000
+
//======================================================================
// forward declarations
//======================================================================
@@ -147,7 +150,7 @@ $frame shockc9 shockc10
base_monster_fire_lavaball (org, d - org, LAVABALL_SPEED);

sound_attack (self, CHAN_WEAPON, "boss1/throw.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

// check for dead enemy
if (self.enemy.health <= 0)
@@ -159,7 +162,8 @@ $frame shockc9 shockc10
//--------------------------------------------------------------
void(vector dir) monster_boss2_gib =
{
- sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, "player/udeath.wav",
+ VOL_HIGH, ATTN_NORM);
// throw tons of meat chunks

local vector boss;
@@ -296,11 +300,13 @@ $frame shockc9 shockc10
//--------------------------------------------------------------
void() boss2_rise1 = [$rise1, boss2_rise2]
{
- sound_move (self, CHAN_WEAPON, "boss1/out1.wav", 1, ATTN_NORM);
+ sound_move (self, CHAN_WEAPON, "boss1/out1.wav",
+ VOL_HIGH, ATTN_NORM);
};
void() boss2_rise2 = [$rise2, boss2_rise3]
{
- sound_sight (self, CHAN_VOICE, "boss1/sight1.wav", 1,ATTN_NORM);
+ sound_sight (self, CHAN_VOICE, "boss1/sight1.wav",
+ VOL_HIGH, ATTN_NORM);
};
void() boss2_rise3 = [$rise3, boss2_rise4] { };
void() boss2_rise4 = [$rise4, boss2_rise5] { };
@@ -402,7 +408,8 @@ $frame shockc9 shockc10
void() boss2_pain4 = [$shocka4, boss2_pain5]
{
// pain noise
- sound_pain (self, CHAN_VOICE, "boss1/pain.wav", 1, ATTN_NORM);
+ sound_pain (self, CHAN_VOICE, "boss1/pain.wav",
+ VOL_HIGH, ATTN_NORM);
};
void() boss2_pain5 = [$shocka5, boss2_pain6] { };
void() boss2_pain6 = [$shocka6, boss2_pain7] { };
@@ -418,7 +425,8 @@ $frame shockc9 shockc10
//--------------------------------------------------------------
void() boss2_death1 = [$death1, boss2_death2]
{
- sound_death (self, CHAN_VOICE, "boss1/death.wav", 1, ATTN_NORM);
+ sound_death (self, CHAN_VOICE, "boss1/death.wav",
+ VOL_HIGH, ATTN_NORM);
};
void() boss2_death2 = [$death2, boss2_death3] { };
void() boss2_death3 = [$death3, boss2_death4] { };
@@ -429,7 +437,8 @@ $frame shockc9 shockc10
void() boss2_death8 = [$death8, boss2_death9] { };
void() boss2_death9 = [$death9, boss2_death10]
{
- sound_move (self, CHAN_BODY, "boss1/out1.wav", 1, ATTN_NORM);
+ sound_move (self, CHAN_BODY, "boss1/out1.wav",
+ VOL_HIGH, ATTN_NORM);
if !(self.spawnflags & NO_LAVASPLASH)
{
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
@@ -499,20 +508,18 @@ $frame shockc9 shockc10
setsize (self, '-128 -128 -24', '128 128 256');

if (!self.health)
- {
if (skill == 0)
- self.health = 1000;
+ self.health = BOSS2_HEALTH_EASY;
else
- self.health = 3000;
- }
+ self.health = BOSS2_HEALTH_NORM;

// note that self.th_run has to be set in order to avoid a
// "NULL function" Host_Error in the case where T_Damage()
// calls FoundTarget(), which calls HuntTarget(), which
// uses self.th_run as the next self.think -- iw
- self.think_run = boss2_atk1;
+ self.th_run = boss2_atk1;

- self.pain = monster_boss2_pain;
+ self.th_pain = monster_boss2_pain;
self.destroy = monster_boss2_destroy;

// give the boss a couple of seconds to finish rising

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

Diff qc/monsters/demon.qc

diff --git a/qc/monsters/demon.qc b/qc/monsters/demon.qc
index f6a5290..c89b2ed 100644
--- a/qc/monsters/demon.qc
+++ b/qc/monsters/demon.qc
@@ -7,9 +7,14 @@
//======================================================================

const float DEMON1_HEALTH = 300; // id1 300
+const float DEMON1_HEALTH_CORPSE = 80;

const vector DEMON1_HEAD_MINS = '-13.64 -16.77 -0.11';
const vector DEMON1_HEAD_MAXS = '17.44 16.22 30';
+const vector DEMON1_CORPSE_MINS = '-43.63 -47.26 -50.53';
+const vector DEMON1_CORPSE_MAXS = '32.48 24.65 30';
+const vector DEMON1_CORPSE_Z_MINS = '-20 -20 -24'; // thin 40x40 box on ground
+const vector DEMON1_CORPSE_Z_MAXS = '20 20 -8';

//======================================================================
// forward declarations
@@ -44,7 +49,9 @@ void() dem1_die9;
void(entity attacker, float damage) monster_demon1_pain; // interaction
void(vector dir) monster_demon1_destroy;
void() monster_demon1_touch;
-void(entity e) monster_demon1_init; // initialization
+entity(vector org, vector ang, float sflags, float yaw, float angry)
+ spawn_monster_demon1; // initialization
+void(entity e) monster_demon1_init;
void() monster_demon1;

// gib_head_demon
@@ -53,6 +60,7 @@ void(entity e) gib_head_demon_init;
void() gib_head_demon;

// monster_dead_demon
+void(entity e) monster_dead_demon_init;
void() monster_dead_demon;

//======================================================================
@@ -216,7 +224,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
self.attack_state = AS_MISSILE;
sound_attack (self, CHAN_VOICE, "demon/djump.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
return TRUE;
}

@@ -227,7 +235,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
void() monster_demon1_sightsound =
{
sound_sight (self, CHAN_VOICE, "demon/sight2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
@@ -247,7 +255,8 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
if (!can_damage(self, self.enemy))
return;

- sound_hit (self, CHAN_WEAPON, "demon/dhit2.wav", 1, ATTN_NORM);
+ sound_hit (self, CHAN_WEAPON, "demon/dhit2.wav",
+ VOL_HIGH, ATTN_NORM);
ldmg = 10 + 5 * random ();
t_damage2 (self.enemy, self, self, ldmg);

@@ -279,7 +288,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
if (random() < 0.2)
sound_idle (self, CHAN_VOICE, "demon/idle1.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);
ai_walk (8);
};
void() dem1_walk2 = [$walk2, dem1_walk3] { ai_walk (6); };
@@ -297,7 +306,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
if (random() < 0.2)
sound_idle (self, CHAN_VOICE, "demon/idle1.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);
ai_run (20);
};
void() dem1_run2 = [$run2, dem1_run3] { ai_run (15); };
@@ -378,8 +387,9 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//--------------------------------------------------------------
void() dem1_die1 = [$death1, dem1_die2]
{
+ base_entity_aligntoground (self);
sound_death (self, CHAN_VOICE, "demon/ddeath.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};
void() dem1_die2 = [$death2, dem1_die3] { };
void() dem1_die3 = [$death3, dem1_die4] { };
@@ -390,7 +400,11 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
self.solid = SOLID_NOT;
};
void() dem1_die7 = [$death7, dem1_die8] { };
- void() dem1_die8 = [$death8, dem1_die9] { };
+ void() dem1_die8 = [$death8, dem1_die9]
+ {
+ become_base_corpse (self, DEMON1_HEALTH_CORPSE);
+ setsize (self, DEMON1_CORPSE_Z_MINS, DEMON1_CORPSE_Z_MAXS);
+ };
void() dem1_die9 = [$death9, dem1_die9] { };

//==============================================================
@@ -407,7 +421,8 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
return;

self.pain_finished = time + 1;
- sound_pain (self, CHAN_VOICE, "demon/dpain1.wav", 1, ATTN_NORM);
+ sound_pain (self, CHAN_VOICE, "demon/dpain1.wav",
+ VOL_HIGH, ATTN_NORM);

if (random() * 200 > damage)
// didn't flinch
@@ -419,11 +434,36 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//--------------------------------------------------------------
void(vector dir) monster_demon1_destroy =
{
+ // check if we're dead already
+ if (self.classgroup & CG_CORPSE)
+ {
+ sound (self, CHAN_VOICE, "player/udeath.wav",
+ VOL_HIGH, ATTN_NORM);
+
+ throw_gib_head_demon (self, dir, self.health);
+
+ // TODO CEV this doesn't work *quite* right
+ throw_gib_1 (self, dir, self.health);
+
+ // custom models -- dumptruck_ds
+ if (self.mdl_gib2 != "")
+ throw_gib_2 (self, dir, self.health);
+ else
+ throw_gib_1 (self, dir, self.health);
+
+ if (self.mdl_gib3 != "")
+ throw_gib_3 (self, dir, self.health);
+ else
+ throw_gib_1 (self, dir, self.health);
+
+ return;
+ }
+
// check for gib
if (self.health < -80)
{
sound (self, CHAN_VOICE, "player/udeath.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

throw_gib_head_demon (self, dir, self.health);

@@ -514,6 +554,14 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//==============================================================

//--------------------------------------------------------------
+ entity(vector org, vector ang, float sflags, float yaw, float angry)
+ spawn_monster_demon1 =
+ {
+ return spawn_base_monster (org, ang, sflags, yaw, angry,
+ monster_demon1_init);
+ };
+
+ //--------------------------------------------------------------
void(entity e) monster_demon1_init =
{
if (e.spawnflags & I_AM_TURRET)
@@ -557,21 +605,21 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by

e.checkattack = monster_demon1_checkattack;
e.sightsound = monster_demon1_sightsound;
- e.think_stand = dem1_stand1;
- e.think_walk = dem1_walk1;
- e.think_run = dem1_run1;
+ e.th_stand = dem1_stand1;
+ e.th_walk = dem1_walk1;
+ e.th_run = dem1_run1;
// two attacks: melee, jump
- // e.think_melee = Demon_MeleeAttack;
- e.think_melee = dem1_atk1;
- e.think_missile = dem1_jump1;
+ // e.th_melee = Demon_MeleeAttack;
+ e.th_melee = dem1_atk1;
+ e.th_missile = dem1_jump1;

// Berserk test from
// http://celephais.net/board/view_thread.php?id=4&start=3465
// -- dumptruck_ds
if !(e.berserk)
- e.pain = monster_demon1_pain;
+ e.th_pain = monster_demon1_pain;
else
- e.pain = sub_nullpain;
+ e.th_pain = sub_nullpain;

e.destroy = monster_demon1_destroy;

@@ -653,22 +701,30 @@ model ("progs/h_demon.mdl");
model ({"path":"progs/demon.mdl","frame":53});
}
*/
-void() monster_dead_demon =
-{
- // new spawnflags for all entities -- iw
- if (SUB_Inhibit())
- return;
-
- precache_model ("progs/demon.mdl");
- setmodel (self, "progs/demon.mdl");
- self.frame = $death9;
- if (self.spawnflags & 1)
+//----------------------------------------------------------------------
+// class monster_dead_demon: base_corpse
+// {
+ //--------------------------------------------------------------
+ void(entity e) monster_dead_demon_init =
{
- self.solid = SOLID_BBOX;
- setsize (self,'-43.63 -47.26 -50.53','32.48 24.65 30');
- }
- else
+ base_corpse_init (e);
+
+ precache_model ("progs/demon.mdl");
+ setmodel (e, "progs/demon.mdl");
+
+ e.frame = $death9;
+
+ if (e.solid == SOLID_BBOX)
+ setsize (self, DEMON1_CORPSE_MINS, DEMON1_CORPSE_MAXS);
+ };
+
+ //--------------------------------------------------------------
+ void() monster_dead_demon =
{
- self.solid = SOLID_NOT;
- }
-};
+ // new spawnflags for all entities -- iw
+ if (SUB_Inhibit())
+ return;
+
+ monster_dead_demon_init (self);
+ };
+// };

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

Diff qc/monsters/dog.qc

diff --git a/qc/monsters/dog.qc b/qc/monsters/dog.qc
index 054db84..8c11199 100644
--- a/qc/monsters/dog.qc
+++ b/qc/monsters/dog.qc
@@ -7,9 +7,14 @@
//======================================================================

const float DOG_HEALTH = 25; // id1 25
+const float DOG_HEALTH_CORPSE = 20;

const vector DOG_HEAD_MINS = '-9.66 -11.89 -0.2';
const vector DOG_HEAD_MAXS = '6.57 7.96 13.29';
+const vector DOG_CORPSE_MINS = '-24.51 -16.5 -50.37';
+const vector DOG_CORPSE_MAXS = '28.2 13.81 30';
+const vector DOG_CORPSE_Z_MINS = '-16 -16 -24'; // thin 32x32 box on ground
+const vector DOG_CORPSE_Z_MAXS = '16 16 -8';

//======================================================================
// forward declarations
@@ -49,7 +54,9 @@ void() dog_dieb9;
void(entity attacker, float damage) monster_dog_pain; // interaction
void(vector dir) monster_dog_destroy;
void() monster_dog_touch_jump;
-void(entity e) monster_dog_init; // initialization
+entity(vector org, vector ang, float sflags, float yaw, float angry)
+ spawn_monster_dog; // initialization
+void(entity e) monster_dog_init;
void() monster_dog;

// gib_head_dog
@@ -58,6 +65,7 @@ void(entity e) gib_head_dog_init;
void() gib_head_dog;

// monster_dead_dog
+void(entity e) monster_dead_dog_init;
void() monster_dead_dog;

//======================================================================
@@ -230,7 +238,8 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
void() monster_dog_sightsound =
{
// dumptruck_ds
- sound_sight (self, CHAN_VOICE, "dog/dsight.wav", 1, ATTN_NORM);
+ sound_sight (self, CHAN_VOICE, "dog/dsight.wav",
+ VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
@@ -279,7 +288,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
if (random() < 0.2)
// dumptruck_ds
sound_idle (self, CHAN_VOICE, "dog/idle.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);
ai_walk (8);
};
void() dog_walk2 = [$walk2, dog_walk3] { ai_walk (8); };
@@ -298,7 +307,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
if (random() < 0.2)
// dumptruck_ds
sound_idle (self, CHAN_VOICE, "dog/idle.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);
ai_run (16);
};
void() dog_run2 = [$run2, dog_run3] { ai_run (32); };
@@ -323,7 +332,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
// dumptruck_ds
sound_attack (self, CHAN_VOICE, "dog/dattack1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
monster_dog_bite ();
};
void() dog_atta5 = [$attack5, dog_atta6] { ai_charge (10); };
@@ -388,27 +397,41 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//--------------------------------------------------------------
// Dog death state A
//--------------------------------------------------------------
- void() dog_die1 = [$death1, dog_die2] { };
+ void() dog_die1 = [$death1, dog_die2]
+ {
+ base_entity_aligntoground (self);
+ };
void() dog_die2 = [$death2, dog_die3] { };
void() dog_die3 = [$death3, dog_die4] { };
void() dog_die4 = [$death4, dog_die5] { };
void() dog_die5 = [$death5, dog_die6] { };
void() dog_die6 = [$death6, dog_die7] { };
void() dog_die7 = [$death7, dog_die8] { };
- void() dog_die8 = [$death8, dog_die9] { };
+ void() dog_die8 = [$death8, dog_die9]
+ {
+ become_base_corpse (self, DOG_HEALTH_CORPSE);
+ setsize (self, DOG_CORPSE_Z_MINS, DOG_CORPSE_Z_MAXS);
+ };
void() dog_die9 = [$death9, dog_die9] { };

//--------------------------------------------------------------
// Dog death state B
//--------------------------------------------------------------
- void() dog_dieb1 = [$deathb1, dog_dieb2] { };
+ void() dog_dieb1 = [$deathb1, dog_dieb2]
+ {
+ base_entity_aligntoground (self);
+ };
void() dog_dieb2 = [$deathb2, dog_dieb3] { };
void() dog_dieb3 = [$deathb3, dog_dieb4] { };
void() dog_dieb4 = [$deathb4, dog_dieb5] { };
void() dog_dieb5 = [$deathb5, dog_dieb6] { };
void() dog_dieb6 = [$deathb6, dog_dieb7] { };
void() dog_dieb7 = [$deathb7, dog_dieb8] { };
- void() dog_dieb8 = [$deathb8, dog_dieb9] { };
+ void() dog_dieb8 = [$deathb8, dog_dieb9]
+ {
+ become_base_corpse (self, DOG_HEALTH_CORPSE);
+ setsize (self, DOG_CORPSE_Z_MINS, DOG_CORPSE_Z_MAXS);
+ };
void() dog_dieb9 = [$deathb9, dog_dieb9] { };

//==============================================================
@@ -419,7 +442,8 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
void(entity attacker, float damage) monster_dog_pain =
{
// dumptruck_ds
- sound_pain (self, CHAN_VOICE, "dog/dpain1.wav", 1, ATTN_NORM);
+ sound_pain (self, CHAN_VOICE, "dog/dpain1.wav",
+ VOL_HIGH, ATTN_NORM);

if (random() > 0.5)
dog_pain1 ();
@@ -430,11 +454,38 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//--------------------------------------------------------------
void(vector dir) monster_dog_destroy =
{
+ // check if we're dead already
+ if (self.classgroup & CG_CORPSE)
+ {
+ sound (self, CHAN_VOICE, "player/udeath.wav",
+ VOL_HIGH, ATTN_NORM);
+
+ // custom models -- dumptruck_ds
+ if (self.mdl_gib1 != "")
+ throw_gib_1 (self, dir, self.health);
+ else
+ throw_gib_3 (self, dir, self.health);
+
+ if (self.mdl_gib2 != "")
+ throw_gib_2 (self, dir, self.health);
+ else
+ throw_gib_3 (self, dir, self.health);
+
+ if (self.mdl_gib3 != "")
+ throw_gib_3 (self, dir, self.health);
+ else
+ throw_gib_3 (self, dir, self.health);
+
+ throw_gib_head_dog (self, dir, self.health);
+
+ return;
+ }
+
// check for gib
if (self.health < -35)
{
sound (self, CHAN_VOICE, "player/udeath.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

// custom models -- dumptruck_ds
if (self.mdl_gib1 != "")
@@ -460,9 +511,9 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by

// regular death
// dumptruck_ds
- sound_death (self, CHAN_VOICE, "dog/ddeath.wav", 1, ATTN_NORM);
+ sound_death (self, CHAN_VOICE, "dog/ddeath.wav",
+ VOL_HIGH, ATTN_NORM);
self.solid = SOLID_NOT;
-
base_item_drop_stuff (self);

if (random() > 0.5)
@@ -535,6 +586,14 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//==============================================================

//--------------------------------------------------------------
+ entity(vector org, vector ang, float sflags, float yaw, float angry)
+ spawn_monster_dog =
+ {
+ return spawn_base_monster (org, ang, sflags, yaw, angry,
+ monster_dog_init);
+ };
+
+ //--------------------------------------------------------------
void(entity e) monster_dog_init =
{
if (e.spawnflags & I_AM_TURRET)
@@ -580,19 +639,19 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by

e.checkattack = monster_dog_checkattack;
e.sightsound = monster_dog_sightsound;
- e.think_stand = dog_stand1;
- e.think_walk = dog_walk1;
- e.think_run = dog_run1;
- e.think_melee = dog_atta1;
- e.think_missile = dog_leap1;
+ e.th_stand = dog_stand1;
+ e.th_walk = dog_walk1;
+ e.th_run = dog_run1;
+ e.th_melee = dog_atta1;
+ e.th_missile = dog_leap1;

// Berserk test from
// http://celephais.net/board/view_thread.php?id=4&start=3465
// -- dumptruck_ds
if !(e.berserk)
- e.pain = monster_dog_pain;
+ e.th_pain = monster_dog_pain;
else
- e.pain = sub_nullpain;
+ e.th_pain = sub_nullpain;
e.destroy = monster_dog_destroy;

// walkmonster_start
@@ -673,22 +732,30 @@ model ("progs/h_dog.mdl");
model ({"path":"progs/dog.mdl","frame":16});
}
*/
-void() monster_dead_dog =
-{
- // new spawnflags for all entities -- iw
- if (SUB_Inhibit())
- return;
-
- precache_model ("progs/dog.mdl");
- setmodel (self, "progs/dog.mdl");
- self.frame = $death8;
- if (self.spawnflags & 1)
+//----------------------------------------------------------------------
+// class monster_dead_dog: base_corpse
+// {
+ //--------------------------------------------------------------
+ void(entity e) monster_dead_dog_init =
{
- self.solid = SOLID_BBOX;
- setsize (self,'-24.51 -16.5 -50.37','28.2 13.81 30');
- }
- else
+ base_corpse_init (e);
+
+ precache_model ("progs/dog.mdl");
+ setmodel (e, "progs/dog.mdl");
+
+ e.frame = $death8;
+
+ if (e.solid == SOLID_BBOX)
+ setsize (e, DOG_CORPSE_MINS, DOG_CORPSE_MAXS);
+ };
+
+ //--------------------------------------------------------------
+ void() monster_dead_dog =
{
- self.solid = SOLID_NOT;
- }
-};
+ // new spawnflags for all entities -- iw
+ if (SUB_Inhibit())
+ return;
+
+ monster_dead_dog_init (self);
+ };
+// };

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

Diff qc/monsters/enforcer.qc

diff --git a/qc/monsters/enforcer.qc b/qc/monsters/enforcer.qc
index 89d7b3b..89755d9 100644
--- a/qc/monsters/enforcer.qc
+++ b/qc/monsters/enforcer.qc
@@ -7,9 +7,16 @@
//======================================================================

const float ENFORCER_HEALTH = 80; // id1 80
+const float ENFORCER_HEALTH_CORPSE = 40;

const vector ENFORCER_HEAD_MINS = '-10.63 -10.23 -0.05';
const vector ENFORCER_HEAD_MAXS = '9.27 8.25 30';
+const vector ENFORCER_CORPSE_MINS = '-39.85 -29.35 -49.07';
+const vector ENFORCER_CORPSE_MAXS = '20.52 33.17 30';
+const vector ENFORCER_CORPSE_F_MINS = '-41.16 -45.65 -51.95';
+const vector ENFORCER_CORPSE_F_MAXS = '21.45 25.49 30';
+const vector ENFORCER_CORPSE_Z_MINS = '-16 -16 -24'; // thin 32sq box on ground
+const vector ENFORCER_CORPSE_Z_MAXS = '16 16 -8';

//======================================================================
// forward declarations
@@ -74,7 +81,9 @@ void() enf_dief5; void() enf_dief6; void() enf_dief7; void() enf_dief8;
void() enf_dief9; void() enf_dief10; void() enf_dief11;
void(entity attacker, float damage) monster_enforcer_pain; // interaction
void(vector dir) monster_enforcer_destroy;
-void(entity e) monster_enforcer_init; // initialization
+entity(vector org, vector ang, float sflags, float yaw, float angry)
+ spawn_monster_enforcer; // initialization
+void(entity e) monster_enforcer_init;
void() monster_enforcer;

// gib_head_enforcer
@@ -83,6 +92,7 @@ void(entity e) gib_head_enforcer_init;
void() gib_head_enforcer;

// monster_dead_enforcer
+void(entity e) monster_dead_enforcer_init;
void() monster_dead_enforcer;

//======================================================================
@@ -205,16 +215,16 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
if (rsnd == 1)
// dumptruck_ds
sound_sight (self, CHAN_VOICE, "enforcer/sight1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
else if (rsnd == 2)
sound_misc (self, CHAN_VOICE, "enforcer/sight2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
else if (rsnd == 0)
sound_misc1 (self, CHAN_VOICE, "enforcer/sight3.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
else
sound_misc2 (self, CHAN_VOICE, "enforcer/sight4.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
@@ -226,7 +236,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by

self.effects = self.effects | EF_MUZZLEFLASH;
sound_attack (self, CHAN_WEAPON, "weapons/lstart.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
ai_face ();
makevectors (self.angles);
org = self.origin + v_forward * 30 + v_right * 8.5 + '0 0 16';
@@ -261,7 +271,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
self.effects = self.effects | EF_MUZZLEFLASH;
ai_face ();
sound_attack (self, CHAN_WEAPON, "enforcer/enfire.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

makevectors (self.angles);
// last number was 16 - dumptruck_ds
@@ -293,11 +303,11 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
else if (self.style == 3 || self.style == 5)
{
sound_attack (self, CHAN_WEAPON, "weapons/spike2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
self.effects = self.effects | EF_MUZZLEFLASH;
makevectors (self.angles);

- // self is changed from pd3, speed there was 600; I've
+ // this is changed from pd3, speed there was 600; I've
// set it to standard SPIKE_SPEED (1000) here -- CEV
base_monster_fire_spike (self.origin +
(v_forward * 30 + v_right * 8.5 + '0 0 16'),
@@ -336,7 +346,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
if (random() < 0.2)
// dumptruck_ds
sound_idle (self, CHAN_VOICE, "enforcer/idle1.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);
ai_walk (2);
};
void() enf_walk2 = [$walk2, enf_walk3] { ai_walk (4); };
@@ -363,7 +373,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
if (random() < 0.2)
// dumptruck_ds
sound_idle (self, CHAN_VOICE, "enforcer/idle1.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);
ai_run (18);
};
void() enf_run2 = [$run2, enf_run3] { ai_run (14); };
@@ -670,7 +680,10 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//--------------------------------------------------------------
// Enforcer death state A
//--------------------------------------------------------------
- void() enf_die1 = [$death1, enf_die2] { };
+ void() enf_die1 = [$death1, enf_die2]
+ {
+ base_entity_aligntoground (self);
+ };
void() enf_die2 = [$death2, enf_die3] { };
void() enf_die3 = [$death3, enf_die4]
{
@@ -704,13 +717,20 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
void() enf_die10 = [$death10, enf_die11] { ai_forward (5); };
void() enf_die11 = [$death11, enf_die12] { ai_forward (5); };
void() enf_die12 = [$death12, enf_die13] { ai_forward (5); };
- void() enf_die13 = [$death13, enf_die14] { };
+ void() enf_die13 = [$death13, enf_die14]
+ {
+ become_base_corpse (self, ENFORCER_HEALTH_CORPSE);
+ setsize (self, ENFORCER_CORPSE_Z_MINS, ENFORCER_CORPSE_Z_MAXS);
+ };
void() enf_die14 = [$death14, enf_die14] { };

//--------------------------------------------------------------
// Enforcer death state F
//--------------------------------------------------------------
- void() enf_dief1 = [$fdeath1, enf_dief2] { };
+ void() enf_dief1 = [$fdeath1, enf_dief2]
+ {
+ base_entity_aligntoground (self);
+ };
void() enf_dief2 = [$fdeath2, enf_dief3] { };
void() enf_dief3 = [$fdeath3, enf_dief4]
{
@@ -741,7 +761,11 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
void() enf_dief7 = [$fdeath7, enf_dief8] { };
void() enf_dief8 = [$fdeath8, enf_dief9] { };
void() enf_dief9 = [$fdeath9, enf_dief10] { };
- void() enf_dief10 = [$fdeath10, enf_dief11] { };
+ void() enf_dief10 = [$fdeath10, enf_dief11]
+ {
+ become_base_corpse (self, ENFORCER_HEALTH_CORPSE);
+ setsize (self, ENFORCER_CORPSE_Z_MINS, ENFORCER_CORPSE_Z_MAXS);
+ };
void() enf_dief11 = [$fdeath11, enf_dief11] { };

//==============================================================
@@ -763,11 +787,11 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
if (r < 0.5)
// dumptruck_ds
sound_pain (self, CHAN_VOICE, "enforcer/pain1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
else
// dumptruck_ds
sound_misc3 (self, CHAN_VOICE, "enforcer/pain2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

if (r < 0.2)
{
@@ -810,11 +834,25 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//--------------------------------------------------------------
void(vector dir) monster_enforcer_destroy =
{
+ // check if we're dead already
+ if (self.classgroup & CG_CORPSE)
+ {
+ sound (self, CHAN_VOICE, "player/udeath.wav",
+ VOL_HIGH, ATTN_NORM);
+
+ throw_gib_head_enforcer (self, dir, self.health);
+ throw_gib_1 (self, dir, self.health);
+ throw_gib_2 (self, dir, self.health);
+ throw_gib_3 (self, dir, self.health);
+
+ return;
+ }
+
// check for gib
if (self.health < -35)
{
sound (self, CHAN_VOICE, "player/udeath.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

throw_gib_head_enforcer (self, dir, self.health);
throw_gib_1 (self, dir, self.health);
@@ -828,7 +866,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
// regular death
// dumptruck_ds
sound_death (self, CHAN_VOICE, "enforcer/death1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
base_item_drop_stuff (self);
if (random() > 0.5)
enf_die1 ();
@@ -841,6 +879,14 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//==============================================================

//--------------------------------------------------------------
+ entity(vector org, vector ang, float sflags, float yaw, float angry)
+ spawn_monster_enforcer =
+ {
+ return spawn_base_monster (org, ang, sflags, yaw, angry,
+ monster_enforcer_init);
+ };
+
+ //--------------------------------------------------------------
void(entity e) monster_enforcer_init =
{
if (deathmatch)
@@ -897,39 +943,39 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
e.health = ENFORCER_HEALTH;

e.sightsound = monster_enforcer_sightsound;
- e.think_stand = enf_stand1;
- e.think_walk = enf_walk1;
+ e.th_stand = enf_stand1;
+ e.th_walk = enf_walk1;

if (e.spawnflags & I_AM_TURRET)
- e.think_run = enf_standb1;
+ e.th_run = enf_standb1;
else
- e.think_run = enf_run1;
+ e.th_run = enf_run1;
// Berserk test from
// http://celephais.net/board/view_thread.php?id=4&start=3465
// -- dumptruck_ds
if !(e.berserk)
- e.pain = monster_enforcer_pain;
+ e.th_pain = monster_enforcer_pain;
else
- e.pain = sub_nullpain;
+ e.th_pain = sub_nullpain;
e.destroy = monster_enforcer_destroy;
// new animation frame check -- dumptruck_ds
if (e.style == 1 || e.style == 2 || e.style == 5)
{
if (e.spawnflags & I_AM_TURRET)
- e.think_turret = enf_tur_atkb1;
- e.think_missile = enf_atkb1;
+ e.th_turret = enf_tur_atkb1;
+ e.th_missile = enf_atkb1;
}
else if (e.style == 0 || e.style == 3 )
{
if (e.spawnflags & I_AM_TURRET)
- e.think_turret = enf_tur_atk1;
- e.think_missile = enf_atk1;
+ e.th_turret = enf_tur_atk1;
+ e.th_missile = enf_atk1;
}
else if (e.style == 4)
{
if (e.spawnflags & I_AM_TURRET)
- e.think_turret = enf_tur_atkc1;
- e.think_missile = enf_atkc1;
+ e.th_turret = enf_tur_atkc1;
+ e.th_missile = enf_atkc1;
}

// walkmonster_start
@@ -1012,40 +1058,41 @@ model ("progs/h_mega.mdl");
}
*/
//----------------------------------------------------------------------
-void() monster_dead_enforcer =
-{
- // new spawnflags for all entities -- iw
- if (SUB_Inhibit())
- return;
-
- precache_model ("progs/enforcer.mdl");
- setmodel (self, "progs/enforcer.mdl");
- if (self.spawnflags & 2)
+// class monster_dead_enforcer: base_corpse
+// {
+ //--------------------------------------------------------------
+ void(entity e) monster_dead_enforcer_init =
{
- self.frame = $fdeath11;
+ base_corpse_init (e);
+
+ precache_model ("progs/enforcer.mdl");
+ setmodel (e, "progs/enforcer.mdl");

- if (self.spawnflags & 1)
+ if (e.spawnflags & 2)
{
- self.solid = SOLID_BBOX;
- setsize (self,'-41.16 -45.65 -51.95','21.45 25.49 30');
+ e.frame = $fdeath11;
+
+ if (e.solid == SOLID_BBOX)
+ setsize (e, ENFORCER_CORPSE_F_MINS,
+ ENFORCER_CORPSE_F_MAXS);
}
else
{
- self.solid = SOLID_NOT;
+ e.frame = $death14;
+
+ if (e.solid == SOLID_BBOX)
+ setsize (e, ENFORCER_CORPSE_MINS,
+ ENFORCER_CORPSE_MAXS);
}
- }
- else
+ };
+
+ //--------------------------------------------------------------
+ void() monster_dead_enforcer =
{
- self.frame = $death14;
+ // new spawnflags for all entities -- iw
+ if (SUB_Inhibit())
+ return;

- if (self.spawnflags & 1)
- {
- self.solid = SOLID_BBOX;
- setsize (self,'-39.85 -29.35 -49.07','20.52 33.17 30');
- }
- else
- {
- self.solid = SOLID_NOT;
- }
- }
-};
+ monster_dead_enforcer_init (self);
+ };
+// };

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

Diff qc/monsters/fish.qc

diff --git a/qc/monsters/fish.qc b/qc/monsters/fish.qc
index fad7015..b04151c 100644
--- a/qc/monsters/fish.qc
+++ b/qc/monsters/fish.qc
@@ -7,6 +7,10 @@
//======================================================================

const float FISH_HEALTH = 25; // id1 25
+const float FISH_HEALTH_CORPSE = 20;
+
+const vector FISH_CORPSE_Z_MINS = '-16 -16 -24'; // thin 32x32 box on ground
+const vector FISH_CORPSE_Z_MAXS = '16 16 -8';

//======================================================================
// forward declarations
@@ -45,7 +49,9 @@ void() fish_death18; void() fish_death19; void() fish_death20;
void() fish_death21;
void(entity attacker, float damage) monster_fish_pain; // interaction
void(vector dir) monster_fish_destroy;
-void(entity e) monster_fish_init; // initialization
+entity(vector org, vector ang, float sflags, float yaw, float angry)
+ spawn_monster_fish; // initialization
+void(entity e) monster_fish_init;
void() monster_fish;

//======================================================================
@@ -145,7 +151,8 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
if (vlen(delta) > 60)
return;

- sound_attack (self, CHAN_VOICE, "fish/bite.wav", 1, ATTN_NORM);
+ sound_attack (self, CHAN_VOICE, "fish/bite.wav",
+ VOL_HIGH, ATTN_NORM);
ldmg = (random() + random()) * 3;
t_damage2 (self.enemy, self, self, ldmg);
};
@@ -202,7 +209,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
ai_run (12);
if (random() < 0.5)
sound_idle (self, CHAN_VOICE, "fish/idle.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};
void() fish_run2 = [$swim3, fish_run3] { ai_run (12); };
void() fish_run3 = [$swim5, fish_run4] { ai_run (12); };
@@ -260,11 +267,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//--------------------------------------------------------------
// Fish death states (RIP fish)
//--------------------------------------------------------------
- void() fish_death1 = [$death1, fish_death2]
- {
- self.solid = SOLID_NOT;
- sound_death (self, CHAN_VOICE, "fish/death.wav", 1, ATTN_NORM);
- };
+ void() fish_death1 = [$death1, fish_death2] { };
void() fish_death2 = [$death2, fish_death3] { };
void() fish_death3 = [$death3, fish_death4] { };
void() fish_death4 = [$death4, fish_death5] { };
@@ -283,7 +286,11 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
void() fish_death17 = [$death17, fish_death18] { };
void() fish_death18 = [$death18, fish_death19] { };
void() fish_death19 = [$death19, fish_death20] { };
- void() fish_death20 = [$death20, fish_death21] { };
+ void() fish_death20 = [$death20, fish_death21]
+ {
+ become_base_corpse (self, FISH_HEALTH_CORPSE);
+ setsize (self, FISH_CORPSE_Z_MINS, FISH_CORPSE_Z_MAXS);
+ };
void() fish_death21 = [$death21, fish_death21] { };

//==============================================================
@@ -304,15 +311,12 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//--------------------------------------------------------------
void(vector dir) monster_fish_destroy =
{
- if (self.health < -35)
+ // check if we're dead already
+ if (self.classgroup & CG_CORPSE)
{
// fish gibs -- dumptruck_ds
sound (self, CHAN_VOICE, "player/udeath.wav",
- 1, ATTN_NORM);
-
- // throw_gib ("progs/gib3.mdl", self.health);
- // throw_gib ("progs/gib1.mdl", self.health);
- // throw_gib ("progs/gib3.mdl", self.health);
+ VOL_HIGH, ATTN_NORM);

// custom models -- dumptruck_ds
if (self.mdl_gib1 != "")
@@ -330,19 +334,47 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
else
throw_gib_3 (self, dir, self.health);

- base_item_drop_stuff (self);
-
// no fish heads -- CEV
remove (self);
- // self.think = sub_remove;
- // self.nextthink = time + 0.1;
+ return;
}
- else
+
+ // check for gib
+ if (self.health < -35)
{
- // regular death
+ // fish gibs -- dumptruck_ds
+ sound (self, CHAN_VOICE, "player/udeath.wav",
+ VOL_HIGH, ATTN_NORM);
+
+ // custom models -- dumptruck_ds
+ if (self.mdl_gib1 != "")
+ throw_gib_1 (self, dir, self.health);
+ else
+ throw_gib_3 (self, dir, self.health);
+
+ if (self.mdl_gib2 != "")
+ throw_gib_2 (self, dir, self.health);
+ else
+ throw_gib_3 (self, dir, self.health);
+
+ if (self.mdl_gib3 != "")
+ throw_gib_3 (self, dir, self.health);
+ else
+ throw_gib_3 (self, dir, self.health);
+
base_item_drop_stuff (self);
- fish_death1 ();
+
+ // no fish heads -- CEV
+ remove (self);
+ return;
}
+
+ // regular death
+ self.solid = SOLID_NOT;
+ base_item_drop_stuff (self);
+ sound_death (self, CHAN_VOICE, "fish/death.wav",
+ VOL_HIGH, ATTN_NORM);
+ fish_death1 ();
};

//==============================================================
@@ -350,6 +382,14 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//==============================================================

//--------------------------------------------------------------
+ entity(vector org, vector ang, float sflags, float yaw, float angry)
+ spawn_monster_fish =
+ {
+ return spawn_base_monster (org, ang, sflags, yaw, angry,
+ monster_fish_init);
+ };
+
+ //--------------------------------------------------------------
void(entity e) monster_fish_init =
{
if (e.spawnflags & I_AM_TURRET)
@@ -387,18 +427,18 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
// thanks RennyC -- dumptruck_ds
e.health = FISH_HEALTH;

- e.think_stand = fish_stand1;
- e.think_walk = fish_walk1;
- e.think_run = fish_run1;
+ e.th_stand = fish_stand1;
+ e.th_walk = fish_walk1;
+ e.th_run = fish_run1;
e.destroy = monster_fish_destroy;
// Berserk from
// http://celephais.net/board/view_thread.php?id=4&start=3465
// -- dumptruck_ds
if !(e.berserk)
- e.pain = monster_fish_pain;
+ e.th_pain = monster_fish_pain;
else
- e.pain = sub_nullpain;
- e.think_melee = fish_atk1;
+ e.th_pain = sub_nullpain;
+ e.th_melee = fish_atk1;

// swimmonster_start
base_swimmonster_init (e);

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

Diff qc/monsters/hknight.qc

diff --git a/qc/monsters/hknight.qc b/qc/monsters/hknight.qc
index dad8e9a..8a1b691 100644
--- a/qc/monsters/hknight.qc
+++ b/qc/monsters/hknight.qc
@@ -9,9 +9,16 @@
//======================================================================

const float HELL_KNIGHT_HEALTH = 250; // id1 250
+const float HELL_KNIGHT_HEALTH_CORPSE = 60;

const vector HELL_KNIGHT_HEAD_MINS = '-7.9 -12.97 -0.63';
const vector HELL_KNIGHT_HEAD_MAXS = '10.55 8.87 21.06';
+const vector HELL_KNIGHT_CORPSE_MINS = '-42.05 -31.07 -51.56';
+const vector HELL_KNIGHT_CORPSE_MAXS = '46.34 25.02 30';
+const vector HELL_KNIGHT_CORPSE_B_MINS = '-68.96 -20.43 -53.98';
+const vector HELL_KNIGHT_CORPSE_B_MAXS = '34.8 21.15 30';
+const vector HELL_KNIGHT_CORPSE_Z_MINS = '-16 -16 -24';
+const vector HELL_KNIGHT_CORPSE_Z_MAXS = '16 16 -8';

//======================================================================
// forward declarations
@@ -89,7 +96,9 @@ void() hkn_dieb5; void() hkn_dieb6; void() hkn_dieb7; void() hkn_dieb8;
void() hkn_dieb9;
void(entity attacker, float damage) monster_hell_knight_pain; // interaction
void(vector dir) monster_hell_knight_destroy;
-void(entity e) monster_hell_knight_init;// initialization
+entity(vector org, vector ang, float sflags, float yaw, float angry)
+ spawn_monster_hell_knight; // initialization
+void(entity e) monster_hell_knight_init;
void() monster_hell_knight;

// gib_head_hell_knight
@@ -98,6 +107,7 @@ void(entity e) gib_head_hell_knight_init;
void() gib_head_hell_knight;

// monster_dead_hell_knight
+void(entity e) monster_dead_hell_knight_init;
void() monster_dead_hell_knight;

//======================================================================
@@ -226,7 +236,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
void() monster_hell_knight_sightsound =
{
sound_sight (self, CHAN_VOICE, "hknight/sight1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
@@ -266,10 +276,10 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by

if (random() > 0.5)
sound (self, CHAN_WEAPON, "knight/sword2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
else
sound (self, CHAN_WEAPON, "knight/sword1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
@@ -281,7 +291,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by

self.effects = self.effects | EF_MUZZLEFLASH;
sound_attack(self, CHAN_WEAPON, "weapons/lstart.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
ai_face ();
makevectors (self.angles);
org = self.origin + v_forward * 50 + '0 0 20';
@@ -315,7 +325,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
self.animtype = self.animtype + 1;

sound_misc (self, CHAN_WEAPON, "hknight/slash1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
if (self.animtype == 1)
{
hkn_slice1 ();
@@ -356,7 +366,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
if (random() < 0.2)
sound_idle (self, CHAN_VOICE, "hknight/idle.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
@@ -663,7 +673,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
ai_face ();
sound_misc2 (self, CHAN_WEAPON, "shambler/sboom.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
monster_hell_knight_attack_lightning ();
};
void() hkn_magicb11 = [$magicb11, hkn_magicb12] { ai_face (); };
@@ -736,7 +746,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
ai_face ();
sound_misc2 (self, CHAN_WEAPON, "shambler/sboom.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
monster_hell_knight_attack_lightning ();
};
void() hkn_tur_magb11 = [$magicb11, hkn_tur_magb12] { ai_face (); };
@@ -787,7 +797,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
void() hkn_pain1 = [$pain1, hkn_pain2]
{
sound_pain (self, CHAN_VOICE, "hknight/pain1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};
void() hkn_pain2 = [$pain2, hkn_pain3] { };
void() hkn_pain3 = [$pain3, hkn_pain4] { };
@@ -797,7 +807,11 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//--------------------------------------------------------------
// Death Knight death state A
//--------------------------------------------------------------
- void() hkn_die1 = [$death1, hkn_die2] { ai_forward (10); };
+ void() hkn_die1 = [$death1, hkn_die2]
+ {
+ ai_forward (10);
+ base_entity_aligntoground (self);
+ };
void() hkn_die2 = [$death2, hkn_die3] { ai_forward (8); };
void() hkn_die3 = [$death3, hkn_die4]
{
@@ -811,20 +825,36 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
void() hkn_die8 = [$death8, hkn_die9] { ai_forward (10); };
void() hkn_die9 = [$death9, hkn_die10] { ai_forward (11); };
void() hkn_die10 = [$death10, hkn_die11] { };
- void() hkn_die11 = [$death11, hkn_die12] { };
+ void() hkn_die11 = [$death11, hkn_die12]
+ {
+ become_base_corpse (self, HELL_KNIGHT_HEALTH_CORPSE);
+ setsize (self, HELL_KNIGHT_CORPSE_Z_MINS,
+ HELL_KNIGHT_CORPSE_Z_MAXS);
+ };
void() hkn_die12 = [$death12, hkn_die12] { };

//--------------------------------------------------------------
// Death Knight death state B
//--------------------------------------------------------------
- void() hkn_dieb1 = [$deathb1, hkn_dieb2] { };
+ void() hkn_dieb1 = [$deathb1, hkn_dieb2]
+ {
+ base_entity_aligntoground (self);
+ };
void() hkn_dieb2 = [$deathb2, hkn_dieb3] { };
- void() hkn_dieb3 = [$deathb3, hkn_dieb4] { self.solid = SOLID_NOT; };
+ void() hkn_dieb3 = [$deathb3, hkn_dieb4]
+ {
+ self.solid = SOLID_NOT;
+ };
void() hkn_dieb4 = [$deathb4, hkn_dieb5] { };
void() hkn_dieb5 = [$deathb5, hkn_dieb6] { };
void() hkn_dieb6 = [$deathb6, hkn_dieb7] { };
void() hkn_dieb7 = [$deathb7, hkn_dieb8] { };
- void() hkn_dieb8 = [$deathb8, hkn_dieb9] { };
+ void() hkn_dieb8 = [$deathb8, hkn_dieb9]
+ {
+ become_base_corpse (self, HELL_KNIGHT_HEALTH_CORPSE);
+ setsize (self, HELL_KNIGHT_CORPSE_Z_MINS,
+ HELL_KNIGHT_CORPSE_Z_MAXS);
+ };
void() hkn_dieb9 = [$deathb9, hkn_dieb9] { };

//==============================================================
@@ -849,13 +879,14 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
self.pain_finished = time + 1.5;
sound_pain (self, CHAN_VOICE,
- "hknight/pain1.wav", 1, ATTN_NORM);
+ "hknight/pain1.wav",
+ VOL_HIGH, ATTN_NORM);
}
return;
}

sound_pain (self, CHAN_VOICE, "hknight/pain1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

if (time - self.pain_finished > 5)
{
@@ -878,11 +909,25 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//--------------------------------------------------------------
void(vector dir) monster_hell_knight_destroy =
{
+ // check if we're dead already
+ if (self.classgroup & CG_CORPSE)
+ {
+ sound (self, CHAN_VOICE, "player/udeath.wav",
+ VOL_HIGH, ATTN_NORM);
+
+ throw_gib_head_hell_knight (self, dir, self.health);
+ throw_gib_1 (self, dir, self.health);
+ throw_gib_2 (self, dir, self.health);
+ throw_gib_3 (self, dir, self.health);
+
+ return;
+ }
+
// check for gib
if (self.health < -40)
{
sound (self, CHAN_VOICE, "player/udeath.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

throw_gib_head_hell_knight (self, dir, self.health);
throw_gib_1 (self, dir, self.health);
@@ -895,7 +940,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by

// regular death
sound_death (self, CHAN_VOICE, "hknight/death1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
base_item_drop_stuff (self);
if (random() > 0.5)
hkn_die1 ();
@@ -908,6 +953,14 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//==============================================================

//--------------------------------------------------------------
+ entity(vector org, vector ang, float sflags, float yaw, float angry)
+ spawn_monster_hell_knight =
+ {
+ return spawn_base_monster (org, ang, sflags, yaw, angry,
+ monster_hell_knight_init);
+ };
+
+ //--------------------------------------------------------------
void(entity e) monster_hell_knight_init =
{
if (deathmatch)
@@ -967,30 +1020,30 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
e.proj_speed_mod = 1;

e.sightsound = monster_hell_knight_sightsound;
- e.think_stand = hkn_stand1;
- e.think_walk = hkn_walk1;
+ e.th_stand = hkn_stand1;
+ e.th_walk = hkn_walk1;
if (e.spawnflags & I_AM_TURRET)
- e.think_run = hkn_seek_stand1;
+ e.th_run = hkn_seek_stand1;
else
- e.think_run = hkn_run1;
- e.think_melee = monster_hell_knight_attack_melee;
+ e.th_run = hkn_run1;
+ e.th_melee = monster_hell_knight_attack_melee;
if (e.style == 1)
{
- e.think_missile = hkn_magicb1;
- e.think_turret = hkn_tur_magb1;
+ e.th_missile = hkn_magicb1;
+ e.th_turret = hkn_tur_magb1;
}
else
{
- e.think_missile = hkn_magicc1;
- e.think_turret = hkn_tur_magc1;
+ e.th_missile = hkn_magicc1;
+ e.th_turret = hkn_tur_magc1;
}
// Berserk test from
// http://celephais.net/board/view_thread.php?id=4&start=3465
// -- dumptruck_ds
if !(e.berserk)
- e.pain = monster_hell_knight_pain;
+ e.th_pain = monster_hell_knight_pain;
else
- e.pain = sub_nullpain;
+ e.th_pain = sub_nullpain;
e.destroy = monster_hell_knight_destroy;

// walkmonster_start
@@ -1072,39 +1125,41 @@ model ("progs/h_hellkn.mdl");
}
*/
//----------------------------------------------------------------------
-void() monster_dead_hell_knight =
-{
- // new spawnflags for all entities -- iw
- if (SUB_Inhibit())
- return;
-
- precache_model ("progs/hknight.mdl");
- setmodel (self, "progs/hknight.mdl");
- if (self.spawnflags & 2)
+// class monster_dead_hell_knight: base_corpse
+// {
+ //--------------------------------------------------------------
+ void(entity e) monster_dead_hell_knight_init =
{
- self.frame = $deathb9;
+ base_corpse_init (e);
+
+ precache_model ("progs/hknight.mdl");
+ setmodel (e, "progs/hknight.mdl");

- if (self.spawnflags & 1)
+ if (e.spawnflags & 2)
{
- self.solid = SOLID_BBOX;
- setsize (self,'-68.96 -20.43 -53.98','34.8 21.15 30');
+ e.frame = $deathb9;
+
+ if (e.solid == SOLID_BBOX)
+ setsize (e, HELL_KNIGHT_CORPSE_B_MINS,
+ HELL_KNIGHT_CORPSE_B_MAXS);
}
else
{
- self.solid = SOLID_NOT;
+ e.frame = $death12;
+
+ if (e.solid == SOLID_BBOX)
+ setsize (e, HELL_KNIGHT_CORPSE_MINS,
+ HELL_KNIGHT_CORPSE_MAXS);
}
- }
- else
+ };
+
+ //--------------------------------------------------------------
+ void() monster_dead_hell_knight =
{
- self.frame = $death12;
- if (self.spawnflags & 1)
- {
- self.solid = SOLID_BBOX;
- setsize (self,'-42.05 -31.07 -51.56','46.34 25.02 30');
- }
- else
- {
- self.solid = SOLID_NOT;
- }
- }
-};
+ // new spawnflags for all entities -- iw
+ if (SUB_Inhibit())
+ return;
+
+ monster_dead_hell_knight_init (self);
+ };
+// };

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

Diff qc/monsters/knight.qc

diff --git a/qc/monsters/knight.qc b/qc/monsters/knight.qc
index ff4506e..9227c72 100644
--- a/qc/monsters/knight.qc
+++ b/qc/monsters/knight.qc
@@ -7,9 +7,16 @@
//======================================================================

const float KNIGHT_HEALTH = 75; // id1 75
+const float KNIGHT_HEALTH_CORPSE = 60;

const vector KNIGHT_HEAD_MINS = '-8.17 -7.47 -0.13';
const vector KNIGHT_HEAD_MAXS = '8.36 6.5 30';
+const vector KNIGHT_CORPSE_MINS = '-25.56 -14.56 -50.49';
+const vector KNIGHT_CORPSE_MAXS = '26.45 40.2 30';
+const vector KNIGHT_CORPSE_B_MINS = '-30.36 -45.6 -50.18';
+const vector KNIGHT_CORPSE_B_MAXS = '28.29 11.59 30';
+const vector KNIGHT_CORPSE_Z_MINS = '-16 -16 -24';
+const vector KNIGHT_CORPSE_Z_MAXS = '16 16 -8';

//======================================================================
// forward declarations
@@ -48,7 +55,9 @@ void() kn_dieb5; void() kn_dieb6; void() kn_dieb7; void() kn_dieb8;
void() kn_dieb9; void() kn_dieb10; void() kn_dieb11;
void(entity attacker, float damage) monster_knight_pain; // interaction
void(vector dir) monster_knight_destroy;
-void(entity e) monster_knight_init; // initialization
+entity(vector org, vector ang, float sflags, float yaw, float angry)
+ spawn_monster_knight; // initialization
+void(entity e) monster_knight_init;
void() monster_knight;

// gib_head_knight
@@ -57,6 +66,7 @@ void(entity e) gib_head_knight_init
void() gib_head_knight;

// monster_dead_knight
+void(entity e) monster_dead_knight_init;
void() monster_dead_knight;

//======================================================================
@@ -170,7 +180,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
void() monster_knight_sightsound =
{
sound_sight (self, CHAN_VOICE, "knight/ksight.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
@@ -210,7 +220,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
if (random() < 0.2)
sound_idle (self, CHAN_VOICE, "knight/idle.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);
ai_walk (3);
};
void() kn_walk2 = [$walk2, kn_walk3] { ai_walk (2); };
@@ -234,7 +244,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
if (random() < 0.2)
sound_idle (self, CHAN_VOICE, "knight/idle.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);
ai_run (16);
};
void() kn_run2 = [ $runb2, kn_run3] { ai_run (20); };
@@ -252,10 +262,10 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
if (random() > 0.5)
sound_misc (self, CHAN_WEAPON, "knight/sword2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
else
sound_attack (self, CHAN_WEAPON, "knight/sword1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
ai_charge (20);
};
void() kn_runatk2 = [$runattack2, kn_runatk3] { ai_charge_side (); };
@@ -275,7 +285,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
void() kn_atk1 = [$attackb1, kn_atk2]
{
sound_attack (self, CHAN_WEAPON, "knight/sword1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
ai_charge (0);
};
void() kn_atk2 = [$attackb2, kn_atk3] { ai_charge (7); };
@@ -343,7 +353,10 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//--------------------------------------------------------------
// Knight Death state A
//--------------------------------------------------------------
- void() kn_die1 = [$death1, kn_die2] { };
+ void() kn_die1 = [$death1, kn_die2]
+ {
+ base_entity_aligntoground (self);
+ };
void() kn_die2 = [$death2, kn_die3] { };
void() kn_die3 = [$death3, kn_die4] { self.solid = SOLID_NOT; };
void() kn_die4 = [$death4, kn_die5] { };
@@ -351,22 +364,33 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
void() kn_die6 = [$death6, kn_die7] { };
void() kn_die7 = [$death7, kn_die8] { };
void() kn_die8 = [$death8, kn_die9] { };
- void() kn_die9 = [$death9, kn_die10] { };
+ void() kn_die9 = [$death9, kn_die10]
+ {
+ become_base_corpse (self, KNIGHT_HEALTH_CORPSE);
+ setsize (self, KNIGHT_CORPSE_Z_MINS, KNIGHT_CORPSE_Z_MAXS);
+ };
void() kn_die10 = [$death10, kn_die10] { };

//--------------------------------------------------------------
// Knight Death state B
//--------------------------------------------------------------
- void() kn_dieb1 = [$deathb1, kn_dieb2 ] { };
- void() kn_dieb2 = [$deathb2, kn_dieb3 ] { };
- void() kn_dieb3 = [$deathb3, kn_dieb4 ] { self.solid = SOLID_NOT; };
- void() kn_dieb4 = [$deathb4, kn_dieb5 ] { };
- void() kn_dieb5 = [$deathb5, kn_dieb6 ] { };
- void() kn_dieb6 = [$deathb6, kn_dieb7 ] { };
- void() kn_dieb7 = [$deathb7, kn_dieb8 ] { };
- void() kn_dieb8 = [$deathb8, kn_dieb9 ] { };
+ void() kn_dieb1 = [$deathb1, kn_dieb2]
+ {
+ base_entity_aligntoground (self);
+ };
+ void() kn_dieb2 = [$deathb2, kn_dieb3] { };
+ void() kn_dieb3 = [$deathb3, kn_dieb4] { self.solid = SOLID_NOT; };
+ void() kn_dieb4 = [$deathb4, kn_dieb5] { };
+ void() kn_dieb5 = [$deathb5, kn_dieb6] { };
+ void() kn_dieb6 = [$deathb6, kn_dieb7] { };
+ void() kn_dieb7 = [$deathb7, kn_dieb8] { };
+ void() kn_dieb8 = [$deathb8, kn_dieb9] { };
void() kn_dieb9 = [$deathb9, kn_dieb10] { };
- void() kn_dieb10 = [$deathb10, kn_dieb11] { };
+ void() kn_dieb10 = [$deathb10, kn_dieb11]
+ {
+ become_base_corpse (self, KNIGHT_HEALTH_CORPSE);
+ setsize (self, KNIGHT_CORPSE_Z_MINS, KNIGHT_CORPSE_Z_MAXS);
+ };
void() kn_dieb11 = [$deathb11, kn_dieb11] { };

//==============================================================
@@ -384,7 +408,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
local float r = random ();

sound_pain (self, CHAN_VOICE, "knight/khurt.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

if (r < 0.85)
{
@@ -403,11 +427,25 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//--------------------------------------------------------------
void(vector dir) monster_knight_destroy =
{
+ // check if we're dead already
+ if (self.classgroup & CG_CORPSE)
+ {
+ sound (self, CHAN_VOICE, "player/udeath.wav",
+ VOL_HIGH, ATTN_NORM);
+
+ throw_gib_head_knight (self, dir, self.health);
+ throw_gib_1 (self, dir, self.health);
+ throw_gib_2 (self, dir, self.health);
+ throw_gib_3 (self, dir, self.health);
+
+ return;
+ }
+
// check for gib
if (self.health < -40)
{
sound (self, CHAN_VOICE, "player/udeath.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

throw_gib_head_knight (self, dir, self.health);
throw_gib_1 (self, dir, self.health);
@@ -420,7 +458,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by

// regular death
sound_death (self, CHAN_VOICE, "knight/kdeath.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
base_item_drop_stuff (self);
if (random() < 0.5)
kn_die1 ();
@@ -433,6 +471,14 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//==============================================================

//--------------------------------------------------------------
+ entity(vector org, vector ang, float sflags, float yaw, float angry)
+ spawn_monster_knight =
+ {
+ return spawn_base_monster (org, ang, sflags, yaw, angry,
+ monster_knight_init);
+ };
+
+ //--------------------------------------------------------------
void(entity e) monster_knight_init =
{
if (e.spawnflags & I_AM_TURRET)
@@ -476,17 +522,17 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
e.health = KNIGHT_HEALTH;

e.sightsound = monster_knight_sightsound;
- e.think_stand = kn_stand1;
- e.think_walk = kn_walk1;
- e.think_run = kn_run1;
- e.think_melee = kn_atk1;
+ e.th_stand = kn_stand1;
+ e.th_walk = kn_walk1;
+ e.th_run = kn_run1;
+ e.th_melee = kn_atk1;
// Berserk test from
// http://celephais.net/board/view_thread.php?id=4&start=3465
// -- dumptruck_ds
if !(e.berserk)
- e.pain = monster_knight_pain;
+ e.th_pain = monster_knight_pain;
else
- e.pain = sub_nullpain;
+ e.th_pain = sub_nullpain;
e.destroy = monster_knight_destroy;

// walkmonster_start
@@ -566,39 +612,42 @@ model ("progs/h_knight.mdl");
model ({"path":"progs/knight.mdl","frame":96});
}
*/
-void() monster_dead_knight =
-{
- // new spawnflags for all entities -- iw
- if (SUB_Inhibit())
- return;
-
- precache_model ("progs/knight.mdl");
- setmodel (self, "progs/knight.mdl");
- if (self.spawnflags & 2)
+//----------------------------------------------------------------------
+// class monster_dead_knight: base_corpse
+// {
+ //--------------------------------------------------------------
+ void(entity e) monster_dead_knight_init =
{
- self.frame = $death10;
+ base_corpse_init (e);
+
+ precache_model ("progs/knight.mdl");
+ setmodel (e, "progs/knight.mdl");

- if (self.spawnflags & 1)
+ if (e.spawnflags & 2)
{
- self.solid = SOLID_BBOX;
- setsize (self,'-25.56 -14.56 -50.49','26.45 40.2 30');
+ e.frame = $death10;
+
+ if (e.solid == SOLID_BBOX)
+ setsize (e, KNIGHT_CORPSE_MINS,
+ KNIGHT_CORPSE_MAXS);
}
else
{
- self.solid = SOLID_NOT;
+ e.frame = $deathb11;
+
+ if (e.solid == SOLID_BBOX)
+ setsize (e, KNIGHT_CORPSE_B_MINS,
+ KNIGHT_CORPSE_B_MAXS);
}
- }
- else
+ };
+
+ //--------------------------------------------------------------
+ void() monster_dead_knight =
{
- self.frame = $deathb11;
- if (self.spawnflags & 1)
- {
- self.solid = SOLID_BBOX;
- setsize (self,'-30.36 -45.6 -50.18','28.29 11.59 30');
- }
- else
- {
- self.solid = SOLID_NOT;
- }
- }
-};
+ // new spawnflags for all entities -- iw
+ if (SUB_Inhibit())
+ return;
+
+ monster_dead_knight_init (self);
+ };
+// };

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

Diff qc/monsters/ogre.qc

diff --git a/qc/monsters/ogre.qc b/qc/monsters/ogre.qc
index 994e313..5a9d9db 100644
--- a/qc/monsters/ogre.qc
+++ b/qc/monsters/ogre.qc
@@ -11,9 +11,16 @@ const float FL_NOSELECT = 8192; // ignored by entity selector
const float OGRE_DEFAULT_ELEVATION = 30;// angle to fire at if enemy too far

const float OGRE_HEALTH = 200; // id1 200
+const float OGRE_HEALTH_CORPSE = 80;

const vector OGRE_HEAD_MINS = '-12.35 -15.7 -0.17';
const vector OGRE_HEAD_MAXS = '10.67 13.88 30';
+const vector OGRE_CORPSE_MINS = '-40.64 -54.06 -54.1';
+const vector OGRE_CORPSE_MAXS = '29.42 54.63 30';
+const vector OGRE_CORPSE_B_MINS = '-45.64 -29.46 -54.52';
+const vector OGRE_CORPSE_B_MAXS = '33.87 39.18 30';
+const vector OGRE_CORPSE_Z_MINS = '-20 -20 -24';
+const vector OGRE_CORPSE_Z_MAXS = '20 20 -8';

//======================================================================
// forward declarations
@@ -76,7 +83,9 @@ void() ogre_bdie5; void() ogre_bdie6; void() ogre_bdie7; void() ogre_bdie8;
void() ogre_bdie9; void() ogre_bdie10;
void(entity attacker, float damage) monster_ogre_pain; // interaction
void(vector dir) monster_ogre_destroy;
-void(entity e) monster_ogre_init; // initialization
+entity(vector org, vector ang, float sflags, float yaw, float angry)
+ spawn_monster_ogre; // initialization
+void(entity e) monster_ogre_init;
void() monster_ogre;

// monster_ogre_marksman
@@ -97,6 +106,7 @@ void(entity e) gib_head_ogre_init;
void() gib_head_ogre;

// monster_dead_ogre
+void(entity e) monster_dead_ogre_init;
void() monster_dead_ogre;

//======================================================================
@@ -221,7 +231,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
void() monster_ogre_sightsound =
{
sound_sight (self, CHAN_VOICE, "ogre/ogwake.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
@@ -306,7 +316,8 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//--------------------------------------------------------------
void() monster_ogre_fire_spike =
{
- sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM);
+ sound (self, CHAN_WEAPON, "weapons/spike2.wav",
+ VOL_HIGH, ATTN_NORM);
self.effects = self.effects | EF_MUZZLEFLASH;

self.attack_finished = time + 0.7;
@@ -330,7 +341,8 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
makevectors (vectoangles(self.enemy.origin - self.origin));

self.effects = self.effects | EF_MUZZLEFLASH;
- sound_attack (self, CHAN_AUTO, "boss1/throw.wav", 1, ATTN_NORM);
+ sound_attack (self, CHAN_AUTO, "boss1/throw.wav",
+ VOL_HIGH, ATTN_NORM);

// damage should be 40, 40 -- TODO CEV
// custom lavaball speed -- CEV
@@ -363,7 +375,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
// used for initial attack sound dumptruck_ds
sound_misc2 (self, CHAN_WEAPON,
"shalrath/attack2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
break;
}
};
@@ -425,7 +437,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
if (random() < 0.2)
sound_idle (self, CHAN_VOICE, "ogre/ogidle.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);
ai_stand ();
};
void() ogre_stand6 = [$stand6, ogre_stand7] { ai_stand (); };
@@ -443,7 +455,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
ai_walk (2);
if (random() < 0.2)
sound_idle (self, CHAN_VOICE, "ogre/ogidle.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);
};
void() ogre_walk4 = [$walk4, ogre_walk5] { ai_walk (2); };
void() ogre_walk5 = [$walk5, ogre_walk6] { ai_walk (2); };
@@ -452,7 +464,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
ai_walk (5);
if (random() < 0.1)
sound_misc (self, CHAN_VOICE, "ogre/ogdrag.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);
};
void() ogre_walk7 = [$walk7, ogre_walk8] { ai_walk (3); };
void() ogre_walk8 = [$walk8, ogre_walk9] { ai_walk (2); };
@@ -473,7 +485,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
ai_run (9);
if (random() < 0.2)
sound_misc1 (self, CHAN_VOICE, "ogre/ogidle2.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);
};
void() ogre_run2 = [$run2, ogre_run3] { ai_run (12); };
void() ogre_run3 = [$run3, ogre_run4] { ai_run (8); };
@@ -490,7 +502,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
ai_charge (6);
sound_attack (self, CHAN_WEAPON, "ogre/ogsawatk.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};
void() ogre_smash2 = [$smash2, ogre_smash3] { ai_charge (0); };
void() ogre_smash3 = [$smash3, ogre_smash4] { ai_charge (0); };
@@ -541,7 +553,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
ai_charge (11);
sound_attack (self, CHAN_WEAPON, "ogre/ogsawatk.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};
void() ogre_swing2 = [$swing2, ogre_swing3] { ai_charge (1); };
void() ogre_swing3 = [$swing3, ogre_swing4] { ai_charge (4); };
@@ -633,7 +645,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
if (random() < 0.2)
sound_idle (self, CHAN_VOICE, "ogre/ogidle.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);
ai_run (0);
};
void() ogre_tur_seek6 = [$stand6, ogre_tur_seek7] { ai_run (0); };
@@ -713,11 +725,15 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//--------------------------------------------------------------
// Ogre Death state A
//--------------------------------------------------------------
- void() ogre_die1 = [$death1, ogre_die2] { };
+ void() ogre_die1 = [$death1, ogre_die2]
+ {
+ base_entity_aligntoground (self);
+ };
void() ogre_die2 = [$death2, ogre_die3] { };
void() ogre_die3 = [$death3, ogre_die4]
{
self.solid = SOLID_NOT;
+
// style ammotype check -- dumptruck_ds
if (self.style == 1)
{
@@ -751,17 +767,25 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
void() ogre_die10 = [$death10, ogre_die11] { };
void() ogre_die11 = [$death11, ogre_die12] { };
void() ogre_die12 = [$death12, ogre_die13] { };
- void() ogre_die13 = [$death13, ogre_die14] { };
+ void() ogre_die13 = [$death13, ogre_die14]
+ {
+ become_base_corpse (self, OGRE_HEALTH_CORPSE);
+ setsize (self, OGRE_CORPSE_Z_MINS, OGRE_CORPSE_Z_MAXS);
+ };
void() ogre_die14 = [$death14, ogre_die14] { };

//--------------------------------------------------------------
// Ogre Death state B
//--------------------------------------------------------------
- void() ogre_bdie1 = [$bdeath1, ogre_bdie2] { };
+ void() ogre_bdie1 = [$bdeath1, ogre_bdie2]
+ {
+ base_entity_aligntoground (self);
+ };
void() ogre_bdie2 = [$bdeath2, ogre_bdie3] { ai_forward (5); };
void() ogre_bdie3 = [$bdeath3, ogre_bdie4]
{
self.solid = SOLID_NOT;
+
// style ammotype check -- dumptruck_ds
if (self.style == 1)
{
@@ -793,7 +817,11 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
void() ogre_bdie6 = [$bdeath6, ogre_bdie7] { ai_forward (7); };
void() ogre_bdie7 = [$bdeath7, ogre_bdie8] { ai_forward (25); };
void() ogre_bdie8 = [$bdeath8, ogre_bdie9] { };
- void() ogre_bdie9 = [$bdeath9, ogre_bdie10] { };
+ void() ogre_bdie9 = [$bdeath9, ogre_bdie10]
+ {
+ become_base_corpse (self, OGRE_HEALTH_CORPSE);
+ setsize (self, OGRE_CORPSE_Z_MINS, OGRE_CORPSE_Z_MAXS);
+ };
void() ogre_bdie10 = [$bdeath10, ogre_bdie10] { };

//==============================================================
@@ -814,7 +842,8 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
if (self.spawnflags & I_AM_TURRET)
return;

- sound_pain (self, CHAN_VOICE, "ogre/ogpain1.wav", 1, ATTN_NORM);
+ sound_pain (self, CHAN_VOICE, "ogre/ogpain1.wav",
+ VOL_HIGH, ATTN_NORM);

r = random();

@@ -850,11 +879,38 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//--------------------------------------------------------------
void(vector dir) monster_ogre_destroy =
{
+ // check if we're dead already
+ if (self.classgroup & CG_CORPSE)
+ {
+ sound (self, CHAN_VOICE, "player/udeath.wav",
+ VOL_HIGH, ATTN_NORM);
+
+ throw_gib_head_ogre (self, dir, self.health);
+
+ // custom models -- dumptruck_ds
+ if (self.mdl_gib1 != "")
+ throw_gib_1 (self, dir, self.health);
+ else
+ throw_gib_3 (self, dir, self.health);
+
+ if (self.mdl_gib2 != "")
+ throw_gib_2 (self, dir, self.health);
+ else
+ throw_gib_3 (self, dir, self.health);
+
+ if (self.mdl_gib3 != "")
+ throw_gib_3 (self, dir, self.health);
+ else
+ throw_gib_3 (self, dir, self.health);
+
+ return;
+ }
+
// check for gib
if (self.health < -80)
{
sound (self, CHAN_VOICE, "player/udeath.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

throw_gib_head_ogre (self, dir, self.health);

@@ -878,7 +934,8 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
return;
}

- sound_death (self, CHAN_VOICE, "ogre/ogdth.wav", 1, ATTN_NORM);
+ sound_death (self, CHAN_VOICE, "ogre/ogdth.wav",
+ VOL_HIGH, ATTN_NORM);

base_item_drop_stuff (self);
if (random() < 0.5)
@@ -892,6 +949,14 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//==============================================================

//--------------------------------------------------------------
+ entity(vector org, vector ang, float sflags, float yaw, float angry)
+ spawn_monster_ogre =
+ {
+ return spawn_base_monster (org, ang, sflags, yaw, angry,
+ monster_ogre_init);
+ };
+
+ //--------------------------------------------------------------
void(entity e) monster_ogre_init =
{
if (deathmatch)
@@ -948,24 +1013,24 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by

e.checkattack = monster_ogre_checkattack;
e.sightsound = monster_ogre_sightsound;
- e.think_stand = ogre_stand1;
- e.think_walk = ogre_walk1;
+ e.th_stand = ogre_stand1;
+ e.th_walk = ogre_walk1;
if (e.spawnflags & I_AM_TURRET)
- e.think_run = ogre_tur_seek1;
+ e.th_run = ogre_tur_seek1;
else
- e.think_run = ogre_run1;
+ e.th_run = ogre_run1;
e.destroy = monster_ogre_destroy;
- e.think_melee = monster_ogre_attack_melee;
- e.think_missile = ogre_nail1;
+ e.th_melee = monster_ogre_attack_melee;
+ e.th_missile = ogre_nail1;
// dumptruck_ds
- e.think_turret = ogre_tur_atk1;
+ e.th_turret = ogre_tur_atk1;
// Berserk test from
// http://celephais.net/board/view_thread.php?id=4&start=3465
// -- dumptruck_ds
if !(e.berserk)
- e.pain = monster_ogre_pain;
+ e.th_pain = monster_ogre_pain;
else
- e.pain = sub_nullpain;
+ e.th_pain = sub_nullpain;

// walkmonster_start
base_walkmonster_init (e);
@@ -1127,7 +1192,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
if (random() < 0.2)
sound_idle (self, CHAN_VOICE, "ogre/ogidle.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);
ai_run (0);
};
void() ogre_mm_t_seek6 = [$stand6, ogre_mm_t_seek7] { ai_run (0); };
@@ -1187,24 +1252,24 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by

e.checkattack = monster_ogre_checkattack;
e.sightsound = monster_ogre_sightsound;
- e.think_stand = ogre_stand1;
- e.think_walk = ogre_walk1;
+ e.th_stand = ogre_stand1;
+ e.th_walk = ogre_walk1;
if (e.spawnflags & I_AM_TURRET)
- e.think_run = ogre_mm_t_seek1;
+ e.th_run = ogre_mm_t_seek1;
else
- e.think_run = ogre_run1;
+ e.th_run = ogre_run1;
e.destroy = monster_ogre_destroy;
- e.think_melee = monster_ogre_attack_melee;
- e.think_missile = ogre_mm_nail1;
+ e.th_melee = monster_ogre_attack_melee;
+ e.th_missile = ogre_mm_nail1;
// dumptruck_ds
- e.think_turret = ogre_mm_t_atk1;
+ e.th_turret = ogre_mm_t_atk1;
// Berserk test from
// http://celephais.net/board/view_thread.php?id=4&start=3465
// -- dumptruck_ds
if !(e.berserk)
- e.pain = monster_ogre_pain;
+ e.th_pain = monster_ogre_pain;
else
- e.pain = sub_nullpain;
+ e.th_pain = sub_nullpain;

// could be a call to monster_ogre_init but let's go
// straight to walkmonster instead -- CEV
@@ -1284,39 +1349,42 @@ model ("progs/h_ogre.mdl");
model ({"path":"progs/ogre.mdl","frame":135});
}
*/
-void() monster_dead_ogre =
-{
- // new spawnflags for all entities -- iw
- if (SUB_Inhibit())
- return;
-
- precache_model ("progs/ogre.mdl");
- setmodel (self, "progs/ogre.mdl");
- if (self.spawnflags & 2)
+//----------------------------------------------------------------------
+// class monster_dead_ogre: base_corpse
+// {
+ //--------------------------------------------------------------
+ void(entity e) monster_dead_ogre_init =
{
- self.frame = $death14;
+ base_corpse_init (e);

- if (self.spawnflags & 1)
+ precache_model ("progs/ogre.mdl");
+ setmodel (e, "progs/ogre.mdl");
+
+ if (e.spawnflags & 2)
{
- self.solid = SOLID_BBOX;
- setsize (self,'-40.64 -54.06 -54.1','29.42 54.63 30');
+ e.frame = $death14;
+
+ if (e.solid == SOLID_BBOX)
+ setsize (e, OGRE_CORPSE_MINS,
+ OGRE_CORPSE_MAXS);
}
else
{
- self.solid = SOLID_NOT;
+ e.frame = $bdeath10;
+
+ if (e.solid == SOLID_BBOX)
+ setsize (e, OGRE_CORPSE_B_MINS,
+ OGRE_CORPSE_B_MAXS);
}
- }
- else
+ };
+
+ //--------------------------------------------------------------
+ void() monster_dead_ogre =
{
- self.frame = $bdeath10;
- if (self.spawnflags & 1)
- {
- self.solid = SOLID_BBOX;
- setsize (self,'-45.64 -29.46 -54.52','33.87 39.18 30');
- }
- else
- {
- self.solid = SOLID_NOT;
- }
- }
-};
+ // new spawnflags for all entities -- iw
+ if (SUB_Inhibit())
+ return;
+
+ monster_dead_ogre_init (self);
+ };
+// };

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

Diff qc/monsters/oldone.qc

diff --git a/qc/monsters/oldone.qc b/qc/monsters/oldone.qc
index 4e596fa..49c095e 100644
--- a/qc/monsters/oldone.qc
+++ b/qc/monsters/oldone.qc
@@ -77,6 +77,7 @@ $frame shake15 shake16 shake17 shake18 shake19 shake20
// never allow exit
intermission_exittime = time + 10000000;
intermission = 1;
+ WriteIntermission ();

// find the intermission spot
pos = findfloat (world, classtype, CT_INFO_INTERMISSION);
@@ -134,7 +135,7 @@ $frame shake15 shake16 shake17 shake18 shake19 shake20
WriteCoord (MSG_BROADCAST, o_z);

sound (self.enemy, CHAN_VOICE, "misc/r_tele1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

self.nextthink = time + 2;
self.think = monster_oldone_finale3;
@@ -146,7 +147,7 @@ $frame shake15 shake16 shake17 shake18 shake19 shake20
// start shub thrashing wildly
self.enemy.think = old_thrash1;
sound_death (self.enemy, CHAN_VOICE, "boss2/death.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
lightstyle (0, "abcdefghijklmlkjihgfedcb");
};

@@ -160,7 +161,8 @@ $frame shake15 shake16 shake17 shake18 shake19 shake20
local float r;
local entity n;

- sound_misc (self, CHAN_VOICE, "boss2/pop2.wav", 1, ATTN_NORM);
+ sound_misc (self, CHAN_VOICE, "boss2/pop2.wav",
+ VOL_HIGH, ATTN_NORM);

oldo = self.origin;

@@ -346,7 +348,8 @@ $frame shake15 shake16 shake17 shake18 shake19 shake20
local float r;
local float gibpow;

- sound (self, CHAN_VOICE, "boss2/pop2.wav", 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, "boss2/pop2.wav",
+ VOL_HIGH, ATTN_NORM);

oldo = self.origin;
gibpow = -160;
@@ -424,7 +427,7 @@ $frame shake15 shake16 shake17 shake18 shake19 shake20
// kill by telefrag
e.health = 40000;
e.takedamage = DAMAGE_YES;
- e.pain = monster_oldone_pain;
+ e.th_pain = monster_oldone_pain;
if (e.spawnflags & 2)
e.destroy = monster_oldone_destroy;
else

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

Diff qc/monsters/oldone2.qc

diff --git a/qc/monsters/oldone2.qc b/qc/monsters/oldone2.qc
index 5d1cba6..4a052ca 100644
--- a/qc/monsters/oldone2.qc
+++ b/qc/monsters/oldone2.qc
@@ -85,7 +85,8 @@ $frame shake15 shake16 shake17 shake18 shake19 shake20
//--------------------------------------------------------------
void() monster_oldone2_sightsound =
{
- sound_sight (self, CHAN_VOICE, "boss2/sight.wav", 1, ATTN_NORM);
+ sound_sight (self, CHAN_VOICE, "boss2/sight.wav",
+ VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
@@ -119,7 +120,7 @@ $frame shake15 shake16 shake17 shake18 shake19 shake20
base_monster_fire_lavaball (org, d - org, LAVABALL_SPEED);

sound_attack (self, CHAN_WEAPON, "boss1/throw.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

// check for dead enemy
if (self.enemy.health <= 0)
@@ -269,7 +270,8 @@ $frame shake15 shake16 shake17 shake18 shake19 shake20
//--------------------------------------------------------------
void() old2_twitch1 = [$shake1, old2_twitch2]
{
- sound_misc (self, CHAN_VOICE, "boss2/pop2.wav", 1, ATTN_NONE);
+ sound_misc (self, CHAN_VOICE, "boss2/pop2.wav",
+ VOL_HIGH, ATTN_NONE);
};
void() old2_twitch2 = [$shake2, old2_twitch3] { };
void() old2_twitch3 = [$shake3, old2_twitch4] { };
@@ -313,7 +315,7 @@ $frame shake15 shake16 shake17 shake18 shake19 shake20

// new pain sound
sound_pain (self, CHAN_AUTO, "oldone2/pd_pop2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
old2_atk1 ();
self.pain_finished = time + 4;
};
@@ -377,7 +379,7 @@ $frame shake15 shake16 shake17 shake18 shake19 shake20
particle (oldo, '0 0 0', 0, 255);
particle (oldo, '128 128 128', 0, 255);
sound_death (self, CHAN_VOICE, "player/teledth1.wav",
- 1, ATTN_NONE);
+ VOL_HIGH, ATTN_NONE);
remove (self);
};

@@ -434,8 +436,8 @@ $frame shake15 shake16 shake17 shake18 shake19 shake20
e.flags = FL_MONSTER;
e.takedamage = DAMAGE_AIM;
e.sightsound = monster_oldone2_sightsound;
- e.think_run = old2_atk1;
- e.pain = monster_oldone2_pain;
+ e.th_run = old2_atk1;
+ e.th_pain = monster_oldone2_pain;
e.destroy = monster_oldone2_destroy_twitch1;
e.think = old2_idle1;
e.nextthink = time + 0.1;

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

Diff qc/monsters/playerclient.qc

diff --git a/qc/monsters/playerclient.qc b/qc/monsters/playerclient.qc
index b2d7d3c..6e11a4e 100644
--- a/qc/monsters/playerclient.qc
+++ b/qc/monsters/playerclient.qc
@@ -6,28 +6,59 @@
// constants
//======================================================================

+#ifdef SSQC
const float PLAYER_HEALTH = 100; // id1 100
+const float PLAYER_HEALTH_CORPSE = 30;

const vector PLAYER_HEAD_MINS = '-9.67 -12.38 -2.1';
const vector PLAYER_HEAD_MAXS = '11.49 50.7 30';
+const vector PLAYER_CORPSE_C_MINS = '-50.28 -23.55 -49.85';
+const vector PLAYER_CORPSE_C_MAXS = '30.66 14.49 30';
+const vector PLAYER_CORPSE_E_MINS = '-38.72 -5.83 -50.45';
+const vector PLAYER_CORPSE_E_MAXS = '28.73 33.85 30';
+const vector PLAYER_CORPSE_AX_MINS = '-38.72 -5.83 -50.45';
+const vector PLAYER_CORPSE_AX_MAXS = '28.73 33.85 30';
+#endif
+
+#if defined(CSQC) || defined(SSQC)
+enumflags
+{
+ PLAYER_NET_FRAME, // frame has changed
+ PLAYER_NET_MODEL, // model has changed
+ PLAYER_NET_ORIGIN, // origin has changed
+ PLAYER_NET_SIZE, // size has changed (mins, maxs)
+ PLAYER_NET_ANGLES, // player angles have changed
+ PLAYER_NET_VELOCITY, // velocity has changed
+ PLAYER_NET_FLAGS, // .flags & .pmove_flags
+ PLAYER_NET_TIMERS, // .crouchslide_timer, .doublejump_timer
+ PLAYER_NET_EFFECTS, // .sveffects has changed
+ PLAYER_NET_SOLID, // .solid and/or .movetype have changed
+ PLAYER_NET_ITEMS, // .items (& others) have changed
+ PLAYER_NET_PUNCHANGLE // .punchangle has changed
+};
+#endif

//======================================================================
// globals
//======================================================================

+#ifdef SSQC
float modelindex_eyes;
float modelindex_player;
+#endif

//======================================================================
// fields
//======================================================================

+#ifdef SSQC
.float axhitme;
.float fly_sound;
.float jump_flag; // player jump flag
.float reset_items; // dumptruck_ds
-.float swim_flag; // player swimming sound flag
+#endif

+#ifdef SSQC
.float air_finished; // when time > air_finished, drown
.float attack_finished;
.float pain_finished;
@@ -35,14 +66,18 @@ float modelindex_player;
.float invisible_finished;
.float super_damage_finished;
.float radsuit_finished;
+#endif

+#ifdef SSQC
.float damage_time;
.float invincible_time, invincible_sound;
.float invisible_time, invisible_sound;
.float super_time, super_sound;
.float rad_time;
.float megahealth_rottime; // dumptruck_ds
+#endif

+#ifdef SSQC
.float step_time; // CEV

// set to time+0.2 whenever a client fires a weapon or takes damage.
@@ -50,6 +85,7 @@ float modelindex_player;
.float show_hostile;

.string deathtype; // keeps track of how the player died
+#endif

#ifdef SSQC
// DP_INPUTBUTTONS (in qw we set 1 to equal 3 to match zquake/fuhquake/mvdsv)
@@ -61,11 +97,30 @@ float modelindex_player;
.float button8;
#endif

+#ifdef CSQC
+.float commandframe;
+.float punch1;
+.float punch2;
+.float punch_time;
+#endif
+
//======================================================================
// forward declarations
//======================================================================

// player
+#ifdef CSQC
+void(float isnew) player_netreceive;
+float() player_predraw;
+static void() player_remove;
+void(entity e) player_prediction_save;
+void(entity e) player_prediction_reset;
+void(entity e) player_prediction_preframe;
+void(entity e) player_prediction_postframe;
+void(entity e, float endframe) player_prediction;
+#endif
+#ifdef SSQC
+float(entity to, float netflags) player_netsend;
void() player_impulse_cheat; // impulse commands
void() player_impulse_quadcheat;
void() player_impulse_serverflags;
@@ -90,7 +145,7 @@ void() player_set_suicide_frame; // pain, damage, death
void() player_pain_sound;
void() player_death_sound;
void() player_dead;
-void() player_footsteps; // thinking & animation frames
+void() player_footstep; // thinking & animation frames
void() player_stand;
void() player_axstand;
void(void() axthink) player_run;
@@ -139,30 +194,46 @@ void() player_prethink_jump;
void() player_prethink;
void() player_postthink_powerups;
void() player_postthink;
-float(entity to, float fl) player_sendentity; // object interaction
void(entity attacker, float damage) player_pain;
void(vector dir) player_destroy_gib;
void(vector dir) player_destroy;
+#endif
+#if defined(CSQC) || defined(SSQC)
void() player_touch;
+#endif
+#ifdef SSQC
entity() player_init_selectspawnpoint; // initialization
void() player_init_level_parms;
void() player_respawn;
+#endif
+#if defined(CSQC) || defined(SSQC)
void(entity e) player_init;
+#endif
+#ifdef SSQC
strip void() player;
+#endif

+#ifdef SSQC
// gib_head_player
void(entity act, vector dir, float dmg) throw_gib_head_player;
void(entity e) gib_head_player_init;
void() gib_head_player;
+#endif

+#ifdef SSQC
// player_dead_axe
void() player_dead_axe;
+#endif

+#ifdef SSQC
// player_dead_face_down
void() player_dead_face_down;
+#endif

+#ifdef SSQC
// player_dead_on_side
void() player_dead_on_side;
+#endif

//======================================================================
// frame macros
@@ -221,6 +292,460 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
// class player: entity
// {
//==============================================================
+ // Player/Client networking
+ //==============================================================
+
+#ifdef CSQC
+ //--------------------------------------------------------------
+ // called from CSQC_Ent_Update for CT_PLAYER entities
+ //--------------------------------------------------------------
+ void(float isnew) player_netreceive =
+ {
+ local float newframe = 0;
+ local float newmoveflags = 0;
+ local float netflags = ReadFloat ();
+
+ if (netflags & PLAYER_NET_FRAME)
+ newframe = ReadByte ();
+
+ if (netflags & PLAYER_NET_MODEL)
+ self.modelindex = ReadFloat ();
+
+ if (netflags & PLAYER_NET_ORIGIN)
+ {
+ self.origin_x = ReadCoord ();
+ self.origin_y = ReadCoord ();
+ self.origin_z = ReadCoord ();
+ }
+
+ // we can safely infer PLAYER_NET_SIZE from .pmove_flags;
+ // if it's necessary to transmit size (mins & maxs) in
+ // the future we'd do so here -- CEV
+
+ if (netflags & PLAYER_NET_ANGLES)
+ {
+ self.angles_x = ReadShort () * (360 / 32767);
+ self.angles_y = ReadShort () * (360 / 32767);
+ self.angles_z = ReadShort () * (360 / 32767);
+ }
+
+ if (netflags & PLAYER_NET_VELOCITY)
+ {
+ self.velocity_x = ReadCoord ();
+ self.velocity_y = ReadCoord ();
+ self.velocity_z = ReadCoord ();
+ }
+
+ if (netflags & PLAYER_NET_FLAGS)
+ {
+ self.flags = ReadFloat ();
+ newmoveflags = ReadFloat ();
+ }
+
+ if (netflags & PLAYER_NET_TIMERS)
+ {
+ self.crouchslide_timer = ReadFloat ();
+ self.doublejump_timer = ReadFloat ();
+ }
+
+ if (netflags & PLAYER_NET_EFFECTS)
+ self.sveffects = ReadByte ();
+
+ if (netflags & PLAYER_NET_SOLID)
+ {
+ self.solid = ReadByte ();
+ self.movetype = ReadByte ();
+ }
+
+ if (netflags & PLAYER_NET_ITEMS)
+ self.items = ReadFloat ();
+
+ if (netflags & PLAYER_NET_PUNCHANGLE)
+ {
+ self.punchangle_x = ReadShort ();
+
+ // punchangle code from Ironwail -- CEV
+ if (self.punch1 != self.punchangle_x)
+ {
+ self.punch2 = self.punch1;
+ self.punch1 = self.punchangle_x;
+ self.punch_time = time;
+ }
+ }
+
+ if (isnew && !(self.predraw))
+ {
+ self.pmove_flags = newmoveflags;
+ player_init (self);
+ }
+ else if (self.pmove_flags != newmoveflags)
+ {
+ if (newmoveflags & PMF_CROUCHED &&
+ (!(self.pmove_flags & PMF_CROUCHED)))
+ {
+ PM_CrouchStart ();
+ }
+ else if ((!(newmoveflags & PMF_CROUCHED)) &&
+ self.pmove_flags & PMF_CROUCHED)
+ {
+ PM_CrouchStop ();
+ }
+ self.pmove_flags = newmoveflags;
+ }
+ else
+ {
+ self.pmove_flags = newmoveflags;
+ }
+
+ if (self.entnum == player_localentnum)
+ {
+ view_pl = self;
+
+ if (isnew)
+ {
+ // we've just spawned in
+ self.commandframe = servercommandframe;
+ player_prediction_save (self);
+ }
+ else
+ {
+ // reconcile any movement desynch by processing
+ // movement from servercommandframe up to the
+ // most recently completed client frame
+ self.commandframe = servercommandframe;
+ player_prediction (self, clientcommandframe-1);
+
+ // now set our commandframe and save results
+ // for later extrapolation/prediction -- CEV
+ self.commandframe = clientcommandframe - 1;
+ player_prediction_save (self);
+ }
+ }
+
+ // TODO CEV movement interpolation for other players
+
+ if (newframe != self.frame || isnew)
+ {
+ self.frame2 = self.frame;
+ self.lerptime = time;
+ self.frame = newframe;
+ }
+
+ self.oldframe = self.frame;
+ };
+
+ //--------------------------------------------------------------
+ // Based on pieces of Pred_UpdateLocalMovement from CSQCTest
+ //--------------------------------------------------------------
+ float() player_predraw =
+ {
+ // player visual effects; this might need to be some place
+ // other than predraw for multiplayer support -- CEV
+ if (self.sveffects & EF_MUZZLEFLASH)
+ {
+ self.sveffects &= ~EF_MUZZLEFLASH;
+ makevectors ([0, self.angles_y, 0]);
+ pointparticles (particleeffectnum("te_muzzleflash"),
+ self.origin, v_forward, 1);
+ }
+
+ if (self.sveffects & EF_DIMLIGHT)
+ {
+ local vector col;
+ makevectors (self.v_angle);
+
+ // rely on sitems here instead of transmitting .items
+ // through SendEntity; might reduce net traffic? -- CEV
+ // sitems set in cl_hud already -- CEV
+ // sitems = getstatf (STAT_ITEMS, 0, 23);
+
+ // quad + pent, pent, quad, normal -- CEV
+ if (sitems & IT_INVULNERABILITY)
+ if (sitems & IT_QUAD)
+ col = '0.5 0.3 0.4';
+ else
+ col = '0.4 0 0';
+ else if (sitems & IT_QUAD)
+ col = '0.05 0.05 0.94';
+ else
+ col = '0.5 0.5 0.2';
+
+ // cubemap orientation is read from v_forward etc.
+ dynamiclight_add (self.origin, 200, col, 0, "",
+ PFLAGS_NOSHADOW);
+ }
+
+ if (self.lerptime)
+ self.lerpfrac = 1 - (time - self.lerptime) * 10;
+
+ if (self.entnum != player_localentnum)
+ self.renderflags = 0;
+ else
+ self.renderflags |= RF_EXTERNALMODEL;
+
+ addentity (self);
+ return PREDRAW_NEXT;
+ };
+
+ //--------------------------------------------------------------
+ static void() player_remove =
+ {
+ if (view_pl == self)
+ view_pl = world;
+
+ setmodel (self, "");
+ self.oldskin = "";
+ self.predraw = __NULL__;
+ };
+
+ //--------------------------------------------------------------
+ void(entity e) player_prediction_save =
+ {
+ e.origin_net = e.origin;
+ e.velocity_net = e.velocity;
+ e.angles_net = e.angles;
+ e.flags_net = e.flags;
+ e.pmove_flags_net = e.pmove_flags;
+ e.crouchslide_timer_net = e.crouchslide_timer;
+ e.doublejump_timer_net = e.doublejump_timer;
+ };
+
+ //--------------------------------------------------------------
+ // was Pred_ResetPlayerPrediction in CSQCTest cs/prediction.qc
+ //--------------------------------------------------------------
+ void(entity e) player_prediction_reset =
+ {
+ e.origin = e.origin_net;
+ e.velocity = e.velocity_net;
+ e.angles = e.angles_net;
+ e.flags = e.flags_net;
+ e.pmove_flags = e.pmove_flags_net;
+ e.crouchslide_timer = e.crouchslide_timer_net;
+ e.doublejump_timer = e.doublejump_timer_net;
+
+ if (e.commandframe < clientcommandframe - 128)
+ // avoid an infinite loop
+ e.commandframe = clientcommandframe - 128;
+ };
+
+ //--------------------------------------------------------------
+ void(entity e) player_prediction_preframe =
+ {
+ if (serverkeyfloat(SERVERKEY_PAUSESTATE))
+ return;
+
+ if (intermission == TRUE)
+ {
+ view_origin = e.origin;
+ return;
+ }
+
+ // player_prediction_save (e);
+ player_prediction (e, clientcommandframe);
+
+ // step smoothing (and vertical motion on MOVETYPE_PUSH)
+ local float zspeed = 0;
+
+ if (e.groundentity.velocity_z > 0)
+ {
+ zspeed = e.groundentity.velocity_z;
+ if (view_step_adjust < 16)
+ view_step = 0;
+ view_step_adjust = bound (8, zspeed * 0.11, 64);
+ }
+ /*
+ else if (e.pmove_flags & PMF_CROUCHED &&
+ e.origin_z - view_step_oldz < 0)
+ {
+ zspeed = 1;
+ view_step_adjust = 6;
+ }
+ */
+ else if (e.origin_z - view_step_oldz >= 4 &&
+ e.origin_z - view_step_oldz <= PM_STEPHEIGHT &&
+ e.pmove_flags & PMF_ONGROUND)
+ {
+ if (e.speed)
+ zspeed = e.speed;
+ else
+ zspeed = PM_MAXSPEED;
+ view_step_adjust = bound (4, zspeed * 0.018, 16);
+ }
+
+ if (zspeed)
+ {
+ // evaluate out the remaining old step
+ if (view_step_time - time > 0)
+ view_step = (view_step_time - time) *
+ view_step_adjust * view_step;
+ else
+ view_step = 0;
+
+ view_step += (e.origin_z - view_step_oldz);
+
+ view_step_time = time + (1 / view_step_adjust);
+
+ /*
+ dprint (sprintf("player_prediction_preframe: "
+ "groundent %s, zspeed %g, step_adjust %g\n",
+ self.groundentity.classname, zspeed,
+ view_step_adjust));
+ */
+ }
+
+ view_step_oldz = e.origin_z;
+ view_origin = e.origin;
+
+ // now do the adjustment -- CEV
+ if (view_step_time - time > 0)
+ view_origin_z -= (view_step_time - time) *
+ view_step_adjust * view_step;
+
+ view_origin_z += e.view_ofs_z;
+ };
+
+ //--------------------------------------------------------------
+ void(entity e) player_prediction_postframe =
+ {
+ player_prediction_reset (e);
+ setsize (e, e.mins, e.maxs);
+ setorigin (e, e.origin);
+ };
+
+ //--------------------------------------------------------------
+ // was Pred_RunMovement in CSQCTest cs/prediction.qc
+ //--------------------------------------------------------------
+ void(entity e, float endframe) player_prediction =
+ {
+ if (servercommandframe >= e.commandframe + 63)
+ {
+ // we're meant to be updating the player faster than
+ // this. hopefully its just that we're throttled...
+
+ // you can comment out this block and the player will
+ // continue to be predicted locally. But its best to
+ // freeze them
+ // dprint ("player_prediction: slow update\n");
+ e.commandframe = servercommandframe - 63;
+ return;
+ }
+
+ if (getstatf(STAT_HEALTH) <= 0)
+ {
+ // dead, so don't run prediction. :D
+ e.commandframe = clientcommandframe;
+ if (getinputstate(e.commandframe - 1) == FALSE)
+ {
+ dprint ("player_prediction: no-op?\n");
+ // TODO CEV no-op ?
+ }
+ return;
+ }
+
+ for (float i = e.commandframe + 1; i <= endframe; i++)
+ {
+ local float f = getinputstate (i);
+
+ if (f == FALSE)
+ // no input from client
+ continue;
+
+ if (input_timelength == 0)
+ break;
+
+ if (world_standardphysics)
+ // for testing
+ runstandardplayerphysics (e);
+ else
+ // for real
+ PM_Move (e);
+ }
+
+ // add anything that was applied after (for low packet
+ // rate protocols)
+ input_angles = view_angles;
+ };
+#endif
+
+#ifdef SSQC
+ //--------------------------------------------------------------
+ // SendEntity -- transmit updates from server to client -- CEV
+ //--------------------------------------------------------------
+ float(entity to, float netflags) player_netsend =
+ {
+ WriteFloat (MSG_ENTITY, self.classtype);
+ WriteFloat (MSG_ENTITY, netflags);
+
+ if (netflags & PLAYER_NET_FRAME)
+ WriteByte (MSG_ENTITY, self.frame);
+
+ if (netflags & PLAYER_NET_MODEL)
+ WriteFloat (MSG_ENTITY, self.modelindex);
+
+ if (netflags & PLAYER_NET_ORIGIN)
+ {
+ WriteCoord (MSG_ENTITY, self.origin_x);
+ WriteCoord (MSG_ENTITY, self.origin_y);
+ WriteCoord (MSG_ENTITY, self.origin_z);
+ }
+
+ // we can safely infer PLAYER_NET_SIZE from .pmove_flags;
+ // if it's necessary to transmit size (mins & maxs) in
+ // the future we'd do so here -- CEV
+ // if (netflags & PLAYER_NET_SIZE)
+
+ if (netflags & PLAYER_NET_ANGLES)
+ {
+ WriteShort (MSG_ENTITY, self.angles_x * (32767 / 360));
+ WriteShort (MSG_ENTITY, self.angles_y * (32767 / 360));
+ WriteShort (MSG_ENTITY, self.angles_z * (32767 / 360));
+ }
+
+ if (netflags & PLAYER_NET_VELOCITY)
+ {
+ WriteCoord (MSG_ENTITY, self.velocity_x);
+ WriteCoord (MSG_ENTITY, self.velocity_y);
+ WriteCoord (MSG_ENTITY, self.velocity_z);
+ }
+
+ if (netflags & PLAYER_NET_FLAGS)
+ {
+ WriteFloat (MSG_ENTITY, self.flags);
+ WriteFloat (MSG_ENTITY, self.pmove_flags);
+ }
+
+ if (netflags & PLAYER_NET_TIMERS)
+ {
+ WriteFloat (MSG_ENTITY, self.crouchslide_timer);
+ WriteFloat (MSG_ENTITY, self.doublejump_timer);
+ }
+
+ if (netflags & PLAYER_NET_EFFECTS)
+ WriteByte (MSG_ENTITY, self.sveffects);
+
+ if (netflags & PLAYER_NET_SOLID)
+ {
+ WriteByte (MSG_ENTITY, self.solid);
+ WriteByte (MSG_ENTITY, self.movetype);
+ }
+
+ if (netflags & PLAYER_NET_ITEMS)
+ WriteFloat (MSG_ENTITY, self.items);
+
+ if (netflags & PLAYER_NET_PUNCHANGLE)
+ {
+ WriteShort (MSG_ENTITY, self.punchangle_x);
+ self.punchangle_x = 0;
+ }
+
+ // only muzzleflash once, should be cleared elsewhere -- CEV
+ if (self.sveffects & EF_MUZZLEFLASH)
+ self.sveffects &= ~EF_MUZZLEFLASH;
+
+ return TRUE;
+ };
+
+ //==============================================================
// Client Input Handling
//==============================================================

@@ -332,8 +857,9 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
haveammo = FALSE;
break;
default:
- dprint (sprintf("player::change_weapon: WARNING"
- " bad impulse: %f\n", self.impulse));
+ dprint (sprintf("player_impulse_changeweapon: "
+ "WARNING bad impulse: %f\n",
+ self.impulse));
return;
}

@@ -546,7 +1072,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
{
self.super_sound = time + 1;
sound (self, CHAN_AUTO, "items/damage3.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
}
};

@@ -633,7 +1159,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
//--------------------------------------------------------------
float() player_best_weapon =
{
- if (self.waterlevel <= WATERLEVEL_FEET &&
+ if (self.conlevel <= WATERLEVEL_FEET &&
self.ammo_cells >= 1 && (self.items & IT_LIGHTNING))
{
return IT_LIGHTNING;
@@ -677,10 +1203,16 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
{
local vector source;
local vector org;
+ local float player_solid;

makevectors (self.v_angle);
source = self.origin + '0 0 16';
+ // set player to SOLID_BBOX, trace, then revert that change,
+ // as per comments on SOLID_CORPSE in fteextensions.qc -- CEV
+ player_solid = self.solid;
+ self.solid = SOLID_BBOX;
traceline (source, source + v_forward * 64, FALSE, self);
+ self.solid = player_solid;
if (trace_fraction == 1.0)
return;
org = trace_endpos - v_forward * 4;
@@ -695,7 +1227,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
{
// hit wall
sound (self, CHAN_WEAPON, "player/axhit2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_GUNSHOT);
WriteCoord (MSG_BROADCAST, org_x);
@@ -712,9 +1244,11 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
local vector org, dir, vdir;
local float vspeed;

- sound (self, CHAN_WEAPON, "weapons/guncock.wav", 1, ATTN_NORM);
+ sound (self, CHAN_WEAPON, "weapons/guncock.wav",
+ VOL_HIGH, ATTN_NORM);

self.punchangle_x = -2;
+ // self.SendFlags |= PLAYER_NET_PUNCHANGLE;

self.currentammo = self.ammo_shells = self.ammo_shells - 1;
// dir = aim (self, 100000);
@@ -755,9 +1289,11 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
return;
}

- sound (self, CHAN_WEAPON, "weapons/shotgn2.wav", 1, ATTN_NORM);
+ sound (self, CHAN_WEAPON, "weapons/shotgn2.wav",
+ VOL_HIGH, ATTN_NORM);

self.punchangle_x = -4;
+ // self.SendFlags |= PLAYER_NET_PUNCHANGLE;

self.currentammo = self.ammo_shells = self.ammo_shells - 2;
// dir = aim (self, 100000);
@@ -801,7 +1337,8 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
return;
}

- sound (self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM);
+ sound (self, CHAN_WEAPON, "weapons/rocket1i.wav",
+ VOL_HIGH, ATTN_NORM);
self.attack_finished = time + 0.2;
self.currentammo = self.ammo_nails = self.ammo_nails - 1;

@@ -818,6 +1355,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
dir, SPIKE_NORMAL_DAMAGE);

self.punchangle_x = -2;
+ // self.SendFlags |= PLAYER_NET_PUNCHANGLE;
};

//--------------------------------------------------------------
@@ -827,7 +1365,8 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
{
local vector dir;

- sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM);
+ sound (self, CHAN_WEAPON, "weapons/spike2.wav",
+ VOL_HIGH, ATTN_NORM);
self.attack_finished = time + 0.2;
self.currentammo = self.ammo_nails = self.ammo_nails - 2;

@@ -842,6 +1381,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
dir, SPIKE_SUPER_DAMAGE);

self.punchangle_x = -2;
+ // self.SendFlags |= PLAYER_NET_PUNCHANGLE;
};

//--------------------------------------------------------------
@@ -853,9 +1393,11 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6

self.currentammo = self.ammo_rockets = self.ammo_rockets - 1;

- sound (self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM);
+ sound (self, CHAN_WEAPON, "weapons/grenade.wav",
+ VOL_HIGH, ATTN_NORM);

self.punchangle_x = -2;
+ // self.SendFlags |= PLAYER_NET_PUNCHANGLE;

// set missile speed
makevectors (self.v_angle);
@@ -885,9 +1427,11 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6

self.currentammo = self.ammo_rockets = self.ammo_rockets - 1;

- sound (self, CHAN_WEAPON, "weapons/sgun1.wav", 1, ATTN_NORM);
+ sound (self, CHAN_WEAPON, "weapons/sgun1.wav",
+ VOL_HIGH, ATTN_NORM);

self.punchangle_x = -2;
+ // self.SendFlags |= PLAYER_NET_PUNCHANGLE;

// set missile speed
makevectors (self.v_angle);
@@ -912,7 +1456,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
}

// explode if under water
- if (self.waterlevel > WATERLEVEL_FEET)
+ if (self.conlevel > WATERLEVEL_FEET)
{
local float cells = self.ammo_cells;
self.ammo_cells = 0;
@@ -924,10 +1468,11 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
if (self.t_width < time)
{
sound (self, CHAN_WEAPON, "weapons/lhit.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
self.t_width = time + 0.6;
}
self.punchangle_x = -2;
+ // self.SendFlags |= PLAYER_NET_PUNCHANGLE;

self.currentammo = self.ammo_cells = self.ammo_cells - 1;

@@ -936,7 +1481,12 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
local vector org = self.origin + '0 0 16';
makevectors (self.v_angle);

+ // set player to SOLID_BBOX, trace, then revert that change,
+ // same as in fire_axe -- CEV
+ local float player_solid = self.solid;
+ self.solid = SOLID_BBOX;
traceline (org, org + v_forward * 600, TRUE, self);
+ self.solid = player_solid;

WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_LIGHTNING2);
@@ -970,7 +1520,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
if (self.weapon == IT_AXE)
{
sound (self, CHAN_WEAPON, "weapons/ax1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
r = random ();
if (r < 0.25)
pl_axe1 ();
@@ -1019,7 +1569,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
pl_light1 ();
self.attack_finished = time + 0.1;
sound (self, CHAN_AUTO, "weapons/lstart.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
}
};

@@ -1054,53 +1604,53 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
if (damage_attacker.classname == "teledeath")
{
sound (self, CHAN_VOICE, "player/teledth1.wav",
- 1, ATTN_NONE);
+ VOL_HIGH, ATTN_NONE);
return;
}

// water pain sounds
- if (self.watertype == CONTENT_WATER &&
- self.waterlevel == WATERLEVEL_EYES)
+ if (self.contype == CONTENT_WATER &&
+ self.conlevel == WATERLEVEL_EYES)
{
// PlayerDeathBubbles
spawn_air_bubbles (self, self.origin, 1);
if (random() > 0.5)
sound (self, CHAN_VOICE, "player/drown1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
else
sound (self, CHAN_VOICE, "player/drown2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
return;
}

// slime pain sounds
- if (self.watertype == CONTENT_SLIME)
+ if (self.contype == CONTENT_SLIME)
{
// FIX ME put in some steam here
// 1998-08-10 Player gulps bubbles when hurt in slime
// by Maddes start
- if (self.waterlevel == WATERLEVEL_EYES)
+ if (self.conlevel == WATERLEVEL_EYES)
// PlayerDeathBubbles
spawn_air_bubbles (self, self.origin, 1);
// 1998-08-10 Player gulps bubbles when hurt in slime
// by Maddes end
if (random() > 0.5)
sound (self, CHAN_VOICE, "player/lburn1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
else
- sound (self, CHAN_VOICE, "player/lburn2.wav",
- 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, "player/lburn2.wav",
+ VOL_HIGH, ATTN_NORM);
return;
}

- if (self.watertype == CONTENT_LAVA)
+ if (self.contype == CONTENT_LAVA)
{
if (random() > 0.5)
sound (self, CHAN_VOICE, "player/lburn1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
else
sound (self, CHAN_VOICE, "player/lburn2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
return;
}

@@ -1118,7 +1668,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
{
self.axhitme = 0;
sound (self, CHAN_VOICE, "player/axhit1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
return;
}

@@ -1138,7 +1688,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
else
self.noise = "player/pain6.wav";

- sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise, VOL_HIGH, ATTN_NORM);
return;
};

@@ -1150,12 +1700,12 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
local float rs;

// water death sounds
- if (self.waterlevel == WATERLEVEL_EYES)
+ if (self.conlevel == WATERLEVEL_EYES)
{
// PlayerDeathBubbles
spawn_air_bubbles (self, self.origin, 20);
sound (self, CHAN_VOICE, "player/h2odeath.wav",
- 1, ATTN_NONE);
+ VOL_HIGH, ATTN_NONE);
return;
}

@@ -1171,7 +1721,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
else if (rs == 5)
self.noise = "player/death5.wav";

- sound (self, CHAN_VOICE, self.noise, 1, ATTN_NONE);
+ sound (self, CHAN_VOICE, self.noise, VOL_HIGH, ATTN_NONE);
return;
};

@@ -1190,80 +1740,127 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
//==============================================================

//--------------------------------------------------------------
- void() player_footsteps =
+ void() player_footstep =
{
// not moving, no steps
if (self.velocity_x == 0 || self.velocity_y == 0)
return;

- // no steps when submerged at the waist or greater
- if (self.waterlevel >= WATERLEVEL_WAIST)
+ // no steps when crouching
+ if (self.pmove_flags & PMF_CROUCHED)
return;

- if (self.pmove_flags & PMF_AIRSTEPPED)
- {
- // the heavy foot
- self.pmove_flags &= ~PMF_AIRSTEPPED;
- sound (self, CHAN_FEET, "steps/foot6.wav",
- 0.9, ATTN_FEET);
- }
- else if (self.waterlevel > WATERLEVEL_NONE)
- {
- dprint ("player_footsteps: water\n");
- }
- else
- {
- local float vol;
+ // at least 200ms between steps
+ if (self.step_time >= time - 0.2)
+ return;

- if (self.speed > PM_RUNSPEED * 0.9)
- {
- vol = 0.2 + (random() * 0.5);
- }
- else if (self.speed > PM_WALKSPEED * 0.9 &&
- (self.frame == $rockrun2 ||
- self.frame == $axrun2))
- {
- vol = 0.1 + (random() * 0.3);
- }
- else
- {
- // no footsteps below PM_WALKSPEED * 0.9
+ // no steps when submerged fully
+ if (self.conlevel >= WATERLEVEL_EYES)
+ return;
+
+ if (self.speed < PM_WALKSPEED * 0.9)
+ // no footsteps below PM_WALKSPEED * 0.9
+ return;
+
+ if (self.speed < PM_RUNSPEED * 0.9)
+ if (self.frame != $rockrun2 && self.frame != $axrun2)
+ // half the footsteps when walking
return;
- }

- local string newstep = "";
+ local float vol = 0;
+ local string wav = "";

- if (self.cnt == 0 || self.cnt > 6)
- self.cnt = rint (1 + random() * 5);
+ if (self.conlevel == WATERLEVEL_FEET)
+ {
+ // the water foot
+ vol = 0.3 + (random() * 0.1);
+ self.cnt = rint (random() * 3);

switch (self.cnt)
{
+ case 0:
+ wav = "player/stepwater1.ogg";
+ break;
case 1:
- newstep = "steps/foot1.wav";
+ wav = "player/stepwater2.ogg";
break;
case 2:
- newstep = "steps/foot2.wav";
+ wav = "player/stepwater3.ogg";
break;
case 3:
- newstep = "steps/foot3.wav";
+ wav = "player/stepwater4.ogg";
+ }
+ }
+ else if (self.conlevel == WATERLEVEL_WAIST)
+ {
+ // the deep water foot
+ if (self.frame != $rockrun2 && self.frame != $axrun2)
+ return;
+
+ vol = 0.3 + (random() * 0.1);
+ if (self.cnt > 3)
+ self.cnt = 0;
+
+ switch (self.cnt)
+ {
+ case 0:
+ wav = "player/stepwade1.ogg";
break;
- case 4:
- newstep = "steps/foot4.wav";
+ case 1:
+ wav = "player/stepwade2.ogg";
+ }
+ }
+ else
+ {
+ // call world_surface_type (which then calls out
+ // to compatibility modules) to get a material type
+ // under the player -- CEV
+ switch (world_surface_type(self, [0, 0, self.mins_z]))
+ {
+ case SURFACE_DIRT:
+ vol = 0.3 + (random() * 0.2);
+ if (self.cnt > 4)
+ self.cnt = 0;
+ wav = sprintf ("player/stepdirt%g.ogg",
+ self.cnt + 1);
break;
- case 5:
- newstep = "steps/foot5.wav";
+ case SURFACE_METAL:
+ vol = 0.3 + (random() * 0.2);
+ self.cnt = rint (random() * 8);
+ wav = sprintf ("player/stepmetal%g.ogg",
+ self.cnt + 1);
break;
- case 6:
- newstep = "steps/foot7.wav";
+ case SURFACE_WOOD:
+ vol = 0.3 + (random() * 0.2);
+ if (self.cnt > 3)
+ self.cnt = 0;
+ wav = sprintf ("player/stepwood%g.ogg",
+ self.cnt + 1);
break;
+ default:
+ // default is SURFACE_STONE -- CEV
+ vol = 0.3 + (random() * 0.2);
+ if (self.cnt > 5)
+ self.cnt = 0;
+ wav = sprintf ("player/stepstone%g.ogg",
+ self.cnt + 1);
}
+ }

- self.cnt++;
- sound (self, CHAN_FEET, newstep, vol, ATTN_FEET);
+ // TODO CEV
+ if (self.pmove_flags & PMF_AIRSTEPPED)
+ {
+ self.pmove_flags &= ~PMF_AIRSTEPPED;
}
- // dprint (sprintf("player_footsteps: step time diff %g\n",
- // time - self.step_time));
+
+ sound (self, CHAN_FEET, wav, vol, ATTN_FEET);
+ self.cnt++;
self.step_time = time;
+
+ if (self.lefty == FALSE)
+ self.lefty = TRUE;
+ else
+ self.lefty = FALSE;
};

//--------------------------------------------------------------
@@ -1356,6 +1953,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
void() pl_axrun1 = [$axrun1, pl_axrun2]
{
self.weaponframe = 0;
+ self.lefty = FALSE;
player_axrun (pl_run1);
};
void() pl_axrun2 = [$axrun2, pl_axrun3]
@@ -1363,7 +1961,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
// left foot down
player_axrun (pl_run2);
if (self.flags & FL_ONGROUND)
- player_footsteps ();
+ player_footstep ();
};
void() pl_axrun3 = [$axrun3, pl_axrun4] { player_axrun (pl_run3); };
void() pl_axrun4 = [$axrun4, pl_axrun5] { player_axrun (pl_run4); };
@@ -1372,7 +1970,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
// right foot down
player_axrun (pl_run5);
if (self.flags & FL_ONGROUND)
- player_footsteps ();
+ player_footstep ();
};
void() pl_axrun6 = [$axrun6, pl_axrun1] { player_axrun (pl_run6); };

@@ -1382,6 +1980,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
void() pl_run1 = [$rockrun1, pl_run2]
{
self.weaponframe = 0;
+ self.lefty = FALSE;
player_run (pl_axrun1);
};
void() pl_run2 = [$rockrun2, pl_run3]
@@ -1389,7 +1988,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
// left foot down
player_run (pl_axrun2);
if (self.flags & FL_ONGROUND)
- player_footsteps ();
+ player_footstep ();
};
void() pl_run3 = [$rockrun3, pl_run4] { player_run (pl_axrun3); };
void() pl_run4 = [$rockrun4, pl_run5] { player_run (pl_axrun4); };
@@ -1398,7 +1997,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
// right foot down
player_run (pl_axrun5);
if (self.flags & FL_ONGROUND)
- player_footsteps ();
+ player_footstep ();
};
void() pl_run6 = [$rockrun6, pl_run1] { player_run (pl_axrun6); };

@@ -1408,7 +2007,8 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
void() pl_shot1 = [$shotatt1, pl_shot2]
{
self.weaponframe = 1;
- self.effects = self.effects | EF_MUZZLEFLASH;
+ self.sveffects |= EF_MUZZLEFLASH;
+ // self.SendFlags |= PLAYER_NET_EFFECTS;
};
void() pl_shot2 = [$shotatt2, pl_shot3] { self.weaponframe = 2; };
void() pl_shot3 = [$shotatt3, pl_shot4] { self.weaponframe = 3; };
@@ -1469,7 +2069,8 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
//--------------------------------------------------------------
void() pl_nail1 = [$nailatt1, pl_nail2]
{
- self.effects = self.effects | EF_MUZZLEFLASH;
+ self.sveffects |= EF_MUZZLEFLASH;
+ // self.SendFlags |= PLAYER_NET_EFFECTS;

if (!self.button0)
{
@@ -1486,7 +2087,8 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
};
void() pl_nail2 = [$nailatt2, pl_nail1]
{
- self.effects = self.effects | EF_MUZZLEFLASH;
+ self.sveffects |= EF_MUZZLEFLASH;
+ // self.SendFlags |= PLAYER_NET_EFFECTS;

if (!self.button0)
{
@@ -1507,7 +2109,8 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
//--------------------------------------------------------------
void() pl_light1 = [$light1, pl_light2]
{
- self.effects = self.effects | EF_MUZZLEFLASH;
+ self.sveffects |= EF_MUZZLEFLASH;
+ // self.SendFlags |= PLAYER_NET_EFFECTS;

if (!self.button0)
{
@@ -1524,7 +2127,8 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
};
void() pl_light2 = [$light2, pl_light1]
{
- self.effects = self.effects | EF_MUZZLEFLASH;
+ self.sveffects |= EF_MUZZLEFLASH;
+ // self.SendFlags |= PLAYER_NET_EFFECTS;

if (!self.button0)
{
@@ -1546,7 +2150,8 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
void() pl_rocket1 = [$rockatt1, pl_rocket2]
{
self.weaponframe = 1;
- self.effects = self.effects | EF_MUZZLEFLASH;
+ self.sveffects |= EF_MUZZLEFLASH;
+ // self.SendFlags |= PLAYER_NET_EFFECTS;
};
void() pl_rocket2 = [$rockatt2, pl_rocket3] { self.weaponframe = 2; };
void() pl_rocket3 = [$rockatt3, pl_rocket4] { self.weaponframe = 3; };
@@ -1719,14 +2324,14 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
if (self.health < 0)
return;

- if (self.waterlevel != 3)
+ if (self.conlevel != 3)
{
if (self.air_finished < time)
sound (self, CHAN_VOICE, "player/gasp2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
else if (self.air_finished < time + 9)
sound (self, CHAN_VOICE, "player/gasp1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
self.air_finished = time + 12;
self.dmg = 2;
}
@@ -1745,19 +2350,19 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
}
}

- if (!self.waterlevel)
+ if (!self.conlevel)
{
if (self.flags & FL_INWATER)
{
// play leave water sound
sound (self, CHAN_BODY, "misc/outwater.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
self.flags = self.flags - FL_INWATER;
}
return;
}

- if (self.watertype == CONTENT_LAVA)
+ if (self.contype == CONTENT_LAVA)
{
// do damage
if (self.damage_time < time)
@@ -1769,11 +2374,11 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6

self.deathtype = "lava";
t_damage2 (self, world, world,
- 10 * self.waterlevel);
+ 10 * self.conlevel);
self.deathtype = "";
}
}
- else if (self.watertype == CONTENT_SLIME)
+ else if (self.contype == CONTENT_SLIME)
{
// do damage
if (self.damage_time < time &&
@@ -1782,7 +2387,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
self.damage_time = time + 1;
self.deathtype = "slime";
t_damage2 (self, world, world,
- 4 * self.waterlevel);
+ 4 * self.conlevel);
self.deathtype = "";
}
}
@@ -1790,15 +2395,15 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
if (!(self.flags & FL_INWATER))
{
// player enter water sound
- if (self.watertype == CONTENT_LAVA)
+ if (self.contype == CONTENT_LAVA)
sound (self, CHAN_BODY, "player/inlava.wav",
- 1, ATTN_NORM);
- if (self.watertype == CONTENT_WATER)
+ VOL_HIGH, ATTN_NORM);
+ if (self.contype == CONTENT_WATER)
sound (self, CHAN_BODY, "player/inh2o.wav",
- 1, ATTN_NORM);
- if (self.watertype == CONTENT_SLIME)
+ VOL_HIGH, ATTN_NORM);
+ if (self.contype == CONTENT_SLIME)
sound (self, CHAN_BODY, "player/slimbrn2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

self.flags = self.flags + FL_INWATER;
self.damage_time = 0;
@@ -1852,27 +2457,28 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
if (self.flags & FL_WATERJUMP)
return;

- if (self.waterlevel >= 2)
+ if (self.conlevel >= WATERLEVEL_WAIST)
{
- if (self.watertype == CONTENT_WATER)
+ if (self.contype == CONTENT_WATER)
self.velocity_z = 100;
- else if (self.watertype == CONTENT_SLIME)
+ else if (self.contype == CONTENT_SLIME)
self.velocity_z = 80;
else
self.velocity_z = 50;

// play swiming sound
- if (self.swim_flag < time)
+ if (self.conlevel >= WATERLEVEL_EYES &&
+ self.swim_time < time)
{
- self.swim_flag = time + 1;
+ self.swim_time = time + 1;
if (random() < 0.5)
sound (self, CHAN_BODY,
"misc/water1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
else
sound (self, CHAN_BODY,
"misc/water2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
}
return;
}
@@ -1887,7 +2493,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
return;
// player jumping sound (h00rt)
sound (self, CHAN_BODY, "player/plyrjmp8.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
}

self.flags = self.flags - (self.flags & FL_JUMPRELEASED);
@@ -1906,8 +2512,10 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
{
local float do_ladder_physics = FALSE;

- if (self.button4)
- dprint ("player_prethink: button4!\n");
+ // If just spawned in, try to recover previous fog values
+ // from own client entity, if any
+ if (clean_up_client_stuff)
+ fog_set_from_ent (self, self);

// note that this code block is here, before the tests
// which check whether the player is dead, so that the
@@ -1931,33 +2539,10 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
// from copper -- dumptruck_ds
if (self.movetype == MOVETYPE_NOCLIP)
self.flags |= FL_FLY;
- }
- else
- {
- self.gravity = self.wantedgravity;
- }
-
- /*
- dprint (sprintf("player::prethink: getlight %v\n",
- getlight (self.origin)));
- */

- // for referencing horizontal velocity later -- CEV
- self.speed = vlen ([self.velocity_x, self.velocity_y, 0]);
+ player_prethink_watermove ();

- // If just spawned in, try to recover previous fog values
- // from own client entity, if any
- if (clean_up_client_stuff)
- fog_set_from_ent (self, self);
-
- // WaterMove - needs to run even if doing nonstandard physics
- player_prethink_watermove ();
-
- if (world_standardphysics)
- {
- // run legacy CheckWaterJump if we're doing
- // standard physics -- CEV
- if (self.waterlevel == 2)
+ if (self.conlevel == WATERLEVEL_WAIST)
player_prethink_waterjump ();

// johnfitz ladder conditions, added from
@@ -1977,15 +2562,15 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
if (r > 0.66)
sound (self, CHAN_BODY,
"ladder/metal1.wav",
- 0.5, ATTN_NORM);
+ VOL_MID, ATTN_NORM);
else if (r > 0.33)
sound (self, CHAN_BODY,
"ladder/metal2.wav",
- 0.5, ATTN_NORM);
+ VOL_MID, ATTN_NORM);
else
sound (self, CHAN_BODY,
"ladder/metal3.wav",
- 0.5, ATTN_NORM);
+ VOL_MID, ATTN_NORM);
self.ladder_step_finished =
time + 0.3;
}
@@ -2006,6 +2591,13 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
self.flags |= FL_JUMPRELEASED;
}
}
+ else
+ {
+ self.gravity = self.wantedgravity;
+
+ // WaterMove - needs to run even if doing mod physics
+ player_prethink_watermove ();
+ }

if (self.deadflag >= DEAD_DEAD)
{
@@ -2045,7 +2637,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
if (self.invisible_sound < time)
{
sound (self, CHAN_AUTO, "items/inv3.wav",
- 0.5, ATTN_IDLE);
+ VOL_MID, ATTN_IDLE);
self.invisible_sound = time +
((random() * 3) + 1);
}
@@ -2058,7 +2650,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
" fading\n");
stuffcmd (self, "bf\n");
sound (self, CHAN_AUTO,"items/inv2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
self.invisible_time = time + 1;
}

@@ -2078,13 +2670,23 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
}

// use the eyes
- self.frame = 0;
- self.modelindex = modelindex_eyes;
+ if (self.modelindex != modelindex_eyes)
+ {
+ self.frame = 0;
+ self.modelindex = modelindex_eyes;
+ // self.SendFlags |= PLAYER_NET_FRAME |
+ // PLAYER_NET_MODEL;
+ }
}
else
{
// don't use the eyes
- self.modelindex = modelindex_player;
+ if (self.modelindex != modelindex_player)
+ {
+ self.modelindex = modelindex_player;
+ // self.SendFlags |= PLAYER_NET_FRAME |
+ // PLAYER_NET_MODEL;
+ }
}

// invincibility
@@ -2100,7 +2702,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
stuffcmd (self, "bf\n");
sound (self, CHAN_AUTO,
"items/protect2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
self.invincible_time = time + 1;
}

@@ -2119,9 +2721,11 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
self.invincible_finished = 0;
}
if (self.invincible_finished > time)
- self.effects = self.effects | EF_DIMLIGHT;
+ self.sveffects |= EF_DIMLIGHT;
else
- self.effects -= self.effects & EF_DIMLIGHT;
+ self.sveffects &= ~EF_DIMLIGHT;
+
+ // self.SendFlags |= PLAYER_NET_EFFECTS;
}

// super damage
@@ -2137,7 +2741,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
stuffcmd (self, "bf\n");
sound (self, CHAN_AUTO,
"items/damage2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
self.super_time = time + 1;
}

@@ -2156,9 +2760,11 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
self.super_time = 0;
}
if (self.super_damage_finished > time)
- self.effects = self.effects | EF_DIMLIGHT;
+ self.sveffects |= EF_DIMLIGHT;
else
- self.effects -= self.effects & EF_DIMLIGHT;
+ self.sveffects &= ~EF_DIMLIGHT;
+
+ // self.SendFlags |= PLAYER_NET_EFFECTS;
}

// suit
@@ -2177,7 +2783,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
stuffcmd (self, "bf\n");
sound (self, CHAN_AUTO,
"items/suit2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
self.rad_time = time + 1;
}

@@ -2203,6 +2809,15 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
//--------------------------------------------------------------
void() player_postthink =
{
+ // load up the sendflags -- CEV
+ // if (self.oldorigin != self.origin)
+ // self.SendFlags |= PLAYER_NET_ORIGIN;
+ self.SendFlags = PLAYER_NET_FRAME | PLAYER_NET_MODEL |
+ PLAYER_NET_ORIGIN | PLAYER_NET_ANGLES |
+ PLAYER_NET_VELOCITY | PLAYER_NET_FLAGS |
+ PLAYER_NET_TIMERS | PLAYER_NET_EFFECTS |
+ PLAYER_NET_SOLID | PLAYER_NET_PUNCHANGLE;
+
if (self.view_ofs == '0 0 0')
// intermission or finale
return;
@@ -2211,9 +2826,6 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
if (self.step_time <= time - 0.4)
self.pmove_flags &= ~PMF_AIRSTEPPED;

- // full send -- CEV
- self.SendFlags = 0xffffff;
-
if (self.deadflag)
return;

@@ -2234,20 +2846,20 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
if ((self.jump_flag < -300) && (self.flags & FL_ONGROUND) &&
(self.health > 0))
{
- if (self.watertype == CONTENT_WATER)
+ if (self.contype == CONTENT_WATER)
sound (self, CHAN_BODY, "player/h2ojump.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
else if (self.jump_flag < -650)
{
self.deathtype = "falling";
t_damage2 (self, world, world, 5);
self.deathtype = "";
sound (self, CHAN_VOICE, "player/land2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
}
else
sound (self, CHAN_VOICE, "player/land.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

self.jump_flag = 0;
}
@@ -2276,6 +2888,10 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
// from Copper -- dumptruck_ds
if (world_standardphysics && self.movetype != MOVETYPE_NOCLIP)
self.flags &= ~FL_FLY;
+
+ // set oldorigin here so we can detect if the engine modifies
+ // player origin (useful for setting SendFlags above) -- CEV
+ self.oldorigin = self.origin;
};

//==============================================================
@@ -2283,29 +2899,6 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
//==============================================================

//--------------------------------------------------------------
- // SendEntity -- transmit updates from server to client -- CEV
- //--------------------------------------------------------------
- float(entity to, float fl) player_sendentity =
- {
- WriteByte (MSG_ENTITY, CT_PLAYER);
- WriteByte (MSG_ENTITY, self.frame);
- WriteCoord (MSG_ENTITY, self.origin_x);
- WriteCoord (MSG_ENTITY, self.origin_y);
- WriteCoord (MSG_ENTITY, self.origin_z);
- WriteShort (MSG_ENTITY, self.angles_x * 32767 / 360);
- WriteShort (MSG_ENTITY, self.angles_y * 32767 / 360);
- WriteShort (MSG_ENTITY, self.angles_z * 32767 / 360);
- WriteShort (MSG_ENTITY, self.velocity_x);
- WriteShort (MSG_ENTITY, self.velocity_y);
- WriteShort (MSG_ENTITY, self.velocity_z);
- WriteFloat (MSG_ENTITY, self.effects);
- WriteFloat (MSG_ENTITY, self.flags);
- WriteFloat (MSG_ENTITY, self.pmove_flags);
- WriteFloat (MSG_ENTITY, self.doublejump_timer);
- return TRUE;
- };
-
- //--------------------------------------------------------------
// player_pain
//--------------------------------------------------------------
void(entity attacker, float damage) player_pain =
@@ -2337,17 +2930,17 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6

if (damage_attacker.classname == "teledeath")
sound (self, CHAN_VOICE, "player/teledth1.wav",
- 1, ATTN_NONE);
+ VOL_HIGH, ATTN_NONE);
else if (damage_attacker.classname == "teledeath2")
sound (self, CHAN_VOICE, "player/teledth1.wav",
- 1, ATTN_NONE);
+ VOL_HIGH, ATTN_NONE);
else
if (random() < 0.5)
sound (self, CHAN_VOICE, "player/gib.wav",
- 1, ATTN_NONE);
+ VOL_HIGH, ATTN_NONE);
else
sound (self, CHAN_VOICE, "player/udeath.wav",
- 1, ATTN_NONE);
+ VOL_HIGH, ATTN_NONE);
};

//--------------------------------------------------------------
@@ -2375,6 +2968,7 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
// 1998-07-23 Glowing corpse of players which had quad/pentagram
// until respawn fix by Maddes
self.effects = 0;
+ self.sveffects = 0;

// don't use eyes
self.modelindex = modelindex_player;
@@ -2424,7 +3018,9 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
else
pl_diee1 ();
};
+#endif

+#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
// by: Philip Martin aka: Kryten
// When on top of monsters or players you slide. This is a QuakeC
@@ -2454,11 +3050,13 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
// 1998-09-16 Sliding/not-jumping on monsters/boxes/players
// fix by Maddes/Kryten end
};
+#endif

//==============================================================
// Initialization
//==============================================================

+#ifdef SSQC
//--------------------------------------------------------------
// SelectSpawnPoint -- Returns the entity to spawn at
//--------------------------------------------------------------
@@ -2584,26 +3182,52 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
localcmd ("restart\n");
}
};
+#endif

+#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
// most of this was previously in PutClientInServer -- CEV
//--------------------------------------------------------------
void(entity e) player_init =
{
- local entity spot;
-
- spot = player_init_selectspawnpoint ();
+ #ifdef SSQC
+ local entity spot = player_init_selectspawnpoint ();
+ #endif

+ // block common to both client & server -- CEV
e.classname = "player";
e.classtype = CT_PLAYER;
- e.health = PLAYER_HEALTH;
- e.takedamage = DAMAGE_AIM;
e.solid = SOLID_SLIDEBOX;
- // e.solid = SOLID_BBOX;
e.movetype = MOVETYPE_WALK;
+ e.touch = player_touch;
+
+ #ifdef CSQC
+ e.customphysics = sub_null;
+ e.drawmask = DRAWMASK_NORMAL;
+ e.predraw = player_predraw;
+ e.preframe = player_prediction_preframe;
+ e.postframe = player_prediction_postframe;
+ e.removefunc = player_remove;
+ e.view_ofs = PM_STAND_VIEWOFS;
+ e.velocity = '0 0 0';
+
+ setmodelindex (e, e.modelindex);
+ if (e.pmove_flags & PMF_CROUCHED)
+ setsize (e, PM_CROUCH_MIN, PM_CROUCH_MAX);
+ else
+ setsize (e, PM_STAND_MIN, PM_STAND_MAX);
+ setorigin (e, e.origin);
+ #endif
+
+ #ifdef SSQC
+ e.flags = FL_CLIENT;
+ e.effects = 0;
+ e.gravity = 0;
+ e.wantedgravity = 0;
+ e.health = PLAYER_HEALTH;
+ e.takedamage = DAMAGE_AIM;
e.show_hostile = 0;
e.max_health = 100;
- e.flags = FL_CLIENT;
e.air_finished = time + 12;
// initial water damage
e.dmg = 2;
@@ -2611,11 +3235,8 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
e.radsuit_finished = 0;
e.invisible_finished = 0;
e.invincible_finished = 0;
- e.effects = 0;
e.invincible_time = 0;
e.deathtype = "";
- e.gravity = 0;
- e.wantedgravity = 0;
// support for item_key_custom -- iw
e.customkeys = 0;

@@ -2629,10 +3250,10 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
player_set_current_ammo ();

e.attack_finished = time;
- e.pain = player_pain;
+ e.th_pain = player_pain;
e.destroy = player_destroy;
- e.touch = player_touch;
- e.SendEntity = player_sendentity;
+ e.contentstransition = base_monster_contentstransition;
+ e.SendEntity = player_netsend;
e.deadflag = DEAD_NO;
// pausetime is set by teleporters to keep the player
// from moving for a while
@@ -2673,14 +3294,14 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
setmodel (e, "progs/player.mdl");
modelindex_player = e.modelindex;

- setsize (e, VEC_HULL_MIN, VEC_HULL_MAX);
-
- e.view_ofs = '0 0 22';
+ setsize (e, PM_STAND_MIN, PM_STAND_MAX);
+ e.view_ofs = PM_STAND_VIEWOFS;
// Mod - Xian (May.20.97)
// Bug where player would have velocity from their last kill
e.velocity = '0 0 0';
// 1998-07-21 Player moves after respawn fix by Xian

+ // full send the new entity -- CEV
e.SendFlags = 0xffffff;

// pl_stand1 needs 'self' to be 'e' -- CEV
@@ -2696,19 +3317,24 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
}

spawn_tdeath (e.origin, e);
+ #endif
};
+#endif

+#ifdef SSQC
//--------------------------------------------------------------
strip void() player =
{
player_init (self);
};
+#endif
// };

//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// Scenic Dead Monster Patch stuff here from DeadStuff mod -- dumptruck_ds
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

+#ifdef SSQC
/*QUAKED gib_head_player (0 0.5 0.8) (-16 -16 0) (16 16 56) SOLID 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
{
model ("progs/h_player.mdl");
@@ -2741,6 +3367,8 @@ model ("progs/h_player.mdl");
{
precache_model (e.mdl_head);
setmodel (e, e.mdl_head);
+ e.SendFlags |= PLAYER_NET_MODEL | PLAYER_NET_SOLID |
+ PLAYER_NET_SIZE;
}
else
{
@@ -2750,6 +3378,8 @@ model ("progs/h_player.mdl");
setsize (e, PLAYER_HEAD_MINS, PLAYER_HEAD_MAXS);
else if (e.solid == SOLID_TRIGGER)
setsize (e, '-16 -16 0', '16 16 56');
+ e.SendFlags |= PLAYER_NET_MODEL | PLAYER_NET_SOLID |
+ PLAYER_NET_SIZE;
}

e.frame = 0;
@@ -2765,7 +3395,9 @@ model ("progs/h_player.mdl");
gib_head_player_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED player_dead_axe (0 0.5 0.8) (-16 -16 -24) (16 16 32) SOLID 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
{
model ({"path":"progs/player.mdl","frame":49});
@@ -2784,14 +3416,16 @@ void() player_dead_axe =
if (self.spawnflags & 1)
{
self.solid = SOLID_BBOX;
- setsize (self,'-38.72 -5.83 -50.45','28.73 33.85 30');
+ setsize (self, PLAYER_CORPSE_AX_MINS, PLAYER_CORPSE_AX_MAXS);
}
else
{
self.solid = SOLID_NOT;
}
};
+#endif

+#ifdef SSQC
/*QUAKED player_dead_face_down (0 0.5 0.8) (-16 -16 -24) (16 16 32) SOLID 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
{
model ({"path":"progs/player.mdl","frame":84});
@@ -2810,14 +3444,16 @@ void() player_dead_face_down =
if (self.spawnflags & 1)
{
self.solid = SOLID_BBOX;
- setsize (self,'-50.28 -23.55 -49.85','30.66 14.49 30');
+ setsize (self, PLAYER_CORPSE_C_MINS, PLAYER_CORPSE_C_MAXS);
}
else
{
self.solid = SOLID_NOT;
}
};
+#endif

+#ifdef SSQC
/*QUAKED player_dead_on_side (0 0.5 0.8) (-16 -16 -24) (16 16 32) SOLID 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
{
model ({"path":"progs/player.mdl","frame":102});
@@ -2836,13 +3472,14 @@ void() player_dead_on_side =
if (self.spawnflags & 1)
{
self.solid = SOLID_BBOX;
- setsize (self,'-38.72 -5.83 -50.45','28.73 33.85 30');
+ setsize (self, PLAYER_CORPSE_E_MINS, PLAYER_CORPSE_E_MAXS);
}
else
{
self.solid = SOLID_NOT;
}
};
+#endif

//======================================================================
// END Scenic Dead Monster Patch stuff here from DeadStuff mod -- dumptruck_ds

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

Diff qc/monsters/shalrath.qc

diff --git a/qc/monsters/shalrath.qc b/qc/monsters/shalrath.qc
index 0b71961..f90ac57 100644
--- a/qc/monsters/shalrath.qc
+++ b/qc/monsters/shalrath.qc
@@ -7,9 +7,14 @@
//======================================================================

const float SHALRATH_HEALTH = 400; // id1 400
+const float SHALRATH_HEALTH_CORPSE = 80;

const vector SHALRATH_HEAD_MINS = '-19.85 -19.09 -1.44';
const vector SHALRATH_HEAD_MAXS = '13.72 16.8 30';
+const vector SHALRATH_CORPSE_MINS = '-41.41 -40.06 -49.38';
+const vector SHALRATH_CORPSE_MAXS = '34.52 24.32 30';
+const vector SHALRATH_CORPSE_Z_MINS = '-20 -20 -24';
+const vector SHALRATH_CORPSE_Z_MAXS = '20 20 -8';

//======================================================================
// forward declarations
@@ -38,7 +43,9 @@ void() shal_death1; void() shal_death2; void() shal_death3; void() shal_death4;
void() shal_death5; void() shal_death6; void() shal_death7;
void(entity attacker, float damage) monster_shalrath_pain; // interaction
void(vector dir) monster_shalrath_destroy;
-void(entity e) monster_shalrath_init; // initialization
+entity(vector org, vector ang, float sflags, float yaw, float angry)
+ spawn_monster_shalrath; // initialization
+void(entity e) monster_shalrath_init;
void() monster_shalrath;

// gib_head_shalrath
@@ -47,6 +54,7 @@ void(entity e) gib_head_shalrath_init;
void() gib_head_shalrath;

// monster_dead_shalrath
+void(entity e) monster_dead_shalrath_init;
void() monster_dead_shalrath;

//======================================================================
@@ -139,7 +147,7 @@ homing(float) : "Amount that the projectile should home in target. 1 is default,
void() monster_shalrath_sightsound =
{
sound_sight (self, CHAN_VOICE, "shalrath/sight.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
@@ -154,7 +162,7 @@ homing(float) : "Amount that the projectile should home in target. 1 is default,
{
if (random() < 0.2)
sound_idle (self, CHAN_VOICE, "shalrath/idle.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);
ai_walk (6);
};
void() shal_walk2 = [$walk3, shal_walk3] { ai_walk (4); };
@@ -176,7 +184,7 @@ homing(float) : "Amount that the projectile should home in target. 1 is default,
{
if (random() < 0.2)
sound_idle (self, CHAN_VOICE, "shalrath/idle.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);
ai_run (6);
};
void() shal_run2 = [$walk3, shal_run3] { ai_run (4); };
@@ -197,7 +205,7 @@ homing(float) : "Amount that the projectile should home in target. 1 is default,
void() shal_atk1 = [$attack1, shal_atk2]
{
sound_attack (self, CHAN_VOICE, "shalrath/attack.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
ai_face ();
};
void() shal_atk2 = [$attack2, shal_atk3] { ai_face (); };
@@ -225,7 +233,7 @@ homing(float) : "Amount that the projectile should home in target. 1 is default,
void() shal_tur_atk1 = [$attack1, shal_tur_atk2]
{
sound_attack (self, CHAN_VOICE, "shalrath/attack.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
ai_face ();
};
void() shal_tur_atk2 = [$attack2, shal_tur_atk3] { ai_face (); };
@@ -269,12 +277,19 @@ homing(float) : "Amount that the projectile should home in target. 1 is default,
//--------------------------------------------------------------
// Shalrath Death State
//--------------------------------------------------------------
- void() shal_death1 = [$death1, shal_death2] { };
+ void() shal_death1 = [$death1, shal_death2]
+ {
+ base_entity_aligntoground (self);
+ };
void() shal_death2 = [$death2, shal_death3] { };
void() shal_death3 = [$death3, shal_death4] { };
void() shal_death4 = [$death4, shal_death5] { };
void() shal_death5 = [$death5, shal_death6] { };
- void() shal_death6 = [$death6, shal_death7] { };
+ void() shal_death6 = [$death6, shal_death7]
+ {
+ become_base_corpse (self, SHALRATH_HEALTH_CORPSE);
+ setsize (self, SHALRATH_CORPSE_Z_MINS, SHALRATH_CORPSE_Z_MAXS);
+ };
void() shal_death7 = [$death7, shal_death7] { };

//==============================================================
@@ -291,7 +306,7 @@ homing(float) : "Amount that the projectile should home in target. 1 is default,

// CHAN_AUTO was voice - dumptruck_ds
sound_pain (self, CHAN_AUTO, "shalrath/pain.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
self.pain_finished = time + 3;

if (self.spawnflags & I_AM_TURRET)
@@ -305,11 +320,25 @@ homing(float) : "Amount that the projectile should home in target. 1 is default,
//--------------------------------------------------------------
void(vector dir) monster_shalrath_destroy =
{
+ // check if we're dead already
+ if (self.classgroup & CG_CORPSE)
+ {
+ sound (self, CHAN_VOICE, "player/udeath.wav",
+ VOL_HIGH, ATTN_NORM);
+
+ throw_gib_head_shalrath (self, dir, self.health);
+ throw_gib_1 (self, dir, self.health);
+ throw_gib_2 (self, dir, self.health);
+ throw_gib_3 (self, dir, self.health);
+
+ return;
+ }
+
// check for gib
if (self.health < -90)
{
sound (self, CHAN_VOICE, "player/udeath.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

throw_gib_head_shalrath (self, dir, self.health);
throw_gib_1 (self, dir, self.health);
@@ -322,10 +351,10 @@ homing(float) : "Amount that the projectile should home in target. 1 is default,

// insert death sounds here
sound_death (self, CHAN_VOICE, "shalrath/death.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
+ self.solid = SOLID_NOT;
base_item_drop_stuff (self);
shal_death1 ();
- self.solid = SOLID_NOT;
};

//==============================================================
@@ -333,6 +362,14 @@ homing(float) : "Amount that the projectile should home in target. 1 is default,
//==============================================================

//--------------------------------------------------------------
+ entity(vector org, vector ang, float sflags, float yaw, float angry)
+ spawn_monster_shalrath =
+ {
+ return spawn_base_monster (org, ang, sflags, yaw, angry,
+ monster_shalrath_init);
+ };
+
+ //--------------------------------------------------------------
void(entity e) monster_shalrath_init =
{
if (deathmatch)
@@ -381,12 +418,12 @@ homing(float) : "Amount that the projectile should home in target. 1 is default,
// disable with negative
e.homing = 0;

- e.think_stand = shal_stand1;
- e.think_walk = shal_walk1;
+ e.th_stand = shal_stand1;
+ e.th_walk = shal_walk1;
if (e.spawnflags & I_AM_TURRET)
- e.think_run = shal_seek_stand1;
+ e.th_run = shal_seek_stand1;
else
- e.think_run = shal_run1;
+ e.th_run = shal_run1;

e.destroy = monster_shalrath_destroy;

@@ -394,11 +431,11 @@ homing(float) : "Amount that the projectile should home in target. 1 is default,
// http://celephais.net/board/view_thread.php?id=4&start=3465
// -- dumptruck_ds
if !(e.berserk)
- e.pain = monster_shalrath_pain;
+ e.th_pain = monster_shalrath_pain;
else
- e.pain = sub_nullpain;
- e.think_missile = shal_atk1;
- e.think_turret = shal_tur_atk1;
+ e.th_pain = sub_nullpain;
+ e.th_missile = shal_atk1;
+ e.th_turret = shal_tur_atk1;

// walkmonster_start
base_walkmonster_init (e);
@@ -478,23 +515,30 @@ model ("progs/h_shal.mdl");
model ({"path":"progs/shalrath.mdl","frame":22});
}
*/
-void() monster_dead_shalrath =
-{
- // new spawnflags for all entities -- iw
- if (SUB_Inhibit())
- return;
+//----------------------------------------------------------------------
+// class monster_dead_shalrath: base_corpse
+// {
+ //--------------------------------------------------------------
+ void(entity e) monster_dead_shalrath_init =
+ {
+ base_corpse_init (e);

- precache_model ("progs/shalrath.mdl");
- setmodel (self, "progs/shalrath.mdl");
- self.frame = $death7;
+ precache_model ("progs/shalrath.mdl");
+ setmodel (e, "progs/shalrath.mdl");

- if (self.spawnflags & 1)
- {
- self.solid = SOLID_BBOX;
- setsize (self,'-41.41 -40.06 -49.38','34.52 24.32 30');
+ e.frame = $death7;
+
+ if (e.solid == SOLID_BBOX)
+ setsize (e, SHALRATH_CORPSE_MINS, SHALRATH_CORPSE_MAXS);
}
- else
+
+ //--------------------------------------------------------------
+ void() monster_dead_shalrath =
{
- self.solid = SOLID_NOT;
- }
-};
+ // new spawnflags for all entities -- iw
+ if (SUB_Inhibit())
+ return;
+
+ monster_dead_shalrath_init (self);
+ };
+// };

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

Diff qc/monsters/shambler.qc

diff --git a/qc/monsters/shambler.qc b/qc/monsters/shambler.qc
index 9ec9846..79c2521 100644
--- a/qc/monsters/shambler.qc
+++ b/qc/monsters/shambler.qc
@@ -7,9 +7,14 @@
//======================================================================

const float SHAMBLER_HEALTH = 600; // id1 600
+const float SHAMBLER_HEALTH_CORPSE = 100;

const vector SHAMBLER_HEAD_MINS = '-15.15 -20.638 -0.45';
const vector SHAMBLER_HEAD_MAXS = '21.44 21.76 30';
+const vector SHAMBLER_CORPSE_MINS = '-77.09 -72.17 -51.52';
+const vector SHAMBLER_CORPSE_MAXS = '47.44 98.15 30';
+const vector SHAMBLER_CORPSE_Z_MINS = '-20 -20 -24';
+const vector SHAMBLER_CORPSE_Z_MAXS = '20 20 -8';

//======================================================================
// forward declarations
@@ -77,7 +82,9 @@ void() sham_death5; void() sham_death6; void() sham_death7; void() sham_death8;
void() sham_death9; void() sham_death10; void() sham_death11;
void(entity attacker, float damage) monster_shambler_pain; // interaction
void(vector dir) monster_shambler_destroy;
-void(entity e) monster_shambler_init; // initialization
+entity(vector org, vector ang, float sflags, float yaw, float angry)
+ spawn_monster_shambler; // initialization
+void(entity e) monster_shambler_init;
void() monster_shambler;

// gib_head_shambler
@@ -86,6 +93,7 @@ void(entity e) gib_head_shambler_init;
void() gib_head_shambler;

// monster_dead_shambler
+void(entity e) monster_dead_shambler_init;
void() monster_dead_shambler;

//======================================================================
@@ -237,7 +245,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
void() monster_shambler_sightsound =
{
sound_sight (self, CHAN_VOICE, "shambler/ssight.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
@@ -335,7 +343,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
ldmg = (random() + random() + random()) * 20;
t_damage2 (self.enemy, self, self, ldmg);
sound_hit (self, CHAN_VOICE, "shambler/smack.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

if (side)
{
@@ -384,7 +392,8 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//--------------------------------------------------------------
void() monster_shambler_attack_lavaball =
{
- sound_attack (self, CHAN_AUTO, "boss1/throw.wav", 1, ATTN_NORM);
+ sound_attack (self, CHAN_AUTO, "boss1/throw.wav",
+ VOL_HIGH, ATTN_NORM);

// custom lavaball speed -- CEV
base_monster_fire_lavaball (
@@ -458,7 +467,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
ai_walk (7);
if (random() > 0.8)
sound_idle (self, CHAN_VOICE, "shambler/sidle.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);
};

//--------------------------------------------------------------
@@ -474,7 +483,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
ai_run (20);
if (random() > 0.8)
sound_idle (self, CHAN_VOICE, "shambler/sidle.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);
};

//--------------------------------------------------------------
@@ -483,7 +492,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
void() sham_smash1 = [$smash1, sham_smash2]
{
sound_attack (self, CHAN_VOICE, "shambler/melee1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
ai_charge (2);
};
void() sham_smash2 = [$smash2, sham_smash3] { ai_charge (6); };
@@ -513,7 +522,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
ldmg = (random() + random() + random()) * 40;
t_damage2 (self.enemy, self, self, ldmg);
sound_hit (self, CHAN_VOICE, "shambler/smack.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

spawn_meatspray (self.origin + v_forward * 16,
crandom() * 100 * v_right);
@@ -543,7 +552,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
monster_shambler_attack_lavaball ();
sound_attack (self, CHAN_VOICE, "shambler/melee1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
ai_face ();
};
void() sham_proj11 = [$smash11, sham_proj12] { ai_face (); };
@@ -565,7 +574,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
monster_shambler_attack_lavaball ();
sound_attack (self, CHAN_VOICE, "shambler/melee1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
ai_face();
};
void() sham_tur_proj11 = [$smash11, sham_tur_proj12] { ai_face (); };
@@ -581,7 +590,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
void() sham_swingl1 = [$swingl1, sham_swingl2]
{
sound_misc (self, CHAN_VOICE, "shambler/melee2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
ai_charge (5);
};
void() sham_swingl2 = [$swingl2, sham_swingl3] { ai_charge (3); };
@@ -608,7 +617,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
void() sham_swingr1 = [$swingr1, sham_swingr2]
{
sound_attack (self, CHAN_VOICE, "shambler/melee1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
ai_charge (1);
};
void() sham_swingr2 = [$swingr2, sham_swingr3] { ai_charge (8); };
@@ -637,7 +646,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
ai_face ();
sound_misc1 (self, CHAN_WEAPON, "shambler/sattck1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};
void() sham_magic2 = [$magic2, sham_magic3] { ai_face (); };
void() sham_magic3 = [$magic3, sham_magic4]
@@ -663,7 +672,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
self.trigger_field = world;
monster_shambler_attack_lightning ();
sound_misc2 (self, CHAN_WEAPON, "shambler/sboom.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};
// TODO CEV why are frames $magic8 and $magic9 not used?
void() sham_magic9 = [$magic9, sham_magic10]
@@ -692,7 +701,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
ai_face ();
sound_misc1 (self, CHAN_WEAPON, "shambler/sattck1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};
void() sham_tur_magic2 = [$magic2, sham_tur_magic3] { ai_face (); };
void() sham_tur_magic3 = [$magic3, sham_tur_magic4]
@@ -721,7 +730,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
self.trigger_field = world;
monster_shambler_attack_lightning ();
sound_misc2 (self, CHAN_WEAPON, "shambler/sboom.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};
// TODO CEV again why are $magic7 and $magic8 not used?
void() sham_tur_magic9 = [$magic9, sham_tur_magic10]
@@ -790,19 +799,23 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//--------------------------------------------------------------
// Shambler Death state
//--------------------------------------------------------------
- void() sham_death1 = [$death1, sham_death2] { };
- void() sham_death2 = [$death2, sham_death3] { };
- void() sham_death3 = [$death3, sham_death4]
+ void() sham_death1 = [$death1, sham_death2]
{
- self.solid = SOLID_NOT;
+ base_entity_aligntoground (self);
};
+ void() sham_death2 = [$death2, sham_death3] { };
+ void() sham_death3 = [$death3, sham_death4] { self.solid = SOLID_NOT; };
void() sham_death4 = [$death4, sham_death5] { };
void() sham_death5 = [$death5, sham_death6] { };
void() sham_death6 = [$death6, sham_death7] { };
void() sham_death7 = [$death7, sham_death8] { };
void() sham_death8 = [$death8, sham_death9] { };
void() sham_death9 = [$death9, sham_death10] { };
- void() sham_death10 = [$death10, sham_death11] { };
+ void() sham_death10 = [$death10, sham_death11]
+ {
+ become_base_corpse (self, SHAMBLER_HEALTH_CORPSE);
+ setsize (self, SHAMBLER_CORPSE_Z_MINS, SHAMBLER_CORPSE_Z_MAXS);
+ };
void() sham_death11 = [$death11, sham_death11] { };

//==============================================================
@@ -810,12 +823,20 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//==============================================================

//--------------------------------------------------------------
+ entity(vector org, vector ang, float sflags, float yaw, float angry)
+ spawn_monster_shambler =
+ {
+ return spawn_base_monster (org, ang, sflags, yaw, angry,
+ monster_shambler_init);
+ };
+
+ //--------------------------------------------------------------
// sham_pain
//--------------------------------------------------------------
void(entity attacker, float damage) monster_shambler_pain =
{
sound_pain (self, CHAN_VOICE, "shambler/shurt2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

if (self.spawnflags & I_AM_TURRET)
return;
@@ -847,11 +868,25 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//--------------------------------------------------------------
void(vector dir) monster_shambler_destroy =
{
+ // check if we're dead already
+ if (self.classgroup & CG_CORPSE)
+ {
+ sound (self, CHAN_VOICE, "player/udeath.wav",
+ VOL_HIGH, ATTN_NORM);
+
+ throw_gib_head_shambler (self, dir, self.health);
+ throw_gib_1 (self, dir, self.health);
+ throw_gib_2 (self, dir, self.health);
+ throw_gib_3 (self, dir, self.health);
+
+ return;
+ }
+
// check for gib
if (self.health < -60)
{
sound (self, CHAN_VOICE, "player/udeath.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

throw_gib_head_shambler (self, dir, self.health);
throw_gib_1 (self, dir, self.health);
@@ -864,7 +899,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by

// regular death
sound_death (self, CHAN_VOICE, "shambler/sdeath.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
base_item_drop_stuff (self);
sham_death1 ();
};
@@ -927,32 +962,32 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by

e.checkattack = monster_shambler_checkattack;
e.sightsound = monster_shambler_sightsound;
- e.think_stand = sham_stand1;
- e.think_walk = sham_walk1;
+ e.th_stand = sham_stand1;
+ e.th_walk = sham_walk1;
if (e.spawnflags & I_AM_TURRET)
- e.think_run = sham_seek_1;
+ e.th_run = sham_seek_1;
else
- e.think_run = sham_run1;
+ e.th_run = sham_run1;
e.destroy = monster_shambler_destroy;
if (e.style == 1)
- e.think_melee = monster_shambler_attack_melee2;
+ e.th_melee = monster_shambler_attack_melee2;
else
- e.think_melee = monster_shambler_attack_melee;
+ e.th_melee = monster_shambler_attack_melee;
if (e.style == 1)
- e.think_missile = sham_proj1;
+ e.th_missile = sham_proj1;
else
- e.think_missile = sham_magic1;
+ e.th_missile = sham_magic1;
if (e.style == 1)
- e.think_turret = sham_tur_proj1;
+ e.th_turret = sham_tur_proj1;
else
- e.think_turret = sham_tur_magic1;
+ e.th_turret = sham_tur_magic1;
// Berserk test from
// http://celephais.net/board/view_thread.php?id=4&start=3465
// -- dumptruck_ds
if !(e.berserk)
- e.pain = monster_shambler_pain;
+ e.th_pain = monster_shambler_pain;
else
- e.pain = sub_nullpain;
+ e.th_pain = sub_nullpain;

// walkmonster_start
base_walkmonster_init (e);
@@ -1032,22 +1067,29 @@ model ("progs/h_shams.mdl");
model ({"path":"progs/shambler.mdl","frame":93});
}
*/
-void() monster_dead_shambler =
-{
- // new spawnflags for all entities -- iw
- if (SUB_Inhibit())
- return;
-
- precache_model("progs/shambler.mdl");
- setmodel(self, "progs/shambler.mdl");
- self.frame = $death11;
- if (self.spawnflags & 1)
+//----------------------------------------------------------------------
+// class monster_dead_shambler: base_corpse
+// {
+ //--------------------------------------------------------------
+ void(entity e) monster_dead_shambler_init =
{
- self.solid = SOLID_BBOX;
- setsize(self,'-77.09 -72.17 -51.52','47.44 98.15 30');
- }
- else
+ base_corpse_init (e);
+
+ precache_model ("progs/shambler.mdl");
+ setmodel (e, "progs/shambler.mdl");
+ e.frame = $death11;
+
+ if (e.solid == SOLID_BBOX)
+ setsize (e, SHAMBLER_CORPSE_MINS, SHAMBLER_CORPSE_MAXS);
+ };
+
+ //--------------------------------------------------------------
+ void() monster_dead_shambler =
{
- self.solid = SOLID_NOT;
- }
-};
+ // new spawnflags for all entities -- iw
+ if (SUB_Inhibit())
+ return;
+
+ monster_dead_shambler_init (self);
+ };
+// };

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

Diff qc/monsters/soldier.qc

diff --git a/qc/monsters/soldier.qc b/qc/monsters/soldier.qc
index ef5911a..f9e96d1 100644
--- a/qc/monsters/soldier.qc
+++ b/qc/monsters/soldier.qc
@@ -7,9 +7,16 @@
//======================================================================

const float ARMY_HEALTH = 30; // id1 30
+const float ARMY_HEALTH_CORPSE = 30;

const vector ARMY_HEAD_MINS = '-9.67 -8.27 -0.28';
const vector ARMY_HEAD_MAXS = '4.05 4.8 13.41';
+const vector ARMY_CORPSE_MINS = '-38.27 -30.47 -50.3';
+const vector ARMY_CORPSE_MAXS = '22.1 25.35 30';
+const vector ARMY_CORPSE_C_MINS = '-39.85 -29.35 -49.07';
+const vector ARMY_CORPSE_C_MAXS = '20.52 33.17 30';
+const vector ARMY_CORPSE_Z_MINS = '-16 -16 -24'; // thin 32x32 box on ground
+const vector ARMY_CORPSE_Z_MAXS = '16 16 -8';

//======================================================================
// forward declarations
@@ -58,7 +65,9 @@ void() army_die9; void() army_die10;
void() army_cdie1; void() army_cdie2; void() army_cdie3; void() army_cdie4;
void() army_cdie5; void() army_cdie6; void() army_cdie7; void() army_cdie8;
void() army_cdie9; void() army_cdie10; void() army_cdie11;
-void(entity e) monster_army_init; // initialization
+entity(vector org, vector ang, float sflags, float yaw, float angry)
+ spawn_monster_army; // initialization
+void(entity e) monster_army_init;
void() monster_army;

// gib_head_army
@@ -67,6 +76,7 @@ void(entity e) gib_head_army_init;
void() gib_head_army;

// monster_dead_army
+void(entity e) monster_dead_army_init;
void() monster_dead_army;

//======================================================================
@@ -237,7 +247,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by

if (random() < chance)
{
- self.think_missile ();
+ self.th_missile ();
sub_attackfinished (1 + random());
if (random() < 0.3)
self.lefty = !self.lefty;
@@ -252,7 +262,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
void() monster_army_sightsound =
{
sound_sight (self, CHAN_VOICE, "soldier/sight1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
@@ -300,7 +310,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
ai_face ();

sound_attack (self, CHAN_WEAPON, "weapons/rocket1i.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
self.effects = self.effects | EF_MUZZLEFLASH;

if (self.style == 5)
@@ -324,7 +334,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by

self.effects |= EF_MUZZLEFLASH;
sound_attack (self, CHAN_WEAPON, "soldier/sattck1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

// FireBullets (4, dir, '0.1 0.1 0');

@@ -353,7 +363,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
// correctly -- dumptruck_ds
self.pain_finished = time + 0.6;
sound_pain (self, CHAN_VOICE, "soldier/pain1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
if (self.spawnflags & I_AM_TURRET)
return;
else
@@ -363,7 +373,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
self.pain_finished = time + 1.1;
sound_misc (self, CHAN_VOICE, "soldier/pain2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
if (self.spawnflags & I_AM_TURRET)
return;
else
@@ -373,7 +383,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
self.pain_finished = time + 1.1;
sound_misc (self, CHAN_VOICE, "soldier/pain2.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
if (self.spawnflags & I_AM_TURRET)
return;
else
@@ -384,11 +394,25 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//--------------------------------------------------------------
void(vector dir) monster_army_destroy =
{
+ // check if we're dead already
+ if (self.classgroup & CG_CORPSE)
+ {
+ sound (self, CHAN_VOICE, "player/udeath.wav",
+ VOL_HIGH, ATTN_NORM);
+
+ throw_gib_head_army (self, dir, self.health);
+ throw_gib_1 (self, dir, self.health);
+ throw_gib_2 (self, dir, self.health);
+ throw_gib_3 (self, dir, self.health);
+
+ return;
+ }
+
// check for gib
if (self.health < -35)
{
sound (self, CHAN_VOICE, "player/udeath.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

throw_gib_head_army (self, dir, self.health);
throw_gib_1 (self, dir, self.health);
@@ -401,7 +425,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by

// regular death
sound_death (self, CHAN_VOICE, "soldier/death1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
base_item_drop_stuff (self);
if (random() < 0.5)
army_die1 ();
@@ -428,7 +452,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
if (random() < 0.2)
sound_idle (self, CHAN_VOICE, "soldier/idle.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);
ai_walk (1);
};
void() army_walk2 = [$prowl_2, army_walk3] { ai_walk (1); };
@@ -462,7 +486,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
if (random() < 0.2)
sound_idle (self, CHAN_VOICE, "soldier/idle.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);
ai_run (11);
};
void() army_run2 = [$run2, army_run3] { ai_run (15); };
@@ -617,11 +641,15 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//--------------------------------------------------------------
// Grunt death states
//--------------------------------------------------------------
- void() army_die1 = [$death1, army_die2] { };
+ void() army_die1 = [$death1, army_die2]
+ {
+ base_entity_aligntoground (self);
+ };
void() army_die2 = [$death2, army_die3] { };
void() army_die3 = [$death3, army_die4]
{
self.solid = SOLID_NOT;
+
// style ammotype check -- dumptruck_ds
if (self.style == 1)
self.ammo_rockets = 2;
@@ -633,6 +661,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
self.ammo_nails = 5;
else if (self.style == 0)
self.ammo_shells = 5;
+
if (!self.keep_ammo)
item_backpack_drop (self);
};
@@ -641,14 +670,22 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
void() army_die6 = [$death6, army_die7] { };
void() army_die7 = [$death7, army_die8] { };
void() army_die8 = [$death8, army_die9] { };
- void() army_die9 = [$death9, army_die10] { };
+ void() army_die9 = [$death9, army_die10]
+ {
+ become_base_corpse (self, ARMY_HEALTH_CORPSE);
+ setsize (self, ARMY_CORPSE_Z_MINS, ARMY_CORPSE_Z_MAXS);
+ };
void() army_die10 = [$death10, army_die10] { };

- void() army_cdie1 = [$deathc1, army_cdie2] { };
+ void() army_cdie1 = [$deathc1, army_cdie2]
+ {
+ base_entity_aligntoground (self);
+ };
void() army_cdie2 = [$deathc2, army_cdie3] { ai_back (5); };
void() army_cdie3 = [$deathc3, army_cdie4]
{
self.solid = SOLID_NOT;
+
// style ammotype check -- dumptruck_ds
if (self.style == 1)
self.ammo_rockets = 2;
@@ -660,8 +697,10 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
self.ammo_nails = 5;
else if (self.style == 0)
self.ammo_shells = 5;
+
if (!self.keep_ammo)
item_backpack_drop (self);
+
ai_back (4);
};
void() army_cdie4 = [$deathc4, army_cdie5] { ai_back (13); };
@@ -670,7 +709,11 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
void() army_cdie7 = [$deathc7, army_cdie8] { };
void() army_cdie8 = [$deathc8, army_cdie9] { };
void() army_cdie9 = [$deathc9, army_cdie10] { };
- void() army_cdie10 = [$deathc10, army_cdie11] { };
+ void() army_cdie10 = [$deathc10, army_cdie11]
+ {
+ become_base_corpse (self, ARMY_HEALTH_CORPSE);
+ setsize (self, ARMY_CORPSE_Z_MINS, ARMY_CORPSE_Z_MAXS);
+ };
void() army_cdie11 = [$deathc11, army_cdie11] { };

//==============================================================
@@ -678,6 +721,14 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//==============================================================

//--------------------------------------------------------------
+ entity(vector org, vector ang, float sflags, float yaw, float angry)
+ spawn_monster_army =
+ {
+ return spawn_base_monster (org, ang, sflags, yaw, angry,
+ monster_army_init);
+ };
+
+ //--------------------------------------------------------------
void(entity e) monster_army_init =
{
if (deathmatch)
@@ -737,22 +788,22 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
// thanks RennyC -- dumptruck_ds
e.health = ARMY_HEALTH;

- e.think_stand = army_stand1;
- e.think_walk = army_walk1;
+ e.th_stand = army_stand1;
+ e.th_walk = army_walk1;
if (e.spawnflags & I_AM_TURRET)
- e.think_run = army_seek_stand1;
+ e.th_run = army_seek_stand1;
else
- e.think_run = army_run1;
- e.think_missile = army_atk1;
- e.think_turret = army_tur_atk1;
+ e.th_run = army_run1;
+ e.th_missile = army_atk1;
+ e.th_turret = army_tur_atk1;

if !(e.berserk)
// Berserk test from
// celephais.net/board/view_thread.php?id=4&start=3465
// -- dumptruck_ds
- e.pain = monster_army_pain;
+ e.th_pain = monster_army_pain;
else
- e.pain = sub_nullpain;
+ e.th_pain = sub_nullpain;

e.destroy = monster_army_destroy;

@@ -837,39 +888,41 @@ model ("progs/h_guard.mdl");
model ({"path":"progs/soldier.mdl","frame":28});
}
*/
-void() monster_dead_army =
-{
- // new spawnflags for all entities -- iw
- if (SUB_Inhibit())
- return;
-
- precache_model ("progs/soldier.mdl");
- setmodel (self, "progs/soldier.mdl");
- if (self.spawnflags & 2)
+//----------------------------------------------------------------------
+// class monster_dead_army: base_corpse
+// {
+ //--------------------------------------------------------------
+ void(entity e) monster_dead_army_init =
{
- self.frame = $death10;
+ base_corpse_init (e);

- if (self.spawnflags & 1)
+ precache_model ("progs/soldier.mdl");
+ setmodel (e, "progs/soldier.mdl");
+
+ if (e.spawnflags & 2)
{
- self.solid = SOLID_BBOX;
- setsize (self,'-38.27 -30.47 -50.3','22.1 25.35 30');
+ e.frame = $death10;
+
+ if (e.solid == SOLID_BBOX)
+ setsize (e, ARMY_CORPSE_MINS, ARMY_CORPSE_MAXS);
}
else
{
- self.solid = SOLID_NOT;
+ e.frame = $deathc11;
+
+ if (e.solid == SOLID_BBOX)
+ setsize (e, ARMY_CORPSE_C_MINS,
+ ARMY_CORPSE_C_MAXS);
}
- }
- else
+ };
+
+ //--------------------------------------------------------------
+ void() monster_dead_army =
{
- self.frame = $deathc11;
- if (self.spawnflags & 1)
- {
- self.solid = SOLID_BBOX;
- setsize (self,'-39.85 -29.35 -49.07','20.52 33.17 30');
- }
- else
- {
- self.solid = SOLID_NOT;
- }
- }
-};
+ // new spawnflags for all entities -- iw
+ if (SUB_Inhibit())
+ return;
+
+ monster_dead_army_init (self);
+ };
+// };

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

Diff qc/monsters/wizard.qc

diff --git a/qc/monsters/wizard.qc b/qc/monsters/wizard.qc
index ebe1ca1..78c3c3c 100644
--- a/qc/monsters/wizard.qc
+++ b/qc/monsters/wizard.qc
@@ -7,9 +7,14 @@
//======================================================================

const float WIZARD_HEALTH = 80; // id1 80
+const float WIZARD_HEALTH_CORPSE = 30;

const vector WIZARD_HEAD_MINS = '-10.41 -8.66 -0.54';
const vector WIZARD_HEAD_MAXS = '6.52 10.82 30';
+const vector WIZARD_CORPSE_MINS = '-50.75 -27.46 -55.19';
+const vector WIZARD_CORPSE_MAXS = '31.81 33.61 30';
+const vector WIZARD_CORPSE_Z_MINS = '-20 -20 -24';
+const vector WIZARD_CORPSE_Z_MAXS = '20 20 -8';

//======================================================================
// forward declarations
@@ -40,7 +45,9 @@ void() wiz_death1; void() wiz_death2; void() wiz_death3; void() wiz_death4;
void() wiz_death5; void() wiz_death6; void() wiz_death7; void() wiz_death8;
void(entity attacker, float damage) monster_wizard_pain; // interaction
void(vector dir) monster_wizard_destroy;
-void(entity e) monster_wizard_init; // initialization
+entity(vector org, vector ang, float sflags, float yaw, float angry)
+ spawn_monster_wizard; // initialization
+void(entity e) monster_wizard_init;
void() monster_wizard;

// gib_head_wizard
@@ -49,6 +56,7 @@ void(entity e) gib_head_wizard_init;
void() gib_head_wizard;

// monster_dead_wizard
+void(entity e) monster_dead_wizard_init;
void() monster_dead_wizard;

//======================================================================
@@ -168,7 +176,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
void() monster_wizard_sightsound =
{
sound_sight (self, CHAN_VOICE, "wizard/wsight.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
@@ -178,7 +186,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
// this is a hack to fix Wizard custom attack sounds
sound_attack (self, CHAN_AUTO, "wizard/wattack.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
@@ -193,10 +201,12 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
self.fly_sound = time + 2;
if (wr > 4.5)
sound_idle (self, CHAN_VOICE,
- "wizard/widle1.wav", 1, ATTN_IDLE);
+ "wizard/widle1.wav",
+ VOL_HIGH, ATTN_IDLE);
if (wr < 1.5)
sound_misc (self, CHAN_VOICE,
- "wizard/widle2.wav", 1, ATTN_IDLE);
+ "wizard/widle2.wav",
+ VOL_HIGH, ATTN_IDLE);
}
return;
};
@@ -388,16 +398,21 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
self.velocity_x = -200 + 400 * random ();
self.velocity_y = -200 + 400 * random ();
self.velocity_z = 100 + 100 * random ();
- self.flags = self.flags - (self.flags & FL_ONGROUND);
+ // self.flags = self.flags - (self.flags & FL_ONGROUND);
+ base_entity_aligntoground (self);
sound_death (self, CHAN_VOICE, "wizard/wdeath.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};
void() wiz_death2 = [$death2, wiz_death3] { };
void() wiz_death3 = [$death3, wiz_death4] { self.solid = SOLID_NOT; };
void() wiz_death4 = [$death4, wiz_death5] { };
void() wiz_death5 = [$death5, wiz_death6] { };
void() wiz_death6 = [$death6, wiz_death7] { };
- void() wiz_death7 = [$death7, wiz_death8] { };
+ void() wiz_death7 = [$death7, wiz_death8]
+ {
+ become_base_corpse (self, WIZARD_HEALTH_CORPSE);
+ setsize (self, WIZARD_CORPSE_Z_MINS, WIZARD_CORPSE_Z_MAXS);
+ };
void() wiz_death8 = [$death8, wiz_death8] { };

//==============================================================
@@ -410,7 +425,7 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
void(entity attacker, float damage) monster_wizard_pain =
{
sound_pain (self, CHAN_VOICE, "wizard/wpain.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

if (random() * 70 > damage)
// didn't flinch
@@ -424,11 +439,38 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//--------------------------------------------------------------
void(vector dir) monster_wizard_destroy =
{
+ // check if we're dead already
+ if (self.classgroup & CG_CORPSE)
+ {
+ sound (self, CHAN_VOICE, "player/udeath.wav",
+ VOL_HIGH, ATTN_NORM);
+
+ throw_gib_head_wizard (self, dir, self.health);
+
+ // custom models -- dumptruck_ds
+ if (self.mdl_gib1 != "")
+ throw_gib_1 (self, dir, self.health);
+ else
+ throw_gib_2 (self, dir, self.health);
+
+ if (self.mdl_gib2 != "")
+ throw_gib_2 (self, dir, self.health);
+ else
+ throw_gib_2 (self, dir, self.health);
+
+ if (self.mdl_gib3 != "")
+ throw_gib_3 (self, dir, self.health);
+ else
+ throw_gib_2 (self, dir, self.health);
+
+ return;
+ }
+
// check for gib
if (self.health < -40)
{
sound (self, CHAN_VOICE, "player/udeath.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

throw_gib_head_wizard (self, dir, self.health);

@@ -461,6 +503,14 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
//==============================================================

//--------------------------------------------------------------
+ entity(vector org, vector ang, float sflags, float yaw, float angry)
+ spawn_monster_wizard =
+ {
+ return spawn_base_monster (org, ang, sflags, yaw, angry,
+ monster_wizard_init);
+ };
+
+ //--------------------------------------------------------------
void(entity e) monster_wizard_init =
{
if (e.spawnflags & I_AM_TURRET)
@@ -513,17 +563,17 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by

e.checkattack = monster_wizard_checkattack;
e.sightsound = monster_wizard_sightsound;
- e.think_stand = wiz_stand1;
- e.think_walk = wiz_walk1;
- e.think_run = wiz_run1;
- e.think_missile = wiz_fast1;
+ e.th_stand = wiz_stand1;
+ e.th_walk = wiz_walk1;
+ e.th_run = wiz_run1;
+ e.th_missile = wiz_fast1;
// Berserk test from
// http://celephais.net/board/view_thread.php?id=4&start=3465
// -- dumptruck_ds
if !(e.berserk)
- e.pain = monster_wizard_pain;
+ e.th_pain = monster_wizard_pain;
else
- e.pain = sub_nullpain;
+ e.th_pain = sub_nullpain;
e.destroy = monster_wizard_destroy;

// flymonster_starts
@@ -604,23 +654,29 @@ model ("progs/h_wizard.mdl");
model ({"path":"progs/wizard.mdl","frame":53});
}
*/
-void() monster_dead_wizard =
-{
- // new spawnflags for all entities -- iw
- if (SUB_Inhibit())
- return;
+//----------------------------------------------------------------------
+// class monster_dead_wizard: base_corpse
+// {
+ //--------------------------------------------------------------
+ void(entity e) monster_dead_wizard_init =
+ {
+ base_corpse_init (e);

- precache_model ("progs/wizard.mdl");
- setmodel (self, "progs/wizard.mdl");
- self.frame = $death8;
+ precache_model ("progs/wizard.mdl");
+ setmodel (e, "progs/wizard.mdl");
+ e.frame = $death8;

- if (self.spawnflags & 1)
- {
- self.solid = SOLID_BBOX;
- setsize (self,'-50.75 -27.46 -55.19','31.81 33.61 30');
- }
- else
+ if (e.solid == SOLID_BBOX)
+ setsize (e, WIZARD_CORPSE_MINS, WIZARD_CORPSE_MAXS);
+ };
+
+ //--------------------------------------------------------------
+ void() monster_dead_wizard =
{
- self.solid = SOLID_NOT;
- }
-};
+ // new spawnflags for all entities -- iw
+ if (SUB_Inhibit())
+ return;
+
+ monster_dead_wizard_init (self);
+ };
+// };

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

Diff qc/monsters/zombie.qc

diff --git a/qc/monsters/zombie.qc b/qc/monsters/zombie.qc
index f0af859..e53e337 100644
--- a/qc/monsters/zombie.qc
+++ b/qc/monsters/zombie.qc
@@ -107,6 +107,8 @@ void(vector dir) monster_zombie_destroy;
void() monster_zombie_use;
void() monster_zombie_decide; // initialization
void() monster_zombie_start;
+entity(vector org, vector ang, float sflags, float yaw, float angry)
+ spawn_monster_zombie;
void(entity e) monster_zombie_init;
void() monster_zombie;

@@ -240,7 +242,7 @@ spawnflags(Flags) =
void() monster_zombie_sightsound =
{
sound_sight (self, CHAN_VOICE, "zombie/z_idle.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
@@ -288,7 +290,7 @@ spawnflags(Flags) =
{
if (random() < 0.1)
sound_idle (self, CHAN_VOICE, "zombie/idle_w2.wav",
- 1, ATTN_STATIC);
+ VOL_HIGH, ATTN_STATIC);
};
void() zom_cruc2 = [$cruc_2, zom_cruc3]
{
@@ -383,7 +385,7 @@ spawnflags(Flags) =
ai_walk (0);
if (random() < 0.2)
sound_misc (self, CHAN_VOICE, "zombie/z_idle.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);
};

//--------------------------------------------------------------
@@ -424,10 +426,10 @@ spawnflags(Flags) =
ai_run (8);
if (random() < 0.2)
sound_misc (self, CHAN_VOICE, "zombie/z_idle.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);
if (random() > 0.8)
sound_sight (self, CHAN_VOICE, "zombie/z_idle1.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);
};

//--------------------------------------------------------------
@@ -650,7 +652,7 @@ spawnflags(Flags) =
void() zom_paina1 = [$paina1, zom_paina2]
{
sound_pain (self, CHAN_VOICE, "zombie/z_pain.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};
void() zom_paina2 = [$paina2, zom_paina3] { ai_painforward (3); };
void() zom_paina3 = [$paina3, zom_paina4] { ai_painforward (1); };
@@ -670,7 +672,7 @@ spawnflags(Flags) =
void() zom_painb1 = [$painb1, zom_painb2]
{
sound_misc2 (self, CHAN_VOICE, "zombie/z_pain1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};
void() zom_painb2 = [$painb2, zom_painb3] { ai_pain (2); };
void() zom_painb3 = [$painb3, zom_painb4] { ai_pain (8); };
@@ -682,7 +684,7 @@ spawnflags(Flags) =
void() zom_painb9 = [$painb9, zom_painb10]
{
sound_misc3 (self, CHAN_BODY, "zombie/z_fall.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};
void() zom_painb10 = [$painb10, zom_painb11] { };
void() zom_painb11 = [$painb11, zom_painb12] { };
@@ -710,7 +712,7 @@ spawnflags(Flags) =
void() zom_painc1 = [$painc1, zom_painc2]
{
sound_misc2 (self, CHAN_VOICE, "zombie/z_pain1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};
void() zom_painc2 = [$painc2, zom_painc3] { };
void() zom_painc3 = [$painc3, zom_painc4] { ai_pain (3); };
@@ -736,7 +738,7 @@ spawnflags(Flags) =
void() zom_paind1 = [$paind1, zom_paind2]
{
sound_pain (self, CHAN_VOICE, "zombie/z_pain.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
};
void() zom_paind2 = [$paind2, zom_paind3] { };
void() zom_paind3 = [$paind3, zom_paind4] { };
@@ -763,7 +765,7 @@ spawnflags(Flags) =
return;
}
sound_pain (self, CHAN_VOICE, "zombie/z_pain.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
self.health = 60;
};
void() zom_paine2 = [$paine2, zom_paine3] { ai_pain (8); };
@@ -777,7 +779,7 @@ spawnflags(Flags) =
void() zom_paine10 = [$paine10, zom_paine11]
{
sound_misc3 (self, CHAN_BODY, "zombie/z_fall.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
self.solid = SOLID_NOT;
};
void() zom_paine11 = [$paine11, zom_paine12]
@@ -790,7 +792,7 @@ spawnflags(Flags) =
// see if ok to stand up
self.health = 60;
sound_misc (self, CHAN_VOICE, "zombie/z_idle.wav",
- 1, ATTN_IDLE);
+ VOL_HIGH, ATTN_IDLE);
self.solid = SOLID_SLIDEBOX;
if (!walkmove(0, 0))
{
@@ -925,7 +927,7 @@ spawnflags(Flags) =
void(vector dir) monster_zombie_destroy =
{
sound_death (self, CHAN_VOICE, "zombie/z_gib.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

throw_gib_head_zombie (self, dir, self.health);
throw_gib_1 (self, dir, self.health);
@@ -952,6 +954,14 @@ spawnflags(Flags) =
//==============================================================

//--------------------------------------------------------------
+ entity(vector org, vector ang, float sflags, float yaw, float angry)
+ spawn_monster_zombie =
+ {
+ return spawn_base_monster (org, ang, sflags, yaw, angry,
+ monster_zombie_init);
+ };
+
+ //--------------------------------------------------------------
// stand up if orig. lying down, else just start running
//--------------------------------------------------------------
void() monster_zombie_decide =
@@ -961,12 +971,12 @@ spawnflags(Flags) =
else
zom_run1 ();

- self.think_run = zom_run1;
+ self.th_run = zom_run1;
};

//--------------------------------------------------------------
// determine if zombie is to be lying down, or standing
- // shims think_stand -- CEV
+ // shims th_stand -- CEV
//--------------------------------------------------------------
void() monster_zombie_start =
{
@@ -994,7 +1004,7 @@ spawnflags(Flags) =
zom_alt_stand1 ();
}

- self.think_stand = zom_alt_stand1;
+ self.th_stand = zom_alt_stand1;
};

//--------------------------------------------------------------
@@ -1033,18 +1043,18 @@ spawnflags(Flags) =
precache_gib2 (e, "progs/gib2.mdl");
precache_gib3 (e, "progs/gib3.mdl");

- e.think_stand = monster_zombie_start;
- e.think_walk = zom_walk1;
+ e.th_stand = monster_zombie_start;
+ e.th_walk = zom_walk1;
if (e.spawnflags & I_AM_TURRET)
- e.think_run = zom_alt_seek1;
+ e.th_run = zom_alt_seek1;
else
- e.think_run = monster_zombie_decide;
+ e.th_run = monster_zombie_decide;

e.sightsound = monster_zombie_sightsound;
- e.pain = monster_zombie_pain;
+ e.th_pain = monster_zombie_pain;
e.destroy = monster_zombie_destroy;
- e.think_turret = monster_zombie_attack_turretmissile;
- e.think_missile = monster_zombie_attack_missile;
+ e.th_turret = monster_zombie_attack_turretmissile;
+ e.th_missile = monster_zombie_attack_missile;
e.solid = SOLID_SLIDEBOX;
e.movetype = MOVETYPE_STEP;

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

Diff qc/newflags.qc

diff --git a/qc/newflags.qc b/qc/newflags.qc
index 01c60fa..385c608 100644
--- a/qc/newflags.qc
+++ b/qc/newflags.qc
@@ -57,7 +57,7 @@ affecting the other.
// constants
//======================================================================

-// The new spawnflags. (16384 is already used elsewhere.)
+// The new spawnflags. (16384 is already used elsewhere.)
const float SPAWNFLAG_NOT_IN_COOP = 4096; // Not in Coop
const float SPAWNFLAG_NOT_IN_SP = 8192; // Not in Single Player
const float SPAWNFLAG_NOT_ON_SKILL2 = 32768; // Not on Hard Only
@@ -67,24 +67,29 @@ const float SPAWNFLAG_NOT_ON_SKILL3 = 65536; // Not on Nightmare Only
// globals
//======================================================================

+#ifdef SSQC
float total_not_in_coop; // the number of entities inhibited by
float total_not_in_sp; // each of the new spawnflags
float total_not_on_skill2;
float total_not_on_skill3;

float done_inhibition_summary; // TRUE if developer summary has been printed
+#endif

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

+#ifdef SSQC
void() InitNewSpawnflags;
float() SUB_Inhibit;
void(float total, string spawnflag_name) PrintInhibitionTotal;
void() PrintInhibitionSummary;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// InitNewSpawnflags
//
@@ -205,3 +210,4 @@ void() PrintInhibitionSummary =

done_inhibition_summary = TRUE;
};
+#endif

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

Diff qc/obituary.qc

diff --git a/qc/obituary.qc b/qc/obituary.qc
index cbd8ce2..ec1a6f6 100644
--- a/qc/obituary.qc
+++ b/qc/obituary.qc
@@ -6,17 +6,22 @@
// fields
//======================================================================

+#ifdef SSQC
.string obit_name; // dumptruck_ds misc pd additions
.string obit_method; // dumptruck_ds misc pd additions
+#endif

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

+#ifdef SSQC
void(entity targ, entity inflictor, entity attacker) ClientObituary;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// ClientObituary -- called when a player dies
//----------------------------------------------------------------------
@@ -351,3 +356,4 @@ void(entity targ, entity inflictor, entity attacker) ClientObituary =
bprint (" died\n");
}
};
+#endif

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

Diff qc/pmove.qc

diff --git a/qc/pmove.qc b/qc/pmove.qc
index c805085..960d13a 100644
--- a/qc/pmove.qc
+++ b/qc/pmove.qc
@@ -2,9 +2,6 @@
// PMOVE
//==============================================================================

-// TODO CEV: crouching
-// TODO CEV: crouch sliding (useful for sliding up stairs)
-// TODO CEV: crouch-wall-thing (wallrunning? wall sliding?)
// TODO CEV: improved player unstick function
// TODO CEV: varied sounds (different jump sounds)

@@ -12,45 +9,51 @@
// globals
//======================================================================

+#if defined(CSQC) || defined (SSQC)
// the following are all managed by FTEQW -- CEV
float input_buttons; // buttons pressed by the client
// float input_impulse;
float input_timelength; // frame / tic time
vector input_angles; // +x = DOWN
vector input_movevalues; // movement requested by client
+#endif

//======================================================================
// fields
//======================================================================

+#if defined(CSQC) || defined (SSQC)
// note: timers are expensive, require synch between server and client -- CEV
// .entity groundentity; // already defined in entvars_t
.vector groundnormal;
.float pmove_flags; // custom movement flags -- CEV
+.float crouchslide_timer; // crouchslide countdown timer
.float doublejump_timer; // time in which a player can doublejump
.void() customphysics;
+#endif

//======================================================================
// pmove constants (could be reworked as cvars, would add overhead) -- CEV
//======================================================================

+#if defined(CSQC) || defined (SSQC)
// acceleration & friction
-const float PM_AIRACCEL = 6.0f; // 10 in Q1; now 7.5 or 8.0
-const float PM_AIRACCELQ3 = 0.8f; // 1.0 in Q3 ?; now 0.75 or 0.8
+const float PM_AIRACCEL = 8.0f; // 10 in Q1; halved on acceleration
+const float PM_AIRACCELQ3 = 0.9f; // 1.0 in Q3 ?; now 0.75 or 0.8
const float PM_AIRACCELFWD = 0.8f; // 1 feels close to Q3 / CPM
const float PM_AIRACCELBACK = 5.0f; // Air stop speed in Q3? 5.0f?
const float PM_AIRACCELBASE = 32.0f; // PM_MAXSPEED / 10.0
const float PM_AIRACCELTURN = 250.0f; // affects +fwd turning radius; 150.0f
-const float PM_BOOSTACCEL = 10.0f; // ground boost accel; 10; 10 + 1.25
-const float PM_BOOSTFRICTION = 1.0f; // ground boost friction; 4 is Q1
const float PM_GROUNDACCEL = 10.0f; // 10 is Q1, 15 is CPM
const float PM_GROUNDFRICTION = 6.0f; // 4 for Q1, 6 for Q3, 8 for (old?) CPM
const vector PM_GROUNDDIST_V = '0 0 1'; // distance for ground check
+const float PM_SLIDEACCEL = 1.01f; // crouchslide accel; 10; 8? 4?
+const float PM_SLIDEFRICTION = 0.01f; // crouchslide friction; 1.0?
const float PM_WATERACCEL = 10.0f; // water acceleration
const float PM_WATERFRICTION = 4.0f; // friction in water

// horizontal speeds (mostly)
-const float PM_BOOSTWISHSPEED = 400.0f; // 320, 400
+const float PM_BOOSTWISHSPEED = 380.0f; // 320, 400
const float PM_CROUCHSPEED = 120.0f; // ???
const float PM_MAXSPEED = 320.0f; // 320 always
const float PM_MAXAIRSPEED = 30.0f; // 30 for Q1 air control
@@ -76,6 +79,7 @@ const float PM_WALLJUMPSPEED = 270.0f; // same as JUMPSPEED
const float PM_WALLJUMPDOUBLE = 360.0f; // same as STAIRJUMPSPEED

// timing
+const float PM_CROUCHSLIDE_TIME = 1.0f; // crouchslide total duration
const float PM_DOUBLEJUMP_WINDOW = 0.4f;// 2 jumps in this time is a double
const float PM_TELEJUMP_WINDOW = 0.4f; // duration to perform a telejump
const float PM_WALLJUMP_WINDOW = 0.3f; // dj timer < this to walljump
@@ -97,12 +101,17 @@ const float WATERLEVEL_EYES = 3;
// Player Sizes
const vector PM_STAND_MIN = VEC_HULL_MIN;
const vector PM_STAND_MAX = VEC_HULL_MAX;
-const vector PM_CROUCH_MIN = '-16 -16 -18';
-const vector PM_CROUCH_MAX = '16 16 18';
+const vector PM_CROUCH_MIN = '-16 -16 -24';
+const vector PM_CROUCH_MAX = '16 16 16'; // Q3 crouch MAX_z is 16 -- CEV
+
+// Player View Offset
+// Q1 ranger's view offset is lower than Q3; is Q1 ranger canonically shorter?
+const vector PM_STAND_VIEWOFS = '0 0 22'; // Q3 default 0 0 26 -- CEV
+const vector PM_CROUCH_VIEWOFS = '0 0 8'; // Q3 crouch 0 0 12 -- CEV

// pmove_flags is used by the engine; FTE defines two constants:
// PMF_JUMP_HELD = 1, PMF_LADDER = 2. So those two constants should
-// to be first (and in that order) in our enum below. -- CEV
+// be first (and in that order) in our enum below. -- CEV
enumflags
{
PMF_JUMP_HELD, // player is holding the jump key
@@ -111,6 +120,7 @@ enumflags
PMF_STARTGROUND, // entity started the move on ground
PMF_CROUCH_HELD, // player is holding the crouch key
PMF_CROUCHED, // entity is crouching
+ PMF_CROUCHSLIDE, // entity is crouch sliding
PMF_DOUBLEJUMPED, // entity has doublejumped
PMF_WALLJUMPED, // entity has walljumped
PMF_WATERJUMPED, // entity has waterjumped
@@ -119,15 +129,20 @@ enumflags
PMF_SLIDE_SKIM, // slidemove hint to skim/wallclip
PMF_SLIDE_STEP, // slidemove hint to traverse steps
PMF_SLIDE_STICKY, // slidemove hint to stick to ground
- PMF_AIRSTEPPED // we've airstepped
+ PMF_AIRSTEPPED, // entity has airstepped
+ PMF_PUSHED // entity moved by a trigger_push
};
+#endif

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

+#ifdef SSQC
float(float maxspeed, float a, float c, float t) PM_MaxCircleGroundSpeed;
+#endif

+#if defined(CSQC) || defined (SSQC)
static void(entity ent) PM_DoTouch;
float() PM_Nudge;
void() PM_DanceMove;
@@ -139,16 +154,22 @@ void(vector wishdir, float wishspeed, float accel, float move_time)
void(vector wishvel, float wishspeed, float accel, float move_time)
PM_AirAccelerate;
void(vector wishdir, float wishspeed, float move_time) PM_AirControl;
+void() PM_CrouchStart;
+void() PM_CrouchStop;
+void() PM_CrouchSlideStart;
+void() PM_CrouchSlideStop;
void(vector wishdir) PM_Jump;
void() PM_WallJump;
void(vector wishvel, float move_time) PM_WalkAccelerate;
void(vector wishvel, float move_time) PM_SwimAccelerate;
void(vector wishvel, float scale, float move_time) PM_NoClipAccelerate;
void(float move_time) PM_ManageTimers;
-void(entity target) PM_Move;
+void(entity e) PM_Move;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// PM_MaxCircleGroundSpeed
//
@@ -156,7 +177,7 @@ void(entity target) PM_Move;
// 320 * math.sqrt((A * (2 - A * (1 / T))) / (c * (2 - c * (1 / T))))
// where A = accel (10.0), c = friction (4.0), T = framerate (q3 125, q1 77?)
// this equation is from the article "Circle-Jump Theory" by injx, found here:
-// https://www.artifexquake.com/?page_id=184
+// https://github.com/5xp/strafe-theory
//
// Max ground speed for accel 10, friction 6, T 125, w 320 (vq3) is ~409
// Max ground speed for accel 15, friction 6, T 125, w 320 (CPM) is ~497
@@ -168,7 +189,9 @@ float(float maxspeed, float a, float f, float t) PM_MaxCircleGroundSpeed =
return maxspeed * sqrt ((a * (2.0 - a * (1.0 / t))) /
(f * (2.0 - f * (1.0 / t))));
};
+#endif

+#if defined(CSQC) || defined (SSQC)
//----------------------------------------------------------------------
// PM_DoTouch
//----------------------------------------------------------------------
@@ -194,7 +217,12 @@ static void(entity ent) PM_DoTouch =
//----------------------------------------------------------------------
float() PM_Nudge =
{
- dprint ("PM_Nudge: starting function...\n");
+ #if defined(CSQC)
+ dprint ("PM_Nudge: client player attempting to nudge out of a ");
+ #elif defined(SSQC)
+ dprint ("PM_Nudge: server player attempting to nudge out of a ");
+ #endif
+ dprint (sprintf("%s!\n", trace_ent.classname));

vector test, org = self.origin;

@@ -297,34 +325,31 @@ void() PM_DanceMove =

if (trace_allsolid || trace_startsolid)
{
- if (trace_ent.classgroup & CG_PROJECTILE)
+ #ifdef CSQC
+ if (trace_ent.velocity)
{
- // self is in a projectile; call its touch
- // function (maybe it'll explode)
- /*
- #ifdef SSQC
- dprint (sprintf("PM_DanceMove: in a solid %s\n",
- trace_ent.classname));
- #endif
- PM_DoTouch (trace_ent);
- */
- continue;
+ self.velocity += trace_ent.velocity;
+ }
+ else
+ {
+ if (PM_Nudge())
+ continue;
}
+ #endif

+ #ifdef SSQC
// self is in something else; attempt to nudge out
if (PM_Nudge())
continue;
+ else
+ setorigin (self, self.oldorigin);

// nah, we're stuck. don't build up falling damage
// but allow sideways acceleration -- CEV
- #if defined(CSQC)
- dprint ("PM_DanceMove: client player entity stuck ");
- #elif defined(SSQC)
- dprint ("PM_DanceMove: server player entity stuck ");
- #endif
- dprint (sprintf("in a %s!\n", trace_ent.classname));
+ dprint ("PM_DanceMove: server player entity stuck!\n");
self.velocity_z = 0;
break;
+ #endif
}

// accept the move -- CEV
@@ -334,8 +359,8 @@ void() PM_DanceMove =
// no obstructions, made the whole move -- CEV
break;

- // zero out stepsize, then store the plane normal and touched
- // ent for later, then reduce time_left -- CEV
+ // zero out stepsize, then save the touched ent for later,
+ // then reduce time_left -- CEV
stepsize = 0;
touched_ent = trace_ent;
time_left -= time_left * trace_fraction;
@@ -378,20 +403,12 @@ void() PM_DanceMove =
tracebox (trace_endpos, self.mins, self.maxs, end,
FALSE, self);

- #ifdef SSQC
- if (trace_allsolid || trace_startsolid)
- // caution
- dprint ("PM_DanceMove: fwd move solid\n");
- #endif
-
if (trace_fraction >= 1.0f)
{
// forward move didn't hit anything
// third: move down
end = trace_endpos;
end_z -= stepsize;
- // + (self.pmove_flags &
- // PMF_SLIDE_STICKY ? 16 : 1);
tracebox (trace_endpos, self.mins, self.maxs,
end, FALSE, self);

@@ -413,6 +430,13 @@ void() PM_DanceMove =
time_left = f - (f * trace_fraction);
stepsize = trace_endpos_z -
self.origin_z;
+ /*
+ #ifdef CSQC
+ // save off stepsize for view smoothing
+ if (self.entnum == player_localentnum)
+ pmove_step = stepsize;
+ #endif
+ */
self.origin = trace_endpos;

if (new_vel != self.velocity)
@@ -458,22 +482,25 @@ void() PM_DanceMove =
// do the ground check before we might stop the loop -- CEV
if (trace_plane_normal_z > 0.7)
{
- if (touched_ent.solid == SOLID_BSP)
+ if (self.groundentity != touched_ent)
{
self.groundentity = touched_ent;
- self.groundnormal = trace_plane_normal;
- self.flags |= FL_ONGROUND;
- self.pmove_flags |= PMF_ONGROUND;
#ifdef SSQC
// before clipping velocity - CEV
self.jump_flag = self.velocity_z;
#endif
}
+ self.groundnormal = trace_plane_normal;
+ self.flags |= FL_ONGROUND;
+ self.pmove_flags |= PMF_ONGROUND;
}
else
{
- self.groundentity = __NULL__;
- self.groundnormal = __NULL__;
+ if (self.groundentity != __NULL__)
+ {
+ self.groundentity = __NULL__;
+ self.groundnormal = __NULL__;
+ }
self.flags &= ~FL_ONGROUND;
self.pmove_flags &= ~PMF_ONGROUND;
}
@@ -541,6 +568,55 @@ void() PM_DanceMove =
}
}

+ // Duplicating the block above here but checking prev_plane2
+ // instead of prev_plane. This rarely executes but if we're
+ // storing two previous planes we might as well check both.
+ // Again this is inlined instead of broken out into multiple
+ // functions in the hope that it'll run faster that way -- CEV
+ if (prev_plane2 && prev_plane2 != trace_plane_normal &&
+ self.velocity * prev_plane2 < 0)
+ {
+ #ifdef SSQC
+ dprint ("PM_DanceMove: interacts with prev_plane2\n");
+ #endif
+ f = self.velocity * prev_plane2;
+
+ if (f < 0)
+ f *= PM_OVERCLIP;
+ else
+ if (prev_plane2_z > 0.7)
+ if (self.pmove_flags & PMF_SLIDE_STICKY)
+ f /= PM_OVERCLIP;
+ else
+ f *= PM_ONESIDEDCLIP;
+ else
+ f /= PM_OVERCLIP;
+
+ self.velocity -= prev_plane2 * f;
+
+ if (self.velocity * trace_plane_normal < 0)
+ {
+ end = crossproduct (prev_plane2,
+ trace_plane_normal);
+ end = normalize (end);
+ self.velocity = end * (end * self.velocity);
+ }
+
+ if (prev_plane && prev_plane != trace_plane_normal &&
+ prev_plane2 != prev_plane &&
+ self.velocity * prev_plane < 0)
+ {
+ // Stop if we interact with three planes -- CEV
+ #ifdef SSQC
+ dprint ("PM_DanceMove: triple plane stop 2\n");
+ #endif
+ self.velocity = '0 0 0';
+ PM_DoTouch (touched_ent);
+
+ break;
+ }
+ }
+
// an optimization from Quake 1; is this necessary? -- CEV
if (self.velocity * start_vel <= 0)
{
@@ -602,23 +678,46 @@ void() PM_DanceMove =
self.velocity_z -= grav * 0.5;

// if stepsize is nonzero and we changed from inair to onground then
- // we've airstepped. flag for later (see player_footsteps) -- CEV
- #ifdef SSQC
+ // we've airstepped. -- CEV
if (stepsize > 0 && !(self.pmove_flags & PMF_STARTGROUND) &&
self.pmove_flags & PMF_ONGROUND)
{
- // more debugging -- CEV
- // dprint (sprintf("PM_DanceMove: airstep: %g\n", stepsize));
- self.step_time = time;
+ // improve stairjumps by mercilessly gluing the player to
+ // the floor when their z vel is positive, the jump timer
+ // isn't running, the ground is flat horizontal, and we
+ // weren't recently pushed -- CEV
+ if (self.velocity_z > 0 && self.doublejump_timer == 0 &&
+ self.groundnormal_z == 1 &&
+ !(self.pmove_flags & PMF_PUSHED) &&
+ !(self.pmove_flags & PMF_WATERJUMPED))
+ {
+ self.velocity_z = 0;
+ }
+
+ #ifdef SSQC
+ // flag to be handled later (see player_postthink) -- CEV
self.pmove_flags |= PMF_AIRSTEPPED;
+ #endif
}
+
+ /*
+ #ifdef CSQC
+ // prepare step smoothing; inspired by Quake 3 cg_event.c -- CEV
+ if (stepsize > 0 && self.entnum == player_localentnum)
+ if (player_steptime - time <= 0)
+ pmove_step = stepsize;
#endif
+ */

// clear slide hint flags -- CEV
self.pmove_flags = self.pmove_flags - (self.pmove_flags &
(PMF_SLIDE_GRAVITY | PMF_SLIDE_SKIM | PMF_SLIDE_STEP |
PMF_SLIDE_STICKY));

+ // clear push brush flag -- CEV
+ if (self.groundentity && self.pmove_flags & PMF_PUSHED)
+ self.pmove_flags &= ~PMF_PUSHED;
+
// a final call to setorigin to update links -- CEV
setorigin (self, self.origin);
};
@@ -972,18 +1071,22 @@ void(float dogravity, float sticky, float dostep, float doskim) PM_DanceMoveQ3 =
//----------------------------------------------------------------------
void() PM_CategorizePosition =
{
- vector point;
- float contents;
-
if (self.movetype == MOVETYPE_NOCLIP || self.movetype == MOVETYPE_FLY)
{
// noclip is never on ground
- self.groundentity = __NULL__;
+ if (self.groundentity != __NULL__)
+ self.groundentity = __NULL__;
self.groundnormal = __NULL__;
- self.pmove_flags &= ~PMF_DOUBLEJUMPED;
- self.pmove_flags &= ~PMF_WALLJUMPED;
- self.pmove_flags &= ~PMF_ONGROUND;
- self.flags &= ~FL_ONGROUND;
+ if (self.pmove_flags & PMF_DOUBLEJUMPED)
+ self.pmove_flags &= ~PMF_DOUBLEJUMPED;
+ if (self.pmove_flags & PMF_WALLJUMPED)
+ self.pmove_flags &= ~PMF_WALLJUMPED;
+ if (self.pmove_flags & PMF_ONGROUND)
+ self.pmove_flags &= ~PMF_ONGROUND;
+ if (self.flags & FL_ONGROUND)
+ self.flags &= ~FL_ONGROUND;
+ if (self.pmove_flags & PMF_PUSHED)
+ self.pmove_flags &= ~PMF_PUSHED;
}
else
{
@@ -993,56 +1096,80 @@ void() PM_CategorizePosition =
// do a trace to check for ground
tracebox (self.origin, self.mins, self.maxs,
self.origin - PM_GROUNDDIST_V, FALSE, self);
+
// only onground if we hit it & it faces upwards
if (trace_fraction < 1.0f && trace_plane_normal_z > 0.7f)
{
// on ground
- self.groundentity = trace_ent;
+ if (!(self.pmove_flags & PMF_ONGROUND) &&
+ self.pmove_flags & PMF_CROUCH_HELD &&
+ !(self.pmove_flags & PMF_CROUCHSLIDE) &&
+ self.velocity * trace_plane_normal < 0 &&
+ self.speed > PM_MAXSPEED)
+ {
+ // start crouchsliding if: we just landed,
+ // we're holding crouch, we aren't already
+ // sliding, we hit the ground with some force,
+ // and we're going faster than run speed -- CEV
+ PM_CrouchSlideStart ();
+ }
+
+ if (self.groundentity != trace_ent)
+ {
+ #ifdef SSQC
+ if (self.groundentity == __NULL__)
+ self.jump_flag = self.velocity_z;
+ #endif
+ self.groundentity = trace_ent;
+ }
+
self.groundnormal = trace_plane_normal;
- self.flags |= FL_ONGROUND;
- self.pmove_flags |= PMF_ONGROUND;
- self.pmove_flags &= ~PMF_WALLJUMPED;
+
+ if (!(self.flags & FL_ONGROUND))
+ self.flags |= FL_ONGROUND;
+ if (!(self.pmove_flags & PMF_ONGROUND))
+ self.pmove_flags |= PMF_ONGROUND;
+
+ // TODO CEV
+ // for MOVETYPE_PUSH entities
+ #if 0
+ if (trace_ent.velocity_z > 0)
+ self.velocity_z += trace_ent.velocity_z;
+ #endif
+
+ if (self.pmove_flags & PMF_WALLJUMPED)
+ self.pmove_flags &= ~PMF_WALLJUMPED;
+
+ if (self.pmove_flags & PMF_PUSHED)
+ self.pmove_flags &= ~PMF_PUSHED;
}
else
{
// not on ground
- self.groundentity = __NULL__;
+ if (self.groundentity != __NULL__)
+ self.groundentity = __NULL__;
self.groundnormal = __NULL__;
- self.flags &= ~FL_ONGROUND;
- self.pmove_flags &= ~PMF_ONGROUND;
+ if (self.flags & FL_ONGROUND)
+ self.flags &= ~FL_ONGROUND;
+ if (self.pmove_flags & PMF_ONGROUND)
+ self.pmove_flags &= ~PMF_ONGROUND;
}
}

- // check water levels
- point = self.origin;
- point_z = self.origin_z + self.mins_z + 1;
- contents = pointcontents (point);
- if (contents < CONTENT_SOLID)
- {
- self.watertype = contents;
- point_z = self.origin_z + (self.mins_z + self.maxs_z) * 0.5;
- if (pointcontents(point) < CONTENT_SOLID)
- {
- point_z = self.origin_z + self.maxs_z;
- if (pointcontents(point) < CONTENT_SOLID)
- self.waterlevel = WATERLEVEL_EYES;
- else
- self.waterlevel = WATERLEVEL_WAIST;
- }
- else
- {
- self.waterlevel = WATERLEVEL_FEET;
- }
- }
- else
+ // set waterlevel and watertype -- CEV
+ base_entity_positioncontents (self);
+
+ // don't crouchslide in water -- CEV
+ if (self.pmove_flags & PMF_CROUCHSLIDE &&
+ self.conlevel > WATERLEVEL_NONE)
{
- self.watertype = CONTENT_EMPTY;
- self.waterlevel = WATERLEVEL_NONE;
+ // self.crouchslide_timer = 0;
+ self.pmove_flags &= ~PMF_CROUCHSLIDE;
}

// can't be waterjumping if we're on ground
if (self.pmove_flags & PMF_WATERJUMPED &&
- (self.waterlevel == WATERLEVEL_NONE ||
+ (self.conlevel == WATERLEVEL_NONE ||
self.pmove_flags & PMF_ONGROUND))
{
#ifdef SSQC
@@ -1157,6 +1284,100 @@ void(vector wishdir, float wishspeed, float move_time) PM_AirControl =
};

//----------------------------------------------------------------------
+void() PM_CrouchStart =
+{
+ // crouch
+ self.pmove_flags |= PMF_CROUCHED;
+ // self.pmove_flags |= PMF_CROUCH_HELD;
+ setsize (self, PM_CROUCH_MIN, PM_CROUCH_MAX);
+ self.view_ofs = PM_CROUCH_VIEWOFS;
+
+ #ifdef CSQC
+ // TODO CEV
+ /*
+ if (self.entnum == player_localentnum)
+ {
+ view_step_oldz = self.origin_z +
+ (PM_STAND_VIEWOFS_z - PM_CROUCH_VIEWOFS_z);
+ view_step_time = time - 1;
+ }
+ */
+ #endif
+
+ #if 0
+ self.SendFlags |= PLAYER_NET_SIZE | PLAYER_NET_FLAGS;
+ #endif
+};
+
+//----------------------------------------------------------------------
+void() PM_CrouchStop =
+{
+ // uncrouch if we're clear to stand
+ tracebox (self.origin, PM_STAND_MIN, PM_STAND_MAX, self.origin,
+ FALSE, self);
+ if (!trace_startsolid && !trace_allsolid)
+ {
+ self.pmove_flags &= ~PMF_CROUCHED;
+ setsize (self, PM_STAND_MIN, PM_STAND_MAX);
+ self.view_ofs = PM_STAND_VIEWOFS;
+
+ #ifdef CSQC
+ // TODO CEV
+ /*
+ if (self.entnum == player_localentnum)
+ {
+ view_step_oldz = self.origin_z +
+ (PM_CROUCH_VIEWOFS_z - PM_STAND_VIEWOFS_z);
+ view_step_time = time - 1;
+ }
+ */
+ #endif
+
+ #if 0
+ self.SendFlags |= PLAYER_NET_SIZE | PLAYER_NET_FLAGS;
+ #endif
+ }
+};
+
+//----------------------------------------------------------------------
+// PM_CrouchSlideStart
+// Crouchslide behaviour is based on Rapha's Quake Champions movement
+// tutorial found here: https://www.youtube.com/watch?v=95spyl1LRTc&t=1623s
+// because I've never played QC (or Q4). Please note that it doesn't
+// work exactly as described in that video. -- CEV
+//----------------------------------------------------------------------
+void() PM_CrouchSlideStart =
+{
+ if (self.crouchslide_timer <= 0)
+ {
+ #ifdef SSQC
+ sound (self, CHAN_AUTO, "player/slidestart.ogg",
+ 0.4, ATTN_FEET);
+ sound (self, CHAN_SLIDE, "player/slide.ogg",
+ 0.2, ATTN_FEET);
+ #endif
+ self.crouchslide_timer = PM_CROUCHSLIDE_TIME;
+ }
+
+ #ifdef SSQC
+ dprint (sprintf("PM_CrouchSlideStart: lesgo %g\n", self.velocity_z));
+ #endif
+
+ self.pmove_flags |= PMF_CROUCHSLIDE;
+};
+
+//----------------------------------------------------------------------
+// PM_CrouchSlideStop
+//----------------------------------------------------------------------
+void() PM_CrouchSlideStop =
+{
+ #ifdef SSQC
+ sound (self, CHAN_SLIDE, "misc/null.wav", 0.4, ATTN_FEET);
+ #endif
+ self.pmove_flags &= ~PMF_CROUCHSLIDE;
+};
+
+//----------------------------------------------------------------------
// PM_Jump
//----------------------------------------------------------------------
void(vector wishdir) PM_Jump =
@@ -1167,16 +1388,14 @@ void(vector wishdir) PM_Jump =
return;

#ifdef SSQC
- local string msg = "";
+ local string wav = "";
+ local float vol = 0;
#endif

// make sure we get at least jumpspeed upwards from
// the ground plane by clamping it first.
if (self.groundnormal && (self.velocity * self.groundnormal < 0))
{
- // #ifdef SSQC
- // dprint("PM_Jump: clamping to ground\n");
- // #endif
self.velocity -= self.groundnormal *
(self.velocity * self.groundnormal);
}
@@ -1191,39 +1410,28 @@ void(vector wishdir) PM_Jump =
// it may be useful in the future (for a tricks mode, etc)
// to distinguish between different jump types -- CEV
if (self.teleport_time > time - (PM_TELEJUMP_WINDOW + 0.2))
- {
// a teleport jump: allow a larger (+0.2) window to
// account for time to travel thru teleporter -- CEV
- #ifdef SSQC
- msg = sprintf ("PM_Jump: telejump %g, ",
- self.velocity_z);
- #endif
// non-additive jump, though it shouldn't matter -- CEV
self.velocity_z = PM_TELEJUMPSPEED;
- }
else if (self.groundnormal && self.groundnormal_z == 1)
- {
- #ifdef SSQC
- msg = sprintf ("PM_Jump: stairjump %g, ",
- self.velocity_z);
- #endif
// don't do additive stairjumps on flat ground -- CEV
self.velocity_z = PM_STAIRJUMPSPEED;
- }
else
- {
- #ifdef SSQC
- msg = sprintf ("PM_Jump: doublejump %g, ",
- self.velocity_z);
- #endif
// the groundnormal might be weird - some kind of
// ramp - so we want an additive doublejump here -- CEV
self.velocity_z += PM_DOUBLEJUMPSPEED;
- }
+
+ #ifdef SSQC
+ vol = 0.9;
+ wav = "player/plyrjmp8.wav";
+ #endif

// set the doublejump flag -- CEV
self.pmove_flags |= PMF_DOUBLEJUMPED;
}
+ // Commented out for now -- TODO CEV
+ /*
else if (input_movevalues_y && input_movevalues_x == 0 &&
vlen (self.velocity) <= PM_SHORTJUMPTHRESH)
{
@@ -1233,34 +1441,26 @@ void(vector wishdir) PM_Jump =
// self.velocity = normalize (self.velocity);
// self.velocity *= 400;
self.velocity_z = PM_SHORTJUMPSPEED;
-
- #ifdef SSQC
- msg = sprintf ("PM_Jump: short jump %v ", self.velocity);
- #endif
}
+ */
else
{
// normal jump
#ifdef SSQC
- if (self.velocity_z > 0)
- msg = sprintf ("PM_Jump: jump %g, ", self.velocity_z);
+ local float r = rint (random() * 3);
+ vol = 0.1;
+ wav = sprintf ("player/jump0%g.ogg", r + 1);
#endif

// do an additive jump on non-flat ground -- CEV
- if (self.groundnormal_z == 1)
- // self.velocity_z = min (PM_STAIRJUMPSPEED,
- // self.velocity_z += PM_JUMPSPEED);
+ if (self.groundnormal && self.groundnormal_z == 1)
self.velocity_z = PM_JUMPSPEED;
+ else if (self.groundentity.velocity)
+ self.velocity_z += PM_JUMPSPEED;
else
self.velocity_z += PM_JUMPSPEED;
}

- // report new Z velocity
- #ifdef SSQC
- if (msg != "")
- dprint (sprintf("%s %g\n", msg, self.velocity_z));
- #endif
-
// manage flags -- CEV
self.groundentity = __NULL__;
self.groundnormal = __NULL__;
@@ -1268,9 +1468,15 @@ void(vector wishdir) PM_Jump =
self.flags &= ~FL_ONGROUND;
self.pmove_flags |= PMF_JUMP_HELD;
self.button2 = 0;
+
+ if (self.pmove_flags & PMF_CROUCHSLIDE)
+ PM_CrouchSlideStop ();
+
#ifdef SSQC
- // player jumping sound; copied into pmove from client.qc -- CEV
- sound (self, CHAN_BODY, "player/plyrjmp8.wav", 1, ATTN_NORM);
+ // player jumping sound; moved into pmove from client.qc -- CEV
+ if (wav != "")
+ sound (self, CHAN_BODY, wav, vol, ATTN_NORM);
+ player_footstep ();
#endif

// timers for all jumps -- CEV
@@ -1284,16 +1490,11 @@ void() PM_WallJump =
{
// are we in water, already waterjumping, already walljumping,
// or is jump being held?
- if (self.waterlevel > WATERLEVEL_NONE ||
+ if (self.conlevel > WATERLEVEL_NONE ||
self.pmove_flags & PMF_WATERJUMPED ||
self.pmove_flags & PMF_JUMP_HELD ||
self.pmove_flags & PMF_WALLJUMPED)
{
- /*
- #ifdef SSQC
- dprint ("PM_WallJump: returning in first block\n");
- #endif
- */
return;
}

@@ -1347,8 +1548,7 @@ void() PM_WallJump =
tracebox (start, PM_CROUCH_MIN, PM_CROUCH_MAX, end, TRUE, self);

// in order: we hit something, that something is vaguely
- // vertical, we hit it at a speed greater than 0, and
- // that something is within 20 (units?) -- CEV
+ // vertical, and that something is within 20 (units?) -- CEV
if (trace_fraction < 1.0f &&
trace_plane_normal_z <= 0.7f &&
trace_plane_normal_z >= 0 &&
@@ -1377,6 +1577,11 @@ void() PM_WallJump =

if (self.pmove_flags & PMF_WALLJUMPED)
{
+ #ifdef SSQC
+ local float vol = 0;
+ local string wav = "";
+ #endif
+
// bounce off the wall plane -- CEV
self.velocity_x += trace_plane_normal_x * PM_WALLJUMPFORCE;
self.velocity_y += trace_plane_normal_y * PM_WALLJUMPFORCE;
@@ -1385,6 +1590,8 @@ void() PM_WallJump =
{
#ifdef SSQC
dprint ("PM_WallJump: wall double ");
+ vol = 0.9;
+ wav = "player/plyrjmp8.wav";
#endif
self.velocity_z = PM_WALLJUMPDOUBLE;
}
@@ -1392,6 +1599,9 @@ void() PM_WallJump =
{
#ifdef SSQC
dprint ("PM_WallJump: walljump ");
+ local float r = rint (random() * 3);
+ vol = 0.2;
+ wav = sprintf ("player/jump0%g.ogg", r + 1);
#endif
self.velocity_z = PM_WALLJUMPSPEED;
}
@@ -1405,7 +1615,9 @@ void() PM_WallJump =
dprint (sprintf("dist %g, normalspeed %g\n",
vlen(self.origin - trace_endpos), f));
self.button2 = 0;
- sound (self, CHAN_BODY, "player/plyrjmp8.wav", 1, ATTN_NORM);
+ player_footstep ();
+ if (wav != "")
+ sound (self, CHAN_BODY, wav, vol, ATTN_NORM);
#endif
}
};
@@ -1416,33 +1628,32 @@ void() PM_WallJump =
//----------------------------------------------------------------------
void(vector wishvel, float move_time) PM_WalkAccelerate =
{
- float accel, friction, newspeed, speed, temp, wishspeed;
+ local float accel, friction, newspeed, speed1, temp, wishspeed;
+ local vector wishdir;

accel = friction = temp = 0;

wishspeed = vlen (wishvel);
- vector wishdir = normalize (wishvel);
+ wishdir = normalize (wishvel);

if (self.pmove_flags & PMF_PRE_MOVE)
{
if (self.pmove_flags & PMF_ONLADDER)
{
// ladder physics
- // these currently stutter in high ping (or low netfps)
- // situations because we rely on touch()ing the ladder
- // trigger to set PMF_ONLADDER and the client doesn't
- // know about the trigger brush yet -- TODO CEV
self.velocity *= 0.75;

- if (input_buttons & 2 || self.button2 > 0 ||
+ if (input_buttons & INPUT_BUTTON2 || self.button2 > 0 ||
input_movevalues_z > 0)
{
// PlayerClimb -- johnfitz
self.velocity_z = 160;
}
- else if (input_movevalues_z < 0)
+ else if (input_buttons & INPUT_BUTTON8 ||
+ input_movevalues_z < 0)
{
// PlayerClimbDown -- CEV
+ // self.pmove_flags |= PMF_CROUCH_HELD;
self.velocity_z = -160;
}
else
@@ -1456,7 +1667,7 @@ void(vector wishvel, float move_time) PM_WalkAccelerate =
}
else
{
- if (input_buttons & 2 || self.button2 > 0 ||
+ if (input_buttons & INPUT_BUTTON2 || self.button2 > 0 ||
input_movevalues_z > 0)
{
// +jump was pressed
@@ -1471,6 +1682,17 @@ void(vector wishvel, float move_time) PM_WalkAccelerate =
{
self.flags |= FL_JUMPRELEASED;
}
+
+ if (input_buttons & INPUT_BUTTON8 &&
+ !(self.pmove_flags & PMF_CROUCHED))
+ {
+ PM_CrouchStart ();
+ }
+ else if (!(input_buttons & INPUT_BUTTON8) &&
+ self.pmove_flags & PMF_CROUCHED)
+ {
+ PM_CrouchStop ();
+ }
}

if (self.pmove_flags & PMF_ONGROUND)
@@ -1485,66 +1707,146 @@ void(vector wishvel, float move_time) PM_WalkAccelerate =
if (self.pmove_flags & PMF_STARTGROUND)
{
// we're on ground so pick accel and friction values -- CEV
- accel = PM_GROUNDACCEL;
- friction = PM_GROUNDFRICTION;
+ if (self.pmove_flags & PMF_CROUCHSLIDE && self.conlevel == 0)
+ {
+ wishspeed = min (wishspeed, PM_MAXSPEED);

- if (self.doublejump_timer > 0)
- wishspeed = min (wishspeed, PM_BOOSTWISHSPEED);
+ if (input_movevalues_x == 0)
+ {
+ accel = -1;
+ friction = PM_SLIDEFRICTION;
+ }
+ else
+ {
+ if (input_movevalues_y == 0)
+ {
+ if (wishvel * self.velocity < 0)
+ accel = PM_AIRACCELBACK;
+ else
+ accel = PM_AIRACCELFWD;
+ friction = -1;
+ }
+ else
+ {
+ accel = PM_SLIDEACCEL;
+ friction = PM_SLIDEFRICTION;
+ }
+ }
+ }
else
- wishspeed = min (wishspeed, PM_MAXSPEED);
+ {
+ accel = PM_GROUNDACCEL;
+ friction = PM_GROUNDFRICTION;
+
+ if (self.pmove_flags & PMF_CROUCHED)
+ wishspeed = min (wishspeed, PM_CROUCHSPEED);
+ else if (self.doublejump_timer > 0)
+ // scale wishspeed up linearly based on the
+ // remaining time to doublejump -- CEV
+ wishspeed = min (wishspeed,
+ bound (PM_MAXSPEED, PM_MAXSPEED +
+ ((self.doublejump_timer -
+ PM_DOUBLEJUMP_WINDOW) * -1)
+ * 150, PM_BOOSTWISHSPEED));
+ else
+ wishspeed = min (wishspeed, PM_MAXSPEED);
+ }
}
else if (self.pmove_flags & PMF_ONGROUND)
{
- // we're in the second acceleration pass and we've just
- // landed. For this one-half acceleration frame set
- // friction to zero and accel to AIRACCELQ3. This
- // moment is particularly noticeable on stairs. -- CEV
- accel = PM_AIRACCELQ3;
- friction = 0;
-
- // rewrite user input to direct movement along current
- // velocity in the half-frame after we've just landed.
- // will only rewrite when neither +fwd or +back is
- // pressed. the neverending quest to improve stairs. -- CEV
- if (input_movevalues_y && input_movevalues_x == 0)
+ if (self.pmove_flags & PMF_CROUCH_HELD &&
+ self.conlevel == 0 &&
+ self.velocity * self.groundnormal < 0 &&
+ self.speed > PM_MAXSPEED)
{
- input_movevalues_x = fabs (input_movevalues_y);
+ // We've just landed, the player is holding crouch,
+ // we hit the ground with some force, and we're
+ // moving faster than default run speed so start
+ // crouchsliding -- CEV
+ PM_CrouchSlideStart ();
+ wishspeed = min (wishspeed, PM_MAXSPEED);

- // we've altered input movevalues so rework wishvel
- // start by ensuring v_ globals are correct
- makevectors ([0, input_angles_y, 0]);
- wishvel = v_forward * input_movevalues_x;
- wishvel += v_right * input_movevalues_y;
- // is wishvel now against self.velocity?
- if (wishvel * self.velocity < 0)
+ if (input_movevalues_x == 0)
+ {
+ accel = -1;
+ friction = PM_SLIDEFRICTION;
+ }
+ else
+ {
+ if (input_movevalues_y == 0)
+ {
+ if (wishvel * self.velocity < 0)
+ accel = PM_AIRACCELBACK;
+ else
+ accel = PM_AIRACCELFWD;
+
+ friction = -1;
+ }
+ else
+ {
+ accel = PM_SLIDEACCEL;
+ friction = PM_SLIDEFRICTION;
+ }
+ }
+ }
+ else
+ {
+ // we're in the second acceleration pass and we've just
+ // landed. For this one-half acceleration frame set
+ // friction to zero and accel to AIRACCELQ3. This
+ // moment is particularly noticeable on stairs. -- CEV
+ accel = PM_AIRACCELQ3;
+ friction = 0;
+
+ // rewrite user input to direct movement along current
+ // velocity in the half-frame after we've just landed.
+ // will only rewrite when neither +fwd or +back is
+ // pressed. the neverending quest to improve stairs.
+ // -- CEV
+ if (input_movevalues_y && input_movevalues_x == 0)
{
- // then movevalues_x should be negative
- input_movevalues_x = -input_movevalues_x;
+ input_movevalues_x = fabs (input_movevalues_y);
+
+ // we've altered input movevalues so rework
+ // wishvel; start by ensuring v_ globals are
+ // correct
+ makevectors ([0, input_angles_y, 0]);
wishvel = v_forward * input_movevalues_x;
wishvel += v_right * input_movevalues_y;
+ // is wishvel now against self.velocity?
+ if (wishvel * self.velocity < 0)
+ {
+ // then movevalues_x should be negative
+ input_movevalues_x = -input_movevalues_x;
+ wishvel = v_forward * input_movevalues_x;
+ wishvel += v_right * input_movevalues_y;
+ }
+ wishspeed = vlen (wishvel);
+ wishdir = normalize (wishvel);
}
- wishspeed = vlen (wishvel);
- wishdir = normalize (wishvel);
- }

- if (self.doublejump_timer > 0)
- wishspeed = min (wishspeed, PM_BOOSTWISHSPEED);
- else
- wishspeed = min (wishspeed, PM_MAXSPEED);
+ if (self.doublejump_timer > 0)
+ // scale wishspeed up linearly based on the
+ // remaining time to doublejump -- CEV
+ wishspeed = min (wishspeed,
+ bound (PM_MAXSPEED, PM_MAXSPEED +
+ ((self.doublejump_timer -
+ PM_DOUBLEJUMP_WINDOW) * -1)
+ * 150, PM_BOOSTWISHSPEED));
+ else
+ wishspeed = min (wishspeed, PM_MAXSPEED);
+ }
}
else if (input_movevalues_x == 0)
{
// Q1 air accel when requesting sideways movement in the air
// flag a check below with this -1 -- CEV
- if (wishspeed > PM_MAXSPEED)
- wishspeed = PM_MAXSPEED;
-
+ wishspeed = min (wishspeed, PM_MAXSPEED);
accel = -1;
}
else
{
- if (wishspeed > PM_MAXSPEED)
- wishspeed = PM_MAXSPEED;
+ wishspeed = min (wishspeed, PM_MAXSPEED);

if (input_movevalues_y == 0)
{
@@ -1575,55 +1877,89 @@ void(vector wishvel, float move_time) PM_WalkAccelerate =
if (friction > 0)
{
// inline PM_Friction
- speed = vlen (self.velocity);
+ speed1 = vlen (self.velocity);

- if (speed < 1)
+ if (speed1 < 1)
{
self.velocity = '0 0 0';
}
else
{
// calculate what their new speed should be
- temp = speed < PM_STOPSPEED ? PM_STOPSPEED : speed;
- newspeed = speed - temp * friction * move_time;
+ temp = speed1 < PM_STOPSPEED ? PM_STOPSPEED : speed1;
+ newspeed = speed1 - temp * friction * move_time;

// and slow them
- if (newspeed < 0)
+ if (newspeed <= 0)
+ {
newspeed = 0;
-
- self.velocity *= newspeed / speed;
+ self.velocity = '0 0 0';
+ }
+ else
+ {
+ self.velocity *= newspeed / speed1;
+ }
}
}

if (accel == -1)
{
// Quake 1 sideways air acceleration; inline PM_AirAccelerate
- wishvel_z = 0;
- temp = vlen (wishvel);
- wishvel = normalize (wishvel);
- if (temp > PM_MAXAIRSPEED)
- temp = PM_MAXAIRSPEED;
- speed = self.velocity * wishvel;
- speed = temp - speed;
-
- if (speed > 0)
+ temp = self.velocity_z;
+ self.velocity_z = wishvel_z = wishdir_z = 0;
+ newspeed = vlen (wishvel);
+ // we've already normalized wishvel as wishdir above, no
+ // need to do it again -- CEV
+ // wishvel = normalize (wishvel);
+ if (newspeed > PM_MAXAIRSPEED)
+ newspeed = PM_MAXAIRSPEED;
+ speed1 = self.velocity * wishdir;
+ speed1 = newspeed - speed1;
+
+ if (speed1 > 0)
{
newspeed = PM_AIRACCEL * move_time * wishspeed;
- if (newspeed > speed)
- newspeed = speed;
- self.velocity += newspeed * wishvel;
+
+ if (newspeed > speed1)
+ newspeed = speed1;
+
+ // self.velocity += newspeed * wishdir;
+
+ // below is an attempt to separate turning radius
+ // from acceleration. -- CEV
+
+ // re-using a lot of variables here
+ wishdir = self.velocity + newspeed * wishdir;
+ newspeed = vlen (wishdir);
+ speed1 = vlen (self.velocity);
+
+ if (newspeed > speed1)
+ {
+ // we've gained speed; reduce -- CEV
+ newspeed = (newspeed - speed1) * 0.4;
+ newspeed += speed1;
+ // now apply the new speed -- CEV
+ self.velocity = normalize (wishdir);
+ self.velocity *= newspeed;
+ }
+ else
+ {
+ self.velocity = wishdir;
+ }
}
+
+ self.velocity_z = temp;
}
else if (accel > 0)
{
// ground & Quake 3 style acceleration; inline PM_Accelerate
- speed = wishspeed - (self.velocity * wishdir);
+ speed1 = wishspeed - (self.velocity * wishdir);

- if (speed > 0)
+ if (speed1 > 0)
{
newspeed = accel * move_time * wishspeed;
- if (newspeed > speed)
- newspeed = speed;
+ if (newspeed > speed1)
+ newspeed = speed1;

self.velocity += newspeed * wishdir;
}
@@ -1637,7 +1973,7 @@ void(vector wishvel, float move_time) PM_WalkAccelerate =
temp = self.velocity_z;
self.velocity_z = 0;

- speed = vlen (self.velocity);
+ speed1 = vlen (self.velocity);
self.velocity = normalize (self.velocity);

// reuse the friction float for dotproduct -- CEV
@@ -1649,11 +1985,11 @@ void(vector wishvel, float move_time) PM_WalkAccelerate =

if (friction > 0)
{
- self.velocity = normalize (self.velocity * speed +
+ self.velocity = normalize (self.velocity * speed1 +
wishdir * accel);
}

- self.velocity *= speed;
+ self.velocity *= speed1;
self.velocity_z = temp;
}

@@ -1667,12 +2003,12 @@ void(vector wishvel, float move_time) PM_WalkAccelerate =
//----------------------------------------------------------------------
void(vector wishvel, float move_time) PM_SwimAccelerate =
{
- float wishspeed;
+ local float wishspeed;

if (self.pmove_flags & PMF_PRE_MOVE)
{
// CheckWaterJump
- if (self.waterlevel == WATERLEVEL_WAIST)
+ if (self.conlevel == WATERLEVEL_WAIST)
{
local vector start, end;

@@ -1710,29 +2046,44 @@ void(vector wishvel, float move_time) PM_SwimAccelerate =

#ifdef SSQC
// functionality copied into pmove from client.qc -- CEV
- if (self.waterlevel >= WATERLEVEL_WAIST)
+ if (self.conlevel >= WATERLEVEL_WAIST)
{
- if (self.swim_flag < time)
+ if (self.conlevel >= WATERLEVEL_EYES &&
+ self.swim_time < time)
{
// play swimming sound
- self.swim_flag = time + 1;
+ self.swim_time = time + 1;
if (random() < 0.5)
sound (self, CHAN_BODY,
- "misc/water1.wav", 1,ATTN_NORM);
+ "misc/water1.wav",
+ 0.6, ATTN_NORM);
else
sound (self, CHAN_BODY,
- "misc/water2.wav", 1,ATTN_NORM);
+ "misc/water2.wav",
+ 0.6, ATTN_NORM);
}
}
#endif
}

- if (input_buttons & 2 && !(self.pmove_flags & PMF_WATERJUMPED))
+ if (input_buttons & INPUT_BUTTON2 &&
+ !(self.pmove_flags & PMF_WATERJUMPED))
+ {
// smartjump
wishvel_z = max (PM_MAXSPEED, wishvel_z);
+ }
+ else if (input_buttons & INPUT_BUTTON8 &&
+ !(self.pmove_flags & PMF_WATERJUMPED))
+ {
+ // smartcrouch
+ // self.pmove_flags |= PMF_CROUCH_HELD;
+ wishvel_z = min (-PM_MAXSPEED, wishvel_z);
+ }
else if (input_movevalues == '0 0 0')
+ {
// drift towards bottom -- CEV
wishvel_z -= PM_WATERSINKSPEED;
+ }

wishspeed = vlen (wishvel);
if (wishspeed > PM_WATERMAXSPEED)
@@ -1755,7 +2106,7 @@ void(vector wishvel, float move_time) PM_SwimAccelerate =
//----------------------------------------------------------------------
void(vector wishvel, float scale, float move_time) PM_NoClipAccelerate =
{
- float wishspeed;
+ local float wishspeed;

// smartjump
if (input_buttons & 2)
@@ -1776,20 +2127,38 @@ void(float move_time) PM_ManageTimers =
else if (self.doublejump_timer < 0)
self.doublejump_timer = 0;

- if (self.doublejump_timer == 0)
+ if (self.doublejump_timer == 0 && self.pmove_flags & PMF_DOUBLEJUMPED)
self.pmove_flags &= ~PMF_DOUBLEJUMPED;
+
+ if (self.crouchslide_timer > 0 && move_time > 0)
+ self.crouchslide_timer -= move_time;
+ else if (self.crouchslide_timer < 0)
+ self.crouchslide_timer = 0;
+
+ if (self.crouchslide_timer == 0 && self.pmove_flags & PMF_CROUCHSLIDE)
+ PM_CrouchSlideStop ();
};

//----------------------------------------------------------------------
// PM_Move -- PMOVE entrypoint -- CEV
//----------------------------------------------------------------------
-void(entity target) PM_Move =
+void(entity e) PM_Move =
{
if (input_timelength <= 0)
// don't process partial frames -- CEV
return;

- vector wishvel;
+ // 'self' in this context is not reliable; it should be set to
+ // the entity passed to this function -- CEV
+ local entity oself = self;
+ self = e;
+
+ #ifdef CSQC
+ if (self.entnum == player_localentnum)
+ view_pl = self;
+ #endif
+
+ local vector wishvel;

// Nudge player's origin if the server is sending low-precision
// (16 bit?) player coordinates. This can be fixed by setting
@@ -1840,9 +2209,21 @@ void(entity target) PM_Move =
}

// TODO CEV this is the wrong place to clear PMF_JUMP_HELD
- if (!(input_buttons & 2))
+ if (!(input_buttons & INPUT_BUTTON2))
self.pmove_flags &= ~PMF_JUMP_HELD;

+ // crouch key, crouchsliding -- CEV
+ if (input_buttons & INPUT_BUTTON8)
+ {
+ self.pmove_flags |= PMF_CROUCH_HELD;
+ }
+ else
+ {
+ self.pmove_flags &= ~PMF_CROUCH_HELD;
+ if (self.pmove_flags & PMF_CROUCHSLIDE)
+ PM_CrouchSlideStop ();
+ }
+
// figure out the properties of the player's position, then clear timers
PM_CategorizePosition ();
PM_ManageTimers (0);
@@ -1855,7 +2236,7 @@ void(entity target) PM_Move =

// split the acceleration in two to reduce
// framerate dependence. -- CEV
- if (self.waterlevel >= WATERLEVEL_WAIST)
+ if (self.conlevel >= WATERLEVEL_WAIST)
{
// figure out wishvel -- CEV
makevectors (input_angles);
@@ -1886,6 +2267,7 @@ void(entity target) PM_Move =
// stick to the ground if we've jumped and
// haven't yet doublejumped
if (self.doublejump_timer > 0 &&
+ !(self.pmove_flags & PMF_CROUCHSLIDE) &&
!(self.pmove_flags & PMF_WALLJUMPED) &&
!(self.pmove_flags & PMF_DOUBLEJUMPED))
{
@@ -1931,7 +2313,7 @@ void(entity target) PM_Move =
self.pmove_flags &= ~PMF_PRE_MOVE;

// second pass at acceleration
- if (self.waterlevel >= WATERLEVEL_WAIST)
+ if (self.conlevel >= WATERLEVEL_WAIST)
PM_SwimAccelerate (wishvel,
input_timelength * 0.5f);
else
@@ -1979,9 +2361,20 @@ void(entity target) PM_Move =
break;
}

+ #ifdef CSQC
+ // oldorigin is saved in player_postthink on the server -- CEV
+ self.oldorigin = self.origin;
+ #endif
+
+ self.speed = vlen ([self.velocity_x, self.velocity_y, 0]);
+
// make sure we've touched the ground entity (it might've slipped
// through the slidemove above) -- CEV
PM_DoTouch (self.groundentity);

touchtriggers ();
+
+ // restore self just in case -- CEV
+ self = oself;
};
+#endif

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

Diff qc/projectiles/bullet.qc

diff --git a/qc/projectiles/bullet.qc b/qc/projectiles/bullet.qc
index 20a9173..a6c8df4 100644
--- a/qc/projectiles/bullet.qc
+++ b/qc/projectiles/bullet.qc
@@ -49,6 +49,9 @@ strip void() projectile_bullet;
//--------------------------------------------------------------
void() projectile_bullet_touch =
{
+ if (base_projectile_check_touch())
+ return;
+
// hit something that bleeds
if (other.takedamage)
{

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

Diff qc/projectiles/flak.qc

diff --git a/qc/projectiles/flak.qc b/qc/projectiles/flak.qc
index 02ab0f2..48f9aeb 100644
--- a/qc/projectiles/flak.qc
+++ b/qc/projectiles/flak.qc
@@ -58,12 +58,16 @@ strip void() projectile_flak;
//--------------------------------------------------------------
void() projectile_flak_touch =
{
+ if (base_projectile_check_touch())
+ return;
+
// hit something that bleeds
if (other.takedamage)
{
spawn_touchblood (self.direct_damage);

- sound (self, CHAN_VOICE, "fish/bite.wav", 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, "fish/bite.wav",
+ VOL_HIGH, ATTN_NORM);

if (other.spikecount)
{

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

Diff qc/projectiles/grenade.qc

diff --git a/qc/projectiles/grenade.qc b/qc/projectiles/grenade.qc
index cbbddf2..dd6ec94 100644
--- a/qc/projectiles/grenade.qc
+++ b/qc/projectiles/grenade.qc
@@ -30,7 +30,7 @@ strip void() projectile_grenade;
//------------------------------------------------------------------------------

//----------------------------------------------------------------------
-// class projectile_grenade: base_projectile_qcphys
+// class projectile_grenade: base_projectile
// {
//--------------------------------------------------------------
void(vector dir) projectile_grenade_destroy =
@@ -120,7 +120,7 @@ strip void() projectile_grenade;
{
// bounce sound
sound (self, CHAN_WEAPON, "weapons/bounce.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
}

self.count = time + 0.02;
@@ -150,17 +150,17 @@ strip void() projectile_grenade;
//--------------------------------------------------------------
void(entity e) projectile_grenade_init =
{
- base_projectile_qcphys_init (e);
+ base_projectile_init (e);

e.classname = "grenade";
e.classtype = CT_PROJECTILE_GRENADE;
e.movetype = MOVETYPE_BOUNCE;
e.solid = SOLID_BBOX;
- e.destroy = projectile_grenade_destroy;
+ // e.destroy = projectile_grenade_destroy;
e.touch = projectile_grenade_touch;
e.aflag |= PROJECTILE_EXPLOSIVE;
- e.health = GRENADE_HEALTH;
- e.takedamage = DAMAGE_YES;
+ // e.health = GRENADE_HEALTH;
+ // e.takedamage = DAMAGE_YES;
e.angles = vectoangles (e.velocity);

if (!e.avelocity)
@@ -186,7 +186,8 @@ strip void() projectile_grenade;
else
e.skin = 0;

- setsize (e, GRENADE_MINS, GRENADE_MAXS);
+ // setsize (e, GRENADE_MINS, GRENADE_MAXS);
+ setsize (e, '0 0 0', '0 0 0');
setorigin (e, e.origin);

// schedule next think (explosion time)

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

Diff qc/projectiles/laser.qc

diff --git a/qc/projectiles/laser.qc b/qc/projectiles/laser.qc
index 1be13b7..d2a0851 100644
--- a/qc/projectiles/laser.qc
+++ b/qc/projectiles/laser.qc
@@ -32,7 +32,7 @@ strip void() projectile_laser;
{
// dumptruck_ds
sound_hit (self, CHAN_WEAPON, "enforcer/enfstop.wav",
- 1, ATTN_STATIC);
+ VOL_HIGH, ATTN_STATIC);
local vector org = self.origin - 8 * normalize (self.velocity);

if (other.health)

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

Diff qc/projectiles/lavaball.qc

diff --git a/qc/projectiles/lavaball.qc b/qc/projectiles/lavaball.qc
index 2c2befc..a9aa22c 100644
--- a/qc/projectiles/lavaball.qc
+++ b/qc/projectiles/lavaball.qc
@@ -29,7 +29,7 @@ strip void() projectile_lavaball;
//------------------------------------------------------------------------------

//----------------------------------------------------------------------
-// class projectile_lavaball: base_projectile_qcphys
+// class projectile_lavaball: base_projectile
// {
//--------------------------------------------------------------
void(vector dir) projectile_lavaball_destroy =
@@ -69,7 +69,7 @@ strip void() projectile_lavaball;
//--------------------------------------------------------------
void(entity e) projectile_lavaball_init =
{
- base_projectile_qcphys_init (e);
+ base_projectile_init (e);

e.classname = "lavaball";
e.classtype = CT_PROJECTILE_LAVABALL;

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

Diff qc/projectiles/multigrenade.qc

diff --git a/qc/projectiles/multigrenade.qc b/qc/projectiles/multigrenade.qc
index 4a1567e..05982cd 100644
--- a/qc/projectiles/multigrenade.qc
+++ b/qc/projectiles/multigrenade.qc
@@ -87,7 +87,8 @@ strip void() projectile_multigrenade;
}

// bounce sound
- sound (self, CHAN_WEAPON, "weapons/bounce.wav", 1, ATTN_NORM);
+ sound (self, CHAN_WEAPON, "weapons/bounce.wav",
+ VOL_HIGH, ATTN_NORM);
if (self.velocity == '0 0 0')
self.avelocity = '0 0 0';
};
@@ -225,7 +226,8 @@ strip void() projectile_multigrenade;
}

// bounce sound
- sound (self, CHAN_WEAPON, "weapons/bounce.wav", 1, ATTN_NORM);
+ sound (self, CHAN_WEAPON, "weapons/bounce.wav",
+ VOL_HIGH, ATTN_NORM);
if (self.velocity == '0 0 0')
self.avelocity = '0 0 0';
};
@@ -258,12 +260,12 @@ strip void() projectile_multigrenade;
e.classtype = CT_PROJECTILE_MULTIGRENADE;
e.movetype = MOVETYPE_BOUNCE;
e.solid = SOLID_BBOX;
- e.destroy = projectile_multigrenade_destroy;
+ // e.destroy = projectile_multigrenade_destroy;
e.think = projectile_multigrenade_think;
e.touch = projectile_multigrenade_touch;
e.aflag |= PROJECTILE_EXPLOSIVE;
- e.health = MULTINADE_HEALTH;
- e.takedamage = DAMAGE_YES;
+ // e.health = MULTINADE_HEALTH;
+ // e.takedamage = DAMAGE_YES;
e.angles = vectoangles (e.velocity);

if (!e.avelocity)
@@ -286,7 +288,8 @@ strip void() projectile_multigrenade;
else
e.skin = 0;

- setsize (e, MULTINADE_MINS, MULTINADE_MAXS);
+ // setsize (e, MULTINADE_MINS, MULTINADE_MAXS);
+ setsize (e, '0 0 0', '0 0 0');
setorigin (e, e.origin);

// set missile duration

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

Diff qc/projectiles/rocket.qc

diff --git a/qc/projectiles/rocket.qc b/qc/projectiles/rocket.qc
index 48c5be2..c550300 100644
--- a/qc/projectiles/rocket.qc
+++ b/qc/projectiles/rocket.qc
@@ -30,7 +30,7 @@ strip void() projectile_rocket;
//------------------------------------------------------------------------------

//----------------------------------------------------------------------
-// class projectile_rocket: base_projectile_qcphys
+// class projectile_rocket: base_projectile
// {
//--------------------------------------------------------------
void(vector dir) projectile_rocket_destroy =
@@ -71,16 +71,16 @@ strip void() projectile_rocket;
//--------------------------------------------------------------
void(entity e) projectile_rocket_init =
{
- base_projectile_qcphys_init (e);
+ base_projectile_init (e);

e.classname = "missile";
e.classtype = CT_PROJECTILE_ROCKET;
e.movetype = MOVETYPE_FLYMISSILE;
e.solid = SOLID_BBOX;
- e.destroy = projectile_rocket_destroy;
+ // e.destroy = projectile_rocket_destroy;
e.aflag |= PROJECTILE_EXPLOSIVE;
- e.health = ROCKET_HEALTH;
- e.takedamage = DAMAGE_YES;
+ // e.health = ROCKET_HEALTH;
+ // e.takedamage = DAMAGE_YES;
e.angles = vectoangles (e.velocity);

if (!e.proj_basespeed)
@@ -116,7 +116,8 @@ strip void() projectile_rocket;
e.nextthink = time + 5;
}

- setsize (e, ROCKET_MINS, ROCKET_MAXS);
+ // setsize (e, ROCKET_MINS, ROCKET_MAXS);
+ setsize (e, '0 0 0', '0 0 0');
setorigin (e, e.origin);
};

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

Diff qc/projectiles/voreball.qc

diff --git a/qc/projectiles/voreball.qc b/qc/projectiles/voreball.qc
index 80d4fdf..ad9ea2a 100644
--- a/qc/projectiles/voreball.qc
+++ b/qc/projectiles/voreball.qc
@@ -29,7 +29,7 @@ strip void() projectile_voreball;
//------------------------------------------------------------------------------

//----------------------------------------------------------------------
-// class projectile_voreball: base_projectile_qcphys
+// class projectile_voreball: base_projectile
// {
//--------------------------------------------------------------
void(vector dir) projectile_voreball_destroy =
@@ -59,7 +59,8 @@ strip void() projectile_voreball;
self.takedamage = DAMAGE_NO;

t_radiusdamage2 (self, self.owner, self.splash_damage, world);
- sound (self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM);
+ sound (self, CHAN_WEAPON, "weapons/r_exp3.wav",
+ VOL_HIGH, ATTN_NORM);

// BecomeExplosion
write_explosion (self.origin);
@@ -92,17 +93,17 @@ strip void() projectile_voreball;
//--------------------------------------------------------------
void(entity e) projectile_voreball_init =
{
- base_projectile_qcphys_init (e);
+ base_projectile_init (e);

e.classname = "voreball";
e.classtype = CT_PROJECTILE_VOREBALL;
e.movetype = MOVETYPE_FLYMISSILE;
e.solid = SOLID_BBOX;
- e.destroy = projectile_voreball_destroy;
+ // e.destroy = projectile_voreball_destroy;
e.touch = projectile_voreball_touch;
e.aflag |= PROJECTILE_EXPLOSIVE;
- e.health = VOREBALL_HEALTH;
- e.takedamage = DAMAGE_YES;
+ // e.health = VOREBALL_HEALTH;
+ // e.takedamage = DAMAGE_YES;
e.angles = vectoangles (e.velocity);

// custom spin on projectile -- dumptruck_ds
@@ -142,7 +143,8 @@ strip void() projectile_voreball;
e.nextthink = time + 5;
}

- setsize (e, VOREBALL_MINS, VOREBALL_MAXS);
+ // setsize (e, VOREBALL_MINS, VOREBALL_MAXS);
+ setsize (e, '0 0 0', '0 0 0');
setorigin (e, e.origin);
};

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

Diff qc/projectiles/wizardspell.qc

diff --git a/qc/projectiles/wizardspell.qc b/qc/projectiles/wizardspell.qc
index bfd888c..6a0d63c 100644
--- a/qc/projectiles/wizardspell.qc
+++ b/qc/projectiles/wizardspell.qc
@@ -62,7 +62,7 @@ strip void() projectile_wizardspell;
{
// dumptruck_ds
sound (self, CHAN_WEAPON, self.owner.snd_hit,
- 1, ATTN_STATIC);
+ VOL_HIGH, ATTN_STATIC);
WriteByte (MSG_BROADCAST, TE_WIZSPIKE);
}
else

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

Diff qc/projectiles/zombiechunk.qc

diff --git a/qc/projectiles/zombiechunk.qc b/qc/projectiles/zombiechunk.qc
index c0c925f..24ed85f 100644
--- a/qc/projectiles/zombiechunk.qc
+++ b/qc/projectiles/zombiechunk.qc
@@ -5,6 +5,7 @@
//======================================================================
// constants
//======================================================================
+
const float ZCHUNK_DIRECT_DAMAGE = 10; // direct damage; 10 is id1
// zombie chunks don't splash
const float ZCHUNK_SPEED = 600; // id1 default 600
@@ -40,13 +41,14 @@ strip void() projectile_zombiechunk;
// hardcoded 10 damage -- CEV
t_damage2 (other, self, self.owner, self.direct_damage);
sound (self, CHAN_WEAPON, "zombie/z_hit.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
remove (self);
return;
}

// bounce sound
- sound (self, CHAN_WEAPON, "zombie/z_miss.wav", 1, ATTN_NORM);
+ sound (self, CHAN_WEAPON, "zombie/z_miss.wav",
+ VOL_HIGH, ATTN_NORM);
self.velocity = '0 0 0';
self.avelocity = '0 0 0';
self.touch = sub_remove;

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

Diff qc/sv_entry.qc

diff --git a/qc/sv_entry.qc b/qc/sv_entry.qc
index 17edf68..4737968 100644
--- a/qc/sv_entry.qc
+++ b/qc/sv_entry.qc
@@ -40,6 +40,7 @@ void() GotoNextMap;
float(float start) ShowIntermissionTextEntity;
void() ExitIntermission;
void() IntermissionThink;
+void() WriteIntermission;
void() RestartLoopSounds_think;
void() RestartLoopSounds;

@@ -55,7 +56,7 @@ void() PlayerPreThink;
void() SV_RunClientCommand;
void() PlayerPostThink;
void() StartFrame;
-// void() EndFrame;
+void() EndFrame;
// void(void() spawnfunc) CheckSpawn;
#endif

@@ -453,11 +454,6 @@ void() ExitIntermission =
//----------------------------------------------------------------------
void() IntermissionThink =
{
- // full send -- CEV
- // self.fixangle = TRUE;
- self.velocity = '0 0 0';
- self.SendFlags = 0xffffff;
-
if (time < intermission_exittime)
return;

@@ -468,6 +464,17 @@ void() IntermissionThink =
};

//----------------------------------------------------------------------
+// WriteIntermission -- CEV
+//----------------------------------------------------------------------
+void() WriteIntermission =
+{
+ WriteByte (MSG_MULTICAST, SVC_CGAMEPACKET);
+ WriteByte (MSG_MULTICAST, EVENT_INTERMISSION);
+ WriteFloat (MSG_MULTICAST, intermission);
+ multicast ('0 0 0', MULTICAST_ALL);
+};
+
+//----------------------------------------------------------------------
void() RestartLoopSounds_think =
{
sound (self, self.impulse, self.noise, self.volume, self.speed);
@@ -477,7 +484,7 @@ void() RestartLoopSounds_think =
void() RestartLoopSounds =
{
entity e;
- e = find (world, classname, "play_sound_triggered");
+ e = findfloat (world, classtype, CT_MISC_PLAY_SOUND_TRIGGERED);
while (e) {
if (e.spawnflags & 3 == 3) {
// both "toggle" and "looped" need to be set
@@ -486,7 +493,7 @@ void() RestartLoopSounds =
e.think = RestartLoopSounds_think;
}
}
- e = find (e, classname, "play_sound_triggered");
+ e = findfloat (e, classtype, CT_MISC_PLAY_SOUND_TRIGGERED);
}
};
#endif
@@ -685,7 +692,7 @@ void() ClientDisconnect =
bprint (" left the game with ");
bprint (ftos(self.frags));
bprint (" frags\n");
- sound (self, CHAN_BODY, "player/tornoff2.wav", 1, ATTN_NONE);
+ sound (self, CHAN_BODY, "player/tornoff2.wav", VOL_HIGH, ATTN_NONE);

if (self.classtype == CT_PLAYER)
player_set_suicide_frame ();
@@ -782,7 +789,7 @@ void() SetChangeParms =

//----------------------------------------------------------------------
// PutClientInServer -- called each time a player is spawned
-// according to Nuclide: player has fully connected and loaded in.
+// according to Nuclide: player has fully connected and loaded in.
// 'self' is the player/client, parmX are populated with data carried
// over from previous levels for this specific client. -- CEV
//----------------------------------------------------------------------
@@ -872,15 +879,33 @@ void() StartFrame =

gamestarted = TRUE;
}
+
+ // aid clientside prediction by updating any networked SOLID_BSP
+ // MOVETYPE_PUSH entities that are in motion. I hate looping
+ // through all entities like this. -- CEV
+ local entity e = world;
+ while ((e = nextent(e)))
+ {
+ // only SOLID PUSH entities
+ if (e.solid == SOLID_BSP && e.movetype == MOVETYPE_PUSH)
+ // only CG_FUNC entities
+ if (e.classgroup & CG_FUNC)
+ // only ents in motion with a SendEntity func
+ if (e.velocity && e.SendEntity)
+ // transmit origin, vel, state, speed
+ e.SendFlags |= BASE_FUNC_NET_ORIGIN |
+ BASE_FUNC_NET_VELOCITY |
+ BASE_FUNC_NET_SPEED;
+ }
};

-/*
-// placeholder in case it's necessary -- CEV
+//----------------------------------------------------------------------
+// "Called after non-player entities have run at the end of the physics frame"
+// according to fteextensions.qc
+//----------------------------------------------------------------------
void() EndFrame =
{
- dprint ("EndFrame: entering...\n");
};
-*/

/*
// placeholder in case it's necessary; based on code from Nuclide SDK -- CEV

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

Diff qc/sv_progs.src

diff --git a/qc/sv_progs.src b/qc/sv_progs.src
index b067478..40cee89 100644
--- a/qc/sv_progs.src
+++ b/qc/sv_progs.src
@@ -1,9 +1,10 @@
-#pragma target fte
+#pragma target FTE
#pragma progs_dat "../progs.dat"
#pragma autoproto

#define FTE
#define SSQC
+#define DP_QC_GETSURFACE

#includelist
//----------------------------------------------------------------------
@@ -127,7 +128,7 @@ func/fall.qc // Renny's original version
func/fall2.qc // Renny's improved version.
func/illusionary.qc // was misc.qc -- CEV
func/laser.qc // selections from Rubicon2 QC
-// func/monster_spawner.qc // "bot" creation code for func_monster_spawner
+func/monster_spawner.qc // "bot" creation code for func_monster_spawner
func/new_plat.qc // Rogue MP newplats.qc
func/plat.qc // was plats.qc -- CEV
func/particlefield.qc // Hipnotic particlefield
@@ -208,5 +209,6 @@ world.qc // worldspawn
//----------------------------------------------------------------------
// compatibility spawn functions & misc
//----------------------------------------------------------------------
-compat_quake3.qc // entrypoints & support for Quake 3 entities
+compat/id1.qc // loose functions specific to id1 maps
+compat/quake3.qc // entrypoints & support for Quake 3 entities
#endlist

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

Diff qc/triggers/changelevel.qc

diff --git a/qc/triggers/changelevel.qc b/qc/triggers/changelevel.qc
index deaf624..d394660 100644
--- a/qc/triggers/changelevel.qc
+++ b/qc/triggers/changelevel.qc
@@ -6,26 +6,31 @@
// constants
//======================================================================

+#ifdef SSQC
const float TRIGGER_CHANGELEVEL_EXITOFF = 8; // was DT_EXITOFF
+#endif

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

+#ifdef SSQC
+// trigger_changelevel
void() trigger_changelevel_think;
void() trigger_changelevel_touch;
void() trigger_changelevel_use;
entity(entity src, vector org, string m) spawn_trigger_changelevel;
void(entity e) trigger_changelevel_init;
void() trigger_changelevel;
+#endif

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

+#ifdef SSQC
/*QUAKED trigger_changelevel (0.5 0.5 0.5) ? NO_INTERMISSION 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

When the player touches this, he gets sent to the map listed in the "map" variable. Unless the NO_INTERMISSION flag is set, the view will go to the info_intermission spot and display stats.
*/
-
//----------------------------------------------------------------------
// class trigger_changelevel: base_trigger
// {
@@ -38,6 +43,7 @@ When the player touches this, he gets sent to the map listed in the "map" variab
local entity pos;

intermission = 1;
+ WriteIntermission ();

// enforce a wait time before allowing changelevel
if (deathmatch)
@@ -199,3 +205,4 @@ When the player touches this, he gets sent to the map listed in the "map" variab
trigger_changelevel_init (self);
};
// };
+#endif

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

Diff qc/triggers/changemusic.qc

diff --git a/qc/triggers/changemusic.qc b/qc/triggers/changemusic.qc
index dc0eca4..82d9427 100644
--- a/qc/triggers/changemusic.qc
+++ b/qc/triggers/changemusic.qc
@@ -7,26 +7,33 @@
//======================================================================

// base_changemusic
+#ifdef SSQC
void(float newtrack) base_changemusic_newtrack;
+#endif

+#ifdef SSQC
// trigger_changemusic
void() trigger_changemusic_touch;
entity(entity src, vector org, vector nmins, vector nmaxs, float newsnd)
spawn_trigger_changemusic;
void(entity e) trigger_changemusic_init;
void() trigger_changemusic;
+#endif

+#ifdef SSQC
// trigger_cdtrack
void() trigger_cdtrack_use;
entity(entity src, vector org, float newcount) spawn_trigger_cdtrack;
void(entity e) trigger_cdtrack_init;
void() trigger_cdtrack;
+#endif

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

//----------------------------------------------------------------------
// class base_changemusic: base_trigger
// {
+#ifdef SSQC
//--------------------------------------------------------------
void(float newtrack) base_changemusic_newtrack =
{
@@ -46,8 +53,10 @@ void() trigger_cdtrack;
// might as well be same for those that care.
WriteByte (MSG_ALL, newtrack);
};
+#endif
// };

+#ifdef SSQC
/*QUAKED trigger_changemusic (.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
A trigger brush that changes the currently playing music track. The number of the track to play goes in the sounds key (just like worldspawn). */
//----------------------------------------------------------------------
@@ -117,7 +126,9 @@ A trigger brush that changes the currently playing music track. The number of th
trigger_changemusic_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED trigger_cdtrack (.7 .7 .7) 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
A point entity that changes the currently playing music track when triggered. The number of the track to play goes in the count key. e.g. 32 for track32.ogg See manual trigger_changemusic for more information on formats and more.

@@ -174,3 +185,4 @@ NOTE: the track number uses the count key here but trigger_changemusic uses the
trigger_cdtrack_init (self);
};
// };
+#endif

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

Diff qc/triggers/changetarget.qc

diff --git a/qc/triggers/changetarget.qc b/qc/triggers/changetarget.qc
index e9505b3..39132ab 100644
--- a/qc/triggers/changetarget.qc
+++ b/qc/triggers/changetarget.qc
@@ -6,14 +6,18 @@
// forward declarations
//======================================================================

+#ifdef SSQC
+// trigger_changetarget
void() trigger_changetarget_use;
entity(vector org, vector nmins, vector nmaxs, string newtarg,
string newmsg, float newcnt) spawn_trigger_changetarget;
void(entity e) trigger_changetarget_init;
void() trigger_changetarget;
+#endif

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

+#ifdef SSQC
/*QUAKED trigger_changetarget (.5 .5 .5) ?
Changes an entity's target field

@@ -79,3 +83,4 @@ cnt = target field to change, null defaults to target
trigger_changetarget_init (self);
};
// };
+#endif

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

Diff qc/triggers/counter.qc

diff --git a/qc/triggers/counter.qc b/qc/triggers/counter.qc
index 978539f..2f5e235 100644
--- a/qc/triggers/counter.qc
+++ b/qc/triggers/counter.qc
@@ -6,18 +6,24 @@
// constants
//======================================================================

+#ifdef SSQC
const float TRIGGER_COUNTER_NOMESSAGE = 1;
+#endif

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

+#ifdef SSQC
+// trigger_counter
void() trigger_counter_use;
void(entity e) trigger_counter_init;
void() trigger_counter;
+#endif

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

+#ifdef SSQC
/*QUAKED trigger_counter (.5 .5 .5) ? nomessage 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

Acts as an intermediary for an action that takes multiple inputs.
@@ -97,3 +103,4 @@ After the counter has been triggered "count" times (default 2), it will fire all
trigger_counter_init (self);
};
// };
+#endif

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

Diff qc/triggers/cvarset.qc

diff --git a/qc/triggers/cvarset.qc b/qc/triggers/cvarset.qc
index 98e0361..980ecbf 100644
--- a/qc/triggers/cvarset.qc
+++ b/qc/triggers/cvarset.qc
@@ -6,14 +6,18 @@
// forward declarations
//======================================================================

+#ifdef SSQC
+// trigger_cvarset
void() trigger_cvarset_delaythink;
void() trigger_cvarset_use;
// void() trigger_cvarset_touch;
void(entity e) trigger_cvarset_init;
void() trigger_cvarset;
+#endif

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

+#ifdef SSQC
/*QUAKED trigger_cvarset (.5 .5 .5) (-8 -8 -8) (8 8 32)
You can set any CVAR on the server with this trigger. Put the CVAR name
in "netname" and put the value in "message". Useful CVAR's are
@@ -88,3 +92,4 @@ sv_gravity, sv_friction, fov, and v_idlescale.
trigger_cvarset_init (self);
};
// };
+#endif

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

Diff qc/triggers/everything.qc

diff --git a/qc/triggers/everything.qc b/qc/triggers/everything.qc
index 2c0636f..5192bb1 100644
--- a/qc/triggers/everything.qc
+++ b/qc/triggers/everything.qc
@@ -6,12 +6,16 @@
// forward declarations
//======================================================================

+#ifdef SSQC
+// trigger_everything
void() trigger_everything_touch;
void(entity e) trigger_everything_init;
void() trigger_everything;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// trigger_everything
//----------------------------------------------------------------------
@@ -55,3 +59,4 @@ void() trigger_everything;
trigger_everything_init (self);
};
// };
+#endif

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

Diff qc/triggers/filter.qc

diff --git a/qc/triggers/filter.qc b/qc/triggers/filter.qc
index 8ece91d..9bcb77b 100644
--- a/qc/triggers/filter.qc
+++ b/qc/triggers/filter.qc
@@ -6,6 +6,7 @@
// constants
//======================================================================

+#ifdef SSQC
const float FILTER_FIELD_STATE = 0;
const float FILTER_FIELD_HEALTH = 1;
const float FILTER_FIELD_WEAPON = 2;
@@ -30,24 +31,31 @@ const float FILTER_OP_GT = 3;
const float FILTER_OP_GTE = 4;
const float FILTER_OP_BITMASK_AND = 5;
const float FILTER_OP_BITMASK_OR = 6;
+#endif

//======================================================================
// fields
//======================================================================

+#ifdef SSQC
.string include; // trigger_filter
.string type; // trigger_filter
+#endif

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

+#ifdef SSQC
+// trigger_filter
void() trigger_filter_use;
void(entity e) trigger_filter_init;
void() trigger_filter;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// TODO CEV: this needs comments
//----------------------------------------------------------------------
@@ -265,3 +273,4 @@ void() trigger_filter;
trigger_filter_init (self);
};
// };
+#endif

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

Diff qc/triggers/fog.qc

diff --git a/qc/triggers/fog.qc b/qc/triggers/fog.qc
index 697765e..fa4d795 100644
--- a/qc/triggers/fog.qc
+++ b/qc/triggers/fog.qc
@@ -19,26 +19,31 @@
// constants
//======================================================================

+#ifdef SSQC
const float FOG_INTERVAL = 0.04166667; // 1/24;

const float FOGBLEND_ONEWAY = 1;
const float FOGBLEND_REVERSE = 2;
const float FOGBLEND_ALLCLIENTS = 4;
const float FOGBLEND_BLENDTO = 8;
+#endif

//======================================================================
// fields
//======================================================================

+#if defined(CSQC) || defined(SSQC)
.vector fog_color, fog_color2; // progs_dump fog
.float fog_density, fog_density2;
.float skyfog_density, skyfog_density2;
.entity fogblend_entity;
+#endif

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

+#ifdef SSQC
void(entity client, float density, vector color) fog_save;
void(entity client) fog_save_to_previous;
void(entity client, float density) skyfog_save;
@@ -48,38 +53,50 @@ void(entity client, float density, vector color) fog_set;
void(entity client, float density) skyfog_set;
void(entity client, vector cTo, float dTo, float f) fog_blend_set_fraction;
void(entity client, float sTo, float f) skyfog_blend_set_fraction;
+#endif

+#ifdef SSQC
// base_fog_controller
void() base_fog_controller_think;
+#endif

+#ifdef SSQC
// temp_fog_controller
entity(entity own, entity nme) spawn_temp_fog_controller;
void(entity e) temp_fog_controller_init;
strip void() temp_fog_controller;
+#endif

+#ifdef SSQC
// target_fogblend
void() target_fogblend_use;
entity(vector org, float sflags, vector fogcolor, float fd, float sfd,
float newspeed1, float newspeed2) spawn_target_fogblend;
void(entity e) target_fogblend_init;
void() target_fogblend;
+#endif

+#ifdef SSQC
// trigger_fogblend
void() trigger_fogblend_touch;
entity(vector org, vector nmins, vector nmaxs, vector ang, vector md,
float dist) spawn_trigger_fogblend;
void(entity e) trigger_fogblend_init;
void() trigger_fogblend;
+#endif

+#ifdef SSQC
// trigger_fog
void() trigger_fog_touch;
entity(vector org, vector nmins, vector nmaxs, float newspeed, vector newcolor,
float fdensity, float sfdensity, float newdelay) spawn_trigger_fog;
void(entity e) trigger_fog_init;
void() trigger_fog;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// fog_save
//----------------------------------------------------------------------
@@ -162,8 +179,8 @@ void(entity client, float density, vector color) fog_set =
if (client.classtype != CT_PLAYER)
return;

- // dprint9 ("Setting fog: ", ftos(density), " ", ftos(color_x),
- // " ", ftos(color_y), " ", ftos(color_z), "\n");
+ // dprint (sprintf("Setting fog: density %g, color %v\n",
+ // density, color));

stuffcmd (client, "\nfog ");
stuffcmd_float (client, density);
@@ -224,7 +241,9 @@ void(entity client, float sTo, float f) skyfog_blend_set_fraction =

skyfog_set (client, s);
};
+#endif

+#ifdef SSQC
//----------------------------------------------------------------------
// class base_fog_controller: base_mapentity
// {
@@ -333,7 +352,9 @@ void(entity client, float sTo, float f) skyfog_blend_set_fraction =
}
};
// };
+#endif

+#ifdef SSQC
//----------------------------------------------------------------------
// class temp_fog_controller: base_fog_controller
// {
@@ -368,7 +389,9 @@ void(entity client, float sTo, float f) skyfog_blend_set_fraction =
temp_fog_controller_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED target_fogblend (.5 .5 .2) (-8 -8 -8) (8 8 8) ONE_WAY REVERSE GLOBAL BLENDTO
Blends the fog for a client. activator's fog will be blended from "fog_color" and "fog_density"
to "fog_color2" and "fog_density2". Triggering again will blend it back, unless ONE_WAY is set.
@@ -508,7 +531,9 @@ Activator's fog will be blended over time from start to end values.
target_fogblend_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED trigger_fogblend (.5 .5 .2) ?
Acts as a smoothly blending portal between two zones of different fog. Sets the fog for any client passing through it, blending their global fog settings between "fog_color"/"fog_density" and "fog_color2"/"fog_density2" proportional to their position within the trigger.
The axis of motion on which the blend happens is defined by "angle", pointing to whatever zone has color2 and density2. Trigger therefore has two 'sides' - the side that "angle" points to, and the opposite side.
@@ -672,7 +697,9 @@ Acts as a smoothly blending portal between two zones of different fog. Sets the
trigger_fogblend_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED trigger_fog (.5 .5 .2) ?
Smoothly blends touching client's currently applied fog to "fog_color" and "fog_density" over time.

@@ -765,3 +792,4 @@ CAVEATS:
trigger_fog_init (self);
};
// };
+#endif

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

Diff qc/triggers/heal.qc

diff --git a/qc/triggers/heal.qc b/qc/triggers/heal.qc
index 964643b..2f2e758 100644
--- a/qc/triggers/heal.qc
+++ b/qc/triggers/heal.qc
@@ -8,30 +8,38 @@
// constants
//======================================================================

+#ifdef SSQC
const float TRIGGER_HEAL_START_ON = 1;
const float TRIGGER_HEAL_PLAYER_ONLY = 2;
const float TRIGGER_HEAL_MONSTER_ONLY = 4;
+#endif

//======================================================================
// fields
//======================================================================

+#ifdef SSQC
.float heal_timer;
.float heal_amount;
.float health_max;
+#endif

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

+#ifdef SSQC
+// trigger_heal
void() trigger_heal_think;
void() trigger_heal_touch;
// void() trigger_heal_toggle;
void(entity e) trigger_heal_init;
void() trigger_heal;
+#endif

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

+#ifdef SSQC
/*QUAKED trigger_heal (.5 .5 .5) ? TRIGGER_HEAL_START_ON TRIGGER_HEAL_PLAYER_ONLY TRIGGER_HEAL_MONSTER_ONLY 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

Any object touching this will be healed
@@ -122,10 +130,10 @@ message2 -- message to print when exhausted
{
if (self.noise != "")
sound (self, CHAN_AUTO, self.noise,
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
else
sound (self, CHAN_AUTO, "items/r_item1.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

local float calc_healing;

@@ -232,3 +240,4 @@ message2 -- message to print when exhausted
trigger_heal_init (self);
};
// };
+#endif

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

Diff qc/triggers/hurt.qc

diff --git a/qc/triggers/hurt.qc b/qc/triggers/hurt.qc
index 9164d04..4003a02 100644
--- a/qc/triggers/hurt.qc
+++ b/qc/triggers/hurt.qc
@@ -6,23 +6,29 @@
// fields
//======================================================================

+#ifdef SSQC
// 1998-07-03 hurt_touch fix by Robert Field start
.float hurt_together_time;
.float hurt_nextthink;
// 1998-07-03 hurt_touch fix by Robert Field end
+#endif

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

+#ifdef SSQC
+// trigger_hurt
void(entity e, float amount) trigger_hurt_setdamage;
// void() trigger_hurt_on;
void() trigger_hurt_touch;
void(entity e) trigger_hurt_init;
void() trigger_hurt;
+#endif

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

+#ifdef SSQC
/*QUAKED trigger_hurt (.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
Any object touching this will be hurt
set dmg to damage amount
@@ -110,3 +116,4 @@ defalt dmg = 5
trigger_hurt_init (self);
};
// };
+#endif

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

Diff qc/triggers/ladder.qc

diff --git a/qc/triggers/ladder.qc b/qc/triggers/ladder.qc
index 8ce3bd8..fea43a8 100644
--- a/qc/triggers/ladder.qc
+++ b/qc/triggers/ladder.qc
@@ -6,9 +6,19 @@
// forward declarations
//======================================================================

+#ifdef CSQC
+void(float isnew) trigger_ladder_netreceive;
+#endif
+#ifdef SSQC
+float(entity to, float netflags) trigger_ladder_netsend;
+#endif
+#if defined(CSQC) || defined (SSQC)
void() trigger_ladder_touch;
void(entity e) trigger_ladder_init;
+#endif
+#ifdef SSQC
void() trigger_ladder;
+#endif

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

@@ -22,6 +32,90 @@ Keys:
//----------------------------------------------------------------------
// class trigger_ladder: base_trigger
// {
+#ifdef CSQC
+ //--------------------------------------------------------------
+ void(float isnew) trigger_ladder_netreceive =
+ {
+ local float netflags = ReadFloat ();
+
+ if (netflags & BASE_TRIGGER_NET_ORIGIN)
+ {
+ self.origin_x = ReadCoord ();
+ self.origin_y = ReadCoord ();
+ self.origin_z = ReadCoord ();
+ }
+
+ if (netflags & BASE_TRIGGER_NET_SIZE)
+ {
+ self.mins_x = ReadCoord ();
+ self.mins_y = ReadCoord ();
+ self.mins_z = ReadCoord ();
+ self.maxs_x = ReadCoord ();
+ self.maxs_y = ReadCoord ();
+ self.maxs_z = ReadCoord ();
+ }
+
+ if (netflags & BASE_TRIGGER_NET_MOVEDIR)
+ {
+ self.movedir_x = ReadShort () * (360 / 32767);
+ self.movedir_y = ReadShort () * (360 / 32767);
+ self.movedir_z = ReadShort () * (360 / 32767);
+ }
+
+ if (netflags & BASE_TRIGGER_NET_ESTATE)
+ self.estate = ReadFloat ();
+
+ if (isnew)
+ trigger_ladder_init (self);
+
+ // make sure size and origin are set -- CEV
+ if (netflags & BASE_TRIGGER_NET_SIZE)
+ setsize (self, self.mins, self.maxs);
+
+ if (netflags & BASE_TRIGGER_NET_ORIGIN)
+ setorigin (self, self.origin);
+ };
+#endif
+
+#ifdef SSQC
+ //--------------------------------------------------------------
+ float(entity to, float netflags) trigger_ladder_netsend =
+ {
+ WriteFloat (MSG_ENTITY, self.classtype);
+ WriteFloat (MSG_ENTITY, netflags);
+
+ if (netflags & BASE_TRIGGER_NET_ORIGIN)
+ {
+ WriteCoord (MSG_ENTITY, self.origin_x);
+ WriteCoord (MSG_ENTITY, self.origin_y);
+ WriteCoord (MSG_ENTITY, self.origin_z);
+ }
+
+ if (netflags & BASE_TRIGGER_NET_SIZE)
+ {
+ WriteCoord (MSG_ENTITY, self.mins_x);
+ WriteCoord (MSG_ENTITY, self.mins_y);
+ WriteCoord (MSG_ENTITY, self.mins_z);
+ WriteCoord (MSG_ENTITY, self.maxs_x);
+ WriteCoord (MSG_ENTITY, self.maxs_y);
+ WriteCoord (MSG_ENTITY, self.maxs_z);
+ }
+
+ if (netflags & BASE_TRIGGER_NET_MOVEDIR)
+ {
+ WriteShort (MSG_ENTITY, self.movedir_x * (32767 / 360));
+ WriteShort (MSG_ENTITY, self.movedir_y * (32767 / 360));
+ WriteShort (MSG_ENTITY, self.movedir_z * (32767 / 360));
+ }
+
+ if (netflags & BASE_TRIGGER_NET_ESTATE)
+ WriteFloat (MSG_ENTITY, self.estate);
+
+ return TRUE;
+ };
+#endif
+
+#if defined(CSQC) || defined (SSQC)
//--------------------------------------------------------------
// trigger_ladder_touch
//--------------------------------------------------------------
@@ -51,13 +145,16 @@ Keys:
// changed to PMFLAGS -- CEV
other.pmove_flags |= PMF_ONLADDER;
};
+#endif

+#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void(entity e) trigger_ladder_init =
{
e.classname = "trigger_ladder";
e.classtype = CT_TRIGGER_LADDER;

+ #ifdef SSQC
// ignore an "up" or "down" angle (doesn't make sense
// for a ladder)
if (e.angles_y == -1 || e.angles_y == -2)
@@ -67,12 +164,27 @@ Keys:

e.angles_y = 0;
}
+ #endif

base_trigger_init (e);
e.touch = trigger_ladder_touch;
+
+ #ifdef SSQC
sub_checkwaiting (e);
+
+ // trigger_ladder needs to be networked to the client. set
+ // our transmit function then full send the entity -- CEV
+ e.SendEntity = trigger_ladder_netsend;
+ e.SendFlags |= BASE_TRIGGER_NET_ORIGIN |
+ BASE_TRIGGER_NET_SIZE |
+ BASE_TRIGGER_NET_ESTATE;
+ if (e.movedir)
+ e.SendFlags |= BASE_TRIGGER_NET_MOVEDIR;
+ #endif
};
+#endif

+#ifdef SSQC
//--------------------------------------------------------------
void() trigger_ladder =
{
@@ -82,4 +194,5 @@ Keys:

trigger_ladder_init (self);
};
+#endif
// };

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

Diff qc/triggers/look.qc

diff --git a/qc/triggers/look.qc b/qc/triggers/look.qc
index ef988e1..d25f2e8 100644
--- a/qc/triggers/look.qc
+++ b/qc/triggers/look.qc
@@ -6,13 +6,17 @@
// forward declarations
//======================================================================

+#ifdef SSQC
+// trigger_look
void() trigger_look_use;
void() trigger_look_touch;
void(entity e) trigger_look_init;
void() trigger_look;
+#endif

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

+#ifdef SSQC
/*QUAKED trigger_look (.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
This will trigger when a player is within the brush trigger and looks directly at a target entity.
Use the first target key for the "looked at entity" and use the subsequent targets (2-4) to trigger other events.
@@ -68,11 +72,11 @@ See manual for complete details. See pd_cutscenes sample map for example
sub_usetargets ();

if (self.noise != "")
- sound (self, CHAN_VOICE, self.noise, 1,
- ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise,
+ VOL_HIGH, ATTN_NORM);
else
- sound (self, CHAN_VOICE, self.noise1, 1,
- ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise1,
+ VOL_HIGH, ATTN_NORM);

// added wait
if (self.wait > 0)
@@ -152,3 +156,4 @@ See manual for complete details. See pd_cutscenes sample map for example
trigger_look_init (self);
};
// };
+#endif

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

Diff qc/triggers/monsterface.qc

diff --git a/qc/triggers/monsterface.qc b/qc/triggers/monsterface.qc
index 59baf7c..9264897 100644
--- a/qc/triggers/monsterface.qc
+++ b/qc/triggers/monsterface.qc
@@ -6,13 +6,17 @@
// forward declarations
//======================================================================

+#ifdef SSQC
+// trigger_monsterface
float(entity targ, entity o) ai_visible_to_other;
void() trigger_monsterface_touch;
void(entity e) trigger_monsterface_init;
void() trigger_monsterface;
+#endif

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

+#ifdef SSQC
/*QUAKED trigger_monsterface (.5 .0 .5)
Running monsters that do not see their target and touch this will face in the direction of the trigger's angle instead of the unseen target.
Use this trigger to make monsters leave their sniping spot and execute complex maneuvers.
@@ -92,3 +96,4 @@ Keys:
trigger_monsterface_init (self);
};
// };
+#endif

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

Diff qc/triggers/monsterjump.qc

diff --git a/qc/triggers/monsterjump.qc b/qc/triggers/monsterjump.qc
index 05f756b..58be4be 100644
--- a/qc/triggers/monsterjump.qc
+++ b/qc/triggers/monsterjump.qc
@@ -6,19 +6,25 @@
// constants
//======================================================================

+#ifdef SSQC
const float TRIGGER_MONSTERJUMP_STARTOFF = 8;
+#endif

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

+#ifdef SSQC
+// trigger_monsterjump
void() trigger_monsterjump_touch;
void() trigger_monsterjump_use;
void(entity e) trigger_monsterjump_init;
void() trigger_monsterjump;
+#endif

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

+#ifdef SSQC
/*QUAKED trigger_monsterjump (.5 .5 .5) ? X X X TRIGGER_MONSTERJUMP_STARTOFF 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

Walking monsters that touch this will jump in the direction of the
@@ -102,3 +108,4 @@ be targeted and toggled off and on.
trigger_monsterjump_init (self);
};
// };
+#endif

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

Diff qc/triggers/multiple.qc

diff --git a/qc/triggers/multiple.qc b/qc/triggers/multiple.qc
index b9d420f..37a5668 100644
--- a/qc/triggers/multiple.qc
+++ b/qc/triggers/multiple.qc
@@ -6,14 +6,17 @@
// constants
//======================================================================

+#ifdef SSQC
const float TRIGGER_MULTIPLE_NOTOUCH = 1;
// used for Wait for retrigger spawnflag
const float TRIGGER_MULTIPLE_TURNS_OFF = 2;
+#endif

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

+#ifdef SSQC
// base_multiple
void() base_multiple_think_wait;
void() base_multiple_fire;
@@ -22,17 +25,23 @@ void() base_multiple_touch;
void() base_multiple_use;
void(entity e) base_multiple_init;
strip void() base_multiple;
+#endif

+#ifdef SSQC
// trigger_multiple
void(entity e) trigger_multiple_init;
void() trigger_multiple;
+#endif

+#ifdef SSQC
// trigger_once
void(entity e) trigger_once_init;
void() trigger_once;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// generic multiple class
//----------------------------------------------------------------------
@@ -47,7 +56,9 @@ void() trigger_once;
{
self.health = self.max_health;
self.takedamage = DAMAGE_YES;
- self.solid = SOLID_BBOX;
+ // Don't block players -- CEV
+ // self.solid = SOLID_BBOX;
+ self.solid = SOLID_CORPSE;
}
};

@@ -76,7 +87,8 @@ void() trigger_once;
}

if (self.noise != "")
- sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise,
+ VOL_HIGH, ATTN_NORM);

// don't trigger again until reset
self.takedamage = DAMAGE_NO;
@@ -116,7 +128,9 @@ void() trigger_once;
{
self.health = self.max_health; // nyah nyah~!
self.takedamage = DAMAGE_YES;
- self.solid = SOLID_BBOX;
+ // Don't block players -- CEV
+ // self.solid = SOLID_BBOX;
+ self.solid = SOLID_CORPSE;

return;
}
@@ -208,7 +222,9 @@ void() trigger_once;
e.max_health = e.health;
e.destroy = base_multiple_destroy;
e.takedamage = DAMAGE_YES;
- e.solid = SOLID_BBOX;
+ // Don't block players -- CEV
+ // e.solid = SOLID_BBOX;
+ e.solid = SOLID_CORPSE;
// make sure it links into the world
setorigin (e, e.origin);
}
@@ -227,7 +243,9 @@ void() trigger_once;
base_multiple_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED trigger_multiple (.5 .5 .5) ? notouch WAIT_FOR_RETRIGGER 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

Variable sized repeatable trigger. Must be targeted at one or more entities. If "health" is set, the trigger must be killed to activate each time.
@@ -264,7 +282,9 @@ set "message" to text string
trigger_multiple_init (self);
};
// };
+#endif

+#ifdef SSQC
/*QUAKED trigger_once (.5 .5 .5) ? notouch 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

Variable sized trigger. Triggers once, then removes itself. You must set the key "target" to the name of another object in the level that has a matching
@@ -300,3 +320,4 @@ set "message" to text string
trigger_once_init (self);
};
// };
+#endif

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

Diff qc/triggers/onlyregistered.qc

diff --git a/qc/triggers/onlyregistered.qc b/qc/triggers/onlyregistered.qc
index 95e8cad..208a6f5 100644
--- a/qc/triggers/onlyregistered.qc
+++ b/qc/triggers/onlyregistered.qc
@@ -6,12 +6,16 @@
// forward declarations
//======================================================================

+#ifdef SSQC
+// trigger_onlyregistered
void() trigger_onlyregistered_touch;
void(entity e) trigger_onlyregistered_init;
void() trigger_onlyregistered;
+#endif

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

+#ifdef SSQC
/*QUAKED trigger_onlyregistered (.5 .5 .5) ?
Only fires if playing the registered version, otherwise prints the message
*/
@@ -45,7 +49,7 @@ Only fires if playing the registered version, otherwise prints the message
{
centerprint (other, self.message);
sound (other, CHAN_BODY, "misc/talk.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
}
}
};
@@ -72,3 +76,4 @@ Only fires if playing the registered version, otherwise prints the message
trigger_onlyregistered_init (self);
};
// };
+#endif

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

Diff qc/triggers/push.qc

diff --git a/qc/triggers/push.qc b/qc/triggers/push.qc
index 4953d05..ec53c46 100644
--- a/qc/triggers/push.qc
+++ b/qc/triggers/push.qc
@@ -6,34 +6,61 @@
// constants
//======================================================================

+#ifdef SSQC
const float TRIGGER_PUSH_ONCE = 1; // only trigger once
const float TRIGGER_PUSH_STARTOFF = 8; // trigger will start off
const float TRIGGER_PUSH_SILENT = 16; // push silently
const float TRIGGER_PUSH_NOISE = 32; // use custom sound via noise key/value
+#endif
+
+#if defined(CSQC) || defined(SSQC)
+const float TRIGGER_PUSH_STATE_TARGETED = 1;
+#endif

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

+#ifdef SSQC
vector(float a, float b, float c) solve_quadratic;
+#endif

// base_trigger_push
+#ifdef CSQC
+void(float isnew) base_trigger_push_netreceive;
+#endif
+#ifdef SSQC
+float(entity to, float netflags) base_trigger_push_netsend;
vector(vector org, entity tgt, float ht) base_trigger_push_calculatevelocity;
void() base_trigger_push_findtarget;
+#endif
+#if defined(CSQC) || defined(SSQC)
void() base_trigger_push_touch;
+#endif

// trigger_push
// void() trigger_push_use;
+#if defined(CSQC) || defined(SSQC)
void(entity e) trigger_push_init;
+#endif
+#ifdef SSQC
void() trigger_push;
+#endif

// trigger_push_custom
+#ifdef SSQC
void() trigger_push_custom_use;
+#endif
+#if defined(CSQC) || defined(SSQC)
void(entity e) trigger_push_custom_init;
+#endif
+#ifdef SSQC
void() trigger_push_custom;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// solve_quadratic -- from Nexuiz source code; original can be found at
// https://github.com/smlinux/nexuiz/blob/master/data/qcsrc/common/util.qc
@@ -41,8 +68,8 @@ void() trigger_push_custom;
vector(float a, float b, float c) solve_quadratic =
{
// ax^2 + bx + c = 0
- vector v = '0 0 0';
- float D;
+ local vector v = '0 0 0';
+ local float D;
if (a == 0)
{
if (b != 0)
@@ -92,10 +119,102 @@ vector(float a, float b, float c) solve_quadratic =
}
return v;
};
+#endif

//----------------------------------------------------------------------
// class base_trigger_push: base_trigger
// {
+#ifdef CSQC
+ //--------------------------------------------------------------
+ void(float isnew) base_trigger_push_netreceive =
+ {
+ local float netflags = ReadFloat ();
+
+ if (netflags & BASE_TRIGGER_NET_ORIGIN)
+ {
+ self.origin_x = ReadCoord ();
+ self.origin_y = ReadCoord ();
+ self.origin_z = ReadCoord ();
+ }
+
+ if (netflags & BASE_TRIGGER_NET_SIZE)
+ {
+ self.mins_x = ReadCoord ();
+ self.mins_y = ReadCoord ();
+ self.mins_z = ReadCoord ();
+ self.maxs_x = ReadCoord ();
+ self.maxs_y = ReadCoord ();
+ self.maxs_z = ReadCoord ();
+ }
+
+ if (netflags & BASE_TRIGGER_NET_MOVEDIR)
+ {
+ self.movedir_x = ReadCoord ();
+ self.movedir_y = ReadCoord ();
+ self.movedir_z = ReadCoord ();
+ }
+
+ if (netflags & BASE_TRIGGER_NET_STATE)
+ self.state = ReadByte ();
+
+ if (netflags & BASE_TRIGGER_NET_ESTATE)
+ self.estate = ReadFloat ();
+
+ if (isnew)
+ if (self.classtype == CT_TRIGGER_PUSH)
+ trigger_push_init (self);
+ else if (self.classtype == CT_TRIGGER_PUSH_CUSTOM)
+ trigger_push_custom_init (self);
+
+ // make sure size and origin are set -- CEV
+ if (netflags & BASE_TRIGGER_NET_SIZE)
+ setsize (self, self.mins, self.maxs);
+
+ if (netflags & BASE_TRIGGER_NET_ORIGIN)
+ setorigin (self, self.origin);
+ };
+#endif
+
+#ifdef SSQC
+ //--------------------------------------------------------------
+ float(entity to, float netflags) base_trigger_push_netsend =
+ {
+ WriteFloat (MSG_ENTITY, self.classtype);
+ WriteFloat (MSG_ENTITY, netflags);
+
+ if (netflags & BASE_TRIGGER_NET_ORIGIN)
+ {
+ WriteCoord (MSG_ENTITY, self.origin_x);
+ WriteCoord (MSG_ENTITY, self.origin_y);
+ WriteCoord (MSG_ENTITY, self.origin_z);
+ }
+
+ if (netflags & BASE_TRIGGER_NET_SIZE)
+ {
+ WriteCoord (MSG_ENTITY, self.mins_x);
+ WriteCoord (MSG_ENTITY, self.mins_y);
+ WriteCoord (MSG_ENTITY, self.mins_z);
+ WriteCoord (MSG_ENTITY, self.maxs_x);
+ WriteCoord (MSG_ENTITY, self.maxs_y);
+ WriteCoord (MSG_ENTITY, self.maxs_z);
+ }
+
+ if (netflags & BASE_TRIGGER_NET_MOVEDIR)
+ {
+ WriteCoord (MSG_ENTITY, self.movedir_x);
+ WriteCoord (MSG_ENTITY, self.movedir_y);
+ WriteCoord (MSG_ENTITY, self.movedir_z);
+ }
+
+ if (netflags & BASE_TRIGGER_NET_STATE)
+ WriteByte (MSG_ENTITY, self.state);
+
+ if (netflags & BASE_TRIGGER_NET_ESTATE)
+ WriteFloat (MSG_ENTITY, self.estate);
+
+ return TRUE;
+ };
+
//--------------------------------------------------------------
// trigger_push_calculatevelocity
//
@@ -229,9 +348,14 @@ vector(float a, float b, float c) solve_quadratic =
org_z = self.absmax_z - -24; // - PL_MIN_z;
self.movedir = base_trigger_push_calculatevelocity (
org, self.enemy, self.height);
+ self.state = TRIGGER_PUSH_STATE_TARGETED;
+ self.SendFlags |= BASE_TRIGGER_NET_MOVEDIR;
+ self.SendFlags |= BASE_TRIGGER_NET_STATE;
}
};
+#endif

+#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void() base_trigger_push_touch =
{
@@ -242,33 +366,46 @@ vector(float a, float b, float c) solve_quadratic =
if (other.movetype == MOVETYPE_NOCLIP)
return;

+ #ifdef SSQC
// try to find target again if necessary
if (self.target && (!self.enemy))
base_trigger_push_findtarget ();

// we have a target, set movedir accordingly
if (self.target && self.enemy)
+ {
self.movedir = base_trigger_push_calculatevelocity (
other.origin, self.enemy, self.height);
+ self.state = TRIGGER_PUSH_STATE_TARGETED;
+ self.SendFlags |= BASE_TRIGGER_NET_MOVEDIR |
+ BASE_TRIGGER_NET_STATE;
+ }
+ #endif

if (other.classtype == CT_PROJECTILE_GRENADE)
{
- if (self.target && self.enemy)
+ if (self.state == TRIGGER_PUSH_STATE_TARGETED)
other.velocity = self.movedir;
else
other.velocity = self.speed * self.movedir * 10;
}
else if (other.health > 0)
{
- if (self.target && self.enemy)
+ if (self.state == TRIGGER_PUSH_STATE_TARGETED)
other.velocity = self.movedir;
else
other.velocity = self.speed * self.movedir * 10;

- if (other.classtype == CT_PLAYER &&
- !(self.spawnflags & TRIGGER_PUSH_SILENT))
+ if (other.classtype == CT_PLAYER)
{
- if (other.fly_sound < time)
+ // signal pmove that player has touched a
+ // push brush -- CEV
+ other.pmove_flags |= PMF_PUSHED;
+
+ #ifdef SSQC
+ // carry on with normal push sound behavior
+ if (!(self.spawnflags & TRIGGER_PUSH_SILENT) &&
+ other.fly_sound < time)
{
if (!(self.spawnflags &
TRIGGER_PUSH_NOISE))
@@ -276,22 +413,26 @@ vector(float a, float b, float c) solve_quadratic =
other.fly_sound = time + 1.5;
sound (other, CHAN_AUTO,
"ambience/windfly.wav",
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
}
else
{
other.fly_sound = time + 1.5;
sound (other, CHAN_AUTO,
self.noise,
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
}
}
+ #endif
}
}

+ #ifdef SSQC
if (self.spawnflags & TRIGGER_PUSH_ONCE)
remove (self);
+ #endif
};
+#endif
// };

/*QUAKED trigger_push (.5 .5 .5) ? TRIGGER_PUSH_ONCE 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
@@ -310,6 +451,7 @@ Pushes the player
}
*/

+#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void(entity e) trigger_push_init =
{
@@ -318,6 +460,8 @@ Pushes the player
e.touch = base_trigger_push_touch;

base_trigger_init (e);
+
+ #ifdef SSQC
precache_sound ("ambience/windfly.wav");

if (!e.speed)
@@ -334,8 +478,20 @@ Pushes the player
}

sub_checkwaiting (e);
+
+ e.SendEntity = base_trigger_push_netsend;
+ e.SendFlags |= BASE_TRIGGER_NET_ORIGIN |
+ BASE_TRIGGER_NET_SIZE |
+ BASE_TRIGGER_NET_STATE |
+ BASE_TRIGGER_NET_ESTATE |
+ BASE_TRIGGER_NET_SPEED;
+ if (e.movedir)
+ e.SendFlags |= BASE_TRIGGER_NET_MOVEDIR;
+ #endif
};
+#endif

+#ifdef SSQC
//--------------------------------------------------------------
void() trigger_push =
{
@@ -345,6 +501,7 @@ Pushes the player

trigger_push_init (self);
};
+#endif
// };

/*QUAKED trigger_push_custom (.5 .5 .5) ? TRIGGER_PUSH_ONCE TRIGGER_PUSH_STARTOFF TRIGGER_PUSH_SILENT 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
@@ -366,6 +523,7 @@ Adapted from Hipnotic's func_togglewall
//----------------------------------------------------------------------
// class trigger_push_custom: base_trigger_push
// {
+#ifdef SSQC
//--------------------------------------------------------------
// dumptruck_ds was based on hipnotic blocker_use now Alkaline estate
//--------------------------------------------------------------
@@ -376,16 +534,23 @@ Adapted from Hipnotic's func_togglewall
else
self.estate = STATE_INACTIVE;
};
+#endif

+#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void(entity e) trigger_push_custom_init =
{
e.classname = "trigger_push_custom";
e.classtype = CT_TRIGGER_PUSH_CUSTOM;
e.touch = base_trigger_push_touch;
+
+ #ifdef SSQC
e.use = trigger_push_custom_use;
+ #endif

base_trigger_init (e);
+
+ #ifdef SSQC
precache_sound ("ambience/windfly.wav");

if (e.spawnflags & TRIGGER_PUSH_STARTOFF)
@@ -408,8 +573,20 @@ Adapted from Hipnotic's func_togglewall
}

sub_checkwaiting (e);
+
+ e.SendEntity = base_trigger_push_netsend;
+ e.SendFlags |= BASE_TRIGGER_NET_ORIGIN |
+ BASE_TRIGGER_NET_SIZE |
+ BASE_TRIGGER_NET_STATE |
+ BASE_TRIGGER_NET_ESTATE |
+ BASE_TRIGGER_NET_SPEED;
+ if (e.movedir)
+ e.SendFlags |= BASE_TRIGGER_NET_MOVEDIR;
+ #endif
};
+#endif

+#ifdef SSQC
//--------------------------------------------------------------
void() trigger_push_custom =
{
@@ -419,4 +596,5 @@ Adapted from Hipnotic's func_togglewall

trigger_push_custom_init (self);
};
+#endif
// };

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

Diff qc/triggers/relay.qc

diff --git a/qc/triggers/relay.qc b/qc/triggers/relay.qc
index 36db7e1..25d1b89 100644
--- a/qc/triggers/relay.qc
+++ b/qc/triggers/relay.qc
@@ -6,13 +6,16 @@
// forward declarations
//======================================================================

+#ifdef SSQC
// trigger_relay
// void() trigger_relay_use;
void(entity e) trigger_relay_init;
void() trigger_relay;
+#endif

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

+#ifdef SSQC
/*QUAKED trigger_relay (.5 .5 .5) (-8 -8 -8) (8 8 8) 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
This fixed size trigger cannot be touched, it can only be fired by other events. It can contain killtargets, targets, delays, and messages.
*/
@@ -47,3 +50,4 @@ This fixed size trigger cannot be touched, it can only be fired by other events.
trigger_relay_init (self);
};
// };
+#endif

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

Diff qc/triggers/secret.qc

diff --git a/qc/triggers/secret.qc b/qc/triggers/secret.qc
index 3e562f2..1286dc9 100644
--- a/qc/triggers/secret.qc
+++ b/qc/triggers/secret.qc
@@ -6,11 +6,15 @@
// forward declarations
//======================================================================

+#ifdef SSQC
+// trigger_secret
void(entity e) trigger_secret_init;
void() trigger_secret;
+#endif

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

+#ifdef SSQC
/*QUAKED trigger_secret (.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
secret counter trigger
sounds
@@ -60,3 +64,4 @@ set "message" to text string
trigger_secret_init (self);
};
// };
+#endif

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

Diff qc/triggers/setcount.qc

diff --git a/qc/triggers/setcount.qc b/qc/triggers/setcount.qc
index 1db6c75..9500d35 100644
--- a/qc/triggers/setcount.qc
+++ b/qc/triggers/setcount.qc
@@ -6,13 +6,17 @@
// forward declarations
//======================================================================

+#ifdef SSQC
+// target_setcount
void(string name, .string fld) target_setcount_set;
void() target_setcount_use;
void(entity e) target_setcount_init;
void() target_setcount;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// target_setcount
//----------------------------------------------------------------------
@@ -96,3 +100,4 @@ void() target_setcount;
target_setcount_init (self);
};
// };
+#endif

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

Diff qc/triggers/setgravity.qc

diff --git a/qc/triggers/setgravity.qc b/qc/triggers/setgravity.qc
index 154cbbc..fe7d382 100644
--- a/qc/triggers/setgravity.qc
+++ b/qc/triggers/setgravity.qc
@@ -14,17 +14,36 @@
// constants
//======================================================================

+#if defined(CSQC) || defined(SSQC)
const float TRIGGER_SETGRAVITY_STARTOFF = 8; // trigger will start off

+// trigger net constants start at 1<<4
+const float TRIGGER_SETGRAVITY_NET_GRAVITY = 1<<6; // .gravity has changed
+#endif
+
//======================================================================
// forward declarations
//======================================================================

// trigger_setgravity
+#ifdef CSQC
+void(float isnew) trigger_setgravity_netreceive;
+#endif
+#ifdef SSQC
+float(entity to, float netflags) trigger_setgravity_netsend;
+#endif
+#if defined(CSQC) || defined(SSQC)
void() trigger_setgravity_touch;
+#endif
+#ifdef SSQC
void() trigger_setgravity_use;
+#endif
+#if defined(CSQC) || defined(SSQC)
void(entity e) trigger_setgravity_init;
+#endif
+#ifdef SSQC
void() trigger_setgravity;
+#endif

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

@@ -54,6 +73,75 @@ set the gravity of a player
//----------------------------------------------------------------------
// class trigger_setgravity: base_trigger
// {
+#ifdef CSQC
+ //--------------------------------------------------------------
+ void(float isnew) trigger_setgravity_netreceive =
+ {
+ local float netflags = ReadFloat ();
+
+ if (netflags & BASE_TRIGGER_NET_ORIGIN)
+ {
+ self.origin_x = ReadCoord ();
+ self.origin_y = ReadCoord ();
+ self.origin_z = ReadCoord ();
+ }
+
+ if (netflags & BASE_TRIGGER_NET_SIZE)
+ {
+ self.mins_x = ReadCoord ();
+ self.mins_y = ReadCoord ();
+ self.mins_z = ReadCoord ();
+ self.maxs_x = ReadCoord ();
+ self.maxs_y = ReadCoord ();
+ self.maxs_z = ReadCoord ();
+ }
+
+ if (netflags & TRIGGER_SETGRAVITY_NET_GRAVITY)
+ self.gravity = ReadFloat ();
+
+ if (netflags & BASE_TRIGGER_NET_ESTATE)
+ self.estate = ReadFloat ();
+
+ if (isnew)
+ trigger_setgravity_init (self);
+ };
+#endif
+
+#ifdef SSQC
+ //--------------------------------------------------------------
+ float(entity to, float netflags) trigger_setgravity_netsend =
+ {
+ WriteFloat (MSG_ENTITY, self.classtype);
+ WriteFloat (MSG_ENTITY, netflags);
+
+ if (netflags & BASE_TRIGGER_NET_ORIGIN)
+ {
+ WriteCoord (MSG_ENTITY, self.origin_x);
+ WriteCoord (MSG_ENTITY, self.origin_y);
+ WriteCoord (MSG_ENTITY, self.origin_z);
+ }
+
+ if (netflags & BASE_TRIGGER_NET_SIZE)
+ {
+ WriteCoord (MSG_ENTITY, self.mins_x);
+ WriteCoord (MSG_ENTITY, self.mins_y);
+ WriteCoord (MSG_ENTITY, self.mins_z);
+ WriteCoord (MSG_ENTITY, self.maxs_x);
+ WriteCoord (MSG_ENTITY, self.maxs_y);
+ WriteCoord (MSG_ENTITY, self.maxs_z);
+ }
+
+ if (netflags & TRIGGER_SETGRAVITY_NET_GRAVITY)
+ WriteFloat (MSG_ENTITY, self.gravity);
+
+ if (netflags & BASE_TRIGGER_NET_ESTATE)
+ WriteFloat (MSG_ENTITY, self.estate);
+
+ return TRUE;
+ };
+#endif
+
+#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
// from Copper -- dumptruck_ds
//--------------------------------------------------------------
@@ -65,17 +153,17 @@ set the gravity of a player
return;
*/

- if (self.estate != STATE_ACTIVE)
- return;
-
- local float grav;
-
// This is commented out so that the changing gravity will
// affect everything, if you don't want to use all affecting
// gravity changes, then uncomment these two lines.
// if (other.classtype != CT_PLAYER)
// return;

+ if (self.estate != STATE_ACTIVE)
+ return;
+
+ local float grav;
+
if (self.gravity == -1)
grav = 1;
else
@@ -89,7 +177,9 @@ set the gravity of a player
else
other.gravity = grav;
};
+#endif

+#ifdef SSQC
//--------------------------------------------------------------
// dumptruck_ds based on hipnotic blocker_use
//--------------------------------------------------------------
@@ -99,18 +189,29 @@ set the gravity of a player
self.estate = STATE_ACTIVE;
else
self.estate = STATE_INACTIVE;
+
+ self.SendFlags |= BASE_TRIGGER_NET_ESTATE;
};
+#endif

+#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void(entity e) trigger_setgravity_init =
{
e.classname = "trigger_setgravity";
e.classtype = CT_TRIGGER_SETGRAVITY;
e.touch = trigger_setgravity_touch;
- e.use = trigger_setgravity_use;

base_trigger_init (e);

+ #ifdef CSQC
+ setorigin (e, e.origin);
+ setsize (e, e.mins, e.maxs);
+ #endif
+
+ #ifdef SSQC
+ e.use = trigger_setgravity_use;
+
// dumptruck_ds
if (e.spawnflags & TRIGGER_SETGRAVITY_STARTOFF)
e.estate = STATE_INACTIVE;
@@ -121,8 +222,17 @@ set the gravity of a player
e.gravity = ((e.gravity - 1) / 100);

sub_checkwaiting (e);
+
+ e.SendEntity = trigger_setgravity_netsend;
+ e.SendFlags = e.SendFlags | BASE_TRIGGER_NET_ORIGIN |
+ BASE_TRIGGER_NET_SIZE |
+ TRIGGER_SETGRAVITY_NET_GRAVITY |
+ BASE_TRIGGER_NET_ESTATE;
+ #endif
};
+#endif

+#ifdef SSQC
//--------------------------------------------------------------
void() trigger_setgravity =
{
@@ -132,4 +242,5 @@ set the gravity of a player

trigger_setgravity_init (self);
};
+#endif
// };

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

Diff qc/triggers/setskill.qc

diff --git a/qc/triggers/setskill.qc b/qc/triggers/setskill.qc
index 149e2ed..361de6d 100644
--- a/qc/triggers/setskill.qc
+++ b/qc/triggers/setskill.qc
@@ -6,13 +6,16 @@
// forward declarations
//======================================================================

+#ifdef SSQC
// trigger_setskill
void() trigger_setskill_touch;
void(entity e) trigger_setskill_init;
void() trigger_setskill;
+#endif

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

+#ifdef SSQC
/*QUAKED trigger_setskill (.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
sets skill level to the value of "message".
Only used on start map.
@@ -51,3 +54,4 @@ Only used on start map.
trigger_setskill_init (self);
};
// };
+#endif

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

Diff qc/triggers/setstate.qc

diff --git a/qc/triggers/setstate.qc b/qc/triggers/setstate.qc
index 2dcf706..ef8aeec 100644
--- a/qc/triggers/setstate.qc
+++ b/qc/triggers/setstate.qc
@@ -6,14 +6,17 @@
// constants
//======================================================================

+#ifdef SSQC
const float SETSTATE_STARTOFF = 1;
const float SETSTATE_CLOSEALLDOORS = 2;
const float SETSTATE_DONTRESETBUTTON = 4;
+#endif

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

+#ifdef SSQC
// target_setstate
float(entity e) target_setstate_getestate;
void(entity e, float state, float flags) target_setstate_setestate;
@@ -24,9 +27,11 @@ void() target_setstate_use;
void() target_setstate_think_startoff;
void(entity e) target_setstate_init;
void() target_setstate;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// target_setstate
//----------------------------------------------------------------------
@@ -213,3 +218,4 @@ void() target_setstate;
target_setstate_init (self);
};
// };
+#endif

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

Diff qc/triggers/shake.qc

diff --git a/qc/triggers/shake.qc b/qc/triggers/shake.qc
index c67ca3d..7794fb4 100644
--- a/qc/triggers/shake.qc
+++ b/qc/triggers/shake.qc
@@ -6,20 +6,25 @@
// constants
//======================================================================

+#ifdef SSQC
const float TRIGGER_SHAKE_VIEWONLY = 1;
+#endif

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

+#ifdef SSQC
// trigger_shake
void() trigger_shake_think;
void() trigger_shake_use;
void(entity e) trigger_shake_init;
void() trigger_shake;
+#endif

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

+#ifdef SSQC
/*QUAKED trigger_shake (.5 0 .5) (-8 -8 -8) (8 8 8) TRIGGER_SHAKE_VIEWONLY 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

Earthquake trigger - shakes players in it's radius when active.
@@ -48,7 +53,7 @@ TRIGGER_SHAKE_VIEWONLY Shakes the view, but player movement is not affected

if (self.noise1 != "")
sound (self, CHAN_VOICE, self.noise1,
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);

return;
}
@@ -72,6 +77,7 @@ TRIGGER_SHAKE_VIEWONLY Shakes the view, but player movement is not affected
// shake up the view
p.punchangle_x = -1 * (random() +
(0.025 * self.dmg * d));
+ p.SendFlags |= PLAYER_NET_PUNCHANGLE;

// push the player around
if (p.flags & FL_ONGROUND
@@ -105,7 +111,8 @@ TRIGGER_SHAKE_VIEWONLY Shakes the view, but player movement is not affected

// Start...
if (self.noise != "")
- sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, self.noise,
+ VOL_HIGH, ATTN_NORM);

self.attack_finished = time + self.wait;
self.nextthink = time + 0.1;
@@ -150,3 +157,4 @@ TRIGGER_SHAKE_VIEWONLY Shakes the view, but player movement is not affected
trigger_shake_init (self);
};
// };
+#endif

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

Diff qc/triggers/take_weapon.qc

diff --git a/qc/triggers/take_weapon.qc b/qc/triggers/take_weapon.qc
index 271db21..640a235 100644
--- a/qc/triggers/take_weapon.qc
+++ b/qc/triggers/take_weapon.qc
@@ -11,12 +11,15 @@
// forward declarations
//======================================================================

+#ifdef SSQC
void() trigger_take_weapon_touch;
void(entity e) trigger_take_weapon_init;
void() trigger_take_weapon;
+#endif

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

+#ifdef SSQC
/*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.
@@ -72,3 +75,4 @@ Removes shotgun upon touch. You can also set "reset_items" in the worldspawn ent
trigger_take_weapon_init (self);
};
// };
+#endif

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

Diff qc/triggers/teleport.qc

diff --git a/qc/triggers/teleport.qc b/qc/triggers/teleport.qc
index a611335..501ffcf 100644
--- a/qc/triggers/teleport.qc
+++ b/qc/triggers/teleport.qc
@@ -7,29 +7,35 @@
// constants
//======================================================================

+#ifdef SSQC
const float TRIGGER_TELEPORT_ONLYPLAYER = 1;
const float TRIGGER_TELEPORT_SILENT = 2;
const float TRIGGER_TELEPORT_RANDOM = 4;
const float TRIGGER_TELEPORT_STEALTH = 8;
const float TRIGGER_TELEPORT_ONLYMONSTER = 16;
const float TRIGGER_TELEPORT_DD = 32;
+#endif

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

+#ifdef SSQC
// tfog & tdeath
void() spawn_tfog_think;
void(vector org) spawn_tfog;
void() spawn_tdeath_touch;
void(vector org, entity death_owner) spawn_tdeath;
+#endif

+#ifdef SSQC
// trigger_teleport
entity() trigger_teleport_randomspot;
void() trigger_teleport_touch;
void() trigger_teleport_use;
void(entity e) trigger_teleport_init;
void() trigger_teleport;
+#endif

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

@@ -37,6 +43,7 @@ void() trigger_teleport;
// teleporter fog & teleporter death
//======================================================================

+#ifdef SSQC
//----------------------------------------------------------------------
void() spawn_tfog_think =
{
@@ -55,7 +62,7 @@ void() spawn_tfog_think =
else
tmpstr = "misc/r_tele5.wav";

- sound (self, CHAN_VOICE, tmpstr, 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, tmpstr, VOL_HIGH, ATTN_NORM);
remove (self);
};

@@ -166,11 +173,13 @@ void(vector org, entity death_owner) spawn_tdeath =
// make sure even still objects get hit
force_retouch = 2;
};
+#endif

//======================================================================
// trigger_teleport
//======================================================================

+#ifdef SSQC
/*QUAKED trigger_teleport (.5 .5 .5) ? TRIGGER_TELEPORT_ONLYPLAYER TRIGGER_TELEPORT_SILENT TRIGGER_TELEPORT_RANDOM TRIGGER_TELEPORT_STEALTH 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

Any object touching this will be transported to the corresponding
@@ -390,7 +399,7 @@ TRIGGER_TELEPORT_ONLYMONSTER(16) will only teleport monsters
precache_sound ("ambience/hum1.wav");
// volume was 0.5 -- CEV
ambientsound ((e.mins + e.maxs) * 0.5,
- "ambience/hum1.wav", 0.3, ATTN_STATIC);
+ "ambience/hum1.wav", VOL_LOW, ATTN_STATIC);
}

sub_checkwaiting (e);
@@ -406,3 +415,4 @@ TRIGGER_TELEPORT_ONLYMONSTER(16) will only teleport monsters
trigger_teleport_init (self);
};
// };
+#endif

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

Diff qc/triggers/textstory.qc

diff --git a/qc/triggers/textstory.qc b/qc/triggers/textstory.qc
index 05c8f22..275b598 100644
--- a/qc/triggers/textstory.qc
+++ b/qc/triggers/textstory.qc
@@ -6,24 +6,31 @@
// constants
//======================================================================

+#ifdef SSQC
const float TEXTSTORY_SILENT = 1;
const float TEXTSTORY_NOFADE = 2;
+#endif

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

+#ifdef SSQC
// base_textstory
void(entity controller) base_textstory_hide;
void(entity controller) base_textstory_show;
+#endif

+#ifdef SSQC
// trigger_textstory
void() trigger_textstory_hide;
void() trigger_textstory_show;
void() trigger_textstory_touch;
void(entity e) trigger_textstory_init;
void() trigger_textstory;
+#endif

+#ifdef SSQC
// target_textstory_helper
void() target_textstory_helper_hide;
void() target_textstory_helper_show;
@@ -31,15 +38,19 @@ entity(entity src, entity tgt, float nthink, float atkfinished)
spawn_target_textstory_helper;
void(entity e) target_textstory_helper_init;
void() target_textstory_helper;
+#endif

+#ifdef SSQC
// target_textstory
void(entity tgt) target_textstory_spawn_helper;
void() target_textstory_use;
void(entity e) target_textstory_init;
void() target_textstory;
+#endif

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

+#ifdef SSQC
//----------------------------------------------------------------------
// base textstory class
//----------------------------------------------------------------------
@@ -57,8 +68,8 @@ void() target_textstory;
centerprint (self.enemy, "");

if (controller.noise2 != __NULL__ && controller.noise2 != "")
- sound (self.enemy, CHAN_BODY, controller.noise2, 1,
- ATTN_NORM);
+ sound (self.enemy, CHAN_BODY, controller.noise2,
+ VOL_HIGH, ATTN_NORM);

if (!(controller.spawnflags & TEXTSTORY_NOFADE))
csf_fade (self.enemy, 0, '0 0 0', 0.5);
@@ -82,7 +93,7 @@ void() target_textstory;
controller.noise1 != "")
{
sound (self.enemy, CHAN_BODY, controller.noise1,
- 1, ATTN_NORM);
+ VOL_HIGH, ATTN_NORM);
}

if (!(controller.spawnflags & TEXTSTORY_NOFADE))
@@ -99,7 +110,9 @@ void() target_textstory;
self.state = 1;
};
// };
+#endif

+#ifdef SSQC
//----------------------------------------------------------------------
// trigger_textstory -- centerprint text when inside this trigger
//----------------------------------------------------------------------
@@ -200,7 +213,9 @@ void() target_textstory;
trigger_textstory_init (self);
};
// };
+#endif

+#ifdef SSQC
//------------------------------------------------------------------------------
// helper class spawned by target_textstory below
//------------------------------------------------------------------------------
@@ -267,7 +282,9 @@ void() target_textstory;
target_textstory_helper_init (self);
};
// };
+#endif

+#ifdef SSQC
//----------------------------------------------------------------------
// target_textstory: centerprint a message for an amount of time when used
//----------------------------------------------------------------------
@@ -346,3 +363,4 @@ void() target_textstory;
target_textstory_init (self);
};
// };
+#endif

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

Diff qc/triggers/usekey.qc

diff --git a/qc/triggers/usekey.qc b/qc/triggers/usekey.qc
index 1ce0846..ac82046 100644
--- a/qc/triggers/usekey.qc
+++ b/qc/triggers/usekey.qc
@@ -14,21 +14,27 @@
// constants
//======================================================================

+#ifdef SSQC
const float TRIGGER_USEKEY_SILV_KEY = 8;
const float TRIGGER_USEKEY_GOLD_KEY = 16;
+#endif

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

+#ifdef SSQC
+// trigger_usekey
void() trigger_usekey_unlock;
void() trigger_usekey_use;
void() trigger_usekey_touch;
void(entity e) trigger_usekey_init;
void() trigger_usekey;
+#endif

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

+#ifdef SSQC
/*
QUAKED trigger_usekey (0 .5 0) ? X X X
TRIGGER_USEKEY_SILV_KEY TRIGGER_USEKEY_GOLD_KEY X X X
@@ -168,3 +174,4 @@ targets. Must be targeted at one or more entities.
trigger_usekey_init (self);
};
// };
+#endif

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

Diff qc/triggers/void.qc

diff --git a/qc/triggers/void.qc b/qc/triggers/void.qc
index a01ece3..cfff6d3 100644
--- a/qc/triggers/void.qc
+++ b/qc/triggers/void.qc
@@ -11,19 +11,25 @@
// constants
//======================================================================

+#ifdef SSQC
const float TRIGGER_VOID_MONSTER_SAFE = 1;
const float TRIGGER_VOID_PLAYER_SAFE = 2;
+#endif

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

+#ifdef SSQC
+// trigger_void
void() trigger_void_touch;
void(entity e) trigger_void_init;
void() trigger_void;
+#endif

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

+#ifdef SSQC
/*
QUAKED trigger_void (.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
@@ -103,3 +109,4 @@ Removes monsters, gibs, ammo, etc... also kills player.
trigger_void_init (self);
};
// };
+#endif

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

Diff qc/utility.qc

diff --git a/qc/utility.qc b/qc/utility.qc
index 717b662..e672c27 100644
--- a/qc/utility.qc
+++ b/qc/utility.qc
@@ -6,18 +6,6 @@
// forward declarations
//======================================================================

-void(string s1, string s2) dprint2;
-void(string s1, string s2, string s3) dprint3;
-void(string s1, string s2, string s3, string s4) dprint4;
-void(string s1, string s2, string s3, string s4, string s5) dprint5;
-void(string s1, string s2, string s3, string s4, string s5, string s6) dprint6;
-void(string s1, string s2, string s3, string s4, string s5, string s6,
- string s7) dprint7;
-void(string s1, string s2, string s3, string s4, string s5, string s6,
- string s7, string s8) dprint8;
-void(string s1, string s2, string s3, string s4, string s5, string s6,
- string s7, string s8, string s9) dprint9;
-
float(float in) bprint_int;
float(float in) zeroconvert;
float(float in, float def) zeroconvertdefault;
@@ -30,95 +18,6 @@ void(entity client, float f) stuffcmd_float;

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

-//----------------------------------------------------------------------
-// dprint shims
-//----------------------------------------------------------------------
-void(string s1, string s2) dprint2 =
-{
- dprint (s1);
- dprint (s2);
-};
-
-//----------------------------------------------------------------------
-void(string s1, string s2, string s3) dprint3 =
-{
- dprint (s1);
- dprint (s2);
- dprint (s3);
-};
-
-//----------------------------------------------------------------------
-void(string s1, string s2, string s3, string s4) dprint4 =
-{
- dprint (s1);
- dprint (s2);
- dprint (s3);
- dprint (s4);
-};
-
-//----------------------------------------------------------------------
-void(string s1, string s2, string s3, string s4, string s5) dprint5 =
-{
- dprint (s1);
- dprint (s2);
- dprint (s3);
- dprint (s4);
- dprint (s5);
-};
-
-//----------------------------------------------------------------------
-void(string s1, string s2, string s3, string s4, string s5, string s6) dprint6 =
-{
- dprint (s1);
- dprint (s2);
- dprint (s3);
- dprint (s4);
- dprint (s5);
- dprint (s6);
-};
-
-//----------------------------------------------------------------------
-void(string s1, string s2, string s3, string s4, string s5, string s6,
- string s7) dprint7 =
-{
- dprint (s1);
- dprint (s2);
- dprint (s3);
- dprint (s4);
- dprint (s5);
- dprint (s6);
- dprint (s7);
-};
-
-//----------------------------------------------------------------------
-void(string s1, string s2, string s3, string s4, string s5, string s6,
- string s7, string s8) dprint8 =
-{
- dprint (s1);
- dprint (s2);
- dprint (s3);
- dprint (s4);
- dprint (s5);
- dprint (s6);
- dprint (s7);
- dprint (s8);
-};
-
-//----------------------------------------------------------------------
-void(string s1, string s2, string s3, string s4, string s5, string s6,
- string s7, string s8, string s9) dprint9 =
-{
- dprint (s1);
- dprint (s2);
- dprint (s3);
- dprint (s4);
- dprint (s5);
- dprint (s6);
- dprint (s7);
- dprint (s8);
- dprint (s9);
-};
-
//======================================================================
// Sourced from utility.qc from smej2
//======================================================================

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

Diff qc/world.qc

diff --git a/qc/world.qc b/qc/world.qc
index bfb29fb..b7df6e5 100644
--- a/qc/world.qc
+++ b/qc/world.qc
@@ -6,13 +6,21 @@
// constants
//======================================================================

-const float KNOWN_RELEASE_NOT = 0; // known_release values -- iw
-const float KNOWN_RELEASE_ID1 = 1;
-const float KNOWN_RELEASE_FUNC_MAPJAMX = 2;
+#if defined(CSQC) || defined(SSQC)
+enum
+{
+ KNOWN_RELEASE_NOT, // known_release values -- iw
+ KNOWN_RELEASE_ID1,
+ KNOWN_RELEASE_FUNC_MAPJAMX,
+ KNOWN_RELEASE_DMD, // Deathmatch Dimension
+ KNOWN_RELEASE_QUAKE3,
+ KNOWN_RELEASE_DOTP // Dimension Of The Past
+};

const float WORLDTYPE_MEDIEVAL = 0; // worldtype values
const float WORLDTYPE_METAL = 1;
const float WORLDTYPE_BASE = 2;
+#endif

//======================================================================
// globals
@@ -25,6 +33,7 @@ float known_release; // unique ID for a release
nosave float *world_sounds; // via Spike fun times! nosave=noclobber
#endif

+#if defined(CSQC) || defined(SSQC)
float world_airstep; // latched cvars, reset on world spawn
float world_bigcoords;
float world_clrun;
@@ -35,12 +44,13 @@ float world_standardphysics;
float world_walljump;
float world_clforwardspeed;
float world_clsidespeed;
+#endif

//======================================================================
// fields
//======================================================================

-#ifdef SSQC
+#if defined(CSQC) || defined(SSQC)
.string wad;
.string map;
.float worldtype; // 0=medieval 1=metal 2=base
@@ -51,11 +61,18 @@ float world_clsidespeed;
// forward declarations
//======================================================================

-#ifdef SSQC
+#if defined(CSQC) || defined(SSQC)
void() world_latched_cvars;
+#endif
+#ifdef SSQC
void() world_weapon_precache;
void() world_detect_known_release;
+float(entity e, vector offset) world_surface_type;
+#endif
+#if defined(CSQC) || defined(SSQC)
void() worldspawn;
+#endif
+#ifdef SSQC
void() bodyque;
void() InitBodyQue;
void(entity ent) CopyToBodyQue;
@@ -87,7 +104,7 @@ void() world_latched_cvars =
//----------------------------------------------------------------------
void() world_weapon_precache =
{
- precache_sound ("weapons/r_exp3.wav"); // new rocket explosion
+ precache_sound ("weapons/r_exp3.wav"); // rocket explosion
precache_sound ("weapons/rocket1i.wav");// spike gun
precache_sound ("weapons/sgun1.wav");
precache_sound ("weapons/guncock.wav"); // player shotgun
@@ -277,6 +294,9 @@ void() world_detect_known_release =

if (mapname == "dm1" || mapname == "dm2" || mapname == "dm3" ||
mapname == "dm4" || mapname == "dm5" || mapname == "dm6" ||
+ // include the remaining standard DM maps -- CEV
+ mapname == "aerowalk" || mapname == "ztndm3" ||
+ // back to id1
mapname == "e1m1" || mapname == "e1m2" || mapname == "e1m3" ||
mapname == "e1m4" || mapname == "e1m5" || mapname == "e1m6" ||
mapname == "e1m7" || mapname == "e1m8" ||
@@ -295,8 +315,7 @@ void() world_detect_known_release =
known_release = KNOWN_RELEASE_ID1;
release_name = "id1";
}
-
- if (mapname == "jamx_artistical" || mapname == "jamx_bloodshot" ||
+ else if (mapname == "jamx_artistical" || mapname == "jamx_bloodshot" ||
mapname == "jamx_fw" || mapname == "jamx_hcm" ||
mapname == "jamx_ionous" || mapname == "jamx_jcr" ||
mapname == "jamx_kalebclark" || mapname == "jamx_mafon" ||
@@ -309,15 +328,105 @@ void() world_detect_known_release =
known_release = KNOWN_RELEASE_FUNC_MAPJAMX;
release_name = "func_mapjamx";
}
+ else if (mapname == "dmd0" || mapname == "dmd1" || mapname == "dmd2" ||
+ mapname == "dmd3" || mapname == "dmd4" || mapname == "dmd5" ||
+ mapname == "dmd6" || mapname == "dmd7" || mapname == "dmd8" ||
+ mapname == "dmd9" || (mapname == "start" &&
+ world.message == "Deathmatch Dimension"))
+ {
+ known_release = KNOWN_RELEASE_DMD;
+ release_name = "Deathmatch Dimension";
+ }
+ else if (mapname == "q3ctf1" || mapname == "q3ctf2" ||
+ mapname == "q3ctf3" || mapname == "q3ctf4" ||
+ mapname == "q3ctf5" ||
+ mapname == "q3dm0" || mapname == "q3dm1" ||
+ mapname == "q3dm2" || mapname == "q3dm3" ||
+ mapname == "q3dm4" || mapname == "q3dm5" ||
+ mapname == "q3dm6" || mapname == "q3dm7" ||
+ mapname == "q3dm8" || mapname == "q3dm9" ||
+ mapname == "q3dm10" || mapname == "q3dm11" ||
+ mapname == "q3dm12" || mapname == "q3dm13" ||
+ mapname == "q3dm14" || mapname == "q3dm15" ||
+ mapname == "q3dm16" || mapname == "q3dm17" ||
+ mapname == "q3dm18" || mapname == "q3dm19" ||
+ mapname == "q3tourney1" || mapname == "q3tourney2" ||
+ mapname == "q3tourney3" || mapname == "q3tourney4" ||
+ mapname == "q3tourney5" || mapname == "q3tourney6" ||
+ mapname == "q3tourney6_ctf" ||
+ mapname == "pro-q3dm13" || mapname == "pro-q3dm6" ||
+ mapname == "pro-q3tourney2" || mapname == "pro-q3tourney4")
+ {
+ known_release = KNOWN_RELEASE_QUAKE3;
+ release_name = "Quake 3";
+ }
+ else if (mapname == "e5m1" || mapname == "e5m2" || mapname == "e5m3" ||
+ mapname == "e5m4" || mapname == "e5m5" || mapname == "e5m6" ||
+ mapname == "e5m7" || mapname == "e5m8" || mapname == "e5dm" ||
+ mapname == "e5start" || (mapname == "start" &&
+ world.message == "Dimension Of The Past"))
+ {
+ known_release = KNOWN_RELEASE_DOTP;
+ release_name = "Dimension Of The Past";
+ }

if (release_name != "")
+ dprint (sprintf("WARNING: progs.dat detected a map from %s "
+ "(%g), attempting to behave compatibly\n",
+ release_name, known_release));
+};
+
+//----------------------------------------------------------------------
+float(entity e, vector offset) world_surface_type =
+{
+ if (known_release == KNOWN_RELEASE_NOT)
+ return SURFACE_UNKNOWN;
+
+ if (e.pmove_flags & PMF_WALLJUMPED)
+ return SURFACE_UNKNOWN;
+
+ local string tex = "";
+ local float surfnum = 0;
+
+ if (world_standardphysics || e.classtype != CT_PLAYER)
+ {
+ // trace to the ground entity, get the surface
+ // number we're standing on, then get the texture
+ // name on that surface. traceline will do fine.
+ traceline (e.origin, e.origin + offset, 0, e);
+ surfnum = getsurfacenearpoint (trace_ent, trace_endpos);
+ tex = getsurfacetexture (trace_ent, surfnum);
+ dprint (sprintf("world_surface_type: trace ent %s, "
+ "surface id %g, texture %s\n",
+ trace_ent.classname, surfnum, tex));
+ }
+ else
+ {
+ // we have reliable access to the ground entity
+ // already, no need to trace -- CEV
+ surfnum = getsurfacenearpoint (e.groundentity,
+ e.origin + offset);
+ tex = getsurfacetexture (e.groundentity, surfnum);
+ dprint (sprintf("world_surface_type: ground ent %s, "
+ "surface id %g, texture %s\n",
+ e.groundentity.classname, surfnum, tex));
+ }
+
+ switch (known_release)
{
- dprint ("WARNING: progs.dat detected a map from ");
- dprint (release_name);
- dprint (", attempting to behave compatibly\n");
+ case KNOWN_RELEASE_ID1:
+ // see compat/quake1.qc -- CEV
+ return id1_surface_type (tex);
+ case KNOWN_RELEASE_DOTP:
+ // reuse id1 surface checks -- CEV
+ return id1_surface_type (tex);
+ default:
+ return SURFACE_UNKNOWN;
}
};
+#endif

+#if defined(CSQC) || defined(SSQC)
/*QUAKED worldspawn (0 0 0) ?
Only used for the world entity.

@@ -392,6 +501,7 @@ sky(string) : "Sky Texture" : : "Must have compatible skybox textures in gfx/en
*/
void() worldspawn =
{
+ #ifdef SSQC
world_detect_known_release ();

// new spawnflags for all entities -- iw
@@ -402,6 +512,8 @@ void() worldspawn =

lastspawn = world;
InitBodyQue ();
+ #endif
+
self.classname = "world";
self.classtype = CT_WORLD;

@@ -417,6 +529,7 @@ void() worldspawn =
world_gravity = 800.0;
}

+ #ifdef SSQC
// No cutscene is active during worldspawn. Drake -- dumptruck_ds
cutscene = 0;

@@ -433,8 +546,13 @@ void() worldspawn =
precache_sound ("misc/h2ohit1.wav"); // landing splash

// setup precaches always needed
+ precache_sound ("misc/null.wav"); // empty sound
precache_sound ("items/itembk2.wav"); // item respawn sound
precache_sound ("player/plyrjmp8.wav"); // player jump
+ precache_sound ("player/jump01.ogg"); //
+ precache_sound ("player/jump02.ogg"); //
+ precache_sound ("player/jump03.ogg"); //
+ precache_sound ("player/jump04.ogg"); //
precache_sound ("player/land.wav"); // player landing
precache_sound ("player/land2.wav"); // player hurt landing
precache_sound ("player/drown1.wav"); // drowning pain
@@ -444,13 +562,38 @@ void() worldspawn =
precache_sound ("player/h2odeath.wav"); // drowning death

// player footstep sounds -- CEV
- precache_sound ("steps/foot1.wav");
- precache_sound ("steps/foot2.wav");
- precache_sound ("steps/foot3.wav");
- precache_sound ("steps/foot4.wav");
- precache_sound ("steps/foot5.wav");
- precache_sound ("steps/foot6.wav");
- precache_sound ("steps/foot7.wav");
+ precache_sound ("player/stepdirt1.ogg");
+ precache_sound ("player/stepdirt2.ogg");
+ precache_sound ("player/stepdirt3.ogg");
+ precache_sound ("player/stepdirt4.ogg");
+ precache_sound ("player/stepdirt5.ogg");
+ precache_sound ("player/stepmetal1.ogg");
+ precache_sound ("player/stepmetal2.ogg");
+ precache_sound ("player/stepmetal3.ogg");
+ precache_sound ("player/stepmetal4.ogg");
+ precache_sound ("player/stepmetal5.ogg");
+ precache_sound ("player/stepmetal6.ogg");
+ precache_sound ("player/stepmetal7.ogg");
+ precache_sound ("player/stepmetal8.ogg");
+ precache_sound ("player/stepmetal9.ogg");
+ precache_sound ("player/stepstone1.ogg");
+ precache_sound ("player/stepstone2.ogg");
+ precache_sound ("player/stepstone3.ogg");
+ precache_sound ("player/stepstone4.ogg");
+ precache_sound ("player/stepstone5.ogg");
+ precache_sound ("player/stepstone6.ogg");
+ precache_sound ("player/stepwade1.ogg");
+ precache_sound ("player/stepwade2.ogg");
+ precache_sound ("player/stepwater1.ogg");
+ precache_sound ("player/stepwater2.ogg");
+ precache_sound ("player/stepwater3.ogg");
+ precache_sound ("player/stepwater4.ogg");
+ precache_sound ("player/stepwood1.ogg");
+ precache_sound ("player/stepwood2.ogg");
+ precache_sound ("player/stepwood3.ogg");
+ precache_sound ("player/stepwood4.ogg");
+ precache_sound ("player/slide.ogg");
+ precache_sound ("player/slidestart.ogg");

precache_sound ("misc/talk.wav"); // talk
precache_sound ("player/teledth1.wav"); // telefrag
@@ -459,8 +602,9 @@ void() worldspawn =
precache_sound ("misc/r_tele3.wav");
precache_sound ("misc/r_tele4.wav");
precache_sound ("misc/r_tele5.wav");
- precache_sound ("weapons/lock4.wav"); // ammo pick up
- precache_sound ("weapons/pkup.wav"); // weapon up
+ precache_sound ("items/ammo_pickup.ogg"); // ammo pick up
+ precache_sound ("items/backpack_pickup.wav"); // backpack up
+ precache_sound ("items/weapon_pickup.ogg"); // weapon up
precache_sound ("items/armor1.wav"); // armor up
precache_sound ("weapons/lhit.wav"); // lightning
precache_sound ("weapons/lstart.wav"); // lightning start
@@ -570,8 +714,8 @@ void() worldspawn =
precache_model2 ("progs/b_g_key.mdl");
precache_model ("progs/health/pd_vial.mdl"); // DropVial -- dumptruck_ds
precache_sound ("items/r_item1.wav");
- precache_sound ("items/armor_shard_q3.wav"); // DropShard - dumptruck_ds
- precache_sound ("items/item_respawn_q3.wav");// CEV
+ precache_sound ("items/shard_pickup.ogg"); // DropShard - dumptruck_ds
+ precache_sound ("items/respawn.ogg"); // CEV
precache_model ("progs/armshr.mdl");

// Setup light anim tables. 'a' is total darkness, 'z' is maxbright.
@@ -616,8 +760,11 @@ void() worldspawn =

// 63 testing
lightstyle (63, "a");
+ #endif
};
+#endif

+#ifdef SSQC
//======================================================================
// BODY QUE
//======================================================================

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

Diff sound/items/item_respawn_q3.wav

diff --git a/sound/items/item_respawn_q3.wav b/sound/items/item_respawn_q3.wav
deleted file mode 100644
index 03cf43b..0000000
Binary files a/sound/items/item_respawn_q3.wav and /dev/null differ

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

Diff sound/items/respawn.wav

diff --git a/sound/items/respawn.wav b/sound/items/respawn.wav
new file mode 100644
index 0000000..d73781e
Binary files /dev/null and b/sound/items/respawn.wav differ

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