bit manip cleanup

This commit is contained in:
Bill Currie 2004-02-08 06:50:44 +00:00
parent 523094fa2f
commit b3998b0f96
14 changed files with 106 additions and 112 deletions

View file

@ -898,9 +898,9 @@ void() CheckWaterJump =
traceline (start, end, TRUE, @self); traceline (start, end, TRUE, @self);
if (trace_fraction == 1) if (trace_fraction == 1)
{ // open at eye level { // open at eye level
@self.flags = @self.flags | FL_WATERJUMP; @self.flags |= FL_WATERJUMP;
@self.velocity_z = 225; @self.velocity_z = 225;
@self.flags = @self.flags - (@self.flags & FL_JUMPRELEASED); @self.flags &= ~FL_JUMPRELEASED;
@self.teleport_time = time + 2; // safety net @self.teleport_time = time + 2; // safety net
return; return;
} }
@ -956,7 +956,7 @@ void() PlayerPreThink =
PlayerJump (); PlayerJump ();
} }
else else
@self.flags = @self.flags | FL_JUMPRELEASED; @self.flags |= FL_JUMPRELEASED;
// teleporters can force a non-moving pause time // teleporters can force a non-moving pause time
if (time < @self.pausetime) if (time < @self.pausetime)
@self.velocity = '0 0 0'; @self.velocity = '0 0 0';
@ -1063,13 +1063,13 @@ void() CheckPowerups =
// + POX - ignore light effects in Dark Mode // + POX - ignore light effects in Dark Mode
if (@self.invincible_finished > time && !(deathmatch & DM_DARK)) if (@self.invincible_finished > time && !(deathmatch & DM_DARK))
{ {
@self.effects = @self.effects | EF_DIMLIGHT; @self.effects |= EF_DIMLIGHT;
@self.effects = @self.effects | EF_RED; @self.effects |= EF_RED;
} }
else else
{ {
@self.effects = @self.effects - (@self.effects & EF_DIMLIGHT); @self.effects &= ~EF_DIMLIGHT;
@self.effects = @self.effects - (@self.effects & EF_RED); @self.effects &= ~EF_RED;
} }
} }
// super damage // super damage

View file

@ -27,16 +27,16 @@ void() start_dynlight =
//POX v1.1 - changed this for QW support //POX v1.1 - changed this for QW support
//No EF_BRIGHTFIELD in QW - defaults to EF_DIMLIGHT //No EF_BRIGHTFIELD in QW - defaults to EF_DIMLIGHT
if (@self.dynlight_style == 2) if (@self.dynlight_style == 2)
@self.effects = @self.effects | EF_BRIGHTLIGHT; @self.effects |= EF_BRIGHTLIGHT;
else if (@self.dynlight_style == 4) else if (@self.dynlight_style == 4)
@self.effects = @self.effects | EF_BLUE; @self.effects |= EF_BLUE;
else if (@self.dynlight_style == 5) else if (@self.dynlight_style == 5)
@self.effects = @self.effects | EF_RED; @self.effects |= EF_RED;
else else
@self.effects = @self.effects | EF_DIMLIGHT; @self.effects |= EF_DIMLIGHT;
dynlight_next(); dynlight_next();

View file

