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