*.icns -crlf -diff
*.ico -crlf -diff
*.idsoftware crlf=input
+*.iqm -crlf -diff
*.inc crlf=input
*.instantaction crlf=input
*.java crlf=input
alias allready "sv_cmd allready"
-// note: these cvars use weapon NUMBERS. Use the menu to edit this cvar, or look the numbers up in qcsrc/common/constants.qh.
seta cl_weaponpriority "minstanex rocketlauncher nex grenadelauncher fireball hlac hagar seeker crylink campingrifle uzi electro tuba shotgun laser hook porto" "weapon priority list"
seta cl_weaponpriority_useforcycling 0 "when set, weapon cycling by the mouse wheel makes use of the weapon priority list (the special value 2 uses the weapon ID list for cycling)"
seta cl_weaponpriority0 "rocketlauncher grenadelauncher hagar seeker fireball" "use impulse 200 for prev gun from this list, 210 for best gun, 220 for next gun. Default value: explosives"
const float K_ALT = 132;
const float K_CTRL = 133;
const float K_SHIFT = 134;
+
const float K_F1 = 135;
const float K_F2 = 136;
const float K_F3 = 137;
const float K_F10 = 144;
const float K_F11 = 145;
const float K_F12 = 146;
+
const float K_INS = 147;
const float K_DEL = 148;
const float K_PGDN = 149;
const float K_HOME = 151;
const float K_END = 152;
-const float K_KP_HOME = 160;
-const float K_KP_UPARROW = 161;
-const float K_KP_PGUP = 162;
-const float K_KP_LEFTARROW = 163;
-const float K_KP_5 = 164;
-const float K_KP_RIGHTARROW = 165;
-const float K_KP_END = 166;
-const float K_KP_DOWNARROW = 167;
-const float K_KP_PGDN = 168;
-const float K_KP_ENTER = 169;
-const float K_KP_INS = 170;
-const float K_KP_DEL = 171;
-const float K_KP_SLASH = 172;
-const float K_KP_MINUS = 173;
-const float K_KP_PLUS = 174;
+const float K_NUMLOCK = 154;
+const float K_CAPSLOCK = 155;
+const float K_SCROLLOCK = 156;
+
+const float K_KP_0 = 157;
+const float K_KP_INS = K_KP_0;
+const float K_KP_1 = 158;
+const float K_KP_END = K_KP_1;
+const float K_KP_2 = 159;
+const float K_KP_DOWNARROW = K_KP_2;
+const float K_KP_3 = 160;
+const float K_KP_PGDN = K_KP_3;
+const float K_KP_4 = 161;
+const float K_KP_LEFTARROW = K_KP_4;
+const float K_KP_5 = 162;
+const float K_KP_6 = 163;
+const float K_KP_RIGHTARROW = K_KP_6;
+const float K_KP_7 = 164;
+const float K_KP_HOME = K_KP_7;
+const float K_KP_8 = 165;
+const float K_KP_UPARROW = K_KP_8;
+const float K_KP_9 = 166;
+const float K_KP_PGUP = K_KP_9;
+const float K_KP_PERIOD = 167;
+const float K_KP_DEL = K_KP_PERIOD;
+const float K_KP_DIVIDE = 168;
+const float K_KP_SLASH = K_KP_DIVIDE;
+const float K_KP_MULTIPLY = 169;
+const float K_KP_MINUS = 170;
+const float K_KP_PLUS = 171;
+const float K_KP_ENTER = 172;
+const float K_KP_EQUALS = 173;
const float K_PAUSE = 255;
}
switch(key)
{
+ case K_KP_LEFTARROW:
case K_LEFTARROW:
me.cursorPos -= 1;
return 1;
+ case K_KP_RIGHTARROW:
case K_RIGHTARROW:
me.cursorPos += 1;
return 1;
+ case K_KP_HOME:
case K_HOME:
me.cursorPos = 0;
return 1;
+ case K_KP_END:
case K_END:
me.cursorPos = strlen(me.text);
return 1;
me.setText(me, strcat(substring(me.text, 0, me.cursorPos), substring(me.text, me.cursorPos + 1, strlen(me.text) - me.cursorPos - 1)));
}
return 1;
+ case K_KP_DEL:
case K_DEL:
if(shift & S_CTRL)
me.setText(me, "");
me.scrollPos = min(me.scrollPos + 0.5, me.nItems * me.itemHeight - 1);
me.setSelected(me, max(me.selectedItem, ceil(me.scrollPos / me.itemHeight)));
}
- else if(key == K_PGUP)
+ else if(key == K_PGUP || key == K_KP_PGUP)
me.setSelected(me, me.selectedItem - 1 / me.itemHeight);
- else if(key == K_PGDN)
+ else if(key == K_PGDN || key == K_KP_PGDN)
me.setSelected(me, me.selectedItem + 1 / me.itemHeight);
- else if(key == K_UPARROW)
+ else if(key == K_UPARROW || key == K_KP_UPARROW)
me.setSelected(me, me.selectedItem - 1);
- else if(key == K_DOWNARROW)
+ else if(key == K_DOWNARROW || key == K_KP_DOWNARROW)
me.setSelected(me, me.selectedItem + 1);
- else if(key == K_HOME)
+ else if(key == K_HOME || key == K_KP_HOME)
{
me.scrollPos = 0;
me.setSelected(me, 0);
}
- else if(key == K_END)
+ else if(key == K_END || key == K_KP_END)
{
me.scrollPos = max(0, me.nItems * me.itemHeight - 1);
me.setSelected(me, me.nItems - 1);
if(me.disabled)
return 0;
inRange = (almost_in_bounds(me.valueMin, me.value, me.valueMax));
- if(key == K_LEFTARROW)
+ if(key == K_LEFTARROW || key == K_KP_LEFTARROW)
{
if(inRange)
me.setValue(me, median(me.valueMin, me.value - me.valueKeyStep, me.valueMax));
me.setValue(me, me.valueMax);
return 1;
}
- if(key == K_RIGHTARROW)
+ if(key == K_RIGHTARROW || key == K_KP_RIGHTARROW)
{
if(inRange)
me.setValue(me, median(me.valueMin, me.value + me.valueKeyStep, me.valueMax));
me.setValue(me, me.valueMin);
return 1;
}
- if(key == K_PGUP)
+ if(key == K_PGUP || key == K_KP_PGUP)
{
if(inRange)
me.setValue(me, median(me.valueMin, me.value - me.valuePageStep, me.valueMax));
me.setValue(me, me.valueMax);
return 1;
}
- if(key == K_PGDN)
+ if(key == K_PGDN || key == K_KP_PGDN)
{
if(inRange)
me.setValue(me, median(me.valueMin, me.value + me.valuePageStep, me.valueMax));
me.setValue(me, me.valueMin);
return 1;
}
- if(key == K_HOME)
+ if(key == K_HOME || key == K_KP_HOME)
{
me.setValue(me, me.valueMin);
return 1;
}
- if(key == K_END)
+ if(key == K_END || key == K_KP_END)
{
me.setValue(me, me.valueMax);
return 1;
switch(key)
{
case K_LEFTARROW:
+ case K_KP_LEFTARROW:
me.selectedCharacterCell = mod(me.selectedCharacterCell + 159, 160);
return 1;
case K_RIGHTARROW:
+ case K_KP_RIGHTARROW:
me.selectedCharacterCell = mod(me.selectedCharacterCell + 1, 160);
return 1;
case K_UPARROW:
+ case K_KP_UPARROW:
me.selectedCharacterCell = mod(me.selectedCharacterCell + 144, 160);
return 1;
case K_DOWNARROW:
+ case K_KP_DOWNARROW:
me.selectedCharacterCell = mod(me.selectedCharacterCell + 16, 160);
return 1;
case K_HOME:
+ case K_KP_HOME:
me.selectedCharacterCell = 0;
return 1;
case K_END:
+ case K_KP_END:
me.selectedCharacterCell = 159;
return 1;
case K_SPACE:
case K_ENTER:
case K_INS:
+ case K_KP_INS:
me.controlledTextbox.enterText(me.controlledTextbox, CharMap_CellToChar(me.selectedCharacterCell));
return 1;
default:
draw_CenterText(me.realUpperMargin * eY + 0.5 * eX, s, me.realFontSize, theColor, theAlpha, 0);
}
-float XonoticCreditsList_keyDown(entity me, float scan, float ascii, float shift)
+float XonoticCreditsList_keyDown(entity me, float key, float ascii, float shift)
{
float i;
me.dragScrollTimer = time;
me.scrolling = 0;
-
- if(scan == K_PGUP)
+ if(key == K_PGUP || key == K_KP_PGUP)
me.scrollPos = max(me.scrollPos - 0.5, 0);
- else if(scan == K_PGDN)
+ else if(key == K_PGDN || key == K_KP_PGDN)
me.scrollPos = min(me.scrollPos + 0.5, me.nItems * me.itemHeight - 1);
- else if(scan == K_UPARROW)
+ else if(key == K_UPARROW || key == K_KP_UPARROW)
me.scrollPos = max(me.scrollPos - me.itemHeight, 0);
- else if(scan == K_DOWNARROW)
+ else if(key == K_DOWNARROW || key == K_KP_DOWNARROW)
me.scrollPos = min(me.scrollPos + me.itemHeight, me.nItems * me.itemHeight - 1);
else
- return SUPER(XonoticCreditsList).keyDown(me, scan, ascii, shift);
+ return SUPER(XonoticCreditsList).keyDown(me, key, ascii, shift);
i = min(me.selectedItem, floor((me.scrollPos + 1) / me.itemHeight - 1));
i = max(i, ceil(me.scrollPos / me.itemHeight));
entity champion;
float warmup;
float allowed_to_spawn;
-float player_cnt;
+float ca_players;
float required_ca_players;
.float caplayer;
kh_Controller_SetThink(cvar("g_balance_keyhunt_delay_round")+(game_starttime - time), "", kh_StartRound);
if(g_arena || g_ca)
- if(champion && champion.classname == "player" && player_cnt > 1)
+ if(champion && champion.classname == "player" && player_count > 1)
UpdateFrags(champion, +1);
self = oldself;
* player when player is waiting for the countdown to finish.
* Blocks the players movement while countdown is active.
* Unblocks the player once the countdown is over.
- *
+ *
* Called in PlayerPostThink()
*/
float roundStartTime_prev; // prevent networkspam
allowed_to_spawn = 0;
- if(g_ca && (player_cnt < required_ca_players || inWarmupStage))
+ if(g_ca && (ca_players < required_ca_players || inWarmupStage))
allowed_to_spawn = 1;
msg = NEWLINES;
{
roundStartTime_prev = f;
Announce("begin");
- centerprint(self, "^1Begin!\n");
+ centerprint(self, "^1Begin!\n");
if(g_ca) {
- player_cnt = 0;
+ ca_players = 0;
- FOR_EACH_CLIENT(self) {
- if (self.classname == "player")
- player_cnt += 1;
- }
+ FOR_EACH_PLAYER(self)
+ ca_players += 1;
}
}
* This function finds out whether an arena round is over 1 player is left.
* It determines the last player who's still alive and saves it's entity reference
* in the global variable 'champion'. Then the new enemy/enemies are put into the server.
- *
+ *
* Gets called in StartFrame()
*/
void Spawnqueue_Check()
if(g_ca) {
// check the amount of spawned players in each team
float redspawned, bluespawned;
- FOR_EACH_CLIENT(self) {
- if (self.classname == "player") {
- if (self.team == COLOR_TEAM1) redspawned += 1;
- else if (self.team == COLOR_TEAM2) bluespawned += 1;
- }
+ FOR_EACH_PLAYER(self) {
+ if (self.team == COLOR_TEAM1) redspawned += 1;
+ else if (self.team == COLOR_TEAM2) bluespawned += 1;
}
required_ca_players = max(2, fabs(cvar("bot_vs_human") + 1));
- if(player_cnt < required_ca_players && (redspawned && bluespawned)) {
+ if(ca_players < required_ca_players && (redspawned && bluespawned)) {
reset_map(TRUE);
}
- else if(player_cnt < required_ca_players) {
- FOR_EACH_CLIENT(self)
- if(self.classname == "player")
+ else if(ca_players < required_ca_players) {
+ FOR_EACH_PLAYER(self)
centerprint(self, strcat("^1Need at least 1 player in each team to play CA", "^7\n"));
allowed_to_spawn = 1;
return;
}
- else if(!next_round)
- if((redspawned && bluespawned == 0) || (bluespawned && redspawned == 0)) {
+ else if(!next_round) {
+ if((redspawned && !bluespawned) || (bluespawned && !redspawned)) {
next_round = time + 5;
champion = find(world, classname, "player");
champion_team = "^4Blue team";
play2all("ctf/blue_capture.wav");
}
- FOR_EACH_CLIENT(self) centerprint(self, strcat(champion_team, "^7 wins the round.", "^7\n"));
+ FOR_EACH_CLIENT(self) centerprint(self, strcat(champion_team, "^7 wins the round.", "^7\n"));
+ }
else if(!redspawned && !bluespawned) {
FOR_EACH_CLIENT(self) centerprint(self, strcat("^7Round tied.", "^7\n"));
next_round = time + 5;
else
Violence_GibSplash_At(hitloc, force, 2, bound(0, damage, 200) / 16, self, attacker);
- if((g_arena && numspawned < 2) || (g_ca && player_cnt < required_ca_players) && !inWarmupStage)
+ if((g_arena && numspawned < 2) || (g_ca && ca_players < required_ca_players) && !inWarmupStage)
return;
if (!g_minstagib)
self.W_BallisticBullet_LeaveSolid_origin = trace_endpos;
- dst = vlen(trace_endpos - self.origin);
+ dst = max(cvar("g_ballistics_mindistance"), vlen(trace_endpos - self.origin));
// E(s) = E0 - constant * s, constant = area of bullet circle * material constant / mass
Es_m = E0_m - constant * dst;
if(Es_m <= 0)
if(--i < 1)
{
dprint("Too many warpzones in sequence, aborting trace.\n");
+ trace_ent = world;
break;
}
tracebox(org, mi, ma, end, nomonsters, forent);
if(trace_ent == wz)
{
dprint("I transformed into the same zone again, wtf, aborting the trace\n");
+ trace_ent = world;
break;
}
wz = trace_ent;
if(--i < 1)
{
dprint("Too many warpzones in sequence, aborting trace.\n");
+ trace_ent = world;
break;
}
tracetoss(e, forent);
if(trace_ent == wz)
{
dprint("I transformed into the same zone again, wtf, aborting the trace\n");
+ trace_ent = world;
break;
}
wz = trace_ent;
self.enemy = world;
}
+entity warpzone_first; .entity warpzone_next;
void WarpZone_InitStep_FindTarget()
{
float i;
entity e, e2;
+ if(self.enemy)
+ return;
+
// this way only one of the two ents needs to target
if(self.target != "")
{
+ self.enemy = self; // so the if(!e.enemy) check also skips self, saves one IF
+
e2 = world;
- for(e = world; (e = find(e, targetname, self.target)); )
+ for(e = world, i = 0; (e = find(e, targetname, self.target)); )
if(!e.enemy)
- if(random() * ++i < 1)
- e2 = e;
+ if(e.classname == self.classname) // possibly non-warpzones may use the same targetname!
+ if(random() * ++i < 1)
+ e2 = e;
if(!e2)
{
+ self.enemy = world;
error("Warpzone with non-existing target");
return;
}
WarpZone_StoreProjectileData(e);
}
-void target_warpzone_reconnect_use()
+void trigger_warpzone_reconnect_use()
{
entity e;
e = self;
self = e;
}
-void trigger_warpzone_reconnect()
+void spawnfunc_trigger_warpzone_reconnect()
+{
+ self.use = trigger_warpzone_reconnect_use;
+}
+
+void spawnfunc_target_warpzone_reconnect()
{
- self.use = target_warpzone_reconnect_use;
+ spawnfunc_trigger_warpzone_reconnect(); // both names make sense here :(
}
--- /dev/null
+electro
+fireball
+flags
+hlac
+model-common
+onslaught
+portals
+pyria
+shotgun
+spiderbot
+teamfx
+tree
+tuba
+turrets
+weapons