//
// print the message
//
- if (IS_PLAYER(activator) && self.message != "")
+ if(IS_PLAYER(activator) && self.message != "")
+ if(IS_REAL_CLIENT(activator))
{
- if(IS_REAL_CLIENT(activator))
- {
- centerprint (activator, self.message);
- if (self.noise == "")
- play2(activator, "misc/talk.wav");
- }
+ Send_Notification(NOTIF_ONE, activator, MSG_CENTER, CENTER_TRIGGER, self.message);
+ if (self.noise == "")
+ play2(activator, "misc/talk.wav");
}
//
//=============================================================================
-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.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;
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
void counter_use()
{
- self.count = self.count - 1;
+ self.count -= 1;
if (self.count < 0)
return;
- if (self.count != 0)
+ if (self.count == 0)
{
- if (IS_PLAYER(activator)
- && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0)
- {
- if (self.count >= 4)
- centerprint (activator, "There are more to go...");
- else if (self.count == 3)
- centerprint (activator, "Only 3 more to go...");
- else if (self.count == 2)
- centerprint (activator, "Only 2 more to go...");
- else
- centerprint (activator, "Only 1 more to go...");
- }
- return;
+ if(IS_PLAYER(activator) && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0)
+ Send_Notification(NOTIF_ONE, activator, MSG_CENTER, CENTER_SEQUENCE_COMPLETED);
+
+ self.enemy = activator;
+ multi_trigger ();
+ }
+ else
+ {
+ if(IS_PLAYER(activator) && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0)
+ if(self.count >= 4)
+ Send_Notification(NOTIF_ONE, activator, MSG_CENTER, CENTER_SEQUENCE_COUNTER);
+ else
+ Send_Notification(NOTIF_ONE, activator, MSG_CENTER, CENTER_SEQUENCE_COUNTER_FEWMORE, self.count);
}
-
- if (IS_PLAYER(activator)
- && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0)
- centerprint(activator, "Sequence completed!");
- self.enemy = activator;
- multi_trigger ();
}
void counter_reset()
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)
{
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);
}
}
}
{
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);
}
}
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;
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.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');
if(!pushdeltatime) return;
other.velocity = other.velocity + normalize(targ.origin - self.origin) * str * pushdeltatime;
- other.flags &~= FL_ONGROUND;
+ other.flags &= ~FL_ONGROUND;
UpdateCSQCProjectile(other);
}