SERVER: Add support for new Perk light colors

This commit is contained in:
Steam Deck User 2023-03-05 11:54:09 -05:00
parent 976a1844a5
commit 2b06d480bc
4 changed files with 310 additions and 191 deletions

View file

@ -475,9 +475,6 @@ waypoint_ai waypoints[MAX_WAYPOINTS];
// fog
string world_fog;
// lights
#define EF_PURPLELIGHT 256 // fte already has some effect styles defined...
#endif // FTE
#define UT_HUD 1

View file

@ -430,21 +430,21 @@ void ()
#define UPDATE_TEMP 3
// entity effects
#define EF_BLUE 1
#define EF_MUZZLEFLASH 2
#define EF_BRIGHTLIGHT 4
#define EF_RED 8
#define EF_ORANGELIGHT 16
#define EF_GREEN 32
#define EF_LIGHT 64
#define EF_NODRAW 128
#define EF_BRIGHTFIELD 256
#define EF_FULLBRIGHT 512
#define EF_DARKLIGHT 1024
#define EF_DARKFIELD 2048
#define EF_PURPLELIGHT 4096
#define EF_RAYRED 8196
#define EF_RAYGREEN 16384
#define EF_BLUELIGHT 1
#define EF_MUZZLEFLASH 2
#define EF_BRIGHTLIGHT 4
#define EF_REDLIGHT 8
#define EF_ORANGELIGHT 16
#define EF_GREENLIGHT 32
#define EF_PINKLIGHT 64 // formerly EF_LIGHT
#define EF_NODRAW 128
#define EF_LIMELIGHT 256 // formerly EF_BRIGHTFIELD
#define EF_FULLBRIGHT 512
#define EF_CYANLIGHT 1024 // formerly EF_DARKLIGHT
#define EF_YELLOWLIGHT 2048 // formerly EF_DARKFIELD
#define EF_PURPLELIGHT 4096
#define EF_RAYRED 8196 // red trail for porter x2
#define EF_RAYGREEN 16384 // green trail for ray gun
// messages
#define MSG_BROADCAST 0 // unreliable to all

View file

