bit manip cleanup

This commit is contained in:
Bill Currie 2004-02-08 06:18:03 +00:00
parent 0a95abcc29
commit 523094fa2f
26 changed files with 235 additions and 221 deletions

View file

@ -102,7 +102,7 @@ void() bot_grab_weapon =
}
bound_bot_ammo();
self.items = self.items | weap;
self.items |= weap;
self.weapon = weap;
/*TESTING
@ -188,7 +188,7 @@ void() bot_grab_powerup =
sound (self, CHAN_VOICE, self.goalentity.noise, 1, ATTN_NORM);
self.items = self.items | self.goalentity.items;
self.items |= self.goalentity.items;
// do the apropriate action
if (self.goalentity.classname == "item_artifact_envirosuit")

View file

@ -399,7 +399,7 @@ local float bold;
bnew = self.weapon;
bold = self.items;
self.items = self.items | bnew;
self.items |= bnew;
//POX - Packs contain health in FFA mode, so check for it here
if (self.goalentity.healamount)
@ -427,7 +427,7 @@ local float bold;
//POX - Turn off the powerup's 'glow'
if (self.goalentity.classname == "item_artifact_super_damage" || self.goalentity.classname == "item_artifact_invulnerability" || self.goalentity.classname == "item_artifact_invisibility")
self.goalentity.effects = self.goalentity.effects - (self.goalentity.effects & EF_DIMLIGHT);
self.goalentity.effects &= ~EF_DIMLIGHT;
//POX - respawn times vary for powerups
if (self.goalentity.touch == powerup_touch)
@ -645,13 +645,13 @@ local float ofs;
if (ofs == -90)
{
makevectors(self.angles);
self.flags = self.flags - (self.flags & FL_ONGROUND);
self.flags &= ~FL_ONGROUND;
self.velocity = self.velocity + v_right * 300;
}
else
{
makevectors(self.angles);
self.flags = self.flags - (self.flags & FL_ONGROUND);
self.flags &= ~FL_ONGROUND;
self.velocity = self.velocity + v_right * -300;
}
return;
@ -664,13 +664,13 @@ local float ofs;
if (ofs == -90)
{
makevectors(self.angles);
self.flags = self.flags - (self.flags & FL_ONGROUND);
self.flags &= ~FL_ONGROUND;
self.velocity = self.velocity + v_right * 300;
}
else
{
makevectors(self.angles);
self.flags = self.flags - (self.flags & FL_ONGROUND);
self.flags &= ~FL_ONGROUND;
self.velocity = self.velocity + v_right * -300;
}
};
@ -684,7 +684,7 @@ void() bot_ai_back=
bot_run_slide();
else
{
self.flags = self.flags - (self.flags & FL_ONGROUND);
self.flags &= ~FL_ONGROUND;
self.velocity = v_forward*-460;
}
};
@ -699,7 +699,7 @@ void() jump_forward =
if (!(self.flags & FL_ONGROUND))
return;
self.flags = self.flags - (self.flags & FL_ONGROUND);
self.flags &= ~FL_ONGROUND;
makevectors(self.angles);
self.velocity = self.velocity + (v_forward * 220);
@ -750,7 +750,7 @@ void() check_for_water =
sound (self, CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM);
}
self.flags = self.flags - (self.flags & FL_ONGROUND);
self.flags &= ~FL_ONGROUND;
//POX - Give'm an extra boost if in deep
if (self.waterlevel > 2)
@ -1564,37 +1564,37 @@ float() bot_bestweapon =
void() bot_set_currentammo =
// --------------------------------
{
self.items = self.items - ( self.items & (IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS) );
self.items &= ~(IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS);
if (self.weapon == IT_TSHOT)
{
self.currentammo = self.ammo_shells;
self.items = self.items | IT_SHELLS;
self.items |= IT_SHELLS;
}
else if (self.weapon == IT_COMBOGUN)
{
self.currentammo = self.ammo_shells;
self.items = self.items | IT_SHELLS;
self.items |= IT_SHELLS;
}
else if (self.weapon == IT_PLASMAGUN)
{
self.currentammo = self.ammo_cells;
self.items = self.items | IT_CELLS;
self.items |= IT_CELLS;
}
else if (self.weapon == IT_SUPER_NAILGUN)
{
self.currentammo = self.ammo_nails;
self.items = self.items | IT_NAILS;
self.items |= IT_NAILS;
}
else if (self.weapon == IT_GRENADE_LAUNCHER)
{
self.currentammo = self.ammo_rockets;
self.items = self.items | IT_ROCKETS;
self.items |= IT_ROCKETS;
}
else if (self.weapon == IT_ROCKET_LAUNCHER)
{
self.currentammo = self.ammo_rockets;
self.items = self.items | IT_ROCKETS;
self.items |= IT_ROCKETS;
}
else
{
@ -1698,7 +1698,7 @@ void() bot_fire_MPlasma =
newmis.movetype = MOVETYPE_FLY;
newmis.solid = SOLID_BBOX;
newmis.classname = "megaplasma";
newmis.effects = newmis.effects | EF_BRIGHTFIELD | EF_BRIGHTLIGHT;
newmis.effects |= EF_BRIGHTFIELD | EF_BRIGHTLIGHT;
newmis.velocity = bot_aim_at_enemy() * 1200;
newmis.angles = vectoangles(newmis.velocity);
@ -1799,7 +1799,7 @@ local vector dir;
self.currentammo = self.ammo_shells = self.ammo_shells - 2;
bot_face();
sound (self ,CHAN_WEAPON, "weapons/shotgn2.wav", 1, ATTN_NORM);
self.effects = self.effects | EF_MUZZLEFLASH;
self.effects |= EF_MUZZLEFLASH;
dir = bot_aim_at_enemy();
FireBullets (14, dir, '0.14 0.1 0');
@ -1835,7 +1835,7 @@ local vector dir;
bot_face();
sound (self, CHAN_WEAPON, "weapons/tsfire.wav", 1, ATTN_NORM);
self.effects = self.effects | EF_MUZZLEFLASH;
self.effects |= EF_MUZZLEFLASH;
dir = bot_aim_at_enemy();
FireBullets (6, dir, '0.04 0.04 0');
@ -1908,7 +1908,7 @@ void() bot_fire_grenade =
}
self.currentammo = self.ammo_rockets = self.ammo_rockets - 1;
self.effects = self.effects | EF_MUZZLEFLASH;
self.effects |= EF_MUZZLEFLASH;
sound (self, CHAN_WEAPON, "weapons/ssgrnde.wav", 1, ATTN_NORM);
bot_face();
@ -2015,7 +2015,7 @@ void() bot_lightning =
{
local vector org, dir;
self.effects = self.effects | EF_MUZZLEFLASH;
self.effects |= EF_MUZZLEFLASH;
bot_face();
@ -2171,19 +2171,19 @@ void() bot_jump5 =[0, bot_walk1 ] {};
//POX - Added a few things here, SuperDamage sound is checked, and the weapon fire calls support POX weapons
void() bot_rock1 =[ 14, bot_rock2 ] {bot_strafe(); self.effects = self.effects | EF_MUZZLEFLASH;
void() bot_rock1 =[ 14, bot_rock2 ] {bot_strafe(); self.effects |= EF_MUZZLEFLASH;
sound (self, CHAN_WEAPON, "weapons/rhino.wav", 1, ATTN_NORM); bot_fire_rocket(); SuperDamageSound();self.nextthink = time + 0.1;};
void() bot_rock2 =[ 15, bot_rock3 ] {bot_strafe(); bot_fire_rocket();};
void() bot_rock3 =[ 16, bot_rock4 ] {bot_strafe();};
void() bot_rock4 =[ 16, bot_run1 ] {bot_strafe();};
void() bot_gren1 =[ 15, bot_gren2 ] {bot_strafe(); self.effects = self.effects | EF_MUZZLEFLASH; bot_fire_grenade(); SuperDamageSound();};
void() bot_gren1 =[ 15, bot_gren2 ] {bot_strafe(); self.effects |= EF_MUZZLEFLASH; bot_fire_grenade(); SuperDamageSound();};
void() bot_gren2 =[ 16, bot_gren3 ] {bot_strafe();};
void() bot_gren3 =[ 17, bot_gren4 ] {bot_strafe();};
void() bot_gren4 =[ 18, bot_gren5 ] {bot_strafe();};
void() bot_gren5 =[ 19, bot_run1 ] {bot_strafe();};
void() bot_shot1 =[ 15, bot_shot2 ] {bot_strafe(); self.effects = self.effects | EF_MUZZLEFLASH; bot_fire_shotgun(); SuperDamageSound();};
void() bot_shot1 =[ 15, bot_shot2 ] {bot_strafe(); self.effects |= EF_MUZZLEFLASH; bot_fire_shotgun(); SuperDamageSound();};
void() bot_shot2 =[ 16, bot_shot3 ] {bot_strafe();};
void() bot_shot3 =[ 17, bot_shot4 ] {bot_strafe();};
void() bot_shot4 =[ 18, bot_shot5 ] {bot_strafe();};
@ -2191,7 +2191,7 @@ void() bot_shot5 =[ 19, bot_run1 ] {bot_strafe();};
//POX - 102b - Made this simpler, and fixed attack_finished check
void() bot_nail1 =[ 15, bot_nail2 ] {bot_strafe(); bot_fire_nailgun(); self.effects = self.effects | EF_MUZZLEFLASH; SuperDamageSound();};
void() bot_nail1 =[ 15, bot_nail2 ] {bot_strafe(); bot_fire_nailgun(); self.effects |= EF_MUZZLEFLASH; SuperDamageSound();};
void() bot_nail2 =[ 16, bot_run1 ] {bot_strafe();
if (visible(self.enemy) && self.ammo_nails > 0 && self.enemy.health > 0)
bot_attack();
@ -2393,7 +2393,7 @@ local float i;
self.deadflag = DEAD_DYING;
self.solid = SOLID_NOT;
self.flags = self.flags - (self.flags & FL_ONGROUND);
self.flags &= ~FL_ONGROUND;
self.movetype = MOVETYPE_TOSS;
if (self.velocity_z < 10)
self.velocity_z = self.velocity_z + random()*300;

View file

@ -30,7 +30,8 @@ void(entity bot) BotCheckPowerups =
//POX v1.1 - change armour to Yellow
if (bot.armorvalue == 150)
bot.items = bot.items - (bot.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR2;
bot.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3);
bot.items |= IT_ARMOR2;
}
@ -124,9 +125,9 @@ void(entity bot) BotCheckPowerups =
if (!(deathmatch & DM_DARK))
{
if (bot.invincible_finished > time)
bot.effects = bot.effects | EF_DIMLIGHT;
bot.effects |= EF_DIMLIGHT;
else
bot.effects = bot.effects - (bot.effects & EF_DIMLIGHT);
bot.effects &= ~EF_DIMLIGHT;
}
}
@ -167,9 +168,9 @@ void(entity bot) BotCheckPowerups =
if (!(deathmatch & DM_DARK))
{
if (bot.super_damage_finished > time)
bot.effects = bot.effects | EF_DIMLIGHT;
bot.effects |= EF_DIMLIGHT;
else
bot.effects = bot.effects - (bot.effects & EF_DIMLIGHT);
bot.effects &= ~EF_DIMLIGHT;
}
}

View file

@ -123,7 +123,7 @@ local entity spot;
spawn_tdeath (self.origin, self);
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP;
self.flags = self.flags - (self.flags & FL_ONGROUND);
self.flags &= ~FL_ONGROUND;
makevectors(self.angles);
self.velocity = self.velocity + v_forward*20;
@ -197,7 +197,8 @@ local entity spot;
self.search_time = 0;
// 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);
self.items |= IT_ARMOR1;
self.armorvalue = 50;
self.armortype = 0.9;
@ -311,7 +312,7 @@ if (botcounter == 8)
bot.th_missile = bot_attack;
// arming and naming him
bot.items = bot.items | IT_TSHOT;
bot.items |= IT_TSHOT;
bot.currentammo = bot.ammo_shells = bot.ammo_shells + 25;
bot.weapon = IT_TSHOT;
bot.health = 100;
@ -327,7 +328,8 @@ if (botcounter == 8)
bot.invincible_time = 0;
// 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);
self.items |= IT_ARMOR1;
self.armorvalue = 50;
self.armortype = 0.9;

View file

@ -476,8 +476,8 @@ void() PutClientInServer =
local entity spot;
//POX v1.2 - remove items
self.items = self.items - (self.items &
(IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD) );
self.items &= ~(IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY
| IT_SUIT | IT_QUAD);
//spot = SelectSpawnPoint ();
@ -508,7 +508,8 @@ void() PutClientInServer =
self.weapon = IT_TSHOT;
// 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);
self.items |= IT_ARMOR1;
self.armorvalue = 50;
self.armortype = 0.9;
@ -556,7 +557,7 @@ void() PutClientInServer =
sound (self, CHAN_AUTO, "items/inv1.wav", 1, ATTN_NORM);
stuffcmd (self, "bf\n");
self.items = self.items | IT_INVISIBILITY;
self.items |= IT_INVISIBILITY;
self.invisible_time = 1;
self.invisible_finished = time + 9999999999;
}
@ -644,17 +645,18 @@ void() PutClientInServer =
self.ammo_shells = 200;
self.ammo_rockets = 100;
self.ammo_cells = 200;
self.items = self.items | IT_PLASMAGUN;
self.items = self.items | IT_SUPER_NAILGUN;
self.items = self.items | IT_COMBOGUN;
self.items = self.items | IT_ROCKET_LAUNCHER;
self.items = self.items | IT_GRENADE_LAUNCHER;
self.items |= IT_PLASMAGUN;
self.items |= IT_SUPER_NAILGUN;
self.items |= IT_COMBOGUN;
self.items |= IT_ROCKET_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);
self.items |= IT_ARMOR3;
self.armorvalue = 250;
self.armortype = 0.9;
self.health = 200;
self.items = self.items | IT_INVULNERABILITY;
self.items |= IT_INVULNERABILITY;
self.invincible_time = 1;
self.invincible_finished = time + 3;
@ -662,7 +664,7 @@ void() PutClientInServer =
self.currentammo = self.ammo_rockets;
self.weaponmodel = "progs/v_rhino.mdl";
self.weaponframe = 0;
self.items = self.items | IT_ROCKETS;
self.items |= IT_ROCKETS;
self.max_health = 200;
sound (self, CHAN_AUTO, "items/protect.wav", 1, ATTN_NORM);
@ -754,17 +756,17 @@ void() NextLevel =
else if (!(serverflags & 1))
{
mapname = "e1m1";
serverflags = serverflags | 1;
serverflags |= 1;
}
else if (!(serverflags & 2))
{
mapname = "e2m1";
serverflags = serverflags | 2;
serverflags |= 2;
}
else if (!(serverflags & 4))
{
mapname = "e3m1";
serverflags = serverflags | 4;
serverflags |= 4;
}
else if (!(serverflags & 8))
{
@ -898,7 +900,7 @@ void() PlayerJump =
if ( !(self.flags & FL_JUMPRELEASED) )
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
@ -1075,9 +1077,9 @@ void() CheckWaterJump =
traceline (start, end, TRUE, self);
if (trace_fraction == 1)
{ // open at eye level
self.flags = self.flags | FL_WATERJUMP;
self.flags |= FL_WATERJUMP;
self.velocity_z = 225;
self.flags = self.flags - (self.flags & FL_JUMPRELEASED);
self.flags &= ~FL_JUMPRELEASED;
self.teleport_time = time + 2; // safety net
return;
}
@ -1132,7 +1134,7 @@ void() PlayerPreThink =
PlayerJump ();
}
else
self.flags = self.flags | FL_JUMPRELEASED;
self.flags |= FL_JUMPRELEASED;
// teleporters can force a non-moving pause time
if (time < self.pausetime)
@ -1172,8 +1174,10 @@ void() CheckPowerups =
self.armor_rot = time + 1;
//POX v1.1 - change armour to Yellow
if (self.armorvalue == 150)
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR2;
if (self.armorvalue == 150) {
self.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3);
self.items |= IT_ARMOR2;
}
}
// invisibility
@ -1252,9 +1256,9 @@ void() CheckPowerups =
if (!(deathmatch & DM_DARK))
{
if (self.invincible_finished > time)
self.effects = self.effects | EF_DIMLIGHT;
self.effects |= EF_DIMLIGHT;
else
self.effects = self.effects - (self.effects & EF_DIMLIGHT);
self.effects &= ~EF_DIMLIGHT;
}
}
@ -1292,9 +1296,9 @@ void() CheckPowerups =
if (!(deathmatch & DM_DARK))
{
if (self.super_damage_finished > time)
self.effects = self.effects | EF_DIMLIGHT;
self.effects |= EF_DIMLIGHT;
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;
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;
@ -147,19 +147,22 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage=
if (targ.armorvalue > 150)
{
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);
targ.items |= IT_ARMOR3;
}
else if (targ.armorvalue > 50)
{
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);
targ.items |= IT_ARMOR2;
}
else if (targ.armorvalue > 1)
{
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);
targ.items |= IT_ARMOR1;
}
take = ceil(damage-save);

View file

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

View file

@ -842,7 +842,7 @@ void() func_rotate_train =
self.dest1 = self.origin; // original position
self.flags = self.flags | FL_ONGROUND;
self.flags |= FL_ONGROUND;
};
//************************************************

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")
self.effects = self.effects | EF_DIMLIGHT;
self.effects |= EF_DIMLIGHT;
};
@ -198,7 +198,7 @@ void() health_touch =
// Megahealth = rot down the player's super health
if (self.healtype == 2)
{
other.items = other.items | IT_SUPERHEALTH;
other.items |= IT_SUPERHEALTH;
self.nextthink = time + 5;
self.think = item_megahealth_rot;
self.owner = other;
@ -230,7 +230,7 @@ void() item_megahealth_rot =
// it is possible for a player to die and respawn between rots, so don't
// 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
{
@ -390,7 +390,7 @@ void() weapon_touch =
// change to the weapon
old = other.items;
other.items = other.items | new;
other.items |= new;
stemp = self;
self = other;
@ -855,7 +855,7 @@ void() key_touch =
sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM);
stuffcmd (other, "bf\n");
other.items = other.items | self.items;
other.items |= self.items;
if (!coop)
{
@ -987,7 +987,7 @@ void() sigil_touch =
stuffcmd (other, "bf\n");
self.solid = SOLID_NOT;
self.model = string_null;
serverflags = serverflags | (self.spawnflags & 15);
serverflags |= (self.spawnflags & 15);
self.classname = ""; // so rune doors won't find it
activator = other;
@ -1071,12 +1071,12 @@ void() powerup_touch =
sound (other, CHAN_VOICE, self.noise, 1, ATTN_NORM);
stuffcmd (other, "bf\n");
self.solid = SOLID_NOT;
other.items = other.items | self.items;
other.items |= self.items;
self.model = string_null;
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.model = string_null;
@ -1093,7 +1093,7 @@ void() powerup_touch =
if (self.classname == "item_artifact_invulnerability")
{
self.effects = self.effects - (self.effects & EF_DIMLIGHT);
self.effects &= ~EF_DIMLIGHT;
other.invincible_time = 1;
other.invincible_finished = time + 30;
}
@ -1102,7 +1102,7 @@ void() powerup_touch =
{
other.invisible_time = 1;
other.invisible_finished = time + 30;
self.effects = self.effects - (self.effects & EF_DIMLIGHT);
self.effects &= ~EF_DIMLIGHT;
}
@ -1129,7 +1129,7 @@ void() item_artifact_invulnerability =
self.netname = "MegaShields";
self.items = IT_INVULNERABILITY;
self.effects = self.effects | EF_DIMLIGHT;
self.effects |= EF_DIMLIGHT;
setsize (self, '-16 -16 -24', '16 16 32');
StartItem ();
@ -1176,7 +1176,7 @@ void() item_artifact_invisibility =
self.netname = "Cloaking Device";
self.items = IT_INVISIBILITY;
self.effects = self.effects | EF_DIMLIGHT;
self.effects |= EF_DIMLIGHT;
setsize (self, '-16 -16 -24', '16 16 32');
StartItem ();
@ -1229,7 +1229,7 @@ void() item_artifact_super_damage =
self.items = IT_QUAD;
setsize (self, '-16 -16 -24', '16 16 32');
self.effects = self.effects | EF_DIMLIGHT;
self.effects |= EF_DIMLIGHT;
Spawn_QuadCore ();
@ -1286,7 +1286,7 @@ void() BackpackTouch =
if (!new)
new = other.weapon;
old = other.items;
other.items = other.items | new;
other.items |= new;
bound_other_ammo ();

View file

@ -818,7 +818,7 @@ void() CamUpdValues =
if ((self.enemy != self) && (self.enemy.classname != "bodyque") && (self.enemy.health > 0)) {
// Mask out items which change view color
it = IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD;
self.items = (self.enemy.items | it) - it;
self.items &= ~it;
self.health = self.enemy.health;
self.armorvalue = self.enemy.armorvalue;
self.ammo_shells = self.enemy.ammo_shells;

View file

@ -178,7 +178,7 @@ void() player_run =[0, player_run ]
/*
//used for PulseGun fire
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_pulse3 = [$shotatt3, player_pulse4 ] {self.weaponframe=3;};
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
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_shot3 = [17, player_shot4 ] {self.weaponframe=3;};
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
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_tshot3 = [17, player_tshot4 ] {self.weaponframe=3;};
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)
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_gshot3 = [17, player_gshot4 ] {self.weaponframe=4;};
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)
void() player_shrap1 = [15, player_shrap2 ] {
self.effects = self.effects | EF_MUZZLEFLASH;};
self.effects |= EF_MUZZLEFLASH;};
void() player_shrap2 = [16, player_run ] {};
// End Nailgun Second Trigger Macro
@ -345,7 +345,7 @@ void() player_nail1 =[15, player_nail2 ]
}
else
{
self.effects = self.effects | EF_MUZZLEFLASH;
self.effects |= EF_MUZZLEFLASH;
if (!self.button0)
{player_run ();return;}
@ -375,7 +375,7 @@ void() player_nail2 =[16, player_nail1 ]
else
{
self.effects = self.effects | EF_MUZZLEFLASH;
self.effects |= EF_MUZZLEFLASH;
if (!self.button0)
{player_run ();return;}
@ -410,7 +410,7 @@ void() player_plasma1 =[15, player_plasma2 ]
}
else
{
self.effects = self.effects | EF_MUZZLEFLASH;
self.effects |= EF_MUZZLEFLASH;
if (!self.button0)
{player_run ();return;}
@ -447,7 +447,7 @@ void() player_plasma2 =[16, player_plasma1 ]
else
{
self.effects = self.effects | EF_MUZZLEFLASH;
self.effects |= EF_MUZZLEFLASH;
if (!self.button0)
{player_run ();return;}
@ -471,7 +471,7 @@ void() player_plasma2 =[16, player_plasma1 ]
//Had to seperate Grenade Macro from Anihilator
//to make room for new rhino animations
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_grenade3 =[17, player_grenade4 ] {self.weaponframe=3;};
void() player_grenade4 =[18, player_grenade5 ] {self.weaponframe=4;};
@ -493,7 +493,7 @@ sound (self, CHAN_WEAPON, "weapons/rhino.wav", 1, ATTN_NORM);
self.velocity = v_forward* -25;
self.punchangle_x = -3;
self.effects = self.effects | EF_MUZZLEFLASH;};
self.effects |= EF_MUZZLEFLASH;};
void() player_rocket2 =[15, player_rocket3 ] {self.weaponframe=2;
W_FireRocket('0 0 24');};
void() player_rocket3 =[16, player_run ] {self.weaponframe=3;};
@ -812,7 +812,7 @@ void(string gibname, float dm) ThrowHead =
setsize (self, '-16 -16 0', '16 16 56');
self.velocity = VelocityForDamage (dm);
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';
};
@ -914,7 +914,7 @@ void() PlayerDie =
{
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.invincible_finished = 0;
self.super_damage_finished = 0;
@ -936,7 +936,7 @@ void() PlayerDie =
self.view_ofs = '0 0 -8';
self.deadflag = DEAD_DYING;
self.solid = SOLID_NOT;
self.flags = self.flags - (self.flags & FL_ONGROUND);
self.flags &= ~FL_ONGROUND;
self.movetype = MOVETYPE_TOSS;
if (self.velocity_z < 10)
self.velocity_z = self.velocity_z + random()*300;

View file

@ -155,7 +155,7 @@ marks the client's bit flag as being in use
void( float clientno ) clientSetUsed =
{
fActiveClients = fActiveClients | clientBitFlag( clientno );
fActiveClients |= clientBitFlag( clientno );
};
/*

View file

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

View file

@ -116,7 +116,8 @@ local string snd;
//set armour type
other.armortype = type;
other.items = other.items - (other.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + bit;
other.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3);
other.items |= bit;
sound (other, CHAN_AUTO, snd, 1, ATTN_NORM);
//POX - 1.01b - Don't allow armour to rot while recharging

View file

@ -427,7 +427,7 @@ local vector org;
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)
@ -593,7 +593,7 @@ void() trigger_push_touch =
else if (other.health > 0)
{
if (other.classname == "bot")
other.flags = other.flags - (other.flags & FL_ONGROUND);
other.flags &= ~FL_ONGROUND;
other.velocity = self.speed * self.movedir * 10;
@ -648,7 +648,7 @@ void() trigger_bounce_touch =
if ((other.classname == "player" || other.classname == "bot") && (other.health > 0))
{
if (other.classname == "bot")
other.flags = other.flags - (other.flags & FL_ONGROUND);
other.flags &= ~FL_ONGROUND;
other.velocity = self.angles;
other.bounce_time = time + 0.8;

View file

@ -1017,7 +1017,7 @@ void() W_SetCurrentAmmo =
if (!self.saw_on)
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
@ -1039,7 +1039,7 @@ void() W_SetCurrentAmmo =
self.weaponframe = 0;
self.items = self.items | IT_SHELLS;
self.items |= IT_SHELLS;
}
else if (self.weapon == IT_COMBOGUN)
{
@ -1053,12 +1053,12 @@ void() W_SetCurrentAmmo =
if (self.which_ammo == 1)
{
self.currentammo = self.ammo_rockets;
self.items = self.items | IT_ROCKETS;
self.items |= IT_ROCKETS;
}
else
{
self.currentammo = self.ammo_shells;
self.items = self.items | IT_SHELLS;
self.items |= IT_SHELLS;
}
}
else if (self.weapon == IT_PLASMAGUN)
@ -1069,7 +1069,7 @@ void() W_SetCurrentAmmo =
self.weaponmodel = "progs/v_plasma.mdl";
self.weaponframe = 0;
self.items = self.items | IT_CELLS;
self.items |= IT_CELLS;
}
else if (self.weapon == IT_SUPER_NAILGUN)
{
@ -1079,7 +1079,7 @@ void() W_SetCurrentAmmo =
self.weaponmodel = "progs/v_nailg.mdl";
self.weaponframe = 0;
self.items = self.items | IT_NAILS;
self.items |= IT_NAILS;
}
else if (self.weapon == IT_GRENADE_LAUNCHER)
{
@ -1089,7 +1089,7 @@ void() W_SetCurrentAmmo =
self.weaponmodel = "progs/v_gren.mdl";
self.weaponframe = 0;
self.items = self.items | IT_ROCKETS;
self.items |= IT_ROCKETS;
}
else if (self.weapon == IT_ROCKET_LAUNCHER)
{
@ -1099,7 +1099,7 @@ void() W_SetCurrentAmmo =
self.weaponmodel = "progs/v_rhino.mdl";
self.weaponframe = 0;
self.items = self.items | IT_ROCKETS;
self.items |= IT_ROCKETS;
}
else
{
@ -1234,8 +1234,8 @@ void() W_Attack =
if (self.ammo_shells < 1)
{
self.currentammo = self.ammo_shells;
self.items = self.items - ( self.items & (IT_ROCKETS) );
self.items = self.items | IT_SHELLS;
self.items &= ~(IT_ROCKETS);
self.items |= IT_SHELLS;
self.which_ammo = 0;
sound (self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM);
self.st_sshotgun = time + 0.7;
@ -1244,8 +1244,8 @@ void() W_Attack =
else
{
self.currentammo = self.ammo_shells;
self.items = self.items - ( self.items & (IT_ROCKETS) );
self.items = self.items | IT_SHELLS;
self.items &= ~(IT_ROCKETS);
self.items |= IT_SHELLS;
self.which_ammo = 0;
player_shot1 ();
W_FireSuperShotgun ();
@ -1409,14 +1409,9 @@ void() CheatCommand =
self.ammo_nails = 200;
self.ammo_shells = 100;
self.ammo_cells = 200;
self.items = self.items |
IT_BONESAW |
IT_TSHOT |
IT_COMBOGUN |
IT_PLASMAGUN |
IT_SUPER_NAILGUN |
IT_GRENADE_LAUNCHER |
IT_ROCKET_LAUNCHER;
self.items |= (IT_BONESAW | IT_TSHOT | IT_COMBOGUN | IT_PLASMAGUN
| IT_SUPER_NAILGUN | IT_GRENADE_LAUNCHER
| IT_ROCKET_LAUNCHER);
self.weapon = IT_COMBOGUN;
self.impulse = 0;
@ -1598,7 +1593,7 @@ void() QuadCheat =
return;
self.super_time = 1;
self.super_damage_finished = time + 30;
self.items = self.items | IT_QUAD;
self.items |= IT_QUAD;
dprint ("quad cheat\n");
};

View file

@ -397,8 +397,8 @@ void() PutClientInServer =
local entity spot;
//POX v1.2 - remove items
self.items = self.items - (self.items &
(IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD) );
self.items &= ~(IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY
| IT_SUIT | IT_QUAD);
if (deathmatch & DM_LMS && self.LMS_observer)
{
@ -432,7 +432,8 @@ void() PutClientInServer =
self.weapon = IT_TSHOT;
// + 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);
self.items |= IT_ARMOR1;
self.armorvalue = 50;
self.armortype = 0.9;
// - POX
@ -504,17 +505,18 @@ void() PutClientInServer =
self.ammo_shells = 200;
self.ammo_rockets = 100;
self.ammo_cells = 200;
self.items = self.items | IT_PLASMAGUN;
self.items = self.items | IT_SUPER_NAILGUN;
self.items = self.items | IT_COMBOGUN;
self.items = self.items | IT_ROCKET_LAUNCHER;
self.items = self.items | IT_GRENADE_LAUNCHER;
self.items |= IT_PLASMAGUN;
self.items |= IT_SUPER_NAILGUN;
self.items |= IT_COMBOGUN;
self.items |= IT_ROCKET_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);
self.items |= IT_ARMOR3;
self.armorvalue = 250;
self.armortype = 0.9;
self.health = 200;
self.items = self.items | IT_INVULNERABILITY;
self.items |= IT_INVULNERABILITY;
self.invincible_time = 1;
self.invincible_finished = time + 3;
@ -522,7 +524,7 @@ void() PutClientInServer =
self.currentammo = self.ammo_rockets;
self.weaponmodel = "progs/v_rhino.mdl";
self.weaponframe = 0;
self.items = self.items | IT_ROCKETS;
self.items |= IT_ROCKETS;
self.max_health = 200;
sound (self, CHAN_AUTO, "items/protect.wav", 1, ATTN_NORM);
@ -536,7 +538,7 @@ void() PutClientInServer =
sound (self, CHAN_AUTO, "items/inv1.wav", 1, ATTN_NORM);
stuffcmd (self, "bf\n");
self.items = self.items | IT_INVISIBILITY;
self.items |= IT_INVISIBILITY;
self.invisible_time = 1;
self.invisible_finished = time + 9999999999;
}
@ -550,18 +552,18 @@ void() PutClientInServer =
self.ammo_shells = 255;
self.ammo_rockets = 255;
self.ammo_cells = 255;
self.items = self.items | IT_PLASMAGUN;
self.items = self.items | IT_SUPER_NAILGUN;
self.items = self.items | IT_COMBOGUN;
self.items = self.items | IT_ROCKET_LAUNCHER;
// self.items = self.items | IT_GRENADE_LAUNCHER;
//self.items = self.items | IT_LIGHTNING;
self.items |= IT_PLASMAGUN;
self.items |= IT_SUPER_NAILGUN;
self.items |= IT_COMBOGUN;
self.items |= IT_ROCKET_LAUNCHER;
// self.items |= IT_GRENADE_LAUNCHER;
//self.items |= IT_LIGHTNING;
}
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 = 200;
self.armortype = 0.8;
self.health = 250;
self.items = self.items | IT_INVULNERABILITY;
self.items |= IT_INVULNERABILITY;
self.invincible_time = 1;
self.invincible_finished = time + 3;
}
@ -571,17 +573,17 @@ void() PutClientInServer =
self.ammo_shells = 30;
self.ammo_rockets = 10;
self.ammo_cells = 30;
self.items = self.items | IT_PLASMAGUN;
self.items = self.items | IT_SUPER_NAILGUN;
self.items = self.items | IT_COMBOGUN;
self.items = self.items | IT_ROCKET_LAUNCHER;
self.items = self.items | IT_GRENADE_LAUNCHER;
//self.items = self.items | IT_LIGHTNING;
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR3;
self.items |= IT_PLASMAGUN;
self.items |= IT_SUPER_NAILGUN;
self.items |= IT_COMBOGUN;
self.items |= IT_ROCKET_LAUNCHER;
self.items |= IT_GRENADE_LAUNCHER;
//self.items |= IT_LIGHTNING;
self.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR3;
self.armorvalue = 200;
self.armortype = 0.8;
self.health = 200;
self.items = self.items | IT_INVULNERABILITY;
self.items |= IT_INVULNERABILITY;
self.invincible_time = 1;
self.invincible_finished = time + 3;
}
@ -644,17 +646,17 @@ void() NextLevel =
else if (!(serverflags & 1))
{
mapname = "e1m1";
serverflags = serverflags | 1;
serverflags |= 1;
}
else if (!(serverflags & 2))
{
mapname = "e2m1";
serverflags = serverflags | 2;
serverflags |= 2;
}
else if (!(serverflags & 4))
{
mapname = "e3m1";
serverflags = serverflags | 4;
serverflags |= 4;
}
else if (!(serverflags & 8))
{
@ -783,7 +785,7 @@ void() PlayerJump =
return;
if ( !(self.flags & FL_JUMPRELEASED) )
return; // don't pogo stick
self.flags = self.flags - (self.flags & FL_JUMPRELEASED);
self.flags &= ~FL_JUMPRELEASED;
self.button2 = 0;
// player jumping sound
sound (self, CHAN_VOICE, "player/plyrjmp8.wav", 1, ATTN_NORM);
@ -940,9 +942,9 @@ void() CheckWaterJump =
traceline (start, end, TRUE, self);
if (trace_fraction == 1)
{ // open at eye level
self.flags = self.flags | FL_WATERJUMP;
self.flags |= FL_WATERJUMP;
self.velocity_z = 225;
self.flags = self.flags - (self.flags & FL_JUMPRELEASED);
self.flags &= ~FL_JUMPRELEASED;
self.teleport_time = time + 2; // safety net
return;
}
@ -998,7 +1000,7 @@ void() PlayerPreThink =
PlayerJump ();
}
else
self.flags = self.flags | FL_JUMPRELEASED;
self.flags |= FL_JUMPRELEASED;
// teleporters can force a non-moving pause time
if (time < self.pausetime)
self.velocity = '0 0 0';
@ -1032,8 +1034,10 @@ void() CheckPowerups =
self.armor_rot = time + 1;
//change armour to Yellow
if (self.armorvalue == 150)
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR2;
if (self.armorvalue == 150) {
self.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3);
self.items |= IT_ARMOR2;
}
}
// - POX
// invisibility
@ -1104,13 +1108,13 @@ void() CheckPowerups =
// + POX - ignore light effects in Dark Mode
if (self.invincible_finished > time && !(deathmatch & DM_DARK))
{
self.effects = self.effects | EF_DIMLIGHT;
self.effects = self.effects | EF_RED;
self.effects |= EF_DIMLIGHT;
self.effects |= EF_RED;
}
else
{
self.effects = self.effects - (self.effects & EF_DIMLIGHT);
self.effects = self.effects - (self.effects & EF_RED);
self.effects &= ~EF_DIMLIGHT;
self.effects &= ~EF_RED;
}
}
// super damage
@ -1152,13 +1156,13 @@ void() CheckPowerups =
// + POX - ignore light effects in Dark Mode
if (self.super_damage_finished > time && !(deathmatch & DM_DARK))
{
self.effects = self.effects | EF_DIMLIGHT;
self.effects = self.effects | EF_BLUE;
self.effects |= EF_DIMLIGHT;
self.effects |= EF_BLUE;
}
else
{
self.effects = self.effects - (self.effects & EF_DIMLIGHT);
self.effects = self.effects - (self.effects & EF_BLUE);
self.effects &= ~EF_DIMLIGHT;
self.effects &= ~EF_BLUE;
}
}
// suit
@ -1235,7 +1239,8 @@ local string snd;
//set armour type
self.armortype = type;
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + bit;
self.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3);
self.items |= bit;
sound (self, CHAN_AUTO, snd, 1, ATTN_NORM);
//POX - 1.01b - Don't allow armour to rot while recharging

View file

@ -125,7 +125,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage=
{
save = targ.armorvalue;
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;
@ -133,19 +133,22 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage=
if (targ.armorvalue > 150)
{
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);
targ.items |= IT_ARMOR3;
}
else if (targ.armorvalue > 50)
{
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);
targ.items |= IT_ARMOR2;
}
else if (targ.armorvalue > 1)
{
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);
targ.items |= IT_ARMOR1;
}
take = ceil(damage-save);

View file

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

View file

@ -719,7 +719,7 @@ void() func_rotate_train =
self.cnt = 0.1; // start time
self.dest2 = '0 0 0'; // delta
self.dest1 = self.origin; // original position
self.flags = self.flags | FL_ONGROUND;
self.flags |= FL_ONGROUND;
};
//************************************************
//

View file

@ -42,7 +42,7 @@ local string s;
sound (other, CHAN_VOICE, self.noise, 1, ATTN_NORM);
stuffcmd (other, "bf\n");
self.solid = SOLID_NOT;
other.items = other.items | IT_QUAD;
other.items |= IT_QUAD;
self.model = string_null;
//if (deathmatch == 4)
//{
@ -99,7 +99,7 @@ local string s;
sound (other, CHAN_VOICE, self.noise, 1, ATTN_NORM);
stuffcmd (other, "bf\n");
self.solid = SOLID_NOT;
other.items = other.items | IT_INVISIBILITY;
other.items |= IT_INVISIBILITY;
self.model = string_null;
// do the apropriate action
other.invisible_time = 1;
@ -284,7 +284,7 @@ void() health_touch =
// Megahealth = rot down the player's super health
if (self.healtype == 2)
{
other.items = other.items | IT_SUPERHEALTH;
other.items |= IT_SUPERHEALTH;
//if (deathmatch != 4)
//{
self.nextthink = time + 5;
@ -316,7 +316,7 @@ void() item_megahealth_rot =
}
// it is possible for a player to die and respawn between rots, so don't
// 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
//{
@ -473,7 +473,7 @@ void() weapon_touch =
bound_other_ammo ();
// change to the weapon
old = other.items;
other.items = other.items | new;
other.items |= new;
stemp = self;
self = other;
@ -929,7 +929,7 @@ void() key_touch =
sprint (other,PRINT_LOW, "\n");
sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM);
stuffcmd (other, "bf\n");
other.items = other.items | self.items;
other.items |= self.items;
self.solid = SOLID_NOT;
self.model = string_null;
activator = other;
@ -1044,7 +1044,7 @@ void() sigil_touch =
stuffcmd (other, "bf\n");
self.solid = SOLID_NOT;
self.model = string_null;
serverflags = serverflags | (self.spawnflags & 15);
serverflags &= ~15;
self.classname = ""; // so rune doors won't find it
activator = other;
@ -1111,7 +1111,7 @@ void() powerup_touch =
sound (other, CHAN_VOICE, self.noise, 1, ATTN_NORM);
stuffcmd (other, "bf\n");
self.solid = SOLID_NOT;
other.items = other.items | self.items;
other.items |= self.items;
self.model = string_null;
// do the apropriate action
if (self.classname == "item_artifact_envirosuit")
@ -1156,7 +1156,7 @@ void() item_artifact_invulnerability =
self.noise = "items/protect.wav";
setmodel (self, "progs/poxmegs.mdl");
self.netname = "MegaShields";
self.effects = self.effects | EF_RED;
self.effects |= EF_RED;
self.items = IT_INVULNERABILITY;
setsize (self, '-16 -16 -24', '16 16 32');
StartItem ();
@ -1237,7 +1237,7 @@ void() item_artifact_super_damage =
setmodel (self, "progs/poxquad.mdl");
self.netname = "Quad Damage";
self.items = IT_QUAD;
self.effects = self.effects | EF_BLUE;
self.effects |= EF_BLUE;
setsize (self, '-16 -16 -24', '16 16 32');
Spawn_QuadCore (self);
@ -1289,11 +1289,11 @@ void() BackpackTouch =
{
other.invincible_time = 1;
other.invincible_finished = time + 30;
other.items = other.items | IT_INVULNERABILITY;
other.items |= IT_INVULNERABILITY;
other.super_time = 1;
other.super_damage_finished = time + 30;
other.items = other.items | IT_QUAD;
other.items |= IT_QUAD;
other.ammo_cells = 0;
@ -1329,7 +1329,7 @@ void() BackpackTouch =
if (!new)
new = other.weapon;
old = other.items;
other.items = other.items | self.items;
other.items |= self.items;
bound_other_ammo ();
if (self.ammo_shells)

View file

@ -43,7 +43,7 @@ local entity t;
if (self.flags & FL_ONGROUND)
self.flags = self.flags - FL_ONGROUND;
self.velocity = v_forward * 300;
self.flags = self.flags - self.flags & FL_ONGROUND;
self.flags &= ~FL_ONGROUND;
};
/*------------------
ObserverImpulses

View file

@ -598,7 +598,7 @@ void(string gibname, float dm) ThrowHead =
setsize (self, '-16 -16 0', '16 16 56');
self.velocity = VelocityForDamage (dm);
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';
};
void() GibPlayer =
@ -634,7 +634,7 @@ void() PlayerDie =
local float i;
local string s;
self.items = self.items - (self.items & IT_INVISIBILITY);
self.items &= ~IT_INVISIBILITY;
if ((stof(infokey(world,"dq"))) != 0)
{
if (self.super_damage_finished > 0)
@ -680,7 +680,7 @@ void() PlayerDie =
self.view_ofs = '0 0 -8';
self.deadflag = DEAD_DYING;
self.solid = SOLID_NOT;
self.flags = self.flags - (self.flags & FL_ONGROUND);
self.flags &= ~FL_ONGROUND;
self.movetype = MOVETYPE_TOSS;
if (self.velocity_z < 10)
self.velocity_z = self.velocity_z + random()*300;

View file

@ -128,7 +128,7 @@ void() launch_megaplasma =
newmis.movetype = MOVETYPE_FLYMISSILE;
newmis.solid = SOLID_BBOX;
newmis.classname = "megaplasma";
newmis.effects = newmis.effects | EF_BLUE;
newmis.effects |= EF_BLUE;
// set speed
dir = aim ( self, 1000 );
@ -788,15 +788,15 @@ void() W_SecondTrigger =
if (self.weapon == IT_COMBOGUN) {
if (self.ammo_rockets < 1) { // check for rockets
self.items = self.items - ( self.items & (IT_SHELLS) );
self.items = self.items | IT_ROCKETS;
self.items &= ~IT_SHELLS;
self.items |= IT_ROCKETS;
self.currentammo = self.ammo_rockets;
self.which_ammo = 1;
sound (self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM);
} else {
if (self.st_pball < time) {
self.items = self.items - ( self.items & (IT_SHELLS) );
self.items = self.items | IT_ROCKETS;
self.items &= ~IT_SHELLS;
self.items |= IT_ROCKETS;
self.currentammo = self.ammo_rockets;
self.which_ammo = 1;
player_gshot1();

View file

@ -373,7 +373,7 @@ local vector org;
stuffcmd (other, "fov 40;wait;fov 55;wait;fov 70;wait;fov 90;\n");
// - POX
}
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)
This is the destination marker for a teleporter. It should have a "targetname" field with the same value as a teleporter's "target" field.

View file

@ -906,7 +906,7 @@ void() W_SetCurrentAmmo =
{
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);
if (self.weapon == IT_AXE)
{
@ -919,7 +919,7 @@ void() W_SetCurrentAmmo =
self.currentammo = self.ammo_shells;
self.weaponmodel = "progs/v_tshot.mdl";
self.weaponframe = 0;
self.items = self.items | IT_SHELLS;
self.items |= IT_SHELLS;
}
else if (self.weapon == IT_COMBOGUN)
{
@ -930,12 +930,12 @@ void() W_SetCurrentAmmo =
if (self.which_ammo == 1)
{
self.currentammo = self.ammo_rockets;
self.items = self.items | IT_ROCKETS;
self.items |= IT_ROCKETS;
}
else
{
self.currentammo = self.ammo_shells;
self.items = self.items | IT_SHELLS;
self.items |= IT_SHELLS;
}
}
else if (self.weapon == IT_PLASMAGUN)
@ -943,28 +943,28 @@ void() W_SetCurrentAmmo =
self.currentammo = self.ammo_cells;
self.weaponmodel = "progs/v_plasma.mdl";
self.weaponframe = 0;
self.items = self.items | IT_CELLS;
self.items |= IT_CELLS;
}
else if (self.weapon == IT_SUPER_NAILGUN)
{
self.currentammo = self.ammo_nails;
self.weaponmodel = "progs/v_nailg.mdl";
self.weaponframe = 0;
self.items = self.items | IT_NAILS;
self.items |= IT_NAILS;
}
else if (self.weapon == IT_GRENADE_LAUNCHER)
{
self.currentammo = self.ammo_rockets;
self.weaponmodel = "progs/v_gren.mdl";
self.weaponframe = 0;
self.items = self.items | IT_ROCKETS;
self.items |= IT_ROCKETS;
}
else if (self.weapon == IT_ROCKET_LAUNCHER)
{
self.currentammo = self.ammo_rockets;
self.weaponmodel = "progs/v_rhino.mdl";
self.weaponframe = 0;
self.items = self.items | IT_ROCKETS;
self.items |= IT_ROCKETS;
}
else
{
@ -1087,8 +1087,8 @@ void() W_Attack =
if (self.ammo_shells < 1)
{
self.currentammo = self.ammo_shells;
self.items = self.items - ( self.items & (IT_ROCKETS) );
self.items = self.items | IT_SHELLS;
self.items &= ~IT_ROCKETS;
self.items |= IT_SHELLS;
self.which_ammo = 0;
sound (self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM);
self.st_sshotgun = time + 0.7;
@ -1097,8 +1097,8 @@ void() W_Attack =
else
{
self.currentammo = self.ammo_shells;
self.items = self.items - ( self.items & (IT_ROCKETS) );
self.items = self.items | IT_SHELLS;
self.items &= ~IT_ROCKETS;
self.items |= IT_SHELLS;
self.which_ammo = 0;
player_shot1 ();
W_FireSuperShotgun ();