compressShortVector_init();
draw_endBoldFont();
- menu_visible = FALSE;
+ menu_visible = false;
menu_show = menu_show_error;
menu_action = func_null;
tm = GetTeam(o.team, false);
tm.team_size -= 1;
o.has_team = 0;
- return TRUE;
+ return true;
}
}
else
tm = GetTeam(Team, true);
tm.team_size += 1;
o.has_team = 1;
- return TRUE;
+ return true;
}
else if(Team != o.team)
{
o.team = Team;
tm = GetTeam(Team, true);
tm.team_size += 1;
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
void Playerchecker_Think()
if(menu_visible && menu_action)
if(menu_action(bInputType, nPrimary, nSecondary))
- return TRUE;
+ return true;
return bSkipKey;
}
if(autocvar_cl_unpress_zoom_on_spawn)
{
localcmd("-zoom\n");
- button_zoom = FALSE;
+ button_zoom = false;
}
}
for(0;;)
{
dir = nextdir;
- traceline(p, p + 65536 * dir, TRUE, porto);
+ traceline(p, p + 65536 * dir, true, porto);
if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
return;
nextdir = dir - 2 * (dir * trace_plane_normal) * trace_plane_normal; // mirror dir at trace_plane_normal
float WantEventchase()
{
if(autocvar_cl_orthoview)
- return FALSE;
+ return false;
if(intermission)
- return TRUE;
+ return true;
if(spectatee_status >= 0)
{
if(autocvar_cl_eventchase_nexball && gametype == MAPINFO_TYPE_NEXBALL && !(WepSet_GetFromStat() & WepSet_FromWeapon(WEP_PORTO)))
- return TRUE;
+ return true;
if(autocvar_cl_eventchase_death && (getstati(STAT_HEALTH) <= 0))
{
if(autocvar_cl_eventchase_death == 2)
{
// don't stop eventchase once it's started (even if velocity changes afterwards)
if(self.velocity == '0 0 0' || eventchase_running)
- return TRUE;
+ return true;
}
- else return TRUE;
+ else return true;
}
}
- return FALSE;
+ return false;
}
vector damage_blurpostprocess, content_blurpostprocess;
f = (time - wcross_name_changestarttime) / autocvar_crosshair_effect_time;
if (f >= 1)
{
- wcross_ring_prev = ((ring_image) ? TRUE : FALSE);
+ wcross_ring_prev = ((ring_image) ? true : false);
}
if(wcross_ring_prev)
{
// no zoom while dead or in intermission please
localcmd("-zoom\n");
- button_zoom = FALSE;
+ button_zoom = false;
}
// event chase camera
{
if(WantEventchase())
{
- eventchase_running = TRUE;
+ eventchase_running = true;
// 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);
}
else if(autocvar_chase_active < 0) // time to disable chase_active if it was set by this code
{
- eventchase_running = FALSE;
+ eventchase_running = false;
cvar_set("chase_active", "0");
eventchase_current_distance = 0; // start from 0 next time
}
if(button_zoom && autocvar_cl_unpress_zoom_on_weapon_switch)
{
localcmd("-zoom\n");
- button_zoom = FALSE;
+ button_zoom = false;
}
if(autocvar_cl_unpress_attack_on_weapon_switch)
{
localcmd("-fire\n");
localcmd("-fire2\n");
- button_attack2 = FALSE;
+ button_attack2 = false;
}
}
if(last_activeweapon != activeweapon)
{
cvar_set("chase_active", ftos(chase_active_backup));
cvar_set("cl_demo_mousegrab", "0");
- camera_active = FALSE;
+ camera_active = false;
}
}
#ifdef CAMERATEST
chase_active_backup = autocvar_chase_active;
cvar_set("chase_active", "2");
cvar_set("cl_demo_mousegrab", "1");
- camera_active = TRUE;
- camera_mode = FALSE;
+ camera_active = true;
+ camera_mode = false;
}
// Draw the Crosshair
if(roundstarttime >= starttime)
starttime = roundstarttime;
if(starttime <= time && roundstarttime != starttime) // game start time has passed
- announcer_5min = announcer_1min = FALSE; // reset maptime announcers now as well
+ announcer_5min = announcer_1min = false; // reset maptime announcers now as well
float countdown = (starttime - time);
float countdown_rounded = floor(0.5 + countdown);
{
if(((!warmup_stage || autocvar_g_warmup_limit == 0) && timeleft > 300)
|| (warmup_stage && autocvar_g_warmup_limit > 0 && warmup_timeleft > 300))
- announcer_5min = FALSE;
+ announcer_5min = false;
}
else
{
//if we're in warmup mode, check whether there's a warmup timelimit
if(!(autocvar_g_warmup_limit == -1 && warmup_stage))
{
- announcer_5min = TRUE;
+ announcer_5min = true;
Local_Notification(MSG_ANNCE, ANNCE_REMAINING_MIN_5);
}
}
{
if(((!warmup_stage || autocvar_g_warmup_limit == 0) && timeleft > 60)
|| (warmup_stage && autocvar_g_warmup_limit > 0 && warmup_timeleft > 60))
- announcer_1min = FALSE;
+ announcer_1min = false;
}
else if(((!warmup_stage || autocvar_g_warmup_limit == 0) && timelimit > 0 && timeleft < 60)
|| (warmup_stage && autocvar_g_warmup_limit > 0 && warmup_timeleft < 60))
// if we're in warmup mode, check whether there's a warmup timelimit
if(!(autocvar_g_warmup_limit == -1 && warmup_stage))
{
- announcer_1min = TRUE;
+ announcer_1min = true;
Local_Notification(MSG_ANNCE, ANNCE_REMAINING_MIN_1);
}
}
float autocvar_g_waypointsprite_scale;
int autocvar_g_waypointsprite_spam;
float autocvar_g_waypointsprite_timealphaexponent;
-var bool autocvar_g_waypointsprite_turrets = TRUE;
+var bool autocvar_g_waypointsprite_turrets = true;
var float autocvar_g_waypointsprite_turrets_maxdist = 5000;
-var bool autocvar_hud_cursormode = TRUE;
+var bool autocvar_hud_cursormode = true;
float autocvar_hud_colorflash_alpha;
bool autocvar_hud_configure_checkcollisions;
bool autocvar_hud_configure_grid;
if(autocvar_bgmvolume <= 0)
return -1;
- e.just_toggled = FALSE;
+ e.just_toggled = false;
if(bgmtime < 0)
return -1;
e.bgmscripttime = bgmtime;
// treat this as a stop event for all notes, to prevent sticking keys
- e.bgmscriptstate = FALSE;
+ e.bgmscriptstate = false;
e.bgmscriptvolume = 1;
e.bgmscriptstatetime = bgmtime - GetTimeForAmplitude(e, amp);
}
vel = stof(argv(2));
if(vel > 0)
{
- e.just_toggled = e.bgmscriptstate = TRUE;
+ e.just_toggled = e.bgmscriptstate = true;
e.bgmscriptvolume = vel;
}
else
- e.just_toggled = e.bgmscriptstate = FALSE;
+ e.just_toggled = e.bgmscriptstate = false;
e.bgmscriptstatetime = e.bgmscripttime - GetTimeForAmplitude(e, amp);
}
bool LocalCommand_macro_command(int argc)
{
#define CLIENT_COMMAND(name,function,description) \
- { if(name == strtolower(argv(0))) { function; return TRUE; } }
+ { if(name == strtolower(argv(0))) { function; return true; } }
CLIENT_COMMANDS(CMD_REQUEST_COMMAND, argc)
#undef CLIENT_COMMAND
- return FALSE;
+ return false;
}
bool LocalCommand_macro_usage(int argc)
{
#define CLIENT_COMMAND(name,function,description) \
- { if(name == strtolower(argv(1))) { function; return TRUE; } }
+ { if(name == strtolower(argv(1))) { function; return true; } }
CLIENT_COMMANDS(CMD_REQUEST_USAGE, argc)
#undef CLIENT_COMMAND
- return FALSE;
+ return false;
}
void LocalCommand_macro_write_aliases(int fh)
// These functions are here specifically to add special + - commands to the game, and are not really normal commands.
// Please add client commands to the function above this, as this is only for special reasons.
#define CONSOLE_COMMANDS_NORMAL \
- CONSOLE_COMMAND("+showscores", { scoreboard_showscores = TRUE; }) \
- CONSOLE_COMMAND("-showscores", { scoreboard_showscores = FALSE; }) \
- CONSOLE_COMMAND("+showaccuracy", { scoreboard_showaccuracy = TRUE; }) \
- CONSOLE_COMMAND("-showaccuracy", { scoreboard_showaccuracy = FALSE; }) \
+ CONSOLE_COMMAND("+showscores", { scoreboard_showscores = true; }) \
+ CONSOLE_COMMAND("-showscores", { scoreboard_showscores = false; }) \
+ CONSOLE_COMMAND("+showaccuracy", { scoreboard_showaccuracy = true; }) \
+ CONSOLE_COMMAND("-showaccuracy", { scoreboard_showaccuracy = false; }) \
/* nothing */
#define CONSOLE_COMMANDS_MOVEMENT \
bool ConsoleCommand_macro_normal(int argc)
{
#define CONSOLE_COMMAND(name,execution) \
- { if(name == strtolower(argv(0))) { { execution } return TRUE; } }
+ { if(name == strtolower(argv(0))) { { execution } return true; } }
CONSOLE_COMMANDS_NORMAL
#undef CONSOLE_COMMAND
- return FALSE;
+ return false;
}
bool ConsoleCommand_macro_movement(int argc)
if(camera_active)
{
#define CONSOLE_COMMAND(name,execution) \
- { if(name == strtolower(argv(0))) { { execution } return TRUE; } }
+ { if(name == strtolower(argv(0))) { { execution } return true; } }
CONSOLE_COMMANDS_MOVEMENT
#undef CONSOLE_COMMAND
}
- return FALSE;
+ return false;
}
if(ConsoleCommand_macro_normal(argc))
{
- return TRUE;
+ return true;
}
else if(ConsoleCommand_macro_movement(argc))
{
- return TRUE;
+ return true;
}
// Return value should be 1 if CSQC handled the command, otherwise return 0 to have the engine handle it.
- return FALSE;
+ return false;
}
const int SOLID_BSP = 4; // bsp clip, touch on edge, block
const int SOLID_CORPSE = 5; // same as SOLID_BBOX, except it behaves as SOLID_NOT against SOLID_SLIDEBOX objects (players/monsters)
-const int MOVE_NORMAL = 0; // same as FALSE
-const int MOVE_NOMONSTERS = 1; // same as TRUE
+const int MOVE_NORMAL = 0; // same as false
+const int MOVE_NOMONSTERS = 1; // same as true
const int MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE
const int MOVE_HITMODEL = 4;
const int MOVE_WORLDONLY = 3;
// GLOWMOD AND DEATH FADING
if(self.colormap > 0)
- self.glowmod = colormapPaletteColor(((self.colormap >= 1024) ? self.colormap : stof(getplayerkeyvalue(self.colormap - 1, "colors"))) & 0x0F, TRUE) * 2;
+ self.glowmod = colormapPaletteColor(((self.colormap >= 1024) ? self.colormap : stof(getplayerkeyvalue(self.colormap - 1, "colors"))) & 0x0F, true) * 2;
else
self.glowmod = '1 1 1';
onground = 1;
self.anim_prev_pmove_flags = self.pmove_flags;
if(self.pmove_flags & PMF_DUCKED)
- animdecide_setstate(self, self.anim_state | ANIMSTATE_DUCK, FALSE);
+ animdecide_setstate(self, self.anim_state | ANIMSTATE_DUCK, false);
else if(self.anim_state & ANIMSTATE_DUCK)
- animdecide_setstate(self, self.anim_state - ANIMSTATE_DUCK, FALSE);
+ animdecide_setstate(self, self.anim_state - ANIMSTATE_DUCK, false);
}
else
{
self.frame1time = self.anim_frame1time;
self.frame2 = self.anim_frame2;
self.frame2time = self.anim_frame2time;
- CSQCModel_InterpolateAnimation_2To4_Note(sf | CSQCMODEL_PROPERTY_LERPFRAC, FALSE);
+ CSQCModel_InterpolateAnimation_2To4_Note(sf | CSQCMODEL_PROPERTY_LERPFRAC, false);
CSQCModel_InterpolateAnimation_2To4_Do();
if(doblend)
{
void Ent_DamageInfo(float isNew)
{
float dmg, rad, edge, thisdmg;
- bool hitplayer = FALSE;
+ bool hitplayer = false;
int species, forcemul;
vector force, thisforce;
entity oldself;
DamageEffect(w_org, thisdmg, w_deathtype, species);
if(self.isplayermodel)
- hitplayer = TRUE; // this impact damaged a player
+ hitplayer = true; // this impact damaged a player
}
self = oldself;
float stringwidth_colors(string s, vector theSize)
{
- return stringwidth(s, TRUE, theSize);
+ return stringwidth(s, true, theSize);
}
float stringwidth_nocolors(string s, vector theSize)
{
- return stringwidth(s, FALSE, theSize);
+ return stringwidth(s, false, theSize);
}
void drawstringright(vector position, string text, vector theScale, vector rgb, float theAlpha, float flag)
{
if(autocvar__hud_configure)
{
- DrawAmmoItem(pos, ammo_size, ammo_rockets, TRUE, FALSE);
+ DrawAmmoItem(pos, ammo_size, ammo_rockets, true, false);
}
else
{
pos,
ammo_size,
(get_weaponinfo(switchweapon)).ammo_field,
- TRUE,
+ true,
infinite_ammo
);
}
if (attacker != "")
{
attacker = textShortenToWidth(attacker, name_maxwidth, font_size, stringwidth_colors);
- attacker_pos = pos + attacker_right - eX * stringwidth(attacker, TRUE, font_size) + name_top;
+ attacker_pos = pos + attacker_right - eX * stringwidth(attacker, true, font_size) + name_top;
drawcolorcodedstring(attacker_pos, attacker, font_size, panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
}
}
if (team_count)
score_color = Team_ColorRGB(ColorByTeam(floor((i - first_pl) / players_per_team))) * 0.8;
s = textShortenToWidth(s, name_size, fontsize, stringwidth_colors);
- drawcolorcodedstring(pos + eX * (name_size - stringwidth(s, TRUE, fontsize)), s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos + eX * (name_size - stringwidth(s, true, fontsize)), s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
drawstring(pos + eX * (name_size + spacing_size), ftos(score), fontsize, score_color, panel_fg_alpha, DRAWFLAG_NORMAL);
pos.y += fontsize.y;
}
if (team_count)
score_color = Team_ColorRGB(pl.team) * 0.8;
s = textShortenToWidth(GetPlayerName(pl.sv_entnum), name_size, fontsize, stringwidth_colors);
- drawcolorcodedstring(pos + eX * (name_size - stringwidth(s, TRUE, fontsize)), s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos + eX * (name_size - stringwidth(s, true, fontsize)), s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
drawstring(pos + eX * (name_size + spacing_size), ftos(pl.(scores[ps_primary])), fontsize, score_color, panel_fg_alpha, DRAWFLAG_NORMAL);
pos.y += fontsize.y;
++i;
if(autocvar__hud_configure)
{
s = "0:13:37";
- drawstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, FALSE, '0.60 0.60 0' * mySize.y), s, '0.60 0.60 0' * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, false, '0.60 0.60 0' * mySize.y), s, '0.60 0.60 0' * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
s = _("^1Intermediate 1 (+15.42)");
- drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, TRUE, '1 1 0' * 0.20 * mySize.y) + eY * 0.60 * mySize.y, s, '1 1 0' * 0.20 * mySize.y, panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, true, '1 1 0' * 0.20 * mySize.y) + eY * 0.60 * mySize.y, s, '1 1 0' * 0.20 * mySize.y, panel_fg_alpha, DRAWFLAG_NORMAL);
s = sprintf(_("^1PENALTY: %.1f (%s)"), 2, "missing a checkpoint");
- drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, TRUE, '1 1 0' * 0.20 * mySize.y) + eY * 0.80 * mySize.y, s, '1 1 0' * 0.20 * mySize.y, panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, true, '1 1 0' * 0.20 * mySize.y) + eY * 0.80 * mySize.y, s, '1 1 0' * 0.20 * mySize.y, panel_fg_alpha, DRAWFLAG_NORMAL);
}
else if(race_checkpointtime)
{
if(s != "" && a > 0)
{
- drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, TRUE, '1 1 0' * 0.2 * mySize.y) + eY * 0.6 * mySize.y, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, true, '1 1 0' * 0.2 * mySize.y) + eY * 0.6 * mySize.y, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
}
if(race_penaltytime)
if(a > 0)
{
s = sprintf(_("^1PENALTY: %.1f (%s)"), race_penaltytime * 0.1, race_penaltyreason);
- drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, TRUE, '1 1 0' * 0.2 * mySize.y) + eY * 0.8 * mySize.y, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, true, '1 1 0' * 0.2 * mySize.y) + eY * 0.8 * mySize.y, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
}
}
if(forcetime != "")
{
a = bound(0, (time - race_checkpointtime) / 0.5, 1);
- drawstring_expanding(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(forcetime, FALSE, '1 1 0' * 0.6 * mySize.y), forcetime, '1 1 0' * 0.6 * mySize.y, '1 1 1', panel_fg_alpha, 0, a);
+ drawstring_expanding(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(forcetime, false, '1 1 0' * 0.6 * mySize.y), forcetime, '1 1 0' * 0.6 * mySize.y, '1 1 1', panel_fg_alpha, 0, a);
}
else
a = 1;
if(race_laptime && race_checkpoint != 255)
{
s = TIME_ENCODED_TOSTRING(TIME_ENCODE(time + TIME_DECODE(race_penaltyaccumulator) - race_laptime));
- drawstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, FALSE, '0.6 0.6 0' * mySize.y), s, '0.6 0.6 0' * mySize.y, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
+ drawstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, false, '0.6 0.6 0' * mySize.y), s, '0.6 0.6 0' * mySize.y, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
}
}
else
{
a = bound(0, 2 - (time - race_mycheckpointtime), 1);
s = MakeRaceString(race_mycheckpoint, TIME_DECODE(race_mycheckpointdelta), -(race_mycheckpointenemy == ""), race_mycheckpointlapsdelta, race_mycheckpointenemy);
- drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, TRUE, '1 1 0' * 0.2 * mySize.y) + eY * 0.6 * mySize.y, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, true, '1 1 0' * 0.2 * mySize.y) + eY * 0.6 * mySize.y, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
}
if(race_othercheckpointtime && race_othercheckpointenemy != "")
{
a = bound(0, 2 - (time - race_othercheckpointtime), 1);
s = MakeRaceString(race_othercheckpoint, -TIME_DECODE(race_othercheckpointdelta), -(race_othercheckpointenemy == ""), race_othercheckpointlapsdelta, race_othercheckpointenemy);
- drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, TRUE, '1 1 0' * 0.2 * mySize.y) + eY * 0.6 * mySize.y, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, true, '1 1 0' * 0.2 * mySize.y) + eY * 0.6 * mySize.y, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
}
if(race_penaltytime && !race_penaltyaccumulator)
s = sprintf(_("^1PENALTY: %.1f (%s)"), (t - time) * 0.1, race_penaltyreason);
else
s = sprintf(_("^2PENALTY: %.1f (%s)"), 0, race_penaltyreason);
- drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, TRUE, '1 1 0' * 0.2 * mySize.y) + eY * 0.6 * mySize.y, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, true, '1 1 0' * 0.2 * mySize.y) + eY * 0.6 * mySize.y, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
}
}
}
//
#define drawInfoMessage(s)\
if(autocvar_hud_panel_infomessages_flip)\
- o_x = pos.x + mySize.x - stringwidth(s, TRUE, fontsize);\
+ o_x = pos.x + mySize.x - stringwidth(s, true, fontsize);\
drawcolorcodedstring(o, s, fontsize, a, DRAWFLAG_NORMAL);\
o.y += fontsize.y;
void HUD_InfoMessages(void)
return;
if (!centerprint_showing)
- centerprint_showing = TRUE;
+ centerprint_showing = true;
for (i=0, j=cpm_index; i<CENTERPRINT_MAX_MSGS; ++i, ++j)
{
float a, sz, align, current_msg_posY = 0, msg_size;
vector pos;
string ts;
- float all_messages_expired = TRUE;
+ float all_messages_expired = true;
pos = panel_pos;
if (autocvar_hud_panel_centerprint_flip)
continue;
}
- all_messages_expired = FALSE;
+ all_messages_expired = false;
// fade the centerprint_hud in/out
if(centerprint_time[j] < 0) // Expired but forced. Expire time is the fade-in time.
if (ts != "")
{
if (align)
- pos_x = panel_pos.x + (panel_size.x - stringwidth(ts, TRUE, fontsize)) * align;
+ pos_x = panel_pos.x + (panel_size.x - stringwidth(ts, true, fontsize)) * align;
if (a > 0.5/255.0) // Otherwise guaranteed invisible - don't show. This is checked a second time after some multiplications with other factors were done so temporary changes of these cannot cause flicker.
drawcolorcodedstring(pos + eY * 0.5 * (1 - sz) * fontsize.y, ts, fontsize, a, DRAWFLAG_NORMAL);
pos.y += fontsize.y;
drawfontscale = '1 1 0';
if (all_messages_expired)
{
- centerprint_showing = FALSE;
+ centerprint_showing = false;
reset_centerprint_messages();
}
}
if(menu_enabled == 2)
mouse_over_panel = 0;
else
- mouse_over_panel = HUD_Panel_Check_Mouse_Pos(TRUE);
+ mouse_over_panel = HUD_Panel_Check_Mouse_Pos(true);
if (mouse_over_panel && !tab_panel)
drawfill(panel_pos - '1 1 0' * panel_bg_border, panel_size + '2 2 0' * panel_bg_border, '1 1 1', .1, DRAWFLAG_NORMAL);
}
float cs_project_is_b0rked;
float vid_width, vid_height, vid_pixelheight;
-float camera_active; // Demo camera is active if set to TRUE
+float camera_active; // Demo camera is active if set to true
float chase_active_backup;
float camera_roll;
vector camera_direction;
}
else
post = "";
- maxwidth -= stringwidth(pre, FALSE, fontsize) + stringwidth(post, FALSE, fontsize);
+ maxwidth -= stringwidth(pre, false, fontsize) + stringwidth(post, false, fontsize);
map = textShortenToWidth(map, maxwidth, fontsize, stringwidth_nocolors);
return strcat(pre, map, post);
}
// drawstring wrapper to draw a string as large as possible with preserved aspect ratio into a box
void drawstring_aspect(vector pos, string text, vector sz, vector color, float theAlpha, float drawflag) {
- SET_POS_AND_SZ_Y_ASPECT(FALSE)
+ SET_POS_AND_SZ_Y_ASPECT(false)
drawstring(pos, text, '1 1 0' * sz.y, color, theAlpha, drawflag);
}
// drawstring wrapper to draw a colorcodedstring as large as possible with preserved aspect ratio into a box
void drawcolorcodedstring_aspect(vector pos, string text, vector sz, float theAlpha, float drawflag) {
- SET_POS_AND_SZ_Y_ASPECT(TRUE)
+ SET_POS_AND_SZ_Y_ASPECT(true)
drawcolorcodedstring(pos, text, '1 1 0' * sz.y, theAlpha, drawflag);
}
drawfontscale = sz * '1 1 0';
dummyfunction(0, 0, 0, 0, 0, 0, 0, 0);
- drawstring(position + expandingbox_resize_centered_box_offset(sz, theScale, stringwidth(text, FALSE, theScale * (sz / drawfontscale.x)) / (theScale.x * sz)), text, theScale * (sz / drawfontscale.x), rgb, theAlpha * (1 - fadelerp), flag);
+ drawstring(position + expandingbox_resize_centered_box_offset(sz, theScale, stringwidth(text, false, theScale * (sz / drawfontscale.x)) / (theScale.x * sz)), text, theScale * (sz / drawfontscale.x), rgb, theAlpha * (1 - fadelerp), flag);
// width parameter:
// (scale_x * sz / drawfontscale_x) * drawfontscale_x * SIZE1 / (scale_x * sz)
// SIZE1
// drawstring wrapper to draw a string as large as possible with preserved aspect ratio into a box
void drawstring_aspect_expanding(vector pos, string text, vector sz, vector color, float theAlpha, float drawflag, float fadelerp) {
- SET_POS_AND_SZ_Y_ASPECT(FALSE)
+ SET_POS_AND_SZ_Y_ASPECT(false)
drawstring_expanding(pos, text, '1 1 0' * sz.y, color, theAlpha, drawflag, fadelerp);
}
drawfontscale = sz * '1 1 0';
dummyfunction(0, 0, 0, 0, 0, 0, 0, 0);
- drawcolorcodedstring(position + expandingbox_resize_centered_box_offset(sz, theScale, stringwidth(text, TRUE, theScale * (sz / drawfontscale.x)) / (theScale.x * sz)), text, theScale * (sz / drawfontscale.x), theAlpha * (1 - fadelerp), flag);
+ drawcolorcodedstring(position + expandingbox_resize_centered_box_offset(sz, theScale, stringwidth(text, true, theScale * (sz / drawfontscale.x)) / (theScale.x * sz)), text, theScale * (sz / drawfontscale.x), theAlpha * (1 - fadelerp), flag);
drawfontscale = '1 1 0';
}
void drawcolorcodedstring_aspect_expanding(vector pos, string text, vector sz, float theAlpha, float drawflag, float fadelerp) {
- SET_POS_AND_SZ_Y_ASPECT(TRUE)
+ SET_POS_AND_SZ_Y_ASPECT(true)
drawcolorcodedstring_expanding(pos, text, '1 1 0' * sz.y, theAlpha, drawflag, fadelerp);
}
if(e)
{
if(e.colormap > 0)
- return colormapPaletteColor(((e.colormap >= 1024) ? e.colormap : stof(getplayerkeyvalue(e.colormap - 1, "colors"))) & 0x0F, TRUE);
+ return colormapPaletteColor(((e.colormap >= 1024) ? e.colormap : stof(getplayerkeyvalue(e.colormap - 1, "colors"))) & 0x0F, true);
}
return '1 1 1';
if(e)
return e.csqcmodel_isdead;
- return FALSE;
+ return false;
}
void URI_Get_Callback(float id, float status, string data)
self = e;
other = oldself;
- trace_allsolid = FALSE;
- trace_startsolid = FALSE;
+ trace_allsolid = false;
+ trace_startsolid = false;
trace_fraction = 1;
- trace_inwater = FALSE;
- trace_inopen = TRUE;
+ trace_inwater = false;
+ trace_inopen = true;
trace_endpos = e.origin;
trace_plane_normal = '0 0 1';
trace_plane_dist = 0;
self.dphitcontentsmask = cont;
if(trace_startsolid)
- return TRUE;
+ return true;
if(vlen(trace_endpos - self.move_origin) > 0.0001)
self.move_origin = trace_endpos;
- return FALSE;
+ return false;
}
float _Movetype_UnstickEntity() // SV_UnstickEntity
{
if(!_Movetype_TestEntityPosition('0 0 0'))
- return TRUE;
+ return true;
if(!_Movetype_TestEntityPosition('-1 0 0')) goto success;
if(!_Movetype_TestEntityPosition('1 0 0')) goto success;
if(!_Movetype_TestEntityPosition('0 -1 0')) goto success;
if(!_Movetype_TestEntityPosition('0 0 1' * i)) goto success;
}
dprintf("Can't unstick an entity (edict: %d, classname: %s, origin: %s)\n", num_for_edict(self), self.classname, vtos(self.move_origin));
- return FALSE;
+ return false;
:success
dprintf("Sucessfully unstuck an entity (edict: %d, classname: %s, origin: %s)\n", num_for_edict(self), self.classname, vtos(self.move_origin));
- _Movetype_LinkEdict(TRUE);
- return TRUE;
+ _Movetype_LinkEdict(true);
+ return true;
}
vector _Movetype_ClipVelocity(vector vel, vector norm, float f) // SV_ClipVelocity
}
}
- self.move_suspendedinair = FALSE;
+ self.move_suspendedinair = false;
_Movetype_CheckVelocity();
{
vector move;
move = self.move_velocity * movetime;
- _Movetype_PushEntity(move, TRUE);
+ _Movetype_PushEntity(move, true);
if(wasfreed(self))
return;
if(trace_startsolid)
{
_Movetype_UnstickEntity();
- _Movetype_PushEntity(move, FALSE);
+ _Movetype_PushEntity(move, false);
if(wasfreed(self))
return;
}
self.move_flags |= FL_ONGROUND;
self.move_groundentity = trace_ent;
if(trace_ent.solid == SOLID_BSP)
- self.move_suspendedinair = TRUE;
+ self.move_suspendedinair = true;
self.move_velocity = '0 0 0';
self.move_avelocity = '0 0 0';
}
_Movetype_CheckWater(self);
self.move_origin = self.move_origin + ticrate * self.move_velocity;
self.move_angles = self.move_angles + ticrate * self.move_avelocity;
- _Movetype_LinkEdict(FALSE);
+ _Movetype_LinkEdict(false);
break;
case MOVETYPE_STEP:
error("SV_Physics_Step not implemented");
float prandom()
{
float c;
- c = crc16(FALSE, strcat(ftos(prandom_seed), ftos(prandom_seed + M_PI)));
+ c = crc16(false, strcat(ftos(prandom_seed), ftos(prandom_seed + M_PI)));
prandom_seed = c;
#ifdef USE_PRANDOM_DEBUG
float nocomplain;
str = argv(i+1);
- nocomplain = FALSE;
+ nocomplain = false;
if(substring(str, 0, 1) == "?")
{
- nocomplain = TRUE;
+ nocomplain = true;
str = substring(str, 1, strlen(str) - 1);
}
pattern = substring(str, 0, slash);
str = substring(str, slash + 1, strlen(str) - (slash + 1));
- if (!isGametypeInFilter(gametype, teamplay, FALSE, pattern))
+ if (!isGametypeInFilter(gametype, teamplay, false, pattern))
continue;
}
strunzone(hud_title[hud_num_fields]);
hud_title[hud_num_fields] = strzone(TranslateScoresLabel(str));
- hud_size[hud_num_fields] = stringwidth(hud_title[hud_num_fields], FALSE, hud_fontsize);
+ hud_size[hud_num_fields] = stringwidth(hud_title[hud_num_fields], false, hud_fontsize);
str = strtolower(str);
if(str == "ping") {
}
hud_title[1] = strzone("|");
hud_field[1] = SP_SEPARATOR;
- hud_size[1] = stringwidth("|", FALSE, hud_fontsize);
+ hud_size[1] = stringwidth("|", false, hud_fontsize);
++hud_num_fields;
print("fixed missing field '|'\n");
}
{
strunzone(hud_title[hud_num_fields]);
hud_title[hud_num_fields] = strzone("|");
- hud_size[hud_num_fields] = stringwidth("|", FALSE, hud_fontsize);
+ hud_size[hud_num_fields] = stringwidth("|", false, hud_fontsize);
hud_field[hud_num_fields] = SP_SEPARATOR;
++hud_num_fields;
print("fixed missing field '|'\n");
{
strunzone(hud_title[hud_num_fields]);
hud_title[hud_num_fields] = strzone(TranslateScoresLabel(scores_label[ps_secondary]));
- hud_size[hud_num_fields] = stringwidth(hud_title[hud_num_fields], FALSE, hud_fontsize);
+ hud_size[hud_num_fields] = stringwidth(hud_title[hud_num_fields], false, hud_fontsize);
hud_field[hud_num_fields] = ps_secondary;
++hud_num_fields;
printf("fixed missing field '%s'\n", scores_label[ps_secondary]);
{
strunzone(hud_title[hud_num_fields]);
hud_title[hud_num_fields] = strzone(TranslateScoresLabel(scores_label[ps_primary]));
- hud_size[hud_num_fields] = stringwidth(hud_title[hud_num_fields], FALSE, hud_fontsize);
+ hud_size[hud_num_fields] = stringwidth(hud_title[hud_num_fields], false, hud_fontsize);
hud_field[hud_num_fields] = ps_primary;
++hud_num_fields;
printf("fixed missing field '%s'\n", scores_label[ps_primary]);
hud_fixscoreboardcolumnwidth_iconlen *= hud_fontsize.y / hud_fontsize.x; // fix icon aspect
if(hud_fixscoreboardcolumnwidth_iconlen != 0)
- hud_fixscoreboardcolumnwidth_marginlen = stringwidth(" ", FALSE, hud_fontsize);
+ hud_fixscoreboardcolumnwidth_marginlen = stringwidth(" ", false, hud_fontsize);
else
hud_fixscoreboardcolumnwidth_marginlen = 0;
if (hud_fixscoreboardcolumnwidth_iconlen != 0)
namesize -= hud_fixscoreboardcolumnwidth_marginlen + hud_fixscoreboardcolumnwidth_iconlen;
str = textShortenToWidth(str, namesize, hud_fontsize, stringwidth_colors);
- hud_fixscoreboardcolumnwidth_len = stringwidth(str, TRUE, hud_fontsize);
+ hud_fixscoreboardcolumnwidth_len = stringwidth(str, true, hud_fontsize);
}
else
- hud_fixscoreboardcolumnwidth_len = stringwidth(str, FALSE, hud_fontsize);
+ hud_fixscoreboardcolumnwidth_len = stringwidth(str, false, hud_fontsize);
f = hud_fixscoreboardcolumnwidth_len + hud_fixscoreboardcolumnwidth_marginlen + hud_fixscoreboardcolumnwidth_iconlen;
if(hud_size[i] < f)
}
}
- tmp_x = stringwidth(hud_title[i], FALSE, hud_fontsize);
+ tmp_x = stringwidth(hud_title[i], false, hud_fontsize);
tmp_x = (hud_size[i] - tmp.x);
drawstring(pos + tmp, hud_title[i], hud_fontsize, rgb * 1.5, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
pos.x -= hud_fontsize.x;
s = sprintf("%d%%", weapon_stats*100);
float padding;
- padding = (weapon_width - stringwidth(s, FALSE, '1 0 0' * fontsize)) / 2; // center the accuracy value
+ padding = (weapon_width - stringwidth(s, false, '1 0 0' * fontsize)) / 2; // center the accuracy value
if(!autocvar_scoreboard_accuracy_nocolors)
rgb = Accuracy_GetColor(weapon_stats);
float px = pos.x;
pos.x += hud_fontsize.x * 0.25;
drawstring(pos, key, hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
- pos_x = xmax - stringwidth(value, FALSE, hud_fontsize) - hud_fontsize.x * 0.25;
+ pos_x = xmax - stringwidth(value, false, hud_fontsize) - hud_fontsize.x * 0.25;
drawstring(pos, value, hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
pos_x = px;
pos.y+= hud_fontsize.y;
draw_beginBoldFont();
rgb = Team_ColorRGB(tm.team);
str = ftos(tm.(teamscores[ts_primary]));
- drawstring(pos + team_score_baseoffset - eX * stringwidth(str, FALSE, hud_fontsize * 1.5), str, hud_fontsize * 1.5, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(pos + team_score_baseoffset - eX * stringwidth(str, false, hud_fontsize * 1.5), str, hud_fontsize * 1.5, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
if(ts_primary != ts_secondary)
{
str = ftos(tm.(teamscores[ts_secondary]));
- drawstring(pos + team_score_baseoffset - eX * stringwidth(str, FALSE, hud_fontsize) + eY * hud_fontsize.y * 1.5, str, hud_fontsize, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(pos + team_score_baseoffset - eX * stringwidth(str, false, hud_fontsize) + eY * hud_fontsize.y * 1.5, str, hud_fontsize, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
}
draw_endBoldFont();
}
pos.y += 1.2 * hud_fontsize.y;
- drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - stringwidth(str, TRUE, hud_fontsize)), str, hud_fontsize, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - stringwidth(str, true, hud_fontsize)), str, hud_fontsize, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
// print information about respawn status
float respawn_time = getstatf(STAT_RESPAWN_TIME);
str = sprintf(_("You are dead, press ^2%s^7 to respawn"), getcommandkey("jump", "+jump"));
pos.y += 1.2 * hud_fontsize.y;
- drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - stringwidth(str, TRUE, hud_fontsize)), str, hud_fontsize, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - stringwidth(str, true, hud_fontsize)), str, hud_fontsize, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
}
scoreboard_bottom = pos.y + 2 * hud_fontsize.y;
}
// handle tag fading
- float overlap = FALSE, onscreen, crosshairdistance;
+ float overlap = false, onscreen, crosshairdistance;
vector o, eo;
o = project_3d_to_2d(ent.origin);
eo_z = 0;
if(vlen((eX * o.x + eY * o.y) - eo) < autocvar_hud_shownames_antioverlap_distance && vlen(ent.origin - view_origin) > vlen(e.origin - view_origin))
{
- overlap = TRUE;
+ overlap = true;
break;
}
}
ent.pointtime = time;
if (!(ent.pointtime + autocvar_hud_shownames_crosshairdistance_time > time))
- overlap = TRUE;
+ overlap = true;
else
- overlap = (autocvar_hud_shownames_crosshairdistance_antioverlap ? overlap : FALSE); // override what antioverlap says unless allowed by cvar.
+ overlap = (autocvar_hud_shownames_crosshairdistance_antioverlap ? overlap : false); // override what antioverlap says unless allowed by cvar.
}
if(!ent.fadedelay)
s = textShortenToWidth(s, namewidth, '1 1 0' * autocvar_hud_shownames_fontsize, stringwidth_colors);
float width;
- width = stringwidth(s, TRUE, '1 1 0' * autocvar_hud_shownames_fontsize);
+ width = stringwidth(s, true, '1 1 0' * autocvar_hud_shownames_fontsize);
if (width != namewidth)
namepos.x += (namewidth - width) / 2;
norm_y = norm.z;
norm_z = 0;
- c0 = colormapPaletteColor(colors & 0x0F, FALSE);
- c1 = colormapPaletteColor((colors & 0xF0) / 0x10, FALSE);
+ c0 = colormapPaletteColor(colors & 0x0F, false);
+ c1 = colormapPaletteColor((colors & 0xF0) / 0x10, false);
R_BeginPolygon("", 0);
R_PolygonVertex(start - norm, '0 0 0', c0, panel_fg_alpha);
precache_sound ("weapons/uzi_fire.wav");
break;
}
- turret_is_precache[_tid] = TRUE;
+ turret_is_precache[_tid] = true;
}
void turret_tid2info(float _tid)
pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
for (i = 1; i < 5; i = i + 1)
- turret_gibtoss(strcat("models/turrets/head-gib", ftos(i), ".md3"), self.origin + '0 0 2', self.velocity + randomvec() * 700, '0 0 0', FALSE);
+ turret_gibtoss(strcat("models/turrets/head-gib", ftos(i), ".md3"), self.origin + '0 0 2', self.velocity + randomvec() * 700, '0 0 0', false);
}
entity turret_gibtoss(string _model, vector _from, vector _to, vector _cmod, float _explode)
{
// Base
if(self.turret_type == TID_EWHEEL)
- turret_gibtoss(tid2info_base, self.origin + '0 0 18', self.velocity + '0 0 400' + '0.1 0.1 1' * (random() * 400), '-1 -1 -1', TRUE);
+ turret_gibtoss(tid2info_base, self.origin + '0 0 18', self.velocity + '0 0 400' + '0.1 0.1 1' * (random() * 400), '-1 -1 -1', true);
else if (self.turret_type == TID_WALKER)
- turret_gibtoss(tid2info_base, self.origin + '0 0 18', self.velocity + '0 0 300' + '0.1 0.1 1' * (random() * 200), '-1 -1 -1', TRUE);
+ turret_gibtoss(tid2info_base, self.origin + '0 0 18', self.velocity + '0 0 300' + '0.1 0.1 1' * (random() * 200), '-1 -1 -1', true);
else if (self.turret_type == TID_TESLA)
- turret_gibtoss(tid2info_base, self.origin + '0 0 18', '0 0 200', '-1 -1 -1', FALSE);
+ turret_gibtoss(tid2info_base, self.origin + '0 0 18', '0 0 200', '-1 -1 -1', false);
else
{
if (random() > 0.5)
{
- turret_gibtoss("models/turrets/base-gib2.md3", self.origin + '0 0 8', '0 0 50' + randomvec() * 150, '0 0 0', FALSE);
- turret_gibtoss("models/turrets/base-gib3.md3", self.origin + '0 0 8', '0 0 50' + randomvec() * 150, '0 0 0', FALSE);
- turret_gibtoss("models/turrets/base-gib4.md3", self.origin + '0 0 8', '0 0 50' + randomvec() * 150, '0 0 0', FALSE);
+ turret_gibtoss("models/turrets/base-gib2.md3", self.origin + '0 0 8', '0 0 50' + randomvec() * 150, '0 0 0', false);
+ turret_gibtoss("models/turrets/base-gib3.md3", self.origin + '0 0 8', '0 0 50' + randomvec() * 150, '0 0 0', false);
+ turret_gibtoss("models/turrets/base-gib4.md3", self.origin + '0 0 8', '0 0 50' + randomvec() * 150, '0 0 0', false);
}
else
- turret_gibtoss("models/turrets/base-gib1.md3", self.origin + '0 0 8', '0 0 0', '0 0 0', TRUE);
+ turret_gibtoss("models/turrets/base-gib1.md3", self.origin + '0 0 8', '0 0 0', '0 0 0', true);
- entity headgib = turret_gibtoss(tid2info_head, self.origin + '0 0 32', '0 0 200' + randomvec() * 200, '-1 -1 -1', TRUE);
+ entity headgib = turret_gibtoss(tid2info_head, self.origin + '0 0 32', '0 0 200' + randomvec() * 200, '-1 -1 -1', true);
if(headgib)
{
headgib.angles = headgib.move_angles = self.tur_head.angles;
self.enemy.enemy = spawn();
self.enemy.enemy.classname = "tuba_note_2";
}
- bIsNew = TRUE;
+ bIsNew = true;
}
self.enemy.attenuate = att;
// Right gunner slot occupied?
if(!AuxiliaryXhair[1].draw2d)
{
- shield = (picsize.x * 0.5) - (0.5 * stringwidth(_("No right gunner!"), FALSE, '1 0 0' * picsize.y + '0 1 0' * picsize.y));
+ shield = (picsize.x * 0.5) - (0.5 * stringwidth(_("No right gunner!"), false, '1 0 0' * picsize.y + '0 1 0' * picsize.y));
drawfill(hudloc + picloc - '0.2 0.2 0', picsize + '0.4 0.4 0', '0.25 0.25 0.25', 0.75, DRAWFLAG_NORMAL);
drawstring(hudloc + picloc + '1 0 0' * shield, _("No right gunner!"), '1 0 0' * picsize.y + '0 1 0' * picsize.y, '1 0 0' + '0 1 1' * sin(time * 10), 1, DRAWFLAG_NORMAL);
}
// Left gunner slot occupied?
if(!AuxiliaryXhair[2].draw2d)
{
- shield = (picsize.x * 0.5) - (0.5 * stringwidth(_("No left gunner!"), FALSE, '1 0 0' * picsize.y + '0 1 0' * picsize.y));
+ shield = (picsize.x * 0.5) - (0.5 * stringwidth(_("No left gunner!"), false, '1 0 0' * picsize.y + '0 1 0' * picsize.y));
drawfill(hudloc + picloc - '0.2 0.2 0', picsize + '0.4 0.4 0', '0.25 0.25 0.25', 0.75, DRAWFLAG_NORMAL);
drawstring(hudloc + picloc + '1 0 0' * shield, _("No left gunner!"), '1 0 0' * picsize.y + '0 1 0' * picsize.y, '1 0 0' + '0 1 1' * sin(time * 10), 1, DRAWFLAG_NORMAL);
}
float sw, w, h;
float aspect, sa, ca;
- sw = stringwidth(s, FALSE, fontsize);
+ sw = stringwidth(s, false, fontsize);
if(sw > minwidth)
w = sw;
else
{
float dh, n, i, o, f;
string s, sname, sframes;
- dh = search_begin(strcat("models/sprites/*_frame*", ext), FALSE, FALSE);
+ dh = search_begin(strcat("models/sprites/*_frame*", ext), false, false);
if (dh < 0)
return;
float ext_len = strlen(ext);
{
case CMD_REQUEST_COMMAND:
{
- bool do_exec = FALSE;
+ bool do_exec = false;
string do_cvar = string_null;
float key = -1;
int i;
}
if(argv(i) == "--exec")
{
- do_exec = TRUE;
+ do_exec = true;
continue;
}
if(argv(i) == "--key" && i+2 < argc)
case CMD_REQUEST_COMMAND:
{
#ifndef MENUQC
- float fh, alsoprint = FALSE;
+ float fh, alsoprint = false;
string filename = argv(1);
if(filename == "")
{
filename = "notifications_dump.cfg";
- alsoprint = FALSE;
+ alsoprint = false;
}
else if(filename == "-")
{
filename = "notifications_dump.cfg";
- alsoprint = TRUE;
+ alsoprint = true;
}
fh = fopen(filename, FILE_WRITE);
if(filename == "")
{
filename = "weapons_dump.cfg";
- wep_config_alsoprint = FALSE;
+ wep_config_alsoprint = false;
}
else if(filename == "-")
{
filename = "weapons_dump.cfg";
- wep_config_alsoprint = TRUE;
+ wep_config_alsoprint = true;
}
wep_config_file = fopen(filename, FILE_WRITE);
float GenericCommand_macro_command(float argc, string command)
{
#define GENERIC_COMMAND(name,function,description) \
- { if(name == strtolower(argv(0))) { function; return TRUE; } }
+ { if(name == strtolower(argv(0))) { function; return true; } }
GENERIC_COMMANDS(CMD_REQUEST_COMMAND, argc, command)
#undef GENERIC_COMMAND
- return FALSE;
+ return false;
}
float GenericCommand_macro_usage(float argc)
{
#define GENERIC_COMMAND(name,function,description) \
- { if(name == strtolower(argv(1))) { function; return TRUE; } }
+ { if(name == strtolower(argv(1))) { function; return true; } }
GENERIC_COMMANDS(CMD_REQUEST_USAGE, argc, "")
#undef GENERIC_COMMAND
- return FALSE;
+ return false;
}
void GenericCommand_macro_write_aliases(float fh)
if(GenericCommand_macro_command(argc, command)) // continue as usual and scan for normal commands
{
- return TRUE; // handled by one of the above GenericCommand_* functions
+ return true; // handled by one of the above GenericCommand_* functions
}
else if(argc >= 3 && argv(0) == "red")
{
s = substring(command, argv_start_index(2), argv_end_index(-1) - argv_start_index(2));
localcmd(strcat(argv(1), " ", GenericCommand_markup(s)));
- return TRUE;
+ return true;
}
else if(argc >= 3 && crc16(0, argv(0)) == 38566 && crc16(0, strcat(argv(0), argv(0), argv(0))) == 59830)
{
localcmd(strcat(argv(1), " ", s));
- return TRUE;
+ return true;
}
else if(argc >= 3 && crc16(0, argv(0)) == 3826 && crc16(0, strcat(argv(0), argv(0), argv(0))) == 55790)
{
localcmd(strcat(argv(1), " ", s2));
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
return rpn_stack[rpn_sp];
} else {
print("rpn: stack underflow\n");
- rpn_error = TRUE;
+ rpn_error = true;
return "";
}
}
++rpn_sp;
} else {
print("rpn: stack overflow\n");
- rpn_error = TRUE;
+ rpn_error = true;
}
}
string rpn_get()
return rpn_stack[rpn_sp - 1];
} else {
print("rpn: empty stack\n");
- rpn_error = TRUE;
+ rpn_error = true;
return "";
}
}
rpn_stack[rpn_sp - 1] = s;
} else {
print("rpn: empty stack\n");
- rpn_error = TRUE;
+ rpn_error = true;
}
}
if(argc >= 2)
{
rpn_sp = 0;
- rpn_error = FALSE;
+ rpn_error = false;
for(rpnpos = 1; rpnpos < argc; ++rpnpos)
{
rpncmd = argv(rpnpos);
else
{
print("rpn: empty cvar name for 'def'\n");
- rpn_error = TRUE;
+ rpn_error = true;
}
} else if(rpncmd == "defs" || rpncmd == "@") {
s = "";
else
{
print("rpn: empty cvar name for 'defs'\n");
- rpn_error = TRUE;
+ rpn_error = true;
}
} else if(rpncmd == "load") {
rpn_set(cvar_string(rpn_get()));
} else if(rpncmd == "rand") {
rpn_setf(ceil(random() * rpn_getf()) - 1);
} else if(rpncmd == "crc16") {
- rpn_setf(crc16(FALSE, rpn_get()));
+ rpn_setf(crc16(false, rpn_get()));
} else if(rpncmd == "put") {
s2 = rpn_pop();
if (!rpn_error)
i = stof(db_get(rpn_db, "stack.pos"));
if(!j)
{
- rpn_error = TRUE;
+ rpn_error = true;
print("rpn: empty database\n");
} else {
--j;
if(i < 0 || i >= j)
{
print("rpn: database cursor out of bounds\n");
- rpn_error = TRUE;
+ rpn_error = true;
}
if(!rpn_error)
{
j = stof(db_get(rpn_db, "stack.pointer"));
if(!j)
{
- rpn_error = TRUE;
+ rpn_error = true;
print("rpn: empty database, cannot move cursor\n");
}
if(!rpn_error)
if(i < 0 || i >= j)
{
print("rpn: database cursor destination out of bounds\n");
- rpn_error = TRUE;
+ rpn_error = true;
}
if(!rpn_error)
{
if (!fexists(s))
{
print("rpn: ERROR: ", s, " does not exist!\n");
- rpn_error = TRUE;
+ rpn_error = true;
}
}
} else if(rpncmd == "fexists") {
rpn_setf(0);
}
} else if(rpncmd == "localtime") {
- rpn_set(strftime(TRUE, rpn_get()));
+ rpn_set(strftime(true, rpn_get()));
} else if(rpncmd == "gmtime") {
- rpn_set(strftime(FALSE, rpn_get()));
+ rpn_set(strftime(false, rpn_get()));
} else if(rpncmd == "time") {
rpn_pushf(time);
} else if(rpncmd == "digest") {
_MapInfo_globopen = 0;
}
MapInfo_Cache_Invalidate();
- _MapInfo_globhandle = search_begin("maps/*.bsp", TRUE, TRUE);
+ _MapInfo_globhandle = search_begin("maps/*.bsp", true, true);
if(_MapInfo_globhandle >= 0)
{
_MapInfo_globcount = search_getsize(_MapInfo_globhandle);
return;
if(load_default)
- _MapInfo_Map_ApplyGametype(_MapInfo_GetDefault(pThisType), pWantedType, pThisType, FALSE);
+ _MapInfo_Map_ApplyGametype(_MapInfo_GetDefault(pThisType), pWantedType, pThisType, false);
if(pWantedType == MAPINFO_TYPE_ASSAULT || pWantedType == MAPINFO_TYPE_ONSLAUGHT || pWantedType == MAPINFO_TYPE_RACE || pWantedType == MAPINFO_TYPE_CTS) // these modes don't use fraglimit
{
for(e = MapInfo_Type_first; e; e = e.enemy)
if(t == e.items)
return e.team;
- return FALSE;
+ return false;
}
void _MapInfo_Map_ApplyGametypeEx(string s, int pWantedType, int pThisType)
t = strreplace("'", "-", t);
if(!strcasecmp(fn, t))
- return TRUE;
+ return true;
// we allow the visible title to have punctuation the file name does
// not, but not vice versa
t = strreplace("-", "", t);
if(!strcasecmp(fn, t))
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
// load info about a map by name into the MapInfo_Map_* globals
f = MapInfo_Type_FromString(t);
dprint("Map ", pFilename, " contains the legacy 'type' keyword which is deprecated and will be removed in the future. Please migrate the mapinfo file to 'gametype'.\n");
if(f)
- _MapInfo_Map_ApplyGametype (s, pGametypeToSet, f, TRUE);
+ _MapInfo_Map_ApplyGametype (s, pGametypeToSet, f, true);
else
dprint("Map ", pFilename, " supports unknown game type ", t, ", ignored\n");
}
{
search_end(_MapInfo_globhandle);
_MapInfo_globhandle = -1;
- _MapInfo_globopen = FALSE;
+ _MapInfo_globopen = false;
}
}
#define IS_GAMETYPE(NAME) \
(MapInfo_LoadedGametype == MAPINFO_TYPE_##NAME)
-REGISTER_GAMETYPE(_("Deathmatch"),dm,g_dm,DEATHMATCH,FALSE,"timelimit=20 pointlimit=30 leadlimit=0",_("Kill all enemies"));
+REGISTER_GAMETYPE(_("Deathmatch"),dm,g_dm,DEATHMATCH,false,"timelimit=20 pointlimit=30 leadlimit=0",_("Kill all enemies"));
#define g_dm IS_GAMETYPE(DEATHMATCH)
-REGISTER_GAMETYPE(_("Last Man Standing"),lms,g_lms,LMS,FALSE,"timelimit=20 lives=9 leadlimit=0",_("Survive and kill until the enemies have no lives left"));
+REGISTER_GAMETYPE(_("Last Man Standing"),lms,g_lms,LMS,false,"timelimit=20 lives=9 leadlimit=0",_("Survive and kill until the enemies have no lives left"));
#define g_lms IS_GAMETYPE(LMS)
-REGISTER_GAMETYPE(_("Race"),rc,g_race,RACE,FALSE,"timelimit=20 qualifying_timelimit=5 laplimit=7 teamlaplimit=15 leadlimit=0",_("Race against other players to the finish line"));
+REGISTER_GAMETYPE(_("Race"),rc,g_race,RACE,false,"timelimit=20 qualifying_timelimit=5 laplimit=7 teamlaplimit=15 leadlimit=0",_("Race against other players to the finish line"));
#define g_race IS_GAMETYPE(RACE)
-REGISTER_GAMETYPE(_("Race CTS"),cts,g_cts,CTS,FALSE,"timelimit=20 skill=-1",_("Race for fastest time"));
+REGISTER_GAMETYPE(_("Race CTS"),cts,g_cts,CTS,false,"timelimit=20 skill=-1",_("Race for fastest time"));
#define g_cts IS_GAMETYPE(CTS)
-REGISTER_GAMETYPE(_("Team Deathmatch"),tdm,g_tdm,TEAM_DEATHMATCH,TRUE,"timelimit=20 pointlimit=50 teams=2 leadlimit=0",_("Kill all enemy teammates"));
+REGISTER_GAMETYPE(_("Team Deathmatch"),tdm,g_tdm,TEAM_DEATHMATCH,true,"timelimit=20 pointlimit=50 teams=2 leadlimit=0",_("Kill all enemy teammates"));
#define g_tdm IS_GAMETYPE(TEAM_DEATHMATCH)
-REGISTER_GAMETYPE(_("Capture the Flag"),ctf,g_ctf,CTF,TRUE,"timelimit=20 caplimit=10 leadlimit=6",_("Find and bring the enemy flag to your base to capture it"));
+REGISTER_GAMETYPE(_("Capture the Flag"),ctf,g_ctf,CTF,true,"timelimit=20 caplimit=10 leadlimit=6",_("Find and bring the enemy flag to your base to capture it"));
#define g_ctf IS_GAMETYPE(CTF)
-REGISTER_GAMETYPE(_("Clan Arena"),ca,g_ca,CA,TRUE,"timelimit=20 pointlimit=10 teams=2 leadlimit=0",_("Kill all enemy teammates to win the round"));
+REGISTER_GAMETYPE(_("Clan Arena"),ca,g_ca,CA,true,"timelimit=20 pointlimit=10 teams=2 leadlimit=0",_("Kill all enemy teammates to win the round"));
#define g_ca IS_GAMETYPE(CA)
-REGISTER_GAMETYPE(_("Domination"),dom,g_domination,DOMINATION,TRUE,"timelimit=20 pointlimit=200 teams=2 leadlimit=0",_("Capture all the control points to win"));
+REGISTER_GAMETYPE(_("Domination"),dom,g_domination,DOMINATION,true,"timelimit=20 pointlimit=200 teams=2 leadlimit=0",_("Capture all the control points to win"));
#define g_domination IS_GAMETYPE(DOMINATION)
-REGISTER_GAMETYPE(_("Key Hunt"),kh,g_keyhunt,KEYHUNT,TRUE,"timelimit=20 pointlimit=1000 teams=3 leadlimit=0",_("Gather all the keys to win the round"));
+REGISTER_GAMETYPE(_("Key Hunt"),kh,g_keyhunt,KEYHUNT,true,"timelimit=20 pointlimit=1000 teams=3 leadlimit=0",_("Gather all the keys to win the round"));
#define g_keyhunt IS_GAMETYPE(KEYHUNT)
-REGISTER_GAMETYPE(_("Assault"),as,g_assault,ASSAULT,TRUE,"timelimit=20",_("Destroy obstacles to find and destroy the enemy power core before time runs out"));
+REGISTER_GAMETYPE(_("Assault"),as,g_assault,ASSAULT,true,"timelimit=20",_("Destroy obstacles to find and destroy the enemy power core before time runs out"));
#define g_assault IS_GAMETYPE(ASSAULT)
-REGISTER_GAMETYPE(_("Onslaught"),ons,g_onslaught,ONSLAUGHT,TRUE,"timelimit=20",_("Capture control points to reach and destroy the enemy generator"));
+REGISTER_GAMETYPE(_("Onslaught"),ons,g_onslaught,ONSLAUGHT,true,"timelimit=20",_("Capture control points to reach and destroy the enemy generator"));
#define g_onslaught IS_GAMETYPE(ONSLAUGHT)
-REGISTER_GAMETYPE(_("Nexball"),nb,g_nexball,NEXBALL,TRUE,"timelimit=20 pointlimit=5 leadlimit=0",_("XonSports"));
+REGISTER_GAMETYPE(_("Nexball"),nb,g_nexball,NEXBALL,true,"timelimit=20 pointlimit=5 leadlimit=0",_("XonSports"));
#define g_nexball IS_GAMETYPE(NEXBALL)
-REGISTER_GAMETYPE(_("Freeze Tag"),ft,g_freezetag,FREEZETAG,TRUE,"timelimit=20 pointlimit=10 teams=2 leadlimit=0",_("Kill enemies to freeze them, stand next to teammates to revive them"));
+REGISTER_GAMETYPE(_("Freeze Tag"),ft,g_freezetag,FREEZETAG,true,"timelimit=20 pointlimit=10 teams=2 leadlimit=0",_("Kill enemies to freeze them, stand next to teammates to revive them"));
#define g_freezetag IS_GAMETYPE(FREEZETAG)
-REGISTER_GAMETYPE(_("Keepaway"),ka,g_keepaway,KEEPAWAY,TRUE,"timelimit=20 pointlimit=30",_("Hold the ball to get points for kills"));
+REGISTER_GAMETYPE(_("Keepaway"),ka,g_keepaway,KEEPAWAY,true,"timelimit=20 pointlimit=30",_("Hold the ball to get points for kills"));
#define g_keepaway IS_GAMETYPE(KEEPAWAY)
-REGISTER_GAMETYPE(_("Invasion"),inv,g_invasion,INVASION,FALSE,"pointlimit=50 teams=0",_("Survive against waves of monsters"));
+REGISTER_GAMETYPE(_("Invasion"),inv,g_invasion,INVASION,false,"pointlimit=50 teams=0",_("Survive against waves of monsters"));
#define g_invasion IS_GAMETYPE(INVASION)
const int MAPINFO_FEATURE_WEAPONS = 1; // not defined for instagib-only maps
float friend_needshelp(entity e)
{
if(e == world)
- return FALSE;
+ return false;
if(e.health <= 0)
- return FALSE;
+ return false;
if(DIFF_TEAM(e, self) && e != self.monster_owner)
- return FALSE;
+ return false;
if(e.frozen)
- return FALSE;
+ return false;
if(!IS_PLAYER(e))
return ((e.flags & FL_MONSTER) && e.health < e.max_health);
if(e.items & IT_INVINCIBLE)
- return FALSE;
+ return false;
switch(self.skin)
{
case 3: return (e.health > 0);
}
- return FALSE;
+ return false;
}
void mage_spike_explode()
{
// Is it a better idea (shorter distance) to trace to the target itself?
if ( vlen(self.origin + olddir * self.wait) < dist)
- traceline(self.origin, self.origin + olddir * self.wait, FALSE, self);
+ traceline(self.origin, self.origin + olddir * self.wait, false, self);
else
- traceline(self.origin, eorg, FALSE, self);
+ traceline(self.origin, eorg, false, self);
// Setup adaptive tracelength
self.wait = bound((autocvar_g_monster_mage_attack_spike_smart_trace_min), vlen(self.origin - trace_endpos), self.wait = (autocvar_g_monster_mage_attack_spike_smart_trace_max));
self.mage_spike = missile;
- CSQCProjectile(missile, TRUE, PROJECTILE_MAGE_SPIKE, TRUE);
+ CSQCProjectile(missile, true, PROJECTILE_MAGE_SPIKE, true);
}
void mage_heal()
{
entity head;
- float washealed = FALSE;
+ float washealed = false;
for(head = findradius(self.origin, (autocvar_g_monster_mage_heal_range)); head; head = head.chain) if(friend_needshelp(head))
{
- washealed = TRUE;
+ washealed = true;
string fx = "";
if(IS_PLAYER(head))
{
if(random() <= 0.7)
{
mage_push();
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
case MONSTER_ATTACK_RANGED:
{
if(random() <= 0.4)
{
mage_teleport();
- return TRUE;
+ return true;
}
else
{
self.frame = mage_anim_attack;
self.attack_finished_single = time + (autocvar_g_monster_mage_attack_spike_delay);
defer(0.2, mage_attack_spike);
- return TRUE;
+ return true;
}
}
if(self.mage_spike)
- return TRUE;
+ return true;
else
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
void spawnfunc_monster_mage()
case MR_THINK:
{
entity head;
- float need_help = FALSE;
+ float need_help = false;
for(head = findradius(self.origin, (autocvar_g_monster_mage_heal_range)); head; head = head.chain)
if(head != self)
if(friend_needshelp(head))
{
- need_help = TRUE;
+ need_help = true;
break;
}
mage_shield();
monster_move((autocvar_g_monster_mage_speed_run), (autocvar_g_monster_mage_speed_walk), (autocvar_g_monster_mage_speed_stop), mage_anim_walk, mage_anim_run, mage_anim_idle);
- return TRUE;
+ return true;
}
case MR_DEATH:
{
self.frame = mage_anim_death;
- return TRUE;
+ return true;
}
case MR_SETUP:
{
self.monster_attackfunc = mage_attack;
self.frame = mage_anim_walk;
- return TRUE;
+ return true;
}
case MR_PRECACHE:
{
precache_model("models/monsters/mage.dpm");
precache_sound ("weapons/grenade_impact.wav");
precache_sound ("weapons/tagexp1.wav");
- return TRUE;
+ return true;
}
}
- return TRUE;
+ return true;
}
#endif // SVQC
{
case MR_PRECACHE:
{
- return TRUE;
+ return true;
}
}
- return TRUE;
+ return true;
}
#endif // CSQC
void shambler_swing()
{
float r = (random() < 0.5);
- monster_melee(self.enemy, (autocvar_g_monster_shambler_attack_claw_damage), ((r) ? shambler_anim_swingr : shambler_anim_swingl), self.attack_range, 0.8, DEATH_MONSTER_SHAMBLER_CLAW, TRUE);
+ monster_melee(self.enemy, (autocvar_g_monster_shambler_attack_claw_damage), ((r) ? shambler_anim_swingr : shambler_anim_swingl), self.attack_range, 0.8, DEATH_MONSTER_SHAMBLER_CLAW, true);
if(r)
{
defer(0.5, shambler_swing);
gren = spawn ();
gren.owner = gren.realowner = self;
gren.classname = "grenade";
- gren.bot_dodge = TRUE;
+ gren.bot_dodge = true;
gren.bot_dodgerating = (autocvar_g_monster_shambler_attack_lightning_damage);
gren.movetype = MOVETYPE_BOUNCE;
PROJECTILE_MAKETRIGGER(gren);
gren.health = 50;
gren.damageforcescale = 0;
gren.event_damage = shambler_lightning_damage;
- gren.damagedbycontents = TRUE;
+ gren.damagedbycontents = true;
gren.missile_flags = MIF_SPLASH | MIF_ARC;
- W_SetupProjVelocity_Explicit(gren, v_forward, v_up, (autocvar_g_monster_shambler_attack_lightning_speed), (autocvar_g_monster_shambler_attack_lightning_speed_up), 0, 0, FALSE);
+ W_SetupProjVelocity_Explicit(gren, v_forward, v_up, (autocvar_g_monster_shambler_attack_lightning_speed), (autocvar_g_monster_shambler_attack_lightning_speed_up), 0, 0, false);
gren.angles = vectoangles (gren.velocity);
gren.flags = FL_PROJECTILE;
- CSQCProjectile(gren, TRUE, PROJECTILE_SHAMBLER_LIGHTNING, TRUE);
+ CSQCProjectile(gren, true, PROJECTILE_SHAMBLER_LIGHTNING, true);
}
float shambler_attack(float attack_type)
case MONSTER_ATTACK_MELEE:
{
shambler_swing();
- return TRUE;
+ return true;
}
case MONSTER_ATTACK_RANGED:
{
defer(0.7, shambler_smash);
self.attack_finished_single = time + 1.1;
self.shambler_lastattack = time + 3;
- return TRUE;
+ return true;
}
else if(random() <= 0.1) // small chance, don't want this spammed
{
self.attack_finished_single = time + 1.1;
self.shambler_lastattack = time + 3;
defer(0.6, shambler_lightning);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
void spawnfunc_monster_shambler()
case MR_THINK:
{
monster_move((autocvar_g_monster_shambler_speed_run), (autocvar_g_monster_shambler_speed_walk), (autocvar_g_monster_shambler_speed_stop), shambler_anim_run, shambler_anim_walk, shambler_anim_stand);
- return TRUE;
+ return true;
}
case MR_DEATH:
{
self.frame = shambler_anim_death;
- return TRUE;
+ return true;
}
case MR_SETUP:
{
self.frame = shambler_anim_stand;
self.weapon = WEP_VORTEX;
- return TRUE;
+ return true;
}
case MR_PRECACHE:
{
precache_model("models/monsters/shambler.mdl");
- return TRUE;
+ return true;
}
}
- return TRUE;
+ return true;
}
#endif // SVQC
{
case MR_PRECACHE:
{
- return TRUE;
+ return true;
}
}
- return TRUE;
+ return true;
}
#endif // CSQC
proj.owner = proj.realowner = self;
proj.use = spider_web_touch;
proj.think = adaptor_think2use_hittype_splash;
- proj.bot_dodge = TRUE;
+ proj.bot_dodge = true;
proj.bot_dodgerating = 0;
proj.nextthink = time + 5;
PROJECTILE_MAKETRIGGER(proj);
//proj.glow_size = 50;
//proj.glow_color = 45;
proj.movetype = MOVETYPE_BOUNCE;
- W_SetupProjVelocity_Explicit(proj, v_forward, v_up, (autocvar_g_monster_spider_attack_web_speed), (autocvar_g_monster_spider_attack_web_speed_up), 0, 0, FALSE);
+ W_SetupProjVelocity_Explicit(proj, v_forward, v_up, (autocvar_g_monster_spider_attack_web_speed), (autocvar_g_monster_spider_attack_web_speed_up), 0, 0, false);
proj.touch = spider_web_touch;
setsize(proj, '-4 -4 -4', '4 4 4');
proj.takedamage = DAMAGE_NO;
proj.health = 500;
proj.event_damage = func_null;
proj.flags = FL_PROJECTILE;
- proj.damagedbycontents = TRUE;
+ proj.damagedbycontents = true;
proj.bouncefactor = 0.3;
proj.bouncestop = 0.05;
proj.missile_flags = MIF_SPLASH | MIF_ARC;
- CSQCProjectile(proj, TRUE, PROJECTILE_ELECTRO, TRUE);
+ CSQCProjectile(proj, true, PROJECTILE_ELECTRO, true);
}
float spider_attack(float attack_type)
{
case MONSTER_ATTACK_MELEE:
{
- return monster_melee(self.enemy, (autocvar_g_monster_spider_attack_bite_damage), ((random() > 0.5) ? spider_anim_attack : spider_anim_attack2), self.attack_range, (autocvar_g_monster_spider_attack_bite_delay), DEATH_MONSTER_SPIDER, TRUE);
+ return monster_melee(self.enemy, (autocvar_g_monster_spider_attack_bite_damage), ((random() > 0.5) ? spider_anim_attack : spider_anim_attack2), self.attack_range, (autocvar_g_monster_spider_attack_bite_delay), DEATH_MONSTER_SPIDER, true);
}
case MONSTER_ATTACK_RANGED:
{
self.attack_finished_single = time + (autocvar_g_monster_spider_attack_web_delay);
spider_shootweb();
self.spider_web_delay = time + 3;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
void spawnfunc_monster_spider()
case MR_THINK:
{
monster_move((autocvar_g_monster_spider_speed_run), (autocvar_g_monster_spider_speed_walk), (autocvar_g_monster_spider_speed_stop), spider_anim_walk, spider_anim_walk, spider_anim_idle);
- return TRUE;
+ return true;
}
case MR_DEATH:
{
self.frame = spider_anim_attack;
self.angles_x = 180;
- return TRUE;
+ return true;
}
case MR_SETUP:
{
self.monster_attackfunc = spider_attack;
self.frame = spider_anim_idle;
- return TRUE;
+ return true;
}
case MR_PRECACHE:
{
precache_model("models/monsters/spider.dpm");
precache_sound ("weapons/electro_fire2.wav");
- return TRUE;
+ return true;
}
}
- return TRUE;
+ return true;
}
#endif // SVQC
{
case MR_PRECACHE:
{
- return TRUE;
+ return true;
}
}
- return TRUE;
+ return true;
}
#endif // CSQC
missile.think = wyvern_fireball_explode;
missile.enemy = self.enemy;
missile.touch = wyvern_fireball_touch;
- CSQCProjectile(missile, TRUE, PROJECTILE_FIREMINE, TRUE);
+ CSQCProjectile(missile, true, PROJECTILE_FIREMINE, true);
}
float wyvern_attack(float attack_type)
wyvern_fireball();
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
void spawnfunc_monster_wyvern()
case MR_THINK:
{
monster_move((autocvar_g_monster_wyvern_speed_run), (autocvar_g_monster_wyvern_speed_walk), (autocvar_g_monster_wyvern_speed_stop), wyvern_anim_fly, wyvern_anim_hover, wyvern_anim_hover);
- return TRUE;
+ return true;
}
case MR_DEATH:
{
self.velocity_x = -200 + 400 * random();
self.velocity_y = -200 + 400 * random();
self.velocity_z = 100 + 100 * random();
- return TRUE;
+ return true;
}
case MR_SETUP:
{
self.monster_attackfunc = wyvern_attack;
self.frame = wyvern_anim_hover;
- return TRUE;
+ return true;
}
case MR_PRECACHE:
{
precache_model("models/monsters/wizard.mdl");
- return TRUE;
+ return true;
}
}
- return TRUE;
+ return true;
}
#endif // SVQC
{
case MR_PRECACHE:
{
- return TRUE;
+ return true;
}
}
- return TRUE;
+ return true;
}
#endif // CSQC
defer(2, zombie_blockend);
- return TRUE;
+ return true;
}
float zombie_attack(float attack_type)
if(random() < 0.3 && self.health < 75 && self.enemy.health > 10)
return zombie_block();
- return monster_melee(self.enemy, (autocvar_g_monster_zombie_attack_melee_damage), chosen_anim, self.attack_range, (autocvar_g_monster_zombie_attack_melee_delay), DEATH_MONSTER_ZOMBIE_MELEE, TRUE);
+ return monster_melee(self.enemy, (autocvar_g_monster_zombie_attack_melee_damage), chosen_anim, self.attack_range, (autocvar_g_monster_zombie_attack_melee_delay), DEATH_MONSTER_ZOMBIE_MELEE, true);
}
case MONSTER_ATTACK_RANGED:
{
}
}
- return FALSE;
+ return false;
}
void spawnfunc_monster_zombie()
case MR_THINK:
{
monster_move((autocvar_g_monster_zombie_speed_run), (autocvar_g_monster_zombie_speed_walk), (autocvar_g_monster_zombie_speed_stop), zombie_anim_runforward, zombie_anim_runforward, zombie_anim_idle);
- return TRUE;
+ return true;
}
case MR_DEATH:
{
self.armorvalue = 0;
self.m_armor_blockpercent = autocvar_g_monsters_armor_blockpercent;
self.frame = ((random() > 0.5) ? zombie_anim_deathback1 : zombie_anim_deathfront1);
- return TRUE;
+ return true;
}
case MR_SETUP:
{
self.spawnshieldtime = self.spawn_time;
self.respawntime = 0.2;
- return TRUE;
+ return true;
}
case MR_PRECACHE:
{
precache_model("models/monsters/zombie.dpm");
- return TRUE;
+ return true;
}
}
- return TRUE;
+ return true;
}
#endif // SVQC
{
case MR_PRECACHE:
{
- return TRUE;
+ return true;
}
}
- return TRUE;
+ return true;
}
#endif // CSQC
mon = get_monsterinfo(i);
if(mon.netname == monster)
{
- found = TRUE;
+ found = true;
monster_id = mon.monsterid; // we have the monster, old monster id is no longer required
break;
}
if(e && e.monster_loot)
{
self = e;
- e.noalign = TRUE;
+ e.noalign = true;
e.monster_loot();
e.gravity = 1;
e.movetype = MOVETYPE_TOSS;
float monster_isvalidtarget (entity targ, entity ent)
{
if(!targ || !ent)
- return FALSE; // someone doesn't exist
+ return false; // someone doesn't exist
if(targ == ent)
- return FALSE; // don't attack ourselves
+ return false; // don't attack ourselves
//traceline(ent.origin, targ.origin, MOVE_NORMAL, ent);
//if(trace_ent != targ)
- //return FALSE;
+ //return false;
if(targ.vehicle_flags & VHF_ISVEHICLE)
if(!((get_monsterinfo(ent.monsterid)).spawnflags & MON_FLAG_RANGED))
- return FALSE; // melee attacks are useless against vehicles
+ return false; // melee attacks are useless against vehicles
if(time < game_starttime)
- return FALSE; // monsters do nothing before the match has started
+ return false; // monsters do nothing before the match has started
if(targ.takedamage == DAMAGE_NO)
- return FALSE; // enemy can't be damaged
+ return false; // enemy can't be damaged
if(targ.items & IT_INVISIBILITY)
- return FALSE; // enemy is invisible
+ return false; // enemy is invisible
if(substring(targ.classname, 0, 10) == "onslaught_")
- return FALSE; // don't attack onslaught targets
+ return false; // don't attack onslaught targets
if(IS_SPEC(targ) || IS_OBSERVER(targ))
- return FALSE; // enemy is a spectator
+ return false; // enemy is a spectator
if(!(targ.vehicle_flags & VHF_ISVEHICLE))
if(targ.deadflag != DEAD_NO || ent.deadflag != DEAD_NO || targ.health <= 0 || ent.health <= 0)
- return FALSE; // enemy/self is dead
+ return false; // enemy/self is dead
if(ent.monster_owner == targ)
- return FALSE; // don't attack our master
+ return false; // don't attack our master
if(targ.monster_owner == ent)
- return FALSE; // don't attack our pet
+ return false; // don't attack our pet
if(!(targ.vehicle_flags & VHF_ISVEHICLE))
if(targ.flags & FL_NOTARGET)
- return FALSE; // enemy can't be targeted
+ return false; // enemy can't be targeted
if(!autocvar_g_monsters_typefrag)
if(targ.BUTTON_CHAT)
- return FALSE; // no typefragging!
+ return false; // no typefragging!
if(SAME_TEAM(targ, ent))
- return FALSE; // enemy is on our team
+ return false; // enemy is on our team
if (targ.frozen)
- return FALSE; // ignore frozen
+ return false; // ignore frozen
if(autocvar_g_monsters_target_infront || (ent.spawnflags & MONSTERFLAG_INFRONT))
if(ent.enemy != targ)
dot = normalize (targ.origin - ent.origin) * v_forward;
if(dot <= 0.3)
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
entity FindTarget (entity ent)
entity head, closest_target = world;
head = findradius(ent.origin, ent.target_range);
- //head = WarpZone_FindRadius(ent.origin, ent.target_range, TRUE);
+ //head = WarpZone_FindRadius(ent.origin, ent.target_range, true);
while(head) // find the closest acceptable target to pass to
{
float globhandle, n, i;
string f;
- globhandle = search_begin(strcat(m, "_*.sounds"), TRUE, FALSE);
+ globhandle = search_begin(strcat(m, "_*.sounds"), true, false);
if (globhandle < 0)
return;
n = search_getsize(globhandle);
float monster_melee(entity targ, float damg, float anim, float er, float anim_finished, float deathtype, float dostop)
{
if (self.health <= 0)
- return FALSE; // attacking while dead?!
+ return false; // attacking while dead?!
if(dostop)
{
if(trace_ent.takedamage)
Damage(trace_ent, self, self, damg * Monster_SkillModifier(), deathtype, trace_ent.origin, normalize(trace_ent.origin - self.origin));
- return TRUE;
+ return true;
}
void Monster_CheckMinibossFlag ()
other = ent;
if(ent.deadflag == DEAD_DEAD) // don't call when monster isn't dead
if(MUTATOR_CALLHOOK(MonsterRespawn))
- return TRUE; // enabled by a mutator
+ return true; // enabled by a mutator
if(ent.spawnflags & MONSTERFLAG_NORESPAWN)
- return FALSE;
+ return false;
if(!autocvar_g_monsters_respawn)
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
float monster_initialize(float mon_id);
float Monster_CanJump (vector vel)
{
if(self.state)
- return FALSE; // already attacking
+ return false; // already attacking
if(!(self.flags & FL_ONGROUND))
- return FALSE; // not on the ground
+ return false; // not on the ground
if(self.health <= 0)
- return FALSE; // called when dead?
+ return false; // called when dead?
if(time < self.attack_finished_single)
- return FALSE; // still attacking
+ return false; // still attacking
vector old = self.velocity;
tracetoss(self, self);
self.velocity = old;
if (trace_ent != self.enemy)
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
float monster_leap (float anm, void() touchfunc, vector vel, float anim_finished)
{
if(!Monster_CanJump(vel))
- return FALSE;
+ return false;
self.frame = anm;
self.state = MONSTER_STATE_ATTACK_LEAP;
self.attack_finished_single = time + anim_finished;
- return TRUE;
+ return true;
}
void monster_checkattack(entity e, entity targ)
if(vlen(targ.origin - e.origin) <= e.attack_range)
if(e.monster_attackfunc(MONSTER_ATTACK_MELEE))
{
- MonsterSound(monstersound_melee, 0, FALSE, CH_VOICE);
+ MonsterSound(monstersound_melee, 0, false, CH_VOICE);
return;
}
if(vlen(targ.origin - e.origin) > e.attack_range)
if(e.monster_attackfunc(MONSTER_ATTACK_RANGED))
{
- MonsterSound(monstersound_ranged, 0, FALSE, CH_VOICE);
+ MonsterSound(monstersound_ranged, 0, false, CH_VOICE);
return;
}
}
{
if(time >= self.last_trace)
{
- self.fish_wasdrowning = TRUE;
+ self.fish_wasdrowning = true;
self.last_trace = time + 0.4;
Damage (self, world, world, 2, DEATH_DROWN, self.origin, '0 0 0');
}
else if(self.fish_wasdrowning)
{
- self.fish_wasdrowning = FALSE;
+ self.fish_wasdrowning = false;
self.angles_x = 0;
self.movetype = MOVETYPE_WALK;
}
self.moveto = WarpZone_RefSys_TransformOrigin(self.enemy, self, (0.5 * (self.enemy.absmin + self.enemy.absmax)));
self.pass_distance = vlen((('1 0 0' * self.enemy.origin.x) + ('0 1 0' * self.enemy.origin.y)) - (('1 0 0' * self.origin.x) + ('0 1 0' * self.origin.y)));
- MonsterSound(monstersound_sight, 0, FALSE, CH_VOICE);
+ MonsterSound(monstersound_sight, 0, false, CH_VOICE);
}
}
self.moveto = monster_pickmovetarget(targ);
if(!self.enemy)
- MonsterSound(monstersound_idle, 7, TRUE, CH_VOICE);
+ MonsterSound(monstersound_idle, 7, true, CH_VOICE);
if(self.state == MONSTER_STATE_ATTACK_LEAP && (self.flags & FL_ONGROUND))
{
if(vlen(self.origin - self.moveto) > 64)
{
if((self.flags & FL_ONGROUND) || ((self.flags & FL_FLY) || (self.flags & FL_SWIM)))
- monster_CalculateVelocity(self, self.moveto, self.origin, TRUE, ((self.enemy) ? runspeed : walkspeed));
+ monster_CalculateVelocity(self, self.moveto, self.origin, true, ((self.enemy) ? runspeed : walkspeed));
/*&if(self.flags & FL_FLY || self.flags & FL_SWIM)
movelib_move_simple(v_forward, ((self.enemy) ? runspeed : walkspeed), 0.6);
float Monster_CheckAppearFlags(entity ent, float monster_id)
{
if(!(ent.spawnflags & MONSTERFLAG_APPEAR))
- return FALSE;
+ return false;
ent.think = func_null;
ent.monsterid = monster_id; // set so this monster is properly registered (otherwise, normal initialization is used)
ent.use = Monster_Appear;
ent.flags = FL_MONSTER; // set so this monster can get butchered
- return TRUE;
+ return true;
}
void monsters_reset()
monster_dropitem();
- MonsterSound(monstersound_death, 0, FALSE, CH_VOICE);
+ MonsterSound(monstersound_death, 0, false, CH_VOICE);
if(!(self.spawnflags & MONSTERFLAG_SPAWNED) && !(self.spawnflags & MONSTERFLAG_RESPAWNED))
monsters_killed += 1;
if(self.health <= 0)
{
if(deathtype == DEATH_KILL)
- self.candrop = FALSE; // killed by mobkill command
+ self.candrop = false; // killed by mobkill command
// TODO: fix this?
activator = attacker;
if(!teamplay) { return; }
ent.team = newteam;
- ent.monster_attack = TRUE; // new team, activate attacking
+ ent.monster_attack = true; // new team, activate attacking
monster_setupcolors(ent);
if(ent.sprite)
UpdateMonsterSounds();
if(teamplay)
- self.monster_attack = TRUE; // we can have monster enemies in team games
+ self.monster_attack = true; // we can have monster enemies in team games
- MonsterSound(monstersound_spawn, 0, FALSE, CH_VOICE);
+ MonsterSound(monstersound_spawn, 0, false, CH_VOICE);
- WaypointSprite_Spawn(M_NAME(self.monsterid), 0, 1024, self, '0 0 1' * (self.maxs.z + 15), world, self.team, self, sprite, TRUE, RADARICON_DANGER, ((self.team) ? Team_ColorRGB(self.team) : '1 0 0'));
+ WaypointSprite_Spawn(M_NAME(self.monsterid), 0, 1024, self, '0 0 1' * (self.maxs.z + 15), world, self.team, self, sprite, true, RADARICON_DANGER, ((self.team) ? Team_ColorRGB(self.team) : '1 0 0'));
if(!(self.spawnflags & MONSTERFLAG_INVINCIBLE))
{
WaypointSprite_UpdateMaxHealth(self.sprite, self.max_health);
self.nextthink = time + self.ticrate;
if(MUTATOR_CALLHOOK(MonsterSpawn))
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
float monster_initialize(float mon_id)
{
- if(!autocvar_g_monsters) { return FALSE; }
+ if(!autocvar_g_monsters) { return false; }
if(!(self.spawnflags & MONSTERFLAG_RESPAWNED)) { MON_ACTION(mon_id, MR_PRECACHE); }
- if(Monster_CheckAppearFlags(self, mon_id)) { return TRUE; } // return true so the monster isn't removed
+ if(Monster_CheckAppearFlags(self, mon_id)) { return true; } // return true so the monster isn't removed
entity mon = get_monsterinfo(mon_id);
self.monster_skill = cvar("g_monsters_skill");
// support for quake style removing monsters based on skill
- if(self.monster_skill == MONSTER_SKILL_EASY) if(self.spawnflags & MONSTERSKILL_NOTEASY) { return FALSE; }
- if(self.monster_skill == MONSTER_SKILL_MEDIUM) if(self.spawnflags & MONSTERSKILL_NOTMEDIUM) { return FALSE; }
- if(self.monster_skill == MONSTER_SKILL_HARD) if(self.spawnflags & MONSTERSKILL_NOTHARD) { return FALSE; }
+ if(self.monster_skill == MONSTER_SKILL_EASY) if(self.spawnflags & MONSTERSKILL_NOTEASY) { return false; }
+ if(self.monster_skill == MONSTER_SKILL_MEDIUM) if(self.spawnflags & MONSTERSKILL_NOTMEDIUM) { return false; }
+ if(self.monster_skill == MONSTER_SKILL_HARD) if(self.spawnflags & MONSTERSKILL_NOTHARD) { return false; }
if(self.team && !teamplay)
self.team = 0;
//setsize(self, mon.mins, mon.maxs);
self.flags = FL_MONSTER;
self.takedamage = DAMAGE_AIM;
- self.bot_attack = TRUE;
- self.iscreature = TRUE;
- self.teleportable = TRUE;
- self.damagedbycontents = TRUE;
+ self.bot_attack = true;
+ self.iscreature = true;
+ self.teleportable = true;
+ self.damagedbycontents = true;
self.monsterid = mon_id;
self.damageforcescale = 0;
self.event_damage = monsters_damage;
self.reset = monsters_reset;
self.netname = mon.netname;
self.monster_name = M_NAME(mon_id);
- self.candrop = TRUE;
+ self.candrop = true;
self.view_ofs = '0 0 1' * (self.maxs.z * 0.5);
self.oldtarget2 = self.target2;
self.pass_distance = 0;
}
if(!monster_spawn())
- return FALSE;
+ return false;
if(!(self.spawnflags & MONSTERFLAG_RESPAWNED))
monster_setupcolors(self);
CSQCMODEL_AUTOINIT();
- return TRUE;
+ return true;
}
WriteByte(MSG_ENTITY, (self.ltime - time)*10.0+0.5);
}
- return TRUE;
+ return true;
}
#endif // SVQC
{
float i;
for(i = argc - 1; i >= 0; --i)
- sv_notice_to(self.owner, argv(i), autocvar_sv_join_notices_time, FALSE);
+ sv_notice_to(self.owner, argv(i), autocvar_sv_join_notices_time, false);
}
remove(self);
}
{
entity _notes;
string _notice;
- float m = FALSE;
+ float m = false;
_notes = findchain(classname, "sv_notice");
if(!_notes)
- return FALSE;
+ return false;
#define M1 30
#define M2 10
OUT(_notice, 16);
if(_notes.skin)
- m = TRUE;
+ m = true;
if(_notes.alpha <= time)
{
&&
(to_client.enemy == other_client)
)
- ) { return TRUE; }
+ ) { return true; }
break;
}
case NOTIF_ONE_ONLY: // send ONLY to one client
{
- if(to_client == other_client) { return TRUE; }
+ if(to_client == other_client) { return true; }
break;
}
case NOTIF_TEAM: // send only to X team and their spectators
&&
(to_client.enemy.team == other_client.team)
)
- ) { return TRUE; }
+ ) { return true; }
break;
}
case NOTIF_TEAM_EXCEPT: // send only to X team and their spectators, except for Y person and their spectators
)
)
)
- ) { return TRUE; }
+ ) { return true; }
break;
}
case NOTIF_ALL: // send to everyone
{
- return TRUE;
+ return true;
}
case NOTIF_ALL_EXCEPT: // send to everyone except X person and their spectators
{
&&
(to_client.enemy == other_client)
)
- ) { return TRUE; }
+ ) { return true; }
break;
}
}
- return FALSE;
+ return false;
}
#endif
notifname,
stringtype
);
- notif_error = TRUE;
+ notif_error = true;
input = substring(input, 1, (strlen(input) - 1));
}
notifname,
NOTIF_MAX_ARGS
);
- notif_error = TRUE;
+ notif_error = true;
break;
}
notifname,
selected
);
- notif_error = TRUE;
+ notif_error = true;
break;
}
}
notifname,
NOTIF_MAX_HUDARGS
);
- notif_error = TRUE;
+ notif_error = true;
break;
}
notifname,
selected
);
- notif_error = TRUE;
+ notif_error = true;
break;
}
}
notifname,
NOTIF_MAX_DURCNT
);
- notif_error = TRUE;
+ notif_error = true;
break;
}
notifname,
selected
);
- notif_error = TRUE;
+ notif_error = true;
}
break;
}
string typestring = Get_Notif_TypeName(typeId);
// Other pre-notif-setup requisites
- notif_error = FALSE;
+ notif_error = false;
// ====================
// Notification Setup
typestring,
namestring
);
- notif_error = TRUE;
+ notif_error = true;
}
}
- else { notif.nent_enabled = FALSE; }
+ else { notif.nent_enabled = false; }
#else
- notif.nent_enabled = FALSE;
+ notif.nent_enabled = false;
#endif
break;
#ifdef SVQC
float should_process_args = server_is_dedicated;
#else
- float should_process_args = TRUE;
+ float should_process_args = true;
#endif
if(should_process_args)
strnum,
flnum
);
- notif_error = TRUE;
+ notif_error = true;
}
}
else if(args != "")
typestring,
namestring
);
- notif_error = TRUE;
+ notif_error = true;
}
}
else if(icon != "")
typestring,
namestring
);
- notif_error = TRUE;
+ notif_error = true;
}
if(durcnt != "")
typestring,
namestring
);
- notif_error = TRUE;
+ notif_error = true;
}
}
else if(cpid != NO_MSG) { notif.nent_cpid = cpid; }
typestring,
namestring
);
- notif_error = TRUE;
+ notif_error = true;
}
}
typestring,
namestring
);
- notif_error = TRUE;
+ notif_error = true;
}
else
{
typestring,
namestring
);
- notif_error = TRUE;
+ notif_error = true;
}
else
{
typeId,
namestring
);
- notif_error = TRUE;
+ notif_error = true;
break;
}
}
typeId,
namestring
);
- notif_error = TRUE;
+ notif_error = true;
break;
}
}
// now check to see if any errors happened
if(notif_error)
{
- notif.nent_enabled = FALSE; // disable the notification so it can't cause trouble
- notif_global_error = TRUE; // throw the red flag that an error happened on init
+ notif.nent_enabled = false; // disable the notification so it can't cause trouble
+ notif_global_error = true; // throw the red flag that an error happened on init
}
}
WriteShort(MSG_ENTITY, self.nent_net_name);
for(i = 0; i < self.nent_stringcount; ++i) { WriteString(MSG_ENTITY, self.nent_strings[i]); }
for(i = 0; i < self.nent_floatcount; ++i) { WriteLong(MSG_ENTITY, self.nent_floats[i]); }
- return TRUE;
+ return true;
}
- else { return FALSE; }
+ else { return false; }
}
void Kill_Notification(
net_notif.nent_client = client;
net_notif.nent_net_type = MSG_CENTER_CPID;
net_notif.nent_net_name = killed_cpid;
- Net_LinkEntity(net_notif, FALSE, autocvar_notification_lifetime_runtime, Net_Write_Notification);
+ Net_LinkEntity(net_notif, false, autocvar_notification_lifetime_runtime, Net_Write_Notification);
}
for(notif = world; (notif = find(notif, classname, "net_notification"));)
autocvar_notification_lifetime_mapload
);
- Net_LinkEntity(net_notif, FALSE, 0, Net_Write_Notification);
+ Net_LinkEntity(net_notif, false, 0, Net_Write_Notification);
}
}
#define NOTIF_ADD_AUTOCVAR(name,default) var float autocvar_notification_##name = default;
-var float autocvar_notification_show_location = FALSE;
+var float autocvar_notification_show_location = false;
var string autocvar_notification_show_location_string = ""; //_(" at the %s");
-var float autocvar_notification_show_sprees = TRUE;
+var float autocvar_notification_show_sprees = true;
var float autocvar_notification_show_sprees_info = 3; // 0 = off, 1 = target only, 2 = attacker only, 3 = target and attacker
-var float autocvar_notification_show_sprees_info_newline = TRUE;
-var float autocvar_notification_show_sprees_info_specialonly = TRUE;
-var float autocvar_notification_errors_are_fatal = TRUE;
+var float autocvar_notification_show_sprees_info_newline = true;
+var float autocvar_notification_show_sprees_info_specialonly = true;
+var float autocvar_notification_errors_are_fatal = true;
var float autocvar_notification_lifetime_runtime = 0.5;
var float autocvar_notification_lifetime_mapload = 10;
-var float autocvar_notification_debug = FALSE;
+var float autocvar_notification_debug = false;
#ifdef SVQC
.float FRAG_VERBOSE;
// DISABLED IN CODE, BUT ENABLED IN CONFIG FOR COMPATIBILITY WITH OLD CLIENTS
var float autocvar_notification_allow_chatboxprint = 0;
-var float autocvar_notification_show_sprees_center = TRUE;
-var float autocvar_notification_show_sprees_center_specialonly = TRUE;
+var float autocvar_notification_show_sprees_center = true;
+var float autocvar_notification_show_sprees_center_specialonly = true;
#endif
ARG_CASE(ARG_CS_SV, "race_diff", ((f2 > f3) ? sprintf(CCR("^1[+%s]"), mmssss(f2 - f3)) : sprintf(CCR("^2[-%s]"), mmssss(f3 - f2)))) \
ARG_CASE(ARG_CS, "missing_teams", notif_arg_missing_teams(f1)) \
ARG_CASE(ARG_CS, "pass_key", ((((tmp_s = getcommandkey("pass", "+use")) != "pass") && !(strstrofs(tmp_s, "not bound", 0) >= 0)) ? sprintf(CCR(_(" ^F1(Press %s)")), tmp_s) : "")) \
- ARG_CASE(ARG_CS, "frag_ping", notif_arg_frag_ping(TRUE, f2)) \
+ ARG_CASE(ARG_CS, "frag_ping", notif_arg_frag_ping(true, f2)) \
ARG_CASE(ARG_CS, "frag_stats", notif_arg_frag_stats(f2, f3, f4)) \
/*ARG_CASE(ARG_CS, "frag_pos", ((Should_Print_Score_Pos(f1)) ? sprintf("\n^BG%s", Read_Score_Pos(f1)) : ""))*/ \
ARG_CASE(ARG_CS, "spree_cen", (autocvar_notification_show_sprees ? notif_arg_spree_cen(f1) : "")) \
string notif_arg_frag_stats(float fhealth, float farmor, float fping)
{
if (!(fhealth < 1))
- return sprintf(CCR(_("\n(Health ^1%d^BG / Armor ^2%d^BG)%s")), fhealth, farmor, notif_arg_frag_ping(FALSE, fping));
+ return sprintf(CCR(_("\n(Health ^1%d^BG / Armor ^2%d^BG)%s")), fhealth, farmor, notif_arg_frag_ping(false, fping));
else
- return sprintf(CCR(_("\n(^F4Dead^BG)%s")), notif_arg_frag_ping(FALSE, fping));
+ return sprintf(CCR(_("\n(^F4Dead^BG)%s")), notif_arg_frag_ping(false, fping));
}
string notif_arg_missing_teams(float f1)
void RegisterNotifications_First()
{
- notif_global_error = FALSE;
+ notif_global_error = false;
#ifdef SVQC
#define dedi (server_is_dedicated ? "a dedicated " : "")
#else
if(autocvar_notification_version_mismatch_server_error)
#endif
- notif_global_error = TRUE;
+ notif_global_error = true;
printf("^1NOTIFICATION VERSION MISMATCH: ^7program = %s, config = %d, code = %d.\n",
PROGNAME, autocvar_notification_version, NOTIF_VERSION);
if(autocvar_g_playerstats_gamereport_uri != "")
{
- PlayerStats_GameReport_DelayMapVote = TRUE;
+ PlayerStats_GameReport_DelayMapVote = true;
url_multi_fopen(
autocvar_g_playerstats_gamereport_uri,
FILE_APPEND,
}
else
{
- PlayerStats_GameReport_DelayMapVote = FALSE;
+ PlayerStats_GameReport_DelayMapVote = false;
db_close(PS_GR_OUT_DB);
PS_GR_OUT_DB = -1;
}
if(PS_GR_OUT_DB >= 0)
{
- PlayerStats_GameReport_DelayMapVote = TRUE;
+ PlayerStats_GameReport_DelayMapVote = true;
serverflags |= SERVERFLAG_PLAYERSTATS;
PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD);
PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM);
}
- else { PlayerStats_GameReport_DelayMapVote = FALSE; }
+ else { PlayerStats_GameReport_DelayMapVote = false; }
}
void PlayerStats_GameReport_Handler(entity fh, entity pass, float status)
{
// url_fclose has finished
dprint("Player stats written\n");
- PlayerStats_GameReport_DelayMapVote = FALSE;
+ PlayerStats_GameReport_DelayMapVote = false;
if(PS_GR_OUT_DB >= 0)
{
db_close(PS_GR_OUT_DB);
default:
{
print("Player stats writing failed: ", ftos(status), "\n");
- PlayerStats_GameReport_DelayMapVote = FALSE;
+ PlayerStats_GameReport_DelayMapVote = false;
if(PS_GR_OUT_DB >= 0)
{
db_close(PS_GR_OUT_DB);
void TEST_OK()
{
- TEST_ok = TRUE;
+ TEST_ok = true;
}
float TEST_RunAll()
// Boolean Constants
const bool true = 1;
const bool false = 0;
-const bool TRUE = 1;
-const bool FALSE = 0;
#endif
float fh;
fh = fopen(f, FILE_READ);
if (fh < 0)
- return FALSE;
+ return false;
fclose(fh);
- return TRUE;
+ return true;
}
// Databases (hash tables)
string db_get(float db, string pKey)
{
float h;
- h = crc16(FALSE, pKey) % DB_BUCKETS;
+ h = crc16(false, pKey) % DB_BUCKETS;
return uri_unescape(infoget(bufstr_get(db, h), pKey));
}
void db_put(float db, string pKey, string pValue)
{
float h;
- h = crc16(FALSE, pKey) % DB_BUCKETS;
+ h = crc16(false, pKey) % DB_BUCKETS;
bufstr_set(db, h, infoadd(bufstr_get(db, h), pKey, uri_escape(pValue)));
}
#ifndef MENUQC
float CheckWireframeBox(entity forent, vector v0, vector dvx, vector dvy, vector dvz)
{
- traceline(v0, v0 + dvx, TRUE, forent); if(trace_fraction < 1) return 0;
- traceline(v0, v0 + dvy, TRUE, forent); if(trace_fraction < 1) return 0;
- traceline(v0, v0 + dvz, TRUE, forent); if(trace_fraction < 1) return 0;
- traceline(v0 + dvx, v0 + dvx + dvy, TRUE, forent); if(trace_fraction < 1) return 0;
- traceline(v0 + dvx, v0 + dvx + dvz, TRUE, forent); if(trace_fraction < 1) return 0;
- traceline(v0 + dvy, v0 + dvy + dvx, TRUE, forent); if(trace_fraction < 1) return 0;
- traceline(v0 + dvy, v0 + dvy + dvz, TRUE, forent); if(trace_fraction < 1) return 0;
- traceline(v0 + dvz, v0 + dvz + dvx, TRUE, forent); if(trace_fraction < 1) return 0;
- traceline(v0 + dvz, v0 + dvz + dvy, TRUE, forent); if(trace_fraction < 1) return 0;
- traceline(v0 + dvx + dvy, v0 + dvx + dvy + dvz, TRUE, forent); if(trace_fraction < 1) return 0;
- traceline(v0 + dvx + dvz, v0 + dvx + dvy + dvz, TRUE, forent); if(trace_fraction < 1) return 0;
- traceline(v0 + dvy + dvz, v0 + dvx + dvy + dvz, TRUE, forent); if(trace_fraction < 1) return 0;
+ traceline(v0, v0 + dvx, true, forent); if(trace_fraction < 1) return 0;
+ traceline(v0, v0 + dvy, true, forent); if(trace_fraction < 1) return 0;
+ traceline(v0, v0 + dvz, true, forent); if(trace_fraction < 1) return 0;
+ traceline(v0 + dvx, v0 + dvx + dvy, true, forent); if(trace_fraction < 1) return 0;
+ traceline(v0 + dvx, v0 + dvx + dvz, true, forent); if(trace_fraction < 1) return 0;
+ traceline(v0 + dvy, v0 + dvy + dvx, true, forent); if(trace_fraction < 1) return 0;
+ traceline(v0 + dvy, v0 + dvy + dvz, true, forent); if(trace_fraction < 1) return 0;
+ traceline(v0 + dvz, v0 + dvz + dvx, true, forent); if(trace_fraction < 1) return 0;
+ traceline(v0 + dvz, v0 + dvz + dvy, true, forent); if(trace_fraction < 1) return 0;
+ traceline(v0 + dvx + dvy, v0 + dvx + dvy + dvz, true, forent); if(trace_fraction < 1) return 0;
+ traceline(v0 + dvx + dvz, v0 + dvx + dvy + dvz, true, forent); if(trace_fraction < 1) return 0;
+ traceline(v0 + dvy + dvz, v0 + dvx + dvy + dvz, true, forent); if(trace_fraction < 1) return 0;
return 1;
}
#endif
float eps;
eps = (max(a, -a) + max(b, -b)) * 0.001;
if(a - b < eps && b - a < eps)
- return TRUE;
- return FALSE;
+ return true;
+ return false;
}
float almost_in_bounds(float a, float b, float c)
case "yes":
case "true":
case "on":
- return TRUE;
+ return true;
case "no":
case "false":
case "off":
- return FALSE;
+ return false;
default: return stof(input);
}
float cubic_speedfunc_is_sane(float startspeedfactor, float endspeedfactor)
{
if(startspeedfactor < 0 || endspeedfactor < 0)
- return FALSE;
+ return false;
/*
// if this is the case, the possible zeros of the first derivative are outside
// 0..1
We can calculate this condition as condition
if(se <= 3)
- return TRUE;
+ return true;
*/
// better, see below:
if(startspeedfactor <= 3 && endspeedfactor <= 3)
- return TRUE;
+ return true;
// if this is the case, the first derivative has no zeros at all
float se = startspeedfactor + endspeedfactor;
float s_e = startspeedfactor - endspeedfactor;
if(3 * (se - 4) * (se - 4) + s_e * s_e <= 12) // an ellipse
- return TRUE;
+ return true;
// Now let s <= 3, s <= 3, s+e >= 3 (triangle) then we get se <= 6 (top right corner).
// we also get s_e <= 6 - se
// is quadratic, has value 12 at 3 and 6, and value < 12 in between.
// Therefore, above "better" check works!
- return FALSE;
+ return false;
// known good cases:
// (0, [0..3])
WriteByte(MSG_ENTITY, self.beam_type);
}
- return TRUE;
+ return true;
}
void Reset_ArcBeam(entity player, vector forward)
if( self.owner.BUTTON_ATCK2 || self.beam_bursting)
{
if(!self.beam_bursting)
- self.beam_bursting = TRUE;
+ self.beam_bursting = true;
burst = ARC_BT_BURSTMASK;
}
W_SetupShot_Range(
self.owner,
- TRUE,
+ true,
0,
"",
0,
if(!self.beam_initialized)
{
self.beam_dir = w_shotdir;
- self.beam_initialized = TRUE;
+ self.beam_initialized = true;
}
// WEAPONTODO: Detect player velocity so that the beam curves when moving too
beam.think = W_Arc_Beam_Think;
beam.owner = self;
beam.movetype = MOVETYPE_NONE;
- beam.bot_dodge = TRUE;
+ beam.bot_dodge = true;
beam.bot_dodgerating = WEP_CVAR(arc, beam_damage);
beam.beam_bursting = burst;
- Net_LinkEntity(beam, FALSE, 0, W_Arc_Beam_Send);
+ Net_LinkEntity(beam, false, 0, W_Arc_Beam_Send);
entity oldself = self;
self = beam;
void Arc_Smoke()
{
makevectors(self.v_angle);
- W_SetupShot_Range(self,TRUE,0,"",0,0,0);
+ W_SetupShot_Range(self,true,0,"",0,0,0);
vector smoke_origin = w_shotorg + self.velocity*frametime;
if ( self.arc_overheat > time )
WEP_CVAR(arc, beam_botaimspeed),
0,
WEP_CVAR(arc, beam_botaimlifetime),
- FALSE
+ false
);
}
else
1000000,
0,
0.001,
- FALSE
+ false
);
}
- return TRUE;
+ return true;
}
case WR_THINK:
{
}
}
- return TRUE;
+ return true;
}
if(self.arc_BUTTON_ATCK_prev != 0)
}
#endif
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/arc_loop_overheat.wav");
if(!arc_shotorigin[0])
{
- arc_shotorigin[0] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC), FALSE, FALSE, 1);
- arc_shotorigin[1] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC), FALSE, FALSE, 2);
- arc_shotorigin[2] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC), FALSE, FALSE, 3);
- arc_shotorigin[3] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC), FALSE, FALSE, 4);
+ arc_shotorigin[0] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC), false, false, 1);
+ arc_shotorigin[1] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC), false, false, 2);
+ arc_shotorigin[2] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC), false, false, 3);
+ arc_shotorigin[3] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC), false, false, 4);
}
ARC_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
- return TRUE;
+ return true;
}
case WR_CHECKAMMO1:
{
case WR_CONFIG:
{
ARC_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
- return TRUE;
+ return true;
}
case WR_KILLMESSAGE:
{
weapon_dropevent_item.arc_cooldown = self.arc_cooldown;
self.arc_overheat = 0;
self.arc_cooldown = 0;
- return TRUE;
+ return true;
}
case WR_PICKUP:
{
- if ( !client_hasweapon(self, WEP_ARC, FALSE, FALSE) &&
+ if ( !client_hasweapon(self, WEP_ARC, false, false) &&
weapon_dropevent_item.arc_overheat > time )
{
self.arc_overheat = weapon_dropevent_item.arc_overheat;
self.arc_cooldown = weapon_dropevent_item.arc_cooldown;
}
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
#endif
#ifdef CSQC
{
entity e;
for (e = world; (e = findfloat(e, beam_usevieworigin, 1)); ) {
- e.beam_initialized = FALSE;
+ e.beam_initialized = false;
}
for (e = world; (e = findfloat(e, beam_usevieworigin, 2)); ) {
- e.beam_initialized = FALSE;
+ e.beam_initialized = false;
}
}
if(!self.beam_initialized)
{
self.beam_dir = wantdir;
- self.beam_initialized = TRUE;
+ self.beam_initialized = true;
}
if(self.beam_dir != wantdir)
self.beam_color = randomvec();
self.beam_alpha = 1;
self.beam_thickness = 8;
- self.beam_traileffect = FALSE;
- self.beam_hiteffect = FALSE;
+ self.beam_traileffect = false;
+ self.beam_hiteffect = false;
self.beam_hitlight[0] = 0;
self.beam_hitlight[1] = 1;
self.beam_hitlight[2] = 1;
case WR_IMPACTEFFECT:
{
// todo
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/arc_loop.wav");
- return TRUE;
+ return true;
}
case WR_ZOOMRETICLE:
{
// no weapon specific image for this weapon
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
#endif
#endif
self.movetype = MOVETYPE_FLY;
self.think = SUB_Remove;
self.nextthink = time + self.blaster_lifetime;
- CSQCProjectile(self, TRUE, PROJECTILE_BLASTER, TRUE);
+ CSQCProjectile(self, true, PROJECTILE_BLASTER, true);
}
void W_Blaster_Attack(
{
vector s_forward = v_forward * cos(atk_shotangle * DEG2RAD) + v_up * sin(atk_shotangle * DEG2RAD);
- W_SetupShot_Dir(self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", CH_WEAPON_B, atk_damage);
+ W_SetupShot_Dir(self, s_forward, false, 3, "weapons/lasergun_fire.wav", CH_WEAPON_B, atk_damage);
pointparticles(particleeffectnum("laser_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
entity missile = spawn();
missile.owner = missile.realowner = self;
missile.classname = "blasterbolt";
- missile.bot_dodge = TRUE;
+ missile.bot_dodge = true;
missile.bot_dodgerating = atk_damage;
PROJECTILE_MAKETRIGGER(missile);
0,
0,
atk_spread,
- FALSE
+ false
);
missile.angles = vectoangles(missile.velocity);
if(WEP_CVAR(blaster, secondary))
{
if((random() * (WEP_CVAR_PRI(blaster, damage) + WEP_CVAR_SEC(blaster, damage))) > WEP_CVAR_PRI(blaster, damage))
- { self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(blaster, speed), 0, WEP_CVAR_SEC(blaster, lifetime), FALSE); }
+ { self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(blaster, speed), 0, WEP_CVAR_SEC(blaster, lifetime), false); }
else
- { self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(blaster, speed), 0, WEP_CVAR_PRI(blaster, lifetime), FALSE); }
+ { self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(blaster, speed), 0, WEP_CVAR_PRI(blaster, lifetime), false); }
}
else
- { self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(blaster, speed), 0, WEP_CVAR_PRI(blaster, lifetime), FALSE); }
+ { self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(blaster, speed), 0, WEP_CVAR_PRI(blaster, lifetime), false); }
- return TRUE;
+ return true;
}
case WR_THINK:
}
}
}
- return TRUE;
+ return true;
}
case WR_INIT:
precache_model("models/weapons/h_laser.iqm");
precache_sound("weapons/lasergun_fire.wav");
BLASTER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
- return TRUE;
+ return true;
}
case WR_SETUP:
{
self.ammo_field = ammo_none;
- return TRUE;
+ return true;
}
case WR_CHECKAMMO1:
case WR_CHECKAMMO2:
{
- return TRUE; // laser has infinite ammo
+ return true; // laser has infinite ammo
}
case WR_CONFIG:
{
BLASTER_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
- return TRUE;
+ return true;
}
case WR_SUICIDEMESSAGE:
return WEAPON_BLASTER_MURDER;
}
}
- return FALSE;
+ return false;
}
#endif
#ifdef CSQC
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); }
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/laserimpact.wav");
- return TRUE;
+ return true;
}
case WR_ZOOMRETICLE:
{
// no weapon specific image for this weapon
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
#endif
#endif
float W_Crylink_Touch_WouldHitFriendly(entity projectile, float rad)
{
- entity head = WarpZone_FindRadius((projectile.origin + (projectile.mins + projectile.maxs) * 0.5), rad + MAX_DAMAGEEXTRARADIUS, FALSE);
+ entity head = WarpZone_FindRadius((projectile.origin + (projectile.mins + projectile.maxs) * 0.5), rad + MAX_DAMAGEEXTRARADIUS, false);
float hit_friendly = 0;
float hit_enemy = 0;
head = head.chain;
}
- return (hit_enemy ? FALSE : hit_friendly);
+ return (hit_enemy ? false : hit_friendly);
}
// NO bounce protection, as bounces are limited!
self.projectiledeathtype |= HITTYPE_BOUNCE;
// commented out as it causes a little hitch...
//if(proj.cnt == 0)
- // CSQCProjectile(proj, TRUE, PROJECTILE_CRYLINK, TRUE);
+ // CSQCProjectile(proj, true, PROJECTILE_CRYLINK, true);
}
void W_Crylink_Fadethink(void)
if(WEP_CVAR_PRI(crylink, joinexplode))
maxdmg += WEP_CVAR_PRI(crylink, joinexplode_damage);
- W_SetupShot(self, FALSE, 2, "weapons/crylink_fire.wav", CH_WEAPON_A, maxdmg);
+ W_SetupShot(self, false, 2, "weapons/crylink_fire.wav", CH_WEAPON_A, maxdmg);
forward = v_forward;
right = v_right;
up = v_up;
proj.reset = W_Crylink_Reset;
proj.realowner = proj.owner = self;
proj.classname = "spike";
- proj.bot_dodge = TRUE;
+ proj.bot_dodge = true;
proj.bot_dodgerating = WEP_CVAR_PRI(crylink, damage);
if(shots == 1) {
proj.queuenext = proj;
s_z = v_forward.y;
}
s = s * WEP_CVAR_PRI(crylink, spread) * g_weaponspreadfactor;
- W_SetupProjVelocity_Explicit(proj, w_shotdir + right * s.y + up * s.z, v_up, WEP_CVAR_PRI(crylink, speed), 0, 0, 0, FALSE);
+ W_SetupProjVelocity_Explicit(proj, w_shotdir + right * s.y + up * s.z, v_up, WEP_CVAR_PRI(crylink, speed), 0, 0, 0, false);
proj.touch = W_Crylink_Touch;
proj.think = W_Crylink_Fadethink;
proj.flags = FL_PROJECTILE;
proj.missile_flags = MIF_SPLASH;
- CSQCProjectile(proj, TRUE, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), TRUE);
+ CSQCProjectile(proj, true, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), true);
other = proj; MUTATOR_CALLHOOK(EditProjectile);
}
if(WEP_CVAR_SEC(crylink, joinexplode))
maxdmg += WEP_CVAR_SEC(crylink, joinexplode_damage);
- W_SetupShot(self, FALSE, 2, "weapons/crylink_fire2.wav", CH_WEAPON_A, maxdmg);
+ W_SetupShot(self, false, 2, "weapons/crylink_fire2.wav", CH_WEAPON_A, maxdmg);
forward = v_forward;
right = v_right;
up = v_up;
proj.reset = W_Crylink_Reset;
proj.realowner = proj.owner = self;
proj.classname = "spike";
- proj.bot_dodge = TRUE;
+ proj.bot_dodge = true;
proj.bot_dodgerating = WEP_CVAR_SEC(crylink, damage);
if(shots == 1) {
proj.queuenext = proj;
s = (w_shotdir + (((counter + 0.5) / shots) * 2 - 1) * v_right * WEP_CVAR_SEC(crylink, spread) * g_weaponspreadfactor);
}
- W_SetupProjVelocity_Explicit(proj, s, v_up, WEP_CVAR_SEC(crylink, speed), 0, 0, 0, FALSE);
+ W_SetupProjVelocity_Explicit(proj, s, v_up, WEP_CVAR_SEC(crylink, speed), 0, 0, 0, false);
proj.touch = W_Crylink_Touch;
proj.think = W_Crylink_Fadethink;
if(counter == (shots - 1) / 2)
proj.flags = FL_PROJECTILE;
proj.missile_flags = MIF_SPLASH;
- CSQCProjectile(proj, TRUE, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), TRUE);
+ CSQCProjectile(proj, true, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), true);
other = proj; MUTATOR_CALLHOOK(EditProjectile);
}
case WR_AIM:
{
if(random() < 0.10)
- self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(crylink, speed), 0, WEP_CVAR_PRI(crylink, middle_lifetime), FALSE);
+ self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(crylink, speed), 0, WEP_CVAR_PRI(crylink, middle_lifetime), false);
else
- self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(crylink, speed), 0, WEP_CVAR_SEC(crylink, middle_lifetime), FALSE);
+ self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(crylink, speed), 0, WEP_CVAR_SEC(crylink, middle_lifetime), false);
- return TRUE;
+ return true;
}
case WR_THINK:
{
}
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/crylink_fire2.wav");
precache_sound("weapons/crylink_linkjoin.wav");
CRYLINK_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
- return TRUE;
+ return true;
}
case WR_CHECKAMMO1:
{
// don't "run out of ammo" and switch weapons while waiting for release
if(self.crylink_lastgroup && self.crylink_waitrelease)
- return TRUE;
+ return true;
ammo_amount = self.WEP_AMMO(CRYLINK) >= WEP_CVAR_PRI(crylink, ammo);
ammo_amount += self.(weapon_load[WEP_CRYLINK]) >= WEP_CVAR_PRI(crylink, ammo);
{
// don't "run out of ammo" and switch weapons while waiting for release
if(self.crylink_lastgroup && self.crylink_waitrelease)
- return TRUE;
+ return true;
ammo_amount = self.WEP_AMMO(CRYLINK) >= WEP_CVAR_SEC(crylink, ammo);
ammo_amount += self.(weapon_load[WEP_CRYLINK]) >= WEP_CVAR_SEC(crylink, ammo);
case WR_CONFIG:
{
CRYLINK_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
- return TRUE;
+ return true;
}
case WR_RELOAD:
{
W_Reload(min(WEP_CVAR_PRI(crylink, ammo), WEP_CVAR_SEC(crylink, ammo)), "weapons/reload.wav");
- return TRUE;
+ return true;
}
case WR_SUICIDEMESSAGE:
{
return WEAPON_CRYLINK_MURDER;
}
}
- return FALSE;
+ return false;
}
#endif
#ifdef CSQC
sound(self, CH_SHOTS, "weapons/crylink_impact.wav", VOL_BASE, ATTN_NORM);
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/crylink_impact2.wav");
precache_sound("weapons/crylink_impact.wav");
- return TRUE;
+ return true;
}
case WR_ZOOMRETICLE:
{
// no weapon specific image for this weapon
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
#endif
#endif
self.event_damage = func_null;
self.takedamage = DAMAGE_NO;
- float handled_as_rocketjump = FALSE;
+ float handled_as_rocketjump = false;
entity head = WarpZone_FindRadius(
self.origin,
WEP_CVAR(devastator, remote_jump_radius),
- FALSE
+ false
);
while(head)
if(distance_to_head <= WEP_CVAR(devastator, remote_jump_radius))
{
// we handled this as a rocketjump :)
- handled_as_rocketjump = TRUE;
+ handled_as_rocketjump = true;
// modify velocity
head.velocity_x *= 0.9;
W_DecreaseAmmo(WEP_CVAR(devastator, ammo));
- W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', FALSE, 5, "weapons/rocket_fire.wav", CH_WEAPON_A, WEP_CVAR(devastator, damage));
+ W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 5, "weapons/rocket_fire.wav", CH_WEAPON_A, WEP_CVAR(devastator, damage));
pointparticles(particleeffectnum("rocketlauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
missile = WarpZone_RefSys_SpawnSameRefSys(self);
missile.spawnshieldtime = -1;
missile.pushltime = time + WEP_CVAR(devastator, guidedelay);
missile.classname = "rocket";
- missile.bot_dodge = TRUE;
+ missile.bot_dodge = true;
missile.bot_dodgerating = WEP_CVAR(devastator, damage) * 2; // * 2 because it can be detonated inflight which makes it even more dangerous
missile.takedamage = DAMAGE_YES;
missile.damageforcescale = WEP_CVAR(devastator, damageforcescale);
missile.health = WEP_CVAR(devastator, health);
missile.event_damage = W_Devastator_Damage;
- missile.damagedbycontents = TRUE;
+ missile.damagedbycontents = true;
missile.movetype = MOVETYPE_FLY;
PROJECTILE_MAKETRIGGER(missile);
missile.flags = FL_PROJECTILE;
missile.missile_flags = MIF_SPLASH;
- CSQCProjectile(missile, WEP_CVAR(devastator, guiderate) == 0 && WEP_CVAR(devastator, speedaccel) == 0, PROJECTILE_ROCKET, FALSE); // because of fly sound
+ CSQCProjectile(missile, WEP_CVAR(devastator, guiderate) == 0 && WEP_CVAR(devastator, speedaccel) == 0, PROJECTILE_ROCKET, false); // because of fly sound
// muzzle flash for 1st person view
flash = spawn();
case WR_AIM:
{
// aim and decide to fire if appropriate
- self.BUTTON_ATCK = bot_aim(WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), FALSE);
+ self.BUTTON_ATCK = bot_aim(WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), false);
if(skill >= 2) // skill 0 and 1 bots won't detonate rockets!
{
// decide whether to detonate rockets
entity missile, targetlist, targ;
- targetlist = findchainfloat(bot_attack, TRUE);
+ targetlist = findchainfloat(bot_attack, true);
for(missile = world; (missile = find(missile, classname, "rocket")); ) if(missile.realowner == self)
{
targ = targetlist;
{
if(targ != missile.realowner && vlen(targ.origin - missile.origin) < WEP_CVAR(devastator, radius))
{
- self.BUTTON_ATCK2 = TRUE;
+ self.BUTTON_ATCK2 = true;
break;
}
targ = targ.chain;
}
}
- if(self.BUTTON_ATCK2) self.BUTTON_ATCK = FALSE;
+ if(self.BUTTON_ATCK2) self.BUTTON_ATCK = false;
}
- return TRUE;
+ return true;
}
#else
case WR_AIM:
{
// aim and decide to fire if appropriate
- self.BUTTON_ATCK = bot_aim(WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), FALSE);
+ self.BUTTON_ATCK = bot_aim(WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), false);
if(skill >= 2) // skill 0 and 1 bots won't detonate rockets!
{
// decide whether to detonate rockets
selfdamage = 0;
teamdamage = 0;
enemydamage = 0;
- targetlist = findchainfloat(bot_attack, TRUE);
+ targetlist = findchainfloat(bot_attack, true);
missile = find(world, classname, "rocket");
while(missile)
{
if(
(v_forward * normalize(missile.origin - targ.origin)< 0.1)
&& desirabledamage > 0.1*coredamage
- )self.BUTTON_ATCK2 = TRUE;
+ )self.BUTTON_ATCK2 = true;
targ = targ.chain;
}
}else{
if(IS_PLAYER(self.enemy))
if(desirabledamage >= 0.1*coredamage)
if(random()/distance*300 > frametime*bound(0,(10-skill)*0.2,1))
- self.BUTTON_ATCK2 = TRUE;
+ self.BUTTON_ATCK2 = true;
// dprint(ftos(random()/distance*300),">");dprint(ftos(frametime*bound(0,(10-skill)*0.2,1)),"\n");
}
// if we would be doing at X percent of the core damage, detonate it
// but don't fire a new shot at the same time!
if(desirabledamage >= 0.75 * coredamage) //this should do group damage in rare fortunate events
- self.BUTTON_ATCK2 = TRUE;
+ self.BUTTON_ATCK2 = true;
if((skill > 6.5) && (selfdamage > self.health))
- self.BUTTON_ATCK2 = FALSE;
- //if(self.BUTTON_ATCK2 == TRUE)
+ self.BUTTON_ATCK2 = false;
+ //if(self.BUTTON_ATCK2 == true)
// dprint(ftos(desirabledamage),"\n");
- if(self.BUTTON_ATCK2 == TRUE) self.BUTTON_ATCK = FALSE;
+ if(self.BUTTON_ATCK2 == true) self.BUTTON_ATCK = false;
}
- return TRUE;
+ return true;
}
#endif
case WR_THINK:
{
if(!rock.rl_detonate_later)
{
- rock.rl_detonate_later = TRUE;
+ rock.rl_detonate_later = true;
rockfound = 1;
}
}
}
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/rocket_mode.wav");
//}
DEVASTATOR_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
- return TRUE;
+ return true;
}
case WR_SETUP:
{
self.rl_release = 1;
- return TRUE;
+ return true;
}
case WR_CHECKAMMO1:
{
// don't switch while guiding a missile
if(ATTACK_FINISHED(self) <= time || self.weapon != WEP_DEVASTATOR)
{
- ammo_amount = FALSE;
+ ammo_amount = false;
if(WEP_CVAR(devastator, reload_ammo))
{
if(self.WEP_AMMO(DEVASTATOR) < WEP_CVAR(devastator, ammo) && self.(weapon_load[WEP_DEVASTATOR]) < WEP_CVAR(devastator, ammo))
- ammo_amount = TRUE;
+ ammo_amount = true;
}
else if(self.WEP_AMMO(DEVASTATOR) < WEP_CVAR(devastator, ammo))
- ammo_amount = TRUE;
+ ammo_amount = true;
return !ammo_amount;
}
#endif
if(self.rl_release == 0)
{
printf("W_Devastator(WR_CHECKAMMO1): %d, %.2f, %d: TRUE\n", self.rl_release, self.WEP_AMMO(DEVASTATOR), WEP_CVAR(devastator, ammo));
- return TRUE;
+ return true;
}
else
{
}
case WR_CHECKAMMO2:
{
- return FALSE;
+ return false;
}
case WR_CONFIG:
{
DEVASTATOR_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
- return TRUE;
+ return true;
}
case WR_RESETPLAYER:
{
self.rl_release = 0;
- return TRUE;
+ return true;
}
case WR_RELOAD:
{
W_Reload(WEP_CVAR(devastator, ammo), "weapons/reload.wav");
- return TRUE;
+ return true;
}
case WR_SUICIDEMESSAGE:
{
return WEAPON_DEVASTATOR_MURDER_DIRECT;
}
}
- return FALSE;
+ return false;
}
#endif
#ifdef CSQC
if(!w_issilent)
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/rocket_impact.wav");
- return TRUE;
+ return true;
}
case WR_ZOOMRETICLE:
{
// no weapon specific image for this weapon
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
#endif
#endif
if(WEP_CVAR_PRI(electro, midaircombo_radius))
{
float found = 0;
- entity e = WarpZone_FindRadius(self.origin, WEP_CVAR_PRI(electro, midaircombo_radius), TRUE);
+ entity e = WarpZone_FindRadius(self.origin, WEP_CVAR_PRI(electro, midaircombo_radius), true);
// loop through nearby orbs and trigger them
while(e)
self,
'0 0 -3',
'0 0 -3',
- FALSE,
+ false,
2,
"weapons/electro_fire.wav",
CH_WEAPON_A,
proj = spawn();
proj.classname = "electro_bolt";
proj.owner = proj.realowner = self;
- proj.bot_dodge = TRUE;
+ proj.bot_dodge = true;
proj.bot_dodgerating = WEP_CVAR_PRI(electro, damage);
proj.use = W_Electro_Explode;
proj.think = W_Electro_Bolt_Think;
proj.flags = FL_PROJECTILE;
proj.missile_flags = MIF_SPLASH;
- CSQCProjectile(proj, TRUE, PROJECTILE_ELECTRO_BEAM, TRUE);
+ CSQCProjectile(proj, true, PROJECTILE_ELECTRO_BEAM, true);
other = proj; MUTATOR_CALLHOOK(EditProjectile);
}
self,
'0 0 -4',
'0 0 -4',
- FALSE,
+ false,
2,
"weapons/electro_fire2.wav",
CH_WEAPON_A,
proj.owner = proj.realowner = self;
proj.use = W_Electro_Explode;
proj.think = adaptor_think2use_hittype_splash;
- proj.bot_dodge = TRUE;
+ proj.bot_dodge = true;
proj.bot_dodgerating = WEP_CVAR_SEC(electro, damage);
proj.nextthink = time + WEP_CVAR_SEC(electro, lifetime);
PROJECTILE_MAKETRIGGER(proj);
setsize(p2, proj.mins, proj.maxs);
#endif
- CSQCProjectile(proj, TRUE, PROJECTILE_ELECTRO, FALSE); // no culling, it has sound
+ CSQCProjectile(proj, true, PROJECTILE_ELECTRO, false); // no culling, it has sound
other = proj; MUTATOR_CALLHOOK(EditProjectile);
}
{
case WR_AIM:
{
- self.BUTTON_ATCK = self.BUTTON_ATCK2 = FALSE;
+ self.BUTTON_ATCK = self.BUTTON_ATCK2 = false;
if(vlen(self.origin-self.enemy.origin) > 1000) { self.bot_secondary_electromooth = 0; }
if(self.bot_secondary_electromooth == 0)
{
float shoot;
if(WEP_CVAR_PRI(electro, speed))
- shoot = bot_aim(WEP_CVAR_PRI(electro, speed), 0, WEP_CVAR_PRI(electro, lifetime), FALSE);
+ shoot = bot_aim(WEP_CVAR_PRI(electro, speed), 0, WEP_CVAR_PRI(electro, lifetime), false);
else
- shoot = bot_aim(1000000, 0, 0.001, FALSE);
+ shoot = bot_aim(1000000, 0, 0.001, false);
if(shoot)
{
- self.BUTTON_ATCK = TRUE;
+ self.BUTTON_ATCK = true;
if(random() < 0.01) self.bot_secondary_electromooth = 1;
}
}
else
{
- if(bot_aim(WEP_CVAR_SEC(electro, speed), WEP_CVAR_SEC(electro, speed_up), WEP_CVAR_SEC(electro, lifetime), TRUE))
+ if(bot_aim(WEP_CVAR_SEC(electro, speed), WEP_CVAR_SEC(electro, speed_up), WEP_CVAR_SEC(electro, lifetime), true))
{
- self.BUTTON_ATCK2 = TRUE;
+ self.BUTTON_ATCK2 = true;
if(random() < 0.03) self.bot_secondary_electromooth = 0;
}
}
- return TRUE;
+ return true;
}
case WR_THINK:
{
if(!ammo_amount)
{
WEP_ACTION(self.weapon, WR_RELOAD);
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
if(self.BUTTON_ATCK)
}
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/electro_impact.wav");
precache_sound("weapons/electro_impact_combo.wav");
ELECTRO_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
- return TRUE;
+ return true;
}
case WR_CHECKAMMO1:
{
case WR_CONFIG:
{
ELECTRO_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
- return TRUE;
+ return true;
}
case WR_RESETPLAYER:
{
self.electro_secondarytime = time;
- return TRUE;
+ return true;
}
case WR_RELOAD:
{
W_Reload(min(WEP_CVAR_PRI(electro, ammo), WEP_CVAR_SEC(electro, ammo)), "weapons/reload.wav");
- return TRUE;
+ return true;
}
case WR_SUICIDEMESSAGE:
{
}
}
}
- return FALSE;
+ return false;
}
#endif
#ifdef CSQC
}
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/electro_impact.wav");
precache_sound("weapons/electro_impact_combo.wav");
- return TRUE;
+ return true;
}
case WR_ZOOMRETICLE:
{
// no weapon specific image for this weapon
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
#endif
#endif
return;
RandomSelection_Init();
- for(e = WarpZone_FindRadius(self.origin, dist, TRUE); e; e = e.chain)
+ for(e = WarpZone_FindRadius(self.origin, dist, true); e; e = e.chain)
if(e != self.realowner) if(e.takedamage == DAMAGE_AIM) if(!IS_PLAYER(e) || !self.realowner || DIFF_TEAM(e, self))
{
p = e.origin;
{
entity proj;
- W_SetupShot_ProjectileSize(self, '-16 -16 -16', '16 16 16', FALSE, 2, "weapons/fireball_fire2.wav", CH_WEAPON_A, WEP_CVAR_PRI(fireball, damage) + WEP_CVAR_PRI(fireball, bfgdamage));
+ W_SetupShot_ProjectileSize(self, '-16 -16 -16', '16 16 16', false, 2, "weapons/fireball_fire2.wav", CH_WEAPON_A, WEP_CVAR_PRI(fireball, damage) + WEP_CVAR_PRI(fireball, bfgdamage));
pointparticles(particleeffectnum("fireball_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
proj = spawn();
proj.classname = "plasma_prim";
proj.owner = proj.realowner = self;
- proj.bot_dodge = TRUE;
+ proj.bot_dodge = true;
proj.bot_dodgerating = WEP_CVAR_PRI(fireball, damage);
proj.pushltime = time + WEP_CVAR_PRI(fireball, lifetime);
proj.use = W_Fireball_Explode;
proj.flags = FL_PROJECTILE;
proj.missile_flags = MIF_SPLASH | MIF_PROXY;
- CSQCProjectile(proj, TRUE, PROJECTILE_FIREBALL, TRUE);
+ CSQCProjectile(proj, true, PROJECTILE_FIREBALL, true);
other = proj; MUTATOR_CALLHOOK(EditProjectile);
}
void W_Fireball_AttackEffect(float i, vector f_diff)
{
- W_SetupShot_ProjectileSize(self, '-16 -16 -16', '16 16 16', FALSE, 0, "", 0, 0);
+ W_SetupShot_ProjectileSize(self, '-16 -16 -16', '16 16 16', false, 0, "", 0, 0);
w_shotorg += f_diff.x * v_up + f_diff.y * v_right;
pointparticles(particleeffectnum("fireball_preattack_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
}
f_diff = '+1.25 +3.75 0';
break;
}
- W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', FALSE, 2, "weapons/fireball_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(fireball, damage));
+ W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', false, 2, "weapons/fireball_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(fireball, damage));
traceline(w_shotorg, w_shotorg + f_diff.x * v_up + f_diff.y * v_right, MOVE_NORMAL, self);
w_shotorg = trace_endpos;
proj = spawn();
proj.owner = proj.realowner = self;
proj.classname = "grenade";
- proj.bot_dodge = TRUE;
+ proj.bot_dodge = true;
proj.bot_dodgerating = WEP_CVAR_SEC(fireball, damage);
proj.movetype = MOVETYPE_BOUNCE;
proj.projectiledeathtype = WEP_FIREBALL | HITTYPE_SECONDARY;
proj.flags = FL_PROJECTILE;
proj.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_ARC;
- CSQCProjectile(proj, TRUE, PROJECTILE_FIREMINE, TRUE);
+ CSQCProjectile(proj, true, PROJECTILE_FIREMINE, true);
other = proj; MUTATOR_CALLHOOK(EditProjectile);
}
{
case WR_AIM:
{
- self.BUTTON_ATCK = FALSE;
- self.BUTTON_ATCK2 = FALSE;
+ self.BUTTON_ATCK = false;
+ self.BUTTON_ATCK2 = false;
if(self.bot_primary_fireballmooth == 0)
{
- if(bot_aim(WEP_CVAR_PRI(fireball, speed), 0, WEP_CVAR_PRI(fireball, lifetime), FALSE))
+ if(bot_aim(WEP_CVAR_PRI(fireball, speed), 0, WEP_CVAR_PRI(fireball, lifetime), false))
{
- self.BUTTON_ATCK = TRUE;
+ self.BUTTON_ATCK = true;
if(random() < 0.02) self.bot_primary_fireballmooth = 0;
}
}
else
{
- if(bot_aim(WEP_CVAR_SEC(fireball, speed), WEP_CVAR_SEC(fireball, speed_up), WEP_CVAR_SEC(fireball, lifetime), TRUE))
+ if(bot_aim(WEP_CVAR_SEC(fireball, speed), WEP_CVAR_SEC(fireball, speed_up), WEP_CVAR_SEC(fireball, lifetime), true))
{
- self.BUTTON_ATCK2 = TRUE;
+ self.BUTTON_ATCK2 = true;
if(random() < 0.01) self.bot_primary_fireballmooth = 1;
}
}
- return TRUE;
+ return true;
}
case WR_THINK:
{
}
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/fireball_fire2.wav");
precache_sound("weapons/fireball_prefire2.wav");
FIREBALL_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
- return TRUE;
+ return true;
}
case WR_SETUP:
{
self.ammo_field = ammo_none;
- return TRUE;
+ return true;
}
case WR_CHECKAMMO1:
case WR_CHECKAMMO2:
{
- return TRUE; // fireball has infinite ammo
+ return true; // fireball has infinite ammo
}
case WR_CONFIG:
{
FIREBALL_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
- return TRUE;
+ return true;
}
case WR_RESETPLAYER:
{
self.fireball_primarytime = time;
- return TRUE;
+ return true;
}
case WR_SUICIDEMESSAGE:
{
return WEAPON_FIREBALL_MURDER_BLAST;
}
}
- return FALSE;
+ return false;
}
#endif
#ifdef CSQC
sound(self, CH_SHOTS, "weapons/fireball_impact2.wav", VOL_BASE, ATTEN_NORM * 0.25); // long range boom
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/fireball_impact2.wav");
- return TRUE;
+ return true;
}
case WR_ZOOMRETICLE:
{
// no weapon specific image for this weapon
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
#endif
#endif
if(self.health <= 0)
return;
- float is_linkexplode = ( ((inflictor.owner != world) ? (inflictor.owner == self.owner) : TRUE)
+ float is_linkexplode = ( ((inflictor.owner != world) ? (inflictor.owner == self.owner) : true)
&& (inflictor.projectiledeathtype & HITTYPE_SECONDARY)
&& (self.projectiledeathtype & HITTYPE_SECONDARY));
W_DecreaseAmmo(WEP_CVAR_PRI(hagar, ammo));
- W_SetupShot(self, FALSE, 2, "weapons/hagar_fire.wav", CH_WEAPON_A, WEP_CVAR_PRI(hagar, damage));
+ W_SetupShot(self, false, 2, "weapons/hagar_fire.wav", CH_WEAPON_A, WEP_CVAR_PRI(hagar, damage));
pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
missile = spawn();
missile.owner = missile.realowner = self;
missile.classname = "missile";
- missile.bot_dodge = TRUE;
+ missile.bot_dodge = true;
missile.bot_dodgerating = WEP_CVAR_PRI(hagar, damage);
missile.takedamage = DAMAGE_YES;
missile.health = WEP_CVAR_PRI(hagar, health);
missile.damageforcescale = WEP_CVAR_PRI(hagar, damageforcescale);
missile.event_damage = W_Hagar_Damage;
- missile.damagedbycontents = TRUE;
+ missile.damagedbycontents = true;
missile.touch = W_Hagar_Touch;
missile.use = W_Hagar_Explode;
missile.flags = FL_PROJECTILE;
missile.missile_flags = MIF_SPLASH;
- CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR, TRUE);
+ CSQCProjectile(missile, true, PROJECTILE_HAGAR, true);
other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
W_DecreaseAmmo(WEP_CVAR_SEC(hagar, ammo));
- W_SetupShot(self, FALSE, 2, "weapons/hagar_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage));
+ W_SetupShot(self, false, 2, "weapons/hagar_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage));
pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
missile = spawn();
missile.owner = missile.realowner = self;
missile.classname = "missile";
- missile.bot_dodge = TRUE;
+ missile.bot_dodge = true;
missile.bot_dodgerating = WEP_CVAR_SEC(hagar, damage);
missile.takedamage = DAMAGE_YES;
missile.health = WEP_CVAR_SEC(hagar, health);
missile.damageforcescale = WEP_CVAR_SEC(hagar, damageforcescale);
missile.event_damage = W_Hagar_Damage;
- missile.damagedbycontents = TRUE;
+ missile.damagedbycontents = true;
missile.touch = W_Hagar_Touch2;
missile.cnt = 0;
missile.flags = FL_PROJECTILE;
missile.missile_flags = MIF_SPLASH;
- CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR_BOUNCING, TRUE);
+ CSQCProjectile(missile, true, PROJECTILE_HAGAR_BOUNCING, true);
other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
weapon_prepareattack_do(1, WEP_CVAR_SEC(hagar, refire));
- W_SetupShot(self, FALSE, 2, "weapons/hagar_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage));
+ W_SetupShot(self, false, 2, "weapons/hagar_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage));
pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
forward = v_forward;
missile = spawn();
missile.owner = missile.realowner = self;
missile.classname = "missile";
- missile.bot_dodge = TRUE;
+ missile.bot_dodge = true;
missile.bot_dodgerating = WEP_CVAR_SEC(hagar, damage);
missile.takedamage = DAMAGE_YES;
missile.health = WEP_CVAR_SEC(hagar, health);
missile.damageforcescale = WEP_CVAR_SEC(hagar, damageforcescale);
missile.event_damage = W_Hagar_Damage;
- missile.damagedbycontents = TRUE;
+ missile.damagedbycontents = true;
missile.touch = W_Hagar_Touch; // not bouncy
missile.use = W_Hagar_Explode2;
}
s = s * WEP_CVAR_SEC(hagar, load_spread) * g_weaponspreadfactor;
- W_SetupProjVelocity_Explicit(missile, w_shotdir + right * s.y + up * s.z, v_up, WEP_CVAR_SEC(hagar, speed), 0, 0, spread_pershot, FALSE);
+ W_SetupProjVelocity_Explicit(missile, w_shotdir + right * s.y + up * s.z, v_up, WEP_CVAR_SEC(hagar, speed), 0, 0, spread_pershot, false);
missile.angles = vectoangles(missile.velocity);
missile.flags = FL_PROJECTILE;
- CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR, TRUE);
+ CSQCProjectile(missile, true, PROJECTILE_HAGAR, true);
other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
self.hagar_loadstep = time + WEP_CVAR_SEC(hagar, load_speed) * W_WeaponRateFactor();
// require letting go of the alt fire button before we can load again
- self.hagar_loadblock = TRUE;
+ self.hagar_loadblock = true;
}
}
else
{
// 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);
- self.hagar_loadbeep = TRUE;
+ self.hagar_loadbeep = true;
}
}
}
else if(self.hagar_loadblock)
{
// the alt fire button has been released, so re-enable loading if blocked
- self.hagar_loadblock = FALSE;
+ self.hagar_loadblock = false;
}
if(self.hagar_load)
{
// 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);
- self.hagar_warning = TRUE;
+ self.hagar_warning = true;
}
}
}
else
{
- self.hagar_loadbeep = FALSE;
- self.hagar_warning = FALSE;
+ self.hagar_loadbeep = false;
+ self.hagar_warning = false;
}
// we aren't checking ammo during an attack, so we must do it here
case WR_AIM:
{
if(random()>0.15)
- self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), FALSE);
+ self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
else // not using secondary_speed since these are only 15% and should cause some ricochets without re-aiming
- self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), FALSE);
+ self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
- return TRUE;
+ return true;
}
case WR_THINK:
{
}
}
- return TRUE;
+ return true;
}
case WR_GONETHINK:
{
W_Hagar_Attack2_Load_Release();
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/hagar_load.wav");
precache_sound("weapons/hagar_beep.wav");
HAGAR_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
- return TRUE;
+ return true;
}
case WR_SETUP:
{
- self.hagar_loadblock = FALSE;
+ self.hagar_loadblock = false;
if(self.hagar_load)
{
self.hagar_load = 0;
}
- return TRUE;
+ return true;
}
case WR_CHECKAMMO1:
{
case WR_CONFIG:
{
HAGAR_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
- return TRUE;
+ return true;
}
case WR_RESETPLAYER:
{
self.hagar_load = 0;
- return TRUE;
+ return true;
}
case WR_PLAYERDEATH:
{
if(self.hagar_load && WEP_CVAR_SEC(hagar, load_releasedeath))
W_Hagar_Attack2_Load_Release();
- return TRUE;
+ return true;
}
case WR_RELOAD:
{
if(!self.hagar_load) // require releasing loaded rockets first
W_Reload(min(WEP_CVAR_PRI(hagar, ammo), WEP_CVAR_SEC(hagar, ammo)), "weapons/reload.wav");
- return TRUE;
+ return true;
}
case WR_SUICIDEMESSAGE:
{
return WEAPON_HAGAR_MURDER_SPRAY;
}
}
- return FALSE;
+ return false;
}
#endif
#ifdef CSQC
sound(self, CH_SHOTS, "weapons/hagexp3.wav", VOL_BASE, ATTN_NORM);
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/hagexp1.wav");
precache_sound("weapons/hagexp2.wav");
precache_sound("weapons/hagexp3.wav");
- return TRUE;
+ return true;
}
case WR_ZOOMRETICLE:
{
// no weapon specific image for this weapon
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
#endif
#endif
if(self.crouch)
spread = spread * WEP_CVAR_PRI(hlac, spread_crouchmod);
- W_SetupShot(self, FALSE, 3, "weapons/lasergun_fire.wav", CH_WEAPON_A, WEP_CVAR_PRI(hlac, damage));
+ W_SetupShot(self, false, 3, "weapons/lasergun_fire.wav", CH_WEAPON_A, WEP_CVAR_PRI(hlac, damage));
pointparticles(particleeffectnum("laser_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
if(!autocvar_g_norecoil)
{
missile = spawn();
missile.owner = missile.realowner = self;
missile.classname = "hlacbolt";
- missile.bot_dodge = TRUE;
+ missile.bot_dodge = true;
missile.bot_dodgerating = WEP_CVAR_PRI(hlac, damage);
missile.flags = FL_PROJECTILE;
missile.projectiledeathtype = WEP_HLAC;
- CSQCProjectile(missile, TRUE, PROJECTILE_HLAC, TRUE);
+ CSQCProjectile(missile, true, PROJECTILE_HLAC, true);
other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
if(self.crouch)
spread = spread * WEP_CVAR_SEC(hlac, spread_crouchmod);
- W_SetupShot(self, FALSE, 3, "weapons/lasergun_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hlac, damage));
+ W_SetupShot(self, false, 3, "weapons/lasergun_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hlac, damage));
pointparticles(particleeffectnum("laser_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
missile = spawn();
missile.owner = missile.realowner = self;
missile.classname = "hlacbolt";
- missile.bot_dodge = TRUE;
+ missile.bot_dodge = true;
missile.bot_dodgerating = WEP_CVAR_SEC(hlac, damage);
missile.missile_flags = MIF_SPLASH;
missile.projectiledeathtype = WEP_HLAC | HITTYPE_SECONDARY;
- CSQCProjectile(missile, TRUE, PROJECTILE_HLAC, TRUE);
+ CSQCProjectile(missile, true, PROJECTILE_HLAC, true);
other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
{
case WR_AIM:
{
- self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(hlac, speed), 0, WEP_CVAR_PRI(hlac, lifetime), FALSE);
- return TRUE;
+ self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(hlac, speed), 0, WEP_CVAR_PRI(hlac, lifetime), false);
+ return true;
}
case WR_THINK:
{
}
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_model("models/weapons/h_hlac.iqm");
precache_sound("weapons/lasergun_fire.wav");
HLAC_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
- return TRUE;
+ return true;
}
case WR_CHECKAMMO1:
{
case WR_CONFIG:
{
HLAC_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
- return TRUE;
+ return true;
}
case WR_RELOAD:
{
W_Reload(min(WEP_CVAR_PRI(hlac, ammo), WEP_CVAR_SEC(hlac, ammo)), "weapons/reload.wav");
- return TRUE;
+ return true;
}
case WR_SUICIDEMESSAGE:
{
return WEAPON_HLAC_MURDER;
}
}
- return FALSE;
+ return false;
}
#endif
#ifdef CSQC
if(!w_issilent)
sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/laserimpact.wav");
- return TRUE;
+ return true;
}
case WR_ZOOMRETICLE:
{
// no weapon specific image for this weapon
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
#endif
#endif
W_DecreaseAmmo(WEP_CVAR(hmg, ammo));
- W_SetupShot (self, TRUE, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, WEP_CVAR(hmg, damage));
+ W_SetupShot (self, true, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, WEP_CVAR(hmg, damage));
if(!autocvar_g_norecoil)
{
case WR_AIM:
{
if(vlen(self.origin-self.enemy.origin) < 3000 - bound(0, skill, 10) * 200)
- self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE);
+ self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false);
else
- self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, FALSE);
+ self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false);
- return TRUE;
+ return true;
}
case WR_THINK:
{
}
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_model ("models/weapons/h_ok_hmg.iqm");
precache_sound ("weapons/uzi_fire.wav");
HMG_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
- return TRUE;
+ return true;
}
case WR_CHECKAMMO1:
{
case WR_CONFIG:
{
HMG_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
- return TRUE;
+ return true;
}
case WR_RELOAD:
{
W_Reload(WEP_CVAR(hmg, ammo), "weapons/reload.wav");
- return TRUE;
+ return true;
}
case WR_SUICIDEMESSAGE:
{
return WEAPON_HMG_MURDER_SPRAY;
}
}
- return FALSE;
+ return false;
}
#endif
#ifdef CSQC
else if(w_random < 0.2)
sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTEN_NORM);
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/ric1.wav");
precache_sound("weapons/ric2.wav");
precache_sound("weapons/ric3.wav");
- return TRUE;
+ return true;
}
case WR_ZOOMRETICLE:
{
// no weapon specific image for this weapon
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
#endif
#endif
{
if(g_grappling_hook) // offhand hook
{
- startitem_failed = TRUE;
+ startitem_failed = true;
remove(self);
return;
}
entity gren;
//W_DecreaseAmmo(WEP_CVAR_SEC(hook, ammo)); // WEAPONTODO: Figure out how to handle ammo with hook secondary (gravitybomb)
- W_SetupShot(self, FALSE, 4, "weapons/hookbomb_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hook, damage));
+ W_SetupShot(self, false, 4, "weapons/hookbomb_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hook, damage));
gren = spawn();
gren.owner = gren.realowner = self;
gren.classname = "hookbomb";
- gren.bot_dodge = TRUE;
+ gren.bot_dodge = true;
gren.bot_dodgerating = WEP_CVAR_SEC(hook, damage);
gren.movetype = MOVETYPE_TOSS;
PROJECTILE_MAKETRIGGER(gren);
gren.health = WEP_CVAR_SEC(hook, health);
gren.damageforcescale = WEP_CVAR_SEC(hook, damageforcescale);
gren.event_damage = W_Hook_Damage;
- gren.damagedbycontents = TRUE;
+ gren.damagedbycontents = true;
gren.missile_flags = MIF_SPLASH | MIF_ARC;
gren.velocity = '0 0 1' * WEP_CVAR_SEC(hook, speed);
gren.angles = '0 0 0';
gren.flags = FL_PROJECTILE;
- CSQCProjectile(gren, TRUE, PROJECTILE_HOOKBOMB, TRUE);
+ CSQCProjectile(gren, true, PROJECTILE_HOOKBOMB, true);
other = gren; MUTATOR_CALLHOOK(EditProjectile);
}
case WR_AIM:
{
// no bot AI for hook (yet?)
- return TRUE;
+ return true;
}
case WR_THINK:
{
}
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/hook_fire.wav");
precache_sound("weapons/hookbomb_fire.wav");
HOOK_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
- return TRUE;
+ return true;
}
case WR_SETUP:
{
self.hook_state &= ~HOOK_WAITING_FOR_RELEASE;
- return TRUE;
+ return true;
}
case WR_CHECKAMMO1:
{
case WR_CHECKAMMO2:
{
// infinite ammo for now
- return TRUE; // self.ammo_cells >= WEP_CVAR_SEC(hook, ammo); // WEAPONTODO: see above
+ return true; // self.ammo_cells >= WEP_CVAR_SEC(hook, ammo); // WEAPONTODO: see above
}
case WR_CONFIG:
{
HOOK_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
- return TRUE;
+ return true;
}
case WR_RESETPLAYER:
{
self.hook_refire = time;
- return TRUE;
+ return true;
}
case WR_SUICIDEMESSAGE:
{
- return FALSE;
+ return false;
}
case WR_KILLMESSAGE:
{
return WEAPON_HOOK_MURDER;
}
}
- return FALSE;
+ return false;
}
#endif
#ifdef CSQC
if(!w_issilent)
sound(self, CH_SHOTS, "weapons/hookbomb_impact.wav", VOL_BASE, ATTN_NORM);
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/hookbomb_impact.wav");
- return TRUE;
+ return true;
}
case WR_ZOOMRETICLE:
{
// no weapon specific image for this weapon
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
#endif
#endif
void W_MachineGun_Attack(float deathtype)
{
- W_SetupShot(self, TRUE, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, ((self.misc_bulletcounter == 1) ? WEP_CVAR(machinegun, first_damage) : WEP_CVAR(machinegun, sustained_damage)));
+ W_SetupShot(self, true, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, ((self.misc_bulletcounter == 1) ? WEP_CVAR(machinegun, first_damage) : WEP_CVAR(machinegun, sustained_damage)));
if(!autocvar_g_norecoil)
{
self.punchangle_x = random() - 0.5;
W_DecreaseAmmo(WEP_CVAR(machinegun, sustained_ammo));
- W_SetupShot(self, TRUE, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage));
+ W_SetupShot(self, true, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage));
if(!autocvar_g_norecoil)
{
self.punchangle_x = random() - 0.5;
void W_MachineGun_Attack_Burst(void)
{
- W_SetupShot(self, TRUE, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage));
+ W_SetupShot(self, true, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage));
if(!autocvar_g_norecoil)
{
self.punchangle_x = random() - 0.5;
case WR_AIM:
{
if(vlen(self.origin-self.enemy.origin) < 3000 - bound(0, skill, 10) * 200)
- self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE);
+ self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false);
else
- self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, FALSE);
+ self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false);
- return TRUE;
+ return true;
}
case WR_THINK:
{
{
W_SwitchWeapon_Force(self, w_getbestweapon(self));
w_ready();
- return FALSE;
+ return false;
}
W_DecreaseAmmo(WEP_CVAR(machinegun, burst_ammo));
}
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_model("models/weapons/h_uzi.iqm");
precache_sound("weapons/uzi_fire.wav");
MACHINEGUN_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
- return TRUE;
+ return true;
}
case WR_CHECKAMMO1:
{
case WR_CONFIG:
{
MACHINEGUN_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
- return TRUE;
+ return true;
}
case WR_RELOAD:
{
W_Reload(min(max(WEP_CVAR(machinegun, sustained_ammo), WEP_CVAR(machinegun, first_ammo)), WEP_CVAR(machinegun, burst_ammo)), "weapons/reload.wav");
- return TRUE;
+ return true;
}
case WR_SUICIDEMESSAGE:
{
return WEAPON_MACHINEGUN_MURDER_SPRAY;
}
}
- return FALSE;
+ return false;
}
#endif
#ifdef CSQC
else if(w_random < 0.2)
sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/ric1.wav");
precache_sound("weapons/ric2.wav");
precache_sound("weapons/ric3.wav");
- return TRUE;
+ return true;
}
case WR_ZOOMRETICLE:
{
// no weapon specific image for this weapon
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
#endif
#endif
newmine.health = self.health;
newmine.event_damage = self.event_damage;
newmine.spawnshieldtime = self.spawnshieldtime;
- newmine.damagedbycontents = TRUE;
+ newmine.damagedbycontents = true;
newmine.movetype = MOVETYPE_NONE; // lock the mine in place
newmine.projectiledeathtype = self.projectiledeathtype;
W_DecreaseAmmo(WEP_CVAR(minelayer, ammo));
- W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', FALSE, 5, "weapons/mine_fire.wav", CH_WEAPON_A, WEP_CVAR(minelayer, damage));
+ W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', false, 5, "weapons/mine_fire.wav", CH_WEAPON_A, WEP_CVAR(minelayer, damage));
pointparticles(particleeffectnum("rocketlauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
mine = WarpZone_RefSys_SpawnSameRefSys(self);
else
mine.spawnshieldtime = -1;
mine.classname = "mine";
- mine.bot_dodge = TRUE;
+ mine.bot_dodge = true;
mine.bot_dodgerating = WEP_CVAR(minelayer, damage) * 2; // * 2 because it can detonate inflight which makes it even more dangerous
mine.takedamage = DAMAGE_YES;
mine.damageforcescale = WEP_CVAR(minelayer, damageforcescale);
mine.health = WEP_CVAR(minelayer, health);
mine.event_damage = W_MineLayer_Damage;
- mine.damagedbycontents = TRUE;
+ mine.damagedbycontents = true;
mine.movetype = MOVETYPE_TOSS;
PROJECTILE_MAKETRIGGER(mine);
if(mine.cnt > 0) { mine.cnt += time; }
- CSQCProjectile(mine, TRUE, PROJECTILE_MINE, TRUE);
+ CSQCProjectile(mine, true, PROJECTILE_MINE, true);
// muzzle flash for 1st person view
flash = spawn();
{
if(!mine.minelayer_detonate)
{
- mine.minelayer_detonate = TRUE;
+ mine.minelayer_detonate = true;
minfound = 1;
}
}
{
// aim and decide to fire if appropriate
if(self.minelayer_mines >= WEP_CVAR(minelayer, limit))
- self.BUTTON_ATCK = FALSE;
+ self.BUTTON_ATCK = false;
else
- self.BUTTON_ATCK = bot_aim(WEP_CVAR(minelayer, speed), 0, WEP_CVAR(minelayer, lifetime), FALSE);
+ self.BUTTON_ATCK = bot_aim(WEP_CVAR(minelayer, speed), 0, WEP_CVAR(minelayer, lifetime), false);
if(skill >= 2) // skill 0 and 1 bots won't detonate mines!
{
// decide whether to detonate mines
selfdamage = 0;
teamdamage = 0;
enemydamage = 0;
- targetlist = findchainfloat(bot_attack, TRUE);
+ targetlist = findchainfloat(bot_attack, true);
mine = find(world, classname, "mine");
while(mine)
{
if(
(v_forward * normalize(mine.origin - targ.origin)< 0.1)
&& desirabledamage > 0.1*coredamage
- )self.BUTTON_ATCK2 = TRUE;
+ )self.BUTTON_ATCK2 = true;
targ = targ.chain;
}
}else{
if(IS_PLAYER(self.enemy))
if(desirabledamage >= 0.1*coredamage)
if(random()/distance*300 > frametime*bound(0,(10-skill)*0.2,1))
- self.BUTTON_ATCK2 = TRUE;
+ self.BUTTON_ATCK2 = true;
// dprint(ftos(random()/distance*300),">");dprint(ftos(frametime*bound(0,(10-skill)*0.2,1)),"\n");
}
// if we would be doing at X percent of the core damage, detonate it
// but don't fire a new shot at the same time!
if(desirabledamage >= 0.75 * coredamage) //this should do group damage in rare fortunate events
- self.BUTTON_ATCK2 = TRUE;
+ self.BUTTON_ATCK2 = true;
if((skill > 6.5) && (selfdamage > self.health))
- self.BUTTON_ATCK2 = FALSE;
- //if(self.BUTTON_ATCK2 == TRUE)
+ self.BUTTON_ATCK2 = false;
+ //if(self.BUTTON_ATCK2 == true)
// dprint(ftos(desirabledamage),"\n");
- if(self.BUTTON_ATCK2 == TRUE) self.BUTTON_ATCK = FALSE;
+ if(self.BUTTON_ATCK2 == true) self.BUTTON_ATCK = false;
}
- return TRUE;
+ return true;
}
case WR_THINK:
{
if(autocvar_g_balance_minelayer_reload_ammo && self.clip_load < WEP_CVAR(minelayer, ammo)) // forced reload
{
// not if we're holding the minelayer without enough ammo, but can detonate existing mines
- if(!(W_MineLayer_PlacedMines(FALSE) && self.WEP_AMMO(MINE_LAYER) < WEP_CVAR(minelayer, ammo)))
+ if(!(W_MineLayer_PlacedMines(false) && self.WEP_AMMO(MINE_LAYER) < WEP_CVAR(minelayer, ammo)))
WEP_ACTION(self.weapon, WR_RELOAD);
}
else if(self.BUTTON_ATCK)
if(self.BUTTON_ATCK2)
{
- if(W_MineLayer_PlacedMines(TRUE))
+ if(W_MineLayer_PlacedMines(true))
sound(self, CH_WEAPON_B, "weapons/mine_det.wav", VOL_BASE, ATTN_NORM);
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/mine_stick.wav");
precache_sound("weapons/mine_trigger.wav");
MINELAYER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
- return TRUE;
+ return true;
}
case WR_CHECKAMMO1:
{
ammo_amount += self.(weapon_load[WEP_MINE_LAYER]) >= WEP_CVAR(minelayer, ammo);
return ammo_amount;
}
- return TRUE;
+ return true;
}
case WR_CHECKAMMO2:
{
- if(W_MineLayer_PlacedMines(FALSE))
- return TRUE;
+ if(W_MineLayer_PlacedMines(false))
+ return true;
else
- return FALSE;
+ return false;
}
case WR_CONFIG:
{
MINELAYER_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
- return TRUE;
+ return true;
}
case WR_RESETPLAYER:
{
self.minelayer_mines = 0;
- return TRUE;
+ return true;
}
case WR_RELOAD:
{
W_Reload(WEP_CVAR(minelayer, ammo), "weapons/reload.wav");
- return TRUE;
+ return true;
}
case WR_SUICIDEMESSAGE:
{
return WEAPON_MINELAYER_MURDER;
}
}
- return FALSE;
+ return false;
}
#endif
#ifdef CSQC
if(!w_issilent)
sound(self, CH_SHOTS, "weapons/mine_exp.wav", VOL_BASE, ATTN_NORM);
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/mine_exp.wav");
- return TRUE;
+ return true;
}
case WR_ZOOMRETICLE:
{
// no weapon specific image for this weapon
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
#endif
#endif
W_DecreaseAmmo(WEP_CVAR_PRI(mortar, ammo));
- W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", CH_WEAPON_A, WEP_CVAR_PRI(mortar, damage));
+ W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 4, "weapons/grenade_fire.wav", CH_WEAPON_A, WEP_CVAR_PRI(mortar, damage));
w_shotdir = v_forward; // no TrueAim for grenades please
pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
gren = spawn();
gren.owner = gren.realowner = self;
gren.classname = "grenade";
- gren.bot_dodge = TRUE;
+ gren.bot_dodge = true;
gren.bot_dodgerating = WEP_CVAR_PRI(mortar, damage);
gren.movetype = MOVETYPE_BOUNCE;
gren.bouncefactor = WEP_CVAR(mortar, bouncefactor);
gren.health = WEP_CVAR_PRI(mortar, health);
gren.damageforcescale = WEP_CVAR_PRI(mortar, damageforcescale);
gren.event_damage = W_Mortar_Grenade_Damage;
- gren.damagedbycontents = TRUE;
+ gren.damagedbycontents = true;
gren.missile_flags = MIF_SPLASH | MIF_ARC;
W_SetupProjVelocity_UP_PRI(gren, mortar);
gren.flags = FL_PROJECTILE;
if(WEP_CVAR_PRI(mortar, type) == 0 || WEP_CVAR_PRI(mortar, type) == 2)
- CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE, TRUE);
+ CSQCProjectile(gren, true, PROJECTILE_GRENADE, true);
else
- CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE_BOUNCING, TRUE);
+ CSQCProjectile(gren, true, PROJECTILE_GRENADE_BOUNCING, true);
other = gren; MUTATOR_CALLHOOK(EditProjectile);
}
W_DecreaseAmmo(WEP_CVAR_SEC(mortar, ammo));
- W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(mortar, damage));
+ W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 4, "weapons/grenade_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(mortar, damage));
w_shotdir = v_forward; // no TrueAim for grenades please
pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
gren = spawn();
gren.owner = gren.realowner = self;
gren.classname = "grenade";
- gren.bot_dodge = TRUE;
+ gren.bot_dodge = true;
gren.bot_dodgerating = WEP_CVAR_SEC(mortar, damage);
gren.movetype = MOVETYPE_BOUNCE;
gren.bouncefactor = WEP_CVAR(mortar, bouncefactor);
gren.health = WEP_CVAR_SEC(mortar, health);
gren.damageforcescale = WEP_CVAR_SEC(mortar, damageforcescale);
gren.event_damage = W_Mortar_Grenade_Damage;
- gren.damagedbycontents = TRUE;
+ gren.damagedbycontents = true;
gren.missile_flags = MIF_SPLASH | MIF_ARC;
W_SetupProjVelocity_UP_SEC(gren, mortar);
gren.flags = FL_PROJECTILE;
if(WEP_CVAR_SEC(mortar, type) == 0 || WEP_CVAR_SEC(mortar, type) == 2)
- CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE, TRUE);
+ CSQCProjectile(gren, true, PROJECTILE_GRENADE, true);
else
- CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE_BOUNCING, TRUE);
+ CSQCProjectile(gren, true, PROJECTILE_GRENADE_BOUNCING, true);
other = gren; MUTATOR_CALLHOOK(EditProjectile);
}
{
case WR_AIM:
{
- self.BUTTON_ATCK = FALSE;
- self.BUTTON_ATCK2 = FALSE;
+ self.BUTTON_ATCK = false;
+ self.BUTTON_ATCK2 = false;
if(self.bot_secondary_grenademooth == 0) // WEAPONTODO: merge this into using WEP_CVAR_BOTH
{
- if(bot_aim(WEP_CVAR_PRI(mortar, speed), WEP_CVAR_PRI(mortar, speed_up), WEP_CVAR_PRI(mortar, lifetime), TRUE))
+ if(bot_aim(WEP_CVAR_PRI(mortar, speed), WEP_CVAR_PRI(mortar, speed_up), WEP_CVAR_PRI(mortar, lifetime), true))
{
- self.BUTTON_ATCK = TRUE;
+ self.BUTTON_ATCK = true;
if(random() < 0.01) self.bot_secondary_grenademooth = 1;
}
}
else
{
- if(bot_aim(WEP_CVAR_SEC(mortar, speed), WEP_CVAR_SEC(mortar, speed_up), WEP_CVAR_SEC(mortar, lifetime), TRUE))
+ if(bot_aim(WEP_CVAR_SEC(mortar, speed), WEP_CVAR_SEC(mortar, speed_up), WEP_CVAR_SEC(mortar, lifetime), true))
{
- self.BUTTON_ATCK2 = TRUE;
+ self.BUTTON_ATCK2 = true;
if(random() < 0.02) self.bot_secondary_grenademooth = 0;
}
}
- return TRUE;
+ return true;
}
/*case WR_CALCINFO:
{
{
if(!nade.gl_detonate_later)
{
- nade.gl_detonate_later = TRUE;
+ nade.gl_detonate_later = true;
nadefound = 1;
}
}
}
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/grenade_stick.wav");
precache_sound("weapons/grenade_fire.wav");
MORTAR_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
- return TRUE;
+ return true;
}
case WR_CHECKAMMO1:
{
case WR_CONFIG:
{
MORTAR_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
- return TRUE;
+ return true;
}
case WR_RELOAD:
{
W_Reload(min(WEP_CVAR_PRI(mortar, ammo), WEP_CVAR_SEC(mortar, ammo)), "weapons/reload.wav"); // WEAPONTODO
- return TRUE;
+ return true;
}
case WR_SUICIDEMESSAGE:
{
return WEAPON_MORTAR_MURDER_EXPLODE;
}
}
- return FALSE;
+ return false;
}
#endif
#ifdef CSQC
if(!w_issilent)
sound(self, CH_SHOTS, "weapons/grenade_impact.wav", VOL_BASE, ATTN_NORM);
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/grenade_impact.wav");
- return TRUE;
+ return true;
}
case WR_ZOOMRETICLE:
{
// no weapon specific image for this weapon
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
#endif
#endif
Send_Notification(NOTIF_ONE, self.realowner, MSG_CENTER, CENTER_PORTO_CREATED_IN);
self.right_vector = self.right_vector - 2 * trace_plane_normal * (self.right_vector * norm);
self.angles = vectoangles(self.velocity - 2 * trace_plane_normal * (self.velocity * norm));
- CSQCProjectile(self, TRUE, PROJECTILE_PORTO_BLUE, TRUE); // change type
+ CSQCProjectile(self, true, PROJECTILE_PORTO_BLUE, true); // change type
}
else
{
{
entity gren;
- W_SetupShot(self, FALSE, 4, "porto/fire.wav", CH_WEAPON_A, 0);
+ W_SetupShot(self, false, 4, "porto/fire.wav", CH_WEAPON_A, 0);
// always shoot from the eye
w_shotdir = v_forward;
w_shotorg = self.origin + self.view_ofs + ((w_shotorg - self.origin - self.view_ofs) * v_forward) * v_forward;
gren.owner = gren.realowner = self;
gren.playerid = self.playerid;
gren.classname = "porto";
- gren.bot_dodge = TRUE;
+ gren.bot_dodge = true;
gren.bot_dodgerating = 200;
gren.movetype = MOVETYPE_BOUNCEMISSILE;
PROJECTILE_MAKETRIGGER(gren);
gren.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP;
if(type > 0)
- CSQCProjectile(gren, TRUE, PROJECTILE_PORTO_BLUE, TRUE);
+ CSQCProjectile(gren, true, PROJECTILE_PORTO_BLUE, true);
else
- CSQCProjectile(gren, TRUE, PROJECTILE_PORTO_RED, TRUE);
+ CSQCProjectile(gren, true, PROJECTILE_PORTO_RED, true);
other = gren; MUTATOR_CALLHOOK(EditProjectile);
}
{
case WR_AIM:
{
- self.BUTTON_ATCK = FALSE;
- self.BUTTON_ATCK2 = FALSE;
+ self.BUTTON_ATCK = false;
+ self.BUTTON_ATCK2 = false;
if(!WEP_CVAR(porto, secondary))
- if(bot_aim(WEP_CVAR_PRI(porto, speed), 0, WEP_CVAR_PRI(porto, lifetime), FALSE))
- self.BUTTON_ATCK = TRUE;
+ if(bot_aim(WEP_CVAR_PRI(porto, speed), 0, WEP_CVAR_PRI(porto, lifetime), false))
+ self.BUTTON_ATCK = true;
- return TRUE;
+ return true;
}
case WR_CONFIG:
{
PORTO_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
- return TRUE;
+ return true;
}
case WR_THINK:
{
}
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("porto/fire.wav");
precache_sound("porto/unsupported.wav");
PORTO_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
- return TRUE;
+ return true;
}
case WR_SETUP:
{
self.ammo_field = ammo_none;
- return TRUE;
+ return true;
}
case WR_RESETPLAYER:
{
self.porto_current = world;
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
#endif
#ifdef CSQC
case WR_IMPACTEFFECT:
{
print("Since when does Porto send DamageInfo?\n");
- return TRUE;
+ return true;
}
case WR_INIT:
{
// nothing to do
- return TRUE;
+ return true;
}
case WR_ZOOMRETICLE:
{
// no weapon specific image for this weapon
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
#endif
#endif
W_DecreaseAmmo(pAmmo);
- W_SetupShot(self, TRUE, 2, pSound, CH_WEAPON_A, pDamage * pShots);
+ W_SetupShot(self, true, 2, pSound, CH_WEAPON_A, pDamage * pShots);
pointparticles(particleeffectnum("rifle_muzzleflash"), w_shotorg, w_shotdir * 2000, 1);
{
case WR_AIM:
{
- self.BUTTON_ATCK=FALSE;
- self.BUTTON_ATCK2=FALSE;
+ self.BUTTON_ATCK=false;
+ self.BUTTON_ATCK2=false;
if(vlen(self.origin-self.enemy.origin) > 1000)
self.bot_secondary_riflemooth = 0;
if(self.bot_secondary_riflemooth == 0)
{
- if(bot_aim(1000000, 0, 0.001, FALSE))
+ if(bot_aim(1000000, 0, 0.001, false))
{
- self.BUTTON_ATCK = TRUE;
+ self.BUTTON_ATCK = true;
if(random() < 0.01) self.bot_secondary_riflemooth = 1;
}
}
else
{
- if(bot_aim(1000000, 0, 0.001, FALSE))
+ if(bot_aim(1000000, 0, 0.001, false))
{
- self.BUTTON_ATCK2 = TRUE;
+ self.BUTTON_ATCK2 = true;
if(random() < 0.03) self.bot_secondary_riflemooth = 0;
}
}
- return TRUE;
+ return true;
}
case WR_THINK:
{
}
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/campingrifle_fire.wav");
precache_sound("weapons/campingrifle_fire2.wav");
RIFLE_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
- return TRUE;
+ return true;
}
case WR_CHECKAMMO1:
{
case WR_CONFIG:
{
RIFLE_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
- return TRUE;
+ return true;
}
case WR_RESETPLAYER:
{
self.rifle_accumulator = time - WEP_CVAR(rifle, bursttime);
- return TRUE;
+ return true;
}
case WR_RELOAD:
{
W_Reload(min(WEP_CVAR_PRI(rifle, ammo), WEP_CVAR_SEC(rifle, ammo)), "weapons/reload.wav");
- return TRUE;
+ return true;
}
case WR_SUICIDEMESSAGE:
{
}
}
}
- return FALSE;
+ return false;
}
#endif
#ifdef CSQC
sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
{
precache_pic("gfx/reticle_nex");
}
- return TRUE;
+ return true;
}
case WR_ZOOMRETICLE:
{
if(button_zoom || zoomscript_caught)
{
reticle_image = "gfx/reticle_nex";
- return TRUE;
+ return true;
}
else
{
// no weapon specific image for this weapon
- return FALSE;
+ return false;
}
}
}
- return FALSE;
+ return false;
}
#endif
#endif
entity flash = spawn ();
W_DecreaseAmmo(WEP_CVAR(rpc, ammo));
- W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 5, "weapons/rocket_fire.wav", CH_WEAPON_A, WEP_CVAR(rpc, damage));
+ W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', false, 5, "weapons/rocket_fire.wav", CH_WEAPON_A, WEP_CVAR(rpc, damage));
pointparticles(particleeffectnum("rocketlauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
PROJECTILE_MAKETRIGGER(missile);
missile.owner = missile.realowner = self;
- missile.bot_dodge = TRUE;
+ missile.bot_dodge = true;
missile.bot_dodgerating = WEP_CVAR(rpc, damage) * 2;
missile.takedamage = DAMAGE_YES;
missile.damageforcescale = WEP_CVAR(rpc, damageforcescale);
missile.health = WEP_CVAR(rpc, health);
missile.event_damage = W_RocketPropelledChainsaw_Damage;
- missile.damagedbycontents = TRUE;
+ missile.damagedbycontents = true;
missile.movetype = MOVETYPE_FLY;
missile.projectiledeathtype = WEP_RPC;
missile.nextthink = time;
missile.flags = FL_PROJECTILE;
- CSQCProjectile(missile, TRUE, PROJECTILE_RPC, FALSE);
+ CSQCProjectile(missile, true, PROJECTILE_RPC, false);
setmodel(flash, "models/flash.md3"); // precision set below
SUB_SetFade (flash, time, 0.1);
float W_RocketPropelledChainsaw(float req)
{
- float ammo_amount = FALSE;
+ float ammo_amount = false;
switch(req)
{
case WR_AIM:
{
- self.BUTTON_ATCK = bot_aim(WEP_CVAR(rpc, speed), 0, WEP_CVAR(rpc, lifetime), FALSE);
- return TRUE;
+ self.BUTTON_ATCK = bot_aim(WEP_CVAR(rpc, speed), 0, WEP_CVAR(rpc, lifetime), false);
+ return true;
}
case WR_THINK:
{
}
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_model("models/weapons/g_ok_rl.md3");
precache_sound ("weapons/rocket_fire.wav");
RPC_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
- return TRUE;
+ return true;
}
case WR_CHECKAMMO1:
{
}
case WR_CHECKAMMO2:
{
- return FALSE;
+ return false;
}
case WR_CONFIG:
{
RPC_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
- return TRUE;
+ return true;
}
case WR_RELOAD:
{
W_Reload(WEP_CVAR(rpc, ammo), "weapons/reload.wav");
- return TRUE;
+ return true;
}
case WR_SUICIDEMESSAGE:
{
}
}
- return FALSE;
+ return false;
}
#endif
if(!w_issilent)
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/rocket_impact.wav");
- return TRUE;
+ return true;
}
case WR_ZOOMRETICLE:
{
// no weapon specific image for this weapon
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
#endif
#endif
{
// Is it a better idea (shorter distance) to trace to the target itself?
if( vlen(self.origin + olddir * self.wait) < dist)
- traceline(self.origin, self.origin + olddir * self.wait, FALSE, self);
+ traceline(self.origin, self.origin + olddir * self.wait, false, self);
else
- traceline(self.origin, eorg, FALSE, self);
+ traceline(self.origin, eorg, false, self);
// Setup adaptive tracelength
self.wait = bound(WEP_CVAR(seeker, missile_smart_trace_min), vlen(self.origin - trace_endpos), self.wait = WEP_CVAR(seeker, missile_smart_trace_max));
W_DecreaseAmmo(WEP_CVAR(seeker, missile_ammo));
makevectors(self.v_angle);
- W_SetupShot_ProjectileSize(self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/seeker_fire.wav", CH_WEAPON_A, 0);
+ W_SetupShot_ProjectileSize(self, '-2 -2 -2', '2 2 2', false, 2, "weapons/seeker_fire.wav", CH_WEAPON_A, 0);
w_shotorg += f_diff;
pointparticles(particleeffectnum("seeker_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
- //self.detornator = FALSE;
+ //self.detornator = false;
missile = spawn();
missile.owner = missile.realowner = self;
missile.classname = "seeker_missile";
- missile.bot_dodge = TRUE;
+ missile.bot_dodge = true;
missile.bot_dodgerating = WEP_CVAR(seeker, missile_damage);
missile.think = W_Seeker_Missile_Think;
missile.takedamage = DAMAGE_YES;
missile.health = WEP_CVAR(seeker, missile_health);
missile.damageforcescale = WEP_CVAR(seeker, missile_damageforcescale);
- missile.damagedbycontents = TRUE;
+ missile.damagedbycontents = true;
//missile.think = W_Seeker_Missile_Animate; // csqc projectiles.
if(missile.enemy != world)
missile.angles = vectoangles(missile.velocity);
- CSQCProjectile(missile, FALSE, PROJECTILE_SEEKER, TRUE);
+ CSQCProjectile(missile, false, PROJECTILE_SEEKER, true);
other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
f_diff = '+1.25 +3.75 0';
break;
}
- W_SetupShot_ProjectileSize(self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/flac_fire.wav", CH_WEAPON_A, WEP_CVAR(seeker, flac_damage));
+ W_SetupShot_ProjectileSize(self, '-2 -2 -2', '2 2 2', false, 2, "weapons/flac_fire.wav", CH_WEAPON_A, WEP_CVAR(seeker, flac_damage));
w_shotorg += f_diff;
pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
missile = spawn();
missile.owner = missile.realowner = self;
missile.classname = "missile";
- missile.bot_dodge = TRUE;
+ missile.bot_dodge = true;
missile.bot_dodgerating = WEP_CVAR(seeker, flac_damage);
missile.touch = W_Seeker_Flac_Explode;
missile.use = W_Seeker_Flac_Explode;
setsize(missile, '-2 -2 -2', '2 2 2');
W_SetupProjVelocity_UP_PRE(missile, seeker, flac_);
- CSQCProjectile(missile, TRUE, PROJECTILE_FLAC, TRUE);
+ CSQCProjectile(missile, true, PROJECTILE_FLAC, true);
other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
if(WEP_CVAR(seeker, type) == 1)
{
- WaypointSprite_Spawn("tagged-target", WEP_CVAR(seeker, tag_tracker_lifetime), 0, other, '0 0 64', self.realowner, 0, other, wps_tag_tracker, TRUE, RADARICON_TAGGED, '0.5 1 0');
+ WaypointSprite_Spawn("tagged-target", WEP_CVAR(seeker, tag_tracker_lifetime), 0, other, '0 0 64', self.realowner, 0, other, wps_tag_tracker, true, RADARICON_TAGGED, '0.5 1 0');
WaypointSprite_UpdateRule(other.wps_tag_tracker, 0, SPRITERULE_DEFAULT);
}
}
entity missile;
W_DecreaseAmmo(WEP_CVAR(seeker, tag_ammo));
- W_SetupShot_ProjectileSize(self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/tag_fire.wav", CH_WEAPON_A, WEP_CVAR(seeker, missile_damage) * WEP_CVAR(seeker, missile_count));
+ W_SetupShot_ProjectileSize(self, '-2 -2 -2', '2 2 2', false, 2, "weapons/tag_fire.wav", CH_WEAPON_A, WEP_CVAR(seeker, missile_damage) * WEP_CVAR(seeker, missile_count));
missile = spawn();
missile.owner = missile.realowner = self;
missile.classname = "seeker_tag";
- missile.bot_dodge = TRUE;
+ missile.bot_dodge = true;
missile.bot_dodgerating = 50;
missile.touch = W_Seeker_Tag_Touch;
missile.think = SUB_Remove;
W_SetupProjVelocity_PRE(missile, seeker, tag_);
missile.angles = vectoangles(missile.velocity);
- CSQCProjectile(missile, TRUE, PROJECTILE_TAG, FALSE); // has sound
+ CSQCProjectile(missile, true, PROJECTILE_TAG, false); // has sound
other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
{
if(WEP_CVAR(seeker, type) == 1)
if(W_Seeker_Tagged_Info(self, self.enemy) != world)
- self.BUTTON_ATCK = bot_aim(WEP_CVAR(seeker, missile_speed_max), 0, WEP_CVAR(seeker, missile_lifetime), FALSE);
+ self.BUTTON_ATCK = bot_aim(WEP_CVAR(seeker, missile_speed_max), 0, WEP_CVAR(seeker, missile_lifetime), false);
else
- self.BUTTON_ATCK2 = bot_aim(WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), FALSE);
+ self.BUTTON_ATCK2 = bot_aim(WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
else
- self.BUTTON_ATCK = bot_aim(WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), FALSE);
- return TRUE;
+ self.BUTTON_ATCK = bot_aim(WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
+ return true;
}
case WR_THINK:
{
}
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/flac_fire.wav");
precache_sound("weapons/seeker_fire.wav");
SEEKER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
- return TRUE;
+ return true;
}
case WR_CHECKAMMO1:
{
case WR_CONFIG:
{
SEEKER_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
- return TRUE;
+ return true;
}
case WR_RELOAD:
{
W_Reload(min(WEP_CVAR(seeker, missile_ammo), WEP_CVAR(seeker, tag_ammo)), "weapons/reload.wav");
- return TRUE;
+ return true;
}
case WR_SUICIDEMESSAGE:
{
return WEAPON_SEEKER_MURDER_SPRAY;
}
}
- return FALSE;
+ return false;
}
#endif
#ifdef CSQC
sound(self, CH_SHOTS, "weapons/seekerexp3.wav", 1, ATTEN_NORM);
}
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/tagexp2.wav");
precache_sound("weapons/tagexp3.wav");
precache_sound("weapons/tag_impact.wav");
- return TRUE;
+ return true;
}
case WR_ZOOMRETICLE:
{
// no weapon specific image for this weapon
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
#endif
#endif
self.realowner,
(self.realowner.origin + self.realowner.view_ofs),
targpos,
- FALSE,
+ false,
self.realowner,
ANTILAG_LATENCY(self.realowner)
);
meleetemp.owner = meleetemp.realowner = self;
meleetemp.think = W_Shockwave_Melee_Think;
meleetemp.nextthink = time + WEP_CVAR(shockwave, melee_delay) * W_WeaponRateFactor();
- W_SetupShot_Range(self, TRUE, 0, "", 0, WEP_CVAR(shockwave, melee_damage), WEP_CVAR(shockwave, melee_range));
+ W_SetupShot_Range(self, true, 0, "", 0, WEP_CVAR(shockwave, melee_damage), WEP_CVAR(shockwave, melee_range));
}
// SHOCKWAVE ATTACK MODE
)
{ return bound(0, (distance_from_line / spreadlimit), 1); }
else
- { return FALSE; }
+ { return false; }
}
float W_Shockwave_Attack_IsVisible(
if(W_Shockwave_Attack_CheckSpread(nearest_to_attacker, nearest_on_line, sw_shotorg, attack_endpos))
{
WarpZone_TraceLine(sw_shotorg, nearest_to_attacker, MOVE_NOMONSTERS, self);
- if(trace_fraction == 1) { return TRUE; } // yes, the nearest point is clear and we can allow the damage
+ if(trace_fraction == 1) { return true; } // yes, the nearest point is clear and we can allow the damage
}
// STEP TWO: Check if shotorg to center point is clear
if(W_Shockwave_Attack_CheckSpread(center, nearest_on_line, sw_shotorg, attack_endpos))
{
WarpZone_TraceLine(sw_shotorg, center, MOVE_NOMONSTERS, self);
- if(trace_fraction == 1) { return TRUE; } // yes, the center point is clear and we can allow the damage
+ if(trace_fraction == 1) { return true; } // yes, the center point is clear and we can allow the damage
}
// STEP THREE: Check each corner to see if they are clear
if(W_Shockwave_Attack_CheckSpread(corner, nearest_on_line, sw_shotorg, attack_endpos))
{
WarpZone_TraceLine(sw_shotorg, corner, MOVE_NOMONSTERS, self);
- if(trace_fraction == 1) { return TRUE; } // yes, this corner is clear and we can allow the damage
+ if(trace_fraction == 1) { return true; } // yes, this corner is clear and we can allow the damage
}
}
- return FALSE;
+ return false;
}
float W_Shockwave_Attack_CheckHit(
vector final_force,
float final_damage)
{
- if(!head) { return FALSE; }
+ if(!head) { return false; }
float i;
for(i = 0; i <= queue; ++i)
{
if(vlen(final_force) > vlen(shockwave_hit_force[i])) { shockwave_hit_force[i] = final_force; }
if(final_damage > shockwave_hit_damage[i]) { shockwave_hit_damage[i] = final_damage; }
- return FALSE;
+ return false;
}
}
shockwave_hit[queue] = head;
shockwave_hit_force[queue] = final_force;
shockwave_hit_damage[queue] = final_damage;
- return TRUE;
+ return true;
}
void W_Shockwave_Send(void)
float i, queue = 0;
// set up the shot direction
- W_SetupShot(self, FALSE, 3, "weapons/lasergun_fire.wav", CH_WEAPON_B, WEP_CVAR(shockwave, blast_damage));
+ W_SetupShot(self, false, 3, "weapons/lasergun_fire.wav", CH_WEAPON_B, WEP_CVAR(shockwave, blast_damage));
vector attack_endpos = (w_shotorg + (w_shotdir * WEP_CVAR(shockwave, blast_distance)));
WarpZone_TraceLine(w_shotorg, attack_endpos, MOVE_NOMONSTERS, self);
vector attack_hitpos = trace_endpos;
WEP_CVAR(shockwave, blast_splash_radius),
WEP_CVAR(shockwave, blast_jump_radius)
),
- FALSE
+ false
);
while(head)
}
// cone damage trace
- head = WarpZone_FindRadius(w_shotorg, WEP_CVAR(shockwave, blast_distance), FALSE);
+ head = WarpZone_FindRadius(w_shotorg, WEP_CVAR(shockwave, blast_distance), false);
while(head)
{
if((head != self) && head.takedamage)
case WR_AIM:
{
if(vlen(self.origin - self.enemy.origin) <= WEP_CVAR(shockwave, melee_range))
- { self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, FALSE); }
+ { self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false); }
else
- { self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE); }
+ { self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false); }
- return TRUE;
+ return true;
}
case WR_THINK:
{
}
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/lasergun_fire.wav");
precache_sound("weapons/shotgun_melee.wav");
SHOCKWAVE_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
- return TRUE;
+ return true;
}
case WR_CHECKAMMO1:
case WR_CHECKAMMO2:
{
// shockwave has infinite ammo
- return TRUE;
+ return true;
}
case WR_CONFIG:
{
SHOCKWAVE_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
- return TRUE;
+ return true;
}
case WR_SUICIDEMESSAGE:
{
return WEAPON_SHOCKWAVE_MURDER;
}
}
- return FALSE;
+ return false;
}
#endif
#ifdef CSQC
//vector org2;
//org2 = w_org + w_backoff * 2;
//pointparticles(particleeffectnum("laser_impact"), org2, w_backoff * 1000, 1);
- return FALSE;
+ return false;
}
case WR_INIT:
{
//precache_sound("weapons/ric1.wav");
//precache_sound("weapons/ric2.wav");
//precache_sound("weapons/ric3.wav");
- return FALSE;
+ return false;
}
case WR_ZOOMRETICLE:
{
// no weapon specific image for this weapon
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
#endif
#endif
W_DecreaseAmmo(WEP_CVAR_PRI(shotgun, ammo));
- W_SetupShot(self, TRUE, 5, "weapons/shotgun_fire.wav", ((isprimary) ? CH_WEAPON_A : CH_WEAPON_SINGLE), WEP_CVAR_PRI(shotgun, damage) * WEP_CVAR_PRI(shotgun, bullets));
+ W_SetupShot(self, true, 5, "weapons/shotgun_fire.wav", ((isprimary) ? CH_WEAPON_A : CH_WEAPON_SINGLE), WEP_CVAR_PRI(shotgun, damage) * WEP_CVAR_PRI(shotgun, bullets));
for(sc = 0;sc < WEP_CVAR_PRI(shotgun, bullets);sc = sc + 1)
fireBullet(w_shotorg, w_shotdir, WEP_CVAR_PRI(shotgun, spread), WEP_CVAR_PRI(shotgun, solidpenetration), WEP_CVAR_PRI(shotgun, damage), WEP_CVAR_PRI(shotgun, force), WEP_SHOTGUN, 0);
+ (v_up * swing_factor * WEP_CVAR_SEC(shotgun, melee_swing_up))
+ (v_right * swing_factor * WEP_CVAR_SEC(shotgun, melee_swing_side)));
- WarpZone_traceline_antilag(self, self.realowner.origin + self.realowner.view_ofs, targpos, FALSE, self, ANTILAG_LATENCY(self.realowner));
+ WarpZone_traceline_antilag(self, self.realowner.origin + self.realowner.view_ofs, targpos, false, self, ANTILAG_LATENCY(self.realowner));
// draw lightning beams for debugging
//te_lightning2(world, targpos, self.realowner.origin + self.realowner.view_ofs + v_forward * 5 - v_up * 5);
meleetemp.realowner = self;
meleetemp.think = W_Shotgun_Melee_Think;
meleetemp.nextthink = time + WEP_CVAR_SEC(shotgun, melee_delay) * W_WeaponRateFactor();
- W_SetupShot_Range(self, TRUE, 0, "", 0, WEP_CVAR_SEC(shotgun, damage), WEP_CVAR_SEC(shotgun, melee_range));
+ W_SetupShot_Range(self, true, 0, "", 0, WEP_CVAR_SEC(shotgun, damage), WEP_CVAR_SEC(shotgun, melee_range));
}
// alternate secondary weapon frames
}
sound(self, CH_WEAPON_SINGLE, "misc/null.wav", VOL_BASE, ATTN_NORM); // kill previous sound
- W_Shotgun_Attack(TRUE); // actually is secondary, but we trick the last shot into playing full reload sound
+ W_Shotgun_Attack(true); // actually is secondary, but we trick the last shot into playing full reload sound
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_SEC(shotgun, alt_animtime), w_ready);
}
void W_Shotgun_Attack3_Frame1()
return;
}
- W_Shotgun_Attack(FALSE);
+ W_Shotgun_Attack(false);
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_SEC(shotgun, alt_animtime), W_Shotgun_Attack3_Frame2);
}
case WR_AIM:
{
if(vlen(self.origin-self.enemy.origin) <= WEP_CVAR_SEC(shotgun, melee_range))
- self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, FALSE);
+ self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false);
else
- self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE);
+ self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false);
- return TRUE;
+ return true;
}
case WR_THINK:
{
{
if(weapon_prepareattack(0, WEP_CVAR_PRI(shotgun, animtime)))
{
- W_Shotgun_Attack(TRUE);
+ W_Shotgun_Attack(true);
self.shotgun_primarytime = time + WEP_CVAR_PRI(shotgun, refire) * W_WeaponRateFactor();
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(shotgun, animtime), w_ready);
}
{
if(weapon_prepareattack(0, WEP_CVAR_SEC(shotgun, alt_animtime)))
{
- W_Shotgun_Attack(FALSE);
+ W_Shotgun_Attack(false);
self.shotgun_primarytime = time + WEP_CVAR_SEC(shotgun, alt_refire) * W_WeaponRateFactor();
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_SEC(shotgun, alt_animtime), W_Shotgun_Attack3_Frame1);
}
weapon_thinkf(WFRAME_FIRE1, 0, W_Shotgun_Attack2);
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/shotgun_fire.wav");
precache_sound("weapons/shotgun_melee.wav");
SHOTGUN_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
- return TRUE;
+ return true;
}
case WR_SETUP:
{
self.ammo_field = ammo_none;
- return TRUE;
+ return true;
}
case WR_CHECKAMMO1:
{
{
if(IS_BOT_CLIENT(self))
if(vlen(self.origin-self.enemy.origin) > WEP_CVAR_SEC(shotgun, melee_range))
- return FALSE; // bots cannot use secondary out of range (fixes constant melee when out of ammo)
+ return false; // bots cannot use secondary out of range (fixes constant melee when out of ammo)
switch(WEP_CVAR(shotgun, secondary))
{
- case 1: return TRUE; // melee does not use ammo
+ case 1: return true; // melee does not use ammo
case 2: // secondary triple shot
{
ammo_amount = self.WEP_AMMO(SHOTGUN) >= WEP_CVAR_PRI(shotgun, ammo);
ammo_amount += self.(weapon_load[WEP_SHOTGUN]) >= WEP_CVAR_PRI(shotgun, ammo);
return ammo_amount;
}
- default: return FALSE; // secondary unavailable
+ default: return false; // secondary unavailable
}
}
case WR_CONFIG:
{
SHOTGUN_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
- return TRUE;
+ return true;
}
case WR_RELOAD:
{
W_Reload(WEP_CVAR_PRI(shotgun, ammo), "weapons/reload.wav"); // WEAPONTODO
- return TRUE;
+ return true;
}
case WR_SUICIDEMESSAGE:
{
return WEAPON_SHOTGUN_MURDER;
}
}
- return FALSE;
+ return false;
}
#endif
#ifdef CSQC
self.prevric = time;
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/ric1.wav");
precache_sound("weapons/ric2.wav");
precache_sound("weapons/ric3.wav");
- return TRUE;
+ return true;
}
case WR_ZOOMRETICLE:
{
// no weapon specific image for this weapon
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
#endif
#endif
float i, j, mmin, mmax, nolength;
float n = tokenize_console(melody);
if(n > pl.tuba_lastnotes_cnt)
- return FALSE;
+ return false;
float pitchshift = 0;
if(instrument >= 0)
if(pl.tuba_instrument != instrument)
- return FALSE;
+ return false;
// verify notes...
- nolength = FALSE;
+ nolength = false;
for(i = 0; i < n; ++i)
{
vector v = pl.(tuba_lastnotes[(pl.tuba_lastnotes_last - i + MAX_TUBANOTES) % MAX_TUBANOTES]);
float ai = stof(argv(n - i - 1));
float np = floor(ai);
if(ai == np)
- nolength = TRUE;
+ nolength = true;
// n counts the last played notes BACKWARDS
// _x is start
// _y is end
else
{
if(v.z + pitchshift != np)
- return FALSE;
+ return false;
}
}
}
if(mmin > mmax) // rhythm fail
- return FALSE;
+ return false;
}
pl.tuba_lastnotes_cnt = 0;
- return TRUE;
+ return true;
}
void W_Tuba_NoteOff(void)
msg_entity = to;
if(!sound_allowed(MSG_ONE, self.realowner))
- return FALSE;
+ return false;
WriteByte(MSG_ENTITY, ENT_CLIENT_TUBANOTE);
WriteByte(MSG_ENTITY, sf);
WriteCoord(MSG_ENTITY, self.origin.y);
WriteCoord(MSG_ENTITY, self.origin.z);
}
- return TRUE;
+ return true;
}
void W_Tuba_NoteThink(void)
vector o;
float n;
- W_SetupShot(self, FALSE, 2, "", 0, WEP_CVAR(tuba, damage));
+ W_SetupShot(self, false, 2, "", 0, WEP_CVAR(tuba, damage));
n = W_Tuba_GetNote(self, hittype);
self.tuba_note.think = W_Tuba_NoteThink;
self.tuba_note.nextthink = time;
self.tuba_note.spawnshieldtime = time;
- Net_LinkEntity(self.tuba_note, FALSE, 0, W_Tuba_NoteSendEntity);
+ Net_LinkEntity(self.tuba_note, false, 0, W_Tuba_NoteSendEntity);
}
self.tuba_note.teleport_time = time + WEP_CVAR(tuba, refire) * 2 * W_WeaponRateFactor(); // so it can get prolonged safely
self.BUTTON_ATCK2 = 1;
}
- return TRUE;
+ return true;
}
case WR_THINK:
{
}
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_model("models/weapons/v_kleinbottle.md3");
precache_model("models/weapons/h_kleinbottle.iqm");
TUBA_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
- return TRUE;
+ return true;
}
case WR_SETUP:
{
self.ammo_field = ammo_none;
self.tuba_instrument = 0;
- return TRUE;
+ return true;
}
case WR_RELOAD:
{
self.weaponname = "tuba";
break;
}
- W_SetupShot(self, FALSE, 0, "", 0, 0);
+ W_SetupShot(self, false, 0, "", 0, 0);
pointparticles(particleeffectnum("teleport"), w_shotorg, '0 0 0', 1);
self.weaponentity.state = WS_INUSE;
weapon_thinkf(WFRAME_RELOAD, 0.5, w_ready);
}
- return TRUE;
+ return true;
}
case WR_CHECKAMMO1:
case WR_CHECKAMMO2:
{
- return TRUE; // tuba has infinite ammo
+ return true; // tuba has infinite ammo
}
case WR_CONFIG:
{
TUBA_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
- return TRUE;
+ return true;
}
case WR_SUICIDEMESSAGE:
{
return WEAPON_TUBA_MURDER;
}
}
- return FALSE;
+ return false;
}
#endif
#ifdef CSQC
case WR_ZOOMRETICLE:
{
// no weapon specific image for this weapon
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
#endif
#endif
float flying;
flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
- W_SetupShot(self, TRUE, 0, "", CH_WEAPON_A, 10000);
+ W_SetupShot(self, true, 0, "", CH_WEAPON_A, 10000);
// handle sound separately so we can change the volume
// added bonus: no longer plays the strength sound (strength gives no bonus to instakill anyway)
sound (self, CH_WEAPON_A, "weapons/minstanexfire.wav", VOL_BASE * 0.8, ATTEN_NORM);
case WR_AIM:
{
if(self.WEP_AMMO(VAPORIZER) > 0)
- self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
+ self.BUTTON_ATCK = bot_aim(1000000, 0, 1, false);
else
- self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), FALSE); // WEAPONTODO: replace with proper vaporizer cvars
+ self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), false); // WEAPONTODO: replace with proper vaporizer cvars
- return TRUE;
+ return true;
}
case WR_THINK:
{
}
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/nexwhoosh3.wav");
//W_Blaster(WR_INIT); // Samual: Is this really the proper thing to do? Didn't we already run this previously?
VAPORIZER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
- return TRUE;
+ return true;
}
case WR_SETUP:
{
self.ammo_field = WEP_AMMO(VAPORIZER);
self.vaporizer_lasthit = 0;
- return TRUE;
+ return true;
}
case WR_CHECKAMMO1:
{
case WR_CHECKAMMO2:
{
if(!WEP_CVAR_SEC(vaporizer, ammo))
- return TRUE;
+ return true;
ammo_amount = self.WEP_AMMO(VAPORIZER) >= WEP_CVAR_SEC(vaporizer, ammo);
ammo_amount += self.(weapon_load[WEP_VAPORIZER]) >= WEP_CVAR_SEC(vaporizer, ammo);
return ammo_amount;
case WR_CONFIG:
{
VAPORIZER_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
- return TRUE;
+ return true;
}
case WR_RESETPLAYER:
{
self.vaporizer_lasthit = 0;
- return TRUE;
+ return true;
}
case WR_RELOAD:
{
used_ammo = vaporizer_ammo;
W_Reload(used_ammo, "weapons/reload.wav");
- return TRUE;
+ return true;
}
case WR_SUICIDEMESSAGE:
{
return WEAPON_VAPORIZER_MURDER;
}
}
- return FALSE;
+ return false;
}
#endif
#ifdef CSQC
pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
if(!w_issilent) { sound(self, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM); }
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
{
precache_pic("gfx/reticle_nex");
}
- return TRUE;
+ return true;
}
case WR_ZOOMRETICLE:
{
if(button_zoom || zoomscript_caught)
{
reticle_image = "gfx/reticle_nex";
- return TRUE;
+ return true;
}
else
{
// no weapon specific image for this weapon
- return FALSE;
+ return false;
}
}
}
- return FALSE;
+ return false;
}
#endif
#endif
mydmg *= charge;
myforce *= charge;
- W_SetupShot(self, TRUE, 5, "weapons/nexfire.wav", CH_WEAPON_A, mydmg);
+ W_SetupShot(self, true, 5, "weapons/nexfire.wav", CH_WEAPON_A, mydmg);
if(charge > WEP_CVAR(vortex, charge_animlimit) && WEP_CVAR(vortex, charge_animlimit)) // if the Vortex is overcharged, we play an extra sound
{
sound(self, CH_WEAPON_B, "weapons/nexcharge.wav", VOL_BASE * (charge - 0.5 * WEP_CVAR(vortex, charge_animlimit)) / (1 - 0.5 * WEP_CVAR(vortex, charge_animlimit)), ATTN_NORM);
{
case WR_AIM:
{
- if(bot_aim(1000000, 0, 1, FALSE))
- self.BUTTON_ATCK = TRUE;
+ if(bot_aim(1000000, 0, 1, false))
+ self.BUTTON_ATCK = true;
else
{
if(WEP_CVAR(vortex, charge))
- self.BUTTON_ATCK2 = TRUE;
+ self.BUTTON_ATCK2 = true;
}
- return TRUE;
+ return true;
}
case WR_THINK:
{
}
}
- return TRUE;
+ return true;
}
case WR_INIT:
{
precache_sound("weapons/nexwhoosh2.wav");
precache_sound("weapons/nexwhoosh3.wav");
VORTEX_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
- return TRUE;
+ return true;
}
case WR_CHECKAMMO1:
{
}
else
{
- return FALSE; // zoom is not a fire mode
+ return false; // zoom is not a fire mode
}
}
case WR_CONFIG:
{
VORTEX_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
- return TRUE;
+ return true;
}
case WR_RELOAD:
{
W_Reload(min(WEP_CVAR_PRI(vortex, ammo), WEP_CVAR_SEC(vortex, ammo)), "weapons/reload.wav");
- return TRUE;
+ return true;
}
case WR_SUICIDEMESSAGE:
{
return WEAPON_VORTEX_MURDER;
}
}
- return FALSE;
+ return false;
}
#endif
#ifdef CSQC
if(!w_issilent)
sound(self, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
- return TRUE;
+ return true;
}
case WR_INIT:
{
{
precache_pic("gfx/reticle_nex");
}
- return TRUE;
+ return true;
}
case WR_ZOOMRETICLE:
{
if(button_zoom || zoomscript_caught || (!WEP_CVAR(vortex, secondary) && button_attack2))
{
reticle_image = "gfx/reticle_nex";
- return TRUE;
+ return true;
}
else
{
// no weapon specific image for this weapon
- return FALSE;
+ return false;
}
}
}
- return FALSE;
+ return false;
}
#endif
#endif
void CSQCModel_InterpolateAnimation_Note(float sf)
{
#ifdef CSQCMODEL_HAVE_TWO_FRAMES
- CSQCModel_InterpolateAnimation_2To4_Note(sf, TRUE);
+ CSQCModel_InterpolateAnimation_2To4_Note(sf, true);
#else
- CSQCModel_InterpolateAnimation_1To2_Note(sf, TRUE);
+ CSQCModel_InterpolateAnimation_1To2_Note(sf, true);
#endif
}
o = self.origin;
v = v0;
csqcplayer_status = CSQCPLAYERSTATUS_PREDICTED;
- CSQCPlayer_PredictTo(servercommandframe + 1, FALSE);
+ CSQCPlayer_PredictTo(servercommandframe + 1, false);
CSQCPlayer_SetPredictionError(self.origin - o, self.velocity - v, pmove_onground - !!(self.pmove_flags & PMF_ONGROUND));
self.origin = o;
self.velocity = v;
CSQCPlayer_SavePrediction();
}
- CSQCPlayer_PredictTo(clientcommandframe + 1, TRUE);
+ CSQCPlayer_PredictTo(clientcommandframe + 1, true);
#ifdef CSQCMODEL_SERVERSIDE_CROUCH
// get crouch state from the server (LAG)
#undef CSQCMODEL_ENDIF
#undef CSQCMODEL_IF
- return TRUE;
+ return true;
}
#ifdef CSQCPLAYER_FORCE_UPDATES
//definitions that id Software left out:
//these are passed as the 'nomonsters' parameter to traceline/tracebox (yes really this was supported in all quake engines, nomonsters is misnamed)
-float MOVE_NORMAL = 0; // same as FALSE
-float MOVE_NOMONSTERS = 1; // same as TRUE
+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
//checkextension function
//// (it is recommended this code be placed in worldspawn or a worldspawn called function somewhere)
//if (cvar("pr_checkextension"))
//if (checkextension("DP_SV_SETCOLOR"))
-// ext_setcolor = TRUE;
+// ext_setcolor = true;
//from then on you can check ext_setcolor to know if that extension is available
//BX_WAL_SUPPORT
//for more format codes please do a web search for strftime 3 and you should find the man(3) pages for this standard C function.
//
//practical uses:
-//changing day/night cycle (shops closing, monsters going on the prowl) in an RPG, for this you probably want to use s = strftime(TRUE, "%H");hour = stof(s);
+//changing day/night cycle (shops closing, monsters going on the prowl) in an RPG, for this you probably want to use s = strftime(true, "%H");hour = stof(s);
//printing current date/time for competitive multiplayer games, such as the beginning/end of each round in real world time.
//activating eastereggs in singleplayer games on certain dates.
//
//field definitions:
.float() customizeentityforclient; // self = this entity, other = client entity
//description:
-//allows qc to modify an entity before it is sent to each client, the function returns TRUE if it should send, FALSE if it should not, and is fully capable of editing the entity's fields, this allows cloaked players to appear less transparent to their teammates, navigation markers to only show to their team, etc
+//allows qc to modify an entity before it is sent to each client, the function returns true if it should send, false if it should not, and is fully capable of editing the entity's fields, this allows cloaked players to appear less transparent to their teammates, navigation markers to only show to their team, etc
//tips on writing customize functions:
-//it is a good idea to return FALSE early in the function if possible to reduce cpu usage, because this function may be called many thousands of times per frame if there are many customized entities on a 64+ player server.
+//it is a good idea to return false early in the function if possible to reduce cpu usage, because this function may be called many thousands of times per frame if there are many customized entities on a 64+ player server.
//you are free to change anything in self, but please do not change any other entities (the results may be very inconsistent).
//example ideas for use of this extension:
//making icons over teammates' heads which are only visible to teammates. for exasmple: float() playericon_customizeentityforclient = {return self.owner.team == other.team;};
-//making cloaked players more visible to their teammates than their enemies. for example: float() player_customizeentityforclient = {if (self.items & IT_CLOAKING) {if (self.team == other.team) self.alpha = 0.6;else self.alpha = 0.1;} return TRUE;};
+//making cloaked players more visible to their teammates than their enemies. for example: float() player_customizeentityforclient = {if (self.items & IT_CLOAKING) {if (self.team == other.team) self.alpha = 0.6;else self.alpha = 0.1;} return true;};
//making explosion models that face the viewer (does not work well with chase_active). for example: float() explosion_customizeentityforclient = {self.angles = vectoangles(other.origin + other.view_ofs - self.origin);self.angles_x = 0 - self.angles_x;};
//implementation notes:
//entity customization is done before per-client culling (visibility for instance) because the entity may be doing setorigin to display itself in different locations on different clients, may be altering its .modelindex, .effects and other fields important to culling, so customized entities increase cpu usage (non-customized entities can use all the early culling they want however, as they are not changing on a per client basis).
//vector velocity
//short count
//byte color (palette color)
-//byte gravity (TRUE or FALSE, FIXME should this be a scaler instead?)
+//byte gravity (true or false, FIXME should this be a scaler instead?)
//coord randomvel (how much to jitter the velocity)
//description:
//creates a cloud of particles, useful for forcefields but quite customizable.
void() traceon = #29; // turns statment trace on
void() traceoff = #30;
void(entity e) eprint = #31; // prints an entire edict
-float(float yaw, float dist) walkmove = #32; // returns TRUE or FALSE
+float(float yaw, float dist) walkmove = #32; // returns true or false
// #33 was removed
-float() droptofloor= #34; // TRUE if landed on floor
+float() droptofloor= #34; // true if landed on floor
void(float style, string value) lightstyle = #35;
float(float v) rint = #36; // round to nearest int
float(float v) floor = #37; // largest integer <= v
ATTRIB(Animation, duration, float, 0)
ATTRIB(Animation, startValue, float, 0)
ATTRIB(Animation, delta, float, 0)
- ATTRIB(Animation, stopped, float, FALSE)
- ATTRIB(Animation, finished, float, FALSE)
+ ATTRIB(Animation, stopped, float, false)
+ ATTRIB(Animation, finished, float, false)
ENDCLASS(Animation)
void setterDummy(entity, float);
#endif
void Animation_stopAnim(entity me)
{
- me.stopped = TRUE;
+ me.stopped = true;
}
void Animation_resumeAnim(entity me)
{
- me.stopped = FALSE;
+ me.stopped = false;
}
float Animation_isFinished(entity me)
void Animation_finishAnim(entity me)
{
me.value = me.delta + me.startValue;
- me.finished = TRUE;
+ me.finished = true;
me.setter(me.object, me.value);
}
float draw_TextWidth_WithColors(string s, vector theFontSize)
{
- return draw_TextWidth(s, TRUE, theFontSize);
+ return draw_TextWidth(s, true, theFontSize);
}
float draw_TextWidth_WithoutColors(string s, vector theFontSize)
{
- return draw_TextWidth(s, FALSE, theFontSize);
+ return draw_TextWidth(s, false, theFontSize);
}
float draw_TextLengthUpToWidth(string theText, float maxWidth, float allowColorCodes, vector theFontSize)
ATTRIB(Dialog, zoomedOutTitleBarPosition, float, 0)
ATTRIB(Dialog, zoomedOutTitleBar, float, 0)
- ATTRIB(Dialog, requiresConnection, float, 0) // set to TRUE if the dialog requires a connection to be opened
+ ATTRIB(Dialog, requiresConnection, float, 0) // set to true if the dialog requires a connection to be opened
ATTRIB(Dialog, backgroundImage, string, string_null)
ATTRIB(Dialog, borderLines, float, 1)
}
fclose(fh);
- glob = search_begin(strcat(draw_currentSkin, "/*.tga"), TRUE, TRUE);
+ glob = search_begin(strcat(draw_currentSkin, "/*.tga"), true, true);
if(glob >= 0)
{
n = search_getsize(glob);
{
if(pos.x >= menuTooltipOrigin.x && pos.x < menuTooltipOrigin.x + menuTooltipSize.x)
if(pos.y >= menuTooltipOrigin.y && pos.y < menuTooltipOrigin.y + menuTooltipSize.y)
- return FALSE;
- return TRUE;
+ return false;
+ return true;
}
float m_testtooltipbox(vector tooltippos)
{
if(tooltippos.x < 0)
- return FALSE;
+ return false;
if(tooltippos.y < 0)
- return FALSE;
+ return false;
if(tooltippos.x + menuTooltipSize.x > 1)
- return FALSE;
+ return false;
if(tooltippos.y + menuTooltipSize.y > 1)
- return FALSE;
+ return false;
menuTooltipOrigin = tooltippos;
- return TRUE;
+ return true;
}
float m_allocatetooltipbox(vector pos)
{
// bottom right
v = pos + avoidplus;
if(m_testtooltipbox(v))
- return TRUE;
+ return true;
// bottom center
v_x = pos.x - menuTooltipSize.x * 0.5;
if(m_testtooltipbox(v))
- return TRUE;
+ return true;
// bottom left
v_x = pos.x - avoidminus.x;
if(m_testtooltipbox(v))
- return TRUE;
+ return true;
// top left
v_y = pos.y - avoidminus.y;
if(m_testtooltipbox(v))
- return TRUE;
+ return true;
// top center
v_x = pos.x - menuTooltipSize.x * 0.5;
if(m_testtooltipbox(v))
- return TRUE;
+ return true;
// top right
v_x = pos.x + avoidplus.x;
if(m_testtooltipbox(v))
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
entity m_findtooltipitem(entity root, vector pos)
{
{
s = getWrappedLine(SKINWIDTH_TOOLTIP, fontsize, draw_TextWidth_WithoutColors);
++i;
- f = draw_TextWidth(s, FALSE, fontsize);
+ f = draw_TextWidth(s, false, fontsize);
if(f > w)
w = f;
}
while(getWrappedLine_remaining)
{
s = getWrappedLine(SKINWIDTH_TOOLTIP, fontsize, draw_TextWidth_WithoutColors);
- draw_Text(p, s, fontsize, SKINCOLOR_TOOLTIP, SKINALPHA_TOOLTIP * menuTooltipAlpha, FALSE);
+ draw_Text(p, s, fontsize, SKINCOLOR_TOOLTIP, SKINALPHA_TOOLTIP * menuTooltipAlpha, false);
p.y += fontsize.y;
}
}
{
draw_reset_full();
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_BACKGROUND, 1);
- drawBackground(SKINGFX_BACKGROUND, bound(0, menuLogoAlpha, 1), SKINALIGN_BACKGROUND, TRUE);
+ drawBackground(SKINGFX_BACKGROUND, bound(0, menuLogoAlpha, 1), SKINALIGN_BACKGROUND, true);
draw_reset_cropped();
if(menuAlpha <= 0 && SKINALPHA_CURSOR_INTRO > 0)
{
if(menuAlpha > 0)
{
draw_reset_full();
- drawBackground(SKINGFX_BACKGROUND_INGAME, menuAlpha * SKINALPHA_BACKGROUND_INGAME, SKINALIGN_BACKGROUND_INGAME, FALSE);
+ drawBackground(SKINGFX_BACKGROUND_INGAME, menuAlpha * SKINALPHA_BACKGROUND_INGAME, SKINALIGN_BACKGROUND_INGAME, false);
draw_reset_cropped();
}
}
void XonoticCampaignList_configureXonoticCampaignList(entity me)
{
me.configureXonoticListBox(me);
- me.campaignGlob = search_begin("maps/campaign*.txt", TRUE, TRUE);
+ me.campaignGlob = search_begin("maps/campaign*.txt", true, true);
me.loadCvars(me);
me.campaignGo(me, 0); // takes care of enabling/disabling buttons too
}
return s;
}
-// if subdir is TRUE look in subdirectories too (1 level)
+// if subdir is true look in subdirectories too (1 level)
void getDemos_for_ext(entity me, string ext, float subdir)
{
string s;
s=strcat(s, "*", ext);
float list, i, n;
- list = search_begin(s, FALSE, TRUE);
+ list = search_begin(s, false, true);
if(list >= 0)
{
n = search_getsize(list);
{
s = strreplace("/", "^7/", s); // clear colors at the forward slash
s = strcat("/", rgb_to_hexcolor(SKINCOLOR_DEMOLIST_SUBDIR), s); // add a forward slash for sorting, then color
- bufstr_add(me.listDemo, s, TRUE);
+ bufstr_add(me.listDemo, s, true);
}
- else { bufstr_add(me.listDemo, s, TRUE); }
+ else { bufstr_add(me.listDemo, s, true); }
}
search_end(list);
}
if (subdir)
- getDemos_for_ext(me, ext, FALSE);
+ getDemos_for_ext(me, ext, false);
}
void XonoticDemoList_getDemos(entity me)
me.nItems = 0;
return;
}
- getDemos_for_ext(me, ".dem", TRUE);
+ getDemos_for_ext(me, ".dem", true);
me.nItems = buf_getsize(me.listDemo);
if(me.nItems > 0)
- buf_sort(me.listDemo, 128, FALSE);
+ buf_sort(me.listDemo, 128, false);
}
void XonoticDemoList_destroy(entity me)
ATTRIB(XonoticHUDAmmoDialog, rows, float, 15)
ATTRIB(XonoticHUDAmmoDialog, columns, float, 4)
ATTRIB(XonoticHUDAmmoDialog, name, string, "HUDammo")
- ATTRIB(XonoticHUDAmmoDialog, requiresConnection, float, TRUE)
+ ATTRIB(XonoticHUDAmmoDialog, requiresConnection, float, true)
ENDCLASS(XonoticHUDAmmoDialog)
#endif
ATTRIB(XonoticHUDBuffsDialog, rows, float, 15)
ATTRIB(XonoticHUDBuffsDialog, columns, float, 4)
ATTRIB(XonoticHUDBuffsDialog, name, string, "HUDbuffs")
- ATTRIB(XonoticHUDBuffsDialog, requiresConnection, float, TRUE)
+ ATTRIB(XonoticHUDBuffsDialog, requiresConnection, float, true)
ENDCLASS(XonoticHUDBuffsDialog)
#endif
ATTRIB(XonoticHUDCenterprintDialog, rows, float, 15)
ATTRIB(XonoticHUDCenterprintDialog, columns, float, 4)
ATTRIB(XonoticHUDCenterprintDialog, name, string, "HUDcenterprint")
- ATTRIB(XonoticHUDCenterprintDialog, requiresConnection, float, TRUE)
+ ATTRIB(XonoticHUDCenterprintDialog, requiresConnection, float, true)
ENDCLASS(XonoticHUDCenterprintDialog)
#endif
ATTRIB(XonoticHUDChatDialog, rows, float, 15)
ATTRIB(XonoticHUDChatDialog, columns, float, 4)
ATTRIB(XonoticHUDChatDialog, name, string, "HUDchat")
- ATTRIB(XonoticHUDChatDialog, requiresConnection, float, TRUE)
+ ATTRIB(XonoticHUDChatDialog, requiresConnection, float, true)
ENDCLASS(XonoticHUDChatDialog)
#endif
ATTRIB(XonoticHUDEngineInfoDialog, rows, float, 15)
ATTRIB(XonoticHUDEngineInfoDialog, columns, float, 4)
ATTRIB(XonoticHUDEngineInfoDialog, name, string, "HUDengineinfo")
- ATTRIB(XonoticHUDEngineInfoDialog, requiresConnection, float, TRUE)
+ ATTRIB(XonoticHUDEngineInfoDialog, requiresConnection, float, true)
ENDCLASS(XonoticHUDEngineInfoDialog)
#endif
ATTRIB(XonoticHUDHealthArmorDialog, rows, float, 15)
ATTRIB(XonoticHUDHealthArmorDialog, columns, float, 4)
ATTRIB(XonoticHUDHealthArmorDialog, name, string, "HUDhealtharmor")
- ATTRIB(XonoticHUDHealthArmorDialog, requiresConnection, float, TRUE)
+ ATTRIB(XonoticHUDHealthArmorDialog, requiresConnection, float, true)
ENDCLASS(XonoticHUDHealthArmorDialog)
#endif
ATTRIB(XonoticHUDInfoMessagesDialog, rows, float, 15)
ATTRIB(XonoticHUDInfoMessagesDialog, columns, float, 4)
ATTRIB(XonoticHUDInfoMessagesDialog, name, string, "HUDinfomessages")
- ATTRIB(XonoticHUDInfoMessagesDialog, requiresConnection, float, TRUE)
+ ATTRIB(XonoticHUDInfoMessagesDialog, requiresConnection, float, true)
ENDCLASS(XonoticHUDInfoMessagesDialog)
#endif
ATTRIB(XonoticHUDModIconsDialog, rows, float, 15)
ATTRIB(XonoticHUDModIconsDialog, columns, float, 4)
ATTRIB(XonoticHUDModIconsDialog, name, string, "HUDmodicons")
- ATTRIB(XonoticHUDModIconsDialog, requiresConnection, float, TRUE)
+ ATTRIB(XonoticHUDModIconsDialog, requiresConnection, float, true)
ENDCLASS(XonoticHUDModIconsDialog)
#endif
ATTRIB(XonoticHUDNotificationDialog, rows, float, 15)
ATTRIB(XonoticHUDNotificationDialog, columns, float, 4)
ATTRIB(XonoticHUDNotificationDialog, name, string, "HUDnotify")
- ATTRIB(XonoticHUDNotificationDialog, requiresConnection, float, TRUE)
+ ATTRIB(XonoticHUDNotificationDialog, requiresConnection, float, true)
ENDCLASS(XonoticHUDNotificationDialog)
#endif
ATTRIB(XonoticHUDPhysicsDialog, columns, float, 4)
ATTRIB(XonoticHUDPhysicsDialog, name, string, "HUDphysics")
ATTRIB(XonoticHUDPhysicsDialog, sliderTopspeedTime, entity, NULL)
- ATTRIB(XonoticHUDPhysicsDialog, requiresConnection, float, TRUE)
+ ATTRIB(XonoticHUDPhysicsDialog, requiresConnection, float, true)
ENDCLASS(XonoticHUDPhysicsDialog)
#endif
ATTRIB(XonoticHUDPowerupsDialog, rows, float, 15)
ATTRIB(XonoticHUDPowerupsDialog, columns, float, 4)
ATTRIB(XonoticHUDPowerupsDialog, name, string, "HUDpowerups")
- ATTRIB(XonoticHUDPowerupsDialog, requiresConnection, float, TRUE)
+ ATTRIB(XonoticHUDPowerupsDialog, requiresConnection, float, true)
ENDCLASS(XonoticHUDPowerupsDialog)
#endif
ATTRIB(XonoticHUDPressedKeysDialog, rows, float, 15)
ATTRIB(XonoticHUDPressedKeysDialog, columns, float, 4)
ATTRIB(XonoticHUDPressedKeysDialog, name, string, "HUDpressedkeys")
- ATTRIB(XonoticHUDPressedKeysDialog, requiresConnection, float, TRUE)
+ ATTRIB(XonoticHUDPressedKeysDialog, requiresConnection, float, true)
ENDCLASS(XonoticHUDPressedKeysDialog)
#endif
ATTRIB(XonoticHUDRaceTimerDialog, rows, float, 15)
ATTRIB(XonoticHUDRaceTimerDialog, columns, float, 4)
ATTRIB(XonoticHUDRaceTimerDialog, name, string, "HUDracetimer")
- ATTRIB(XonoticHUDRaceTimerDialog, requiresConnection, float, TRUE)
+ ATTRIB(XonoticHUDRaceTimerDialog, requiresConnection, float, true)
ENDCLASS(XonoticHUDRaceTimerDialog)
#endif
ATTRIB(XonoticHUDRadarDialog, rows, float, 15)
ATTRIB(XonoticHUDRadarDialog, columns, float, 4)
ATTRIB(XonoticHUDRadarDialog, name, string, "HUDradar")
- ATTRIB(XonoticHUDRadarDialog, requiresConnection, float, TRUE)
+ ATTRIB(XonoticHUDRadarDialog, requiresConnection, float, true)
ENDCLASS(XonoticHUDRadarDialog)
#endif
ATTRIB(XonoticHUDScoreDialog, rows, float, 15)
ATTRIB(XonoticHUDScoreDialog, columns, float, 4)
ATTRIB(XonoticHUDScoreDialog, name, string, "HUDscore")
- ATTRIB(XonoticHUDScoreDialog, requiresConnection, float, TRUE)
+ ATTRIB(XonoticHUDScoreDialog, requiresConnection, float, true)
ENDCLASS(XonoticHUDScoreDialog)
#endif
ATTRIB(XonoticHUDTimerDialog, rows, float, 15)
ATTRIB(XonoticHUDTimerDialog, columns, float, 4)
ATTRIB(XonoticHUDTimerDialog, name, string, "HUDtimer")
- ATTRIB(XonoticHUDTimerDialog, requiresConnection, float, TRUE)
+ ATTRIB(XonoticHUDTimerDialog, requiresConnection, float, true)
ENDCLASS(XonoticHUDTimerDialog)
#endif
ATTRIB(XonoticHUDVoteDialog, rows, float, 15)
ATTRIB(XonoticHUDVoteDialog, columns, float, 4)
ATTRIB(XonoticHUDVoteDialog, name, string, "HUDvote")
- ATTRIB(XonoticHUDVoteDialog, requiresConnection, float, TRUE)
+ ATTRIB(XonoticHUDVoteDialog, requiresConnection, float, true)
ENDCLASS(XonoticHUDVoteDialog)
#endif
ATTRIB(XonoticHUDWeaponsDialog, rows, float, 19)
ATTRIB(XonoticHUDWeaponsDialog, columns, float, 4)
ATTRIB(XonoticHUDWeaponsDialog, name, string, "HUDweapons")
- ATTRIB(XonoticHUDWeaponsDialog, requiresConnection, float, TRUE)
+ ATTRIB(XonoticHUDWeaponsDialog, requiresConnection, float, true)
ENDCLASS(XonoticHUDWeaponsDialog)
#endif
ATTRIB(XonoticHUDExitDialog, rows, float, 18)
ATTRIB(XonoticHUDExitDialog, columns, float, 4)
ATTRIB(XonoticHUDExitDialog, name, string, "HUDExit")
- ATTRIB(XonoticHUDExitDialog, requiresConnection, float, TRUE)
+ ATTRIB(XonoticHUDExitDialog, requiresConnection, float, true)
ENDCLASS(XonoticHUDExitDialog)
#endif
{
e.configureXonoticTextSlider(e, string_null);
l.setText(l, pLabel);
- e.disabled = l.disabled = TRUE;
+ e.disabled = l.disabled = true;
}
else
{
// set text field
l.setText(l, pLabel);
- e.disabled = l.disabled = FALSE;
+ e.disabled = l.disabled = false;
}
}
me.TD(me, 1, 2, e = makeXonoticRadioButton(1, string_null, string_null, _("Regular (no arena)")));
me.TR(me);
me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "g_weaponarena", "menu_weaponarena", _("Weapon arenas:")));
- e.getCvarValueFromCvar = TRUE;
+ e.getCvarValueFromCvar = true;
e.cvarOffValue = "0";
for(i = WEP_FIRST, j = 0; i <= WEP_LAST; ++i)
{
}
void increaseZoom_Click(entity btn, entity me)
{
- me.screenshotImage.setZoom(me.screenshotImage, -2, FALSE);
+ me.screenshotImage.setZoom(me.screenshotImage, -2, false);
}
void decreaseZoom_Click(entity btn, entity me)
{
- me.screenshotImage.setZoom(me.screenshotImage, -1/2, FALSE);
+ me.screenshotImage.setZoom(me.screenshotImage, -1/2, false);
}
void resetZoom_Click(entity btn, entity me)
{
- me.screenshotImage.setZoom(me.screenshotImage, 0, FALSE);
+ me.screenshotImage.setZoom(me.screenshotImage, 0, false);
}
void toggleSlideShow_Click(entity btn, entity me)
{
label.allowCut = 1;
label.allowColors = 1;
label.alpha = 1;
- label.isBold = TRUE;
+ label.isBold = true;
label.fontSize = SKINFONTSIZE_TITLE;
me.gotoRC(me, 2.5, 0);
ATTRIB(XonoticSandboxToolsDialog, rows, float, 16)
ATTRIB(XonoticSandboxToolsDialog, columns, float, 4)
ATTRIB(XonoticSandboxToolsDialog, name, string, "SandboxTools")
- ATTRIB(XonoticSandboxToolsDialog, requiresConnection, float, TRUE)
+ ATTRIB(XonoticSandboxToolsDialog, requiresConnection, float, true)
ENDCLASS(XonoticSandboxToolsDialog)
#endif
me.TR(me);
me.TR(me);
me.TD(me, 1, 3, makeXonoticCheckBox(0, "cl_hitsound", _("Hit indication sound")));
- e.sendCvars = TRUE;
+ e.sendCvars = true;
me.TR(me);
me.TD(me, 1, 3, makeXonoticCheckBox(0, "con_chatsound", _("Chat message sound")));
me.TR(me);
e.addValue(e, _("Often"), "0.65");
e.addValue(e, _("Always"), "1");
e.configureXonoticTextSliderValues(e);
- e.sendCvars = TRUE;
+ e.sendCvars = true;
me.TR(me);
me.TR(me);
if(cvar("developer"))
{
if(cvar("r_shadow_realtime_dlight"))
if(cvar("r_shadow_realtime_dlight_shadows"))
- return TRUE;
+ return true;
if(cvar("r_shadow_realtime_world"))
if(cvar("r_shadow_realtime_world_shadows"))
- return TRUE;
- return FALSE;
+ return true;
+ return false;
}
void XonoticEffectsSettingsTab_fill(entity me)
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 1, "notification_CHOICE_FRAG", _("Add extra frag information to centerprint when available")));
makeMulti(e, "notification_CHOICE_FRAGGED notification_CHOICE_TYPEFRAG notification_CHOICE_TYPEFRAGGED");
- e.sendCvars = TRUE;
+ e.sendCvars = true;
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "notification_show_location", _("Add frag location to death messages when available")));
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 1, "notification_CHOICE_CTF_CAPTURE_TIME_RED", _("Display capture times in Capture The Flag")));
makeMulti(e, "notification_CHOICE_CTF_CAPTURE_TIME_BLUE notification_CHOICE_CTF_CAPTURE_BROKEN_RED notification_CHOICE_CTF_CAPTURE_BROKEN_BLUE notification_CHOICE_CTF_CAPTURE_UNBROKEN_RED notification_CHOICE_CTF_CAPTURE_UNBROKEN_BLUE ");
- e.sendCvars = TRUE;
+ e.sendCvars = true;
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 1, "notification_CHOICE_CTF_PICKUP_ENEMY", _("Display name of flag stealer in Capture The Flag")));
makeMulti(e, "notification_CHOICE_CTF_PICKUP_TEAM");
- e.sendCvars = TRUE;
+ e.sendCvars = true;
me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Other")));
me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "con_closeontoggleconsole", _("Pressing \"enter console\" key also closes it")));
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_movement_track_canjump", _("Automatically repeat jumping if holding jump")));
- e.sendCvars = TRUE;
+ e.sendCvars = true;
me.TR(me);
me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Jetpack on jump:")));
me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_jetpack_jump"));
e.addValue(e, _("Air only"), "1");
e.addValue(e, _("All"), "2");
e.configureXonoticTextSliderValues(e);
- e.sendCvars = TRUE;
+ e.sendCvars = true;
me.TR(me);
if(cvar_type("joy_enable") & CVAR_TYPEFLAG_ENGINE)
{
ATTRIB(XonoticTeamSelectDialog, team2, entity, NULL)
ATTRIB(XonoticTeamSelectDialog, team3, entity, NULL)
ATTRIB(XonoticTeamSelectDialog, team4, entity, NULL)
- ATTRIB(XonoticTeamSelectDialog, requiresConnection, float, TRUE)
+ ATTRIB(XonoticTeamSelectDialog, requiresConnection, float, true)
ENDCLASS(XonoticTeamSelectDialog)
#endif
s2 = _("free for all");
vector save_fontscale = draw_fontscale;
- float f = draw_CondensedFontFactor(strcat(s1, " ", s2), FALSE, me.realFontSize, 1);
+ float f = draw_CondensedFontFactor(strcat(s1, " ", s2), false, me.realFontSize, 1);
draw_fontscale.x *= f;
vector fs = me.realFontSize;
fs.x *= f;
s = me.languageParameter(me, i, LANGPARM_NAME_LOCALIZED);
vector save_fontscale = draw_fontscale;
- float f = draw_CondensedFontFactor(s, FALSE, me.realFontSize, 1);
+ float f = draw_CondensedFontFactor(s, false, me.realFontSize, 1);
draw_fontscale.x *= f;
vector fs = me.realFontSize;
fs.x *= f;
if(p != "")
{
vector save_fontscale = draw_fontscale;
- float f = draw_CondensedFontFactor(p, FALSE, me.realFontSize, 1);
+ float f = draw_CondensedFontFactor(p, false, me.realFontSize, 1);
draw_fontscale.x *= f;
vector fs = me.realFontSize;
fs.x *= f;
float sortbuf, glob, i;
string fn;
- glob = search_begin(language_filename(get_model_datafilename(string_null, -1, "txt")), TRUE, TRUE);
+ glob = search_begin(language_filename(get_model_datafilename(string_null, -1, "txt")), true, true);
if (glob < 0)
return;
if (me.numModels <= 0)
{
- draw_CenterText('0.5 0.5 0', _("<no model found>"), me.realFontSize, SKINCOLOR_TEXT, 0.6, FALSE);
+ draw_CenterText('0.5 0.5 0', _("<no model found>"), me.realFontSize, SKINCOLOR_TEXT, 0.6, false);
return;
}
draw_beginBoldFont();
#if XONVOTE186 // (nyov) lower name display looks better when there is no description text
- draw_CenterText('0.5 0.8 0', me.currentModelTitle, me.realFontSize * (me.titleFontSize / me.fontSize), SKINCOLOR_MODELTITLE, SKINALPHA_MODELTITLE, FALSE);
+ draw_CenterText('0.5 0.8 0', me.currentModelTitle, me.realFontSize * (me.titleFontSize / me.fontSize), SKINCOLOR_MODELTITLE, SKINALPHA_MODELTITLE, false);
#else
- draw_CenterText('0.5 0 0', me.currentModelTitle, me.realFontSize * (me.titleFontSize / me.fontSize), SKINCOLOR_MODELTITLE, SKINALPHA_MODELTITLE, FALSE);
+ draw_CenterText('0.5 0 0', me.currentModelTitle, me.realFontSize * (me.titleFontSize / me.fontSize), SKINCOLOR_MODELTITLE, SKINALPHA_MODELTITLE, false);
#endif
draw_endBoldFont();
o = '0.5 1 0' - eY * me.realFontSize.y * ((n = tokenizebyseparator(me.currentModelDescription, "\n")) + 0.5);
for(i = 0; i < n; ++i)
{
- draw_CenterText(o, argv(i), me.realFontSize, SKINCOLOR_TEXT, 1, FALSE);
+ draw_CenterText(o, argv(i), me.realFontSize, SKINCOLOR_TEXT, 1, false);
o += eY * me.realFontSize.y;
}
}
void XonoticPlayList_removeSelectedFromPlayList(entity me)
{
- float i, cpt = FALSE;
+ float i, cpt = false;
string s = "";
me.nItems = tokenize_console(cvar_string("music_playlist_list0"));
if(me.nItems == 0)
if(cvar("music_playlist_index") == 0 || cvar("music_playlist_index") == 999)
{
if(cvar("music_playlist_current0") == i)
- cpt = TRUE; // current playing track (we can't start next track here because startSound calls tokenize_console)
+ cpt = true; // current playing track (we can't start next track here because startSound calls tokenize_console)
else if(cvar("music_playlist_current0") > i)
cvar_set("music_playlist_current0", ftos(cvar("music_playlist_current0") - 1));
}
void XonoticScreenshotImage_configureXonoticScreenshotImage(entity me)
{
me.configureXonoticImage(me, string_null, -2);
- me.zoomLimitedByTheBox = FALSE; // enable this to forbid enlarging the image more than the containing box (if making use of draw_SetClip is a too bad thing)
- me.zoomSnapToTheBox = FALSE; // disabled: it's cooler
+ me.zoomLimitedByTheBox = false; // enable this to forbid enlarging the image more than the containing box (if making use of draw_SetClip is a too bad thing)
+ me.zoomSnapToTheBox = false; // disabled: it's cooler
}
void XonoticScreenshotImage_load(entity me, string theImage)
if (me.showTitle && time < me.screenshotTime + 4) // 3 seconds at full alpha, 1 second fading out
{
theAlpha = (4 - (time - me.screenshotTime));
- draw_CenterText('0.5 0 0', me.screenshotTitle, me.realFontSize, '1 1 1', theAlpha, FALSE);
+ draw_CenterText('0.5 0 0', me.screenshotTitle, me.realFontSize, '1 1 1', theAlpha, false);
}
if (time < me.zoomTime + 2) // 1 seconds at full alpha, 1 second fading out
{
else
zoomString = sprintf("%.2f%%", z);
theAlpha = (2 - (time - me.zoomTime));
- draw_Text('0.05 0.95 0', zoomString, me.realFontSize, '1 1 1', theAlpha, FALSE);
+ draw_Text('0.05 0.95 0', zoomString, me.realFontSize, '1 1 1', theAlpha, false);
}
}
}
return s;
}
-// if subdir is TRUE look in subdirectories too (1 level)
+// if subdir is true look in subdirectories too (1 level)
void getScreenshots_for_ext(entity me, string ext, float subdir)
{
string s;
s=strcat(s, "*", ext);
float list, i, n;
- list = search_begin(s, FALSE, TRUE);
+ list = search_begin(s, false, true);
if(list >= 0)
{
n = search_getsize(list);
{
s = strreplace("/", "^7/", s); // clear colors at the forward slash
s = strcat("/", rgb_to_hexcolor(SKINCOLOR_SCREENSHOTLIST_SUBDIR), s); // add a forward slash for sorting, then color
- bufstr_add(me.listScreenshot, s, TRUE);
+ bufstr_add(me.listScreenshot, s, true);
}
- else { bufstr_add(me.listScreenshot, s, TRUE); }
+ else { bufstr_add(me.listScreenshot, s, true); }
}
search_end(list);
}
if (subdir)
- getScreenshots_for_ext(me, ext, FALSE);
+ getScreenshots_for_ext(me, ext, false);
}
void XonoticScreenshotList_getScreenshots(entity me)
me.nItems = 0;
return;
}
- getScreenshots_for_ext(me, ".jpg", TRUE);
- getScreenshots_for_ext(me, ".tga", TRUE);
- getScreenshots_for_ext(me, ".png", TRUE);
+ getScreenshots_for_ext(me, ".jpg", true);
+ getScreenshots_for_ext(me, ".tga", true);
+ getScreenshots_for_ext(me, ".png", true);
me.nItems = buf_getsize(me.listScreenshot);
if(me.nItems > 0)
- buf_sort(me.listScreenshot, 128, FALSE);
+ buf_sort(me.listScreenshot, 128, false);
}
void XonoticScreenshotList_destroy(entity me)
string p;
float i, n;
if(srv == "")
- return FALSE;
+ return false;
srv = netaddress_resolve(srv, 26000);
if(srv == "")
- return FALSE;
+ return false;
p = crypto_getidfp(srv);
n = tokenize_console(list);
for(i = 0; i < n; ++i)
{
if(p)
if(argv(i) == p)
- return TRUE;
+ return true;
}
else
{
if(srv == netaddress_resolve(argv(i), 26000))
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
float CheckCategoryOverride(float cat)
string s;
buf = buf_create();
- glob = search_begin("gfx/menu/*/skinvalues.txt", TRUE, TRUE);
+ glob = search_begin("gfx/menu/*/skinvalues.txt", true, true);
if(glob < 0)
{
me.skinlist = buf;
c_y = rint(c.y);
// Please reload resolutions list and such stuff.
- XonoticResolutionSlider_DataHasChanged = TRUE;
+ XonoticResolutionSlider_DataHasChanged = true;
if (c.x != cvar("vid_conwidth") || c.y != cvar("vid_conheight"))
{
if (cvar("vid_fullscreen") != me.vid_fullscreen)
{
me.loadResolutions(me, cvar("vid_fullscreen"));
- XonoticResolutionSlider_DataHasChanged = TRUE;
+ XonoticResolutionSlider_DataHasChanged = true;
}
if (XonoticResolutionSlider_DataHasChanged)
{
- XonoticResolutionSlider_DataHasChanged = FALSE;
+ XonoticResolutionSlider_DataHasChanged = false;
me.loadCvars(me);
}
SUPER(XonoticResolutionSlider).draw(me);
if(me.listSound >= 0)
search_end(me.listSound);
- me.listSound = search_begin(s, FALSE, TRUE);
+ me.listSound = search_begin(s, false, true);
if(me.listSound < 0)
me.nItems=0;
if((order == -1) && (out_total_matches >= 0) && (out_total_wins >= 0))
{
- bufstr_add(me.listStats, sprintf("003Matches: %d", out_total_matches), TRUE);
+ bufstr_add(me.listStats, sprintf("003Matches: %d", out_total_matches), true);
if(out_total_matches > 0) // don't show extra info if there are no matches played
{
out_total_losses = max(0, (out_total_matches - out_total_wins));
- bufstr_add(me.listStats, sprintf("003Wins/Losses: %d/%d", out_total_wins, out_total_losses), TRUE);
- bufstr_add(me.listStats, sprintf("004Win_Percentage: %d%%", ((out_total_wins / out_total_matches) * 100)), TRUE);
+ bufstr_add(me.listStats, sprintf("003Wins/Losses: %d/%d", out_total_wins, out_total_losses), true);
+ bufstr_add(me.listStats, sprintf("004Win_Percentage: %d%%", ((out_total_wins / out_total_matches) * 100)), true);
}
out_total_matches = -1;
if((order == -1) && (out_total_kills >= 0) && (out_total_deaths >= 0))
{
- bufstr_add(me.listStats, sprintf("005Kills/Deaths: %d/%d", out_total_kills, out_total_deaths), TRUE);
+ bufstr_add(me.listStats, sprintf("005Kills/Deaths: %d/%d", out_total_kills, out_total_deaths), true);
// if there are no deaths, just show kill count
if(out_total_deaths > 0)
- bufstr_add(me.listStats, sprintf("006Kill_Ratio: %.2f", (out_total_kills / out_total_deaths)), TRUE);
+ bufstr_add(me.listStats, sprintf("006Kill_Ratio: %.2f", (out_total_kills / out_total_deaths)), true);
else
- bufstr_add(me.listStats, sprintf("006Kill_Ratio: %.2f", out_total_kills), TRUE);
+ bufstr_add(me.listStats, sprintf("006Kill_Ratio: %.2f", out_total_kills), true);
out_total_kills = -1;
out_total_deaths = -1;
else { continue; }
}
- bufstr_add(me.listStats, sprintf("%s%s %s", orderstr, outstr, data), TRUE);
+ bufstr_add(me.listStats, sprintf("%s%s %s", orderstr, outstr, data), true);
}
me.nItems = buf_getsize(me.listStats);
if(me.nItems > 0)
- buf_sort(me.listStats, 128, FALSE);
+ buf_sort(me.listStats, 128, false);
}
void XonoticStatsList_destroy(entity me)
me = makeXonoticTextLabel(0.5, theText);
me.colorL = SKINCOLOR_HEADER;
me.alpha = SKINALPHA_HEADER;
- me.isBold = TRUE;
+ me.isBold = true;
return me;
}
void XonoticTextLabel_configureXonoticTextLabel(entity me, float theAlign, string theText)
{
if(un_compatexpire != "")
{
- string curdate = strftime(FALSE, "%Y%m%d%H%M%S");
+ string curdate = strftime(false, "%Y%m%d%H%M%S");
if (strcmp(curdate, un_compatexpire) >= 0)
DisableServerBackwardsCompatibility();
}
float n, i;
float allgood;
n = tokenize_console(_Nex_ExtResponseSystem_Packs);
- allgood = TRUE;
+ allgood = true;
for(i = 0; i+1 < n; i += 2)
{
if(fexists(argv(i+1)))
continue;
- allgood = FALSE;
+ allgood = false;
if(_Nex_ExtResponseSystem_PacksStep == 1) // first run
localcmd("\ncurl --pak \"", argv(i), "\"\n");
}
boxB_x = boxA_x * (1 - MapInfo_progress) + boxB_x * MapInfo_progress;
draw_Fill(boxA, boxB - boxA, '0 0 1', 1);
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
string campaign_name_previous;
void XonoticWeaponarenaCheckBox_configureXonoticWeaponarenaCheckBox(entity me, string theWeapon, string theText)
{
me.netname = theWeapon;
- me.checked = FALSE;
+ me.checked = false;
me.loadCvars(me);
me.configureCheckBox(me, theText, me.fontSize, me.image);
}
{
if(argv(i) == me.netname)
{
- me.checked = TRUE;
+ me.checked = true;
break;
}
}
msg = sprintf(_("%s (mutator weapon)"), msg);
vector save_fontscale = draw_fontscale;
- float f = draw_CondensedFontFactor(msg, FALSE, me.realFontSize, 1);
+ float f = draw_CondensedFontFactor(msg, false, me.realFontSize, 1);
draw_fontscale.x *= f;
vector fs = me.realFontSize;
fs.x *= f;
e.antilag_saved_origin = e.origin;
setorigin(e, antilag_takebackorigin(e, t));
- e.antilag_takenback = TRUE;
+ e.antilag_takenback = true;
}
void antilag_restore(entity e)
return;
setorigin(e, e.antilag_saved_origin);
- e.antilag_takenback = FALSE;
+ e.antilag_takenback = false;
}
void antilag_clear(entity e)
entity ka_ball;
// traces multiple trajectories to find one that will impact the target
// 'end' vector is the place it aims for,
-// returns TRUE only if it hit targ (don't target non-solid entities)
+// returns true only if it hit targ (don't target non-solid entities)
float findtrajectorywithleading(vector org, vector m1, vector m2, entity targ, float shotspeed, float shotspeedupward, float maxtime, float shotdelay, entity ignore)
{
float c, savesolid, shottime;
vector dir, end, v, o;
if (shotspeed < 1)
- return FALSE; // could cause division by zero if calculated
+ return false; // could cause division by zero if calculated
if (targ.solid < SOLID_BBOX) // SOLID_NOT and SOLID_TRIGGER
- return FALSE; // could never hit it
+ return false; // could never hit it
if (!tracetossent)
tracetossent = spawn();
tracetossent.owner = ignore;
o = (targ.absmin + targ.absmax) * 0.5;
shottime = ((vlen(o - org) / shotspeed) + shotdelay);
v = targ.velocity * shottime + o;
- tracebox(o, targ.mins, targ.maxs, v, FALSE, targ);
+ tracebox(o, targ.mins, targ.maxs, v, false, targ);
v = trace_endpos;
end = v + (targ.mins + targ.maxs) * 0.5;
if ((vlen(end - org) / shotspeed + 0.2) > maxtime)
{
// out of range
targ.solid = savesolid;
- return FALSE;
+ return false;
}
if (!tracetossfaketarget)
// relink to remove it from physics considerations
setorigin(tracetossfaketarget, v);
- return TRUE;
+ return true;
}
dir_z = dir.z + 0.1; // aim up a little more
c = c + 1;
// leave a valid one even if it won't reach
findtrajectory_velocity = normalize(end - org) * shotspeed + shotspeedupward * '0 0 1';
- return FALSE;
+ return false;
}
void lag_update()
float lag_additem(float t, float f1, float f2, entity e1, vector v1, vector v2, vector v3, vector v4)
{
- if (self.lag1_time == 0) {self.lag1_time = t;self.lag1_float1 = f1;self.lag1_float2 = f2;self.lag1_entity1 = e1;self.lag1_vec1 = v1;self.lag1_vec2 = v2;self.lag1_vec3 = v3;self.lag1_vec4 = v4;return TRUE;}
- if (self.lag2_time == 0) {self.lag2_time = t;self.lag2_float1 = f1;self.lag2_float2 = f2;self.lag2_entity1 = e1;self.lag2_vec1 = v1;self.lag2_vec2 = v2;self.lag2_vec3 = v3;self.lag2_vec4 = v4;return TRUE;}
- if (self.lag3_time == 0) {self.lag3_time = t;self.lag3_float1 = f1;self.lag3_float2 = f2;self.lag3_entity1 = e1;self.lag3_vec1 = v1;self.lag3_vec2 = v2;self.lag3_vec3 = v3;self.lag3_vec4 = v4;return TRUE;}
- if (self.lag4_time == 0) {self.lag4_time = t;self.lag4_float1 = f1;self.lag4_float2 = f2;self.lag4_entity1 = e1;self.lag4_vec1 = v1;self.lag4_vec2 = v2;self.lag4_vec3 = v3;self.lag4_vec4 = v4;return TRUE;}
- if (self.lag5_time == 0) {self.lag5_time = t;self.lag5_float1 = f1;self.lag5_float2 = f2;self.lag5_entity1 = e1;self.lag5_vec1 = v1;self.lag5_vec2 = v2;self.lag5_vec3 = v3;self.lag5_vec4 = v4;return TRUE;}
+ if (self.lag1_time == 0) {self.lag1_time = t;self.lag1_float1 = f1;self.lag1_float2 = f2;self.lag1_entity1 = e1;self.lag1_vec1 = v1;self.lag1_vec2 = v2;self.lag1_vec3 = v3;self.lag1_vec4 = v4;return true;}
+ if (self.lag2_time == 0) {self.lag2_time = t;self.lag2_float1 = f1;self.lag2_float2 = f2;self.lag2_entity1 = e1;self.lag2_vec1 = v1;self.lag2_vec2 = v2;self.lag2_vec3 = v3;self.lag2_vec4 = v4;return true;}
+ if (self.lag3_time == 0) {self.lag3_time = t;self.lag3_float1 = f1;self.lag3_float2 = f2;self.lag3_entity1 = e1;self.lag3_vec1 = v1;self.lag3_vec2 = v2;self.lag3_vec3 = v3;self.lag3_vec4 = v4;return true;}
+ if (self.lag4_time == 0) {self.lag4_time = t;self.lag4_float1 = f1;self.lag4_float2 = f2;self.lag4_entity1 = e1;self.lag4_vec1 = v1;self.lag4_vec2 = v2;self.lag4_vec3 = v3;self.lag4_vec4 = v4;return true;}
+ if (self.lag5_time == 0) {self.lag5_time = t;self.lag5_float1 = f1;self.lag5_float2 = f2;self.lag5_entity1 = e1;self.lag5_vec1 = v1;self.lag5_vec2 = v2;self.lag5_vec3 = v3;self.lag5_vec4 = v4;return true;}
// no room for it (what is the best thing to do here??)
- return FALSE;
+ return false;
}
float bot_shouldattack(entity e)
if (e.team == self.team)
{
if (e == self)
- return FALSE;
+ return false;
if (teamplay)
if (e.team != 0)
- return FALSE;
+ return false;
}
if(e.frozen)
- return FALSE;
+ return false;
// If neither player has ball then don't attack unless the ball is on the
// ground.
if (g_keepaway)
if (!e.ballcarried && !self.ballcarried && ka_ball.owner)
- return FALSE;
+ return false;
if(teamplay)
{
if(e.team==0)
- return FALSE;
+ return false;
}
else if(bot_ignore_bots)
if(IS_BOT_CLIENT(e))
- return FALSE;
+ return false;
if (!e.takedamage)
- return FALSE;
+ return false;
if (e.deadflag)
- return FALSE;
+ return false;
if (e.BUTTON_CHAT)
- return FALSE;
+ return false;
if(e.flags & FL_NOTARGET)
- return FALSE;
+ return false;
checkentity = e;
if(MUTATOR_CALLHOOK(BotShouldAttack))
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
void bot_lagfunc(float t, float f1, float f2, entity e1, vector v1, vector v2, vector v3, vector v4)
if ((normalize(v) * shotdir) >= cos(maxfiredeviation * (3.14159265358979323846 / 180)))
if (vlen(trace_endpos-shotorg) < 500+500*bound(0, skill+self.bot_aggresskill, 10) || random()*random()>bound(0,(skill+self.bot_aggresskill)*0.05,1))
self.bot_firetimer = time + bound(0.1, 0.5-(skill+self.bot_aggresskill)*0.05, 0.5);
- //traceline(shotorg,shotorg+shotdir*1000,FALSE,world);
+ //traceline(shotorg,shotorg+shotdir*1000,false,world);
//dprint(ftos(maxfiredeviation),"\n");
//dprint(" diff:", vtos(diffang), "\n");
if (!findtrajectorywithleading(shotorg, '0 0 0', '0 0 0', self.bot_aimtarg, shotspeed, shotspeedupward, maxshottime, 0, self))
{
self.dphitcontentsmask = hf;
- return FALSE;
+ return false;
}
f = bot_aimdir(findtrajectory_velocity - shotspeedupward * '0 0 1', r);
{
f = bot_aimdir(v - shotorg, r);
//dprint("AIM: ");dprint(vtos(self.bot_aimtargorigin));dprint(" + ");dprint(vtos(self.bot_aimtargvelocity));dprint(" * ");dprint(ftos(self.bot_aimlatency + vlen(self.bot_aimtargorigin - shotorg) / shotspeed));dprint(" = ");dprint(vtos(v));dprint(" : aimdir = ");dprint(vtos(normalize(v - shotorg)));dprint(" : ");dprint(vtos(shotdir));dprint("\n");
- //traceline(shotorg, shotorg + shotdir * 10000, FALSE, self);
+ //traceline(shotorg, shotorg + shotdir * 10000, false, self);
//if (trace_ent.takedamage)
//if (trace_fraction < 1)
//if (!bot_shouldattack(trace_ent))
- // return FALSE;
- traceline(shotorg, self.bot_aimtargorigin, FALSE, self);
+ // return false;
+ traceline(shotorg, self.bot_aimtargorigin, false, self);
if (trace_fraction < 1)
if (trace_ent != self.enemy)
if (!bot_shouldattack(trace_ent))
{
self.dphitcontentsmask = hf;
- return FALSE;
+ return false;
}
}
//if (r > maxshottime * shotspeed)
- // return FALSE;
+ // return false;
self.dphitcontentsmask = hf;
- return TRUE;
+ return true;
}
{
self.v_angle = self.angles;
self.v_angle_z = 0;
- self.fixangle = FALSE;
+ self.fixangle = false;
}
self.dmg_take = 0;
READSKILL(bot_thinkskill, 1, 0.5); // think skill
READSKILL(bot_aiskill, 2, 0); // "ai" skill
- self.bot_config_loaded = TRUE;
+ self.bot_config_loaded = true;
// this is really only a default, JoinBestTeam is called later
setcolor(self, stof(bot_shirt) * 16 + stof(bot_pants));
{
float tokens, i, c, w;
- bot_custom_weapon = FALSE;
+ bot_custom_weapon = false;
if( autocvar_bot_ai_custom_weapon_priority_far == "" ||
autocvar_bot_ai_custom_weapon_priority_mid == "" ||
if(c < WEP_COUNT)
bot_weapons_close[c] = -1;
- bot_custom_weapon = TRUE;
+ bot_custom_weapon = true;
}
void bot_endgame()
}
dprint(strcat("relink: ", ftos(currentbots), " bots seen.\n"));
bot_strategytoken = bot_list;
- bot_strategytoken_taken = TRUE;
+ bot_strategytoken_taken = true;
}
void bot_clientdisconnect()
self.bot_preferredcolors = self.clientcolors;
self.bot_nextthink = time - random();
self.lag_func = bot_lagfunc;
- self.isbot = TRUE;
+ self.isbot = true;
self.createdtime = self.bot_nextthink;
if(!self.bot_config_loaded) // This is needed so team overrider doesn't break between matches
else if(self.bot_forced_team==4)
self.team = NUM_TEAM_4;
else
- JoinBestTeam(self, FALSE, TRUE);
+ JoinBestTeam(self, false, true);
havocbot_setupbot();
}
entity best, head;
CheckAllowedTeams(world);
GetTeamCounts(world);
- head = findchainfloat(isbot, TRUE);
+ head = findchainfloat(isbot, true);
if (!head)
return;
best = head;
return;
}
- head = findchainfloat(isbot, TRUE);
+ head = findchainfloat(isbot, true);
if (!head)
return;
best = head;
// minplayers+bot_number, or remove all bots if no one is playing
// But don't remove bots immediately on level change, as the real players
// usually haven't rejoined yet
- bots_would_leave = FALSE;
+ bots_would_leave = false;
if (teamplay && autocvar_bot_vs_human && (c3==-1 && c4==-1))
bots = min(ceil(fabs(autocvar_bot_vs_human) * activerealplayers), maxclients - realplayers);
else if ((realplayers || autocvar_bot_join_empty || (currentbots > 0 && time < 5)))
bots = min(max(minbots, minplayers - activerealplayers), maxclients - realplayers);
if(bots > minbots)
- bots_would_leave = TRUE;
+ bots_would_leave = true;
}
else
{
if (bot_spawn() == world)
{
bprint("Can not add bot, server full.\n");
- return FALSE;
+ return false;
}
}
while (currentbots > bots)
bot_removenewest();
}
- return TRUE;
+ return true;
}
void bot_serverframe()
}
else
{
- botframe_spawnedwaypoints = TRUE;
+ botframe_spawnedwaypoints = true;
waypoint_loadall();
if(!waypoint_load_links())
waypoint_schedulerelinkall();
// frame, which causes choppy framerates)
if (bot_strategytoken_taken)
{
- bot_strategytoken_taken = FALSE;
+ bot_strategytoken_taken = false;
if (bot_strategytoken)
bot_strategytoken = bot_strategytoken.nextbot;
if (!bot_strategytoken)
{
if(self.havocbot_blockhead)
{
- self.havocbot_blockhead = FALSE;
+ self.havocbot_blockhead = false;
}
else
{
if (pointcontents(head.origin + head.maxs + '0 0 1') != CONTENT_EMPTY)
continue;
- traceline(self.origin + self.view_ofs , head.origin, TRUE, head);
+ traceline(self.origin + self.view_ofs , head.origin, true, head);
if(trace_fraction<1)
continue;
}
// token has been used this frame
- bot_strategytoken_taken = TRUE;
+ bot_strategytoken_taken = true;
}
if(self.deadflag != DEAD_NO)
WEP_ACTION(self.weapon, WR_AIM);
if (autocvar_bot_nofire || IS_INDEPENDENT_PLAYER(self))
{
- self.BUTTON_ATCK = FALSE;
- self.BUTTON_ATCK2 = FALSE;
+ self.BUTTON_ATCK = false;
+ self.BUTTON_ATCK2 = false;
}
else
{
keyboard_z = 0;
self.havocbot_keyboard = keyboard * maxspeed;
- if (self.havocbot_ducktime>time) self.BUTTON_CROUCH=TRUE;
+ if (self.havocbot_ducktime>time) self.BUTTON_CROUCH=true;
keyboard = self.havocbot_keyboard;
blend = bound(0,vlen(destorg-self.origin)/autocvar_bot_ai_keyboard_distance,1); // When getting close move with 360 degree
if(self.aistatus & AI_STATUS_DANGER_AHEAD)
{
self.aistatus &= ~AI_STATUS_RUNNING;
- self.BUTTON_JUMP = FALSE;
+ self.BUTTON_JUMP = false;
self.bot_canruntogoal = 0;
self.bot_timelastseengoal = 0;
return;
if(time - self.bot_timelastseengoal > autocvar_bot_ai_bunnyhop_firstjumpdelay)
{
float checkdistance;
- checkdistance = TRUE;
+ checkdistance = true;
// don't run if it is too close
if(self.bot_canruntogoal==0)
if(vlen(gco - gno) > autocvar_bot_ai_bunnyhop_startdistance)
if(checkpvs(self.origin + self.view_ofs, self.goalstack01))
{
- checkdistance = FALSE;
+ checkdistance = false;
}
}
}
{
self.aistatus &= ~AI_STATUS_RUNNING;
if(bunnyhopdistance > autocvar_bot_ai_bunnyhop_stopdistance)
- self.BUTTON_JUMP = TRUE;
+ self.BUTTON_JUMP = true;
}
else
{
self.aistatus |= AI_STATUS_RUNNING;
- self.BUTTON_JUMP = TRUE;
+ self.BUTTON_JUMP = true;
}
}
}
if((self.flags & FL_ONGROUND) == 0)
{
if(self.velocity.z < 0 || vlen(self.velocity)<maxspeed)
- self.BUTTON_JUMP = FALSE;
+ self.BUTTON_JUMP = false;
// Strafe
if(self.aistatus & AI_STATUS_RUNNING)
}
// Flying
- self.BUTTON_HOOK = TRUE;
+ self.BUTTON_HOOK = true;
if(self.navigation_jetpack_point.z - PL_MAX_z + PL_MIN_z < self.origin.z)
{
self.movement_x = dir * v_forward * maxspeed;
if(distance>1000)
continue;
- traceline(self.origin + self.view_ofs , ( ( head.absmin + head.absmax ) * 0.5 ), TRUE, world);
+ traceline(self.origin + self.view_ofs , ( ( head.absmin + head.absmax ) * 0.5 ), true, world);
if(trace_fraction<1)
continue;
{
if(self.velocity.z<0)
{
- self.BUTTON_HOOK = TRUE;
+ self.BUTTON_HOOK = true;
}
}
else
- self.BUTTON_HOOK = TRUE;
+ self.BUTTON_HOOK = true;
// If there is no goal try to move forward
}
}
- self.havocbot_blockhead = TRUE;
+ self.havocbot_blockhead = true;
return;
}
else if(self.health>WEP_CVAR(devastator, damage)*0.5)
{
if(self.velocity.z < 0)
- if(client_hasweapon(self, WEP_DEVASTATOR, TRUE, FALSE))
+ if(client_hasweapon(self, WEP_DEVASTATOR, true, false))
{
self.movement_x = maxspeed;
{
if(time > self.rocketjumptime)
{
- self.BUTTON_ATCK2 = TRUE;
+ self.BUTTON_ATCK2 = true;
self.rocketjumptime = 0;
}
return;
self.switchweapon = WEP_DEVASTATOR;
self.v_angle_x = 90;
- self.BUTTON_ATCK = TRUE;
+ self.BUTTON_ATCK = true;
self.rocketjumptime = time + WEP_CVAR(devastator, detonatedelay);
return;
}
if(self.waterlevel>WATERLEVEL_SWIMMING)
dir_z = 1;
else if(self.velocity.z >= 0 && !(self.waterlevel == WATERLEVEL_WETFEET && self.watertype == CONTENT_WATER))
- self.BUTTON_JUMP = TRUE;
+ self.BUTTON_JUMP = true;
else
- self.BUTTON_JUMP = FALSE;
+ self.BUTTON_JUMP = false;
makevectors(self.v_angle.y * '0 1 0');
self.movement_x = dir * v_forward * maxspeed;
self.movement_y = dir * v_right * maxspeed;
{
if(self.velocity.z >= 0 && !(self.watertype == CONTENT_WATER && gco.z < self.origin.z) &&
( !(self.waterlevel == WATERLEVEL_WETFEET && self.watertype == CONTENT_WATER) || self.aistatus & AI_STATUS_OUT_WATER))
- self.BUTTON_JUMP = TRUE;
+ self.BUTTON_JUMP = true;
else
- self.BUTTON_JUMP = FALSE;
+ self.BUTTON_JUMP = false;
}
dir = normalize(flatdir);
makevectors(self.v_angle.y * '0 1 0');
// jump if going toward an obstacle that doesn't look like stairs we
// can walk up directly
- tracebox(self.origin, self.mins, self.maxs, self.origin + self.velocity * 0.2, FALSE, self);
+ tracebox(self.origin, self.mins, self.maxs, self.origin + self.velocity * 0.2, false, self);
if (trace_fraction < 1)
if (trace_plane_normal.z < 0.7)
{
s = trace_fraction;
- tracebox(self.origin + stepheightvec, self.mins, self.maxs, self.origin + self.velocity * 0.2 + stepheightvec, FALSE, self);
+ tracebox(self.origin + stepheightvec, self.mins, self.maxs, self.origin + self.velocity * 0.2 + stepheightvec, false, self);
if (trace_fraction < s + 0.01)
if (trace_plane_normal.z < 0.7)
{
s = trace_fraction;
- tracebox(self.origin + jumpstepheightvec, self.mins, self.maxs, self.origin + self.velocity * 0.2 + jumpstepheightvec, FALSE, self);
+ tracebox(self.origin + jumpstepheightvec, self.mins, self.maxs, self.origin + self.velocity * 0.2 + jumpstepheightvec, false, self);
if (trace_fraction > s)
self.BUTTON_JUMP = 1;
}
dst_down = dst_ahead - '0 0 1500';
// Look ahead
- traceline(self.origin + self.view_ofs, dst_ahead, TRUE, world);
+ traceline(self.origin + self.view_ofs, dst_ahead, true, world);
// Check head-banging against walls
if(vlen(self.origin + self.view_ofs - trace_endpos) < 25 && !(self.aistatus & AI_STATUS_OUT_WATER))
{
- self.BUTTON_JUMP = TRUE;
+ self.BUTTON_JUMP = true;
if(self.facingwalltime && time > self.facingwalltime)
{
self.ignoregoal = self.goalcurrent;
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);
+ traceline(dst_ahead , dst_down, true, world);
// te_lightning2(world, self.origin, dst_ahead); // Draw "ahead" look
// te_lightning2(world, dst_ahead, dst_down); // Draw "downwards" look
if(trace_endpos.z < self.origin.z + self.mins.z)
dodge = havocbot_dodge();
dodge = dodge * bound(0,0.5+(skill+self.bot_dodgeskill)*0.1,1);
evadelava = evadelava * bound(1,3-(skill+self.bot_dodgeskill),3); //Noobs fear lava a lot and take more distance from it
- traceline(self.origin, ( ( self.enemy.absmin + self.enemy.absmax ) * 0.5 ), TRUE, world);
+ traceline(self.origin, ( ( self.enemy.absmin + self.enemy.absmax ) * 0.5 ), true, world);
if(IS_PLAYER(trace_ent))
dir = dir * bound(0,(skill+self.bot_dodgeskill)/7,1);
havocbot_bunnyhop(dir);
if ((dir * v_up) >= autocvar_sv_jumpvelocity*0.5 && (self.flags & FL_ONGROUND)) self.BUTTON_JUMP=1;
- if (((dodge * v_up) > 0) && random()*frametime >= 0.2*bound(0,(10-skill-self.bot_dodgeskill)*0.1,1)) self.BUTTON_JUMP=TRUE;
+ if (((dodge * v_up) > 0) && random()*frametime >= 0.2*bound(0,(10-skill-self.bot_dodgeskill)*0.1,1)) self.BUTTON_JUMP=true;
if (((dodge * v_up) < 0) && random()*frametime >= 0.5*bound(0,(10-skill-self.bot_dodgeskill)*0.1,1)) self.havocbot_ducktime=time+0.3/bound(0.1,skill+self.bot_dodgeskill,10);
}
// and not really really far away
// and we're not severely injured
// then keep tracking for a half second into the future
- traceline(self.origin+self.view_ofs, ( self.enemy.absmin + self.enemy.absmax ) * 0.5,FALSE,world);
+ traceline(self.origin+self.view_ofs, ( self.enemy.absmin + self.enemy.absmax ) * 0.5,false,world);
if (trace_ent == self.enemy || trace_fraction == 1)
if (vlen((( self.enemy.absmin + self.enemy.absmax ) * 0.5) - self.origin) < 1000)
if (self.health > 30)
eye = self.origin + self.view_ofs;
best = world;
bestrating = 100000000;
- head = head2 = findchainfloat(bot_attack, TRUE);
+ head = head2 = findchainfloat(bot_attack, true);
// Backup hit flags
hf = self.dphitcontentsmask;
if (bestrating > rating)
if (bot_shouldattack(head))
{
- traceline(eye, v, TRUE, self);
+ traceline(eye, v, true, self);
if (trace_ent == head || trace_fraction >= 1)
{
best = head;
self.dphitcontentsmask = hf;
self.enemy = best;
- self.havocbot_stickenemy = TRUE;
+ self.havocbot_stickenemy = true;
}
float havocbot_chooseweapon_checkreload(float new_weapon)
// so skip this for them, or they'll never get to reload their weapons at all.
// this also allows bots under this skill to be more stupid, and reload more often during combat :)
if(skill < 5)
- return FALSE;
+ return false;
// if this weapon is scheduled for reloading, don't switch to it during combat
if (self.weapon_load[new_weapon] < 0)
{
- float i, other_weapon_available = FALSE;
+ float i, other_weapon_available = false;
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
{
// if we are out of ammo for all other weapons, it's an emergency to switch to anything else
if (WEP_ACTION(i, WR_CHECKAMMO1) + WEP_ACTION(i, WR_CHECKAMMO2))
- other_weapon_available = TRUE;
+ other_weapon_available = true;
}
if(other_weapon_available)
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void havocbot_chooseweapon()
if(self.weapon==0)
for(i = WEP_FIRST; i <= WEP_LAST; ++i) if(i != WEP_BLASTER)
{
- if(client_hasweapon(self, i, TRUE, FALSE))
+ if(client_hasweapon(self, i, true, false))
{
self.switchweapon = i;
return;
// Ideally this 4 should be calculated as longest_weapon_refire / bot_ai_weapon_combo_threshold
combo_time = time + ct + (ct * ((-0.3*(skill+self.bot_weaponskill))+3));
- combo = FALSE;
+ combo = false;
if(autocvar_bot_ai_weapon_combo)
if(self.weapon == self.lastfiredweapon)
if(af > combo_time)
{
- combo = TRUE;
+ combo = true;
self.lastcombotime = time;
}
if ( distance > bot_distance_far ) {
for(i=0; i < WEP_COUNT && bot_weapons_far[i] != -1 ; ++i){
w = bot_weapons_far[i];
- if ( client_hasweapon(self, w, TRUE, FALSE) )
+ if ( client_hasweapon(self, w, true, false) )
{
if ((self.weapon == w && combo) || havocbot_chooseweapon_checkreload(w))
continue;
if ( distance > bot_distance_close) {
for(i=0; i < WEP_COUNT && bot_weapons_mid[i] != -1 ; ++i){
w = bot_weapons_mid[i];
- if ( client_hasweapon(self, w, TRUE, FALSE) )
+ if ( client_hasweapon(self, w, true, false) )
{
if ((self.weapon == w && combo) || havocbot_chooseweapon_checkreload(w))
continue;
// Choose weapons for close distance
for(i=0; i < WEP_COUNT && bot_weapons_close[i] != -1 ; ++i){
w = bot_weapons_close[i];
- if ( client_hasweapon(self, w, TRUE, FALSE) )
+ if ( client_hasweapon(self, w, true, false) )
{
if ((self.weapon == w && combo) || havocbot_chooseweapon_checkreload(w))
continue;
if (!bot_strategytoken_taken)
if(self.havocbot_personal_waypoint_searchtime<time)
{
- bot_strategytoken_taken = TRUE;
+ bot_strategytoken_taken = true;
if(havocbot_moveto_refresh_route())
{
dprint(self.netname, " walking to its personal waypoint (after ", ftos(self.havocbot_personal_waypoint_failcounter), " failed attempts)\n");
dodge = '0 0 0';
bestdanger = -20;
// check for dangerous objects near bot or approaching bot
- head = findchainfloat(bot_dodge, TRUE);
+ head = findchainfloat(bot_dodge, true);
while(head)
{
if (head.owner != self)
void havocbot_goalrating_ons_offenseitems(float ratingscale, vector org, float sradius)
{
entity head;
- float t, i, c, needarmor = FALSE, needweapons = FALSE;
+ float t, i, c, needarmor = false, needweapons = false;
// Needs armor/health?
if(self.health<100)
- needarmor = TRUE;
+ needarmor = true;
// Needs weapons?
c = 0;
}
if(c<4)
- needweapons = TRUE;
+ needweapons = true;
if(!needweapons && !needarmor)
return;
// dprint(self.netname, " needs armor ", ftos(needarmor) , "\n");
// See what is around
- head = findchainfloat(bot_pickup, TRUE);
+ head = findchainfloat(bot_pickup, true);
while (head)
{
// gather health and armor only
for(0; cp2; cp2 = cp2.chain)
{
cp2.wpcost = c = 0;
- cp2.wpconsidered = FALSE;
+ cp2.wpconsidered = false;
if(cp2.isshielded)
continue;
// NOTE: probably decrease the cost of attackable control points
cp2.wpcost = c;
- cp2.wpconsidered = TRUE;
+ cp2.wpconsidered = true;
}
// We'll consider only the best case
{
// Should be attacked
// Rate waypoints near it
- found = FALSE;
+ found = false;
best = world;
bestvalue = 99999999999;
for(radius=0; radius<1000 && !found; radius+=500)
if(wp.classname=="waypoint")
if(checkpvs(wp.origin,cp))
{
- found = TRUE;
+ found = true;
if(wp.cnt<bestvalue)
{
best = wp;
{
// Should be touched
// dprint(self.netname, " found a touchable controlpoint at ", vtos(cp.origin) ,"\n");
- found = FALSE;
+ found = false;
// Look for auto generated waypoint
if (!bot_waypoints_for_items)
if(wp.classname=="waypoint")
{
navigation_routerating(wp, ratingscale, 10000);
- found = TRUE;
+ found = true;
}
}
// Should be attacked
// Rate waypoints near it
- found = FALSE;
+ found = false;
bestwp = world;
best = 99999999999;
if(wp.classname=="waypoint")
if(checkpvs(wp.origin,g))
{
- found = TRUE;
+ found = true;
if(wp.cnt<best)
{
bestwp = wp;
if(checkpvs(self.view_ofs,bestwp))
self.havocbot_attack_time = time + 5;
- return TRUE;
+ return true;
}
else
{
// if there aren't waypoints near the generator go straight to it
navigation_routerating(g, ratingscale, 10000);
self.havocbot_attack_time = 0;
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
void havocbot_role_ons_offense()
float rating, d, discard, distance, friend_distance, enemy_distance;
vector o;
ratingscale = ratingscale * 0.0001; // items are rated around 10000 already
- head = findchainfloat(bot_pickup, TRUE);
+ head = findchainfloat(bot_pickup, true);
while (head)
{
// Check if the item can be picked up safely
if(head.classname == "droppedweapon")
{
- traceline(o, o + '0 0 -1500', TRUE, world);
+ traceline(o, o + '0 0 -1500', true, world);
d = pointcontents(trace_endpos + '0 0 1');
if(d & CONTENT_WATER || d & CONTENT_SLIME || d & CONTENT_LAVA)
if(teamplay)
{
- discard = FALSE;
+ discard = false;
FOR_EACH_PLAYER(player)
{
friend_distance = d;
- discard = TRUE;
+ discard = true;
if( head.health && player.health > self.health )
continue;
if (head.ammo_plasma && player.ammo_plasma > self.ammo_plasma)
continue;
- discard = FALSE;
+ discard = false;
}
else
{
// not falling
if((head.flags & FL_ONGROUND) == 0)
{
- traceline(head.origin, head.origin + '0 0 -1500', TRUE, world);
+ traceline(head.origin, head.origin + '0 0 -1500', true, world);
t = pointcontents(trace_endpos + '0 0 1');
if( t != CONTENT_SOLID )
if(t & CONTENT_WATER || t & CONTENT_SLIME || t & CONTENT_LAVA)
dist = totaldist = vlen(move);
dir = normalize(move);
stepdist = 32;
- ignorehazards = FALSE;
- swimming = FALSE;
+ ignorehazards = false;
+ swimming = false;
// Analyze starting point
traceline(start, start, MOVE_NORMAL, e);
if (trace_dpstartcontents & (DPCONTENTS_SLIME | DPCONTENTS_LAVA))
- ignorehazards = TRUE;
+ ignorehazards = true;
else
{
traceline( start, start + '0 0 -65536', MOVE_NORMAL, e);
if (trace_dpstartcontents & (DPCONTENTS_SLIME | DPCONTENTS_LAVA))
{
- ignorehazards = TRUE;
- swimming = TRUE;
+ ignorehazards = true;
+ swimming = true;
}
}
tracebox(start, m1, m2, start, MOVE_NOMONSTERS, e);
debugnodestatus(start, DEBUG_NODE_FAIL);
//print("tracewalk: ", vtos(start), " is a bad start\n");
- return FALSE;
+ return false;
}
// Movement loop
debugnodestatus(org, DEBUG_NODE_SUCCESS);
//print("tracewalk: ", vtos(start), " can reach ", vtos(end), "\n");
- return TRUE;
+ return true;
}
if(autocvar_bot_debug_tracewalk)
debugnode(org);
debugnodestatus(org, DEBUG_NODE_FAIL);
//print("tracewalk: ", vtos(start), " hits a hazard when trying to reach ", vtos(end), "\n");
- return FALSE;
+ return false;
}
}
if (trace_dpstartcontents & DPCONTENTS_LIQUIDSMASK)
if (trace_fraction < 1)
{
- swimming = TRUE;
+ swimming = true;
org = trace_endpos - normalize(org - trace_endpos) * stepdist;
for(0; org.z < end.z + self.maxs.z; org.z += stepdist)
{
if(autocvar_bot_debug_tracewalk)
debugnodestatus(org, DEBUG_NODE_FAIL);
- return FALSE;
+ return false;
//print("tracewalk: ", vtos(start), " failed under water\n");
}
continue;
//print("tracewalk: ", vtos(start), " hit something when trying to reach ", vtos(end), "\n");
//te_explosion(trace_endpos);
//print(ftos(e.dphitcontentsmask), "\n");
- return FALSE; // failed
+ return false; // failed
}
}
else
float c;
c = pointcontents(org + '0 0 1');
if (!(c == CONTENT_WATER || c == CONTENT_LAVA || c == CONTENT_SLIME))
- swimming = FALSE;
+ swimming = false;
else
continue;
}
if(autocvar_bot_debug_tracewalk)
debugnodestatus(org, DEBUG_NODE_FAIL);
- return FALSE;
+ return false;
}
/////////////////////////////////////////////////////////////////////////////
void navigation_clearroute()
{
//print("bot ", etos(self), " clear\n");
- self.navigation_hasgoals = FALSE;
+ self.navigation_hasgoals = false;
self.goalcurrent = world;
self.goalstack01 = world;
self.goalstack02 = world;
dist = vlen(v - org);
if (bestdist > dist)
{
- traceline(v, org, TRUE, ent);
+ traceline(v, org, true, ent);
if (trace_fraction == 1)
{
if (walkfromwp)
{
if (tracewalk(ent, v, PL_MIN, PL_MAX, org, bot_navigation_movemode))
- return TRUE;
+ return true;
}
else
{
if (tracewalk(ent, org, PL_MIN, PL_MAX, v, bot_navigation_movemode))
- return TRUE;
+ return true;
}
}
}
- return FALSE;
+ return false;
}
// find the spawnfunc_waypoint near a dynamic goal such as a dropped weapon
entity head;
vector v, m1, m2, diff;
float c;
-// navigation_testtracewalk = TRUE;
+// navigation_testtracewalk = true;
c = 0;
head = waylist;
while (head)
diff_z = max(0, diff.z);
if (vlen(diff) < maxdist)
{
- head.wpconsidered = TRUE;
+ head.wpconsidered = true;
if (tracewalk(self, self.origin, self.mins, self.maxs, v, bot_navigation_movemode))
{
head.wpnearestpoint = v;
}
head = head.chain;
}
- //navigation_testtracewalk = FALSE;
+ //navigation_testtracewalk = false;
return c;
}
w = waylist = findchain(classname, "waypoint");
while (w)
{
- w.wpconsidered = FALSE;
+ w.wpconsidered = false;
w.wpnearestpoint = '0 0 0';
w.wpcost = 10000000;
w.wpfire = 0;
if(fixed_source_waypoint)
{
- fixed_source_waypoint.wpconsidered = TRUE;
+ fixed_source_waypoint.wpconsidered = true;
fixed_source_waypoint.wpnearestpoint = fixed_source_waypoint.origin + 0.5 * (fixed_source_waypoint.mins + fixed_source_waypoint.maxs);
fixed_source_waypoint.wpcost = fixed_source_waypoint.dmg;
fixed_source_waypoint.wpfire = 1;
for(i=increment;!navigation_markroutes_nearestwaypoints(waylist, i)&&i<maxdistance;i+=increment);
}
- searching = TRUE;
+ searching = true;
while (searching)
{
- searching = FALSE;
+ searching = false;
w = waylist;
while (w)
{
if (w.wpfire)
{
- searching = TRUE;
+ searching = true;
w.wpfire = 0;
cost = w.wpcost;
p = w.wpnearestpoint;
w = waylist = findchain(classname, "waypoint");
while (w)
{
- w.wpconsidered = FALSE;
+ w.wpconsidered = false;
w.wpnearestpoint = '0 0 0';
w.wpcost = 10000000;
w.wpfire = 0;
if(fixed_source_waypoint)
{
- fixed_source_waypoint.wpconsidered = TRUE;
+ fixed_source_waypoint.wpconsidered = true;
fixed_source_waypoint.wpnearestpoint = fixed_source_waypoint.origin + 0.5 * (fixed_source_waypoint.mins + fixed_source_waypoint.maxs);
fixed_source_waypoint.wpcost = fixed_source_waypoint.dmg; // the cost to get from X to fixed_source_waypoint
fixed_source_waypoint.wpfire = 1;
error("need to start with a waypoint\n");
}
- searching = TRUE;
+ searching = true;
while (searching)
{
- searching = FALSE;
+ searching = false;
w = waylist;
while (w)
{
if (w.wpfire)
{
- searching = TRUE;
+ searching = true;
w.wpfire = 0;
cost = w.wpcost; // cost to walk from w to home
p = w.wpnearestpoint;
{
float search;
- search = TRUE;
+ search = true;
if(e.flags & FL_ITEM)
{
if (!(e.flags & FL_WEAPON))
if(e.nearestwaypoint)
- search = FALSE;
+ search = false;
}
else if (e.flags & FL_WEAPON)
{
if(e.classname != "droppedweapon")
if(e.nearestwaypoint)
- search = FALSE;
+ search = false;
}
if(search)
if (time > e.nearestwaypointtimeout)
{
- nwp = navigation_findnearestwaypoint(e, TRUE);
+ nwp = navigation_findnearestwaypoint(e, true);
if(nwp)
e.nearestwaypoint = nwp;
else
bot_debug(strcat("FAILED to find a nearest waypoint to '", e.classname, "' #", etos(e), "\n"));
if(e.flags & FL_ITEM)
- e.blacklisted = TRUE;
+ e.blacklisted = true;
else if (e.flags & FL_WEAPON)
{
if(e.classname != "droppedweapon")
- e.blacklisted = TRUE;
+ e.blacklisted = true;
}
if(e.blacklisted)
// if there is no goal, just exit
if (!e)
- return FALSE;
+ return false;
- self.navigation_hasgoals = TRUE;
+ self.navigation_hasgoals = true;
// put the entity on the goal stack
//print("routetogoal ", etos(e), "\n");
if(g_jetpack)
if(e==self.navigation_jetpack_goal)
- return TRUE;
+ return true;
// if it can reach the goal there is nothing more to do
if (tracewalk(self, startposition, PL_MIN, PL_MAX, (e.absmin + e.absmax) * 0.5, bot_navigation_movemode))
- return TRUE;
+ return true;
// see if there are waypoints describing a path to the item
if(e.classname != "waypoint" || (e.wpflags & WAYPOINTFLAG_PERSONAL))
e = e.enemy; // we already have added it, so...
if(e == world)
- return FALSE;
+ return false;
for(0;;)
{
break;
}
- return FALSE;
+ return false;
}
// removes any currently touching waypoints from the goal stack
{
if(vlen(self.origin - self.goalcurrent.origin)<150)
{
- traceline(self.origin + self.view_ofs , self.goalcurrent.origin, TRUE, world);
+ traceline(self.origin + self.view_ofs , self.goalcurrent.origin, true, world);
if(trace_fraction==1)
{
// Detect personal waypoints
self.navigation_jetpack_goal = world;
navigation_bestrating = -1;
- self.navigation_hasgoals = FALSE;
+ self.navigation_hasgoals = false;
navigation_clearroute();
navigation_bestgoal = world;
navigation_markroutes(world);
self.aistatus |= AI_STATUS_STUCK;
}
- self.navigation_hasgoals = FALSE; // Reset this value
+ self.navigation_hasgoals = false; // Reset this value
}
}
vector m1, m2, v, o;
float c, d, danger;
c = 0;
- bot_dodgelist = findchainfloat(bot_dodge, TRUE);
+ bot_dodgelist = findchainfloat(bot_dodge, true);
botframe_dangerwaypoint = find(botframe_dangerwaypoint, classname, "waypoint");
while (botframe_dangerwaypoint != world)
{
d = head.bot_dodgerating - vlen(o - v);
if (d > 0)
{
- traceline(o, v, TRUE, world);
+ traceline(o, v, true, world);
if (trace_fraction == 1)
danger = danger + d;
}
if(!bot.bot_cmdqueuebuf_allocated)
return;
buf_del(bot.bot_cmdqueuebuf);
- bot.bot_cmdqueuebuf_allocated = FALSE;
+ bot.bot_cmdqueuebuf_allocated = false;
dprint("bot ", bot.netname, " queue cleared\n");
}
if(!bot.bot_cmdqueuebuf_allocated)
{
bot.bot_cmdqueuebuf = buf_create();
- bot.bot_cmdqueuebuf_allocated = TRUE;
+ bot.bot_cmdqueuebuf_allocated = true;
bot.bot_cmdqueuebuf_start = 0;
bot.bot_cmdqueuebuf_end = 0;
}
bot_cmd_string[BOT_CMD_DEBUG_ASSERT_CANFIRE] = "debug_assert_canfire";
bot_cmd_parm_type[BOT_CMD_DEBUG_ASSERT_CANFIRE] = BOT_CMD_PARAMETER_FLOAT;
- bot_cmds_initialized = TRUE;
+ bot_cmds_initialized = true;
}
// Returns first bot with matching name
if(id < WEP_FIRST || id > WEP_LAST)
return CMD_STATUS_ERROR;
- if(client_hasweapon(self, id, TRUE, FALSE))
+ if(client_hasweapon(self, id, true, false))
self.switchweapon = id;
else
return CMD_STATUS_ERROR;
.float bot_cmd_condition_status;
const float CMD_CONDITION_NONE = 0;
-const float CMD_CONDITION_TRUE = 1;
-const float CMD_CONDITION_FALSE = 2;
-const float CMD_CONDITION_TRUE_BLOCK = 4;
-const float CMD_CONDITION_FALSE_BLOCK = 8;
+const float CMD_CONDITION_true = 1;
+const float CMD_CONDITION_false = 2;
+const float CMD_CONDITION_true_BLOCK = 4;
+const float CMD_CONDITION_false_BLOCK = 8;
float bot_cmd_eval(string expr)
{
return CMD_STATUS_ERROR;
}
- self.bot_cmd_condition_status |= CMD_CONDITION_TRUE_BLOCK;
+ self.bot_cmd_condition_status |= CMD_CONDITION_true_BLOCK;
// search for operators
expr = bot_cmd.bot_cmd_parm_string;
val_b = substring(expr,cmpofs+1,strlen(expr));
if(bot_cmd_eval(val_a)==bot_cmd_eval(val_b))
- self.bot_cmd_condition_status |= CMD_CONDITION_TRUE;
+ self.bot_cmd_condition_status |= CMD_CONDITION_true;
else
- self.bot_cmd_condition_status |= CMD_CONDITION_FALSE;
+ self.bot_cmd_condition_status |= CMD_CONDITION_false;
return CMD_STATUS_FINISHED;
}
val_b = substring(expr,cmpofs+1,strlen(expr));
if(bot_cmd_eval(val_a)>bot_cmd_eval(val_b))
- self.bot_cmd_condition_status |= CMD_CONDITION_TRUE;
+ self.bot_cmd_condition_status |= CMD_CONDITION_true;
else
- self.bot_cmd_condition_status |= CMD_CONDITION_FALSE;
+ self.bot_cmd_condition_status |= CMD_CONDITION_false;
return CMD_STATUS_FINISHED;
}
val_b = substring(expr,cmpofs+1,strlen(expr));
if(bot_cmd_eval(val_a)<bot_cmd_eval(val_b))
- self.bot_cmd_condition_status |= CMD_CONDITION_TRUE;
+ self.bot_cmd_condition_status |= CMD_CONDITION_true;
else
- self.bot_cmd_condition_status |= CMD_CONDITION_FALSE;
+ self.bot_cmd_condition_status |= CMD_CONDITION_false;
return CMD_STATUS_FINISHED;
}
if(bot_cmd_eval(expr))
- self.bot_cmd_condition_status |= CMD_CONDITION_TRUE;
+ self.bot_cmd_condition_status |= CMD_CONDITION_true;
else
- self.bot_cmd_condition_status |= CMD_CONDITION_FALSE;
+ self.bot_cmd_condition_status |= CMD_CONDITION_false;
return CMD_STATUS_FINISHED;
}
float bot_cmd_else()
{
- self.bot_cmd_condition_status &= ~CMD_CONDITION_TRUE_BLOCK;
- self.bot_cmd_condition_status |= CMD_CONDITION_FALSE_BLOCK;
+ self.bot_cmd_condition_status &= ~CMD_CONDITION_true_BLOCK;
+ self.bot_cmd_condition_status |= CMD_CONDITION_false_BLOCK;
return CMD_STATUS_FINISHED;
}
float bot_presskeys()
{
self.movement = '0 0 0';
- self.BUTTON_JUMP = FALSE;
- self.BUTTON_CROUCH = FALSE;
- self.BUTTON_ATCK = FALSE;
- self.BUTTON_ATCK2 = FALSE;
- self.BUTTON_USE = FALSE;
- self.BUTTON_HOOK = FALSE;
- self.BUTTON_CHAT = FALSE;
+ self.BUTTON_JUMP = false;
+ self.BUTTON_CROUCH = false;
+ self.BUTTON_ATCK = false;
+ self.BUTTON_ATCK2 = false;
+ self.BUTTON_USE = false;
+ self.BUTTON_HOOK = false;
+ self.BUTTON_CHAT = false;
if(self.bot_cmd_keys == BOT_CMD_KEY_NONE)
- return FALSE;
+ return false;
if(self.bot_cmd_keys & BOT_CMD_KEY_FORWARD)
self.movement_x = autocvar_sv_maxspeed;
self.movement_y = -autocvar_sv_maxspeed;
if(self.bot_cmd_keys & BOT_CMD_KEY_JUMP)
- self.BUTTON_JUMP = TRUE;
+ self.BUTTON_JUMP = true;
if(self.bot_cmd_keys & BOT_CMD_KEY_CROUCH)
- self.BUTTON_CROUCH = TRUE;
+ self.BUTTON_CROUCH = true;
if(self.bot_cmd_keys & BOT_CMD_KEY_ATTACK1)
- self.BUTTON_ATCK = TRUE;
+ self.BUTTON_ATCK = true;
if(self.bot_cmd_keys & BOT_CMD_KEY_ATTACK2)
- self.BUTTON_ATCK2 = TRUE;
+ self.BUTTON_ATCK2 = true;
if(self.bot_cmd_keys & BOT_CMD_KEY_USE)
- self.BUTTON_USE = TRUE;
+ self.BUTTON_USE = true;
if(self.bot_cmd_keys & BOT_CMD_KEY_HOOK)
- self.BUTTON_HOOK = TRUE;
+ self.BUTTON_HOOK = true;
if(self.bot_cmd_keys & BOT_CMD_KEY_CHAT)
- self.BUTTON_CHAT = TRUE;
+ self.BUTTON_CHAT = true;
- return TRUE;
+ return true;
}
key = bot_cmd.bot_cmd_parm_string;
- bot_cmd_keypress_handler(key,TRUE);
+ bot_cmd_keypress_handler(key,true);
return CMD_STATUS_FINISHED;
}
key = bot_cmd.bot_cmd_parm_string;
- return bot_cmd_keypress_handler(key,FALSE);
+ return bot_cmd_keypress_handler(key,false);
}
float bot_cmd_pause()
// (namely, it means you cannot make a bot "normal" ever again)
// to keep a bot walking for a while, use the "wait" bot command
if(bot_cmd == world)
- return FALSE;
+ return false;
// Ignore all commands except continue when the bot is paused
if(self.bot_exec_status & BOT_EXEC_STATUS_PAUSED)
{
if(bot_cmd.bot_cmd_type!=BOT_CMD_NULL)
{
- bot_command_executed(TRUE);
+ bot_command_executed(true);
print( "WARNING: Commands are ignored while the bot is paused. Use the command 'continue' instead.\n");
}
return 1;
// Handle conditions
if (!(bot_cmd.bot_cmd_type==BOT_CMD_FI||bot_cmd.bot_cmd_type==BOT_CMD_ELSE))
- if(self.bot_cmd_condition_status & CMD_CONDITION_TRUE && self.bot_cmd_condition_status & CMD_CONDITION_FALSE_BLOCK)
+ if(self.bot_cmd_condition_status & CMD_CONDITION_true && self.bot_cmd_condition_status & CMD_CONDITION_false_BLOCK)
{
- bot_command_executed(TRUE);
+ bot_command_executed(true);
return -1;
}
- else if(self.bot_cmd_condition_status & CMD_CONDITION_FALSE && self.bot_cmd_condition_status & CMD_CONDITION_TRUE_BLOCK)
+ else if(self.bot_cmd_condition_status & CMD_CONDITION_false && self.bot_cmd_condition_status & CMD_CONDITION_true_BLOCK)
{
- bot_command_executed(TRUE);
+ bot_command_executed(true);
return -1;
}
clientcommand(self,strcat("say ^7", bot_cmd_string[bot_cmd.bot_cmd_type]," ",parms,"\n"));
}
- bot_command_executed(TRUE);
+ bot_command_executed(true);
}
if(status == CMD_STATUS_FINISHED)
setorigin(w, (m1 + m2) * 0.5);
setsize(w, m1 - w.origin, m2 - w.origin);
if (vlen(w.size) > 0)
- w.wpisbox = TRUE;
+ w.wpisbox = true;
if(!w.wpisbox)
{
navigation_testtracewalk = 0;
if (!self.wpisbox)
{
- tracebox(sv - PL_MIN_z * '0 0 1', PL_MIN, PL_MAX, sv, FALSE, self);
+ tracebox(sv - PL_MIN_z * '0 0 1', PL_MIN, PL_MAX, sv, false, self);
if (!trace_startsolid)
{
//dprint("sv deviation", vtos(trace_endpos - sv), "\n");
}
if (!e.wpisbox)
{
- tracebox(ev - PL_MIN_z * '0 0 1', PL_MIN, PL_MAX, ev, FALSE, e);
+ tracebox(ev - PL_MIN_z * '0 0 1', PL_MIN, PL_MAX, ev, false, e);
if (!trace_startsolid)
{
//dprint("ev deviation", vtos(trace_endpos - ev), "\n");
ev = trace_endpos + '0 0 1';
}
}
- //traceline(self.origin, e.origin, FALSE, world);
+ //traceline(self.origin, e.origin, false, world);
//if (trace_fraction == 1)
if (!self.wpisbox && tracewalk(self, sv, PL_MIN, PL_MAX, ev, MOVE_NOMONSTERS))
waypoint_addlink(self, e);
}
}
navigation_testtracewalk = 0;
- self.wplinked = TRUE;
+ self.wplinked = true;
}
void waypoint_clearlinks(entity wp)
wp.wp16mincost = wp.wp17mincost = wp.wp18mincost = wp.wp19mincost = wp.wp20mincost = wp.wp21mincost = wp.wp22mincost = wp.wp23mincost = f;
wp.wp24mincost = wp.wp25mincost = wp.wp26mincost = wp.wp27mincost = wp.wp28mincost = wp.wp29mincost = wp.wp30mincost = wp.wp31mincost = f;
- wp.wplinked = FALSE;
+ wp.wplinked = false;
}
// tell a spawnfunc_waypoint to relink
dprint("waypoint links load from ");
dprint(filename);
dprint(" failed\n");
- return FALSE;
+ return false;
}
while ((s = fgets(file)))
{
// bad file format
fclose(file);
- return FALSE;
+ return false;
}
wp_from_pos = stov(argv(0));
if(!wp_from || wp_from.origin!=wp_from_pos)
{
wp_from = findradius(wp_from_pos, 1);
- found = FALSE;
+ found = false;
while(wp_from)
{
if(vlen(wp_from.origin-wp_from_pos)<1)
if(wp_from.classname == "waypoint")
{
- found = TRUE;
+ found = true;
break;
}
wp_from = wp_from.chain;
// Search "to" waypoint
wp_to = findradius(wp_to_pos, 1);
- found = FALSE;
+ found = false;
while(wp_to)
{
if(vlen(wp_to.origin-wp_to_pos)<1)
if(wp_to.classname == "waypoint")
{
- found = TRUE;
+ found = true;
break;
}
wp_to = wp_to.chain;
dprint(mapname);
dprint(".waypoints.cache\n");
- botframe_cachedwaypointlinks = TRUE;
- return TRUE;
+ botframe_cachedwaypointlinks = true;
+ return true;
}
void waypoint_load_links_hardwired()
filename = strcat(filename, ".waypoints.hardwired");
file = fopen(filename, FILE_READ);
- botframe_loadedforcedlinks = TRUE;
+ botframe_loadedforcedlinks = true;
if (file < 0)
{
if(!wp_from || wp_from.origin!=wp_from_pos)
{
wp_from = findradius(wp_from_pos, 5);
- found = FALSE;
+ found = false;
while(wp_from)
{
if(vlen(wp_from.origin-wp_from_pos)<5)
if(wp_from.classname == "waypoint")
{
- found = TRUE;
+ found = true;
break;
}
wp_from = wp_from.chain;
// Search "to" waypoint
wp_to = findradius(wp_to_pos, 5);
- found = FALSE;
+ found = false;
while(wp_to)
{
if(vlen(wp_to.origin-wp_to_pos)<5)
if(wp_to.classname == "waypoint")
{
- found = TRUE;
+ found = true;
break;
}
wp_to = wp_to.chain;
++c;
waypoint_addlink(wp_from, wp_to);
- wp_from.wphardwired = TRUE;
- wp_to.wphardwired = TRUE;
+ wp_from.wphardwired = true;
+ wp_to.wphardwired = true;
}
fclose(file);
w = w.chain;
}
fclose(file);
- botframe_cachedwaypointlinks = TRUE;
+ botframe_cachedwaypointlinks = true;
print("saved ");
print(ftos(c));
bprint(" failed\n");
}
waypoint_save_links();
- botframe_loadedforcedlinks = FALSE;
+ botframe_loadedforcedlinks = false;
}
// load waypoints from file
if (!player.isbot)
if (player.flags & FL_ONGROUND || player.waterlevel > WATERLEVEL_NONE)
{
- //navigation_testtracewalk = TRUE;
- head = navigation_findnearestwaypoint(player, FALSE);
+ //navigation_testtracewalk = true;
+ head = navigation_findnearestwaypoint(player, false);
// print("currently selected WP is ", etos(head), "\n");
- //navigation_testtracewalk = FALSE;
+ //navigation_testtracewalk = false;
if (head)
{
w = head ;if (w) te_lightning2(world, w.origin, player.origin);
{
entity w, w1, w2;
float i, j, k;
- for (w = world; (w = findfloat(w, bot_pickup, TRUE)); )
+ for (w = world; (w = findfloat(w, bot_pickup, true)); )
{
// NOTE: this protects waypoints if they're the ONLY nearest
// waypoint. That's the intention.
- navigation_findnearestwaypoint(w, FALSE); // Walk TO item.
- navigation_findnearestwaypoint(w, TRUE); // Walk FROM item.
+ navigation_findnearestwaypoint(w, false); // Walk TO item.
+ navigation_findnearestwaypoint(w, true); // Walk FROM item.
}
for (w = world; (w = find(w, classname, "waypoint")); )
{
if(p.deadflag)
continue;
// going back is broken, so only fix waypoints to walk TO the player
- //botframe_autowaypoints_fix(p, FALSE, botframe_autowaypoints_lastwp0);
- botframe_autowaypoints_fix(p, TRUE, botframe_autowaypoints_lastwp1);
+ //botframe_autowaypoints_fix(p, false, botframe_autowaypoints_lastwp0);
+ botframe_autowaypoints_fix(p, true, botframe_autowaypoints_lastwp1);
//te_explosion(p.botframe_autowaypoints_lastwp0.origin);
}
IS_CHEAT(i, 0, 0);
if(self.personal)
{
- self.speedrunning = TRUE;
+ self.speedrunning = true;
tracebox(self.personal.origin, self.mins, self.maxs, self.personal.origin, MOVE_WORLDONLY, self);
if(trace_startsolid)
{
setorigin(self, self.personal.origin);
self.oldvelocity = self.velocity = self.personal.velocity;
self.angles = self.personal.v_angle;
- self.fixangle = TRUE;
+ self.fixangle = true;
MUTATOR_CALLHOOK(AbortSpeedrun);
}
self.angles = e.angles;
remove(e);
// should we? self.angles_x = -self.angles_x;
- self.fixangle = TRUE;
+ self.fixangle = true;
self.velocity = '0 0 0';
DID_CHEAT();
break;
{
sprint(self, "Emergency teleport used random location\n");
self.angles_x = -self.angles.x;
- self.fixangle = TRUE;
+ self.fixangle = true;
self.velocity = '0 0 0';
DID_CHEAT();
break;
// arguments:
// effectname
effectnum = particleeffectnum(argv(1));
- W_SetupShot(self, FALSE, FALSE, "", CH_WEAPON_A, 0);
+ W_SetupShot(self, false, false, "", CH_WEAPON_A, 0);
traceline(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, MOVE_NORMAL, self);
trailparticles(self, effectnum, w_shotorg, trace_endpos);
DID_CHEAT();
// arguments:
// modelname mode
f = stof(argv(2));
- W_SetupShot(self, FALSE, FALSE, "", CH_WEAPON_A, 0);
+ W_SetupShot(self, false, false, "", CH_WEAPON_A, 0);
traceline(w_shotorg, w_shotorg + w_shotdir * 2048, MOVE_NORMAL, self);
if((trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT) || trace_fraction == 1)
{
{
// use cheat dragging if cheats are enabled
crosshair_trace_plusvisibletriggers(self);
- Drag(TRUE, TRUE);
+ Drag(true, true);
}
else
{
- Drag(FALSE, FALSE); // execute dragging
+ Drag(false, false); // execute dragging
}
break;
}
{
BEGIN_CHEAT_FUNCTION();
- // returns TRUE when an entity has been picked up
- // If pick is TRUE, the object can also be picked up if it's not being held already
- // If pick is FALSE, only keep dragging the object if it's already being held
+ // returns true when an entity has been picked up
+ // If pick is true, the object can also be picked up if it's not being held already
+ // If pick is false, only keep dragging the object if it's already being held
switch(0)
{
float pick = force_allow_pick;
if (e && !pick)
{
- // pick is TRUE if the object can be picked up. While an object is being carried, the Drag() function
+ // pick is true if the object can be picked up. While an object is being carried, the Drag() function
// must execute for it either way, otherwise it would cause bugs if it went out of the player's trace.
// This also makes sure that an object can only pe picked up if in range, but does not get dropped if
// it goes out of range while slinging it around.
break;
case 1: // owner can grab
if(e.owner == self || e.realowner == self)
- pick = TRUE;
+ pick = true;
break;
case 2: // owner and team mates can grab
if(SAME_TEAM(e.owner, self) || SAME_TEAM(e.realowner, self) || e.team == self.team)
- pick = TRUE;
+ pick = true;
break;
case 3: // anyone can grab
- pick = TRUE;
+ pick = true;
break;
default:
break;
Drag_Begin(self, e, trace_endpos);
if(ischeat)
DID_CHEAT();
- return TRUE;
+ return true;
}
}
}
break;
}
- return FALSE;
+ return false;
}
// on dragger:
{
// TODO add more checks for bad stuff here
if(draggee == world)
- return FALSE;
+ return false;
if(draggee.classname == "func_bobbing")
- return FALSE;
+ return false;
if(draggee.classname == "door") // FIXME find out why these must be excluded, or work around the problem (trying to drag these causes like 4 fps)
- return FALSE;
+ return false;
if(draggee.classname == "plat")
- return FALSE;
+ return false;
if(draggee.classname == "func_button")
- return FALSE;
+ return false;
// if(draggee.model == "")
-// return FALSE;
+// return false;
if(IS_SPEC(draggee))
- return FALSE;
+ return false;
if(IS_OBSERVER(draggee))
- return FALSE;
+ return false;
if(draggee.classname == "exteriorweaponentity")
- return FALSE;
+ return false;
if(draggee.classname == "weaponentity")
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
float Drag_MayChangeAngles(entity draggee)
{
// TODO add more checks for bad stuff here
if(substring(draggee.model, 0, 1) == "*")
- return FALSE;
- return TRUE;
+ return false;
+ return true;
}
void Drag_MoveForward(entity dragger)
float Drag_IsDragging(entity dragger)
{
if(!dragger.dragentity)
- return FALSE;
+ return false;
if(wasfreed(dragger.dragentity) || dragger.dragentity.draggedby != dragger)
{
dragger.dragentity = world;
- return FALSE;
+ return false;
}
if(!Drag_CanDrag(dragger) || !Drag_IsDraggable(dragger.dragentity))
{
Drag_Finish(dragger);
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
void Drag_MoveDrag(entity from, entity to)
if(to != self.owner)
{
error("wtf");
- return FALSE;
+ return false;
}
entity e;
WriteAngle(MSG_ENTITY, e.v_angle.y);
}
- return TRUE;
+ return true;
}
void ClientData_Attach()
{
- Net_LinkEntity(self.clientdata = spawn(), FALSE, 0, ClientData_Send);
+ Net_LinkEntity(self.clientdata = spawn(), false, 0, ClientData_Send);
self.clientdata.drawonlytoclient = self;
self.clientdata.owner = self;
}
if(IS_PLAYER(self)) { pointparticles(particleeffectnum("spawn_event_neutral"), self.origin, '0 0 0', 1); }
- spot = SelectSpawnPoint (TRUE);
+ spot = SelectSpawnPoint (true);
if(!spot)
error("No spawnpoints for observers?!?\n");
RemoveGrapplingHook(self); // Wazat's Grappling Hook
if(autocvar_g_chat_nospectators == 1 || (cvar("g_warmup") && !(warmup_stage || gameover) && autocvar_g_chat_nospectators == 2))
Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_CHAT_NOSPECTATORS);
- if(self.just_joined == FALSE) {
+ if(self.just_joined == false) {
LogTeamchange(self.playerid, -1, 4);
} else
- self.just_joined = FALSE;
+ self.just_joined = false;
}
PlayerScore_Clear(self); // clear scores when needed
self.spectatortime = time;
self.classname = "observer";
- self.iscreature = FALSE;
+ self.iscreature = false;
self.teleportable = TELEPORT_SIMPLE;
- self.damagedbycontents = FALSE;
+ self.damagedbycontents = false;
self.health = -666;
self.takedamage = DAMAGE_NO;
self.solid = SOLID_NOT;
self.deadflag = DEAD_NO;
self.angles = spot.angles;
self.angles_z = 0;
- self.fixangle = TRUE;
- self.crouch = FALSE;
+ self.fixangle = true;
+ self.crouch = false;
self.revival_time = 0;
setorigin (self, (spot.origin + PL_VIEW_OFS)); // offset it so that the spectator spawns higher off the ground, looks better this way
defaultmodel = "";
defaultskin = 0;
- chmdl = FALSE;
+ chmdl = false;
if(autocvar_sv_defaultcharacter == 1)
{
m2 = self.maxs;
setplayermodel (self, defaultmodel);
setsize (self, m1, m2);
- chmdl = TRUE;
+ chmdl = true;
}
oldskin = self.skin;
m2 = self.maxs;
setplayermodel (self, self.playermodel);
setsize (self, m1, m2);
- chmdl = TRUE;
+ chmdl = true;
}
oldskin = self.skin;
accuracy_resend(self);
if(self.team < 0)
- JoinBestTeam(self, FALSE, TRUE);
+ JoinBestTeam(self, false, true);
- spot = SelectSpawnPoint (FALSE);
+ spot = SelectSpawnPoint (false);
if(!spot)
{
Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_JOIN_NOSPAWNS);
vehicles_exit(VHEF_RELESE);
self.classname = "player";
- self.wasplayer = TRUE;
- self.iscreature = TRUE;
+ self.wasplayer = true;
+ self.iscreature = true;
self.teleportable = TELEPORT_NORMAL;
- self.damagedbycontents = TRUE;
+ self.damagedbycontents = true;
self.movetype = MOVETYPE_WALK;
self.solid = SOLID_SLIDEBOX;
self.dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_SOLID;
self.angles_z = 0; // never spawn tilted even if the spot says to
if(IS_BOT_CLIENT(self))
self.v_angle = self.angles;
- self.fixangle = TRUE; // turn this way immediately
+ self.fixangle = true; // turn this way immediately
self.velocity = '0 0 0';
self.avelocity = '0 0 0';
self.punchangle = '0 0 0';
entity spawnevent = spawn();
spawnevent.owner = self;
- Net_LinkEntity(spawnevent, FALSE, 0.5, SpawnEvent_Send);
+ Net_LinkEntity(spawnevent, false, 0.5, SpawnEvent_Send);
// Cut off any still running player sounds.
stopsound(self, CH_PLAYER_SINGLE);
FixPlayermodel();
self.drawonlytoclient = world;
- self.crouch = FALSE;
+ self.crouch = false;
self.view_ofs = PL_VIEW_OFS;
setsize (self, PL_MIN, PL_MAX);
self.spawnorigin = spot.origin;
self.event_damage = PlayerDamage;
- self.bot_attack = TRUE;
- self.monster_attack = TRUE;
+ self.bot_attack = true;
+ self.monster_attack = true;
self.spider_slowness = 0;
self.colormod = '1 1 1' * autocvar_g_player_brightness;
self.exteriorweaponentity.alpha = default_weapon_alpha;
- self.speedrunning = FALSE;
+ self.speedrunning = false;
//stuffcmd(self, "chase_active 0");
//stuffcmd(self, "set viewsize $tmpviewsize \n");
WriteByte(MSG_ENTITY, WEP_CVAR_SEC(hagar, load_max)); // hagar max loadable rockets // WEAPONTODO
WriteCoord(MSG_ENTITY, autocvar_g_trueaim_minrange);
WriteByte(MSG_ENTITY, WEP_CVAR(porto, secondary)); // WEAPONTODO
- return TRUE;
+ return true;
}
void ClientInit_CheckUpdate()
e = spawn();
e.classname = "clientinit";
e.think = ClientInit_CheckUpdate;
- Net_LinkEntity(e, FALSE, 0, ClientInit_SendEntity);
+ Net_LinkEntity(e, false, 0, ClientInit_SendEntity);
o = self;
self = e;
{
if(self.killindicator_teamchange == -1)
{
- JoinBestTeam( self, FALSE, TRUE );
+ JoinBestTeam( self, false, true );
}
else if(self.killindicator_teamchange == -2)
{
if(self.team_forced > 0)
self.team_forced = 0;
- JoinBestTeam(self, FALSE, FALSE); // if the team number is valid, keep it
+ JoinBestTeam(self, false, false); // if the team number is valid, keep it
if((autocvar_sv_spectate == 1) || autocvar_g_campaign || self.team_forced < 0) {
self.classname = "observer";
LogTeamchange(self.playerid, self.team, 1);
- self.just_joined = TRUE; // stop spamming the eventlog with additional lines when the client connects
+ self.just_joined = true; // stop spamming the eventlog with additional lines when the client connects
self.netname_previous = strzone(self.netname);
self.frozen = spectatee.frozen;
self.revive_progress = spectatee.revive_progress;
if(!self.BUTTON_USE)
- self.fixangle = TRUE;
+ self.fixangle = true;
setorigin(self, spectatee.origin);
setsize(self, spectatee.mins, spectatee.maxs);
SetZoomState(spectatee.zoomstate);
self.hud = spectatee.hud;
if(spectatee.vehicle)
{
- self.fixangle = FALSE;
+ self.fixangle = false;
//self.velocity = spectatee.vehicle.velocity;
self.vehicle_health = spectatee.vehicle_health;
self.vehicle_shield = spectatee.vehicle_shield;
float SpectateSet()
{
if(self.enemy.classname != "player")
- return FALSE;
+ return false;
/*if(self.enemy.vehicle)
{
if(!SpectateUpdate())
PutObserverInServer();
//}
- return TRUE;
+ return true;
}
void SetSpectator(entity player, entity spectatee)
// NOTE: chain order is from the highest to the lower entnum (unlike find)
other = findchain(classname, "player");
if (!other) // no player
- return FALSE;
+ return false;
entity first = other;
// skip players until current spectated player
while(other.team != self.team)
other = other.chain;
if(other == self.enemy)
- return TRUE;
+ return true;
}
}
else
nades_RemoveBonus(self);
if(autocvar_g_campaign || autocvar_g_balance_teams)
- { JoinBestTeam(self, FALSE, TRUE); }
+ { JoinBestTeam(self, false, true); }
if(autocvar_g_campaign)
{ campaign_bots_may_start = 1; }
/**
* Determines whether the player is allowed to join. This depends on cvar
- * g_maxplayers, if it isn't used this function always return TRUE, otherwise
+ * g_maxplayers, if it isn't used this function always return true, otherwise
* it checks whether the number of currently playing players exceeds g_maxplayers.
* @return int number of free slots for players, 0 if none
*/
case 192: // charmap space
if (!autocvar_utf8_enable)
break;
- return FALSE;
+ return false;
case 160: // space in unicode fonts
case 0xE000 + 192: // utf8 charmap space
if (autocvar_utf8_enable)
break;
default:
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
/*
// FIXME turn this into CSQC stuff
self.v_angle = self.lastV_angle;
self.angles = self.lastV_angle;
- self.fixangle = TRUE;
+ self.fixangle = true;
}
if(frametime)
}
}
else
- self.weaponentity_glowmod = colormapPaletteColor(self.clientcolors & 0x0F, TRUE) * 2;
+ self.weaponentity_glowmod = colormapPaletteColor(self.clientcolors & 0x0F, true) * 2;
player_powerups();
}
{
if (!self.crouch)
{
- self.crouch = TRUE;
+ self.crouch = true;
self.view_ofs = PL_CROUCH_VIEW_OFS;
setsize (self, PL_CROUCH_MIN, PL_CROUCH_MAX);
- // setanim(self, self.anim_duck, FALSE, TRUE, TRUE); // this anim is BROKEN anyway
+ // setanim(self, self.anim_duck, false, true, true); // this anim is BROKEN anyway
}
}
else
{
if (self.crouch)
{
- tracebox(self.origin, PL_MIN, PL_MAX, self.origin, FALSE, self);
+ tracebox(self.origin, PL_MIN, PL_MAX, self.origin, false, self);
if (!trace_startsolid)
{
- self.crouch = FALSE;
+ self.crouch = false;
self.view_ofs = PL_VIEW_OFS;
setsize (self, PL_MIN, PL_MAX);
}
W_PreviousWeapon(2);
break;
case 17:
- W_ThrowWeapon(W_CalculateProjectileVelocity(self.velocity, v_forward * 750, FALSE), '0 0 0', TRUE);
+ W_ThrowWeapon(W_CalculateProjectileVelocity(self.velocity, v_forward * 750, false), '0 0 0', true);
break;
case 18:
W_NextWeapon(1);
{
if (!MUTATOR_CALLHOOK(HelpMePing))
{
- wp = WaypointSprite_Attach("helpme", TRUE, RADARICON_HELPME, '1 0.5 0');
+ wp = WaypointSprite_Attach("helpme", true, RADARICON_HELPME, '1 0.5 0');
if(!wp)
WaypointSprite_HelpMePing(self.waypointsprite_attachedforcarrier);
else
}
break;
case 34:
- wp = WaypointSprite_DeployFixed("here", FALSE, self.origin, RADARICON_HERE, '0 1 0');
+ wp = WaypointSprite_DeployFixed("here", false, self.origin, RADARICON_HERE, '0 1 0');
if(wp)
WaypointSprite_Ping(wp);
sprint(self, "HERE spawned at location\n");
break;
case 35:
WarpZone_crosshair_trace(self);
- wp = WaypointSprite_DeployFixed("here", FALSE, trace_endpos, RADARICON_HERE, '0 1 0');
+ wp = WaypointSprite_DeployFixed("here", false, trace_endpos, RADARICON_HERE, '0 1 0');
if(wp)
WaypointSprite_Ping(wp);
sprint(self, "HERE spawned at crosshair\n");
case 36:
if(vlen(self.death_origin))
{
- wp = WaypointSprite_DeployFixed("here", FALSE, self.death_origin, RADARICON_HERE, '0 1 0');
+ wp = WaypointSprite_DeployFixed("here", false, self.death_origin, RADARICON_HERE, '0 1 0');
if(wp)
WaypointSprite_Ping(wp);
sprint(self, "HERE spawned at death location\n");
}
break;
case 37:
- wp = WaypointSprite_DeployFixed("danger", FALSE, self.origin, RADARICON_DANGER, '1 0.5 0');
+ wp = WaypointSprite_DeployFixed("danger", false, self.origin, RADARICON_DANGER, '1 0.5 0');
if(wp)
WaypointSprite_Ping(wp);
sprint(self, "DANGER spawned at location\n");
break;
case 38:
WarpZone_crosshair_trace(self);
- wp = WaypointSprite_DeployFixed("danger", FALSE, trace_endpos, RADARICON_DANGER, '1 0.5 0');
+ wp = WaypointSprite_DeployFixed("danger", false, trace_endpos, RADARICON_DANGER, '1 0.5 0');
if(wp)
WaypointSprite_Ping(wp);
sprint(self, "DANGER spawned at crosshair\n");
case 39:
if(vlen(self.death_origin))
{
- wp = WaypointSprite_DeployFixed("danger", FALSE, self.death_origin, RADARICON_DANGER, '1 0.5 0');
+ wp = WaypointSprite_DeployFixed("danger", false, self.death_origin, RADARICON_DANGER, '1 0.5 0');
if(wp)
WaypointSprite_Ping(wp);
sprint(self, "DANGER spawned at death location\n");
bprint(strcat("Waypoint spawned at ",vtos(self.origin),"\n"));
break;
case 104:
- e = navigation_findnearestwaypoint(self, FALSE);
+ e = navigation_findnearestwaypoint(self, false);
if (e)
if (!(e.wpflags & WAYPOINTFLAG_GENERATED))
{
e.colormod = '0.5 0.5 0.5';
e.effects &= ~(EF_NODEPTHTEST | EF_RED | EF_BLUE);
}
- e2 = navigation_findnearestwaypoint(self, FALSE);
+ e2 = navigation_findnearestwaypoint(self, false);
navigation_markroutes(e2);
i = 0;
m = 0;
org = e.origin;
tracebox(e.origin, PL_MIN, PL_MAX, e.origin - '0 0 512', MOVE_NOMONSTERS, world);
setorigin(e, trace_endpos);
- if(navigation_findnearestwaypoint(e, FALSE))
+ if(navigation_findnearestwaypoint(e, false))
{
setorigin(e, org);
e.effects &= ~EF_NODEPTHTEST;
}
for(e = start; e; e = e.chain)
{
- if(navigation_findnearestwaypoint(e, FALSE))
+ if(navigation_findnearestwaypoint(e, false))
{
}
else
for(e = start; e; e = e.chain)
{
org = e.origin;
- if(navigation_findnearestwaypoint(e, TRUE))
+ if(navigation_findnearestwaypoint(e, true))
{
}
else
PlayerJump
When you press the jump key
-returns TRUE if handled
+returns true if handled
=============
*/
float PlayerJump (void)
{
if(self.frozen)
- return TRUE; // no jumping in freezetag when frozen
+ return true; // no jumping in freezetag when frozen
if(self.player_blocked)
- return TRUE; // no jumping while blocked
+ return true; // no jumping while blocked
- float doublejump = FALSE;
+ float doublejump = false;
float mjumpheight = autocvar_sv_jumpvelocity;
player_multijump = doublejump;
player_jumpheight = mjumpheight;
if(MUTATOR_CALLHOOK(PlayerJump))
- return TRUE;
+ return true;
doublejump = player_multijump;
mjumpheight = player_jumpheight;
tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self);
if (trace_fraction < 1 && trace_plane_normal.z > 0.7)
{
- doublejump = TRUE;
+ doublejump = true;
// we MUST clip velocity here!
float f;
if (self.waterlevel >= WATERLEVEL_SWIMMING)
{
self.velocity_z = self.stat_sv_maxspeed * 0.7;
- return TRUE;
+ return true;
}
if (!doublejump)
if(self.cvar_cl_movement_track_canjump)
if (!(self.flags & FL_JUMPRELEASED))
- return TRUE;
+ return true;
// sv_jumpspeedcap_min/sv_jumpspeedcap_max act as baseline
// velocity bounds. Final velocity is bound between (jumpheight *
self.flags &= ~FL_ONGROUND;
self.flags &= ~FL_JUMPRELEASED;
- animdecide_setaction(self, ANIMACTION_JUMP, TRUE);
+ animdecide_setaction(self, ANIMACTION_JUMP, true);
if(autocvar_g_jump_grunt)
PlayerSound(playersound_jump, CH_PLAYER, VOICETYPE_PLAYERSOUND);
self.restart_jump = -1; // restart jump anim next time
// value -1 is used to not use the teleport bit (workaround for tiny hitch when re-jumping)
- return TRUE;
+ return true;
}
void CheckWaterJump()
{
v_forward_z = 0;
normalize(v_forward);
end = start + v_forward*24;
- traceline (start, end, TRUE, self);
+ traceline (start, end, true, self);
if (trace_fraction < 1)
{ // solid at waist
start_z = start.z + self.maxs.z - 8;
end = start + v_forward*24;
self.movedir = trace_plane_normal * -50;
- traceline (start, end, TRUE, self);
+ traceline (start, end, true, self);
if (trace_fraction == 1)
{ // open at eye level
self.flags |= FL_WATERJUMP;
Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_JETPACK_NOFUEL);
else if (activate)
Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_JETPACK_NOFUEL);
- self.jetpack_stopped = TRUE;
+ self.jetpack_stopped = true;
self.items &= ~IT_USING_JETPACK;
}
else if (activate && !self.frozen)
}
else
{
- self.jetpack_stopped = FALSE;
+ self.jetpack_stopped = false;
self.items &= ~IT_USING_JETPACK;
}
if (!self.BUTTON_JUMP)
self.angles_x = random() * 360;
self.angles_y = random() * 360;
// at least I'm not forcing retardedview by also assigning to angles_z
- self.fixangle = TRUE;
+ self.fixangle = true;
}
}
self.think = CopyBody_Think;
// "bake" the current animation frame for clones (they don't get clientside animation)
animdecide_load_if_needed(self);
- animdecide_setframes(self, FALSE, frame, frame1time, frame2, frame2time);
+ animdecide_setframes(self, false, frame, frame1time, frame2, frame2time);
self = oldself;
}
{
// load animation info
animdecide_load_if_needed(self);
- animdecide_setstate(self, 0, FALSE);
+ animdecide_setstate(self, 0, false);
}
void player_anim (void)
animbits |= ANIMSTATE_FROZEN;
if(self.crouch)
animbits |= ANIMSTATE_DUCK;
- animdecide_setstate(self, animbits, FALSE);
+ animdecide_setstate(self, animbits, false);
animdecide_setimplicitstate(self, (self.flags & FL_ONGROUND));
if (self.weaponentity)
{
updateanim(self.weaponentity);
if (!self.weaponentity.animstate_override)
- setanim(self.weaponentity, self.weaponentity.anim_idle, TRUE, FALSE, FALSE);
+ setanim(self.weaponentity, self.weaponentity.anim_idle, true, false, false);
}
}
self.alpha = -1;
self.solid = SOLID_NOT; // restore later
self.takedamage = DAMAGE_NO; // restore later
- self.damagedbycontents = FALSE;
+ self.damagedbycontents = false;
}
}
if (!self.animstate_override)
{
if (random() > 0.5)
- animdecide_setaction(self, ANIMACTION_PAIN1, TRUE);
+ animdecide_setaction(self, ANIMACTION_PAIN1, true);
else
- animdecide_setaction(self, ANIMACTION_PAIN2, TRUE);
+ animdecide_setaction(self, ANIMACTION_PAIN2, true);
}
}
if (self.health < 1)
{
float defer_ClientKill_Now_TeamChange;
- defer_ClientKill_Now_TeamChange = FALSE;
+ defer_ClientKill_Now_TeamChange = false;
if(self.alivetime)
{
remove(self.killindicator);
self.killindicator = world;
if(self.killindicator_teamchange)
- defer_ClientKill_Now_TeamChange = TRUE;
+ defer_ClientKill_Now_TeamChange = true;
if(self.classname == "body")
if(deathtype == DEATH_KILL)
Portal_ClearAllLater(self);
- self.fixangle = TRUE;
+ self.fixangle = true;
if(defer_ClientKill_Now_TeamChange)
ClientKill_Now_TeamChange(); // can turn player into spectator
self.death_time = time;
if (random() < 0.5)
- animdecide_setstate(self, self.anim_state | ANIMSTATE_DEAD1, TRUE);
+ animdecide_setstate(self, self.anim_state | ANIMSTATE_DEAD1, true);
else
- animdecide_setstate(self, self.anim_state | ANIMSTATE_DEAD2, TRUE);
+ animdecide_setstate(self, self.anim_state | ANIMSTATE_DEAD2, true);
if (self.maxs.z > 5)
{
self.maxs_z = 5;
else
{
colorstr = "";
- teamsay = FALSE;
+ teamsay = false;
}
if(intermission_running)
- teamsay = FALSE;
+ teamsay = false;
if(msgin != "")
msgin = trigger_magicear_processmessage_forallears(source, teamsay, privatesay, msgin);
case VOICETYPE_TAUNT:
if(IS_PLAYER(self))
if(self.deadflag == DEAD_NO)
- animdecide_setaction(self, ANIMACTION_TAUNT, TRUE);
+ animdecide_setaction(self, ANIMACTION_TAUNT, true);
if(!sv_taunt)
break;
if(autocvar_sv_gentle)
case VOICETYPE_TAUNT:
if(IS_PLAYER(self))
if(self.deadflag == DEAD_NO)
- animdecide_setaction(self, ANIMACTION_TAUNT, TRUE);
+ animdecide_setaction(self, ANIMACTION_TAUNT, true);
if(!sv_taunt)
break;
if(autocvar_sv_gentle)
if(argc >= 2)
{
entity client = GetIndexedEntity(argc, 1);
- float accepted = VerifyClientEntity(client, TRUE, FALSE);
+ float accepted = VerifyClientEntity(client, true, false);
float reason_arg, bantime, masksize;
string reason;
if(argc >= 2)
{
entity client = GetFilteredEntity(argv(1));
- float accepted = VerifyClientEntity(client, TRUE, FALSE);
+ float accepted = VerifyClientEntity(client, true, false);
if(accepted > 0)
{
- client.muted = TRUE;
+ client.muted = true;
return;
}
else
if(argc >= 2)
{
entity client = GetFilteredEntity(argv(1));
- float accepted = VerifyClientEntity(client, TRUE, FALSE);
+ float accepted = VerifyClientEntity(client, true, false);
if(accepted > 0)
{
- client.muted = FALSE;
+ client.muted = false;
return;
}
else
float BanCommand_macro_command(float argc, string command)
{
#define BAN_COMMAND(name,function,description) \
- { if(name == strtolower(argv(0))) { function; return TRUE; } }
+ { if(name == strtolower(argv(0))) { function; return true; } }
BAN_COMMANDS(CMD_REQUEST_COMMAND, argc, command)
#undef BAN_COMMAND
- return FALSE;
+ return false;
}
float BanCommand_macro_usage(float argc)
{
#define BAN_COMMAND(name,function,description) \
- { if(name == strtolower(argv(1))) { function; return TRUE; } }
+ { if(name == strtolower(argv(1))) { function; return true; } }
BAN_COMMANDS(CMD_REQUEST_USAGE, argc, "")
#undef BAN_COMMAND
- return FALSE;
+ return false;
}
void BanCommand_macro_write_aliases(float fh)
if(BanCommand_macro_command(argc, command)) // continue as usual and scan for normal commands
{
- return TRUE; // handled by one of the above GenericCommand_* functions
+ return true; // handled by one of the above GenericCommand_* functions
}
- return FALSE;
+ return false;
}
if(time <= (self.cmd_floodtime + autocvar_sv_clientcommand_antispam_time))
{
self.cmd_floodcount += 1;
- if(self.cmd_floodcount > autocvar_sv_clientcommand_antispam_count) { return FALSE; } // too much spam, halt
+ if(self.cmd_floodcount > autocvar_sv_clientcommand_antispam_count) { return false; } // too much spam, halt
}
else
{
self.cmd_floodcount = 1;
}
}
- return TRUE; // continue, as we're not flooding yet
+ return true; // continue, as we're not flooding yet
}
}
else if(autocvar_g_campaign || autocvar_g_balance_teams)
{
- //JoinBestTeam(self, FALSE, TRUE);
+ //JoinBestTeam(self, false, true);
}
else if(teamplay && !autocvar_sv_spectate && !(self.team_forced > 0))
{
mon = get_monsterinfo(i);
if(mon.netname == tospawn)
{
- found = TRUE;
+ found = true;
break;
}
}
totalspawned += 1;
makevectors(self.v_angle);
- WarpZone_TraceBox (CENTER_OR_VIEWOFS(self), PL_MIN, PL_MAX, CENTER_OR_VIEWOFS(self) + v_forward * 150, TRUE, self);
+ WarpZone_TraceBox (CENTER_OR_VIEWOFS(self), PL_MIN, PL_MAX, CENTER_OR_VIEWOFS(self) + v_forward * 150, true, self);
//WarpZone_TraceLine(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * 150, MOVE_NORMAL, self);
- e = spawnmonster(tospawn, 0, self, self, trace_endpos, FALSE, FALSE, moveflag);
+ e = spawnmonster(tospawn, 0, self, self, trace_endpos, false, false, moveflag);
sprint(self, strcat("Spawned ", e.monster_name, "\n"));
return;
if (self.ready) // toggle
{
- self.ready = FALSE;
+ self.ready = false;
bprint(self.netname, "^2 is ^1NOT^2 ready\n");
}
else
{
- self.ready = TRUE;
+ self.ready = true;
bprint(self.netname, "^2 is ready\n");
}
{
case CMD_REQUEST_COMMAND:
{
- if(argc >= 2) { Say(self, FALSE, world, substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), 1); }
+ if(argc >= 2) { Say(self, false, world, substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), 1); }
return; // never fall through to usage
}
{
case CMD_REQUEST_COMMAND:
{
- if(argc >= 2) { Say(self, TRUE, world, substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), 1); }
+ if(argc >= 2) { Say(self, true, world, substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), 1); }
return; // never fall through to usage
}
if(argc >= 3)
{
entity tell_to = GetIndexedEntity(argc, 1);
- float tell_accepted = VerifyClientEntity(tell_to, TRUE, FALSE);
+ float tell_accepted = VerifyClientEntity(tell_to, true, false);
if(tell_accepted > 0) // the target is a real client
{
if(tell_to != self) // and we're allowed to send to them :D
{
- Say(self, FALSE, tell_to, substring(command, argv_start_index(next_token), argv_end_index(-1) - argv_start_index(next_token)), TRUE);
+ Say(self, false, tell_to, substring(command, argv_start_index(next_token), argv_end_index(-1) - argv_start_index(next_token)), true);
return;
}
else { print_to(self, "You can't ^2tell^7 a message to yourself."); return; }
float ClientCommand_macro_command(float argc, string command)
{
#define CLIENT_COMMAND(name,function,description) \
- { if(name == strtolower(argv(0))) { function; return TRUE; } }
+ { if(name == strtolower(argv(0))) { function; return true; } }
CLIENT_COMMANDS(CMD_REQUEST_COMMAND, argc, command)
#undef CLIENT_COMMAND
- return FALSE;
+ return false;
}
float ClientCommand_macro_usage(float argc)
{
#define CLIENT_COMMAND(name,function,description) \
- { if(name == strtolower(argv(1))) { function; return TRUE; } }
+ { if(name == strtolower(argv(1))) { function; return true; } }
CLIENT_COMMANDS(CMD_REQUEST_USAGE, argc, "")
#undef CLIENT_COMMAND
- return FALSE;
+ return false;
}
void ClientCommand_macro_write_aliases(float fh)
default:
if(SV_ParseClientCommand_floodcheck())
- break; // "TRUE": continue, as we're not flooding yet
+ break; // "true": continue, as we're not flooding yet
else
- return; // "FALSE": not allowed to continue, halt // print("^1ERROR: ^7ANTISPAM CAUGHT: ", command, ".\n");
+ return; // "false": not allowed to continue, halt // print("^1ERROR: ^7ANTISPAM CAUGHT: ", command, ".\n");
}
/* NOTE: should this be disabled? It can be spammy perhaps, but hopefully it's okay for now */
float VerifyClientNumber(float tmp_number)
{
if((tmp_number < 1) || (tmp_number > maxclients))
- return FALSE;
+ return false;
else
- return TRUE;
+ return true;
}
entity GetIndexedEntity(float argc, float start_index)
// unlock the view for players so they can move around again
FOR_EACH_REALPLAYER(tmp_player)
- tmp_player.fixangle = FALSE;
+ tmp_player.fixangle = false;
timeout_handler_reset();
}
print_to(caller, strcat("realtime = ", ftos(gettime(GETTIME_REALTIME))));
print_to(caller, strcat("hires = ", ftos(gettime(GETTIME_HIRES))));
print_to(caller, strcat("uptime = ", ftos(gettime(GETTIME_UPTIME))));
- print_to(caller, strcat("localtime = ", strftime(TRUE, "%a %b %e %H:%M:%S %Z %Y")));
- print_to(caller, strcat("gmtime = ", strftime(FALSE, "%a %b %e %H:%M:%S %Z %Y")));
+ print_to(caller, strcat("localtime = ", strftime(true, "%a %b %e %H:%M:%S %Z %Y")));
+ print_to(caller, strcat("gmtime = ", strftime(false, "%a %b %e %H:%M:%S %Z %Y")));
return;
}
float CommonCommand_macro_command(float argc, entity caller, string command)
{
#define COMMON_COMMAND(name,function,description) \
- { if(name == strtolower(argv(0))) { function; return TRUE; } }
+ { if(name == strtolower(argv(0))) { function; return true; } }
COMMON_COMMANDS(CMD_REQUEST_COMMAND, caller, argc, command)
#undef COMMON_COMMAND
- return FALSE;
+ return false;
}
float CommonCommand_macro_usage(float argc, entity caller)
{
#define COMMON_COMMAND(name,function,description) \
- { if(name == strtolower(argv(1))) { function; return TRUE; } }
+ { if(name == strtolower(argv(1))) { function; return true; } }
COMMON_COMMANDS(CMD_REQUEST_USAGE, caller, argc, "")
#undef COMMON_COMMAND
- return FALSE;
+ return false;
}
void CommonCommand_macro_write_aliases(float fh)
(g_cts && !stof(db_get(ServerProgsDB, strcat(MapInfo_Map_bspname, CTS_RECORD, "time"))))
)
{
- newmaps = TRUE;
+ newmaps = true;
if(i % 2) { col = "^4*"; }
else { col = "^5*"; }
}
c = trace_endpos;
}
- n += tracebox_inverted(c, mi, ma, b, MOVE_WORLDONLY, world, FALSE, world);
+ n += tracebox_inverted(c, mi, ma, b, MOVE_WORLDONLY, world, false, world);
white += vlen(trace_endpos - c);
c = trace_endpos;
if(radarmapper) // after doing the arguments, see if we successfully went forward.
{
print("Radarmap entity spawned.\n");
- return TRUE; // if so, don't print usage.
+ return true; // if so, don't print usage.
}
}
- return FALSE;
+ return false;
}
// Check to see if the player is a valid target
client = GetFilteredEntity(t);
- accepted = VerifyClientEntity(client, TRUE, FALSE);
+ accepted = VerifyClientEntity(client, true, false);
if(accepted <= 0)
{
case CMD_REQUEST_COMMAND:
{
entity client = GetIndexedEntity(argc, 1);
- float accepted = VerifyClientEntity(client, FALSE, FALSE);
+ float accepted = VerifyClientEntity(client, false, false);
if(accepted > 0)
{
if(argc >= 2)
{
client = GetIndexedEntity(argc, 1);
- accepted = VerifyClientEntity(client, TRUE, FALSE);
+ accepted = VerifyClientEntity(client, true, false);
if(accepted > 0)
{
// Check to see if the player is a valid target
client = GetFilteredEntity(t);
- accepted = VerifyClientEntity(client, FALSE, FALSE);
+ accepted = VerifyClientEntity(client, false, false);
if(accepted <= 0)
{
else if(team_id == 0) // auto team
{
CheckAllowedTeams(client);
- team_id = Team_NumberToTeam(FindSmallestTeam(client, FALSE));
+ team_id = Team_NumberToTeam(FindSmallestTeam(client, false));
}
else
{
case "read":
{
client = GetIndexedEntity(argc, 2);
- accepted = VerifyClientEntity(client, FALSE, TRUE);
+ accepted = VerifyClientEntity(client, false, true);
if(accepted <= 0)
{
case "write":
{
client = GetIndexedEntity(argc, 2);
- accepted = VerifyClientEntity(client, FALSE, FALSE);
+ accepted = VerifyClientEntity(client, false, false);
if(accepted <= 0)
{
{
case CMD_REQUEST_COMMAND:
{
- DumpStats(FALSE);
+ DumpStats(false);
print("stats dumped.\n");
return;
}
if(argv(2))
{
entity client = GetIndexedEntity(argc, 1);
- float accepted = VerifyClientEntity(client, TRUE, FALSE);
+ float accepted = VerifyClientEntity(client, true, false);
if(accepted > 0)
{
float GameCommand_macro_command(float argc, string command)
{
#define SERVER_COMMAND(name,function,description) \
- { if(name == strtolower(argv(0))) { function; return TRUE; } }
+ { if(name == strtolower(argv(0))) { function; return true; } }
SERVER_COMMANDS(CMD_REQUEST_COMMAND, argc, command)
#undef SERVER_COMMAND
- return FALSE;
+ return false;
}
float GameCommand_macro_usage(float argc)
{
#define SERVER_COMMAND(name,function,description) \
- { if(name == strtolower(argv(1))) { function; return TRUE; } }
+ { if(name == strtolower(argv(1))) { function; return true; } }
SERVER_COMMANDS(CMD_REQUEST_USAGE, argc, "")
#undef SERVER_COMMAND
- return FALSE;
+ return false;
}
void GameCommand_macro_write_aliases(float fh)
}
}
- return TRUE;
+ return true;
}
void Nagger_Init()
{
- Net_LinkEntity(nagger = spawn(), FALSE, 0, Nagger_SendEntity);
+ Net_LinkEntity(nagger = spawn(), false, 0, Nagger_SendEntity);
}
void Nagger_VoteChanged()
if(vote_endtime > 0) // a vote was called
if(time > vote_endtime) // time is up
{
- VoteCount(FALSE);
+ VoteCount(false);
}
return;
void ReadyRestart_think()
{
restart_mapalreadyrestarted = 1;
- reset_map(TRUE);
+ reset_map(true);
Score_ClearAll();
remove(self);
if(autocvar_sv_timeout) { FOR_EACH_REALPLAYER(tmp_player) { tmp_player.allowed_timeouts = autocvar_sv_timeout_number; } }
//reset map immediately if this cvar is not set
- if (!autocvar_sv_ready_restart_after_countdown) { reset_map(TRUE); }
+ if (!autocvar_sv_ready_restart_after_countdown) { reset_map(true); }
if(autocvar_sv_eventlog) { GameLogEcho(":restart"); }
}
|| ((!from_server && assignment == VC_ASGNMNT_CLIENTONLY)
|| (from_server && assignment == VC_ASGNMNT_SERVERONLY)))
{
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
string VoteCommand_extractcommand(string input, float startpos, float argc)
|| (strstrofs(vote_command, "\n", 0) >= 0)
|| (strstrofs(vote_command, "\r", 0) >= 0)
|| (strstrofs(vote_command, "$", 0) >= 0))
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
float VoteCommand_checkinlist(string vote_command, string list)
string l = strcat(" ", list, " ");
if(strstrofs(l, strcat(" ", vote_command, " "), 0) >= 0)
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
string ValidateMap(string validated_map, entity caller)
float checkmate;
if(cmdrestriction == "")
- return TRUE;
+ return true;
++startpos; // skip command name
minargs = stof(cmdrestriction);
if(argc - startpos < minargs)
- return FALSE;
+ return false;
p = strstrofs(cmdrestriction, ";", 0); // find first semicolon
break;
// otherwise fail
- return FALSE;
+ return false;
}
// cut to next semicolon
checkmate = strlen(arg);
for(check = 0; check < checkmate; ++check)
if(strstrofs(charlist, substring(arg, check, 1), 0) < 0)
- return FALSE; // not allowed character
+ return false; // not allowed character
// all characters are allowed. FINE.
}
p = q;
}
- return TRUE;
+ return true;
}
float VoteCommand_parse(entity caller, string vote_command, string vote_list, float startpos, float argc)
&&
(strlen(substring(vote_command, argv_start_index(startpos), strlen(vote_command) - argv_start_index(startpos))) > autocvar_sv_vote_limit)
)
- return FALSE;
+ return false;
if (!VoteCommand_checkinlist(first_command, vote_list))
- return FALSE;
+ return false;
if (!VoteCommand_checkargs(startpos, argc))
- return FALSE;
+ return false;
switch(first_command) // now go through and parse the proper commands to adjust as needed.
{
case "kickban": // catch all kick/kickban commands
{
entity victim = GetIndexedEntity(argc, (startpos + 1));
- float accepted = VerifyClientEntity(victim, TRUE, FALSE);
+ float accepted = VerifyClientEntity(victim, true, false);
if(accepted > 0)
{
vote_parsed_command = strcat(first_command, " # ", ftos(num_for_edict(victim)), " ", command_arguments);
vote_parsed_display = strcat("^1", vote_command, " (^7", victim.netname, "^1): ", reason);
}
- else { print_to(caller, strcat("vcall: ", GetClientErrorString(accepted, argv(startpos + 1)), ".\n")); return FALSE; }
+ else { print_to(caller, strcat("vcall: ", GetClientErrorString(accepted, argv(startpos + 1)), ".\n")); return false; }
break;
}
case "gotomap": // re-direct all map selection commands to gotomap
{
vote_command = ValidateMap(argv(startpos + 1), caller);
- if (!vote_command) { return FALSE; }
+ if (!vote_command) { return false; }
vote_parsed_command = strcat("gotomap ", vote_command);
vote_parsed_display = strzone(strcat("^1", vote_parsed_command));
}
}
- return TRUE;
+ return true;
}
print_to(caller, "^1You abstained from your vote.");
caller.vote_selection = VOTE_SELECT_ABSTAIN;
msg_entity = caller;
- if(!autocvar_sv_vote_singlecount) { VoteCount(FALSE); }
+ if(!autocvar_sv_vote_singlecount) { VoteCount(false); }
}
return;
bprint("\{1}^2* ^3", GetCallerName(vote_caller), "^2 calls a vote for ", vote_called_display, "\n");
if(autocvar_sv_eventlog) { GameLogEcho(strcat(":vote:vcall:", ftos(vote_caller.playerid), ":", vote_called_display)); }
Nagger_VoteChanged();
- VoteCount(TRUE); // needed if you are the only one
+ VoteCount(true); // needed if you are the only one
}
return;
else // everything went okay, proceed with giving this player master privilages
{
- caller.vote_master = TRUE;
+ caller.vote_master = true;
print_to(caller, strcat("Accepted vote master login from ", GetCallerName(caller)));
bprint("\{1}^2* ^3", GetCallerName(caller), "^2 logged in as ^3master^2\n");
if(autocvar_sv_eventlog) { GameLogEcho(strcat(":vote:vlogin:", ftos(caller.playerid))); }
bprint("\{1}^2* ^3", GetCallerName(vote_caller), "^2 calls a vote to become ^3master^2.\n");
if(autocvar_sv_eventlog) { GameLogEcho(strcat(":vote:vcall:", ftos(vote_caller.playerid), ":", vote_called_display)); }
Nagger_VoteChanged();
- VoteCount(TRUE); // needed if you are the only one
+ VoteCount(true); // needed if you are the only one
}
return;
print_to(caller, "^1You rejected the vote.");
caller.vote_selection = VOTE_SELECT_REJECT;
msg_entity = caller;
- if(!autocvar_sv_vote_singlecount) { VoteCount(FALSE); }
+ if(!autocvar_sv_vote_singlecount) { VoteCount(false); }
}
return;
print_to(caller, "^1You accepted the vote.");
caller.vote_selection = VOTE_SELECT_ACCEPT;
msg_entity = caller;
- if(!autocvar_sv_vote_singlecount) { VoteCount(FALSE); }
+ if(!autocvar_sv_vote_singlecount) { VoteCount(false); }
}
return;
float VoteCommand_macro_command(entity caller, float argc, string vote_command)
{
#define VOTE_COMMAND(name,function,description,assignment) \
- { if(Votecommand_check_assignment(caller, assignment)) { if(name == strtolower(argv(1))) { function; return TRUE; } } }
+ { if(Votecommand_check_assignment(caller, assignment)) { if(name == strtolower(argv(1))) { function; return true; } } }
VOTE_COMMANDS(CMD_REQUEST_COMMAND, caller, argc, vote_command)
#undef VOTE_COMMAND
- return FALSE;
+ return false;
}
#define MIF_GUIDED_TRACKING (MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG)
#define MIF_GUIDED_CONFUSABLE (MIF_GUIDED_HEAT | MIF_GUIDED_AI)
-#define MISSILE_IS_CONFUSABLE(m) ((m.missile_flags & MIF_GUIDED_CONFUSABLE) ? TRUE : FALSE)
-#define MISSILE_IS_GUIDED(m) ((m.missile_flags & MIF_GUIDED_ALL) ? TRUE : FALSE)
-#define MISSILE_IS_TRACKING(m) ((m.missile_flags & MIF_GUIDED_TRACKING) ? TRUE : FALSE)
+#define MISSILE_IS_CONFUSABLE(m) ((m.missile_flags & MIF_GUIDED_CONFUSABLE) ? true : false)
+#define MISSILE_IS_GUIDED(m) ((m.missile_flags & MIF_GUIDED_ALL) ? true : false)
+#define MISSILE_IS_TRACKING(m) ((m.missile_flags & MIF_GUIDED_TRACKING) ? true : false)
////
entity o;
o = self.owner;
if(o.deadflag != DEAD_NO)
- return FALSE;
+ return false;
if (!IS_PLAYER(o))
- return FALSE;
+ return false;
if(other == o)
- return FALSE;
+ return false;
if((IS_PLAYER(other)) || other.caplayer)
if(!teamplay || o.team != other.team)
if (!radar_showennemies)
- return FALSE;
- return TRUE;
+ return false;
+ return true;
}
float entcs_send(entity to, float sf)
WriteByte(MSG_ENTITY, self.health / 10); // FIXME use a better scale?
if(sf & 16)
WriteByte(MSG_ENTITY, self.armorvalue / 10); // FIXME use a better scale?
- return TRUE;
+ return true;
}
void entcs_think()
ent.think = entcs_think;
ent.nextthink = time;
- Net_LinkEntity(ent, FALSE, 0, entcs_send);
+ Net_LinkEntity(ent, false, 0, entcs_send);
ent.customizeentityforclient = entcs_customize;
self.entcs = ent;
{
self.health = self.max_health;
self.takedamage = DAMAGE_NO;
- self.bot_attack = FALSE;
+ self.bot_attack = false;
self.event_damage = func_null;
self.state = 1;
func_breakable_colormod();
WaypointSprite_UpdateHealth(self.sprite, self.health);
}
self.takedamage = DAMAGE_AIM;
- self.bot_attack = TRUE;
+ self.bot_attack = true;
self.event_damage = func_breakable_damage;
self.state = 0;
self.nextthink = 0; // cancel auto respawn
WriteByte(MSG_ENTITY, self.angles.x * 256 / 360);
WriteByte(MSG_ENTITY, self.angles.y * 256 / 360);
WriteByte(MSG_ENTITY, self.angles.z * 256 / 360);
- return TRUE;
+ return true;
}
void SpawnCasing(vector vel, float randomvel, vector ang, vector avel, float randomavel, float casingtype, entity casingowner)
e.angles = ang;
e.oldorigin_x = compressShortVector(e.velocity);
- Net_LinkEntity(e, TRUE, 0.2, Casing_SendEntity);
+ Net_LinkEntity(e, true, 0.2, Casing_SendEntity);
// 0.2s should be enough time for all clients to receive this ent once, do the gibbage and be done with it
}
WriteByte(MSG_ENTITY, bound(1, self.dmg_edge, 255));
WriteShort(MSG_ENTITY, self.oldorigin.x);
WriteByte(MSG_ENTITY, self.species);
- return TRUE;
+ return true;
}
void Damage_DamageInfo(vector org, float coredamage, float edgedamage, float rad, vector force, float deathtype, float bloodtype, entity dmgowner)
e.oldorigin_x = compressShortVector(e.velocity);
e.species = bloodtype;
- Net_LinkEntity(e, FALSE, 0.2, Damage_DamageInfo_SendEntity);
+ Net_LinkEntity(e, false, 0.2, Damage_DamageInfo_SendEntity);
}
float checkrules_firstblood;
{
w_deathtype = deathtype;
float death_message = WEP_ACTION(death_weapon, ((murder) ? WR_KILLMESSAGE : WR_SUICIDEMESSAGE));
- w_deathtype = FALSE;
+ w_deathtype = false;
if(death_message)
{
);
}
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void Obituary(entity attacker, entity inflictor, entity targ, float deathtype)
if (!IS_PLAYER(targ)) { backtrace("Obituary called on non-player?!\n"); return; }
// Declarations
- float notif_firstblood = FALSE;
+ float notif_firstblood = false;
float kill_count_to_attacker, kill_count_to_target;
// Set final information for the death
{
if(deathtype == DEATH_TEAMCHANGE || deathtype == DEATH_AUTOTEAMCHANGE)
{
- Obituary_SpecialDeath(targ, FALSE, deathtype, targ.netname, deathlocation, "", targ.team, 0, 0);
+ Obituary_SpecialDeath(targ, false, deathtype, targ.netname, deathlocation, "", targ.team, 0, 0);
}
else
{
{
case DEATH_MIRRORDAMAGE:
{
- Obituary_SpecialDeath(targ, FALSE, deathtype, targ.netname, deathlocation, "", targ.killcount, 0, 0);
+ Obituary_SpecialDeath(targ, false, deathtype, targ.netname, deathlocation, "", targ.killcount, 0, 0);
break;
}
default:
{
- Obituary_SpecialDeath(targ, FALSE, deathtype, targ.netname, deathlocation, "", targ.killcount, 0, 0);
+ Obituary_SpecialDeath(targ, false, deathtype, targ.netname, deathlocation, "", targ.killcount, 0, 0);
break;
}
}
}
}
- else if (!Obituary_WeaponDeath(targ, FALSE, deathtype, targ.netname, deathlocation, "", targ.killcount, 0))
+ else if (!Obituary_WeaponDeath(targ, false, deathtype, targ.netname, deathlocation, "", targ.killcount, 0))
{
backtrace("SUICIDE: what the hell happened here?\n");
return;
if(!checkrules_firstblood)
{
- checkrules_firstblood = TRUE;
- notif_firstblood = TRUE; // modify the current messages so that they too show firstblood information
+ checkrules_firstblood = true;
+ notif_firstblood = true; // modify the current messages so that they too show firstblood information
PS_GR_P_ADDVAL(attacker, PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD, 1);
PS_GR_P_ADDVAL(targ, PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM, 1);
);
}
- if (!Obituary_WeaponDeath(targ, TRUE, deathtype, targ.netname, attacker.netname, deathlocation, targ.killcount, kill_count_to_attacker))
- Obituary_SpecialDeath(targ, TRUE, deathtype, targ.netname, attacker.netname, deathlocation, targ.killcount, kill_count_to_attacker, 0);
+ if (!Obituary_WeaponDeath(targ, true, deathtype, targ.netname, attacker.netname, deathlocation, targ.killcount, kill_count_to_attacker))
+ Obituary_SpecialDeath(targ, true, deathtype, targ.netname, attacker.netname, deathlocation, targ.killcount, kill_count_to_attacker, 0);
}
}
case DEATH_CUSTOM:
{
- Obituary_SpecialDeath(targ, FALSE, deathtype,
+ Obituary_SpecialDeath(targ, false, deathtype,
targ.netname,
((strstrofs(deathmessage, "%", 0) < 0) ? strcat("%s ", deathmessage) : deathmessage),
deathlocation,
default:
{
- Obituary_SpecialDeath(targ, FALSE, deathtype, targ.netname, deathlocation, "", targ.killcount, 0, 0);
+ Obituary_SpecialDeath(targ, false, deathtype, targ.netname, deathlocation, "", targ.killcount, 0, 0);
break;
}
}
// add waypoint
if(show_waypoint)
- WaypointSprite_Spawn("frozen", 0, 0, targ, '0 0 64', world, targ.team, targ, waypointsprite_attached, TRUE, RADARICON_WAYPOINT, '0.25 0.90 1');
+ WaypointSprite_Spawn("frozen", 0, 0, targ, '0 0 64', world, targ.team, targ, waypointsprite_attached, true, RADARICON_WAYPOINT, '0.25 0.90 1');
}
void Unfreeze (entity targ)
entity oldself = self;
self = targ;
- entity spot = SelectSpawnPoint (FALSE);
+ entity spot = SelectSpawnPoint (false);
if(spot)
{
self.effects |= EF_TELEPORT_BIT;
self.angles_z = 0; // never spawn tilted even if the spot says to
- self.fixangle = TRUE; // turn this way immediately
+ self.fixangle = true; // turn this way immediately
self.velocity = '0 0 0';
self.avelocity = '0 0 0';
self.punchangle = '0 0 0';
stat_damagedone = 0;
- targ = WarpZone_FindRadius (inflictororigin, rad + MAX_DAMAGEEXTRARADIUS, FALSE);
+ targ = WarpZone_FindRadius (inflictororigin, rad + MAX_DAMAGEEXTRARADIUS, false);
while (targ)
{
next = targ.chain;
float RadiusDamage (entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, float deathtype, entity directhitentity)
{
- return RadiusDamageForSource (inflictor, (inflictor.origin + (inflictor.mins + inflictor.maxs) * 0.5), inflictor.velocity, attacker, coredamage, edgedamage, rad, cantbe, mustbe, FALSE, forceintensity, deathtype, directhitentity);
+ return RadiusDamageForSource (inflictor, (inflictor.origin + (inflictor.mins + inflictor.maxs) * 0.5), inflictor.velocity, attacker, coredamage, edgedamage, rad, cantbe, mustbe, false, forceintensity, deathtype, directhitentity);
}
.float fire_damagepersec;
if(e.fire_owner != o)
{
e.fire_owner = o;
- e.fire_hitsound = FALSE;
+ e.fire_hitsound = false;
}
}
if(accuracy_isgooddamage(o, e))
e.fire_endtime = time + t;
e.fire_deathtype = dt;
e.fire_owner = o;
- e.fire_hitsound = FALSE;
+ e.fire_hitsound = false;
if(accuracy_isgooddamage(o, e))
accuracy_add(o, DEATH_WEAPONOFWEAPONDEATH(dt), 0, d);
return d;
e.fire_owner.damage_dealt = hi;
e.fire_owner.typehitsound = ty;
}
- e.fire_hitsound = TRUE;
+ e.fire_hitsound = true;
if (!IS_INDEPENDENT_PLAYER(e))
if(!e.frozen)
if(pl.movetype == MOVETYPE_FLY)
pl.movetype = MOVETYPE_WALK;
- //pl.disableclientprediction = FALSE;
+ //pl.disableclientprediction = false;
}
void GrapplingHookReset(void)
WriteCoord(MSG_ENTITY, self.hook_end.y);
WriteCoord(MSG_ENTITY, self.hook_end.z);
}
- return TRUE;
+ return true;
}
void GrapplingHookThink()
WarpZone_RefSys_BeginAddingIncrementally(self, self.aiment);
}
- //self.realowner.disableclientprediction = TRUE;
+ //self.realowner.disableclientprediction = true;
}
void GrapplingHook_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
missile.state = 0; // not latched onto anything
- W_SetupProjVelocity_Explicit(missile, v_forward, v_up, autocvar_g_balance_grapplehook_speed_fly, 0, 0, 0, FALSE);
+ W_SetupProjVelocity_Explicit(missile, v_forward, v_up, autocvar_g_balance_grapplehook_speed_fly, 0, 0, 0, false);
missile.angles = vectoangles (missile.velocity);
//missile.glow_color = 250; // 244, 250
missile.hook_start = missile.hook_end = missile.origin;
- Net_LinkEntity(missile, FALSE, 0, GrapplingHookSend);
+ Net_LinkEntity(missile, false, 0, GrapplingHookSend);
}
// void GrapplingHookFrame()
else
{
WEP_ACTION(WEP_HOOK, WR_INIT);
- hook_shotorigin[0] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_HOOK), FALSE, FALSE, 1);
- hook_shotorigin[1] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_HOOK), FALSE, FALSE, 2);
- hook_shotorigin[2] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_HOOK), FALSE, FALSE, 3);
- hook_shotorigin[3] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_HOOK), FALSE, FALSE, 4);
+ hook_shotorigin[0] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_HOOK), false, false, 1);
+ hook_shotorigin[1] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_HOOK), false, false, 2);
+ hook_shotorigin[2] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_HOOK), false, false, 3);
+ hook_shotorigin[3] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_HOOK), false, false, 4);
}
}
}
}
- return TRUE;
+ return true;
}
InitializeEntity(self, g_clientmodel_dropbyspawnflags, INITPRIO_DROPTOFLOOR); \
if(!self.solid) self.solid = (sol); else if(self.solid < 0) self.solid = SOLID_NOT; \
if(!self.bgmscriptsustain) self.bgmscriptsustain = 1; else if(self.bgmscriptsustain < 0) self.bgmscriptsustain = 0; \
- Net_LinkEntity(self, TRUE, 0, g_clientmodel_genericsendentity);
+ Net_LinkEntity(self, true, 0, g_clientmodel_genericsendentity);
// non-solid model entities:
void spawnfunc_misc_gamemodel() { self.angles_x = -self.angles.x; G_MODEL_INIT (SOLID_NOT) } // model entity
e.animstate_starttime = e.animstate_endtime;
e.animstate_endtime = e.animstate_starttime + e.animstate_numframes / e.animstate_framerate;
}
- e.animstate_override = FALSE;
+ e.animstate_override = false;
}
e.frame = e.animstate_startframe + bound(0, (time - e.animstate_starttime) * e.animstate_framerate, e.animstate_numframes - 1);
//print(ftos(time), " -> ", ftos(e.frame), "\n");
}
void traceline_antilag_force (entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
{
- tracebox_antilag_force_wz(source, v1, '0 0 0', '0 0 0', v2, nomonst, forent, lag, FALSE);
+ tracebox_antilag_force_wz(source, v1, '0 0 0', '0 0 0', v2, nomonst, forent, lag, false);
}
void traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
{
{
if (autocvar_g_antilag != 2 || source.cvar_cl_noantilag)
lag = 0;
- tracebox_antilag_force_wz(source, v1, mi, ma, v2, nomonst, forent, lag, FALSE);
+ tracebox_antilag_force_wz(source, v1, mi, ma, v2, nomonst, forent, lag, false);
}
void WarpZone_traceline_antilag_force (entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
{
- tracebox_antilag_force_wz(source, v1, '0 0 0', '0 0 0', v2, nomonst, forent, lag, TRUE);
+ tracebox_antilag_force_wz(source, v1, '0 0 0', '0 0 0', v2, nomonst, forent, lag, true);
}
void WarpZone_traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
{
{
if (autocvar_g_antilag != 2 || source.cvar_cl_noantilag)
lag = 0;
- tracebox_antilag_force_wz(source, v1, mi, ma, v2, nomonst, forent, lag, TRUE);
+ tracebox_antilag_force_wz(source, v1, mi, ma, v2, nomonst, forent, lag, true);
}
float tracebox_inverted (vector v1, vector mi, vector ma, vector v2, float nomonsters, entity forent, float stopatentity, entity ignorestopatentity) // returns the number of traces done, for benchmarking
c = 0;
while (c < 6)
{
- traceline (org, org + vec, TRUE, world);
+ traceline (org, org + vec, true, world);
vec = vec * -1;
if (trace_fraction < 1)
{
loc = trace_endpos;
- traceline (loc, loc + vec, TRUE, world);
+ traceline (loc, loc + vec, true, world);
if (trace_fraction >= 1)
org = loc + vec;
}
self.modelindex = self.lodmodelindex1;
else // if(d == 3)
self.modelindex = self.lodmodelindex2;
- return TRUE;
+ return true;
}
// TODO csqc network this so it only gets sent once
else
self.modelindex = self.lodmodelindex2;
- return TRUE;
+ return true;
}
void LOD_uncustomize()
PieceMinsMaxs(rot, piece);
if (tet_piecemins.x+orgx<1 || tet_piecemaxs.x+orgx > TET_WIDTH || tet_piecemins.y+orgy<1 || tet_piecemaxs.y+orgy> TET_LINES)
- return FALSE; // ouside the level
+ return false; // ouside the level
for (y = tet_piecemins.y; y <= tet_piecemaxs.y; y = y + 1)
{
l = GetLine(y + orgy);
for (x = tet_piecemins.x; x <= tet_piecemaxs.x; x = x + 1)
if (PieceMetric(x, y, rot, piece))
if (GetXBlock(x + orgx, l))
- return FALSE; // uhoh, gonna hit something.
+ return false; // uhoh, gonna hit something.
}
- return TRUE;
+ return true;
}
void ClearPiece(float piece, float orgx, float orgy, float rot) /*FIXDECL*/
for(th = trigger_hurt_first; th; th = th.trigger_hurt_next)
if(tracebox_hits_box(start, mi, ma, end, th.absmin, th.absmax))
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
//////////////////////////////////////////////////////////////
{
float g;
- if(self.state != TRUE)
+ if(self.state != true)
return;
EXACTTRIGGER_TOUCH;
if(self.noise != "")
precache_sound(self.noise);
- self.state = TRUE;
+ self.state = true;
IFTARGETED
{
self.use = trigger_gravity_use;
if(self.spawnflags & 2)
- self.state = FALSE;
+ self.state = false;
}
}
self.state = 1; // 1 is rain, 0 is snow
self.Version = 1;
- Net_LinkEntity(self, FALSE, 0, rainsnow_SendEntity);
+ Net_LinkEntity(self, false, 0, rainsnow_SendEntity);
}
self.state = 0; // 1 is rain, 0 is snow
self.Version = 1;
- Net_LinkEntity(self, FALSE, 0, rainsnow_SendEntity);
+ Net_LinkEntity(self, false, 0, rainsnow_SendEntity);
}
.float modelscale;
self.mangle = self.angles;
- Net_LinkEntity(self, FALSE, 0, laser_SendEntity);
+ Net_LinkEntity(self, false, 0, laser_SendEntity);
IFTARGETED
{
entity oldself;
string savemessage;
- magicear_matched = FALSE;
+ magicear_matched = false;
dotrigger = ((IS_PLAYER(source)) && (source.deadflag == DEAD_NO) && ((ear.radius == 0) || (vlen(source.origin - ear.origin) <= ear.radius)));
domatch = ((ear.spawnflags & 32) || dotrigger);
if(!W_Tuba_HasPlayed(source, ear.message, ear.movedir.x, !(ear.spawnflags & 512), ear.movedir.y, ear.movedir.z))
return msgin;
- magicear_matched = TRUE;
+ magicear_matched = true;
if(dotrigger)
{
if(matchstart == -1) // no match
return msgin;
- magicear_matched = TRUE;
+ magicear_matched = true;
if(dotrigger)
{
WriteShort(MSG_ENTITY, floor(self.origin.y / 4)); // not using a coord here, as gibs don't need this accuracy
WriteShort(MSG_ENTITY, floor(self.origin.z / 4)); // not using a coord here, as gibs don't need this accuracy
WriteShort(MSG_ENTITY, self.oldorigin.x); // acrually compressed velocity
- return TRUE;
+ return true;
}
// TODO maybe convert this to a TE?
e.oldorigin_x = compressShortVector(e.velocity);
- Net_LinkEntity(e, FALSE, 0.2, Violence_GibSplash_SendEntity);
+ Net_LinkEntity(e, false, 0.2, Violence_GibSplash_SendEntity);
}
void Violence_GibSplash(entity source, float type, float amount, entity attacker)
buf_cvarlist(h, "", "_"); // exclude all _ cvars as they are temporary
n = buf_getsize(h);
- adding = TRUE;
- pureadding = TRUE;
+ adding = true;
+ pureadding = true;
for(i = 0; i < n; ++i)
{
{
WriteByte(MSG_ENTITY, ENT_CLIENT_RANDOMSEED);
WriteShort(MSG_ENTITY, self.cnt);
- return TRUE;
+ return true;
}
void RandomSeed_Think()
{
{
randomseed = spawn();
randomseed.think = RandomSeed_Think;
- Net_LinkEntity(randomseed, FALSE, 0, RandomSeed_Send);
+ Net_LinkEntity(randomseed, false, 0, RandomSeed_Send);
entity oldself;
oldself = self;
if(world_already_spawned)
error("world already spawned - you may have EXACTLY ONE worldspawn!");
- world_already_spawned = TRUE;
+ world_already_spawned = true;
remove = remove_safely; // during spawning, watch what you remove!
head = nextent(head);
}
- server_is_dedicated = (stof(cvar_defstring("is_dedicated")) ? TRUE : FALSE);
+ server_is_dedicated = (stof(cvar_defstring("is_dedicated")) ? true : false);
// needs to be done so early because of the constants they create
CALL_ACCUMULATED_FUNCTION(RegisterWeapons);
// character set: ASCII 33-126 without the following characters: : ; ' " \ $
if(autocvar_sv_eventlog)
{
- s = sprintf("%d.%s.%06d", ftos(autocvar_sv_eventlog_files_counter), strftime(FALSE, "%s"), floor(random() * 1000000));
+ s = sprintf("%d.%s.%06d", ftos(autocvar_sv_eventlog_files_counter), strftime(false, "%s"), floor(random() * 1000000));
matchid = strzone(s);
GameLogEcho(strcat(":gamestart:", GetGametype(), "_", GetMapname(), ":", s));
if(substring(argv(i), -18, -1) != "-serverpackage.txt")
if(substring(argv(i), -14, -1) != ".serverpackage") // OLD legacy
s = strcat(s, " ", argv(i));
- fd = search_begin("*-serverpackage.txt", TRUE, FALSE);
+ fd = search_begin("*-serverpackage.txt", true, false);
if(fd >= 0)
{
j = search_getsize(fd);
s = strcat(s, " ", search_getfilename(fd, i));
search_end(fd);
}
- fd = search_begin("*.serverpackage", TRUE, FALSE);
+ fd = search_begin("*.serverpackage", true, false);
if(fd >= 0)
{
j = search_getsize(fd);
if(!fexists(strcat("maps/", map, ".waypoints")))
{
dprint(": no waypoints\n");
- return FALSE;
+ return false;
}
dprint(": has waypoints\n");
}
if(player_count < mapmin)
{
dprint("not enough\n");
- return FALSE;
+ return false;
}
if(player_count > mapmax)
{
dprint("too many\n");
- return FALSE;
+ return false;
}
dprint("right size\n");
- return TRUE;
+ return true;
}
dprint(": not found\n");
- return TRUE;
+ return true;
}
string Map_Filename(float position)
if(autocvar_g_campaign)
{
CampaignPostIntermission();
- alreadychangedlevel = TRUE;
- return TRUE;
+ alreadychangedlevel = true;
+ return true;
}
if(autocvar_quit_when_empty)
{
if(player_count <= currentbots)
{
localcmd("quit\n");
- alreadychangedlevel = TRUE;
- return TRUE;
+ alreadychangedlevel = true;
+ return true;
}
}
if(autocvar_quit_and_redirect != "")
{
redirection_target = strzone(autocvar_quit_and_redirect);
- alreadychangedlevel = TRUE;
- return TRUE;
+ alreadychangedlevel = true;
+ return true;
}
if (!reinit && autocvar_samelevel) // if samelevel is set, stay on same level
{
localcmd("restart\n");
- alreadychangedlevel = TRUE;
- return TRUE;
+ alreadychangedlevel = true;
+ return true;
}
if(autocvar_nextmap != "")
{
cvar_set("nextmap",m);
if(!m || gametypevote)
- return FALSE;
+ return false;
if(autocvar_sv_vote_gametype)
{
Map_Goto_SetStr(m);
- return FALSE;
+ return false;
}
if(MapInfo_CheckMap(m))
{
Map_Goto_SetStr(m);
Map_Goto(reinit);
- alreadychangedlevel = TRUE;
- return TRUE;
+ alreadychangedlevel = true;
+ return true;
}
}
if(!reinit && autocvar_lastlevel)
{
cvar_settemp_restore();
localcmd("set lastlevel 0\ntogglemenu 1\n");
- alreadychangedlevel = TRUE;
- return TRUE;
+ alreadychangedlevel = true;
+ return true;
}
- return FALSE;
+ return false;
}
void GotoNextMap(float reinit)
//string s;
if (alreadychangedlevel)
return;
- alreadychangedlevel = TRUE;
+ alreadychangedlevel = true;
string nextMap;
&& ((self.autoscreenshot > 0) && (time > self.autoscreenshot)) )
{
self.autoscreenshot = -1;
- if(IS_REAL_CLIENT(self)) { stuffcmd(self, sprintf("\nscreenshot screenshots/autoscreenshot/%s-%s.jpg; echo \"^5A screenshot has been taken at request of the server.\"\n", GetMapname(), strftime(FALSE, "%s"))); }
+ if(IS_REAL_CLIENT(self)) { stuffcmd(self, sprintf("\nscreenshot screenshots/autoscreenshot/%s-%s.jpg; echo \"^5A screenshot has been taken at request of the server.\"\n", GetMapname(), strftime(false, "%s"))); }
return;
}
if(!final)
{
- to_console = TRUE; // always print printstats replies
- to_eventlog = FALSE; // but never print them to the event log
+ to_console = true; // always print printstats replies
+ to_eventlog = false; // but never print them to the event log
}
if(to_eventlog)
if(autocvar_sv_eventlog_console)
- to_console = FALSE; // otherwise we get the output twice
+ to_console = false; // otherwise we get the output twice
if(final)
s = ":scores:";
{
file = fopen(autocvar_sv_logscores_filename, FILE_APPEND);
if(file == -1)
- to_file = FALSE;
+ to_file = false;
else
fputs(file, strcat(s, "\n"));
}
*/
void NextLevel()
{
- gameover = TRUE;
+ gameover = true;
intermission_running = 1;
VoteReset();
- DumpStats(TRUE);
+ DumpStats(true);
// send statistics
- PlayerStats_GameReport(TRUE);
+ PlayerStats_GameReport(true);
WeaponStats_Shutdown();
Kill_Notification(NOTIF_ALL, world, MSG_CENTER, 0); // kill all centerprints now
float have_players;
float l;
- have_player = FALSE;
- have_players = FALSE;
+ have_player = false;
+ have_players = false;
l = LMS_NewPlayerLives();
head = find(world, classname, "player");
if(head)
- have_player = TRUE;
+ have_player = true;
head2 = find(head, classname, "player");
if(head2)
- have_players = TRUE;
+ have_players = true;
if(have_player)
{
ClearWinners();
if(WinningConditionHelper_winner)
- WinningConditionHelper_winner.winning = TRUE;
+ WinningConditionHelper_winner.winning = true;
if(WinningConditionHelper_topscore == WinningConditionHelper_secondscore)
return WINNING_NEVER;
}
}
- limitreached = FALSE;
+ limitreached = false;
if(limit)
if(WinningConditionHelper_topscore >= limit)
- limitreached = TRUE;
+ limitreached = true;
if(leadlimit)
{
float leadlimitreached;
ClearWinners();
if(team1_score + team2_score + team3_score + team4_score == 0)
{
- checkrules_equality = TRUE;
+ checkrules_equality = true;
return WINNING_YES;
}
else if(team1_score + team2_score + team3_score + team4_score == 1)
{
if(!checkrules_suddendeathwarning)
{
- checkrules_suddendeathwarning = TRUE;
+ checkrules_suddendeathwarning = true;
if(g_race && !g_race_qualifying)
Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_RACE_FINISHLAP);
else
// needed!
FOR_EACH_CLIENT(self)
{
- self.typehitsound = FALSE;
+ self.typehitsound = false;
self.damage_dealt = 0;
antilag_record(self, altime);
}
/*
* RedirectionThink:
- * returns TRUE if redirecting
+ * returns true if redirecting
*/
float redirection_timeout;
float redirection_nextthink;
float clients_found;
if(redirection_target == "")
- return FALSE;
+ return false;
if(!redirection_timeout)
{
}
if(time < redirection_nextthink)
- return TRUE;
+ return true;
redirection_nextthink = time + 1;
if(time > redirection_timeout || clients_found == 0)
localcmd("\nwait; wait; wait; quit\n");
- return TRUE;
+ return true;
}
void TargetMusic_RestoreGame();
Ban_SaveBans();
// playerstats with unfinished match
- PlayerStats_GameReport(FALSE);
+ PlayerStats_GameReport(false);
if(!cheatcount_total)
{
float Ban_Delete(float i)
{
if(i < 0)
- return FALSE;
+ return false;
if(i >= ban_count)
- return FALSE;
+ return false;
if(ban_expire[i] == 0)
- return FALSE;
+ return false;
if(ban_expire[i] > 0)
{
OnlineBanList_SendUnban(ban_ip[i]);
ban_expire[i] = 0;
ban_ip[i] = "";
Ban_SaveBans();
- return TRUE;
+ return true;
}
void Ban_LoadBans()
for(i = 0; i < ban_count; ++i)
Ban_Delete(i);
ban_count = 0;
- ban_loaded = TRUE;
+ ban_loaded = true;
n = tokenize_console(autocvar_g_banned_list);
if(stof(argv(0)) == 1)
{
goto ipv6;
i2 = strstrofs(s, ".", i1 + 1);
if(i2 < 0)
- return FALSE;
+ return false;
i3 = strstrofs(s, ".", i2 + 1);
if(i3 < 0)
- return FALSE;
+ return false;
i4 = strstrofs(s, ".", i3 + 1);
if(i4 >= 0)
s = substring(s, 0, i4);
ban_ip2 = substring(s, 0, i2); // 16
ban_ip3 = substring(s, 0, i3); // 24
ban_ip4 = strcat1(s); // 32
- return TRUE;
+ return true;
:ipv6
i1 = strstrofs(s, ":", 0);
if(i1 < 0)
- return FALSE;
+ return false;
i1 = strstrofs(s, ":", i1 + 1);
if(i1 < 0)
- return FALSE;
+ return false;
i2 = strstrofs(s, ":", i1 + 1);
if(i2 < 0)
- return FALSE;
+ return false;
i3 = strstrofs(s, ":", i2 + 1);
if(i3 < 0)
- return FALSE;
+ return false;
ban_ip1 = strcat(substring(s, 0, i1), "::/32"); // 32
ban_ip2 = strcat(substring(s, 0, i2), "::/48"); // 48
else
ban_ip3 = strcat(substring(s, 0, i2), ":0::/56");
- return TRUE;
+ return true;
}
float Ban_IsClientBanned(entity client, float idx)
if(!ban_loaded)
Ban_LoadBans();
if(!Ban_GetClientIP(client))
- return FALSE;
+ return false;
if(idx < 0)
{
b = 0;
b = idx;
e = idx + 1;
}
- ipbanned = FALSE;
+ ipbanned = false;
for(i = b; i < e; ++i)
{
string s;
if(time > ban_expire[i])
continue;
s = ban_ip[i];
- if(ban_ip1 == s) ipbanned = TRUE;
- if(ban_ip2 == s) ipbanned = TRUE;
- if(ban_ip3 == s) ipbanned = TRUE;
- if(ban_ip4 == s) ipbanned = TRUE;
- if(ban_idfp == s) return TRUE;
+ if(ban_ip1 == s) ipbanned = true;
+ if(ban_ip2 == s) ipbanned = true;
+ if(ban_ip3 == s) ipbanned = true;
+ if(ban_ip4 == s) ipbanned = true;
+ if(ban_idfp == s) return true;
}
if(ipbanned)
{
if(!autocvar_g_banned_list_idmode)
- return TRUE;
+ return true;
if (!ban_idfp)
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
float Ban_MaybeEnforceBan(entity client)
s = strcat("^1NOTE:^7 banned client ", client.netaddress, " just tried to enter\n");
dropclient(client);
bprint(s);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
.float ban_checked;
float Ban_MaybeEnforceBanOnce(entity client)
{
if(client.ban_checked)
- return FALSE;
- client.ban_checked = TRUE;
+ return false;
+ client.ban_checked = true;
return Ban_MaybeEnforceBan(self);
}
if(substring(reason, 0, 1) != "~") // like IRC: unauthenticated banner
OnlineBanList_SendBan(ip, bantime, reason);
- return FALSE;
+ return false;
}
// do we have a free slot?
if(ban_expire[i] > time + bantime)
{
print(ip, " could not get banned due to no free ban slot\n");
- return FALSE;
+ return false;
}
// okay, insert our new victim as i
Ban_Delete(i);
if(substring(reason, 0, 1) != "~") // like IRC: unauthenticated banner
OnlineBanList_SendBan(ip, bantime, reason);
- return TRUE;
+ return true;
}
void Ban_KickBanClient(entity client, float bantime, float masksize, string reason)
if (!valid) {
// other has none of the needed keys
- return FALSE;
+ return false;
} else if (l.itemkeys == valid) {
// ALL needed keys were given
l.itemkeys = 0;
- return TRUE;
+ return true;
} else {
// only some of the needed keys were given
l.itemkeys &= ~valid;
- return TRUE;
+ return true;
}
}
{
// first nudge it off the floor a little bit to avoid math errors
setorigin(self, self.origin + '0 0 1');
- // note droptofloor returns FALSE if stuck/or would fall too far
+ // note droptofloor returns false if stuck/or would fall too far
droptofloor();
}
};
void trigger_keylock_touch(void) {
- bool key_used = FALSE;
- bool started_delay = FALSE;
+ bool key_used = false;
+ bool started_delay = false;
// only player may trigger the lock
if (!IS_PLAYER(other))
}
// trigger target2
- if (self.delay <= time || started_delay == TRUE)
+ if (self.delay <= time || started_delay == true)
if (self.target2) {
trigger_keylock_trigger(self.target2);
- started_delay = TRUE;
+ started_delay = true;
self.delay = time + self.wait;
}
} else {
/**
* Use keys from p on l.
- * Returns TRUE if any new keys were given, FALSE otherwise.
+ * Returns true if any new keys were given, false otherwise.
*/
float item_keys_usekey(entity l, entity p);
if ( autocvar_nextmap != "" )
{
- if ( !MapInfo_Get_ByName(autocvar_nextmap, FALSE, 0) )
+ if ( !MapInfo_Get_ByName(autocvar_nextmap, false, 0) )
return GTV_FORBIDDEN;
if (!(MapInfo_Map_supportedGametypes & type))
return GTV_FORBIDDEN;
if(mapvote_suggestion_ptr)
for(i = 0; i < 100 && mapvote_count < smax; ++i)
- MapVote_AddVotable(mapvote_suggestions[floor(random() * mapvote_suggestion_ptr)], TRUE);
+ MapVote_AddVotable(mapvote_suggestions[floor(random() * mapvote_suggestion_ptr)], true);
for(i = 0; i < 100 && mapvote_count < nmax; ++i)
- MapVote_AddVotable(GetNextMap(), FALSE);
+ MapVote_AddVotable(GetNextMap(), false);
if(mapvote_count == 0)
{
ShuffleMaplist();
localcmd("\nmenu_cmd sync\n");
for(i = 0; i < 100 && mapvote_count < nmax; ++i)
- MapVote_AddVotable(GetNextMap(), FALSE);
+ MapVote_AddVotable(GetNextMap(), false);
}
mapvote_count_real = mapvote_count;
WriteByte(MSG_ENTITY, to.mapvote);
}
- return TRUE;
+ return true;
}
void MapVote_Spawn()
{
- Net_LinkEntity(mapvote_ent = spawn(), FALSE, 0, MapVote_SendEntity);
+ Net_LinkEntity(mapvote_ent = spawn(), false, 0, MapVote_SendEntity);
}
void MapVote_TouchMask()
float MapVote_Finished(float mappos)
{
if(alreadychangedlevel)
- return FALSE;
+ return false;
string result;
float i;
{
if ( GameTypeVote_Finished(mappos) )
{
- gametypevote = FALSE;
+ gametypevote = false;
if(autocvar_nextmap != "")
{
Map_Goto_SetStr(autocvar_nextmap);
Map_Goto(0);
- alreadychangedlevel = TRUE;
- return TRUE;
+ alreadychangedlevel = true;
+ return true;
}
else
MapVote_Init();
}
- return FALSE;
+ return false;
}
Map_Goto_SetStr(mapvote_maps[mappos]);
Map_Goto(0);
- alreadychangedlevel = TRUE;
+ alreadychangedlevel = true;
- return TRUE;
+ return true;
}
void MapVote_CheckRules_1()
GameLogEcho(result);
}
- return FALSE;
+ return false;
}
void MapVote_Tick()
MapInfo_Enumerate();
if(MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 1))
- mapvote_run = TRUE;
+ mapvote_run = true;
}
void MapVote_Think()
cvar_set("rescan_pending", "0");
}
- mapvote_initialized = TRUE;
+ mapvote_initialized = true;
if(DoNextMapOverride(0))
return;
if(!autocvar_g_maplist_votable || player_count <= 0)
float GameTypeVote_SetGametype(float type)
{
if (MapInfo_CurrentGametype() == type)
- return TRUE;
+ return true;
float tsave = MapInfo_CurrentGametype();
bprint("Cannot use this game type: no map for it found\n");
MapInfo_SwitchGameType(tsave);
MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
- return FALSE;
+ return false;
}
//localcmd("gametype ", MapInfo_Type_ToString(type), "\n");
if(autocvar_g_maplist_shuffle)
ShuffleMaplist();
- return TRUE;
+ return true;
}
float gametypevote_finished;
float GameTypeVote_Finished(float pos)
{
if(!gametypevote || gametypevote_finished)
- return FALSE;
+ return false;
if ( !GameTypeVote_SetGametype(MapInfo_Type_FromString(mapvote_maps[pos])) )
{
localcmd("sv_vote_gametype_hook_all\n");
localcmd("sv_vote_gametype_hook_", mapvote_maps[pos], "\n");
- gametypevote_finished = TRUE;
+ gametypevote_finished = true;
- return TRUE;
+ return true;
}
float GameTypeVote_AddVotable(string nextMode)
{
float j;
if ( nextMode == "" || MapInfo_Type_FromString(nextMode) == 0 )
- return FALSE;
+ return false;
for(j = 0; j < mapvote_count; ++j)
if(mapvote_maps[j] == nextMode)
- return FALSE;
+ return false;
mapvote_maps[mapvote_count] = strzone(nextMode);
- mapvote_maps_suggested[mapvote_count] = FALSE;
+ mapvote_maps_suggested[mapvote_count] = false;
mapvote_maps_screenshot_dir[mapvote_count] = 0;
mapvote_maps_pakfile[mapvote_count] = strzone("");
mapvote_count += 1;
- return TRUE;
+ return true;
}
mapvote_maps[0] = strzone(MapInfo_Type_ToString(MapInfo_CurrentGametype()));
//GameTypeVote_Finished(0);
MapVote_Finished(0);
- return FALSE;
+ return false;
}
if ( really_available == 1 )
{
//GameTypeVote_Finished(which_available);
MapVote_Finished(which_available);
- return FALSE;
+ return false;
}
mapvote_count_real = mapvote_count;
MapVote_Spawn();
- return TRUE;
+ return true;
}
{
if (!logfile_open)
{
- logfile_open = TRUE;
+ logfile_open = true;
matches = autocvar_sv_eventlog_files_counter + 1;
cvar_set("sv_eventlog_files_counter", ftos(matches));
fn = ftos(matches);
if (logfile >= 0)
{
if (autocvar_sv_eventlog_files_timestamps)
- fputs(logfile, strcat(":time:", strftime(TRUE, "%Y-%m-%d %H:%M:%S", "\n", s, "\n")));
+ fputs(logfile, strcat(":time:", strftime(true, "%Y-%m-%d %H:%M:%S", "\n", s, "\n")));
else
fputs(logfile, strcat(s, "\n"));
}
// now use the first one from our list that we can see
for (i = 0; i < num_nearest; ++i)
{
- traceline(point, nearest_entity[i].origin, TRUE, world);
+ traceline(point, nearest_entity[i].origin, true, world);
if (trace_fraction == 1)
{
if (i != 0)
return msg;
}
-float boolean(float value) { // if value is 0 return FALSE (0), otherwise return TRUE (1)
- return (value == 0) ? FALSE : TRUE;
+float boolean(float value) { // if value is 0 return false (0), otherwise return true (1)
+ return (value == 0) ? false : true;
}
/*
if (g_lms || g_ca || allguns)
{
if(weaponinfo.spawnflags & WEP_FLAG_NORMAL)
- d = TRUE;
+ d = true;
else
- d = FALSE;
+ d = false;
}
else if (g_cts)
d = (i == WEP_SHOTGUN);
for (i = WEP_FIRST; i <= WEP_LAST; ++i)
{
e = get_weaponinfo(i);
- float w = want_weapon(e, FALSE);
+ float w = want_weapon(e, false);
if(w & 1)
start_weapons |= WepSet_FromWeapon(i);
if(w & 2)
// sounds to self may always pass
if (dest == MSG_ONE)
if (e == msg_entity)
- return TRUE;
+ return true;
// sounds by players can be removed
if (autocvar_bot_sound_monopoly)
if (IS_REAL_CLIENT(e))
- return FALSE;
+ return false;
// anything else may pass
- return TRUE;
+ return true;
}
#undef sound
float spamsound(entity e, float chan, string samp, float vol, float atten)
{
if (!sound_allowed(MSG_BROADCAST, e))
- return FALSE;
+ return false;
if (time > e.spamtime)
{
e.spamtime = time;
sound(e, chan, samp, vol, atten);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void play2team(float t, string filename)
if(fexists(f))
precache_model(f);
- globhandle = search_begin(strcat(m, "_*.sounds"), TRUE, FALSE);
+ globhandle = search_begin(strcat(m, "_*.sounds"), true, false);
if (globhandle < 0)
return;
n = search_getsize(globhandle);
float globhandle, i, n;
string f;
- globhandle = search_begin(pattern, TRUE, FALSE);
+ globhandle = search_begin(pattern, true, false);
if (globhandle < 0)
return;
n = search_getsize(globhandle);
}
}
- return TRUE;
+ return true;
}
void EliminatedPlayers_Init(float(entity) isEliminated_func)
backtrace("Can't spawn eliminatedPlayers again!");
return;
}
- Net_LinkEntity(eliminatedPlayers = spawn(), FALSE, 0, EliminatedPlayers_SendEntity);
+ Net_LinkEntity(eliminatedPlayers = spawn(), false, 0, EliminatedPlayers_SendEntity);
eliminatedPlayers.isEliminated = isEliminated_func;
}
{
// just check if x is in range
if (0 < thmi)
- return FALSE;
+ return false;
if (0 > thma)
- return FALSE;
+ return false;
}
else
{
trace_hits_box_a0 = max(trace_hits_box_a0, min(thmi / end, thma / end));
trace_hits_box_a1 = min(trace_hits_box_a1, max(thmi / end, thma / end));
if (trace_hits_box_a0 > trace_hits_box_a1)
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
float trace_hits_box(vector start, vector end, vector thmi, vector thma)
trace_hits_box_a1 = 1;
if (!trace_hits_box_1d(end.x, thmi.x, thma.x))
- return FALSE;
+ return false;
if (!trace_hits_box_1d(end.y, thmi.y, thma.y))
- return FALSE;
+ return false;
if (!trace_hits_box_1d(end.z, thmi.z, thma.z))
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
float tracebox_hits_box(vector start, vector mi, vector ma, vector end, vector thmi, vector thma)
float WarpZone_Projectile_Touch_ImpactFilter_Callback()
{
if(SUB_OwnerCheck())
- return TRUE;
+ return true;
if(SUB_NoImpactCheck())
{
if(self.classname == "nade")
- return FALSE; // no checks here
+ return false; // no checks here
else if(self.classname == "grapplinghook")
RemoveGrapplingHook(self.realowner);
else if(self.classname == "spike")
}
else
remove(self);
- return TRUE;
+ return true;
}
if(trace_ent && trace_ent.solid > SOLID_TRIGGER)
UpdateCSQCProjectile(self);
- return FALSE;
+ return false;
}
#define PROJECTILE_TOUCH if(WarpZone_Projectile_Touch()) return
setorigin(e, start);
e.angles = vectoangles(end - start);
dprint("Needed ", ftos(i + 1), " attempts\n");
- return TRUE;
+ return true;
}
else
- return FALSE;
+ return false;
}
void write_recordmarker(entity pl, float tstart, float dt)
WriteByte(MSG_ENTITY, self.fade_time * 100.0);
WriteByte(MSG_ENTITY, self.alpha * 255.0);
- return TRUE;
+ return true;
}
void modeleffect_spawn(string m, float s, float f, vector o, vector v, vector ang, vector angv, float s0, float s2, float a, float t1, float t2)
e.scale2 = -s2;
sz = max(e.scale, e.scale2);
setsize(e, e.mins * sz, e.maxs * sz);
- Net_LinkEntity(e, FALSE, 0.1, modeleffect_SendEntity);
+ Net_LinkEntity(e, false, 0.1, modeleffect_SendEntity);
}
void shockwave_spawn(string m, vector org, float sz, float t1, float t2)
float isPushable(entity e)
{
if(e.iscreature)
- return TRUE;
+ return true;
if(e.pushable)
- return TRUE;
+ return true;
switch(e.classname)
{
case "body":
case "keepawayball":
case "nexball_basketball":
case "nexball_football":
- return TRUE;
+ return true;
case "bullet": // antilagged bullets can't hit this either
- return FALSE;
+ return false;
}
if (e.projectiledeathtype)
- return TRUE;
- return FALSE;
+ return true;
+ return false;
}
MUTATOR_HOOKABLE(MonsterMove);
// called when a monster moves
- // returning TRUE makes the monster stop
+ // returning true makes the monster stop
// INPUT:
float monster_speed_run;
float monster_speed_walk;
MUTATOR_HOOKABLE(VehicleSpawn);
// called when a vehicle initializes
- // return TRUE to remove the vehicle
+ // return true to remove the vehicle
MUTATOR_HOOKABLE(VehicleEnter);
// called when a player enters a vehicle
MUTATOR_HOOKABLE(VehicleTouch);
// called when a player touches a vehicle
- // return TRUE to stop player from entering the vehicle
+ // return true to stop player from entering the vehicle
// INPUT
entity self; // vehicle
entity other; // player
decreaser = self.assault_decreaser;
if(decreaser.enemy.health >= ASSAULT_VALUE_INACTIVE)
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
void target_objective_decrease_activate()
if (!ad.bot_attack)
continue;
- found = FALSE;
+ found = false;
for(tod = world; (tod = find(tod, targetname, ad.target)); )
{
if(tod.classname == "target_objective_decrease")
if(tod.enemy.health > 0 && tod.enemy.health < ASSAULT_VALUE_INACTIVE)
{
// dprint(etos(ad),"\n");
- found = TRUE;
+ found = true;
break;
}
}
// te_lightning2(world, '0 0 0', p);
// Find and rate waypoints around it
- found = FALSE;
+ found = false;
best = world;
bestvalue = 99999999999;
for(radius=0; radius<1500 && !found; radius+=500)
if(wp.classname=="waypoint")
if(checkpvs(wp.origin, ad))
{
- found = TRUE;
+ found = true;
if(wp.cnt<bestvalue)
{
best = wp;
else
Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_ASSAULT_DEFENDING);
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(assault_TurretSpawn)
if (!self.team)
self.team = 14;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(assault_VehicleSpawn)
{
self.nextthink = time + 0.5;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(assault_BotRoles)
{
havocbot_ast_reset_role(self);
- return TRUE;
+ return true;
}
// scoreboard setup
void assault_ScoreRules()
{
- ScoreRules_basics(2, SFL_SORT_PRIO_SECONDARY, SFL_SORT_PRIO_SECONDARY, TRUE);
+ ScoreRules_basics(2, SFL_SORT_PRIO_SECONDARY, SFL_SORT_PRIO_SECONDARY, true);
ScoreInfo_SetLabel_TeamScore( ST_ASSAULT_OBJECTIVES, "objectives", SFL_SORT_PRIO_PRIMARY);
ScoreInfo_SetLabel_PlayerScore(SP_ASSAULT_OBJECTIVES, "objectives", SFL_SORT_PRIO_PRIMARY);
ScoreRules_basics_end();
const float ST_CA_ROUNDS = 1;
void ca_ScoreRules(float teams)
{
- ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, 0, TRUE);
+ ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, 0, true);
ScoreInfo_SetLabel_TeamScore(ST_CA_ROUNDS, "rounds", SFL_SORT_PRIO_PRIMARY);
ScoreRules_basics_end();
}
{
Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_OVER);
Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_OVER);
- allowed_to_spawn = FALSE;
+ allowed_to_spawn = false;
round_handler_Init(5, autocvar_g_ca_warmup, autocvar_g_ca_round_timelimit);
FOR_EACH_PLAYER(e)
nades_Clear(e);
Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_TIED);
}
- allowed_to_spawn = FALSE;
+ allowed_to_spawn = false;
round_handler_Init(5, autocvar_g_ca_warmup, autocvar_g_ca_round_timelimit);
FOR_EACH_PLAYER(e)
void CA_RoundStart()
{
if(warmup_stage)
- allowed_to_spawn = TRUE;
+ allowed_to_spawn = true;
else
- allowed_to_spawn = FALSE;
+ allowed_to_spawn = false;
}
float prev_missing_teams_mask;
float CA_CheckTeams()
{
- allowed_to_spawn = TRUE;
+ allowed_to_spawn = true;
CA_count_alive_players();
if(CA_ALIVE_TEAMS_OK())
{
float ca_isEliminated(entity e)
{
if(e.caplayer == 1 && (e.deadflag != DEAD_NO || e.frags == FRAGS_LMS_LOSER))
- return TRUE;
+ return true;
if(e.caplayer == 0.5)
- return TRUE;
- return FALSE;
+ return true;
+ return false;
}
MUTATOR_HOOKFUNCTION(ca_PlayerSpawn)
MUTATOR_HOOKFUNCTION(ca_reset_map_global)
{
- allowed_to_spawn = TRUE;
+ allowed_to_spawn = true;
return 1;
}
frag_mirrordamage = 0;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(ca_FilterItem)
{
if(autocvar_g_powerups <= 0)
if(self.flags & FL_POWERUP)
- return TRUE;
+ return true;
if(autocvar_g_pickup_items <= 0)
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(ca_PlayerDamage_SplitHealthArmor)
if(frag_target != frag_attacker && IS_PLAYER(frag_attacker))
PlayerTeamScore_Add(frag_attacker, SP_SCORE, ST_SCORE, (frag_damage - excess) * autocvar_g_ca_damage2score_multiplier);
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(ca_PlayerRegen)
{
// no regeneration in CA
- return TRUE;
+ return true;
}
void ca_Initialize()
{
- allowed_to_spawn = TRUE;
+ allowed_to_spawn = true;
ca_teams = autocvar_g_ca_teams_override;
if(ca_teams < 2)
void ctf_FlagcarrierWaypoints(entity player)
{
- WaypointSprite_Spawn("flagcarrier", 0, 0, player, FLAG_WAYPOINT_OFFSET, world, player.team, player, wps_flagcarrier, TRUE, RADARICON_FLAG, WPCOLOR_FLAGCARRIER(player.team));
+ WaypointSprite_Spawn("flagcarrier", 0, 0, player, FLAG_WAYPOINT_OFFSET, world, player.team, player, wps_flagcarrier, true, RADARICON_FLAG, WPCOLOR_FLAGCARRIER(player.team));
WaypointSprite_UpdateMaxHealth(player.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(start_health, start_armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON) * 2);
WaypointSprite_UpdateHealth(player.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(player.health, player.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON));
WaypointSprite_UpdateTeamRadar(player.wps_flagcarrier, RADARICON_FLAGCARRIER, WPCOLOR_FLAGCARRIER(player.team));
spreadlimit = (autocvar_g_ctf_pass_directional_min * (1 - spreadlimit) + autocvar_g_ctf_pass_directional_max * spreadlimit);
if(spreadlimit && (distance_from_line <= spreadlimit) && ((vlen(normalize(head_center - passer_center) - v_forward) * RAD2DEG) <= 90))
- { return TRUE; }
+ { return true; }
else
- { return FALSE; }
+ { return false; }
}
- else { return TRUE; }
+ else { return true; }
}
float players_worseeq, players_total;
if(ctf_captureshield_max_ratio <= 0)
- return FALSE;
+ return false;
s = PlayerScore_Add(p, SP_SCORE, 0);
if(s >= -ctf_captureshield_min_negscore)
- return FALSE;
+ return false;
players_total = players_worseeq = 0;
FOR_EACH_PLAYER(e)
// use this rule here
if(players_worseeq >= players_total * ctf_captureshield_max_ratio)
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
void ctf_CaptureShield_Update(entity player, float wanted_status)
float ctf_CaptureShield_Customize()
{
- if(!other.ctf_captureshielded) { return FALSE; }
- if(SAME_TEAM(self, other)) { return FALSE; }
+ if(!other.ctf_captureshielded) { return false; }
+ if(SAME_TEAM(self, other)) { return false; }
- return TRUE;
+ return true;
}
void ctf_CaptureShield_Touch()
// waypoints
if(autocvar_g_ctf_flag_dropped_waypoint)
- WaypointSprite_Spawn("flagdropped", 0, 0, flag, FLAG_WAYPOINT_OFFSET, world, ((autocvar_g_ctf_flag_dropped_waypoint == 2) ? 0 : player.team), flag, wps_flagdropped, TRUE, RADARICON_FLAG, WPCOLOR_DROPPEDFLAG(flag.team));
+ WaypointSprite_Spawn("flagdropped", 0, 0, flag, FLAG_WAYPOINT_OFFSET, world, ((autocvar_g_ctf_flag_dropped_waypoint == 2) ? 0 : player.team), flag, wps_flagdropped, true, RADARICON_FLAG, WPCOLOR_DROPPEDFLAG(flag.team));
if(autocvar_g_ctf_flag_return_time || (autocvar_g_ctf_flag_return_damage && autocvar_g_ctf_flag_health))
{
targ_origin = WarpZone_RefSys_TransformOrigin(receiver, flag, (0.5 * (receiver.absmin + receiver.absmax))); // this is target origin as seen by the flag
flag.pass_distance = vlen((('1 0 0' * targ_origin.x) + ('0 1 0' * targ_origin.y)) - (('1 0 0' * player.origin.x) + ('0 1 0' * player.origin.y))); // for the sake of this check, exclude Z axis
- ctf_CalculatePassVelocity(flag, targ_origin, player.origin, FALSE);
+ ctf_CalculatePassVelocity(flag, targ_origin, player.origin, false);
// main
flag.movetype = MOVETYPE_FLY;
makevectors((player.v_angle.y * '0 1 0') + (bound(autocvar_g_ctf_throw_angle_min, player.v_angle.x, autocvar_g_ctf_throw_angle_max) * '1 0 0'));
flag_velocity = (('0 0 1' * autocvar_g_ctf_throw_velocity_up) + ((v_forward * autocvar_g_ctf_throw_velocity_forward) * ((player.items & IT_STRENGTH) ? autocvar_g_ctf_throw_strengthmultiplier : 1)));
- flag.velocity = W_CalculateProjectileVelocity(player.velocity, flag_velocity, FALSE);
+ flag.velocity = W_CalculateProjectileVelocity(player.velocity, flag_velocity, false);
ctf_Handle_Drop(flag, player, droptype);
break;
}
default:
case DROP_NORMAL:
{
- flag.velocity = W_CalculateProjectileVelocity(player.velocity, (('0 0 1' * autocvar_g_ctf_drop_velocity_up) + ((('0 1 0' * crandom()) + ('1 0 0' * crandom())) * autocvar_g_ctf_drop_velocity_side)), FALSE);
+ flag.velocity = W_CalculateProjectileVelocity(player.velocity, (('0 0 1' * autocvar_g_ctf_drop_velocity_up) + ((('0 1 0' * crandom()) + ('1 0 0' * crandom())) * autocvar_g_ctf_drop_velocity_side)), false);
ctf_Handle_Drop(flag, player, droptype);
break;
}
}
if(stale_red_flags && stale_blue_flags)
- ctf_stalemate = TRUE;
+ ctf_stalemate = true;
else if((!stale_red_flags && !stale_blue_flags) && autocvar_g_ctf_stalemate_endcondition == 2)
- { ctf_stalemate = FALSE; wpforenemy_announced = FALSE; }
+ { ctf_stalemate = false; wpforenemy_announced = false; }
else if((!stale_red_flags || !stale_blue_flags) && autocvar_g_ctf_stalemate_endcondition == 1)
- { ctf_stalemate = FALSE; wpforenemy_announced = FALSE; }
+ { ctf_stalemate = false; wpforenemy_announced = false; }
// if sufficient stalemate, then set up the waypointsprite and announce the stalemate if necessary
if(ctf_stalemate)
for(tmp_entity = ctf_staleflaglist; tmp_entity; tmp_entity = tmp_entity.ctf_staleflagnext)
{
if((tmp_entity.owner) && (!tmp_entity.owner.wps_enemyflagcarrier))
- WaypointSprite_Spawn("enemyflagcarrier", 0, 0, tmp_entity.owner, FLAG_WAYPOINT_OFFSET, world, tmp_entity.team, tmp_entity.owner, wps_enemyflagcarrier, TRUE, RADARICON_FLAG, WPCOLOR_ENEMYFC(tmp_entity.owner.team));
+ WaypointSprite_Spawn("enemyflagcarrier", 0, 0, tmp_entity.owner, FLAG_WAYPOINT_OFFSET, world, tmp_entity.team, tmp_entity.owner, wps_enemyflagcarrier, true, RADARICON_FLAG, WPCOLOR_ENEMYFC(tmp_entity.owner.team));
}
if (!wpforenemy_announced)
FOR_EACH_REALPLAYER(tmp_entity)
Send_Notification(NOTIF_ONE, tmp_entity, MSG_CENTER, ((tmp_entity.flagcarried) ? CENTER_CTF_STALEMATE_CARRIER : CENTER_CTF_STALEMATE_OTHER));
- wpforenemy_announced = TRUE;
+ wpforenemy_announced = true;
}
}
}
else
{
// still a viable target, go for it
- ctf_CalculatePassVelocity(self, targ_origin, self.origin, TRUE);
+ ctf_CalculatePassVelocity(self, targ_origin, self.origin, true);
}
return;
}
self.bot_basewaypoint = self.nearestwaypoint;
// waypointsprites
- WaypointSprite_SpawnFixed(((self.team == NUM_TEAM_1) ? "redbase" : "bluebase"), self.origin + FLAG_WAYPOINT_OFFSET, self, wps_flagbase, RADARICON_FLAG, colormapPaletteColor(self.team - 1, FALSE));
- WaypointSprite_UpdateTeamRadar(self.wps_flagbase, RADARICON_FLAG, colormapPaletteColor(self.team - 1, FALSE));
+ WaypointSprite_SpawnFixed(((self.team == NUM_TEAM_1) ? "redbase" : "bluebase"), self.origin + FLAG_WAYPOINT_OFFSET, self, wps_flagbase, RADARICON_FLAG, colormapPaletteColor(self.team - 1, false));
+ WaypointSprite_UpdateTeamRadar(self.wps_flagbase, RADARICON_FLAG, colormapPaletteColor(self.team - 1, false));
// captureshield setup
ctf_CaptureShield_Spawn(self);
flag.max_flag_health = ((autocvar_g_ctf_flag_return_damage && autocvar_g_ctf_flag_health) ? autocvar_g_ctf_flag_health : 100);
flag.health = flag.max_flag_health;
flag.event_damage = ctf_FlagDamage;
- flag.pushable = TRUE;
+ flag.pushable = true;
flag.teleportable = TELEPORT_NORMAL;
flag.damagedbytriggers = autocvar_g_ctf_flag_return_when_unreachable;
flag.damagedbycontents = autocvar_g_ctf_flag_return_when_unreachable;
if((flag.spawnflags & 1) || flag.noalign) // don't drop to floor, just stay at fixed location
{
flag.dropped_origin = flag.origin;
- flag.noalign = TRUE;
+ flag.noalign = true;
flag.movetype = MOVETYPE_NONE;
}
else // drop to floor, automatically find a platform and set that as spawn origin
{
- flag.noalign = FALSE;
+ flag.noalign = false;
self = flag;
droptofloor();
flag.movetype = MOVETYPE_TOSS;
{
entity head;
float t;
- head = findchainfloat(bot_pickup, TRUE);
+ head = findchainfloat(bot_pickup, true);
while (head)
{
// gather health and armor only
if(self.wps_flagcarrier)
WaypointSprite_UpdateHealth(self.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(self.health, self.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON));
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(ctf_PlayerDamage) // for changing damage and force values that are applied to players in g_damage.qc
}
// todo: add notification for when flag carrier needs help?
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(ctf_PlayerDies)
if(frag_target.flagcarried)
{ ctf_Handle_Throw(frag_target, world, DROP_NORMAL); }
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(ctf_GiveFragsForKill)
if(flag.ctf_dropper == self) { flag.ctf_dropper = world; }
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(ctf_PortalTeleport)
if(!autocvar_g_ctf_portalteleport)
{ ctf_Handle_Throw(self, world, DROP_NORMAL); }
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(ctf_PlayerUseKey)
{
- if(MUTATOR_RETURNVALUE || gameover) { return FALSE; }
+ if(MUTATOR_RETURNVALUE || gameover) { return false; }
entity player = self;
if(autocvar_g_ctf_pass)
{
entity head, closest_target = world;
- head = WarpZone_FindRadius(player.origin, autocvar_g_ctf_pass_radius, TRUE);
+ head = WarpZone_FindRadius(player.origin, autocvar_g_ctf_pass_radius, true);
while(head) // find the closest acceptable target to pass to
{
Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_PASS_REQUESTING, head.netname);
}
player.throw_antispam = time + autocvar_g_ctf_pass_wait;
- return TRUE;
+ return true;
}
else if(player.flagcarried)
{
head = head.chain;
}
- if(closest_target) { ctf_Handle_Throw(player, closest_target, DROP_PASS); return TRUE; }
+ if(closest_target) { ctf_Handle_Throw(player, closest_target, DROP_PASS); return true; }
}
// throw the flag in front of you
player.throw_prevtime = time;
player.throw_count = 1;
ctf_Handle_Throw(player, world, DROP_THROW);
- return TRUE;
+ return true;
}
else
{
Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_FLAG_THROW_PUNISH, rint((player.throw_prevtime + autocvar_g_ctf_throw_punish_delay) - time));
- return FALSE;
+ return false;
}
}
else
player.throw_prevtime = time;
ctf_Handle_Throw(player, world, DROP_THROW);
- return TRUE;
+ return true;
}
}
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(ctf_HelpMePing)
}
else // create a normal help me waypointsprite
{
- WaypointSprite_Spawn("helpme", waypointsprite_deployed_lifetime, waypointsprite_limitedrange, self, FLAG_WAYPOINT_OFFSET, world, self.team, self, wps_helpme, FALSE, RADARICON_HELPME, '1 0.5 0');
+ WaypointSprite_Spawn("helpme", waypointsprite_deployed_lifetime, waypointsprite_limitedrange, self, FLAG_WAYPOINT_OFFSET, world, self.team, self, wps_helpme, false, RADARICON_HELPME, '1 0.5 0');
WaypointSprite_Ping(self.wps_helpme);
}
- return TRUE;
+ return true;
}
MUTATOR_HOOKFUNCTION(ctf_VehicleEnter)
vh_player.flagcarried.scale = VEHICLE_FLAG_SCALE;
//vh_player.flagcarried.angles = '0 0 0';
}
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(ctf_VehicleExit)
setorigin(vh_player.flagcarried, FLAG_CARRY_OFFSET);
vh_player.flagcarried.scale = FLAG_SCALE;
vh_player.flagcarried.angles = '0 0 0';
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(ctf_AbortSpeedrun)
{
Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(self.flagcarried, INFO_CTF_FLAGRETURN_ABORTRUN_));
ctf_RespawnFlag(self.flagcarried);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(ctf_MatchEnd)
flag.movetype = MOVETYPE_NONE;
flag.takedamage = DAMAGE_NO;
flag.solid = SOLID_NOT;
- flag.nextthink = FALSE; // stop thinking
+ flag.nextthink = false; // stop thinking
//dprint("stopping the ", flag.netname, " from moving.\n");
break;
}
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(ctf_BotRoles)
{
havocbot_ctf_reset_role(self);
- return TRUE;
+ return true;
}
// scoreboard setup
void ctf_ScoreRules()
{
- ScoreRules_basics(2, SFL_SORT_PRIO_PRIMARY, 0, TRUE);
+ ScoreRules_basics(2, SFL_SORT_PRIO_PRIMARY, 0, true);
ScoreInfo_SetLabel_TeamScore (ST_CTF_CAPS, "caps", SFL_SORT_PRIO_PRIMARY);
ScoreInfo_SetLabel_PlayerScore(SP_CTF_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
ScoreInfo_SetLabel_PlayerScore(SP_CTF_CAPTIME, "captime", SFL_LOWER_IS_BETTER | SFL_TIME);
const float VEHICLE_FLAG_SCALE = 1.0;
// waypoint colors
-#define WPCOLOR_ENEMYFC(t) (colormapPaletteColor(t - 1, FALSE) * 0.75)
+#define WPCOLOR_ENEMYFC(t) (colormapPaletteColor(t - 1, false) * 0.75)
#define WPCOLOR_FLAGCARRIER(t) ('0.8 0.8 0')
-#define WPCOLOR_DROPPEDFLAG(t) (('0.25 0.25 0.25' + colormapPaletteColor(t - 1, FALSE)) * 0.5)
+#define WPCOLOR_DROPPEDFLAG(t) (('0.25 0.25 0.25' + colormapPaletteColor(t - 1, false)) * 0.5)
// sounds
#define snd_flag_taken noise
void cts_ScoreRules()
{
- ScoreRules_basics(0, 0, 0, FALSE);
+ ScoreRules_basics(0, 0, 0, false);
if(g_race_qualifying)
{
ScoreInfo_SetLabel_PlayerScore(SP_CTS_FASTEST, "fastest", SFL_SORT_PRIO_PRIMARY | SFL_LOWER_IS_BETTER | SFL_TIME);
}
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(cts_ResetMap)
cts_ScoreRules();
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(cts_PlayerPreThink)
if(msg_entity.enemy.race_laptime)
race_SendNextCheckpoint(msg_entity.enemy, 1);
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(cts_ClientConnect)
}
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(cts_MakePlayerObserver)
race_PreparePlayer();
self.race_checkpoint = -1;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(cts_PlayerSpawn)
self.race_place = 0;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(cts_PutClientInServer)
race_AbandonRaceCheck(self);
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(cts_PlayerDies)
{
self.respawn_flags |= RESPAWN_FORCE;
race_AbandonRaceCheck(self);
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(cts_BotRoles)
{
self.havocbot_role = havocbot_role_cts;
- return TRUE;
+ return true;
}
MUTATOR_HOOKFUNCTION(cts_PlayerPostThink)
}
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(cts_ForbidThrowing)
{
// no weapon dropping in CTS
- return TRUE;
+ return true;
}
MUTATOR_HOOKFUNCTION(cts_FilterItem)
{
if(self.classname == "droppedweapon")
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(cts_PlayerDamage)
if(!autocvar_g_cts_selfdamage)
frag_damage = 0;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(cts_ForbidClearPlayerScore)
{
- return TRUE; // in CTS, you don't lose score by observing
+ return true; // in CTS, you don't lose score by observing
}
MUTATOR_HOOKFUNCTION(cts_SetMods)
{
g_cloaked = 1; // always enable cloak in CTS
- return FALSE;
+ return false;
}
void cts_Initialize()
self.player_blocked = 1;
else
self.player_blocked = 0;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(dom_ClientConnect)
{
set_dom_state(self);
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(dom_BotRoles)
{
self.havocbot_role = havocbot_role_dom;
- return TRUE;
+ return true;
}
/*QUAKED spawnfunc_dom_controlpoint (0 .5 .8) (-16 -16 -24) (16 16 32)
{
if(domination_roundbased)
{
- ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, 0, TRUE);
+ ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, 0, true);
ScoreInfo_SetLabel_TeamScore (ST_DOM_CAPS, "caps", SFL_SORT_PRIO_PRIMARY);
ScoreInfo_SetLabel_PlayerScore(SP_DOM_TAKES, "takes", 0);
ScoreRules_basics_end();
sp_domticks = SFL_SORT_PRIO_PRIMARY;
else
sp_score = SFL_SORT_PRIO_PRIMARY;
- ScoreRules_basics(teams, sp_score, sp_score, TRUE);
+ ScoreRules_basics(teams, sp_score, sp_score, true);
ScoreInfo_SetLabel_TeamScore (ST_DOM_TICKS, "ticks", sp_domticks);
ScoreInfo_SetLabel_PlayerScore(SP_DOM_TICKS, "ticks", sp_domticks);
ScoreInfo_SetLabel_PlayerScore(SP_DOM_TAKES, "takes", 0);
const float SP_FREEZETAG_REVIVALS = 4;
void freezetag_ScoreRules(float teams)
{
- ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, TRUE); // SFL_SORT_PRIO_PRIMARY
+ ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, true); // SFL_SORT_PRIO_PRIMARY
ScoreInfo_SetLabel_PlayerScore(SP_FREEZETAG_REVIVALS, "revivals", 0);
ScoreRules_basics_end();
}
if(autocvar_g_freezetag_frozen_maxtime > 0)
self.freezetag_frozen_timeout = time + autocvar_g_freezetag_frozen_maxtime;
- Freeze(self, 0, 1, TRUE);
+ Freeze(self, 0, 1, true);
freezetag_count_alive_players();
float freezetag_isEliminated(entity e)
{
if(IS_PLAYER(e) && (e.frozen == 1 || e.deadflag != DEAD_NO))
- return TRUE;
- return FALSE;
+ return true;
+ return false;
}
if(!o)
o = other;
if(self.frozen == 1)
- other.reviving = TRUE;
+ other.reviving = true;
++n;
}
}
if(other.reviving)
{
other.revive_progress = self.revive_progress;
- other.reviving = FALSE;
+ other.reviving = false;
}
}
}
self.havocbot_role = havocbot_role_ft_offense;
}
- return TRUE;
+ return true;
}
MUTATOR_HOOKFUNCTION(freezetag_GetTeamCount)
setsize(e, (get_monsterinfo(mon)).mins, (get_monsterinfo(mon)).maxs);
if(MoveToRandomMapLocation(e, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, 10, 1024, 256))
- monster = spawnmonster("", mon, world, world, e.origin, FALSE, FALSE, 2);
+ monster = spawnmonster("", mon, world, world, e.origin, false, false, 2);
else return;
e.think = SUB_Remove;
e.nextthink = time + 0.1;
}
else
- monster = spawnmonster("", ((spawn_point.monsterid) ? spawn_point.monsterid : mon), spawn_point, spawn_point, spawn_point.origin, FALSE, FALSE, 2);
+ monster = spawnmonster("", ((spawn_point.monsterid) ? spawn_point.monsterid : mon), spawn_point, spawn_point, spawn_point.origin, false, false, 2);
if(spawn_point) monster.target2 = spawn_point.target2;
monster.spawnshieldtime = time;
}
}
- monster.monster_attack = FALSE; // it's the player's job to kill all the monsters
+ monster.monster_attack = false; // it's the player's job to kill all the monsters
if(inv_roundcnt >= inv_maxrounds)
monster.spawnflags |= MONSTERFLAG_MINIBOSS; // last round spawns minibosses
float Invasion_CheckPlayers()
{
- return TRUE;
+ return true;
}
void Invasion_RoundStart()
}
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(invasion_MonsterSpawn)
{
if(!(self.spawnflags & MONSTERFLAG_SPAWNED))
- return TRUE;
+ return true;
if(!(self.spawnflags & MONSTERFLAG_RESPAWNED))
{
self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_BOTCLIP | DPCONTENTS_MONSTERCLIP;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(invasion_OnEntityPreSpawn)
{
if(startsWith(self.classname, "monster_"))
if(!(self.spawnflags & MONSTERFLAG_SPAWNED))
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(invasion_StartFrame)
monsters_total = inv_maxspawned; // TODO: make sure numspawned never exceeds maxspawned
monsters_killed = inv_numkilled;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(invasion_PlayerRegen)
{
// no regeneration in invasion
- return TRUE;
+ return true;
}
MUTATOR_HOOKFUNCTION(invasion_PlayerSpawn)
{
- self.bot_attack = FALSE;
- return FALSE;
+ self.bot_attack = false;
+ return false;
}
MUTATOR_HOOKFUNCTION(invasion_PlayerDamage)
frag_force = '0 0 0';
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(invasion_PlayerCommand)
{
if(MUTATOR_RETURNVALUE) // command was already handled?
- return FALSE;
+ return false;
if(cmd_name == "debuginvasion")
{
sprint(self, strcat("monsters_killed = ", ftos(monsters_killed), "\n"));
sprint(self, strcat("inv_monsterskill = ", ftos(inv_monsterskill), "\n"));
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(invasion_BotShouldAttack)
{
if(!(checkentity.flags & FL_MONSTER))
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(invasion_SetStartItems)
start_health = 200;
start_armorvalue = 200;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(invasion_AccuracyTargetValid)
MUTATOR_HOOKFUNCTION(invasion_AllowMobSpawning)
{
// monster spawning disabled during an invasion
- return TRUE;
+ return true;
}
MUTATOR_HOOKFUNCTION(invasion_GetTeamCount)
{
ret_float = invasion_teams;
- return FALSE;
+ return false;
}
void invasion_ScoreRules(float inv_teams)
{
if(inv_teams) { CheckAllowedTeams(world); }
- ScoreRules_basics(inv_teams, 0, 0, FALSE);
+ ScoreRules_basics(inv_teams, 0, 0, false);
if(inv_teams) ScoreInfo_SetLabel_TeamScore(ST_INV_KILLS, "frags", SFL_SORT_PRIO_PRIMARY);
ScoreInfo_SetLabel_PlayerScore(SP_KILLS, "frags", ((inv_teams) ? SFL_SORT_PRIO_SECONDARY : SFL_SORT_PRIO_PRIMARY));
ScoreRules_basics_end();
{
if(e.ballcarried)
if(IS_SPEC(other))
- return FALSE; // we don't want spectators of the ballcarrier to see the attached waypoint on the top of their screen
+ return false; // we don't want spectators of the ballcarrier to see the attached waypoint on the top of their screen
// TODO: Make the ballcarrier lack a waypointsprite whenever they have the invisibility powerup
- return TRUE;
+ return true;
}
void ka_EventLog(string mode, entity actor) // use an alias for easy changing and quick editing later
if(!MoveToRandomMapLocation(self, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, 10, 1024, 256))
{
- entity spot = SelectSpawnPoint(TRUE);
+ entity spot = SelectSpawnPoint(true);
setorigin(self, spot.origin);
self.angles = spot.angles;
}
pointparticles(particleeffectnum("electro_combo"), oldballorigin, '0 0 0', 1);
pointparticles(particleeffectnum("electro_combo"), self.origin, '0 0 0', 1);
- WaypointSprite_Spawn("ka-ball", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAGCARRIER, '0 1 1');
+ 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, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
// apply effects to player
other.glow_color = autocvar_g_keepawayball_trail_color;
- other.glow_trail = TRUE;
+ other.glow_trail = true;
other.effects |= autocvar_g_keepaway_ballcarrier_effects;
// messages and sounds
ball.owner = world;
// reset the player effects
- plyr.glow_trail = FALSE;
+ plyr.glow_trail = false;
plyr.effects &= ~autocvar_g_keepaway_ballcarrier_effects;
// messages and sounds
// PlayerScore_Add(plyr, SP_KEEPAWAY_DROPS, 1); Not anymore, this is 100% the same as pickups and is useless.
// waypoints
- WaypointSprite_Spawn("ka-ball", 0, 0, ball, '0 0 64', world, ball.team, ball, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAGCARRIER, '0 1 1');
+ WaypointSprite_Spawn("ka-ball", 0, 0, ball, '0 0 64', world, ball.team, ball, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER, '0 1 1');
WaypointSprite_UpdateRule(ball.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
WaypointSprite_Ping(ball.waypointsprite_attachedforcarrier);
WaypointSprite_Kill(plyr.waypointsprite_attachedforcarrier);
self.havocbot_role = havocbot_role_ka_carrier;
else
self.havocbot_role = havocbot_role_ka_collector;
- return TRUE;
+ return true;
}
e.solid = SOLID_TRIGGER;
e.movetype = MOVETYPE_BOUNCE;
e.glow_color = autocvar_g_keepawayball_trail_color;
- e.glow_trail = TRUE;
+ e.glow_trail = true;
e.flags = FL_ITEM;
e.reset = ka_Reset;
e.touch = ka_TouchEvent;
void ka_ScoreRules()
{
- ScoreRules_basics(0, SFL_SORT_PRIO_PRIMARY, 0, TRUE); // SFL_SORT_PRIO_PRIMARY
+ ScoreRules_basics(0, SFL_SORT_PRIO_PRIMARY, 0, true); // SFL_SORT_PRIO_PRIMARY
ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_PICKUPS, "pickups", 0);
ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_CARRIERKILLS, "bckills", 0);
ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_BCTIME, "bctime", SFL_SORT_PRIO_SECONDARY);
const float SP_KH_LOSSES = 9;
void kh_ScoreRules(float teams)
{
- ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, TRUE);
+ ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, true);
ScoreInfo_SetLabel_TeamScore( ST_KH_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
ScoreInfo_SetLabel_PlayerScore(SP_KH_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
ScoreInfo_SetLabel_PlayerScore(SP_KH_PUSHES, "pushes", 0);
{
if(!IS_PLAYER(e) || self.team != e.team)
if(!kh_tracking_enabled)
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
float kh_Key_waypointsprite_visible_for_player(entity e) // ??
{
if(!kh_tracking_enabled)
- return FALSE;
+ return false;
if(!self.owner)
- return TRUE;
+ return true;
if(!self.owner.owner)
- return TRUE;
- return FALSE; // draw only when key is not owned
+ return true;
+ return false; // draw only when key is not owned
}
void kh_update_state()
kh_interferemsg_time = 0;
entity key;
- kh_no_radar_circles = TRUE;
+ kh_no_radar_circles = true;
FOR_EACH_KH_KEY(key)
kh_Key_Remove(key);
- kh_no_radar_circles = FALSE;
+ kh_no_radar_circles = false;
Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEYHUNT_ROUNDSTART, autocvar_g_balance_keyhunt_delay_round);
kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_round, kh_StartRound);
nades_GiveBonus(key.owner, autocvar_g_nades_bonus_score_high);
}
- first = TRUE;
+ first = true;
string keyowner = "";
FOR_EACH_KH_KEY(key)
if(key.owner.kh_next == key)
if(!first)
keyowner = strcat(keyowner, ", ");
keyowner = key.owner.netname;
- first = FALSE;
+ first = false;
}
Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM_4(teem, INFO_KEYHUNT_CAPTURE_), keyowner);
- first = TRUE;
+ first = true;
midpoint = '0 0 0';
firstorigin = '0 0 0';
lastorigin = '0 0 0';
lastorigin = thisorigin;
if(first)
firstorigin = thisorigin;
- first = FALSE;
+ first = false;
}
if(kh_teams > 2)
{
Send_Notification(NOTIF_ONE, initial_owner, MSG_CENTER, APP_TEAM_NUM_4(initial_owner.team, CENTER_KEYHUNT_START_));
- WaypointSprite_Spawn("key-dropped", 0, 0, key, '0 0 1' * KH_KEY_WP_ZSHIFT, world, key.team, key, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAG, '0 1 1');
+ WaypointSprite_Spawn("key-dropped", 0, 0, key, '0 0 1' * KH_KEY_WP_ZSHIFT, world, key.team, key, waypointsprite_attachedforcarrier, false, RADARICON_FLAG, '0 1 1');
key.waypointsprite_attachedforcarrier.waypointsprite_visible_for_player = kh_Key_waypointsprite_visible_for_player;
kh_Key_AssignTo(key, initial_owner);
kh_Key_AssignTo(key, world);
makevectors(player.v_angle);
- key.velocity = W_CalculateProjectileVelocity(player.velocity, autocvar_g_balance_keyhunt_throwvelocity * v_forward, FALSE);
+ key.velocity = W_CalculateProjectileVelocity(player.velocity, autocvar_g_balance_keyhunt_throwvelocity * v_forward, false);
key.pusher = world;
key.pushltime = time + autocvar_g_balance_keyhunt_protecttime;
key.kh_dropperteam = key.team;
Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_4(key, INFO_KEYHUNT_LOST_), player.netname);
kh_Key_AssignTo(key, world);
makevectors('-1 0 0' * (45 + 45 * random()) + '0 360 0' * random());
- key.velocity = W_CalculateProjectileVelocity(player.velocity, autocvar_g_balance_keyhunt_dropvelocity * v_forward, FALSE);
+ key.velocity = W_CalculateProjectileVelocity(player.velocity, autocvar_g_balance_keyhunt_dropvelocity * v_forward, false);
key.pusher = mypusher;
key.pushltime = time + autocvar_g_balance_keyhunt_protecttime;
if(suicide)
Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_KEYHUNT);
Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_KEYHUNT_OTHER);
- kh_tracking_enabled = TRUE;
+ kh_tracking_enabled = true;
}
void kh_StartRound() // runs at the start of each round
kh_Key_Spawn(my_player, 360 * i / kh_teams, i);
}
- kh_tracking_enabled = FALSE;
+ kh_tracking_enabled = false;
Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEYHUNT_SCAN, autocvar_g_balance_keyhunt_delay_tracking);
kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_tracking, kh_EnableTrackingDevice);
}
MUTATOR_HOOKFUNCTION(kh_Key_DropAll)
{
- kh_Key_DropAll(self, TRUE);
+ kh_Key_DropAll(self, true);
return 0;
}
MUTATOR_HOOKFUNCTION(kh_PlayerDies)
{
if(self == other)
- kh_Key_DropAll(self, TRUE);
+ kh_Key_DropAll(self, true);
else if(IS_PLAYER(other))
- kh_Key_DropAll(self, FALSE);
+ kh_Key_DropAll(self, false);
else
- kh_Key_DropAll(self, TRUE);
+ kh_Key_DropAll(self, true);
return 0;
}
lms_lowest_lives = 999;
lms_next_place = player_count;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(lms_ResetPlayers)
if(IS_PLAYER(self))
PlayerScore_Add(self, SP_LMS_LIVES, LMS_NewPlayerLives());
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(lms_PlayerPreSpawn)
if(PlayerScore_Add(self, SP_LMS_RANK, 0) > 0)
self.classname = "observer";
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(lms_PlayerDies)
{
self.respawn_flags |= RESPAWN_FORCE;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(lms_RemovePlayer)
else
Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_LMS_FORFEIT, self.netname);
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(lms_ClientConnect)
self.frags = FRAGS_SPECTATOR;
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(lms_PlayerThink)
if(self.deadflag == DEAD_DYING)
self.deadflag = DEAD_RESPAWNING;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(lms_PlayerRegen)
{
if(autocvar_g_lms_regenerate)
- return FALSE;
- return TRUE;
+ return false;
+ return true;
}
MUTATOR_HOOKFUNCTION(lms_ForbidThrowing)
{
// forbode!
- return TRUE;
+ return true;
}
MUTATOR_HOOKFUNCTION(lms_GiveFragsForKill)
}
frag_score = 0;
- return TRUE;
+ return true;
}
MUTATOR_HOOKFUNCTION(lms_SetStartItems)
start_ammo_plasma = warmup_start_ammo_plasma = cvar("g_lms_start_ammo_plasma");
start_ammo_fuel = warmup_start_ammo_fuel = cvar("g_lms_start_ammo_fuel");
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(lms_KeepScore)
{
// don't clear player score
- return TRUE;
+ return true;
}
MUTATOR_HOOKFUNCTION(lms_FilterItem)
if(self.classname == "item_health_mega")
{
self.max_health = 1;
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
MUTATOR_HOOKFUNCTION(lms_ItemTouch)
// scoreboard stuff
void lms_ScoreRules()
{
- ScoreRules_basics(0, 0, 0, FALSE);
+ ScoreRules_basics(0, 0, 0, false);
ScoreInfo_SetLabel_PlayerScore(SP_LMS_LIVES, "lives", SFL_SORT_PRIO_SECONDARY);
ScoreInfo_SetLabel_PlayerScore(SP_LMS_RANK, "rank", SFL_LOWER_IS_BETTER | SFL_RANK | SFL_SORT_PRIO_PRIMARY | SFL_ALLOW_HIDE);
ScoreRules_basics_end();
const float SP_NEXBALL_FAULTS = 5;
void nb_ScoreRules(float teams)
{
- ScoreRules_basics(teams, 0, 0, TRUE);
+ ScoreRules_basics(teams, 0, 0, true);
ScoreInfo_SetLabel_TeamScore( ST_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY);
ScoreInfo_SetLabel_PlayerScore( SP_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY);
ScoreInfo_SetLabel_PlayerScore(SP_NEXBALL_FAULTS, "faults", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER);
void relocate_nexball(void)
{
- tracebox(self.origin, BALL_MINS, BALL_MAXS, self.origin, TRUE, self);
+ tracebox(self.origin, BALL_MINS, BALL_MAXS, self.origin, true, self);
if(trace_startsolid)
{
vector o;
}
WaypointSprite_Kill(ball.owner.waypointsprite_attachedforcarrier);
- WaypointSprite_Spawn("nb-ball", 0, 0, ball, '0 0 64', world, ball.team, ball, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAGCARRIER, BALL_SPRITECOLOR); // no health bar please
+ WaypointSprite_Spawn("nb-ball", 0, 0, ball, '0 0 64', world, ball.team, ball, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER, BALL_SPRITECOLOR); // no health bar please
WaypointSprite_UpdateRule(ball.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
ball.owner.ballcarried = world;
self.nextthink = time + autocvar_g_nexball_delay_idle + 3;
self.teamtime = 0;
self.pusher = world;
- self.team = FALSE;
+ self.team = false;
sound(self, CH_TRIGGER, self.noise1, VOL_BASE, ATTEN_NORM);
WaypointSprite_Ping(self.waypointsprite_attachedforcarrier);
LogNB("init", world);
if(cvar(strcat("g_", self.classname, "_trail"))) //nexball_basketball :p
{
self.glow_color = autocvar_g_nexball_trail_color;
- self.glow_trail = TRUE;
+ self.glow_trail = true;
}
self.movetype = MOVETYPE_FLY;
entity e, wp_owner;
e = WaypointSprite_getviewentity(other);
wp_owner = self.owner;
- if(SAME_TEAM(e, wp_owner)) { return FALSE; }
+ if(SAME_TEAM(e, wp_owner)) { return false; }
- return TRUE;
+ return true;
}
void SpawnGoal(void)
if(!(ball = self.ballcarried))
return;
- W_SetupShot(self, FALSE, 4, "nexball/shoot1.wav", CH_WEAPON_A, 0);
+ W_SetupShot(self, false, 4, "nexball/shoot1.wav", CH_WEAPON_A, 0);
tracebox(w_shotorg, BALL_MINS, BALL_MAXS, w_shotorg, MOVE_WORLDONLY, world);
if(trace_startsolid)
{
mul = mi + (ma - mi) * mul; // range from the minimal power to the maximal power
}
- DropBall(ball, w_shotorg, W_CalculateProjectileVelocity(self.velocity, w_shotdir * autocvar_g_balance_nexball_primary_speed * mul, FALSE));
+ DropBall(ball, w_shotorg, W_CalculateProjectileVelocity(self.velocity, w_shotdir * autocvar_g_balance_nexball_primary_speed * mul, false));
//TODO: use the speed_up cvar too ??
if(self.ballcarried.enemy)
{
entity _ball = self.ballcarried;
- W_SetupShot(self, FALSE, 4, "nexball/shoot1.wav", CH_WEAPON_A, 0);
+ W_SetupShot(self, false, 4, "nexball/shoot1.wav", CH_WEAPON_A, 0);
DropBall(_ball, w_shotorg, trigger_push_calculatevelocity(_ball.origin, _ball.enemy, 32));
_ball.think = W_Nexball_Think;
_ball.nextthink = time;
entity missile;
if(!(balls & BALL_BASKET))
return;
- W_SetupShot(self, FALSE, 2, "nexball/shoot2.wav", CH_WEAPON_A, 0);
+ W_SetupShot(self, false, 2, "nexball/shoot2.wav", CH_WEAPON_A, 0);
// pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
missile = spawn();
missile.effects = EF_BRIGHTFIELD | EF_LOWPRECISION;
missile.flags = FL_PROJECTILE;
- CSQCProjectile(missile, TRUE, PROJECTILE_ELECTRO, TRUE);
+ CSQCProjectile(missile, true, PROJECTILE_ELECTRO, true);
}
float ball_customize()
self.effects &= ~EF_FLAME;
self.scale = 1;
self.customizeentityforclient = func_null;
- return TRUE;
+ return true;
}
if(other == self.owner)
self.scale = 1;
}
- return TRUE;
+ return true;
}
float w_nexball_weapon(float req)
{
//weapon_setup(WEP_PORTO);
}
- // No need to check WR_CHECKAMMO* or WR_AIM, it should always return TRUE
- return TRUE;
+ // No need to check WR_CHECKAMMO* or WR_AIM, it should always return true
+ return true;
}
MUTATOR_HOOKFUNCTION(nexball_BallDrop)
nexball_setstatus();
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(nexball_PlayerSpawn)
else
self.weapons = '0 0 0';
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(nexball_PlayerPhysics)
self.stat_sv_airspeedlimit_nonqw *= autocvar_g_nexball_basketball_carrier_highspeed;
self.stat_sv_maxspeed *= autocvar_g_nexball_basketball_carrier_highspeed;
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(nexball_SetStartItems)
{
start_items |= IT_UNLIMITED_SUPERWEAPONS; // FIXME BAD BAD BAD BAD HACK, NEXBALL SHOULDN'T ABUSE PORTO'S WEAPON SLOT
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(nexball_ForbidThrowing)
{
if(self.weapon == WEP_MORTAR)
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(nexball_FilterItem)
{
if(self.classname == "droppedweapon")
if(self.weapon == WEP_MORTAR)
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
MUTATOR_DEFINITION(gamemode_nexball)
l = findchain(classname, "onslaught_controlpoint");
while (l)
{
- l.islinked = FALSE;
- l.isshielded = TRUE;
- l.isgenneighbor_red = FALSE;
- l.isgenneighbor_blue = FALSE;
- l.iscpneighbor_red = FALSE;
- l.iscpneighbor_blue = FALSE;
+ l.islinked = false;
+ l.isshielded = true;
+ l.isgenneighbor_red = false;
+ l.isgenneighbor_blue = false;
+ l.iscpneighbor_red = false;
+ l.iscpneighbor_blue = false;
dprint(etos(l), " (point) belongs to team ", ftos(l.team), "\n");
l = l.chain;
}
dprint(etos(l), " (link) connects ", etos(l.goalentity), " with ", etos(l.enemy), "\n");
l = l.chain;
}
- stop = FALSE;
+ stop = false;
while (!stop)
{
- stop = TRUE;
+ stop = true;
l = links;
while (l)
{
{
if (!l.goalentity.islinked)
{
- stop = FALSE;
- l.goalentity.islinked = TRUE;
+ stop = false;
+ l.goalentity.islinked = true;
dprint(etos(l), " (link) is marking ", etos(l.goalentity), " (point) because its team matches ", etos(l.enemy), " (point)\n");
}
else if (!l.enemy.islinked)
{
- stop = FALSE;
- l.enemy.islinked = TRUE;
+ stop = false;
+ l.enemy.islinked = true;
dprint(etos(l), " (link) is marking ", etos(l.enemy), " (point) because its team matches ", etos(l.goalentity), " (point)\n");
}
}
if (l.goalentity.team != l.enemy.team)
{
dprint(etos(l), " (link) is unshielding ", etos(l.enemy), " (point) because its team does not match ", etos(l.goalentity), " (point)\n");
- l.enemy.isshielded = FALSE;
+ l.enemy.isshielded = false;
}
if(l.goalentity.classname == "onslaught_generator")
{
if(l.goalentity.team == NUM_TEAM_1)
- l.enemy.isgenneighbor_red = TRUE;
+ l.enemy.isgenneighbor_red = true;
else if(l.goalentity.team == NUM_TEAM_2)
- l.enemy.isgenneighbor_blue = TRUE;
+ l.enemy.isgenneighbor_blue = true;
}
else
{
if(l.goalentity.team == NUM_TEAM_1)
- l.enemy.iscpneighbor_red = TRUE;
+ l.enemy.iscpneighbor_red = true;
else if(l.goalentity.team == NUM_TEAM_2)
- l.enemy.iscpneighbor_blue = TRUE;
+ l.enemy.iscpneighbor_blue = true;
}
}
if (l.enemy.islinked)
if (l.goalentity.team != l.enemy.team)
{
dprint(etos(l), " (link) is unshielding ", etos(l.goalentity), " (point) because its team does not match ", etos(l.enemy), " (point)\n");
- l.goalentity.isshielded = FALSE;
+ l.goalentity.isshielded = false;
}
if(l.enemy.classname == "onslaught_generator")
{
if(l.enemy.team == NUM_TEAM_1)
- l.goalentity.isgenneighbor_red = TRUE;
+ l.goalentity.isgenneighbor_red = true;
else if(l.enemy.team == NUM_TEAM_2)
- l.goalentity.isgenneighbor_blue = TRUE;
+ l.goalentity.isgenneighbor_blue = true;
}
else
{
if(l.enemy.team == NUM_TEAM_1)
- l.goalentity.iscpneighbor_red = TRUE;
+ l.goalentity.iscpneighbor_red = true;
else if(l.enemy.team == NUM_TEAM_2)
- l.goalentity.iscpneighbor_blue = TRUE;
+ l.goalentity.iscpneighbor_blue = true;
}
}
l = l.chain;
dprint(etos(l), " (generator) is shielded\n");
l.enemy.alpha = 1;
l.takedamage = DAMAGE_NO;
- l.bot_attack = FALSE;
+ l.bot_attack = false;
}
else
{
dprint(etos(l), " (generator) is not shielded\n");
l.enemy.alpha = -1;
l.takedamage = DAMAGE_AIM;
- l.bot_attack = TRUE;
+ l.bot_attack = true;
}
l = l.chain;
}
if (l.goalentity)
{
l.goalentity.takedamage = DAMAGE_NO;
- l.goalentity.bot_attack = FALSE;
+ l.goalentity.bot_attack = false;
}
}
else
if (l.goalentity)
{
l.goalentity.takedamage = DAMAGE_AIM;
- l.goalentity.bot_attack = TRUE;
+ l.goalentity.bot_attack = true;
}
}
onslaught_controlpoint_updatesprite(l);
{
i = random();
if(i < 0.3)
- ons_throwgib(self.origin + '0 0 40', (100 * randomvec() - '1 1 1') * 11 + '0 0 20', "models/onslaught/gen_gib1.md3", 6, TRUE);
+ ons_throwgib(self.origin + '0 0 40', (100 * randomvec() - '1 1 1') * 11 + '0 0 20', "models/onslaught/gen_gib1.md3", 6, true);
else if(i > 0.7)
- ons_throwgib(self.origin + '0 0 40', (100 * randomvec() - '1 1 1') * 12 + '0 0 20', "models/onslaught/gen_gib2.md3", 6, TRUE);
+ ons_throwgib(self.origin + '0 0 40', (100 * randomvec() - '1 1 1') * 12 + '0 0 20', "models/onslaught/gen_gib2.md3", 6, true);
else
- ons_throwgib(self.origin + '0 0 40', (100 * randomvec() - '1 1 1') * 13 + '0 0 20', "models/onslaught/gen_gib3.md3", 6, TRUE);
+ ons_throwgib(self.origin + '0 0 40', (100 * randomvec() - '1 1 1') * 13 + '0 0 20', "models/onslaught/gen_gib3.md3", 6, true);
}
// Spawn fire balls
t = Team_ColoredFullName(attacker.team);
bprint(Team_ColoredFullName(self.team), " generator destroyed by ", t, "!\n");
}
- self.iscaptured = FALSE;
- self.islinked = FALSE;
- self.isshielded = FALSE;
+ self.iscaptured = false;
+ self.islinked = false;
+ self.isshielded = false;
self.takedamage = DAMAGE_NO; // can't be hurt anymore
self.event_damage = func_null; // won't do anything if hurt
self.count = 0; // reset counter
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);
+ ons_throwgib(hitloc + '0 0 20', force * -1, "models/onslaught/gen_gib1.md3", 5, true);
else if(i > 0.7)
- ons_throwgib(hitloc + '0 0 20', force * -1, "models/onslaught/gen_gib2.md3", 5, TRUE);
+ ons_throwgib(hitloc + '0 0 20', force * -1, "models/onslaught/gen_gib2.md3", 5, true);
else
- ons_throwgib(hitloc + '0 0 20', force * -1, "models/onslaught/gen_gib3.md3", 5, TRUE);
+ ons_throwgib(hitloc + '0 0 20', force * -1, "models/onslaught/gen_gib3.md3", 5, true);
}
else
{
//throw some gibs on damage
if(random() < damage/200+0.2)
if(random() < 0.5)
- ons_throwgib(hitloc + '0 0 20', randomvec()*360, "models/onslaught/gen_gib1.md3", 5, FALSE);
+ ons_throwgib(hitloc + '0 0 20', randomvec()*360, "models/onslaught/gen_gib1.md3", 5, false);
}
// update links after a delay
if(e.lastshielded)
{
if(e.team == NUM_TEAM_1 || e.team == NUM_TEAM_2)
- WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_GENERATOR, 0.5 * colormapPaletteColor(e.team - 1, FALSE));
+ WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_GENERATOR, 0.5 * colormapPaletteColor(e.team - 1, false));
else
WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_GENERATOR, '0.5 0.5 0.5');
}
else
{
if(e.team == NUM_TEAM_1 || e.team == NUM_TEAM_2)
- WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_GENERATOR, colormapPaletteColor(e.team - 1, FALSE));
+ WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_GENERATOR, colormapPaletteColor(e.team - 1, false));
else
WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_GENERATOR, '0.75 0.75 0.75');
}
if(e.lastshielded)
{
if(e.team == NUM_TEAM_1 || e.team == NUM_TEAM_2)
- WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_CONTROLPOINT, 0.5 * colormapPaletteColor(e.team - 1, FALSE));
+ WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_CONTROLPOINT, 0.5 * colormapPaletteColor(e.team - 1, false));
else
WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_CONTROLPOINT, '0.5 0.5 0.5');
}
else
{
if(e.team == NUM_TEAM_1 || e.team == NUM_TEAM_2)
- WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_CONTROLPOINT, colormapPaletteColor(e.team - 1, FALSE));
+ WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_CONTROLPOINT, colormapPaletteColor(e.team - 1, false));
else
WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_CONTROLPOINT, '0.75 0.75 0.75');
}
self.team = self.team_saved;
self.lasthealth = self.max_health = self.health = autocvar_g_onslaught_gen_health;
self.takedamage = DAMAGE_AIM;
- self.bot_attack = TRUE;
- self.iscaptured = TRUE;
- self.islinked = TRUE;
- self.isshielded = TRUE;
+ self.bot_attack = true;
+ self.iscaptured = true;
+ self.islinked = true;
+ self.isshielded = true;
self.enemy.solid = SOLID_NOT;
self.think = onslaught_generator_delayed;
self.nextthink = time + 0.2;
setsize(self, '-52 -52 -14', '52 52 75');
setorigin(self, self.origin);
self.takedamage = DAMAGE_AIM;
- self.bot_attack = TRUE;
+ self.bot_attack = true;
self.event_damage = onslaught_generator_damage;
- self.iscaptured = TRUE;
- self.islinked = TRUE;
- self.isshielded = TRUE;
+ self.iscaptured = true;
+ self.islinked = true;
+ self.isshielded = true;
// helper entity that create fx when generator is damaged
onslaught_generator_damage_spawn(self);
// spawn shield model which indicates whether this can be damaged
if (IS_PLAYER(attacker))
{
- nag = FALSE;
+ nag = false;
if(self.team == NUM_TEAM_1)
{
if(time - ons_notification_time_team1 > 10)
{
- nag = TRUE;
+ nag = true;
ons_notification_time_team1 = time;
}
}
{
if(time - ons_notification_time_team2 > 10)
{
- nag = TRUE;
+ nag = true;
ons_notification_time_team2 = time;
}
}
else
- nag = TRUE;
+ nag = true;
if(nag)
play2team(self.team, "onslaught/controlpoint_underattack.wav");
string t;
t = Team_ColoredFullName(attacker.team);
bprint(Team_ColoredFullName(self.team), " ", self.message, " control point destroyed by ", t, "\n");
- ons_throwgib(self.origin, (2 * randomvec() - '1 1 1') * 25, "models/onslaught/controlpoint_icon_gib1.md3", 3, FALSE);
- ons_throwgib(self.origin, (2 * randomvec() - '1 1 1') * 45, "models/onslaught/controlpoint_icon_gib2.md3", 3, FALSE);
- ons_throwgib(self.origin, (2 * randomvec() - '1 1 1') * 45, "models/onslaught/controlpoint_icon_gib2.md3", 3, FALSE);
- ons_throwgib(self.origin, (2 * randomvec() - '1 1 1') * 75, "models/onslaught/controlpoint_icon_gib4.md3", 3, FALSE);
- ons_throwgib(self.origin, (2 * randomvec() - '1 1 1') * 75, "models/onslaught/controlpoint_icon_gib4.md3", 3, FALSE);
- ons_throwgib(self.origin, (2 * randomvec() - '1 1 1') * 75, "models/onslaught/controlpoint_icon_gib4.md3", 3, FALSE);
- ons_throwgib(self.origin, (2 * randomvec() - '1 1 1') * 75, "models/onslaught/controlpoint_icon_gib4.md3", 3, FALSE);
+ ons_throwgib(self.origin, (2 * randomvec() - '1 1 1') * 25, "models/onslaught/controlpoint_icon_gib1.md3", 3, false);
+ ons_throwgib(self.origin, (2 * randomvec() - '1 1 1') * 45, "models/onslaught/controlpoint_icon_gib2.md3", 3, false);
+ ons_throwgib(self.origin, (2 * randomvec() - '1 1 1') * 45, "models/onslaught/controlpoint_icon_gib2.md3", 3, false);
+ ons_throwgib(self.origin, (2 * randomvec() - '1 1 1') * 75, "models/onslaught/controlpoint_icon_gib4.md3", 3, false);
+ ons_throwgib(self.origin, (2 * randomvec() - '1 1 1') * 75, "models/onslaught/controlpoint_icon_gib4.md3", 3, false);
+ ons_throwgib(self.origin, (2 * randomvec() - '1 1 1') * 75, "models/onslaught/controlpoint_icon_gib4.md3", 3, false);
+ ons_throwgib(self.origin, (2 * randomvec() - '1 1 1') * 75, "models/onslaught/controlpoint_icon_gib4.md3", 3, false);
}
self.owner.goalentity = world;
- self.owner.islinked = FALSE;
- self.owner.iscaptured = FALSE;
+ self.owner.islinked = false;
+ self.owner.iscaptured = false;
self.owner.team = 0;
self.owner.colormap = 1024;
self.think = onslaught_controlpoint_icon_think;
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;
+ self.owner.iscaptured = true;
WaypointSprite_UpdateMaxHealth(self.owner.sprite, self.max_health);
WaypointSprite_UpdateHealth(self.owner.sprite, self.health);
setsize(e, '-32 -32 -32', '32 32 32');
setorigin(e, self.origin + '0 0 96');
e.takedamage = DAMAGE_AIM;
- e.bot_attack = TRUE;
+ e.bot_attack = true;
e.event_damage = onslaught_controlpoint_icon_damage;
e.team = other.team;
e.colormap = 1024 + (e.team - 1) * 17;
self.goalentity = world;
self.team = 0;
self.colormap = 1024;
- self.iscaptured = FALSE;
- self.islinked = FALSE;
- self.isshielded = TRUE;
+ self.iscaptured = false;
+ self.islinked = false;
+ self.isshielded = true;
self.enemy.solid = SOLID_NOT;
self.enemy.colormap = self.colormap;
self.think = onslaught_controlpoint_think;
self.touch = onslaught_controlpoint_touch;
self.team = 0;
self.colormap = 1024;
- self.iscaptured = FALSE;
- self.islinked = FALSE;
- self.isshielded = TRUE;
+ self.iscaptured = false;
+ self.islinked = false;
+ self.isshielded = true;
// spawn shield model which indicates whether this can be damaged
self.enemy = spawn();
{
WriteByte(MSG_ENTITY, self.clientcolors); // which is goalentity's color + enemy's color * 16
}
- return TRUE;
+ return true;
}
void onslaught_link_checkupdate()
if (self.target == "" || self.target2 == "")
objerror("target and target2 must be set\n");
InitializeEntity(self, onslaught_link_delayed, INITPRIO_FINDTARGET);
- Net_LinkEntity(self, FALSE, 0, onslaught_link_send);
+ Net_LinkEntity(self, false, 0, onslaught_link_send);
}
MUTATOR_HOOKFUNCTION(ons_BuildMutatorsString)
{
/*
- float _neer_home = (random() > 0.5 ? TRUE : FALSE);
+ float _neer_home = (random() > 0.5 ? true : false);
RandomSelection_Init();
if(random() < 0.5) // 50/50 chane to use default spawnsystem.
return 0;
- float _close_to_home = ((random() > 0.5) ? TRUE : FALSE);
+ float _close_to_home = ((random() > 0.5) ? true : false);
entity _best = world, _trg_gen = world;
float _score, _best_score = MAX_SHOT_DISTANCE;
if (e != world)
self.team = e.team;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(ons_MonsterSpawn)
self.use();
}
- return FALSE;
+ return false;
}
MUTATOR_DEFINITION(gamemode_onslaught)
void race_ScoreRules()
{
- ScoreRules_basics(race_teams, 0, 0, FALSE);
+ ScoreRules_basics(race_teams, 0, 0, false);
if(race_teams)
{
ScoreInfo_SetLabel_TeamScore( ST_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY);
}
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(race_ResetMap)
race_ScoreRules();
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(race_PlayerPreThink)
if(msg_entity.enemy.race_laptime)
race_SendNextCheckpoint(msg_entity.enemy, 1);
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(race_ClientConnect)
}
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(race_MakePlayerObserver)
race_PreparePlayer();
self.race_checkpoint = -1;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(race_PlayerSpawn)
self.race_place = 0;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(race_PutClientInServer)
race_AbandonRaceCheck(self);
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(race_PlayerDies)
{
self.respawn_flags |= RESPAWN_FORCE;
race_AbandonRaceCheck(self);
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(race_BotRoles)
{
self.havocbot_role = havocbot_role_race;
- return TRUE;
+ return true;
}
MUTATOR_HOOKFUNCTION(race_PlayerPostThink)
}
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(race_ForbidClearPlayerScore)
{
if(g_race_qualifying)
- return TRUE; // in qualifying, you don't lose score by observing
+ return true; // in qualifying, you don't lose score by observing
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(race_GetTeamCount)
{
ret_float = race_teams;
- return FALSE;
+ return false;
}
void race_Initialize()
MUTATOR_HOOKFUNCTION(tdm_GetTeamCount)
{
ret_string = "tdm_team";
- return TRUE;
+ return true;
}
MUTATOR_DEFINITION(gamemode_tdm)
if(IS_PLAYER(self))
if(self.health <= autocvar_g_bloodloss && self.deadflag == DEAD_NO)
{
- self.BUTTON_CROUCH = TRUE;
+ self.BUTTON_CROUCH = true;
if(time >= self.bloodloss_timer)
{
}
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(bloodloss_PlayerJump)
{
if(self.health <= autocvar_g_bloodloss)
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(bloodloss_BuildMutatorsString)
{
ret_string = strcat(ret_string, ":bloodloss");
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(bloodloss_BuildMutatorsPrettyString)
{
ret_string = strcat(ret_string, ", Blood loss");
- return FALSE;
+ return false;
}
MUTATOR_DEFINITION(mutator_bloodloss)
MUTATOR_HOOK(BuildMutatorsString, bloodloss_BuildMutatorsString, CBC_ORDER_ANY);
MUTATOR_HOOK(BuildMutatorsPrettyString, bloodloss_BuildMutatorsPrettyString, CBC_ORDER_ANY);
- return FALSE;
+ return false;
}
same_team = (SAME_TEAM(player, myowner) || SAME_TEAM(player, myowner));
if(myowner.alpha <= 0.5 && !same_team && myowner.alpha != 0)
- return FALSE;
+ return false;
if(player == myowner || (IS_SPEC(other) && other.enemy == myowner))
{
self.effects = EF_FULLBRIGHT | EF_LOWPRECISION;
self.alpha = 1;
}
- return TRUE;
+ return true;
}
// buff item
float buff_Waypoint_visible_for_player(entity plr)
{
if(!self.owner.buff_active && !self.owner.buff_activetime)
- return FALSE;
+ return false;
if(plr.buffs)
{
if(plr.cvar_cl_buffs_autoreplace)
{
if(plr.buffs == self.owner.buffs)
- return FALSE;
+ return false;
}
else
- return FALSE;
+ return false;
}
return WaypointSprite_visible_for_player(plr);
void buff_Waypoint_Spawn(entity e)
{
- WaypointSprite_Spawn(Buff_Sprite(e.buffs), 0, autocvar_g_buffs_waypoint_distance, e, '0 0 1' * e.maxs.z, world, e.team, e, buff_waypoint, TRUE, RADARICON_POWERUP, e.glowmod);
+ WaypointSprite_Spawn(Buff_Sprite(e.buffs), 0, autocvar_g_buffs_waypoint_distance, e, '0 0 1' * e.maxs.z, world, e.team, e, buff_waypoint, true, RADARICON_POWERUP, e.glowmod);
WaypointSprite_UpdateTeamRadar(e.buff_waypoint, RADARICON_POWERUP, e.glowmod);
e.buff_waypoint.waypointsprite_visible_for_player = buff_Waypoint_visible_for_player;
}
if(!MoveToRandomMapLocation(ent, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, ((autocvar_g_buffs_random_location_attempts > 0) ? autocvar_g_buffs_random_location_attempts : 10), 1024, 256))
{
- entity spot = SelectSpawnPoint(TRUE);
+ entity spot = SelectSpawnPoint(true);
setorigin(ent, ((spot.origin + '0 0 200') + (randomvec() * 300)));
ent.angles = spot.angles;
}
}
self.owner = other;
- self.buff_active = FALSE;
+ self.buff_active = false;
self.lifetime = 0;
Send_Notification(NOTIF_ONE, other, MSG_MULTI, ITEM_BUFF_GOT, self.buffs);
float buff_Available(float buffid)
{
if(buffid == BUFF_AMMO && ((start_items & IT_UNLIMITED_WEAPON_AMMO) || (start_items & IT_UNLIMITED_AMMO) || (cvar("g_melee_only"))))
- return FALSE;
+ return false;
if(buffid == BUFF_VAMPIRE && cvar("g_vampire"))
- return FALSE;
+ return false;
if(!cvar(strcat("g_buffs_", Buff_Name(buffid))))
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
void buff_NewType(entity ent, float cb)
if(!self.buff_activetime_updated)
{
buff_SetCooldown(self.buff_activetime);
- self.buff_activetime_updated = TRUE;
+ self.buff_activetime_updated = true;
}
if(!self.buff_active && !self.buff_activetime)
if(!self.buff_activetime)
{
- self.buff_active = TRUE;
+ self.buff_active = true;
sound(self, CH_TRIGGER, "misc/strength_respawn.wav", VOL_BASE, ATTN_NORM);
pointparticles(particleeffectnum("item_respawn"), CENTER_OR_VIEWOFS(self), '0 0 0', 1);
}
self.owner = world;
buff_SetCooldown(autocvar_g_buffs_cooldown_activate);
buff_Waypoint_Reset();
- self.buff_activetime_updated = FALSE;
+ self.buff_activetime_updated = false;
if(autocvar_g_buffs_random_location || (self.spawnflags & 1))
buff_Respawn(self);
// mutator hooks
MUTATOR_HOOKFUNCTION(buffs_PlayerDamage_SplitHealthArmor)
{
- if(frag_deathtype == DEATH_BUFF_VENGEANCE) { return FALSE; } // oh no you don't
+ if(frag_deathtype == DEATH_BUFF_VENGEANCE) { return false; } // oh no you don't
if(frag_target.buffs & BUFF_RESISTANCE)
{
damage_save = v.y;
}
- return FALSE;
+ return false;
}
void buff_Vengeance_DelayedDamage()
MUTATOR_HOOKFUNCTION(buffs_PlayerDamage_Calculate)
{
- if(frag_deathtype == DEATH_BUFF_VENGEANCE) { return FALSE; } // oh no you don't
+ if(frag_deathtype == DEATH_BUFF_VENGEANCE) { return false; } // oh no you don't
if(frag_target.buffs & BUFF_SPEED)
if(frag_target != frag_attacker)
if(DIFF_TEAM(frag_attacker, frag_target))
frag_attacker.health = bound(0, frag_attacker.health + bound(0, frag_damage * autocvar_g_buffs_vampire_damage_steal, frag_target.health), g_pickup_healthsmall_max);
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(buffs_PlayerSpawn)
// reset timers here to prevent them continuing after re-spawn
self.buff_disability_time = 0;
self.buff_disability_effect_time = 0;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(buffs_PlayerPhysics)
self.stat_sv_airspeedlimit_nonqw *= autocvar_g_buffs_disability_speed;
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(buffs_PlayerJump)
player_jumpheight = autocvar_g_buffs_jump_height;
self.stat_jumpheight = player_jumpheight;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(buffs_MonsterMove)
monster_speed_run *= autocvar_g_buffs_disability_speed;
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(buffs_PlayerDies)
self.buff_model = world;
}
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(buffs_PlayerUseKey)
{
- if(MUTATOR_RETURNVALUE || gameover) { return FALSE; }
+ if(MUTATOR_RETURNVALUE || gameover) { return false; }
if(self.buffs)
{
Send_Notification(NOTIF_ONE, self, MSG_MULTI, ITEM_BUFF_DROP, self.buffs);
self.buffs = 0;
sound(self, CH_TRIGGER, "relics/relic_effect.wav", VOL_BASE, ATTN_NORM);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(buffs_RemovePlayer)
self.buff_disability_time = 0;
self.buff_disability_effect_time = 0;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(buffs_CustomizeWaypoint)
// but only apply this to real players, not to spectators
if((self.owner.flags & FL_CLIENT) && (self.owner.buffs & BUFF_INVISIBLE) && (e == other))
if(DIFF_TEAM(self.owner, e))
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(buffs_OnEntityPreSpawn)
{
entity e = spawn();
buff_SpawnReplacement(e, self);
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(buffs_WeaponRate)
if(time < self.buff_disability_time)
weapon_rate *= autocvar_g_buffs_disability_rate;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(buffs_PlayerThink)
{
- if(gameover || self.deadflag != DEAD_NO) { return FALSE; }
+ if(gameover || self.deadflag != DEAD_NO) { return false; }
if(time < self.buff_disability_time)
if(time >= self.buff_disability_effect_time)
self.buff_model.alpha = self.alpha;
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(buffs_SpectateCopy)
{
self.buffs = other.buffs;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(buffs_VehicleEnter)
{
vh_vehicle.buffs = vh_player.buffs;
vh_player.buffs = 0;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(buffs_VehicleExit)
{
vh_player.buffs = vh_vehicle.buffs;
vh_vehicle.buffs = 0;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(buffs_PlayerRegen)
if(self.buffs & BUFF_SPEED)
regen_mod_regen = autocvar_g_buffs_speed_regen;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(buffs_GetCvars)
{
GetCvars_handleFloat(get_cvars_s, get_cvars_f, cvar_cl_buffs_autoreplace, "cl_buffs_autoreplace");
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(buffs_BuildMutatorsString)
{
ret_string = strcat(ret_string, ":Buffs");
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(buffs_BuildMutatorsPrettyString)
{
ret_string = strcat(ret_string, ", Buffs");
- return FALSE;
+ return false;
}
void buffs_DelayedInit()
buffs_Initialize();
}
- return FALSE;
+ return false;
}
{
Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER_CPID, CPID_CAMPCHECK);
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(campcheck_PlayerDamage)
frag_attacker.campcheck_traveled_distance = autocvar_g_campcheck_distance;
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(campcheck_PlayerThink)
}
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(campcheck_PlayerSpawn)
self.campcheck_nextcheck = time + autocvar_g_campcheck_interval * 2;
self.campcheck_traveled_distance = 0;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(campcheck_BuildMutatorsString)
{
ret_string = strcat(ret_string, ":CampCheck");
- return FALSE;
+ return false;
}
MUTATOR_DEFINITION(mutator_campcheck)
MUTATOR_HOOK(PlayerSpawn, campcheck_PlayerSpawn, CBC_ORDER_ANY);
MUTATOR_HOOK(BuildMutatorsString, campcheck_BuildMutatorsString, CBC_ORDER_ANY);
- return FALSE;
+ return false;
}
if (autocvar_sv_dodging_sound == 1)
PlayerSound(playersound_jump, CH_PLAYER, VOICETYPE_PLAYERSOUND);
- animdecide_setaction(self, ANIMACTION_JUMP, TRUE);
+ animdecide_setaction(self, ANIMACTION_JUMP, true);
self.dodging_single_action = 0;
}
trace_start = self.origin;
trace_end = self.origin + (1000*v_right);
- tracebox(trace_start, self.mins, self.maxs, trace_end, TRUE, self);
+ tracebox(trace_start, self.mins, self.maxs, trace_end, true, self);
if (trace_fraction < 1 && vlen (self.origin - trace_endpos) < threshold)
return 1;
trace_end = self.origin - (1000*v_right);
- tracebox(trace_start, self.mins, self.maxs, trace_end, TRUE, self);
+ tracebox(trace_start, self.mins, self.maxs, trace_end, true, self);
if (trace_fraction < 1 && vlen (self.origin - trace_endpos) < threshold)
return 1;
trace_end = self.origin + (1000*v_forward);
- tracebox(trace_start, self.mins, self.maxs, trace_end, TRUE, self);
+ tracebox(trace_start, self.mins, self.maxs, trace_end, true, self);
if (trace_fraction < 1 && vlen (self.origin - trace_endpos) < threshold)
return 1;
trace_end = self.origin - (1000*v_forward);
- tracebox(trace_start, self.mins, self.maxs, trace_end, TRUE, self);
+ tracebox(trace_start, self.mins, self.maxs, trace_end, true, self);
if (trace_fraction < 1 && vlen (self.origin - trace_endpos) < threshold)
return 1;
if (!e.instagib_needammo)
return;
Kill_Notification(NOTIF_ONE_ONLY, e, MSG_CENTER_CPID, CPID_INSTAGIB_FINDAMMO);
- e.instagib_needammo = FALSE;
+ e.instagib_needammo = false;
}
void instagib_ammocheck()
{
instagib_stop_countdown(self);
else
{
- self.instagib_needammo = TRUE;
+ self.instagib_needammo = true;
if (self.health <= 5)
{
Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
FOR_EACH_PLAYER(head)
instagib_stop_countdown(head);
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(instagib_MonsterLoot)
{
other.monster_loot = spawnfunc_item_minst_cells;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(instagib_MonsterSpawn)
if(self.monsterid == MON_MAGE)
self.skin = 1;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(instagib_BotShouldAttack)
{
if(checkentity.items & IT_STRENGTH)
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(instagib_MakePlayerObserver)
{
instagib_stop_countdown(self);
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(instagib_PlayerSpawn)
{
self.effects |= EF_FULLBRIGHT;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(instagib_PlayerPreThink)
{
instagib_ammocheck();
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(instagib_PlayerRegen)
{
// no regeneration in instagib
- return TRUE;
+ return true;
}
MUTATOR_HOOKFUNCTION(instagib_PlayerPowerups)
Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERUP_SPEED);
}
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(instagib_PlayerPhysics)
if(self.items & IT_INVINCIBLE)
self.stat_sv_maxspeed = self.stat_sv_maxspeed * autocvar_g_instagib_speed_highspeed;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(instagib_SplitHealthArmor)
damage_save = 0;
damage_take = frag_damage;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(instagib_ForbidThrowing)
{
// weapon dropping on death handled by FilterItem
- return TRUE;
+ return true;
}
MUTATOR_HOOKFUNCTION(instagib_PlayerDamage)
if(frag_target.items & IT_STRENGTH)
yoda = 1;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(instagib_SetStartItems)
start_weapons = warmup_start_weapons = WEPSET_VAPORIZER;
start_items |= IT_UNLIMITED_SUPERWEAPONS;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(instagib_FilterItem)
{
if(self.classname == "item_cells")
- return TRUE; // no normal cells?
+ return true; // no normal cells?
if(self.weapon == WEP_VAPORIZER && self.classname == "droppedweapon")
{
self.ammo_cells = autocvar_g_instagib_ammo_drop;
- return FALSE;
+ return false;
}
if(self.weapon == WEP_DEVASTATOR || self.weapon == WEP_VORTEX)
self = e;
spawnfunc_item_minst_cells();
self = oldself;
- return TRUE;
+ return true;
}
if(self.flags & FL_POWERUP)
- return FALSE;
+ return false;
if(self.ammo_cells > autocvar_g_instagib_ammo_drop && self.classname != "item_minst_cells")
self.ammo_cells = autocvar_g_instagib_ammo_drop;
if(self.ammo_cells && !self.weapon)
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
MUTATOR_HOOKFUNCTION(instagib_CustomizeWaypoint)
// but only apply this to real players, not to spectators
if((self.owner.flags & FL_CLIENT) && (self.owner.items & IT_STRENGTH) && (e == other))
if(DIFF_TEAM(self.owner, e))
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(instagib_ItemCountdown)
case IT_NAILS: item_name = "item-extralife"; item_color = '1 0 0'; break;
case IT_INVINCIBLE: item_name = "item-speed"; item_color = '1 0 1'; break;
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(instagib_ItemTouch)
MUTATOR_HOOKFUNCTION(instagib_OnEntityPreSpawn)
{
- if (!autocvar_g_powerups) { return FALSE; }
+ if (!autocvar_g_powerups) { return false; }
if (!(self.classname == "item_strength" || self.classname == "item_invincible" || self.classname == "item_health_mega"))
- return FALSE;
+ return false;
entity e = spawn();
e.noalign = self.noalign;
setorigin(e, self.origin);
- return TRUE;
+ return true;
}
MUTATOR_HOOKFUNCTION(instagib_BuildMutatorsString)
{
ret_string = strcat(ret_string, ":instagib");
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(instagib_BuildMutatorsPrettyString)
{
ret_string = strcat(ret_string, ", instagib");
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(instagib_SetModname)
{
modname = "instagib";
- return TRUE;
+ return true;
}
MUTATOR_DEFINITION(mutator_instagib)
MUTATOR_HOOK(BuildMutatorsPrettyString, instagib_BuildMutatorsPrettyString, CBC_ORDER_ANY);
MUTATOR_HOOK(SetModname, instagib_SetModname, CBC_ORDER_ANY);
- return FALSE;
+ return false;
}
start_ammo_shells = warmup_start_ammo_shells = 0;
start_weapons = warmup_start_weapons = WEPSET_SHOTGUN;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(melee_ForbidThrowing)
{
- return TRUE;
+ return true;
}
MUTATOR_HOOKFUNCTION(melee_FilterItem)
{
case IT_5HP:
case IT_ARMOR_SHARD:
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
MUTATOR_HOOKFUNCTION(melee_BuildMutatorsString)
{
ret_string = strcat(ret_string, ":MeleeOnly");
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(melee_BuildMutatorsPrettyString)
{
ret_string = strcat(ret_string, ", Melee Only Arena");
- return FALSE;
+ return false;
}
MUTATOR_DEFINITION(mutator_melee_only)
MUTATOR_HOOK(BuildMutatorsString, melee_BuildMutatorsString, CBC_ORDER_ANY);
MUTATOR_HOOK(BuildMutatorsPrettyString, melee_BuildMutatorsPrettyString, CBC_ORDER_ANY);
- return FALSE;
+ return false;
}
if(IS_PLAYER(frag_attacker))
if(IS_PLAYER(frag_target))
if(time < self.midair_shieldtime)
- frag_damage = FALSE;
+ frag_damage = false;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(midair_PlayerPowerups)
self.midair_shieldtime = max(self.midair_shieldtime, time + autocvar_g_midair_shieldtime);
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(midair_PlayerSpawn)
if(IS_BOT_CLIENT(self))
self.bot_moveskill = 0; // disable bunnyhopping
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(midair_BuildMutatorsString)
{
ret_string = strcat(ret_string, ":midair");
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(midair_BuildMutatorsPrettyString)
{
ret_string = strcat(ret_string, ", Midair");
- return FALSE;
+ return false;
}
MUTATOR_DEFINITION(mutator_midair)
MUTATOR_HOOK(BuildMutatorsString, midair_BuildMutatorsString, CBC_ORDER_ANY);
MUTATOR_HOOK(BuildMutatorsPrettyString, midair_BuildMutatorsPrettyString, CBC_ORDER_ANY);
- return FALSE;
+ return false;
}
if(self.flags & FL_ONGROUND)
self.multijump_count = 0;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(multijump_PlayerJump)
{
if (self.flags & FL_JUMPRELEASED && !(self.flags & FL_ONGROUND)) // jump button pressed this frame and we are in midair
- self.multijump_ready = TRUE; // this is necessary to check that we released the jump button and pressed it again
+ self.multijump_ready = true; // this is necessary to check that we released the jump button and pressed it again
else
- self.multijump_ready = FALSE;
+ self.multijump_ready = false;
if(!player_multijump && self.multijump_ready && (autocvar_g_multijump == -1 || self.multijump_count < autocvar_g_multijump) && self.velocity.z > autocvar_g_multijump_speed)
{
{
if (self.velocity.z < autocvar_sv_jumpvelocity)
{
- player_multijump = TRUE;
+ player_multijump = true;
self.velocity_z = 0;
}
}
else
- player_multijump = TRUE;
+ player_multijump = true;
if(player_multijump)
{
self.multijump_count += 1;
}
}
- self.multijump_ready = FALSE; // require releasing and pressing the jump button again for the next jump
+ self.multijump_ready = false; // require releasing and pressing the jump button again for the next jump
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(multijump_BuildMutatorsString)
{
ret_string = strcat(ret_string, ":multijump");
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(multijump_BuildMutatorsPrettyString)
{
ret_string = strcat(ret_string, ", Multi jump");
- return FALSE;
+ return false;
}
MUTATOR_DEFINITION(mutator_multijump)
MUTATOR_HOOK(BuildMutatorsString, multijump_BuildMutatorsString, CBC_ORDER_ANY);
MUTATOR_HOOK(BuildMutatorsPrettyString, multijump_BuildMutatorsPrettyString, CBC_ORDER_ANY);
- return FALSE;
+ return false;
}
void nade_burn_spawn(entity _nade)
{
- CSQCProjectile(_nade, TRUE, Nade_ProjectileFromID(_nade.nade_type, TRUE), TRUE);
+ CSQCProjectile(_nade, true, Nade_ProjectileFromID(_nade.nade_type, true), true);
}
void nade_spawn(entity _nade)
_nade.effects |= EF_LOWPRECISION;
- CSQCProjectile(_nade, TRUE, Nade_ProjectileFromID(_nade.nade_type, FALSE), TRUE);
+ CSQCProjectile(_nade, true, Nade_ProjectileFromID(_nade.nade_type, false), true);
}
void napalm_damage(float dist, float damage, float edgedamage, float burntime)
return;
RandomSelection_Init();
- for(e = WarpZone_FindRadius(self.origin, dist, TRUE); e; e = e.chain)
+ for(e = WarpZone_FindRadius(self.origin, dist, true); e; e = e.chain)
if(e.takedamage == DAMAGE_AIM)
if(self.realowner != e || autocvar_g_nades_napalm_selfdamage)
if(!IS_PLAYER(e) || !self.realowner || DIFF_TEAM(e, self))
proj.realowner = self.realowner;
proj.team = self.owner.team;
proj.classname = "grenade";
- proj.bot_dodge = TRUE;
+ proj.bot_dodge = true;
proj.bot_dodgerating = autocvar_g_nades_napalm_ball_damage;
proj.movetype = MOVETYPE_BOUNCE;
proj.projectiledeathtype = DEATH_NADE_NAPALM;
proj.flags = FL_PROJECTILE;
proj.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_ARC;
- //CSQCProjectile(proj, TRUE, PROJECTILE_NAPALM_FIRE, TRUE);
+ //CSQCProjectile(proj, true, PROJECTILE_NAPALM_FIRE, true);
}
fountain.team = self.team;
fountain.movetype = MOVETYPE_TOSS;
fountain.projectiledeathtype = DEATH_NADE_NAPALM;
- fountain.bot_dodge = TRUE;
+ fountain.bot_dodge = true;
fountain.bot_dodgerating = autocvar_g_nades_napalm_fountain_damage;
fountain.nade_special_time = time;
setsize(fountain, '-16 -16 -16', '16 16 16');
- CSQCProjectile(fountain, TRUE, PROJECTILE_NAPALM_FOUNTAIN, TRUE);
+ CSQCProjectile(fountain, true, PROJECTILE_NAPALM_FOUNTAIN, true);
}
void nade_ice_freeze(entity freezefield, entity frost_target, float freeze_time)
{
frost_target.frozen_by = freezefield.realowner;
pointparticles(particleeffectnum("electro_impact"), frost_target.origin, '0 0 0', 1);
- Freeze(frost_target, 1/freeze_time, 3, FALSE);
+ Freeze(frost_target, 1/freeze_time, 3, false);
if(frost_target.ballcarried)
if(g_keepaway) { ka_DropEvent(frost_target); }
else { DropBall(frost_target.ballcarried, frost_target.origin, frost_target.velocity);}
if(frost_target.flagcarried) { ctf_Handle_Throw(frost_target, world, DROP_THROW); }
if(frost_target.nade) { toss_nade(frost_target, '0 0 0', time + 0.05); }
- kh_Key_DropAll(frost_target, FALSE);
+ kh_Key_DropAll(frost_target, false);
}
void nade_ice_think()
fountain.team = self.team;
fountain.movetype = MOVETYPE_TOSS;
fountain.projectiledeathtype = DEATH_NADE_ICE;
- fountain.bot_dodge = FALSE;
+ fountain.bot_dodge = false;
setsize(fountain, '-16 -16 -16', '16 16 16');
fountain.nade_special_time = time+0.3;
fountain.angles = self.angles;
healer.healer_lifetime = autocvar_g_nades_heal_time; // save the cvar
healer.ltime = time + healer.healer_lifetime;
healer.team = self.realowner.team;
- healer.bot_dodge = FALSE;
+ healer.bot_dodge = false;
healer.solid = SOLID_TRIGGER;
healer.touch = nade_heal_touch;
vector size = '1 1 1' * healer.healer_radius / 2;
setsize(healer,-size,size);
- Net_LinkEntity(healer, TRUE, 0, healer_send);
+ Net_LinkEntity(healer, true, 0, healer_send);
healer.think = nade_heal_think;
healer.nextthink = time;
void nade_monster_boom()
{
- entity e = spawnmonster(self.pokenade_type, 0, self.realowner, self.realowner, self.origin, FALSE, FALSE, 1);
+ entity e = spawnmonster(self.pokenade_type, 0, self.realowner, self.realowner, self.origin, false, false, 1);
if(autocvar_g_nades_pokenade_monster_lifetime > 0)
e.monster_lifetime = time + autocvar_g_nades_pokenade_monster_lifetime;
makevectors(e.v_angle);
- W_SetupShot(e, FALSE, FALSE, "", CH_WEAPON_A, 0);
+ W_SetupShot(e, false, false, "", CH_WEAPON_A, 0);
Kill_Notification(NOTIF_ONE_ONLY, e, MSG_CENTER_CPID, CPID_NADES);
setsize(_nade, '-16 -16 -16', '16 16 16');
_nade.movetype = MOVETYPE_BOUNCE;
- tracebox(_nade.origin, _nade.mins, _nade.maxs, _nade.origin, FALSE, _nade);
+ tracebox(_nade.origin, _nade.mins, _nade.maxs, _nade.origin, false, _nade);
if (trace_startsolid)
setorigin(_nade, e.origin);
else if(autocvar_g_nades_nade_newton_style == 2)
_nade.velocity = _velocity;
else
- _nade.velocity = W_CalculateProjectileVelocity(e.velocity, _velocity, TRUE);
+ _nade.velocity = W_CalculateProjectileVelocity(e.velocity, _velocity, true);
_nade.touch = nade_touch;
_nade.health = autocvar_g_nades_nade_health;
_nade.customizeentityforclient = func_null;
_nade.exteriormodeltoclient = world;
_nade.traileffectnum = 0;
- _nade.teleportable = TRUE;
- _nade.pushable = TRUE;
+ _nade.teleportable = true;
+ _nade.pushable = true;
_nade.gravity = 1;
_nade.missile_flags = MIF_SPLASH | MIF_ARC;
- _nade.damagedbycontents = TRUE;
+ _nade.damagedbycontents = true;
_nade.angles = vectoangles(_nade.velocity);
_nade.flags = FL_PROJECTILE;
_nade.projectiledeathtype = DEATH_NADE;
float nade_customize()
{
- //if(IS_SPEC(other)) { return FALSE; }
+ //if(IS_SPEC(other)) { return false; }
if(other == self.realowner || (IS_SPEC(other) && other.enemy == self.realowner))
{
// somewhat hide the model, but keep the glow
{
//self.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
if(!self.traileffectnum)
- self.traileffectnum = particleeffectnum(Nade_TrailEffect(Nade_ProjectileFromID(self.nade_type, FALSE), self.team));
+ self.traileffectnum = particleeffectnum(Nade_TrailEffect(Nade_ProjectileFromID(self.nade_type, false), self.team));
self.alpha = 1;
}
- return TRUE;
+ return true;
}
void nade_prime()
//setattachment(n, self, "bip01 l hand");
n.exteriormodeltoclient = self;
n.customizeentityforclient = nade_customize;
- n.traileffectnum = particleeffectnum(Nade_TrailEffect(Nade_ProjectileFromID(n.nade_type, FALSE), self.team));
+ n.traileffectnum = particleeffectnum(Nade_TrailEffect(Nade_ProjectileFromID(n.nade_type, false), self.team));
n.colormod = Nade_Color(n.nade_type);
n.realowner = self;
n.colormap = self.colormap;
float CanThrowNade()
{
if(self.vehicle)
- return FALSE;
+ return false;
if(gameover)
- return FALSE;
+ return false;
if(self.deadflag != DEAD_NO)
- return FALSE;
+ return false;
if (!autocvar_g_nades)
- return FALSE; // allow turning them off mid match
+ return false; // allow turning them off mid match
if(forbidWeaponUse())
- return FALSE;
+ return false;
if (!IS_PLAYER(self))
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
void nades_CheckThrow()
MUTATOR_HOOKFUNCTION(nades_CheckThrow)
{
if(MUTATOR_RETURNVALUE) { nades_CheckThrow(); }
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(nades_VehicleEnter)
if(vh_player.nade)
toss_nade(vh_player, '0 0 100', max(vh_player.nade.wait, time + 0.05));
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(nades_PlayerPreThink)
{
- if(!IS_PLAYER(self)) { return FALSE; }
+ if(!IS_PLAYER(self)) { return false; }
float key_pressed = self.BUTTON_HOOK;
float time_score;
- if(g_grappling_hook || client_hasweapon(self, WEP_HOOK, FALSE, FALSE) || (weaponsInMap & WEPSET_HOOK))
+ if(g_grappling_hook || client_hasweapon(self, WEP_HOOK, false, false) || (weaponsInMap & WEPSET_HOOK))
key_pressed = self.button16; // if hook is enabled, use an alternate key
if(self.nade)
if(!o)
o = other;
if(self.frozen == 1)
- other.reviving = TRUE;
+ other.reviving = true;
++n;
}
}
FOR_EACH_PLAYER(other) if(other.reviving)
{
other.revive_progress = self.revive_progress;
- other.reviving = FALSE;
+ other.reviving = false;
}
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(nades_PlayerSpawn)
}
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(nades_PlayerDies)
nades_RemoveBonus(frag_target);
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(nades_PlayerDamage)
Send_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_FREEZETAG_REVIVE_SELF);
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(nades_MonsterDies)
if(!(self.spawnflags & MONSTERFLAG_SPAWNED))
nades_GiveBonus(frag_attacker, autocvar_g_nades_bonus_score_minor);
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(nades_RemovePlayer)
{
nades_Clear(self);
nades_RemoveBonus(self);
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(nades_SpectateCopy)
self.bonus_nade_score = other.bonus_nade_score;
self.stat_healing_orb = other.stat_healing_orb;
self.stat_healing_orb_alpha = other.stat_healing_orb_alpha;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(nades_GetCvars)
GetCvars_handleFloat(get_cvars_s, get_cvars_f, cvar_cl_nade_type, "cl_nade_type");
GetCvars_handleString(get_cvars_s, get_cvars_f, cvar_cl_pokenade_type, "cl_pokenade_type");
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(nades_BuildMutatorsString)
{
ret_string = strcat(ret_string, ":Nades");
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(nades_BuildMutatorsPrettyString)
{
ret_string = strcat(ret_string, ", Nades");
- return FALSE;
+ return false;
}
void nades_Initialize()
nades_Initialize();
}
- return FALSE;
+ return false;
}
case WEP_HLAC:
case WEP_RIFLE:
case WEP_SHOCKWAVE:
- return TRUE;
+ return true;
default:
- return FALSE;
+ return false;
}
}
entity e;
e = get_weaponinfo(wpn);
if(!e.weapon) // skip dummies
- return FALSE;
+ return false;
if(g_weaponarena)
{
if(!(g_weaponarena_weapons & WepSet_FromWeapon(wpn)))
- return FALSE;
+ return false;
}
else
{
if(wpn == WEP_BLASTER && g_nix_with_blaster) // WEAPONTODO: rename to g_nix_with_blaster
- return FALSE;
+ return false;
if(e.spawnflags & WEP_FLAG_MUTATORBLOCKED)
- return FALSE;
+ return false;
if (!(e.spawnflags & WEP_FLAG_NORMAL))
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
void NIX_ChooseNextWeapon()
{
self.weapons |= WepSet_FromWeapon(nix_weapon);
if(self.switchweapon != nix_weapon)
- if(!client_hasweapon(self, self.switchweapon, TRUE, FALSE))
- if(client_hasweapon(self, nix_weapon, TRUE, FALSE))
+ if(!client_hasweapon(self, self.switchweapon, true, false))
+ if(client_hasweapon(self, nix_weapon, true, false))
W_SwitchWeapon(nix_weapon);
}
e.ammo_rockets = start_ammo_rockets;
e.ammo_fuel = start_ammo_fuel;
e.weapons = start_weapons;
- if(!client_hasweapon(e, e.weapon, TRUE, FALSE))
+ if(!client_hasweapon(e, e.weapon, true, false))
e.switchweapon = w_getbestweapon(self);
}
}
float ok_CheckWeaponCharge(entity ent, float wep)
{
- if(!ent.ok_use_ammocharge) return TRUE;
+ if(!ent.ok_use_ammocharge) return true;
entity wepent = get_weaponinfo(wep);
}
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(ok_PlayerDamage_SplitHealthArmor)
{
if(damage_take)
self.ok_pauseregen_finished = max(self.ok_pauseregen_finished, time + 2);
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(ok_PlayerDies)
}
self = spawn();
- self.ok_item = TRUE;
- self.noalign = TRUE;
- self.pickup_anyway = TRUE;
+ self.ok_item = true;
+ self.noalign = true;
+ self.pickup_anyway = true;
spawnfunc_item_armor_small();
self.movetype = MOVETYPE_TOSS;
self.gravity = 1;
self.ok_lastwep = self.switchweapon;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(ok_PlayerRegen)
self.ammo_fuel = CalcRotRegen(self.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, frametime * (time > self.pauseregen_finished) * ((self.items & IT_FUEL_REGEN) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, frametime * (time > self.pauserotfuel_finished), limitf);
}
- return TRUE; // return TRUE anyway, as frozen uses no regen
+ return true; // return true anyway, as frozen uses no regen
}
MUTATOR_HOOKFUNCTION(ok_ForbidThrowCurrentWeapon)
{
- return TRUE;
+ return true;
}
MUTATOR_HOOKFUNCTION(ok_PlayerPreThink)
{
if(intermission_running || gameover)
- return FALSE;
+ return false;
if(self.deadflag != DEAD_NO || !IS_PLAYER(self) || self.frozen)
- return FALSE;
+ return false;
if(self.ok_lastwep)
{
);
}
- self.weapon_blocked = FALSE;
+ self.weapon_blocked = false;
self.ok_ammo_charge = self.ammo_charge[self.weapon];
if(self.weaponentity.state != WS_CLEAR)
w_ready();
- self.weapon_blocked = TRUE;
+ self.weapon_blocked = true;
}
self.BUTTON_ATCK2 = 0;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(ok_PlayerSpawn)
self.ok_pauseregen_finished = time + 2;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(ok_OnEntityPreSpawn)
setorigin(wep, self.origin);
setmodel(wep, "models/weapons/g_ok_hmg.md3");
wep.classname = "weapon_hmg";
- wep.ok_item = TRUE;
+ wep.ok_item = true;
wep.noalign = self.noalign;
wep.cnt = self.cnt;
wep.team = self.team;
wep.respawntime = autocvar_g_overkill_superguns_respawn_time;
- wep.pickup_anyway = TRUE;
+ wep.pickup_anyway = true;
wep.think = spawnfunc_weapon_hmg;
wep.nextthink = time + 0.1;
- return TRUE;
+ return true;
}
if(self.classname == "item_invincible")
setorigin(wep, self.origin);
setmodel(wep, "models/weapons/g_ok_rl.md3");
wep.classname = "weapon_rpc";
- wep.ok_item = TRUE;
+ wep.ok_item = true;
wep.noalign = self.noalign;
wep.cnt = self.cnt;
wep.team = self.team;
wep.respawntime = autocvar_g_overkill_superguns_respawn_time;
- wep.pickup_anyway = TRUE;
+ wep.pickup_anyway = true;
wep.think = spawnfunc_weapon_rpc;
wep.nextthink = time + 0.1;
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(ok_ItemRemove)
{
if(self.ok_item)
- return FALSE;
+ return false;
switch(self.items)
{
case IT_ARMOR: return !(autocvar_g_overkill_100a_anyway);
}
- return TRUE;
+ return true;
}
MUTATOR_HOOKFUNCTION(ok_SpectateCopy)
self.ammo_charge[self.weapon] = other.ammo_charge[other.weapon];
self.ok_use_ammocharge = other.ok_use_ammocharge;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(ok_StartItems)
start_items |= IT_UNLIMITED_WEAPON_AMMO;
start_weapons = warmup_start_weapons = ok_start_items;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(ok_BuildMutatorsString)
{
ret_string = strcat(ret_string, ":OK");
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(ok_BuildMutatorsPrettyString)
{
ret_string = strcat(ret_string, ", Overkill");
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(ok_SetModname)
{
modname = "Overkill";
- return TRUE;
+ return true;
}
void ok_SetCvars()
(get_weaponinfo(WEP_HMG)).spawnflags |= WEP_FLAG_MUTATORBLOCKED;
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(item_spawning)
{
if(self.owner == world && autocvar_g_physical_items <= 1)
- return FALSE;
+ return false;
if (self.spawnflags & 1) // floating item
- return FALSE;
+ return false;
// The actual item can't be physical and trigger at the same time, so make it invisible and use a second entity for physics.
// Ugly hack, but unless SOLID_TRIGGER is gotten to work with MOVETYPE_PHYSICS in the engine it can't be fixed.
self.movetype = MOVETYPE_FOLLOW;
self.aiment = wep; // attach the original weapon
- return FALSE;
+ return false;
}
MUTATOR_DEFINITION(mutator_physical_items)
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');
+ W_ThrowNewWeapon(self, j, false, self.origin + (self.mins + self.maxs) * 0.5, randomvec() * 175 + '0 0 325');
- return TRUE;
+ return true;
}
MUTATOR_HOOKFUNCTION(pinata_BuildMutatorsString)
{
ret_string = strcat(ret_string, ":Pinata");
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(pinata_BuildMutatorsPrettyString)
{
ret_string = strcat(ret_string, ", Piñata");
- return FALSE;
+ return false;
}
MUTATOR_DEFINITION(mutator_pinata)
MUTATOR_HOOK(BuildMutatorsString, pinata_BuildMutatorsString, CBC_ORDER_ANY);
MUTATOR_HOOK(BuildMutatorsPrettyString, pinata_BuildMutatorsPrettyString, CBC_ORDER_ANY);
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(gravity_StartFrame)
{
- if(gameover || !cvar("g_random_gravity")) return FALSE;
- if(time < gravity_delay) return FALSE;
- if(time < game_starttime) return FALSE;
- if(round_handler_IsActive() && !round_handler_IsRoundStarted()) return FALSE;
+ if(gameover || !cvar("g_random_gravity")) return false;
+ if(time < gravity_delay) return false;
+ if(time < game_starttime) return false;
+ if(round_handler_IsActive() && !round_handler_IsRoundStarted()) return false;
if(random() >= autocvar_g_random_gravity_negative_chance)
cvar_set("sv_gravity", ftos(bound(autocvar_g_random_gravity_min, random() - random() * -autocvar_g_random_gravity_negative, autocvar_g_random_gravity_max)));
dprint("Gravity is now: ", ftos(autocvar_sv_gravity), "\n");
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(gravity_BuildMutatorsString)
cvar_settemp("sv_gravity", cvar_string("sv_gravity")); // settemp current gravity so it's restored on match end
}
- return FALSE;
+ return false;
}
#define _SSMAGIX "SUPERSPEC_OPTIONSFILE_V1"
-#define _ISLOCAL ((edict_num(1) == self) ? TRUE : FALSE)
+#define _ISLOCAL ((edict_num(1) == self) ? true : false)
const float ASF_STRENGTH = 1;
const float ASF_SHIELD = 2;
if(Spectate(_player) == 1)
self.classname = "spectator";
- return TRUE;
+ return true;
}
void superspec_save_client_conf()
float i;
if(_for.superspec_itemfilter == "")
- return TRUE;
+ return true;
if(_for.superspec_itemfilter == "")
- return TRUE;
+ return true;
float l = tokenize_console(_for.superspec_itemfilter);
for(i = 0; i < l; ++i)
{
if(argv(i) == _item.classname)
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(superspec_ItemTouch)
var = strcat(var, text," ^7(^3 ", long, "^7 | ^3", short, " ^7)\n")
if(MUTATOR_RETURNVALUE) // command was already handled?
- return FALSE;
+ return false;
if(IS_PLAYER(self))
- return FALSE;
+ return false;
if(cmd_name == "superspec_itemfilter")
{
if(self.superspec_itemfilter == "")
{
superspec_msg("^3superspec_itemfilter^7 is ^1not^7 set", "\n^3superspec_itemfilter^7 is ^1not^7 set\n", self, "", 1);
- return TRUE;
+ return true;
}
float i;
float l = tokenize_console(self.superspec_itemfilter);
self.superspec_itemfilter = strzone(argv(1));
}
- return TRUE;
+ return true;
}
if(cmd_name == "superspec")
_aspeco = strcat(_aspeco, "^3 item_message ^7(short^5 im^7) makes superspectate print items that were picked up.\n");
_aspeco = strcat(_aspeco, "^7 Use cmd superspec_itemfilter \"item_class1 item_class2\" to set up a filter of what to show with ^3item_message.\n");
superspec_msg("^2Available Super Spectate ^3options:\n\n\n", "\n^2Available Super Spectate ^3options:\n", self, _aspeco, 1);
- return TRUE;
+ return true;
}
if(argv(1) == "clear")
superspec_msg("^3Current Super Spectate options are:\n\n\n\n\n", "\n^3Current Super Spectate options are:\n", self, _aspeco, 1);
- return TRUE;
+ return true;
}
/////////////////////
_aspeco = strcat(_aspeco, "^3 followkiller ^7(short ^5fk^7) to autospec the killer/off\n");
_aspeco = strcat(_aspeco, "^3 all ^7(short ^5aa^7) to turn everything on/off\n");
superspec_msg("^2Available Auto Spectate ^3options:\n\n\n", "\n^2Available Auto Spectate ^3options:\n", self, _aspeco, 1);
- return TRUE;
+ return true;
}
float i, _bits = 0, _start = 1;
OPTIONINFO(self.autospec_flags, _aspeco, ASF_FOLLOWKILLER, "Followkiller", "followkiller", "fk");
superspec_msg("^3Current auto spectate options are:\n\n\n\n\n", "\n^3Current auto spectate options are:\n", self, _aspeco, 1);
- return TRUE;
+ return true;
}
if(cmd_name == "followpowerup")
}
superspec_msg("", "", self, "No active powerup\n", 1);
- return TRUE;
+ return true;
}
if(cmd_name == "followstrength")
}
superspec_msg("", "", self, "No active Strength\n", 1);
- return TRUE;
+ return true;
}
if(cmd_name == "followshield")
}
superspec_msg("", "", self, "No active Shield\n", 1);
- return TRUE;
+ return true;
}
if(cmd_name == "followfc")
{
if(!g_ctf)
- return TRUE;
+ return true;
entity _player;
float _team = 0;
- float found = FALSE;
+ float found = false;
if(cmd_argc == 2)
{
{
if(_player.flagcarried && (_player.team == _team || _team == 0))
{
- found = TRUE;
+ found = true;
if(_team == 0 && IS_SPEC(self) && self.enemy == _player)
continue; // already spectating a fc, try to find the other fc
return _spectate(_player);
if(!found)
superspec_msg("", "", self, "No active flag carrier\n", 1);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
#undef OPTIONINFO
}
MUTATOR_HOOKFUNCTION(superspec_ClientConnect)
{
if(!IS_REAL_CLIENT(self))
- return FALSE;
+ return false;
string fn = "superspec-local.options";
float fh;
if (!_ISLOCAL)
{
if(self.crypto_idfp == "")
- return FALSE;
+ return false;
fn = sprintf("superspec-%s.options", uri_escape(self.crypto_idfp));
}
fclose(fh);
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(superspec_PlayerDies)
}
self = _old_self;
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(superspec_ClientDisconnect)
{
superspec_save_client_conf();
- return FALSE;
+ return false;
}
MUTATOR_DEFINITION(mutator_superspec)
}
}
- return FALSE;
+ return false;
}
MUTATOR_DEFINITION(mutator_touchexplode)
{
MUTATOR_HOOK(PlayerPreThink, touchexplode_PlayerThink, CBC_ORDER_ANY);
- return FALSE;
+ return false;
}
frag_attacker.health = bound(0, frag_attacker.health, autocvar_g_balance_health_limit);
}
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(vampire_BuildMutatorsString)
entity sandbox_ObjectEdit_Get(float permissions)
{
// Returns the traced entity if the player can edit it, and world if not.
- // If permissions if FALSE, the object is returned regardless of editing rights.
+ // If permissions if false, the object is returned regardless of editing rights.
// Attached objects are SOLID_NOT and do not get traced.
crosshair_trace_plusvisibletriggers(self);
// set public object information
e.netname = strzone(self.netname); // name of the owner
- e.message = strzone(strftime(TRUE, "%d-%m-%Y %H:%M:%S")); // creation time
- e.message2 = strzone(strftime(TRUE, "%d-%m-%Y %H:%M:%S")); // last editing time
+ e.message = strzone(strftime(true, "%d-%m-%Y %H:%M:%S")); // creation time
+ e.message2 = strzone(strftime(true, "%d-%m-%Y %H:%M:%S")); // last editing time
// set origin and direction based on player position and view angle
makevectors(self.v_angle);
file_name = strcat("sandbox/storage_", autocvar_g_sandbox_storage_name, "_", GetMapname(), ".txt");
file_get = fopen(file_name, FILE_WRITE);
- fputs(file_get, strcat("// sandbox storage \"", autocvar_g_sandbox_storage_name, "\" for map \"", GetMapname(), "\" last updated ", strftime(TRUE, "%d-%m-%Y %H:%M:%S")));
+ fputs(file_get, strcat("// sandbox storage \"", autocvar_g_sandbox_storage_name, "\" for map \"", GetMapname(), "\" last updated ", strftime(true, "%d-%m-%Y %H:%M:%S")));
fputs(file_get, strcat(" containing ", ftos(object_count), " objects\n"));
for(head = world; (head = find(head, classname, "object")); )
continue;
// use a line of text for each object, listing all properties
- fputs(file_get, strcat(sandbox_ObjectPort_Save(head, TRUE), "\n"));
+ fputs(file_get, strcat(sandbox_ObjectPort_Save(head, true), "\n"));
}
fclose(file_get);
}
continue;
entity e;
- e = sandbox_ObjectPort_Load(file_read, TRUE);
+ e = sandbox_ObjectPort_Load(file_read, true);
if(e.material)
{
MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
{
if(MUTATOR_RETURNVALUE) // command was already handled?
- return FALSE;
+ return false;
if(cmd_name == "g_sandbox")
{
if(autocvar_g_sandbox_readonly)
{
print_to(self, "^2SANDBOX - INFO: ^7Sandbox mode is active, but in read-only mode. Sandbox commands cannot be used");
- return TRUE;
+ return true;
}
if(cmd_argc < 2)
{
print_to(self, "^2SANDBOX - INFO: ^7Sandbox mode is active. For usage information, type 'sandbox help'");
- return TRUE;
+ return true;
}
switch(argv(1))
print_to(self, "^3mesh ^7- prints information about the object's mesh, including skeletal bones");
print_to(self, "^3attachments ^7- prints information about the object's attachments");
print_to(self, "^7The ^1drag object ^7key can be used to grab and carry objects. Players can only grab their own objects");
- return TRUE;
+ return true;
// ---------------- COMMAND: OBJECT, SPAWN ----------------
case "object_spawn":
if(time < self.object_flood)
{
print_to(self, strcat("^1SANDBOX - WARNING: ^7Flood protection active. Please wait ^3", ftos(self.object_flood - time), " ^7seconds beofore spawning another object"));
- return TRUE;
+ return true;
}
self.object_flood = time + autocvar_g_sandbox_editor_flood;
if(object_count >= autocvar_g_sandbox_editor_maxobjects)
{
print_to(self, strcat("^1SANDBOX - WARNING: ^7Cannot spawn any more objects. Up to ^3", ftos(autocvar_g_sandbox_editor_maxobjects), " ^7objects may exist at a time"));
- return TRUE;
+ return true;
}
if(cmd_argc < 3)
{
print_to(self, "^1SANDBOX - WARNING: ^7Attempted to spawn an object without specifying a model. Please specify the path to your model file after the 'object_spawn' command");
- return TRUE;
+ return true;
}
if (!(fexists(argv(2))))
{
print_to(self, "^1SANDBOX - WARNING: ^7Attempted to spawn an object with a non-existent model. Make sure the path to your model file is correct");
- return TRUE;
+ return true;
}
- e = sandbox_ObjectSpawn(FALSE);
+ e = sandbox_ObjectSpawn(false);
setmodel(e, argv(2));
if(autocvar_g_sandbox_info > 0)
print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " spawned an object at origin ^3", vtos(e.origin), "\n"));
- return TRUE;
+ return true;
// ---------------- COMMAND: OBJECT, REMOVE ----------------
case "object_remove":
- e = sandbox_ObjectEdit_Get(TRUE);
+ e = sandbox_ObjectEdit_Get(true);
if(e != world)
{
if(autocvar_g_sandbox_info > 0)
print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " removed an object at origin ^3", vtos(e.origin), "\n"));
sandbox_ObjectRemove(e);
- return TRUE;
+ return true;
}
print_to(self, "^1SANDBOX - WARNING: ^7Object could not be removed. Make sure you are facing an object that you have edit rights over");
- return TRUE;
+ return true;
// ---------------- COMMAND: OBJECT, DUPLICATE ----------------
case "object_duplicate":
e = sandbox_ObjectEdit_Get(autocvar_g_sandbox_editor_free); // can we copy objects we can't edit?
if(e != world)
{
- s = sandbox_ObjectPort_Save(e, FALSE);
+ s = sandbox_ObjectPort_Save(e, false);
s = strreplace("\"", "\\\"", s);
stuffcmd(self, strcat("set ", argv(3), " \"", s, "\""));
print_to(self, "^2SANDBOX - INFO: ^7Object copied to clipboard");
- return TRUE;
+ return true;
}
print_to(self, "^1SANDBOX - WARNING: ^7Object could not be copied. Make sure you are facing an object that you have copy rights over");
- return TRUE;
+ return true;
case "paste":
// spawns a new object using the properties in the player's clipboard cvar
if(time < self.object_flood)
{
print_to(self, strcat("^1SANDBOX - WARNING: ^7Flood protection active. Please wait ^3", ftos(self.object_flood - time), " ^7seconds beofore spawning another object"));
- return TRUE;
+ return true;
}
self.object_flood = time + autocvar_g_sandbox_editor_flood;
if(argv(3) == "") // no object in clipboard
{
print_to(self, "^1SANDBOX - WARNING: ^7No object in clipboard. You must copy an object before you can paste it");
- return TRUE;
+ return true;
}
if(object_count >= autocvar_g_sandbox_editor_maxobjects)
{
print_to(self, strcat("^1SANDBOX - WARNING: ^7Cannot spawn any more objects. Up to ^3", ftos(autocvar_g_sandbox_editor_maxobjects), " ^7objects may exist at a time"));
- return TRUE;
+ return true;
}
- e = sandbox_ObjectPort_Load(argv(3), FALSE);
+ e = sandbox_ObjectPort_Load(argv(3), false);
print_to(self, "^2SANDBOX - INFO: ^7Object pasted successfully");
if(autocvar_g_sandbox_info > 0)
print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " pasted an object at origin ^3", vtos(e.origin), "\n"));
- return TRUE;
+ return true;
}
- return TRUE;
+ return true;
// ---------------- COMMAND: OBJECT, ATTACH ----------------
case "object_attach":
{
case "get":
// select e as the object as meant to be attached
- e = sandbox_ObjectEdit_Get(TRUE);
+ e = sandbox_ObjectEdit_Get(true);
if(e != world)
{
self.object_attach = e;
print_to(self, "^2SANDBOX - INFO: ^7Object selected for attachment");
- return TRUE;
+ return true;
}
print_to(self, "^1SANDBOX - WARNING: ^7Object could not be selected for attachment. Make sure you are facing an object that you have edit rights over");
- return TRUE;
+ return true;
case "set":
if(self.object_attach == world)
{
print_to(self, "^1SANDBOX - WARNING: ^7No object selected for attachment. Please select an object to be attached first.");
- return TRUE;
+ return true;
}
// attaches the previously selected object to e
- e = sandbox_ObjectEdit_Get(TRUE);
+ e = sandbox_ObjectEdit_Get(true);
if(e != world)
{
sandbox_ObjectAttach_Set(self.object_attach, e, argv(3));
print_to(self, "^2SANDBOX - INFO: ^7Object attached successfully");
if(autocvar_g_sandbox_info > 1)
print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " attached objects at origin ^3", vtos(e.origin), "\n"));
- return TRUE;
+ return true;
}
print_to(self, "^1SANDBOX - WARNING: ^7Object could not be attached to the parent. Make sure you are facing an object that you have edit rights over");
- return TRUE;
+ return true;
case "remove":
// removes e if it was attached
- e = sandbox_ObjectEdit_Get(TRUE);
+ e = sandbox_ObjectEdit_Get(true);
if(e != world)
{
sandbox_ObjectAttach_Remove(e);
print_to(self, "^2SANDBOX - INFO: ^7Child objects detached successfully");
if(autocvar_g_sandbox_info > 1)
print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " detached objects at origin ^3", vtos(e.origin), "\n"));
- return TRUE;
+ return true;
}
print_to(self, "^1SANDBOX - WARNING: ^7Child objects could not be detached. Make sure you are facing an object that you have edit rights over");
- return TRUE;
+ return true;
}
- return TRUE;
+ return true;
// ---------------- COMMAND: OBJECT, EDIT ----------------
case "object_edit":
if(argv(2) == "")
{
print_to(self, "^1SANDBOX - WARNING: ^7Too few parameters. You must specify a property to edit");
- return TRUE;
+ return true;
}
- e = sandbox_ObjectEdit_Get(TRUE);
+ e = sandbox_ObjectEdit_Get(true);
if(e != world)
{
switch(argv(2))
break;
default:
print_to(self, "^1SANDBOX - WARNING: ^7Invalid object property. For usage information, type 'sandbox help'");
- return TRUE;
+ return true;
}
// update last editing time
if(e.message2) strunzone(e.message2);
- e.message2 = strzone(strftime(TRUE, "%d-%m-%Y %H:%M:%S"));
+ e.message2 = strzone(strftime(true, "%d-%m-%Y %H:%M:%S"));
if(autocvar_g_sandbox_info > 1)
print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " edited property ^3", argv(2), " ^7of an object at origin ^3", vtos(e.origin), "\n"));
- return TRUE;
+ return true;
}
print_to(self, "^1SANDBOX - WARNING: ^7Object could not be edited. Make sure you are facing an object that you have edit rights over");
- return TRUE;
+ return true;
// ---------------- COMMAND: OBJECT, CLAIM ----------------
case "object_claim":
if(self.crypto_idfp == "")
{
print_to(self, "^1SANDBOX - WARNING: ^7You do not have a player UID, and cannot claim objects");
- return TRUE;
+ return true;
}
- e = sandbox_ObjectEdit_Get(TRUE);
+ e = sandbox_ObjectEdit_Get(true);
if(e != world)
{
// update the owner's name
if(e.crypto_idfp == self.crypto_idfp)
{
print_to(self, "^2SANDBOX - INFO: ^7Object is already yours, nothing to claim");
- return TRUE;
+ return true;
}
if(e.crypto_idfp) strunzone(e.crypto_idfp);
print_to(self, "^2SANDBOX - INFO: ^7Object claimed successfully");
}
print_to(self, "^1SANDBOX - WARNING: ^7Object could not be claimed. Make sure you are facing an object that you have edit rights over");
- return TRUE;
+ return true;
// ---------------- COMMAND: OBJECT, INFO ----------------
case "object_info":
// prints public information about the object to the player
- e = sandbox_ObjectEdit_Get(FALSE);
+ e = sandbox_ObjectEdit_Get(false);
if(e != world)
{
switch(argv(2))
{
case "object":
print_to(self, strcat("^2SANDBOX - INFO: ^7Object is owned by \"^7", e.netname, "^7\", created \"^3", e.message, "^7\", last edited \"^3", e.message2, "^7\""));
- return TRUE;
+ return true;
case "mesh":
s = "";
FOR_EACH_TAG(e)
s = strcat(s, "^7\"^5", gettaginfo_name, "^7\", ");
print_to(self, strcat("^2SANDBOX - INFO: ^7Object mesh is \"^3", e.model, "^7\" at animation frame ^3", ftos(e.frame), " ^7containing the following tags: ", s));
- return TRUE;
+ return true;
case "attachments":
// this should show the same info as 'mesh' but for attachments
s = "";
print_to(self, strcat("^2SANDBOX - INFO: ^7Object contains the following ^1", ftos(i), "^7 attachment(s): ", s));
else
print_to(self, "^2SANDBOX - INFO: ^7Object contains no attachments");
- return TRUE;
+ return true;
}
}
print_to(self, "^1SANDBOX - WARNING: ^7No information could be found. Make sure you are facing an object");
- return TRUE;
+ return true;
// ---------------- COMMAND: DEFAULT ----------------
default:
print_to(self, "Invalid command. For usage information, type 'sandbox help'");
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
float autosave_time;
MUTATOR_HOOKFUNCTION(sandbox_StartFrame)
{
if(!autocvar_g_sandbox_storage_autosave)
- return FALSE;
+ return false;
if(time < autosave_time)
- return FALSE;
+ return false;
autosave_time = time + autocvar_g_sandbox_storage_autosave;
sandbox_Database_Save();
- return TRUE;
+ return true;
}
MUTATOR_HOOKFUNCTION(sandbox_SetModname)
{
modname = "Sandbox";
- return TRUE;
+ return true;
}
MUTATOR_DEFINITION(sandbox)
// nothing to remove
}
- return FALSE;
+ return false;
}
n.path_next = world;
n.path_prev = world;
- n.is_path_node = FALSE;
+ n.is_path_node = false;
n.owner = scraplist;
#else
- //n.is_path_node = FALSE;
+ //n.is_path_node = false;
n.think = SUB_Remove;
n.nextthink = time;
#endif
entity node;
node = newnode();
- node.is_path_node = TRUE;
+ node.is_path_node = true;
node.owner = openlist;
node.path_prev = parent;
node = findradius(where,pathlib_gridsize * 0.75);
while(node)
{
- if(node.is_path_node == TRUE)
+ if(node.is_path_node == true)
{
++pathlib_merge_cnt;
if(node.owner == openlist)
if(pathlib_movenode_goodnode)
{
goal_node = node;
- pathlib_foundgoal = TRUE;
+ pathlib_foundgoal = true;
}
}
}
{
entity node;
- node = findfloat(world,is_path_node, TRUE);
+ node = findfloat(world,is_path_node, true);
while(node)
{
dumpnode(node);
- node = findfloat(node,is_path_node, TRUE);
+ node = findfloat(node,is_path_node, true);
}
if(openlist)
void dumpnode(entity n)
{
- n.is_path_node = FALSE;
+ n.is_path_node = false;
n.think = SUB_Remove;
n.nextthink = time;
}
node.think = SUB_Remove;
node.nextthink = time + PATHLIB_NODEEXPIRE;
- node.is_path_node = TRUE;
+ node.is_path_node = true;
node.owner = openlist;
node.path_prev = parent;
node = findradius(where,pathlib_gridsize * 0.5);
while(node)
{
- if(node.is_path_node == TRUE)
+ if(node.is_path_node == true)
{
++pathlib_merge_cnt;
if(node.owner == openlist)
if(pathlib_movenode_goodnode)
{
goal_node = node;
- pathlib_foundgoal = TRUE;
+ pathlib_foundgoal = true;
}
}
}
entity node;
- node = findfloat(world,is_path_node, TRUE);
+ node = findfloat(world,is_path_node, true);
while(node)
{
/*
*/
dumpnode(node);
- node = findfloat(node,is_path_node, TRUE);
+ node = findfloat(node,is_path_node, true);
}
if(openlist)
best_open_node = world;
if(wp == goal_node)
- pathlib_foundgoal = TRUE;
+ pathlib_foundgoal = true;
}
float pathlib_wpp_opencb(entity wp, entity child, float cost)
{
if(child.pathlib_list == closedlist)
- return FALSE;
+ return false;
// FIXME! wp.wp##mincost is NOT distance. Make it distance or add a field for distance to be used here (for better speed)
cost = vlen(child.origin - wp.origin);
if(child == goal_node)
- pathlib_foundgoal = TRUE;
+ pathlib_foundgoal = true;
++pathlib_open_cnt;
if(best_open_node.pathlib_node_f > child.pathlib_node_f)
best_open_node = child;
- return TRUE;
+ return true;
}
float pathlib_wpp_openncb(entity wp, entity child, float cost)
{
if(child.pathlib_list == closedlist)
- return FALSE;
+ return false;
// FIXME! wp.wp##mincost is NOT distance. Make it distance or add a field for distance to be used here (for better speed)
cost = vlen(child.origin - wp.origin);
child.pathlib_node_f = child.pathlib_node_g + child.pathlib_node_h;
if(child == goal_node)
- pathlib_foundgoal = TRUE;
+ pathlib_foundgoal = true;
++pathlib_open_cnt;
if(best_open_node.pathlib_node_f > child.pathlib_node_f)
best_open_node = child;
- return TRUE;
+ return true;
}
float pathlib_wpp_expand(entity wp)
pathlib_movecost_diag = vlen('1 1 0' * pathlib_movecost);
if (!pathlib_wpp_waypointcallback)
- callback = FALSE;
+ callback = false;
if (callback)
pathlib_wpp_open = pathlib_wpp_opencb;
pathlib_closed_cnt = 0;
pathlib_open_cnt = 0;
pathlib_searched_cnt = 0;
- pathlib_foundgoal = FALSE;
+ pathlib_foundgoal = false;
dprint("pathlib_waypointpath init\n");
node = findradius(where,pathlib_gridsize * 0.5);
while(node)
{
- if(node.is_path_node == TRUE)
+ if(node.is_path_node == true)
return node;
node = node.chain;
{
self.modelindex = self.savemodelindex;
}
- return TRUE;
+ return true;
}
// cleanup:
float race_waypointsprite_visible_for_player(entity e)
{
if(e.race_checkpoint == -1 || self.owner.race_checkpoint == -2)
- return TRUE;
+ return true;
else if(e.race_checkpoint == self.owner.race_checkpoint)
- return TRUE;
+ return true;
else
- return FALSE;
+ return false;
}
float have_verified;
// race only (middle of the race)
g_race_qualifying = 0;
self.race_place = 0;
- if(!Spawn_FilterOutBadSpots(findchain(classname, "info_player_deathmatch"), 0, FALSE))
+ if(!Spawn_FilterOutBadSpots(findchain(classname, "info_player_deathmatch"), 0, false))
error(strcat("Checkpoint ", ftos(i), " misses a spawnpoint with race_place==", ftos(self.race_place), " (used for respawning in race) - bailing out"));
if(i == 0)
// qualifying only
g_race_qualifying = 1;
self.race_place = race_lowest_place_spawn;
- if(!Spawn_FilterOutBadSpots(findchain(classname, "info_player_deathmatch"), 0, FALSE))
+ if(!Spawn_FilterOutBadSpots(findchain(classname, "info_player_deathmatch"), 0, false))
error(strcat("Checkpoint ", ftos(i), " misses a spawnpoint with race_place==", ftos(self.race_place), " (used for qualifying) - bailing out"));
// race only (initial spawn)
for(p = 1; p <= race_highest_place_spawn; ++p)
{
self.race_place = p;
- if(!Spawn_FilterOutBadSpots(findchain(classname, "info_player_deathmatch"), 0, FALSE))
+ if(!Spawn_FilterOutBadSpots(findchain(classname, "info_player_deathmatch"), 0, false))
error(strcat("Checkpoint ", ftos(i), " misses a spawnpoint with race_place==", ftos(self.race_place), " (used for initially spawning in race) - bailing out"));
}
}
self.race_checkpoint = race_NextCheckpoint(0);
g_race_qualifying = 1;
self.race_place = race_lowest_place_spawn;
- if(!Spawn_FilterOutBadSpots(findchain(classname, "info_player_deathmatch"), 0, FALSE))
+ if(!Spawn_FilterOutBadSpots(findchain(classname, "info_player_deathmatch"), 0, false))
error(strcat("Checkpoint 0 misses a spawnpoint with race_place==", ftos(self.race_place), " (used for qualifying) - bailing out"));
}
else
if(self.wait)
{
- self.wait = FALSE;
+ self.wait = false;
self.cnt = self.count + 1; // init countdown
round_starttime = time + self.count;
- reset_map(TRUE);
+ reset_map(true);
}
if(self.cnt > 0) // countdown running
if(self.canRoundEnd())
{
// schedule a new round
- self.wait = TRUE;
+ self.wait = true;
self.nextthink = time + self.delay;
}
else
round_handler.canRoundStart = canRoundStart_func;
round_handler.canRoundEnd = canRoundEnd_func;
round_handler.roundStart = roundStart_func;
- round_handler.wait = FALSE;
+ round_handler.wait = false;
round_handler_Init(5, 5, 180);
round_handler.nextthink = time;
}
void round_handler_Reset(float next_think)
{
- round_handler.wait = FALSE;
+ round_handler.wait = false;
if(round_handler.count)
if(round_handler.cnt < round_handler.count + 1)
round_handler.cnt = round_handler.count + 1;
entity round_handler;
.float delay; // stores delay from round end to countdown start
.float count; // stores initial number of the countdown
-.float wait; // it's set to TRUE when round ends, to FALSE when countdown starts
+.float wait; // it's set to true when round ends, to false when countdown starts
.float cnt; // its initial value is .count + 1, then decreased while counting down
// reaches 0 when the round starts
.float round_timelimit;
WriteChar(MSG_ENTITY, self.(teamscores[i]));
}
- return TRUE;
+ return true;
}
void TeamScore_Spawn(float t, string name)
ts.classname = "csqc_score_team";
ts.netname = name; // not used yet, FIXME
ts.team = t;
- Net_LinkEntity(ts, FALSE, 0, TeamScore_SendEntity);
+ Net_LinkEntity(ts, false, 0, TeamScore_SendEntity);
teamscorekeepers[t - 1] = ts;
++teamscores_entities_count;
PlayerStats_GameReport_AddTeam(t);
WriteString(MSG_ENTITY, teamscores_label[i]);
WriteByte(MSG_ENTITY, teamscores_flags[i]);
}
- return TRUE;
+ return true;
}
void ScoreInfo_Init(float teams)
{
scores_initialized = spawn();
scores_initialized.classname = "ent_client_scoreinfo";
- Net_LinkEntity(scores_initialized, FALSE, 0, ScoreInfo_SendEntity);
+ Net_LinkEntity(scores_initialized, false, 0, ScoreInfo_SendEntity);
}
if(teams >= 1)
TeamScore_Spawn(NUM_TEAM_1, "Red");
WriteChar(MSG_ENTITY, self.(scores[i]));
}
- return TRUE;
+ return true;
}
float PlayerScore_Clear(entity player)
error("player already has a scorekeeper");
sk = spawn();
sk.owner = player;
- Net_LinkEntity(sk, FALSE, 0, PlayerScore_SendEntity);
+ Net_LinkEntity(sk, false, 0, PlayerScore_SendEntity);
player.scorekeeper = sk;
}
if(teamplay)
{
CheckAllowedTeams(world);
- ScoreRules_basics(((c4>=0) ? 4 : (c3>=0) ? 3 : 2), SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, TRUE);
+ ScoreRules_basics(((c4>=0) ? 4 : (c3>=0) ? 3 : 2), SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, true);
}
else
- ScoreRules_basics(0, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, TRUE);
+ ScoreRules_basics(0, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, true);
ScoreRules_basics_end();
}
WriteShort(MSG_ENTITY, self.origin.y);
WriteShort(MSG_ENTITY, self.origin.z);
- return TRUE;
+ return true;
}
float SpawnEvent_Send(entity to, float sf)
WriteShort(MSG_ENTITY, self.owner.origin.x);
WriteShort(MSG_ENTITY, self.owner.origin.y);
WriteShort(MSG_ENTITY, self.owner.origin.z);
- send = TRUE;
+ send = true;
}
else if((to == self.owner) || (IS_SPEC(to) && (to.enemy == self.owner)) )
{
WriteByte(MSG_ENTITY, 0);
- send = TRUE;
+ send = true;
}
- else { send = FALSE; }
+ else { send = false; }
return send;
}
// nudge off the floor
setorigin(self, self.origin + '0 0 1');
- tracebox(self.origin, PL_MIN, PL_MAX, self.origin, TRUE, self);
+ tracebox(self.origin, PL_MIN, PL_MAX, self.origin, true, self);
if (trace_startsolid)
{
vector o;
||
autocvar_g_spawn_useallspawns
)
- { Net_LinkEntity(self, FALSE, 0, SpawnPoint_Send); }
+ { Net_LinkEntity(self, false, 0, SpawnPoint_Send); }
}
void spawnfunc_info_player_survivor (void)
float dm;
oldself = self;
- for(self = world; (self = findfloat(self, damagedbycontents, TRUE)); )
+ for(self = world; (self = findfloat(self, damagedbycontents, true)); )
{
if (self.movetype == MOVETYPE_NOCLIP) { continue; }
skill = autocvar_skill;
// detect when the pre-game countdown (if any) has ended and the game has started
- game_delay = (time < game_starttime) ? TRUE : FALSE;
+ game_delay = (time < game_starttime) ? true : false;
- if(game_delay_last == TRUE)
- if(game_delay == FALSE)
+ if(game_delay_last == true)
+ if(game_delay == false)
if(autocvar_sv_eventlog)
GameLogEcho(":startdelay_ended");
WriteCoord(MSG_ENTITY, self.velocity.z);
}
- return TRUE;
+ return true;
}
void ItemUpdate(entity item)
if(self.flags & FL_POWERUP)
{
if(autocvar_g_powerups > 0)
- return TRUE;
+ return true;
if(autocvar_g_powerups == 0)
- return FALSE;
+ return false;
}
else
{
if(autocvar_g_pickup_items > 0)
- return TRUE;
+ return true;
if(autocvar_g_pickup_items == 0)
- return FALSE;
+ return false;
if(g_weaponarena)
if(self.weapons || (self.items & IT_AMMO)) // no item or ammo pickups in weaponarena
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
/*
float Item_Customize()
{
if(self.spawnshieldtime)
- return TRUE;
+ return true;
if(self.weapons & ~other.weapons)
{
self.colormod = '0 0 0';
self.glowmod = self.colormod;
self.alpha = 0.5 + 0.5 * g_ghost_items; // halfway more alpha
- return TRUE;
+ return true;
}
else
{
self.colormod = stov(autocvar_g_ghost_items_color);
self.glowmod = self.colormod;
self.alpha = g_ghost_items;
- return TRUE;
+ return true;
}
else
- return FALSE;
+ return false;
}
}
*/
}
if(name)
{
- WaypointSprite_Spawn(name, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, TRUE, RADARICON_POWERUP, rgb);
+ WaypointSprite_Spawn(name, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, true, RADARICON_POWERUP, rgb);
if(self.waypointsprite_attached)
WaypointSprite_UpdateBuildFinished(self.waypointsprite_attached, time + ITEM_RESPAWN_TICKS);
}
float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax, float mode)
{
if (!item.ammotype)
- return FALSE;
+ return false;
if (item.spawnshieldtime)
{
}
}
- return FALSE;
+ return false;
:YEAH
switch(mode)
default:
break;
}
- return TRUE;
+ return true;
}
float Item_GiveTo(entity item, entity player)
float i;
// if nothing happens to player, just return without taking the item
- pickedup = FALSE;
- _switchweapon = FALSE;
+ pickedup = false;
+ _switchweapon = false;
// in case the player has autoswitch enabled do the following:
// if the player is using their best weapon before items are given, they
// probably want to switch to an even better weapon after items are given
if (player.autoswitch)
if (player.switchweapon == w_getbestweapon(player))
- _switchweapon = TRUE;
+ _switchweapon = true;
if (!(player.weapons & WepSet_FromWeapon(player.switchweapon)))
- _switchweapon = TRUE;
+ _switchweapon = true;
pickedup |= Item_GiveAmmoTo(item, player, ammo_fuel, g_pickup_fuel_max, ITEM_MODE_FUEL);
pickedup |= Item_GiveAmmoTo(item, player, ammo_shells, g_pickup_shells_max, ITEM_MODE_NONE);
if (it || (item.spawnshieldtime && item.pickup_anyway))
{
- pickedup = TRUE;
+ pickedup = true;
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
if(it & WepSet_FromWeapon(i))
{
if((it = (item.items - (item.items & player.items)) & IT_PICKUPMASK))
{
- pickedup = TRUE;
+ pickedup = true;
player.items |= it;
Send_Notification(NOTIF_ONE, player, MSG_INFO, INFO_ITEM_WEAPON_GOT, item.netname);
}
if (item.strength_finished)
{
- pickedup = TRUE;
+ pickedup = true;
player.strength_finished = max(player.strength_finished, time) + item.strength_finished;
}
if (item.invincible_finished)
{
- pickedup = TRUE;
+ pickedup = true;
player.invincible_finished = max(player.invincible_finished, time) + item.invincible_finished;
}
if (item.superweapons_finished)
{
- pickedup = TRUE;
+ pickedup = true;
player.superweapons_finished = max(player.superweapons_finished, time) + item.superweapons_finished;
}
// always eat teamed entities
if(item.team)
- pickedup = TRUE;
+ pickedup = true;
if (!pickedup)
return 0;
float commodity_pickupevalfunc(entity player, entity item)
{
float c, i;
- float need_shells = FALSE, need_nails = FALSE, need_rockets = FALSE, need_cells = FALSE, need_plasma = FALSE, need_fuel = FALSE;
+ float need_shells = false, need_nails = false, need_rockets = false, need_cells = false, need_plasma = false, need_fuel = false;
entity wi;
c = 0;
continue;
if(wi.items & IT_SHELLS)
- need_shells = TRUE;
+ need_shells = true;
else if(wi.items & IT_NAILS)
- need_nails = TRUE;
+ need_nails = true;
else if(wi.items & IT_ROCKETS)
- need_rockets = TRUE;
+ need_rockets = true;
else if(wi.items & IT_CELLS)
- need_cells = TRUE;
+ need_cells = true;
else if(wi.items & IT_PLASMA)
- need_plasma = TRUE;
+ need_plasma = true;
else if(wi.items & IT_FUEL)
- need_fuel = TRUE;
+ need_fuel = true;
}
// TODO: figure out if the player even has the weapon this ammo is for?
void StartItem (string itemmodel, string pickupsound, float defaultrespawntime, float defaultrespawntimejitter, string itemname, float itemid, float weaponid, float itemflags, float(entity player, entity item) pickupevalfunc, float pickupbasevalue)
{
- startitem_failed = FALSE;
+ startitem_failed = false;
if(self.model == "")
self.model = itemmodel;
if(MUTATOR_CALLHOOK(FilterItem)) // error means we do not want the item
{
- startitem_failed = TRUE;
+ startitem_failed = true;
remove(self);
return;
}
traceline(self.origin, self.origin, MOVE_NORMAL, self);
if (trace_dpstartcontents & DPCONTENTS_NODROP)
{
- startitem_failed = TRUE;
+ startitem_failed = true;
remove(self);
return;
}
{
if(!have_pickup_item())
{
- startitem_failed = TRUE;
+ startitem_failed = true;
remove (self);
return;
}
else
setsize (self, '-16 -16 0', '16 16 32');
- // note droptofloor returns FALSE if stuck/or would fall too far
+ // note droptofloor returns false if stuck/or would fall too far
droptofloor();
waypoint_spawnforitem(self);
}
{
// target_give not yet supported; maybe later
print("removed targeted ", self.classname, "\n");
- startitem_failed = TRUE;
+ startitem_failed = true;
remove (self);
return;
}
error("Mapper sucks.");
}
}
- self.is_item = TRUE;
+ self.is_item = true;
}
weaponsInMap |= WepSet_FromWeapon(weaponid);
self.target = "###item###"; // for finding the nearest item using find()
}
- self.bot_pickup = TRUE;
+ self.bot_pickup = true;
self.bot_pickupevalfunc = pickupevalfunc;
self.bot_pickupbasevalue = pickupbasevalue;
self.mdl = self.model;
else
Item_Reset();
- Net_LinkEntity(self, FALSE, 0, ItemSend);
+ Net_LinkEntity(self, false, 0, ItemSend);
self.SendFlags |= ISF_SIZE;
if(self.angles)
// call this hook after everything else has been done
if(MUTATOR_CALLHOOK(Item_Spawn))
{
- startitem_failed = TRUE;
+ startitem_failed = true;
remove(self);
return;
}
if(autocvar_sv_q3acompat_machineshotgunswap)
if(self.classname != "droppedweapon")
{
- weaponswapping = TRUE;
+ weaponswapping = true;
spawnfunc_item_shells();
- weaponswapping = FALSE;
+ weaponswapping = false;
return;
}
if(autocvar_sv_q3acompat_machineshotgunswap)
if(self.classname != "droppedweapon")
{
- weaponswapping = TRUE;
+ weaponswapping = true;
spawnfunc_item_bullets();
- weaponswapping = FALSE;
+ weaponswapping = false;
return;
}
got = 0;
- _switchweapon = FALSE;
+ _switchweapon = false;
if (e.autoswitch)
if (e.switchweapon == w_getbestweapon(e))
- _switchweapon = TRUE;
+ _switchweapon = true;
e.strength_finished = max(0, e.strength_finished - time);
e.invincible_finished = max(0, e.invincible_finished - time);
e.superweapons_finished += time;
if (!(e.weapons & WepSet_FromWeapon(e.switchweapon)))
- _switchweapon = TRUE;
+ _switchweapon = true;
if(_switchweapon)
W_SwitchWeapon_Force(e, w_getbestweapon(e));
{
float i;
float found;
- found = FALSE;
+ found = false;
for(i = 0; i < other.jumppadcount && i < NUM_JUMPPADSUSED; ++i)
if(other.(jumppadsused[i]) == self)
- found = TRUE;
+ found = true;
if(!found)
{
other.(jumppadsused[other.jumppadcount % NUM_JUMPPADSUSED]) = self;
other.lastteleporttime = time;
if (other.deadflag == DEAD_NO)
- animdecide_setaction(other, ANIMACTION_JUMP, TRUE);
+ animdecide_setaction(other, ANIMACTION_JUMP, true);
}
else
- other.jumppadcount = TRUE;
+ other.jumppadcount = true;
// reset tracking of who pushed you into a hazard (for kill credit)
other.pushltime = 0;
if(n > 2)
if(argv(2) == "force")
- return TRUE; // no checking, return immediately
+ return true; // no checking, return immediately
if(!cubic_speedfunc_is_sane(e.platmovetype_start, e.platmovetype_end))
{
objerror("Invalid platform move type; platform would go in reverse, which is not allowed.");
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
void spawnfunc_path_corner()
SUB_CalcAngleMove(ang, TSPEED_TIME, self.ltime - time + self.wait, train_wait);
else // instant turning
SUB_CalcAngleMove(ang, TSPEED_TIME, 0.0000001, train_wait);
- self.train_wait_turning = TRUE;
+ self.train_wait_turning = true;
return;
}
if(self.wait < 0 || self.train_wait_turning) // no waiting or we already waited while turning
{
- self.train_wait_turning = FALSE;
+ self.train_wait_turning = false;
train_next();
}
else
if (self.spawnflags & 2)
{
- self.platmovetype_turn = TRUE;
+ self.platmovetype_turn = true;
self.view_ofs = '0 0 0'; // don't offset a rotating train, origin works differently now
}
else
// no key needed
if (!door.itemkeys)
- return TRUE;
+ return true;
// this door require a key
// only a player can have a key
if (!IS_PLAYER(other))
- return FALSE;
+ return false;
if (item_keys_usekey(door, other)) {
// some keys were used
// door is now unlocked
play2(other, "misc/talk.wav");
Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_DOOR_UNLOCKED);
- return TRUE;
+ return true;
} else
- return FALSE;
+ return false;
}
{
float DELTA = 4;
if (e1.absmin.x > e2.absmax.x + DELTA)
- return FALSE;
+ return false;
if (e1.absmin.y > e2.absmax.y + DELTA)
- return FALSE;
+ return false;
if (e1.absmin.z > e2.absmax.z + DELTA)
- return FALSE;
+ return false;
if (e2.absmin.x > e1.absmax.x + DELTA)
- return FALSE;
+ return false;
if (e2.absmin.y > e1.absmax.y + DELTA)
- return FALSE;
+ return false;
if (e2.absmin.z > e1.absmax.z + DELTA)
- return FALSE;
- return TRUE;
+ return false;
+ return true;
}
/*
string message_save;
self.health = 10000;
- self.bot_attack = TRUE;
+ self.bot_attack = true;
// exit if still moving around...
if (self.origin != self.oldorigin)
setorigin (player, to);
player.oldorigin = to; // don't undo the teleport by unsticking
player.angles = to_angles;
- player.fixangle = TRUE;
+ player.fixangle = true;
player.velocity = to_velocity;
BITXOR_ASSIGN(player.effects, EF_TELEPORT_BIT);
self.use = trigger_music_use;
self.reset = trigger_music_reset;
- Net_LinkEntity(self, FALSE, 0, trigger_music_SendEntity);
+ Net_LinkEntity(self, false, 0, trigger_music_SendEntity);
}
// invalid
if(ca < 0 || cb < 0)
- return FALSE;
+ return false;
// equal
if(ta == tb)
- return TRUE;
+ return true;
if(IS_REAL_CLIENT(e))
{
// keep teams alive (teams of size 0 always count as smaller, ignoring score)
if(ca < 1)
if(cb >= 1)
- return TRUE;
+ return true;
if(ca >= 1)
if(cb < 1)
- return FALSE;
+ return false;
// first, normalize
f = max(ca, cb, 1);
// otherwise end up on the smallest team (handled below)
}
- smallest = FindSmallestTeam(pl, TRUE);
+ smallest = FindSmallestTeam(pl, true);
if(!only_return_best && !pl.bot_forced_team)
{
if(scolor == dcolor)
{
//bprint("same team change\n");
- SetPlayerTeam(self, dteam, steam, TRUE);
+ SetPlayerTeam(self, dteam, steam, true);
return;
}
TeamchangeFrags(self);
}
- SetPlayerTeam(self, dteam, steam, FALSE);
+ SetPlayerTeam(self, dteam, steam, false);
if(IS_PLAYER(self) && steam != dteam)
{
// move the player to the new team
TeamchangeFrags(selected);
- SetPlayerTeam(selected, smallestteam, source_team, FALSE);
+ SetPlayerTeam(selected, smallestteam, source_team, false);
if(selected.deadflag == DEAD_NO)
Damage(selected, selected, selected, 100000, DEATH_AUTOTEAMCHANGE, selected.origin, '0 0 0');
WriteByte(MSG_ENTITY, ceil((self.health / self.tur_health) * 255));
}
- return TRUE;
+ return true;
}
void load_unit_settings(entity ent, string unitname, float is_reload)
setsize(proj, '-0.5 -0.5 -0.5' * _size, '0.5 0.5 0.5' * _size);
proj.owner = self;
proj.realowner = self;
- proj.bot_dodge = TRUE;
+ proj.bot_dodge = true;
proj.bot_dodgerating = self.shot_dmg;
proj.think = turret_projectile_explode;
proj.touch = turret_projectile_touch;
void turret_link()
{
- Net_LinkEntity(self, TRUE, 0, turret_send);
+ Net_LinkEntity(self, true, 0, turret_send);
self.think = turret_think;
self.nextthink = time;
self.tur_head.effects = EF_NODRAW;
if (!self.health)
self.health = 1000;
self.tur_health = max(1, self.health);
- self.bot_attack = TRUE;
- self.monster_attack = TRUE;
+ self.bot_attack = true;
+ self.monster_attack = true;
if (!self.turrcaps_flags)
self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL;
{
error("Call to turret_tag_fire_update with self.tur_head missing!\n");
self.tur_shotorg = '0 0 0';
- return FALSE;
+ return false;
}
self.tur_shotorg = gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_fire"));
v_forward = normalize(v_forward);
- return TRUE;
+ return true;
}
/*
// note down which entities were hit so we can damage them later
while (1)
{
- tracebox(start, smin, smax, end, FALSE, self);
+ tracebox(start, smin, smax, end, false, self);
// if it is world we can't hurt it so stop now
if (trace_ent == world || trace_fraction == 1)
break;
// make the entity non-solid so we can hit the next one
- trace_ent.railgunhit = TRUE;
+ trace_ent.railgunhit = true;
trace_ent.railgunhitloc = end;
trace_ent.railgunhitsolidbackup = trace_ent.solid;
endpoint = trace_endpos;
// find all the entities the railgun hit and restore their solid state
- ent = findfloat(world, railgunhit, TRUE);
+ ent = findfloat(world, railgunhit, true);
while (ent)
{
// restore their solid type
ent.solid = ent.railgunhitsolidbackup;
- ent = findfloat(ent, railgunhit, TRUE);
+ ent = findfloat(ent, railgunhit, true);
}
// find all the entities the railgun hit and hurt them
- ent = findfloat(world, railgunhit, TRUE);
+ ent = findfloat(world, railgunhit, true);
while (ent)
{
// get the details we need to call the damage function
hitloc = ent.railgunhitloc;
ent.railgunhitloc = '0 0 0';
ent.railgunhitsolidbackup = SOLID_NOT;
- ent.railgunhit = FALSE;
+ ent.railgunhit = false;
// apply the damage
if (ent.takedamage)
}
// advance to the next entity
- ent = findfloat(ent, railgunhit, TRUE);
+ ent = findfloat(ent, railgunhit, true);
}
trace_endpos = endpoint;
}
{
turret_do_updates(self);
- _mis = turret_projectile("weapons/lasergun_fire.wav", 1, 0, DEATH_TURRET_EWHEEL, PROJECTILE_BLASTER, TRUE, TRUE); // WEAPONTODO: this is not a projectile made by the blaster, add separate effect for it
+ _mis = turret_projectile("weapons/lasergun_fire.wav", 1, 0, DEATH_TURRET_EWHEEL, PROJECTILE_BLASTER, true, true); // WEAPONTODO: this is not a projectile made by the blaster, add separate effect for it
_mis.missile_flags = MIF_SPLASH;
pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
movelib_beak_simple(autocvar_g_turrets_unit_ewheel_speed_stop);
}
- turrets_setframe(newframe , FALSE);
+ turrets_setframe(newframe , false);
/*if(self.frame != newframe)
{
self.frame = 1;
self.target_select_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
- self.iscreature = TRUE;
+ self.iscreature = true;
self.teleportable = TELEPORT_NORMAL;
- self.damagedbycontents = TRUE;
+ self.damagedbycontents = true;
self.movetype = MOVETYPE_WALK;
self.solid = SOLID_SLIDEBOX;
self.takedamage = DAMAGE_AIM;
turret_tag_fire_update();
- proj = turret_projectile("weapons/hagar_fire.wav", 5, 0, DEATH_TURRET_FLAC, PROJECTILE_HAGAR, TRUE, TRUE);
+ proj = turret_projectile("weapons/hagar_fire.wav", 5, 0, DEATH_TURRET_FLAC, PROJECTILE_HAGAR, true, true);
pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
proj.think = turret_flac_projectile_think_explode;
proj.nextthink = time + self.tur_impacttime + (random() * 0.01 - random() * 0.01);
else
self.tur_shotorg = gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_fire2"));
- missile = turret_projectile("weapons/rocket_fire.wav", 6, 10, DEATH_TURRET_HELLION, PROJECTILE_ROCKET, FALSE, FALSE);
+ missile = turret_projectile("weapons/rocket_fire.wav", 6, 10, DEATH_TURRET_HELLION, PROJECTILE_ROCKET, false, false);
te_explosion (missile.origin);
missile.think = turret_hellion_missile_think;
missile.nextthink = time;
self.enemy.velocity *
min((vlen(self.enemy.origin - self.origin) / vlen(self.velocity)),0.5);
- traceline(self.origin, pre_pos,TRUE,self.enemy);
+ traceline(self.origin, pre_pos,true,self.enemy);
ve = normalize(pre_pos - self.origin);
fe = trace_fraction;
lt_seek = myspeed * 2.95;
// Trace forward
- traceline(self.origin, self.origin + v_forward * lt_for,FALSE,self);
+ traceline(self.origin, self.origin + v_forward * lt_for,false,self);
vf = trace_endpos;
ff = trace_fraction;
if (ff < 0.5) pt_seek = 1;
// Trace left
- traceline(self.origin, self.origin + (-1 * (v_right * pt_seek) + (v_forward * ff)) * lt_seek,FALSE,self);
+ traceline(self.origin, self.origin + (-1 * (v_right * pt_seek) + (v_forward * ff)) * lt_seek,false,self);
vl = trace_endpos;
fl = trace_fraction;
// Trace right
- traceline(self.origin, self.origin + ((v_right * pt_seek) + (v_forward * ff)) * lt_seek ,FALSE,self);
+ traceline(self.origin, self.origin + ((v_right * pt_seek) + (v_forward * ff)) * lt_seek ,false,self);
vr = trace_endpos;
fr = trace_fraction;
// Trace up
- traceline(self.origin, self.origin + ((v_up * pt_seek) + (v_forward * ff)) * lt_seek ,FALSE,self);
+ traceline(self.origin, self.origin + ((v_up * pt_seek) + (v_forward * ff)) * lt_seek ,false,self);
vu = trace_endpos;
fu = trace_fraction;
// Trace down
- traceline(self.origin, self.origin + (-1 * (v_up * pt_seek) + (v_forward * ff)) * lt_seek ,FALSE,self);
+ traceline(self.origin, self.origin + (-1 * (v_up * pt_seek) + (v_forward * ff)) * lt_seek ,false,self);
vd = trace_endpos;
fd = trace_fraction;
{
entity missile;
- missile = turret_projectile("weapons/rocket_fire.wav", 6, 10, DEATH_TURRET_HK, PROJECTILE_ROCKET, FALSE, FALSE);
+ missile = turret_projectile("weapons/rocket_fire.wav", 6, 10, DEATH_TURRET_HK, PROJECTILE_ROCKET, false, false);
te_explosion (missile.origin);
missile.think = turret_hk_missile_think;
entity missile;
turret_tag_fire_update();
- missile = turret_projectile("weapons/rocket_fire.wav", 6, 10, DEATH_TURRET_MLRS, PROJECTILE_ROCKET, TRUE, TRUE);
+ missile = turret_projectile("weapons/rocket_fire.wav", 6, 10, DEATH_TURRET_MLRS, PROJECTILE_ROCKET, true, true);
missile.nextthink = time + max(self.tur_impacttime,(self.shot_radius * 2) / self.shot_speed);
missile.missile_flags = MIF_SPLASH;
te_explosion (missile.origin);
beam.scale = self.target_range / 256;
beam.movetype = MOVETYPE_NONE;
beam.enemy = self.enemy;
- beam.bot_dodge = TRUE;
+ beam.bot_dodge = true;
beam.bot_dodgerating = beam.shot_dmg;
sound (beam, CH_SHOTS_SINGLE, "turrets/phaser.wav", VOL_BASE, ATTEN_NORM);
self.fireflag = 1;
void turret_plasma_attack()
{
- entity missile = turret_projectile("weapons/hagar_fire.wav", 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE);
+ entity missile = turret_projectile("weapons/hagar_fire.wav", 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, true, true);
missile.missile_flags = MIF_SPLASH;
pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
void turret_plasma_dual_attack()
{
- entity missile = turret_projectile("weapons/hagar_fire.wav", 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE);
+ entity missile = turret_projectile("weapons/hagar_fire.wav", 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, true, true);
missile.missile_flags = MIF_SPLASH;
pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
self.tur_head.frame += 1;
void walker_setnoanim()
{
- turrets_setframe(ANIM_NO, FALSE);
+ turrets_setframe(ANIM_NO, false);
self.animflag = self.frame;
}
void walker_rocket_explode()
rocket.classname = "walker_rocket";
rocket.owner = self;
- rocket.bot_dodge = TRUE;
+ rocket.bot_dodge = true;
rocket.bot_dodgerating = 50;
rocket.takedamage = DAMAGE_YES;
rocket.damageforcescale = 2;
rocket.tur_health = time + 9;
rocket.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_GUIDED_HEAT;
- CSQCProjectile(rocket, FALSE, PROJECTILE_ROCKET, FALSE); // no culling, has fly sound
+ CSQCProjectile(rocket, false, PROJECTILE_ROCKET, false); // no culling, has fly sound
}
.vector enemy_last_loc;
self.SendFlags |= TNSF_MOVE;
self.oldorigin = self.origin;
- turrets_setframe(self.animflag, FALSE);
+ turrets_setframe(self.animflag, false);
}
void walker_attack()
setsize(self, WALKER_MIN, WALKER_MAX);
self.target_select_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
- self.iscreature = TRUE;
+ self.iscreature = true;
self.teleportable = TELEPORT_NORMAL;
- self.damagedbycontents = TRUE;
+ self.damagedbycontents = true;
self.movetype = MOVETYPE_WALK;
self.solid = SOLID_SLIDEBOX;
self.takedamage = DAMAGE_AIM;
vehicles_projectile("bigplasma_muzzleflash", "weapons/flacexp3.wav",
v, normalize(v_forward + randomvec() * autocvar_g_vehicle_bumblebee_cannon_spread) * autocvar_g_vehicle_bumblebee_cannon_speed,
autocvar_g_vehicle_bumblebee_cannon_damage, autocvar_g_vehicle_bumblebee_cannon_radius, autocvar_g_vehicle_bumblebee_cannon_force, 0,
- DEATH_VH_BUMB_GUN, PROJECTILE_BUMBLE_GUN, 0, TRUE, TRUE, _owner);
+ DEATH_VH_BUMB_GUN, PROJECTILE_BUMBLE_GUN, 0, true, true, _owner);
}
float bumb_gunner_frame()
else
{
dprint("^1ERROR:^7Tried to enter a fully occupied vehicle!\n");
- return FALSE;
+ return false;
}
_gunner = other;
other = vh_player;
_gun = vh_vehicle;
- return TRUE;
+ return true;
}
float vehicles_valid_pilot()
{
if (!IS_PLAYER(other))
- return FALSE;
+ return false;
if(other.deadflag != DEAD_NO)
- return FALSE;
+ return false;
if(other.vehicle != world)
- return FALSE;
+ return false;
if (!IS_REAL_CLIENT(other))
if(!autocvar_g_vehicles_allow_bots)
- return FALSE;
+ return false;
if(teamplay && other.team != self.team)
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
void bumb_touch()
self.gun2.vehicle_energy + autocvar_g_vehicle_bumblebee_cannon_ammo_regen * frametime);
if(self.vehicle_flags & VHF_SHIELDREGEN)
- vehicles_regen(self.dmg_time, vehicle_shield, autocvar_g_vehicle_bumblebee_shield, autocvar_g_vehicle_bumblebee_shield_regen_pause, autocvar_g_vehicle_bumblebee_shield_regen, frametime, TRUE);
+ vehicles_regen(self.dmg_time, vehicle_shield, autocvar_g_vehicle_bumblebee_shield, autocvar_g_vehicle_bumblebee_shield_regen_pause, autocvar_g_vehicle_bumblebee_shield_regen, frametime, true);
if(self.vehicle_flags & VHF_HEALTHREGEN)
- vehicles_regen(self.dmg_time, vehicle_health, autocvar_g_vehicle_bumblebee_health, autocvar_g_vehicle_bumblebee_health_regen_pause, autocvar_g_vehicle_bumblebee_health_regen, frametime, FALSE);
+ vehicles_regen(self.dmg_time, vehicle_health, autocvar_g_vehicle_bumblebee_health, autocvar_g_vehicle_bumblebee_health_regen_pause, autocvar_g_vehicle_bumblebee_health_regen, frametime, false);
if(self.vehicle_flags & VHF_ENERGYREGEN)
- vehicles_regen(self.wait, vehicle_energy, autocvar_g_vehicle_bumblebee_energy, autocvar_g_vehicle_bumblebee_energy_regen_pause, autocvar_g_vehicle_bumblebee_energy_regen, frametime, FALSE);
+ vehicles_regen(self.wait, vehicle_energy, autocvar_g_vehicle_bumblebee_energy, autocvar_g_vehicle_bumblebee_energy_regen_pause, autocvar_g_vehicle_bumblebee_energy_regen, frametime, false);
}
if(self.gun3.enemy == world)
{
self.gun3.enemy = spawn();
- Net_LinkEntity(self.gun3.enemy, TRUE, 0, bumble_raygun_send);
+ Net_LinkEntity(self.gun3.enemy, true, 0, bumble_raygun_send);
self.gun3.enemy.SendFlags = BRG_SETUP;
self.gun3.enemy.cnt = autocvar_g_vehicle_bumblebee_raygun;
self.gun3.enemy.effects = EF_NODRAW | EF_LOWPRECISION;
if(!vehicle_initialize(
"Bumblebee", "models/vehicles/bumblebee_body.dpm",
"", "models/vehicles/spiderbot_cockpit.dpm", "", "", "tag_viewport",
- HUD_BUMBLEBEE, BUMB_MIN, BUMB_MAX, FALSE,
+ HUD_BUMBLEBEE, BUMB_MIN, BUMB_MAX, false,
bumb_spawn, autocvar_g_vehicle_bumblebee_respawntime,
bumb_pilot_frame, bumb_enter, bumb_exit,
- bumb_die, bumb_think, FALSE, autocvar_g_vehicle_bumblebee_health, autocvar_g_vehicle_bumblebee_shield))
+ bumb_die, bumb_think, false, autocvar_g_vehicle_bumblebee_health, autocvar_g_vehicle_bumblebee_shield))
{
remove(self);
return;
WriteCoord(MSG_ENTITY, self.hook_end.z);
}
- return TRUE;
+ return true;
}
#endif // SVQC
bolt = vehicles_projectile("wakizashi_gun_muzzleflash", "weapons/lasergun_fire.wav",
v, normalize(v_forward + randomvec() * autocvar_g_vehicle_racer_cannon_spread) * autocvar_g_vehicle_racer_cannon_speed,
autocvar_g_vehicle_racer_cannon_damage, autocvar_g_vehicle_racer_cannon_radius, autocvar_g_vehicle_racer_cannon_force, 0,
- DEATH_VH_WAKI_GUN, PROJECTILE_WAKICANNON, 0, TRUE, TRUE, self.owner);
+ DEATH_VH_WAKI_GUN, PROJECTILE_WAKICANNON, 0, true, true, self.owner);
// Fix z-aim (for chase mode)
v = normalize(trace_endpos - bolt.origin);
entity rocket = rocket = vehicles_projectile("wakizashi_rocket_launch", "weapons/rocket_fire.wav",
v, v_forward * autocvar_g_vehicle_racer_rocket_speed,
autocvar_g_vehicle_racer_rocket_damage, autocvar_g_vehicle_racer_rocket_radius, autocvar_g_vehicle_racer_rocket_force, 3,
- DEATH_VH_WAKI_ROCKET, PROJECTILE_WAKIROCKET, 20, FALSE, FALSE, self.owner);
+ DEATH_VH_WAKI_ROCKET, PROJECTILE_WAKIROCKET, 20, false, false, self.owner);
rocket.lip = autocvar_g_vehicle_racer_rocket_accel * sys_frametime;
rocket.wait = autocvar_g_vehicle_racer_rocket_turnrate;
player.vehicle_reload1 = bound(0, 100 * ((time - racer.lip) / (racer.delay - racer.lip)), 100);
if(racer.vehicle_flags & VHF_SHIELDREGEN)
- vehicles_regen(racer.dmg_time, vehicle_shield, autocvar_g_vehicle_racer_shield, autocvar_g_vehicle_racer_shield_regen_pause, autocvar_g_vehicle_racer_shield_regen, frametime, TRUE);
+ vehicles_regen(racer.dmg_time, vehicle_shield, autocvar_g_vehicle_racer_shield, autocvar_g_vehicle_racer_shield_regen_pause, autocvar_g_vehicle_racer_shield_regen, frametime, true);
if(racer.vehicle_flags & VHF_HEALTHREGEN)
- vehicles_regen(racer.dmg_time, vehicle_health, autocvar_g_vehicle_racer_health, autocvar_g_vehicle_racer_health_regen_pause, autocvar_g_vehicle_racer_health_regen, frametime, FALSE);
+ vehicles_regen(racer.dmg_time, vehicle_health, autocvar_g_vehicle_racer_health, autocvar_g_vehicle_racer_health_regen_pause, autocvar_g_vehicle_racer_health_regen, frametime, false);
if(racer.vehicle_flags & VHF_ENERGYREGEN)
- vehicles_regen(racer.wait, vehicle_energy, autocvar_g_vehicle_racer_energy, autocvar_g_vehicle_racer_energy_regen_pause, autocvar_g_vehicle_racer_energy_regen, frametime, FALSE);
+ vehicles_regen(racer.wait, vehicle_energy, autocvar_g_vehicle_racer_energy, autocvar_g_vehicle_racer_energy_regen_pause, autocvar_g_vehicle_racer_energy_regen, frametime, false);
VEHICLE_UPDATE_PLAYER(player, health, racer);
"", "", "tag_viewport",
HUD_WAKIZASHI,
0.5 * RACER_MIN, 0.5 * RACER_MAX,
- FALSE,
+ false,
racer_spawn, autocvar_g_vehicle_racer_respawntime,
racer_frame,
racer_enter, racer_exit,
racer_die, racer_think,
- TRUE,
+ true,
autocvar_g_vehicle_racer_health,
autocvar_g_vehicle_racer_shield))
{
bomblet.velocity = normalize(normalize(self.velocity) + (randomvec() * autocvar_g_vehicle_raptor_bomblet_spread)) * vlen(self.velocity);
PROJECTILE_MAKETRIGGER(bomblet);
- CSQCProjectile(bomblet, TRUE, PROJECTILE_RAPTORBOMBLET, TRUE);
+ CSQCProjectile(bomblet, true, PROJECTILE_RAPTORBOMBLET, true);
}
remove(self);
PROJECTILE_MAKETRIGGER(bomb_1);
PROJECTILE_MAKETRIGGER(bomb_2);
- CSQCProjectile(bomb_1, TRUE, PROJECTILE_RAPTORBOMB, TRUE);
- CSQCProjectile(bomb_2, TRUE, PROJECTILE_RAPTORBOMB, TRUE);
+ CSQCProjectile(bomb_1, true, PROJECTILE_RAPTORBOMB, true);
+ CSQCProjectile(bomb_2, true, PROJECTILE_RAPTORBOMB, true);
}
vehicles_projectile("raptor_cannon_muzzleflash", "weapons/lasergun_fire.wav",
gettaginfo(gun, gettagindex(gun, tagname)), normalize(v_forward + randomvec() * autocvar_g_vehicle_raptor_cannon_spread) * autocvar_g_vehicle_raptor_cannon_speed,
autocvar_g_vehicle_raptor_cannon_damage, autocvar_g_vehicle_raptor_cannon_radius, autocvar_g_vehicle_raptor_cannon_force, 0,
- DEATH_VH_RAPT_CANNON, PROJECTILE_RAPTORCANNON, 0, TRUE, TRUE, self.owner);
+ DEATH_VH_RAPT_CANNON, PROJECTILE_RAPTORCANNON, 0, true, true, self.owner);
}
void raptor_think()
player.PlayerPhysplug = raptor_frame;
if(self.vehicle_flags & VHF_SHIELDREGEN)
- vehicles_regen(raptor.dmg_time, vehicle_shield, autocvar_g_vehicle_raptor_shield, autocvar_g_vehicle_raptor_shield_regen_pause, autocvar_g_vehicle_raptor_shield_regen, frametime, TRUE);
+ vehicles_regen(raptor.dmg_time, vehicle_shield, autocvar_g_vehicle_raptor_shield, autocvar_g_vehicle_raptor_shield_regen_pause, autocvar_g_vehicle_raptor_shield_regen, frametime, true);
if(self.vehicle_flags & VHF_HEALTHREGEN)
- vehicles_regen(raptor.dmg_time, vehicle_health, autocvar_g_vehicle_raptor_health, autocvar_g_vehicle_raptor_health_regen_pause, autocvar_g_vehicle_raptor_health_regen, frametime, FALSE);
+ vehicles_regen(raptor.dmg_time, vehicle_health, autocvar_g_vehicle_raptor_health, autocvar_g_vehicle_raptor_health_regen_pause, autocvar_g_vehicle_raptor_health_regen, frametime, false);
if(self.vehicle_flags & VHF_ENERGYREGEN)
- vehicles_regen(raptor.cnt, vehicle_energy, autocvar_g_vehicle_raptor_energy, autocvar_g_vehicle_raptor_energy_regen_pause, autocvar_g_vehicle_raptor_energy_regen, frametime, FALSE);
+ vehicles_regen(raptor.cnt, vehicle_energy, autocvar_g_vehicle_raptor_energy, autocvar_g_vehicle_raptor_energy_regen_pause, autocvar_g_vehicle_raptor_energy_regen, frametime, false);
raptor.bomb1.alpha = raptor.bomb2.alpha = (time - raptor.lip) / (raptor.delay - raptor.lip);
}
if(self.vehicle_flags & VHF_SHIELDREGEN)
- vehicles_regen(raptor.dmg_time, vehicle_shield, autocvar_g_vehicle_raptor_shield, autocvar_g_vehicle_raptor_shield_regen_pause, autocvar_g_vehicle_raptor_shield_regen, frametime, TRUE);
+ vehicles_regen(raptor.dmg_time, vehicle_shield, autocvar_g_vehicle_raptor_shield, autocvar_g_vehicle_raptor_shield_regen_pause, autocvar_g_vehicle_raptor_shield_regen, frametime, true);
if(self.vehicle_flags & VHF_HEALTHREGEN)
- vehicles_regen(raptor.dmg_time, vehicle_health, autocvar_g_vehicle_raptor_health, autocvar_g_vehicle_raptor_health_regen_pause, autocvar_g_vehicle_raptor_health_regen, frametime, FALSE);
+ vehicles_regen(raptor.dmg_time, vehicle_health, autocvar_g_vehicle_raptor_health, autocvar_g_vehicle_raptor_health_regen_pause, autocvar_g_vehicle_raptor_health_regen, frametime, false);
if(self.vehicle_flags & VHF_ENERGYREGEN)
- vehicles_regen(raptor.cnt, vehicle_energy, autocvar_g_vehicle_raptor_energy, autocvar_g_vehicle_raptor_energy_regen_pause, autocvar_g_vehicle_raptor_energy_regen, frametime, FALSE);
+ vehicles_regen(raptor.cnt, vehicle_energy, autocvar_g_vehicle_raptor_energy, autocvar_g_vehicle_raptor_energy_regen_pause, autocvar_g_vehicle_raptor_energy_regen, frametime, false);
if(raptor.vehicle_weapon2mode == RSM_BOMB)
{
self.vehicle.vehicle_weapon2mode = RSM_FIRST;
CSQCVehicleSetup(self, 0);
- return TRUE;
+ return true;
case 12:
case 16:
case 19:
self.vehicle.vehicle_weapon2mode = RSM_LAST;
CSQCVehicleSetup(self, 0);
- return TRUE;
+ return true;
/*
case 17: // toss gun, could be used to exit?
break;
*/
}
- return FALSE;
+ return false;
}
void raptor_spawn(float _f)
"", "tag_hud", "tag_camera",
HUD_RAPTOR,
RAPTOR_MIN, RAPTOR_MAX,
- FALSE,
+ false,
raptor_spawn, autocvar_g_vehicle_raptor_respawntime,
raptor_frame,
raptor_enter, raptor_exit,
raptor_die, raptor_think,
- FALSE,
+ false,
autocvar_g_vehicle_raptor_health,
autocvar_g_vehicle_raptor_shield))
{
rocket = vehicles_projectile("spiderbot_rocket_launch", "weapons/rocket_fire.wav",
v, normalize(randomvec() * autocvar_g_vehicle_spiderbot_rocket_spread + v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed,
autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
- DEATH_VH_SPID_ROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, FALSE, TRUE, self.owner);
+ DEATH_VH_SPID_ROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, true, self.owner);
crosshair_trace(self.owner);
float _dist = (random() * autocvar_g_vehicle_spiderbot_rocket_radius) + vlen(v - trace_endpos);
_dist -= (random() * autocvar_g_vehicle_spiderbot_rocket_radius) ;
rocket = vehicles_projectile("spiderbot_rocket_launch", "weapons/rocket_fire.wav",
v, normalize(v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed,
autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
- DEATH_VH_SPID_ROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, FALSE, FALSE, self.owner);
+ DEATH_VH_SPID_ROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, false, self.owner);
crosshair_trace(self.owner);
rocket.pos1 = trace_endpos;
rocket.nextthink = time;
rocket = vehicles_projectile("spiderbot_rocket_launch", "weapons/rocket_fire.wav",
v, normalize(v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed,
autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
- DEATH_VH_SPID_ROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, FALSE, TRUE, self.owner);
+ DEATH_VH_SPID_ROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, true, self.owner);
crosshair_trace(self.owner);
float spiderbot_aiframe()
{
- return FALSE;
+ return false;
}
float spiderbot_frame()
crosshair_trace(player);
ad = vectoangles(normalize(trace_endpos - ad));
ad = AnglesTransform_ToAngles(AnglesTransform_LeftDivide(AnglesTransform_FromAngles(spider.angles), AnglesTransform_FromAngles(ad))) - spider.tur_head.angles;
- ad = AnglesTransform_Normalize(ad, TRUE);
+ ad = AnglesTransform_Normalize(ad, true);
//UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload2) + ('0 1 0' * (1 - player.vehicle_reload2)), 2);
// Rotate head
else
vehicles_regen(spider.cnt, vehicle_ammo1, autocvar_g_vehicle_spiderbot_minigun_ammo_max,
autocvar_g_vehicle_spiderbot_minigun_ammo_regen_pause,
- autocvar_g_vehicle_spiderbot_minigun_ammo_regen, frametime, FALSE);
+ autocvar_g_vehicle_spiderbot_minigun_ammo_regen, frametime, false);
spiderbot_rocket_do();
if(self.vehicle_flags & VHF_SHIELDREGEN)
- vehicles_regen(spider.dmg_time, vehicle_shield, autocvar_g_vehicle_spiderbot_shield, autocvar_g_vehicle_spiderbot_shield_regen_pause, autocvar_g_vehicle_spiderbot_shield_regen, frametime, TRUE);
+ vehicles_regen(spider.dmg_time, vehicle_shield, autocvar_g_vehicle_spiderbot_shield, autocvar_g_vehicle_spiderbot_shield_regen_pause, autocvar_g_vehicle_spiderbot_shield_regen, frametime, true);
if(self.vehicle_flags & VHF_HEALTHREGEN)
- vehicles_regen(spider.dmg_time, vehicle_health, autocvar_g_vehicle_spiderbot_health, autocvar_g_vehicle_spiderbot_health_regen_pause, autocvar_g_vehicle_spiderbot_health_regen, frametime, FALSE);
+ vehicles_regen(spider.dmg_time, vehicle_health, autocvar_g_vehicle_spiderbot_health, autocvar_g_vehicle_spiderbot_health_regen_pause, autocvar_g_vehicle_spiderbot_health_regen, frametime, false);
player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
player.vehicle_ammo2 = spider.tur_head.frame;
//centerprint(self, strcat("Rocket mode is ", ftos(self.vehicle.vehicle_weapon2mode)));
CSQCVehicleSetup(self, 0);
- return TRUE;
+ return true;
case 12:
case 16:
case 19:
//centerprint(self, strcat("Rocket mode is ", ftos(self.vehicle.vehicle_weapon2mode)));
CSQCVehicleSetup(self, 0);
- return TRUE;
+ return true;
/*
case 17: // toss gun, could be used to exit?
break;
*/
}
- return FALSE;
+ return false;
}
void spiderbot_spawn(float _f)
"tag_head", "tag_hud", "",
HUD_SPIDERBOT,
SPIDERBOT_MIN, SPIDERBOT_MAX,
- FALSE,
+ false,
spiderbot_spawn, autocvar_g_vehicle_spiderbot_respawntime,
spiderbot_frame,
spiderbot_enter, spiderbot_exit,
spiderbot_die, spiderbot_think,
- FALSE,
+ false,
autocvar_g_vehicle_spiderbot_health,
autocvar_g_vehicle_spiderbot_shield))
{
WriteByte(MSG_ENTITY, rint(self.colormod.y * 255));
WriteByte(MSG_ENTITY, rint(self.colormod.z * 255));
- return TRUE;
+ return true;
}
void UpdateAuxiliaryXhair(entity own, vector loc, vector clr, float axh_id)
axh.cnt = axh_id;
axh.drawonlytoclient = own;
axh.owner = own;
- Net_LinkEntity(axh, FALSE, 0, SendAuxiliaryXhair);
+ Net_LinkEntity(axh, false, 0, SendAuxiliaryXhair);
}
setorigin(axh, loc);
proj.solid = SOLID_BBOX;
proj.movetype = MOVETYPE_FLYMISSILE;
proj.flags = FL_PROJECTILE;
- proj.bot_dodge = TRUE;
+ proj.bot_dodge = true;
proj.bot_dodgerating = _dmg;
proj.velocity = _vel;
proj.touch = vehicles_projectile_explode;
self.touch = vehicles_touch;
self.event_damage = vehicles_damage;
self.reset = vehicles_reset;
- self.iscreature = TRUE;
- self.teleportable = FALSE; // no teleporting for vehicles, too buggy
- self.damagedbycontents = TRUE;
+ self.iscreature = true;
+ self.teleportable = false; // no teleporting for vehicles, too buggy
+ self.damagedbycontents = true;
self.movetype = MOVETYPE_WALK;
self.solid = SOLID_SLIDEBOX;
self.takedamage = DAMAGE_AIM;
self.deadflag = DEAD_NO;
- self.bot_attack = TRUE;
+ self.bot_attack = true;
self.flags = FL_NOTARGET;
self.avelocity = '0 0 0';
self.velocity = '0 0 0';
float vehicles_crushable(entity e)
{
if(IS_PLAYER(e))
- return TRUE;
+ return true;
if(e.flags & FL_MONSTER)
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
void vehicles_impact(float _minspeed, float _speedfac, float _maxpain)
self.team = self.owner.team;
self.flags -= FL_NOTARGET;
- self.monster_attack = TRUE;
+ self.monster_attack = true;
if (IS_REAL_CLIENT(other))
{
return;
}
- vehicles_exit_running = TRUE;
+ vehicles_exit_running = true;
if(IS_CLIENT(self))
{
_vehicle = self.vehicle;
{
_vehicle.vehicle_exit(eject);
self = _oldself;
- vehicles_exit_running = FALSE;
+ vehicles_exit_running = false;
return;
}
}
sound (_vehicle, CH_TRIGGER_SINGLE, "misc/null.wav", 1, ATTEN_NORM);
_vehicle.vehicle_hudmodel.viewmodelforclient = _vehicle;
_vehicle.phase = time + 1;
- _vehicle.monster_attack = FALSE;
+ _vehicle.monster_attack = false;
_vehicle.vehicle_exit(eject);
_vehicle.owner = world;
self = _oldself;
- vehicles_exit_running = FALSE;
+ vehicles_exit_running = false;
}
rgb = Team_ColorRGB(self.team);
else
rgb = '1 1 1';
- WaypointSprite_Spawn("vehicle", 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, TRUE, RADARICON_POWERUP, rgb);
+ WaypointSprite_Spawn("vehicle", 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, true, RADARICON_POWERUP, rgb);
if(self.waypointsprite_attached)
{
WaypointSprite_UpdateRule(self.waypointsprite_attached, self.wp00.team, SPRITERULE_DEFAULT);
setattachment(_slot.vehicle_hudmodel, _slot, "");
setattachment(_slot.vehicle_viewport, _slot.vehicle_hudmodel, "");
- return TRUE;
+ return true;
}
float vehicle_initialize(string net_name,
float _max_shield)
{
if(!autocvar_g_vehicles)
- return FALSE;
+ return false;
if(self.targetname)
{
self.tur_head = spawn();
self.tur_head.owner = self;
self.takedamage = DAMAGE_AIM;
- self.bot_attack = TRUE;
- self.iscreature = TRUE;
- self.teleportable = FALSE; // no teleporting for vehicles, too buggy
- self.damagedbycontents = TRUE;
+ self.bot_attack = true;
+ self.iscreature = true;
+ self.teleportable = false; // no teleporting for vehicles, too buggy
+ self.damagedbycontents = true;
self.hud = vhud;
self.tur_health = _max_health;
self.tur_head.tur_health = _max_shield;
self.tur_head.team = self.team;
if(MUTATOR_CALLHOOK(VehicleSpawn))
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
vector vehicle_aimturret(entity _vehic, vector _target, entity _turrret, string _tagname,
vtag = gettaginfo(_turrret, gettagindex(_turrret, _tagname));
vtmp = vectoangles(normalize(_target - vtag));
vtmp = AnglesTransform_ToAngles(AnglesTransform_LeftDivide(AnglesTransform_FromAngles(_vehic.angles), AnglesTransform_FromAngles(vtmp))) - _turrret.angles;
- vtmp = AnglesTransform_Normalize(vtmp, TRUE);
+ vtmp = AnglesTransform_Normalize(vtmp, true);
ftmp = _aimspeed * frametime;
vtmp_y = bound(-ftmp, vtmp.y, ftmp);
vtmp_x = bound(-ftmp, vtmp.x, ftmp);
{
float doremove;
- doremove = FALSE;
+ doremove = false;
if(self.fade_time)
{
if(time >= self.teleport_time)
- doremove = TRUE;
+ doremove = true;
}
if(self.exteriormodeltoclient)
// personal waypoints
if(self.enemy)
if(self.enemy != e)
- return FALSE;
+ return false;
// team waypoints
if(self.team && self.rule == SPRITERULE_DEFAULT)
{
if(self.team != e.team)
- return FALSE;
+ return false;
if (!IS_PLAYER(e))
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
entity WaypointSprite_getviewentity(entity e)
if(teamplay)
{
if(e2.team != e.team)
- return FALSE;
+ return false;
}
else
{
if(e2 != e)
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
float WaypointSprite_Customize()
e = WaypointSprite_getviewentity(other);
if(MUTATOR_CALLHOOK(CustomizeWaypoint))
- return FALSE;
+ return false;
return self.waypointsprite_visible_for_player(e);
}
WriteByte(MSG_ENTITY, 0);
}
- return TRUE;
+ return true;
}
void WaypointSprite_Reset()
wp.reset2 = WaypointSprite_Reset;
wp.cnt = icon;
wp.colormod = rgb;
- Net_LinkEntity(wp, FALSE, 0, WaypointSprite_SendEntity);
+ Net_LinkEntity(wp, false, 0, WaypointSprite_SendEntity);
return wp;
}
float icon, vector rgb // initial icon and color
)
{
- return WaypointSprite_Spawn(spr, 0, 0, world, ofs, world, 0, own, ownfield, TRUE, icon, rgb);
+ return WaypointSprite_Spawn(spr, 0, 0, world, ofs, world, 0, own, ownfield, true, icon, rgb);
}
.entity waypointsprite_deployed_fixed;
maxdistance = waypointsprite_limitedrange;
else
maxdistance = 0;
- return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, world, ofs, world, t, self, waypointsprite_deployed_fixed, FALSE, icon, rgb);
+ return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, world, ofs, world, t, self, waypointsprite_deployed_fixed, false, icon, rgb);
}
.entity waypointsprite_deployed_personal;
float icon, vector rgb // initial icon and color
)
{
- return WaypointSprite_Spawn(spr, 0, 0, world, ofs, world, 0, self, waypointsprite_deployed_personal, FALSE, icon, rgb);
+ return WaypointSprite_Spawn(spr, 0, 0, world, ofs, world, 0, self, waypointsprite_deployed_personal, false, icon, rgb);
}
.entity waypointsprite_attached;
maxdistance = waypointsprite_limitedrange;
else
maxdistance = 0;
- return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, self, '0 0 64', world, t, self, waypointsprite_attached, FALSE, icon, rgb);
+ return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, self, '0 0 64', world, t, self, waypointsprite_attached, false, icon, rgb);
}
entity WaypointSprite_AttachCarrier(
{
entity e;
WaypointSprite_Kill(carrier.waypointsprite_attached); // FC overrides attached
- e = WaypointSprite_Spawn(spr, 0, 0, carrier, '0 0 64', world, carrier.team, carrier, waypointsprite_attachedforcarrier, FALSE, icon, rgb);
+ e = WaypointSprite_Spawn(spr, 0, 0, carrier, '0 0 64', world, carrier.team, carrier, waypointsprite_attachedforcarrier, false, icon, rgb);
if(e)
{
WaypointSprite_UpdateMaxHealth(e, '1 0 0' * healtharmor_maxdamage(start_health, start_armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON) * 2);
// note: zero sendflags can never be sent... so we can use that to say that we send no accuracy!
WriteInt24_t(MSG_ENTITY, sf);
if(sf == 0)
- return TRUE;
+ return true;
// note: we know that client and server agree about SendFlags...
for(w = 0, f = 1; w <= WEP_LAST - WEP_FIRST; ++w)
{
else
f *= 2;
}
- return TRUE;
+ return true;
}
// init/free
e.accuracy.owner = e;
e.accuracy.classname = "accuracy";
e.accuracy.drawonlytoclient = e;
- Net_LinkEntity(e.accuracy, FALSE, 0, accuracy_send);
+ Net_LinkEntity(e.accuracy, false, 0, accuracy_send);
}
void accuracy_free(entity e)
if(!targ.frozen)
if(mutator_check == MUT_ACCADD_INVALID || (mutator_check == MUT_ACCADD_VALID && IS_CLIENT(targ)))
if(DIFF_TEAM(attacker, targ))
- return TRUE;
- return FALSE;
+ return true;
+ return false;
}
float accuracy_canbegooddamage(entity attacker)
{
if(!warmup_stage)
- return TRUE;
- return FALSE;
+ return true;
+ return false;
}
if(autocvar_g_projectiles_damage <= -2)
{
- return FALSE; // no damage to projectiles at all, not even with the exceptions
+ return false; // no damage to projectiles at all, not even with the exceptions
}
else if(autocvar_g_projectiles_damage == -1)
{
if(is_from_exception)
return (exception); // if exception is detected, allow it to override
else
- return FALSE; // otherwise, no other damage is allowed
+ return false; // otherwise, no other damage is allowed
}
else if(autocvar_g_projectiles_damage == 0)
{
if(is_from_exception)
return (exception); // if exception is detected, allow it to override
else if(!is_from_contents)
- return FALSE; // otherwise, only allow damage from contents
+ return false; // otherwise, only allow damage from contents
}
else if(autocvar_g_projectiles_damage == 1)
{
if(is_from_exception)
return (exception); // if exception is detected, allow it to override
else if(!(is_from_contents || is_from_owner))
- return FALSE; // otherwise, only allow self damage and damage from contents
+ return false; // otherwise, only allow self damage and damage from contents
}
else if(autocvar_g_projectiles_damage == 2) // allow any damage, but override for exceptions
{
return (exception); // if exception is detected, allow it to override
}
- return TRUE; // if none of these return, then allow damage anyway.
+ return true; // if none of these return, then allow damage anyway.
}
void W_PrepareExplosionByDamage(entity attacker, void() explode)
{
if (complain)
sprint(self, "Invalid weapon\n");
- return FALSE;
+ return false;
}
if (cl.weapons & WepSet_FromWeapon(wpn))
{
play2(cl, "weapons/unavailable.wav");
Send_WeaponComplain (cl, wpn, 0);
}
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
if (complain)
{
play2(cl, "weapons/unavailable.wav");
}
- return FALSE;
+ return false;
}
float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, float complain, float skipmissing)
if(wep.impulse != imp)
continue;
- float i, have_other = FALSE;
+ float i, have_other = false;
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
{
if(i != weaponwant)
if((get_weaponinfo(i)).impulse == imp || imp < 0)
if((pl.weapons & WepSet_FromWeapon(i)) || (weaponsInMap & WepSet_FromWeapon(i)))
- have_other = TRUE;
+ have_other = true;
}
// skip weapons we don't own that aren't normal and aren't in the map
++c;
- if(!skipmissing || client_hasweapon(pl, weaponwant, TRUE, FALSE))
+ if(!skipmissing || client_hasweapon(pl, weaponwant, true, false))
{
if(switchtonext)
return weaponwant;
if(wep.impulse != imp)
continue;
- float i, have_other = FALSE;
+ float i, have_other = false;
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
{
if(i != weaponwant)
if((get_weaponinfo(i)).impulse == imp || imp < 0)
if((pl.weapons & WepSet_FromWeapon(i)) || (weaponsInMap & WepSet_FromWeapon(i)))
- have_other = TRUE;
+ have_other = true;
}
// skip weapons we don't own that aren't normal and aren't in the map
--c;
if(c == 0)
{
- client_hasweapon(pl, weaponwant, TRUE, TRUE);
+ client_hasweapon(pl, weaponwant, true, true);
break;
}
}
{
if (self.switchweapon != imp)
{
- if (client_hasweapon(self, imp, TRUE, TRUE))
+ if (client_hasweapon(self, imp, true, true))
W_SwitchWeapon_Force(self, imp);
else
self.selectweapon = imp; // update selectweapon ANYWAY
void W_CycleWeapon(string weaponorder, float dir)
{
float w;
- w = W_GetCycleWeapon(self, weaponorder, dir, -1, 1, TRUE);
+ w = W_GetCycleWeapon(self, weaponorder, dir, -1, 1, true);
if(w > 0)
W_SwitchWeapon(w);
}
// previously used if exists and has ammo, (second) best otherwise
void W_LastWeapon(void)
{
- if(client_hasweapon(self, self.cnt, TRUE, FALSE))
+ if(client_hasweapon(self, self.cnt, true, false))
W_SwitchWeapon(self.cnt);
else
W_SwitchToOtherWeapon(self);
.float weaponcomplainindex;
float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, float complain, float skipmissing);
-#define w_getbestweapon(ent) W_GetCycleWeapon(ent, ent.cvar_cl_weaponpriority, 0, -1, FALSE, TRUE)
+#define w_getbestweapon(ent) W_GetCycleWeapon(ent, ent.cvar_cl_weaponpriority, 0, -1, false, true)
void W_SwitchWeapon_Force(entity e, float w);
if(e.spawnflags & WEP_FLAG_MUTATORBLOCKED)
{
objerror("Attempted to spawn a mutator-blocked weapon rejected");
- startitem_failed = TRUE;
+ startitem_failed = true;
return;
}
if(s == "")
{
remove(self);
- startitem_failed = TRUE;
+ startitem_failed = true;
return;
}
t = tokenize_console(s);
if(wpn == 0)
{
remove(self);
- startitem_failed = TRUE;
+ startitem_failed = true;
return;
}
}
// pickup anyway
if(g_pickup_weapons_anyway)
- self.pickup_anyway = TRUE;
+ self.pickup_anyway = true;
f = FL_WEAPON;
wep.think = thrown_wep_think;
wep.savenextthink = wep.nextthink;
wep.nextthink = min(wep.nextthink, time + 0.5);
- wep.pickup_anyway = TRUE; // these are ALWAYS pickable
+ wep.pickup_anyway = true; // these are ALWAYS pickable
//wa = W_AmmoItemCode(wpn);
if(ammotype == ammo_none)
{
if(self.weapons & WepSet_FromWeapon(self.weapon))
if(W_IsWeaponThrowable(self.weapon))
- W_ThrowNewWeapon(self, self.weapon, FALSE, org, randomvec() * 125 + '0 0 200');
+ W_ThrowNewWeapon(self, self.weapon, false, org, randomvec() * 125 + '0 0 200');
}
while (1)
{
if(self.antilag_debug)
- WarpZone_traceline_antilag (self, start, end, FALSE, o, self.antilag_debug);
+ WarpZone_traceline_antilag (self, start, end, false, o, self.antilag_debug);
else
- WarpZone_traceline_antilag (self, start, end, FALSE, o, ANTILAG_LATENCY(self));
+ WarpZone_traceline_antilag (self, start, end, false, o, ANTILAG_LATENCY(self));
if(o && WarpZone_trace_firstzone)
{
o = world;
break;
// make the entity non-solid so we can hit the next one
- trace_ent.railgunhit = TRUE;
+ trace_ent.railgunhit = true;
trace_ent.railgunhitloc = end;
trace_ent.railgunhitsolidbackup = trace_ent.solid;
trace_ent.railgundistance = vlen(WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos) - start);
endq3surfaceflags = trace_dphitq3surfaceflags;
// find all the entities the railgun hit and restore their solid state
- ent = findfloat(world, railgunhit, TRUE);
+ ent = findfloat(world, railgunhit, true);
while (ent)
{
// restore their solid type
ent.solid = ent.railgunhitsolidbackup;
- ent = findfloat(ent, railgunhit, TRUE);
+ ent = findfloat(ent, railgunhit, true);
}
// spawn a temporary explosion entity for RadiusDamage calls
}
// find all the entities the railgun hit and hurt them
- ent = findfloat(world, railgunhit, TRUE);
+ ent = findfloat(world, railgunhit, true);
while (ent)
{
// get the details we need to call the damage function
ent.railgunhitloc = '0 0 0';
ent.railgunhitsolidbackup = SOLID_NOT;
- ent.railgunhit = FALSE;
+ ent.railgunhit = false;
ent.railgundistance = 0;
// advance to the next entity
- ent = findfloat(ent, railgunhit, TRUE);
+ ent = findfloat(ent, railgunhit, true);
}
// calculate hits and fired shots for hitscan
for(0;;)
{
// TODO also show effect while tracing
- WarpZone_TraceBox_ThroughZone(start, '0 0 0', '0 0 0', end, FALSE, WarpZone_trace_forent, world, fireBullet_trace_callback);
+ WarpZone_TraceBox_ThroughZone(start, '0 0 0', '0 0 0', end, false, WarpZone_trace_forent, world, fireBullet_trace_callback);
dir = WarpZone_TransformVelocity(WarpZone_trace_transform, dir);
end = WarpZone_TransformOrigin(WarpZone_trace_transform, end);
start = trace_endpos;
// move the entity along its velocity until it's out of solid, then let it resume
// The previously hit entity is ignored here!
- traceline_inverted (start, start + dir * maxdist, MOVE_NORMAL, WarpZone_trace_forent, TRUE, hit);
+ traceline_inverted (start, start + dir * maxdist, MOVE_NORMAL, WarpZone_trace_forent, true, hit);
if(trace_fraction == 1) // 1: we never got out of solid
break;
void W_SetupProjVelocity_Explicit(entity proj, vector dir, vector upDir, float pSpeed, float pUpSpeed, float pZSpeed, float spread, float forceAbsolute);
-#define W_SetupProjVelocity_Basic(ent,pspeed,pspread) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, pspeed, 0, 0, pspread, FALSE)
+#define W_SetupProjVelocity_Basic(ent,pspeed,pspread) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, pspeed, 0, 0, pspread, false)
-#define W_SetupProjVelocity_UP_PRE(ent,wepname,prefix) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR(wepname, prefix##speed), WEP_CVAR(wepname, prefix##speed_up), WEP_CVAR(wepname, prefix##speed_z), WEP_CVAR(wepname, prefix##spread), FALSE)
-#define W_SetupProjVelocity_UP_PRI(ent,wepname) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR_PRI(wepname, speed), WEP_CVAR_PRI(wepname, speed_up), WEP_CVAR_PRI(wepname, speed_z), WEP_CVAR_PRI(wepname, spread), FALSE)
-#define W_SetupProjVelocity_UP_SEC(ent,wepname) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR_SEC(wepname, speed), WEP_CVAR_SEC(wepname, speed_up), WEP_CVAR_SEC(wepname, speed_z), WEP_CVAR_SEC(wepname, spread), FALSE)
+#define W_SetupProjVelocity_UP_PRE(ent,wepname,prefix) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR(wepname, prefix##speed), WEP_CVAR(wepname, prefix##speed_up), WEP_CVAR(wepname, prefix##speed_z), WEP_CVAR(wepname, prefix##spread), false)
+#define W_SetupProjVelocity_UP_PRI(ent,wepname) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR_PRI(wepname, speed), WEP_CVAR_PRI(wepname, speed_up), WEP_CVAR_PRI(wepname, speed_z), WEP_CVAR_PRI(wepname, spread), false)
+#define W_SetupProjVelocity_UP_SEC(ent,wepname) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR_SEC(wepname, speed), WEP_CVAR_SEC(wepname, speed_up), WEP_CVAR_SEC(wepname, speed_z), WEP_CVAR_SEC(wepname, spread), false)
#define W_SetupProjVelocity_UP_BOTH(ent,wepname,isprimary) \
if(isprimary) { W_SetupProjVelocity_UP_PRI(ent, wepname); } \
else { W_SetupProjVelocity_UP_SEC(ent, wepname); }
-#define W_SetupProjVelocity_PRE(ent,wepname,prefix) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR(wepname, prefix##speed), 0, 0, WEP_CVAR(wepname, prefix##spread), FALSE)
-#define W_SetupProjVelocity_PRI(ent,wepname) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR_PRI(wepname, speed), 0, 0, WEP_CVAR_PRI(wepname, spread), FALSE)
-#define W_SetupProjVelocity_SEC(ent,wepname) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR_SEC(wepname, speed), 0, 0, WEP_CVAR_SEC(wepname, spread), FALSE)
+#define W_SetupProjVelocity_PRE(ent,wepname,prefix) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR(wepname, prefix##speed), 0, 0, WEP_CVAR(wepname, prefix##spread), false)
+#define W_SetupProjVelocity_PRI(ent,wepname) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR_PRI(wepname, speed), 0, 0, WEP_CVAR_PRI(wepname, spread), false)
+#define W_SetupProjVelocity_SEC(ent,wepname) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR_SEC(wepname, speed), 0, 0, WEP_CVAR_SEC(wepname, spread), false)
#define W_SetupProjVelocity_BOTH(ent,wepname,isprimary) \
if(isprimary) { W_SetupProjVelocity_PRI(ent, wepname); } \
// we can write
prefix = strcat(autocvar_hostname, "\t", GetGametype(), "_", GetMapname(), "\t");
url_fputs(fh, "#begin statsfile\n");
- url_fputs(fh, strcat("#date ", strftime(TRUE, "%a %b %e %H:%M:%S %Z %Y"), "\n"));
+ url_fputs(fh, strcat("#date ", strftime(true, "%a %b %e %H:%M:%S %Z %Y"), "\n"));
#ifdef WATERMARK
url_fputs(fh, strcat("#version ", WATERMARK, "\n"));
#endif
- url_fputs(fh, strcat("#config ", ftos(crc16(FALSE, cvar_purechanges)), "\n"));
+ url_fputs(fh, strcat("#config ", ftos(crc16(false, cvar_purechanges)), "\n"));
url_fputs(fh, strcat("#cvar_purechanges ", ftos(cvar_purechanges_count), "\n"));
n = tokenizebyseparator(cvar_purechanges, "\n");
for(i = 0; i < n; ++i)
if(IS_SPEC(other))
if(other.enemy == self.owner)
self.viewmodelforclient = other;
- return TRUE;
+ return true;
}
/*
{
vector v0;
v0 = self.movedir;
- self.movedir = shotorg_adjust(v0, FALSE, FALSE);
- self.view_ofs = shotorg_adjust(v0, FALSE, TRUE) - v0;
+ self.movedir = shotorg_adjust(v0, false, false);
+ self.view_ofs = shotorg_adjust(v0, false, true) - v0;
}
self.owner.stat_shotorg = compressShotOrigin(self.movedir);
self.movedir = decompressShotOrigin(self.owner.stat_shotorg); // make them match perfectly
setorigin(self, self.view_ofs);
// reset animstate now
self.wframe = WFRAME_IDLE;
- setanim(self, self.anim_idle, TRUE, FALSE, TRUE);
+ setanim(self, self.anim_idle, true, false, true);
}
vector CL_Weapon_GetShotOrg(float wpn)
entity mine;
if(self.weapon == WEP_MINE_LAYER)
for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.owner == self)
- return FALSE;
+ return false;
if(self.weapon == WEP_SHOTGUN)
if(!secondary && WEP_CVAR(shotgun, secondary) == 1)
- return FALSE; // no clicking, just allow
+ return false; // no clicking, just allow
if(self.weapon == self.switchweapon && time - self.prevdryfire > 1) // only play once BEFORE starting to switch weapons
{
W_SwitchToOtherWeapon(self);
}
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
.float race_penalty;
float weapon_prepareattack_check(float secondary, float attacktime)
{
if(!weapon_prepareattack_checkammo(secondary))
- return FALSE;
+ return false;
//if sv_ready_restart_after_countdown is set, don't allow the player to shoot
//if all players readied up and the countdown is running
if(time < game_starttime || time < self.race_penalty) {
- return FALSE;
+ return false;
}
if (timeout_status == TIMEOUT_ACTIVE) //don't allow the player to shoot while game is paused
- return FALSE;
+ return false;
// do not even think about shooting if switching
if(self.switchweapon != self.weapon)
- return FALSE;
+ return false;
if(attacktime >= 0)
{
// don't fire if previous attack is not finished
if (ATTACK_FINISHED(self) > time + self.weapon_frametime * 0.5)
- return FALSE;
+ return false;
// don't fire while changing weapon
if (self.weaponentity.state != WS_READY)
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
float weapon_prepareattack_do(float secondary, float attacktime)
{
}
self.bulletcounter += 1;
//dprint("attack finished ", ftos(ATTACK_FINISHED(self)), "\n");
- return TRUE;
+ return true;
}
float weapon_prepareattack(float secondary, float attacktime)
{
if(weapon_prepareattack_check(secondary, attacktime))
{
weapon_prepareattack_do(secondary, attacktime);
- return TRUE;
+ return true;
}
else
- return FALSE;
+ return false;
}
void weapon_thinkf(float fr, float t, void() func)
if(fr == WFRAME_DONTCHANGE)
{
fr = self.weaponentity.wframe;
- restartanim = FALSE;
+ restartanim = false;
}
else if (fr == WFRAME_IDLE)
- restartanim = FALSE;
+ restartanim = false;
else
- restartanim = TRUE;
+ restartanim = true;
of = v_forward;
or = v_right;
else // if (fr == WFRAME_RELOAD)
a = self.weaponentity.anim_reload;
a.z *= g_weaponratefactor;
- setanim(self.weaponentity, a, restartanim == FALSE, restartanim, restartanim);
+ setanim(self.weaponentity, a, restartanim == false, restartanim, restartanim);
}
v_forward = of;
ang = AnglesTransform_ApplyToVAngles(wz.warpzone_transform, ang);
#ifdef KEEP_ROLL
- ang = AnglesTransform_Normalize(ang, TRUE);
+ ang = AnglesTransform_Normalize(ang, true);
ang = AnglesTransform_CancelRoll(ang);
ang_z = roll;
#else
- ang = AnglesTransform_Normalize(ang, FALSE);
+ ang = AnglesTransform_Normalize(ang, false);
#endif
return ang;
ang_z = 0;
ang = AnglesTransform_ApplyToVAngles(AnglesTransform_Invert(wz.warpzone_transform), ang);
- ang = AnglesTransform_Normalize(ang, TRUE);
+ ang = AnglesTransform_Normalize(ang, true);
ang = AnglesTransform_CancelRoll(ang);
ang_z = roll;
setorigin (player, to); // NOTE: this also aborts the move, when this is called by touch
player.oldorigin = to; // for DP's unsticking
player.angles = to_angles;
- player.fixangle = TRUE;
+ player.fixangle = true;
player.velocity = to_velocity;
BITXOR_ASSIGN(player.effects, EF_TELEPORT_BIT);
WriteCoord(MSG_ENTITY, self.angles.x);
WriteCoord(MSG_ENTITY, self.angles.y);
WriteCoord(MSG_ENTITY, self.angles.z);
- return TRUE;
+ return true;
}
float WarpZone_Teleport(entity wz, entity player, float f0, float f1)
if(IS_PLAYER(player))
{
// instead of fixangle, send the transform to the client for smoother operation
- player.fixangle = FALSE;
+ player.fixangle = false;
entity ts = spawn();
setmodel(ts, "null");
WriteShort(MSG_ENTITY, self.warpzone_fadeend);
}
- return TRUE;
+ return true;
}
float WarpZone_Camera_Send(entity to, float sendflags)
WriteShort(MSG_ENTITY, self.warpzone_fadeend);
}
- return TRUE;
+ return true;
}
#ifdef WARPZONELIB_KEEPDEBUG
float WarpZone_Projectile_Touch()
{
if(other.classname == "trigger_warpzone")
- return TRUE;
+ return true;
// no further impacts if we teleported this frame!
// this is because even if we did teleport, the engine still may raise
// but if this is called from TouchAreaGrid of the projectile moving,
// then this won't do
if(time == self.warpzone_teleport_time)
- return TRUE;
+ return true;
#ifdef WARPZONELIB_KEEPDEBUG
// this SEEMS to not happen at the moment, but if it did, it would be more reliable
#endif
if(WarpZone_Projectile_Touch_ImpactFilter_Callback())
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
void WarpZone_InitStep_FindOriginTarget()
o = e.origin;
traceline(o, o, MOVE_WORLDONLY, e);
if (trace_startsolid)
- return FALSE;
+ return false;
tracebox(o, e.mins, e.maxs, o, MOVE_WORLDONLY, e);
if (!trace_startsolid)
- return TRUE;
+ return true;
m0 = e.mins;
m1 = e.maxs;
if (trace_startsolid)
{
setorigin(e, o);
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
float WarpZoneLib_ExactTrigger_Touch()