SERVER/PC: Add New Light_Custom() function for dynamic lights.

This commit is contained in:
Steam Deck User 2023-01-15 23:13:06 -05:00
parent 934e4bacce
commit 5bee39d063
2 changed files with 23 additions and 22 deletions

View file

@ -95,4 +95,26 @@ void() light_torch_small_yellow = // Light with small flame & fire sound
void() light_torch_large_yellow = // Light with larger flame & fire sound
{ Precache_Set("progs/flame2.mdl"); self.frame = 1; makestatic(self); }
void() light_flame_small_white = // Light with small flame & fire sound
{ Precache_Set("progs/flame2.mdl"); makestatic(self); }
{ Precache_Set("progs/flame2.mdl"); makestatic(self); }
//
// --------------------
// Spawnable Dynamic Lights
// --------------------
//
#ifdef PC
void(entity what, float fullbright, float light_level,
float red, float green, float blue) Light_Custom =
{
if (fullbright)
what.effects = what.effects | EF_FULLBRIGHT;
{
what.pflags = PFLAGS_FULLDYNAMIC;
what.light_lev = light_level;
what.color_x = red;
what.color_y = green;
what.color_z = blue;
}
}
#endif

View file

@ -155,27 +155,6 @@ void(entity e) Light_None =
#endif
}
//
// Light_Custom(e, r, g, b)
// For custom Perk Light Effects, generally not recommended
// unless you're testing a cool selection of colors and do not
// want to constantly recompile the client, or the client is
// inaccessible. Only functional on PC/FTE atm (TODO?)
//
void(entity e, float r, float g, float b) Light_Custom =
{
e.effects = e.effects | EF_FULLBRIGHT;
#ifdef PC
{
e.pflags = PFLAGS_FULLDYNAMIC;
e.light_lev = 100;
e.color_x = r/255;
e.color_y = g/255;
e.color_z = b/255;
}
#endif
}
//
// --------------------
// Core Perk System