34 pos = v1 +
dir * nudge;
49 tracebox(pos, mi, ma, v2, nomonsters, forent);
67 tracebox(t, mi, ma, pos, nomonsters, forent);
73 pos = t +
dir * nudge;
76 if(stopatentity && stopentity && stopentity != ignorestopatentity)
103 tracebox_inverted(v1,
'0 0 0',
'0 0 0', v2, nomonsters, forent, stopatentity, ignorestopatentity);
119 vector vec = mindist *
'1 0 0';
128 traceline (loc, loc + vec,
true,
NULL);
150 vector v = ((ent.absmin + ent.absmax) * 0.5);
151 entity e = ent.tag_entity;
155 v = v + ((e.absmin + e.absmax) * 0.5);
206string draw_UseSkinFor(
string pic)
211 return strcat(draw_currentSkin,
"/", pic);
215 #define PRECACHE_PIC precache_pic
216 #define SKIN_PATH hud_skin_path
219 #define PRECACHE_PIC draw_PreloadPicture
220 #define SKIN_PATH (strreplace("gfx/menu", "gfx/hud", draw_currentSkin))
225string icon_path_from_HUDskin(
string theIcon)
230 string img =
strcat(
"/", SKIN_PATH,
"/", theIcon);
231 if (PRECACHE_PIC(img) ==
"")
232 img = sprintf(
"/gfx/hud/default/%s", theIcon);
238string icon_path_from_menuskin(
string theIcon)
243 string img =
strcat(
"/", draw_currentSkin,
"/", theIcon);
245 img = sprintf(
"/gfx/menu/wickedx/%s", theIcon);
254void mut_set_active(
int mut)
257 active_mutators[1] |=
BIT(mut - 24);
259 active_mutators[0] |=
BIT(mut);
262bool mut_is_active(
int mut)
265 return (active_mutators[1] & (
BIT(mut - 24)));
267 return (active_mutators[0] &
BIT(mut));
273string build_mutator_list(
string s)
276 if (s ==
"")
return "";
290 for (
string arg =
""; i < n; ++i)
292 if (i >= 0) arg =
argv(i);
294 #define X(name, translated_name, mut, cond) \
295 if(arg == name || (!n && (cond))) { s2 = cons_mid(s2, ", ", translated_name); mut_set_active(mut); }
296 X(
"Dodging" , _(
"Dodging") , MUT_DODGING ,
cvar(
"g_dodging"))
297 X(
"InstaGib" , _(
"InstaGib") , MUT_INSTAGIB ,
cvar(
"g_instagib"))
298 X(
"New Toys" , _(
"New Toys") , MUT_NEW_TOYS ,
cvar(
"g_new_toys"))
299 X(
"NIX" , _(
"NIX") , MUT_NIX ,
cvar(
"g_nix"))
300 X(
"Rocket Flying" , _(
"Rocket Flying") , MUT_ROCKET_FLYING ,
cvar(
"g_rocket_flying"))
301 X(
"Invincible Projectiles" , _(
"Invincible Projectiles") , MUT_INVINCIBLE_PROJECTILES ,
cvar(
"g_invincible_projectiles"))
303 X(
"Cloaked" , _(
"Cloaked") , MUT_CLOAKED ,
cvar(
"g_cloaked"))
304 X(
"Hook" , _(
"Hook") , MUT_GRAPPLING_HOOK ,
cvar(
"g_grappling_hook"))
305 X(
"Midair" , _(
"Midair") , MUT_MIDAIR ,
cvar(
"g_midair"))
306 X(
"Melee only Arena" , _(
"Melee only Arena") , MUT_MELEE_ONLY ,
cvar(
"g_melee_only"))
307 X(
"Vampire" , _(
"Vampire") , MUT_VAMPIRE ,
cvar(
"g_vampire"))
308 X(
"Piñata" , _(
"Piñata") , MUT_PINATA ,
cvar(
"g_pinata"))
309 X(
"Weapons stay" , _(
"Weapons stay") , MUT_WEAPON_STAY ,
cvar(
"g_weapon_stay"))
310 X(
"Blood loss" , _(
"Blood loss") , MUT_BLOODLOSS ,
cvar(
"g_bloodloss") > 0)
311 X(
"Jetpack" , _(
"Jetpack") , MUT_JETPACK ,
cvar(
"g_jetpack"))
312 X(
"Buffs" , _(
"Buffs") , MUT_BUFFS ,
cvar(
"g_buffs") > 0)
313 X(
"Overkill" , _(
"Overkill") , MUT_OVERKILL ,
cvar(
"g_overkill"))
314 X(
"No powerups" , _(
"No powerups") , MUT_NO_POWERUPS ,
cvar(
"g_powerups") == 0)
315 X(
"Powerups" , _(
"Powerups") , MUT_POWERUPS ,
cvar(
"g_powerups") > 0)
316 X(
"Touch explode" , _(
"Touch explode") , MUT_TOUCHEXPLODE ,
cvar(
"g_touchexplode") > 0)
317 X(
"Wall jumping" , _(
"Wall jumping") , MUT_WALLJUMP ,
cvar(
"g_walljump"))
318 X(
"No start weapons" , _(
"No start weapons") , MUT_NO_START_WEAPONS ,
cvar_string(
"g_weaponarena") ==
"0" &&
cvar(
"g_balance_blaster_weaponstartoverride") == 0)
319 X(
"Nades" , _(
"Nades") , MUT_NADES ,
cvar(
"g_nades"))
320 X(
"Offhand blaster" , _(
"Offhand blaster") , MUT_OFFHAND_BLASTER ,
cvar(
"g_offhand_blaster"))
330 float lleft, i, j, wlen;
335 for (i = 0; i < len; ++i)
358 for (j = i+1; j < len; ++j)
428 pValue =
floor(pValue + 0.5);
439 valstr =
ftos(pValue);
471 m =
floor((l + r) / 2);
491 float p = (data & 0xF000) / 0x1000;
492 float q = (data & 0x0F80) / 0x80;
493 int len = (data & 0x007F);
510 float cos_p =
cos(p);
511 out.x =
cos(q) * cos_p;
512 out.y =
sin(q) * cos_p;
532 if(
ang.x < -90 &&
ang.x > +90)
533 error(
"BOGUS vectoangles");
536 p =
floor(0.5 + (
ang.x + 90) * (16 / 180)) & 15;
545 y =
floor(0.5 +
ang.y * (32 / 360)) & 31;
550 return (p * 0x1000) + (
y * 0x80) + len;
556 float f = (2 ** (1/8));
558 for(i = 0; i < 128; ++i)
564 if(
cvar(
"developer") > 0)
566 LOG_TRACE(
"Verifying vector compression table...");
567 for(i = 0x0F00; i < 0xFFFF; ++i)
571 "BROKEN vector compression: %s -> %s -> %s",
584 traceline(v0, v0 + dvx,
true, forent);
if(
trace_fraction < 1)
return 0;
585 traceline(v0, v0 + dvy,
true, forent);
if(
trace_fraction < 1)
return 0;
586 traceline(v0, v0 + dvz,
true, forent);
if(
trace_fraction < 1)
return 0;
587 traceline(v0 + dvx, v0 + dvx + dvy,
true, forent);
if(
trace_fraction < 1)
return 0;
588 traceline(v0 + dvx, v0 + dvx + dvz,
true, forent);
if(
trace_fraction < 1)
return 0;
589 traceline(v0 + dvy, v0 + dvy + dvx,
true, forent);
if(
trace_fraction < 1)
return 0;
590 traceline(v0 + dvy, v0 + dvy + dvz,
true, forent);
if(
trace_fraction < 1)
return 0;
591 traceline(v0 + dvz, v0 + dvz + dvx,
true, forent);
if(
trace_fraction < 1)
return 0;
592 traceline(v0 + dvz, v0 + dvz + dvy,
true, forent);
if(
trace_fraction < 1)
return 0;
593 traceline(v0 + dvx + dvy, v0 + dvx + dvy + dvz,
true, forent);
if(
trace_fraction < 1)
return 0;
594 traceline(v0 + dvx + dvz, v0 + dvx + dvy + dvz,
true, forent);
if(
trace_fraction < 1)
return 0;
595 traceline(v0 + dvy + dvz, v0 + dvx + dvy + dvz,
true, forent);
if(
trace_fraction < 1)
return 0;
600string fixPriorityList(
string order,
float from,
float to,
float subtract,
float complete)
607 for(i = 0; i < n; ++i)
612 if(w >= from && w <= to)
617 if(w >= from && w <= to)
626 for(w = to; w >= from; --w)
631 for(i = 0; i < n; ++i)
649 for(
float i = 0; i < n; ++i)
650 neworder =
strcat(neworder, mapfunc(
argv(i)),
" ");
659 if(i >= 0 && i < n && j >= 0 && j < n && i != j)
662 for(
float w = 0; w < n; ++w)
711 tracebox(
'1 0 0' * mi.x,
712 '0 1 0' * mi.y +
'0 0 1' * mi.z,
713 '0 1 0' * ma.y +
'0 0 1' * ma.z,
720 tracebox(
'0 1 0' * mi.y,
721 '1 0 0' * mi.x +
'0 0 1' * mi.z,
722 '1 0 0' * ma.x +
'0 0 1' * ma.z,
729 tracebox(
'0 0 1' * mi.z,
730 '1 0 0' * mi.x +
'0 1 0' * mi.y,
731 '1 0 0' * ma.x +
'0 1 0' * ma.y,
738 tracebox(
'1 0 0' * ma.x,
739 '0 1 0' * mi.y +
'0 0 1' * mi.z,
740 '0 1 0' * ma.y +
'0 0 1' * ma.z,
747 tracebox(
'0 1 0' * ma.y,
748 '1 0 0' * mi.x +
'0 0 1' * mi.z,
749 '1 0 0' * ma.x +
'0 0 1' * ma.z,
756 tracebox(
'0 0 1' * ma.z,
757 '1 0 0' * mi.x +
'0 1 0' * mi.y,
758 '1 0 0' * ma.x +
'0 1 0' * ma.y,
780 if(extend.y > extend.x)
782 mi_picmin.x -= (extend.y - extend.x) * 0.5;
783 mi_picmax.x += (extend.y - extend.x) * 0.5;
787 mi_picmin.y -= (extend.x - extend.y) * 0.5;
788 mi_picmax.y += (extend.x - extend.y) * 0.5;
804 mi_pictexcoord1_x = mi_pictexcoord0_x;
805 mi_pictexcoord1_y = mi_pictexcoord2_y;
806 mi_pictexcoord3_x = mi_pictexcoord2_x;
807 mi_pictexcoord3_y = mi_pictexcoord0_y;
813 float created_saved_value;
815 created_saved_value = 0;
817 if (!(tmp_cvar || tmp_value))
819 LOG_TRACE(
"Error: Invalid usage of cvar_settemp(string, string); !");
823 if(!cvar_type(tmp_cvar))
825 LOG_INFOF(
"Error: cvar %s doesn't exist!", tmp_cvar);
831 created_saved_value = -1;
835 if(created_saved_value != -1)
842 created_saved_value = 1;
848 return created_saved_value;
858 if(cvar_type(it.netname))
867 LOG_INFOF(
"Error: cvar %s doesn't exist anymore! It can still be restored once it's manually recreated.", it.netname);
874 if(cvar_type(e.netname))
881 print(sprintf(
"Error: cvar %s doesn't exist anymore! It can still be restored once it's manually recreated.", e.netname));
895 if(w(theText, theSize) <= maxWidth)
898 bool colors = (w(
"^7", theSize) == 0);
901 int len, left, right, middle;
903 right = len =
strlen(theText);
907 middle =
floor((left + right) / 2);
911 ofs = (res.x) ? res.x - res.y : 0;
914 if(w(
substring(theText, 0, middle + ofs), theSize) <= maxWidth)
919 while(left < right - 1);
931 if(w(theText) <= maxLength)
934 bool colors = (w(
"^7") == 0);
937 int len, left, right, middle;
939 right = len =
strlen(theText);
943 middle =
floor((left + right) / 2);
947 ofs = (!res.x) ? 0 : res.x - res.y;
950 if(w(
substring(theText, 0, middle + ofs)) <= maxLength)
955 while(left < right - 1);
966 for(
int i = len; i >= start; --i)
972 while (i-carets >= start &&
substring(s, i-carets, 1) ==
"^")
1006 if(take_until > 0 && take_until <
strlen(s))
1008 int last_word = take_until - 1;
1009 while(last_word > 0 &&
substring(s, last_word, 1) !=
" ")
1015 take_until = last_word;
1022 else if (tw(
"^7", theFontSize) == 0)
1044 if(take_until > 0 && take_until <
strlen(s))
1046 int last_word = take_until - 1;
1047 while(last_word > 0 &&
substring(s, last_word, 1) !=
" ")
1053 take_until = last_word;
1060 else if (tw(
"^7") == 0)
1073 if(tw(theText, theFontSize) <= maxWidth)
1081 if(tw(theText) <= maxWidth)
1089 string subpattern, subpattern2, subpattern3, subpattern4;
1092 subpattern2 =
",teams,";
1094 subpattern2 =
",noteams,";
1096 subpattern3 =
",teamspawns,";
1098 subpattern3 =
",noteamspawns,";
1099 if(gt == MAPINFO_TYPE_RACE || gt == MAPINFO_TYPE_CTS)
1100 subpattern4 =
",race,";
1113 if(subpattern4 &&
strstrofs(
strcat(
",", pattern,
","), subpattern4, 0) >= 0)
1162 else if(solution.x > 0)
1166 ret =
normalize(eorg + solution.x * evel);
1168 else if(solution.y > 0)
1172 ret =
normalize(eorg + solution.y * evel);
1190 if(newton_style == 2)
1201 if(newton_style == 2)
1220 outspeed = solution.y;
1224 outspeed = solution.x;
1228 outspeed =
bound(spd * mi, outspeed, spd * ma);
1229 return mydir * outspeed;
1233 return myvel + spd * mydir;
1250 int rx_neg = (v.x < 0) ? 1 : 0;
1251 int ry_neg = (v.y < 0) ? 1 : 0;
1252 int rz_neg = (v.z < 0) ? 1 : 0;
1259 rx =
bound(0, rx, 255);
1264 ry =
bound(0, ry, 63);
1269 rz =
bound(0, rz, 63);
1271 ry |= ry_neg *
BIT(6) + rx_neg *
BIT(7);
1272 rz |= rz_neg *
BIT(6);
1273 return rx * 0x10000 + ry * 0x100 + rz;
1279 v.y = (f & 0xFF00) >> 8;
1282 if (v.y &
BIT(7)) { v.y &=
~BIT(7); v.x *= -1; }
1283 if (v.y &
BIT(6)) { v.y &=
~BIT(6); v.y *= -1; }
1284 if (v.z &
BIT(6)) { v.z &=
~BIT(6); v.z *= -1; }
1292 float healthdamage, armordamage, armorideal;
1293 if (
DEATH_IS(deathtype, DEATH_DROWN))
1296 healthdamage = (h - 1) / (1 - armorblock);
1297 armordamage = a + (h - 1);
1298 armorideal = healthdamage * armorblock;
1300 if(armordamage < healthdamage)
1316 if (
DEATH_IS(deathtype, DEATH_DROWN))
1320 v.y =
bound(0, damage * armorblock, a);
1321 v.x =
bound(0, damage - v.y, damage);
1346 t =
car(acl); acl =
cdr(acl);
1386 m =
"models/player/*_";
1391 return strcat(m,
".", fil);
1448 while((s =
fgets(fh)))
1469 if (s ==
"Male") s = _(
"Male");
1470 else if (s ==
"Female") s = _(
"Female");
1471 else if (s ==
"Undisclosed") s = _(
"Undisclosed");
1478 if(c ==
"description")
1480 if(c ==
"bone_upperbody")
1482 if(c ==
"bone_weapon")
1499 while((s =
fgets(fh)))
1518 if (key ==
"<KEY NOT FOUND>")
return _(
"<KEY NOT FOUND>");
1519 if (key ==
"<UNKNOWN KEYNUM>")
return _(
"<UNKNOWN KEYNUM>");
1524 case "TAB":
return _(
"TAB");
1525 case "ENTER":
return _(
"ENTER");
1526 case "ESCAPE":
return _(
"ESCAPE");
1527 case "SPACE":
return _(
"SPACE");
1529 case "BACKSPACE":
return _(
"BACKSPACE");
1530 case "UPARROW":
return _(
"UPARROW");
1531 case "DOWNARROW":
return _(
"DOWNARROW");
1532 case "LEFTARROW":
return _(
"LEFTARROW");
1533 case "RIGHTARROW":
return _(
"RIGHTARROW");
1535 case "ALT":
return _(
"ALT");
1536 case "CTRL":
return _(
"CTRL");
1537 case "SHIFT":
return _(
"SHIFT");
1539 case "INS":
return _(
"INS");
1540 case "DEL":
return _(
"DEL");
1541 case "PGDN":
return _(
"PGDN");
1542 case "PGUP":
return _(
"PGUP");
1543 case "HOME":
return _(
"HOME");
1544 case "END":
return _(
"END");
1546 case "PAUSE":
return _(
"PAUSE");
1548 case "NUMLOCK":
return _(
"NUMLOCK");
1549 case "CAPSLOCK":
return _(
"CAPSLOCK");
1550 case "SCROLLOCK":
return _(
"SCROLLOCK");
1552 case "SEMICOLON":
return _(
"SEMICOLON");
1553 case "TILDE":
return _(
"TILDE");
1554 case "BACKQUOTE":
return _(
"BACKQUOTE");
1555 case "QUOTE":
return _(
"QUOTE");
1556 case "APOSTROPHE":
return _(
"APOSTROPHE");
1557 case "BACKSLASH":
return _(
"BACKSLASH");
1565 return sprintf(_(
"F%d"),
stof(subkey));
1575 return sprintf(_(
"KP_%d"),
stof(subkey));
1580 case "INS":
return sprintf(_(
"KP_%s"), _(
"INS"));
1581 case "END":
return sprintf(_(
"KP_%s"), _(
"END"));
1582 case "DOWNARROW":
return sprintf(_(
"KP_%s"), _(
"DOWNARROW"));
1583 case "PGDN":
return sprintf(_(
"KP_%s"), _(
"PGDN"));
1584 case "LEFTARROW":
return sprintf(_(
"KP_%s"), _(
"LEFTARROW"));
1585 case "RIGHTARROW":
return sprintf(_(
"KP_%s"), _(
"RIGHTARROW"));
1586 case "HOME":
return sprintf(_(
"KP_%s"), _(
"HOME"));
1587 case "UPARROW":
return sprintf(_(
"KP_%s"), _(
"UPARROW"));
1588 case "PGUP":
return sprintf(_(
"KP_%s"), _(
"PGUP"));
1589 case "PERIOD":
return sprintf(_(
"KP_%s"), _(
"PERIOD"));
1590 case "DEL":
return sprintf(_(
"KP_%s"), _(
"DEL"));
1591 case "DIVIDE":
return sprintf(_(
"KP_%s"), _(
"DIVIDE"));
1592 case "SLASH":
return sprintf(_(
"KP_%s"), _(
"SLASH"));
1593 case "MULTIPLY":
return sprintf(_(
"KP_%s"), _(
"MULTIPLY"));
1594 case "MINUS":
return sprintf(_(
"KP_%s"), _(
"MINUS"));
1595 case "PLUS":
return sprintf(_(
"KP_%s"), _(
"PLUS"));
1596 case "ENTER":
return sprintf(_(
"KP_%s"), _(
"ENTER"));
1597 case "EQUALS":
return sprintf(_(
"KP_%s"), _(
"EQUALS"));
1598 default:
return key;
1602 if (key ==
"PRINTSCREEN")
return _(
"PRINTSCREEN");
1607 if (key ==
"MWHEELUP")
return _(
"MWHEELUP");
1608 if (key ==
"MWHEELDOWN")
return _(
"MWHEELDOWN");
1621 case "DPAD_UP":
return sprintf(_(
"X360_%s"), _(
"DPAD_UP"));
1622 case "DPAD_DOWN":
return sprintf(_(
"X360_%s"), _(
"DPAD_DOWN"));
1623 case "DPAD_LEFT":
return sprintf(_(
"X360_%s"), _(
"DPAD_LEFT"));
1624 case "DPAD_RIGHT":
return sprintf(_(
"X360_%s"), _(
"DPAD_RIGHT"));
1625 case "START":
return sprintf(_(
"X360_%s"), _(
"START"));
1626 case "BACK":
return sprintf(_(
"X360_%s"), _(
"BACK"));
1627 case "LEFT_THUMB":
return sprintf(_(
"X360_%s"), _(
"LEFT_THUMB"));
1628 case "RIGHT_THUMB":
return sprintf(_(
"X360_%s"), _(
"RIGHT_THUMB"));
1629 case "LEFT_SHOULDER":
return sprintf(_(
"X360_%s"), _(
"LEFT_SHOULDER"));
1630 case "RIGHT_SHOULDER":
return sprintf(_(
"X360_%s"), _(
"RIGHT_SHOULDER"));
1631 case "LEFT_TRIGGER":
return sprintf(_(
"X360_%s"), _(
"LEFT_TRIGGER"));
1632 case "RIGHT_TRIGGER":
return sprintf(_(
"X360_%s"), _(
"RIGHT_TRIGGER"));
1633 case "LEFT_THUMB_UP":
return sprintf(_(
"X360_%s"), _(
"LEFT_THUMB_UP"));
1634 case "LEFT_THUMB_DOWN":
return sprintf(_(
"X360_%s"), _(
"LEFT_THUMB_DOWN"));
1635 case "LEFT_THUMB_LEFT":
return sprintf(_(
"X360_%s"), _(
"LEFT_THUMB_LEFT"));
1636 case "LEFT_THUMB_RIGHT":
return sprintf(_(
"X360_%s"), _(
"LEFT_THUMB_RIGHT"));
1637 case "RIGHT_THUMB_UP":
return sprintf(_(
"X360_%s"), _(
"RIGHT_THUMB_UP"));
1638 case "RIGHT_THUMB_DOWN":
return sprintf(_(
"X360_%s"), _(
"RIGHT_THUMB_DOWN"));
1639 case "RIGHT_THUMB_LEFT":
return sprintf(_(
"X360_%s"), _(
"RIGHT_THUMB_LEFT"));
1640 case "RIGHT_THUMB_RIGHT":
return sprintf(_(
"X360_%s"), _(
"RIGHT_THUMB_RIGHT"));
1641 default:
return key;
1650 case "UP":
return sprintf(_(
"JOY_%s"), _(
"UP"));
1651 case "DOWN":
return sprintf(_(
"JOY_%s"), _(
"DOWN"));
1652 case "LEFT":
return sprintf(_(
"JOY_%s"), _(
"LEFT"));
1653 case "RIGHT":
return sprintf(_(
"JOY_%s"), _(
"RIGHT"));
1654 default:
return key;
1659 return sprintf(_(
"MIDINOTE%d"),
stof(
substring(key, 8, -1)));
1670 d = f % 22; f =
floor(f / 22);
1671 c = f % 22; f =
floor(f / 22);
1672 b = f % 22; f =
floor(f / 22);
1693 if(a < 0 || b < 0 || c < 0 || d < 0)
1695 return ((a * 22 + b) * 22 + c) * 22 + d;
1720 LOG_INFO(
"Recursive shutdown detected! Only restoring cvars...");
1736 if(e.skeleton_bones_index == e.modelindex)
1740 skelindex = skel_create(e.modelindex);
1741 e.skeleton_bones = skel_get_numbones(skelindex);
1742 skel_delete(skelindex);
1743 e.skeleton_bones_index = e.modelindex;
1768 entity queue_start, queue_end;
1774 if(e.FindConnectedComponent_processing)
1775 error(
"recursion or broken cleanup");
1778 queue_start = queue_end = e;
1779 queue_end.(fld) =
NULL;
1780 queue_end.FindConnectedComponent_processing = 1;
1783 for (; queue_start; queue_start = queue_start.(fld))
1787 for(t =
NULL; (t = nxt(t, queue_start,
pass)); )
1789 if(t.FindConnectedComponent_processing)
1791 if(iscon(t, queue_start,
pass))
1794 queue_end.(fld) = t;
1796 queue_end.(fld) =
NULL;
1797 queue_end.FindConnectedComponent_processing = 1;
1803 for (queue_start = e; queue_start; queue_start = queue_start.(fld))
1804 queue_start.FindConnectedComponent_processing = 0;
1813 float dur = frameduration(e.modelindex, a.x);
1814 if (dur <= 0 && b.y)
1817 dur = frameduration(e.modelindex, a.x);
1836 case 10:
return ANNCE_NUM_GAMESTART_10;
1837 case 9:
return ANNCE_NUM_GAMESTART_9;
1838 case 8:
return ANNCE_NUM_GAMESTART_8;
1839 case 7:
return ANNCE_NUM_GAMESTART_7;
1840 case 6:
return ANNCE_NUM_GAMESTART_6;
1841 case 5:
return ANNCE_NUM_GAMESTART_5;
1842 case 4:
return ANNCE_NUM_GAMESTART_4;
1843 case 3:
return ANNCE_NUM_GAMESTART_3;
1844 case 2:
return ANNCE_NUM_GAMESTART_2;
1845 case 1:
return ANNCE_NUM_GAMESTART_1;
1853 case 10:
return ANNCE_NUM_KILL_10;
1854 case 9:
return ANNCE_NUM_KILL_9;
1855 case 8:
return ANNCE_NUM_KILL_8;
1856 case 7:
return ANNCE_NUM_KILL_7;
1857 case 6:
return ANNCE_NUM_KILL_6;
1858 case 5:
return ANNCE_NUM_KILL_5;
1859 case 4:
return ANNCE_NUM_KILL_4;
1860 case 3:
return ANNCE_NUM_KILL_3;
1861 case 2:
return ANNCE_NUM_KILL_2;
1862 case 1:
return ANNCE_NUM_KILL_1;
1870 case 10:
return ANNCE_NUM_RESPAWN_10;
1871 case 9:
return ANNCE_NUM_RESPAWN_9;
1872 case 8:
return ANNCE_NUM_RESPAWN_8;
1873 case 7:
return ANNCE_NUM_RESPAWN_7;
1874 case 6:
return ANNCE_NUM_RESPAWN_6;
1875 case 5:
return ANNCE_NUM_RESPAWN_5;
1876 case 4:
return ANNCE_NUM_RESPAWN_4;
1877 case 3:
return ANNCE_NUM_RESPAWN_3;
1878 case 2:
return ANNCE_NUM_RESPAWN_2;
1879 case 1:
return ANNCE_NUM_RESPAWN_1;
1887 case 10:
return ANNCE_NUM_ROUNDSTART_10;
1888 case 9:
return ANNCE_NUM_ROUNDSTART_9;
1889 case 8:
return ANNCE_NUM_ROUNDSTART_8;
1890 case 7:
return ANNCE_NUM_ROUNDSTART_7;
1891 case 6:
return ANNCE_NUM_ROUNDSTART_6;
1892 case 5:
return ANNCE_NUM_ROUNDSTART_5;
1893 case 4:
return ANNCE_NUM_ROUNDSTART_4;
1894 case 3:
return ANNCE_NUM_ROUNDSTART_3;
1895 case 2:
return ANNCE_NUM_ROUNDSTART_2;
1896 case 1:
return ANNCE_NUM_ROUNDSTART_1;
1905 case 10:
return ANNCE_NUM_10;
1906 case 9:
return ANNCE_NUM_9;
1907 case 8:
return ANNCE_NUM_8;
1908 case 7:
return ANNCE_NUM_7;
1909 case 6:
return ANNCE_NUM_6;
1910 case 5:
return ANNCE_NUM_5;
1911 case 4:
return ANNCE_NUM_4;
1912 case 3:
return ANNCE_NUM_3;
1913 case 2:
return ANNCE_NUM_2;
1914 case 1:
return ANNCE_NUM_1;
1925 switch(nativecontents)
1962 vector org, t_forward, t_left, t_up, e_forward, e_up;
1969 t_up =
v_up * tagscale;
1971 e.origin_x =
org * t_forward;
1972 e.origin_y =
org * t_left;
1973 e.origin_z =
org * t_up;
1986 e_up.x =
v_up * t_forward;
1987 e_up.y =
v_up * t_left;
1988 e_up.z =
v_up * t_up;
1996 setattachment(e, to, tag);
1997 setorigin(e, e.origin);
2010 setattachment(e,
NULL,
"");
2011 setorigin(e, e.origin);
2018 e.punchangle = to.angles;
2019 e.view_ofs = e.origin - to.origin;
2020 e.v_angle = e.angles - to.angles;
2025void unfollow_sameorigin(
entity e)
2038 ent.punchangle = e.angles;
2039 ent.view_ofs = ent.origin - e.origin;
2040 ent.v_angle = ent.angles - e.angles;
2041 ent.aiment_classname = e.classname;
2042 ent.aiment_deadflag = e.deadflag;
2047 ent.view_ofs.x =
bound(pl.mins.x + 4, ent.view_ofs.x, pl.maxs.x - 4);
2048 ent.view_ofs.y =
bound(pl.mins.y + 4, ent.view_ofs.y, pl.maxs.y - 4);
2049 ent.view_ofs.z =
bound(pl.mins.z + 4, ent.view_ofs.z, pl.maxs.z - 4);
2074 if(ent.aiment.classname != ent.aiment_classname || ent.aiment.deadflag != ent.aiment_deadflag)
2085 bool do_colorize = (
teamplay && team_colorize);
2093 return strcat(t, strdecolorize(thename));
2174 return base + range *
sin((
time - start_time - (
M_PI / 2) * start_pos) *
freq);
#define MUTATOR_CALLHOOK(id,...)
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
const int SFL_TIME
Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!...
const int SFL_RANK
Display as a rank (with st, nd, rd, th suffix)
const int SFL_HIDE_ZERO
Don't show zero values as scores.
ERASEABLE void write_String_To_File(int fh, string str, bool alsoprint)
float CheckWireframeBox(entity forent, vector v0, vector dvx, vector dvy, vector dvz)
void SetMovetypeFollow(entity ent, entity e)
string playername(string thename, int teamid, bool team_colorize)
void FindConnectedComponent(entity e,.entity fld, findNextEntityNearFunction_t nxt, isConnectedFunction_t iscon, entity pass)
void queue_to_execute_next_frame(string s)
float isGametypeInFilter(Gametype gt, float tp, float ts, string pattern)
void execute_next_frame()
void get_mi_min_max_texcoords(float mode)
void wordwrap_cb(string s, float l, void(string) callback)
string fixPriorityList(string order, float from, float to, float subtract, float complete)
float compressShortVector(vector vec)
int Mod_Q1BSP_SuperContentsFromNativeContents(int nativecontents)
float skeleton_bones_index
void wordwrap_buffer_sprint(string s)
float tracebox_inverted(vector v1, vector mi, vector ma, vector v2, float nomonsters, entity forent, float stopatentity, entity ignorestopatentity)
float tracebox_hits_box(vector start, vector mi, vector ma, vector end, vector thmi, vector thma)
vector healtharmor_maxdamage(float h, float a, float armorblock, int deathtype)
vector decompressShortVector(int data)
void depthfirst(entity start,.entity up,.entity downleft,.entity right, void(entity, entity) funcPre, void(entity, entity) funcPost, entity pass)
vector healtharmor_applydamage(float a, float armorblock, int deathtype, float damage)
float matchacl(string acl, string str)
vector solve_shotdirection(vector myorg, vector myvel, vector eorg, vector evel, float spd, float newton_style)
Notification Announcer_PickNumber(int type, int num)
string find_last_color_code(string s)
entity _wordwrap_buffer_sprint_ent
int Mod_Q1BSP_NativeContentsFromSuperContents(int supercontents)
float lengthLogTable[128]
string textShortenToLength(string theText, float maxWidth, textLengthUpToLength_lenFunction_t tw)
float FindConnectedComponent_processing
string to_execute_next_frame
void SV_Shutdown() void CSQC_Shutdown() void m_shutdown()
ERASEABLE float blink_synced(float base, float range, float freq, float start_time, int start_pos)
int cvar_settemp_restore()
string textShortenToWidth(string theText, float maxWidth, vector theFontSize, textLengthUpToWidth_widthFunction_t tw)
float compressShotOrigin(vector v)
void get_mi_min_max(float mode)
string ScoreString(int pFlags, float pValue, int rounds_played)
vector real_origin(entity ent)
float trace_hits_box_1d(float end, float thmi, float thma)
void UnsetMovetypeFollow(entity ent)
string translate_key(string key)
string getWrappedLineLen(int maxLength, textLengthUpToLength_lenFunction_t tw)
int LostMovetypeFollow(entity ent)
string get_model_datafilename(string m, float sk, string fil)
float textLengthUpToLength(string theText, int maxLength, textLengthUpToLength_lenFunction_t w)
void wordwrap_buffer_put(string s)
float textLengthUpToWidth(string theText, float maxWidth, vector theSize, textLengthUpToWidth_widthFunction_t w)
vector get_shotvelocity(vector myvel, vector mydir, float spd, float newton_style, float mi, float ma)
float trace_hits_box(vector start, vector end, vector thmi, vector thma)
string swapInPriorityList(string order, float i, float j)
void attach_sameorigin(entity e, entity to, string tag)
float cvar_settemp(string tmp_cvar, string tmp_value)
string getWrappedLine(float maxWidth, vector theFontSize, textLengthUpToWidth_widthFunction_t tw)
ERASEABLE float cvar_or(string cv, float v)
void Skeleton_SetBones(entity e)
void detach_sameorigin(entity e)
string wordwrap(string s, float l)
void follow_sameorigin(entity e, entity to)
vector findbetterlocation(vector org, float mindist)
float get_model_parameters(string m, float sk)
string mapPriorityList(string order, string(string) mapfunc)
ERASEABLE float blink(float base, float range, float freq)
void traceline_inverted(vector v1, vector v2, float nomonsters, entity forent, float stopatentity, entity ignorestopatentity)
vector animfixfps(entity e, vector a, vector b)
float invertLengthLog(float dist)
void wordwrap_sprint(entity to, string s, float l)
vector decompressShotOrigin(int f)
float(string s) textLengthUpToLength_lenFunction_t
float get_model_parameters_weight
float get_model_parameters_fixbone
string get_model_parameters_sex
float(entity a, entity b, entity pass) isConnectedFunction_t
float get_model_parameters_species
string getWrappedLine_remaining
float get_model_parameters_bone_aimweight[MAX_AIM_BONES]
float get_model_parameters_modelskin
string get_model_parameters_name
string get_model_parameters_bone_weapon
#define TIME_ENCODED_TOSTRING(n, compact)
string get_model_parameters_description
bool get_model_parameters_hidden
string get_model_parameters_modelname
string get_model_parameters_bone_upperbody
entity(entity cur, entity near, entity pass) findNextEntityNearFunction_t
string get_model_parameters_bone_aim[MAX_AIM_BONES]
float(string s, vector size) textLengthUpToWidth_widthFunction_t
IntrusiveList g_saved_cvars
float get_model_parameters_age
string get_model_parameters_desc
const int SPECIES_ROBOT_SOLID
const int SPECIES_ROBOT_RUSTY
const int SPECIES_RESERVED
const int SPECIES_ROBOT_SHINY
ERASEABLE string count_ordinal(int interval)
const float CONTENT_SOLID
const float CONTENT_WATER
const float CONTENT_EMPTY
const float CONTENT_SLIME
const int HITTYPE_ARMORPIERCE
#define tokenizebyseparator
#define pass(name, colormin, colormax)
bool intermission_running
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
#define IL_EACH(this, cond, body)
#define FOREACH_ENTITY_CLASS(class, cond, body)
string MapInfo_Type_ToString(Gametype t)
int MapInfo_Get_ByName(string pFilename, float pAllowGenerate, Gametype pGametypeToSet)
ERASEABLE vector solve_quadratic(float a, float b, float c)
ax^2 + bx + c = 0
void set_movetype(entity this, int mt)
const int MOVETYPE_FOLLOW
spree_inf s1 s2 s3loc s2 spree_inf s1 s2 s3loc s2 spree_inf s1 s2 s3loc s2 s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2 f1points s1 s2
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
entity Notification
always last
#define new_pure(class)
purely logical entities (not linked to the area grid)
#define REGISTRY_GET(id, i)
#define PROJECTILE_MAKETRIGGER(e)
#define STATIC_INIT(func)
during worldspawn
ERASEABLE string car(string s)
returns first word
ERASEABLE string cdr(string s)
returns all but first word
ERASEABLE vector checkColorCode(string theText, int text_len, int pos, bool check_at_the_end)
string Team_ColorCode(int teamid)
const int WEP_FLAG_SPECIALATTACK