if (!self.speed)
self.speed = 100;
+ if (!InitMovingBrushTrigger())
+ return;
+ self.effects |= EF_LOWPRECISION;
+
if (self.spawnflags & 2)
{
self.platmovetype_turn = TRUE;
else
self.view_ofs = self.mins;
- if (!InitMovingBrushTrigger())
- return;
- self.effects |= EF_LOWPRECISION;
-
// wait for targets to spawn
InitializeEntity(self, func_train_find, INITPRIO_SETLOCATION);
void func_rotating_setactive(float astate)
{
-
+
if (astate == ACTIVE_TOGGLE)
- {
+ {
if(self.active == ACTIVE_ACTIVE)
self.active = ACTIVE_NOT;
else
}
else
self.active = astate;
-
- if(self.active == ACTIVE_NOT)
+
+ if(self.active == ACTIVE_NOT)
self.avelocity = '0 0 0';
else
self.avelocity = self.pos1;
precache_sound(self.noise);
ambientsound(self.origin, self.noise, VOL_BASE, ATTEN_IDLE);
}
-
+
self.active = ACTIVE_ACTIVE;
self.setactive = func_rotating_setactive;
-
+
if (!self.speed)
self.speed = 100;
// FIXME: test if this turns the right way, then remove this comment (negate as needed)
// FIXME: test if this turns the right way, then remove this comment (negate as needed)
else // Z
self.avelocity = '0 1 0' * self.speed;
-
+
self.pos1 = self.avelocity;
-
+
if(self.dmg && (self.message == ""))
self.message = " was squished";
if(self.dmg && (self.message2 == ""))
{
vector v;
self.nextthink = time + 0.1;
-
- if (!(self.owner.active == ACTIVE_ACTIVE))
+
+ if(self.owner.active != ACTIVE_ACTIVE)
{
- self.owner.velocity = '0 0 0';
+ self.owner.velocity = '0 0 0';
return;
}
-
+
// calculate sinewave using makevectors
makevectors((self.nextthink * self.owner.cnt + self.owner.phase * 360) * '0 1 0');
v = self.owner.destvec + self.owner.movedir * v_forward_y;
void button_use()
{
- if (!(self.active == ACTIVE_ACTIVE))
+ if(self.active != ACTIVE_ACTIVE)
return;
self.enemy = activator;
float door_check_keys(void) {
local entity door;
-
-
+
+
if (self.owner)
door = self.owner;
else
door = self;
-
+
// no key needed
if (!door.itemkeys)
return TRUE;
// only a player can have a key
if (!IS_PLAYER(other))
return FALSE;
-
+
if (item_keys_usekey(door, other)) {
// some keys were used
if (other.key_door_messagetime <= time) {
play2(other, "misc/talk.wav");
- centerprint(other, strcat("You also need ", item_keys_keylist(door.itemkeys), "!"));
+ Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_DOOR_LOCKED_ALSONEED, item_keys_keylist(door.itemkeys));
other.key_door_messagetime = time + 2;
}
} else {
// no keys were used
if (other.key_door_messagetime <= time) {
play2(other, "misc/talk.wav");
- centerprint(other, strcat("You need ", item_keys_keylist(door.itemkeys), "!"));
+ Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_DOOR_LOCKED_NEED, item_keys_keylist(door.itemkeys));
other.key_door_messagetime = time + 2;
}
}
if (door.itemkeys) {
// door is now unlocked
play2(other, "misc/talk.wav");
- centerprint(other, "Door unlocked!");
+ Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_DOOR_UNLOCKED);
return TRUE;
} else
return FALSE;
entity oself;
//dprint("door_use (model: ");dprint(self.model);dprint(")\n");
-
+
if (self.owner)
{
oself = self;
if (time < self.attack_finished_single)
return;
-
+
// check if door is locked
if (!door_check_keys())
return;
-
+
self.attack_finished_single = time + 1;
activator = other;
if(!(DEATH_ISSPECIAL(deathtype)) && (deathtype & HITTYPE_SPLASH))
return;
self.health = self.health - damage;
-
+
if (self.itemkeys) {
// don't allow opening doors through damage if keys are required
return;
}
-
+
if (self.health <= 0)
{
oself = self;
self.itemkeys |= ITEM_KEY_BIT(0);
if (self.spawnflags & SPAWNFLAGS_SILVER_KEY)
self.itemkeys |= ITEM_KEY_BIT(1);
-
+
//if (!self.deathtype) // map makers can override this
// self.deathtype = " got in the way";
SetMovedir ();
float n, i, t;
self.nextthink = time + 0.1;
- if (!(self.owner.active == ACTIVE_ACTIVE))
+ if(self.owner.active != ACTIVE_ACTIVE)
{
- self.owner.velocity = '0 0 0';
+ self.owner.velocity = '0 0 0';
return;
}
{
self.nextthink = time + 0.1;
- if (!(self.owner.active == ACTIVE_ACTIVE))
+ if(self.owner.active != ACTIVE_ACTIVE)
{
- self.owner.velocity = '0 0 0';
+ self.owner.velocity = '0 0 0';
return;
}