34 pos = v1 + dir * nudge;
41 if(pos * dir >= v2 * dir)
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)
101 void traceline_inverted (
vector v1,
vector v2,
float nomonsters,
entity forent,
float stopatentity,
entity ignorestopatentity)
103 tracebox_inverted(v1,
'0 0 0',
'0 0 0', v2, nomonsters, forent, stopatentity, ignorestopatentity);
119 vector vec = mindist *
'1 0 0';
123 traceline (org, org + vec,
true,
NULL);
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);
167 wordwrap_buffer =
strcat(wordwrap_buffer, s);
173 wordwrap_buffer =
"";
176 wordwrap_buffer =
"";
181 entity _wordwrap_buffer_sprint_ent;
182 void wordwrap_buffer_sprint(
string s)
184 wordwrap_buffer =
strcat(wordwrap_buffer, s);
187 sprint(_wordwrap_buffer_sprint_ent, wordwrap_buffer);
188 wordwrap_buffer =
"";
192 void wordwrap_sprint(
entity to,
string s,
float l)
194 wordwrap_buffer =
"";
195 _wordwrap_buffer_sprint_ent =
to;
197 _wordwrap_buffer_sprint_ent =
NULL;
198 if(wordwrap_buffer !=
"")
200 wordwrap_buffer =
"";
218 float lleft, i, j, wlen;
223 for (i = 0; i < len; ++i)
246 for (j = i+1; j < len; ++j)
311 string ScoreString(
int pFlags,
float pValue)
316 pValue =
floor(pValue + 0.5);
325 valstr =
ftos(pValue);
347 if(dist >= lengthLogTable[127])
349 if(dist <= lengthLogTable[0])
357 m =
floor((l + r) / 2);
358 if(lengthLogTable[m] < dist)
365 float lerr = (dist - lengthLogTable[l]);
366 float rerr = (lengthLogTable[r] - dist);
377 float p = (data & 0xF000) / 0x1000;
378 float q = (data & 0x0F80) / 0x80;
379 int len = (data & 0x007F);
394 q = .19634954084936207740 * q;
395 p = .19634954084936207740 * p - 1.57079632679489661922;
403 return out * lengthLogTable[len];
417 if(ang.x < -90 && ang.x > +90)
418 error(
"BOGUS vectoangles");
421 p =
floor(0.5 + (ang.x + 90) * 16 / 180) & 15;
430 y =
floor(0.5 + ang.y * 32 / 360) & 31;
435 return (p * 0x1000) + (y * 0x80) + len;
441 float f = (2 ** (1/8));
443 for(i = 0; i < 128; ++i)
445 lengthLogTable[i] = l;
449 if(
cvar(
"developer") > 0)
451 LOG_TRACE(
"Verifying vector compression table...");
452 for(i = 0x0F00; i < 0xFFFF; ++i)
456 "BROKEN vector compression: %s -> %s -> %s",
469 traceline(v0, v0 + dvx,
true, forent);
if(
trace_fraction < 1)
return 0;
470 traceline(v0, v0 + dvy,
true, forent);
if(
trace_fraction < 1)
return 0;
471 traceline(v0, v0 + dvz,
true, forent);
if(
trace_fraction < 1)
return 0;
472 traceline(v0 + dvx, v0 + dvx + dvy,
true, forent);
if(
trace_fraction < 1)
return 0;
473 traceline(v0 + dvx, v0 + dvx + dvz,
true, forent);
if(
trace_fraction < 1)
return 0;
474 traceline(v0 + dvy, v0 + dvy + dvx,
true, forent);
if(
trace_fraction < 1)
return 0;
475 traceline(v0 + dvy, v0 + dvy + dvz,
true, forent);
if(
trace_fraction < 1)
return 0;
476 traceline(v0 + dvz, v0 + dvz + dvx,
true, forent);
if(
trace_fraction < 1)
return 0;
477 traceline(v0 + dvz, v0 + dvz + dvy,
true, forent);
if(
trace_fraction < 1)
return 0;
478 traceline(v0 + dvx + dvy, v0 + dvx + dvy + dvz,
true, forent);
if(
trace_fraction < 1)
return 0;
479 traceline(v0 + dvx + dvz, v0 + dvx + dvy + dvz,
true, forent);
if(
trace_fraction < 1)
return 0;
480 traceline(v0 + dvy + dvz, v0 + dvx + dvy + dvz,
true, forent);
if(
trace_fraction < 1)
return 0;
485 string fixPriorityList(
string order,
float from,
float to,
float subtract,
float complete)
492 for(i = 0; i < n; ++i)
497 if(w >= from && w <= to)
502 if(w >= from && w <= to)
511 for(w = to; w >= from; --w)
516 for(i = 0; i < n; ++i)
534 for(
float i = 0; i < n; ++i)
535 neworder =
strcat(neworder, mapfunc(
argv(i)),
" ");
544 if(i >= 0 && i < n && j >= 0 && j < n && i != j)
547 for(
float w = 0; w < n; ++w)
563 void get_mi_min_max(
float mode)
596 tracebox(
'1 0 0' * mi.x,
597 '0 1 0' * mi.y +
'0 0 1' * mi.z,
598 '0 1 0' * ma.y +
'0 0 1' * ma.z,
605 tracebox(
'0 1 0' * mi.y,
606 '1 0 0' * mi.x +
'0 0 1' * mi.z,
607 '1 0 0' * ma.x +
'0 0 1' * ma.z,
614 tracebox(
'0 0 1' * mi.z,
615 '1 0 0' * mi.x +
'0 1 0' * mi.y,
616 '1 0 0' * ma.x +
'0 1 0' * ma.y,
623 tracebox(
'1 0 0' * ma.x,
624 '0 1 0' * mi.y +
'0 0 1' * mi.z,
625 '0 1 0' * ma.y +
'0 0 1' * ma.z,
632 tracebox(
'0 1 0' * ma.y,
633 '1 0 0' * mi.x +
'0 0 1' * mi.z,
634 '1 0 0' * ma.x +
'0 0 1' * ma.z,
641 tracebox(
'0 0 1' * ma.z,
642 '1 0 0' * mi.x +
'0 1 0' * mi.y,
643 '1 0 0' * ma.x +
'0 1 0' * ma.y,
653 void get_mi_min_max_texcoords(
float mode)
657 get_mi_min_max(mode);
664 extend = mi_picmax - mi_picmin;
665 if(extend.y > extend.x)
667 mi_picmin.x -= (extend.y - extend.x) * 0.5;
668 mi_picmax.x += (extend.y - extend.x) * 0.5;
672 mi_picmin.y -= (extend.x - extend.y) * 0.5;
673 mi_picmax.y += (extend.x - extend.y) * 0.5;
677 extend = (mi_picmax - mi_picmin) * (1 / 64.0);
682 mi_pictexcoord0 = mi_pictexcoord1 = mi_pictexcoord2 = mi_pictexcoord3 =
'0 0 0';
684 mi_pictexcoord0_x = (mi_min.x - mi_picmin.x) / (mi_picmax.x - mi_picmin.x);
685 mi_pictexcoord0_y = (mi_min.y - mi_picmin.y) / (mi_picmax.y - mi_picmin.y);
686 mi_pictexcoord2_x = (mi_max.x - mi_picmin.x) / (mi_picmax.x - mi_picmin.x);
687 mi_pictexcoord2_y = (mi_max.y - mi_picmin.y) / (mi_picmax.y - mi_picmin.y);
689 mi_pictexcoord1_x = mi_pictexcoord0_x;
690 mi_pictexcoord1_y = mi_pictexcoord2_y;
691 mi_pictexcoord3_x = mi_pictexcoord2_x;
692 mi_pictexcoord3_y = mi_pictexcoord0_y;
698 float created_saved_value;
700 created_saved_value = 0;
702 if (!(tmp_cvar || tmp_value))
704 LOG_TRACE(
"Error: Invalid usage of cvar_settemp(string, string); !");
708 if(!cvar_type(tmp_cvar))
710 LOG_INFOF(
"Error: cvar %s doesn't exist!", tmp_cvar);
716 created_saved_value = -1;
720 if(created_saved_value != -1)
727 created_saved_value = 1;
733 return created_saved_value;
743 if(cvar_type(it.netname))
745 cvar_set(it.netname, it.message);
746 strunzone(it.netname);
747 strunzone(it.message);
752 LOG_INFOF(
"Error: cvar %s doesn't exist anymore! It can still be restored once it's manually recreated.", it.netname);
759 if(cvar_type(e.netname))
766 print(sprintf(
"Error: cvar %s doesn't exist anymore! It can still be restored once it's manually recreated.", e.netname));
780 if(w(theText, theSize) <= maxWidth)
783 bool colors = (w(
"^7", theSize) == 0);
786 int len, left, right, middle;
788 right = len =
strlen(theText);
792 middle =
floor((left + right) / 2);
796 ofs = (res.x) ? res.x - res.y : 0;
799 if(w(
substring(theText, 0, middle + ofs), theSize) <= maxWidth)
804 while(left < right - 1);
816 if(w(theText) <= maxWidth)
819 bool colors = (w(
"^7") == 0);
822 int len, left, right, middle;
824 right = len =
strlen(theText);
828 middle =
floor((left + right) / 2);
832 ofs = (!res.x) ? 0 : res.x - res.y;
835 if(w(
substring(theText, 0, middle + ofs)) <= maxWidth)
840 while(left < right - 1);
851 for(
int i = len; i >= start; --i)
857 while (i-carets >= start &&
substring(s, i-carets, 1) ==
"^")
891 if(take_until > 0 && take_until <
strlen(s))
893 int last_word = take_until - 1;
894 while(last_word > 0 &&
substring(s, last_word, 1) !=
" ")
900 take_until = last_word;
907 else if (tw(
"^7", theFontSize) == 0)
929 if(take_until > 0 && take_until <
strlen(s))
931 int last_word = take_until - 1;
932 while(last_word > 0 &&
substring(s, last_word, 1) !=
" ")
938 take_until = last_word;
945 else if (tw(
"^7") == 0)
958 if(tw(theText, theFontSize) <= maxWidth)
966 if(tw(theText) <= maxWidth)
974 string subpattern, subpattern2, subpattern3, subpattern4;
977 subpattern2 =
",teams,";
979 subpattern2 =
",noteams,";
981 subpattern3 =
",teamspawns,";
983 subpattern3 =
",noteamspawns,";
984 if(gt == MAPINFO_TYPE_RACE || gt == MAPINFO_TYPE_CTS)
985 subpattern4 =
",race,";
998 if(subpattern4 &&
strstrofs(
strcat(
",", pattern,
","), subpattern4, 0) >= 0)
1047 else if(solution.x > 0)
1051 ret =
normalize(eorg + solution.x * evel);
1053 else if(solution.y > 0)
1057 ret =
normalize(eorg + solution.y * evel);
1075 if(newton_style == 2)
1086 if(newton_style == 2)
1105 outspeed = solution.y;
1109 outspeed = solution.x;
1113 outspeed =
bound(spd * mi, outspeed, spd * ma);
1114 return mydir * outspeed;
1118 return myvel + spd * mydir;
1123 float rx =
rint(v.x * 2);
1124 float ry =
rint(v.y * 4) + 128;
1125 float rz =
rint(v.z * 4) + 128;
1126 if(rx > 255 || rx < 0)
1129 rx =
bound(0, rx, 255);
1131 if(ry > 255 || ry < 0)
1134 ry =
bound(0, ry, 255);
1136 if(rz > 255 || rz < 0)
1139 rz =
bound(0, rz, 255);
1141 return rx * 0x10000 + ry * 0x100 + rz;
1146 v.x = ((f & 0xFF0000) / 0x10000) / 2;
1147 v.y = ((f & 0xFF00) / 0x100 - 128) / 4;
1148 v.z = ((f & 0xFF) - 128) / 4;
1153 vector healtharmor_maxdamage(
float h,
float a,
float armorblock,
int deathtype)
1156 float healthdamage, armordamage, armorideal;
1157 if (
DEATH_IS(deathtype, DEATH_DROWN))
1160 healthdamage = (h - 1) / (1 - armorblock);
1161 armordamage = a + (h - 1);
1162 armorideal = healthdamage * armorblock;
1164 if(armordamage < healthdamage)
1177 vector healtharmor_applydamage(
float a,
float armorblock,
int deathtype,
float damage)
1180 if (
DEATH_IS(deathtype, DEATH_DROWN))
1184 v.y =
bound(0, damage * armorblock, a);
1185 v.x =
bound(0, damage - v.y, damage);
1210 t =
car(acl); acl =
cdr(acl);
1250 m =
"models/player/*_";
1255 return strcat(m,
".", fil);
1312 while((s =
fgets(fh)))
1333 if (s ==
"Male") s = _(
"Male");
1334 else if (s ==
"Female") s = _(
"Female");
1335 else if (s ==
"Undisclosed") s = _(
"Undisclosed");
1342 if(c ==
"description")
1344 if(c ==
"bone_upperbody")
1346 if(c ==
"bone_weapon")
1363 while((s =
fgets(fh)))
1382 if (key ==
"<KEY NOT FOUND>")
return _(
"<KEY NOT FOUND>");
1383 if (key ==
"<UNKNOWN KEYNUM>")
return _(
"<UNKNOWN KEYNUM>");
1388 case "TAB":
return _(
"TAB");
1389 case "ENTER":
return _(
"ENTER");
1390 case "ESCAPE":
return _(
"ESCAPE");
1391 case "SPACE":
return _(
"SPACE");
1393 case "BACKSPACE":
return _(
"BACKSPACE");
1394 case "UPARROW":
return _(
"UPARROW");
1395 case "DOWNARROW":
return _(
"DOWNARROW");
1396 case "LEFTARROW":
return _(
"LEFTARROW");
1397 case "RIGHTARROW":
return _(
"RIGHTARROW");
1399 case "ALT":
return _(
"ALT");
1400 case "CTRL":
return _(
"CTRL");
1401 case "SHIFT":
return _(
"SHIFT");
1403 case "INS":
return _(
"INS");
1404 case "DEL":
return _(
"DEL");
1405 case "PGDN":
return _(
"PGDN");
1406 case "PGUP":
return _(
"PGUP");
1407 case "HOME":
return _(
"HOME");
1408 case "END":
return _(
"END");
1410 case "PAUSE":
return _(
"PAUSE");
1412 case "NUMLOCK":
return _(
"NUMLOCK");
1413 case "CAPSLOCK":
return _(
"CAPSLOCK");
1414 case "SCROLLOCK":
return _(
"SCROLLOCK");
1416 case "SEMICOLON":
return _(
"SEMICOLON");
1417 case "TILDE":
return _(
"TILDE");
1418 case "BACKQUOTE":
return _(
"BACKQUOTE");
1419 case "QUOTE":
return _(
"QUOTE");
1420 case "APOSTROPHE":
return _(
"APOSTROPHE");
1421 case "BACKSLASH":
return _(
"BACKSLASH");
1429 return sprintf(_(
"F%d"),
stof(subkey));
1439 return sprintf(_(
"KP_%d"),
stof(subkey));
1444 case "INS":
return sprintf(_(
"KP_%s"), _(
"INS"));
1445 case "END":
return sprintf(_(
"KP_%s"), _(
"END"));
1446 case "DOWNARROW":
return sprintf(_(
"KP_%s"), _(
"DOWNARROW"));
1447 case "PGDN":
return sprintf(_(
"KP_%s"), _(
"PGDN"));
1448 case "LEFTARROW":
return sprintf(_(
"KP_%s"), _(
"LEFTARROW"));
1449 case "RIGHTARROW":
return sprintf(_(
"KP_%s"), _(
"RIGHTARROW"));
1450 case "HOME":
return sprintf(_(
"KP_%s"), _(
"HOME"));
1451 case "UPARROW":
return sprintf(_(
"KP_%s"), _(
"UPARROW"));
1452 case "PGUP":
return sprintf(_(
"KP_%s"), _(
"PGUP"));
1453 case "PERIOD":
return sprintf(_(
"KP_%s"), _(
"PERIOD"));
1454 case "DEL":
return sprintf(_(
"KP_%s"), _(
"DEL"));
1455 case "DIVIDE":
return sprintf(_(
"KP_%s"), _(
"DIVIDE"));
1456 case "SLASH":
return sprintf(_(
"KP_%s"), _(
"SLASH"));
1457 case "MULTIPLY":
return sprintf(_(
"KP_%s"), _(
"MULTIPLY"));
1458 case "MINUS":
return sprintf(_(
"KP_%s"), _(
"MINUS"));
1459 case "PLUS":
return sprintf(_(
"KP_%s"), _(
"PLUS"));
1460 case "ENTER":
return sprintf(_(
"KP_%s"), _(
"ENTER"));
1461 case "EQUALS":
return sprintf(_(
"KP_%s"), _(
"EQUALS"));
1462 default:
return key;
1466 if (key ==
"PRINTSCREEN")
return _(
"PRINTSCREEN");
1471 if (key ==
"MWHEELUP")
return _(
"MWHEELUP");
1472 if (key ==
"MWHEELDOWN")
return _(
"MWHEELDOWN");
1485 case "DPAD_UP":
return sprintf(_(
"X360_%s"), _(
"DPAD_UP"));
1486 case "DPAD_DOWN":
return sprintf(_(
"X360_%s"), _(
"DPAD_DOWN"));
1487 case "DPAD_LEFT":
return sprintf(_(
"X360_%s"), _(
"DPAD_LEFT"));
1488 case "DPAD_RIGHT":
return sprintf(_(
"X360_%s"), _(
"DPAD_RIGHT"));
1489 case "START":
return sprintf(_(
"X360_%s"), _(
"START"));
1490 case "BACK":
return sprintf(_(
"X360_%s"), _(
"BACK"));
1491 case "LEFT_THUMB":
return sprintf(_(
"X360_%s"), _(
"LEFT_THUMB"));
1492 case "RIGHT_THUMB":
return sprintf(_(
"X360_%s"), _(
"RIGHT_THUMB"));
1493 case "LEFT_SHOULDER":
return sprintf(_(
"X360_%s"), _(
"LEFT_SHOULDER"));
1494 case "RIGHT_SHOULDER":
return sprintf(_(
"X360_%s"), _(
"RIGHT_SHOULDER"));
1495 case "LEFT_TRIGGER":
return sprintf(_(
"X360_%s"), _(
"LEFT_TRIGGER"));
1496 case "RIGHT_TRIGGER":
return sprintf(_(
"X360_%s"), _(
"RIGHT_TRIGGER"));
1497 case "LEFT_THUMB_UP":
return sprintf(_(
"X360_%s"), _(
"LEFT_THUMB_UP"));
1498 case "LEFT_THUMB_DOWN":
return sprintf(_(
"X360_%s"), _(
"LEFT_THUMB_DOWN"));
1499 case "LEFT_THUMB_LEFT":
return sprintf(_(
"X360_%s"), _(
"LEFT_THUMB_LEFT"));
1500 case "LEFT_THUMB_RIGHT":
return sprintf(_(
"X360_%s"), _(
"LEFT_THUMB_RIGHT"));
1501 case "RIGHT_THUMB_UP":
return sprintf(_(
"X360_%s"), _(
"RIGHT_THUMB_UP"));
1502 case "RIGHT_THUMB_DOWN":
return sprintf(_(
"X360_%s"), _(
"RIGHT_THUMB_DOWN"));
1503 case "RIGHT_THUMB_LEFT":
return sprintf(_(
"X360_%s"), _(
"RIGHT_THUMB_LEFT"));
1504 case "RIGHT_THUMB_RIGHT":
return sprintf(_(
"X360_%s"), _(
"RIGHT_THUMB_RIGHT"));
1505 default:
return key;
1514 case "UP":
return sprintf(_(
"JOY_%s"), _(
"UP"));
1515 case "DOWN":
return sprintf(_(
"JOY_%s"), _(
"DOWN"));
1516 case "LEFT":
return sprintf(_(
"JOY_%s"), _(
"LEFT"));
1517 case "RIGHT":
return sprintf(_(
"JOY_%s"), _(
"RIGHT"));
1518 default:
return key;
1523 return sprintf(_(
"MIDINOTE%d"),
stof(
substring(key, 8, -1)));
1534 d = f % 22; f =
floor(f / 22);
1535 c = f % 22; f =
floor(f / 22);
1536 b = f % 22; f =
floor(f / 22);
1557 if(a < 0 || b < 0 || c < 0 || d < 0)
1559 return ((a * 22 + b) * 22 + c) * 22 + d;
1576 void CSQC_Shutdown()
1582 if(shutdown_running)
1584 LOG_INFO(
"Recursive shutdown detected! Only restoring cvars...");
1588 shutdown_running = 1;
1596 .float skeleton_bones_index;
1597 void Skeleton_SetBones(
entity e)
1600 if(e.skeleton_bones_index == e.modelindex)
1604 skelindex = skel_create(e.modelindex);
1605 e.skeleton_bones = skel_get_numbones(skelindex);
1606 skel_delete(skelindex);
1607 e.skeleton_bones_index = e.modelindex;
1614 if(to_execute_next_frame)
1616 localcmd(
"\n", to_execute_next_frame,
"\n");
1617 strfree(to_execute_next_frame);
1622 if(to_execute_next_frame)
1624 s =
strcat(s,
"\n", to_execute_next_frame);
1626 strcpy(to_execute_next_frame, s);
1632 entity queue_start, queue_end;
1638 if(e.FindConnectedComponent_processing)
1639 error(
"recursion or broken cleanup");
1642 queue_start = queue_end = e;
1643 queue_end.(fld) =
NULL;
1644 queue_end.FindConnectedComponent_processing = 1;
1647 for (; queue_start; queue_start = queue_start.(fld))
1651 for(t =
NULL; (t = nxt(t, queue_start, pass)); )
1653 if(t.FindConnectedComponent_processing)
1655 if(iscon(t, queue_start, pass))
1658 queue_end.(fld) = t;
1660 queue_end.(fld) =
NULL;
1661 queue_end.FindConnectedComponent_processing = 1;
1667 for (queue_start = e; queue_start; queue_start = queue_start.(fld))
1668 queue_start.FindConnectedComponent_processing = 0;
1677 float dur = frameduration(e.modelindex, a.x);
1678 if (dur <= 0 && b.y)
1681 dur = frameduration(e.modelindex, a.x);
1700 case 10:
return ANNCE_NUM_GAMESTART_10;
1701 case 9:
return ANNCE_NUM_GAMESTART_9;
1702 case 8:
return ANNCE_NUM_GAMESTART_8;
1703 case 7:
return ANNCE_NUM_GAMESTART_7;
1704 case 6:
return ANNCE_NUM_GAMESTART_6;
1705 case 5:
return ANNCE_NUM_GAMESTART_5;
1706 case 4:
return ANNCE_NUM_GAMESTART_4;
1707 case 3:
return ANNCE_NUM_GAMESTART_3;
1708 case 2:
return ANNCE_NUM_GAMESTART_2;
1709 case 1:
return ANNCE_NUM_GAMESTART_1;
1717 case 10:
return ANNCE_NUM_KILL_10;
1718 case 9:
return ANNCE_NUM_KILL_9;
1719 case 8:
return ANNCE_NUM_KILL_8;
1720 case 7:
return ANNCE_NUM_KILL_7;
1721 case 6:
return ANNCE_NUM_KILL_6;
1722 case 5:
return ANNCE_NUM_KILL_5;
1723 case 4:
return ANNCE_NUM_KILL_4;
1724 case 3:
return ANNCE_NUM_KILL_3;
1725 case 2:
return ANNCE_NUM_KILL_2;
1726 case 1:
return ANNCE_NUM_KILL_1;
1734 case 10:
return ANNCE_NUM_RESPAWN_10;
1735 case 9:
return ANNCE_NUM_RESPAWN_9;
1736 case 8:
return ANNCE_NUM_RESPAWN_8;
1737 case 7:
return ANNCE_NUM_RESPAWN_7;
1738 case 6:
return ANNCE_NUM_RESPAWN_6;
1739 case 5:
return ANNCE_NUM_RESPAWN_5;
1740 case 4:
return ANNCE_NUM_RESPAWN_4;
1741 case 3:
return ANNCE_NUM_RESPAWN_3;
1742 case 2:
return ANNCE_NUM_RESPAWN_2;
1743 case 1:
return ANNCE_NUM_RESPAWN_1;
1747 case CNT_ROUNDSTART:
1751 case 10:
return ANNCE_NUM_ROUNDSTART_10;
1752 case 9:
return ANNCE_NUM_ROUNDSTART_9;
1753 case 8:
return ANNCE_NUM_ROUNDSTART_8;
1754 case 7:
return ANNCE_NUM_ROUNDSTART_7;
1755 case 6:
return ANNCE_NUM_ROUNDSTART_6;
1756 case 5:
return ANNCE_NUM_ROUNDSTART_5;
1757 case 4:
return ANNCE_NUM_ROUNDSTART_4;
1758 case 3:
return ANNCE_NUM_ROUNDSTART_3;
1759 case 2:
return ANNCE_NUM_ROUNDSTART_2;
1760 case 1:
return ANNCE_NUM_ROUNDSTART_1;
1769 case 10:
return ANNCE_NUM_10;
1770 case 9:
return ANNCE_NUM_9;
1771 case 8:
return ANNCE_NUM_8;
1772 case 7:
return ANNCE_NUM_7;
1773 case 6:
return ANNCE_NUM_6;
1774 case 5:
return ANNCE_NUM_5;
1775 case 4:
return ANNCE_NUM_4;
1776 case 3:
return ANNCE_NUM_3;
1777 case 2:
return ANNCE_NUM_2;
1778 case 1:
return ANNCE_NUM_1;
1787 int Mod_Q1BSP_SuperContentsFromNativeContents(
int nativecontents)
1789 switch(nativecontents)
1807 int Mod_Q1BSP_NativeContentsFromSuperContents(
int supercontents)
1824 void attach_sameorigin(
entity e,
entity to,
string tag)
1826 vector org, t_forward, t_left, t_up, e_forward, e_up;
1833 t_up =
v_up * tagscale;
1835 e.origin_x = org * t_forward;
1836 e.origin_y = org * t_left;
1837 e.origin_z = org * t_up;
1850 e_up.x =
v_up * t_forward;
1851 e_up.y =
v_up * t_left;
1852 e_up.z =
v_up * t_up;
1860 setattachment(e, to, tag);
1864 void detach_sameorigin(
entity e)
1874 setattachment(e,
NULL,
"");
1882 e.punchangle = to.angles;
1883 e.view_ofs = e.origin - to.origin;
1884 e.v_angle = e.angles - to.angles;
1889 void unfollow_sameorigin(
entity e)
1895 .string aiment_classname;
1896 .float aiment_deadflag;
1903 ent.punchangle = e.angles;
1904 ent.view_ofs = ent.origin - e.origin;
1905 ent.v_angle = ent.angles - e.angles;
1906 ent.aiment_classname =
strzone(e.classname);
1907 ent.aiment_deadflag = e.deadflag;
1912 ent.view_ofs.x =
bound(pl.mins.x + 4, ent.view_ofs.x, pl.maxs.x - 4);
1913 ent.view_ofs.y =
bound(pl.mins.y + 4, ent.view_ofs.y, pl.maxs.y - 4);
1914 ent.view_ofs.z =
bound(pl.mins.z + 4, ent.view_ofs.z, pl.maxs.z - 4);
1918 void UnsetMovetypeFollow(
entity ent)
1922 if (ent.aiment_classname)
1929 int LostMovetypeFollow(
entity ent)
1940 if(ent.aiment.classname != ent.aiment_classname || ent.aiment.deadflag != ent.aiment_deadflag)
1948 string playername(
string thename,
int teamid,
bool team_colorize)
1951 bool do_colorize = (
teamplay && team_colorize);
1959 return strcat(t, strdecolorize(thename));
1965 float trace_hits_box_a0, trace_hits_box_a1;
1967 float trace_hits_box_1d(
float end,
float thmi,
float thma)
1981 trace_hits_box_a0 =
max(trace_hits_box_a0,
min(thmi / end, thma / end));
1982 trace_hits_box_a1 =
min(trace_hits_box_a1,
max(thmi / end, thma / end));
1983 if (trace_hits_box_a0 > trace_hits_box_a1)
1996 trace_hits_box_a0 = 0;
1997 trace_hits_box_a1 = 1;
1999 if (!trace_hits_box_1d(end.x, thmi.x, thma.x))
2001 if (!trace_hits_box_1d(end.y, thmi.y, thma.y))
2003 if (!trace_hits_box_1d(end.z, thmi.z, thma.z))
2011 return trace_hits_box(start, end, thmi - ma, thma - mi);
2032 float blink_synced(
float base,
float range,
float freq,
float start_time,
int start_pos)
2040 return base + range *
sin((
time - start_time - (
M_PI / 2) * start_pos) * freq);
2044 float blink(
float base,
float range,
float freq)
float get_model_parameters_weight
string MapInfo_Type_ToString(Gametype t)
string get_model_datafilename(string m, float sk, string fil)
#define IL_EACH(this, cond, body)
string get_model_parameters_desc
float compressShortVector(vector vec)
string find_last_color_code(string s)
ERASEABLE vector solve_quadratic(float a, float b, float c)
ax^2 + bx + c = 0
#define PROJECTILE_MAKETRIGGER(e)
string getWrappedLine_remaining
ERASEABLE float blink(float base, float range, float freq)
const int SPECIES_ROBOT_RUSTY
float FindConnectedComponent_processing
float get_model_parameters(string m, float sk)
float textLengthUpToWidth(string theText, float maxWidth, vector theSize, textLengthUpToWidth_widthFunction_t w)
void wordwrap_buffer_put(string s)
STATIC_INIT(compressShortVector)
float cvar_settemp(string tmp_cvar, string tmp_value)
const int SFL_HIDE_ZERO
Don't show zero values as scores.
float(entity a, entity b, entity pass) isConnectedFunction_t
string get_model_parameters_description
entity(entity cur, entity near, entity pass) findNextEntityNearFunction_t
#define REGISTRY_GET(id, i)
ERASEABLE float cvar_or(string cv, float v)
void depthfirst(entity start,.entity up,.entity downleft,.entity right, void(entity, entity) funcPre, void(entity, entity) funcPost, entity pass)
ERASEABLE string cdr(string s)
returns all but first word
const float CONTENT_SOLID
void FindConnectedComponent(entity e,.entity fld, findNextEntityNearFunction_t nxt, isConnectedFunction_t iscon, entity pass)
string getWrappedLineLen(float w, textLengthUpToLength_lenFunction_t tw)
string textShortenToLength(string theText, float maxWidth, textLengthUpToLength_lenFunction_t tw)
string textShortenToWidth(string theText, float maxWidth, vector theFontSize, textLengthUpToWidth_widthFunction_t tw)
float get_model_parameters_fixbone
ERASEABLE string car(string s)
returns first word
float matchacl(string acl, string str)
string mapPriorityList(string order, string(string) mapfunc)
#define TIME_ENCODED_TOSTRING(n)
const int SFL_RANK
Display as a rank (with st, nd, rd, th suffix)
vector decompressShotOrigin(int f)
string draw_UseSkinFor(string pic)
float compressShotOrigin(vector v)
string get_model_parameters_sex
float(string s, vector size) textLengthUpToWidth_widthFunction_t
ERASEABLE string count_ordinal(int interval)
const float CONTENT_EMPTY
#define FOREACH_ENTITY_CLASS(class, cond, body)
float get_model_parameters_age
float get_model_parameters_modelskin
const int HITTYPE_ARMORPIERCE
ERASEABLE void write_String_To_File(int fh, string str, bool alsoprint)
float invertLengthLog(float dist)
float lengthLogTable[128]
float get_model_parameters_species
float textLengthUpToLength(string theText, float maxWidth, textLengthUpToLength_lenFunction_t w)
string get_model_parameters_modelname
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
const float CONTENT_SLIME
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
string get_model_parameters_bone_aim[MAX_AIM_BONES]
const float CONTENT_WATER
int MapInfo_Get_ByName(string pFilename, float pAllowGenerate, Gametype pGametypeToSet)
float isGametypeInFilter(Gametype gt, float tp, float ts, string pattern)
string fixPriorityList(string order, float from, float to, float subtract, float complete)
string to_execute_next_frame
string swapInPriorityList(string order, float i, float j)
const int SPECIES_ROBOT_SHINY
vector decompressShortVector(int data)
ERASEABLE float blink_synced(float base, float range, float freq, float start_time, int start_pos)
string get_model_parameters_bone_weapon
vector(float skel, float bonenum) _skel_get_boneabs_hidden
string get_model_parameters_bone_upperbody
const int SPECIES_RESERVED
vector solve_shotdirection(vector myorg, vector myvel, vector eorg, vector evel, float spd, float newton_style)
string wordwrap(string s, float l)
string Team_ColorCode(int teamid)
const int WEP_FLAG_SPECIALATTACK
entity Notification
always last
ERASEABLE vector checkColorCode(string theText, int text_len, int pos, bool check_at_the_end)
const int SPECIES_ROBOT_SOLID
#define MUTATOR_CALLHOOK(id,...)
#define new_pure(class)
purely logical entities (.origin doesn't work)
IntrusiveList g_saved_cvars
bool intermission_running
float(string s) textLengthUpToLength_lenFunction_t
bool get_model_parameters_hidden
void execute_next_frame()
float get_model_parameters_bone_aimweight[MAX_AIM_BONES]
int cvar_settemp_restore()
string getWrappedLine(float w, vector theFontSize, textLengthUpToWidth_widthFunction_t tw)
#define pass(name, colormin, colormax)
string translate_key(string key)
vector get_shotvelocity(vector myvel, vector mydir, float spd, float newton_style, float mi, float ma)
const int SFL_TIME
Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!) ...
void set_movetype(entity this, int mt)
void wordwrap_cb(string s, float l, void(string) callback)
void queue_to_execute_next_frame(string s)
string get_model_parameters_name