Update 4 id1, hipnotic, mg1, and rogue source

This commit is contained in:
Mike Rubits 2022-08-18 15:18:32 -05:00
parent bebf782915
commit 7bcbd29c99
14 changed files with 149 additions and 12 deletions

View file

@ -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;

View file

@ -364,7 +364,11 @@ float SVC_CDTRACK = 32;
float SVC_SELLSCREEN = 33;
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;

View file

@ -96,6 +96,8 @@ void(float offset) hknight_shot =
setmodel (newmis, "progs/k_spike.mdl");
setsize (newmis, VEC_ORIGIN, VEC_ORIGIN);
newmis.velocity = vec*300;
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);
};

View file

@ -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;

View file

@ -520,6 +520,9 @@ void(string gibname, float dm) ThrowGib =
setmodel (new, gibname);
setsize (new, '0 0 0', '0 0 0');
new.velocity = VelocityForDamage (dm);
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;
@ -537,6 +540,9 @@ void(string gibname, float dm) ThrowHead =
setmodel (self, gibname);
self.frame = 0;
self.nextthink = -1;
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;

View file

@ -34,7 +34,7 @@ void() SetMovedir =
self.movedir = '0 0 -1';
else
{
makevectorsfixed(self.angles);
makevectors(self.angles);
self.movedir = v_forward;
}

View file

@ -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
}

View file

@ -1285,7 +1285,7 @@ void() ServerflagsCommand =
void() QuadCheat =
{
if (deathmatch || coop)
if (!cheats_allowed)
return;
self.super_time = 1;

View file

@ -96,6 +96,8 @@ void(float offset) hknight_shot =
setmodel (newmis, "progs/k_spike.mdl");
setsize (newmis, VEC_ORIGIN, VEC_ORIGIN);
newmis.velocity = vec*300;
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);
};

View file

@ -137,6 +137,10 @@ void() OgreFireGrenade =
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;
missile.think = OgreGrenadeExplode;

106
quakec_mg1/misc_model.qc Normal file
View file

@ -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();
}
}

View file

@ -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

View file

@ -97,6 +97,8 @@ void(float offset) hknight_shot =
setmodel (newmis, "progs/k_spike.mdl");
setsize (newmis, VEC_ORIGIN, VEC_ORIGIN);
newmis.velocity = vec*300;
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);
};

View file

@ -134,6 +134,10 @@ void() OgreFireGrenade =
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)
{