//=============================================================================
-float SPAWNFLAG_NOMESSAGE = 1;
-float SPAWNFLAG_NOTOUCH = 1;
+const float SPAWNFLAG_NOMESSAGE = 1;
+const float SPAWNFLAG_NOTOUCH = 1;
// the wait time has passed, so set back up for another activation
void multi_wait()
if (self.classname == "trigger_secret")
{
- if not(IS_PLAYER(self.enemy))
+ if (!IS_PLAYER(self.enemy))
return;
found_secrets = found_secrets + 1;
WriteByte (MSG_ALL, SVC_FOUNDSECRET);
}
if (self.noise)
- sound (self.enemy, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
+ sound (self.enemy, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
// don't trigger again until reset
self.takedamage = DAMAGE_NO;
void multi_touch()
{
- if not(self.spawnflags & 2)
- if not(other.iscreature)
+ if (!(self.spawnflags & 2))
+ if (!other.iscreature)
return;
if(self.team)
- if((self.spawnflags & 4 == 0) == (self.team != other.team))
+ if(((self.spawnflags & 4) == 0) == (self.team != other.team))
return;
// if the trigger has an angles field, check player's facing direction
.float triggerhurttime;
void trigger_hurt_touch()
{
- if (self.active != ACTIVE_ACTIVE)
+ if (self.active != ACTIVE_ACTIVE)
return;
if(self.team)
- if((self.spawnflags & 4 == 0) == (self.team != other.team))
+ if(((self.spawnflags & 4) == 0) == (self.team != other.team))
return;
// only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu)
entity own;
own = self.enemy;
- if not(IS_PLAYER(own))
+ if (!IS_PLAYER(own))
{
own = self;
self.enemy = world; // I still hate you all
.float triggerhealtime;
void trigger_heal_touch()
{
- if (self.active != ACTIVE_ACTIVE)
+ if (self.active != ACTIVE_ACTIVE)
return;
-
+
// only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu)
if (other.iscreature)
{
{
EXACTTRIGGER_TOUCH;
other.triggerhealtime = time + 1;
-
+
if (other.health < self.max_health)
{
other.health = min(other.health + self.health, self.max_health);
other.pauserothealth_finished = max(other.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot);
- sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
+ sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
}
}
}
void spawnfunc_trigger_heal()
{
self.active = ACTIVE_ACTIVE;
-
+
EXACTTRIGGER_INIT;
self.touch = trigger_heal_touch;
if (!self.health)
g = self.gravity;
- if not(self.spawnflags & 1)
+ if (!(self.spawnflags & 1))
{
if(other.trigger_gravity_check)
{
{
other.gravity = g;
if(self.noise != "")
- sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
+ sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
UpdateCSQCProjectile(self.owner);
}
}
void target_speaker_use_off();
void target_speaker_use_activator()
{
- if not(IS_REAL_CLIENT(activator))
+ if (!IS_REAL_CLIENT(activator))
return;
string snd;
if(substring(self.noise, 0, 1) == "*")
if(!self.atten && !(self.spawnflags & 4))
{
IFTARGETED
- self.atten = ATTN_NORM;
+ self.atten = ATTEN_NORM;
else
- self.atten = ATTN_STATIC;
+ self.atten = ATTEN_STATIC;
}
else if(self.atten < 0)
self.atten = 0;
setmodel(self, self.model);
if(self.noise != "")
precache_sound (self.noise);
-
+
if(!self.bgmscriptsustain)
self.bgmscriptsustain = 1;
else if(self.bgmscriptsustain < 0)
self.bgmscriptsustain = 0;
if(!self.atten)
- self.atten = ATTN_NORM;
+ self.atten = ATTEN_NORM;
else if(self.atten < 0)
self.atten = 0;
if(!self.volume)
if(self.enemy)
{
o = self.enemy.origin;
- if not(self.spawnflags & 2)
+ if (!(self.spawnflags & 2))
o = self.origin + normalize(o - self.origin) * 32768;
}
else
if(self.dmg)
{
if(self.team)
- if((self.spawnflags & 8 == 0) == (self.team != hitent.team))
+ if(((self.spawnflags & 8) == 0) == (self.team != hitent.team))
return;
if(hitent.takedamage)
Damage(hitent, self, self, ((self.dmg < 0) ? 100000 : (self.dmg * frametime)), DEATH_HURTTRIGGER, hitloc, '0 0 0');
float pushdeltatime;
float str;
- if (self.active != ACTIVE_ACTIVE)
+ if (self.active != ACTIVE_ACTIVE)
return;
if (!isPushable(other))
if(!pushdeltatime) return;
other.velocity = other.velocity + normalize(targ.origin - self.origin) * str * pushdeltatime;
- other.flags &~= FL_ONGROUND;
+ other.flags &= ~FL_ONGROUND;
UpdateCSQCProjectile(other);
}
{
float pushdeltatime;
- if (self.active != ACTIVE_ACTIVE)
+ if (self.active != ACTIVE_ACTIVE)
return;
if (!isPushable(other))
float pushdeltatime;
float str;
- if (self.active != ACTIVE_ACTIVE)
+ if (self.active != ACTIVE_ACTIVE)
return;
if (!isPushable(other))
return;
if(vs.message == "")
return;
- if not(IS_PLAYER(pl))
+ if (!IS_PLAYER(pl))
return;
if(gameover)
return;
// added after this message
// wait: average time between messages
// delay: initial delay before the first message
-
+
float i, n;
self.use = target_voicescript_use;
dotrigger = ((IS_PLAYER(source)) && (source.deadflag == DEAD_NO) && ((ear.radius == 0) || (vlen(source.origin - ear.origin) <= ear.radius)));
domatch = ((ear.spawnflags & 32) || dotrigger);
- if not(domatch)
+ if (!domatch)
return msgin;
- if not(msgin)
+ if (!msgin)
{
// we are in TUBA mode!
- if not(ear.spawnflags & 256)
+ if (!(ear.spawnflags & 256))
return msgin;
if(!W_Tuba_HasPlayed(source, ear.message, ear.movedir_x, !(ear.spawnflags & 512), ear.movedir_y, ear.movedir_z))
if(ear.spawnflags & 8)
return msgin;
}
-
+
matchstart = -1;
l = strlen(ear.message);
for(ear = magicears; ear; ear = ear.enemy)
{
msgout = trigger_magicear_processmessage(ear, source, teamsay, privatesay, msgin);
- if not(ear.spawnflags & 64)
+ if (!(ear.spawnflags & 64))
if(magicear_matched)
return msgout;
msgin = msgout;
void relay_activators_use()
{
entity trg, os;
-
+
os = self;
-
+
for(trg = world; (trg = find(trg, targetname, os.target)); )
{
self = trg;
if(os.cnt == ACTIVE_TOGGLE)
if(trg.active == ACTIVE_ACTIVE)
trg.active = ACTIVE_NOT;
- else
+ else
trg.active = ACTIVE_ACTIVE;
else
trg.active = os.cnt;
- }
+ }
}
self = os;
}
void spawnfunc_relay_deactivate()
{
self.cnt = ACTIVE_NOT;
- self.use = relay_activators_use;
+ self.use = relay_activators_use;
}
void spawnfunc_relay_activatetoggle()
{
self.cnt = ACTIVE_TOGGLE;
- self.use = relay_activators_use;
+ self.use = relay_activators_use;
}
.string chmap, gametype;