@ -42,7 +42,7 @@ void() q_touch =
sound (other, CHAN_VOICE, @self.noise, 1, ATTN_NORM); sound (other, CHAN_VOICE, @self.noise, 1, ATTN_NORM);
stuffcmd (other, "bf\n"); stuffcmd (other, "bf\n");
@self.solid = SOLID_NOT; @self.solid = SOLID_NOT;
other.items = other.items | IT_QUAD; other.items |= IT_QUAD;
@self.model = string_null; @self.model = string_null;
//if (deathmatch == 4) //if (deathmatch == 4)
//{ //{
@ -102,7 +102,7 @@ void() r_touch =
sound (other, CHAN_VOICE, @self.noise, 1, ATTN_NORM); sound (other, CHAN_VOICE, @self.noise, 1, ATTN_NORM);
stuffcmd (other, "bf\n"); stuffcmd (other, "bf\n");
@self.solid = SOLID_NOT; @self.solid = SOLID_NOT;
other.items = other.items | IT_INVISIBILITY; other.items |= IT_INVISIBILITY;
@self.model = string_null; @self.model = string_null;
// do the apropriate action // do the apropriate action
other.invisible_time = 1; other.invisible_time = 1;
@ -287,7 +287,7 @@ void() health_touch =
// Megahealth = rot down the player's super health // Megahealth = rot down the player's super health
if (@self.healtype == 2) if (@self.healtype == 2)
{ {
other.items = other.items | IT_SUPERHEALTH; other.items |= IT_SUPERHEALTH;
//if (deathmatch != 4) //if (deathmatch != 4)
//{ //{
@self.nextthink = time + 5; @self.nextthink = time + 5;
@ -319,7 +319,7 @@ void() item_megahealth_rot =
} }
// it is possible for a player to die and respawn between rots, so don't // it is possible for a player to die and respawn between rots, so don't
// just blindly subtract the flag off // just blindly subtract the flag off
other.items = other.items - (other.items & IT_SUPERHEALTH); other.items &= ~IT_SUPERHEALTH;
//if (deathmatch != 2) // deathmatch 2 is silly old rules //if (deathmatch != 2) // deathmatch 2 is silly old rules
//{ //{
@ -474,7 +474,7 @@ void() weapon_touch =
bound_other_ammo (); bound_other_ammo ();
// change to the weapon // change to the weapon
old = other.items; old = other.items;
other.items = other.items | new; other.items |= new;
stemp = @self; stemp = @self;
@self = other; @self = other;
@ -930,7 +930,7 @@ void() key_touch =
sprint (other,PRINT_LOW, "\n"); sprint (other,PRINT_LOW, "\n");
sound (other, CHAN_ITEM, @self.noise, 1, ATTN_NORM); sound (other, CHAN_ITEM, @self.noise, 1, ATTN_NORM);
stuffcmd (other, "bf\n"); stuffcmd (other, "bf\n");
other.items = other.items | @self.items; other.items |= @self.items;
@self.solid = SOLID_NOT; @self.solid = SOLID_NOT;
@self.model = string_null; @self.model = string_null;
activator = other; activator = other;
@ -1045,7 +1045,7 @@ void() sigil_touch =
stuffcmd (other, "bf\n"); stuffcmd (other, "bf\n");
@self.solid = SOLID_NOT; @self.solid = SOLID_NOT;
@self.model = string_null; @self.model = string_null;
serverflags = serverflags | (@self.spawnflags & 15); serverflags &= ~15;
@self.classname = ""; // so rune doors won't find it @self.classname = ""; // so rune doors won't find it
activator = other; activator = other;
@ -1107,7 +1107,7 @@ void() powerup_touch =
sound (other, CHAN_VOICE, @self.noise, 1, ATTN_NORM); sound (other, CHAN_VOICE, @self.noise, 1, ATTN_NORM);
stuffcmd (other, "bf\n"); stuffcmd (other, "bf\n");
@self.solid = SOLID_NOT; @self.solid = SOLID_NOT;
other.items = other.items | @self.items; other.items |= @self.items;
@self.model = string_null; @self.model = string_null;
// do the apropriate action // do the apropriate action
if (@self.classname == "item_artifact_envirosuit") if (@self.classname == "item_artifact_envirosuit")
@ -1153,7 +1153,7 @@ void() item_artifact_invulnerability =
@self.noise = "items/protect.wav"; @self.noise = "items/protect.wav";
setmodel (@self, "progs/poxmegs.mdl"); setmodel (@self, "progs/poxmegs.mdl");
@self.netname = "MegaShields"; @self.netname = "MegaShields";
@self.effects = @self.effects | EF_RED; @self.effects |= EF_RED;
@self.items = IT_INVULNERABILITY; @self.items = IT_INVULNERABILITY;
setsize (@self, '-16 -16 -24', '16 16 32'); setsize (@self, '-16 -16 -24', '16 16 32');
StartItem (); StartItem ();
@ -1291,11 +1291,11 @@ void() BackpackTouch =
{ {
other.invincible_time = 1; other.invincible_time = 1;
other.invincible_finished = time + 30; other.invincible_finished = time + 30;
other.items = other.items | IT_INVULNERABILITY; other.items |= IT_INVULNERABILITY;
other.super_time = 1; other.super_time = 1;
other.super_damage_finished = time + 30; other.super_damage_finished = time + 30;
other.items = other.items | IT_QUAD; other.items |= IT_QUAD;
other.ammo_cells = 0; other.ammo_cells = 0;
@ -1331,7 +1331,7 @@ void() BackpackTouch =
if (!new) if (!new)
new = other.weapon; new = other.weapon;
old = other.items; old = other.items;
other.items = other.items | @self.items; other.items |= @self.items;
bound_other_ammo (); bound_other_ammo ();
if (@self.ammo_shells) { if (@self.ammo_shells) {

View file

@ -417,8 +417,7 @@ void() PutClientInServer =
self.movetype = MOVETYPE_WALK; self.movetype = MOVETYPE_WALK;
//POX v1.2 - remove items //POX v1.2 - remove items
self.items = self.items - (self.items & self.items &= ~(IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD) );
(IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD) );
self.show_hostile = 0; self.show_hostile = 0;
self.max_health = 100; self.max_health = 100;
@ -442,7 +441,7 @@ void() PutClientInServer =
self.weapon = IT_TSHOT; self.weapon = IT_TSHOT;
// POX v1.1 - spawn with 50 armour points // POX v1.1 - spawn with 50 armour points
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR1; self.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR1;
self.armorvalue = 50; self.armorvalue = 50;
self.armortype = 0.9; self.armortype = 0.9;
@ -490,7 +489,7 @@ void() PutClientInServer =
sound (self, CHAN_AUTO, "items/inv1.wav", 1, ATTN_NORM); sound (self, CHAN_AUTO, "items/inv1.wav", 1, ATTN_NORM);
stuffcmd (self, "bf\n"); stuffcmd (self, "bf\n");
self.items = self.items | IT_INVISIBILITY; self.items |= IT_INVISIBILITY;
self.invisible_time = 1; self.invisible_time = 1;
self.invisible_finished = time + 9999999999; self.invisible_finished = time + 9999999999;
} }
@ -587,17 +586,17 @@ void() PutClientInServer =
self.ammo_shells = 200; self.ammo_shells = 200;
self.ammo_rockets = 100; self.ammo_rockets = 100;
self.ammo_cells = 200; self.ammo_cells = 200;
self.items = self.items | IT_PLASMAGUN; self.items |= IT_PLASMAGUN;
self.items = self.items | IT_SUPER_NAILGUN; self.items |= IT_SUPER_NAILGUN;
self.items = self.items | IT_COMBOGUN; self.items |= IT_COMBOGUN;
self.items = self.items | IT_ROCKET_LAUNCHER; self.items |= IT_ROCKET_LAUNCHER;
self.items = self.items | IT_GRENADE_LAUNCHER; self.items |= IT_GRENADE_LAUNCHER;
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR3; self.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR3;
self.armorvalue = 250; self.armorvalue = 250;
self.armortype = 0.9; self.armortype = 0.9;
self.health = 200; self.health = 200;
self.items = self.items | IT_INVULNERABILITY; self.items |= IT_INVULNERABILITY;
self.invincible_time = 1; self.invincible_time = 1;
self.invincible_finished = time + 3; self.invincible_finished = time + 3;
@ -605,7 +604,7 @@ void() PutClientInServer =
self.currentammo = self.ammo_rockets; self.currentammo = self.ammo_rockets;
self.weaponmodel = "progs/v_rhino.mdl"; self.weaponmodel = "progs/v_rhino.mdl";
self.weaponframe = 0; self.weaponframe = 0;
self.items = self.items | IT_ROCKETS; self.items |= IT_ROCKETS;
self.max_health = 200; self.max_health = 200;
sound (self, CHAN_AUTO, "items/protect.wav", 1, ATTN_NORM); sound (self, CHAN_AUTO, "items/protect.wav", 1, ATTN_NORM);
@ -697,17 +696,17 @@ void() NextLevel =
else if (!(serverflags & 1)) else if (!(serverflags & 1))
{ {
mapname = "e1m1"; mapname = "e1m1";
serverflags = serverflags | 1; serverflags |= 1;
} }
else if (!(serverflags & 2)) else if (!(serverflags & 2))
{ {
mapname = "e2m1"; mapname = "e2m1";
serverflags = serverflags | 2; serverflags |= 2;
} }
else if (!(serverflags & 4)) else if (!(serverflags & 4))
{ {
mapname = "e3m1"; mapname = "e3m1";
serverflags = serverflags | 4; serverflags |= 4;
} }
else if (!(serverflags & 8)) else if (!(serverflags & 8))
{ {
@ -844,7 +843,7 @@ void() PlayerJump =
if ( !(self.flags & FL_JUMPRELEASED) ) if ( !(self.flags & FL_JUMPRELEASED) )
return; // don't pogo stick return; // don't pogo stick
self.flags = self.flags - (self.flags & FL_JUMPRELEASED); self.flags &= ~FL_JUMPRELEASED);
self.flags = self.flags - FL_ONGROUND; // don't stairwalk self.flags = self.flags - FL_ONGROUND; // don't stairwalk
@ -1021,9 +1020,9 @@ void() CheckWaterJump =
traceline (start, end, TRUE, self); traceline (start, end, TRUE, self);
if (trace_fraction == 1) if (trace_fraction == 1)
{ // open at eye level { // open at eye level
self.flags = self.flags | FL_WATERJUMP; self.flags |= FL_WATERJUMP;
self.velocity_z = 225; self.velocity_z = 225;
self.flags = self.flags - (self.flags & FL_JUMPRELEASED); self.flags &= ~FL_JUMPRELEASED);
self.teleport_time = time + 2; // safety net self.teleport_time = time + 2; // safety net
return; return;
} }
@ -1082,7 +1081,7 @@ void() PlayerPreThink =
PlayerJump (); PlayerJump ();
} }
else else
self.flags = self.flags | FL_JUMPRELEASED; self.flags |= FL_JUMPRELEASED;
// teleporters can force a non-moving pause time // teleporters can force a non-moving pause time
if (time < self.pausetime) if (time < self.pausetime)
@ -1123,7 +1122,7 @@ void() CheckPowerups =
//POX v1.1 - change armour to Yellow //POX v1.1 - change armour to Yellow
if (self.armorvalue == 150) if (self.armorvalue == 150)
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR2; self.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR2;
} }
// invisibility // invisibility
@ -1202,9 +1201,9 @@ void() CheckPowerups =
if (!(deathmatch & DM_DARK)) if (!(deathmatch & DM_DARK))
{ {
if (self.invincible_finished > time) if (self.invincible_finished > time)
self.effects = self.effects | EF_DIMLIGHT; self.effects |= EF_DIMLIGHT;
else else
self.effects = self.effects - (self.effects & EF_DIMLIGHT); self.effects &= ~EF_DIMLIGHT);
} }
} }
@ -1242,9 +1241,9 @@ void() CheckPowerups =
if (!(deathmatch & DM_DARK)) if (!(deathmatch & DM_DARK))
{ {
if (self.super_damage_finished > time) if (self.super_damage_finished > time)
self.effects = self.effects | EF_DIMLIGHT; self.effects |= EF_DIMLIGHT;
else else
self.effects = self.effects - (self.effects & EF_DIMLIGHT); self.effects &= ~EF_DIMLIGHT);
} }
} }

