This also gets rid of the ugly WEPSET macros.
New design limit of weapon count: 72 weapons (currently set to 24 to use
less bandwidth, though).
QCCVERSIONFILE := qccversion.$(shell $(QCC) --version > qccversion.txt && git hash-object qccversion.txt)
-QCCFLAGS ?= \
- -std=fteqcc \
- -Werror -Wall \
- -Wcpp \
+# We eventually need to get rid of these.
+QCCFLAGS_WTFS ?= \
-Wno-field-redeclared \
-Wno-double-declaration \
- -Wno-uninitialized-global \
- -Wno-parenthesis \
- -O3 \
- -fadjust-vector-fields \
- -fftepp \
- -fftepp-predefs \
- -frelaxed-switch \
- -fshort-logic \
- -fno-perl-logic \
- -ftranslatable-strings \
- -fno-initialized-nonconstants \
- -fno-assign-function-types \
- -flno \
- -fcorrect-ternary \
- -fno-single-vector-defs \
- -fcorrect-logic \
- -ftrue-empty-strings \
- -fno-false-empty-strings \
- -futf8 \
- -fno-bail-on-werror \
- -floop-labels \
- -funtyped-nil \
- -fno-permissive \
- -fvariadic-args \
+
+QCCFLAGS ?= \
+ -std=gmqcc \
+ -O3 -flno \
+ -Werror -fno-bail-on-werror -Wall \
+ -fftepp -fftepp-predefs -Wcpp -futf8 \
+ $(QCCFLAGS_WTFS) \
$(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
# xonotic build system overrides this by command line argument to turn off the update-cvarcount step
}
if(autocvar_cl_spawn_event_sound)
{
- sound(self, CH_TRIGGER, "misc/spawn.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER, "misc/spawn.wav", VOL_BASE, ATTEN_NORM);
}
}
}
entity porto;
vector polyline[16];
-float Q3SURFACEFLAG_SLICK = 2; // low friction surface
-float DPCONTENTS_SOLID = 1; // blocks player movement
-float DPCONTENTS_BODY = 32; // blocks player movement
-float DPCONTENTS_CORPSE = 64; // blocks player movement
-float DPCONTENTS_PLAYERCLIP = 256; // blocks player movement
void Porto_Draw()
{
vector p, dir, ang, q, nextdir;
void CSQC_Demo_Camera();
float HUD_WouldDrawScoreboard();
float camera_mode;
-float CAMERA_FREE = 1;
-float CAMERA_CHASE = 2;
+const float CAMERA_FREE = 1;
+const float CAMERA_CHASE = 2;
float reticle_type;
string NextFrameCommand;
void CSQC_SPIDER_HUD();
// event chase camera
if(autocvar_chase_active <= 0) // greater than 0 means it's enabled manually, and this code is skipped
{
- if(spectatee_status >= 0 && (autocvar_cl_eventchase_death && is_dead) || intermission)
+ if((spectatee_status >= 0 && (autocvar_cl_eventchase_death && is_dead)) || intermission)
{
// make special vector since we can't use view_origin (It is one frame old as of this code, it gets set later with the results this code makes.)
vector current_view_origin = (csqcplayer ? csqcplayer.origin : pmove_org);
// the view to go back to normal, so reticle_type would become 0 as we fade out)
if(spectatee_status || is_dead || hud != HUD_NORMAL)
reticle_type = 0; // prevent reticle from showing during the respawn zoom effect or for spectators
- else if(activeweapon == WEP_NEX && (button_zoom || zoomscript_caught) || activeweapon == WEP_RIFLE && (button_zoom || zoomscript_caught) || activeweapon == WEP_MINSTANEX && (button_zoom || zoomscript_caught))
+ else if((activeweapon == WEP_NEX || activeweapon == WEP_RIFLE || activeweapon == WEP_MINSTANEX) && (button_zoom || zoomscript_caught))
reticle_type = 2; // nex zoom
else if(button_zoom || zoomscript_caught)
reticle_type = 1; // normal zoom
- else if(activeweapon == WEP_NEX && button_attack2 || activeweapon == WEP_RIFLE && button_attack2)
+ else if((activeweapon == WEP_NEX) && button_attack2)
reticle_type = 2; // nex zoom
if(reticle_type && autocvar_cl_reticle)
if(hit_time > nextsound_hit_time && autocvar_cl_hitsound)
{
if(time - hit_time < MAX_TIME_DIFF) // don't play the sound if it's too old.
- sound(world, CH_INFO, "misc/hit.wav", VOL_BASE, ATTN_NONE);
+ sound(world, CH_INFO, "misc/hit.wav", VOL_BASE, ATTEN_NONE);
nextsound_hit_time = time + autocvar_cl_hitsound_antispam_time;
}
if(typehit_time > nextsound_typehit_time)
{
if(time - typehit_time < MAX_TIME_DIFF) // don't play the sound if it's too old.
- sound(world, CH_INFO, "misc/typehit.wav", VOL_BASE, ATTN_NONE);
+ sound(world, CH_INFO, "misc/typehit.wav", VOL_BASE, ATTEN_NONE);
nextsound_typehit_time = time + autocvar_cl_hitsound_antispam_time;
}
{
/*if((announcement != previous_announcement) || (time >= (previous_announcement_time + autocvar_cl_announcer_antispam)))
{
- sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/", announcement, ".wav"), VOL_BASEVOICE, ATTN_NONE);
+ sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/", announcement, ".wav"), VOL_BASEVOICE, ATTEN_NONE);
if(previous_announcement) { strunzone(previous_announcement); }
{
self.move_angles_x = 0;
self.move_angles_z = 0;
- self.flags &~= FL_ONGROUND;
+ self.flags &= ~FL_ONGROUND;
}
Movetype_Physics_MatchTicrate(autocvar_cl_casings_ticrate, autocvar_cl_casings_sloppy);
break;
}
- sound (self, CH_SHOTS, s, VOL_BASE, ATTN_LARGE);
+ sound (self, CH_SHOTS, s, VOL_BASE, ATTEN_LARGE);
}
}
}
if(thisforce_z < 0)
thisforce_z = 0;
self.move_velocity = self.move_velocity + thisforce + '0 0 100';
- self.move_flags &~= FL_ONGROUND;
+ self.move_flags &= ~FL_ONGROUND;
}
void Ent_Casing(float isNew)
#define SOLID_BSP 4 // bsp clip, touch on edge, block
#define SOLID_CORPSE 5 // same as SOLID_BBOX, except it behaves as SOLID_NOT against SOLID_SLIDEBOX objects (players/monsters)
-float MOVE_NORMAL = 0; // same as FALSE
-float MOVE_NOMONSTERS = 1; // same as TRUE
-float MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE
-float MOVE_HITMODEL = 4;
-float MOVE_WORLDONLY = 3;
+const float MOVE_NORMAL = 0; // same as FALSE
+const float MOVE_NOMONSTERS = 1; // same as TRUE
+const float MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE
+const float MOVE_HITMODEL = 4;
+const float MOVE_WORLDONLY = 3;
-float CAMERA_FREE = 1;
-float CAMERA_CHASE = 2;
+const float CAMERA_FREE = 1;
+const float CAMERA_CHASE = 2;
-float EF_NOMODELFLAGS = 8388608;
+const float EF_NOMODELFLAGS = 8388608;
}
// FEATURE: EF_NODRAW workalike
-float EF_BRIGHTFIELD = 1;
-float EF_BRIGHTLIGHT = 4;
-float EF_DIMLIGHT = 8;
-float EF_DOUBLESIDED = 32768;
-float EF_NOSELFSHADOW = 65536;
-float EF_DYNAMICMODELLIGHT = 131072;
-float EF_RESTARTANIM_BIT = 1048576;
-float EF_TELEPORT_BIT = 2097152;
-float MF_ROCKET = 1; // leave a trail
-float MF_GRENADE = 2; // leave a trail
-float MF_GIB = 4; // leave a trail
-float MF_ROTATE = 8; // rotate (bonus items)
-float MF_TRACER = 16; // green split trail
-float MF_ZOMGIB = 32; // small blood trail
-float MF_TRACER2 = 64; // orange split trail
-float MF_TRACER3 = 128; // purple trail
+const float EF_BRIGHTFIELD = 1;
+const float EF_BRIGHTLIGHT = 4;
+const float EF_DIMLIGHT = 8;
+const float EF_DOUBLESIDED = 32768;
+const float EF_NOSELFSHADOW = 65536;
+const float EF_DYNAMICMODELLIGHT = 131072;
+const float EF_RESTARTANIM_BIT = 1048576;
+const float EF_TELEPORT_BIT = 2097152;
+const float MF_ROCKET = 1; // leave a trail
+const float MF_GRENADE = 2; // leave a trail
+const float MF_GIB = 4; // leave a trail
+const float MF_ROTATE = 8; // rotate (bonus items)
+const float MF_TRACER = 16; // green split trail
+const float MF_ZOMGIB = 32; // small blood trail
+const float MF_TRACER2 = 64; // orange split trail
+const float MF_TRACER3 = 128; // purple trail
.float csqcmodel_effects;
.float csqcmodel_modelflags;
void CSQCModel_Effects_PreUpdate(void)
void CSQCModel_Effects_Apply(void)
{
float eff = self.csqcmodel_effects;
- eff &~= CSQCMODEL_EF_RESPAWNGHOST;
+ eff &= ~CSQCMODEL_EF_RESPAWNGHOST;
- self.renderflags &~= (RF_DEPTHHACK | RF_ADDITIVE | RF_FULLBRIGHT | EF_NOSHADOW | RF_USEAXIS);
+ self.renderflags &= ~(RF_DEPTHHACK | RF_ADDITIVE | RF_FULLBRIGHT | EF_NOSHADOW | RF_USEAXIS);
self.effects = 0;
self.traileffect = 0;
if(vlen(thisforce))
{
self.move_velocity = self.move_velocity + damage_explosion_calcpush(self.damageforcescale * thisforce, self.move_velocity, autocvar_g_balance_damagepush_speedfactor);
- self.move_flags &~= FL_ONGROUND;
+ self.move_flags &= ~FL_ONGROUND;
}
if(w_issilent)
case DEATH_VH_SPID_MINIGUN:
string _snd;
_snd = strcat("weapons/ric", ftos(1 + rint(random() * 2)), ".waw");
- sound(self, CH_SHOTS, _snd, VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("spiderbot_minigun_impact"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_SPID_ROCKET:
- sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("spiderbot_rocket_explode"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_SPID_DEATH:
- sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_MIN);
+ sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_MIN);
pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_WAKI_GUN:
- sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("wakizashi_gun_impact"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_WAKI_ROCKET:
- sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("wakizashi_rocket_explode"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_WAKI_DEATH:
- sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_MIN);
+ sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_MIN);
pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_RAPT_CANNON:
- sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("raptor_cannon_impact"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_RAPT_FRAGMENT:
ang = vectoangles(vel);
RaptorCBShellfragToss(w_org, vel, ang + '0 0 1' * (120 * i));
}
- sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("raptor_bomb_spread"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_RAPT_BOMB:
- sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("raptor_bomb_impact"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_RAPT_DEATH:
- sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_MIN);
+ sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_MIN);
pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_BUMB_GUN:
- sound(self, CH_SHOTS, "weapons/fireball_impact2.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/fireball_impact2.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("bigplasma_impact"), self.origin, w_backoff * 1000, 1);
break;
}
switch(w_deathtype)
{
case DEATH_TURRET_EWHEEL:
- sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_MIN);
+ sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_MIN);
pointparticles(particleeffectnum("laser_impact"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_TURRET_FLAC:
pointparticles(particleeffectnum("hagar_explode"), w_org, '0 0 0', 1);
_snd = strcat("weapons/hagexp", ftos(1 + rint(random() * 2)), ".waw");
- sound(self, CH_SHOTS, _snd, VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM);
break;
case DEATH_TURRET_MLRS:
case DEATH_TURRET_HK:
case DEATH_TURRET_WALK_ROCKET:
case DEATH_TURRET_HELLION:
- sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_MIN);
+ sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_MIN);
pointparticles(particleeffectnum("rocket_explode"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_TURRET_MACHINEGUN:
case DEATH_TURRET_WALK_GUN:
_snd = strcat("weapons/ric", ftos(1 + rint(random() * 2)), ".waw");
- sound(self, CH_SHOTS, _snd, VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("machinegun_impact"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_TURRET_PLASMA:
- sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTN_MIN);
+ sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTEN_MIN);
pointparticles(particleeffectnum("electro_impact"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_TURRET_WALK_MEELE:
- sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTN_MIN);
+ sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTEN_MIN);
pointparticles(particleeffectnum("TE_SPARK"), self.origin, w_backoff * 1000, 1);
break;
}
if(!self.silent)
- sound(self, CH_PAIN, strcat("misc/gib_splat0", ftos(floor(prandom() * 4 + 1)), ".wav"), VOL_BASE, ATTN_NORM);
+ sound(self, CH_PAIN, strcat("misc/gib_splat0", ftos(floor(prandom() * 4 + 1)), ".wav"), VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum(strcat(species_prefix(self.cnt), "blood")), self.origin + '0 0 1', '0 0 30', 10);
Gib_Delete();
{
case 0x01:
if(!issilent)
- sound (self, CH_PAIN, "misc/gib.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_PAIN, "misc/gib.wav", VOL_BASE, ATTEN_NORM);
if(prandom() < amount)
TossGib ("models/gibs/eye.md3", org, org, vel, prandomvec() * 150, specnum, 0, issilent);
if(self.teleport_time)
if(time > self.teleport_time)
{
- sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTN_NORM); // safeguard
+ sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM); // safeguard
self.teleport_time = 0;
}
void Remove_GrapplingHook()
{
- sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM);
}
void Ent_ReadHook(float bIsNew, float type)
self.drawmask = MASK_NORMAL;
break;
case ENT_CLIENT_LGBEAM:
- sound (self, CH_SHOTS_SINGLE, "weapons/lgbeam_fly.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_SHOTS_SINGLE, "weapons/lgbeam_fly.wav", VOL_BASE, ATTEN_NORM);
break;
case ENT_CLIENT_GAUNTLET:
- sound (self, CH_SHOTS_SINGLE, "weapons/gauntletbeam_fly.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_SHOTS_SINGLE, "weapons/gauntletbeam_fly.wav", VOL_BASE, ATTEN_NORM);
break;
}
}
void HUD_Weapons(void)
{
// declarations
- WEPSET_DECLARE_A(weapons_stat);
- WEPSET_COPY_AS(weapons_stat);
+ WepSet weapons_stat = WepSet_GetFromStat();
float i, f, a;
float screen_ar, center_x = 0, center_y;
float weapon_count, weapon_id;
{
if(autocvar__hud_configure)
{
- if (WEPSET_EMPTY_A(weapons_stat))
+ if (!weapons_stat)
for(i = WEP_FIRST; i <= WEP_LAST; i += floor((WEP_LAST-WEP_FIRST)/5))
- WEPSET_OR_AW(weapons_stat, i);
+ weapons_stat |= WepSet_FromWeapon(i);
if(menu_enabled != 2)
HUD_Panel_DrawBg(1); // also draw the bg of the entire panel
// do we own this weapon?
weapon_count = 0;
for(i = 0; i <= WEP_LAST-WEP_FIRST; ++i)
- if(WEPSET_CONTAINS_AW(weapons_stat, weaponorder[i].weapon))
+ if(weapons_stat & WepSet_FromWeapon(weaponorder[i].weapon))
++weapon_count;
// add it anyway if weaponcomplain is shown
// skip this weapon if we don't own it (and onlyowned is enabled)-- or if weapons_complainbubble is showing for this weapon
if(autocvar_hud_panel_weapons_onlyowned)
- if not(WEPSET_CONTAINS_AW(weapons_stat, self.weapon) || (self.weapon == complain_weapon))
+ if not((weapons_stat & WepSet_FromWeapon(self.weapon)) || (self.weapon == complain_weapon))
continue;
// figure out the drawing position of weapon
}
// drawing all the weapon items
- if(WEPSET_CONTAINS_AW(weapons_stat, self.weapon))
+ if(weapons_stat & WepSet_FromWeapon(self.weapon))
{
// draw the weapon image
drawpic_aspect_skin(weapon_pos, strcat("weapon", self.netname), weapon_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
if(autocvar_cl_autodemo_delete_keeprecords)
{
f = autocvar_cl_autodemo_delete;
- f &~= 1;
+ f &= ~1;
cvar_set("cl_autodemo_delete", ftos(f)); // don't delete demo with new record!
}
}
.float scale; // scaling factor of the thickness
.float modelscale; // scaling factor of the dlight
-// TODO move these into a heade file
-float trace_dphitq3surfaceflags;
-float Q3SURFACEFLAG_SKY = 4; // sky surface (also has NOIMPACT and NOMARKS set)
-float Q3SURFACEFLAG_NOIMPACT = 16; // projectiles should remove themselves on impact (this is set on sky)
-
void Draw_Laser()
{
if(!self.state)
else
mv_maps_mask = ReadShort();
- if(oldmask & mv_maps_mask != oldmask)
- if(oldmask & mv_maps_mask == mv_maps_mask)
- sound(world, CH_INFO, "misc_invshot.wav", VOL_BASE, ATTN_NONE);
+ if((oldmask & mv_maps_mask) != oldmask)
+ if((oldmask & mv_maps_mask) == mv_maps_mask)
+ sound(world, CH_INFO, "misc_invshot.wav", VOL_BASE, ATTEN_NONE);
// remove votes that no longer apply
for(i = 0, power = 1; i < mv_num_maps; ++i, power *= 2)
-float STAT_MOVEFLAGS = 225;
-float MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE = 4;
+const float STAT_MOVEFLAGS = 225;
+const float MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE = 4;
#define GRAVITY_UNAFFECTED_BY_TICRATE (getstati(STAT_MOVEFLAGS) & MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE)
.entity move_groundentity; // FIXME add move_groundnetworkentity?
if(self.move_flags & FL_ONGROUND)
{
if(self.move_velocity_z >= 1/32)
- self.move_flags &~= FL_ONGROUND;
+ self.move_flags &= ~FL_ONGROUND;
else if(!self.move_groundentity)
return;
else if(self.move_suspendedinair && wasfreed(self.move_groundentity))
if(self.move_movetype == MOVETYPE_BOUNCEMISSILE)
{
self.move_velocity = _Movetype_ClipVelocity(self.move_velocity, trace_plane_normal, 2.0);
- self.move_flags &~= FL_ONGROUND;
+ self.move_flags &= ~FL_ONGROUND;
}
else if(self.move_movetype == MOVETYPE_BOUNCE)
{
self.move_avelocity = '0 0 0';
}
else
- self.move_flags &~= FL_ONGROUND;
+ self.move_flags &= ~FL_ONGROUND;
}
else
{
self.move_avelocity = '0 0 0';
}
else
- self.move_flags &~= FL_ONGROUND;
+ self.move_flags &= ~FL_ONGROUND;
}
// DP revision 8905 (just, WHY...)
void Movetype_Physics_MatchServer(float sloppy);
void Movetype_Physics_NoMatchServer();
-float MOVETYPE_NONE = 0;
-float MOVETYPE_ANGLENOCLIP = 1;
-float MOVETYPE_ANGLECLIP = 2;
-float MOVETYPE_WALK = 3;
-float MOVETYPE_STEP = 4;
-float MOVETYPE_FLY = 5;
-float MOVETYPE_TOSS = 6;
-float MOVETYPE_PUSH = 7;
-float MOVETYPE_NOCLIP = 8;
-float MOVETYPE_FLYMISSILE = 9;
-float MOVETYPE_BOUNCE = 10;
-float MOVETYPE_BOUNCEMISSILE = 11; // Like bounce but doesn't lose speed on bouncing
-float MOVETYPE_FOLLOW = 12;
-float MOVETYPE_FAKEPUSH = 13;
-float MOVETYPE_FLY_WORLDONLY = 33;
+const float MOVETYPE_NONE = 0;
+const float MOVETYPE_ANGLENOCLIP = 1;
+const float MOVETYPE_ANGLECLIP = 2;
+const float MOVETYPE_WALK = 3;
+const float MOVETYPE_STEP = 4;
+const float MOVETYPE_FLY = 5;
+const float MOVETYPE_TOSS = 6;
+const float MOVETYPE_PUSH = 7;
+const float MOVETYPE_NOCLIP = 8;
+const float MOVETYPE_FLYMISSILE = 9;
+const float MOVETYPE_BOUNCE = 10;
+const float MOVETYPE_BOUNCEMISSILE = 11; // Like bounce but doesn't lose speed on bouncing
+const float MOVETYPE_FOLLOW = 12;
+const float MOVETYPE_FAKEPUSH = 13;
+const float MOVETYPE_FLY_WORLDONLY = 33;
-float FL_ITEM = 256;
-float FL_ONGROUND = 512;
+const float FL_ITEM = 256;
+const float FL_ONGROUND = 512;
if(self.count & 0x80)
{
- //self.move_flags &~= FL_ONGROUND;
+ //self.move_flags &= ~FL_ONGROUND;
if(self.move_movetype == MOVETYPE_NONE || self.move_movetype == MOVETYPE_FLY)
Movetype_Physics_NoMatchServer();
// the trivial movetypes do not have to match the
if(f & 0x40)
self.move_flags |= FL_ONGROUND;
else
- self.move_flags &~= FL_ONGROUND;
+ self.move_flags &= ~FL_ONGROUND;
if(!self.move_time)
{
{
case PROJECTILE_ELECTRO:
// only new engines support sound moving with object
- loopsound(self, CH_SHOTS_SINGLE, "weapons/electro_fly.wav", VOL_BASE, ATTN_NORM);
+ loopsound(self, CH_SHOTS_SINGLE, "weapons/electro_fly.wav", VOL_BASE, ATTEN_NORM);
self.mins = '0 0 -4';
self.maxs = '0 0 -4';
self.move_movetype = MOVETYPE_BOUNCE;
self.move_bounce_stopspeed = g_balance_electro_secondary_bouncestop;
break;
case PROJECTILE_ROCKET:
- loopsound(self, CH_SHOTS_SINGLE, "weapons/rocket_fly.wav", VOL_BASE, ATTN_NORM);
+ loopsound(self, CH_SHOTS_SINGLE, "weapons/rocket_fly.wav", VOL_BASE, ATTEN_NORM);
self.mins = '-3 -3 -3';
self.maxs = '3 3 3';
break;
self.move_touch = func_null;
break;
case PROJECTILE_FIREBALL:
- loopsound(self, CH_SHOTS_SINGLE, "weapons/fireball_fly2.wav", VOL_BASE, ATTN_NORM);
+ loopsound(self, CH_SHOTS_SINGLE, "weapons/fireball_fly2.wav", VOL_BASE, ATTEN_NORM);
self.mins = '-16 -16 -16';
self.maxs = '16 16 16';
break;
case PROJECTILE_FIREMINE:
- loopsound(self, CH_SHOTS_SINGLE, "weapons/fireball_fly.wav", VOL_BASE, ATTN_NORM);
+ loopsound(self, CH_SHOTS_SINGLE, "weapons/fireball_fly.wav", VOL_BASE, ATTEN_NORM);
self.move_movetype = MOVETYPE_BOUNCE;
self.move_touch = func_null;
self.mins = '-4 -4 -4';
self.maxs = '2 2 2';
break;
case PROJECTILE_SEEKER:
- loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTN_NORM);
+ loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTEN_NORM);
self.mins = '-4 -4 -4';
self.maxs = '4 4 4';
break;
case PROJECTILE_RAPTORCANNON:
break;
case PROJECTILE_SPIDERROCKET:
- loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTN_NORM);
+ loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTEN_NORM);
break;
case PROJECTILE_WAKIROCKET:
- loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTN_NORM);
+ loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTEN_NORM);
break;
/*
case PROJECTILE_WAKICANNON:
break;
case PROJECTILE_BUMBLE_GUN:
// only new engines support sound moving with object
- loopsound(self, CH_SHOTS_SINGLE, "weapons/electro_fly.wav", VOL_BASE, ATTN_NORM);
+ loopsound(self, CH_SHOTS_SINGLE, "weapons/electro_fly.wav", VOL_BASE, ATTEN_NORM);
self.mins = '0 0 -4';
self.maxs = '0 0 -4';
self.move_movetype = MOVETYPE_BOUNCE;
void drawstringright(vector, string, vector, vector, float, float);
void drawstringcenter(vector, string, vector, vector, float, float);
-float SCOREBOARD_OFFSET = 50;
+const float SCOREBOARD_OFFSET = 50;
// wrapper to put all possible scores titles through gettext
string TranslateScoresLabel(string l)
#pragma noref 0
-#undef ATTN_NORM
+#undef ATTEN_NORM
#ifdef COMPAT_050_ENGINE
// WORKAROUND for 0.5.0 engine
#define CSQC
-#define ATTN_NORM builtin_ATTN_NORM
+#define ATTEN_NORM builtin_ATTEN_NORM
#ifdef COMPAT_050_ENGINE
// WORKAROUND for 0.5.0 engine
if(vol != vol0)
{
if(vol0 < 0)
- sound(e, CH_BGM_SINGLE, e.noise, vol, ATTN_NONE); // restart
+ sound(e, CH_BGM_SINGLE, e.noise, vol, ATTEN_NONE); // restart
else
- sound(e, CH_BGM_SINGLE, "", vol, ATTN_NONE);
+ sound(e, CH_BGM_SINGLE, "", vol, ATTEN_NONE);
e.lastvol = vol;
}
}
strunzone(e.noise);
e.noise = strzone(noi);
precache_sound(e.noise);
- sound(e, CH_BGM_SINGLE, e.noise, 0, ATTN_NONE);
+ sound(e, CH_BGM_SINGLE, e.noise, 0, ATTEN_NONE);
if(getsoundtime(e, CH_BGM_SINGLE) < 0)
{
print(sprintf(_("Cannot initialize sound %s\n"), e.noise));
if(self.noise != s)
{
precache_sound(self.noise);
- sound(self, CH_BGM_SINGLE, self.noise, 0, ATTN_NONE);
+ sound(self, CH_BGM_SINGLE, self.noise, 0, ATTEN_NONE);
if(getsoundtime(self, CH_BGM_SINGLE) < 0)
{
print(sprintf(_("Cannot initialize sound %s\n"), self.noise));
{
float i;
- sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
for (i = 1; i < 5; i = i + 1)
void turret_die()
{
- sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
turret_tid2info(self.turret_type);
if (!autocvar_cl_nogibs)
// hud_id == 0 means we exited a vehicle, so stop alarm sound/s
if(hud_id == 0)
{
- sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
- sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
+ sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
+ sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
return;
}
if(alarm1time < time)
{
alarm1time = time + 2;
- sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
+ sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
}
drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
if(alarm1time)
{
- sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
+ sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
alarm1time = 0;
}
}
if(alarm2time < time)
{
alarm2time = time + 1;
- sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
+ sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE);
}
drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
}
drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
if(alarm2time)
{
- sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
+ sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
alarm2time = 0;
}
}
if(alarm1time < time)
{
alarm1time = time + 2;
- sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
+ sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
}
drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
if(alarm1time)
{
- sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
+ sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
alarm1time = 0;
}
}
if(alarm2time < time)
{
alarm2time = time + 1;
- sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
+ sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE);
}
drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
}
drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
if(alarm2time)
{
- sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
+ sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
alarm2time = 0;
}
}
if(alarm1time < time)
{
alarm1time = time + 2;
- sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
+ sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
}
drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
}
drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
if(alarm1time)
{
- sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
+ sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
alarm1time = 0;
}
}
if(alarm2time < time)
{
alarm2time = time + 1;
- sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
+ sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE);
}
drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
}
drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
if(alarm2time)
{
- sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
+ sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
alarm2time = 0;
}
}
if(alarm1time < time)
{
alarm1time = time + 2;
- sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
+ sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
}
drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
if(alarm1time)
{
- sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
+ sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
alarm1time = 0;
}
}
if(alarm2time < time)
{
alarm2time = time + 1;
- sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
+ sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE);
}
drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
}
drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
if(alarm2time)
{
- sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
+ sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
alarm2time = 0;
}
}
if(alarm1time < time)
{
alarm1time = time + 2;
- sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
+ sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
}
drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
if(alarm1time)
{
- sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
+ sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
alarm1time = 0;
}
}
if(alarm2time < time)
{
alarm2time = time + 1;
- sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
+ sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE);
}
drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
}
drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
if(alarm2time)
{
- sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
+ sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
alarm2time = 0;
}
}
.float build_starthealth;
.float build_finished;
-float SPRITE_HEALTHBAR_WIDTH = 144;
-float SPRITE_HEALTHBAR_HEIGHT = 9;
-float SPRITE_HEALTHBAR_MARGIN = 6;
-float SPRITE_HEALTHBAR_BORDER = 2;
-float SPRITE_HEALTHBAR_BORDERALPHA = 1;
-float SPRITE_HEALTHBAR_HEALTHALPHA = 0.5;
-float SPRITE_ARROW_SCALE = 1.0;
-float SPRITE_HELPME_BLINK = 2;
+const float SPRITE_HEALTHBAR_WIDTH = 144;
+const float SPRITE_HEALTHBAR_HEIGHT = 9;
+const float SPRITE_HEALTHBAR_MARGIN = 6;
+const float SPRITE_HEALTHBAR_BORDER = 2;
+const float SPRITE_HEALTHBAR_BORDERALPHA = 1;
+const float SPRITE_HEALTHBAR_HEALTHALPHA = 0.5;
+const float SPRITE_ARROW_SCALE = 1.0;
+const float SPRITE_HELPME_BLINK = 2;
void drawrotpic(vector org, float rot, string pic, vector sz, vector hotspot, vector rgb, float a, float f)
{
// Revision 22: hook shot origin
#define CSQC_REVISION 22
-const float AS_STRING = 1;
-const float AS_INT = 2;
-const float AS_FLOAT_TRUNCATED = 2;
-const float AS_FLOAT = 8;
+const float AS_STRING = 1;
+const float AS_INT = 2;
+const float AS_FLOAT_TRUNCATED = 2;
+const float AS_FLOAT = 8;
const float TE_CSQC_PICTURE = 100;
const float TE_CSQC_RACE = 101;
///////////////////////////
// keys pressed
-const float KEY_FORWARD = 1;
-const float KEY_BACKWARD = 2;
-const float KEY_LEFT = 4;
-const float KEY_RIGHT = 8;
-const float KEY_JUMP = 16;
-const float KEY_CROUCH = 32;
-const float KEY_ATCK = 64;
-const float KEY_ATCK2 = 128;
+const float KEY_FORWARD = 1;
+const float KEY_BACKWARD = 2;
+const float KEY_LEFT = 4;
+const float KEY_RIGHT = 8;
+const float KEY_JUMP = 16;
+const float KEY_CROUCH = 32;
+const float KEY_ATCK = 64;
+const float KEY_ATCK2 = 128;
///////////////////////////
// cvar constants
-float CVAR_SAVE = 1;
-float CVAR_NOTIFY = 2;
-float CVAR_READONLY = 4;
+const float CVAR_SAVE = 1;
+const float CVAR_NOTIFY = 2;
+const float CVAR_READONLY = 4;
///////////////////////////
// csqc communication stuff
const float STAT_SWITCHINGWEAPON = 58;
const float STAT_SUPERWEAPONS_FINISHED = 59;
-const float STAT_VEHICLESTAT_HEALTH = 60;
-const float STAT_VEHICLESTAT_SHIELD = 61;
-const float STAT_VEHICLESTAT_ENERGY = 62;
-const float STAT_VEHICLESTAT_AMMO1 = 63;
+const float STAT_VEHICLESTAT_HEALTH = 60;
+const float STAT_VEHICLESTAT_SHIELD = 61;
+const float STAT_VEHICLESTAT_ENERGY = 62;
+const float STAT_VEHICLESTAT_AMMO1 = 63;
const float STAT_VEHICLESTAT_RELOAD1 = 64;
-const float STAT_VEHICLESTAT_AMMO2 = 65;
+const float STAT_VEHICLESTAT_AMMO2 = 65;
const float STAT_VEHICLESTAT_RELOAD2 = 66;
const float STAT_SECRETS_TOTAL = 70;
const float STAT_RESPAWN_TIME = 72;
const float STAT_ROUNDSTARTTIME = 73;
+const float STAT_WEAPONS2 = 74;
+const float STAT_WEAPONS3 = 75;
+
// mod stats (1xx)
const float STAT_REDALIVE = 100;
const float STAT_BLUEALIVE = 101;
const float STAT_DOM_PPS_PINK = 103;
const float STAT_DOM_PPS_YELLOW = 104;
-//const float STAT_SPIDERBOT_AIM 53 // compressShotOrigin
-//const float STAT_SPIDERBOT_TARGET 54 // compressShotOrigin
+//const float STAT_SPIDERBOT_AIM 53 // compressShotOrigin
+//const float STAT_SPIDERBOT_TARGET 54 // compressShotOrigin
// see DP source, quakedef.h
const float STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222;
const float CTF_STATE_COMMANDER = 3;
const float HUD_NORMAL = 0;
-const float HUD_VEHICLE_FIRST = 10;
-const float HUD_SPIDERBOT = 10;
-const float HUD_WAKIZASHI = 11;
-const float HUD_RAPTOR = 12;
-const float HUD_BUMBLEBEE = 13;
-const float HUD_BUMBLEBEE_GUN = 14;
-const float HUD_VEHICLE_LAST = 14;
+const float HUD_VEHICLE_FIRST = 10;
+const float HUD_SPIDERBOT = 10;
+const float HUD_WAKIZASHI = 11;
+const float HUD_RAPTOR = 12;
+const float HUD_BUMBLEBEE = 13;
+const float HUD_BUMBLEBEE_GUN = 14;
+const float HUD_VEHICLE_LAST = 14;
const vector eX = '1 0 0';
const vector eY = '0 1 0';
/**
* Lower scores are better (e.g. suicides)
*/
-#define SFL_LOWER_IS_BETTER 1
+#define SFL_LOWER_IS_BETTER 1
/**
* Don't show zero values as scores
*/
-#define SFL_HIDE_ZERO 2
+#define SFL_HIDE_ZERO 2
/**
* Allow a column to be hidden (do not automatically add it even if it is a sorting key)
*/
-#define SFL_ALLOW_HIDE 16
+#define SFL_ALLOW_HIDE 16
/**
* Display as a rank (with st, nd, rd, th suffix)
*/
-#define SFL_RANK 32
+#define SFL_RANK 32
/**
* Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!)
*/
-#define SFL_TIME 64
+#define SFL_TIME 64
// not an extra constant yet
#define SFL_ZERO_IS_WORST SFL_TIME
* Scoring priority (NOTE: PRIMARY is used for fraglimit)
*/
#define SFL_SORT_PRIO_SECONDARY 4
-#define SFL_SORT_PRIO_PRIMARY 8
-#define SFL_SORT_PRIO_MASK 12
+#define SFL_SORT_PRIO_PRIMARY 8
+#define SFL_SORT_PRIO_MASK 12
/**
* Score indices
// game mode specific indices are not in common/, but in server/scores_rules.qc!
#ifdef COMPAT_XON010_CHANNELS
-float CH_INFO = 0; // only on world and csqc
-float CH_TRIGGER = 0; // only on players; compat: FALSELY CONTROLLED BY "Info"
-float CH_WEAPON_A = 1; // only on players and entities
-float CH_WEAPON_SINGLE = 5; // only on players and entities
-float CH_VOICE = 2; // only on players
-float CH_BGM_SINGLE = 2; // only on csqc; compat: FALSELY CONTROLLED BY "Voice"
-float CH_AMBIENT = 2; // only on csqc; compat: FALSELY CONTROLLED BY "Voice"
-float CH_TRIGGER_SINGLE = 3; // only on players, entities, csqc
-float CH_SHOTS = 4; // only on players, entities, csqc
-float CH_SHOTS_SINGLE = 4; // only on players, entities, csqc
-float CH_WEAPON_B = 5; // only on players and entities
-float CH_PAIN = 6; // only on players and csqc
-float CH_PAIN_SINGLE = 6; // only on players and csqc
-float CH_PLAYER = 7; // only on players and entities
-float CH_TUBA = 5; // only on csqc
+const float CH_INFO = 0; // only on world and csqc
+const float CH_TRIGGER = 0; // only on players; compat: FALSELY CONTROLLED BY "Info"
+const float CH_WEAPON_A = 1; // only on players and entities
+const float CH_WEAPON_SINGLE = 5; // only on players and entities
+const float CH_VOICE = 2; // only on players
+const float CH_BGM_SINGLE = 2; // only on csqc; compat: FALSELY CONTROLLED BY "Voice"
+const float CH_AMBIENT = 2; // only on csqc; compat: FALSELY CONTROLLED BY "Voice"
+const float CH_TRIGGER_SINGLE = 3; // only on players, entities, csqc
+const float CH_SHOTS = 4; // only on players, entities, csqc
+const float CH_SHOTS_SINGLE = 4; // only on players, entities, csqc
+const float CH_WEAPON_B = 5; // only on players and entities
+const float CH_PAIN = 6; // only on players and csqc
+const float CH_PAIN_SINGLE = 6; // only on players and csqc
+const float CH_PLAYER = 7; // only on players and entities
+const float CH_TUBA = 5; // only on csqc
#else
-float CH_INFO = 0;
-float CH_TRIGGER = -3;
-float CH_WEAPON_A = -1;
-float CH_WEAPON_SINGLE = 1;
-float CH_VOICE = -2;
-float CH_BGM_SINGLE = 8;
-float CH_AMBIENT = -9;
-float CH_TRIGGER_SINGLE = 3;
-float CH_SHOTS = -4;
-float CH_SHOTS_SINGLE = 4;
-float CH_WEAPON_B = -1;
-float CH_PAIN = -6;
-float CH_PAIN_SINGLE = 6;
-float CH_PLAYER = -7;
-float CH_TUBA = 5;
+const float CH_INFO = 0;
+const float CH_TRIGGER = -3;
+const float CH_WEAPON_A = -1;
+const float CH_WEAPON_SINGLE = 1;
+const float CH_VOICE = -2;
+const float CH_BGM_SINGLE = 8;
+const float CH_AMBIENT = -9;
+const float CH_TRIGGER_SINGLE = 3;
+const float CH_SHOTS = -4;
+const float CH_SHOTS_SINGLE = 4;
+const float CH_WEAPON_B = -1;
+const float CH_PAIN = -6;
+const float CH_PAIN_SINGLE = 6;
+const float CH_PLAYER = -7;
+const float CH_TUBA = 5;
#endif
-float ATTN_NONE = 0;
-float ATTN_MIN = 0.015625;
-float ATTN_NORM = 0.5;
-float ATTN_LARGE = 1;
-float ATTN_IDLE = 2;
-float ATTN_STATIC = 3;
-float ATTN_MAX = 3.984375;
+const float ATTEN_NONE = 0;
+const float ATTEN_MIN = 0.015625;
+const float ATTEN_NORM = 0.5;
+const float ATTEN_LARGE = 1;
+const float ATTEN_IDLE = 2;
+const float ATTEN_STATIC = 3;
+const float ATTEN_MAX = 3.984375;
#define VOL_BASE 0.7
#define VOL_BASEVOICE 1.0
// this sets sounds and other properties of the projectiles in csqc
-float PROJECTILE_ELECTRO = 1;
-float PROJECTILE_ROCKET = 2;
-float PROJECTILE_TAG = 3;
-float PROJECTILE_BULLET = 4;
-float PROJECTILE_CRYLINK = 5;
-float PROJECTILE_ELECTRO_BEAM = 6;
-float PROJECTILE_GRENADE = 7;
-float PROJECTILE_GRENADE_BOUNCING = 8;
-float PROJECTILE_MINE = 9;
-float PROJECTILE_LASER = 10;
-float PROJECTILE_HLAC = 11;
-float PROJECTILE_SEEKER = 12;
-float PROJECTILE_FLAC = 13;
-float PROJECTILE_PORTO_RED = 14;
-float PROJECTILE_PORTO_BLUE = 15;
-float PROJECTILE_HOOKBOMB = 16;
-float PROJECTILE_HAGAR = 17;
-float PROJECTILE_HAGAR_BOUNCING = 18;
-float PROJECTILE_BULLET_GLOWING = 19;
-float PROJECTILE_CRYLINK_BOUNCING = 20;
-float PROJECTILE_FIREBALL = 21;
-float PROJECTILE_FIREMINE = 22;
-float PROJECTILE_BULLET_GLOWING_TRACER = 23;
-
-float PROJECTILE_RAPTORCANNON = 24;
-float PROJECTILE_RAPTORBOMB = 25;
-float PROJECTILE_RAPTORBOMBLET = 26;
-float PROJECTILE_SPIDERROCKET = 27;
-float PROJECTILE_WAKIROCKET = 28;
-float PROJECTILE_WAKICANNON = 29;
-
-float PROJECTILE_BUMBLE_GUN = 30;
-float PROJECTILE_BUMBLE_BEAM = 31;
-
-float PROJECTILE_NADE_RED = 50;
-float PROJECTILE_NADE_RED_BURN = 51;
-float PROJECTILE_NADE_BLUE = 52;
-float PROJECTILE_NADE_BLUE_BURN = 53;
-float PROJECTILE_NADE_YELLOW = 54;
-float PROJECTILE_NADE_YELLOW_BURN = 55;
-float PROJECTILE_NADE_PINK = 56;
-float PROJECTILE_NADE_PINK_BURN = 57;
-float PROJECTILE_NADE = 58;
-float PROJECTILE_NADE_BURN = 59;
-
-float SPECIES_HUMAN = 0;
-float SPECIES_ROBOT_SOLID = 1;
-float SPECIES_ALIEN = 2;
-float SPECIES_ANIMAL = 3;
-float SPECIES_ROBOT_RUSTY = 4;
-float SPECIES_ROBOT_SHINY = 5;
-float SPECIES_RESERVED = 15;
+const float PROJECTILE_ELECTRO = 1;
+const float PROJECTILE_ROCKET = 2;
+const float PROJECTILE_TAG = 3;
+const float PROJECTILE_BULLET = 4;
+const float PROJECTILE_CRYLINK = 5;
+const float PROJECTILE_ELECTRO_BEAM = 6;
+const float PROJECTILE_GRENADE = 7;
+const float PROJECTILE_GRENADE_BOUNCING = 8;
+const float PROJECTILE_MINE = 9;
+const float PROJECTILE_LASER = 10;
+const float PROJECTILE_HLAC = 11;
+const float PROJECTILE_SEEKER = 12;
+const float PROJECTILE_FLAC = 13;
+const float PROJECTILE_PORTO_RED = 14;
+const float PROJECTILE_PORTO_BLUE = 15;
+const float PROJECTILE_HOOKBOMB = 16;
+const float PROJECTILE_HAGAR = 17;
+const float PROJECTILE_HAGAR_BOUNCING = 18;
+const float PROJECTILE_BULLET_GLOWING = 19;
+const float PROJECTILE_CRYLINK_BOUNCING = 20;
+const float PROJECTILE_FIREBALL = 21;
+const float PROJECTILE_FIREMINE = 22;
+const float PROJECTILE_BULLET_GLOWING_TRACER = 23;
+
+const float PROJECTILE_RAPTORCANNON = 24;
+const float PROJECTILE_RAPTORBOMB = 25;
+const float PROJECTILE_RAPTORBOMBLET = 26;
+const float PROJECTILE_SPIDERROCKET = 27;
+const float PROJECTILE_WAKIROCKET = 28;
+const float PROJECTILE_WAKICANNON = 29;
+
+const float PROJECTILE_BUMBLE_GUN = 30;
+const float PROJECTILE_BUMBLE_BEAM = 31;
+
+const float PROJECTILE_NADE_RED = 50;
+const float PROJECTILE_NADE_RED_BURN = 51;
+const float PROJECTILE_NADE_BLUE = 52;
+const float PROJECTILE_NADE_BLUE_BURN = 53;
+const float PROJECTILE_NADE_YELLOW = 54;
+const float PROJECTILE_NADE_YELLOW_BURN = 55;
+const float PROJECTILE_NADE_PINK = 56;
+const float PROJECTILE_NADE_PINK_BURN = 57;
+const float PROJECTILE_NADE = 58;
+const float PROJECTILE_NADE_BURN = 59;
+
+const float SPECIES_HUMAN = 0;
+const float SPECIES_ROBOT_SOLID = 1;
+const float SPECIES_ALIEN = 2;
+const float SPECIES_ANIMAL = 3;
+const float SPECIES_ROBOT_RUSTY = 4;
+const float SPECIES_ROBOT_SHINY = 5;
+const float SPECIES_RESERVED = 15;
#define FRAGS_PLAYER 0
#define FRAGS_SPECTATOR -666
// we can use this frags value for both
// water levels
-float WATERLEVEL_NONE = 0;
-float WATERLEVEL_WETFEET = 1;
-float WATERLEVEL_SWIMMING = 2;
-float WATERLEVEL_SUBMERGED = 3;
+const float WATERLEVEL_NONE = 0;
+const float WATERLEVEL_WETFEET = 1;
+const float WATERLEVEL_SWIMMING = 2;
+const float WATERLEVEL_SUBMERGED = 3;
-float MAX_SHOT_DISTANCE = 32768;
+const float MAX_SHOT_DISTANCE = 32768;
// weapon requests
-float WR_SETUP = 1; // (SVQC) setup weapon data
-float WR_THINK = 2; // (SVQC) logic to run every frame
-float WR_CHECKAMMO1 = 3; // (SVQC) checks ammo for weapon
-float WR_CHECKAMMO2 = 4; // (SVQC) checks ammo for weapon
-float WR_AIM = 5; // (SVQC) runs bot aiming code for this weapon
-float WR_PRECACHE = 6; // (CSQC and SVQC) precaches models/sounds used by this weapon
-float WR_SUICIDEMESSAGE = 7; // (SVQC) notification number for suicide message (may inspect w_deathtype for details)
-float WR_KILLMESSAGE = 8; // (SVQC) notification number for kill message (may inspect w_deathtype for details)
-float WR_RELOAD = 9; // (SVQC) does not need to do anything
-float WR_RESETPLAYER = 10; // (SVQC) does not need to do anything
-float WR_IMPACTEFFECT = 11; // (CSQC) impact effect
-float WR_SWITCHABLE = 12; // (CSQC) impact effect
-float WR_PLAYERDEATH = 13; // (SVQC) does not need to do anything
-float WR_GONETHINK = 14; // (SVQC) logic to run every frame, also if no longer having the weapon as long as the switch away has not been performed
+const float WR_SETUP = 1; // (SVQC) setup weapon data
+const float WR_THINK = 2; // (SVQC) logic to run every frame
+const float WR_CHECKAMMO1 = 3; // (SVQC) checks ammo for weapon
+const float WR_CHECKAMMO2 = 4; // (SVQC) checks ammo for weapon
+const float WR_AIM = 5; // (SVQC) runs bot aiming code for this weapon
+const float WR_PRECACHE = 6; // (CSQC and SVQC) precaches models/sounds used by this weapon
+const float WR_SUICIDEMESSAGE = 7; // (SVQC) notification number for suicide message (may inspect w_deathtype for details)
+const float WR_KILLMESSAGE = 8; // (SVQC) notification number for kill message (may inspect w_deathtype for details)
+const float WR_RELOAD = 9; // (SVQC) does not need to do anything
+const float WR_RESETPLAYER = 10; // (SVQC) does not need to do anything
+const float WR_IMPACTEFFECT = 11; // (CSQC) impact effect
+const float WR_SWITCHABLE = 12; // (CSQC) impact effect
+const float WR_PLAYERDEATH = 13; // (SVQC) does not need to do anything
+const float WR_GONETHINK = 14; // (SVQC) logic to run every frame, also if no longer having the weapon as long as the switch away has not been performed
#define SERVERFLAG_ALLOW_FULLBRIGHT 1
#define SERVERFLAG_TEAMPLAY 2
#define PL_HEAD_z autocvar_sv_player_headsize_z
// spawnpoint prios
-#define SPAWN_PRIO_NEAR_TEAMMATE_FOUND 200
+#define SPAWN_PRIO_NEAR_TEAMMATE_FOUND 200
#define SPAWN_PRIO_NEAR_TEAMMATE_SAMETEAM 100
-#define SPAWN_PRIO_RACE_PREVIOUS_SPAWN 50
-#define SPAWN_PRIO_GOOD_DISTANCE 10
+#define SPAWN_PRIO_RACE_PREVIOUS_SPAWN 50
+#define SPAWN_PRIO_GOOD_DISTANCE 10
// URI handles
-#define URI_GET_DISCARD 0
-#define URI_GET_IPBAN 1
-#define URI_GET_IPBAN_END 16
-#define URI_GET_CURL 17
-#define URI_GET_CURL_END 32
-#define URI_GET_UPDATENOTIFICATION 33
-#define URI_GET_URLLIB 128
-#define URI_GET_URLLIB_END 191
+#define URI_GET_DISCARD 0
+#define URI_GET_IPBAN 1
+#define URI_GET_IPBAN_END 16
+#define URI_GET_CURL 17
+#define URI_GET_CURL_END 32
+#define URI_GET_UPDATENOTIFICATION 33
+#define URI_GET_URLLIB 128
+#define URI_GET_URLLIB_END 191
else { return ftos(deathtype); }
}
-float DEATH_WEAPONMASK = 0xFF;
-float DEATH_HITTYPEMASK = 0x1F00; // which is WAY below 10000 used for normal deaths
-float HITTYPE_SECONDARY = 0x100;
-float HITTYPE_SPLASH = 0x200; // automatically set by RadiusDamage
-float HITTYPE_BOUNCE = 0x400;
-float HITTYPE_RESERVED2 = 0x800;
-float HITTYPE_RESERVED = 0x1000; // unused yet
+const float DEATH_WEAPONMASK = 0xFF;
+const float DEATH_HITTYPEMASK = 0x1F00; // which is WAY below 10000 used for normal deaths
+const float HITTYPE_SECONDARY = 0x100;
+const float HITTYPE_SPLASH = 0x200; // automatically set by RadiusDamage
+const float HITTYPE_BOUNCE = 0x400;
+const float HITTYPE_RESERVED2 = 0x800;
+const float HITTYPE_RESERVED = 0x1000; // unused yet
entity weapon_info[WEP_MAXCOUNT];
entity dummy_weapon_info;
-void register_weapon(float id, float(float) func, float ammotype, float i, float weapontype, float pickupbasevalue, string modelname, string shortname, string wname)
+#if WEP_MAXCOUNT > 72
+# error Kein Weltraum links auf dem Gerät
+#endif
+
+WepSet WepSet_FromWeapon(float a) {
+ a -= WEP_FIRST;
+#if WEP_MAXCOUNT > 24
+ if(a >= 24) {
+ a -= 24;
+#if WEP_MAXCOUNT > 48
+ if(a >= 24) {
+ a -= 24;
+ return '0 0 1' * power2of(a);
+ }
+#endif
+ return '0 1 0' * power2of(a);
+ }
+#endif
+ return '1 0 0' * power2of(a);
+}
+#ifdef SVQC
+void WepSet_AddStat()
+{
+ addstat(STAT_WEAPONS, AS_INT, weapons_x);
+#if WEP_MAXCOUNT > 24
+ addstat(STAT_WEAPONS2, AS_INT, weapons_y);
+#if WEP_MAXCOUNT > 48
+ addstat(STAT_WEAPONS3, AS_INT, weapons_z);
+#endif
+#endif
+}
+void WriteWepSet(float dst, WepSet w)
+{
+#if WEP_MAXCOUNT > 48
+ WriteInt72_t(dst, w);
+#elif WEP_MAXCOUNT > 24
+ WriteInt48_t(dst, w);
+#else
+ WriteInt24_t(dst, w_x);
+#endif
+}
+#endif
+#ifdef CSQC
+WepSet WepSet_GetFromStat()
+{
+ WepSet w = '0 0 0';
+ w_x = getstati(STAT_WEAPONS);
+#if WEP_MAXCOUNT > 24
+ w_y = getstati(STAT_WEAPONS2);
+#if WEP_MAXCOUNT > 48
+ w_z = getstati(STAT_WEAPONS3);
+#endif
+#endif
+ return w;
+}
+WepSet ReadWepSet()
+{
+#if WEP_MAXCOUNT > 48
+ return ReadInt72_t();
+#elif WEP_MAXCOUNT > 24
+ return ReadInt48_t();
+#else
+ return ReadInt24_t() * '1 0 0';
+#endif
+}
+#endif
+
+void register_weapon(float id, WepSet bit, float(float) func, float ammotype, float i, float weapontype, float pickupbasevalue, string modelname, string shortname, string wname)
{
entity e;
weapon_info[id - 1] = e = spawn();
e.classname = "weapon_info";
e.weapon = id;
- WEPSET_COPY_EW(e, id);
+ e.weapons = bit;
e.netname = shortname;
e.message = wname;
e.items = ammotype;
dummy_weapon_info = spawn();
dummy_weapon_info.classname = "weapon_info";
dummy_weapon_info.weapon = 0; // you can recognize dummies by this
- WEPSET_CLEAR_E(dummy_weapon_info);
+ dummy_weapon_info.weapons = '0 0 0';
dummy_weapon_info.netname = "";
dummy_weapon_info.message = "AOL CD Thrower";
dummy_weapon_info.items = 0;
void W_RandomWeapons(entity e, float n)
{
float i, j;
- WEPSET_DECLARE_A(remaining);
- WEPSET_DECLARE_A(result);
- WEPSET_COPY_AE(remaining, e);
- WEPSET_CLEAR_A(result);
+ WepSet remaining;
+ WepSet result;
+ remaining = e.weapons;
+ result = '0 0 0';
for(i = 0; i < n; ++i)
{
RandomSelection_Init();
for(j = WEP_FIRST; j <= WEP_LAST; ++j)
- if(WEPSET_CONTAINS_AW(remaining, j))
+ if(remaining & WepSet_FromWeapon(j))
RandomSelection_Add(world, j, string_null, 1, 1);
- WEPSET_OR_AW(result, RandomSelection_chosen_float);
- WEPSET_ANDNOT_AW(remaining, RandomSelection_chosen_float);
+ result |= WepSet_FromWeapon(RandomSelection_chosen_float);
+ remaining &= ~WepSet_FromWeapon(RandomSelection_chosen_float);
}
- WEPSET_COPY_EA(e, result);
+ e.weapons = result;
}
string W_Name(float weaponid)
-float BOT_PICKUP_RATING_LOW = 2500;
-float BOT_PICKUP_RATING_MID = 5000;
-float BOT_PICKUP_RATING_HIGH = 10000;
-
-float WEP_TYPE_OTHER = 0x00; // not for damaging people
-float WEP_TYPE_SPLASH = 0x01; // splash damage
-float WEP_TYPE_HITSCAN = 0x02; // hitscan
-float WEP_TYPEMASK = 0x0F;
-float WEP_FLAG_CANCLIMB = 0x10; // can be used for movement
-float WEP_FLAG_NORMAL = 0x20; // in "most weapons" set
-float WEP_FLAG_HIDDEN = 0x40; // hides from menu
-float WEP_FLAG_RELOADABLE = 0x80; // can has reload
-float WEP_FLAG_SUPERWEAPON = 0x100; // powerup timer
-float WEP_FLAG_MUTATORBLOCKED = 0x200; // hides from impulse 99 etc. (mutators are allowed to clear this flag)
-
-float IT_UNLIMITED_WEAPON_AMMO = 1;
+const float BOT_PICKUP_RATING_LOW = 2500;
+const float BOT_PICKUP_RATING_MID = 5000;
+const float BOT_PICKUP_RATING_HIGH = 10000;
+
+const float WEP_TYPE_OTHER = 0x00; // not for damaging people
+const float WEP_TYPE_SPLASH = 0x01; // splash damage
+const float WEP_TYPE_HITSCAN = 0x02; // hitscan
+const float WEP_TYPEMASK = 0x0F;
+const float WEP_FLAG_CANCLIMB = 0x10; // can be used for movement
+const float WEP_FLAG_NORMAL = 0x20; // in "most weapons" set
+const float WEP_FLAG_HIDDEN = 0x40; // hides from menu
+const float WEP_FLAG_RELOADABLE = 0x80; // can has reload
+const float WEP_FLAG_SUPERWEAPON = 0x100; // powerup timer
+const float WEP_FLAG_MUTATORBLOCKED = 0x200; // hides from impulse 99 etc. (mutators are allowed to clear this flag)
+
+const float IT_UNLIMITED_WEAPON_AMMO = 1;
// when this bit is set, using a weapon does not reduce ammo. Checkpoints can give this powerup.
-float IT_UNLIMITED_SUPERWEAPONS = 2;
+const float IT_UNLIMITED_SUPERWEAPONS = 2;
// when this bit is set, superweapons don't expire. Checkpoints can give this powerup.
-float IT_CTF_SHIELDED = 4; // set for the flag shield
-float IT_USING_JETPACK = 8; // confirmation that button is pressed
-float IT_JETPACK = 16; // actual item
-float IT_FUEL_REGEN = 32; // fuel regeneration trigger
-float IT_SHELLS = 256;
-float IT_NAILS = 512;
-float IT_ROCKETS = 1024;
-float IT_CELLS = 2048;
-float IT_SUPERWEAPON = 4096;
-float IT_FUEL = 128;
-float IT_STRENGTH = 8192;
-float IT_INVINCIBLE = 16384;
-float IT_HEALTH = 32768;
+const float IT_CTF_SHIELDED = 4; // set for the flag shield
+const float IT_USING_JETPACK = 8; // confirmation that button is pressed
+const float IT_JETPACK = 16; // actual item
+const float IT_FUEL_REGEN = 32; // fuel regeneration trigger
+WANT_CONST float IT_SHELLS = 256;
+WANT_CONST float IT_NAILS = 512;
+WANT_CONST float IT_ROCKETS = 1024;
+WANT_CONST float IT_CELLS = 2048;
+const float IT_SUPERWEAPON = 4096;
+const float IT_FUEL = 128;
+const float IT_STRENGTH = 8192;
+const float IT_INVINCIBLE = 16384;
+const float IT_HEALTH = 32768;
// union:
// for items:
- float IT_KEY1 = 131072;
- float IT_KEY2 = 262144;
+ WANT_CONST float IT_KEY1 = 131072;
+ WANT_CONST float IT_KEY2 = 262144;
// for players:
- float IT_RED_FLAG_TAKEN = 32768;
- float IT_RED_FLAG_LOST = 65536;
- float IT_RED_FLAG_CARRYING = 98304;
- float IT_BLUE_FLAG_TAKEN = 131072;
- float IT_BLUE_FLAG_LOST = 262144;
- float IT_BLUE_FLAG_CARRYING = 393216;
+ const float IT_RED_FLAG_TAKEN = 32768;
+ const float IT_RED_FLAG_LOST = 65536;
+ const float IT_RED_FLAG_CARRYING = 98304;
+ const float IT_BLUE_FLAG_TAKEN = 131072;
+ const float IT_BLUE_FLAG_LOST = 262144;
+ const float IT_BLUE_FLAG_CARRYING = 393216;
// end
-float IT_5HP = 524288;
-float IT_25HP = 1048576;
-float IT_ARMOR_SHARD = 2097152;
-float IT_ARMOR = 4194304;
+const float IT_5HP = 524288;
+const float IT_25HP = 1048576;
+const float IT_ARMOR_SHARD = 2097152;
+const float IT_ARMOR = 4194304;
-float IT_AMMO = 3968; // IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS | IT_FUEL;
-float IT_PICKUPMASK = 51; // IT_FUEL_REGEN | IT_JETPACK | IT_UNLIMITED_AMMO; // strength and invincible are handled separately
-float IT_UNLIMITED_AMMO = 3; // IT_UNLIMITED_SUPERWEAPONS | IT_UNLIMITED_WEAPON_AMMO;
+const float IT_AMMO = 3968; // IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS | IT_FUEL;
+const float IT_PICKUPMASK = 51; // IT_FUEL_REGEN | IT_JETPACK | IT_UNLIMITED_AMMO; // strength and invincible are handled separately
+const float IT_UNLIMITED_AMMO = 3; // IT_UNLIMITED_SUPERWEAPONS | IT_UNLIMITED_WEAPON_AMMO;
-float AMMO_COUNT = 4; // amount of ammo types to show in the inventory panel
+const float AMMO_COUNT = 4; // amount of ammo types to show in the inventory panel
// variables:
string weaponorder_byid;
.float ammo_fuel;
.float ammo_batteries; // dummy
+// Weapon sets
+typedef vector WepSet;
+WepSet WepSet_FromWeapon(float a);
+#ifdef SVQC
+void WepSet_AddStat();
+void WriteWepSet(float dest, WepSet w);
+#endif
+#ifdef CSQC
+WepSet WepSet_GetFromStat();
+WepSet ReadWepSet();
+#endif
+
+// Weapon name macros
+#define WEP_FIRST 1
+#define WEP_MAXCOUNT 24 // Increase as needed. Can be up to three times as much.
+float WEP_COUNT;
+float WEP_LAST;
+WepSet WEPSET_ALL;
+WepSet WEPSET_SUPERWEAPONS;
+
// entity properties of weaponinfo:
.float weapon; // WEP_...
+.WepSet weapons; // WEPSET_...
.string netname; // short name
.string message; // human readable name
.float items; // IT_...
.float bot_pickupbasevalue; // bot weapon priority
.string model2; // wpn- sprite name
..float ammo_field; // main ammo field
-// also, weaponinfo ents can act as a WEPSET
// dynamic weapon adding
float w_null(float dummy);
-void register_weapon(float id, float(float) func, float ammotype, float i, float weapontype, float pickupbasevalue, string modelname, string shortname, string wname);
+void register_weapon(float id, WepSet bit, float(float) func, float ammotype, float i, float weapontype, float pickupbasevalue, string modelname, string shortname, string wname);
void register_weapons_done();
-#define WEP_FIRST 1
-float WEP_COUNT;
-float WEP_LAST;
-
-#if 1
-# define WEP_MAXCOUNT 24
-// default storage
-.float _WS_weapons;
-# define WEPSET_BIT(a) power2of((a) - WEP_FIRST)
-# define WEPSET_DECLARE_A(a) float _WS_##a
-# define WEPSET_CLEAR_E(e) ((e)._WS_weapons = 0)
-# define WEPSET_CLEAR_A(a) (_WS_##a = 0)
-# define WEPSET_EMPTY_E(e) ((e)._WS_weapons == 0)
-# define WEPSET_EMPTY_A(a) (_WS_##a == 0)
-# define WEPSET_COPY_AS(a) (_WS_##a = getstati(STAT_WEAPONS))
-# define WEPSET_ADDSTAT() addstat(STAT_WEAPONS, AS_INT, _WS_weapons)
-# define WEPSET_WRITE_E(dest,a) WriteInt24_t(dest, (a)._WS_weapons)
-# define WEPSET_WRITE_A(dest,a) WriteInt24_t(dest, _WS_##a)
-# define WEPSET_WRITE_W(dest,a) WriteInt24_t(dest, WEPSET_BIT(a))
-# define WEPSET_READ_E(a) (a)._WS_weapons = ReadInt24_t()
-# define WEPSET_READ_A(a) (_WS_##a) = ReadInt24_t()
-# define WEPSET_OP1_EE(a,b,mergeop,x) ((a)._WS_weapons x (b)._WS_weapons)
-# define WEPSET_OP2_EE(a,b,mergeop,x,y) ((a)._WS_weapons x (b)._WS_weapons y (a)._WS_weapons)
-# define WEPSET_OP1_EA(a,b,mergeop,x) ((a)._WS_weapons x _WS_##b)
-# define WEPSET_OP2_EA(a,b,mergeop,x,y) ((a)._WS_weapons x _WS_##b y (a)._WS_weapons)
-# define WEPSET_OP1_EW(a,b,mergeop,x) ((a)._WS_weapons x WEPSET_BIT(b))
-# define WEPSET_OP2_EW(a,b,mergeop,x,y) ((a)._WS_weapons x WEPSET_BIT(b) y (a)._WS_weapons)
-# define WEPSET_OP1_AE(a,b,mergeop,x) (_WS_##a x (b)._WS_weapons)
-# define WEPSET_OP2_AE(a,b,mergeop,x,y) (_WS_##a x (b)._WS_weapons y _WS_##a)
-# define WEPSET_OP1_AA(a,b,mergeop,x) (_WS_##a x _WS_##b)
-# define WEPSET_OP2_AA(a,b,mergeop,x,y) (_WS_##a x _WS_##b y _WS_##a)
-# define WEPSET_OP1_AW(a,b,mergeop,x) (_WS_##a x WEPSET_BIT(b))
-# define WEPSET_OP2_AW(a,b,mergeop,x,y) (_WS_##a x WEPSET_BIT(b) y _WS_##a)
-#else
-# define WEP_MAXCOUNT 48
-# define WEP_FIRST2 25
-.float _WS1_weapons;
-.float _WS2_weapons;
-# define WEPSET_BIT1(a) (((a) < WEP_FIRST2) ? power2of((a) - WEP_FIRST) : 0)
-# define WEPSET_BIT2(a) (((a) >= WEP_FIRST2) ? power2of((a) - WEP_FIRST2) : 0)
-# define WEPSET_DECLARE_A(a) float _WS1_##a, _WS2_##a
-# define WEPSET_CLEAR_E(e) ((e)._WS1_weapons = (e)._WS2_weapons = 0)
-# define WEPSET_CLEAR_A(a) ((_WS1_##a) = (_WS2_##a) = 0)
-# define WEPSET_EMPTY_E(e) ((e)._WS1_weapons == 0 && (e)._WS2_weapons == 0)
-# define WEPSET_EMPTY_A(a) ((_WS1_##a) == 0 && (_WS2_##a) == 0)
-# define WEPSET_COPY_AS(a) ((_WS1_##a) = getstati(STAT_WEAPONS), (_WS2_##a) = getstati(STAT_WEAPONS2))
-# define WEPSET_ADDSTAT() addstat(STAT_WEAPONS, AS_INT, _WS1_weapons); addstat(STAT_WEAPONS2, AS_INT, _WS2_weapons)
-# define WEPSET_WRITE_E(dest,a) WriteInt24_t(dest, (a)._WS1_weapons); WriteInt24_t(dest, (a)._WS2_weapons)
-# define WEPSET_WRITE_A(dest,a) WriteInt24_t(dest, _WS1_##a); WriteInt24_t(dest, _WS2_##a)
-# define WEPSET_WRITE_W(dest,a) WriteInt24_t(dest, WEPSET_BIT1(a)); WriteInt24_t(dest, WEPSET_BIT2(a))
-# define WEPSET_READ_E(a) (a)._WS1_weapons = ReadInt24_t(); (a)._WS2_weapons = ReadInt24_t()
-# define WEPSET_READ_A(a) (_WS1_##a) = ReadInt24_t(); (_WS2_##a) = ReadInt24_t()
-# define WEPSET_OP1_EE(a,b,mergeop,x) (((a)._WS1_weapons x (b)._WS1_weapons) mergeop ((a)._WS2_weapons x (b)._WS2_weapons))
-# define WEPSET_OP2_EE(a,b,mergeop,x,y) (((a)._WS1_weapons x (b)._WS1_weapons y (a)._WS1_weapons) mergeop ((a)._WS2_weapons x (b)._WS2_weapons y (a)._WS2_weapons))
-# define WEPSET_OP1_EA(a,b,mergeop,x) (((a)._WS1_weapons x _WS1_##b) mergeop ((a)._WS2_weapons x _WS2_##b))
-# define WEPSET_OP2_EA(a,b,mergeop,x,y) (((a)._WS1_weapons x _WS1_##b y (a)._WS1_weapons) mergeop ((a)._WS2_weapons x _WS2_##b y (a)._WS2_weapons))
-# define WEPSET_OP1_EW(a,b,mergeop,x) (((a)._WS1_weapons x WEPSET_BIT1(b)) mergeop ((a)._WS2_weapons x WEPSET_BIT2(b)))
-# define WEPSET_OP2_EW(a,b,mergeop,x,y) (((a)._WS1_weapons x WEPSET_BIT1(b) y (a)._WS1_weapons) mergeop ((a)._WS2_weapons x WEPSET_BIT2(b) y (a)._WS2_weapons))
-# define WEPSET_OP1_AE(a,b,mergeop,x) ((_WS1_##a x (b)._WS1_weapons) mergeop (_WS2_##a x (b)._WS2_weapons))
-# define WEPSET_OP2_AE(a,b,mergeop,x,y) ((_WS1_##a x (b)._WS1_weapons y _WS1_##a) mergeop (_WS2_##a x (b)._WS2_weapons y _WS2_##a))
-# define WEPSET_OP1_AA(a,b,mergeop,x) ((_WS1_##a x _WS1_##b) mergeop (_WS2_##a x _WS2_##b))
-# define WEPSET_OP2_AA(a,b,mergeop,x,y) ((_WS1_##a x _WS1_##b y _WS1_##a) mergeop (_WS2_##a x _WS2_##b y _WS2_##a))
-# define WEPSET_OP1_AW(a,b,mergeop,x) ((_WS1_##a x WEPSET_BIT1(b)) mergeop (_WS2_##a x WEPSET_BIT2(b)))
-# define WEPSET_OP2_AW(a,b,mergeop,x,y) ((_WS1_##a x WEPSET_BIT1(b) y _WS1_##a) mergeop (_WS2_##a x WEPSET_BIT2(b) y _WS2_##a))
-#endif
-
-#define XX ,
-
-#define WEPSET_COPY_EE(a,b) WEPSET_OP1_EE(a,b,XX,=)
-#define WEPSET_EQ_EE(a,b) WEPSET_OP1_EE(a,b,&&,==)
-#define WEPSET_OR_EE(a,b) WEPSET_OP1_EE(a,b,XX,|=)
-#define WEPSET_AND_EE(a,b) WEPSET_OP2_EE(a,b,XX,=,&)
-#define WEPSET_ANDNOT_EE(a,b) WEPSET_OP1_EE(a,b,XX,&~=)
-#define WEPSET_CONTAINS_ANY_EE(a,b) !!(WEPSET_OP1_EE(a,b,||,&))
-#define WEPSET_CONTAINS_ALL_EE(a,b) WEPSET_OP2_EE(b,a,&&,==,&)
-
-#define WEPSET_COPY_EA(a,b) WEPSET_OP1_EA(a,b,XX,=)
-#define WEPSET_EQ_EA(a,b) WEPSET_OP1_EA(a,b,&&,==)
-#define WEPSET_OR_EA(a,b) WEPSET_OP1_EA(a,b,XX,|=)
-#define WEPSET_AND_EA(a,b) WEPSET_OP2_EA(a,b,XX,=,&)
-#define WEPSET_ANDNOT_EA(a,b) WEPSET_OP1_EA(a,b,XX,&~=)
-#define WEPSET_CONTAINS_ANY_EA(a,b) !!(WEPSET_OP1_EA(a,b,||,&))
-#define WEPSET_CONTAINS_ALL_EA(a,b) WEPSET_OP2_EA(b,a,&&,==,&)
-
-#define WEPSET_COPY_EW(a,b) WEPSET_OP1_EW(a,b,XX,=)
-#define WEPSET_EQ_EW(a,b) WEPSET_OP1_EW(a,b,&&,==)
-#define WEPSET_OR_EW(a,b) WEPSET_OP1_EW(a,b,XX,|=)
-#define WEPSET_AND_EW(a,b) WEPSET_OP2_EW(a,b,XX,=,&)
-#define WEPSET_ANDNOT_EW(a,b) WEPSET_OP1_EW(a,b,XX,&~=)
-#define WEPSET_CONTAINS_EW(a,b) !!(WEPSET_OP1_EW(a,b,||,&))
-
-#define WEPSET_COPY_AE(a,b) WEPSET_OP1_AE(a,b,XX,=)
-#define WEPSET_EQ_AE(a,b) WEPSET_OP1_AE(a,b,&&,==)
-#define WEPSET_OR_AE(a,b) WEPSET_OP1_AE(a,b,XX,|=)
-#define WEPSET_AND_AE(a,b) WEPSET_OP2_AE(a,b,XX,=,&)
-#define WEPSET_ANDNOT_AE(a,b) WEPSET_OP1_AE(a,b,XX,&~=)
-#define WEPSET_CONTAINS_ANY_AE(a,b) !!(WEPSET_OP1_AE(a,b,||,&))
-#define WEPSET_CONTAINS_ALL_AE(a,b) WEPSET_OP2_AE(b,a,&&,==,&)
-
-#define WEPSET_COPY_AA(a,b) WEPSET_OP1_AA(a,b,XX,=)
-#define WEPSET_EQ_AA(a,b) WEPSET_OP1_AA(a,b,&&,==)
-#define WEPSET_OR_AA(a,b) WEPSET_OP1_AA(a,b,XX,|=)
-#define WEPSET_AND_AA(a,b) WEPSET_OP2_AA(a,b,XX,=,&)
-#define WEPSET_ANDNOT_AA(a,b) WEPSET_OP1_AA(a,b,XX,&~=)
-#define WEPSET_CONTAINS_ANY_AA(a,b) !!(WEPSET_OP1_AA(a,b,||,&))
-#define WEPSET_CONTAINS_ALL_AA(a,b) WEPSET_OP2_AA(b,a,&&,==,&)
-
-#define WEPSET_COPY_AW(a,b) WEPSET_OP1_AW(a,b,XX,=)
-#define WEPSET_EQ_AW(a,b) WEPSET_OP1_AW(a,b,&&,==)
-#define WEPSET_OR_AW(a,b) WEPSET_OP1_AW(a,b,XX,|=)
-#define WEPSET_AND_AW(a,b) WEPSET_OP2_AW(a,b,XX,=,&)
-#define WEPSET_ANDNOT_AW(a,b) WEPSET_OP1_AW(a,b,XX,&~=)
-#define WEPSET_CONTAINS_AW(a,b) !!(WEPSET_OP1_AW(a,b,||,&))
-
-WEPSET_DECLARE_A(WEPBIT_ALL);
-WEPSET_DECLARE_A(WEPBIT_SUPERWEAPONS);
-// note: the fabs call is just there to hide "if result is constant" warning
-#define REGISTER_WEAPON_2(id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname) \
+#define REGISTER_WEAPON_2(id,bit,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname) \
float id; \
+ WepSet bit; \
float func(float); \
void RegisterWeapons_##id() \
{ \
WEP_LAST = (id = WEP_FIRST + WEP_COUNT); \
- WEPSET_OR_AW(WEPBIT_ALL, id); \
- if(fabs(weapontype & WEP_FLAG_SUPERWEAPON)) \
- WEPSET_OR_AW(WEPBIT_SUPERWEAPONS, id); \
+ bit = WepSet_FromWeapon(id); \
+ WEPSET_ALL |= bit; \
+ if((weapontype) & WEP_FLAG_SUPERWEAPON) \
+ WEPSET_SUPERWEAPONS |= bit; \
++WEP_COUNT; \
- register_weapon(id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname); \
+ register_weapon(id,bit,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname); \
} \
ACCUMULATE_FUNCTION(RegisterWeapons, RegisterWeapons_##id)
#ifdef MENUQC
#define REGISTER_WEAPON(id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname) \
- REGISTER_WEAPON_2(WEP_##id,w_null,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname)
+ REGISTER_WEAPON_2(WEP_##id,WEPSET_##id,w_null,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname)
#else
#define REGISTER_WEAPON(id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname) \
- REGISTER_WEAPON_2(WEP_##id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname)
+ REGISTER_WEAPON_2(WEP_##id,WEPSET_##id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname)
#endif
#include "../server/w_all.qc"
if(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_RACE)
if(!spawnplaces)
{
- MapInfo_Map_supportedGametypes &~= MAPINFO_TYPE_RACE;
+ MapInfo_Map_supportedGametypes &= ~MAPINFO_TYPE_RACE;
MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_CTS;
}
REGISTER_GAMETYPE(_("Keepaway"),ka,g_keepaway,KEEPAWAY,"timelimit=20 pointlimit=30")
#define g_keepaway IS_GAMETYPE(KEEPAWAY)
-float MAPINFO_FEATURE_WEAPONS = 1; // not defined for minstagib-only maps
-float MAPINFO_FEATURE_VEHICLES = 2;
-float MAPINFO_FEATURE_TURRETS = 4;
+const float MAPINFO_FEATURE_WEAPONS = 1; // not defined for minstagib-only maps
+const float MAPINFO_FEATURE_VEHICLES = 2;
+const float MAPINFO_FEATURE_TURRETS = 4;
-float MAPINFO_FLAG_HIDDEN = 1; // not in lsmaps/menu/vcall/etc., can just be changed to manually
-float MAPINFO_FLAG_FORBIDDEN = 2; // don't even allow the map by a cvar setting that allows hidden maps
-float MAPINFO_FLAG_FRUSTRATING = 4; // this map is near impossible to play, enable at your own risk
+const float MAPINFO_FLAG_HIDDEN = 1; // not in lsmaps/menu/vcall/etc., can just be changed to manually
+const float MAPINFO_FLAG_FORBIDDEN = 2; // don't even allow the map by a cvar setting that allows hidden maps
+const float MAPINFO_FLAG_FRUSTRATING = 4; // this map is near impossible to play, enable at your own risk
float MapInfo_count;
*/
#define MSG_ANNCE_NOTIFICATIONS \
- MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_AIRSHOT, CH_INFO, "airshot", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_AMAZING, CH_INFO, "amazing", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_AWESOME, CH_INFO, "awesome", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_BOTLIKE, CH_INFO, "botlike", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(2, ANNCE_ACHIEVEMENT_ELECTROBITCH, CH_INFO, "electrobitch", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_IMPRESSIVE, CH_INFO, "impressive", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_YODA, CH_INFO, "yoda", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(2, ANNCE_BEGIN, CH_INFO, "begin", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_03, CH_INFO, "03kills", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_05, CH_INFO, "05kills", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_10, CH_INFO, "10kills", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_15, CH_INFO, "15kills", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_20, CH_INFO, "20kills", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_25, CH_INFO, "25kills", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_30, CH_INFO, "30kills", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(1, ANNCE_MINSTAGIB_LASTSECOND, CH_INFO, "lastsecond", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(1, ANNCE_MINSTAGIB_NARROWLY, CH_INFO, "narrowly", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(1, ANNCE_MINSTAGIB_TERMINATED, CH_INFO, "terminated", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(0, ANNCE_MULTIFRAG, CH_INFO, "multifrag", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(2, ANNCE_NUM_1, CH_INFO, "1", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(2, ANNCE_NUM_2, CH_INFO, "2", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(2, ANNCE_NUM_3, CH_INFO, "3", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(2, ANNCE_NUM_4, CH_INFO, "4", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(2, ANNCE_NUM_5, CH_INFO, "5", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(2, ANNCE_NUM_6, CH_INFO, "6", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(2, ANNCE_NUM_7, CH_INFO, "7", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(2, ANNCE_NUM_8, CH_INFO, "8", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(2, ANNCE_NUM_9, CH_INFO, "9", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(2, ANNCE_NUM_10, CH_INFO, "10", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(2, ANNCE_PREPARE, CH_INFO, "prepareforbattle", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(1, ANNCE_REMAINING_FRAG_1, CH_INFO, "1fragleft", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(1, ANNCE_REMAINING_FRAG_2, CH_INFO, "2fragsleft", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(1, ANNCE_REMAINING_FRAG_3, CH_INFO, "3fragsleft", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(2, ANNCE_REMAINING_MIN_1, CH_INFO, "1minuteremains", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(2, ANNCE_REMAINING_MIN_5, CH_INFO, "5minutesremain", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(2, ANNCE_TIMEOUT, CH_INFO, "timeoutcalled", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(2, ANNCE_VOTE_ACCEPT, CH_INFO, "voteaccept", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(2, ANNCE_VOTE_CALL, CH_INFO, "votecall", VOL_BASEVOICE, ATTN_NONE) \
- MSG_ANNCE_NOTIF(2, ANNCE_VOTE_FAIL, CH_INFO, "votefail", VOL_BASEVOICE, ATTN_NONE)
+ MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_AIRSHOT, CH_INFO, "airshot", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_AMAZING, CH_INFO, "amazing", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_AWESOME, CH_INFO, "awesome", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_BOTLIKE, CH_INFO, "botlike", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_ACHIEVEMENT_ELECTROBITCH, CH_INFO, "electrobitch", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_IMPRESSIVE, CH_INFO, "impressive", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_YODA, CH_INFO, "yoda", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_BEGIN, CH_INFO, "begin", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_03, CH_INFO, "03kills", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_05, CH_INFO, "05kills", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_10, CH_INFO, "10kills", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_15, CH_INFO, "15kills", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_20, CH_INFO, "20kills", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_25, CH_INFO, "25kills", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_30, CH_INFO, "30kills", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(1, ANNCE_MINSTAGIB_LASTSECOND, CH_INFO, "lastsecond", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(1, ANNCE_MINSTAGIB_NARROWLY, CH_INFO, "narrowly", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(1, ANNCE_MINSTAGIB_TERMINATED, CH_INFO, "terminated", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(0, ANNCE_MULTIFRAG, CH_INFO, "multifrag", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_NUM_1, CH_INFO, "1", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_NUM_2, CH_INFO, "2", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_NUM_3, CH_INFO, "3", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_NUM_4, CH_INFO, "4", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_NUM_5, CH_INFO, "5", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_NUM_6, CH_INFO, "6", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_NUM_7, CH_INFO, "7", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_NUM_8, CH_INFO, "8", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_NUM_9, CH_INFO, "9", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_NUM_10, CH_INFO, "10", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_PREPARE, CH_INFO, "prepareforbattle", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(1, ANNCE_REMAINING_FRAG_1, CH_INFO, "1fragleft", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(1, ANNCE_REMAINING_FRAG_2, CH_INFO, "2fragsleft", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(1, ANNCE_REMAINING_FRAG_3, CH_INFO, "3fragsleft", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_REMAINING_MIN_1, CH_INFO, "1minuteremains", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_REMAINING_MIN_5, CH_INFO, "5minutesremain", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_TIMEOUT, CH_INFO, "timeoutcalled", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_VOTE_ACCEPT, CH_INFO, "voteaccept", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_VOTE_CALL, CH_INFO, "votecall", VOL_BASEVOICE, ATTEN_NONE) \
+ MSG_ANNCE_NOTIF(2, ANNCE_VOTE_FAIL, CH_INFO, "votefail", VOL_BASEVOICE, ATTEN_NONE)
#define MULTITEAM_INFO(default,prefix,teams,strnum,flnum,args,hudargs,icon,normal,gentle) \
MSG_INFO_NOTIF(default, prefix##RED, strnum, flnum, args, hudargs, sprintf(icon, strtolower(STATIC_NAME_TEAM_1)), TCR(normal, COL_TEAM_1, strtoupper(NAME_TEAM_1)), TCR(gentle, COL_TEAM_1, strtoupper(NAME_TEAM_1))) \
-float URL_READY_ERROR = -1;
-float URL_READY_CLOSED = 0;
-float URL_READY_CANWRITE = 1;
-float URL_READY_CANREAD = 2;
+const float URL_READY_ERROR = -1;
+const float URL_READY_CLOSED = 0;
+const float URL_READY_CANWRITE = 1;
+const float URL_READY_CANREAD = 2;
// errors: -1, or negative HTTP status code
typedef void(entity handle, entity pass, float status) url_ready_func;
#ifdef FTEQCC
#ifdef WATERMARK
-string FTEQCC_SUCKS_WATERMARKS_THROUGH_C60_FULLERENES = WATERMARK();
+const string FTEQCC_SUCKS_WATERMARKS_THROUGH_C60_FULLERENES = WATERMARK();
#undef WATERMARK
#define WATERMARK FTEQCC_SUCKS_WATERMARKS_THROUGH_C60_FULLERENES
#endif
return sprintf("%.*f", decimals, number);
}
-float time;
vector colormapPaletteColor(float c, float isPants)
{
switch(c)
v += ReadByte(); // note: this is unsigned
return v;
}
+vector ReadInt48_t()
+{
+ vector v;
+ v_x = ReadInt24_t();
+ v_y = ReadInt24_t();
+ v_z = 0;
+ return v;
+}
+vector ReadInt72_t()
+{
+ vector v;
+ v_x = ReadInt24_t();
+ v_y = ReadInt24_t();
+ v_z = ReadInt24_t();
+ return v;
+}
#else
void WriteInt24_t(float dst, float val)
{
WriteShort(dst, (v = floor(val / 256)));
WriteByte(dst, val - v * 256); // 0..255
}
+void WriteInt48_t(float dst, vector val)
+{
+ WriteInt24_t(dst, val_x);
+ WriteInt24_t(dst, val_y);
+}
+void WriteInt72_t(float dst, vector val)
+{
+ WriteInt24_t(dst, val_x);
+ WriteInt24_t(dst, val_y);
+ WriteInt24_t(dst, val_z);
+}
#endif
#endif
float lowestbit(float f)
{
- f &~= f * 2;
- f &~= f * 4;
- f &~= f * 16;
- f &~= f * 256;
- f &~= f * 65536;
+ f &= ~(f * 2);
+ f &= ~(f * 4);
+ f &= ~(f * 16);
+ f &= ~(f * 256);
+ f &= ~(f * 65536);
return f;
}
+#define WANT_CONST
+// commonly used, but better make them macros
+#define TRUE 1
+#define FALSE 0
+
// a dummy macro that prevents the "hanging ;" warning
#define ENDS_WITH_CURLY_BRACE
float power2of(float e);
float log2of(float x);
-string HEXDIGITS = "0123456789ABCDEF0123456789abcdef";
+const string HEXDIGITS = "0123456789ABCDEF0123456789abcdef";
#define HEXDIGIT_TO_DEC_RAW(d) (strstrofs(HEXDIGITS, (d), 0))
#define HEXDIGIT_TO_DEC(d) ((HEXDIGIT_TO_DEC_RAW(d) | 0x10) - 0x10)
#define DEC_TO_HEXDIGIT(d) (substring(HEXDIGITS, (d), 1))
#ifndef MENUQC
#ifdef CSQC
float ReadInt24_t();
+vector ReadInt48_t();
+vector ReadInt72_t();
#else
void WriteInt24_t(float dest, float val);
+void WriteInt48_t(float dest, vector val);
+void WriteInt72_t(float dest, vector val);
#endif
#endif
root = root.tag_entity;
if(self != root)
{
- self.renderflags &~= RF_EXTERNALMODEL | RF_VIEWMODEL;
+ self.renderflags &= ~(RF_EXTERNALMODEL | RF_VIEWMODEL);
self.renderflags |= (root.renderflags & (RF_EXTERNALMODEL | RF_VIEWMODEL));
}
#endif
self.renderflags |= RF_EXTERNALMODEL;
else
- self.renderflags &~= RF_EXTERNALMODEL;
+ self.renderflags &= ~RF_EXTERNALMODEL;
// draw it
self.drawmask = MASK_NORMAL;
// get crouch state from the server
if(getstati(STAT_VIEWHEIGHT) == PL_VIEW_OFS_z)
- self.pmove_flags &~= PMF_DUCKED;
+ self.pmove_flags &= ~PMF_DUCKED;
else if(getstati(STAT_VIEWHEIGHT) == PL_CROUCH_VIEW_OFS_z)
self.pmove_flags |= PMF_DUCKED;
if(pmove_onground)
self.pmove_flags |= PMF_ONGROUND;
else
- self.pmove_flags &~= PMF_ONGROUND;
+ self.pmove_flags &= ~PMF_ONGROUND;
CSQCPlayer_SetMinsMaxs();
else
{
float flg = self.iflags;
- self.iflags &~= IFLAG_ORIGIN | IFLAG_ANGLES;
+ self.iflags &= ~(IFLAG_ORIGIN | IFLAG_ANGLES);
InterpolateOrigin_Do();
self.iflags = flg;
// get crouch state from the server
if(getstati(STAT_VIEWHEIGHT) == PL_VIEW_OFS_z)
- self.pmove_flags &~= PMF_DUCKED;
+ self.pmove_flags &= ~PMF_DUCKED;
else if(getstati(STAT_VIEWHEIGHT) == PL_CROUCH_VIEW_OFS_z)
self.pmove_flags |= PMF_DUCKED;
if(pmove_onground)
self.pmove_flags |= PMF_ONGROUND;
else
- self.pmove_flags &~= PMF_ONGROUND;
+ self.pmove_flags &= ~PMF_ONGROUND;
CSQCPlayer_SavePrediction();
}
#ifdef CSQCMODEL_SERVERSIDE_CROUCH
// get crouch state from the server (LAG)
if(getstati(STAT_VIEWHEIGHT) == PL_VIEW_OFS_z)
- self.pmove_flags &~= PMF_DUCKED;
+ self.pmove_flags &= ~PMF_DUCKED;
else if(getstati(STAT_VIEWHEIGHT) == PL_CROUCH_VIEW_OFS_z)
self.pmove_flags |= PMF_DUCKED;
#endif
.float itime1, itime2;
void InterpolateOrigin_Reset()
{
- self.iflags &~= IFLAG_INTERNALMASK;
+ self.iflags &= ~IFLAG_INTERNALMASK;
self.itime1 = self.itime2 = 0;
}
void InterpolateOrigin_Note()
if(self.iflags & IFLAG_TELEPORTED)
{
- self.iflags &~= IFLAG_TELEPORTED;
+ self.iflags &= ~IFLAG_TELEPORTED;
self.itime1 = self.itime2 = time; // don't lerp
}
else if(vlen(self.iorigin2 - self.iorigin1) > 1000)
if(self.effects & EF_RESTARTANIM_BIT)
{
self.SendFlags |= CSQCMODEL_PROPERTY_FRAME | CSQCMODEL_PROPERTY_FRAME2; // full anim resend please
- self.effects &~= EF_RESTARTANIM_BIT;
+ self.effects &= ~EF_RESTARTANIM_BIT;
}
if(self.effects & EF_TELEPORT_BIT)
{
self.SendFlags |= CSQCMODEL_PROPERTY_TELEPORTED; // no interpolation please
- self.effects &~= EF_TELEPORT_BIT;
+ self.effects &= ~EF_TELEPORT_BIT;
}
#define CSQCMODEL_IF(cond) if(cond) {
void(entity e, string m) setmodel = #3;
void(entity e, vector min, vector max) setsize = #4;
-void() break_builtin = #6;
+void() break_to_debugger = #6;
float() random = #7;
void(entity e, float chan, string samp) sound = #8;
vector(vector v) normalize = #9;
//- NOTE: to check for this, ALSO OR a check with DP_SND_SOUND7 to also support
// the finished extension once done
-//DP_MOVETYPEFLYWORLDONLY
-//idea: Samual
-//darkplaces implementation: Samual
-//movetype definitions:
-float MOVETYPE_FLY_WORLDONLY = 33;
-//description:
-//like MOVETYPE_FLY, but does all traces with MOVE_WORLDONLY, and is ignored by MOVETYPE_PUSH. Should only be combined with SOLID_NOT and SOLID_TRIGGER.
-
//DP_PRECACHE_PIC_FLAGS
//idea: divVerent
//darkplaces implementation: divVerent
float K_SCROLLLOCK = 156;
float K_KP_0 = 157;
-float K_KP_INS = K_KP_0;
+float K_KP_INS = 157; // same as K_KP_0
float K_KP_1 = 158;
-float K_KP_END = K_KP_1;
+float K_KP_END = 158; // same as K_KP_1
float K_KP_2 = 159;
-float K_KP_DOWNARROW = K_KP_2;
+float K_KP_DOWNARROW = 159; // same as K_KP_2
float K_KP_3 = 160;
-float K_KP_PGDN = K_KP_3;
+float K_KP_PGDN = 160; // same as K_KP_3
float K_KP_4 = 161;
-float K_KP_LEFTARROW = K_KP_4;
+float K_KP_LEFTARROW = 161; // same as K_KP_4
float K_KP_5 = 162;
float K_KP_6 = 163;
-float K_KP_RIGHTARROW = K_KP_6;
+float K_KP_RIGHTARROW = 163; // same as K_KP_6
float K_KP_7 = 164;
-float K_KP_HOME = K_KP_7;
+float K_KP_HOME = 164; // same as K_KP_7
float K_KP_8 = 165;
-float K_KP_UPARROW = K_KP_8;
+float K_KP_UPARROW = 165; // same as K_KP_8
float K_KP_9 = 166;
-float K_KP_PGUP = K_KP_9;
+float K_KP_PGUP = 166; // same as K_KP_9
float K_KP_PERIOD = 167;
-float K_KP_DEL = K_KP_PERIOD;
+float K_KP_DEL = 167; // same as K_KP_PERIOD
float K_KP_DIVIDE = 168;
-float K_KP_SLASH = K_KP_DIVIDE;
+float K_KP_SLASH = 168; // same as K_KP_DIVIDE
float K_KP_MULTIPLY = 169;
float K_KP_MINUS = 170;
float K_KP_PLUS = 171;
float ERR_NULLSTRING = -1;
float ERR_BADDRAWFLAG = -2;
float ERR_BADSCALE = -3;
-float ERR_BADSIZE = ERR_BADSCALE;
+float ERR_BADSIZE = -3; // same as ERR_BADSCALE
float ERR_NOTCACHED = -4;
// server list stuff
void(entity e, string m) setmodel = #3; // set movetype and solid first
void(entity e, vector min, vector max) setsize = #4;
// #5 was removed
-void() break_builtin = #6;
+void() break_to_debugger = #6;
float() random = #7; // returns 0 - 1
void(entity e, float chan, string samp, float vol, float atten) sound = #8;
vector(vector v) normalize = #9;
vector draw_shift;
vector draw_scale;
float draw_alpha;
-vector draw_fontscale;
void draw_reset(float cw, float ch, float ox, float oy);
void draw_beginBoldFont();
}
}
-float MENU_ASPECT = 1.25; // 1280x1024
-float MENU_MINHEIGHT = 600;
+const float MENU_ASPECT = 1.25; // 1280x1024
+const float MENU_MINHEIGHT = 600;
float conwidth_s, conheight_s, realconwidth, realconheight, screenconwidth, screenconheight;
void draw_reset_cropped()
{
if(key == K_SHIFT) menuShiftState |= S_SHIFT;
}
-float SCALEMODE_CROP = 0;
-float SCALEMODE_LETTERBOX = 1;
-float SCALEMODE_WIDTH = 2;
-float SCALEMODE_HEIGHT = 3;
-float SCALEMODE_STRETCH = 4;
+const float SCALEMODE_CROP = 0;
+const float SCALEMODE_LETTERBOX = 1;
+const float SCALEMODE_WIDTH = 2;
+const float SCALEMODE_HEIGHT = 3;
+const float SCALEMODE_STRETCH = 4;
void draw_Picture_Aligned(vector algn, float scalemode, string img, float a)
{
vector sz, org, isz, isz_w, isz_h;
if(me.checked)
{
if(me.cvarPart == 1)
- cvar_set(me.cvarName, ftos(cvar(me.cvarName) & 15 + me.cvarValueFloat * 16));
+ cvar_set(me.cvarName, ftos((cvar(me.cvarName) & 15) + me.cvarValueFloat * 16));
else
- cvar_set(me.cvarName, ftos(cvar(me.cvarName) & 240 + me.cvarValueFloat));
+ cvar_set(me.cvarName, ftos((cvar(me.cvarName) & 240) + me.cvarValueFloat));
}
// TODO on an apply button, read _cl_color and execute the color command for it
}
METHOD(XonoticDialog, configureDialog, void(entity))
ENDCLASS(XonoticDialog)
+#ifndef IMPLEMENTATION
entity currentDialog;
#endif
+#endif
#ifdef IMPLEMENTATION
void XonoticDialog_configureDialog(entity me)
w = get_weaponinfo(i);
if(w.spawnflags & WEP_FLAG_HIDDEN)
continue;
- if(j & 1 == 0)
+ if((j & 1) == 0)
me.TR(me);
me.TDempty(me, 0.2);
me.TD(me, 1, 1.8, e = makeXonoticWeaponarenaCheckBox(strzone(w.netname), strzone(w.message)));
#ifdef IMPLEMENTATION
-string KEY_NOT_BOUND_CMD = "// not bound";
+const string KEY_NOT_BOUND_CMD = "// not bound";
#define MAX_KEYS_PER_FUNCTION 2
#define MAX_KEYBINDS 256
ATTRIB(XonoticServerList, seenIPv6, float, 0)
ENDCLASS(XonoticServerList)
entity makeXonoticServerList();
+
void ServerList_Connect_Click(entity btn, entity me);
void ServerList_ShowEmpty_Click(entity box, entity me);
void ServerList_ShowFull_Click(entity box, entity me);
void ServerList_Info_Click(entity btn, entity me);
void ServerList_Update_favoriteButton(entity btn, entity me);
+#ifndef IMPLEMENTATION
float SLIST_FIELD_CNAME;
float SLIST_FIELD_PING;
float SLIST_FIELD_GAME;
float SLIST_FIELD_ISFAVORITE;
#endif
+#endif
+
#ifdef IMPLEMENTATION
void ServerList_UpdateFieldIDs()
{
if (self.bot_nextthink > time)
return;
- self.flags &~= FL_GODMODE;
+ self.flags &= ~FL_GODMODE;
if(autocvar_bot_god)
self.flags |= FL_GODMODE;
* Globals and Fields
*/
-float AI_STATUS_ROAMING = 1; // Bot is just crawling the map. No enemies at sight
-float AI_STATUS_ATTACKING = 2; // There are enemies at sight
-float AI_STATUS_RUNNING = 4; // Bot is bunny hopping
-float AI_STATUS_DANGER_AHEAD = 8; // There is lava/slime/trigger_hurt ahead
-float AI_STATUS_OUT_JUMPPAD = 16; // Trying to get out of a "vertical" jump pad
-float AI_STATUS_OUT_WATER = 32; // Trying to get out of water
-float AI_STATUS_WAYPOINT_PERSONAL_LINKING = 64; // Waiting for the personal waypoint to be linked
-float AI_STATUS_WAYPOINT_PERSONAL_GOING = 128; // Going to a personal waypoint
-float AI_STATUS_WAYPOINT_PERSONAL_REACHED = 256; // Personal waypoint reached
-float AI_STATUS_JETPACK_FLYING = 512;
-float AI_STATUS_JETPACK_LANDING = 1024;
-float AI_STATUS_STUCK = 2048; // Cannot reach any goal
+const float AI_STATUS_ROAMING = 1; // Bot is just crawling the map. No enemies at sight
+const float AI_STATUS_ATTACKING = 2; // There are enemies at sight
+const float AI_STATUS_RUNNING = 4; // Bot is bunny hopping
+const float AI_STATUS_DANGER_AHEAD = 8; // There is lava/slime/trigger_hurt ahead
+const float AI_STATUS_OUT_JUMPPAD = 16; // Trying to get out of a "vertical" jump pad
+const float AI_STATUS_OUT_WATER = 32; // Trying to get out of water
+const float AI_STATUS_WAYPOINT_PERSONAL_LINKING = 64; // Waiting for the personal waypoint to be linked
+const float AI_STATUS_WAYPOINT_PERSONAL_GOING = 128; // Going to a personal waypoint
+const float AI_STATUS_WAYPOINT_PERSONAL_REACHED = 256; // Personal waypoint reached
+const float AI_STATUS_JETPACK_FLYING = 512;
+const float AI_STATUS_JETPACK_LANDING = 1024;
+const float AI_STATUS_STUCK = 2048; // Cannot reach any goal
.float isbot; // true if this client is actually a bot
.float aistatus;
// if we don't have a goal and we're under water look for a waypoint near the "shore" and push it
if(self.deadflag != DEAD_NO)
if(self.goalcurrent==world)
- if(self.waterlevel==WATERLEVEL_SWIMMING || self.aistatus & AI_STATUS_OUT_WATER)
+ if(self.waterlevel==WATERLEVEL_SWIMMING || (self.aistatus & AI_STATUS_OUT_WATER))
{
// Look for the closest waypoint out of water
entity newgoal, head;
if (self.bot_aimtarg)
{
self.aistatus |= AI_STATUS_ATTACKING;
- self.aistatus &~= AI_STATUS_ROAMING;
+ self.aistatus &= ~AI_STATUS_ROAMING;
- if(!WEPSET_EMPTY_E(self))
+ if(self.weapons)
{
weapon_action(self.weapon, WR_AIM);
if (autocvar_bot_nofire || IS_INDEPENDENT_PLAYER(self))
else if (self.goalcurrent)
{
self.aistatus |= AI_STATUS_ROAMING;
- self.aistatus &~= AI_STATUS_ATTACKING;
+ self.aistatus &= ~AI_STATUS_ATTACKING;
vector now,v,next;//,heading;
float aimdistance,skillblend,distanceblend,blend;
//heading = self.velocity;
//dprint(self.goalstack01.classname,etos(self.goalstack01),"\n");
if(
- self.goalstack01 != self && self.goalstack01 != world && self.aistatus & AI_STATUS_RUNNING == 0 &&
+ self.goalstack01 != self && self.goalstack01 != world && ((self.aistatus & AI_STATUS_RUNNING) == 0) &&
!(self.goalcurrent.wpflags & WAYPOINTFLAG_TELEPORT)
)
next = ((self.goalstack01.absmin + self.goalstack01.absmax) * 0.5) - (self.origin + self.view_ofs);
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
{
e = get_weaponinfo(i);
- if (WEPSET_CONTAINS_EW(self, i) && (e.spawnflags & WEP_FLAG_RELOADABLE) && (self.weapon_load[i] < cvar(strcat("g_balance_", e.netname, "_reload_ammo"))))
+ if ((self.weapons & WepSet_FromWeapon(i)) && (e.spawnflags & WEP_FLAG_RELOADABLE) && (self.weapon_load[i] < cvar(strcat("g_balance_", e.netname, "_reload_ammo"))))
self.switchweapon = i;
}
}
if(self.aistatus & AI_STATUS_DANGER_AHEAD)
{
- self.aistatus &~= AI_STATUS_RUNNING;
+ self.aistatus &= ~AI_STATUS_RUNNING;
self.BUTTON_JUMP = FALSE;
self.bot_canruntogoal = 0;
self.bot_timelastseengoal = 0;
if(self.waterlevel > WATERLEVEL_WETFEET)
{
- self.aistatus &~= AI_STATUS_RUNNING;
+ self.aistatus &= ~AI_STATUS_RUNNING;
return;
}
if(checkdistance)
{
- self.aistatus &~= AI_STATUS_RUNNING;
+ self.aistatus &= ~AI_STATUS_RUNNING;
if(bunnyhopdistance > autocvar_bot_ai_bunnyhop_stopdistance)
self.BUTTON_JUMP = TRUE;
}
#if 0
// Release jump button
if(!cvar("sv_pogostick"))
- if(self.flags & FL_ONGROUND == 0)
+ if((self.flags & FL_ONGROUND) == 0)
{
if(self.velocity_z < 0 || vlen(self.velocity)<maxspeed)
self.BUTTON_JUMP = FALSE;
}
// Switch to normal mode
self.navigation_jetpack_goal = world;
- self.aistatus &~= AI_STATUS_JETPACK_LANDING;
- self.aistatus &~= AI_STATUS_JETPACK_FLYING;
+ self.aistatus &= ~AI_STATUS_JETPACK_LANDING;
+ self.aistatus &= ~AI_STATUS_JETPACK_FLYING;
return;
}
}
else if(checkpvs(self.origin,self.goalcurrent))
{
// If I can see the goal switch to landing code
- self.aistatus &~= AI_STATUS_JETPACK_FLYING;
+ self.aistatus &= ~AI_STATUS_JETPACK_FLYING;
self.aistatus |= AI_STATUS_JETPACK_LANDING;
return;
}
self.ignoregoaltime = time + autocvar_bot_ai_ignoregoal_timeout;
navigation_clearroute();
navigation_routetogoal(newgoal, self.origin);
- self.aistatus &~= AI_STATUS_OUT_JUMPPAD;
+ self.aistatus &= ~AI_STATUS_OUT_JUMPPAD;
}
}
else
}
}
else if(self.aistatus & AI_STATUS_OUT_JUMPPAD)
- self.aistatus &~= AI_STATUS_OUT_JUMPPAD;
+ self.aistatus &= ~AI_STATUS_OUT_JUMPPAD;
// If there is a trigger_hurt right below try to use the jetpack or make a rocketjump
if(skill>6)
else
{
if(self.aistatus & AI_STATUS_OUT_WATER)
- self.aistatus &~= AI_STATUS_OUT_WATER;
+ self.aistatus &= ~AI_STATUS_OUT_WATER;
// jump if going toward an obstacle that doesn't look like stairs we
// can walk up directly
// Check for water/slime/lava and dangerous edges
// (only when the bot is on the ground or jumping intentionally)
- self.aistatus &~= AI_STATUS_DANGER_AHEAD;
+ self.aistatus &= ~AI_STATUS_DANGER_AHEAD;
if(trace_fraction == 1 && self.jumppadcount == 0 && !self.goalcurrent.wphardwired )
- if(self.flags & FL_ONGROUND || self.aistatus & AI_STATUS_RUNNING || self.BUTTON_JUMP == TRUE)
+ if((self.flags & FL_ONGROUND) || (self.aistatus & AI_STATUS_RUNNING) || self.BUTTON_JUMP == TRUE)
{
// Look downwards
traceline(dst_ahead , dst_down, TRUE, world);
// I want to do a second scan if no enemy was found or I don't have weapons
// TODO: Perform the scan when using the rifle (requires changes on the rifle code)
- if(best || !WEPSET_EMPTY_E(self)) // || self.weapon == WEP_RIFLE
+ if(best || self.weapons) // || self.weapon == WEP_RIFLE
break;
if(i)
break;
float i;
// ;)
- if(WEPSET_EQ_AW(g_weaponarena_weapons, WEP_TUBA))
+ if(g_weaponarena_weapons == WEPSET_TUBA)
{
self.switchweapon = WEP_TUBA;
return;
if(self.havocbot_personal_waypoint==world)
{
dprint("Error: ", self.netname, " trying to walk to a non existent personal waypoint\n");
- self.aistatus &~= AI_STATUS_WAYPOINT_PERSONAL_GOING;
+ self.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_GOING;
return CMD_STATUS_ERROR;
}
if(self.havocbot_personal_waypoint_failcounter >= 30)
{
dprint("Warning: can't walk to the personal waypoint located at ", vtos(self.havocbot_personal_waypoint.origin),"\n");
- self.aistatus &~= AI_STATUS_WAYPOINT_PERSONAL_LINKING;
+ self.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_LINKING;
remove(self.havocbot_personal_waypoint);
return CMD_STATUS_ERROR;
}
// Step 5: Waypoint reached
dprint(self.netname, "'s personal waypoint reached\n");
remove(self.havocbot_personal_waypoint);
- self.aistatus &~= AI_STATUS_WAYPOINT_PERSONAL_REACHED;
+ self.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_REACHED;
return CMD_STATUS_FINISHED;
}
}
self.havocbot_personal_waypoint_searchtime = time; // so we set the route next frame
- self.aistatus &~= AI_STATUS_WAYPOINT_PERSONAL_LINKING;
+ self.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_LINKING;
self.aistatus |= AI_STATUS_WAYPOINT_PERSONAL_GOING;
// Step 3: Route to waypoint
for(i = WEP_FIRST; i <= WEP_LAST ; ++i)
{
// Find weapon
- if(WEPSET_CONTAINS_EW(self, i))
+ if(self.weapons & WepSet_FromWeapon(i))
if(++c>=4)
break;
}
{
// gather health and armor only
if (head.solid)
- if ( ((head.health || head.armorvalue) && needarmor) || (!WEPSET_EMPTY_E(head) && needweapons ) )
+ if ( ((head.health || head.armorvalue) && needarmor) || (head.weapons && needweapons ) )
if (vlen(head.origin - org) < sradius)
{
t = head.bot_pickupevalfunc(self, head);
if( head.armorvalue && player.armorvalue > self.armorvalue)
continue;
- if( !WEPSET_EMPTY_E(head) )
- if( !WEPSET_CONTAINS_ALL_EE(player, head) )
+ if( head.weapons )
+ if( head.weapons & ~player.weapons )
continue;
if (head.ammo_shells && player.ammo_shells > self.ammo_shells)
continue;
*/
- if(head.flags & FL_INWATER || head.flags & FL_PARTIALGROUND)
+ if((head.flags & FL_INWATER) || (head.flags & FL_PARTIALGROUND))
continue;
// not falling
- if(head.flags & FL_ONGROUND == 0)
+ if((head.flags & FL_ONGROUND) == 0)
{
traceline(head.origin, head.origin + '0 0 -1500', TRUE, world);
t = pointcontents(trace_endpos + '0 0 1');
if(self.aistatus & AI_STATUS_WAYPOINT_PERSONAL_GOING)
if(self.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL && self.goalcurrent.owner==self)
{
- self.aistatus &~= AI_STATUS_WAYPOINT_PERSONAL_GOING;
+ self.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_GOING;
self.aistatus |= AI_STATUS_WAYPOINT_PERSONAL_REACHED;
}
navigation_poproute();
if(self.aistatus & AI_STATUS_WAYPOINT_PERSONAL_GOING)
if(self.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL && self.goalcurrent.owner==self)
{
- self.aistatus &~= AI_STATUS_WAYPOINT_PERSONAL_GOING;
+ self.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_GOING;
self.aistatus |= AI_STATUS_WAYPOINT_PERSONAL_REACHED;
}
if(self.aistatus & AI_STATUS_WAYPOINT_PERSONAL_GOING)
if(self.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL && self.goalcurrent.owner==self)
{
- self.aistatus &~= AI_STATUS_WAYPOINT_PERSONAL_GOING;
+ self.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_GOING;
self.aistatus |= AI_STATUS_WAYPOINT_PERSONAL_REACHED;
}
bot_debug(strcat(self.netname, " stuck, reachable waypoint found, heading to it\n"));
navigation_routetogoal(bot_waypoint_queue_bestgoal, self.origin);
self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
- self.aistatus &~= AI_STATUS_STUCK;
+ self.aistatus &= ~AI_STATUS_STUCK;
}
else
{
.entity navigation_jetpack_goal;
.vector navigation_jetpack_point;
-float DEBUG_NODE_SUCCESS = 1;
-float DEBUG_NODE_WARNING = 2;
-float DEBUG_NODE_FAIL = 3;
+const float DEBUG_NODE_SUCCESS = 1;
+const float DEBUG_NODE_WARNING = 2;
+const float DEBUG_NODE_FAIL = 3;
vector debuglastnode;
entity bot_waypoint_queue_owner; // Owner of the temporary list of goals
float bot_cmd_continue()
{
- self.bot_exec_status &~= BOT_EXEC_STATUS_PAUSED;
+ self.bot_exec_status &= ~BOT_EXEC_STATUS_PAUSED;
return CMD_STATUS_FINISHED;
}
{
if(time>=self.bot_cmd_wait_time)
{
- self.bot_exec_status &~= BOT_EXEC_STATUS_WAITING;
+ self.bot_exec_status &= ~BOT_EXEC_STATUS_WAITING;
return CMD_STATUS_FINISHED;
}
else
self.bot_exec_status |= BOT_EXEC_STATUS_WAITING;
return CMD_STATUS_EXECUTING;
}
- self.bot_exec_status &~= BOT_EXEC_STATUS_WAITING;
+ self.bot_exec_status &= ~BOT_EXEC_STATUS_WAITING;
return CMD_STATUS_FINISHED;
}
float bot_cmd_else()
{
- self.bot_cmd_condition_status &~= CMD_CONDITION_TRUE_BLOCK;
+ self.bot_cmd_condition_status &= ~CMD_CONDITION_TRUE_BLOCK;
self.bot_cmd_condition_status |= CMD_CONDITION_FALSE_BLOCK;
return CMD_STATUS_FINISHED;
}
if(enabled)
{
self.bot_cmd_keys |= BOT_CMD_KEY_FORWARD;
- self.bot_cmd_keys &~= BOT_CMD_KEY_BACKWARD;
+ self.bot_cmd_keys &= ~BOT_CMD_KEY_BACKWARD;
}
else
- self.bot_cmd_keys &~= BOT_CMD_KEY_FORWARD;
+ self.bot_cmd_keys &= ~BOT_CMD_KEY_FORWARD;
break;
case "backward":
if(enabled)
{
self.bot_cmd_keys |= BOT_CMD_KEY_BACKWARD;
- self.bot_cmd_keys &~= BOT_CMD_KEY_FORWARD;
+ self.bot_cmd_keys &= ~BOT_CMD_KEY_FORWARD;
}
else
- self.bot_cmd_keys &~= BOT_CMD_KEY_BACKWARD;
+ self.bot_cmd_keys &= ~BOT_CMD_KEY_BACKWARD;
break;
case "left":
if(enabled)
{
self.bot_cmd_keys |= BOT_CMD_KEY_LEFT;
- self.bot_cmd_keys &~= BOT_CMD_KEY_RIGHT;
+ self.bot_cmd_keys &= ~BOT_CMD_KEY_RIGHT;
}
else
- self.bot_cmd_keys &~= BOT_CMD_KEY_LEFT;
+ self.bot_cmd_keys &= ~BOT_CMD_KEY_LEFT;
break;
case "right":
if(enabled)
{
self.bot_cmd_keys |= BOT_CMD_KEY_RIGHT;
- self.bot_cmd_keys &~= BOT_CMD_KEY_LEFT;
+ self.bot_cmd_keys &= ~BOT_CMD_KEY_LEFT;
}
else
- self.bot_cmd_keys &~= BOT_CMD_KEY_RIGHT;
+ self.bot_cmd_keys &= ~BOT_CMD_KEY_RIGHT;
break;
case "jump":
if(enabled)
self.bot_cmd_keys |= BOT_CMD_KEY_JUMP;
else
- self.bot_cmd_keys &~= BOT_CMD_KEY_JUMP;
+ self.bot_cmd_keys &= ~BOT_CMD_KEY_JUMP;
break;
case "crouch":
if(enabled)
self.bot_cmd_keys |= BOT_CMD_KEY_CROUCH;
else
- self.bot_cmd_keys &~= BOT_CMD_KEY_CROUCH;
+ self.bot_cmd_keys &= ~BOT_CMD_KEY_CROUCH;
break;
case "attack1":
if(enabled)
self.bot_cmd_keys |= BOT_CMD_KEY_ATTACK1;
else
- self.bot_cmd_keys &~= BOT_CMD_KEY_ATTACK1;
+ self.bot_cmd_keys &= ~BOT_CMD_KEY_ATTACK1;
break;
case "attack2":
if(enabled)
self.bot_cmd_keys |= BOT_CMD_KEY_ATTACK2;
else
- self.bot_cmd_keys &~= BOT_CMD_KEY_ATTACK2;
+ self.bot_cmd_keys &= ~BOT_CMD_KEY_ATTACK2;
break;
case "use":
if(enabled)
self.bot_cmd_keys |= BOT_CMD_KEY_USE;
else
- self.bot_cmd_keys &~= BOT_CMD_KEY_USE;
+ self.bot_cmd_keys &= ~BOT_CMD_KEY_USE;
break;
case "hook":
if(enabled)
self.bot_cmd_keys |= BOT_CMD_KEY_HOOK;
else
- self.bot_cmd_keys &~= BOT_CMD_KEY_HOOK;
+ self.bot_cmd_keys &= ~BOT_CMD_KEY_HOOK;
break;
case "chat":
if(enabled)
self.bot_cmd_keys |= BOT_CMD_KEY_CHAT;
else
- self.bot_cmd_keys &~= BOT_CMD_KEY_CHAT;
+ self.bot_cmd_keys &= ~BOT_CMD_KEY_CHAT;
break;
default:
break;
string sample = f;
float chan = CH_WEAPON_B;
float vol = VOL_BASE;
- float atten = ATTN_MIN;
+ float atten = ATTEN_MIN;
if(n >= 1)
sample = argv(n - 1);
* Globals and Fields
*/
-float WAYPOINTFLAG_GENERATED = 8388608;
-float WAYPOINTFLAG_ITEM = 4194304;
-float WAYPOINTFLAG_TELEPORT = 2097152;
-float WAYPOINTFLAG_NORELINK = 1048576;
-float WAYPOINTFLAG_PERSONAL = 524288;
+const float WAYPOINTFLAG_GENERATED = 8388608;
+const float WAYPOINTFLAG_ITEM = 4194304;
+const float WAYPOINTFLAG_TELEPORT = 2097152;
+const float WAYPOINTFLAG_NORELINK = 1048576;
+const float WAYPOINTFLAG_PERSONAL = 524288;
// fields you can query using prvm_global server to get some statistics about waypoint linking culling
float relink_total, relink_walkculled, relink_pvsculled, relink_lengthculled;
self.personal.ammo_fuel = self.ammo_fuel;
self.personal.health = self.health;
self.personal.armorvalue = self.armorvalue;
- WEPSET_COPY_EE(self.personal, self);
+ self.personal.weapons = self.weapons;
self.personal.items = self.items;
self.personal.pauserotarmor_finished = self.pauserotarmor_finished;
self.personal.pauserothealth_finished = self.pauserothealth_finished;
self.ammo_fuel = self.personal.ammo_fuel;
self.health = self.personal.health;
self.armorvalue = self.personal.armorvalue;
- WEPSET_COPY_EE(self, self.personal);
+ self.weapons = self.personal.weapons;
self.items = self.personal.items;
self.pauserotarmor_finished = time + self.personal.pauserotarmor_finished - self.personal.teleport_time;
self.pauserothealth_finished = time + self.personal.pauserothealth_finished - self.personal.teleport_time;
e = self;
pointparticles(particleeffectnum("rocket_explode"), e.origin, '0 0 0', 1);
- sound(e, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ sound(e, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
e2 = spawn();
setorigin(e2, e.origin);
draggee.draggravity = draggee.gravity;
draggee.movetype = MOVETYPE_WALK;
draggee.gravity = 0.00001;
- draggee.flags &~= FL_ONGROUND;
+ draggee.flags &= ~FL_ONGROUND;
draggee.draggedby = dragger;
dragger.dragentity = draggee;
entity draggee;
draggee = dragger.dragentity;
- draggee.flags &~= FL_ONGROUND;
+ draggee.flags &= ~FL_ONGROUND;
curorigin = gettaginfo(draggee, 0);
curorigin = curorigin + v_forward * dragger.draglocalvector_x + v_right * dragger.draglocalvector_y + v_up * dragger.draglocalvector_z;
setorigin (self, (spot.origin + PL_VIEW_OFS)); // offset it so that the spectator spawns higher off the ground, looks better this way
self.prevorigin = self.origin;
self.items = 0;
- WEPSET_CLEAR_E(self);
+ self.weapons = '0 0 0';
self.model = "";
FixPlayermodel();
setmodel(self, "null");
self.ammo_fuel = warmup_start_ammo_fuel;
self.health = warmup_start_health;
self.armorvalue = warmup_start_armorvalue;
- WEPSET_COPY_EA(self, warmup_start_weapons);
+ self.weapons = warmup_start_weapons;
}
else
{
self.ammo_fuel = start_ammo_fuel;
self.health = start_health;
self.armorvalue = start_armorvalue;
- WEPSET_COPY_EA(self, start_weapons);
+ self.weapons = start_weapons;
}
- if(WEPSET_CONTAINS_ANY_EA(self, WEPBIT_SUPERWEAPONS)) // exception for minstagib, as minstanex is a superweapon
+ if(self.weapons & WEPSET_SUPERWEAPONS)
self.superweapons_finished = time + autocvar_g_balance_superweapons_time;
else
self.superweapons_finished = 0;
if(g_weaponarena_random)
{
if(g_weaponarena_random_with_laser)
- WEPSET_ANDNOT_EW(self, WEP_LASER);
+ self.weapons &= ~WEPSET_LASER;
W_RandomWeapons(self, g_weaponarena_random);
if(g_weaponarena_random_with_laser)
- WEPSET_OR_EW(self, WEP_LASER);
+ self.weapons |= WEPSET_LASER;
}
self.items = start_items;
Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_MOTD, getwelcomemessage());
}
- if(autocvar_g_bugrigs || WEPSET_EQ_AW(g_weaponarena_weapons, WEP_TUBA))
+ if(autocvar_g_bugrigs || (g_weaponarena_weapons == WEPSET_TUBA))
stuffcmd(self, "cl_cmd settemp chase_active 1\n");
}
// Here, everything has been done that requires this player to be a client.
- self.flags &~= FL_CLIENT;
+ self.flags &= ~FL_CLIENT;
if (self.chatbubbleentity)
remove (self.chatbubbleentity);
if(IS_REAL_CLIENT(self))
if(floor(finished - time - frametime) != floor(finished - time))
if(finished - time < 6)
- sound (self, CH_INFO, samp, VOL_BASE, ATTN_NORM);
+ sound (self, CH_INFO, samp, VOL_BASE, ATTEN_NORM);
}
void player_powerups (void)
if((self.items & IT_USING_JETPACK) && !self.deadflag)
self.modelflags |= MF_ROCKET;
else
- self.modelflags &~= MF_ROCKET;
+ self.modelflags &= ~MF_ROCKET;
- self.effects &~= (EF_RED | EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT | EF_FLAME | EF_NODEPTHTEST);
+ self.effects &= ~(EF_RED | EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT | EF_FLAME | EF_NODEPTHTEST);
if((self.alpha < 0 || self.deadflag) && !self.vehicle) // don't apply the flags if the player is gibbed
return;
}
if (self.items & IT_SUPERWEAPON)
{
- if (!WEPSET_CONTAINS_ANY_EA(self, WEPBIT_SUPERWEAPONS))
+ if (!(self.weapons & WEPSET_SUPERWEAPONS))
{
self.superweapons_finished = 0;
self.items = self.items - (self.items & IT_SUPERWEAPON);
if (time > self.superweapons_finished)
{
self.items = self.items - (self.items & IT_SUPERWEAPON);
- WEPSET_ANDNOT_EA(self, WEPBIT_SUPERWEAPONS);
+ self.weapons &= ~WEPSET_SUPERWEAPONS;
//Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_SUPERWEAPON_BROKEN, self.netname);
Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_SUPERWEAPON_BROKEN);
}
}
}
- else if(WEPSET_CONTAINS_ANY_EA(self, WEPBIT_SUPERWEAPONS))
+ else if(self.weapons & WEPSET_SUPERWEAPONS)
{
if (time < self.superweapons_finished || (self.items & IT_UNLIMITED_SUPERWEAPONS))
{
else
{
self.superweapons_finished = 0;
- WEPSET_ANDNOT_EA(self, WEPBIT_SUPERWEAPONS);
+ self.weapons &= ~WEPSET_SUPERWEAPONS;
}
}
else
}
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_fuel = CalcRotRegen(self.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, regen_mod * frametime * (time > self.pauseregen_finished) * (self.items & IT_FUEL_REGEN != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, rot_mod * frametime * (time > self.pauserotfuel_finished), limitf);
+ self.ammo_fuel = CalcRotRegen(self.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, regen_mod * frametime * (time > self.pauseregen_finished) * ((self.items & IT_FUEL_REGEN) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, rot_mod * frametime * (time > self.pauserotfuel_finished), limitf);
}
float zoomstate_set;
if (self.movement_x > 0) // get if movement keys are pressed
{ // forward key pressed
self.pressedkeys |= KEY_FORWARD;
- self.pressedkeys &~= KEY_BACKWARD;
+ self.pressedkeys &= ~KEY_BACKWARD;
}
else if (self.movement_x < 0)
{ // backward key pressed
self.pressedkeys |= KEY_BACKWARD;
- self.pressedkeys &~= KEY_FORWARD;
+ self.pressedkeys &= ~KEY_FORWARD;
}
else
{ // no x input
- self.pressedkeys &~= KEY_FORWARD;
- self.pressedkeys &~= KEY_BACKWARD;
+ self.pressedkeys &= ~KEY_FORWARD;
+ self.pressedkeys &= ~KEY_BACKWARD;
}
if (self.movement_y > 0)
{ // right key pressed
self.pressedkeys |= KEY_RIGHT;
- self.pressedkeys &~= KEY_LEFT;
+ self.pressedkeys &= ~KEY_LEFT;
}
else if (self.movement_y < 0)
{ // left key pressed
self.pressedkeys |= KEY_LEFT;
- self.pressedkeys &~= KEY_RIGHT;
+ self.pressedkeys &= ~KEY_RIGHT;
}
else
{ // no y input
- self.pressedkeys &~= KEY_RIGHT;
- self.pressedkeys &~= KEY_LEFT;
+ self.pressedkeys &= ~KEY_RIGHT;
+ self.pressedkeys &= ~KEY_LEFT;
}
if (self.BUTTON_JUMP) // get if jump and crouch keys are pressed
self.pressedkeys |= KEY_JUMP;
else
- self.pressedkeys &~= KEY_JUMP;
+ self.pressedkeys &= ~KEY_JUMP;
if (self.BUTTON_CROUCH)
self.pressedkeys |= KEY_CROUCH;
else
- self.pressedkeys &~= KEY_CROUCH;
+ self.pressedkeys &= ~KEY_CROUCH;
if (self.BUTTON_ATCK)
self.pressedkeys |= KEY_ATCK;
else
- self.pressedkeys &~= KEY_ATCK;
+ self.pressedkeys &= ~KEY_ATCK;
if (self.BUTTON_ATCK2)
self.pressedkeys |= KEY_ATCK2;
else
- self.pressedkeys &~= KEY_ATCK2;
+ self.pressedkeys &= ~KEY_ATCK2;
}
/*
self.strength_finished = spectatee.strength_finished;
self.invincible_finished = spectatee.invincible_finished;
self.pressedkeys = spectatee.pressedkeys;
- WEPSET_COPY_EE(self, spectatee);
+ self.weapons = spectatee.weapons;
self.switchweapon = spectatee.switchweapon;
self.switchingweapon = spectatee.switchingweapon;
self.weapon = spectatee.weapon;
float prefered_movetype;
if (self.flags & FL_JUMPRELEASED) {
if (self.BUTTON_JUMP && !self.version_mismatch) {
- self.flags &~= FL_JUMPRELEASED;
+ self.flags &= ~FL_JUMPRELEASED;
self.flags |= FL_SPAWNING;
} else if(self.BUTTON_ATCK && !self.version_mismatch) {
- self.flags &~= FL_JUMPRELEASED;
+ self.flags &= ~FL_JUMPRELEASED;
if(SpectateNext()) {
self.classname = "spectator";
}
self.flags |= FL_JUMPRELEASED;
if(self.flags & FL_SPAWNING)
{
- self.flags &~= FL_SPAWNING;
+ self.flags &= ~FL_SPAWNING;
LeaveSpectatorMode();
return;
}
{
if (self.flags & FL_JUMPRELEASED) {
if (self.BUTTON_JUMP && !self.version_mismatch) {
- self.flags &~= FL_JUMPRELEASED;
+ self.flags &= ~FL_JUMPRELEASED;
self.flags |= FL_SPAWNING;
- } else if(self.BUTTON_ATCK || self.impulse == 10 || self.impulse == 15 || self.impulse == 18 || self.impulse >= 200 && self.impulse <= 209) {
- self.flags &~= FL_JUMPRELEASED;
+ } else if(self.BUTTON_ATCK || self.impulse == 10 || self.impulse == 15 || self.impulse == 18 || (self.impulse >= 200 && self.impulse <= 209)) {
+ self.flags &= ~FL_JUMPRELEASED;
if(SpectateNext()) {
self.classname = "spectator";
} else {
PutClientInServer();
}
self.impulse = 0;
- } else if(self.impulse == 12 || self.impulse == 16 || self.impulse == 19 || self.impulse >= 220 && self.impulse <= 229) {
- self.flags &~= FL_JUMPRELEASED;
+ } else if(self.impulse == 12 || self.impulse == 16 || self.impulse == 19 || (self.impulse >= 220 && self.impulse <= 229)) {
+ self.flags &= ~FL_JUMPRELEASED;
if(SpectatePrev()) {
self.classname = "spectator";
} else {
}
self.impulse = 0;
} else if (self.BUTTON_ATCK2) {
- self.flags &~= FL_JUMPRELEASED;
+ self.flags &= ~FL_JUMPRELEASED;
self.classname = "observer";
PutClientInServer();
} else {
self.flags |= FL_JUMPRELEASED;
if(self.flags & FL_SPAWNING)
{
- self.flags &~= FL_SPAWNING;
+ self.flags &= ~FL_SPAWNING;
LeaveSpectatorMode();
return;
}
// LordHavoc: allow firing on move frames (sub-ticrate), this gives better timing on slow servers
//if(frametime)
{
- self.items &~= self.items_added;
+ self.items &= ~self.items_added;
W_WeaponFrame();
for(e = findchain(classname, "waypoint"); e; e = e.chain)
{
e.colormod = '0.5 0.5 0.5';
- e.effects &~= EF_NODEPTHTEST | EF_RED | EF_BLUE;
+ e.effects &= ~(EF_NODEPTHTEST | EF_RED | EF_BLUE);
}
e2 = navigation_findnearestwaypoint(self, FALSE);
navigation_markroutes(e2);
if(navigation_findnearestwaypoint(e, FALSE))
{
setorigin(e, org);
- e.effects &~= EF_NODEPTHTEST;
+ e.effects &= ~EF_NODEPTHTEST;
e.model = "";
}
else
start = findchainflags(flags, FL_ITEM);
for(e = start; e; e = e.chain)
{
- e.effects &~= EF_NODEPTHTEST | EF_RED | EF_BLUE;
+ e.effects &= ~(EF_NODEPTHTEST | EF_RED | EF_BLUE);
e.colormod = '0.5 0.5 0.5';
}
for(e = start; e; e = e.chain)
self.velocity_z = self.velocity_z + mjumpheight;
self.oldvelocity_z = self.velocity_z;
- self.flags &~= FL_ONGROUND;
- self.flags &~= FL_JUMPRELEASED;
+ self.flags &= ~FL_ONGROUND;
+ self.flags &= ~FL_JUMPRELEASED;
animdecide_setaction(self, ANIMACTION_JUMP, TRUE);
{ // open at eye level
self.flags |= FL_WATERJUMP;
self.velocity_z = 225;
- self.flags &~= FL_JUMPRELEASED;
+ self.flags &= ~FL_JUMPRELEASED;
self.teleport_time = time + 2; // safety net
return;
}
else
{
// now set angles_x so that the car points forward, but is tilted in velocity direction
- self.flags &~= FL_ONGROUND;
+ self.flags &= ~FL_ONGROUND;
}
self.velocity = (neworigin - self.origin) * (1.0 / frametime);
bot_think();
}
- self.items &~= IT_USING_JETPACK;
+ self.items &= ~IT_USING_JETPACK;
if(IS_PLAYER(self))
{
maxspd_mod = autocvar_sv_spectator_speed_multiplier;
if(!self.spectatorspeed)
self.spectatorspeed = maxspd_mod;
- if(self.impulse && self.impulse <= 19 || self.impulse >= 200 && self.impulse <= 209 || self.impulse >= 220 && self.impulse <= 229)
+ if(self.impulse && self.impulse <= 19 || (self.impulse >= 200 && self.impulse <= 209) || (self.impulse >= 220 && self.impulse <= 229))
{
if(self.lastclassname != "player")
{
- if(self.impulse == 10 || self.impulse == 15 || self.impulse == 18 || self.impulse >= 200 && self.impulse <= 209)
+ if(self.impulse == 10 || self.impulse == 15 || self.impulse == 18 || (self.impulse >= 200 && self.impulse <= 209))
self.spectatorspeed = bound(1, self.spectatorspeed + 0.5, 5);
else if(self.impulse == 11)
self.spectatorspeed = maxspd_mod;
- else if(self.impulse == 12 || self.impulse == 16 || self.impulse == 19 || self.impulse >= 220 && self.impulse <= 229)
+ else if(self.impulse == 12 || self.impulse == 16 || self.impulse == 19 || (self.impulse >= 220 && self.impulse <= 229))
self.spectatorspeed = bound(1, self.spectatorspeed - 0.5, 5);
else if(self.impulse >= 1 && self.impulse <= 9)
self.spectatorspeed = 1 + 0.5 * (self.impulse - 1);
self.velocity_y = self.movedir_y;
if (time > self.teleport_time || self.waterlevel == WATERLEVEL_NONE)
{
- self.flags &~= FL_WATERJUMP;
+ self.flags &= ~FL_WATERJUMP;
self.teleport_time = 0;
}
}
else if (self.movetype == MOVETYPE_NOCLIP || self.movetype == MOVETYPE_FLY || self.movetype == MOVETYPE_FLY_WORLDONLY)
{
// noclipping or flying
- self.flags &~= FL_ONGROUND;
+ self.flags &= ~FL_ONGROUND;
self.velocity = self.velocity * (1 - frametime * autocvar_sv_friction);
makevectors(self.v_angle);
else if (self.waterlevel >= WATERLEVEL_SWIMMING)
{
// swimming
- self.flags &~= FL_ONGROUND;
+ self.flags &= ~FL_ONGROUND;
makevectors(self.v_angle);
//wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z;
else if (time < self.ladder_time)
{
// on a spawnfunc_func_ladder or swimming in spawnfunc_func_water
- self.flags &~= FL_ONGROUND;
+ self.flags &= ~FL_ONGROUND;
float g;
g = autocvar_sv_gravity * frametime;
self.velocity = self.velocity + wishvel * f * frametime;
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
self.ammo_fuel -= autocvar_g_jetpack_fuel * frametime * fvel * f;
- self.flags &~= FL_ONGROUND;
+ self.flags &= ~FL_ONGROUND;
self.items |= IT_USING_JETPACK;
// jetpack also inhibits health regeneration, but only for 1 second
void SpawnThrownWeapon (vector org, float w)
{
- if(WEPSET_CONTAINS_EW(self, self.weapon))
+ if(self.weapons & WepSet_FromWeapon(self.weapon))
if(W_IsWeaponThrowable(self.weapon))
W_ThrowNewWeapon(self, self.weapon, FALSE, org, randomvec() * 125 + '0 0 200');
}
if(sound_allowed(MSG_BROADCAST, attacker))
{
if (save > 10)
- sound (self, CH_SHOTS, "misc/armorimpact.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_SHOTS, "misc/armorimpact.wav", VOL_BASE, ATTEN_NORM);
else if (take > 30)
- sound (self, CH_SHOTS, "misc/bodyimpact2.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_SHOTS, "misc/bodyimpact2.wav", VOL_BASE, ATTEN_NORM);
else if (take > 10)
- sound (self, CH_SHOTS, "misc/bodyimpact1.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_SHOTS, "misc/bodyimpact1.wav", VOL_BASE, ATTEN_NORM);
}
if (take > 50)
if(sound_allowed(MSG_BROADCAST, attacker))
{
if (save > 10)
- sound (self, CH_SHOTS, "misc/armorimpact.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_SHOTS, "misc/armorimpact.wav", VOL_BASE, ATTEN_NORM);
else if (take > 30)
- sound (self, CH_SHOTS, "misc/bodyimpact2.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_SHOTS, "misc/bodyimpact2.wav", VOL_BASE, ATTEN_NORM);
else if (take > 10)
- sound (self, CH_SHOTS, "misc/bodyimpact1.wav", VOL_BASE, ATTN_NORM); // FIXME possibly remove them?
+ sound (self, CH_SHOTS, "misc/bodyimpact1.wav", VOL_BASE, ATTEN_NORM); // FIXME possibly remove them?
}
if (take > 50)
self.solid = SOLID_CORPSE;
self.ballistics_density = autocvar_g_ballistics_density_corpse;
// don't stick to the floor
- self.flags &~= FL_ONGROUND;
+ self.flags &= ~FL_ONGROUND;
// dying animation
self.deadflag = DEAD_DYING;
// when to allow respawn
{
msg_entity = self;
if(IS_REAL_CLIENT(msg_entity))
- soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTN_NONE);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTEN_NONE);
}
break;
case VOICETYPE_TEAMRADIO:
msg_entity = self;
if(msg_entity.cvar_cl_voice_directional == 1)
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_MIN);
else
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE);
break;
case VOICETYPE_AUTOTAUNT:
if(!sv_autotaunt)
if (tauntrand < msg_entity.cvar_cl_autotaunt)
{
if (msg_entity.cvar_cl_voice_directional >= 1)
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTEN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTEN_MAX));
else
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE);
}
break;
case VOICETYPE_TAUNT:
break;
msg_entity = self;
if (msg_entity.cvar_cl_voice_directional >= 1)
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTEN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTEN_MAX));
else
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE);
break;
case VOICETYPE_PLAYERSOUND:
msg_entity = self;
- soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTN_NORM);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTEN_NORM);
break;
default:
backtrace("Invalid voice type!");
if(IS_REAL_CLIENT(msg_entity))
{
if(msg_entity.cvar_cl_voice_directional == 1)
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_MIN);
else
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE);
}
}
break;
if(IS_REAL_CLIENT(msg_entity))
{
if(msg_entity.cvar_cl_voice_directional == 1)
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_MIN);
else
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE);
}
msg_entity = self;
if(IS_REAL_CLIENT(msg_entity))
- soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTN_NONE);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTEN_NONE);
}
break;
case VOICETYPE_TEAMRADIO:
if(!teamplay || msg_entity.team == self.team)
{
if(msg_entity.cvar_cl_voice_directional == 1)
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_MIN);
else
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE);
}
break;
case VOICETYPE_AUTOTAUNT:
if (tauntrand < msg_entity.cvar_cl_autotaunt)
{
if (msg_entity.cvar_cl_voice_directional >= 1)
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTEN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTEN_MAX));
else
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE);
}
break;
case VOICETYPE_TAUNT:
FOR_EACH_REALCLIENT(msg_entity)
{
if (msg_entity.cvar_cl_voice_directional >= 1)
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTEN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTEN_MAX));
else
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE);
}
break;
case VOICETYPE_PLAYERSOUND:
- sound(self, chan, sample, VOL_BASE, ATTN_NORM);
+ sound(self, chan, sample, VOL_BASE, ATTEN_NORM);
break;
default:
backtrace("Invalid voice type!");
wep.flags |= FL_TOSSED;
wep.colormap = own.colormap;
- if(WEPSET_CONTAINS_AW(WEPBIT_SUPERWEAPONS, wpn))
+ if(WepSet_FromWeapon(wpn) & WEPSET_SUPERWEAPONS)
{
if(own.items & IT_UNLIMITED_SUPERWEAPONS)
{
{
float superweapons = 1;
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
- if(WEPSET_CONTAINS_AW(WEPBIT_SUPERWEAPONS, i))
- if(WEPSET_CONTAINS_EW(own, i))
+ if(WepSet_FromWeapon(i) & WEPSET_SUPERWEAPONS)
+ if(own.weapons & WepSet_FromWeapon(i))
++superweapons;
if(superweapons <= 1)
{
return 0;
wa = W_AmmoItemCode(w);
- if(WEPSET_CONTAINS_AW(start_weapons, w))
+ if(start_weapons & WepSet_FromWeapon(w))
{
// start weapons that take no ammo can't be dropped (this prevents dropping the laser, as long as it continues to use no ammo)
if(start_items & IT_UNLIMITED_WEAPON_AMMO)
if(!W_IsWeaponThrowable(w))
return;
- if(!WEPSET_CONTAINS_EW(self, w))
+ if(!(self.weapons & WepSet_FromWeapon(w)))
return;
- WEPSET_ANDNOT_EW(self, w);
+ self.weapons &= ~WepSet_FromWeapon(w);
W_SwitchWeapon_Force(self, w_getbestweapon(self));
a = W_ThrowNewWeapon(self, w, doreduce, self.origin + delta, velo);
self.switchingweapon = 0;
self.weaponentity.state = WS_CLEAR;
self.weaponname = "";
- self.items &~= IT_AMMO;
+ self.items &= ~IT_AMMO;
return;
}
if(ATTACK_FINISHED(self) <= time + self.weapon_frametime * 0.5)
{
#endif
- sound (self, CH_WEAPON_SINGLE, "weapons/weapon_switch.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_WEAPON_SINGLE, "weapons/weapon_switch.wav", VOL_BASE, ATTEN_NORM);
self.weaponentity.state = WS_DROP;
// set up weapon switch think in the future, and start drop anim
weapon_thinkf(WFRAME_DONTCHANGE, cvar(sprintf("g_balance_%s_switchdelay_drop", oldwep.netname)), w_clear);
while (c < W_TICSPERFRAME)
{
c = c + 1;
- if(w && !WEPSET_CONTAINS_EW(self, w))
+ if(w && !(self.weapons & WepSet_FromWeapon(w)))
{
if(self.weapon == self.switchweapon)
W_SwitchWeapon_Force(self, w_getbestweapon(self));
.float antilag_debug;
// VorteX: static frame globals
-float WFRAME_DONTCHANGE = -1;
-float WFRAME_FIRE1 = 0;
-float WFRAME_FIRE2 = 1;
-float WFRAME_IDLE = 2;
-float WFRAME_RELOAD = 3;
+const float WFRAME_DONTCHANGE = -1;
+const float WFRAME_FIRE1 = 0;
+const float WFRAME_FIRE2 = 1;
+const float WFRAME_IDLE = 2;
+const float WFRAME_RELOAD = 3;
.float wframe;
void(float fr, float t, void() func) weapon_thinkf;
&& ((time > player.prevstrengthsound + autocvar_sv_strengthsound_antispam_time) // prevent insane sound spam
|| (time > player.prevstrengthsoundattempt + autocvar_sv_strengthsound_antispam_refire_threshold)))
{
- sound(player, CH_TRIGGER, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);
+ sound(player, CH_TRIGGER, "weapons/strength_fire.wav", VOL_BASE, ATTEN_NORM);
player.prevstrengthsound = time;
}
player.prevstrengthsoundattempt = time;
if (snd != "")
{
- sound (ent, chan, snd, VOL_BASE, ATTN_NORM);
+ sound (ent, chan, snd, VOL_BASE, ATTEN_NORM);
W_PlayStrengthSound(ent);
}
tb = (self.effects & (EF_TELEPORT_BIT | EF_RESTARTANIM_BIT));
self.effects = self.owner.effects & EFMASK_CHEAP;
- self.effects &~= EF_LOWPRECISION;
- self.effects &~= EF_FULLBRIGHT; // can mask team color, so get rid of it
- self.effects &~= EF_TELEPORT_BIT;
- self.effects &~= EF_RESTARTANIM_BIT;
+ self.effects &= ~EF_LOWPRECISION;
+ self.effects &= ~EF_FULLBRIGHT; // can mask team color, so get rid of it
+ self.effects &= ~EF_TELEPORT_BIT;
+ self.effects &= ~EF_RESTARTANIM_BIT;
self.effects |= tb;
if(self.owner.alpha == default_player_alpha)
if(complain)
self.hasweapon_complain_spam = time + 0.2;
- if(wpn == WEP_HOOK && !g_grappling_hook && autocvar_g_nades && !WEPSET_CONTAINS_EW(cl, wpn) && !WEPSET_CONTAINS_AW(weaponsInMap, wpn))
+ if(wpn == WEP_HOOK && !g_grappling_hook && autocvar_g_nades && !((cl.weapons | weaponsInMap) & WepSet_FromWeapon(wpn)))
complain = 0;
if (wpn < WEP_FIRST || wpn > WEP_LAST)
sprint(self, "Invalid weapon\n");
return FALSE;
}
- if (WEPSET_CONTAINS_EW(cl, wpn))
+ if (cl.weapons & WepSet_FromWeapon(wpn))
{
if (andammo)
{
{
// DRESK - 3/16/07
// Report Proper Weapon Status / Modified Weapon Ownership Message
- if (WEPSET_CONTAINS_AW(weaponsInMap, wpn))
+ if (weaponsInMap & WepSet_FromWeapon(wpn))
{
Send_WeaponComplain(cl, wpn, W_Name(wpn), 1);
{
entity e;
e = get_weaponinfo(windex);
- self.items &~= IT_AMMO;
+ self.items &= ~IT_AMMO;
self.items = self.items | (e.items & IT_AMMO);
// the two weapon entities will notice this has changed and update their models
// hack to ensure it switches to an OTHER weapon (in case the other fire mode still has ammo, we want that anyway)
float w, ww;
w = pl.weapon;
- if(WEPSET_CONTAINS_EW(pl, w))
+ if(pl.weapons & WepSet_FromWeapon(w))
{
- WEPSET_ANDNOT_EW(pl, w);
+ pl.weapons &= ~WepSet_FromWeapon(w);
ww = w_getbestweapon(pl);
- WEPSET_OR_EW(pl, w);
+ pl.weapons |= WepSet_FromWeapon(w);
}
else
ww = w_getbestweapon(pl);
if(self.weapon == self.switchweapon && time - self.prevdryfire > 1) // only play once BEFORE starting to switch weapons
{
- sound (self, CH_WEAPON_A, "weapons/dryfire.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_WEAPON_A, "weapons/dryfire.wav", VOL_BASE, ATTEN_NORM);
self.prevdryfire = time;
}
// now begin the reloading process
- sound (self, CH_WEAPON_SINGLE, self.reload_sound, VOL_BASE, ATTN_NORM);
+ sound (self, CH_WEAPON_SINGLE, self.reload_sound, VOL_BASE, ATTEN_NORM);
// do not set ATTACK_FINISHED in reload code any more. This causes annoying delays if eg: You start reloading a weapon,
// then quickly switch to another weapon and back. Reloading is canceled, but the reload delay is still there,
case "--force": { radarmapper.count |= 1; break; }
case "--loop": { radarmapper.count |= 2; break; }
case "--quit": { radarmapper.count |= 4; break; }
- case "--block": { radarmapper.count &~= 24; break; }
- case "--trace": { radarmapper.count &~= 24; radarmapper.count |= 8; break; }
- case "--sample": { radarmapper.count &~= 24; radarmapper.count |= 16; break; }
+ case "--block": { radarmapper.count &= ~24; break; }
+ case "--trace": { radarmapper.count &= ~24; radarmapper.count |= 8; break; }
+ case "--sample": { radarmapper.count &= ~24; radarmapper.count |= 16; break; }
case "--lineblock": { radarmapper.count |= 24; break; }
case "--flags": { ++i; radarmapper.count = stof(argv(i)); break; } // for the recursive call
case "--sharpen": { ++i; radarmapper.ltime = stof(argv(i)); break; } // for the recursive call
entity radarmapper;
-float RADAR_WIDTH_MAX = 512;
-float RADAR_HEIGHT_MAX = 512;
+const float RADAR_WIDTH_MAX = 512;
+const float RADAR_HEIGHT_MAX = 512;
float sharpen_buffer[RADAR_WIDTH_MAX * 3];
string doublehex = "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFFFF";
nags |= 128;
if(!(nags & 4)) // no vote called? send no string
- nags &~= (64 | 128);
+ nags &= ~(64 | 128);
WriteByte(MSG_ENTITY, nags);
-float FALSE = 0;
-float TRUE = 1;
+const float FL_WEAPON = 8192;
+const float FL_POWERUP = 16384;
+const float FL_PROJECTILE = 32768;
+const float FL_TOSSED = 65536;
+const float FL_NO_WEAPON_STAY = 131072;
+const float FL_SPAWNING = 262144;
-float FL_FLY = 1;
-float FL_SWIM = 2;
-float FL_CLIENT = 8;
-float FL_INWATER = 16;
-float FL_MONSTER = 32;
-float FL_GODMODE = 64;
-float FL_NOTARGET = 128;
-float FL_ITEM = 256;
-float FL_ONGROUND = 512;
-float FL_PARTIALGROUND = 1024;
-float FL_WATERJUMP = 2048;
-float FL_JUMPRELEASED = 4096;
-float FL_WEAPON = 8192;
-float FL_POWERUP = 16384;
-float FL_PROJECTILE = 32768;
-float FL_TOSSED = 65536;
-float FL_NO_WEAPON_STAY = 131072;
-float FL_SPAWNING = 262144;
+const float SVC_SOUND = 6;
+const float SVC_STOPSOUND = 16;
+const float SVC_SETVIEW = 5;
-float MOVETYPE_NONE = 0;
-float MOVETYPE_ANGLENOCLIP = 1;
-float MOVETYPE_ANGLECLIP = 2;
-float MOVETYPE_WALK = 3;
-float MOVETYPE_STEP = 4;
-float MOVETYPE_FLY = 5;
-float MOVETYPE_TOSS = 6;
-float MOVETYPE_PUSH = 7;
-float MOVETYPE_NOCLIP = 8;
-float MOVETYPE_FLYMISSILE = 9;
-float MOVETYPE_BOUNCE = 10;
-float MOVETYPE_BOUNCEMISSILE = 11; // Like bounce but doesn't lose speed on bouncing
-//float MOVETYPE_FOLLOW = 12; // 'Attaches' the entity to its aim_ent
-//float MOVETYPE_FLY_WORLDONLY = 33;
-
-float SOLID_NOT = 0;
-float SOLID_TRIGGER = 1;
-float SOLID_BBOX = 2;
-float SOLID_SLIDEBOX = 3;
-float SOLID_BSP = 4;
-
-float DEAD_NO = 0;
-float DEAD_DYING = 1;
-float DEAD_DEAD = 2;
-float DEAD_RESPAWNABLE = 3;
-float DEAD_RESPAWNING = 4;
-
-float RESPAWN_FORCE = 1;
-float RESPAWN_SILENT = 2;
-
-float DAMAGE_NO = 0;
-float DAMAGE_YES = 1;
-float DAMAGE_AIM = 2;
-
-float CONTENT_EMPTY = -1;
-float CONTENT_SOLID = -2;
-float CONTENT_WATER = -3;
-float CONTENT_SLIME = -4;
-float CONTENT_LAVA = -5;
-float CONTENT_SKY = -6;
-
-float SVC_BAD = 0;
-float SVC_NOP = 1;
-float SVC_DISCONNECT = 2;
-float SVC_UPDATESTAT = 3;
-float SVC_VERSION = 4;
-float SVC_SETVIEW = 5;
-float SVC_SOUND = 6;
-float SVC_TIME = 7;
-float SVC_PRINT = 8;
-float SVC_STUFFTEXT = 9;
-float SVC_SETANGLE = 10;
-float SVC_SERVERINFO = 11;
-float SVC_LIGHTSTYLE = 12;
-float SVC_UPDATENAME = 13;
-float SVC_UPDATEFRAGS = 14;
-float SVC_CLIENTDATA = 15;
-float SVC_STOPSOUND = 16;
-float SVC_UPDATECOLORS = 17;
-float SVC_PARTICLE = 18;
-float SVC_DAMAGE = 19;
-float SVC_SPAWNSTATIC = 20;
-float SVC_SPAWNBINARY = 21;
-float SVC_SPAWNBASELINE = 22;
-float SVC_TEMPENTITY = 23;
-float SVC_SETPAUSE = 24;
-float SVC_SIGNONNUM = 25;
-float SVC_CENTERPRINT = 26;
-float SVC_KILLEDMONSTER = 27;
-float SVC_FOUNDSECRET = 28;
-float SVC_SPAWNSTATICSOUND = 29;
-float SVC_INTERMISSION = 30;
-float SVC_FINALE = 31;
-float SVC_CDTRACK = 32;
-float SVC_SELLSCREEN = 33;
-float SVC_CUTSCENE = 34;
-
-float TE_SPIKE = 0;
-float TE_SUPERSPIKE = 1;
-float TE_GUNSHOT = 2;
-float TE_EXPLOSION = 3;
-float TE_TAREXPLOSION = 4;
-float TE_LIGHTNING1 = 5;
-float TE_LIGHTNING2 = 6;
-float TE_WIZSPIKE = 7;
-float TE_KNIGHTSPIKE = 8;
-float TE_LIGHTNING3 = 9;
-float TE_LAVASPLASH = 10;
-float TE_TELEPORT = 11;
-float TE_BEAM = 13; // grappling hook
-
-float UPDATE_GENERAL = 0;
-float UPDATE_STATIC = 1;
-float UPDATE_BINARY = 2;
-float UPDATE_TEMP = 3;
-
-float EF_BRIGHTFIELD = 1;
-float EF_MUZZLEFLASH = 2;
-float EF_BRIGHTLIGHT = 4;
-float EF_DIMLIGHT = 8;
+const float RESPAWN_FORCE = 1;
+const float RESPAWN_SILENT = 2;
#define EFMASK_CHEAP (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NODRAW | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT)
-float MSG_BROADCAST = 0; // unreliable
-float MSG_ONE = 1; // reliable
-float MSG_ALL = 2; // reliable
-float MSG_INIT = 3; // initialization
-float MSG_ENTITY = 5; // csqc
-
-// Sajt - added these, just as constants. Not sure how you want them actually put in the game, but I just
-// did this so at least they worked
-// NOTE: instagib IS NOT compatible with rocket-arena, so make sure to prevent selecting both in a menu
-//float GAME_INSTAGIB = 1; /// everyone gets the nex gun with infinite ammo, and one shot kills
-//float GAME_ROCKET_ARENA = 16; /// Everyone starts with a rocket launcher
-//float GAME_FULLBRIGHT_PLAYERS = 64; /// makes the players model fullbright
-//float GAME_TEAMS = 128; /// Teams, red/green/yellow/blue
-
-
-//float POWERUP_STRENGTH_DAMAGE = 2; // damage multiplier for strength powerup
-//float POWERUP_STRENGTH_FORCE = 4; // force multiplier for strength powerup
-
-//float POWERUP_INVINCIBLE_TAKEDAMAGE = 0.2; // received damage multiplier for invincible powerup
+const float MSG_ENTITY = 5; // csqc
-float NUM_PLAYERSKINS_TEAMPLAY = 3;
+const float NUM_PLAYERSKINS_TEAMPLAY = 3;
-float ASSAULT_VALUE_INACTIVE = 1000;
+const float ASSAULT_VALUE_INACTIVE = 1000;
-float DOOR_NOSPLASH = 256; // generic anti-splashdamage spawnflag
+const float DOOR_NOSPLASH = 256; // generic anti-splashdamage spawnflag
.void() weapon_think;
//float PLAYER_WEAPONSELECTION_DELAY = );
-float PLAYER_WEAPONSELECTION_SPEED = 18;
-vector PLAYER_WEAPONSELECTION_RANGE = '0 20 -40';
+const float PLAYER_WEAPONSELECTION_SPEED = 18;
+const vector PLAYER_WEAPONSELECTION_RANGE = '0 20 -40';
// weapon states (self.weaponentity.state)
-float WS_CLEAR = 0; // no weapon selected
-float WS_RAISE = 1; // raise frame
-float WS_DROP = 2; // deselecting frame
-float WS_INUSE = 3; // fire state
-float WS_READY = 4; // idle frame
+const float WS_CLEAR = 0; // no weapon selected
+const float WS_RAISE = 1; // raise frame
+const float WS_DROP = 2; // deselecting frame
+const float WS_INUSE = 3; // fire state
+const float WS_READY = 4; // idle frame
// there is 2 weapon tics that can run in one server frame
#define W_TICSPERFRAME 2
void FixIntermissionClient(entity e);
void FixClientCvars(entity e);
-WEPSET_DECLARE_A(weaponsInMap);
+WepSet weaponsInMap;
.float respawn_countdown; // next number to count
func_breakable_destroyed();
if(self.noise)
- sound (self, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
+ sound (self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
if(self.dmg)
RadiusDamage(self, activator, self.dmg, self.dmg_edge, self.dmg_radius, self, self.dmg_force, DEATH_HURTTRIGGER, world);
culprit = DEATH_WEAPONOF(deathtype);
if(!culprit)
culprit = attacker.weapon;
- else if(!WEPSET_CONTAINS_EW(attacker, culprit))
+ else if(!(attacker.weapons & WepSet_FromWeapon(culprit)))
culprit = attacker.weapon;
if(g_weaponarena_random_with_laser && culprit == WEP_LASER)
}
if(inWarmupStage)
- WEPSET_COPY_EA(GiveFrags_randomweapons, warmup_start_weapons);
+ GiveFrags_randomweapons.weapons = warmup_start_weapons;
else
- WEPSET_COPY_EA(GiveFrags_randomweapons, start_weapons);
+ GiveFrags_randomweapons.weapons = start_weapons;
// all others (including the culprit): remove
- WEPSET_ANDNOT_EE(GiveFrags_randomweapons, attacker);
- WEPSET_ANDNOT_EW(GiveFrags_randomweapons, culprit);
+ GiveFrags_randomweapons.weapons &= ~attacker.weapons;
+ GiveFrags_randomweapons.weapons &= ~WepSet_FromWeapon(culprit);
// among the remaining ones, choose one by random
W_RandomWeapons(GiveFrags_randomweapons, 1);
- if(!WEPSET_EMPTY_E(GiveFrags_randomweapons))
+ if(GiveFrags_randomweapons.weapons)
{
- WEPSET_OR_EE(attacker, GiveFrags_randomweapons);
- WEPSET_ANDNOT_EW(attacker, culprit);
+ attacker.weapons |= GiveFrags_randomweapons.weapons;
+ attacker.weapons &= ~WepSet_FromWeapon(culprit);
}
}
// after a frag, choose another random weapon set
- if not(WEPSET_CONTAINS_EW(attacker, attacker.weapon))
+ if not(attacker.weapons & WepSet_FromWeapon(attacker.weapon))
W_SwitchWeapon_Force(attacker, w_getbestweapon(attacker));
}
}
else
self.velocity = self.velocity + farce;
- self.flags &~= FL_ONGROUND;
+ self.flags &= ~FL_ONGROUND;
UpdateCSQCProjectile(self);
}
// apply damage
if(Fire_IsBurning(e))
e.effects |= EF_FLAME;
else
- e.effects &~= EF_FLAME;
+ e.effects &= ~EF_FLAME;
}
void fireburner_think()
void RemoveGrapplingHook(entity pl);
void SetGrappleHookBindings();
// hook impulses
-float GRAPHOOK_FIRE = 20;
-float GRAPHOOK_RELEASE = 21;
+const float GRAPHOOK_FIRE = 20;
+const float GRAPHOOK_RELEASE = 21;
// (note: you can change the hook impulse #'s to whatever you please)
4. Open client.c and add this to the top of PutClientInServer():
void GrapplingHook_Stop()
{
pointparticles(particleeffectnum("grapple_impact"), self.origin, '0 0 0', 1);
- sound (self, CH_SHOTS, "weapons/hook_impact.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_SHOTS, "weapons/hook_impact.wav", VOL_BASE, ATTEN_NORM);
self.state = 1;
self.think = GrapplingHookThink;
{
v = v - dv * 0.5;
self.aiment.velocity = self.aiment.velocity - dv * 0.5;
- self.aiment.flags &~= FL_ONGROUND;
+ self.aiment.flags &= ~FL_ONGROUND;
self.aiment.pusher = self.realowner;
self.aiment.pushltime = time + autocvar_g_maxpushtime;
self.aiment.istypefrag = self.aiment.BUTTON_CHAT;
}
}
- self.realowner.flags &~= FL_ONGROUND;
+ self.realowner.flags &= ~FL_ONGROUND;
}
self.realowner.velocity = WarpZone_RefSys_TransformVelocity(self, self.realowner, v);
self.realowner.velocity = dir*spd;
self.realowner.movetype = MOVETYPE_FLY;
- self.realowner.flags &~= FL_ONGROUND;
+ self.realowner.flags &= ~FL_ONGROUND;
}
}
vs = hook_shotorigin[s];
// UGLY WORKAROUND: play this on CH_WEAPON_B so it can't cut off fire sounds
- sound (self, CH_WEAPON_B, "weapons/hook_fire.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_WEAPON_B, "weapons/hook_fire.wav", VOL_BASE, ATTEN_NORM);
org = self.origin + self.view_ofs + v_forward * vs_x + v_right * -vs_y + v_up * vs_z;
tracebox(self.origin + self.view_ofs, '-3 -3 -3', '3 3 3', org, MOVE_NORMAL, self);
else
{
self.hook_state |= HOOK_REMOVING;
- self.hook_state &~= HOOK_WAITING_FOR_RELEASE;
+ self.hook_state &= ~HOOK_WAITING_FOR_RELEASE;
}
- self.hook_state &~= HOOK_RELEASING;
+ self.hook_state &= ~HOOK_RELEASING;
if(self.BUTTON_CROUCH)
{
- self.hook_state &~= HOOK_PULLING;
+ self.hook_state &= ~HOOK_PULLING;
//self.hook_state |= HOOK_RELEASING;
}
else
{
self.hook_state |= HOOK_PULLING;
- //self.hook_state &~= HOOK_RELEASING;
+ //self.hook_state &= ~HOOK_RELEASING;
}
}
else if(!(self.items & IT_JETPACK) && !g_grappling_hook && self.switchweapon != WEP_HOOK)
if(!g_grappling_hook && self.weapon != WEP_HOOK)
{
- self.hook_state &~= HOOK_FIRING;
+ self.hook_state &= ~HOOK_FIRING;
self.hook_state |= HOOK_REMOVING;
}
if (self.hook)
RemoveGrapplingHook(self);
FireGrapplingHook();
- self.hook_state &~= HOOK_FIRING;
+ self.hook_state &= ~HOOK_FIRING;
}
else if(self.hook_state & HOOK_REMOVING)
{
if (self.hook)
RemoveGrapplingHook(self);
- self.hook_state &~= HOOK_REMOVING;
+ self.hook_state &= ~HOOK_REMOVING;
}
/*
// (note: you can change the hook impulse #'s to whatever you please)
.float hook_time;
-float HOOK_FIRING = 1;
-float HOOK_REMOVING = 2;
-float HOOK_PULLING = 4;
-float HOOK_RELEASING = 8;
-float HOOK_WAITING_FOR_RELEASE = 16;
+const float HOOK_FIRING = 1;
+const float HOOK_REMOVING = 2;
+const float HOOK_PULLING = 4;
+const float HOOK_RELEASING = 8;
+const float HOOK_WAITING_FOR_RELEASE = 16;
.float hook_state;
void GrappleHookInit();
-float LOOP = 1;
+const float LOOP = 1;
-float DNOSHADOW = 2;
-float DFOLLOW = 4;
+const float DNOSHADOW = 2;
+const float DFOLLOW = 4;
.float light_lev;
.float lefty;
.vector color;
void g_model_dropbyspawnflags()
{
- if(self.spawnflags & 3 == 1) // ALIGN_ORIGIN
+ if((self.spawnflags & 3) == 1) // ALIGN_ORIGIN
{
traceline(self.origin, self.origin - '0 0 4096', MOVE_NOMONSTERS, self);
setorigin(self, trace_endpos);
}
- else if(self.spawnflags & 3 == 2) // ALIGN_BOTTOM
+ else if((self.spawnflags & 3) == 2) // ALIGN_BOTTOM
{
tracebox(self.origin, self.mins, self.maxs, self.origin - '0 0 4096', MOVE_NOMONSTERS, self);
setorigin(self, trace_endpos);
}
- else if(self.spawnflags & 3 == 3) // ALIGN_ORIGIN | ALIGN_BOTTOM
+ else if((self.spawnflags & 3) == 3) // ALIGN_ORIGIN | ALIGN_BOTTOM
{
traceline(self.origin, self.origin - '0 0 4096', MOVE_NOMONSTERS, self);
setorigin(self, trace_endpos - '0 0 1' * self.mins_z);
var float tet_high_score = 0;
-vector TET_START_PIECE_POS = '5 1 0';
-float TET_LINES = 22;
-float TET_DISPLAY_LINES = 20;
-float TET_WIDTH = 10;
-string TET_EMPTY_LINE = "0000000000"; // must match TET_WIDTH
+const vector TET_START_PIECE_POS = '5 1 0';
+const float TET_LINES = 22;
+const float TET_DISPLAY_LINES = 20;
+const float TET_WIDTH = 10;
+const string TET_EMPTY_LINE = "0000000000"; // must match TET_WIDTH
//character values
-float TET_BORDER = 139;
-float TET_BLOCK = 133;
-float TET_SPACE = 160; // blankness
+const float TET_BORDER = 139;
+const float TET_BLOCK = 133;
+const float TET_SPACE = 160; // blankness
-float TETKEY_UP = 1;
-float TETKEY_DOWN = 2;
-float TETKEY_LEFT = 4;
-float TETKEY_RIGHT = 8;
-float TETKEY_ROTLEFT = 16;
-float TETKEY_ROTRIGHT = 32;
-float TETKEY_DROP = 64;
-string TET_PADDING_RIGHT = "\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0"; // get away from crosshair
+const float TETKEY_UP = 1;
+const float TETKEY_DOWN = 2;
+const float TETKEY_LEFT = 4;
+const float TETKEY_RIGHT = 8;
+const float TETKEY_ROTLEFT = 16;
+const float TETKEY_ROTRIGHT = 32;
+const float TETKEY_DROP = 64;
+const string TET_PADDING_RIGHT = "\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0"; // get away from crosshair
-float PIECES = 7;
+const float PIECES = 7;
float tet_line_buf;
}
}
-float LINE_LOW = 349525;
-float LINE_HIGH = 699050; // above number times 2
+const float LINE_LOW = 349525;
+const float LINE_HIGH = 699050; // above number times 2
void AddLines(float n)
{
//=============================================================================
-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
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);
}
pingplreport.nextthink = time;
}
-float SPAWNFLAG_NO_WAYPOINTS_FOR_ITEMS = 1;
+const float SPAWNFLAG_NO_WAYPOINTS_FOR_ITEMS = 1;
string redirection_target;
float world_initialized;
WeaponStats_Init();
- WEPSET_ADDSTAT();
+ WepSet_AddStat();
addstat(STAT_SWITCHWEAPON, AS_INT, switchweapon);
addstat(STAT_SWITCHINGWEAPON, AS_INT, switchingweapon);
addstat(STAT_GAMESTARTTIME, AS_FLOAT, stat_game_starttime);
float checkrules_suddendeathend;
float checkrules_overtimesadded; //how many overtimes have been already added
-float WINNING_NO = 0; // no winner, but time limits may terminate the game
-float WINNING_YES = 1; // winner found
-float WINNING_NEVER = 2; // no winner, enter overtime if time limit is reached
-float WINNING_STARTSUDDENDEATHOVERTIME = 3; // no winner, enter suddendeath overtime NOW
+const float WINNING_NO = 0; // no winner, but time limits may terminate the game
+const float WINNING_YES = 1; // winner found
+const float WINNING_NEVER = 2; // no winner, enter overtime if time limit is reached
+const float WINNING_STARTSUDDENDEATHOVERTIME = 3; // no winner, enter suddendeath overtime NOW
float InitiateSuddenDeath()
{
float i;
if(sf & 1)
- sf &~= 2; // if we send 1, we don't need to also send 2
+ sf &= ~2; // if we send 1, we don't need to also send 2
WriteByte(MSG_ENTITY, ENT_CLIENT_MAPVOTE);
WriteByte(MSG_ENTITY, sf);
return TRUE;
} else {
// only some of the needed keys were given
- l.itemkeys &~= valid;
+ l.itemkeys &= ~valid;
return TRUE;
}
}
#define move_out_of_solid(e) WarpZoneLib_MoveOutOfSolid(e)
-string STR_PLAYER = "player";
-string STR_SPECTATOR = "spectator";
-string STR_OBSERVER = "observer";
+const string STR_PLAYER = "player";
+const string STR_SPECTATOR = "spectator";
+const string STR_OBSERVER = "observer";
#define IS_PLAYER(v) (v.classname == STR_PLAYER)
#define IS_SPEC(v) (v.classname == STR_SPECTATOR)
}
*/
-float NUM_NEAREST_ENTITIES = 4;
+const float NUM_NEAREST_ENTITIES = 4;
entity nearest_entity[NUM_NEAREST_ENTITIES];
float nearest_length[NUM_NEAREST_ENTITIES];
entity findnearest(vector point, .string field, string value, vector axismod)
float g_pickup_ammo_anyway;
float g_pickup_weapons_anyway;
float g_weaponarena;
-WEPSET_DECLARE_A(g_weaponarena_weapons);
+WepSet g_weaponarena_weapons;
float g_weaponarena_random;
float g_weaponarena_random_with_laser;
string g_weaponarena_list;
float g_weaponforcefactor;
float g_weaponspreadfactor;
-WEPSET_DECLARE_A(start_weapons);
-WEPSET_DECLARE_A(start_weapons_default);
-WEPSET_DECLARE_A(start_weapons_defaultmask);
+WepSet start_weapons;
+WepSet start_weapons_default;
+WepSet start_weapons_defaultmask;
float start_items;
float start_ammo_shells;
float start_ammo_nails;
float start_ammo_fuel;
float start_health;
float start_armorvalue;
-WEPSET_DECLARE_A(warmup_start_weapons);
-WEPSET_DECLARE_A(warmup_start_weapons_default);
-WEPSET_DECLARE_A(warmup_start_weapons_defaultmask);
+WepSet warmup_start_weapons;
+WepSet warmup_start_weapons_default;
+WepSet warmup_start_weapons_defaultmask;
float warmup_start_ammo_shells;
float warmup_start_ammo_nails;
float warmup_start_ammo_rockets;
string s;
// initialize starting values for players
- WEPSET_CLEAR_A(start_weapons);
- WEPSET_CLEAR_A(start_weapons_default);
- WEPSET_CLEAR_A(start_weapons_defaultmask);
+ start_weapons = '0 0 0';
+ start_weapons_default = '0 0 0';
+ start_weapons_defaultmask = '0 0 0';
start_items = 0;
start_ammo_shells = 0;
start_ammo_nails = 0;
start_armorvalue = cvar("g_balance_armor_start");
g_weaponarena = 0;
- WEPSET_CLEAR_A(g_weaponarena_weapons);
+ g_weaponarena_weapons = '0 0 0';
s = cvar_string("g_weaponarena");
if (s == "0" || s == "")
{
e = get_weaponinfo(j);
if not(e.spawnflags & WEP_FLAG_MUTATORBLOCKED)
- WEPSET_OR_AW(g_weaponarena_weapons, j);
+ g_weaponarena_weapons |= WepSet_FromWeapon(j);
}
}
else if (s == "most")
e = get_weaponinfo(j);
if not(e.spawnflags & WEP_FLAG_MUTATORBLOCKED)
if (e.spawnflags & WEP_FLAG_NORMAL)
- WEPSET_OR_AW(g_weaponarena_weapons, j);
+ g_weaponarena_weapons |= WepSet_FromWeapon(j);
}
}
else if (s == "none")
e = get_weaponinfo(j);
if (e.netname == s)
{
- WEPSET_OR_AW(g_weaponarena_weapons, j);
+ g_weaponarena_weapons |= WepSet_FromWeapon(j);
g_weaponarena_list = strcat(g_weaponarena_list, e.message, " & ");
break;
}
if (g_weaponarena)
{
g_weapon_stay = 0; // incompatible
- WEPSET_COPY_AA(start_weapons, g_weaponarena_weapons);
+ start_weapons = g_weaponarena_weapons;
start_items |= IT_UNLIMITED_AMMO;
}
else
e = get_weaponinfo(i);
float w = want_weapon("g_start_weapon_", e, FALSE);
if(w & 1)
- WEPSET_OR_AW(start_weapons, i);
+ start_weapons |= WepSet_FromWeapon(i);
if(w & 2)
- WEPSET_OR_AW(start_weapons_default, i);
+ start_weapons_default |= WepSet_FromWeapon(i);
if(w & 4)
- WEPSET_OR_AW(start_weapons_defaultmask, i);
+ start_weapons_defaultmask |= WepSet_FromWeapon(i);
}
}
warmup_start_ammo_fuel = start_ammo_fuel;
warmup_start_health = start_health;
warmup_start_armorvalue = start_armorvalue;
- WEPSET_COPY_AA(warmup_start_weapons, start_weapons);
- WEPSET_COPY_AA(warmup_start_weapons_default, start_weapons_default);
- WEPSET_COPY_AA(warmup_start_weapons_defaultmask, start_weapons_defaultmask);
+ warmup_start_weapons = start_weapons;
+ warmup_start_weapons_default = start_weapons_default;
+ warmup_start_weapons_defaultmask = start_weapons_defaultmask;
if (!g_weaponarena && !g_ca)
{
warmup_start_ammo_fuel = cvar("g_warmup_start_ammo_fuel");
warmup_start_health = cvar("g_warmup_start_health");
warmup_start_armorvalue = cvar("g_warmup_start_armor");
- WEPSET_CLEAR_A(warmup_start_weapons);
- WEPSET_CLEAR_A(warmup_start_weapons_default);
- WEPSET_CLEAR_A(warmup_start_weapons_defaultmask);
+ warmup_start_weapons = '0 0 0';
+ warmup_start_weapons_default = '0 0 0';
+ warmup_start_weapons_defaultmask = '0 0 0';
for (i = WEP_FIRST; i <= WEP_LAST; ++i)
{
e = get_weaponinfo(i);
float w = want_weapon("g_start_weapon_", e, cvar("g_warmup_allguns"));
if(w & 1)
- WEPSET_OR_AW(warmup_start_weapons, i);
+ warmup_start_weapons |= WepSet_FromWeapon(i);
if(w & 2)
- WEPSET_OR_AW(warmup_start_weapons_default, i);
+ warmup_start_weapons_default |= WepSet_FromWeapon(i);
if(w & 4)
- WEPSET_OR_AW(warmup_start_weapons_defaultmask, i);
+ warmup_start_weapons_defaultmask |= WepSet_FromWeapon(i);
}
}
}
MUTATOR_CALLHOOK(SetStartItems);
- if ((start_items & IT_JETPACK) || (g_grappling_hook && WEPSET_CONTAINS_AW(start_weapons, WEP_HOOK)))
+ if ((start_items & IT_JETPACK) || (g_grappling_hook && (start_weapons & WEPSET_HOOK)))
{
g_grappling_hook = 0; // these two can't coexist, as they use the same button
start_items |= IT_FUEL_REGEN;
for (i = WEP_FIRST; i <= WEP_LAST; ++i)
{
e = get_weaponinfo(i);
- if(WEPSET_CONTAINS_AW(start_weapons, i) || WEPSET_CONTAINS_AW(warmup_start_weapons, i))
+ if((start_weapons | warmup_start_weapons) & WepSet_FromWeapon(i))
weapon_action(i, WR_PRECACHE);
}
{
//stuffcmd(e, strcat("play2 ", filename, "\n"));
msg_entity = e;
- soundtoat(MSG_ONE, world, '0 0 0', CH_INFO, filename, VOL_BASE, ATTN_NONE);
+ soundtoat(MSG_ONE, world, '0 0 0', CH_INFO, filename, VOL_BASE, ATTEN_NONE);
}
// use this one if you might be causing spam (e.g. from touch functions that might get called more than once per frame)
if (autocvar_bot_sound_monopoly)
return;
- sound(world, CH_INFO, samp, VOL_BASE, ATTN_NONE);
+ sound(world, CH_INFO, samp, VOL_BASE, ATTEN_NONE);
}
void PrecachePlayerSounds(string f);
if (self.noise)
{
precache_sound (self.noise);
- ambientsound ('0 0 0', self.noise, VOL_BASE, ATTN_NONE);
+ ambientsound ('0 0 0', self.noise, VOL_BASE, ATTEN_NONE);
}
#endif
start_ammo_cells = cvar("g_lms_start_ammo_cells");
start_ammo_fuel = cvar("g_lms_start_ammo_fuel");
- start_items &~= IT_UNLIMITED_AMMO;
+ start_items &= ~IT_UNLIMITED_AMMO;
return 0;
}
// messages and sounds
Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_LOST_), player.netname);
- sound(flag, CH_TRIGGER, flag.snd_flag_dropped, VOL_BASE, ATTN_NONE);
+ sound(flag, CH_TRIGGER, flag.snd_flag_dropped, VOL_BASE, ATTEN_NONE);
ctf_EventLog("dropped", player.team, player);
// scoring
flag.ctf_status = FLAG_CARRY;
// messages and sounds
- sound(player, CH_TRIGGER, flag.snd_flag_pass, VOL_BASE, ATTN_NORM);
+ sound(player, CH_TRIGGER, flag.snd_flag_pass, VOL_BASE, ATTEN_NORM);
ctf_EventLog("receive", flag.team, player);
FOR_EACH_REALPLAYER(tmp_player)
flag.ctf_status = FLAG_PASSING;
// other
- sound(player, CH_TRIGGER, flag.snd_flag_touch, VOL_BASE, ATTN_NORM);
+ sound(player, CH_TRIGGER, flag.snd_flag_touch, VOL_BASE, ATTEN_NORM);
WarpZone_TrailParticles(world, particleeffectnum(flag.passeffect), player.origin, targ_origin);
ctf_EventLog("pass", flag.team, player);
break;
// messages and sounds
Send_Notification(NOTIF_ONE, player, MSG_CENTER, APP_TEAM_ENT_2(enemy_flag, CENTER_CTF_CAPTURE_));
ctf_CaptureRecord(enemy_flag, player);
- sound(player, CH_TRIGGER, flag.snd_flag_capture, VOL_BASE, ATTN_NONE);
+ sound(player, CH_TRIGGER, flag.snd_flag_capture, VOL_BASE, ATTEN_NONE);
switch(capturetype)
{
// messages and sounds
Send_Notification(NOTIF_ONE, player, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_RETURN_));
Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_RETURN_), player.netname);
- sound(player, CH_TRIGGER, flag.snd_flag_returned, VOL_BASE, ATTN_NONE);
+ sound(player, CH_TRIGGER, flag.snd_flag_returned, VOL_BASE, ATTEN_NONE);
ctf_EventLog("return", flag.team, player);
// scoring
// messages and sounds
Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_PICKUP_), player.netname);
- sound(player, CH_TRIGGER, flag.snd_flag_taken, VOL_BASE, ATTN_NONE);
+ sound(player, CH_TRIGGER, flag.snd_flag_taken, VOL_BASE, ATTEN_NONE);
FOR_EACH_REALPLAYER(tmp_player)
{
case RETURN_TIMEOUT:
{ Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_TIMEOUT_)); break; }
}
- sound(flag, CH_TRIGGER, flag.snd_flag_respawn, VOL_BASE, ATTN_NONE);
+ sound(flag, CH_TRIGGER, flag.snd_flag_respawn, VOL_BASE, ATTEN_NONE);
ctf_EventLog("returned", flag.team, world);
ctf_RespawnFlag(flag);
}
if(time > self.wait) // if we haven't in a while, play a sound/effect
{
pointparticles(particleeffectnum(self.toucheffect), self.origin, '0 0 0', 1);
- sound(self, CH_TRIGGER, self.snd_flag_touch, VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER, self.snd_flag_touch, VOL_BASE, ATTEN_NORM);
self.wait = time + FLAG_TOUCHRATE;
}
return;
entity flag;
// initially clear items so they can be set as necessary later.
- self.items &~= (IT_RED_FLAG_CARRYING | IT_RED_FLAG_TAKEN | IT_RED_FLAG_LOST
+ self.items &= ~(IT_RED_FLAG_CARRYING | IT_RED_FLAG_TAKEN | IT_RED_FLAG_LOST
| IT_BLUE_FLAG_CARRYING | IT_BLUE_FLAG_TAKEN | IT_BLUE_FLAG_LOST | IT_CTF_SHIELDED);
// scan through all the flags and notify the client about them
if (head.noise != "")
if(self.enemy)
- sound(self.enemy, CH_TRIGGER, head.noise, VOL_BASE, ATTN_NORM);
+ sound(self.enemy, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM);
else
- sound(self, CH_TRIGGER, head.noise, VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM);
if (head.noise1 != "")
play2all(head.noise1);
WaypointSprite_Spawn("ka-ball", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAGCARRIER, '0 1 1');
WaypointSprite_Ping(self.waypointsprite_attachedforcarrier);
- sound(self, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere)
+ sound(self, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
}
else
{
if not(IS_PLAYER(other))
{ // The ball just touched an object, most likely the world
pointparticles(particleeffectnum("kaball_sparks"), self.origin, '0 0 0', 1);
- sound(self, CH_TRIGGER, "keepaway/touch.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER, "keepaway/touch.wav", VOL_BASE, ATTEN_NORM);
return;
}
else if(self.wait > time) { return; }
ka_EventLog("pickup", other);
Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_KEEPAWAY_PICKUP, other.netname);
Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEEPAWAY_PICKUP, other.netname);
- sound(self.owner, CH_TRIGGER, "keepaway/pickedup.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere)
+ sound(self.owner, CH_TRIGGER, "keepaway/pickedup.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
// scoring
PlayerScore_Add(other, SP_KEEPAWAY_PICKUPS, 1);
ball.think = ka_RespawnBall;
ball.nextthink = time + autocvar_g_keepawayball_respawntime;
ball.takedamage = DAMAGE_YES;
- ball.effects &~= EF_NODRAW;
+ ball.effects &= ~EF_NODRAW;
setorigin(ball, plyr.origin + '0 0 10');
ball.velocity = '0 0 200' + '0 100 0'*crandom() + '100 0 0'*crandom();
ball.owner.ballcarried = world; // I hope nothing checks to see if the world has the ball in the rest of my code :P
// reset the player effects
plyr.glow_trail = FALSE;
- plyr.effects &~= autocvar_g_keepaway_ballcarrier_effects;
+ plyr.effects &= ~autocvar_g_keepaway_ballcarrier_effects;
// messages and sounds
ka_EventLog("dropped", plyr);
Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_KEEPAWAY_DROPPED, plyr.netname);
Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEEPAWAY_DROPPED, plyr.netname);
- sound(other, CH_TRIGGER, "keepaway/dropped.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere)
+ sound(other, CH_TRIGGER, "keepaway/dropped.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
// scoring
// PlayerScore_Add(plyr, SP_KEEPAWAY_DROPS, 1); Not anymore, this is 100% the same as pickups and is useless.
MUTATOR_HOOKFUNCTION(ka_PlayerPreThink)
{
// clear the item used for the ball in keepaway
- self.items &~= IT_KEY1;
+ self.items &= ~IT_KEY1;
// if the player has the ball, make sure they have the item for it (Used for HUD primarily)
if(self.ballcarried)
// In the future this hook is supposed to allow me to do some extra stuff with waypointsprites and invisibility powerup
// So bare with me until I can fix a certain bug with ka_ballcarrier_waypointsprite_visible_for_player()
- self.effects &~= autocvar_g_keepaway_ballcarrier_effects;
+ self.effects &= ~autocvar_g_keepaway_ballcarrier_effects;
if(self.ballcarried)
self.effects |= autocvar_g_keepaway_ballcarrier_effects;
// #define KH_PLAYER_USE_CARRIEDMODEL
#ifdef KH_PLAYER_USE_ATTACHMENT
-vector KH_PLAYER_ATTACHMENT_DIST_ROTATED = '0 -4 0';
-vector KH_PLAYER_ATTACHMENT_DIST = '4 0 0';
-vector KH_PLAYER_ATTACHMENT = '0 0 0';
-vector KH_PLAYER_ATTACHMENT_ANGLES = '0 0 0';
-string KH_PLAYER_ATTACHMENT_BONE = "";
+const vector KH_PLAYER_ATTACHMENT_DIST_ROTATED = '0 -4 0';
+const vector KH_PLAYER_ATTACHMENT_DIST = '4 0 0';
+const vector KH_PLAYER_ATTACHMENT = '0 0 0';
+const vector KH_PLAYER_ATTACHMENT_ANGLES = '0 0 0';
+const string KH_PLAYER_ATTACHMENT_BONE = "";
#else
-float KH_KEY_ZSHIFT = 22;
-float KH_KEY_XYDIST = 24;
-float KH_KEY_XYSPEED = 45;
+const float KH_KEY_ZSHIFT = 22;
+const float KH_KEY_XYDIST = 24;
+const float KH_KEY_XYSPEED = 45;
#endif
-float KH_KEY_WP_ZSHIFT = 20;
+const float KH_KEY_WP_ZSHIFT = 20;
-vector KH_KEY_MIN = '-10 -10 -46';
-vector KH_KEY_MAX = '10 10 3';
-float KH_KEY_BRIGHTNESS = 2;
+const vector KH_KEY_MIN = '-10 -10 -46';
+const vector KH_KEY_MAX = '10 10 3';
+const float KH_KEY_BRIGHTNESS = 2;
float kh_no_radar_circles;
void kh_Key_Collect(entity key, entity player) //a player picks up a dropped key
{
- sound(player, CH_TRIGGER, kh_sound_collect, VOL_BASE, ATTN_NORM);
+ sound(player, CH_TRIGGER, kh_sound_collect, VOL_BASE, ATTEN_NORM);
if(key.kh_dropperteam != player.team)
{
{
if(self.siren_time < time)
{
- sound(self.owner, CH_TRIGGER, kh_sound_alarm, VOL_BASE, ATTN_NORM); // play a simple alarm
+ sound(self.owner, CH_TRIGGER, kh_sound_alarm, VOL_BASE, ATTEN_NORM); // play a simple alarm
self.siren_time = time + 2.5; // repeat every 2.5 seconds
}
kh_Key_Remove(self);
}
-string STR_ITEM_KH_KEY = "item_kh_key";
+const string STR_ITEM_KH_KEY = "item_kh_key";
void kh_Key_Spawn(entity initial_owner, float angle, float i) // runs every time a new flag is created, ie after all the keys have been collected
{
entity key;
key.pushltime = time + autocvar_g_balance_keyhunt_protecttime;
key.kh_dropperteam = key.team;
- sound(player, CH_TRIGGER, kh_sound_drop, VOL_BASE, ATTN_NORM);
+ sound(player, CH_TRIGGER, kh_sound_drop, VOL_BASE, ATTEN_NORM);
}
void kh_Key_DropAll(entity player, float suicide) // runs whenever a player dies
if(suicide)
key.kh_dropperteam = player.team;
}
- sound(player, CH_TRIGGER, kh_sound_drop, VOL_BASE, ATTN_NORM);
+ sound(player, CH_TRIGGER, kh_sound_drop, VOL_BASE, ATTEN_NORM);
}
}
MUTATOR_HOOKFUNCTION(lms_SetStartItems)
{
- start_items &~= IT_UNLIMITED_AMMO;
+ start_items &= ~IT_UNLIMITED_AMMO;
start_ammo_shells = cvar("g_lms_start_ammo_shells");
start_ammo_nails = cvar("g_lms_start_ammo_nails");
start_ammo_rockets = cvar("g_lms_start_ammo_rockets");
void nexball_setstatus(void)
{
entity oldself;
- self.items &~= IT_KEY1;
+ self.items &= ~IT_KEY1;
if(self.ballcarried)
{
if(self.ballcarried.teamtime && (self.ballcarried.teamtime < time))
DropBall(self, ownr.origin, ownr.velocity);
makevectors(ownr.v_angle_y * '0 1 0');
ownr.velocity += ('0 0 0.75' - v_forward) * 1000;
- ownr.flags &~= FL_ONGROUND;
+ ownr.flags &= ~FL_ONGROUND;
}
void GiveBall(entity plyr, entity ball)
if((ownr = ball.owner))
{
- ownr.effects &~= autocvar_g_nexball_basketball_effects_default;
+ ownr.effects &= ~autocvar_g_nexball_basketball_effects_default;
ownr.ballcarried = world;
if(ownr.metertime)
{
ball.nb_dropper = plyr;
plyr.effects |= autocvar_g_nexball_basketball_effects_default;
- ball.effects &~= autocvar_g_nexball_basketball_effects_default;
+ ball.effects &= ~autocvar_g_nexball_basketball_effects_default;
ball.velocity = '0 0 0';
ball.movetype = MOVETYPE_NONE;
ownr = self;
self = plyr;
- WEPSET_COPY_EE(self.weaponentity, self);
+ self.weaponentity.weapons = self.weapons;
self.weaponentity.switchweapon = self.weapon;
- WEPSET_COPY_EW(self, WEP_PORTO);
+ self.weapons = WEPSET_PORTO;
weapon_action(WEP_PORTO, WR_RESETPLAYER);
self.switchweapon = WEP_PORTO;
W_SwitchWeapon(WEP_PORTO);
void DropBall(entity ball, vector org, vector vel)
{
ball.effects |= autocvar_g_nexball_basketball_effects_default;
- ball.effects &~= EF_NOSHADOW;
- ball.owner.effects &~= autocvar_g_nexball_basketball_effects_default;
+ ball.effects &= ~EF_NOSHADOW;
+ ball.owner.effects &= ~autocvar_g_nexball_basketball_effects_default;
setattachment(ball, world, "");
setorigin(ball, org);
ball.movetype = MOVETYPE_BOUNCE;
- ball.flags &~= FL_ONGROUND;
+ ball.flags &= ~FL_ONGROUND;
ball.scale = ball_scale;
ball.velocity = vel;
ball.nb_droptime = time;
void InitBall(void)
{
if(gameover) return;
- self.flags &~= FL_ONGROUND;
+ self.flags &= ~FL_ONGROUND;
self.movetype = MOVETYPE_BOUNCE;
if(self.classname == "nexball_basketball")
self.touch = basketball_touch;
self.teamtime = 0;
self.pusher = world;
self.team = FALSE;
- sound(self, CH_TRIGGER, self.noise1, VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER, self.noise1, VOL_BASE, ATTEN_NORM);
WaypointSprite_Ping(self.waypointsprite_attachedforcarrier);
LogNB("init", world);
}
{
if(time > self.lastground + 0.1)
{
- sound(self, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
self.lastground = time;
}
if(vlen(self.velocity) && !self.cnt)
}
else if(other.solid == SOLID_BSP)
{
- sound(self, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
if(vlen(self.velocity) && !self.cnt)
self.nextthink = min(time + autocvar_g_nexball_delay_idle, self.teamtime);
}
pscore = 1;
}
- sound(ball, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NONE);
+ sound(ball, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NONE);
if(ball.team && pscore)
{
if((ball = other.ballcarried) && (IS_PLAYER(attacker)))
{
other.velocity = other.velocity + normalize(self.velocity) * other.damageforcescale * autocvar_g_balance_nexball_secondary_force;
- other.flags &~= FL_ONGROUND;
+ other.flags &= ~FL_ONGROUND;
if(!attacker.ballcarried)
{
LogNB("stole", attacker);
- sound(other, CH_TRIGGER, ball.noise2, VOL_BASE, ATTN_NORM);
+ sound(other, CH_TRIGGER, ball.noise2, VOL_BASE, ATTEN_NORM);
if(attacker.team == other.team && time > attacker.teamkill_complain)
{
{
if(!self.owner)
{
- self.effects &~= EF_FLAME;
+ self.effects &= ~EF_FLAME;
self.scale = 1;
self.customizeentityforclient = func_null;
return TRUE;
if(self.enemy)
self.effects |= EF_FLAME;
else
- self.effects &~= EF_FLAME;
+ self.effects &= ~EF_FLAME;
}
else
{
- self.effects &~= EF_FLAME;
+ self.effects &= ~EF_FLAME;
self.scale = 1;
}
}
else
{
- if(!WEPSET_EMPTY_E(self.weaponentity))
+ if(self.weaponentity.weapons)
{
- WEPSET_COPY_EE(self, self.weaponentity);
+ self.weapons = self.weaponentity.weapons;
weapon_action(WEP_PORTO, WR_RESETPLAYER);
self.switchweapon = self.weaponentity.switchweapon;
W_SwitchWeapon(self.switchweapon);
- WEPSET_CLEAR_E(self.weaponentity);
+ self.weaponentity.weapons = '0 0 0';
}
}
MUTATOR_HOOKFUNCTION(nexball_PlayerSpawn)
{
- WEPSET_CLEAR_E(self.weaponentity);
+ self.weaponentity.weapons = '0 0 0';
if(nexball_mode & NBM_BASKETBALL)
- WEPSET_OR_EW(self, WEP_PORTO);
+ self.weapons |= WEPSET_PORTO;
else
- WEPSET_CLEAR_E(self);
+ self.weapons = '0 0 0';
return FALSE;
}
}
// self.max_health / 300 gives 5 minutes of overtime.
// control points reduce the overtime duration.
- sound(self, CH_TRIGGER, "onslaught/generator_decay.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER, "onslaught/generator_decay.wav", VOL_BASE, ATTEN_NORM);
d = 1;
e = findchain(classname, "onslaught_controlpoint");
while (e)
if(e.team == self.team)
{
centerprint(e, "^1Your generator is NOT shielded!\n^7Re-capture controlpoints to shield it!");
- soundto(MSG_ONE, e, CHAN_AUTO, "kh/alarm.wav", VOL_BASE, ATTN_NONE); // FIXME: Uniqe sound?
+ soundto(MSG_ONE, e, CHAN_AUTO, "kh/alarm.wav", VOL_BASE, ATTEN_NONE); // FIXME: Uniqe sound?
}
}
}
if(random() < 0.01)
{
pointparticles(particleeffectnum("electro_ballexplode"), self.origin + randompos('-50 -50 -20', '50 50 50'), '0 0 0', 1);
- sound(self, CH_TRIGGER, "onslaught/electricity_explode.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER, "onslaught/electricity_explode.wav", VOL_BASE, ATTEN_NORM);
}
else
pointparticles(particleeffectnum("torch_small"), self.origin + randompos('-60 -60 -20', '60 60 60'), '0 0 0', 1);
if(self.count==40||self.count==20)
{
onslaught_generator_ring_spawn(self.origin);
- sound(self, CH_TRIGGER, "onslaught/shockwave.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER, "onslaught/shockwave.wav", VOL_BASE, ATTEN_NORM);
}
// Throw some gibs
if(random() < 0.25)
{
te_explosion(self.origin);
- sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTEN_NORM);
}
// Particles
te_explosion(org);
onslaught_generator_shockwave_spawn(org);
pointparticles(particleeffectnum("onslaught_generator_finalexplosion"), org, '0 0 0', 1);
- sound(self, CH_TRIGGER, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
}
else
self.nextthink = time + 0.05;
// Throw some flaming gibs on damage, more damage = more chance for gib
if(random() < damage/220)
{
- sound(self, CH_TRIGGER, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
i = random();
if(i < 0.3)
ons_throwgib(hitloc + '0 0 20', force * -1, "models/onslaught/gen_gib1.md3", 5, TRUE);
//sound on every hit
if (random() < 0.5)
- sound(self, CH_TRIGGER, "onslaught/ons_hit1.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER, "onslaught/ons_hit1.wav", VOL_BASE, ATTEN_NORM);
else
- sound(self, CH_TRIGGER, "onslaught/ons_hit2.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER, "onslaught/ons_hit2.wav", VOL_BASE, ATTEN_NORM);
}
//throw some gibs on damage
pointparticles(particleeffectnum("sparks"), hitloc, force*-1, 1);
//sound on every hit
if (random() < 0.5)
- sound(self, CH_TRIGGER, "onslaught/ons_hit1.wav", VOL_BASE+0.3, ATTN_NORM);
+ sound(self, CH_TRIGGER, "onslaught/ons_hit1.wav", VOL_BASE+0.3, ATTEN_NORM);
else
- sound(self, CH_TRIGGER, "onslaught/ons_hit2.wav", VOL_BASE+0.3, ATTN_NORM);
+ sound(self, CH_TRIGGER, "onslaught/ons_hit2.wav", VOL_BASE+0.3, ATTEN_NORM);
if (self.health < 0)
{
- sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
{
string t;
pointparticles(particleeffectnum("electricity_sparks"), self.origin + randompos('-10 -10 -20', '10 10 20'), '0 0 0', 1);
if(random() > 0.8)
- sound(self, CH_PAIN, "onslaught/ons_spark1.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_PAIN, "onslaught/ons_spark1.wav", VOL_BASE, ATTEN_NORM);
else if (random() > 0.5)
- sound(self, CH_PAIN, "onslaught/ons_spark2.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_PAIN, "onslaught/ons_spark2.wav", VOL_BASE, ATTEN_NORM);
}
}
self.health = self.max_health;
self.count = autocvar_g_onslaught_cp_regen * sys_frametime; // slow repair rate from now on
self.think = onslaught_controlpoint_icon_think;
- sound(self, CH_TRIGGER, "onslaught/controlpoint_built.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER, "onslaught/controlpoint_built.wav", VOL_BASE, ATTEN_NORM);
bprint(Team_ColoredFullName(self.team), " captured ", self.owner.message, " control point\n");
self.owner.iscaptured = TRUE;
e.think = onslaught_controlpoint_icon_buildthink;
e.nextthink = time + sys_frametime;
e.count = (e.max_health - e.health) * sys_frametime / autocvar_g_onslaught_cp_buildtime; // how long it takes to build
- sound(e, CH_TRIGGER, "onslaught/controlpoint_build.wav", VOL_BASE, ATTN_NORM);
+ sound(e, CH_TRIGGER, "onslaught/controlpoint_build.wav", VOL_BASE, ATTEN_NORM);
self.team = e.team;
self.colormap = e.colormap;
WaypointSprite_UpdateBuildFinished(self.sprite, time + (e.max_health - e.health) / (e.count / sys_frametime));
// the up part of the dodge is a single shot action
if (self.dodging_single_action == 1) {
- self.flags &~= FL_ONGROUND;
+ self.flags &= ~FL_ONGROUND;
self.velocity =
self.velocity
start_ammo_shells = 0;
warmup_start_ammo_shells = 0;
- WEPSET_COPY_AW(start_weapons, WEP_SHOTGUN);
- WEPSET_COPY_AW(warmup_start_weapons, WEP_SHOTGUN);
+ start_weapons = WEPSET_SHOTGUN;
+ warmup_start_weapons = WEPSET_SHOTGUN;
return FALSE;
}
{
self.alpha = default_player_alpha;
self.exteriorweaponentity.alpha = default_weapon_alpha;
- self.items &~= IT_STRENGTH;
+ self.items &= ~IT_STRENGTH;
Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERDOWN_INVISIBILITY);
}
}
play_countdown(self.invincible_finished, "misc/poweroff.wav");
if (time > self.invincible_finished)
{
- self.items &~= IT_INVINCIBLE;
+ self.items &= ~IT_INVINCIBLE;
Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERDOWN_SPEED);
}
}
start_health = 100;
start_armorvalue = 0;
- WEPSET_COPY_AW(start_weapons, WEP_MINSTANEX);
- WEPSET_COPY_AW(warmup_start_weapons, WEP_MINSTANEX);
+ start_weapons = WEPSET_MINSTANEX;
+ warmup_start_weapons = WEPSET_MINSTANEX;
start_items |= IT_UNLIMITED_SUPERWEAPONS;
return FALSE;
default: expef = "nade_explode"; break;
}
- sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTN_NORM);
- sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM);
+ sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum(expef), self.origin + '0 0 1', '0 0 0', 1);
Damage_DamageInfo(self.origin, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage, autocvar_g_nades_nade_radius, '1 1 1' * autocvar_g_nades_nade_force, self.projectiledeathtype, 0, self);
//UpdateCSQCProjectile(self);
if(self.health == self.max_health)
{
- spamsound(self, CH_SHOTS, strcat("weapons/grenade_bounce", ftos(1 + rint(random() * 5)), ".wav"), VOL_BASE, ATTN_NORM);
+ spamsound(self, CH_SHOTS, strcat("weapons/grenade_bounce", ftos(1 + rint(random() * 5)), ".wav"), VOL_BASE, ATTEN_NORM);
return;
}
void nade_beep()
{
- sound(self, CH_SHOTS_SINGLE, "overkill/grenadebip.ogg", VOL_BASE, 0.5 *(ATTN_LARGE + ATTN_MAX));
+ sound(self, CH_SHOTS_SINGLE, "overkill/grenadebip.ogg", VOL_BASE, 0.5 *(ATTEN_LARGE + ATTEN_MAX));
self.think = nade_boom;
self.nextthink = max(self.wait, time);
}
if(self.health == self.max_health)
{
- sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, 0.5 *(ATTN_LARGE + ATTN_MAX));
+ sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, 0.5 *(ATTEN_LARGE + ATTEN_MAX));
self.nextthink = max(time + autocvar_g_nades_nade_lifetime, time);
self.think = nade_beep;
}
MUTATOR_HOOKFUNCTION(nades_PlayerPreThink)
{
- float key_pressed = ((g_grappling_hook || client_hasweapon(self, WEP_HOOK, FALSE, FALSE) || WEPSET_CONTAINS_AW(weaponsInMap, WEP_HOOK)) ? self.button16 : self.BUTTON_HOOK);
+ float key_pressed = ((g_grappling_hook || client_hasweapon(self, WEP_HOOK, FALSE, FALSE) || (weaponsInMap & WEPSET_HOOK)) ? self.button16 : self.BUTTON_HOOK);
if(self.nade)
if(self.nade.wait - 0.1 <= time)
float i, j, k, n;
- WEPSET_DECLARE_A(newdefault);
- WEPSET_DECLARE_A(warmup_newdefault);
+ WepSet newdefault;
+ WepSet warmup_newdefault;
- WEPSET_CLEAR_A(newdefault);
- WEPSET_CLEAR_A(warmup_newdefault);
+ newdefault = '0 0 0';
+ warmup_newdefault = '0 0 0';
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
{
for(k = WEP_FIRST; k <= WEP_LAST; ++k)
if(get_weaponinfo(k).netname == argv(j))
{
- if(WEPSET_CONTAINS_AW(start_weapons, i))
- WEPSET_OR_AW(newdefault, k);
- if(WEPSET_CONTAINS_AW(warmup_start_weapons, i))
- WEPSET_OR_AW(warmup_newdefault, k);
+ if(start_weapons & WepSet_FromWeapon(i))
+ newdefault |= WepSet_FromWeapon(k);
+ if(warmup_start_weapons & WepSet_FromWeapon(i))
+ warmup_newdefault |= WepSet_FromWeapon(k);
}
}
- WEPSET_AND_AA(newdefault, start_weapons_defaultmask);
- WEPSET_ANDNOT_AA(start_weapons, start_weapons_defaultmask);
- WEPSET_OR_AA(start_weapons, newdefault);
+ newdefault &= start_weapons_defaultmask;
+ start_weapons &= ~start_weapons_defaultmask;
+ start_weapons |= newdefault;
- WEPSET_AND_AA(warmup_newdefault, warmup_start_weapons_defaultmask);
- WEPSET_ANDNOT_AA(warmup_start_weapons, warmup_start_weapons_defaultmask);
- WEPSET_OR_AA(warmup_start_weapons, warmup_newdefault);
+ warmup_newdefault &= warmup_start_weapons_defaultmask;
+ warmup_start_weapons &= ~warmup_start_weapons_defaultmask;
+ warmup_start_weapons |= warmup_newdefault;
return 0;
}
float i;
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
if(nt_IsNewToy(i))
- get_weaponinfo(i).spawnflags &~= WEP_FLAG_MUTATORBLOCKED;
+ get_weaponinfo(i).spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
}
MUTATOR_ONROLLBACK_OR_REMOVE
return FALSE;
if(g_weaponarena)
{
- if not(WEPSET_CONTAINS_AW(g_weaponarena_weapons, wpn))
+ if(!(g_weaponarena_weapons & WepSet_FromWeapon(wpn)))
return FALSE;
}
else
self.nix_nextincr = time + autocvar_g_balance_nix_incrtime;
}
- WEPSET_CLEAR_E(self);
+ self.weapons = '0 0 0';
if(g_nix_with_laser)
- WEPSET_ANDNOT_EW(self, WEP_LASER);
- WEPSET_OR_EW(self, nix_weapon);
+ self.weapons &= ~WEPSET_LASER;
+ self.weapons |= WepSet_FromWeapon(nix_weapon);
if(self.switchweapon != nix_weapon)
if(!client_hasweapon(self, self.switchweapon, TRUE, FALSE))
e.ammo_nails = start_ammo_nails;
e.ammo_rockets = start_ammo_rockets;
e.ammo_fuel = start_ammo_fuel;
- WEPSET_COPY_EA(e, start_weapons);
+ e.weapons = start_weapons;
if(!client_hasweapon(e, e.weapon, TRUE, FALSE))
e.switchweapon = w_getbestweapon(self);
}
{
float j;
for(j = WEP_FIRST; j <= WEP_LAST; ++j)
- if(WEPSET_CONTAINS_EW(self, j))
+ if(self.weapons & WepSet_FromWeapon(j))
if(self.switchweapon != j)
if(W_IsWeaponThrowable(j))
W_ThrowNewWeapon(self, j, FALSE, self.origin + (self.mins + self.maxs) * 0.5, randomvec() * 175 + '0 0 325');
superspec_msg("", "", self, sprintf("Player %s^7 just picked up ^3%s\n", other.netname, _item.netname), 1);
else
superspec_msg("", "", self, sprintf("Player %s^7 just picked up ^3%s\n^8(%s^8)\n", other.netname, _item.netname, _item.classname), 1);
- if(self.autospec_flags& ASF_SSIM && self.enemy != other)
+ if((self.autospec_flags & ASF_SSIM) && self.enemy != other)
{
_spectate(other);
else if(argv(i) == "off" || argv(i) == "0")
{
if(_start == 1)
- self.superspec_flags &~= _bits;
+ self.superspec_flags &= ~_bits;
_bits = 0;
}
else if(argv(i) == "off" || argv(i) == "0")
{
if(_start == 1)
- self.autospec_flags &~= _bits;
+ self.autospec_flags &= ~_bits;
_bits = 0;
}
org = (p1.origin + p2.origin) * 0.5;
org_z += (p1.mins_z + p2.mins_z) * 0.5;
- sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("explosion_small"), org, '0 0 0', 1);
entity e;
intensity -= autocvar_g_sandbox_object_material_velocity_min; // start from minimum velocity, not actual velocity
intensity = bound(0, intensity * autocvar_g_sandbox_object_material_velocity_factor, 1);
- sound(self, CH_TRIGGER, strcat("object/impact_", self.material, "_", ftos(ceil(random() * 5)) , ".wav"), VOL_BASE * intensity, ATTN_NORM);
+ sound(self, CH_TRIGGER, strcat("object/impact_", self.material, "_", ftos(ceil(random() * 5)) , ".wav"), VOL_BASE * intensity, ATTEN_NORM);
pointparticles(particleeffectnum(strcat("impact_", self.material)), self.origin, '0 0 0', ceil(intensity * 10)); // allow a count from 1 to 10
}
// time the player was alive and kicking
-string PLAYERSTATS_ALIVETIME = "alivetime";
-string PLAYERSTATS_AVGLATENCY = "avglatency";
-string PLAYERSTATS_WINS = "wins";
-string PLAYERSTATS_MATCHES = "matches";
-string PLAYERSTATS_JOINS = "joins";
-string PLAYERSTATS_SCOREBOARD_VALID = "scoreboardvalid";
-string PLAYERSTATS_RANK = "rank";
-string PLAYERSTATS_SCOREBOARD_POS = "scoreboardpos";
-
-string PLAYERSTATS_TOTAL = "total-";
-string PLAYERSTATS_SCOREBOARD = "scoreboard-";
-
-string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_3 = "achievement-kill-spree-3";
-string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_5 = "achievement-kill-spree-5";
-string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_10 = "achievement-kill-spree-10";
-string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_15 = "achievement-kill-spree-15";
-string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_20 = "achievement-kill-spree-20";
-string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_25 = "achievement-kill-spree-25";
-string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_30 = "achievement-kill-spree-30";
-string PLAYERSTATS_ACHIEVEMENT_BOTLIKE = "achievement-botlike";
-string PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD = "achievement-firstblood";
-string PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM = "achievement-firstvictim";
+const string PLAYERSTATS_ALIVETIME = "alivetime";
+const string PLAYERSTATS_AVGLATENCY = "avglatency";
+const string PLAYERSTATS_WINS = "wins";
+const string PLAYERSTATS_MATCHES = "matches";
+const string PLAYERSTATS_JOINS = "joins";
+const string PLAYERSTATS_SCOREBOARD_VALID = "scoreboardvalid";
+const string PLAYERSTATS_RANK = "rank";
+const string PLAYERSTATS_SCOREBOARD_POS = "scoreboardpos";
+
+const string PLAYERSTATS_TOTAL = "total-";
+const string PLAYERSTATS_SCOREBOARD = "scoreboard-";
+
+const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_3 = "achievement-kill-spree-3";
+const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_5 = "achievement-kill-spree-5";
+const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_10 = "achievement-kill-spree-10";
+const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_15 = "achievement-kill-spree-15";
+const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_20 = "achievement-kill-spree-20";
+const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_25 = "achievement-kill-spree-25";
+const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_30 = "achievement-kill-spree-30";
+const string PLAYERSTATS_ACHIEVEMENT_BOTLIKE = "achievement-botlike";
+const string PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD = "achievement-firstblood";
+const string PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM = "achievement-firstvictim";
// delay map switch until this is set
float playerstats_waitforme;
if(killed)
{
fixedmakevectors(portal.mangle);
- sound(portal, CH_SHOTS, "porto/explode.wav", VOL_BASE, ATTN_NORM);
+ sound(portal, CH_SHOTS, "porto/explode.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("rocket_explode"), portal.origin + v_forward * 16, v_forward * 1024, 4);
remove(portal);
}
else
{
Portal_MakeBrokenPortal(portal);
- sound(portal, CH_SHOTS, "porto/expire.wav", VOL_BASE, ATTN_NORM);
+ sound(portal, CH_SHOTS, "porto/expire.wav", VOL_BASE, ATTEN_NORM);
SUB_SetFade(portal, time, 0.5);
}
}
{
if(!strict && !(fieldflags & SFL_SORT_PRIO_MASK)) // column does not sort
return previous;
- if(fieldflags & SFL_SORT_PRIO_MASK < previous_y)
+ if((fieldflags & SFL_SORT_PRIO_MASK) < previous_y)
return previous;
if(t1.field == t2.field)
return previous;
{
scores_label[i] = label;
scores_flags[i] = scoreflags;
- if(scoreflags & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_PRIMARY)
+ if((scoreflags & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
{
scores_primary = scores[i];
scores_flags_primary = scoreflags;
{
teamscores_label[i] = label;
teamscores_flags[i] = scoreflags;
- if(scoreflags & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_PRIMARY)
+ if((scoreflags & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
{
teamscores_primary = teamscores[i];
teamscores_flags_primary = scoreflags;
{
if(fl & SFL_LOWER_IS_BETTER)
label = strcat(label, "<");
- if(fl & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_PRIMARY)
+ if((fl & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
label = strcat(label, "!!");
- else if(fl & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_SECONDARY)
+ else if((fl & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_SECONDARY)
label = strcat(label, "!");
return label;
}
{
// label
for(i = 0; i < MAX_SCORE; ++i)
- if(scores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_PRIMARY)
+ if((scores_flags[i] & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
{
f = scores_flags[i];
l = scores_label[i];
}
if(shortString < 2)
for(i = 0; i < MAX_SCORE; ++i)
- if(scores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_SECONDARY)
+ if((scores_flags[i] & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_SECONDARY)
{
f = scores_flags[i];
l = scores_label[i];
}
if(shortString < 1)
for(i = 0; i < MAX_SCORE; ++i)
- if(scores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_PRIMARY)
- if(scores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_SECONDARY)
+ if((scores_flags[i] & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_PRIMARY)
+ if((scores_flags[i] & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_SECONDARY)
{
f = scores_flags[i];
l = scores_label[i];
else if((sk = pl.scorekeeper))
{
for(i = 0; i < MAX_SCORE; ++i)
- if(scores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_PRIMARY)
+ if((scores_flags[i] & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
out = strcat(out, ftos(sk.(scores[i])), ",");
if(shortString < 2)
for(i = 0; i < MAX_SCORE; ++i)
- if(scores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_SECONDARY)
+ if((scores_flags[i] & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_SECONDARY)
out = strcat(out, ftos(sk.(scores[i])), ",");
if(shortString < 1)
for(i = 0; i < MAX_SCORE; ++i)
- if(scores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_PRIMARY)
- if(scores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_SECONDARY)
+ if((scores_flags[i] & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_PRIMARY)
+ if((scores_flags[i] & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_SECONDARY)
out = strcat(out, ftos(sk.(scores[i])), ",");
out = substring(out, 0, strlen(out) - 1);
}
{
// label
for(i = 0; i < MAX_TEAMSCORE; ++i)
- if(teamscores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_PRIMARY)
+ if((teamscores_flags[i] & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
{
f = teamscores_flags[i];
l = teamscores_label[i];
}
if(shortString < 2)
for(i = 0; i < MAX_TEAMSCORE; ++i)
- if(teamscores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_SECONDARY)
+ if((teamscores_flags[i] & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_SECONDARY)
{
f = teamscores_flags[i];
l = teamscores_label[i];
}
if(shortString < 1)
for(i = 0; i < MAX_TEAMSCORE; ++i)
- if(teamscores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_PRIMARY)
- if(teamscores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_SECONDARY)
+ if((teamscores_flags[i] & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_PRIMARY)
+ if((teamscores_flags[i] & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_SECONDARY)
{
f = teamscores_flags[i];
l = teamscores_label[i];
else if((sk = teamscorekeepers[tm - 1]))
{
for(i = 0; i < MAX_TEAMSCORE; ++i)
- if(teamscores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_PRIMARY)
+ if((teamscores_flags[i] & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
out = strcat(out, ftos(sk.(teamscores[i])), ",");
if(shortString < 2)
for(i = 0; i < MAX_TEAMSCORE; ++i)
- if(teamscores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_SECONDARY)
+ if((teamscores_flags[i] & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_SECONDARY)
out = strcat(out, ftos(sk.(teamscores[i])), ",");
if(shortString < 1)
for(i = 0; i < MAX_TEAMSCORE; ++i)
- if(teamscores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_PRIMARY)
- if(teamscores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_SECONDARY)
+ if((teamscores_flags[i] & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_PRIMARY)
+ if((teamscores_flags[i] & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_SECONDARY)
out = strcat(out, ftos(sk.(teamscores[i])), ",");
out = substring(out, 0, strlen(out) - 1);
}
if (self.watersound_finished < time)
{
self.watersound_finished = time + 0.5;
- sound (self, CH_PLAYER, "player/lava.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_PLAYER, "player/lava.wav", VOL_BASE, ATTEN_NORM);
}
Damage (self, world, world, autocvar_g_balance_contents_playerdamage_lava * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_LAVA, self.origin, '0 0 0');
}
if (self.watersound_finished < time)
{
self.watersound_finished = time + 0.5;
- sound (self, CH_PLAYER, "player/slime.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_PLAYER, "player/slime.wav", VOL_BASE, ATTEN_NORM);
}
Damage (self, world, world, autocvar_g_balance_contents_playerdamage_slime * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_SLIME, self.origin, '0 0 0');
}
if (self.flags & FL_INWATER)
{
// play leave water sound
- self.flags &~= FL_INWATER;
+ self.flags &= ~FL_INWATER;
self.dmgtime = 0;
}
self.air_finished = time + 12;
#pragma noref 0
-#undef ATTN_NORM
+#undef ATTEN_NORM
#undef objerror
#undef droptofloor
#undef sound
#define SVQC
-#define ATTN_NORM builtin_ATTN_NORM
+#define ATTEN_NORM builtin_ATTEN_NORM
#define objerror builtin_objerror
#define droptofloor builtin_droptofloor
#define sound builtin_sound
if(self.ItemStatus & ITS_AVAILABLE)
self.effects |= (EF_ADDITIVE | EF_FULLBRIGHT);
else
- self.effects &~= (EF_ADDITIVE | EF_FULLBRIGHT);
+ self.effects &= ~(EF_ADDITIVE | EF_FULLBRIGHT);
}
}
if(self.gravity)
sf |= ISF_DROP;
else
- sf &~= ISF_DROP;
+ sf &= ~ISF_DROP;
WriteByte(MSG_ENTITY, ENT_CLIENT_ITEM);
WriteByte(MSG_ENTITY, sf);
if(autocvar_g_pickup_items == 0)
return FALSE;
if(g_weaponarena)
- if(!WEPSET_EMPTY_E(self) || (self.items & IT_AMMO))
+ if(self.weapons || (self.items & IT_AMMO))
return FALSE;
}
return TRUE;
{
if(self.spawnshieldtime)
return TRUE;
- if(!WEPSET_CONTAINS_ALL_EE(other, self))
+ if(self.weapons & ~other.weapons)
{
self.colormod = '0 0 0';
self.glowmod = self.colormod;
void Item_Show (entity e, float mode)
{
- e.effects &~= EF_ADDITIVE | EF_STARDUST | EF_FULLBRIGHT | EF_NODEPTHTEST;
- e.ItemStatus &~= ITS_STAYWEP;
+ e.effects &= ~(EF_ADDITIVE | EF_STARDUST | EF_FULLBRIGHT | EF_NODEPTHTEST);
+ e.ItemStatus &= ~ITS_STAYWEP;
if (mode > 0)
{
// make the item look normal, and be touchable
e.model = string_null;
e.solid = SOLID_NOT;
e.spawnshieldtime = 1;
- e.ItemStatus &~= ITS_AVAILABLE;
+ e.ItemStatus &= ~ITS_AVAILABLE;
}
else if((e.flags & FL_WEAPON) && !(e.flags & FL_NO_WEAPON_STAY) && g_weapon_stay)
{
e.colormod = '0 0 0';
e.glowmod = e.colormod;
e.spawnshieldtime = 1;
- e.ItemStatus &~= ITS_AVAILABLE;
+ e.ItemStatus &= ~ITS_AVAILABLE;
}
if (e.items & IT_STRENGTH || e.items & IT_INVINCIBLE)
Item_Show(self, 1);
// this is ugly...
if(self.items == IT_STRENGTH)
- sound (self, CH_TRIGGER, "misc/strength_respawn.wav", VOL_BASE, ATTN_NORM); // play respawn sound
+ sound (self, CH_TRIGGER, "misc/strength_respawn.wav", VOL_BASE, ATTEN_NORM); // play respawn sound
else if(self.items == IT_INVINCIBLE)
- sound (self, CH_TRIGGER, "misc/shield_respawn.wav", VOL_BASE, ATTN_NORM); // play respawn sound
+ sound (self, CH_TRIGGER, "misc/shield_respawn.wav", VOL_BASE, ATTEN_NORM); // play respawn sound
else
- sound (self, CH_TRIGGER, "misc/itemrespawn.wav", VOL_BASE, ATTN_NORM); // play respawn sound
+ sound (self, CH_TRIGGER, "misc/itemrespawn.wav", VOL_BASE, ATTEN_NORM); // play respawn sound
setorigin (self, self.origin);
//pointparticles(particleeffectnum("item_respawn"), self.origin + self.mins_z * '0 0 1' + '0 0 48', '0 0 0', 1);
localcmd(sprintf("prvm_edict server %d\n", num_for_edict(self)));
}
}
- sound (self, CH_TRIGGER, "misc/itemrespawncountdown.wav", VOL_BASE, ATTN_NORM); // play respawn sound
+ sound (self, CH_TRIGGER, "misc/itemrespawncountdown.wav", VOL_BASE, ATTEN_NORM); // play respawn sound
if(self.waypointsprite_attached)
{
WaypointSprite_Ping(self.waypointsprite_attached);
void Item_ScheduleRespawnIn(entity e, float t)
{
- if((e.flags & FL_POWERUP) || WEPSET_CONTAINS_ANY_EA(e, WEPBIT_SUPERWEAPONS))
+ if((e.flags & FL_POWERUP) || (e.weapons & WEPSET_SUPERWEAPONS))
{
e.think = Item_RespawnCountdown;
e.nextthink = time + max(0, t - ITEM_RESPAWN_TICKS);
Item_ScheduleRespawnIn(e, game_starttime - time + ITEM_RESPAWNTIME_INITIAL(e));
}
-float ITEM_MODE_NONE = 0;
-float ITEM_MODE_HEALTH = 1;
-float ITEM_MODE_ARMOR = 2;
-float ITEM_MODE_FUEL = 3;
+const float ITEM_MODE_NONE = 0;
+const float ITEM_MODE_HEALTH = 1;
+const float ITEM_MODE_ARMOR = 2;
+const float ITEM_MODE_FUEL = 3;
float Item_GiveAmmoTo(entity item, entity player, .float ammofield, float ammomax, float mode)
{
if (!item.ammofield)
if (player.switchweapon == w_getbestweapon(player))
_switchweapon = TRUE;
- if not(WEPSET_CONTAINS_EW(player, player.switchweapon))
+ if not(player.weapons & WepSet_FromWeapon(player.switchweapon))
_switchweapon = TRUE;
pickedup |= Item_GiveAmmoTo(item, player, ammo_fuel, g_pickup_fuel_max, ITEM_MODE_FUEL);
if (item.flags & FL_WEAPON)
{
- WEPSET_DECLARE_A(it);
- WEPSET_COPY_AE(it, item);
- WEPSET_ANDNOT_AE(it, player);
+ WepSet it;
+ it = item.weapons;
+ it &= ~player.weapons;
- if (!WEPSET_EMPTY_A(it) || (item.spawnshieldtime && item.pickup_anyway))
+ if (it || (item.spawnshieldtime && item.pickup_anyway))
{
pickedup = TRUE;
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
- if(WEPSET_CONTAINS_AW(it, i))
+ if(it & WepSet_FromWeapon(i))
W_GiveWeapon(player, i);
}
}
other.last_pickup = time;
pointparticles(particleeffectnum("item_pickup"), self.origin, '0 0 0', 1);
- sound (other, CH_TRIGGER, self.item_pickupsound, VOL_BASE, ATTN_NORM);
+ sound (other, CH_TRIGGER, self.item_pickupsound, VOL_BASE, ATTEN_NORM);
if (self.classname == "droppedweapon")
remove (self);
if(self.waypointsprite_attached)
WaypointSprite_Kill(self.waypointsprite_attached);
- if((self.flags & FL_POWERUP) | WEPSET_CONTAINS_ANY_EA(self, WEPBIT_SUPERWEAPONS)) // do not spawn powerups initially!
+ if((self.flags & FL_POWERUP) || (self.weapons & WEPSET_SUPERWEAPONS)) // do not spawn powerups initially!
Item_ScheduleInitialRespawn(self);
}
}
Item_Show(head, -1);
head.state = 1; // state 1 = initially hidden item
}
- head.effects &~= EF_NODRAW;
+ head.effects &= ~EF_NODRAW;
}
Item_Reset();
float c, j, position;
// See if I have it already
- if(!WEPSET_CONTAINS_ALL_EE(player, item))
+ if(item.weapons & ~player.weapons)
{
// If I can pick it up
if(!item.spawnshieldtime)
{
wi = get_weaponinfo(i);
- if not(WEPSET_CONTAINS_EW(player, i))
+ if not(player.weapons & WepSet_FromWeapon(i))
continue;
if(wi.items & IT_SHELLS)
self.weapon = weaponid;
if(weaponid)
- WEPSET_COPY_EW(self, weaponid);
+ self.weapons = WepSet_FromWeapon(weaponid);
self.flags = FL_ITEM | itemflags;
if(self.strength_finished || self.invincible_finished || self.superweapons_finished)
/*
if(self.items == 0)
- if(WEPSET_CONTAINS_ALL_AE(WEPBIT_SUPERWEAPONS, self)) // only superweapons
+ if(!(self.weapons & ~WEPSET_SUPERWEAPONS)) // only superweapons
if(self.ammo_nails == 0)
if(self.ammo_cells == 0)
if(self.ammo_rockets == 0)
self.is_item = TRUE;
}
- WEPSET_OR_AW(weaponsInMap, weaponid);
+ weaponsInMap |= WepSet_FromWeapon(weaponid);
precache_model (self.model);
precache_sound (self.item_pickupsound);
if(!self.respawntime)
{
- if(WEPSET_CONTAINS_ANY_EA(e, WEPBIT_SUPERWEAPONS))
+ if(e.weapons & WEPSET_SUPERWEAPONS)
{
self.respawntime = g_pickup_respawntime_superweapon;
self.respawntimejitter = g_pickup_respawntimejitter_superweapon;
}
}
- if(WEPSET_CONTAINS_ANY_EA(e, WEPBIT_SUPERWEAPONS))
+ if(e.weapons & WEPSET_SUPERWEAPONS)
if(!self.superweapons_finished)
self.superweapons_finished = autocvar_g_balance_superweapons_time;
f = FL_WEAPON;
// no weapon-stay on superweapons
- if(WEPSET_CONTAINS_ANY_EA(e, WEPBIT_SUPERWEAPONS))
+ if(e.weapons & WEPSET_SUPERWEAPONS)
f |= FL_NO_WEAPON_STAY;
// weapon stay isn't supported for teamed weapons
e = get_weaponinfo(j);
if(argv(i) == e.netname)
{
- WEPSET_OR_EW(self, j);
+ self.weapons |= WepSet_FromWeapon(j);
if(self.spawnflags == 0 || self.spawnflags == 2)
weapon_action(e.weapon, WR_PRECACHE);
break;
{
e = get_weaponinfo(j);
if(e.weapon)
- self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, WEPSET_CONTAINS_EW(self, j), e.netname);
+ self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, !!(self.weapons & WepSet_FromWeapon(j)), e.netname);
}
}
self.netname = strzone(self.netname);
float GiveWeapon(entity e, float wpn, float op, float val)
{
- float v0, v1;
- v0 = WEPSET_CONTAINS_EW(e, wpn);
+ WepSet v0, v1;
+ v0 = (e.weapons & WepSet_FromWeapon(wpn));
switch(op)
{
case OP_SET:
if(val > 0)
- WEPSET_OR_EW(e, wpn);
+ e.weapons |= WepSet_FromWeapon(wpn);
else
- WEPSET_ANDNOT_EW(e, wpn);
+ e.weapons &= ~WepSet_FromWeapon(wpn);
break;
case OP_MIN:
case OP_PLUS:
if(val > 0)
- WEPSET_OR_EW(e, wpn);
+ e.weapons |= WepSet_FromWeapon(wpn);
break;
case OP_MAX:
if(val <= 0)
- WEPSET_ANDNOT_EW(e, wpn);
+ e.weapons &= ~WepSet_FromWeapon(wpn);
break;
case OP_MINUS:
if(val > 0)
- WEPSET_ANDNOT_EW(e, wpn);
+ e.weapons &= ~WepSet_FromWeapon(wpn);
break;
}
- v1 = WEPSET_CONTAINS_EW(e, wpn);
+ v1 = (e.weapons & WepSet_FromWeapon(wpn));
return (v0 != v1);
}
if(val > 0)
e.fld |= bit;
else
- e.fld &~= bit;
+ e.fld &= ~bit;
break;
case OP_MIN:
case OP_PLUS:
break;
case OP_MAX:
if(val <= 0)
- e.fld &~= bit;
+ e.fld &= ~bit;
break;
case OP_MINUS:
if(val > 0)
- e.fld &~= bit;
+ e.fld &= ~bit;
break;
}
v1 = (e.fld & bit);
if(v1 <= v0 - t)
{
if(snd_decr != "")
- sound (e, CH_TRIGGER, snd_decr, VOL_BASE, ATTN_NORM);
+ sound (e, CH_TRIGGER, snd_decr, VOL_BASE, ATTEN_NORM);
}
else if(v0 >= v0 + t)
{
if(snd_incr != "")
- sound (e, CH_TRIGGER, snd_incr, VOL_BASE, ATTN_NORM);
+ sound (e, CH_TRIGGER, snd_incr, VOL_BASE, ATTEN_NORM);
}
}
e.regenfield = max(e.regenfield, time + regentime);
}
-#define PREGIVE_WEAPONS(e) WEPSET_DECLARE_A(save_weapons); WEPSET_COPY_AE(save_weapons, e)
+#define PREGIVE_WEAPONS(e) WepSet save_weapons; save_weapons = e.weapons
#define PREGIVE(e,f) float save_##f; save_##f = (e).f
-#define POSTGIVE_WEAPON(e,b,snd_incr,snd_decr) GiveSound((e), WEPSET_CONTAINS_AW(save_weapons, b), WEPSET_CONTAINS_EW(e, b), 0, snd_incr, snd_decr)
+#define POSTGIVE_WEAPON(e,b,snd_incr,snd_decr) GiveSound((e), !!(save_weapons & WepSet_FromWeapon(b)), !!(e.weapons & WepSet_FromWeapon(b)), 0, snd_incr, snd_decr)
#define POSTGIVE_BIT(e,f,b,snd_incr,snd_decr) GiveSound((e), save_##f & (b), (e).f & (b), 0, snd_incr, snd_decr)
#define POSTGIVE_VALUE(e,f,t,snd_incr,snd_decr) GiveSound((e), save_##f, (e).f, t, snd_incr, snd_decr)
#define POSTGIVE_VALUE_ROT(e,f,t,rotfield,rottime,regenfield,regentime,snd_incr,snd_decr) GiveRot((e), save_##f, (e).f, rotfield, rottime, regenfield, regentime); GiveSound((e), save_##f, (e).f, t, snd_incr, snd_decr)
if(wi.weapon)
{
POSTGIVE_WEAPON(e, j, "weapons/weaponpickup.wav", string_null);
- if not(WEPSET_CONTAINS_AW(save_weapons, j))
- if(WEPSET_CONTAINS_EW(e, j))
+ if not(save_weapons & WepSet_FromWeapon(j))
+ if(e.weapons & WepSet_FromWeapon(j))
weapon_action(wi.weapon, WR_PRECACHE);
}
}
POSTGIVE_VALUE_ROT(e, health, 1, pauserothealth_finished, autocvar_g_balance_pause_health_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, "misc/megahealth.wav", string_null);
if(e.superweapons_finished <= 0)
- if(WEPSET_CONTAINS_ANY_EA(self, WEPBIT_SUPERWEAPONS))
+ if(self.weapons & WEPSET_SUPERWEAPONS)
e.superweapons_finished = autocvar_g_balance_superweapons_time;
if(e.strength_finished <= 0)
else
e.superweapons_finished += time;
- if not(WEPSET_CONTAINS_EW(e, e.switchweapon))
+ if not(e.weapons & WepSet_FromWeapon(e.switchweapon))
_switchweapon = TRUE;
if(_switchweapon)
W_SwitchWeapon_Force(e, w_getbestweapon(e));
-float PUSH_ONCE = 1;
-float PUSH_SILENT = 2;
+const float PUSH_ONCE = 1;
+const float PUSH_SILENT = 2;
.float pushltime;
.float istypefrag;
return;
if(self.team)
- if((self.spawnflags & 4 == 0) == (self.team != other.team))
+ if(((self.spawnflags & 4) == 0) == (self.team != other.team))
return;
EXACTTRIGGER_TOUCH;
other.velocity = self.movedir;
}
- other.flags &~= FL_ONGROUND;
+ other.flags &= ~FL_ONGROUND;
if (IS_PLAYER(other))
{
{
// flash when activated
pointparticles(particleeffectnum("jumppad_activate"), other.origin, other.velocity, 1);
- sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
+ sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
self.pushltime = time + 0.2;
}
if(IS_REAL_CLIENT(other) || IS_BOT_CLIENT(other))
}
-float STATE_TOP = 0;
-float STATE_BOTTOM = 1;
-float STATE_UP = 2;
-float STATE_DOWN = 3;
-
.entity trigger_field;
void() plat_center_touch;
void() plat_go_up;
void() plat_go_down;
void() plat_crush;
-float PLAT_LOW_TRIGGER = 1;
+const float PLAT_LOW_TRIGGER = 1;
void plat_spawn_inside_trigger()
{
void plat_hit_top()
{
- sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTN_NORM);
+ sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
self.state = 1;
self.think = plat_go_down;
self.nextthink = self.ltime + 3;
void plat_hit_bottom()
{
- sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTN_NORM);
+ sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
self.state = 2;
}
void plat_go_down()
{
- sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTN_NORM);
+ sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_NORM);
self.state = 3;
SUB_CalcMove (self.pos2, self.speed, plat_hit_bottom);
}
void plat_go_up()
{
- sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTN_NORM);
+ sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_NORM);
self.state = 4;
SUB_CalcMove (self.pos1, self.speed, plat_hit_top);
}
SUB_CalcMove(targ.origin - self.mins, self.speed, train_wait);
if(self.noise != "")
- sound(self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTN_IDLE);
+ sound(self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_IDLE);
}
void func_train_find()
if (self.noise != "")
{
precache_sound(self.noise);
- ambientsound(self.origin, self.noise, VOL_BASE, ATTN_IDLE);
+ ambientsound(self.origin, self.noise, VOL_BASE, ATTEN_IDLE);
}
self.active = ACTIVE_ACTIVE;
if (self.noise != "")
{
precache_sound(self.noise);
- soundto(MSG_INIT, self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTN_IDLE);
+ soundto(MSG_INIT, self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_IDLE);
}
if (!self.speed)
self.speed = 4;
if (self.noise != "")
{
precache_sound(self.noise);
- soundto(MSG_INIT, self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTN_IDLE);
+ soundto(MSG_INIT, self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_IDLE);
}
self.active = ACTIVE_ACTIVE;
return;
if (self.noise != "")
- sound (self, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
+ sound (self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
self.state = STATE_UP;
SUB_CalcMove (self.pos2, self.speed, button_wait);
}
-float DOOR_START_OPEN = 1;
-float DOOR_DONT_LINK = 4;
-float DOOR_TOGGLE = 32;
+const float DOOR_START_OPEN = 1;
+const float DOOR_DONT_LINK = 4;
+const float DOOR_TOGGLE = 32;
/*
void door_hit_top()
{
if (self.noise1 != "")
- sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTN_NORM);
+ sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
self.state = STATE_TOP;
if (self.spawnflags & DOOR_TOGGLE)
return; // don't come down automatically
void door_hit_bottom()
{
if (self.noise1 != "")
- sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTN_NORM);
+ sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
self.state = STATE_BOTTOM;
}
void door_go_down()
{
if (self.noise2 != "")
- sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
+ sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
if (self.max_health)
{
self.takedamage = DAMAGE_YES;
}
if (self.noise2 != "")
- sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
+ sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
self.state = STATE_UP;
SUB_CalcMove (self.pos2, self.speed, door_hit_top);
void door_rotating_hit_top()
{
if (self.noise1 != "")
- sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTN_NORM);
+ sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
self.state = STATE_TOP;
if (self.spawnflags & DOOR_TOGGLE)
return; // don't come down automatically
void door_rotating_hit_bottom()
{
if (self.noise1 != "")
- sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTN_NORM);
+ sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
if (self.lip==666) // self.lip is used to remember reverse opening direction for door_rotating
{
self.pos2 = '0 0 0' - self.pos2;
void door_rotating_go_down()
{
if (self.noise2 != "")
- sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
+ sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
if (self.max_health)
{
self.takedamage = DAMAGE_YES;
return;
}
if (self.noise2 != "")
- sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
+ sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
self.state = STATE_UP;
SUB_CalcAngleMove (self.pos2, self.speed, door_rotating_hit_top);
void() fd_secret_move6;
void() fd_secret_done;
-float SECRET_OPEN_ONCE = 1; // stays open
-float SECRET_1ST_LEFT = 2; // 1st move is left of arrow
-float SECRET_1ST_DOWN = 4; // 1st move is down from arrow
-float SECRET_NO_SHOOT = 8; // only opened by trigger
-float SECRET_YES_SHOOT = 16; // shootable even if targeted
+const float SECRET_OPEN_ONCE = 1; // stays open
+const float SECRET_1ST_LEFT = 2; // 1st move is left of arrow
+const float SECRET_1ST_DOWN = 4; // 1st move is down from arrow
+const float SECRET_NO_SHOOT = 8; // only opened by trigger
+const float SECRET_YES_SHOOT = 16; // shootable even if targeted
void fd_secret_use()
{
// Make a sound, wait a little...
if (self.noise1 != "")
- sound(self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
self.nextthink = self.ltime + 0.1;
temp = 1 - (self.spawnflags & SECRET_1ST_LEFT); // 1 or -1
self.dest2 = self.dest1 + v_forward * self.t_length;
SUB_CalcMove(self.dest1, self.speed, fd_secret_move1);
if (self.noise2 != "")
- sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
}
void fd_secret_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
self.nextthink = self.ltime + 1.0;
self.think = fd_secret_move2;
if (self.noise3 != "")
- sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTEN_NORM);
}
// Start moving sideways w/sound...
void fd_secret_move2()
{
if (self.noise2 != "")
- sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
SUB_CalcMove(self.dest2, self.speed, fd_secret_move3);
}
void fd_secret_move3()
{
if (self.noise3 != "")
- sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTEN_NORM);
if (!(self.spawnflags & SECRET_OPEN_ONCE))
{
self.nextthink = self.ltime + self.wait;
void fd_secret_move4()
{
if (self.noise2 != "")
- sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
SUB_CalcMove(self.dest1, self.speed, fd_secret_move5);
}
self.nextthink = self.ltime + 1.0;
self.think = fd_secret_move6;
if (self.noise3 != "")
- sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTEN_NORM);
}
void fd_secret_move6()
{
if (self.noise2 != "")
- sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
SUB_CalcMove(self.oldorigin, self.speed, fd_secret_done);
}
//self.th_pain = fd_secret_use;
}
if (self.noise3 != "")
- sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTEN_NORM);
}
void secret_blocked()
if (self.noise != "")
{
precache_sound(self.noise);
- soundto(MSG_INIT, self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTN_IDLE);
+ soundto(MSG_INIT, self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_IDLE);
}
if (!self.speed)
if (self.noise != "")
{
precache_sound(self.noise);
- soundto(MSG_INIT, self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTN_IDLE);
+ soundto(MSG_INIT, self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_IDLE);
}
if(!self.targetfactor)
if(self.pushltime < time) // only show one teleport effect per teleporter per 0.2 seconds, for better fps
{
if(tflags & TELEPORT_FLAG_SOUND)
- sound (player, CH_TRIGGER, "misc/teleport.wav", VOL_BASE, ATTN_NORM);
+ sound (player, CH_TRIGGER, "misc/teleport.wav", VOL_BASE, ATTEN_NORM);
if(tflags & TELEPORT_FLAG_PARTICLES)
{
pointparticles(particleeffectnum("teleport"), player.origin, '0 0 0', 1);
tdeath(player, teleporter, telefragger, telefragmin, telefragmax);
// player no longer is on ground
- player.flags &~= FL_ONGROUND;
+ player.flags &= ~FL_ONGROUND;
// reset tracking of oldvelocity for impact damage (sudden velocity changes)
player.oldvelocity = player.velocity;
return;
if(self.team)
- if((self.spawnflags & 4 == 0) == (self.team != other.team))
+ if(((self.spawnflags & 4) == 0) == (self.team != other.team))
return;
EXACTTRIGGER_TOUCH;
float trigger_music_SendEntity(entity to, float sf)
{
WriteByte(MSG_ENTITY, ENT_CLIENT_TRIGGER_MUSIC);
- sf &~= 0x80;
+ sf &= ~0x80;
if(self.cnt)
sf |= 0x80;
WriteByte(MSG_ENTITY, sf);
MapInfo_LoadMapSettings(mapname);
teamplay = 0;
- serverflags &~= SERVERFLAG_TEAMPLAY;
+ serverflags &= ~SERVERFLAG_TEAMPLAY;
if not(cvar_value_issafe(world.fog))
{
// common
.float turret_type;
-float TID_COMMON = 1;
-float TID_EWHEEL = 2;
-float TID_FLAC = 3;
-float TID_FUSION = 4;
-float TID_HELLION = 5;
-float TID_HK = 6;
-float TID_MACHINEGUN = 7;
-float TID_MLRS = 8;
-float TID_PHASER = 9;
-float TID_PLASMA = 10;
-float TID_PLASMA_DUAL = 11;
-float TID_TESLA = 12;
-float TID_WALKER = 13;
-float TID_LAST = 13;
-
-float TNSF_UPDATE = 2;
-float TNSF_STATUS = 4;
-float TNSF_SETUP = 8;
-float TNSF_ANG = 16;
-float TNSF_AVEL = 32;
-float TNSF_MOVE = 64;
+const float TID_COMMON = 1;
+const float TID_EWHEEL = 2;
+const float TID_FLAC = 3;
+const float TID_FUSION = 4;
+const float TID_HELLION = 5;
+const float TID_HK = 6;
+const float TID_MACHINEGUN = 7;
+const float TID_MLRS = 8;
+const float TID_PHASER = 9;
+const float TID_PLASMA = 10;
+const float TID_PLASMA_DUAL = 11;
+const float TID_TESLA = 12;
+const float TID_WALKER = 13;
+const float TID_LAST = 13;
+
+const float TNSF_UPDATE = 2;
+const float TNSF_STATUS = 4;
+const float TNSF_SETUP = 8;
+const float TNSF_ANG = 16;
+const float TNSF_AVEL = 32;
+const float TNSF_MOVE = 64;
.float anim_start_time;
-float TNSF_ANIM = 128;
+const float TNSF_ANIM = 128;
-float TNSF_FULL_UPDATE = 16777215;
+const float TNSF_FULL_UPDATE = 16777215;
#endif // TTURRETS_ENABLED
// this function doubles as "teamchange" function.
self.tur_head.team = self.team;
- self.effects &~= EF_NODRAW;
+ self.effects &= ~EF_NODRAW;
self.deadflag = DEAD_NO;
self.effects = EF_LOWPRECISION;
self.solid = SOLID_BBOX;
{
entity proj;
- sound (self, CH_WEAPON_A, _snd, VOL_BASE, ATTN_NORM);
+ sound (self, CH_WEAPON_A, _snd, VOL_BASE, ATTEN_NORM);
proj = spawn ();
setorigin(proj, self.tur_shotorg);
setsize(proj, '-0.5 -0.5 -0.5' * _size, '0.5 0.5 0.5' * _size);
self.owner.attack_finished_single = time + self.owner.shot_refire;
self.owner.fireflag = 2;
self.owner.tur_head.frame = 10;
- sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM);
remove(self);
return;
}
if (time - self.shot_spread > 0)
{
self.shot_spread = time + 2;
- sound (self, CH_SHOTS_SINGLE, "turrets/phaser.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_SHOTS_SINGLE, "turrets/phaser.wav", VOL_BASE, ATTEN_NORM);
}
beam.enemy = self.enemy;
beam.bot_dodge = TRUE;
beam.bot_dodgerating = beam.shot_dmg;
- sound (beam, CH_SHOTS_SINGLE, "turrets/phaser.wav", VOL_BASE, ATTN_NORM);
+ sound (beam, CH_SHOTS_SINGLE, "turrets/phaser.wav", VOL_BASE, ATTEN_NORM);
self.fireflag = 1;
beam.attack_finished_single = self.attack_finished_single;
setattachment(beam,self.tur_head,"tag_fire");
- soundat (self, trace_endpos, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
+ soundat (self, trace_endpos, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTEN_NORM);
if (self.tur_head.frame == 0)
self.tur_head.frame = 1;
rocket = spawn ();
setorigin(rocket, org);
- sound (self, CH_WEAPON_A, "weapons/hagar_fire.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_WEAPON_A, "weapons/hagar_fire.wav", VOL_BASE, ATTEN_NORM);
setsize (rocket, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
rocket.classname = "walker_rocket";
void walker_attack()
{
- sound (self, CH_WEAPON_A, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_WEAPON_A, "weapons/uzi_fire.wav", VOL_BASE, ATTEN_NORM);
fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated, self.shot_spread, self.shot_speed, 5, self.shot_dmg, self.shot_force, DEATH_TURRET_WALK_GUN, 0, 1, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
self.takedamage = DAMAGE_AIM;
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_WALK;
- self.effects &~= EF_NODRAW;
+ self.effects &= ~EF_NODRAW;
self.alpha = 1;
self.PlayerPhysplug = func_null;
self.view_ofs = PL_VIEW_OFS;
other.vehicle_reload2 = self.vehicle_reload2;
other.vehicle_energy = self.vehicle_energy;
other.PlayerPhysplug = bumb_gunner_frame;
- other.flags &~= FL_ONGROUND;
+ other.flags &= ~FL_ONGROUND;
msg_entity = other;
WriteByte(MSG_ONE, SVC_SETVIEWPORT);
if((pilot.BUTTON_ATCK || pilot.BUTTON_ATCK2) && (vehic.vehicle_energy > autocvar_g_vehicle_bumblebee_raygun_dps * sys_frametime || autocvar_g_vehicle_bumblebee_raygun == 0))
{
vehic.gun3.enemy.realowner = pilot;
- vehic.gun3.enemy.effects &~= EF_NODRAW;
+ vehic.gun3.enemy.effects &= ~EF_NODRAW;
vehic.gun3.enemy.hook_start = gettaginfo(vehic.gun3, gettagindex(vehic.gun3, "fire"));
vehic.gun3.enemy.SendFlags |= BRG_START;
autocvar_g_vehicle_bumblebee_blowup_forceintensity,
DEATH_VH_BUMB_DEATH, world);
- sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("explosion_large"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
if(self.owner.deadflag == DEAD_DYING)
if(random() < 0.1)
{
- sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("explosion_small"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
}
{
self.sounds = 1;
self.sound_nexttime = time + 10.922667; //soundlength("vehicles/racer_move.wav");
- sound (self, CH_TRIGGER_SINGLE, "vehicles/racer_move.wav", VOL_VEHICLEENGINE, ATTN_NORM);
+ sound (self, CH_TRIGGER_SINGLE, "vehicles/racer_move.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
}
}
else
{
self.sounds = 0;
self.sound_nexttime = time + 11.888604; //soundlength("vehicles/racer_idle.wav");
- sound (self, CH_TRIGGER_SINGLE, "vehicles/racer_idle.wav", VOL_VEHICLEENGINE, ATTN_NORM);
+ sound (self, CH_TRIGGER_SINGLE, "vehicles/racer_idle.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
}
}
if(racer.strength_finished < time)
{
racer.strength_finished = time + 10.922667; //soundlength("vehicles/racer_boost.wav");
- sound (racer.tur_head, CH_TRIGGER_SINGLE, "vehicles/racer_boost.wav", VOL_VEHICLEENGINE, ATTN_NORM);
+ sound (racer.tur_head, CH_TRIGGER_SINGLE, "vehicles/racer_boost.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
}
}
else
{
racer.strength_finished = 0;
- sound (racer.tur_head, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_VEHICLEENGINE, ATTN_NORM);
+ sound (racer.tur_head, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
}
df -= v_up * (vlen(racer.velocity) * autocvar_g_vehicle_racer_downforce);
self.think = racer_think;
self.nextthink = time;
self.movetype = MOVETYPE_BOUNCE;
- sound (self.tur_head, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_VEHICLEENGINE, ATTN_NORM);
+ sound (self.tur_head, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
if not (self.owner)
return;
if(self.sound_nexttime < time)
{
self.sound_nexttime = time + 7.955812; //soundlength("vehicles/raptor_fly.wav");
- sound (self, CH_TRIGGER_SINGLE, "vehicles/raptor_speed.wav", VOL_VEHICLEENGINE, ATTN_NORM);
+ sound (self, CH_TRIGGER_SINGLE, "vehicles/raptor_speed.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
}
// Takeoff sequense
if(self.sound_nexttime < time)
{
self.sound_nexttime = time + 7.955812;
- //sound (self.tur_head, CH_TRIGGER_SINGLE, "vehicles/raptor_fly.wav", 1 - ftmp, ATTN_NORM );
- sound (self, CH_TRIGGER_SINGLE, "vehicles/raptor_speed.wav", 1, ATTN_NORM);
+ //sound (self.tur_head, CH_TRIGGER_SINGLE, "vehicles/raptor_fly.wav", 1 - ftmp, ATTEN_NORM );
+ sound (self, CH_TRIGGER_SINGLE, "vehicles/raptor_speed.wav", 1, ATTEN_NORM);
self.wait = ftmp;
}
/*
else if(fabs(ftmp - self.wait) > 0.2)
{
- sound (self.tur_head, CH_TRIGGER_SINGLE, "", 1 - ftmp, ATTN_NORM );
- sound (self, CH_TRIGGER_SINGLE, "", ftmp, ATTN_NORM);
+ sound (self.tur_head, CH_TRIGGER_SINGLE, "", 1 - ftmp, ATTEN_NORM );
+ sound (self, CH_TRIGGER_SINGLE, "", ftmp, ATTEN_NORM);
self.wait = ftmp;
}
*/
}
if(_incomming)
- sound(self, CH_PAIN_SINGLE, "vehicles/missile_alarm.wav", VOL_BASE, ATTN_NONE);
+ sound(self, CH_PAIN_SINGLE, "vehicles/missile_alarm.wav", VOL_BASE, ATTEN_NONE);
self.bomb1.cnt = time + 1;
}
if(random() < 0.1)
{
- sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("explosion_small"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
}
self.nextthink = time + 0.1;
{
if(spider.frame == 4 && self.tur_head.wait != 0)
{
- sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_land.wav", VOL_VEHICLEENGINE, ATTN_NORM);
+ sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_land.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
spider.frame = 5;
}
if(player.BUTTON_JUMP && self.tur_head.wait < time)
{
- sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_jump.wav", VOL_VEHICLEENGINE, ATTN_NORM);
+ sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_jump.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
//dprint("spiderbot_jump:", ftos(soundlength("vehicles/spiderbot_jump.wav")), "\n");
self.delay = 0;
self.delay = 3;
self.sound_nexttime = time + 6.486500; //soundlength("vehicles/spiderbot_idle.wav");
//dprint("spiderbot_idle:", ftos(soundlength("vehicles/spiderbot_idle.wav")), "\n");
- sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_idle.wav", VOL_VEHICLEENGINE, ATTN_NORM);
+ sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_idle.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
}
movelib_beak_simple(autocvar_g_vehicle_spiderbot_speed_stop);
spider.frame = 5;
{
self.delay = 1;
self.sound_nexttime = time + 6.486500; //soundlength("vehicles/spiderbot_walk.wav");
- sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_walk.wav", VOL_VEHICLEENGINE, ATTN_NORM);
+ sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_walk.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
//dprint("spiderbot_walk:", ftos(soundlength("vehicles/spiderbot_walk.wav")), "\n");
}
}
{
self.delay = 2;
self.sound_nexttime = time + 6.486500; //soundlength("vehicles/spiderbot_strafe.wav");
- sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_strafe.wav", VOL_VEHICLEENGINE, ATTN_NORM);
+ sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_strafe.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
//dprint("spiderbot_strafe:", ftos(soundlength("vehicles/spiderbot_strafe.wav")), "\n");
}
}
// fireBullet (v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_damage,
// autocvar_g_vehicle_spiderbot_minigun_spread, DEATH_VH_SPID_MINIGUN, 0);
- sound (gun, CH_WEAPON_A, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
+ sound (gun, CH_WEAPON_A, "weapons/uzi_fire.wav", VOL_BASE, ATTEN_NORM);
//trailparticles(self, particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos);
pointparticles(particleeffectnum("spiderbot_minigun_muzzleflash"), v, v_forward * 2500, 1);
{
if(self.alpha > 0.1)
{
- sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("explosion_big"), self.origin + '0 0 100', '0 0 0', 1);
}
remove(self);
{
if(random() < 0.1)
{
- sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("explosion_small"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
}
self.nextthink = time + 0.1;
self.movetype = MOVETYPE_NONE;
self.deadflag = DEAD_DEAD;
self.solid = SOLID_NOT;
- self.tur_head.effects &~= EF_FLAME;
- self.vehicle_hudmodel.viewmodelforclient = self;
+ self.tur_head.effects &= ~EF_FLAME;
+ self.vehicle_hudmodel.viewmodelforclient = self;
}
void spiderbot_die()
/** AuxiliaryXhair*
Send additional points of interest to be drawn, to vehicle owner
**/
-float MAX_AXH = 4;
+const float MAX_AXH = 4;
.entity AuxiliaryXhair[MAX_AXH];
float SendAuxiliaryXhair(entity to, float sf)
.float lock_strength;
.float lock_time;
.float lock_soundtime;
-float DAMAGE_TARGETDRONE = 10;
+const float DAMAGE_TARGETDRONE = 10;
vector targetdrone_getnewspot()
{
proj.flags = FL_PROJECTILE | FL_NOTARGET;
if(_mzlsound)
- sound (self, CH_WEAPON_A, _mzlsound, VOL_BASE, ATTN_NORM);
+ sound (self, CH_WEAPON_A, _mzlsound, VOL_BASE, ATTEN_NORM);
if(_mzlfx)
pointparticles(particleeffectnum(_mzlfx), proj.origin, proj.velocity, 1);
//self.exteriormodeltoclient = self.owner;
//self.tur_head.exteriormodeltoclient = self.owner;
- other.flags &~= FL_ONGROUND;
- self.flags &~= FL_ONGROUND;
+ other.flags &= ~FL_ONGROUND;
+ self.flags &= ~FL_ONGROUND;
self.team = self.owner.team;
self.flags -= FL_NOTARGET;
_player.takedamage = DAMAGE_AIM;
_player.solid = SOLID_SLIDEBOX;
_player.movetype = MOVETYPE_WALK;
- _player.effects &~= EF_NODRAW;
+ _player.effects &= ~EF_NODRAW;
_player.alpha = 1;
_player.PlayerPhysplug = func_null;
_player.vehicle = world;
_vehicle.team = _vehicle.tur_head.team;
- sound (_vehicle, CH_TRIGGER_SINGLE, "misc/null.wav", 1, ATTN_NORM);
+ sound (_vehicle, CH_TRIGGER_SINGLE, "misc/null.wav", 1, ATTEN_NORM);
_vehicle.vehicle_hudmodel.viewmodelforclient = _vehicle;
_vehicle.phase = time + 1;
self.vehicle_shieldent.alpha = 0.45;
self.vehicle_shieldent.angles = vectoangles(normalize(hitloc - (self.origin + self.vehicle_shieldent.origin))) - self.angles;
self.vehicle_shieldent.nextthink = time;
- self.vehicle_shieldent.effects &~= EF_NODRAW;
+ self.vehicle_shieldent.effects &= ~EF_NODRAW;
self.vehicle_shield -= damage;
self.vehicle_shieldent.alpha = 0.75;
if(sound_allowed(MSG_BROADCAST, attacker))
- spamsound (self, CH_PAIN, "onslaught/ons_hit2.wav", VOL_BASE, ATTN_NORM); // FIXME: PLACEHOLDER
+ spamsound (self, CH_PAIN, "onslaught/ons_hit2.wav", VOL_BASE, ATTEN_NORM); // FIXME: PLACEHOLDER
}
else
if(sound_allowed(MSG_BROADCAST, attacker))
- spamsound (self, CH_PAIN, "onslaught/electricity_explode.wav", VOL_BASE, ATTN_NORM); // FIXME: PLACEHOLDER
+ spamsound (self, CH_PAIN, "onslaught/electricity_explode.wav", VOL_BASE, ATTEN_NORM); // FIXME: PLACEHOLDER
}
else
self.vehicle_health -= damage;
if(sound_allowed(MSG_BROADCAST, attacker))
- spamsound (self, CH_PAIN, "onslaught/ons_hit2.wav", VOL_BASE, ATTN_NORM); // FIXME: PLACEHOLDER
+ spamsound (self, CH_PAIN, "onslaught/ons_hit2.wav", VOL_BASE, ATTEN_NORM); // FIXME: PLACEHOLDER
}
if(self.damageforcescale < 1 && self.damageforcescale > 0)
void vehicles_gib_explode()
{
- sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("explosion_small"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
remove(self);
}
#ifdef VEHICLES_ENABLED
.float vehicle_flags;
-float VHF_ISVEHICLE = 2; /// Indicates vehicle
-float VHF_HASSHIELD = 4; /// Vehicle has shileding
-float VHF_SHIELDREGEN = 8; /// Vehicles shield regenerates
-float VHF_HEALTHREGEN = 16; /// Vehicles health regenerates
-float VHF_ENERGYREGEN = 32; /// Vehicles energy regenerates
-float VHF_DEATHEJECT = 64; /// Vehicle ejects pilot upon fatal damage
-float VHF_MOVE_GROUND = 128; /// Vehicle moves on gound
-float VHF_MOVE_HOVER = 256; /// Vehicle hover close to gound
-float VHF_MOVE_FLY = 512; /// Vehicle is airborn
-float VHF_DMGSHAKE = 1024; /// Add random velocity each frame if health < 50%
-float VHF_DMGROLL = 2048; /// Add random angles each frame if health < 50%
-float VHF_DMGHEADROLL = 4096; /// Add random head angles each frame if health < 50%
-float VHF_MULTISLOT = 8192; /// Vehicle has multiple player slots
-float VHF_PLAYERSLOT = 16384; /// This ent is a player slot on a multi-person vehicle
+const float VHF_ISVEHICLE = 2; /// Indicates vehicle
+const float VHF_HASSHIELD = 4; /// Vehicle has shileding
+const float VHF_SHIELDREGEN = 8; /// Vehicles shield regenerates
+const float VHF_HEALTHREGEN = 16; /// Vehicles health regenerates
+const float VHF_ENERGYREGEN = 32; /// Vehicles energy regenerates
+const float VHF_DEATHEJECT = 64; /// Vehicle ejects pilot upon fatal damage
+const float VHF_MOVE_GROUND = 128; /// Vehicle moves on gound
+const float VHF_MOVE_HOVER = 256; /// Vehicle hover close to gound
+const float VHF_MOVE_FLY = 512; /// Vehicle is airborn
+const float VHF_DMGSHAKE = 1024; /// Add random velocity each frame if health < 50%
+const float VHF_DMGROLL = 2048; /// Add random angles each frame if health < 50%
+const float VHF_DMGHEADROLL = 4096; /// Add random head angles each frame if health < 50%
+const float VHF_MULTISLOT = 8192; /// Vehicle has multiple player slots
+const float VHF_PLAYERSLOT = 16384; /// This ent is a player slot on a multi-person vehicle
.entity gun1;
.entity gun2;
void vehicles_exit(float eject);
.void(float exit_flags) vehicle_exit;
-float VHEF_NORMAL = 0; /// User pressed exit key
-float VHEF_EJECT = 1; /// User pressed exit key 3 times fast (not implemented) or vehile is dying
-float VHEF_RELESE = 2; /// Release ownership, client possibly allready dissconnected / went spec / changed team / used "kill" (not implemented)
+const float VHEF_NORMAL = 0; /// User pressed exit key
+const float VHEF_EJECT = 1; /// User pressed exit key 3 times fast (not implemented) or vehile is dying
+const float VHEF_RELESE = 2; /// Release ownership, client possibly allready dissconnected / went spec / changed team / used "kill" (not implemented)
-float SVC_SETVIEWPORT = 5; // Net.Protocol 0x05
-float SVC_SETVIEWANGLES = 10; // Net.Protocol 0x0A
-float SVC_UPDATEENTITY = 128; // Net.Protocol 0x80
+const float SVC_SETVIEWPORT = 5; // Net.Protocol 0x05
+const float SVC_SETVIEWANGLES = 10; // Net.Protocol 0x0A
+const float SVC_UPDATEENTITY = 128; // Net.Protocol 0x80
.void() vehicle_enter; /// Vehicles custom funciton to be executed when owner exit it
.void() vehicle_die; /// Vehicles custom function to be executed when vehile die
if (!wep)
return;
- WEPSET_OR_EW(e, wep);
+ e.weapons |= WepSet_FromWeapon(wep);
oldself = self;
self = e;
if(!pseudoprojectile)
pseudoprojectile = spawn(); // we need this so the sound uses the "entchannel4" volume
- soundtoat(MSG_ONE, pseudoprojectile, beampos, CH_SHOTS, snd, VOL_BASE * f, ATTN_NONE);
+ soundtoat(MSG_ONE, pseudoprojectile, beampos, CH_SHOTS, snd, VOL_BASE * f, ATTEN_NONE);
}
if(pseudoprojectile)
self.nextthink = max(time, self.W_BallisticBullet_LeaveSolid_nextthink_save);
self.W_BallisticBullet_LeaveSolid_think_save = func_null;
- self.flags &~= FL_ONGROUND;
+ self.flags &= ~FL_ONGROUND;
if(self.enemy.solid == SOLID_BSP)
{
{
pointparticles(particleeffectnum("crylink_impact"), org2, '0 0 0', 1);
if(!w_issilent)
- sound(self, CH_SHOTS, "weapons/crylink_impact2.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/crylink_impact2.wav", VOL_BASE, ATTEN_NORM);
}
else
{
pointparticles(particleeffectnum("crylink_impactbig"), org2, '0 0 0', 1);
if(!w_issilent)
- sound(self, CH_SHOTS, "weapons/crylink_impact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/crylink_impact.wav", VOL_BASE, ATTEN_NORM);
}
}
else if(req == WR_PRECACHE)
W_Plasma_Explode ();
} else {
//UpdateCSQCProjectile(self);
- spamsound (self, CH_SHOTS, "weapons/electro_bounce.wav", VOL_BASE, ATTN_NORM);
+ spamsound (self, CH_SHOTS, "weapons/electro_bounce.wav", VOL_BASE, ATTEN_NORM);
self.projectiledeathtype |= HITTYPE_BOUNCE;
}
}
{
// only play fire sound if 0.5 sec has passed since player let go the fire button
if(time - self.prevlgfire > 0.5)
- sound (self, CH_WEAPON_A, "weapons/lgbeam_fire.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_WEAPON_A, "weapons/lgbeam_fire.wav", VOL_BASE, ATTEN_NORM);
entity beam, oldself;
{
pointparticles(particleeffectnum("electro_ballexplode"), org2, '0 0 0', 1);
if(!w_issilent)
- sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTEN_NORM);
}
else
{
// this is sent as "primary (w_deathtype & HITTYPE_BOUNCE)" to distinguish it from (w_deathtype & HITTYPE_SECONDARY) bounced balls
pointparticles(particleeffectnum("electro_combo"), org2, '0 0 0', 1);
if(!w_issilent)
- sound(self, CH_SHOTS, "weapons/electro_impact_combo.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/electro_impact_combo.wav", VOL_BASE, ATTEN_NORM);
}
else
{
pointparticles(particleeffectnum("electro_impact"), org2, '0 0 0', 1);
if(!w_issilent)
- sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTEN_NORM);
}
}
}
void W_Fireball_Attack1_Frame0()
{
W_Fireball_AttackEffect(0, '-1.25 -3.75 0');
- sound (self, CH_WEAPON_SINGLE, "weapons/fireball_prefire2.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_WEAPON_SINGLE, "weapons/fireball_prefire2.wav", VOL_BASE, ATTEN_NORM);
weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_fireball_primary_animtime, W_Fireball_Attack1_Frame1);
}
org2 = w_org + w_backoff * 16;
pointparticles(particleeffectnum("fireball_explode"), org2, '0 0 0', 1);
if(!w_issilent)
- sound(self, CH_SHOTS, "weapons/fireball_impact2.wav", VOL_BASE, ATTN_NORM * 0.25); // long range boom
+ sound(self, CH_SHOTS, "weapons/fireball_impact2.wav", VOL_BASE, ATTEN_NORM * 0.25); // long range boom
}
}
else if(req == WR_PRECACHE)
float r;
r = random() * 6;
if(r < 1)
- spamsound (self, CH_SHOTS, "weapons/grenade_bounce1.wav", VOL_BASE, ATTN_NORM);
+ spamsound (self, CH_SHOTS, "weapons/grenade_bounce1.wav", VOL_BASE, ATTEN_NORM);
else if(r < 2)
- spamsound (self, CH_SHOTS, "weapons/grenade_bounce2.wav", VOL_BASE, ATTN_NORM);
+ spamsound (self, CH_SHOTS, "weapons/grenade_bounce2.wav", VOL_BASE, ATTEN_NORM);
else if(r < 3)
- spamsound (self, CH_SHOTS, "weapons/grenade_bounce3.wav", VOL_BASE, ATTN_NORM);
+ spamsound (self, CH_SHOTS, "weapons/grenade_bounce3.wav", VOL_BASE, ATTEN_NORM);
else if(r < 4)
- spamsound (self, CH_SHOTS, "weapons/grenade_bounce4.wav", VOL_BASE, ATTN_NORM);
+ spamsound (self, CH_SHOTS, "weapons/grenade_bounce4.wav", VOL_BASE, ATTEN_NORM);
else if(r < 5)
- spamsound (self, CH_SHOTS, "weapons/grenade_bounce5.wav", VOL_BASE, ATTN_NORM);
+ spamsound (self, CH_SHOTS, "weapons/grenade_bounce5.wav", VOL_BASE, ATTEN_NORM);
else
- spamsound (self, CH_SHOTS, "weapons/grenade_bounce6.wav", VOL_BASE, ATTN_NORM);
+ spamsound (self, CH_SHOTS, "weapons/grenade_bounce6.wav", VOL_BASE, ATTEN_NORM);
self.projectiledeathtype |= HITTYPE_BOUNCE;
self.gl_bouncecnt += 1;
}
else if(autocvar_g_balance_grenadelauncher_primary_type == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
{
- spamsound (self, CH_SHOTS, "weapons/grenade_stick.wav", VOL_BASE, ATTN_NORM);
+ spamsound (self, CH_SHOTS, "weapons/grenade_stick.wav", VOL_BASE, ATTEN_NORM);
// let it stick whereever it is
self.oldvelocity = self.velocity;
float r;
r = random() * 6;
if(r < 1)
- spamsound (self, CH_SHOTS, "weapons/grenade_bounce1.wav", VOL_BASE, ATTN_NORM);
+ spamsound (self, CH_SHOTS, "weapons/grenade_bounce1.wav", VOL_BASE, ATTEN_NORM);
else if(r < 2)
- spamsound (self, CH_SHOTS, "weapons/grenade_bounce2.wav", VOL_BASE, ATTN_NORM);
+ spamsound (self, CH_SHOTS, "weapons/grenade_bounce2.wav", VOL_BASE, ATTEN_NORM);
else if(r < 3)
- spamsound (self, CH_SHOTS, "weapons/grenade_bounce3.wav", VOL_BASE, ATTN_NORM);
+ spamsound (self, CH_SHOTS, "weapons/grenade_bounce3.wav", VOL_BASE, ATTEN_NORM);
else if(r < 4)
- spamsound (self, CH_SHOTS, "weapons/grenade_bounce4.wav", VOL_BASE, ATTN_NORM);
+ spamsound (self, CH_SHOTS, "weapons/grenade_bounce4.wav", VOL_BASE, ATTEN_NORM);
else if(r < 5)
- spamsound (self, CH_SHOTS, "weapons/grenade_bounce5.wav", VOL_BASE, ATTN_NORM);
+ spamsound (self, CH_SHOTS, "weapons/grenade_bounce5.wav", VOL_BASE, ATTEN_NORM);
else
- spamsound (self, CH_SHOTS, "weapons/grenade_bounce6.wav", VOL_BASE, ATTN_NORM);
+ spamsound (self, CH_SHOTS, "weapons/grenade_bounce6.wav", VOL_BASE, ATTEN_NORM);
self.projectiledeathtype |= HITTYPE_BOUNCE;
self.gl_bouncecnt += 1;
}
else if(autocvar_g_balance_grenadelauncher_secondary_type == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
{
- spamsound (self, CH_SHOTS, "weapons/grenade_stick.wav", VOL_BASE, ATTN_NORM);
+ spamsound (self, CH_SHOTS, "weapons/grenade_stick.wav", VOL_BASE, ATTEN_NORM);
// let it stick whereever it is
self.oldvelocity = self.velocity;
}
}
if(nadefound)
- sound (self, CH_WEAPON_B, "weapons/rocket_det.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_WEAPON_B, "weapons/rocket_det.wav", VOL_BASE, ATTEN_NORM);
}
else if (weapon_prepareattack(1, autocvar_g_balance_grenadelauncher_secondary_refire))
{
org2 = w_org + w_backoff * 12;
pointparticles(particleeffectnum("grenade_explode"), org2, '0 0 0', 1);
if(!w_issilent)
- sound(self, CH_SHOTS, "weapons/grenade_impact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/grenade_impact.wav", VOL_BASE, ATTEN_NORM);
}
else if(req == WR_PRECACHE)
{
self.weaponentity.state = WS_READY;
W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_hagar_secondary_ammo * self.hagar_load * -1, autocvar_g_balance_hagar_reload_ammo); // give back ammo
self.hagar_load = 0;
- sound(self, CH_WEAPON_A, "weapons/hagar_beep.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_WEAPON_A, "weapons/hagar_beep.wav", VOL_BASE, ATTEN_NORM);
// pause until we can load rockets again, once we re-press the alt fire button
self.hagar_loadstep = time + autocvar_g_balance_hagar_secondary_load_speed * W_WeaponRateFactor();
W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_hagar_secondary_ammo, autocvar_g_balance_hagar_reload_ammo);
self.weaponentity.state = WS_INUSE;
self.hagar_load += 1;
- sound(self, CH_WEAPON_B, "weapons/hagar_load.wav", VOL_BASE * 0.8, ATTN_NORM); // sound is too loud according to most
+ sound(self, CH_WEAPON_B, "weapons/hagar_load.wav", VOL_BASE * 0.8, ATTEN_NORM); // sound is too loud according to most
if (self.hagar_load >= autocvar_g_balance_hagar_secondary_load_max)
self.hagar_loadstep = time + autocvar_g_balance_hagar_secondary_load_hold * W_WeaponRateFactor();
else if(!self.hagar_loadbeep && self.hagar_load) // prevents the beep from playing each frame
{
// if this is the last rocket we can load, play a beep sound to notify the player
- sound(self, CH_WEAPON_A, "weapons/hagar_beep.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_WEAPON_A, "weapons/hagar_beep.wav", VOL_BASE, ATTEN_NORM);
self.hagar_loadbeep = TRUE;
}
}
if(!self.hagar_warning && self.hagar_load) // prevents the beep from playing each frame
{
// we're about to automatically release after holding time, play a beep sound to notify the player
- sound(self, CH_WEAPON_A, "weapons/hagar_beep.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_WEAPON_A, "weapons/hagar_beep.wav", VOL_BASE, ATTEN_NORM);
self.hagar_warning = TRUE;
}
}
if(!w_issilent)
{
if (w_random<0.15)
- sound(self, CH_SHOTS, "weapons/hagexp1.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/hagexp1.wav", VOL_BASE, ATTEN_NORM);
else if (w_random<0.7)
- sound(self, CH_SHOTS, "weapons/hagexp2.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/hagexp2.wav", VOL_BASE, ATTEN_NORM);
else
- sound(self, CH_SHOTS, "weapons/hagexp3.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/hagexp3.wav", VOL_BASE, ATTEN_NORM);
}
}
else if(req == WR_PRECACHE)
org2 = w_org + w_backoff * 6;
pointparticles(particleeffectnum("laser_impact"), org2, w_backoff * 1000, 1);
if(!w_issilent)
- sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_NORM);
}
else if(req == WR_PRECACHE)
{
if (self.BUTTON_CROUCH)
{
- self.hook_state &~= HOOK_PULLING;
+ self.hook_state &= ~HOOK_PULLING;
if (self.BUTTON_ATCK || (!(self.items & IT_JETPACK) && self.BUTTON_HOOK))
- self.hook_state &~= HOOK_RELEASING;
+ self.hook_state &= ~HOOK_RELEASING;
else
self.hook_state |= HOOK_RELEASING;
}
else
{
self.hook_state |= HOOK_PULLING;
- self.hook_state &~= HOOK_RELEASING;
+ self.hook_state &= ~HOOK_RELEASING;
if (self.BUTTON_ATCK || (!(self.items & IT_JETPACK) && self.BUTTON_HOOK))
{
else
{
self.hook_state |= HOOK_REMOVING;
- self.hook_state &~= HOOK_WAITING_FOR_RELEASE;
+ self.hook_state &= ~HOOK_WAITING_FOR_RELEASE;
}
}
}
{
weapon_setup(WEP_HOOK);
self.current_ammo = ammo_fuel;
- self.hook_state &~= HOOK_WAITING_FOR_RELEASE;
+ self.hook_state &= ~HOOK_WAITING_FOR_RELEASE;
}
else if (req == WR_CHECKAMMO1)
{
org2 = w_org + w_backoff * 2;
pointparticles(particleeffectnum("hookbomb_explode"), org2, '0 0 0', 1);
if(!w_issilent)
- sound(self, CH_SHOTS, "weapons/hookbomb_impact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/hookbomb_impact.wav", VOL_BASE, ATTEN_NORM);
}
else if(req == WR_PRECACHE)
{
// only play fire sound if 0.5 sec has passed since player let go the fire button
if(time - self.prevgauntletfire > 0.5)
{
- sound (self, CH_WEAPON_A, "weapons/gauntlet_fire.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_WEAPON_A, "weapons/gauntlet_fire.wav", VOL_BASE, ATTEN_NORM);
}
entity beam, oldself;
org2 = w_org + w_backoff * 6;
pointparticles(particleeffectnum("laser_impact"), org2, w_backoff * 1000, 1);
if(!w_issilent)
- sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_NORM);
}
else if(req == WR_PRECACHE)
{
void W_Mine_Stick (entity to)
{
- spamsound (self, CH_SHOTS, "weapons/mine_stick.wav", VOL_BASE, ATTN_NORM);
+ spamsound (self, CH_SHOTS, "weapons/mine_stick.wav", VOL_BASE, ATTEN_NORM);
// in order for mines to face properly when sticking to the ground, they must be a server side entity rather than a csqc projectile
if ((time > self.cnt) && (!self.mine_time))
{
if(autocvar_g_balance_minelayer_lifetime_countdown > 0)
- spamsound (self, CH_SHOTS, "weapons/mine_trigger.wav", VOL_BASE, ATTN_NORM);
+ spamsound (self, CH_SHOTS, "weapons/mine_trigger.wav", VOL_BASE, ATTEN_NORM);
self.mine_time = time + autocvar_g_balance_minelayer_lifetime_countdown;
self.mine_explodeanyway = 1; // make the mine super aggressive -- Samual: Rather, make it not care if a team mate is near.
}
if(head != self.realowner && IsDifferentTeam(head, self.realowner)) // don't trigger for team mates
if(!self.mine_time)
{
- spamsound (self, CH_SHOTS, "weapons/mine_trigger.wav", VOL_BASE, ATTN_NORM);
+ spamsound (self, CH_SHOTS, "weapons/mine_trigger.wav", VOL_BASE, ATTEN_NORM);
self.mine_time = time + autocvar_g_balance_minelayer_time;
}
head = head.chain;
if (self.BUTTON_ATCK2)
{
if(W_PlacedMines(TRUE))
- sound (self, CH_WEAPON_B, "weapons/mine_det.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_WEAPON_B, "weapons/mine_det.wav", VOL_BASE, ATTEN_NORM);
}
}
else if (req == WR_PRECACHE)
org2 = w_org + w_backoff * 12;
pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1);
if(!w_issilent)
- sound(self, CH_SHOTS, "weapons/mine_exp.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/mine_exp.wav", VOL_BASE, ATTEN_NORM);
}
else if(req == WR_PRECACHE)
{
org2 = w_org + w_backoff * 6;
pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
if(!w_issilent)
- sound(self, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTEN_NORM);
}
else if(req == WR_PRECACHE)
{
W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", CH_WEAPON_A, mydmg);
if(charge > autocvar_g_balance_nex_charge_animlimit && autocvar_g_balance_nex_charge_animlimit) // if the Nex is overcharged, we play an extra sound
{
- sound (self, CH_WEAPON_B, "weapons/nexcharge.wav", VOL_BASE * (charge - 0.5 * autocvar_g_balance_nex_charge_animlimit) / (1 - 0.5 * autocvar_g_balance_nex_charge_animlimit), ATTN_NORM);
+ sound (self, CH_WEAPON_B, "weapons/nexcharge.wav", VOL_BASE * (charge - 0.5 * autocvar_g_balance_nex_charge_animlimit) / (1 - 0.5 * autocvar_g_balance_nex_charge_animlimit), ATTEN_NORM);
}
yoda = 0;
org2 = w_org + w_backoff * 6;
pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
if(!w_issilent)
- sound(self, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTEN_NORM);
}
else if(req == WR_PRECACHE)
{
self.realowner.porto_current = world;
- if(self.cnt < 0 && !failhard && self.realowner.playerid == self.playerid && self.realowner.deadflag == DEAD_NO && !WEPSET_CONTAINS_EW(self.realowner, WEP_PORTO))
+ if(self.cnt < 0 && !failhard && self.realowner.playerid == self.playerid && self.realowner.deadflag == DEAD_NO && !(self.realowner.weapons & WEPSET_PORTO))
{
setsize (self, '-16 -16 0', '16 16 32');
setorigin(self, self.origin + trace_plane_normal);
if(self.realowner.playerid != self.playerid)
{
- sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTEN_NORM);
remove(self);
}
else if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK || trace_dphitcontents & DPCONTENTS_PLAYERCLIP)
{
- spamsound(self, CH_SHOTS, "porto/bounce.wav", VOL_BASE, ATTN_NORM);
+ spamsound(self, CH_SHOTS, "porto/bounce.wav", VOL_BASE, ATTEN_NORM);
// just reflect
self.right_vector = self.right_vector - 2 * trace_plane_normal * (self.right_vector * trace_plane_normal);
self.angles = vectoangles(self.velocity - 2 * trace_plane_normal * (self.velocity * trace_plane_normal));
}
else if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
{
- sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTEN_NORM);
W_Porto_Fail(0);
if(self.cnt < 0)
Portal_ClearAll_PortalsOnly(self.realowner);
// in-portal only
if(Portal_SpawnInPortalAtTrace(self.realowner, self.right_vector, self.portal_id))
{
- sound(self, CH_SHOTS, "porto/create.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "porto/create.wav", VOL_BASE, ATTEN_NORM);
trace_plane_normal = norm;
centerprint(self.realowner, "^1In^7-portal created.");
W_Porto_Success();
}
else
{
- sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTEN_NORM);
trace_plane_normal = norm;
W_Porto_Fail(0);
}
// out-portal only
if(Portal_SpawnOutPortalAtTrace(self.realowner, self.right_vector, self.portal_id))
{
- sound(self, CH_SHOTS, "porto/create.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "porto/create.wav", VOL_BASE, ATTEN_NORM);
trace_plane_normal = norm;
centerprint(self.realowner, "^4Out^7-portal created.");
W_Porto_Success();
}
else
{
- sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTEN_NORM);
trace_plane_normal = norm;
W_Porto_Fail(0);
}
self.effects += EF_BLUE - EF_RED;
if(Portal_SpawnInPortalAtTrace(self.realowner, self.right_vector, self.portal_id))
{
- sound(self, CH_SHOTS, "porto/create.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "porto/create.wav", VOL_BASE, ATTEN_NORM);
trace_plane_normal = norm;
centerprint(self.realowner, "^1In^7-portal created.");
self.right_vector = self.right_vector - 2 * trace_plane_normal * (self.right_vector * norm);
}
else
{
- sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTEN_NORM);
trace_plane_normal = norm;
Portal_ClearAll_PortalsOnly(self.realowner);
W_Porto_Fail(0);
{
if(Portal_SpawnOutPortalAtTrace(self.realowner, self.right_vector, self.portal_id))
{
- sound(self, CH_SHOTS, "porto/create.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "porto/create.wav", VOL_BASE, ATTEN_NORM);
trace_plane_normal = norm;
centerprint(self.realowner, "^4Out^7-portal created.");
W_Porto_Success();
}
else
{
- sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTEN_NORM);
Portal_ClearAll_PortalsOnly(self.realowner);
W_Porto_Fail(0);
}
}
else
{
- sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTEN_NORM);
Portal_ClearAll_PortalsOnly(self.realowner);
W_Porto_Fail(0);
}
if(!w_issilent)
{
if(w_random < 0.2)
- sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTEN_NORM);
else if(w_random < 0.4)
- sound(self, CH_SHOTS, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/ric2.wav", VOL_BASE, ATTEN_NORM);
else if(w_random < 0.5)
- sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTEN_NORM);
}
}
else if(req == WR_PRECACHE)
{
pointparticles(particleeffectnum("rocket_guide"), self.origin, self.velocity, 1);
// TODO add a better sound here
- sound (self.realowner, CH_WEAPON_B, "weapons/rocket_mode.wav", VOL_BASE, ATTN_NORM);
+ sound (self.realowner, CH_WEAPON_B, "weapons/rocket_mode.wav", VOL_BASE, ATTEN_NORM);
self.count = 1;
}
}
}
}
if(rockfound)
- sound (self, CH_WEAPON_B, "weapons/rocket_det.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_WEAPON_B, "weapons/rocket_det.wav", VOL_BASE, ATTEN_NORM);
}
}
}
org2 = w_org + w_backoff * 12;
pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1);
if(!w_issilent)
- sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
}
else if(req == WR_PRECACHE)
{
if(w_deathtype & HITTYPE_SECONDARY)
{
if(!w_issilent)
- sound(self, CH_SHOTS, "weapons/tag_impact.wav", 1, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/tag_impact.wav", 1, ATTEN_NORM);
}
else
{
if(!w_issilent)
{
if (w_random<0.15)
- sound(self, CH_SHOTS, "weapons/tagexp1.wav", 1, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/tagexp1.wav", 1, ATTEN_NORM);
else if (w_random<0.7)
- sound(self, CH_SHOTS, "weapons/tagexp2.wav", 1, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/tagexp2.wav", 1, ATTEN_NORM);
else
- sound(self, CH_SHOTS, "weapons/tagexp3.wav", 1, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/tagexp3.wav", 1, ATTEN_NORM);
}
}
}
if(!w_issilent)
{
if (w_random<0.15)
- sound(self, CH_SHOTS, "weapons/seekerexp1.wav", 1, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/seekerexp1.wav", 1, ATTEN_NORM);
else if (w_random<0.7)
- sound(self, CH_SHOTS, "weapons/seekerexp2.wav", 1, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/seekerexp2.wav", 1, ATTEN_NORM);
else
- sound(self, CH_SHOTS, "weapons/seekerexp3.wav", 1, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/seekerexp3.wav", 1, ATTEN_NORM);
}
}
}
void W_Shotgun_Attack2 (void)
{
- sound (self, CH_WEAPON_A, "weapons/shotgun_melee.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_WEAPON_A, "weapons/shotgun_melee.wav", VOL_BASE, ATTEN_NORM);
weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_shotgun_secondary_animtime, w_ready);
entity meleetemp;
if(!w_issilent && time - self.prevric > 0.25)
{
if(w_random < 0.0165)
- sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTEN_NORM);
else if(w_random < 0.033)
- sound(self, CH_SHOTS, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/ric2.wav", VOL_BASE, ATTEN_NORM);
else if(w_random < 0.05)
- sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTEN_NORM);
self.prevric = time;
}
}
pointparticles(particleeffectnum("machinegun_impact"), org2, w_backoff * 1000, 1);
if(!w_issilent)
if(w_random < 0.05)
- sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTEN_NORM);
else if(w_random < 0.1)
- sound(self, CH_SHOTS, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/ric2.wav", VOL_BASE, ATTEN_NORM);
else if(w_random < 0.2)
- sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTEN_NORM);
}
else if(req == WR_PRECACHE)
{
sendflags = sendflags & 0x7F;
if(g_nexball)
- sendflags &~= 0x80;
+ sendflags &= ~0x80;
else if(self.max_health || (self.pain_finished && (time < self.pain_finished + 0.25)))
sendflags |= 0x80;
boxparticles(WarpZone_TrailParticles_trace_callback_eff, WarpZone_TrailParticles_trace_callback_own, from, endpos, WarpZone_TrailParticles_trace_callback_own.velocity, WarpZone_TrailParticles_trace_callback_own.velocity, WarpZone_TrailParticles_trace_callback_f, WarpZone_TrailParticles_trace_callback_flags);
}
-float PARTICLES_DRAWASTRAIL = 128;
void WarpZone_TrailParticles_WithMultiplier(entity own, float eff, vector org, vector end, float f, float boxflags)
{
WarpZone_TrailParticles_trace_callback_own = own;