2016-12-05 22:25:47 +00:00
|
|
|
/*
|
2017-04-30 23:21:49 +00:00
|
|
|
FreeCS Project
|
2017-01-07 20:18:15 +00:00
|
|
|
Copyright (C) 2016, 2017 Marco "eukara" Hladik
|
2016-12-05 22:25:47 +00:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2016-12-07 23:09:50 +00:00
|
|
|
/*
|
|
|
|
=================
|
|
|
|
light
|
|
|
|
|
|
|
|
Only thing this ent does, is allow the change of lightstyles.
|
|
|
|
You can use custom patterns, too.
|
|
|
|
=================
|
|
|
|
*/
|
|
|
|
.string pattern;
|
2016-12-05 22:25:47 +00:00
|
|
|
void light( void ) {
|
|
|
|
static void light_toggle( void ) {
|
|
|
|
if ( self.health == TRUE ) {
|
|
|
|
lightstyle( self.style, "a" );
|
|
|
|
self.health = FALSE;
|
|
|
|
} else {
|
2016-12-07 23:09:50 +00:00
|
|
|
lightstyle( self.style, self.pattern );
|
2016-12-05 22:25:47 +00:00
|
|
|
self.health = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-12-07 23:09:50 +00:00
|
|
|
if ( !self.pattern ) {
|
|
|
|
self.pattern = "m";
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( self.spawnflags & 1 ) {
|
|
|
|
lightstyle( self.style, "a" );
|
|
|
|
self.health = FALSE;
|
|
|
|
} else {
|
|
|
|
lightstyle( self.style, self.pattern );
|
|
|
|
self.health = TRUE;
|
|
|
|
}
|
|
|
|
|
2016-12-05 22:25:47 +00:00
|
|
|
self.vUse = light_toggle;
|
|
|
|
}
|
2017-06-24 12:36:36 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
=================
|
|
|
|
light_environment
|
|
|
|
|
|
|
|
This is just a dummy to prevent the engine from complaining.
|
|
|
|
Don't get too excited.
|
|
|
|
=================
|
|
|
|
*/
|
|
|
|
void light_environment( void ) {
|
|
|
|
remove( self );
|
|
|
|
}
|