View file

@ -138,7 +138,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage=
{ {
save = targ.armorvalue; save = targ.armorvalue;
targ.armortype = 0; // lost all armor targ.armortype = 0; // lost all armor
targ.items = targ.items - (targ.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)); targ.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3));
} }
targ.armorvalue = targ.armorvalue - save; targ.armorvalue = targ.armorvalue - save;
@ -147,19 +147,19 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage=
if (targ.armorvalue > 150) if (targ.armorvalue > 150)
{ {
targ.armortype = 0.8; //Red Armour targ.armortype = 0.8; //Red Armour
targ.items = targ.items - (targ.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR3; targ.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR3;
} }
else if (targ.armorvalue > 50) else if (targ.armorvalue > 50)
{ {
targ.armortype = 0.8; //Yellow Armour targ.armortype = 0.8; //Yellow Armour
targ.items = targ.items - (targ.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR2; targ.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR2;
} }
else if (targ.armorvalue > 1) else if (targ.armorvalue > 1)
{ {
targ.armortype = 0.8; //Blue Armour targ.armortype = 0.8; //Blue Armour
targ.items = targ.items - (targ.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR1; targ.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR1;
} }
take = ceil(damage-save); take = ceil(damage-save);

View file

@ -603,7 +603,7 @@ void () fd_secret_use =
sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
self.nextthink = self.ltime + 0.1; self.nextthink = self.ltime + 0.1;
temp = 1 - (self.spawnflags & SECRET_1ST_LEFT); // 1 or -1 temp &= ~SECRET_1ST_LEFT); // 1 or -1
makevectors(self.mangle); makevectors(self.mangle);
if (!self.t_width) if (!self.t_width)

View file

@ -25,13 +25,13 @@ void() start_dynlight =
//POX v1.1 - changed this for QW support //POX v1.1 - changed this for QW support
//No EF_BLUE or EF_RED in Quake - defaults to EF_DIMLIGHT //No EF_BLUE or EF_RED in Quake - defaults to EF_DIMLIGHT
if (self.dynlight_style == 2) if (self.dynlight_style == 2)
self.effects = self.effects | EF_BRIGHTLIGHT; self.effects |= EF_BRIGHTLIGHT;
else if (self.dynlight_style == 3) else if (self.dynlight_style == 3)
self.effects = self.effects | EF_BRIGHTFIELD; self.effects |= EF_BRIGHTFIELD;
else else
self.effects = self.effects | EF_DIMLIGHT; self.effects |= EF_DIMLIGHT;
dynlight_next(); dynlight_next();
}; };

View file

@ -18,7 +18,7 @@ void() SUB_regen =
} }
if (self.classname == "item_artifact_super_damage" || self.classname == "item_artifact_invulnerability" || self.classname == "item_artifact_invisibility") if (self.classname == "item_artifact_super_damage" || self.classname == "item_artifact_invulnerability" || self.classname == "item_artifact_invisibility")
self.effects = self.effects | EF_DIMLIGHT; self.effects |= EF_DIMLIGHT;
}; };
@ -199,7 +199,7 @@ void() health_touch =
// Megahealth = rot down the player's super health // Megahealth = rot down the player's super health
if (self.healtype == 2) if (self.healtype == 2)
{ {
other.items = other.items | IT_SUPERHEALTH; other.items |= IT_SUPERHEALTH;
self.nextthink = time + 5; self.nextthink = time + 5;
self.think = item_megahealth_rot; self.think = item_megahealth_rot;
self.owner = other; self.owner = other;
@ -231,7 +231,7 @@ void() item_megahealth_rot =
// it is possible for a player to die and respawn between rots, so don't // it is possible for a player to die and respawn between rots, so don't
// just blindly subtract the flag off // just blindly subtract the flag off
other.items = other.items - (other.items & IT_SUPERHEALTH); other.items &= ~IT_SUPERHEALTH);
if (deathmatch >= 1) // deathmatch 2 is silly old rules if (deathmatch >= 1) // deathmatch 2 is silly old rules
{ {
@ -391,7 +391,7 @@ void() weapon_touch =
// change to the weapon // change to the weapon
old = other.items; old = other.items;
other.items = other.items | new; other.items |= new;
stemp = self; stemp = self;
self = other; self = other;
@ -859,7 +859,7 @@ local float best;
sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM); sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM);
stuffcmd (other, "bf\n"); stuffcmd (other, "bf\n");
other.items = other.items | self.items; other.items |= self.items;
if (!coop) if (!coop)
{ {
@ -1019,12 +1019,12 @@ local float best;
sound (other, CHAN_VOICE, self.noise, 1, ATTN_NORM); sound (other, CHAN_VOICE, self.noise, 1, ATTN_NORM);
stuffcmd (other, "bf\n"); stuffcmd (other, "bf\n");
self.solid = SOLID_NOT; self.solid = SOLID_NOT;
other.items = other.items | self.items; other.items |= self.items;
self.model = string_null; self.model = string_null;
if (self.classname == "item_artifact_super_damage") if (self.classname == "item_artifact_super_damage")
{ {
self.effects = self.effects - (self.effects & EF_DIMLIGHT); self.effects &= ~EF_DIMLIGHT);
self.quadcore.mdl = self.quadcore.model; self.quadcore.mdl = self.quadcore.model;
self.quadcore.model = string_null; self.quadcore.model = string_null;
@ -1041,7 +1041,7 @@ local float best;
if (self.classname == "item_artifact_invulnerability") if (self.classname == "item_artifact_invulnerability")
{ {
self.effects = self.effects - (self.effects & EF_DIMLIGHT); self.effects &= ~EF_DIMLIGHT);
other.invincible_time = 1; other.invincible_time = 1;
other.invincible_finished = time + 30; other.invincible_finished = time + 30;
} }
@ -1050,7 +1050,7 @@ local float best;
{ {
other.invisible_time = 1; other.invisible_time = 1;
other.invisible_finished = time + 30; other.invisible_finished = time + 30;
self.effects = self.effects - (self.effects & EF_DIMLIGHT); self.effects &= ~EF_DIMLIGHT);
} }
@ -1077,7 +1077,7 @@ void() item_artifact_invulnerability =
self.netname = "MegaShields"; self.netname = "MegaShields";
self.items = IT_INVULNERABILITY; self.items = IT_INVULNERABILITY;
self.effects = self.effects | EF_DIMLIGHT; self.effects |= EF_DIMLIGHT;
setsize (self, '-16 -16 -24', '16 16 32'); setsize (self, '-16 -16 -24', '16 16 32');
StartItem (); StartItem ();
@ -1124,7 +1124,7 @@ void() item_artifact_invisibility =
self.netname = "Cloaking Device"; self.netname = "Cloaking Device";
self.items = IT_INVISIBILITY; self.items = IT_INVISIBILITY;
self.effects = self.effects | EF_DIMLIGHT; self.effects |= EF_DIMLIGHT;
setsize (self, '-16 -16 -24', '16 16 32'); setsize (self, '-16 -16 -24', '16 16 32');
StartItem (); StartItem ();
@ -1177,7 +1177,7 @@ void() item_artifact_super_damage =
self.items = IT_QUAD; self.items = IT_QUAD;
setsize (self, '-16 -16 -24', '16 16 32'); setsize (self, '-16 -16 -24', '16 16 32');
self.effects = self.effects | EF_DIMLIGHT; self.effects |= EF_DIMLIGHT;
Spawn_QuadCore (); Spawn_QuadCore ();
@ -1234,7 +1234,7 @@ void() BackpackTouch =
if (!new) if (!new)
new = other.weapon; new = other.weapon;
old = other.items; old = other.items;
other.items = other.items | new; other.items |= new;
bound_other_ammo (); bound_other_ammo ();

View file

@ -178,7 +178,7 @@ void() player_run =[0, player_run ]
/* /*
//used for PulseGun fire //used for PulseGun fire
void() player_pulse1 = [$shotatt1, player_pulse2 ] {self.weaponframe=1; void() player_pulse1 = [$shotatt1, player_pulse2 ] {self.weaponframe=1;
self.effects = self.effects | EF_MUZZLEFLASH;}; self.effects |= EF_MUZZLEFLASH;};
void() player_pulse2 = [$shotatt2, player_pulse3 ] {self.weaponframe=2;}; void() player_pulse2 = [$shotatt2, player_pulse3 ] {self.weaponframe=2;};
void() player_pulse3 = [$shotatt3, player_pulse4 ] {self.weaponframe=3;}; void() player_pulse3 = [$shotatt3, player_pulse4 ] {self.weaponframe=3;};
void() player_pulse4 = [$shotatt4, player_pulse5 ] {self.weaponframe=4;}; void() player_pulse4 = [$shotatt4, player_pulse5 ] {self.weaponframe=4;};
@ -196,7 +196,7 @@ void() player_pflex6 = [$shotatt5, player_run ] {self.weaponframe=11;};
//used for t-sht and combo gun //used for t-sht and combo gun
void() player_shot1 = [15, player_shot2 ] {self.weaponframe=1; void() player_shot1 = [15, player_shot2 ] {self.weaponframe=1;
self.effects = self.effects | EF_MUZZLEFLASH;}; self.effects |= EF_MUZZLEFLASH;};
void() player_shot2 = [16, player_shot3 ] {self.weaponframe=2;}; void() player_shot2 = [16, player_shot3 ] {self.weaponframe=2;};
void() player_shot3 = [17, player_shot4 ] {self.weaponframe=3;}; void() player_shot3 = [17, player_shot4 ] {self.weaponframe=3;};
void() player_shot4 = [18, player_shot5 ] {self.weaponframe=4;}; void() player_shot4 = [18, player_shot5 ] {self.weaponframe=4;};
@ -205,7 +205,7 @@ void() player_shot6 = [19, player_run ] {self.weaponframe=6;};
// New Frame Macro For T-Shot 3 barrel fire // New Frame Macro For T-Shot 3 barrel fire
void() player_tshot1 = [15, player_tshot2 ] {self.weaponframe=1; void() player_tshot1 = [15, player_tshot2 ] {self.weaponframe=1;
self.effects = self.effects | EF_MUZZLEFLASH;}; self.effects |= EF_MUZZLEFLASH;};
void() player_tshot2 = [16, player_tshot3 ] {self.weaponframe=16;};//triple flare frame void() player_tshot2 = [16, player_tshot3 ] {self.weaponframe=16;};//triple flare frame
void() player_tshot3 = [17, player_tshot4 ] {self.weaponframe=3;}; void() player_tshot3 = [17, player_tshot4 ] {self.weaponframe=3;};
void() player_tshot4 = [18, player_tshot5 ] {self.weaponframe=4;}; void() player_tshot4 = [18, player_tshot5 ] {self.weaponframe=4;};
@ -228,7 +228,7 @@ void() player_reshot9 = [15, player_run ] {self.weaponframe=15;};
// New Frame Macro For SuperShotgun Second Trigger (Impact Grenades) // New Frame Macro For SuperShotgun Second Trigger (Impact Grenades)
void() player_gshot1 = [15, player_gshot2 ] {self.weaponframe=2; void() player_gshot1 = [15, player_gshot2 ] {self.weaponframe=2;
self.effects = self.effects | EF_MUZZLEFLASH;}; self.effects |= EF_MUZZLEFLASH;};
void() player_gshot2 = [16, player_gshot3 ] {self.weaponframe=3;}; void() player_gshot2 = [16, player_gshot3 ] {self.weaponframe=3;};
void() player_gshot3 = [17, player_gshot4 ] {self.weaponframe=4;}; void() player_gshot3 = [17, player_gshot4 ] {self.weaponframe=4;};
void() player_gshot4 = [18, player_gshot5 ] {self.weaponframe=5;}; void() player_gshot4 = [18, player_gshot5 ] {self.weaponframe=5;};
@ -237,7 +237,7 @@ void() player_gshot5 = [19, player_run ] {self.weaponframe=6;};
// New Frame Macro For Nailgun Second Trigger (Shrapnel Bomb) // New Frame Macro For Nailgun Second Trigger (Shrapnel Bomb)
void() player_shrap1 = [15, player_shrap2 ] { void() player_shrap1 = [15, player_shrap2 ] {
self.effects = self.effects | EF_MUZZLEFLASH;}; self.effects |= EF_MUZZLEFLASH;};
void() player_shrap2 = [16, player_run ] {}; void() player_shrap2 = [16, player_run ] {};
// End Nailgun Second Trigger Macro // End Nailgun Second Trigger Macro
@ -345,7 +345,7 @@ void() player_nail1 =[15, player_nail2 ]
} }
else else
{ {
self.effects = self.effects | EF_MUZZLEFLASH; self.effects |= EF_MUZZLEFLASH;
if (!self.button0) if (!self.button0)
{player_run ();return;} {player_run ();return;}
@ -375,7 +375,7 @@ void() player_nail2 =[16, player_nail1 ]
else else
{ {
self.effects = self.effects | EF_MUZZLEFLASH; self.effects |= EF_MUZZLEFLASH;
if (!self.button0) if (!self.button0)
{player_run ();return;} {player_run ();return;}
@ -410,7 +410,7 @@ void() player_plasma1 =[15, player_plasma2 ]
} }
else else
{ {
self.effects = self.effects | EF_MUZZLEFLASH; self.effects |= EF_MUZZLEFLASH;
if (!self.button0) if (!self.button0)
{player_run ();return;} {player_run ();return;}
@ -447,7 +447,7 @@ void() player_plasma2 =[16, player_plasma1 ]
else else
{ {
self.effects = self.effects | EF_MUZZLEFLASH; self.effects |= EF_MUZZLEFLASH;
if (!self.button0) if (!self.button0)
{player_run ();return;} {player_run ();return;}
@ -471,7 +471,7 @@ void() player_plasma2 =[16, player_plasma1 ]
//Had to seperate Grenade Macro from Anihilator //Had to seperate Grenade Macro from Anihilator
//to make room for new rhino animations //to make room for new rhino animations
void() player_grenade1 =[15, player_grenade2 ] {self.weaponframe=1; void() player_grenade1 =[15, player_grenade2 ] {self.weaponframe=1;
self.effects = self.effects | EF_MUZZLEFLASH;}; self.effects |= EF_MUZZLEFLASH;};
void() player_grenade2 =[16, player_grenade3 ] {self.weaponframe=2;}; void() player_grenade2 =[16, player_grenade3 ] {self.weaponframe=2;};
void() player_grenade3 =[17, player_grenade4 ] {self.weaponframe=3;}; void() player_grenade3 =[17, player_grenade4 ] {self.weaponframe=3;};
void() player_grenade4 =[18, player_grenade5 ] {self.weaponframe=4;}; void() player_grenade4 =[18, player_grenade5 ] {self.weaponframe=4;};
@ -494,7 +494,7 @@ sound (self, CHAN_WEAPON, "weapons/rhino.wav", 1, ATTN_NORM);
self.velocity = v_forward* -25; self.velocity = v_forward* -25;
self.punchangle_x = -3; self.punchangle_x = -3;
self.effects = self.effects | EF_MUZZLEFLASH;}; self.effects |= EF_MUZZLEFLASH;};
void() player_rocket2 =[15, player_rocket3 ] {self.weaponframe=2; void() player_rocket2 =[15, player_rocket3 ] {self.weaponframe=2;
W_FireRocket('0 0 24');}; W_FireRocket('0 0 24');};
void() player_rocket3 =[16, player_run ] {self.weaponframe=3;}; void() player_rocket3 =[16, player_run ] {self.weaponframe=3;};
@ -813,7 +813,7 @@ void(string gibname, float dm) ThrowHead =
setsize (self, '-16 -16 0', '16 16 56'); setsize (self, '-16 -16 0', '16 16 56');
self.velocity = VelocityForDamage (dm); self.velocity = VelocityForDamage (dm);
self.origin_z = self.origin_z - 24; self.origin_z = self.origin_z - 24;
self.flags = self.flags - (self.flags & FL_ONGROUND); self.flags &= ~FL_ONGROUND);
self.avelocity = crandom() * '0 600 0'; self.avelocity = crandom() * '0 600 0';
}; };
@ -915,7 +915,7 @@ void() PlayerDie =
{ {
local float i; local float i;
//self.items = self.items - (self.items & IT_INVISIBILITY); //self.items &= ~IT_INVISIBILITY);
self.invisible_finished = 0; // don't die as eyes self.invisible_finished = 0; // don't die as eyes
self.invincible_finished = 0; self.invincible_finished = 0;
self.super_damage_finished = 0; self.super_damage_finished = 0;
@ -937,7 +937,7 @@ void() PlayerDie =
self.view_ofs = '0 0 -8'; self.view_ofs = '0 0 -8';
self.deadflag = DEAD_DYING; self.deadflag = DEAD_DYING;
self.solid = SOLID_NOT; self.solid = SOLID_NOT;
self.flags = self.flags - (self.flags & FL_ONGROUND); self.flags &= ~FL_ONGROUND);
self.movetype = MOVETYPE_TOSS; self.movetype = MOVETYPE_TOSS;
if (self.velocity_z < 10) if (self.velocity_z < 10)
self.velocity_z = self.velocity_z + random()*300; self.velocity_z = self.velocity_z + random()*300;

View file

@ -170,7 +170,7 @@ void() launch_megaplasma =
newmis.movetype = MOVETYPE_FLYMISSILE; newmis.movetype = MOVETYPE_FLYMISSILE;
newmis.solid = SOLID_BBOX; newmis.solid = SOLID_BBOX;
newmis.classname = "megaplasma"; newmis.classname = "megaplasma";
newmis.effects = newmis.effects | EF_BRIGHTFIELD | EF_BRIGHTLIGHT; newmis.effects |= EF_BRIGHTFIELD | EF_BRIGHTLIGHT;
// set speed // set speed
dir = aim ( self, 1000 ); dir = aim ( self, 1000 );
@ -420,7 +420,7 @@ void() MineArm =
self.takedamage = DAMAGE_YES; self.takedamage = DAMAGE_YES;
self.skin = 1; self.skin = 1;
self.classname = "minearmed"; self.classname = "minearmed";
self.effects = self.effects | EF_MUZZLEFLASH; self.effects |= EF_MUZZLEFLASH;
} }
if ((time > self.delay) || (self.spawnmaster.no_obj == TRUE)) if ((time > self.delay) || (self.spawnmaster.no_obj == TRUE))
@ -892,8 +892,8 @@ void() W_SecondTrigger =
// check for rockets // check for rockets
if (self.ammo_rockets < 1) if (self.ammo_rockets < 1)
{ {
self.items = self.items - ( self.items & (IT_SHELLS) ); self.items &= ~(IT_SHELLS) );
self.items = self.items | IT_ROCKETS; self.items |= IT_ROCKETS;
self.currentammo = self.ammo_rockets; self.currentammo = self.ammo_rockets;
self.which_ammo = 1; self.which_ammo = 1;
sound (self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM); sound (self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM);
@ -903,8 +903,8 @@ void() W_SecondTrigger =
if (self.st_pball < time) if (self.st_pball < time)
{ {
self.items = self.items - ( self.items & (IT_SHELLS) ); self.items &= ~(IT_SHELLS) );
self.items = self.items | IT_ROCKETS; self.items |= IT_ROCKETS;
self.currentammo = self.ammo_rockets; self.currentammo = self.ammo_rockets;
self.which_ammo = 1; self.which_ammo = 1;
player_gshot1(); player_gshot1();

View file

@ -429,7 +429,7 @@ local vector org;
stuffcmd (other, "tele_zoom\n"); stuffcmd (other, "tele_zoom\n");
} }
other.flags = other.flags - other.flags & FL_ONGROUND; other.flags &= ~FL_ONGROUND;
}; };
/*QUAKED info_teleport_destination (.5 .5 .5) (-8 -8 -8) (8 8 32) /*QUAKED info_teleport_destination (.5 .5 .5) (-8 -8 -8) (8 8 32)

View file

@ -997,7 +997,7 @@ void() W_SetCurrentAmmo =
if (!self.saw_on) if (!self.saw_on)
player_run (); // get out of any weapon firing states player_run (); // get out of any weapon firing states
self.items = self.items - ( self.items & (IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS) ); self.items &= ~(IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS) );
self.weaponmodel = ""; //Hack for ChaseCam self.weaponmodel = ""; //Hack for ChaseCam
@ -1019,7 +1019,7 @@ void() W_SetCurrentAmmo =
self.weaponframe = 0; self.weaponframe = 0;
self.items = self.items | IT_SHELLS; self.items |= IT_SHELLS;
} }
else if (self.weapon == IT_COMBOGUN) else if (self.weapon == IT_COMBOGUN)
{ {
@ -1033,12 +1033,12 @@ void() W_SetCurrentAmmo =
if (self.which_ammo == 1) if (self.which_ammo == 1)
{ {
self.currentammo = self.ammo_rockets; self.currentammo = self.ammo_rockets;
self.items = self.items | IT_ROCKETS; self.items |= IT_ROCKETS;
} }
else else
{ {
self.currentammo = self.ammo_shells; self.currentammo = self.ammo_shells;
self.items = self.items | IT_SHELLS; self.items |= IT_SHELLS;
} }
} }
else if (self.weapon == IT_PLASMAGUN) else if (self.weapon == IT_PLASMAGUN)
@ -1049,7 +1049,7 @@ void() W_SetCurrentAmmo =
self.weaponmodel = "progs/v_plasma.mdl"; self.weaponmodel = "progs/v_plasma.mdl";
self.weaponframe = 0; self.weaponframe = 0;
self.items = self.items | IT_CELLS; self.items |= IT_CELLS;
} }
else if (self.weapon == IT_SUPER_NAILGUN) else if (self.weapon == IT_SUPER_NAILGUN)
{ {
@ -1059,7 +1059,7 @@ void() W_SetCurrentAmmo =
self.weaponmodel = "progs/v_nailg.mdl"; self.weaponmodel = "progs/v_nailg.mdl";
self.weaponframe = 0; self.weaponframe = 0;
self.items = self.items | IT_NAILS; self.items |= IT_NAILS;
} }
else if (self.weapon == IT_GRENADE_LAUNCHER) else if (self.weapon == IT_GRENADE_LAUNCHER)
{ {
@ -1069,7 +1069,7 @@ void() W_SetCurrentAmmo =
self.weaponmodel = "progs/v_gren.mdl"; self.weaponmodel = "progs/v_gren.mdl";
self.weaponframe = 0; self.weaponframe = 0;
self.items = self.items | IT_ROCKETS; self.items |= IT_ROCKETS;
} }
else if (self.weapon == IT_ROCKET_LAUNCHER) else if (self.weapon == IT_ROCKET_LAUNCHER)
{ {
@ -1079,7 +1079,7 @@ void() W_SetCurrentAmmo =
self.weaponmodel = "progs/v_rhino.mdl"; self.weaponmodel = "progs/v_rhino.mdl";
self.weaponframe = 0; self.weaponframe = 0;
self.items = self.items | IT_ROCKETS; self.items |= IT_ROCKETS;
} }
else else
{ {
@ -1208,8 +1208,8 @@ void() W_Attack =
if (self.ammo_shells < 1) if (self.ammo_shells < 1)
{ {
self.currentammo = self.ammo_shells; self.currentammo = self.ammo_shells;
self.items = self.items - ( self.items & (IT_ROCKETS) ); self.items &= ~(IT_ROCKETS) );
self.items = self.items | IT_SHELLS; self.items |= IT_SHELLS;
self.which_ammo = 0; self.which_ammo = 0;
sound (self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM); sound (self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM);
self.st_sshotgun = time + 0.7; self.st_sshotgun = time + 0.7;
@ -1218,8 +1218,8 @@ void() W_Attack =
else else
{ {
self.currentammo = self.ammo_shells; self.currentammo = self.ammo_shells;
self.items = self.items - ( self.items & (IT_ROCKETS) ); self.items &= ~(IT_ROCKETS) );
self.items = self.items | IT_SHELLS; self.items |= IT_SHELLS;
self.which_ammo = 0; self.which_ammo = 0;
player_shot1 (); player_shot1 ();
W_FireSuperShotgun (); W_FireSuperShotgun ();
@ -1387,14 +1387,9 @@ void() CheatCommand =
self.ammo_nails = 200; self.ammo_nails = 200;
self.ammo_shells = 100; self.ammo_shells = 100;
self.ammo_cells = 200; self.ammo_cells = 200;
self.items = self.items | self.items |= (IT_BONESAW | IT_TSHOT | IT_COMBOGUN | IT_PLASMAGUN
IT_BONESAW | | IT_SUPER_NAILGUN | IT_GRENADE_LAUNCHER
IT_TSHOT | | IT_ROCKET_LAUNCHER);
IT_COMBOGUN |
IT_PLASMAGUN |
IT_SUPER_NAILGUN |
IT_GRENADE_LAUNCHER |
IT_ROCKET_LAUNCHER;
self.weapon = IT_COMBOGUN; self.weapon = IT_COMBOGUN;
self.impulse = 0; self.impulse = 0;
@ -1576,7 +1571,7 @@ void() QuadCheat =
return; return;
self.super_time = 1; self.super_time = 1;
self.super_damage_finished = time + 30; self.super_damage_finished = time + 30;
self.items = self.items | IT_QUAD; self.items |= IT_QUAD;
dprint ("quad cheat\n"); dprint ("quad cheat\n");
}; };

View file

@ -45,7 +45,7 @@ void (string destination) ObserverTeleportTouch =
if (@self.flags & FL_ONGROUND) if (@self.flags & FL_ONGROUND)
@self.flags = @self.flags - FL_ONGROUND; @self.flags = @self.flags - FL_ONGROUND;
@self.velocity = v_forward * 300; @self.velocity = v_forward * 300;
@self.flags = @self.flags - @self.flags & FL_ONGROUND; @self.flags &= ~FL_ONGROUND;
}; };
/*------------------ /*------------------
ObserverImpulses ObserverImpulses

View file

@ -136,7 +136,7 @@ void() launch_megaplasma =
newmis.movetype = MOVETYPE_FLYMISSILE; newmis.movetype = MOVETYPE_FLYMISSILE;
newmis.solid = SOLID_BBOX; newmis.solid = SOLID_BBOX;
newmis.classname = "megaplasma"; newmis.classname = "megaplasma";
newmis.effects = newmis.effects | EF_BLUE; newmis.effects |= EF_BLUE;
// set speed // set speed
dir = aim ( @self, 1000 ); dir = aim ( @self, 1000 );