seta cl_zoomfactor 5 "how much +zoom will zoom (1-16)"
seta cl_zoomspeed 8 "how fast it will zoom (0.5-16), negative values mean instant zoom"
seta cl_zoomsensitivity 0 "how zoom changes sensitivity (0 = weakest, 1 = strongest)"
+
+ seta cl_unpress_zoom_on_spawn 1 "automatically unpress zoom when you spawn"
+ seta cl_unpress_zoom_on_death 1 "automatically unpress zoom when you die (and don't allow zoom again while dead)"
+ seta cl_unpress_zoom_on_weapon_switch 1 "automatically unpress zoom when you switch a weapon"
+ seta cl_unpress_attack_on_weapon_switch 1 "automatically unpress fire and fire1 attack buttons when you switch a weapon"
+
freelook 1
sensitivity 6
v_gamma 1
seta g_waypointsprite_distancefadealpha 1 "alpha multiplier near distance"
seta g_waypointsprite_distancefadescale 0.7 "scale multiplier near the distance"
seta g_waypointsprite_distancefadedistancemultiplier 0.5 "distance in map sizes from distance where to stop fading"
+seta g_waypointsprite_itemstime 2 "show waypoints to indicate that some important items (mega health, large armor) are about to respawn: 1 when spectating, 2 even playing in warmup stage"
set g_waypointsprite_spam 0 "Debugging feature. Set to 10 and load courtfun in race mode to test."
alias "g_waypointsprite_personal" "impulse 30"
alias "g_waypointsprite_personal_p" "impulse 31"
float autocvar_cl_zoomfactor;
float autocvar_cl_zoomsensitivity;
float autocvar_cl_zoomspeed;
+ var float autocvar_cl_unpress_zoom_on_spawn = 1;
+ var float autocvar_cl_unpress_zoom_on_death = 1;
+ var float autocvar_cl_unpress_zoom_on_weapon_switch = 1;
+ var float autocvar_cl_unpress_attack_on_weapon_switch = 1;
float autocvar_con_chat;
float autocvar_con_chatpos;
float autocvar_con_chatrect;
float autocvar_g_waypointsprite_edgeoffset_right;
float autocvar_g_waypointsprite_edgeoffset_top;
float autocvar_g_waypointsprite_fontsize;
+float autocvar_g_waypointsprite_itemstime;
float autocvar_g_waypointsprite_minalpha;
float autocvar_g_waypointsprite_minscale;
float autocvar_g_waypointsprite_normdistance;
float autocvar_hud_panel_healtharmor_text;
float autocvar_hud_panel_infomessages;
float autocvar_hud_panel_infomessages_flip;
+float autocvar_hud_panel_itemstime;
+float autocvar_hud_panel_itemstime_size_dinamic;
+float autocvar_hud_panel_itemstime_ratio;
+float autocvar_hud_panel_itemstime_iconalign;
+float autocvar_hud_panel_itemstime_progressbar;
+float autocvar_hud_panel_itemstime_progressbar_maxtime;
+string autocvar_hud_panel_itemstime_progressbar_name;
+float autocvar_hud_panel_itemstime_progressbar_reduced;
+float autocvar_hud_panel_itemstime_showspawned;
+float autocvar_hud_panel_itemstime_text;
float autocvar_hud_panel_modicons;
float autocvar_hud_panel_modicons_dom_layout;
float autocvar_hud_panel_notify;
}
}
+
+// ItemsTime (#17)
+//
+const float ITEMSTIME_MAXITEMS = 10;
+float ItemsTime_time[ITEMSTIME_MAXITEMS];
+string GetItemsTimePicture(float i)
+{
+ switch(i)
+ {
+ case 0: return "item_large_armor";
+ case 1: return "item_mega_health";
+ case 2: return "item_strength";
+ case 3: return "item_shield";
+ case 4: return "item_mega_health";
+ case 5: return "item_strength";
+ case 6: return "item_shield";
+ case 7: return "fuelregen";
+ case 8: return "jetpack";
+ case 9: return "superweapons";
+ default: return "";
+ }
+}
+
+void DrawItemsTimeItem(vector myPos, vector mySize, float ar, float itemcode)
+{
+ float t = 0;
+ vector color = '0 0 0';
+ float picalpha;
+ if(ItemsTime_time[itemcode] <= time)
+ {
+ float BLINK_FACTOR = 0.15;
+ float BLINK_BASE = 0.85;
+ float BLINK_FREQ = 5;
+ picalpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ);
+ }
+ else
+ {
+ picalpha = 1;
+ t = floor(ItemsTime_time[itemcode] - time + 0.999);
+ if(t < 5)
+ color = '0.7 0 0';
+ else if(t < 10)
+ color = '0.7 0.7 0';
+ else
+ color = '1 1 1';
+ }
+
+ vector picpos, numpos;
+ if(autocvar_hud_panel_itemstime_iconalign)
+ {
+ numpos = myPos;
+ picpos = myPos + eX * (ar - 1) * mySize_y;
+ }
+ else
+ {
+ numpos = myPos + eX * mySize_y;
+ picpos = myPos;
+ }
+
+ if(t > 0 && autocvar_hud_panel_itemstime_progressbar)
+ {
+ vector p_pos, p_size;
+ if(autocvar_hud_panel_itemstime_progressbar_reduced)
+ {
+ p_pos = numpos;
+ p_size = eX * ((ar - 1)/ar) * mySize_x + eY * mySize_y;
+ }
+ else
+ {
+ p_pos = myPos;
+ p_size = mySize;
+ }
+ HUD_Panel_DrawProgressBar(p_pos, p_size, autocvar_hud_panel_itemstime_progressbar_name, t/autocvar_hud_panel_itemstime_progressbar_maxtime, 0, autocvar_hud_panel_itemstime_iconalign, color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ }
+
+ if(t > 0 && autocvar_hud_panel_itemstime_text)
+ drawstring_aspect(numpos, ftos(t), eX * ((ar - 1)/ar) * mySize_x + eY * mySize_y, color, panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawpic_aspect_skin(picpos, GetItemsTimePicture(itemcode), '1 1 0' * mySize_y, '1 1 1', panel_fg_alpha * picalpha, DRAWFLAG_NORMAL);
+}
+
+void HUD_ItemsTime(void)
+{
+ if(!autocvar__hud_configure)
+ {
+ if not(autocvar_hud_panel_itemstime == 1 && spectatee_status != 0
+ || autocvar_hud_panel_itemstime == 2 && (spectatee_status != 0 || warmup_stage))
+ return;
+
+ ItemsTime_time[0] = getstatf(STAT_ARMOR_LARGE_TIME);
+ ItemsTime_time[1] = getstatf(STAT_HEALTH_MEGA_TIME);
+ ItemsTime_time[2] = getstatf(STAT_INVISIBLE_TIME);
+ ItemsTime_time[3] = getstatf(STAT_SPEED_TIME);
+ ItemsTime_time[4] = getstatf(STAT_EXTRALIFE_TIME);
+ ItemsTime_time[5] = getstatf(STAT_STRENGTH_TIME);
+ ItemsTime_time[6] = getstatf(STAT_SHIELD_TIME);
+ ItemsTime_time[7] = getstatf(STAT_FUELREGEN_TIME);
+ ItemsTime_time[8] = getstatf(STAT_JETPACK_TIME);
+ ItemsTime_time[9] = getstatf(STAT_SUPERWEAPONS_TIME);
+ }
+ else
+ {
+ hud_configure_active_panel = HUD_PANEL_ITEMSTIME;
+
+ // do not show here mutator-dependent items
+ ItemsTime_time[0] = time + 0;
+ ItemsTime_time[1] = time + 8;
+ ItemsTime_time[2] = -1; // mutator-dependent
+ ItemsTime_time[3] = -1; // mutator-dependent
+ ItemsTime_time[4] = -1; // mutator-dependent
+ ItemsTime_time[5] = time + 0;
+ ItemsTime_time[6] = time + 4;
+ ItemsTime_time[7] = time + 49;
+ ItemsTime_time[8] = -1;
+ ItemsTime_time[9] = time + 28;
+ }
+
+ float i;
+ float count = 0;
+ if (autocvar_hud_panel_itemstime_showspawned)
+ for (i = 0; i < ITEMSTIME_MAXITEMS; ++i)
+ count += (ItemsTime_time[i] != -1);
+ else
+ for (i = 0; i < ITEMSTIME_MAXITEMS; ++i)
+ count += (ItemsTime_time[i] > time);
+ if (count == 0)
+ return;
+
+ HUD_Panel_UpdateCvars(itemstime);
+ HUD_Panel_ApplyFadeAlpha();
+ vector pos, mySize;
+ pos = panel_pos;
+ mySize = panel_size;
+
+ if(panel_bg_padding)
+ {
+ pos += '1 1 0' * panel_bg_padding;
+ mySize -= '2 2 0' * panel_bg_padding;
+ }
+
+ float rows, columns;
+ float ar = max(2, autocvar_hud_panel_itemstime_ratio) + 1;
+ rows = mySize_y/mySize_x;
+ rows = bound(1, floor((sqrt(4 * ar * rows * count + rows * rows) + rows + 0.5) / 2), count);
+
+ columns = ceil(count/rows);
+
+ vector itemstime_size;
+ itemstime_size = eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows);
+
+ vector offset = '0 0 0';
+ float newSize;
+ if(autocvar_hud_panel_itemstime_size_dinamic)
+ {
+ if(autocvar__hud_configure)
+ if(menu_enabled != 2)
+ HUD_Panel_DrawBg(1); // also draw the bg of the entire panel
+
+ // reduce panel to avoid spacing items
+ if(itemstime_size_x / itemstime_size_y < ar)
+ {
+ newSize = rows * itemstime_size_x / ar;
+ pos_y += (mySize_y - newSize) / 2;
+ mySize_y = newSize;
+ itemstime_size_y = mySize_y / rows;
+ }
+ else
+ {
+ newSize = columns * itemstime_size_y * ar;
+ pos_x += (mySize_x - newSize) / 2;
+ mySize_x = newSize;
+ itemstime_size_x = mySize_x / columns;
+ }
+ panel_pos = pos - '1 1 0' * panel_bg_padding;
+ panel_size = mySize + '2 2 0' * panel_bg_padding;
+ }
+ else
+ {
+ if(itemstime_size_x/itemstime_size_y > ar)
+ {
+ newSize = ar * itemstime_size_y;
+ offset_x = itemstime_size_x - newSize;
+ pos_x += offset_x/2;
+ itemstime_size_x = newSize;
+ }
+ else
+ {
+ newSize = 1/ar * itemstime_size_x;
+ offset_y = itemstime_size_y - newSize;
+ pos_y += offset_y/2;
+ itemstime_size_y = newSize;
+ }
+ }
+
+ HUD_Panel_DrawBg(1);
+
+ float row = 0, column = 0;
+ for (i = 0; i < ITEMSTIME_MAXITEMS; ++i) {
+ if (ItemsTime_time[i] == -1)
+ continue;
+ if (!autocvar_hud_panel_itemstime_showspawned)
+ if (ItemsTime_time[i] <= time)
+ continue;
+ DrawItemsTimeItem(pos + eX * column * (itemstime_size_x + offset_x) + eY * row * (itemstime_size_y + offset_y), itemstime_size, ar, i);
+ ++row;
+ if(row >= rows)
+ {
+ row = 0;
+ column = column + 1;
+ }
+ }
+}
+
/*
==================
Main HUD system
HUD_Physics(); break;\
case (HUD_PANEL_CENTERPRINT):\
HUD_CenterPrint(); break;\
+ case (HUD_PANEL_ITEMSTIME):\
+ HUD_ItemsTime(); break;\
} ENDS_WITH_CURLY_BRACE
void HUD_Main (void)
vector color;
float hud_dock_color_team = autocvar_hud_dock_color_team;
if((teamplay) && hud_dock_color_team) {
- f = stof(getplayerkeyvalue(current_player - 1, "colors"));
- color = colormapPaletteColor(mod(f, 16), 1) * hud_dock_color_team;
+ color = colormapPaletteColor(myteam, 1) * hud_dock_color_team;
}
else if(autocvar_hud_configure_teamcolorforced && autocvar__hud_configure && hud_dock_color_team) {
color = '1 0 0' * hud_dock_color_team;
// Get value for panel_bg_color: if "" fetch default, else use panel_bg_color. Convert pants, shirt or teamcolor into a vector.
#define HUD_Panel_GetColor()\
if((teamplay) && panel_bg_color_team) {\
- panel_bg_color = colormapPaletteColor(mod(stof(getplayerkeyvalue(current_player - 1, "colors")), 16), 1) * panel_bg_color_team;\
+ panel_bg_color = colormapPaletteColor(myteam, 1) * panel_bg_color_team;\
} else if (autocvar_hud_configure_teamcolorforced && autocvar__hud_configure && panel_bg_color_team) {\
panel_bg_color = '1 0 0' * panel_bg_color_team;\
} else {\
case HUD_PANEL_INFOMESSAGES: HUD_Panel_UpdateCvars(infomessages) break; \
case HUD_PANEL_PHYSICS: HUD_Panel_UpdateCvars(physics); break;\
case HUD_PANEL_CENTERPRINT: HUD_Panel_UpdateCvars(centerprint); break;\
+ case HUD_PANEL_ITEMSTIME: HUD_Panel_UpdateCvars(itemstime); break;\
}
#define HUD_Panel_UpdateCvarsForId(id) \
case HUD_PANEL_INFOMESSAGES: HUD_Panel_UpdatePosSize(infomessages) break;\
case HUD_PANEL_PHYSICS: HUD_Panel_UpdatePosSize(physics); break;\
case HUD_PANEL_CENTERPRINT: HUD_Panel_UpdatePosSize(centerprint); break;\
+ case HUD_PANEL_ITEMSTIME: HUD_Panel_UpdatePosSize(itemstime); break;\
}
#define HUD_Panel_UpdatePosSizeForId(id) \
void PutObserverInServer();
void PutClientInServer();
+void Item_ItemsTime_Reset();
float next_round;
float redalive, bluealive, yellowalive, pinkalive;
float total_players;
/**
- * Resets the state of all clients, items, flags, runes, keys, weapons, waypoints, ... of the map.
+ * Resets the state of all clients, items, flags, keys, weapons, waypoints, ... of the map.
* Sets the 'warmup' global variable.
*/
void reset_map(float dorespawn)
race_ReadyRestart();
+ Item_ItemsTime_Reset();
+
for(self = world; (self = nextent(self)); )
if(clienttype(self) == CLIENTTYPE_NOTACLIENT)
{
if(clienttype(self) == CLIENTTYPE_REAL)
{
+ Item_ItemsTime_Get(self);
msg_entity = self;
WriteByte(MSG_ONE, SVC_SETVIEW);
WriteEntity(MSG_ONE, self);
}
- DropAllRunes(self);
MUTATOR_CALLHOOK(MakePlayerObserver);
minstagib_stop_countdown(self);
self.think = func_null;
self.nextthink = 0;
self.hook_time = 0;
- self.runes = 0;
self.deadflag = DEAD_NO;
self.angles = spot.angles;
self.angles_z = 0;
else
self.superweapons_finished = 0;
+ if(!inWarmupStage)
+ Item_ItemsTime_ResetForPlayer(self);
+
if(g_weaponarena_random)
{
if(g_weaponarena_random_with_laser)
self.metertime = 0;
- self.runes = 0;
-
self.deadflag = DEAD_NO;
self.angles = spot.angles;
Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_QUIT_DISCONNECT, self.netname);
- DropAllRunes(self);
MUTATOR_CALLHOOK(ClientDisconnect);
Portal_ClearAll(self);
max_mod = regen_mod = rot_mod = limit_mod = 1;
- if (self.runes & RUNE_REGEN)
- {
- if (self.runes & CURSE_VENOM) // do we have both rune/curse?
- {
- regen_mod = autocvar_g_balance_rune_regen_combo_regenrate;
- max_mod = autocvar_g_balance_rune_regen_combo_hpmod;
- limit_mod = autocvar_g_balance_rune_regen_combo_limitmod;
- }
- else
- {
- regen_mod = autocvar_g_balance_rune_regen_regenrate;
- max_mod = autocvar_g_balance_rune_regen_hpmod;
- limit_mod = autocvar_g_balance_rune_regen_limitmod;
- }
- }
- else if (self.runes & CURSE_VENOM)
- {
- max_mod = autocvar_g_balance_curse_venom_hpmod;
- if (self.runes & RUNE_REGEN) // do we have both rune/curse?
- rot_mod = autocvar_g_balance_rune_regen_combo_rotrate;
- else
- rot_mod = autocvar_g_balance_curse_venom_rotrate;
- limit_mod = autocvar_g_balance_curse_venom_limitmod;
- //if (!self.runes & RUNE_REGEN)
- // rot_mod = autocvar_g_balance_curse_venom_rotrate;
- }
maxh = maxh * max_mod;
//maxa = maxa * max_mod;
//maxf = maxf * max_mod;
.float species;
+.float scheduledrespawntime;
.float respawntime;
.float respawntimejitter;
//.float chasecam;
float intermission_exittime;
float alreadychangedlevel;
-
- .float runes;
-
// Keys player is holding
.float itemkeys;
// message delay for func_door locked by keys and key locks
float startitem_failed;
- void DropAllRunes(entity pl);
-
-
typedef .float floatfield;
floatfield Item_CounterField(float it);
.void (float act_state) setactive;
.entity realowner;
-float allowed_to_spawn; // boolean variable used by the clan arena code to determine if a player can spawn (after the round has ended)
+.float item_armor_large_time;
+.float item_health_mega_time;
+.float item_invisible_time;
+.float item_speed_time;
+.float item_extralife_time;
+.float item_strength_time;
+.float item_shield_time;
+.float item_fuelregen_time;
+.float item_jetpack_time;
+.float item_superweapons_time;
+float allowed_to_spawn; // boolean variable used by the clan arena code to determine if a player can spawn (after the round has ended)
float serverflags;
.float team_forced; // can be a team number to force a team, or 0 for default action, or -1 for forced spectator
BADCVAR("g_onslaught");
BADCVAR("g_race");
BADCVAR("g_race_qualifying_timelimit");
- BADCVAR("g_runematch");
BADCVAR("g_tdm");
BADCVAR("g_tdm_teams");
BADCVAR("leadlimit");
BADCVAR("g_keyhunt_point_leadlimit");
BADPREFIX("g_mod_");
BADCVAR("g_nexball_goalleadlimit");
- BADCVAR("g_runematch_point_leadlimit");
BADCVAR("leadlimit_and_fraglimit");
BADCVAR("leadlimit_override");
BADCVAR("pausable");
BADCVAR("g_mirrordamage");
BADCVAR("g_nexball_goallimit");
BADCVAR("g_powerups");
- BADCVAR("g_runematch_point_limit");
BADCVAR("g_start_delay");
BADCVAR("g_warmup");
BADCVAR("g_weapon_stay"); BADPRESUFFIX("g_", "_weapon_stay");
void Map_MarkAsRecent(string m);
float world_already_spawned;
void Nagger_Init();
+void Item_ItemsTime_Init();
void ClientInit_Spawn();
void WeaponStats_Init();
void WeaponStats_Shutdown();
addstat(STAT_HAGAR_LOAD, AS_INT, hagar_load);
+ addstat(STAT_ARMOR_LARGE_TIME, AS_FLOAT, item_armor_large_time);
+ addstat(STAT_HEALTH_MEGA_TIME, AS_FLOAT, item_health_mega_time);
+ addstat(STAT_INVISIBLE_TIME, AS_FLOAT, item_invisible_time);
+ addstat(STAT_SPEED_TIME, AS_FLOAT, item_speed_time);
+ addstat(STAT_EXTRALIFE_TIME, AS_FLOAT, item_extralife_time);
+ addstat(STAT_STRENGTH_TIME, AS_FLOAT, item_strength_time);
+ addstat(STAT_SHIELD_TIME, AS_FLOAT, item_shield_time);
+ addstat(STAT_FUELREGEN_TIME, AS_FLOAT, item_fuelregen_time);
+ addstat(STAT_JETPACK_TIME, AS_FLOAT, item_jetpack_time);
+ addstat(STAT_SUPERWEAPONS_TIME, AS_FLOAT, item_superweapons_time);
+ Item_ItemsTime_Init();
+
if(g_ca || g_freezetag)
{
addstat(STAT_REDALIVE, AS_INT, redalive_stat);