#include <client/hud/panel/centerprint.qh>
#include <client/mutators/_mod.qh>
-
#include <common/notifications/all.qh>
#include <common/stats.qh>
+#include <common/mapinfo.qh>
+
+#include <common/ent_cs.qh>
+#include <common/gamemodes/gamemode/duel/duel.qh>
bool announcer_1min;
bool announcer_5min;
int centerprint_countdown_num[CENTERPRINT_MAX_MSGS];
bool centerprint_showing;
++<<<<<<< HEAD
+float centerprint_medal_expire_time;
+string centerprint_medal_icon;
+float centerprint_medal_times;
+
+bool centerprint_title_show;
+string centerprint_title;
+
+void centerprint_ClearTitle()
+{
+ centerprint_title_show = false;
+}
+void centerprint_SetTitle(string title)
+{
+ if(title != centerprint_title) {
+ if(centerprint_title)
+ strunzone(centerprint_title);
+ centerprint_title = strzone(title);
+
+ centerprint_title_show = true;
+ }
+}
+
+void centerprint_Medal(string icon, float times)
+{
+ //LOG_INFOF("centerprint_Medal: icon: %s times: %d", icon, times);
+ //centerprint_medal_expire_time = time + autocvar_hud_panel_centerprint_time;
+ centerprint_medal_expire_time = time + MSG_MEDAL_TIME;
+ centerprint_medal_times = times;
+ if(centerprint_medal_icon)
+ strunzone(centerprint_medal_icon);
+ centerprint_medal_icon = strzone(strcat("gfx/medal/", icon));
+
+ centerprint_showing = true;
+}
+
++=======
++>>>>>>> master
void centerprint_Add(int new_id, string strMessage, float duration, int countdown_num)
{
TC(int, new_id); TC(int, countdown_num);
all_messages_expired = false;
// fade
++<<<<<<< HEAD
+ //if(centerprint_time[j] < 0) // Expired but forced. Expire time is the fade-in time.
+ // a = (time - centerprint_expire_time[j]) / max(0.0001, autocvar_hud_panel_centerprint_fade_in);
+ if(centerprint_time[j] < 0 || centerprint_expire_time[j] - autocvar_hud_panel_centerprint_fade_out > time) // Regularily printed. Not fading out yet.
+ a = 1;
++=======
+ if(centerprint_time[j] < 0) // Expired but forced. Expire time is the fade-in time.
+ a = (time - centerprint_expire_time[j]) / max(0.0001, autocvar_hud_panel_centerprint_fade_in);
+ else if(centerprint_expire_time[j] - autocvar_hud_panel_centerprint_fade_out > time) // Regularily printed. Not fading out yet.
+ a = (time - (centerprint_expire_time[j] - centerprint_time[j])) / max(0.0001, autocvar_hud_panel_centerprint_fade_in);
++>>>>>>> master
else // Expiring soon, so fade it out.
a = (centerprint_expire_time[j] - time) / max(0.0001, autocvar_hud_panel_centerprint_fade_out);
if (!autocvar_con_chatrect)
cvar_set("con_chatrect", "1");
- cvar_set("con_chatrect_x", ftos(pos.x/vid_conwidth));
- cvar_set("con_chatrect_y", ftos(pos.y/vid_conheight));
-
- cvar_set("con_chatwidth", ftos(mySize.x/vid_conwidth));
- cvar_set("con_chat", ftos(floor(mySize.y/autocvar_con_chatsize - 0.5)));
+ // can't use a name ending with _x, _y and _z for a float autocvar as for autocvar specs
+ // it prevents ambiguity with component names of vector autocvars
+ if (cvar_string("con_chatrect_x") != ftos(pos.x / vid_conwidth))
+ cvar_set("con_chatrect_x", ftos(pos.x / vid_conwidth));
+ if (cvar_string("con_chatrect_y") != ftos(pos.y / vid_conheight))
+ cvar_set("con_chatrect_y", ftos(pos.y / vid_conheight));
+ // can't use direct comparison here, it would always returns true even if
+ // both arguments are equal because con_chatwidth is saved with cvar_set
+ //if (autocvar_con_chatwidth != mySize.x / vid_conwidth)
+ if (fabs(autocvar_con_chatwidth - mySize.x / vid_conwidth) > 0.00001)
+ cvar_set("con_chatwidth", ftos(mySize.x / vid_conwidth));
+ if (autocvar_con_chat != floor(mySize.y / autocvar_con_chatsize - 0.5))
+ cvar_set("con_chat", ftos(floor(mySize.y / autocvar_con_chatsize - 0.5)));
+ vector chatsize = '1 1 0' * autocvar_con_chatsize;
if(autocvar__hud_configure)
{
- vector chatsize = '1 1 0' * autocvar_con_chatsize;
cvar_set("con_chatrect_x", "9001"); // over 9000, we'll fake it instead for more control over alpha and such
string str = textShortenToWidth(_("^3Player^7: This is the chat area."), mySize.x, chatsize, stringwidth_colors);
for(int i = 0; i < autocvar_con_chat; ++i)
bool autocvar_hud_panel_scoreboard_playerid = false;
string autocvar_hud_panel_scoreboard_playerid_prefix = "#";
string autocvar_hud_panel_scoreboard_playerid_suffix = " ";
-
+int average_ping[NUM_TEAMS];
// mode 0: returns translated label
// mode 1: prints name and description of all the labels
pos = Scoreboard_MakeTable(pos, tm, panel_bg_color, bg_size);
}
+ pos = Scoreboard_MedalStats_Draw(pos);
+
if (Scoreboard_AccuracyStats_WouldDraw(pos.y))
pos = Scoreboard_AccuracyStats_Draw(pos, panel_bg_color, bg_size);
+ if (Scoreboard_ItemStats_WouldDraw(pos.y))
+ pos = Scoreboard_ItemStats_Draw(pos, panel_bg_color, bg_size);
if(MUTATOR_CALLHOOK(ShowRankings)) {
string ranktitle = M_ARGV(0, string);
}
else if (vdist(this.origin - view_origin, >=, max_shot_distance))
return;
++<<<<<<< HEAD
+ if (!a) return;
++=======
+ if (!a || o.z < 0) return;
+
+ o.z = 0;
++>>>>>>> master
float resize = 1;
- if (autocvar_hud_shownames_resize) // limit resize so its never smaller than 0.5... gets unreadable
+ if (autocvar_hud_shownames_resize && vdist(this.origin - view_origin, >=, autocvar_hud_shownames_mindistance))
{
++<<<<<<< HEAD
+ if (vdist(this.origin - view_origin, >=, autocvar_hud_shownames_mindistance))
+ {
+ float f = autocvar_hud_shownames_maxdistance - autocvar_hud_shownames_mindistance;
+ if (dist == -1)
+ dist = vlen(this.origin - view_origin);
+ resize = 0.5 + 0.5 * (f - max(0, dist - autocvar_hud_shownames_mindistance)) / f;
+ }
++=======
+ // limit resize so its never smaller than 0.5... gets unreadable
+ float f = autocvar_hud_shownames_maxdistance - autocvar_hud_shownames_mindistance;
+ if (dist == -1)
+ dist = vlen(this.origin - view_origin);
+ resize = 0.5 + 0.5 * (f - max(0, dist - autocvar_hud_shownames_mindistance)) / f;
++>>>>>>> master
}
- // draw the sprite image
- if (o.z >= 0)
+ vector mySize = (vec2(autocvar_hud_shownames_aspect, 1)) * autocvar_hud_shownames_fontsize;
+ vector myPos = o - vec2(0.5 * mySize.x, mySize.y);
+ mySize.x *= resize;
+ mySize.y *= resize;
+ myPos.x += 0.5 * (mySize.x / resize - mySize.x);
+ myPos.y += (mySize.y / resize - mySize.y);
+
+ this.box_org = myPos + mySize / 2;
+ this.box_ofs = mySize / 2;
+
+ float namewidth = mySize.x;
+ if (autocvar_hud_shownames_status && this.sameteam && !this.csqcmodel_isdead)
{
++<<<<<<< HEAD
+ o.z = 0;
+ vector mySize = (vec2(autocvar_hud_shownames_aspect, 1)) * autocvar_hud_shownames_fontsize;
+ vector myPos = o - vec2(0.5 * mySize.x, mySize.y);
+ // size scaling
+ mySize.x *= resize;
+ mySize.y *= resize;
+ myPos.x += 0.5 * (mySize.x / resize - mySize.x);
+ myPos.y += (mySize.y / resize - mySize.y);
+ // this is where the origin of the string
+ float namewidth = mySize.x;
+ if (autocvar_hud_shownames_status && this.sameteam && !this.csqcmodel_isdead)
+ {
+ vector pos = myPos + eY * autocvar_hud_shownames_fontsize * resize;
+ vector sz = vec2(0.5 * mySize.x, resize * autocvar_hud_shownames_statusbar_height);
+ if (autocvar_hud_shownames_statusbar_highlight)
+ drawfill(pos + eX * 0.25 * mySize.x, sz, '0.7 0.7 0.7', a / 2, DRAWFLAG_NORMAL);
+ if (this.healthvalue > 0)
+ {
+ HUD_Panel_DrawProgressBar(pos, sz, "nametag_statusbar",
+ this.healthvalue / autocvar_hud_panel_healtharmor_maxhealth, false, 1, '1 0 0', a,
+ DRAWFLAG_NORMAL);
+ }
+ if (GetResource(this, RES_ARMOR) > 0)
+ {
+ HUD_Panel_DrawProgressBar(pos + eX * 0.5 * mySize.x, sz, "nametag_statusbar",
+ GetResource(this, RES_ARMOR) / autocvar_hud_panel_healtharmor_maxarmor, false, 0, '0 1 0', a,
+ DRAWFLAG_NORMAL);
+ }
+ }
+ string s = entcs_GetName(this.sv_entnum - 1);
+ if ((autocvar_hud_shownames_decolorize == 1 && teamplay) || autocvar_hud_shownames_decolorize == 2)
+ s = playername(s, entcs_GetTeam(this.sv_entnum - 1), true);
+ drawfontscale = '1 1 0' * resize;
+ s = textShortenToWidth(s, namewidth, '1 1 0' * autocvar_hud_shownames_fontsize, stringwidth_colors);
+ float width = stringwidth(s, true, '1 1 0' * autocvar_hud_shownames_fontsize);
+ myPos.x = o.x - (width * resize) / 2;
+ drawcolorcodedstring(myPos, s, '1 1 0' * autocvar_hud_shownames_fontsize, a, DRAWFLAG_NORMAL);
+ drawfontscale = '1 1 0';
++=======
+ vector pos = myPos + eY * autocvar_hud_shownames_fontsize * resize;
+ vector sz = vec2(0.5 * mySize.x, resize * autocvar_hud_shownames_statusbar_height);
+
+ this.box_ofs.x = max(mySize.x / 2, sz.x); // sz.x is already half as wide
+ this.box_ofs.y += sz.y / 2;
+ this.box_org.y = myPos.y + (mySize.y + sz.y) / 2;
+ // antioverlap debug code
+ //drawfill(this.box_org - this.box_ofs, this.box_ofs * 2, '1 1 1', a / 2, DRAWFLAG_NORMAL);
+
+ if (autocvar_hud_shownames_statusbar_highlight)
+ drawfill(pos + eX * 0.25 * mySize.x, sz, '0.7 0.7 0.7', a / 2, DRAWFLAG_NORMAL);
+ if (this.healthvalue > 0)
+ {
+ HUD_Panel_DrawProgressBar(pos, sz, "nametag_statusbar",
+ this.healthvalue / autocvar_hud_panel_healtharmor_maxhealth, false, 1, '1 0 0', a,
+ DRAWFLAG_NORMAL);
+ }
+ if (GetResource(this, RES_ARMOR) > 0)
+ {
+ HUD_Panel_DrawProgressBar(pos + eX * 0.5 * mySize.x, sz, "nametag_statusbar",
+ GetResource(this, RES_ARMOR) / autocvar_hud_panel_healtharmor_maxarmor, false, 0, '0 1 0', a,
+ DRAWFLAG_NORMAL);
+ }
++>>>>>>> master
}
+ // antioverlap debug code
+ //else drawfill(this.box_org - this.box_ofs, this.box_ofs * 2, '1 1 1', a / 2, DRAWFLAG_NORMAL);
+
+ string s = entcs_GetName(this.sv_entnum - 1);
+ if ((autocvar_hud_shownames_decolorize == 1 && teamplay) || autocvar_hud_shownames_decolorize == 2)
+ s = playername(s, entcs_GetTeam(this.sv_entnum - 1), true);
+ drawfontscale = '1 1 0' * resize;
+ s = textShortenToWidth(s, namewidth, '1 1 0' * autocvar_hud_shownames_fontsize, stringwidth_colors);
+ float width = stringwidth(s, true, '1 1 0' * autocvar_hud_shownames_fontsize);
+ myPos.x = o.x - (width * resize) / 2;
+ drawcolorcodedstring(myPos, s, '1 1 0' * autocvar_hud_shownames_fontsize, a, DRAWFLAG_NORMAL);
+ drawfontscale = '1 1 0';
}
void Draw_ShowNames_All()
LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
case CMD_REQUEST_USAGE:
{
++<<<<<<< HEAD
+ LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " maplist action [map]");
+ LOG_HELP(" Where 'action' is the command to complete,");
+ LOG_HELP(" and 'map' is what it acts upon (if required).");
+ LOG_HELP(" Full list of commands here: \"add, cleanup, remove, shuffle.\"");
++=======
+ LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " maplist <action> [<map>]");
+ LOG_HELP(" Where <action> is the command to complete,");
+ LOG_HELP(" and <map> is what it acts upon (for the 'add' and 'remove' actions).");
+ LOG_HELP(" Full list of commands here: add, cleanup, remove, shuffle.");
++>>>>>>> master
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
++<<<<<<< HEAD
+ LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " nextframe command...");
+ LOG_HELP(" Where command will be executed next frame of this VM");
++=======
+ LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " nextframe <command>");
+ LOG_HELP(" Where <command> will be executed next frame of this VM");
++>>>>>>> master
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
++<<<<<<< HEAD
+ LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " [function to run]");
++=======
+ LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " <function>");
++>>>>>>> master
return;
}
}
{ WriteByte(chan, ent.sv_solid); },
{ ent.sv_solid = ReadByte(); })
+// z411 weapon
+ENTCS_PROP(ACTIVEWEPID, false, activewepid, activewepid, ENTCS_SET_NORMAL,
+ { WriteByte(chan, ent.activewepid); },
+ { ent.activewepid = ReadByte(); })
+
#ifdef SVQC
- int ENTCS_PUBLICMASK = 0;
+ int ENTCS_PUBLICMASK = 0, ENTCS_PRIVATEMASK = 0;
STATIC_INIT(ENTCS_PUBLICMASK)
{
- FOREACH(EntCSProps, it.m_public,
+ FOREACH(EntCSProps, true,
{
- ENTCS_PUBLICMASK |= BIT(it.m_id);
+ if (it.m_public)
+ ENTCS_PUBLICMASK |= BIT(it.m_id);
+ else
+ ENTCS_PRIVATEMASK |= BIT(it.m_id);
+ });
+ }
+
+ void entcs_update_players(entity player)
+ {
+ FOREACH_CLIENT(it != player && IS_PLAYER(it),
+ {
+ CS(it).entcs.SendFlags |= ENTCS_PRIVATEMASK;
});
}
{
entity player = M_ARGV(0, entity);
++<<<<<<< HEAD
+ if(CS_CVAR(player).cvar_cl_allow_uidtracking == 1 && CS_CVAR(player).cvar_cl_allow_uid2name == 1)
+ {
+ if (!player.stored_netname)
+ player.stored_netname = strzone(uid2name(player.crypto_idfp));
+ if(player.stored_netname != player.netname)
+ {
+ db_put(ServerProgsDB, strcat("/uid2name/", player.crypto_idfp), player.netname);
+ strcpy(player.stored_netname, player.netname);
+ }
+ }
+
+ if (!IS_OBSERVER(player))
+ {
+ if(vdist(player.velocity - player.velocity_z * '0 0 1', >, speedaward_speed))
+ {
+ speedaward_speed = vlen(player.velocity - player.velocity_z * '0 0 1');
+ speedaward_holder = player.netname;
+ speedaward_uid = player.crypto_idfp;
+ speedaward_lastupdate = time;
+ }
+ if (speedaward_speed > speedaward_lastsent && time - speedaward_lastupdate > 1)
+ {
+ string rr = CTS_RECORD;
+ race_send_speedaward(MSG_ALL);
+ speedaward_lastsent = speedaward_speed;
+ if (speedaward_speed > speedaward_alltimebest && speedaward_uid != "")
+ {
+ speedaward_alltimebest = speedaward_speed;
+ speedaward_alltimebest_holder = speedaward_holder;
+ speedaward_alltimebest_uid = speedaward_uid;
+ db_put(ServerProgsDB, strcat(GetMapname(), rr, "speed/speed"), ftos(speedaward_alltimebest));
+ db_put(ServerProgsDB, strcat(GetMapname(), rr, "speed/crypto_idfp"), speedaward_alltimebest_uid);
+ race_send_speedaward_alltimebest(MSG_ALL);
+ }
+ }
+ }
++=======
+ race_checkAndWriteName(player);
+ race_SpeedAwardFrame(player);
++>>>>>>> master
}
MUTATOR_HOOKFUNCTION(cts, ForbidThrowCurrentWeapon)
nades_GiveBonus(it, autocvar_g_nades_bonus_score_low);
}
- entity first = reviving_players_first;
- Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_REVIVED, first.netname);
- Send_Notification(NOTIF_ONE, first, MSG_CENTER, CENTER_FREEZETAG_REVIVE, player.netname);
- Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_REVIVED, player.netname, first.netname);
+ Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_REVIVED, revivers_first.netname);
+ Send_Notification(NOTIF_ONE, revivers_first, MSG_CENTER, CENTER_FREEZETAG_REVIVE, player.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_REVIVED, player.netname, revivers_first.netname);
+ Give_Medal(first, ASSIST);
+ if(autocvar_sv_eventlog)
+ {
+ string revivers = "";
+ for(entity it = revivers_first; it; it = it.chain)
+ revivers = strcat(revivers, ftos(it.playerid), ",");
+ revivers = substring(revivers, 0, strlen(revivers) - 1);
+ GameLogEcho(strcat(":ft:revival:", ftos(player.playerid), ":", revivers));
+ }
}
- for(entity it = reviving_players_first; it; it = it.chain)
+ for(entity it = revivers_first; it; it = it.chain)
STAT(REVIVE_PROGRESS, it) = STAT(REVIVE_PROGRESS, player);
}
player.race_movetime_frac -= f;
player.race_movetime_count += f;
player.race_movetime = player.race_movetime_frac + player.race_movetime_count;
- }
-
- MUTATOR_HOOKFUNCTION(rc, PlayerPhysics)
- {
- entity player = M_ARGV(0, entity);
- //float dt = M_ARGV(1, float);
--
- #ifdef SVQC
++
if(IS_PLAYER(player))
{
if (player.race_penalty)
#endif
#ifdef CSQC
-Inventory g_inventory;
+#include <client/hud/hud.qh>
+
+//Inventory g_inventory;
+Inventory inventoryslots[255];
+float last_pickup_timer;
+entity last_pickup_item;
+int last_pickup_times;
++
+ void Inventory_remove(entity this)
+ {
+ if(g_inventory == this)
+ g_inventory = NULL;
+ }
+
NET_HANDLE(ENT_CLIENT_INVENTORY, bool isnew)
{
make_pure(this);
- g_inventory = this;
+ //g_inventory = this;
+ this.entremove = Inventory_remove;
+
+ float entnum = ReadByte() - 1;
+ inventoryslots[entnum] = this;
-
++
const int majorBits = Readbits(Inventory_groups_major);
for (int i = 0; i < Inventory_groups_major; ++i) {
if (!(majorBits & BIT(i))) {
TC(Inventory, this);
WriteHeader(MSG_ENTITY, ENT_CLIENT_INVENTORY);
TC(PlayerState, this.owner);
-
++
+ // z411 send entity number
+ WriteByte(MSG_ENTITY, etof(this.owner.m_client));
+
Inventory_Write(this, to.inventory_store);
return true;
}
void Inventory_new(PlayerState this)
{
Inventory inv = NEW(Inventory);
- setcefc(inv, Inventory_customize);
+ if(!g_duel) setcefc(inv, Inventory_customize);
Net_LinkEntity((inv.owner = this).inventory = inv, false, 0, Inventory_Send);
}
- void Inventory_delete(entity e) { delete(e.inventory.inventory); delete(e.inventory); }
+ void Inventory_delete(entity e) { delete(e.inventory); }
void Inventory_update(entity e) { e.inventory.SendFlags = 0xFFFFFF; }
-void Inventory_clear(entity store)
-{
- // NOTE: you will need to perform Inventory_update after this to update the storage entity
- // (unless store is the storage entity)
- FOREACH(Items, true, {
- .int fld = inv_items[it.m_id];
- store.(fld) = 0;
- });
-}
-
void InventoryStorage_attach(entity e) { e.inventory_store = NEW(Inventory); e.inventory_store.drawonlytoclient = e; }
-void InventoryStorage_delete(entity e) { delete(e.inventory_store); }
+void InventoryStorage_detach(entity e) { delete(e.inventory_store); }
+
+void Inventory_ClearAll() {
+ FOREACH_CLIENT(IS_PLAYER(it), {
+ entity store = PS(it);
+ FOREACH(Items, true, {
+ store.inventory.inv_items[it.m_id] = 0;
+ });
+ Inventory_update(store);
+ });
+}
#endif
}
yoda = 0;
- damage_goodhits = 0;
+ impressive_hits = 0;
FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, mydmg, true, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, thiswep.m_id);
- if(yoda && flying)
- Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
+ if(yoda && flying) {
+ Give_Medal(actor, YODA);
+ }
+
- if(damage_goodhits && actor.oknex_lasthit)
+ if(impressive_hits && actor.oknex_lasthit)
{
- Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE);
+ Give_Medal(actor, IMPRESSIVE);
- damage_goodhits = 0; // only every second time
+ impressive_hits = 0; // only every second time
}
- actor.oknex_lasthit = damage_goodhits;
+ actor.oknex_lasthit = impressive_hits;
//beam and muzzle flash done on client
SendCSQCVortexBeamParticle(charge);
Notification optiona,
Notification optionb);
+void Create_Notification_Entity_Medal(entity notif,
+ float var_cvar,
+ string namestring,
+ /* MSG_MEDAL */
+ string icon,
+ Notification anncename);
+
void Dump_Notifications(int fh, bool alsoprint);
- GENERIC_COMMAND(dumpnotifs, "Dump all notifications into notifications_dump.txt", false)
+ #define DEFAULT_FILENAME "notifications_dump.cfg"
+ // NOTE: dumpeffectinfo, dumpnotifs, dumpturrets and dumpweapons use similar code
+ GENERIC_COMMAND(dumpnotifs, "Dump all notifications into " DEFAULT_FILENAME, false)
{
switch (request)
{
default:
case CMD_REQUEST_USAGE:
{
++<<<<<<< HEAD
+ LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpnotifs [filename]");
+ LOG_HELP(" Where 'filename' is the file to write (default is notifications_dump.cfg),");
++=======
+ LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpnotifs [<filename>]");
+ LOG_HELPF(" Where <filename> is the file to write (default is %s),", DEFAULT_FILENAME);
++>>>>>>> master
LOG_HELP(" if supplied with '-' output to console as well as default,");
LOG_HELP(" if left blank, it will only write to default.");
return;
return it;
}
++<<<<<<< HEAD
+#define MSG_ANNCE_NOTIF_TEAM(teamnum, name, cvarname, defaultvalue, sound, channel, volume, position, queuetime) \
+ MSG_ANNCE_NOTIF_(teamnum, ANNCE_##name, ANNCE_##cvarname, defaultvalue, sound, channel, volume, position, queuetime)
+
+#define MSG_ANNCE_NOTIF(name, defaultvalue, sound, channel, volume, position, queuetime) \
++=======
+ #define MSG_ANNCE_NOTIF_TEAM(teamnum, name, cvarname, defaultvalue, sound, channel, volume, position) \
+ MSG_ANNCE_NOTIF_(teamnum, ANNCE_##name, ANNCE_##cvarname, defaultvalue, sound, channel, volume, position)
+
+ #define MSG_ANNCE_NOTIF(name, defaultvalue, sound, channel, volume, position) \
++>>>>>>> master
NOTIF_ADD_AUTOCVAR(ANNCE_##name, defaultvalue) \
- MSG_ANNCE_NOTIF_(0, ANNCE_##name, ANNCE_##name, defaultvalue, sound, channel, volume, position)
+ MSG_ANNCE_NOTIF_(0, ANNCE_##name, ANNCE_##name, defaultvalue, sound, channel, volume, position, queuetime)
-#define MSG_ANNCE_NOTIF_(teamnum, name, cvarname, defaultvalue, sound, channel, volume, position) \
+#define MSG_ANNCE_NOTIF_(teamnum, name, cvarname, defaultvalue, sound, channel, volume, position, queuetime) \
REGISTER(Notifications, name, m_id, new_pure(msg_annce_notification)) { \
Create_Notification_Entity (this, defaultvalue, ACVNN(cvarname), MSG_ANNCE, strtoupper(#name), teamnum); \
Create_Notification_Entity_Annce(this, ACVNN(cvarname), strtoupper(#name), \
bool cvar_cl_allow_uidranking;
float cvar_cl_autoscreenshot;
float cvar_cl_autotaunt;
- float cvar_cl_clippedspectating;
+ bool cvar_cl_clippedspectating;
int cvar_cl_gunalign;
+ bool cvar_cl_chat_sounds;
float cvar_cl_handicap;
float cvar_cl_jetpack_jump;
float cvar_cl_movement_track_canjump;
#elif defined(SVQC)
.float cvar_cl_handicap;
.int cvar_cl_gunalign;
- .float cvar_cl_clippedspectating;
+ .bool cvar_cl_chat_sounds;
+ .bool cvar_cl_clippedspectating;
.float cvar_cl_autoscreenshot;
.float cvar_cl_jetpack_jump;
.float cvar_cl_movement_track_canjump;
default:
case CMD_REQUEST_USAGE:
{
++<<<<<<< HEAD
+ LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpturrets [filename]");
+ LOG_HELP(" Where 'filename' is the file to write (default is turrets_dump.cfg),");
++=======
+ LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpturrets [<filename>]");
+ LOG_HELPF(" Where <filename> is the file to write (default is %s),", DEFAULT_FILENAME);
++>>>>>>> master
LOG_HELP(" if supplied with '-' output to console as well as default,");
LOG_HELP(" if left blank, it will only write to default.");
return;
default:
case CMD_REQUEST_USAGE:
{
++<<<<<<< HEAD
+ LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpweapons [filename]");
+ LOG_HELP(" Where 'filename' is the file to write (default is weapons_dump.cfg),");
++=======
+ LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpweapons [<filename>]");
+ LOG_HELPF(" Where <filename> is the file to write (default is %s),", DEFAULT_FILENAME);
++>>>>>>> master
LOG_HELP(" if supplied with '-' output to console as well as default,");
LOG_HELP(" if left blank, it will only write to default.");
return;
if(IS_PLAYER(directhitentity))
if(DIFF_TEAM(this.realowner, directhitentity))
if(!IS_DEAD(directhitentity))
- if(IsFlying(directhitentity))
- Send_Notification(NOTIF_ONE, this.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_ELECTROBITCH);
-
+ if(IsFlying(directhitentity)) {
+ Give_Medal(this.realowner, ELECTROBITCH);
+ }
+ */
+
this.event_damage = func_null;
this.takedamage = DAMAGE_NO;
+ this.velocity = this.movedir; // particle fx and decals need .velocity
if(this.move_movetype == MOVETYPE_BOUNCE || this.classname == "electro_orb") // TODO: classname is more reliable anyway?
{
// do this now, as goodhits is disabled below
vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, normalize(v - w_shotorg));
- SendCSQCVaporizerBeamParticle(actor, damage_goodhits);
+ SendCSQCVaporizerBeamParticle(actor, impressive_hits);
- if(yoda && flying) {
- Give_Medal(actor, YODA);
- }
-
- if(damage_goodhits && actor.vaporizer_lasthit)
+ if(yoda && flying)
+ Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
+ if(impressive_hits && actor.vaporizer_lasthit)
{
- damage_goodhits = 0; // only every second time
+ Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE);
+ Give_Medal(actor, IMPRESSIVE);
+ impressive_hits = 0; // only every second time
}
- actor.vaporizer_lasthit = damage_goodhits;
+ actor.vaporizer_lasthit = impressive_hits;
if(autocvar_g_rm)
if(!(trace_dphitq3surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT)))
}
yoda = 0;
- damage_goodhits = 0;
+ impressive_hits = 0;
FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, mydmg, false, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, dtype);
- if(yoda && flying)
- Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
+ if(yoda && flying) {
+ Give_Medal(actor, YODA);
+ }
+
- if(damage_goodhits && actor.vortex_lasthit)
+ if(impressive_hits && actor.vortex_lasthit)
{
- Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE);
+ Give_Medal(actor, IMPRESSIVE);
- damage_goodhits = 0; // only every second time
+ impressive_hits = 0; // only every second time
}
- actor.vortex_lasthit = damage_goodhits;
+ actor.vortex_lasthit = impressive_hits;
//beam done on client
vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
METHOD(Vortex, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
if(!WEP_CVAR(vortex, charge_always))
++<<<<<<< HEAD
+ W_Vortex_Charge(actor, weaponentity, frametime);
++=======
+ W_Vortex_Charge(actor, weaponentity, frametime / W_TICSPERFRAME);
++>>>>>>> master
if(WEP_CVAR_SEC(vortex, chargepool))
if(actor.(weaponentity).vortex_chargepool_ammo < 1)
PERSON(Zac "Mario" Jardine) \
NL() \
TITLE(_("Extended Team")) \
- PERSON(AllieWay) \
PERSON(Antonio "terencehill" Piu) \
- PERSON(Archer) \
- PERSON(BuddyFriendGuy) \
+ PERSON(bones_was_here) \
PERSON(David "Cloudwalk" Knapp) \
- PERSON(Debugger) \
- PERSON(Diomedes) \
PERSON(Freddy) \
- PERSON(GATTS) \
PERSON(Halogene) \
PERSON(Jan "zykure" Behrens) \
- PERSON(JH0nny) \
- PERSON(Łukasz "kuniu the frogg" Polek) \
- PERSON(martin-t) \
- PERSON(Matthias "matthiaskrgr" Krüger) \
- PERSON(Mattia "Melanosuchus" Basaglia) \
- PERSON(Morosophos) \
++// PERSON(Morosophos) \
PERSON(MrBougo) \
- PERSON(Nick "bitbomb" Lucca) \
PERSON(nilyt/nyov) \
PERSON(Nitroxis) \
PERSON(packer) \
} else if (IS_PLAYER(this)) {
PutPlayerInServer(this);
}
-
-
+ // send team names
+ if(teamplay && IS_REAL_CLIENT(this))
+ send_TeamNames(MSG_ONE, this);
+ bot_relinkplayerlist();
}
// TODO do we need all these fields, or should we stop autodetecting runtime
#define SPECTATE_COPYFIELD(fld) SPECTATE_COPY() { this.(fld) = spectatee.(fld); }
const int MAX_SPECTATORS = 7;
+
+float _medal_times;
+#define Give_Medal(entity,medalname) \
+ _medal_times = GameRules_scoring_add(entity, MEDAL_##medalname, 1); \
+ Send_Notification(NOTIF_ONE, entity, MSG_MEDAL, MEDAL_##medalname, _medal_times);
++
backtrace("Can't spawn round_handler again!");
return;
}
- entity this = round_handler = new(round_handler);
+ entity this = round_handler = new_pure(round_handler);
- setthink(this, round_handler_FirstThink);
+
this.canRoundStart = canRoundStart_func;
this.canRoundEnd = canRoundEnd_func;
this.roundStart = roundStart_func;
//.float hit_time;
.float fired_time;
- void accuracy_add(entity this, Weapon w, int fired, int hit)
+void roundaccuracy_clear(entity this)
+{
+ if (IS_INDEPENDENT_PLAYER(this)) return;
+ entity ra = this.roundaccuracy;
+
+ for (int w = 0; w <= WEP_LAST - WEP_FIRST; ++w) {
+ ra.accuracy_frags[w] = 0;
+ ra.accuracy_hit[w] = 0;
+ ra.accuracy_fired[w] = 0;
+ ra.accuracy_cnt_hit[w] = 0;
+ ra.accuracy_cnt_fired[w] = 0;
+ }
+}
+
+ void accuracy_add(entity this, Weapon w, float fired, float hit)
{
if (IS_INDEPENDENT_PLAYER(this)) return;
entity a = CS(this).accuracy;
string gamemode_name;
+int fragsleft;
+int fragsleft_last;
+ string record_type;
string clientstuff;