From e1ae65fe1922afc3f9e5c0f8d3b93c98fda64a60 Mon Sep 17 00:00:00 2001 From: Richard Allen Date: Sat, 29 Mar 2003 16:01:36 +0000 Subject: [PATCH] _skin cvars now fully removed. dlight code from Makro added. cvar defaults fixed. --- reaction/cgame/cg_local.h | 6 ++- reaction/cgame/cg_main.c | 44 +++++++++++--------- reaction/game/bg_misc.c | 8 +++- reaction/game/g_misc.c | 86 +++++++++++++++++++++++++++++++++++---- 4 files changed, 114 insertions(+), 30 deletions(-) diff --git a/reaction/cgame/cg_local.h b/reaction/cgame/cg_local.h index d4e3a98d..ddb28f96 100644 --- a/reaction/cgame/cg_local.h +++ b/reaction/cgame/cg_local.h @@ -5,6 +5,10 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.140 2003/03/29 16:01:36 jbravo +// _skin cvars now fully removed. dlight code from Makro added. cvar +// defaults fixed. +// // Revision 1.139 2003/03/28 22:25:10 makro // no message // @@ -2456,4 +2460,4 @@ extern qboolean initparticles; int CG_NewParticleArea(int num); //Makro - added -void CG_DrawBigPolygon(void); \ No newline at end of file +void CG_DrawBigPolygon(void); diff --git a/reaction/cgame/cg_main.c b/reaction/cgame/cg_main.c index 9fb58604..6106c7cc 100644 --- a/reaction/cgame/cg_main.c +++ b/reaction/cgame/cg_main.c @@ -5,6 +5,10 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.129 2003/03/29 16:01:36 jbravo +// _skin cvars now fully removed. dlight code from Makro added. cvar +// defaults fixed. +// // Revision 1.128 2003/03/29 15:04:03 jbravo // Removing skin replacement cvars // @@ -748,15 +752,15 @@ static cvarTable_t cvarTable[] = { // bk001129 {&cg_noVoiceText, "cg_noVoiceText", "0", CVAR_ARCHIVE}, {&ogc_islame,"ogc_islame","1",CVAR_ROM}, //Blaze: replacement weapons - {&cg_RQ3_knife, "cg_RQ3_knife", "knife", CVAR_ARCHIVE}, - {&cg_RQ3_mk23, "cg_RQ3_mk23", "mk23", CVAR_ARCHIVE}, - {&cg_RQ3_m4, "cg_RQ3_m4", "m4", CVAR_ARCHIVE}, - {&cg_RQ3_ssg3000, "cg_RQ3_ssg3000", "ssg3000", CVAR_ARCHIVE}, - {&cg_RQ3_mp5, "cg_RQ3_mp5", "mp5", CVAR_ARCHIVE}, - {&cg_RQ3_handcannon, "cg_RQ3_handcannon", "handcannon", CVAR_ARCHIVE}, - {&cg_RQ3_m3, "cg_RQ3_m3", "m3", CVAR_ARCHIVE}, - {&cg_RQ3_akimbo, "cg_RQ3_akimbo", "akimbo", CVAR_ARCHIVE}, - {&cg_RQ3_grenade, "cg_RQ3_grenade", "grenade", CVAR_ARCHIVE}, + {&cg_RQ3_knife, "cg_RQ3_knife", "knife/default", CVAR_ARCHIVE}, + {&cg_RQ3_mk23, "cg_RQ3_mk23", "mk23/default", CVAR_ARCHIVE}, + {&cg_RQ3_m4, "cg_RQ3_m4", "m4/default", CVAR_ARCHIVE}, + {&cg_RQ3_ssg3000, "cg_RQ3_ssg3000", "ssg3000/default", CVAR_ARCHIVE}, + {&cg_RQ3_mp5, "cg_RQ3_mp5", "mp5/default", CVAR_ARCHIVE}, + {&cg_RQ3_handcannon, "cg_RQ3_handcannon", "handcannon/default", CVAR_ARCHIVE}, + {&cg_RQ3_m3, "cg_RQ3_m3", "m3/default", CVAR_ARCHIVE}, + {&cg_RQ3_akimbo, "cg_RQ3_akimbo", "akimbo/default", CVAR_ARCHIVE}, + {&cg_RQ3_grenade, "cg_RQ3_grenade", "grenade/default", CVAR_ARCHIVE}, // JBravo: replacement skins /* {&cg_RQ3_knife_skin, "cg_RQ3_knife_skin", "default", CVAR_ARCHIVE}, {&cg_RQ3_mk23_skin, "cg_RQ3_mk23_skin", "default", CVAR_ARCHIVE}, @@ -768,12 +772,12 @@ static cvarTable_t cvarTable[] = { // bk001129 {&cg_RQ3_akimbo_skin, "cg_RQ3_akimbo_skin", "default", CVAR_ARCHIVE}, {&cg_RQ3_grenade_skin, "cg_RQ3_grenade_skin", "default", CVAR_ARCHIVE}, */ //Blaze: replacement items - {&cg_RQ3_bandolier, "cg_RQ3_bandolier", "bandolier", CVAR_ARCHIVE}, - {&cg_RQ3_kevlar, "cg_RQ3_kevlar", "kevlar", CVAR_ARCHIVE}, - {&cg_RQ3_silencer, "cg_RQ3_silencer", "silencer", CVAR_ARCHIVE}, - {&cg_RQ3_laser, "cg_RQ3_laser", "laser", CVAR_ARCHIVE}, - {&cg_RQ3_slippers, "cg_RQ3_slippers", "slippers", CVAR_ARCHIVE}, - {&cg_RQ3_helmet, "cg_RQ3_helmet", "helmet", CVAR_ARCHIVE}, + {&cg_RQ3_bandolier, "cg_RQ3_bandolier", "bandolier/default", CVAR_ARCHIVE}, + {&cg_RQ3_kevlar, "cg_RQ3_kevlar", "kevlar/default", CVAR_ARCHIVE}, + {&cg_RQ3_silencer, "cg_RQ3_silencer", "silencer/default", CVAR_ARCHIVE}, + {&cg_RQ3_laser, "cg_RQ3_laser", "laser/default", CVAR_ARCHIVE}, + {&cg_RQ3_slippers, "cg_RQ3_slippers", "slippers/default", CVAR_ARCHIVE}, + {&cg_RQ3_helmet, "cg_RQ3_helmet", "helmet/default", CVAR_ARCHIVE}, // JBravo: replacement skins /* {&cg_RQ3_bandolier_skin, "cg_RQ3_bandolier_skin", "default", CVAR_ARCHIVE}, {&cg_RQ3_kevlar_skin, "cg_RQ3_kevlar_skin", "default", CVAR_ARCHIVE}, @@ -782,11 +786,11 @@ static cvarTable_t cvarTable[] = { // bk001129 {&cg_RQ3_slippers_skin, "cg_RQ3_slippers_skin", "default", CVAR_ARCHIVE}, {&cg_RQ3_helmet_skin, "cg_RQ3_helmet_skin", "default", CVAR_ARCHIVE}, */ // JBravo: replacement ammo - {&cg_RQ3_ammo_mk23, "cg_RQ3_ammo_mk23", "mk23", CVAR_ARCHIVE}, - {&cg_RQ3_ammo_shells, "cg_RQ3_ammo_shells", "shells", CVAR_ARCHIVE}, - {&cg_RQ3_ammo_ssg3000, "cg_RQ3_ammo_ssg3000", "ssg3000", CVAR_ARCHIVE}, - {&cg_RQ3_ammo_mp5, "cg_RQ3_ammo_mp5", "mp5", CVAR_ARCHIVE}, - {&cg_RQ3_ammo_m4, "cg_RQ3_ammo_m4", "m4", CVAR_ARCHIVE}, + {&cg_RQ3_ammo_mk23, "cg_RQ3_ammo_mk23", "mk23/default", CVAR_ARCHIVE}, + {&cg_RQ3_ammo_shells, "cg_RQ3_ammo_shells", "shells/default", CVAR_ARCHIVE}, + {&cg_RQ3_ammo_ssg3000, "cg_RQ3_ammo_ssg3000", "ssg3000/default", CVAR_ARCHIVE}, + {&cg_RQ3_ammo_mp5, "cg_RQ3_ammo_mp5", "mp5/default", CVAR_ARCHIVE}, + {&cg_RQ3_ammo_m4, "cg_RQ3_ammo_m4", "m4/default", CVAR_ARCHIVE}, // JBravo: replacement skins /* {&cg_RQ3_ammo_mk23_skin, "cg_RQ3_ammo_mk23_skin", "default", CVAR_ARCHIVE}, {&cg_RQ3_ammo_shells_skin, "cg_RQ3_ammo_shells_skin", "default", CVAR_ARCHIVE}, diff --git a/reaction/game/bg_misc.c b/reaction/game/bg_misc.c index daffce3a..60283120 100644 --- a/reaction/game/bg_misc.c +++ b/reaction/game/bg_misc.c @@ -5,6 +5,10 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.51 2003/03/29 16:01:36 jbravo +// _skin cvars now fully removed. dlight code from Makro added. cvar +// defaults fixed. +// // Revision 1.50 2003/03/28 22:26:24 makro // no message // @@ -1612,7 +1616,7 @@ char *modelFromStr(char *s) char *p, *out = s; if (!s) return NULL; - if ((p = strrchr(s, '/')) != NULL) + if ((p = Q_strrchr(s, '/')) != NULL) { *p=0; out=va("%s", s); @@ -1628,7 +1632,7 @@ char *skinFromStr(char *s) return NULL; if (!*s) return va(""); - if ((p = strrchr(s, '/')) != NULL) + if ((p = Q_strrchr(s, '/')) != NULL) return p+1; return va("default"); } diff --git a/reaction/game/g_misc.c b/reaction/game/g_misc.c index dd20575f..d21b0f57 100644 --- a/reaction/game/g_misc.c +++ b/reaction/game/g_misc.c @@ -5,6 +5,10 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.68 2003/03/29 16:01:36 jbravo +// _skin cvars now fully removed. dlight code from Makro added. cvar +// defaults fixed. +// // Revision 1.67 2003/03/22 20:29:26 jbravo // wrapping linkent and unlinkent calls // @@ -177,6 +181,12 @@ void G_ExplodeMissile(gentity_t * ent); //Makro - added void Think_SpawnNewDoorTrigger(gentity_t * ent); +void InitMover(gentity_t * ent); +void Use_Func_Train(gentity_t * ent, gentity_t * other, gentity_t * activator); +void Think_BeginMoving(gentity_t * ent); +void Reached_Train(gentity_t * ent); +void Think_SetupTrainTargets(gentity_t * ent); + /*QUAKED func_group (0 0 0) ? Used to group brushes together just for editor convenience. They are turned into normal brushes by the utilities. @@ -227,6 +237,13 @@ Set the color key for the intended color */ void use_dlight(gentity_t * ent, gentity_t * other, gentity_t * activator) { + //if train + if (ent->count == 2) { + if (other->pathtarget && other->pathtarget[0]) { + Use_Func_Train(ent, other, activator); + return; + } + } ent->unbreakable = !ent->unbreakable; if (ent->unbreakable) { ent->r.svFlags |= SVF_NOCLIENT; @@ -241,6 +258,7 @@ void use_dlight(gentity_t * ent, gentity_t * other, gentity_t * activator) void SP_dlight(gentity_t * ent) { vec3_t color; + char *s; float light; int r, g, b, i; @@ -263,12 +281,12 @@ void SP_dlight(gentity_t * ent) */ //Makro - added START_OFF flag - ent->use = use_dlight; +/* ent->use = use_dlight; ent->unbreakable = qfalse; if (ent->spawnflags & 8) { ent->unbreakable = qtrue; ent->use(ent, NULL, NULL); - } + } */ r = color[0] * 255; if (r > 255) { @@ -282,7 +300,7 @@ void SP_dlight(gentity_t * ent) if (b > 255) { b = 255; } - i = light / 4; + i = light / 8; if (i > 255) { i = 255; } @@ -291,17 +309,71 @@ void SP_dlight(gentity_t * ent) //Makro - added frequency, phase and light2 G_SpawnFloat("frequency", "2", &light); - ent->s.frame = light * 1000; + ent->s.powerups = light * 1000; G_SpawnFloat("phase", "0", &light); - ent->s.generic1 = light * 1000; + ent->s.otherEntityNum2 = light * 1000; G_SpawnFloat("light2", "0", &light); ent->s.weapon = light; - ent->s.eType = ET_DLIGHT; - ent->classname = "func_dlite"; +// ent->s.eType = ET_DLIGHT; +// ent->classname = "func_dlite"; ent->s.pos.trType = TR_STATIONARY; VectorCopy(ent->s.origin, ent->r.currentOrigin); + ent->classname = "func_dlite"; + //Makro - added mover info + if (G_SpawnString("movertype", "none", &s)) { + if (!Q_stricmp(s, "bobbing")) { + float height, heights[3]; + float phase2; + int axis; + + //bobbing + ent->count = 1; + G_SpawnFloat("speed", "4", &ent->speed); + G_SpawnFloat("height", "32", &height); + G_SpawnFloat("moverphase", "0", &phase2); + G_SpawnInt("axis", "2", &axis); + InitMover(ent); + VectorCopy(ent->s.origin, ent->s.pos.trBase); + VectorCopy(ent->s.origin, ent->r.currentOrigin); + ent->s.pos.trDuration = ent->speed * 1000; + ent->s.pos.trTime = ent->s.pos.trDuration * phase2; + ent->s.pos.trType = TR_SINE; + // set the axis of bobbing + if (G_SpawnVector("heights", "0 0 32", heights)) { + VectorCopy(heights, ent->s.pos.trDelta); + } else { + ent->s.pos.trDelta[axis%3] = height; + } + } else if (!Q_stricmp(s, "train")) { + //train + ent->count = 2; + VectorClear(ent->s.angles); + if (!ent->speed) { + ent->speed = 100; + } + if (!ent->target) { + G_Printf("%s without a target at %s\n", ent->classname, vtos(ent->r.absmin)); + G_FreeEntity(ent); + return; + } + InitMover(ent); + ent->reached = Reached_Train; + // start trains on the second frame, to make sure their targets have had + // a chance to spawn + ent->nextthink = level.time + FRAMETIME; + ent->think = Think_SetupTrainTargets; + } + } + //Makro - added START_OFF flag + ent->use = use_dlight; + ent->unbreakable = qfalse; + if (ent->spawnflags & 8) { + ent->unbreakable = qtrue; + ent->use(ent, NULL, NULL); + } + trap_RQ3LinkEntity(ent, __LINE__, __FILE__); }