diff --git a/quakec/client.qc b/quakec/client.qc index f75d0ff..0dc01b3 100644 --- a/quakec/client.qc +++ b/quakec/client.qc @@ -726,6 +726,7 @@ void() PutClientInServer = self.healthrot_nextcheck = 0; self.fired_weapon = 0; // [NDS] haleyjd self.took_damage = 0; // [NDS] haleyjd + self.team = TEAM_NONE; if ( coop ) { self.team = TEAM_HUMANS; diff --git a/quakec/defs.qc b/quakec/defs.qc index 8784379..20d905c 100644 --- a/quakec/defs.qc +++ b/quakec/defs.qc @@ -362,9 +362,13 @@ float SVC_INTERMISSION = 30; float SVC_FINALE = 31; float SVC_CDTRACK = 32; float SVC_SELLSCREEN = 33; -float SVC_SPAWNEDMONSTER = 39; +float SVC_SPAWNEDMONSTER = 39; float SVC_ACHIEVEMENT = 52; - +float SVC_CHAT = 53; +float SVC_LEVELCOMPLETED = 54; +float SVC_BACKTOLOBBY = 55; +float SVC_LOCALSOUND = 56; +float SVC_PROMPT = 57; float TE_SPIKE = 0; float TE_SUPERSPIKE = 1; @@ -378,6 +382,8 @@ float TE_KNIGHTSPIKE = 8; float TE_LIGHTNING3 = 9; float TE_LAVASPLASH = 10; float TE_TELEPORT = 11; +float TE_EXPLOSION2 = 12; +float TE_BEAM = 13; // sound channels // channel 0 never willingly overrides @@ -416,7 +422,8 @@ float MSG_ONE = 1; // reliable to one (msg_entity) float MSG_ALL = 2; // reliable to all float MSG_INIT = 3; // write to the init string -// team numbers for Coop +// team numbers +float TEAM_NONE = -1; float TEAM_MONSTERS = 0; float TEAM_HUMANS = 1; diff --git a/quakec/monsters/hellknight.qc b/quakec/monsters/hellknight.qc index 00bee95..57e0647 100644 --- a/quakec/monsters/hellknight.qc +++ b/quakec/monsters/hellknight.qc @@ -96,7 +96,9 @@ void(float offset) hknight_shot = setmodel (newmis, "progs/k_spike.mdl"); setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); newmis.velocity = vec*300; - newmis.effects = newmis.effects | EF_CANDLELIGHT; // give the projectiles a weak glow + if (cvar("pr_checkextension")) + if (checkextension("EX_EXTENDED_EF")) + newmis.effects = newmis.effects | EF_CANDLELIGHT; // give the projectiles a weak glow sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM); }; diff --git a/quakec/monsters/ogre.qc b/quakec/monsters/ogre.qc index a82f6d9..ffd4750 100644 --- a/quakec/monsters/ogre.qc +++ b/quakec/monsters/ogre.qc @@ -137,7 +137,9 @@ void() OgreFireGrenade = missile.touch = OgreGrenadeTouch; - missile.effects = missile.effects | EF_CANDLELIGHT; // give the grenades a weak glow + if (cvar("pr_checkextension")) + if (checkextension("EX_EXTENDED_EF")) + missile.effects = missile.effects | EF_CANDLELIGHT; // give the projectiles a weak glow // set missile duration missile.nextthink = time + 2.5; diff --git a/quakec/player.qc b/quakec/player.qc index 4b8cd1d..b6cd381 100644 --- a/quakec/player.qc +++ b/quakec/player.qc @@ -520,7 +520,10 @@ void(string gibname, float dm) ThrowGib = setmodel (new, gibname); setsize (new, '0 0 0', '0 0 0'); new.velocity = VelocityForDamage (dm); - new.movetype = MOVETYPE_GIB; + new.movetype = MOVETYPE_BOUNCE; + if (cvar("pr_checkextension")) + if (checkextension("EX_MOVETYPE_GIB")) + new.movetype = MOVETYPE_GIB; new.solid = SOLID_NOT; new.avelocity_x = random()*600; new.avelocity_y = random()*600; @@ -537,7 +540,10 @@ void(string gibname, float dm) ThrowHead = setmodel (self, gibname); self.frame = 0; self.nextthink = -1; - self.movetype = MOVETYPE_GIB; + self.movetype = MOVETYPE_BOUNCE; + if (cvar("pr_checkextension")) + if (checkextension("EX_MOVETYPE_GIB")) + self.movetype = MOVETYPE_GIB; self.takedamage = DAMAGE_NO; self.solid = SOLID_NOT; self.view_ofs = '0 0 8'; diff --git a/quakec/subs.qc b/quakec/subs.qc index f3777fc..86a4621 100644 --- a/quakec/subs.qc +++ b/quakec/subs.qc @@ -34,7 +34,7 @@ void() SetMovedir = self.movedir = '0 0 -1'; else { - makevectorsfixed(self.angles); + makevectors(self.angles); self.movedir = v_forward; } diff --git a/quakec/triggers.qc b/quakec/triggers.qc index 64a0fb6..4f7a616 100644 --- a/quakec/triggers.qc +++ b/quakec/triggers.qc @@ -115,7 +115,7 @@ void() multi_touch = // if the trigger has an angles field, check player's facing direction if (self.movedir != '0 0 0') { - makevectorsfixed(other.angles); + makevectors(other.angles); if (v_forward * self.movedir < 0) return; // not facing the right way } diff --git a/quakec/weapons.qc b/quakec/weapons.qc index b5d6be6..ab59ffb 100644 --- a/quakec/weapons.qc +++ b/quakec/weapons.qc @@ -1285,7 +1285,7 @@ void() ServerflagsCommand = void() QuadCheat = { - if (deathmatch || coop) + if (!cheats_allowed) return; self.super_time = 1; diff --git a/quakec_hipnotic/monsters/hellknight.qc b/quakec_hipnotic/monsters/hellknight.qc index b7ae083..4c642f1 100644 --- a/quakec_hipnotic/monsters/hellknight.qc +++ b/quakec_hipnotic/monsters/hellknight.qc @@ -96,7 +96,9 @@ void(float offset) hknight_shot = setmodel (newmis, "progs/k_spike.mdl"); setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); newmis.velocity = vec*300; - newmis.effects = newmis.effects | EF_CANDLELIGHT; // give the projectiles a weak glow + if (cvar("pr_checkextension")) + if (checkextension("EX_EXTENDED_EF")) + newmis.effects = newmis.effects | EF_CANDLELIGHT; // give the projectiles a weak glow sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM); }; diff --git a/quakec_hipnotic/monsters/ogre.qc b/quakec_hipnotic/monsters/ogre.qc index e0499d2..cbc732e 100644 --- a/quakec_hipnotic/monsters/ogre.qc +++ b/quakec_hipnotic/monsters/ogre.qc @@ -136,6 +136,10 @@ void() OgreFireGrenade = missile.angles = vectoangles(missile.velocity); missile.touch = OgreGrenadeTouch; + + if (cvar("pr_checkextension")) + if (checkextension("EX_EXTENDED_EF")) + missile.effects = missile.effects | EF_CANDLELIGHT; // give the projectiles a weak glow // set missile duration missile.nextthink = time + 2.5; diff --git a/quakec_mg1/misc_model.qc b/quakec_mg1/misc_model.qc new file mode 100644 index 0000000..8ee23df --- /dev/null +++ b/quakec_mg1/misc_model.qc @@ -0,0 +1,106 @@ + +const float MISC_MODEL_ANIMATED = 1; +const float MISC_MODEL_ANIMATED_ONCE = 2; +const float MISC_MODEL_ANIMATED_START_OFF = 4; + +/////////////////////////////// +// Behaviour for a looping animation +/////////////////////////////// + +void misc_model_think_loop() +{ + self.frame += 1; + if(self.frame == self.cnt) + { + self.frame = self.count; // Back to start + } + self.nextthink = time + 0.1; +} + +void misc_model_use_loop() +{ + if(self.spawnflags & MISC_MODEL_ANIMATED_START_OFF) + { + self.spawnflags (-) MISC_MODEL_ANIMATED_START_OFF; + self.think = misc_model_think_loop; + misc_model_think_loop(); + } + else + { + self.spawnflags (+) MISC_MODEL_ANIMATED_START_OFF; + self.think = SUB_Null; + self.nextthink = -1; + } + +} + +/////////////////////////////// +// Behaviour for a single animation +/////////////////////////////// + +void misc_model_think_once() +{ + self.frame += 1; + if(self.frame < self.cnt) + { + self.nextthink = time + 0.1; + } +} + +void misc_model_use_once() +{ + self.frame = self.count; + self.think = misc_model_think_once; + self.nextthink = time + 0.1; +} + +/////////////////////////////// + +void misc_model() +{ + if(self.model == "") { objerror("misc_model with no model specified"); } + precache_model(self.model); + setmodel(self, self.model); + setorigin(self, self.origin); + self.solid = SOLID_NOT; + + if(self.spawnflags == 0) + { + makestatic(self); + return; + } + + if(self.cnt < self.frame) { objerror("misc_model with invalid frame range (cnt < frame)"); } + if(self.targetname == "") { objerror("misc_model with no targetname"); } + self.count = self.frame; + + if(self.spawnflags & MISC_MODEL_ANIMATED_ONCE) + { + self.use = misc_model_use_once; + } + else if(self.spawnflags & (MISC_MODEL_ANIMATED | MISC_MODEL_ANIMATED_START_OFF)) + { + self.use = misc_model_use_loop; + // Stupid way to do it but just flip the bit flag and pretend we just used it. + self.spawnflags ^= MISC_MODEL_ANIMATED_START_OFF; + misc_model_use_loop(); + } + +} + + + + + + + + + + + + + + + + + diff --git a/quakec_mg1/progs.src b/quakec_mg1/progs.src index e8909cb..feb74d8 100644 --- a/quakec_mg1/progs.src +++ b/quakec_mg1/progs.src @@ -68,6 +68,7 @@ monsters/oldone.qc // registered misc_corpses.qc //Corpses yay misc_fx.qc // adds screenshake +misc_model.qc //generic static and animated model //Map specific code? Why not.. map_specific/mge2m2.qc diff --git a/quakec_rogue/hknight.qc b/quakec_rogue/hknight.qc index 5b3cf64..005623d 100644 --- a/quakec_rogue/hknight.qc +++ b/quakec_rogue/hknight.qc @@ -97,7 +97,9 @@ void(float offset) hknight_shot = setmodel (newmis, "progs/k_spike.mdl"); setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); newmis.velocity = vec*300; - newmis.effects = newmis.effects | EF_CANDLELIGHT; // give the projectiles a weak glow + if (cvar("pr_checkextension")) + if (checkextension("EX_EXTENDED_EF")) + newmis.effects = newmis.effects | EF_CANDLELIGHT; // give the projectiles a weak glow sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM); }; diff --git a/quakec_rogue/ogre.qc b/quakec_rogue/ogre.qc index ab861dd..5848c2f 100644 --- a/quakec_rogue/ogre.qc +++ b/quakec_rogue/ogre.qc @@ -133,6 +133,10 @@ void() OgreFireGrenade = missile.velocity_z = 200; missile.avelocity = '300 300 300'; missile.angles = vectoangles(missile.velocity); + + if (cvar("pr_checkextension")) + if (checkextension("EX_EXTENDED_EF")) + missile.effects = missile.effects | EF_CANDLELIGHT; // give the projectiles a weak glow // set missile duration if(self.spawnflags & OGRE_BOSS)