"ping pl name |" \
" -teams,rc,cts,inv,lms/kills +ft,tdm/kills ?+rc,inv/kills" \
" -teams,lms/deaths +ft,tdm/deaths" \
+" +tdm/sum" \
" -teams,lms,rc,cts,inv,ka/suicides +ft,tdm/suicides ?+rc,inv/suicides" \
" -cts,dm,tdm,ka,ft/frags" /* tdm already has this in "score" */ \
" +tdm,ft,dom,ons,as/teamkills"\
" -rc,cts,nb/dmg -rc,cts,nb/dmgtaken" \
-" +ctf/caps +ctf/pickups +ctf/fckills +ctf/returns +ons/caps +ons/takes" \
+" +ctf/pickups +ctf/fckills +ctf/returns +ctf/caps +ons/takes +ons/caps" \
" +lms/lives +lms/rank" \
-" +kh/caps +kh/pushes +kh/destroyed" \
+" +kh/kckills +kh/losses +kh/caps" \
" ?+rc/laps ?+rc/time +rc,cts/fastest" \
" +as/objectives +nb/faults +nb/goals" \
" +ka/pickups +ka/bckills +ka/bctime +ft/revivals" \
+" +dom/ticks +dom/takes" \
" -lms,rc,cts,inv,nb/score"
void Cmd_Scoreboard_SetFields(int argc)
float f, i, j;
vector v;
if(!scoreboard_active && !camera_active && intermission != 2 && !STAT(GAME_STOPPED) &&
- spectatee_status != -1 && !csqcplayer.viewloc && !MUTATOR_CALLHOOK(DrawCrosshair) &&
+ spectatee_status != -1 && (!csqcplayer.viewloc || (!spectatee_status && (csqcplayer.viewloc.spawnflags & VIEWLOC_FREEAIM))) && !MUTATOR_CALLHOOK(DrawCrosshair) &&
!HUD_MinigameMenu_IsOpened() )
{
if (!autocvar_crosshair_enabled) // main toggle for crosshair rendering
float shottype;
// wcross_origin = '0.5 0 0' * vid_conwidth + '0 0.5 0' * vid_conheight;
- wcross_origin = project_3d_to_2d(view_origin + max_shot_distance * view_forward);
+ if(csqcplayer.viewloc && (csqcplayer.viewloc.spawnflags & VIEWLOC_FREEAIM))
+ wcross_origin = viewloc_mousepos;
+ else
+ wcross_origin = project_3d_to_2d(view_origin + max_shot_distance * view_forward);
wcross_origin.z = 0;
if(autocvar_crosshair_hittest)
{
viewloc_mousepos.x = bound(0, viewloc_mousepos.x, vid_conwidth);
viewloc_mousepos.y = bound(0, viewloc_mousepos.y, vid_conheight);
- float cursor_alpha = 1 - autocvar__menu_alpha;
- draw_cursor(viewloc_mousepos, '0.5 0.5 0', "/cursor_move", '1 1 1', cursor_alpha);
+ //float cursor_alpha = 1 - autocvar__menu_alpha;
+ //draw_cursor(viewloc_mousepos, '0.5 0.5 0', "/cursor_move", '1 1 1', cursor_alpha);
}
bool ov_enabled;
instagib_stop_countdown(player);
}
+MUTATOR_HOOKFUNCTION(mutator_instagib, ForbidRandomStartWeapons)
+{
+ return true;
+}
+
MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerSpawn)
{
entity player = M_ARGV(0, entity);
{
entity e = new(item_vaporizer_cells);
setorigin(e, item.origin);
- e.noalign = item.noalign;
+ e.noalign = Item_ShouldKeepPosition(item);
e.cnt = item.cnt;
e.team = item.team;
e.spawnfunc_checked = true;
M_ARGV(0, string) = "off";
}
+MUTATOR_HOOKFUNCTION(melee_only, ForbidRandomStartWeapons)
+{
+ return true;
+}
+
MUTATOR_HOOKFUNCTION(melee_only, ForbidThrowCurrentWeapon)
{
return true;
}
}
- float n = 0;
+ int n = 0;
entity o = NULL;
if(player.freezetag_frozen_timeout > 0 && time >= player.freezetag_frozen_timeout)
n = -1;
- else
+ else if(STAT(FROZEN, player) == 3)
{
vector revive_extra_size = '1 1 1' * autocvar_g_freezetag_revive_extra_size;
n = 0;
FOREACH_CLIENT(IS_PLAYER(it) && it != player, {
- if(!IS_DEAD(it))
- if(STAT(FROZEN, it) == 0)
- if(SAME_TEAM(it, player))
+ if(!IS_DEAD(it) && STAT(FROZEN, it) == 0 && SAME_TEAM(it, player))
if(boxesoverlap(player.absmin - revive_extra_size, player.absmax + revive_extra_size, it.absmin, it.absmax))
{
if(!o)
o = it;
- if(STAT(FROZEN, player) == 1)
- it.reviving = true;
+ it.reviving = true;
++n;
}
});
}
- if(n && STAT(FROZEN, player) == 3) // OK, there is at least one teammate reviving us
+ if(n > 0 && STAT(FROZEN, player) == 3) // OK, there is at least one teammate reviving us
{
player.revive_progress = bound(0, player.revive_progress + frametime * max(1/60, autocvar_g_freezetag_revive_speed), 1);
SetResourceAmount(player, RESOURCE_HEALTH, max(1, player.revive_progress * start_health));
NIX_GiveCurrentWeapon(player);
}
+MUTATOR_HOOKFUNCTION(nix, ForbidRandomStartWeapons)
+{
+ return true;
+}
+
MUTATOR_HOOKFUNCTION(nix, PlayerSpawn)
{
entity player = M_ARGV(0, entity);
PHYS_INPUT_BUTTON_ATCK2(player) = false;
}
+MUTATOR_HOOKFUNCTION(ok, ForbidRandomStartWeapons)
+{
+ return true;
+}
+
MUTATOR_HOOKFUNCTION(ok, PlayerWeaponSelect)
{
entity player = M_ARGV(0, entity);
}
}
-void self_spawnfunc_weapon_hmg(entity this) { spawnfunc_weapon_hmg(this); }
-void self_spawnfunc_weapon_rpc(entity this) { spawnfunc_weapon_rpc(this); }
-
-MUTATOR_HOOKFUNCTION(ok, OnEntityPreSpawn)
-{
- entity ent = M_ARGV(0, entity);
-
- if(autocvar_g_powerups)
- if(autocvar_g_overkill_powerups_replace)
- {
- if(ent.classname == "item_strength")
- {
- entity wep = new(weapon_hmg);
- setorigin(wep, ent.origin);
- setmodel(wep, MDL_OK_HMG);
- wep.ok_item = true;
- wep.noalign = Item_ShouldKeepPosition(ent);
- wep.cnt = ent.cnt;
- wep.team = ent.team;
- wep.respawntime = g_pickup_respawntime_superweapon;
- wep.pickup_anyway = true;
- wep.spawnfunc_checked = true;
- setthink(wep, self_spawnfunc_weapon_hmg);
- wep.nextthink = time + 0.1;
- return true;
- }
- else if(ent.classname == "item_shield")
- {
- entity wep = new(weapon_rpc);
- setorigin(wep, ent.origin);
- setmodel(wep, MDL_OK_RPC);
- wep.ok_item = true;
- wep.noalign = Item_ShouldKeepPosition(ent);
- wep.cnt = ent.cnt;
- wep.team = ent.team;
- wep.respawntime = g_pickup_respawntime_superweapon;
- wep.pickup_anyway = true;
- wep.spawnfunc_checked = true;
- setthink(wep, self_spawnfunc_weapon_rpc);
- wep.nextthink = time + 0.1;
- return true;
- }
- }
-}
-
bool ok_HandleItemWaypoints(entity e)
{
if(!autocvar_g_overkill_itemwaypoints)
{
entity item = M_ARGV(0, entity);
- if(item.ok_item)
+ if (item.ok_item)
+ {
return false;
-
+ }
+ if (!autocvar_g_powerups || !autocvar_g_overkill_powerups_replace)
+ {
+ return true;
+ }
+ if (item.classname == "item_strength")
+ {
+ entity wep = new(weapon_hmg);
+ setorigin(wep, item.origin);
+ wep.ok_item = true;
+ wep.noalign = Item_ShouldKeepPosition(item);
+ wep.cnt = item.cnt;
+ wep.team = item.team;
+ wep.respawntime = g_pickup_respawntime_superweapon;
+ wep.pickup_anyway = true;
+ wep.spawnfunc_checked = true;
+ Item_Initialize(wep, "weapon_hmg");
+ return true;
+ }
+ else if (item.classname == "item_shield")
+ {
+ entity wep = new(weapon_rpc);
+ setorigin(wep, item.origin);
+ wep.ok_item = true;
+ wep.noalign = Item_ShouldKeepPosition(item);
+ wep.cnt = item.cnt;
+ wep.team = item.team;
+ wep.respawntime = g_pickup_respawntime_superweapon;
+ wep.pickup_anyway = true;
+ wep.spawnfunc_checked = true;
+ Item_Initialize(wep, "weapon_rpc");
+ return true;
+ }
return true;
}
if(cvar_type(s) & CVAR_TYPEFLAG_EXISTS)
return cvar(s);
}
- if(autocvar_g_physics_clientselect && autocvar_g_physics_clientselect_default)
+ if(autocvar_g_physics_clientselect && autocvar_g_physics_clientselect_default && autocvar_g_physics_clientselect_default != "")
{
string s = strcat("g_physics_", autocvar_g_physics_clientselect_default, "_", option);
if(cvar_type(s) & CVAR_TYPEFLAG_EXISTS)
#ifdef CSQC
bool autocvar_cl_ghost_items_vehicle = true;
.vector item_glowmod;
+.bool item_simple; // probably not really needed, but better safe than sorry
void Item_SetAlpha(entity this)
{
bool veh_hud = (hud && autocvar_cl_ghost_items_vehicle);
{
if(this.ItemStatus & ITS_ANIMATE1)
{
- this.angles += this.avelocity * frametime;
+ if(!this.item_simple)
+ this.angles += this.avelocity * frametime;
float fade_in = bound(0, time - this.onground_time, 1);
setorigin(this, this.oldorigin + fade_in * ('0 0 10' + '0 0 8' * sin((time - this.onground_time) * 2)));
}
if(this.ItemStatus & ITS_ANIMATE2)
{
- this.angles += this.avelocity * frametime;
+ if(!this.item_simple)
+ this.angles += this.avelocity * frametime;
float fade_in = bound(0, time - this.onground_time, 1);
setorigin(this, this.oldorigin + fade_in * ('0 0 8' + '0 0 4' * sin((time - this.onground_time) * 3)));
}
Item_SetAlpha(this);
}
-void ItemDrawSimple(entity this)
-{
- if(this.gravity)
- {
- Movetype_Physics_MatchServer(this, false);
-
- if(IS_ONGROUND(this))
- this.gravity = 0;
- }
-
- Item_SetAlpha(this);
-}
-
void Item_PreDraw(entity this)
{
if(warpzone_warpzones_exist)
this.mdl = "";
string _fn = ReadString();
+ this.item_simple = false; // reset it!
if(autocvar_cl_simple_items && (this.ItemStatus & ITS_ALLOWSI))
{
string _fn2 = substring(_fn, 0 , strlen(_fn) -4);
- this.draw = ItemDrawSimple;
+ this.item_simple = true;
if(fexists(strcat(_fn2, autocvar_cl_simpleitems_postfix, ".md3")))
this.mdl = strzone(strcat(_fn2, autocvar_cl_simpleitems_postfix, ".md3"));
this.mdl = strzone(strcat(_fn2, autocvar_cl_simpleitems_postfix, ".mdl"));
else
{
- this.draw = ItemDraw;
+ this.item_simple = false;
LOG_TRACE("Simple item requested for ", _fn, " but no model exists for it");
}
}
- if(this.draw != ItemDrawSimple)
+ if(!this.item_simple)
this.mdl = strzone(_fn);
.vector colormod;
void ItemDraw(entity this);
-void ItemDrawSimple(entity this);
#endif
#ifdef SVQC
if (this.health)
{
+ //this.canteamdamage = true; // TODO
this.takedamage = DAMAGE_YES;
this.event_damage = door_damage;
}
if (this.health)
{
+ //this.canteamdamage = true; // TODO
this.takedamage = DAMAGE_YES;
this.event_damage = door_damage;
}
if (this.spawnflags & SECRET_YES_SHOOT)
{
+ //this.canteamdamage = true; // TODO
this.health = 10000;
this.takedamage = DAMAGE_YES;
this.event_damage = fd_secret_damage;
if(this.spawnflags & DOOR_NOSPLASH)
if(!(DEATH_ISSPECIAL(deathtype)) && (deathtype & HITTYPE_SPLASH))
return;
+ if(this.team)
+ if(((this.spawnflags & 4) == 0) == (this.team != attacker.team))
+ return;
this.health = this.health - damage;
if (this.health <= 0)
{
{
if (this.spawnflags & SPAWNFLAG_NOTOUCH)
objerror (this, "health and notouch don't make sense\n");
+ this.canteamdamage = true;
this.max_health = this.health;
this.event_damage = multi_eventdamage;
this.takedamage = DAMAGE_YES;
} else {
vector mpos = CursorToWorldCoord(viewloc_mousepos);
mpos.x = view.origin.x; // replace the cursor's x position with the player's
- view_angle = aim_vec(view.origin, mpos); // get new angles
+ view_angle = aim_vec(view.origin + view.view_ofs, mpos); // get new angles
}
view.angles_y = view_angle.y;
setproperty(VF_CL_VIEWANGLES, view_angle);
/* spawnfunc */ ATTRIB(Crylink, m_canonical_spawnfunc, string, "weapon_crylink");
/* ammotype */ ATTRIB(Crylink, ammo_type, int, RESOURCE_CELLS);
/* impulse */ ATTRIB(Crylink, impulse, int, 6);
-/* flags */ ATTRIB(Crylink, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH | WEP_FLAG_CANCLIMB | WEP_FLAG_NODUAL);
+/* flags */ ATTRIB(Crylink, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH | WEP_FLAG_CANCLIMB);
/* rating */ ATTRIB(Crylink, bot_pickupbasevalue, float, 6000);
/* color */ ATTRIB(Crylink, wpcolor, vector, '1 0.5 1');
/* modelname */ ATTRIB(Crylink, mdl, string, "crylink");
this.health = start_health;
this.armorvalue = start_armorvalue;
this.weapons = start_weapons;
- GiveRandomWeapons(this, random_start_weapons_count,
- autocvar_g_random_start_weapons, random_start_ammo);
+ if (MUTATOR_CALLHOOK(ForbidRandomStartWeapons, this) == false)
+ {
+ GiveRandomWeapons(this, random_start_weapons_count,
+ autocvar_g_random_start_weapons, random_start_ammo);
+ }
}
SetSpectatee_status(this, 0);
// set when showing a kill countdown
.entity killindicator;
+.bool canteamdamage;
+
void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
float lockteams;
force = '0 0 0';
}
}
- else
+ else if(!targ.canteamdamage)
damage = 0;
}
}
/**/
MUTATOR_HOOKABLE(ForbidSpawn, EV_ForbidSpawn);
+/** called when player spawns to determine whether to give them random start weapons. Return true to forbid giving them. */
+#define EV_ForbidRandomStartWeapons(i, o) \
+ /** player */ i(entity, MUTATOR_ARGV_0_entity) \
+ /**/
+MUTATOR_HOOKABLE(ForbidRandomStartWeapons, EV_ForbidRandomStartWeapons);
+
/** called when a player spawns as player, after shared setup, before his weapon is chosen (so items may be changed in here) */
#define EV_PlayerSpawn(i, o) \
/** player spawning */ i(entity, MUTATOR_ARGV_0_entity) \