Skip to content

Commit e2aa81a

Browse files
committed
CLIENT/SERVER: Add Xmas Content Drop
1 parent ae9f2ea commit e2aa81a

22 files changed

Lines changed: 1191 additions & 513 deletions

progs/ssqc.src

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ entities/wall_weapon.qc
5959
weapons/frames_core.qc
6060
weapons/rocket_launcher.qc
6161
weapons/ray_gun.qc
62+
weapons/ray_gun_mk2.qc
6263
weapons/ballistic_knife.qc
6364
weapons/tesla.qc
6465
weapons/flamethrower.qc

source/client/hud.qc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1374,7 +1374,7 @@ void() HUD_WeaponString =
13741374
break;
13751375
}
13761376

1377-
if (EqualNonPapWeapon(getstatf(STAT_ACTIVEWEAPON)) == W_RAY || EqualNonPapWeapon(getstatf(STAT_ACTIVEWEAPON)) == W_TESLA)
1377+
if (EqualNonPapWeapon(getstatf(STAT_ACTIVEWEAPON)) == W_RAY || EqualNonPapWeapon(getstatf(STAT_ACTIVEWEAPON)) == W_TESLA || EqualNonPapWeapon(getstatf(STAT_ACTIVEWEAPON)) == W_RAYMK2)
13781378
weapon_name_color = TEXT_YELLOW;
13791379

13801380
// If the string matches our last store, bail out.

source/server/ai/zoning_core.qc

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
59 Temple Place - Suite 330
2424
Boston, MA 02111-1307, USA
2525
*/
26-
27-
string zone_version;
2826
float zone_timer;
2927

