seta hud_panel_radar_scale "" "distance you can see on the team radar"
seta hud_panel_radar_maximized_scale "" "distance you can see on the radar when maximized"
seta hud_panel_radar_maximized_size "" "size of the radar when maximized"
+seta hud_panel_radar_maximized_rotation "" "rotation mode: you set what points up. 0 = player, 1 = west, 2 = south, 3 = east, 4 = north"
+seta hud_panel_radar_maximized_zoommode "" "zoom mode: 0 = zoomed by default, 1 = zoomed when +zoom, 2 = always zoomed, 3 = always zoomed out"
seta hud_panel_score "" "enable/disable this panel"
seta hud_panel_score_pos "" "position of this base of the panel"
set g_balance_uzi_first 1
set g_balance_uzi_first_damage 30
-set g_balance_uzi_first_headshotaddeddamage 0
set g_balance_uzi_first_force 50
set g_balance_uzi_first_spread 0.015
set g_balance_uzi_first_refire 0.2
set g_balance_uzi_first_ammo 1
set g_balance_uzi_sustained_damage 15
-set g_balance_uzi_sustained_headshotaddeddamage 0
set g_balance_uzi_sustained_force 27
set g_balance_uzi_sustained_spread 0.05
set g_balance_uzi_sustained_refire 0.1
set g_balance_uzi_first 1
set g_balance_uzi_first_damage 15 / f/ LOG: 22 -> 15
-set g_balance_uzi_first_headshotaddeddamage 0
set g_balance_uzi_first_force 50
set g_balance_uzi_first_spread 0.03
set g_balance_uzi_first_refire 0.2
set g_balance_uzi_first_ammo 2
set g_balance_uzi_sustained_damage 12 // 120 dps
-set g_balance_uzi_sustained_headshotaddeddamage 0
set g_balance_uzi_sustained_force 12
set g_balance_uzi_sustained_spread 0.06
set g_balance_uzi_sustained_refire 0.1
set g_balance_uzi_first 1
set g_balance_uzi_first_damage 14
-set g_balance_uzi_first_headshotaddeddamage 0
set g_balance_uzi_first_force 5
set g_balance_uzi_first_spread 0.03
set g_balance_uzi_first_refire 0.4
set g_balance_uzi_first_ammo 1
set g_balance_uzi_sustained_damage 12
-set g_balance_uzi_sustained_headshotaddeddamage 0
set g_balance_uzi_sustained_force 5
set g_balance_uzi_sustained_spread 0
set g_balance_uzi_sustained_refire 0.1
set g_balance_uzi_first 1
set g_balance_uzi_first_damage 14
-set g_balance_uzi_first_headshotaddeddamage 0
set g_balance_uzi_first_force 5
set g_balance_uzi_first_spread 0.03
set g_balance_uzi_first_refire 0.125
set g_balance_uzi_first_ammo 1
set g_balance_uzi_sustained_damage 10 // 100 dps
-set g_balance_uzi_sustained_headshotaddeddamage 0
set g_balance_uzi_sustained_force 5
set g_balance_uzi_sustained_spread 0.03
set g_balance_uzi_sustained_refire 0.1
set g_balance_uzi_first 1
set g_balance_uzi_first_damage 14
-set g_balance_uzi_first_headshotaddeddamage 0
set g_balance_uzi_first_force 5
set g_balance_uzi_first_spread 0.03
set g_balance_uzi_first_refire 0.125
set g_balance_uzi_first_ammo 1
set g_balance_uzi_sustained_damage 10 // 100 dps
-set g_balance_uzi_sustained_headshotaddeddamage 0
set g_balance_uzi_sustained_force 5
set g_balance_uzi_sustained_spread 0.03
set g_balance_uzi_sustained_refire 0.1
set sv_player_viewoffset "0 0 35" "view offset of the player model"
set sv_player_mins "-16 -16 -24" "playermodel mins"
set sv_player_maxs "16 16 45" "playermodel maxs"
-set sv_player_headsize "24 24 12" "playermodel headshot bbox size (centered at top of player bbox, preview with r_showbboxes)" // actually SHOULD be 19.2 19.2 10 according to docs
set sv_player_crouch_viewoffset "0 0 20" "view offset of the player model when crouched"
set sv_player_crouch_mins "-16 -16 -24" "mins of a crouched playermodel"
set sv_player_crouch_maxs "16 16 25" "maxs of a crouched playermodel"
// startmap_dm is used when running with the -listen or -dedicated commandline options
set serverconfig server.cfg
+alias loadconfig "cvar_resettodefaults_saveonly; exec ${* !}"
set _sv_init 0
alias startmap_dm "set _sv_init 0; map _init/_init; exec $serverconfig; set _sv_init 1"
set waypoint_benchmark 0 "quit after waypoint loading to benchmark bot navigation code"
set g_debug_bot_commands 0 "print scripted bot commands before executing"
set g_debug_defaultsounds 0 "always use default sounds"
-set sv_use_csqc_players 1 "set to 0 to disable CSQC players for better Xonotic 0.5 compat"
set cl_precacheplayermodels 0 "TODO please check if this needs to be 1 or if precaching a model the server already requested is fast enough to do it at runtime"
-seta cl_forceplayermodels 0 "make everyone look like your own model (requires server to have sv_use_csqc_players 1 and sv_defaultcharacter 0)"
-seta cl_forceplayercolors 0 "make everyone look like your own color (requires server to have sv_use_csqc_players 1 and sv_defaultcharacter 0, and is ignored in teamplay with more than two teams)"
-seta cl_forcemyplayermodel "" "set to the model file name you want to show yourself as (requires server to have sv_use_csqc_players 1; does not affect how enemies look with cl_forceplayermodels)"
-seta cl_forcemyplayerskin 0 "set to the skin number you want to show yourself as (requires server to have sv_use_csqc_players 1; does not affect how enemies look with cl_forceplayermodels)"
-seta cl_forcemyplayercolors 0 "set to the color value (encoding is same as _cl_color) for your own player model (requires server to have sv_use_csqc_players 1, and is ignored in teamplay; does not affect how enemies look with cl_forceplayermodels)"
-seta cl_movement_errorcompensation 1 "try to compensate for prediction errors and reduce preceived lag (requires server to have sv_use_csqc_players 1)"
+seta cl_forceplayermodels 0 "make everyone look like your own model (requires server to have sv_defaultcharacter 0)"
+seta cl_forceplayercolors 0 "make everyone look like your own color (requires server to have sv_defaultcharacter 0, and is ignored in teamplay with more than two teams)"
+seta cl_forcemyplayermodel "" "set to the model file name you want to show yourself as (does not affect how enemies look with cl_forceplayermodels)"
+seta cl_forcemyplayerskin 0 "set to the skin number you want to show yourself as (does not affect how enemies look with cl_forceplayermodels)"
+seta cl_forcemyplayercolors 0 "set to the color value (encoding is same as _cl_color) for your own player model (ignored in teamplay; does not affect how enemies look with cl_forceplayermodels)"
+seta cl_movement_errorcompensation 1 "try to compensate for prediction errors and reduce preceived lag"
// debug cvars for keyhunt attaching
set _angles "0 0 0"
seta hud_panel_radar_scale "4096"
seta hud_panel_radar_maximized_scale "8192"
seta hud_panel_radar_maximized_size "0.5 0.5"
+seta hud_panel_radar_maximized_rotation "1"
+seta hud_panel_radar_maximized_zoommode "3"
seta hud_panel_score 1
seta hud_panel_score_pos "0.890000 0.030000"
seta hud_panel_radar_scale "4096"
seta hud_panel_radar_maximized_scale "8192"
seta hud_panel_radar_maximized_size "0.5 0.5"
+seta hud_panel_radar_maximized_rotation "1"
+seta hud_panel_radar_maximized_zoommode "3"
seta hud_panel_score 1
seta hud_panel_score_pos "0.465000 0.045000"
seta hud_panel_radar_scale "4096"
seta hud_panel_radar_maximized_scale "8192"
seta hud_panel_radar_maximized_size "0.5 0.5"
+seta hud_panel_radar_maximized_rotation "1"
+seta hud_panel_radar_maximized_zoommode "3"
seta hud_panel_score 1
seta hud_panel_score_pos "0.465000 0.045000"
seta hud_panel_radar_scale "4096"
seta hud_panel_radar_maximized_scale "8192"
seta hud_panel_radar_maximized_size "0.5 0.5"
+seta hud_panel_radar_maximized_rotation "1"
+seta hud_panel_radar_maximized_zoommode "3"
seta hud_panel_score 1
seta hud_panel_score_pos "0.020000 0.920000"
seta hud_panel_radar_scale "4096"
seta hud_panel_radar_maximized_scale "8192"
seta hud_panel_radar_maximized_size "0.5 0.5"
+seta hud_panel_radar_maximized_rotation "1"
+seta hud_panel_radar_maximized_zoommode "3"
seta hud_panel_score 1
seta hud_panel_score_pos "0.760000 0.910000"
+++ /dev/null
- 0 40 20 // die1 : die
- 40 40 20 // die2 : die differently
- 80 6 20 // draw : raise weapon
- 86 6 20 // duck : crouch quickly
- 92 12 20 // duckwalk : crouch walking
-104 10 20 // duckjump : jump from crouching position, stays on last frame until you land
-114 20 20 // duckidle : crouched
-134 30 20 // idle : standing
-164 10 20 // jump : jump, stays on last frame until you land
-174 10 20 // pain1 : flinch from pain
-184 10 20 // pain2 : flinch differently
-194 6 20 // shoot : 300ms shooting anim, may be played faster/slower by code, used for all weapons
-200 1 20 // taunt : not used
-201 10 20 // run : run forward
-211 10 20 // runbackwards : run backwards
-221 10 20 // strafeleft : fast shuffling to the left
-231 10 20 // straferight : fast shuffling to the right
-241 10 20 // forwardright : running forward and right
-251 10 20 // forwardleft : running forward and left
-261 10 20 // backright : running backward and right
-271 10 20 // backleft : running backward and left
\ No newline at end of file
set g_balance_rifle_bursttime 0
set g_balance_rifle_primary_tracer 1
set g_balance_rifle_primary_shots 1
-set g_balance_rifle_primary_damage 40
-set g_balance_rifle_primary_headshotaddeddamage 40
+set g_balance_rifle_primary_damage 80
set g_balance_rifle_primary_spread 0
set g_balance_rifle_primary_force 100
set g_balance_rifle_primary_speed 40000
set g_balance_rifle_secondary_reload 0
set g_balance_rifle_secondary_tracer 0
set g_balance_rifle_secondary_shots 4
-set g_balance_rifle_secondary_damage 10
-set g_balance_rifle_secondary_headshotaddeddamage 20
+set g_balance_rifle_secondary_damage 20
set g_balance_rifle_secondary_spread 0.04
set g_balance_rifle_secondary_force 50
set g_balance_rifle_secondary_speed 20000
entcs_receiver[self.sv_entnum] = self;
self.entremove = Ent_RemoveEntCS;
+ self.iflags |= IFLAG_ORIGIN;
InterpolateOrigin_Note();
}
precache_sound (strcat("announcer/", autocvar_cl_announcer, "/yoda.wav"));
precache_sound (strcat("announcer/", autocvar_cl_announcer, "/amazing.wav"));
precache_sound (strcat("announcer/", autocvar_cl_announcer, "/awesome.wav"));
- precache_sound (strcat("announcer/", autocvar_cl_announcer, "/headshot.wav"));
precache_sound (strcat("announcer/", autocvar_cl_announcer, "/impressive.wav"));
precache_sound (strcat("announcer/", autocvar_cl_announcer, "/prepareforbattle.wav"));
float autocvar_hud_panel_radar_rotation;
float autocvar_hud_panel_radar_scale;
float autocvar_hud_panel_radar_zoommode;
+float autocvar_hud_panel_radar_maximized_rotation;
+float autocvar_hud_panel_radar_maximized_zoommode;
float autocvar_hud_panel_score;
float autocvar_hud_panel_score_rankings;
float autocvar_hud_panel_timer;
}
else
{
- traceline(self.origin + '0 0 1' * self.maxs_z, self.origin + '0 0 1' * (self.mins_z - 4), MOVE_NOMONSTERS, self);
- if(trace_startsolid || trace_fraction < 1)
+ tracebox(self.origin + '0 0 1', self.mins, self.maxs, self.origin - '0 0 1', MOVE_NORMAL, self);
+ if(trace_fraction < 1 && trace_plane_normal_z > 0.7)
onground = 1;
}
animdecide_init(self);
CSQCModel_InterpolateAnimation_2To4_Do();
if(doblend)
{
- skeleton_from_frames(self);
+ skeleton_from_frames(self, self.csqcmodel_isdead);
}
else
{
void CSQCModel_Hook_PreUpdate(float isnew, float isplayer, float islocalplayer)
{
+ // interpolate v_angle
+ self.iflags |= IFLAG_V_ANGLE_X;
// revert to values from server
CSQCModel_Effects_PreUpdate();
if(self.isplayermodel)
sf = ReadByte();
self.HookSilent = (sf & 0x80);
- self.iflags = IFLAG_VELOCITY;
+ self.iflags = IFLAG_VELOCITY | IFLAG_ORIGIN;
InterpolateOrigin_Undo();
{
s = "notify_melee_shotgun";
}
- else if(type & HITTYPE_HEADSHOT && (w == WEP_RIFLE || w == WEP_MINSTANEX)) // all headshot weapons go here
- {
- s = "notify_headshot";
- }
else if(WEP_VALID(w))
{
self = get_weaponinfo(w);
HUD_Panel_UpdateCvars(radar);
HUD_Panel_ApplyFadeAlpha();
+
+ float f = 0;
if (hud_panel_radar_maximized && !autocvar__hud_configure)
{
panel_bg = strcat(hud_skin_path, "/border_default"); // always use the default border when maximized
if(precache_pic(panel_bg) == "") { panel_bg = "gfx/hud/default/border_default"; } // fallback
+
+ switch(hud_panel_radar_maximized_zoommode)
+ {
+ default:
+ case 0:
+ f = current_zoomfraction;
+ break;
+ case 1:
+ f = 1 - current_zoomfraction;
+ break;
+ case 2:
+ f = 0;
+ break;
+ case 3:
+ f = 1;
+ break;
+ }
+
+ switch(hud_panel_radar_maximized_rotation)
+ {
+ case 0:
+ teamradar_angle = view_angles_y - 90;
+ break;
+ default:
+ teamradar_angle = 90 * hud_panel_radar_maximized_rotation;
+ break;
+ }
+ }
+ if (!hud_panel_radar_maximized && !autocvar__hud_configure)
+ {
+ switch(hud_panel_radar_zoommode)
+ {
+ default:
+ case 0:
+ f = current_zoomfraction;
+ break;
+ case 1:
+ f = 1 - current_zoomfraction;
+ break;
+ case 2:
+ f = 0;
+ break;
+ case 3:
+ f = 1;
+ break;
+ }
+
+ switch(hud_panel_radar_rotation)
+ {
+ case 0:
+ teamradar_angle = view_angles_y - 90;
+ break;
+ default:
+ teamradar_angle = 90 * hud_panel_radar_rotation;
+ break;
+ }
}
vector pos, mySize;
float color2;
entity tm;
float scale2d, normalsize, bigsize;
- float f;
teamradar_origin2d = pos + 0.5 * mySize;
teamradar_size2d = mySize;
teamradar_loadcvars();
- switch(hud_panel_radar_zoommode)
- {
- default:
- case 0:
- f = current_zoomfraction;
- break;
- case 1:
- f = 1 - current_zoomfraction;
- break;
- case 2:
- f = 0;
- break;
- case 3:
- f = 1;
- break;
- }
-
- switch(hud_panel_radar_rotation)
- {
- case 0:
- teamradar_angle = view_angles_y - 90;
- break;
- default:
- teamradar_angle = 90 * hud_panel_radar_rotation;
- break;
- }
-
scale2d = vlen_maxnorm2d(mi_picmax - mi_picmin);
teamradar_size2d = mySize;
teamradar_extraclip_mins = teamradar_extraclip_maxs = '0 0 0'; // we always center
// pixels per world qu to match the teamradar_size2d_x range in the longest dimension
- if(hud_panel_radar_rotation == 0)
+ if((hud_panel_radar_rotation == 0 && !hud_panel_radar_maximized) || (hud_panel_radar_maximized_rotation == 0 && hud_panel_radar_maximized))
{
// max-min distance must fit the radar in any rotation
bigsize = vlen_minnorm2d(teamradar_size2d) * scale2d / (1.05 * vlen2d(mi_scale));
HUD_Write_PanelCvar_q("_scale");
HUD_Write_PanelCvar_q("_maximized_scale");
HUD_Write_PanelCvar_q("_maximized_size");
+ HUD_Write_PanelCvar_q("_maximized_rotation");
+ HUD_Write_PanelCvar_q("_maximized_zoommode");
break;
case HUD_PANEL_SCORE:
HUD_Write_PanelCvar_q("_rankings");
self.count = (f & 0xF0);
if(self.count & 0x80)
- self.iflags = IFLAG_VELOCITY;
+ self.iflags = IFLAG_VELOCITY | IFLAG_ORIGIN;
else
- self.iflags = IFLAG_ANGLES;
+ self.iflags = IFLAG_ANGLES | IFLAG_ORIGIN;
if(f & 1)
{
const vector GETPLAYERORIGIN_ERROR = '1123581321 2357111317 3141592653'; // way out of bounds for anything on the map
vector getplayerorigin(float pl)
{
- string s;
entity e;
e = CSQCModel_server2csqc(pl + 1);
if(e)
return e.origin;
-#ifndef NO_LEGACY_NETWORKING
- s = getplayerkeyvalue(pl, "TEMPHACK_origin");
- if(s != "")
- return stov(s);
-#endif
-
e = entcs_receiver[pl];
if(e)
return e.origin;
e.bone_weapon = gettagindex(e, "bip01 r hand");
for(i = 0; i < MAX_AIM_BONES; ++i)
{
- e.bone_aim[i] = 0;
- e.bone_aimweight[i] = 0;
+ e.(bone_aim[i]) = 0;
+ e.(bone_aimweight[i]) = 0;
}
e.fixbone = 0;
if(get_model_parameters(e.model, e.skin))
for(i = 0; i < MAX_AIM_BONES; ++i)
{
if(get_model_parameters_bone_aim[i])
- e.bone_aim[i] = gettagindex(e, get_model_parameters_bone_aim[i]);
+ e.(bone_aim[i]) = gettagindex(e, get_model_parameters_bone_aim[i]);
if(e.bone_aim[i])
- e.bone_aimweight[i] = get_model_parameters_bone_aimweight[i];
+ e.(bone_aimweight[i]) = get_model_parameters_bone_aimweight[i];
}
}
else
}
}
-void skeleton_from_frames(entity e)
+void skeleton_from_frames(entity e, float is_dead)
{
float i;
float m = e.modelindex;
skel_set_boneabs(s, e.bone_upperbody, org);
}
- for(i = 0; i < MAX_AIM_BONES; ++i)
+ if(!is_dead)
{
- if(e.bone_aim[i])
+ for(i = 0; i < MAX_AIM_BONES; ++i)
{
- vector aim = '1 0 0' * bound(-90, self.v_angle_x, 90) * e.bone_aimweight[i];
- vector org = skel_get_boneabs(s, e.bone_aim[i]);
- vector ang_cur = fixedvectoangles2(v_forward, v_up);
- vector ang = AnglesTransform_Multiply(aim, ang_cur);
- fixedmakevectors(ang);
- skel_set_boneabs(s, e.bone_aim[i], org);
+ if(e.(bone_aim[i]))
+ {
+ vector aim = '1 0 0' * bound(-90, self.v_angle_x, 90) * e.(bone_aimweight[i]);
+ vector org = skel_get_boneabs(s, e.(bone_aim[i]));
+ vector ang_cur = fixedvectoangles2(v_forward, v_up);
+ vector ang = AnglesTransform_Multiply(aim, ang_cur);
+ fixedmakevectors(ang);
+ skel_set_boneabs(s, e.(bone_aim[i]), org);
+ }
}
}
}
void free_skeleton_from_frames(entity e);
-void skeleton_from_frames(entity e);
+void skeleton_from_frames(entity e, float is_dead);
void skeleton_loadinfo(entity e);
.float bone_upperbody;
f = ReadByte();
self.count = (f & 0x80);
- self.iflags = (self.iflags & IFLAG_INTERNALMASK) | IFLAG_AUTOANGLES | IFLAG_ANGLES;
+ self.iflags = (self.iflags & IFLAG_INTERNALMASK) | IFLAG_AUTOANGLES | IFLAG_ANGLES | IFLAG_ORIGIN;
self.solid = SOLID_TRIGGER;
//self.effects = EF_NOMODELFLAGS;
float hud_panel_radar_rotation;
noref vector hud_panel_radar_size; // fteqcc sucks
float hud_panel_radar_zoommode;
+float hud_panel_radar_maximized_zoommode;
+float hud_panel_radar_maximized_rotation;
void teamradar_loadcvars()
{
hud_panel_radar_foreground_alpha = autocvar_hud_panel_radar_foreground_alpha * panel_fg_alpha;
hud_panel_radar_rotation = autocvar_hud_panel_radar_rotation;
hud_panel_radar_zoommode = autocvar_hud_panel_radar_zoommode;
+ hud_panel_radar_maximized_rotation = autocvar_hud_panel_radar_maximized_rotation;
+ hud_panel_radar_maximized_zoommode = autocvar_hud_panel_radar_maximized_zoommode;
// others default to 0
// match this to defaultXonotic.cfg!
InterpolateOrigin_Undo();
- self.iflags = IFLAG_VELOCITY;
+ self.iflags = IFLAG_VELOCITY | IFLAG_ORIGIN;
self.classname = "radarlink";
if(sendflags & 1)
var .vector fld;
InterpolateOrigin_Undo();
- self.iflags = IFLAG_ANGLES;
+ self.iflags = IFLAG_ANGLES | IFLAG_ORIGIN;
if(self.bgmscriptangular)
fld = angles;
self.draw2d = Draw_WaypointSprite;
InterpolateOrigin_Undo();
+ self.iflags |= IFLAG_ORIGIN;
if(sendflags & 0x80)
{
float HITTYPE_SECONDARY = 0x100;
float HITTYPE_SPLASH = 0x200; // automatically set by RadiusDamage
float HITTYPE_BOUNCE = 0x400;
-float HITTYPE_HEADSHOT = 0x800; // automatically set by Damage (if headshotbonus is set)
+float HITTYPE_RESERVED2 = 0x800;
float HITTYPE_RESERVED = 0x1000; // unused yet
// macros to access these
# define TAG_ENTITY_TYPE entity
#endif
+// new fields
+.vector v_angle;
+
// add properties you want networked to CSQC here
#define CSQCMODEL_EXTRAPROPERTIES \
CSQCMODEL_PROPERTY(1, float, ReadShort, WriteShort, colormap) \
//vector PL_CROUCH_VIEW_OFS = ...;
#ifdef SVQC
-# ifdef NO_LEGACY_NETWORKING
-# define CSQCMODEL_AUTOINIT() CSQCModel_LinkEntity()
-# define CSQCMODEL_AUTOUPDATE() CSQCModel_CheckUpdate()
-# else
-.float iscsqcmodel;
-float autocvar_sv_use_csqc_players;
-# define CSQCMODEL_AUTOINIT() \
- if(autocvar_sv_use_csqc_players) \
- { \
- CSQCModel_LinkEntity(); \
- self.iscsqcmodel = 1; \
- } \
- else \
- self.iscsqcmodel = 0
-# define CSQCMODEL_AUTOUPDATE() \
- if(autocvar_sv_use_csqc_players && !self.iscsqcmodel) \
- { \
- CSQCModel_LinkEntity(); \
- self.iscsqcmodel = 1; \
- } \
- if(!autocvar_sv_use_csqc_players && self.iscsqcmodel) \
- { \
- CSQCModel_UnlinkEntity(); \
- self.iscsqcmodel = 0; \
- } \
- if(self.iscsqcmodel) \
- CSQCModel_CheckUpdate()
-# endif
+# define CSQCMODEL_AUTOINIT() CSQCModel_LinkEntity()
+# define CSQCMODEL_AUTOUPDATE() CSQCModel_CheckUpdate()
#endif
#define CSQCMODEL_EF_RESPAWNGHOST EF_SELECTABLE
if(!CSQCPlayer_IsLocalPlayer())
InterpolateOrigin_Do();
- // TODO csqcplayers: run prediction here too
CSQCModel_InterpolateAnimation_Do();
{ CSQCMODEL_HOOK_PREDRAW }
local noref float isnolocalplayer = (isplayer && (self.entnum != player_localnum + 1));
self.classname = "csqcmodel";
+ self.iflags |= IFLAG_ORIGIN; // interpolate origin too
self.iflags |= IFLAG_ANGLES; // interpolate angles too
self.iflags |= IFLAG_VELOCITY | IFLAG_AUTOVELOCITY; // let's calculate velocity automatically
}
else
{
+ float flg = self.iflags;
+ self.iflags &~= IFLAG_ORIGIN | IFLAG_ANGLES;
+ InterpolateOrigin_Do();
+ self.iflags = flg;
+
if(csqcplayer_status == CSQCPLAYERSTATUS_FROMSERVER)
{
vector o, v;
.vector ivelocity1, ivelocity2;
.vector iforward1, iforward2;
.vector iup1, iup2;
+.vector ivforward1, ivforward2;
+.vector ivup1, ivup2;
.float itime1, itime2;
void InterpolateOrigin_Reset()
{
else
self.iflags |= IFLAG_PREVALID;
- self.iorigin1 = self.iorigin2;
- self.iorigin2 = self.origin;
+ if(self.iflags & IFLAG_ORIGIN)
+ {
+ self.iorigin1 = self.iorigin2;
+ self.iorigin2 = self.origin;
+ }
if(self.iflags & IFLAG_AUTOANGLES)
if(self.iorigin2 != self.iorigin1)
self.iup2 = v_up;
}
+ if(self.iflags & IFLAG_V_ANGLE)
+ {
+ fixedmakevectors(self.v_angle);
+ if(f0 & IFLAG_VALID)
+ {
+ self.ivforward1 = self.ivforward2;
+ self.ivup1 = self.ivup2;
+ }
+ else
+ {
+ self.ivforward1 = v_forward;
+ self.ivup1 = v_up;
+ }
+ self.ivforward2 = v_forward;
+ self.ivup2 = v_up;
+ }
+ else if(self.iflags & IFLAG_V_ANGLE_X)
+ {
+ self.ivforward1_x = self.ivforward2_x;
+ self.ivforward2_x = self.v_angle_x;
+ }
+
if(self.iflags & IFLAG_VELOCITY)
{
self.ivelocity1 = self.ivelocity2;
{
float f;
f = bound(0, (time - self.itime1) / (self.itime2 - self.itime1), 1 + autocvar_cl_lerpexcess);
- self.origin = (1 - f) * self.iorigin1 + f * self.iorigin2;
+ if(self.iflags & IFLAG_ORIGIN)
+ setorigin(self, (1 - f) * self.iorigin1 + f * self.iorigin2);
if(self.iflags & IFLAG_ANGLES)
{
forward = (1 - f) * self.iforward1 + f * self.iforward2;
up = (1 - f) * self.iup1 + f * self.iup2;
self.angles = fixedvectoangles2(forward, up);
}
+ if(self.iflags & IFLAG_V_ANGLE)
+ {
+ forward = (1 - f) * self.ivforward1 + f * self.ivforward2;
+ up = (1 - f) * self.ivup1 + f * self.ivup2;
+ self.v_angle = fixedvectoangles2(forward, up);
+ }
+ else if(self.iflags & IFLAG_V_ANGLE_X)
+ self.v_angle_x = (1 - f) * self.ivforward1_x + f * self.ivforward2_x;
if(self.iflags & IFLAG_VELOCITY)
self.velocity = (1 - f) * self.ivelocity1 + f * self.ivelocity2;
}
}
void InterpolateOrigin_Undo()
{
- setorigin(self, self.iorigin2);
+ if(self.iflags & IFLAG_ORIGIN)
+ setorigin(self, self.iorigin2);
if(self.iflags & IFLAG_ANGLES)
self.angles = fixedvectoangles2(self.iforward2, self.iup2);
+ if(self.iflags & IFLAG_V_ANGLE)
+ self.v_angle = fixedvectoangles2(self.ivforward2, self.ivup2);
+ else if(self.iflags & IFLAG_V_ANGLE_X)
+ self.v_angle_x = self.ivforward2_x;
if(self.iflags & IFLAG_VELOCITY)
self.velocity = self.ivelocity2;
}
#define IFLAG_PREVALID 16
#define IFLAG_TELEPORTED 32
#define IFLAG_AUTOVELOCITY 64
+#define IFLAG_V_ANGLE 128
+#define IFLAG_V_ANGLE_X 256
+#define IFLAG_ORIGIN 512
#define IFLAG_INTERNALMASK (IFLAG_VALID | IFLAG_PREVALID)
// call this BEFORE reading an entity update
// call this BEFORE drawing
void InterpolateOrigin_Do();
+
+// in case we interpolate that:
+.vector v_angle;
e.configureXonoticTextSliderValues(e);
setDependent(e, "cl_gentle", 0, 0);
me.TR(me);
- #ifdef ALLOW_FORCEMODELS
- me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Force models:")));
- me.TD(me, 1, 2/3, e = makeXonoticRadioButton(6, string_null, string_null, ZCTX(_("MDL^None"))));
- me.TD(me, 1, 2/3, e = makeXonoticRadioButton(6, "cl_forceplayermodelsfromxonotic", string_null, ZCTX(_("MDL^Custom"))));
- me.TD(me, 1, 2/3, e = makeXonoticRadioButton(6, "cl_forceplayermodels", string_null, ZCTX(_("MDL^All"))));
- #endif
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_forceplayermodels", _("Force player models to mine")));
me.TR(me);
{
float i;
string s;
- MapInfo_FilterGametype(MAPINFO_TYPE_ALL, 0, 0, MAPINFO_FLAG_FORBIDDEN | MAPINFO_FLAG_HIDDEN, 0); // all
+ MapInfo_FilterGametype(MAPINFO_TYPE_ALL, 0, 0, MapInfo_ForbiddenFlags(), 0); // all
s = "";
for(i = 0; i < MapInfo_count; ++i)
s = strcat(s, " ", MapInfo_BSPName_ByID(i));
float autocvar_g_balance_rifle_primary_burstcost;
float autocvar_g_balance_rifle_primary_damage;
float autocvar_g_balance_rifle_primary_force;
-float autocvar_g_balance_rifle_primary_headshotaddeddamage;
float autocvar_g_balance_rifle_primary_lifetime;
float autocvar_g_balance_rifle_primary_refire;
float autocvar_g_balance_rifle_primary_shots;
float autocvar_g_balance_rifle_secondary_burstcost;
float autocvar_g_balance_rifle_secondary_damage;
float autocvar_g_balance_rifle_secondary_force;
-float autocvar_g_balance_rifle_secondary_headshotaddeddamage;
float autocvar_g_balance_rifle_secondary_lifetime;
float autocvar_g_balance_rifle_secondary_reload;
float autocvar_g_balance_rifle_secondary_refire;
float autocvar_g_balance_uzi_first;
float autocvar_g_balance_uzi_first_ammo;
float autocvar_g_balance_uzi_first_damage;
-float autocvar_g_balance_uzi_first_headshotaddeddamage;
float autocvar_g_balance_uzi_first_force;
float autocvar_g_balance_uzi_first_refire;
float autocvar_g_balance_uzi_first_spread;
float autocvar_g_balance_uzi_spread_min;
float autocvar_g_balance_uzi_sustained_ammo;
float autocvar_g_balance_uzi_sustained_damage;
-float autocvar_g_balance_uzi_sustained_headshotaddeddamage;
float autocvar_g_balance_uzi_sustained_force;
float autocvar_g_balance_uzi_sustained_refire;
float autocvar_g_balance_uzi_sustained_spread;
self.skin = stof(self.playerskin);
}
- if(chmdl || oldskin != self.skin)
- self.species = player_getspecies(); // model or skin has changed
+ if(chmdl || oldskin != self.skin) // model or skin has changed
+ {
+ self.species = player_getspecies(); // update species
+ UpdatePlayerSounds(); // update skin sounds
+ }
if(!teamplay)
if(strlen(autocvar_sv_defaultplayercolors))
if(frametime)
{
-#ifndef NO_LEGACY_NETWORKING
- self.glowmod = colormapPaletteColor(self.clientcolors & 0x0F, TRUE) * 2;
-#endif
-
if(self.weapon == WEP_NEX && autocvar_g_balance_nex_charge)
{
self.weaponentity_glowmod_x = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_animlimit);
=============
*/
.float idlekick_lasttimeleft;
-.entity showheadshotbbox;
-void showheadshotbbox_think()
-{
- if(self.owner.showheadshotbbox != self)
- {
- remove(self);
- return;
- }
- self.nextthink = time;
- setorigin(self, self.owner.origin);
- setsize(self, GetHeadshotMins(self.owner), GetHeadshotMaxs(self.owner));
-}
void PlayerPostThink (void)
{
// Savage: Check for nameless players
if(self.waypointsprite_attachedforcarrier)
WaypointSprite_UpdateHealth(self.waypointsprite_attachedforcarrier, '1 0 0' * healtharmor_maxdamage(self.health, self.armorvalue, autocvar_g_balance_armor_blockpercent));
- if(self.classname == "player" && self.deadflag == DEAD_NO && autocvar_r_showbboxes)
- {
- if(!self.showheadshotbbox)
- {
- self.showheadshotbbox = spawn();
- self.showheadshotbbox.classname = "headshotbbox";
- self.showheadshotbbox.owner = self;
- self.showheadshotbbox.think = showheadshotbbox_think;
- self.showheadshotbbox.nextthink = time;
- self = self.showheadshotbbox;
- self.think();
- self = self.owner;
- }
- }
- else
- {
- if(self.showheadshotbbox)
- if(self.showheadshotbbox && !wasfreed(self.showheadshotbbox))
- remove(self.showheadshotbbox);
- }
-
playerdemo_write();
if((g_cts || g_race) && self.cvar_cl_allow_uidtracking == 1 && self.cvar_cl_allow_uid2name == 1)
animdecide_setstate(self, animbits, FALSE);
animdecide_setimplicitstate(self, (self.flags & FL_ONGROUND));
-#ifndef NO_LEGACY_NETWORKING
- if(!self.iscsqcmodel)
- animdecide_setframes(self, FALSE, frame, frame1time, frame2, frame2time);
-#endif
-
if (self.weaponentity)
{
updateanim(self.weaponentity);
.entity flagcarried;
-.entity lastrocket;
-
.float playerid;
float playerid_last;
.float noalign; // if set to 1, the item or spawnpoint won't be dropped to the floor
.string cvar_g_xonoticversion;
.string cvar_cl_weaponpriority;
.string cvar_cl_weaponpriorities[10];
-#ifdef ALLOW_FORCEMODELS
-.float cvar_cl_forceplayermodels;
-.float cvar_cl_forceplayermodelsfromxonotic;
-float sv_clforceplayermodels;
-#endif
.float cvar_cl_gunalign;
.float cvar_cl_noantilag;
.float clip_load;
.float old_clip_load;
.float clip_size;
+
+.entity lastrocket;
.float minelayer_mines;
+.float nex_charge;
+.float nex_charge_rottime;
+.float nex_chargepool_ammo;
+.float hagar_load;
.float grab; // 0 = can't grab, 1 = owner can grab, 2 = owner and team mates can grab, 3 = anyone can grab
.void (float act_state) setactive;
.entity realowner;
-.float nex_charge;
-.float nex_charge_rottime;
-.float nex_chargepool_ammo;
-
-.float hagar_load;
-
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 yoda;
float damage_goodhits;
float damage_gooddamage;
-float headshot;
-float damage_headshotbonus; // bonus multiplier for head shots, set to 0 after use
.float dmg_team;
.float teamkill_complain;
return 1;
}
-vector GetHeadshotMins(entity targ)
-{
- return '-0.5 0 0' * PL_HEAD_x + '0 -0.5 0' * PL_HEAD_y + '0 0 1' * (targ.maxs_z - PL_HEAD_z);
-}
-vector GetHeadshotMaxs(entity targ)
-{
- return '0.5 0 0' * PL_HEAD_x + '0 0.5 0' * PL_HEAD_y + '0 0 1' * targ.maxs_z;
-}
-
void UpdateFrags(entity player, float f)
{
PlayerTeamScore_AddScore(player, f);
{
float mirrordamage;
float mirrorforce;
- float teamdamage0;
+ float complainteamdamage = 0;
entity attacker_save;
mirrordamage = 0;
mirrorforce = 0;
{
if(targ.classname == "player" && targ.deadflag == DEAD_NO)
{
- teamdamage0 = max(attacker.dmg_team, autocvar_g_teamdamage_threshold);
attacker.dmg_team = attacker.dmg_team + damage;
- if(attacker.dmg_team > teamdamage0 && !g_ca)
- mirrordamage = autocvar_g_mirrordamage * (attacker.dmg_team - teamdamage0);
+ complainteamdamage = attacker.dmg_team - autocvar_g_teamdamage_threshold;
+ if(complainteamdamage > 0 && !g_ca) // FIXME why is g_ca ruled out here? Why not just g_mirrordamage 0 on CA servers?
+ mirrordamage = autocvar_g_mirrordamage * complainteamdamage;
mirrorforce = autocvar_g_mirrordamage * vlen(force);
if(g_minstagib)
{
{
damage = 0;
mirrordamage = 0;
+ complainteamdamage = 0;
if (targ != attacker)
{
if ((targ.health >= 1) && (targ.classname == "player"))
{
damage *= g_weapondamagefactor;
mirrordamage *= g_weapondamagefactor;
+ complainteamdamage *= g_weapondamagefactor;
force = force * g_weaponforcefactor;
mirrorforce *= g_weaponforcefactor;
}
if(targ.takedamage == DAMAGE_AIM)
if(targ != attacker)
{
- if(damage_headshotbonus)
- {
- if(targ.classname == "player")
- {
- // HEAD SHOT:
- // find height of hit on player axis
- // if above view_ofs and below maxs, and also in the middle half of the bbox, it is head shot
- vector headmins, headmaxs, org;
- org = antilag_takebackorigin(targ, time - ANTILAG_LATENCY(attacker));
- headmins = org + GetHeadshotMins(targ);
- headmaxs = org + GetHeadshotMaxs(targ);
- if(trace_hits_box(railgun_start, railgun_end, headmins, headmaxs))
- {
- deathtype |= HITTYPE_HEADSHOT;
- }
- }
- else if(targ.classname == "turret_head")
- {
- deathtype |= HITTYPE_HEADSHOT;
- }
- if(deathtype & HITTYPE_HEADSHOT)
- if(damage_headshotbonus > 0)
- damage *= 1 + damage_headshotbonus;
- }
-
entity victim;
if((targ.vehicle_flags & VHF_ISVEHICLE) && targ.owner)
victim = targ.owner;
if(g_minstagib)
if(victim.items & IT_STRENGTH)
yoda = 1;
-
- if(deathtype & HITTYPE_HEADSHOT)
- headshot = 1;
}
}
}
{
attacker.typehitsound += 1;
}
- if(mirrordamage > 0)
+ if(complainteamdamage > 0)
if(time > attacker.teamkill_complain)
{
attacker.teamkill_complain = time + 5;
BADCVAR("gameversion");
BADPREFIX("gameversion_");
BADCVAR("sv_namechangetimer");
-#ifndef NO_LEGACY_NETWORKING
- BADCVAR("sv_use_csqc_players"); // transition
-#endif
// allowed changes to server admins (please sync this to server.cfg)
// vi commands:
for(i = 0, j = 0; i < MapInfo_count; ++i)
{
if(MapInfo_Get_ByID(i))
- if not(MapInfo_Map_flags & (MAPINFO_FLAG_HIDDEN | MAPINFO_FLAG_FORBIDDEN))
+ if not(MapInfo_Map_flags & MapInfo_ForbiddenFlags())
{
if(mod(i, 2))
col = "^2";
self.cvar_cl_accuracy_data_share = boolean(self.cvar_cl_accuracy_data_share);
self.cvar_cl_accuracy_data_receive = boolean(self.cvar_cl_accuracy_data_receive);
-#ifdef ALLOW_FORCEMODELS
- GetCvars_handleFloat(s, f, cvar_cl_forceplayermodels, "cl_forceplayermodels");
- GetCvars_handleFloat(s, f, cvar_cl_forceplayermodelsfromxonotic, "cl_forceplayermodelsfromxonotic");
-#endif
GetCvars_handleFloatOnce(s, f, cvar_cl_gunalign, "cl_gunalign");
GetCvars_handleFloat(s, f, cvar_cl_allow_uid2name, "cl_allow_uid2name");
GetCvars_handleFloat(s, f, cvar_cl_allow_uidtracking, "cl_allow_uidtracking");
g_touchexplode_edgedamage = cvar("g_touchexplode_edgedamage");
g_touchexplode_force = cvar("g_touchexplode_force");
-#ifdef ALLOW_FORCEMODELS
- sv_clforceplayermodels = cvar("sv_clforceplayermodels");
-#endif
-
sv_clones = cvar("sv_clones");
sv_gentle = cvar("sv_gentle");
sv_foginterval = cvar("sv_foginterval");
//.float bulletcounter;
void turret_machinegun_attack()
{
- fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET_MACHINEGUN, 0, 1, autocvar_g_balance_uzi_bulletconstant);
+ fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, self.shot_force, DEATH_TURRET_MACHINEGUN, 0, 1, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
UziFlash();
void walker_attack()
{
sound (self, CH_WEAPON_A, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
- fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated, self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET_WALKER_GUN, 0, 1, autocvar_g_balance_uzi_bulletconstant);
+ fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated, self.shot_spread, self.shot_speed, 5, self.shot_dmg, self.shot_force, DEATH_TURRET_WALKER_GUN, 0, 1, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
}
v_forward = normalize(v_forward);
v += v_forward * 50;
-//void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float headshotbonus, float force, float dtype, float tracereffects, float gravityfactor, float bulletconstant)
+//void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float force, float dtype, float tracereffects, float gravityfactor, float bulletconstant)
fireBallisticBullet(v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_speed,
- 5, autocvar_g_vehicle_spiderbot_minigun_damage, 0, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_SBMINIGUN, 0, 1, autocvar_g_vehicle_spiderbot_minigun_bulletconstant);
+ 5, autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_SBMINIGUN, 0, 1, autocvar_g_vehicle_spiderbot_minigun_bulletconstant);
endFireBallisticBullet();
// fireBullet (v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_damage,
trace_dphitq3surfaceflags = endq3surfaceflags;
}
-.float dmg_edge;
.float dmg_force;
.float dmg_radius;
.float dmg_total;
{
endzcurveparticles();
- headshot = 0;
yoda = 0;
- damage_headshotbonus = self.dmg_edge * f;
railgun_start = self.origin - 2 * frametime * self.velocity;
railgun_end = self.origin + 2 * frametime * self.velocity;
g = accuracy_isgooddamage(self.realowner, other);
Damage(other, self, self.realowner, self.dmg * f, self.projectiledeathtype, self.origin, self.dmg_force * normalize(self.velocity) * f);
- damage_headshotbonus = 0;
- if(headshot)
- f *= q;
- if(self.dmg_edge > 0)
- {
- if(headshot)
- AnnounceTo(self.realowner, "headshot");
- if(yoda)
- AnnounceTo(self.realowner, "awesome");
- }
+ if(yoda)
+ AnnounceTo(self.realowner, "awesome");
// calculate hits for ballistic weapons
if(g)
self.owner = world;
}
-void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float headshotbonus, float force, float dtype, float tracereffects, float gravityfactor, float bulletconstant)
+void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float force, float dtype, float tracereffects, float gravityfactor, float bulletconstant)
{
float lag, dt, savetime; //, density;
entity pl, oldself;
proj.touch = W_BallisticBullet_Touch;
proj.dmg = damage;
- proj.dmg_edge = headshotbonus;
proj.dmg_force = force;
proj.projectiledeathtype = dtype;
{
PROJECTILE_TOUCH;
if (other.takedamage == DAMAGE_AIM)
- if(Fire_AddDamage(other, self.realowner, autocvar_g_balance_fireball_secondary_damage, autocvar_g_balance_fireball_secondary_damagetime, self.projectiledeathtype | HITTYPE_HEADSHOT) >= 0)
+ if(Fire_AddDamage(other, self.realowner, autocvar_g_balance_fireball_secondary_damage, autocvar_g_balance_fireball_secondary_damagetime, self.projectiledeathtype) >= 0)
{
remove(self);
return;
{
if(w_deathtype & HITTYPE_SECONDARY)
{
- if(w_deathtype & HITTYPE_HEADSHOT)
- w_deathtypestring = _("%s tried to catch %s's firemine");
- else
- w_deathtypestring = _("%s fatefully ignored %s's firemine");
+ w_deathtypestring = _("%s fatefully ignored %s's firemine");
}
else
{
void W_Mine_Think (void);
.float minelayer_detonate, mine_explodeanyway;
.float mine_time;
+.vector mine_orientation;
void spawnfunc_weapon_minelayer (void)
{
setmodel(newmine, "models/mine.md3");
newmine.angles = vectoangles(-trace_plane_normal); // face against the surface
- newmine.oldvelocity = self.velocity;
+ newmine.mine_orientation = -trace_plane_normal;
newmine.takedamage = self.takedamage;
newmine.damageforcescale = self.damageforcescale;
self.takedamage = DAMAGE_NO;
if(self.movetype == MOVETYPE_NONE || self.movetype == MOVETYPE_FOLLOW)
- self.velocity = self.oldvelocity;
+ self.velocity = self.mine_orientation; // particle fx and decals need .velocity
RadiusDamage (self, self.realowner, autocvar_g_balance_minelayer_remote_damage, autocvar_g_balance_minelayer_remote_edgedamage, autocvar_g_balance_minelayer_remote_radius, world, autocvar_g_balance_minelayer_remote_force, self.projectiledeathtype | HITTYPE_BOUNCE, world);
entity mine;
for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.realowner == e)
minecount += 1;
-
+
return minecount;
}
if(self.movetype == MOVETYPE_NONE || self.movetype == MOVETYPE_FOLLOW)
return; // we're already a stuck mine, why do we get called? TODO does this even happen?
- PROJECTILE_TOUCH;
+ if(WarpZone_Projectile_Touch())
+ {
+ if(wasfreed(self))
+ self.realowner.minelayer_mines -= 1;
+ return;
+ }
if(other && other.classname == "player" && other.deadflag == DEAD_NO)
{
// scan how many mines we placed, and return if we reached our limit
if(autocvar_g_balance_minelayer_limit)
{
-
- if(W_Mine_Count(self) >= autocvar_g_balance_minelayer_limit)
+ if(self.minelayer_mines >= autocvar_g_balance_minelayer_limit)
{
// the refire delay keeps this message from being spammed
sprint(self, strcat("minelayer: You cannot place more than ^2", ftos(autocvar_g_balance_minelayer_limit), " ^7mines at a time\n") );
if (req == WR_AIM)
{
// aim and decide to fire if appropriate
- self.BUTTON_ATCK = bot_aim(autocvar_g_balance_minelayer_speed, 0, autocvar_g_balance_minelayer_lifetime, FALSE);
+ if(self.minelayer_mines >= autocvar_g_balance_minelayer_limit)
+ self.BUTTON_ATCK = FALSE;
+ else
+ self.BUTTON_ATCK = bot_aim(autocvar_g_balance_minelayer_speed, 0, autocvar_g_balance_minelayer_lifetime, FALSE);
if(skill >= 2) // skill 0 and 1 bots won't detonate mines!
{
// decide whether to detonate mines
else
return FALSE;
}
+ else if (req == WR_RESETPLAYER)
+ {
+ self.minelayer_mines = 0;
+ }
else if (req == WR_RELOAD)
{
W_Reload(autocvar_g_balance_minelayer_ammo, autocvar_g_balance_minelayer_reload_ammo, autocvar_g_balance_minelayer_reload_time, "weapons/reload.wav");
yoda = 0;
damage_goodhits = 0;
- headshot = 0;
- damage_headshotbonus = -1; // no extra damage, just count
FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 10000, 800, 0, 0, 0, 0, WEP_MINSTANEX);
- damage_headshotbonus = 0;
if(g_minstagib)
{
{
if(yoda && flying)
AnnounceTo(self, "yoda");
- if(headshot)
- {
- AnnounceTo(self, "headshot");
- }
if(damage_goodhits && self.minstanex_lasthit)
{
AnnounceTo(self, "impressive");
.float rifle_accumulator;
-void W_Rifle_FireBullet(float pSpread, float pDamage, float pHeadshotAddedDamage, float pForce, float pSpeed, float pLifetime, float pAmmo, float deathtype, float pBulletConstant, float pTracer, float pShots, string pSound)
+void W_Rifle_FireBullet(float pSpread, float pDamage, float pForce, float pSpeed, float pLifetime, float pAmmo, float deathtype, float pBulletConstant, float pTracer, float pShots, string pSound)
{
float i;
W_DecreaseAmmo(ammo_nails, pAmmo, autocvar_g_balance_rifle_reload_ammo);
- W_SetupShot (self, autocvar_g_antilag_bullets && pSpeed >= autocvar_g_antilag_bullets, 2, pSound, CH_WEAPON_A, (pDamage + pHeadshotAddedDamage) * pShots);
+ W_SetupShot (self, autocvar_g_antilag_bullets && pSpeed >= autocvar_g_antilag_bullets, 2, pSound, CH_WEAPON_A, pDamage * pShots);
pointparticles(particleeffectnum("rifle_muzzleflash"), w_shotorg, w_shotdir * 2000, 1);
}
for(i = 0; i < pShots; ++i)
- fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pHeadshotAddedDamage / pDamage, pForce, deathtype, (pTracer ? EF_RED : EF_BLUE), 1, pBulletConstant);
+ fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pForce, deathtype, (pTracer ? EF_RED : EF_BLUE), 1, pBulletConstant);
endFireBallisticBullet();
if (autocvar_g_casings >= 2)
void W_Rifle_Attack()
{
- W_Rifle_FireBullet(autocvar_g_balance_rifle_primary_spread, autocvar_g_balance_rifle_primary_damage, autocvar_g_balance_rifle_primary_headshotaddeddamage, autocvar_g_balance_rifle_primary_force, autocvar_g_balance_rifle_primary_speed, autocvar_g_balance_rifle_primary_lifetime, autocvar_g_balance_rifle_primary_ammo, WEP_RIFLE, autocvar_g_balance_rifle_primary_bulletconstant, autocvar_g_balance_rifle_primary_tracer, autocvar_g_balance_rifle_primary_shots, "weapons/campingrifle_fire.wav");
+ W_Rifle_FireBullet(autocvar_g_balance_rifle_primary_spread, autocvar_g_balance_rifle_primary_damage, autocvar_g_balance_rifle_primary_force, autocvar_g_balance_rifle_primary_speed, autocvar_g_balance_rifle_primary_lifetime, autocvar_g_balance_rifle_primary_ammo, WEP_RIFLE, autocvar_g_balance_rifle_primary_bulletconstant, autocvar_g_balance_rifle_primary_tracer, autocvar_g_balance_rifle_primary_shots, "weapons/campingrifle_fire.wav");
}
void W_Rifle_Attack2()
{
- W_Rifle_FireBullet(autocvar_g_balance_rifle_secondary_spread, autocvar_g_balance_rifle_secondary_damage, autocvar_g_balance_rifle_secondary_headshotaddeddamage, autocvar_g_balance_rifle_secondary_force, autocvar_g_balance_rifle_secondary_speed, autocvar_g_balance_rifle_secondary_lifetime, autocvar_g_balance_rifle_secondary_ammo, WEP_RIFLE | HITTYPE_SECONDARY, autocvar_g_balance_rifle_secondary_bulletconstant, autocvar_g_balance_rifle_secondary_tracer, autocvar_g_balance_rifle_secondary_shots, "weapons/campingrifle_fire2.wav");
+ W_Rifle_FireBullet(autocvar_g_balance_rifle_secondary_spread, autocvar_g_balance_rifle_secondary_damage, autocvar_g_balance_rifle_secondary_force, autocvar_g_balance_rifle_secondary_speed, autocvar_g_balance_rifle_secondary_lifetime, autocvar_g_balance_rifle_secondary_ammo, WEP_RIFLE | HITTYPE_SECONDARY, autocvar_g_balance_rifle_secondary_bulletconstant, autocvar_g_balance_rifle_secondary_tracer, autocvar_g_balance_rifle_secondary_shots, "weapons/campingrifle_fire2.wav");
}
void spawnfunc_weapon_rifle (void)
else
{
if(w_deathtype & HITTYPE_BOUNCE)
- {
- // TODO special headshot message here too?
w_deathtypestring = _("%s failed to hide from %s's rifle");
- }
else
- {
- if(w_deathtype & HITTYPE_HEADSHOT)
- w_deathtypestring = _("%s got shot in the head with a rifle by %s");
- else
- w_deathtypestring = _("%s was sniped with a rifle by %s");
- }
+ w_deathtypestring = _("%s was sniped with a rifle by %s");
}
}
return TRUE;
te_knightspike(org2);
self.event_damage = func_null;
- Damage_DamageInfo(self.origin, 0, 0, 0, self.velocity, WEP_SEEKER | HITTYPE_HEADSHOT, other.species, self);
+ Damage_DamageInfo(self.origin, 0, 0, 0, self.velocity, WEP_SEEKER | HITTYPE_BOUNCE | HITTYPE_SECONDARY, other.species, self);
if (other.takedamage == DAMAGE_AIM && other.deadflag == DEAD_NO)
{
org2 = w_org + w_backoff * 6;
if(w_deathtype & HITTYPE_BOUNCE)
{
- pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
- if(!w_issilent)
+ if(w_deathtype & HITTYPE_SECONDARY)
{
- if (w_random<0.15)
- sound(self, CH_SHOTS, "weapons/tagexp1.wav", 1, ATTN_NORM);
- else if (w_random<0.7)
- sound(self, CH_SHOTS, "weapons/tagexp2.wav", 1, ATTN_NORM);
- else
- sound(self, CH_SHOTS, "weapons/tagexp3.wav", 1, ATTN_NORM);
+ if(!w_issilent)
+ sound(self, CH_SHOTS, "weapons/tag_impact.wav", 1, ATTN_NORM);
+ }
+ else
+ {
+ pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ {
+ if (w_random<0.15)
+ sound(self, CH_SHOTS, "weapons/tagexp1.wav", 1, ATTN_NORM);
+ else if (w_random<0.7)
+ sound(self, CH_SHOTS, "weapons/tagexp2.wav", 1, ATTN_NORM);
+ else
+ sound(self, CH_SHOTS, "weapons/tagexp3.wav", 1, ATTN_NORM);
+ }
}
- }
- else if(w_deathtype & HITTYPE_HEADSHOT)
- {
- if(!w_issilent)
- sound(self, CH_SHOTS, "weapons/tag_impact.wav", 1, ATTN_NORM);
}
else
{
W_SetupShot (self, autocvar_g_antilag_bullets && bulletspeed >= autocvar_g_antilag_bullets, 5, "weapons/shotgun_fire.wav", CH_WEAPON_A, d * bullets);
for (sc = 0;sc < bullets;sc = sc + 1)
- fireBallisticBullet(w_shotorg, w_shotdir, spread, bulletspeed, 5, d, 0, f, WEP_SHOTGUN, 0, 1, bulletconstant);
+ fireBallisticBullet(w_shotorg, w_shotdir, spread, bulletspeed, 5, d, f, WEP_SHOTGUN, 0, 1, bulletconstant);
endFireBallisticBullet();
pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 1000, autocvar_g_balance_shotgun_primary_ammo);
hittype |= HITTYPE_SECONDARY;
if(self.tuba_instrument & 2)
hittype |= HITTYPE_BOUNCE;
- if(self.tuba_instrument & 4)
- hittype |= HITTYPE_HEADSHOT;
if(self.tuba_note)
{
instr |= 1;
if(w_deathtype & HITTYPE_BOUNCE)
instr |= 2;
- if(w_deathtype & HITTYPE_HEADSHOT)
- instr |= 4;
switch(instr)
{
default:
instr |= 1;
if(w_deathtype & HITTYPE_BOUNCE)
instr |= 2;
- if(w_deathtype & HITTYPE_HEADSHOT)
- instr |= 4;
switch(instr)
{
default:
ATTACK_FINISHED(self) = time + autocvar_g_balance_uzi_first_refire * W_WeaponRateFactor();
if (self.misc_bulletcounter == 1)
- fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_first_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_first_damage, autocvar_g_balance_uzi_first_headshotaddeddamage, autocvar_g_balance_uzi_first_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant);
+ fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_first_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_first_damage, autocvar_g_balance_uzi_first_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant);
else
- fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_sustained_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_headshotaddeddamage, autocvar_g_balance_uzi_sustained_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant);
+ fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_sustained_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
pointparticles(particleeffectnum("uzi_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
}
uzi_spread = bound(autocvar_g_balance_uzi_spread_min, autocvar_g_balance_uzi_spread_min + (autocvar_g_balance_uzi_spread_add * self.misc_bulletcounter), autocvar_g_balance_uzi_spread_max);
- fireBallisticBullet(w_shotorg, w_shotdir, uzi_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_headshotaddeddamage, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, 1, autocvar_g_balance_uzi_bulletconstant);
+ fireBallisticBullet(w_shotorg, w_shotdir, uzi_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, 1, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
self.misc_bulletcounter = self.misc_bulletcounter + 1;
self.punchangle_y = random () - 0.5;
}
- fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_burst_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_headshotaddeddamage, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, 1, autocvar_g_balance_uzi_bulletconstant);
+ fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_burst_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, 1, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();