@ -103,6 +103,262 @@ void() light_flame_small_white = // Light with small flame & fire sound
// --------------------
//
//
// Light_Red(e)
// RGB: 255, 56, 56
//
void(entity e) Light_Red =
{
e.effects = e.effects | EF_FULLBRIGHT;
#ifndef FTE
e.effects = e.effects | EF_REDLIGHT;
#else
{
e.pflags = PFLAGS_FULLDYNAMIC;
e.light_lev = 100;
e.color_x = 2;
e.color_y = 0.25;
e.color_z = 0.25;
}
#endif // FTE
}
//
// Light_Green(e)
// RGB: 56, 255, 56
//
void(entity e) Light_Green =
{
e.effects = e.effects | EF_FULLBRIGHT;
#ifndef FTE
e.effects = e.effects | EF_GREENLIGHT;
#else
{
e.pflags = PFLAGS_FULLDYNAMIC;
e.light_lev = 100;
e.color_x = 0.25;
e.color_y = 2;
e.color_z = 0.25;
}
#endif // FTE
}
//
// Light_Blue(e)
// RGB: 56, 56, 255
//
void(entity e) Light_Blue =
{
e.effects = e.effects | EF_FULLBRIGHT;
#ifndef FTE
e.effects = e.effects | EF_BLUELIGHT;
#else
{
e.pflags = PFLAGS_FULLDYNAMIC;
e.light_lev = 100;
e.color_x = 0.25;
e.color_y = 0.25;
e.color_z = 2;
}
#endif // FTE
}
//
// Light_Orange(e)
// RGB: 255, 128, 0
//
void(entity e) Light_Orange =
{
e.effects = e.effects | EF_FULLBRIGHT;
#ifndef FTE
e.effects = e.effects | EF_ORANGELIGHT;
#else
{
e.pflags = PFLAGS_FULLDYNAMIC;
e.light_lev = 100;
e.color_x = 2;
e.color_y = 1;
e.color_z = 0;
}
#endif // FTE
}
//
// Light_Purple(e)
// RGB: 255, 28, 255
//
void(entity e) Light_Purple =
{
e.effects = e.effects | EF_FULLBRIGHT;
#ifndef FTE
e.effects = e.effects | EF_PURPLELIGHT;
#else
{
e.pflags = PFLAGS_FULLDYNAMIC;
e.light_lev = 100;
e.color_x = 2;
e.color_y = 0.25;
e.color_z = 2;
}
#endif // FTE
}
//
// Light_Cyan(e)
// RGB: 97, 178, 248
//
void(entity e) Light_Cyan =
{
e.effects = e.effects | EF_FULLBRIGHT;
#ifndef FTE
e.effects = e.effects | EF_CYANLIGHT;
#else
{
e.pflags = PFLAGS_FULLDYNAMIC;
e.light_lev = 100;
e.color_x = 0.765;
e.color_y = 1.4;
e.color_z = 1.95;
}
#endif // FTE
}
//
// Light_Pink(e)
// RGB: 255, 180, 180
//
void(entity e) Light_Pink =
{
e.effects = e.effects | EF_FULLBRIGHT;
#ifndef FTE
e.effects = e.effects | EF_PINKLIGHT;
#else
{
e.pflags = PFLAGS_FULLDYNAMIC;
e.light_lev = 100;
e.color_x = 2.37;
e.color_y = 1.35;
e.color_z = 1.35;
}
#endif // FTE
}
//
// Light_Lime(e)
// RGB: 128, 255, 128
//
void(entity e) Light_Lime =
{
e.effects = e.effects | EF_FULLBRIGHT;
#ifndef FTE
e.effects = e.effects | EF_LIMELIGHT;
#else
{
e.pflags = PFLAGS_FULLDYNAMIC;
e.light_lev = 100;
e.color_x = 1;
e.color_y = 2;
e.color_z = 1;
}
#endif // FTE
}
//
// Light_Yellow(e)
// RGB: 255, 255, 128
//
void(entity e) Light_Yellow =
{
e.effects = e.effects | EF_FULLBRIGHT;
#ifndef FTE
e.effects = e.effects | EF_YELLOWLIGHT;
#else
{
e.pflags = PFLAGS_FULLDYNAMIC;
e.light_lev = 100;
e.color_x = 2;
e.color_y = 2;
e.color_z = 1;
}
#endif // FTE
}
//
// Light_None(e)
// Resets all Perk Light Effects.
//
void(entity e) Light_None =
{
e.effects = 0;
#ifdef FTE
{
e.pflags = 0;
e.light_lev = 0;
e.color_x = 0;
e.color_y = 0;
e.color_z = 0;
}
#endif // FTE
}
#ifdef FTE
void(entity what, float fullbright, float light_level,

View file

@ -31,170 +31,24 @@ void() W_Switch;
void() W_TakeOut;
void() mystery_touch;
//
// --------------------
// Lights
// --------------------
//
//
// Light_Red(e)
// RGB: 255, 56, 56
//
void(entity e) Light_Red =
{
e.effects = e.effects | EF_FULLBRIGHT;
#ifndef FTE
e.effects = e.effects | EF_RED;
#else
{
e.pflags = PFLAGS_FULLDYNAMIC;
e.light_lev = 100;
e.color_x = 2;
e.color_y = 0.25;
e.color_z = 0.25;
}
#endif // FTE
}
//
// Light_Green(e)
// RGB: 56, 255, 56
//
void(entity e) Light_Green =
{
e.effects = e.effects | EF_FULLBRIGHT;
#ifndef FTE
e.effects = e.effects | EF_GREEN;
#else
{
e.pflags = PFLAGS_FULLDYNAMIC;
e.light_lev = 100;
e.color_x = 0.25;
e.color_y = 2;
e.color_z = 0.25;
}
#endif // FTE
}
//
// Light_Blue(e)
// RGB: 56, 56, 255
//
void(entity e) Light_Blue =
{
e.effects = e.effects | EF_FULLBRIGHT;
#ifndef FTE
e.effects = e.effects | EF_BLUE;
#else
{
e.pflags = PFLAGS_FULLDYNAMIC;
e.light_lev = 100;
e.color_x = 0.25;
e.color_y = 0.25;
e.color_z = 2;
}
#endif // FTE
}
//
// Light_Orange(e)
// RGB: 255, 128, 0
//
void(entity e) Light_Orange =
{
e.effects = e.effects | EF_FULLBRIGHT;
#ifndef FTE
e.effects = e.effects | EF_ORANGELIGHT;
#else
{
e.pflags = PFLAGS_FULLDYNAMIC;
e.light_lev = 100;
e.color_x = 2;
e.color_y = 1;
e.color_z = 0;
}
#endif // FTE
}
//
// Light_Purple(e)
// RGB: 255, 28, 255
//
void(entity e) Light_Purple =
{
e.effects = e.effects | EF_FULLBRIGHT;
#ifndef FTE
e.effects = e.effects | EF_PURPLELIGHT;
#else
{
e.pflags = PFLAGS_FULLDYNAMIC;
e.light_lev = 100;
e.color_x = 2;
e.color_y = 0.25;
e.color_z = 2;
}
#endif // FTE
}
//
// Light_None(e)
// Resets all Perk Light Effects.
//
void(entity e) Light_None =
{
e.effects = 0;
#ifdef FTE
{
e.pflags = 0;
e.light_lev = 0;
e.color_x = 0;
e.color_y = 0;
e.color_z = 0;
}
#endif // FTE
}
//
// --------------------
// Core Perk System
// --------------------
//
// Light Color Spawnflags
#define PERK_SPAWNFLAG_NOLIGHT 1
#define PERK_SPAWNFLAG_REDLIGHT 2
#define PERK_SPAWNFLAG_GREENLIGHT 4
#define PERK_SPAWNFLAG_BLUELIGHT 8
#define PERK_SPAWNFLAG_ORANGELIGHT 16
#define PERK_SPAWNFLAG_PURPLELIGHT 32
#define PERK_SPAWNFLAG_CYANLIGHT 64
#define PERK_SPAWNFLAG_PINKLIGHT 128
#define PERK_SPAWNFLAG_LIMELIGHT 256
#define PERK_SPAWNFLAG_YELLOWLIGHT 512
//
// GivePerk(p)
// Restores View Model and tells the Client to draw the Perk.
@ -469,24 +323,36 @@ void() touch_perk =
//
void(entity who) Turn_PerkLight_On =
{
if (who.spawnflags & 1) {
if (who.spawnflags & PERK_SPAWNFLAG_NOLIGHT) {
Light_None(who);
}
if (who.spawnflags & 2) {
if (who.spawnflags & PERK_SPAWNFLAG_REDLIGHT) {
Light_Red(who);
}
if (who.spawnflags & 4) {
if (who.spawnflags & PERK_SPAWNFLAG_GREENLIGHT) {
Light_Green(who);
}
if (who.spawnflags & 8) {
if (who.spawnflags & PERK_SPAWNFLAG_BLUELIGHT) {
Light_Blue(who);
}
if (who.spawnflags & 16) {
if (who.spawnflags & PERK_SPAWNFLAG_ORANGELIGHT) {
Light_Orange(who);
}
if (who.spawnflags & 32) {
if (who.spawnflags & PERK_SPAWNFLAG_PURPLELIGHT) {
Light_Purple(who);
}
if (who.spawnflags & PERK_SPAWNFLAG_CYANLIGHT) {
Light_Cyan(who);
}
if (who.spawnflags & PERK_SPAWNFLAG_PINKLIGHT) {
Light_Pink(who);
}
if (who.spawnflags & PERK_SPAWNFLAG_LIMELIGHT) {
Light_Lime(who);
}
if (who.spawnflags & PERK_SPAWNFLAG_YELLOWLIGHT) {
Light_Yellow(who);
}
}
//
@ -592,7 +458,7 @@ void() perk_revive =
// Light Effect
if (!self.spawnflags) {
self.spawnflags = self.spawnflags | 8;
self.spawnflags = self.spawnflags | PERK_SPAWNFLAG_CYANLIGHT;
}
// Set up the Perk Entity
@ -656,7 +522,7 @@ void() perk_flopper =
// Light Effect
if (!self.spawnflags) {
self.spawnflags = self.spawnflags | 16;
self.spawnflags = self.spawnflags | PERK_SPAWNFLAG_YELLOWLIGHT;
}
// Set up the Perk Entity
@ -718,7 +584,7 @@ void() perk_juggernog =
// Light Effect
if (!self.spawnflags) {
self.spawnflags = self.spawnflags | 2;
self.spawnflags = self.spawnflags | PERK_SPAWNFLAG_PINKLIGHT;
}
// Set up the Perk Entity
@ -780,7 +646,7 @@ void() perk_staminup =
// Light Effect
if (!self.spawnflags) {
self.spawnflags = self.spawnflags | 16;
self.spawnflags = self.spawnflags | PERK_SPAWNFLAG_YELLOWLIGHT;
}
// Set up the Perk Entity
@ -842,7 +708,7 @@ void() perk_speed =
// Light Effect
if (!self.spawnflags) {
self.spawnflags = self.spawnflags | 4;
self.spawnflags = self.spawnflags | PERK_SPAWNFLAG_LIMELIGHT;
}
// Set up the Perk Entity
@ -904,7 +770,7 @@ void() perk_double =
// Light Effect
if (!self.spawnflags) {
self.spawnflags = self.spawnflags | 16;
self.spawnflags = self.spawnflags | PERK_SPAWNFLAG_YELLOWLIGHT;
}
// Set up the Perk Entity
@ -967,7 +833,7 @@ void() perk_deadshot =
// Light Effect
if (!self.spawnflags) {
self.spawnflags = self.spawnflags | 16;
self.spawnflags = self.spawnflags | PERK_SPAWNFLAG_YELLOWLIGHT;
}
// Set up the Perk Entity
@ -1031,7 +897,7 @@ void() perk_mule =
// Light Effect
if (!self.spawnflags) {
self.spawnflags = self.spawnflags | 4;
self.spawnflags = self.spawnflags | PERK_SPAWNFLAG_LIMELIGHT;
}
// Set up the Perk Entity
@ -1197,7 +1063,7 @@ void() updateBoxGlow
};
void() box_open1 =[ 1, box_open2 ] { self.frame = 1;updateBoxGlow(); Light_Orange(self);};
void() box_open1 =[ 1, box_open2 ] { self.frame = 1;updateBoxGlow(); Light_Yellow(self);};
void() box_open2 =[ 2, box_open3 ] { self.frame = 2;updateBoxGlow();};
void() box_open3 =[ 3, box_open4 ] { self.frame = 3;updateBoxGlow();};
void() box_open4 =[ 4, box_open5 ] { self.frame = 4;updateBoxGlow();};