3028
float num_zones;
@@ -570,19 +568,23 @@ void(float force_update) Zoning_UpdateAllZones =
570568
void(float zone_file) Zoning_ParseZoneFile =
571569
{
572570
string h;
571+
string zone_firstline;
573572
string zone_header;
573+
string zone_version;
574574
float parsing = 1;
575575

576576
while (parsing) {
577577
// read the header to validate that
578578
// this is a zone file
579579
h = fgets(zone_file);
580-
zone_header = substring(h, 0, 17);
580+
zone_firstline = strzone(h);
581+
zone_header = strzone(substring(zone_firstline, 0, 17));
581582
if (zone_header != "zone_file_version") {
582583
parsing = 0;
583584
}
585+
584586
// version of the zone file
585-
zone_version = substring(h, 19, 23);
587+
zone_version = strzone(substring(zone_firstline, 19, 24));
586588
// number of zones in map
587589
h = fgets(zone_file);
588590
num_zones = stof(substring(h, 17, 20));
@@ -610,11 +612,9 @@ void(float zone_file) Zoning_ParseZoneFile =
610612
}
611613
// number of brushes in this zone
612614
h = fgets(zone_file);
613-
float num_zone_brushes = stof(strzone(strtrim(h)));
614-
stored_zones[i].num_brushes = num_zone_brushes;
615-
615+
stored_zones[i].num_brushes = stof(strzone(strtrim(h)));
616616
// all brush mins/maxs
617-
for (float k = 0; k < num_zone_brushes; k++) {
617+
for (float k = 0; k < stored_zones[i].num_brushes; k++) {
618618
h = fgets(zone_file);
619619
string brush_mins = strzone(strtrim(h));
620620
vector brush_mins_vec = stov(brush_mins);
@@ -632,12 +632,16 @@ void(float zone_file) Zoning_ParseZoneFile =
632632
if (zone_version != "1.0.0") {
633633
// number of wayTargets
634634
h = fgets(zone_file);
635-
stored_zones[i].num_way_targets = stof(strzone(strtrim(h)));
635+
string num_way_targets = strzone(strtrim(h));
636+
stored_zones[i].num_way_targets = stof(num_way_targets);
636637
// wayTargets in this zone
637638
for (float l = 0; l < stored_zones[i].num_way_targets; l++) {
638639
h = fgets(zone_file);
639640
stored_zones[i].way_target[l] = strzone(strtrim(h));
640641
}
642+
} else {
643+
stored_zones[i].num_way_targets = 0;
644+
stored_zones[i].way_target[0] = "";
641645
}
642646
}
643647
parsing = 0;

source/server/clientfuncs.qc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,9 @@ void(entity ent) Ent_FakeRemove =
611611
ent.bbmins = ent.mins;
612612
ent.bbmaxs = ent.maxs;
613613
ent.sprintflag = ent.solid;
614+
ent.use = SUB_Null;
615+
ent.think = SUB_Null;
616+
ent.nextthink = 0;
614617

615618
ent.solid = SOLID_NOT;
616619
setsize(ent, '0 0 0', '0 0 0');

source/server/defs/custom.qc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ float framecount;
6464

6565
float music_override;
6666

67+
.float round_delay;
6768
.float recoil_delay;
6869
.float cur_spread;
6970

@@ -190,6 +191,10 @@ void (float shotcount, float sprd, float Damage, float side) FireTrace;
190191
.float hitcount;
191192
.float viewmodel_effects;
192193
.float viewmodel2_effects;
194+
.float weapon_burst_count;
195+
.float weapon_burst_override;
196+
.float weapon_autoreload_pending;
197+
.float weapon2_autoreload_pending;
193198

194199
#ifdef FTE
195200

@@ -470,6 +475,8 @@ float crandom();
470475
#define PERK_MULEKICK_DEFAULT_MODEL "models/machines/quake_scale/mulekick.mdl"
471476

472477
float isPowerOn;
478+
float num_power_switches;
479+
float activated_power_switches;
473480
.float isBuying; // naievil -- used for checking if a perk is being consumed, limits glitching
474481
.float perks;
475482
.float perk_delay;

source/server/dummies.qc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ void() info_player_6_spawn = {};
5151
void() info_player_7_spawn = {};
5252
void() info_player_8_spawn = {};
5353
void() info_null = {remove(self);};
54+
void() info_texlights = {remove(self);};
5455

5556
void() zombie_horde_point = {};
5657

source/server/entities/func.qc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,32 @@
2929
// func_illusionary
3030
// =================================
3131

32+
#define SPAWNFLAG_FUNCILLUSIONARY_STARTHIDDEN 1
33+
34+
void() func_illusionary_show =
35+
{
36+
setmodel(self, self.oldmodel);
37+
#ifdef FTE
38+
39+
HalfLife_DoRender();
40+
41+
#endif // FTE
42+
};
43+
3244
void() func_illusionary =
3345
{
3446
self.angles = '0 0 0';
3547
self.movetype = MOVETYPE_NONE;
3648
self.solid = SOLID_NOT;
3749
setmodel (self, self.model);
3850

51+
if (self.spawnflags & SPAWNFLAG_FUNCILLUSIONARY_STARTHIDDEN) {
52+
self.use = func_illusionary_show;
53+
self.oldmodel = self.model;
54+
setmodel(self, "");
55+
return;
56+
}
57+
3958
#ifdef FTE
4059

4160
HalfLife_DoRender();
@@ -276,6 +295,8 @@ void() func_train =
276295
// func_button
277296
// =================================
278297

298+
#define SPAWNFLAG_FUNCBUTTON_FIREDAMAGE 1
299+
279300
void() button_wait;
280301
void() button_return;
281302

@@ -376,6 +397,7 @@ void() func_button =
376397

377398
self.blocked = button_blocked;
378399
self.use = button_use;
400+
self.classname = "func_button";
379401

380402
if (self.health) {
381403
self.max_health = self.health;

source/server/entities/lights.qc

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
*/
2727

2828
#define LIGHT_SPAWNFLAG_STARTOFF 1 // Light starts turned off but can be triggered
29-
// On via Power Switch.
29+
// targetted.
3030

3131
#define LIGHT_SPAWNFLAG_STARTON 2 // Opposite of STARTOFF, light turns Off when
32-
// Power is On.
32+
// targetted.
3333

3434
//
3535
// LS_Setup()
@@ -54,25 +54,43 @@ void() LS_Setup =
5454
lightstyle(11, "abcdefghijklmnopqrrqponmlkjihgfedcba"); // 11: Slow Pulse (no black) // 64: Off.
5555
}
5656

57+
//
58+
// L_Toggle()
59+
// Sets OFF lights to ON and vice versa.
60+
//
61+
void() L_Toggle =
62+
{
63+
// Turn the light ON if it was set to start OFF
64+
if (self.spawnflags & LIGHT_SPAWNFLAG_STARTOFF)
65+
lightstyle(self.style, self.aistatus);
66+
// Turn the light OFF if it was set to start ON
67+
else
68+
lightstyle(self.style, "a");
69+
};
70+
5771
//
5872
// L_Setup()
5973
// Initialization for Lights.
6074
//
6175
void() L_Setup =
6276
{
63-
// If it's not vanilla ZHLT, cut it off.
64-
if (self.style > 12 || !self.targetname) {
65-
remove(self);
66-
return;
67-
}
77+
if (!self.targetname) {
78+
remove(self);
79+
return;
80+
}
81+
82+
// Reserved internally for toggled lights.
83+
if (self.style >= 32)
84+
{
85+
self.use = L_Toggle;
6886

69-
// Set the Light to be Off if the spawnflag is set.
70-
/*if ((self.spawnflags & LIGHT_SPAWNFLAG_STARTOFF)) {
71-
// Store the other value for later.
72-
//self.score = self.style;
73-
lightstyle(self.style, "a");
74-
}*/
75-
}
87+
// Set the Light to be Off if the spawnflag is set.
88+
if (self.spawnflags & LIGHT_SPAWNFLAG_STARTOFF)
89+
lightstyle(self.style, "a");
90+
else
91+
lightstyle(self.style, self.aistatus);
92+
}
93+
};
7694

7795
//
7896
// --------------------
@@ -85,7 +103,7 @@ void() light = // Basic Light
85103
void() light_fluoro = // Light with hum ambient
86104
{ L_Setup(); }
87105
void() light_environment = // Sun cast from Sky
88-
{ makestatic(self); }
106+
{ L_Setup(); }
89107
void() light_fluorospark = // Light with buzz ambient
90108
{ L_Setup(); }
91109
void() light_globe = // Light with visible globe

source/server/entities/map_entities.qc

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,3 +429,82 @@ void() game_counter =
429429
// Every time its triggered, increment.
430430
self.use = game_counter_increment;
431431
}
432+
433+
#define SCREENFLASH_SPAWNFLAG_ENDROUND 1
434+
435+
void() removeZombie;
436+
void() game_screenflash_fire =
437+
{
438+
if (self.noise != "")
439+
Sound_PlaySound(world, self.noise, SOUND_TYPE_MUSIC_ROUND, SOUND_PRIORITY_PLAYALWAYS);
440+
441+
// End the round if requested
442+
if (self.spawnflags & SCREENFLASH_SPAWNFLAG_ENDROUND) {
443+
entity old_self = self;
444+
entity monsters = find(world, classname, "ai_zombie");
445+
while(monsters != world) {
446+
self = monsters;
447+
self.th_die();
448+
monsters = find(monsters, classname, "ai_zombie");
449+
}
450+
monsters = find(world, classname, "ai_dog");
451+
while(monsters != world) {
452+
self = monsters;
453+
self.th_die();
454+
monsters = find(monsters, classname, "ai_dog");
455+
}
456+
self = old_self;
457+
Remaining_Zombies = Current_Zombies = Total_Zombies = 0;
458+
EndRound();
459+
round_changetime = time + self.currentammo;
460+
}
461+
462+
nzp_screenflash(world, self.weapon, self.ltime, SCREENFLASH_FADE_INANDOUT);
463+
};
464+
465+
void() game_screenflash =
466+
{
467+
// Trigger Sound
468+
if (self.noise != "")
469+
precache_sound(self.noise);
470+
471+
self.use = game_screenflash_fire;
472+
};
473+
474+
#define SPAWNFLAG_SPAWNPU_SPAWN_ON_PLAYER 1
475+
476+
void() spawn_pu_use =
477+
{
478+
if (self.spawnflags & SPAWNFLAG_SPAWNPU_SPAWN_ON_PLAYER) {
479+
// We can just spawn on any active player, it's fine.
480+
entity random_player = find(world, classname, "player");
481+
482+
if (random_player != world)
483+
Spawn_Powerup(random_player.origin, self.spawn_id);
484+
} else {
485+
Spawn_Powerup(self.origin, self.spawn_id);
486+
}
487+
};
488+
489+
void() spawn_pu =
490+
{
491+
self.classname = "spawn_pu";
492+
self.use = spawn_pu_use;
493+
};
494+
495+
void() info_changesky_use =
496+
{
497+
// Evil..
498+
string command = "sky ";
499+
command = strcat(command, self.name);
500+
localcmd(strcat(command, "\n"));
501+
};
502+
503+
void() info_changesky =
504+
{
505+
if (!self.name)
506+
objerror("[ERROR]: info_changesky entity with no skybox definition!\n");
507+
508+
self.classname = "info_changesky";
509+
self.use = info_changesky_use;
510+
};

0 commit comments

Comments
 (0)