float autocvar_crosshair_rpc_alpha = 1;
float autocvar_crosshair_rpc_size = 1;
int autocvar_cl_nade_timer;
-#endif
\ No newline at end of file
+#endif
void BGMScript_InitEntity(entity e);
float BGMScript(entity e);
-#endif
\ No newline at end of file
+#endif
// used by common/command/generic.qc:GenericCommand_dumpcommands to list all commands into a .txt file
void LocalCommand_macro_write_aliases(int fh);
-#endif
\ No newline at end of file
+#endif
Credits go to Dresk for putting this CSQC scratch source together.
-and Urre :o
\ No newline at end of file
+and Urre :o
{
specstr = species_prefix(specnum);
specstr = substring(specstr, 0, strlen(specstr) - 1);
- effectname = strreplace("BLOOD", specstr, effectname);
+ effectname = strreplace("BLOOD", specstr, effectname);
}
else { return; } // objects don't bleed
}
#define DAMAGE_H
.float total_damages; // number of effects which currently are attached to a player
-#endif
\ No newline at end of file
+#endif
#define player_currententnum (spectatee_status > 0 ? spectatee_status : player_localnum + 1)
float g_balance_porto_secondary;
-#endif
\ No newline at end of file
+#endif
void Ent_GibSplash(bool isNew);
void GibSplash_Precache();
-#endif
\ No newline at end of file
+#endif
// Ammo (#1)
void DrawNadeScoreBar(vector myPos, vector mySize, vector color)
{
-
+
HUD_Panel_DrawProgressBar(
myPos + eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize.x,
mySize - eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize.x,
- autocvar_hud_panel_ammo_progressbar_name,
- getstatf(STAT_NADE_BONUS_SCORE), 0, 0, color,
+ autocvar_hud_panel_ammo_progressbar_name,
+ getstatf(STAT_NADE_BONUS_SCORE), 0, 0, color,
autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
{
float theAlpha = 1, a, b;
vector nade_color, picpos, numpos;
-
+
nade_color = Nade_Color(getstati(STAT_NADE_BONUS_TYPE));
-
+
a = getstatf(STAT_NADE_BONUS);
b = getstatf(STAT_NADE_BONUS_SCORE);
-
+
if(autocvar_hud_panel_ammo_iconalign)
{
numpos = myPos;
{
if(autocvar_hud_panel_ammo_text)
drawstring_aspect(numpos, ftos(a), eX * (2/3) * mySize.x + eY * mySize.y, '1 1 1', panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL);
-
+
if(draw_expanding)
drawpic_aspect_skin_expanding(picpos, "nade_nbg", '1 1 0' * mySize.y, '1 1 1', panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL, expand_time);
-
+
drawpic_aspect_skin(picpos, "nade_bg" , '1 1 0' * mySize.y, '1 1 1', panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL);
drawpic_aspect_skin(picpos, "nade_nbg" , '1 1 0' * mySize.y, nade_color, panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL);
}
columns = ceil((total_ammo_count)/rows);
ammo_size = eX * mySize.x*(1/columns) + eY * mySize.y*(1/rows);
-
+
vector offset = '0 0 0'; // fteqcc sucks
float newSize;
{
buffs = Buff_Type_first.items; // force first buff
}
-
+
float b = 0; // counter to tell other functions that we have buffs
entity e;
string s = "";
//float is_vertical = (panel_ar < 1);
//float buff_iconalign = autocvar_hud_panel_buffs_iconalign;
vector buff_offset = '0 0 0';
-
+
for(e = Buff_Type_first; e; e = e.enemy) if(buffs & e.items)
{
//DrawNumIcon(pos + buff_offset, mySize, shield, "shield", is_vertical, buff_iconalign, '1 1 1', 1);
vector rgb = MapVote_RGB(id);
vector offset = pos;
float nlines = 0;
-
+
if(mv_avail_start[id] != GTV_AVAILABLE)
alpha = 0.2;
else if ( mv_avail[id] != GTV_AVAILABLE && mv_top2_alpha)
alpha = mv_top2_alpha;
else
alpha = 1;
-
+
if(id == mv_selection && mv_avail[id] == GTV_AVAILABLE)
{
drawfill(rect_pos, rect_size, '1 1 1', 0.1, DRAWFLAG_NORMAL);
drawfill(rect_pos, rect_size, rgb, 0.1*alpha, DRAWFLAG_NORMAL);
drawborderlines(autocvar_scoreboard_border_thickness, rect_pos, rect_size, rgb, alpha, DRAWFLAG_NORMAL);
}
-
+
entity title;
title = spawn();
- title.message = MapVote_FormatMapItem(id, MapInfo_Type_ToText(MapInfo_Type_FromString(gtype)),
+ title.message = MapVote_FormatMapItem(id, MapInfo_Type_ToText(MapInfo_Type_FromString(gtype)),
_count, tsize, gtv_text_size);
title.origin = pos-offset;
-
+
pos.y += gtv_text_size_small.y;
pos.y += gtv_text_size.y/2;
-
+
maxh -= gtv_text_size.y;
-
+
entity picent = spawn();
picent.origin = pos-offset;
picent.maxs = '1 1 0 ' * min(maxh, desc_padding) * 0.8;
-
+
pos.x += desc_padding;
tsize -= desc_padding;
-
+
string thelabel = GameTypeVote_DescriptionByID(id), ts;
entity last = title;
entity next = world;
- if( thelabel != "")
+ if( thelabel != "")
{
float i,n = tokenizebyseparator(thelabel, "\n");
for(i = 0; i < n && maxh > (nlines+1)*gtv_text_size_small.y; ++i)
}
}
}
-
+
maxh -= max(nlines*gtv_text_size_small.y,picent.maxs.y);
if ( maxh > 0 )
offset.y += maxh/2;
- drawstring(title.origin+offset, title.message, gtv_text_size, rgb, alpha, DRAWFLAG_NORMAL);
-
+ drawstring(title.origin+offset, title.message, gtv_text_size, rgb, alpha, DRAWFLAG_NORMAL);
+
if(pic != "")
drawpic(picent.origin+offset, pic, picent.maxs, '1 1 1', alpha, DRAWFLAG_NORMAL);
-
+
for ( last = title.chain; last ; )
{
drawstring(last.origin+offset, last.message, gtv_text_size_small, '1 1 1', alpha, DRAWFLAG_NORMAL);
last = last.chain;
remove(next);
}
-
+
remove(picent);
remove(title);
}
if ( mv_selection_keyboard )
return mv_selection;
-
+
return mv_mouse_selection;
}
vector mpos = mv_mousepos + getmousepos();
mpos.x = bound(0, mpos.x, vid_conwidth);
mpos.y = bound(0, mpos.y, vid_conheight);
-
+
if ( mpos.x != mv_mousepos.x || mpos.y != mv_mousepos.y )
mv_selection_keyboard = 0;
mv_mousepos = mpos;
mask = ReadShort();
else
mask = ReadLong();
-
+
for(i = 0, power = 1; i < mv_num_maps; ++i, power *= 2)
mv_avail[i] = (mask & power) ? GTV_AVAILABLE : GTV_FORBIDDEN;
}
mv_timeout = ReadCoord();
gametypevote = ReadByte();
-
+
float mv_real_num_maps = mv_num_maps - mv_abstain;
if(gametypevote)
gtv_text_size = hud_fontsize*1.4;
gtv_text_size_small = hud_fontsize*1.1;
-
+
if (mv_real_num_maps > 8 )
mv_columns = 3;
else
int MapVote_MoveLeft(int pos)
{
int imp;
- if ( pos < 0 )
+ if ( pos < 0 )
imp = mv_num_maps - 1;
else
imp = pos < 1 ? mv_num_maps - 1 : pos - 1;
int MapVote_MoveRight(int pos)
{
int imp;
- if ( pos < 0 )
+ if ( pos < 0 )
imp = 0;
else
imp = pos >= mv_num_maps - 1 ? 0 : pos + 1;
int MapVote_MoveUp(int pos)
{
int imp;
- if ( pos < 0 )
+ if ( pos < 0 )
imp = mv_num_maps - 1;
else
{
int MapVote_MoveDown(int pos)
{
int imp;
- if ( pos < 0 )
+ if ( pos < 0 )
imp = 0;
else
{
void Ent_MapVote();
void Net_MapVote_Picture();
-#endif
\ No newline at end of file
+#endif
vector Accuracy_GetColor(float accuracy);
-#endif
\ No newline at end of file
+#endif
void ModelEffect_Draw();
void Ent_ModelEffect(bool isNew);
-#endif
\ No newline at end of file
+#endif
void _Movetype_CheckWaterTransition(entity ent) // SV_CheckWaterTransition
{
float contents = pointcontents(ent.move_origin);
-
+
if(!ent.move_watertype)
{
// just spawned here
const int FL_ITEM = 256;
const int FL_ONGROUND = 512;
-#endif
\ No newline at end of file
+#endif
float Noise_Pink(entity e, float dt);
float Noise_White(entity e, float dt);
float Noise_Burst(entity e, float dt, float p); // +1 or -1
-#endif
\ No newline at end of file
+#endif
void Ent_RainOrSnow();
void Net_ReadVortexBeamParticle();
-#endif
\ No newline at end of file
+#endif
.float bone_aim[MAX_AIM_BONES];
.float bone_aimweight[MAX_AIM_BONES];
.float fixbone;
-#endif
\ No newline at end of file
+#endif
#define psrandom(x)
#define prandom_debug()
#endif
-#endif
\ No newline at end of file
+#endif
../warpzonelib/anglestransform.qc
../warpzonelib/client.qc
../warpzonelib/common.qc
-../warpzonelib/mathlib.qc
\ No newline at end of file
+../warpzonelib/mathlib.qc
.float creationtime;
void RubbleLimit(string cname, float limit, void() deleteproc);
entity RubbleNew(string cname);
-#endif
\ No newline at end of file
+#endif
void HUD_UpdatePlayerPos(entity pl);
void HUD_UpdateTeamPos(entity Team);
float HUD_WouldDrawScoreboard(void);
-#endif
\ No newline at end of file
+#endif
.float sameteam;
.float fadedelay;
.float pointtime;
-#endif
\ No newline at end of file
+#endif
a.sort_prev = b; \
b.sort_next = a
-#endif
\ No newline at end of file
+#endif
#pragma noref 0
#undef ATTEN_NORM
-#endif
\ No newline at end of file
+#endif
#pragma noref 1
-#endif
\ No newline at end of file
+#endif
void Ent_TriggerMusic_Remove();
void Ent_ReadTriggerMusic();
-#endif
\ No newline at end of file
+#endif
void Ent_RadarLink();
-#endif
\ No newline at end of file
+#endif
void ent_turret();
void turrets_precache();
.entity tur_head;
-#endif
\ No newline at end of file
+#endif
void Ent_TubaNote(float bIsNew);
void Tuba_Precache();
-#endif
\ No newline at end of file
+#endif
void Vehicles_Precache();
void Net_AuXair2(bool bIsNew);
void Net_VehicleSetup();
-#endif
\ No newline at end of file
+#endif
if(zoomscript_caught)
f = 1;
- else
+ else
f = current_zoomfraction;
if(f)
void Ent_Wall_Remove();
void Ent_Wall();
-#endif
\ No newline at end of file
+#endif
void WaypointSprite_Load();
-#endif
\ No newline at end of file
+#endif
void Projectile_Precache();
-#endif
\ No newline at end of file
+#endif
const int ANIMACTION_SHOOT = 4; // shoot
const int ANIMACTION_TAUNT = 5; // taunt
const int ANIMACTION_MELEE = 6; // melee
-#endif
\ No newline at end of file
+#endif
BUFF_SPAWNFUNC(e##_team1, b, NUM_TEAM_1) \
BUFF_SPAWNFUNC(e##_team2, b, NUM_TEAM_2) \
BUFF_SPAWNFUNC(e##_team3, b, NUM_TEAM_3) \
- BUFF_SPAWNFUNC(e##_team4, b, NUM_TEAM_4)
+ BUFF_SPAWNFUNC(e##_team4, b, NUM_TEAM_4)
BUFF_SPAWNFUNCS(resistance, BUFF_RESISTANCE)
BUFF_SPAWNFUNCS(ammo, BUFF_AMMO)
int Buff_Type_FromSprite(string buff_sprite);
int Buff_Skin(int buff_id);
string Buff_Sprite(int buff_id);
-#endif
\ No newline at end of file
+#endif
// Sets up the campaign for the n-th array item (meaning: campaign_offset+nth
// level) using localcmd()
void CampaignSetup(float n);
-#endif
\ No newline at end of file
+#endif
wep_config_file = -1;
wep_config_alsoprint = -1;
string filename = argv(1);
-
+
if(filename == "")
{
filename = "weapons_dump.cfg";
wep_config_alsoprint = true;
}
wep_config_file = fopen(filename, FILE_WRITE);
-
+
if(wep_config_file >= 0)
{
Dump_Weapon_Settings();
#endif
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
int curl_uri_get_pos;
float curl_uri_get_exec[URI_GET_CURL_END - URI_GET_CURL + 1];
string curl_uri_get_cvar[URI_GET_CURL_END - URI_GET_CURL + 1];
-#endif
\ No newline at end of file
+#endif
string markup_to[NUM_MARKUPS];
string GenericCommand_markup(string s2);
-#endif
\ No newline at end of file
+#endif
void GenericCommand_rpn(float request, float argc, string command);
-#endif
\ No newline at end of file
+#endif
// identifiers for subfunction requests by the command code structure
const int CMD_REQUEST_COMMAND = 1;
const int CMD_REQUEST_USAGE = 2;
-#endif
\ No newline at end of file
+#endif
const int GTV_AVAILABLE = 0;
// for later use in per-map gametype filtering
const int GTV_FORBIDDEN = 2;
-#endif
\ No newline at end of file
+#endif
}
return "";
}
-#endif
\ No newline at end of file
+#endif
#endif
#define CSQCMODEL_EF_RESPAWNGHOST EF_SELECTABLE
-#endif
\ No newline at end of file
+#endif
const int HITTYPE_BOUNCE = 0x400;
const int HITTYPE_RESERVED2 = 0x800;
const int HITTYPE_RESERVED = 0x1000; // unused yet
-#endif
\ No newline at end of file
+#endif
#include "monster/wyvern.qc"
#include "monster/shambler.qc"
-//#endif
\ No newline at end of file
+//#endif
#undef REGISTER_MONSTER
ACCUMULATE_FUNCTION(RegisterMonsters, register_monsters_done);
-#endif
\ No newline at end of file
+#endif
}
//monster = strcat("$ spawnfunc_monster_", monster);
-
+
entity oldself = self;
self = e;
monster_initialize(monster_id);
#define SPAWN_H
entity spawnmonster (string monster, float monster_id, entity spawnedby, entity own, vector orig, float respwn, float invincible, float moveflag);
-#endif
\ No newline at end of file
+#endif
vector targ_origin = ((self.enemy.absmin + self.enemy.absmax) * 0.5);
targ_origin = WarpZone_RefSys_TransformOrigin(self.enemy, self, targ_origin); // origin of target as seen by the monster (us)
WarpZone_TraceLine(self.origin, targ_origin, MOVE_NOMONSTERS, self);
-
+
if((self.enemy == world)
|| (self.enemy.deadflag != DEAD_NO || self.enemy.health < 1)
|| (self.enemy.frozen)
self.enemy = world;
self.pass_distance = 0;
}
-
+
if(self.enemy)
{
/*WarpZone_TrailParticles(world, particleeffectnum("red_pass"), self.origin, targ_origin);
print("Trace origin: ", vtos(targ_origin), "\n");
print("Target origin: ", vtos(self.enemy.origin), "\n");
print("My origin: ", vtos(self.origin), "\n"); */
-
+
self.monster_movestate = MONSTER_MOVE_ENEMY;
self.last_trace = time + 1.2;
return targ_origin;
}
-
+
/*makevectors(self.angles);
self.monster_movestate = MONSTER_MOVE_ENEMY;
self.last_trace = time + 1.2;
WarpZone_RefSys_Copy(self.enemy, self);
WarpZone_RefSys_AddInverse(self.enemy, self); // wz1^-1 ... wzn^-1 receiver
self.moveto = WarpZone_RefSys_TransformOrigin(self.enemy, self, (0.5 * (self.enemy.absmin + self.enemy.absmax)));
-
+
self.pass_distance = vlen((('1 0 0' * self.enemy.origin.x) + ('0 1 0' * self.enemy.origin.y)) - (('1 0 0' * self.origin.x) + ('0 1 0' * self.origin.y)));
MonsterSound(monstersound_sight, 0, false, CH_VOICE);
}
{
if((self.flags & FL_ONGROUND) || ((self.flags & FL_FLY) || (self.flags & FL_SWIM)))
monster_CalculateVelocity(self, self.moveto, self.origin, true, ((self.enemy) ? runspeed : walkspeed));
-
+
/*&if(self.flags & FL_FLY || self.flags & FL_SWIM)
movelib_move_simple(v_forward, ((self.enemy) ? runspeed : walkspeed), 0.6);
else
if (vlen(self.velocity) <= 30)
self.frame = manim_idle;
}
-
+
self.steerto = steerlib_attract2(self.moveto, 0.5, 500, 0.95);
-
+
vector real_angle = vectoangles(self.steerto) - self.angles;
float turny = 25;
if(self.state == MONSTER_STATE_ATTACK_MELEE)
void monster_changeteam(entity ent, float newteam)
{
if(!teamplay) { return; }
-
+
ent.team = newteam;
ent.monster_attack = true; // new team, activate attacking
monster_setupcolors(ent);
-
+
if(ent.sprite)
{
WaypointSprite_UpdateTeamRadar(ent.sprite, RADARICON_DANGER, ((newteam) ? Team_ColorRGB(newteam) : '1 0 0'));
if(mon.spawnflags & MONSTER_SIZE_BROKEN)
if(!(self.spawnflags & MONSTERFLAG_RESPAWNED))
self.scale *= 1.3;
-
+
setsize(self, mon.mins * self.scale, mon.maxs * self.scale);
if(!self.ticrate)
void monster_setupcolors(entity mon);
float Monster_SkillModifier();
void MonsterTouch ();
-#endif
\ No newline at end of file
+#endif
setmodel(self, "models/ctf/shield.md3");
setorigin(self, self.origin);
-
+
float model_radius = self.maxs.x;
vector size = '1 1 1' * self.healer_radius / 2;
setsize(self,-size,size);
healer_setup();
}
}
-#endif // CSQC
\ No newline at end of file
+#endif // CSQC
case PROJECTILE_NADE_MONSTER: return "nade_red";
case PROJECTILE_NADE_MONSTER_BURN: return "nade_red_burn";
}
-
+
return "";
}
// misc functions
void ent_healer();
#endif // CSQC
-#endif
\ No newline at end of file
+#endif
void cl_notice_read();
#endif
-#endif
\ No newline at end of file
+#endif
MSG_CENTER_NOTIF(1, CENTER_TEAMCHANGE_SUICIDE, 0, 1, "", CPID_TEAMCHANGE, "1 f1", _("^K1Suicide in ^COUNT"), "") \
MSG_CENTER_NOTIF(1, CENTER_TIMEOUT_BEGINNING, 0, 1, "", CPID_TIMEOUT, "1 f1", _("^F4Timeout begins in ^COUNT"), "") \
MSG_CENTER_NOTIF(1, CENTER_TIMEOUT_ENDING, 0, 1, "", CPID_TIMEOUT, "1 f1", _("^F4Timeout ends in ^COUNT"), "") \
- MSG_CENTER_NOTIF(1, CENTER_WEAPON_MINELAYER_LIMIT, 0, 1, "f1", NO_CPID, "0 0", _("^BGYou cannot place more than ^F2%s^BG mines at a time"), "")
+ MSG_CENTER_NOTIF(1, CENTER_WEAPON_MINELAYER_LIMIT, 0, 1, "f1", NO_CPID, "0 0", _("^BGYou cannot place more than ^F2%s^BG mines at a time"), "")
#define MULTITEAM_MULTI2(default,prefix,anncepre,infopre,centerpre) \
MSG_MULTI_NOTIF(default, prefix##RED, anncepre##RED, infopre##RED, centerpre##RED) \
#undef MSG_CHOICE_NOTIF
#undef NOTIF_ADD_AUTOCVAR
-#endif
\ No newline at end of file
+#endif
void PlayerStats_PlayerDetail_CheckUpdate(void);
void PlayerStats_PlayerDetail_Handler(entity fh, entity p, float status);
#endif
-#endif
\ No newline at end of file
+#endif
const int STAT_MOVEVARS_STEPHEIGHT = 253;
const int STAT_MOVEVARS_AIRACCEL_QW = 254;
const int STAT_MOVEVARS_AIRACCEL_SIDEWAYS_FRICTION = 255;
-#endif
\ No newline at end of file
+#endif
#define APP_TEAM_NUM_4(num,prefix) ((num == NUM_TEAM_1) ? prefix##RED : ((num == NUM_TEAM_2) ? prefix##BLUE : ((num == NUM_TEAM_3) ? prefix##YELLOW : prefix##PINK)))
#define APP_TEAM_ENT_2(ent,prefix) ((ent.team == NUM_TEAM_1) ? prefix##RED : prefix##BLUE)
#define APP_TEAM_ENT_4(ent,prefix) ((ent.team == NUM_TEAM_1) ? prefix##RED : ((ent.team == NUM_TEAM_2) ? prefix##BLUE : ((ent.team == NUM_TEAM_3) ? prefix##YELLOW : prefix##PINK)))
-#endif
\ No newline at end of file
+#endif
float TEST_RunAll();
float TEST_Run(string test);
-#endif
\ No newline at end of file
+#endif
#define NUM_URL_ID (URI_GET_URLLIB_END - URI_GET_URLLIB + 1)
void url_multi_fopen(string url, float mode, url_ready_func rdy, entity pass);
-#endif
\ No newline at end of file
+#endif
const bool true = 1;
const bool false = 0;
#endif
-#endif
\ No newline at end of file
+#endif
// Returns the correct difference between two always increasing numbers
#define COMPARE_INCREASING(to,from) (to < from ? from + to + 2 : to - from)
-#endif
\ No newline at end of file
+#endif
#include "w_hmg.qc"
#include "w_rpc.qc"
-//#endif
\ No newline at end of file
+//#endif
if(spread <= 0)
return forward;
sstyle = spreadstyle; //autocvar_g_projectiles_spread_style;
-
+
if(sstyle == 0)
{
// this is the baseline for the spread value!
#define CALCULATIONS_H
vector damage_explosion_calcpush(vector explosion_f, vector target_v, float speedfactor);
vector W_CalculateSpread(vector forward, float spread, float spreadfactor, float spreadstyle);
-#endif
\ No newline at end of file
+#endif
// step 3: sort queue
heapsort(WEP_CONFIG_COUNT, W_Config_Queue_Swap, W_Config_Queue_Compare, world);
-
+
// step 4: write queue
WEP_CONFIG_WRITETOFILE(sprintf(
"// {{{ #%d: %s%s\n",
#define WEP_CONFIG_WRITE_CVARS_BOTH(wepname,name) \
WEP_CONFIG_WRITE_CVARS_PRI(wepname, name) \
WEP_CONFIG_WRITE_CVARS_SEC(wepname, name)
-
+
#define WEP_CONFIG_WRITE_CVARS(wepid,wepname,mode,name) WEP_CONFIG_WRITE_CVARS_##mode(wepname, name)
#define WEP_CONFIG_WRITE_PROPS_string(wepname,name) \
cvar(sprintf("g_balance_%s_%s", #wepname, #name)))) }
#define WEP_CONFIG_WRITE_PROPS(wepid,wepname,type,prop,name) WEP_CONFIG_WRITE_PROPS_##type(wepname,name)
-#endif
\ No newline at end of file
+#endif
}
float Arc_GetHeat_Percent(entity player)
-{
+{
if ( WEP_CVAR(arc, overheat_max) <= 0 || WEP_CVAR(arc, overheat_max) <= 0 )
{
player.arc_overheat = 0;
return 0;
}
-
+
if ( player.arc_beam )
return player.arc_beam.beam_heat/WEP_CVAR(arc, overheat_max);
-
+
if ( player.arc_overheat > time )
{
- return (player.arc_overheat-time) / WEP_CVAR(arc, overheat_max)
+ return (player.arc_overheat-time) / WEP_CVAR(arc, overheat_max)
* player.arc_cooldown;
}
-
+
return 0;
}
void Arc_Player_SetHeat(entity player)
remove(self);
return;
}
-
-
+
+
float burst = 0;
if( self.owner.BUTTON_ATCK2 || self.beam_bursting)
{
{
cooldown_speed = self.beam_heat / WEP_CVAR(arc, beam_refire);
}
-
+
if ( cooldown_speed )
{
self.owner.arc_overheat = time + self.beam_heat / cooldown_speed;
self.owner.arc_cooldown = cooldown_speed;
}
-
+
if ( WEP_CVAR(arc, overheat_max) > 0 && self.beam_heat >= WEP_CVAR(arc, overheat_max) )
{
- pointparticles( particleeffectnum("arc_overheat"),
+ pointparticles( particleeffectnum("arc_overheat"),
self.beam_start, self.beam_wantdir, 1 );
sound(self, CH_WEAPON_A, "weapons/arc_stop.wav", VOL_BASE, ATTN_NORM);
}
}
-
+
if(self == self.owner.arc_beam) { self.owner.arc_beam = world; }
entity oldself = self;
self = self.owner;
remove(self);
return;
}
-
+
// decrease ammo
float coefficient = frametime;
if(!(self.owner.items & IT_UNLIMITED_WEAPON_AMMO))
// note that if we do this, it'll always be corrected to a maximum angle by beam_maxangle handling
- float segments;
+ float segments;
if(self.beam_dir != w_shotdir)
{
// calculate how much we're going to move the end of the beam to the want position
if(WEP_CVAR(arc, beam_degreespersegment))
{
segments = bound(
- 1,
+ 1,
(
min(
angle,
new_beam_type = ARC_BT_HIT;
}
- break;
+ break;
}
else if(trace_fraction != 1)
{
else if ( self.arc_beam && WEP_CVAR(arc, overheat_max) > 0 &&
self.arc_beam.beam_heat > WEP_CVAR(arc, overheat_min) )
{
- if ( random() < (self.arc_beam.beam_heat-WEP_CVAR(arc, overheat_min)) /
+ if ( random() < (self.arc_beam.beam_heat-WEP_CVAR(arc, overheat_min)) /
( WEP_CVAR(arc, overheat_max)-WEP_CVAR(arc, overheat_min) ) )
pointparticles( particleeffectnum("arc_smoke"), smoke_origin, '0 0 0', 1 );
}
-
- if ( self.arc_smoke_sound && ( self.arc_overheat <= time ||
+
+ if ( self.arc_smoke_sound && ( self.arc_overheat <= time ||
!( self.BUTTON_ATCK || self.BUTTON_ATCK2 ) ) || self.switchweapon != WEP_ARC )
{
self.arc_smoke_sound = 0;
if ( self.arc_overheat <= time )
if(self.BUTTON_ATCK || self.BUTTON_ATCK2 || self.arc_beam.beam_bursting )
{
-
+
if(self.arc_BUTTON_ATCK_prev)
{
#if 0
if(weapon_prepareattack(!!self.BUTTON_ATCK2, 0))
{
W_Arc_Beam(!!self.BUTTON_ATCK2);
-
+
if(!self.arc_BUTTON_ATCK_prev)
{
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR(arc, beam_animtime), w_ready);
}
}
}
-
+
return true;
}
-
+
if(self.arc_BUTTON_ATCK_prev != 0)
{
sound(self, CH_WEAPON_A, "weapons/arc_stop.wav", VOL_BASE, ATTN_NORM);
// draw primary beam render
vector top = hitorigin + (thickdir * thickness);
vector bottom = hitorigin - (thickdir * thickness);
-
+
vector last_top = WarpZone_TransformOrigin(WarpZone_trace_transform, Draw_ArcBeam_callback_last_top);
vector last_bottom = WarpZone_TransformOrigin(WarpZone_trace_transform, Draw_ArcBeam_callback_last_bottom);
trailparticles(beam, beam.beam_traileffect, start, hitorigin);
}
- // set up for the next
+ // set up for the next
Draw_ArcBeam_callback_last_thickness = thickness;
Draw_ArcBeam_callback_last_top = WarpZone_UnTransformOrigin(WarpZone_trace_transform, top);
Draw_ArcBeam_callback_last_bottom = WarpZone_UnTransformOrigin(WarpZone_trace_transform, bottom);
// Currently we have to replicate nearly the same method of figuring
// out the shotdir that the server does... Ideally in the future we
// should be able to acquire this from a generalized function built
- // into a weapon system for client code.
+ // into a weapon system for client code.
// find where we are aiming
makevectors(warpzone_save_view_angles);
if(self.beam_degreespersegment)
{
segments = bound(
- 1,
+ 1,
(
min(
angle,
if(self.beam_degreespersegment)
{
segments = bound(
- 1,
+ 1,
(
min(
angle,
self.projectiledeathtype,
other
);
-
+
remove(self);
}
setorigin(missile, w_shotorg);
setsize(missile, '0 0 0', '0 0 0');
-
+
W_SetupProjVelocity_Explicit(
missile,
w_shotdir,
missile.touch = W_Blaster_Touch;
missile.flags = FL_PROJECTILE;
missile.missile_flags = MIF_SPLASH;
- missile.projectiledeathtype = atk_deathtype;
+ missile.projectiledeathtype = atk_deathtype;
missile.think = W_Blaster_Think;
missile.nextthink = time + atk_delay;
return true;
}
-
+
case WR_THINK:
{
if(self.BUTTON_ATCK)
}
return true;
}
-
- case WR_INIT:
+
+ case WR_INIT:
{
precache_model("models/weapons/g_laser.md3");
precache_model("models/weapons/v_laser.md3");
BLASTER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
return true;
}
-
+
case WR_SETUP:
{
self.ammo_field = ammo_none;
return true;
}
-
+
case WR_CHECKAMMO1:
case WR_CHECKAMMO2:
{
return true; // laser has infinite ammo
}
-
+
case WR_CONFIG:
{
BLASTER_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
return true;
}
-
+
case WR_SUICIDEMESSAGE:
{
return WEAPON_BLASTER_SUICIDE;
}
-
+
case WR_KILLMESSAGE:
{
return WEAPON_BLASTER_MURDER;
if(!w_issilent) { sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM); }
return true;
}
-
+
case WR_INIT:
{
precache_sound("weapons/laserimpact.wav");
if(e == e.realowner.crylink_lastgroup)
e.realowner.crylink_lastgroup = world;
-
+
float isprimary = !(e.projectiledeathtype & HITTYPE_SECONDARY);
-
+
RadiusDamage(e, e.realowner, WEP_CVAR_BOTH(crylink, isprimary, damage) * a, WEP_CVAR_BOTH(crylink, isprimary, edgedamage) * a, WEP_CVAR_BOTH(crylink, isprimary, radius), world, world, WEP_CVAR_BOTH(crylink, isprimary, force) * a, e.projectiledeathtype, other);
W_Crylink_LinkExplode(e.queuenext, e2);
if(n >= 2)
{
float isprimary = !(e.projectiledeathtype & HITTYPE_SECONDARY);
-
+
if(WEP_CVAR_BOTH(crylink, isprimary, joinexplode))
{
n /= WEP_CVAR_BOTH(crylink, isprimary, shots);
else
++hit_enemy;
}
-
+
head = head.chain;
}
f *= a;
float totaldamage = RadiusDamage(self, self.realowner, WEP_CVAR_BOTH(crylink, isprimary, damage) * f, WEP_CVAR_BOTH(crylink, isprimary, edgedamage) * f, WEP_CVAR_BOTH(crylink, isprimary, radius), world, world, WEP_CVAR_BOTH(crylink, isprimary, force) * f, self.projectiledeathtype, other);
-
+
if(totaldamage && ((WEP_CVAR_BOTH(crylink, isprimary, linkexplode) == 2) || ((WEP_CVAR_BOTH(crylink, isprimary, linkexplode) == 1) && !W_Crylink_Touch_WouldHitFriendly(self, WEP_CVAR_BOTH(crylink, isprimary, radius)))))
{
if(self == self.realowner.crylink_lastgroup)
proj.flags = FL_PROJECTILE;
proj.missile_flags = MIF_SPLASH;
-
+
CSQCProjectile(proj, true, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), true);
other = proj; MUTATOR_CALLHOOK(EditProjectile);
proj.flags = FL_PROJECTILE;
proj.missile_flags = MIF_SPLASH;
-
+
CSQCProjectile(proj, true, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), true);
other = proj; MUTATOR_CALLHOOK(EditProjectile);
self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(crylink, speed), 0, WEP_CVAR_PRI(crylink, middle_lifetime), false);
else
self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(crylink, speed), 0, WEP_CVAR_SEC(crylink, middle_lifetime), false);
-
+
return true;
}
case WR_THINK:
vector pos;
entity linkjoineffect;
float isprimary = (self.crylink_waitrelease == 1);
-
+
pos = W_Crylink_LinkJoin(self.crylink_lastgroup, WEP_CVAR_BOTH(crylink, isprimary, joinspread) * WEP_CVAR_BOTH(crylink, isprimary, speed));
linkjoineffect = spawn();
}
}
}
-
+
return true;
}
case WR_INIT:
if(!w_issilent)
sound(self, CH_SHOTS, "weapons/crylink_impact.wav", VOL_BASE, ATTN_NORM);
}
-
+
return true;
}
case WR_INIT:
WEP_CVAR(devastator, remote_jump_radius),
false
);
-
+
while(head)
{
if(head.takedamage && (head == self.realowner))
// we handled this as a rocketjump :)
handled_as_rocketjump = true;
- // modify velocity
+ // modify velocity
head.velocity_x *= 0.9;
head.velocity_y *= 0.9;
head.velocity_z = bound(
{
if(self.health <= 0)
return;
-
+
if(!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
return; // g_projectiles_damage says to halt
-
+
self.health = self.health - damage;
self.angles = vectoangles(self.velocity);
-
+
if(self.health <= 0)
W_PrepareExplosionByDamage(attacker, W_Devastator_Explode);
}
missile.nextthink = time;
missile.cnt = time + WEP_CVAR(devastator, lifetime);
missile.flags = FL_PROJECTILE;
- missile.missile_flags = MIF_SPLASH;
+ missile.missile_flags = MIF_SPLASH;
CSQCProjectile(missile, WEP_CVAR(devastator, guiderate) == 0 && WEP_CVAR(devastator, speedaccel) == 0, PROJECTILE_ROCKET, false); // because of fly sound
targ = targ.chain;
}
}
-
+
if(self.BUTTON_ATCK2) self.BUTTON_ATCK = false;
}
-
+
return true;
}
#else
// dprint(ftos(desirabledamage),"\n");
if(self.BUTTON_ATCK2 == true) self.BUTTON_ATCK = false;
}
-
+
return true;
}
#endif
sound(self, CH_WEAPON_B, "weapons/rocket_det.wav", VOL_BASE, ATTN_NORM);
}
}
-
+
return true;
}
case WR_INIT:
pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1);
if(!w_issilent)
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
-
+
return true;
}
case WR_INIT:
}
}
}
-
+
// change owner to whoever caused the combo explosion
e.realowner = own;
e.takedamage = DAMAGE_NO;
e.classname = "electro_orb_chain";
-
+
// now set the next one to trigger as well
e.think = W_Electro_ExplodeCombo;
-
+
// delay combo chains, looks cooler
e.nextthink =
(
W_Electro_TriggerCombo(self.origin, WEP_CVAR(electro, combo_comboradius), self.realowner);
self.event_damage = func_null;
-
+
RadiusDamage(
self,
self.realowner,
self.event_damage = func_null;
self.takedamage = DAMAGE_NO;
-
+
if(self.movetype == MOVETYPE_BOUNCE)
{
RadiusDamage(
// now set the next one to trigger as well
e.think = W_Electro_ExplodeCombo;
-
+
// delay combo chains, looks cooler
e.nextthink =
(
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(electro, animtime), W_Electro_CheckAttack);
return;
}
- // WEAPONTODO: when the player releases the button, cut down the length of refire2?
+ // WEAPONTODO: when the player releases the button, cut down the length of refire2?
w_ready();
}
if(random() < 0.03) self.bot_secondary_electromooth = 0;
}
}
-
+
return true;
}
case WR_THINK:
WEP_ACTION(self.weapon, WR_RELOAD);
return false;
}
-
+
return true;
}
-
+
if(self.BUTTON_ATCK)
{
if(weapon_prepareattack(0, WEP_CVAR_PRI(electro, refire)))
sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTEN_NORM);
}
}
-
+
return true;
}
case WR_INIT:
if(random() < 0.01) self.bot_primary_fireballmooth = 1;
}
}
-
+
return true;
}
case WR_THINK:
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(fireball, animtime), w_ready);
}
}
-
+
return true;
}
case WR_INIT:
if(!w_issilent)
sound(self, CH_SHOTS, "weapons/fireball_impact2.wav", VOL_BASE, ATTEN_NORM * 0.25); // long range boom
}
-
+
return true;
}
case WR_INIT:
{
if(self.health <= 0)
return;
-
+
float is_linkexplode = ( ((inflictor.owner != world) ? (inflictor.owner == self.owner) : true)
- && (inflictor.projectiledeathtype & HITTYPE_SECONDARY)
+ && (inflictor.projectiledeathtype & HITTYPE_SECONDARY)
&& (self.projectiledeathtype & HITTYPE_SECONDARY));
-
+
if(is_linkexplode)
is_linkexplode = (is_linkexplode && WEP_CVAR_SEC(hagar, load_linkexplode));
else
self.health = self.health - damage;
self.angles = vectoangles(self.velocity);
-
+
if(self.health <= 0)
W_PrepareExplosionByDamage(attacker, self.think);
}
missile.classname = "missile";
missile.bot_dodge = true;
missile.bot_dodgerating = WEP_CVAR_PRI(hagar, damage);
-
+
missile.takedamage = DAMAGE_YES;
missile.health = WEP_CVAR_PRI(hagar, health);
missile.damageforcescale = WEP_CVAR_PRI(hagar, damageforcescale);
missile.event_damage = W_Hagar_Damage;
missile.damagedbycontents = true;
-
+
missile.touch = W_Hagar_Touch;
missile.use = W_Hagar_Explode;
missile.think = adaptor_think2use_hittype_splash;
missile.angles = vectoangles(missile.velocity);
missile.flags = FL_PROJECTILE;
- missile.missile_flags = MIF_SPLASH;
+ missile.missile_flags = MIF_SPLASH;
CSQCProjectile(missile, true, PROJECTILE_HAGAR, true);
missile.classname = "missile";
missile.bot_dodge = true;
missile.bot_dodgerating = WEP_CVAR_SEC(hagar, damage);
-
+
missile.takedamage = DAMAGE_YES;
missile.health = WEP_CVAR_SEC(hagar, health);
missile.damageforcescale = WEP_CVAR_SEC(hagar, damageforcescale);
missile.angles = vectoangles(missile.velocity);
missile.flags = FL_PROJECTILE;
- missile.missile_flags = MIF_SPLASH;
+ missile.missile_flags = MIF_SPLASH;
CSQCProjectile(missile, true, PROJECTILE_HAGAR_BOUNCING, true);
missile.classname = "missile";
missile.bot_dodge = true;
missile.bot_dodgerating = WEP_CVAR_SEC(hagar, damage);
-
+
missile.takedamage = DAMAGE_YES;
missile.health = WEP_CVAR_SEC(hagar, health);
missile.damageforcescale = WEP_CVAR_SEC(hagar, damageforcescale);
setorigin(missile, w_shotorg);
setsize(missile, '0 0 0', '0 0 0');
missile.movetype = MOVETYPE_FLY;
- missile.missile_flags = MIF_SPLASH;
-
+ missile.missile_flags = MIF_SPLASH;
+
// per-shot spread calculation: the more shots there are, the less spread is applied (based on the bias cvar)
- spread_pershot = ((shots - 1) / (WEP_CVAR_SEC(hagar, load_max) - 1));
+ spread_pershot = ((shots - 1) / (WEP_CVAR_SEC(hagar, load_max) - 1));
spread_pershot = (1 - (spread_pershot * WEP_CVAR_SEC(hagar, load_spread_bias)));
spread_pershot = (WEP_CVAR_SEC(hagar, spread) * spread_pershot * g_weaponspreadfactor);
-
+
// pattern spread calculation
s = '0 0 0';
if(counter == 0)
s.z = v_forward.y;
}
s = s * WEP_CVAR_SEC(hagar, load_spread) * g_weaponspreadfactor;
-
+
W_SetupProjVelocity_Explicit(missile, w_shotdir + right * s.y + up * s.z, v_up, WEP_CVAR_SEC(hagar, speed), 0, 0, spread_pershot, false);
missile.angles = vectoangles(missile.velocity);
void W_Hagar_Attack2_Load(void)
{
// loadable hagar secondary attack, must always run each frame
-
+
if(time < game_starttime)
return;
self.hagar_warning = true;
}
}
-
+
// release if player let go of button or if they've held it in too long
if(!self.BUTTON_ATCK2 || ((loaded || !enough_ammo) && self.hagar_loadstep < time && WEP_CVAR_SEC(hagar, load_hold) >= 0))
{
self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
else // not using secondary_speed since these are only 15% and should cause some ricochets without re-aiming
self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
-
+
return true;
}
case WR_THINK:
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(hagar, refire), w_ready);
}
}
-
+
return true;
}
case WR_GONETHINK:
self.weaponentity.state = WS_READY;
W_Hagar_Attack2_Load_Release();
}
-
+
return true;
}
case WR_INIT:
W_DecreaseAmmo(WEP_CVAR_SEC(hagar, ammo) * self.hagar_load * -1); // give back ammo if necessary
self.hagar_load = 0;
}
-
+
return true;
}
case WR_CHECKAMMO1:
// if we have any rockets loaded when we die, release them
if(self.hagar_load && WEP_CVAR_SEC(hagar, load_releasedeath))
W_Hagar_Attack2_Load_Release();
-
+
return true;
}
case WR_RELOAD:
{
if(!self.hagar_load) // require releasing loaded rockets first
W_Reload(min(WEP_CVAR_PRI(hagar, ammo), WEP_CVAR_SEC(hagar, ammo)), "weapons/reload.wav");
-
+
return true;
}
case WR_SUICIDEMESSAGE:
else
sound(self, CH_SHOTS, "weapons/hagexp3.wav", VOL_BASE, ATTN_NORM);
}
-
+
return true;
}
case WR_INIT:
PROJECTILE_TOUCH;
self.event_damage = func_null;
-
+
isprimary = !(self.projectiledeathtype & HITTYPE_SECONDARY);
-
+
RadiusDamage(self, self.realowner, WEP_CVAR_BOTH(hlac, isprimary, damage), WEP_CVAR_BOTH(hlac, isprimary, edgedamage), WEP_CVAR_BOTH(hlac, isprimary, radius), world, world, WEP_CVAR_BOTH(hlac, isprimary, force), self.projectiledeathtype, other);
remove(self);
missile.nextthink = time + WEP_CVAR_SEC(hlac, lifetime);
missile.flags = FL_PROJECTILE;
- missile.missile_flags = MIF_SPLASH;
+ missile.missile_flags = MIF_SPLASH;
missile.projectiledeathtype = WEP_HLAC | HITTYPE_SECONDARY;
CSQCProjectile(missile, true, PROJECTILE_HLAC, true);
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(hlac, animtime), w_ready);
}
}
-
+
return true;
}
case WR_INIT:
pointparticles(particleeffectnum("laser_impact"), org2, w_backoff * 1000, 1);
if(!w_issilent)
sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
-
+
return true;
}
case WR_INIT:
self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false);
else
self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false);
-
+
return true;
}
case WR_THINK:
{
if(self.health <= 0)
return;
-
+
if(!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
- return; // g_projectiles_damage says to halt
-
+ return; // g_projectiles_damage says to halt
+
self.health = self.health - damage;
-
+
if(self.health <= 0)
W_PrepareExplosionByDamage(self.realowner, W_Hook_Explode2);
}
gren.think = adaptor_think2use_hittype_splash;
gren.use = W_Hook_Explode2;
gren.touch = W_Hook_Touch2;
-
+
gren.takedamage = DAMAGE_YES;
gren.health = WEP_CVAR_SEC(hook, health);
gren.damageforcescale = WEP_CVAR_SEC(hook, damageforcescale);
float W_Hook(float req)
{
float hooked_time_max, hooked_fuel;
-
+
switch(req)
{
case WR_AIM:
{
W_DecreaseAmmo(WEP_CVAR_PRI(hook, ammo));
self.hook_state |= HOOK_FIRING;
- weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(hook, animtime), w_ready);
+ weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(hook, animtime), w_ready);
}
}
if(self.hook && self.hook.state == 1)
{
- hooked_time_max = WEP_CVAR_PRI(hook, hooked_time_max);
+ hooked_time_max = WEP_CVAR_PRI(hook, hooked_time_max);
if(hooked_time_max > 0)
{
if( time > self.hook_time_hooked + hooked_time_max )
self.hook_state |= HOOK_REMOVING;
}
-
+
hooked_fuel = WEP_CVAR_PRI(hook, hooked_ammo);
if(hooked_fuel > 0)
{
}
else
{
- self.hook_time_hooked = time;
+ self.hook_time_hooked = time;
self.hook_time_fueldecrease = time + WEP_CVAR_PRI(hook, hooked_time_free);
}
self.hook_state &= ~HOOK_WAITING_FOR_RELEASE;
}
}
-
+
return true;
}
case WR_INIT:
pointparticles(particleeffectnum("hookbomb_explode"), org2, '0 0 0', 1);
if(!w_issilent)
sound(self, CH_SHOTS, "weapons/hookbomb_impact.wav", VOL_BASE, ATTN_NORM);
-
+
return true;
}
case WR_INIT:
self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false);
else
self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false);
-
+
return true;
}
case WR_THINK:
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR(machinegun, first_refire), w_ready);
}
}
-
+
return true;
}
case WR_INIT:
sound(self, CH_SHOTS, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
else if(w_random < 0.2)
sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
-
+
return true;
}
case WR_INIT:
self.movetype = MOVETYPE_NONE;
}
}
-
+
// our lifetime has expired, it's time to die - mine_time just allows us to play a sound for this
// TODO: replace this mine_trigger.wav sound with a real countdown
if((time > self.cnt) && (!self.mine_time) && (self.cnt > 0))
{
if(self.health <= 0)
return;
-
+
float is_from_enemy = (inflictor.realowner != self.realowner);
-
+
if(!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, (is_from_enemy ? 1 : -1)))
return; // g_projectiles_damage says to halt
-
+
self.health = self.health - damage;
self.angles = vectoangles(self.velocity);
-
+
if(self.health <= 0)
W_PrepareExplosionByDamage(attacker, W_MineLayer_Explode);
}
// common properties
other = mine; MUTATOR_CALLHOOK(EditProjectile);
-
+
self.minelayer_mines = W_MineLayer_Count(self);
}
// dprint(ftos(desirabledamage),"\n");
if(self.BUTTON_ATCK2 == true) self.BUTTON_ATCK = false;
}
-
+
return true;
}
case WR_THINK:
if(W_MineLayer_PlacedMines(true))
sound(self, CH_WEAPON_B, "weapons/mine_det.wav", VOL_BASE, ATTN_NORM);
}
-
+
return true;
}
case WR_INIT:
pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1);
if(!w_issilent)
sound(self, CH_SHOTS, "weapons/mine_exp.wav", VOL_BASE, ATTN_NORM);
-
+
return true;
}
case WR_INIT:
{
if(self.health <= 0)
return;
-
+
if(!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
return; // g_projectiles_damage says to halt
-
+
self.health = self.health - damage;
-
+
if(self.health <= 0)
W_PrepareExplosionByDamage(attacker, self.use);
}
pointparticles(particleeffectnum("hagar_bounce"), self.origin, self.velocity, 1);
self.projectiledeathtype |= HITTYPE_BOUNCE;
self.gl_bouncecnt += 1;
-
+
if(WEP_CVAR_SEC(mortar, lifetime_bounce) && self.gl_bouncecnt == 1)
self.nextthink = time + WEP_CVAR_SEC(mortar, lifetime_bounce);
-
+
}
else if(WEP_CVAR_SEC(mortar, type) == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
{
if(random() < 0.02) self.bot_secondary_grenademooth = 0;
}
}
-
+
return true;
}
/*case WR_CALCINFO:
// for the range calculation, closer to 1 is better
wepinfo_pri_range_max = 2000 * wepinfo_pri_speed;
- wepinfo_pri_range = wepinfo_pri_speed * WEP_CVAR_PRI(mortar,
-
+ wepinfo_pri_range = wepinfo_pri_speed * WEP_CVAR_PRI(mortar,
+
wepinfo_sec_refire = max3(sys_frametime, WEP_CVAR_SEC(mortar, refire), WEP_CVAR_SEC(mortar, animtime));
wepinfo_sec_dps = (WEP_CVAR_SEC(mortar, damage) * (1 / wepinfo_sec_refire));
-
+
wepinfo_sec_dps = (WEP_CVAR_SEC(mortar, damage) * (1 / max3(sys_frametime, WEP_CVAR_SEC(mortar, refire), WEP_CVAR_SEC(mortar, animtime))));
wepinfo_ter_dps = 0;
*/
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(mortar, animtime), w_ready);
}
}
-
+
return true;
}
case WR_INIT:
pointparticles(particleeffectnum("grenade_explode"), org2, '0 0 0', 1);
if(!w_issilent)
sound(self, CH_SHOTS, "weapons/grenade_impact.wav", VOL_BASE, ATTN_NORM);
-
+
return true;
}
case WR_INIT:
gren.scale = 4;
setorigin(gren, w_shotorg);
setsize(gren, '0 0 0', '0 0 0');
-
+
gren.nextthink = time + WEP_CVAR_BOTH(porto, (type <= 0), lifetime);
gren.think = W_Porto_Think;
gren.touch = W_Porto_Touch;
-
+
if(self.items & IT_STRENGTH)
W_SetupProjVelocity_Basic(gren, WEP_CVAR_BOTH(porto, (type <= 0), speed) * autocvar_g_balance_powerup_strength_force, 0);
else
//vector v_angle_save;
if(g_nexball) { return w_nexball_weapon(req); }
-
+
switch(req)
{
case WR_AIM:
if(!WEP_CVAR(porto, secondary))
if(bot_aim(WEP_CVAR_PRI(porto, speed), 0, WEP_CVAR_PRI(porto, lifetime), false))
self.BUTTON_ATCK = true;
-
+
return true;
}
case WR_CONFIG:
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(porto, animtime), w_ready);
}
}
-
+
return true;
}
case WR_INIT:
float W_Rifle(float req)
{
float ammo_amount;
-
+
switch(req)
{
case WR_AIM:
if(random() < 0.03) self.bot_secondary_riflemooth = 0;
}
}
-
+
return true;
}
case WR_THINK:
}
}
}
-
+
return true;
}
case WR_INIT:
else if(w_random < 0.5)
sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
}
-
+
return true;
}
case WR_INIT:
// set start time of melee
if(!self.cnt)
{
- self.cnt = time;
+ self.cnt = time;
W_PlayStrengthSound(self.realowner);
}
// update values for v_* vectors
makevectors(self.realowner.v_angle);
-
+
// calculate swing percentage based on time
meleetime = WEP_CVAR(shockwave, melee_time) * W_WeaponRateFactor();
swing = bound(0, (self.cnt + meleetime - time) / meleetime, 10);
f = ((1 - swing) * WEP_CVAR(shockwave, melee_traces));
-
- // perform the traces needed for this frame
+
+ // perform the traces needed for this frame
for(i=self.swing_prev; i < f; ++i)
{
swing_factor = ((1 - (i / WEP_CVAR(shockwave, melee_traces))) * 2 - 1);
-
- targpos = (self.realowner.origin + self.realowner.view_ofs
+
+ targpos = (self.realowner.origin + self.realowner.view_ofs
+ (v_forward * WEP_CVAR(shockwave, melee_range))
+ (v_up * swing_factor * WEP_CVAR(shockwave, melee_swing_up))
+ (v_right * swing_factor * WEP_CVAR(shockwave, melee_swing_side)));
self.realowner,
ANTILAG_LATENCY(self.realowner)
);
-
+
// draw lightning beams for debugging
#ifdef DEBUG_SHOCKWAVE
- te_lightning2(world, targpos, self.realowner.origin + self.realowner.view_ofs + v_forward * 5 - v_up * 5);
+ te_lightning2(world, targpos, self.realowner.origin + self.realowner.view_ofs + v_forward * 5 - v_up * 5);
te_customflash(targpos, 40, 2, '1 1 1');
#endif
-
+
is_player = (IS_PLAYER(trace_ent) || trace_ent.classname == "body" || (trace_ent.flags & FL_MONSTER));
if((trace_fraction < 1) // if trace is good, apply the damage and remove self if necessary
- && (trace_ent.takedamage == DAMAGE_AIM)
+ && (trace_ent.takedamage == DAMAGE_AIM)
&& (trace_ent != self.swing_alreadyhit)
&& (is_player || WEP_CVAR(shockwave, melee_nonplayerdamage)))
{
target_victim = trace_ent; // so it persists through other calls
-
+
if(is_player) // this allows us to be able to nerf the non-player damage done in e.g. assault or onslaught
swing_damage = (WEP_CVAR(shockwave, melee_damage) * min(1, swing_factor + 1));
else
Damage(
target_victim,
self.realowner,
- self.realowner,
+ self.realowner,
swing_damage,
- (WEP_SHOCKWAVE | HITTYPE_SECONDARY),
- (self.realowner.origin + self.realowner.view_ofs),
+ (WEP_SHOCKWAVE | HITTYPE_SECONDARY),
+ (self.realowner.origin + self.realowner.view_ofs),
(v_forward * WEP_CVAR(shockwave, melee_force))
);
}
}
}
-
+
if(time >= self.cnt + meleetime)
{
// melee is finished
}
else
{
- // set up next frame
+ // set up next frame
self.swing_prev = i;
self.nextthink = time;
}
float spreadlimit;
float distance_of_attack = vlen(sw_shotorg - attack_endpos);
float distance_from_line = vlen(targetorg - nearest_on_line);
-
+
spreadlimit = (distance_of_attack ? min(1, (vlen(sw_shotorg - nearest_on_line) / distance_of_attack)) : 1);
spreadlimit =
(
{
if(!head) { return false; }
float i;
-
+
for(i = 0; i <= queue; ++i)
{
if(shockwave_hit[i] == head)
entity head;
float i, queue = 0;
-
+
// set up the shot direction
W_SetupShot(self, false, 3, "weapons/lasergun_fire.wav", CH_WEAPON_B, WEP_CVAR(shockwave, blast_damage));
vector attack_endpos = (w_shotorg + (w_shotdir * WEP_CVAR(shockwave, blast_distance)));
),
false
);
-
+
while(head)
{
if(head.takedamage)
{
float distance_to_head = vlen(attack_hitpos - head.WarpZone_findradius_nearest);
-
+
if((head == self) && (distance_to_head <= WEP_CVAR(shockwave, blast_jump_radius)))
{
// ========================
// BLAST JUMP CALCULATION
// ========================
-
+
// calculate importance of distance and accuracy for this attack
multiplier_from_accuracy = (1 -
(distance_to_head ?
// ==========================
// BLAST SPLASH CALCULATION
// ==========================
-
+
// calculate importance of distance and accuracy for this attack
multiplier_from_accuracy = (1 -
(distance_to_head ?
// BLAST CONE CALCULATION
// ========================
- // if it's a player, use the view origin as reference (stolen from RadiusDamage functions in g_damage.qc)
+ // if it's a player, use the view origin as reference (stolen from RadiusDamage functions in g_damage.qc)
center = CENTER_OR_VIEWOFS(head);
// find the closest point on the enemy to the center of the attack
float ang; // angle between shotdir and h
float h; // hypotenuse, which is the distance between attacker to head
float a; // adjacent side, which is the distance between attacker and the point on w_shotdir that is closest to head.origin
-
+
h = vlen(center - self.origin);
ang = acos(dotproduct(normalize(center - self.origin), w_shotdir));
a = h * cos(ang);
vector nearest_on_line = (w_shotorg + a * w_shotdir);
vector nearest_to_attacker = WarpZoneLib_NearestPointOnBox(center + head.mins, center + head.maxs, nearest_on_line);
- if((vlen(head.WarpZone_findradius_dist) <= WEP_CVAR(shockwave, blast_distance))
+ if((vlen(head.WarpZone_findradius_dist) <= WEP_CVAR(shockwave, blast_distance))
&& (W_Shockwave_Attack_IsVisible(head, nearest_on_line, w_shotorg, attack_endpos)))
{
// calculate importance of distance and accuracy for this attack
head = shockwave_hit[i-1];
final_force = shockwave_hit_force[i-1];
final_damage = shockwave_hit_damage[i-1];
-
+
Damage(
head,
self,
vlen(final_force)
));
#endif
-
+
shockwave_hit[i-1] = world;
shockwave_hit_force[i-1] = '0 0 0';
shockwave_hit_damage[i-1] = 0;
{ self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false); }
else
{ self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false); }
-
+
return true;
}
case WR_THINK:
weapon_thinkf(WFRAME_FIRE1, 0, W_Shockwave_Melee);
}
}
-
+
return true;
}
case WR_INIT:
new_max_dist = vlen(new_min_end - endpos);
new_max_end = (new_min_end + (deviation * new_max_dist));
//te_lightning2(world, new_end, prev_min_end);
-
+
if(counter == 0)
{
entity shockwave;
shockwave = spawn();
shockwave.draw = Draw_Shockwave;
-
+
shockwave.sw_shotorg_x = ReadCoord(); shockwave.sw_shotorg_y = ReadCoord(); shockwave.sw_shotorg_z = ReadCoord();
shockwave.sw_shotdir_x = ReadCoord(); shockwave.sw_shotdir_y = ReadCoord(); shockwave.sw_shotdir_z = ReadCoord();
// attempt forcing playback of the anim by switching to another anim (that we never play) here...
weapon_thinkf(WFRAME_FIRE1, 0, W_Shotgun_Attack2);
}
-
+
return true;
}
case WR_INIT:
else
self.BUTTON_ATCK2 = 1;
}
-
+
return true;
}
case WR_THINK:
self = oldself;
}
}
-
+
return true;
}
case WR_INIT:
self.weaponentity.state = WS_INUSE;
weapon_thinkf(WFRAME_RELOAD, 0.5, w_ready);
}
-
+
return true;
}
case WR_CHECKAMMO1:
WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3"), w_shotorg, v);
break;
}
-
+
W_DecreaseAmmo(((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo)));
}
self.BUTTON_ATCK = bot_aim(1000000, 0, 1, false);
else
self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), false); // WEAPONTODO: replace with proper vaporizer cvars
-
+
return true;
}
case WR_THINK:
{
// handle refire manually, so that primary and secondary can be fired without conflictions (important for instagib)
self.jump_interval = time + WEP_CVAR_SEC(vaporizer, refire) * W_WeaponRateFactor();
-
+
// decrease ammo for the laser?
if(WEP_CVAR_SEC(vaporizer, ammo))
W_DecreaseAmmo(WEP_CVAR_SEC(vaporizer, ammo));
WEP_CVAR_SEC(vaporizer, delay),
WEP_CVAR_SEC(vaporizer, lifetime)
);
-
+
// now do normal refire
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(vaporizer, animtime), w_ready);
}
}
-
+
return true;
}
case WR_INIT:
void W_Vortex_Attack(float issecondary)
{
float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo, charge;
-
+
mydmg = WEP_CVAR_BOTH(vortex, !issecondary, damage);
myforce = WEP_CVAR_BOTH(vortex, !issecondary, force);
mymindist = WEP_CVAR_BOTH(vortex, !issecondary, damagefalloff_mindist);
FireRailgunBullet(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, WEP_VORTEX);
if(yoda && flying)
- Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
+ Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
//beam and muzzle flash done on client
SendCSQCVortexBeamParticle(charge);
{
if(WEP_CVAR(vortex, charge) && self.vortex_charge < WEP_CVAR(vortex, charge_limit))
self.vortex_charge = min(1, self.vortex_charge + WEP_CVAR(vortex, charge_rate) * frametime / W_TICSPERFRAME);
-
+
if(WEP_CVAR_SEC(vortex, chargepool))
if(self.vortex_chargepool_ammo < 1)
{
}
}
}
-
+
return true;
}
case WR_INIT:
pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
if(!w_issilent)
sound(self, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
-
+
return true;
}
case WR_INIT:
switch ( s )
{
case "nex" : return "vortex";
- case "rocketlauncher" : return "devastator";
+ case "rocketlauncher" : return "devastator";
case "laser" : return "blaster";
case "minstanex" : return "vaporizer";
case "grenadelauncher": return "mortar";
}
}
#endif
-#endif
\ No newline at end of file
+#endif
#undef REGISTER_WEAPON
ACCUMULATE_FUNCTION(RegisterWeapons, register_weapons_done);
-#endif
\ No newline at end of file
+#endif
void CSQCModel_InterpolateAnimation_2To4_Do();
void CSQCModel_InterpolateAnimation_1To2_Do();
// will overwrite lerpfrac, lerpfrac3, lerpfrac4, and possibly clear frame*time if they are undisplayed according to lerpfracs
-#endif
\ No newline at end of file
+#endif
float CSQCPlayer_PreUpdate();
float CSQCPlayer_PostUpdate();
float CSQCPlayer_IsLocalPlayer();
-#endif
\ No newline at end of file
+#endif
#else
#define ALLPROPERTIES ALLPROPERTIES_COMMON
#endif
-#endif
\ No newline at end of file
+#endif
// in case we interpolate that:
.vector v_angle;
-#endif
\ No newline at end of file
+#endif
//vector PL_CROUCH_MIN = ...;
//vector PL_CROUCH_MAX = ...;
//vector PL_CROUCH_VIEW_OFS = ...;
-#endif
\ No newline at end of file
+#endif
#undef CSQCMODEL_PROPERTY
#undef CSQCMODEL_ENDIF
#undef CSQCMODEL_IF
-#endif
\ No newline at end of file
+#endif
vector gettaginfo_right;
vector gettaginfo_up;
float checkpvs(vector viewpos, entity viewee) = #240;
-#endif
\ No newline at end of file
+#endif
float K_MOUSE14 = 527;
float K_MOUSE15 = 528;
float K_MOUSE16 = 529;
-#endif
\ No newline at end of file
+#endif
const string cvar_string(string name) = #71;
const string cvar_defstring(string name) = #89;
float stringwidth(string text, float handleColors, vector size) = #468;
-#endif
\ No newline at end of file
+#endif
// for coop respawn
//============================================================================
-#endif
\ No newline at end of file
+#endif
#define MENU_CMD_H
void GameCommand(string command);
-#endif
\ No newline at end of file
+#endif
float draw_TextWidth_WithColors(string s, vector size);
float draw_TextWidth_WithoutColors(string s, vector size);
-#endif
\ No newline at end of file
+#endif
Object_vtbl = spawnVtbl(e, null_entity);
return e;
}
-#endif
\ No newline at end of file
+#endif
// for the implementation
#define SUPER(cname) (cname##_vtbl.vtblbase)
-#endif
\ No newline at end of file
+#endif
#define ATTRIBARRAY(cname,name,type,cnt) .type name[cnt];
#define ENDCLASS(cname) .float instanceOf##cname;
#define SUPER(cname)
-#endif
\ No newline at end of file
+#endif
../common/weapons/weapons.qc // TODO
-../warpzonelib/mathlib.qc
\ No newline at end of file
+../warpzonelib/mathlib.qc
#undef SKINFLOAT
#undef SKINVECTOR
#undef SKINBEGIN
-#endif
\ No newline at end of file
+#endif
#define SYS_POST_H
#pragma noref 0
-#endif
\ No newline at end of file
+#endif
#define SYS_PRE_H
#pragma noref 1
-#endif
\ No newline at end of file
+#endif
else
{
e.configureXonoticTextSlider(e, pCvar);
-
+
// clear old values
float i;
for(i = 0; i <= e.nValues; ++i);
ATTRIB(XonoticMediaTab, intendedWidth, float, 0.9)
ATTRIB(XonoticMediaTab, rows, float, 23)
ATTRIB(XonoticMediaTab, columns, float, 3)
- ATTRIB(XonoticMediaTab, name, string, "Media")
+ ATTRIB(XonoticMediaTab, name, string, "Media")
ENDCLASS(XonoticMediaTab)
entity makeXonoticMediaTab();
#endif
ATTRIB(XonoticScreenshotBrowserTab, rows, float, 21)
ATTRIB(XonoticScreenshotBrowserTab, columns, float, 6.5)
ATTRIB(XonoticScreenshotBrowserTab, name, string, "ScreenshotBrowser")
-
+
METHOD(XonoticScreenshotBrowserTab, loadPreviewScreenshot, void(entity, string))
ATTRIB(XonoticScreenshotBrowserTab, screenshotImage, entity, NULL)
ATTRIB(XonoticScreenshotBrowserTab, currentScrPath, string, string_null)
me.TD(me, 1, 1, e = makeXonoticButton(_("Refresh"), '0 0 0'));
e.onClick = ScreenshotList_Refresh_Click;
e.onClickEntity = slist;
-
+
/*me.TR(me);
me.TD(me, 1, 0.5, e = makeXonoticTextLabel(0, "Filter:"));
me.TD(me, 1, me.columns - 1.5, e = makeXonoticInputBox(0, string_null));
me.TD(me, 1, 1, e = makeXonoticButton(_("Refresh"), '0 0 0'));
e.onClick = ScreenshotList_Refresh_Click;
e.onClickEntity = slist;*/
-
+
me.gotoRC(me, 1.5, 0);
me.TD(me, me.rows - 2.5, me.columns, slist);
me.TD(me, 1, 2.5, e = makeXonoticCheckBox(0, "cl_allow_uid2name", _("Allow player statistics to use your nickname")));
setDependent(e, "cl_allow_uidtracking", 1, 1);
me.gotoRC(me, 4, 3.1); // TOP RIGHT
- //me.gotoRC(me, 12.5, 3.1); // BOTTOM RIGHT
+ //me.gotoRC(me, 12.5, 3.1); // BOTTOM RIGHT
//me.gotoRC(me, 12.5, 0); // BOTTOM LEFT
me.TDempty(me, 0.25);
me.TD(me, 9, 2.5, statslist = makeXonoticStatsList());
{
entity mc;
mc = makeXonoticTabController(me.rows - 2.5);
-
+
me.TR(me);
me.TDempty(me, 0.25);
me.TD(me, 1, 1, mc.makeTabButton(mc, _("View"), makeXonoticGameViewSettingsTab()));
me.gotoRC(me, 1.5, 0);
me.TD(me, me.rows - 1.5, me.columns, mc);
-
+
/*
makeXonoticGameViewSettingsTab()));
makeXonoticGameGeneralSettingsTab()));
makeXonoticGameCrosshairSettingsTab()));
-
+
makeXonoticGameWeaponSettingsTab()));
l"), makeXonoticGamePlayermodelSettingsTab()));
makeXonoticGameHUDSettingsTab()));
setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2);
me.TD(me, 1, 1.8, e = makeXonoticSlider(0.1, 1, 0.1, "crosshair_ring_alpha"));
setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2);
-
+
me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_dot", _("Enable center crosshair dot")));
setDependent(e, "crosshair_enabled", 1, 2);
e.addValue(e, ZCTX(_("HTTST^Enemies")), "1.25");
e.configureXonoticTextSliderValues(e);
setDependent(e, "crosshair_enabled", 1, 2);*/
-
+
/*me.TR(me);
-
+
me.gotoRC(me, me.rows - 1, 0);
me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
e.onClick = Dialog_Close;
makeMulti(e, "notification_CENTER_POWERUP_SHIELD notification_CENTER_POWERUP_SPEED notification_CENTER_POWERUP_STRENGTH notification_CENTER_POWERDOWN_INVISIBILITY notification_CENTER_POWERDOWN_SHIELD notification_CENTER_POWERDOWN_SPEED notification_CENTER_POWERDOWN_STRENGTH notification_CENTER_SUPERWEAPON_BROKEN notification_CENTER_SUPERWEAPON_LOST notification_CENTER_SUPERWEAPON_PICKUP notification_INFO_POWERUP_INVISIBILITY notification_INFO_POWERUP_SHIELD notification_INFO_POWERUP_SPEED notification_INFO_POWERUP_STRENGTH");
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "notification_CENTER_ITEM_WEAPON_DONTHAVE", _("Weapon centerprint notifications")));
- makeMulti(e, "notification_CENTER_ITEM_WEAPON_DROP notification_CENTER_ITEM_WEAPON_GOT notification_CENTER_ITEM_WEAPON_NOAMMO notification_CENTER_ITEM_WEAPON_PRIMORSEC notification_CENTER_ITEM_WEAPON_UNAVAILABLE");
+ makeMulti(e, "notification_CENTER_ITEM_WEAPON_DROP notification_CENTER_ITEM_WEAPON_GOT notification_CENTER_ITEM_WEAPON_NOAMMO notification_CENTER_ITEM_WEAPON_PRIMORSEC notification_CENTER_ITEM_WEAPON_UNAVAILABLE");
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "notification_INFO_ITEM_WEAPON_DONTHAVE", _("Weapon info message notifications")));
- makeMulti(e, "notification_INFO_ITEM_WEAPON_DROP notification_INFO_ITEM_WEAPON_GOT notification_INFO_ITEM_WEAPON_NOAMMO notification_INFO_ITEM_WEAPON_PRIMORSEC notification_INFO_ITEM_WEAPON_UNAVAILABLE");
+ makeMulti(e, "notification_INFO_ITEM_WEAPON_DROP notification_INFO_ITEM_WEAPON_GOT notification_INFO_ITEM_WEAPON_NOAMMO notification_INFO_ITEM_WEAPON_PRIMORSEC notification_INFO_ITEM_WEAPON_UNAVAILABLE");
me.gotoRC(me, 9, 3.2); me.setFirstColumn(me, me.currentColumn);
me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Announcers")));
{
entity e;
//float i;
-
+
// Note that this is pretty terrible currently due to the lack of options for this tab...
// There is really not many other decent places for these options, additionally
// later I would like quite a few more options in this tab.
me.TR(me);
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_clippedspectating", _("Allow passing through walls while spectating")));
-
+
me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Field of view:")));
me.TD(me, 1, 2, e = makeXonoticSlider(60, 130, 5, "fov"));
draw_Picture(me.columnIconOrigin * eX, GameType_GetIcon(i), me.columnIconSize * eX + eY, '1 1 1', SKINALPHA_LISTBOX_SELECTED);
s1 = GameType_GetName(i);
-
+
if(_MapInfo_GetTeamPlayBool(GameType_GetID(i)))
s2 = _("teamplay");
else
i = spawnXonoticHUDInfoMessagesDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
i = spawnXonoticHUDPhysicsDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
me.screenshotViewerDialog = i = spawnXonoticScreenshotViewerDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
me.cvarsDialog = i = spawnXonoticCvarsDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
me.resetDialog = i = spawnXonoticResetDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
me.serverInfoDialog = i = spawnXonoticServerInfoDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
+
me.demostartconfirmDialog = i = spawnXonoticDemoStartConfirmDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
#ifndef IMPLEMENTATION
float autocvar_menu_slist_categories;
-float autocvar_menu_slist_categories_onlyifmultiple;
+float autocvar_menu_slist_categories_onlyifmultiple;
float autocvar_menu_slist_purethreshold;
float autocvar_menu_slist_modimpurity;
float autocvar_menu_slist_recommendations;
float autocvar_menu_slist_recommendations_maxping;
-float autocvar_menu_slist_recommendations_minfreeslots;
+float autocvar_menu_slist_recommendations_minfreeslots;
float autocvar_menu_slist_recommendations_minhumans;
-float autocvar_menu_slist_recommendations_purethreshold;
+float autocvar_menu_slist_recommendations_purethreshold;
// server cache fields
#define SLIST_FIELDS \
entity RetrieveCategoryEnt(float catnum);
float CheckCategoryOverride(float cat);
-float CheckCategoryForEntry(float entry);
+float CheckCategoryForEntry(float entry);
float m_gethostcachecategory(float entry) { return CheckCategoryOverride(CheckCategoryForEntry(entry)); }
void RegisterSLCategories();
entity catent = RetrieveCategoryEnt(cat);
if(catent)
{
- float override = (autocvar_menu_slist_categories ? catent.cat_enoverride : catent.cat_dioverride);
+ float override = (autocvar_menu_slist_categories ? catent.cat_enoverride : catent.cat_dioverride);
if(override) { return override; }
else { return cat; }
}
if(autocvar_menu_slist_recommendations)
{
string cname = gethostcachestring(SLIST_FIELD_CNAME, entry);
-
+
if(IsPromoted(cname)) { return CAT_RECOMMENDED; }
else
{
if(
///// check for minimum free slots
(freeslots >= autocvar_menu_slist_recommendations_minfreeslots)
-
+
&& // check for purity requirement
(
(autocvar_menu_slist_recommendations_purethreshold < 0)
||
(impure <= autocvar_menu_slist_recommendations_purethreshold)
)
-
+
&& // check for minimum amount of humans
(
gethostcachenumber(SLIST_FIELD_NUMHUMANS, entry)
>=
autocvar_menu_slist_recommendations_minhumans
)
-
+
&& // check for maximum latency
(
gethostcachenumber(SLIST_FIELD_PING, entry)
{
// old servers which don't report their mod name are considered modified now
case "": { return CAT_MODIFIED; }
-
+
case "xpm": { return CAT_XPM; }
case "minstagib":
case "instagib": { return CAT_INSTAGIB; }
//case "newtoys": { return CAT_NEWTOYS; }
// "cts" is allowed as compat, xdf is replacement
- case "cts":
+ case "cts":
case "xdf": { return CAT_DEFRAG; }
-
+
default: { dprintf("Found strange mod type: %s\n", modtype); return CAT_MODIFIED; }
}
}
if(me.currentSortOrder < 0) { listflags |= SLSF_DESCENDING; }
sethostcachesort(me.currentSortField, listflags);
}
-
+
resorthostcache();
if(mode >= REFRESHSERVERLIST_ASK)
refreshhostcache(mode >= REFRESHSERVERLIST_RESET);
{
float itemcount = gethostcachevalue(SLIST_HOSTCACHEVIEWCOUNT);
me.nItems = itemcount;
-
+
//float visible = floor(me.scrollPos / me.itemHeight);
// ^ unfortunately no such optimization can be made-- we must process through the
// entire list, otherwise there is no way to know which item is first in its category.
me.selectedServer = strzone(gethostcachestring(SLIST_FIELD_CNAME, me.selectedItem));
}
}
-
+
if(owned)
{
if(me.selectedServer != me.ipAddressBox.text)
SET_YRANGE(me.categoriesHeight / (me.categoriesHeight + 1), 1);
}
}
-
+
if(isSelected)
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
draw_Picture(iconPos, n, iconSize, '1 1 1', 1);
}
iconPos.x += iconSize.x;
-
+
// --------------
// RENDER TEXT
// --------------
-
+
// ping
s = ftos(p);
draw_Text(me.realUpperMargin * eY + (me.columnPingOrigin + me.columnPingSize - draw_TextWidth(s, 0, me.realFontSize)) * eX, s, me.realFontSize, theColor, theAlpha, 0);
tokenize_console(me.getIdentifier(me));
cvar_set("cl_particles_quality", argv(0));
cvar_set("r_drawparticles_drawdistance", argv(1));
- cvar_set("cl_damageeffect", argv(2));
+ cvar_set("cl_damageeffect", argv(2));
}
}
#endif
if((order == -1) && (out_total_matches >= 0) && (out_total_wins >= 0))
{
bufstr_add(me.listStats, sprintf("003Matches: %d", out_total_matches), true);
-
+
if(out_total_matches > 0) // don't show extra info if there are no matches played
{
out_total_losses = max(0, (out_total_matches - out_total_wins));
{
bufstr_add(me.listStats, sprintf("005Kills/Deaths: %d/%d", out_total_kills, out_total_deaths), true);
- // if there are no deaths, just show kill count
+ // if there are no deaths, just show kill count
if(out_total_deaths > 0)
bufstr_add(me.listStats, sprintf("006Kill_Ratio: %.2f", (out_total_kills / out_total_deaths)), true);
else
else
{
float dividerpos = strstrofs(e, "/", 0);
-
+
string gametype = substring(e, 0, dividerpos);
if(gametype == "overall") { continue; }
-
+
string event = substring(e, (dividerpos + 1), strlen(e) - (dividerpos + 1));
// if we are ranked, read these sets of possible options
data = sprintf("%d%%", stof(data));
break;
}
-
+
#if 0
case "favorite-map":
{
break;
}
#endif
-
+
default: continue; // nothing to see here
}
string data = bufstr_get(me.listStats, i);
string s = car(data);
string d = cdr(data);
-
+
s = substring(s, 3, strlen(s) - 3);
s = strreplace("_", " ", s);
s = draw_TextShortenToWidth(s, 0.5 * me.columnNameSize, 0, me.realFontSize);
void anticheat_endframe();
void anticheat_fixangle();
-#endif
\ No newline at end of file
+#endif
#define ANTILAG_LATENCY(e) min(0.4, e.ping * 0.001)
// add one ticrate?
-#endif
\ No newline at end of file
+#endif
float autocvar_g_buffs_invisible_alpha;
float autocvar_g_buffs_flight_gravity;
float autocvar_g_buffs_jump_height;
-#endif
\ No newline at end of file
+#endif
vector bot_shotlead(vector targorigin, vector targvelocity, float shotspeed, float shotdelay);
.void(float t, float f1, float f2, entity e1, vector v1, vector v2, vector v3, vector v4) lag_func;
-#endif
\ No newline at end of file
+#endif
.entity draggedby;
.float ladder_time;
.entity ladder_entity;
-#endif
\ No newline at end of file
+#endif
void botframe_updatedangerousobjects(float maxupdate);
entity navigation_findnearestwaypoint(entity ent, float walkfromwp);
-#endif
\ No newline at end of file
+#endif
float campaign_bots_may_start;
// campaign mode: bots shall spawn but wait for the player to spawn before they do anything
// in other game modes, this is ignored
-#endif
\ No newline at end of file
+#endif
float CheatFrame();
void Drag_MoveDrag(entity from, entity to); // call this from CopyBody
-#endif
\ No newline at end of file
+#endif
*/
void ImpulseCommands (void);
-#endif
\ No newline at end of file
+#endif
// used by common/command/generic.qc:GenericCommand_dumpcommands to list all commands into a .txt file
void BanCommand_macro_write_aliases(float fh);
-#endif
\ No newline at end of file
+#endif
{
makevectors(self.v_angle);
WarpZone_TraceLine(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * 100, MOVE_NORMAL, self);
-
+
if(!autocvar_g_monsters_edit) { sprint(self, "Monster property editing is not enabled.\n"); return; }
if(trace_ent.flags & FL_MONSTER)
{
{
makevectors(self.v_angle);
WarpZone_TraceLine(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * 100, MOVE_NORMAL, self);
-
+
if(trace_ent.flags & FL_MONSTER)
{
if(trace_ent.realowner != self)
return;
}
}
-
+
default:
sprint(self, "Incorrect parameters for ^2mobkill^7\n");
case CMD_REQUEST_USAGE:
entity e;
string tospawn;
float moveflag, monstercount = 0;
-
+
moveflag = (argv(2) ? stof(argv(2)) : 1); // follow owner if not defined
tospawn = strtolower(argv(1));
-
+
if(tospawn == "list")
{
sprint(self, monsterlist_reply);
return;
}
-
+
FOR_EACH_MONSTER(e)
{
if(e.realowner == self)
++monstercount;
}
-
+
if(autocvar_g_monsters_max <= 0 || autocvar_g_monsters_max_perplayer <= 0) { sprint(self, "Monster spawning is disabled.\n"); return; }
else if(!IS_PLAYER(self)) { sprint(self, "You can't spawn monsters while spectating.\n"); return; }
else if(MUTATOR_CALLHOOK(AllowMobSpawning)) { sprint(self, "Monster spawning is currently disabled by a mutator.\n"); return; }
{
float found = 0, i;
entity mon;
-
+
for(i = MON_FIRST; i <= MON_LAST; ++i)
{
mon = get_monsterinfo(i);
if(found || tospawn == "random")
{
totalspawned += 1;
-
+
makevectors(self.v_angle);
WarpZone_TraceBox (CENTER_OR_VIEWOFS(self), PL_MIN, PL_MAX, CENTER_OR_VIEWOFS(self) + v_forward * 150, true, self);
//WarpZone_TraceLine(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * 150, MOVE_NORMAL, self);
-
+
e = spawnmonster(tospawn, 0, self, self, trace_endpos, false, false, moveflag);
-
+
sprint(self, strcat("Spawned ", e.monster_name, "\n"));
-
+
return;
}
}
}
-
+
default:
sprint(self, "Incorrect parameters for ^2mobspawn^7\n");
case CMD_REQUEST_USAGE:
// used by common/command/generic.qc:GenericCommand_dumpcommands to list all commands into a .txt file
void ClientCommand_macro_write_aliases(float fh);
-#endif
\ No newline at end of file
+#endif
}
-#endif
\ No newline at end of file
+#endif
// used by common/command/generic.qc:GenericCommand_dumpcommands to list all commands into a .txt file
void GameCommand_macro_write_aliases(float fh);
-#endif
\ No newline at end of file
+#endif
.float ready; // flag for if a player is ready
void reset_map(float dorespawn);
void ReadyCount();
-#endif
\ No newline at end of file
+#endif
RemoveGrapplingHook(head);
// add waypoint
- if(show_waypoint)
+ if(show_waypoint)
WaypointSprite_Spawn("frozen", 0, 0, targ, '0 0 64', world, targ.team, targ, waypointsprite_attached, true, RADARICON_WAYPOINT, '0.25 0.90 1');
}
targ.frozen = 0;
targ.revive_progress = 0;
targ.revival_time = time;
-
+
WaypointSprite_Kill(targ.waypointsprite_attached);
-
+
FOR_EACH_PLAYER(head)
if(head.hook.aiment == targ)
RemoveGrapplingHook(head);
damage = 0;
force *= autocvar_g_freezetag_frozen_force;
}
-
+
if(targ.frozen && deathtype == DEATH_HURTTRIGGER && !autocvar_g_freezetag_frozen_damage_trigger)
{
pointparticles(particleeffectnum("teleport"), targ.origin, '0 0 0', 1);
-
+
entity oldself = self;
self = targ;
entity spot = SelectSpawnPoint (false);
-
+
if(spot)
{
damage = 0;
self.deadflag = DEAD_NO;
self.angles = spot.angles;
-
+
self.effects = 0;
self.effects |= EF_TELEPORT_BIT;
self.punchangle = '0 0 0';
self.punchvector = '0 0 0';
self.oldvelocity = self.velocity;
-
+
self.spawnorigin = spot.origin;
setorigin (self, spot.origin + '0 0 1' * (1 - self.mins.z - 24));
// don't reset back to last position, even if new position is stuck in solid
self.oldorigin = self.origin;
self.prevorigin = self.origin;
-
+
pointparticles(particleeffectnum("teleport"), self.origin, '0 0 0', 1);
}
-
+
self = oldself;
}
void Fire_ApplyEffect(entity e);
void fireburner_think();
-#endif
\ No newline at end of file
+#endif
void GrappleHookInit();
vector hook_shotorigin[4];
-#endif
\ No newline at end of file
+#endif
void InitSolidBSPTrigger();
float InitMovingBrushTrigger();
-#endif
\ No newline at end of file
+#endif
void spawnfunc_target_changelevel_use();
void spawnfunc_target_changelevel();
-#endif
\ No newline at end of file
+#endif
void Violence_GibSplash_At(vector org, vector dir, float type, float amount, entity gibowner, entity attacker);
void Violence_GibSplash(entity source, float type, float amount, entity attacker);
-#endif
\ No newline at end of file
+#endif
addstat(STAT_VORTEX_CHARGEPOOL, AS_FLOAT, vortex_chargepool_ammo);
addstat(STAT_HAGAR_LOAD, AS_INT, hagar_load);
-
+
addstat(STAT_ARC_HEAT, AS_FLOAT, arc_heat_percent);
// freeze attacks
string m;
m = GameTypeVote_MapInfo_FixName(autocvar_nextmap);
cvar_set("nextmap",m);
-
+
if(!m || gametypevote)
return false;
if(autocvar_sv_vote_gametype)
Map_Goto_SetStr(m);
return false;
}
-
+
if(MapInfo_CheckMap(m))
{
Map_Goto_SetStr(m);
void CheckRules_Player();
void IntermissionThink();
-#endif
\ No newline at end of file
+#endif
float BanCommand(string command);
void OnlineBanList_URI_Get_Callback(float id, float status, string data);
-#endif
\ No newline at end of file
+#endif
* Returns a string with a comma separated list of key names, as specified in keylist.
*/
string item_keys_keylist(float keylist);
-#endif
\ No newline at end of file
+#endif
#endif
float GameTypeVote_AvailabilityStatus(string gtname)
-{
+{
float type = MapInfo_Type_FromString(gtname);
if( type == 0 )
return GTV_FORBIDDEN;
-
+
if ( autocvar_nextmap != "" )
{
if ( !MapInfo_Get_ByName(autocvar_nextmap, false, 0) )
if (!(MapInfo_Map_supportedGametypes & type))
return GTV_FORBIDDEN;
}
-
+
return GTV_AVAILABLE;
}
for(i = 0, power = 1; i < mapvote_count; ++i, power *= 2)
if(mapvote_maps_availability[i] == GTV_AVAILABLE )
mask |= power;
-
+
if(mapvote_count < 8)
WriteByte(MSG_ENTITY, mask);
else if (mapvote_count < 16)
WriteByte(MSG_ENTITY, mapvote_abstain);
WriteByte(MSG_ENTITY, mapvote_detail);
WriteCoord(MSG_ENTITY, mapvote_timeout);
-
+
if ( gametypevote )
{
// gametype vote
}
return false;
}
-
+
Map_Goto_SetStr(mapvote_maps[mappos]);
Map_Goto(0);
alreadychangedlevel = true;
-
+
return true;
}
{
float i;
- for(i = 0; i < mapvote_count; ++i)
+ for(i = 0; i < mapvote_count; ++i)
if( mapvote_maps_availability[i] == GTV_AVAILABLE )
{
//dprint("Map ", ftos(i), ": "); dprint(mapvote_maps[i], "\n");
RandomSelection_Init();
currentPlace = 0;
currentVotes = -1;
- for(i = 0; i < mapvote_count_real; ++i)
+ for(i = 0; i < mapvote_count_real; ++i)
if ( mapvote_maps_availability[i] == GTV_AVAILABLE )
{
RandomSelection_Add(world, i, string_null, 1, mapvote_selections[i]);
firstPlace = currentPlace;
else
firstPlace = RandomSelection_chosen_float;
-
+
//dprint("First place: ", ftos(firstPlace), "\n");
//dprint("First place votes: ", ftos(firstPlaceVotes), "\n");
GotoNextMap(0);
return;
}
-
+
if(autocvar_sv_vote_gametype) { GameTypeVote_Start(); }
else if(autocvar_nextmap == "") { MapVote_Init(); }
}
{
if (MapInfo_CurrentGametype() == type)
return true;
-
+
float tsave = MapInfo_CurrentGametype();
MapInfo_SwitchGameType(type);
{
if(!gametypevote || gametypevote_finished)
return false;
-
+
if ( !GameTypeVote_SetGametype(MapInfo_Type_FromString(mapvote_maps[pos])) )
{
dprint("Selected gametype is not supported by any map");
}
-
+
localcmd("sv_vote_gametype_hook_all\n");
localcmd("sv_vote_gametype_hook_", mapvote_maps[pos], "\n");
-
+
gametypevote_finished = true;
-
+
return true;
}
for(j = 0; j < mapvote_count; ++j)
if(mapvote_maps[j] == nextMode)
return false;
-
+
mapvote_maps[mapvote_count] = strzone(nextMode);
mapvote_maps_suggested[mapvote_count] = false;
mapvote_maps_availability[mapvote_count] = GameTypeVote_AvailabilityStatus(nextMode);
mapvote_count += 1;
-
+
return true;
-
+
}
float GameTypeVote_Start()
float j;
MapVote_ClearAllVotes();
MapVote_UnzoneStrings();
-
+
mapvote_count = 0;
mapvote_timeout = time + autocvar_sv_vote_gametype_timeout;
mapvote_abstain = 0;
mapvote_detail = !autocvar_g_maplist_votable_nodetail;
-
+
float n = tokenizebyseparator(autocvar_sv_vote_gametype_options, " ");
n = min(MAPVOTE_COUNT, n);
-
+
float really_available, which_available;
really_available = 0;
which_available = -1;
}
mapvote_count_real = mapvote_count;
-
+
gametypevote = 1;
-
+
if ( really_available == 0 )
{
if ( mapvote_count > 0 )
MapVote_Finished(which_available);
return false;
}
-
+
mapvote_count_real = mapvote_count;
mapvote_keeptwotime = time + autocvar_sv_vote_gametype_keeptwotime;
if(mapvote_count_real < 3 || mapvote_keeptwotime <= time)
mapvote_keeptwotime = 0;
-
+
MapVote_Spawn();
-
+
return true;
}
.float mapvote;
entity mapvote_ent;
-#endif
\ No newline at end of file
+#endif
void movelib_groundalign4point(float spring_length, float spring_up, float blendrate, float _max);
-#endif
\ No newline at end of file
+#endif
const float MUT_ACCADD_VALID = 0; // return this flag to make the function continue if target is a client
const float MUT_ACCADD_INVALID = 1; // return this flag to make the function always continue
const float MUT_ACCADD_INDIFFERENT = 2; // return this flag to make the function always return
-#endif
\ No newline at end of file
+#endif
#define GAMEMODE_CA_H
// should be removed in the future, as other code should not have to care
.float caplayer; // 0.5 if scheduled to join the next round
-#endif
\ No newline at end of file
+#endif
void havocbot_role_ctf_setrole(entity bot, float role);
#endif
-#endif
\ No newline at end of file
+#endif
self.movement_y = -M_SQRT1_2 * wishspeed;
}
}
-
+
return false;
}
cvar_set("timelimit", ftos(race_timelimit));
cts_ScoreRules();
}
-
+
return false;
}
{
race_PreparePlayer();
self.race_checkpoint = -1;
-
+
if(IS_REAL_CLIENT(self))
{
string rr = CTS_RECORD;
self.race_respawn_spotref = spawn_spot;
self.race_place = 0;
-
+
return false;
}
const float SP_CTS_LAPS = 4;
const float SP_CTS_TIME = 5;
const float SP_CTS_FASTEST = 6;
-#endif
\ No newline at end of file
+#endif
domination_teams = bound(2, ((autocvar_g_domination_teams_override < 2) ? autocvar_g_domination_default_teams : autocvar_g_domination_teams_override), 4);
dom_spawnteams(domination_teams);
}
-
+
CheckAllowedTeams(world);
domination_teams = ((c4>=0) ? 4 : (c3>=0) ? 3 : 2);
// misc globals
float domination_roundbased;
float domination_teams;
-#endif
\ No newline at end of file
+#endif
}
else
monster = spawnmonster("", ((spawn_point.monsterid) ? spawn_point.monsterid : mon), spawn_point, spawn_point, spawn_point.origin, false, false, 2);
-
+
if(spawn_point) monster.target2 = spawn_point.target2;
monster.spawnshieldtime = time;
if(spawn_point && spawn_point.target_range) monster.target_range = spawn_point.target_range;
-
+
if(teamplay)
if(spawn_point && spawn_point.team && inv_monsters_perteam[spawn_point.team] > 0)
monster.team = spawn_point.team;
if(inv_monsters_perteam[NUM_TEAM_2] > 0) RandomSelection_Add(world, NUM_TEAM_2, string_null, 1, 1);
if(invasion_teams >= 3) if(inv_monsters_perteam[NUM_TEAM_3] > 0) { RandomSelection_Add(world, NUM_TEAM_3, string_null, 1, 1); }
if(invasion_teams >= 4) if(inv_monsters_perteam[NUM_TEAM_4] > 0) { RandomSelection_Add(world, NUM_TEAM_4, string_null, 1, 1); }
-
+
monster.team = RandomSelection_chosen_float;
}
-
+
if(teamplay)
{
monster_setupcolors(monster);
-
+
if(monster.sprite)
{
WaypointSprite_UpdateTeamRadar(monster.sprite, RADARICON_DANGER, ((monster.team) ? Team_ColorRGB(monster.team) : '1 0 0'));
monster.sprite.SendFlags |= 1;
}
}
-
+
monster.monster_attack = false; // it's the player's job to kill all the monsters
if(inv_roundcnt >= inv_maxrounds)
if(inv_numspawned < 1)
return 0; // nothing has spawned yet
-
+
if(teamplay)
{
if(((red_alive > 0) + (blue_alive > 0) + (yellow_alive > 0) + (pink_alive > 0)) > 1)
if(pink_alive > 0)
if(winner_team) { winner_team = 0; }
else { winner_team = NUM_TEAM_4; }
- }
+ }
else
FOR_EACH_PLAYER(head)
{
if(startsWith(self.classname, "monster_"))
if(!(self.spawnflags & MONSTERFLAG_SPAWNED))
return true;
-
+
return false;
}
{
if(!(checkentity.flags & FL_MONSTER))
return true;
-
+
return false;
}
invasion_teams = bound(2, autocvar_g_invasion_teams, 4);
else
invasion_teams = 0;
-
+
independent_players = 1; // to disable extra useless scores
invasion_ScoreRules(invasion_teams);
MON_ACTION(i, MR_PRECACHE);
}
}
-
+
InitializeEntity(world, invasion_DelayedInit, INITPRIO_GAMETYPE);
}
float inv_monsterskill;
const float ST_INV_KILLS = 1;
-#endif
\ No newline at end of file
+#endif
void() havocbot_role_ka_carrier;
void() havocbot_role_ka_collector;
-#endif
\ No newline at end of file
+#endif
typedef void(void) kh_Think_t;
void kh_StartRound();
void kh_Controller_SetThink(float t, kh_Think_t func);
-#endif
\ No newline at end of file
+#endif
float lms_lowest_lives;
float lms_next_place;
float LMS_NewPlayerLives();
-#endif
\ No newline at end of file
+#endif
.float nb_droptime;
.float teamtime;
-#endif
\ No newline at end of file
+#endif
activator = self;
SUB_UseTargets(); // to reset the structures, playerspawns etc.
-
+
CSQCMODEL_AUTOUPDATE();
}
self.enemy.colormap = self.colormap;
waypoint_spawnforitem(self);
-
+
self.think = onslaught_controlpoint_think;
self.nextthink = time;
onslaught_updatelinks();
self.reset = onslaught_controlpoint_reset;
-
+
CSQCMODEL_AUTOINIT();
}
MUTATOR_HOOKFUNCTION(ons_MonsterSpawn)
{
entity e, ee = world;
-
+
if(self.targetname)
{
e = find(world,target,self.targetname);
ee = e;
}
}
-
+
if(ee)
{
activator = ee;
self.movement_y = -M_SQRT1_2 * wishspeed;
}
}
-
+
return false;
}
cvar_set("timelimit", ftos(race_timelimit));
race_ScoreRules();
}
-
+
return false;
}
self.race_respawn_spotref = spawn_spot;
self.race_place = 0;
-
+
return false;
}
const float SP_RACE_LAPS = 4;
const float SP_RACE_TIME = 5;
const float SP_RACE_FASTEST = 6;
-#endif
\ No newline at end of file
+#endif
void buff_Respawn(entity ent)
{
if(gameover) { return; }
-
+
vector oldbufforigin = ent.origin;
-
+
if(!MoveToRandomMapLocation(ent, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, ((autocvar_g_buffs_random_location_attempts > 0) ? autocvar_g_buffs_random_location_attempts : 10), 1024, 256))
{
entity spot = SelectSpawnPoint(true);
setorigin(ent, ((spot.origin + '0 0 200') + (randomvec() * 300)));
ent.angles = spot.angles;
}
-
+
tracebox(ent.origin, ent.mins * 1.5, self.maxs * 1.5, ent.origin, MOVE_NOMONSTERS, ent);
-
+
setorigin(ent, trace_endpos); // attempt to unstick
-
+
ent.movetype = MOVETYPE_TOSS;
-
+
makevectors(ent.angles);
ent.velocity = '0 0 200';
ent.angles = '0 0 0';
pointparticles(particleeffectnum("electro_combo"), oldbufforigin + ((ent.mins + ent.maxs) * 0.5), '0 0 0', 1);
pointparticles(particleeffectnum("electro_combo"), CENTER_OR_VIEWOFS(ent), '0 0 0', 1);
-
+
WaypointSprite_Ping(ent.buff_waypoint);
-
+
sound(ent, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
}
}
else { return; } // do nothing
}
-
+
self.owner = other;
self.buff_active = false;
self.lifetime = 0;
-
+
Send_Notification(NOTIF_ONE, other, MSG_MULTI, ITEM_BUFF_GOT, self.buffs);
Send_Notification(NOTIF_ALL_EXCEPT, other, MSG_INFO, INFO_ITEM_BUFF, other.netname, self.buffs);
self.color = Buff_Color(self.buffs);
self.glowmod = ((self.team) ? Team_ColorRGB(self.team) + '0.1 0.1 0.1' : self.color);
self.skin = Buff_Skin(self.buffs);
-
+
setmodel(self, "models/relics/relic.md3");
if(self.buff_waypoint)
self.owner = world;
if(autocvar_g_buffs_randomize)
buff_NewType(self, self.buffs);
-
+
if(autocvar_g_buffs_random_location || (self.spawnflags & 1))
buff_Respawn(self);
}
-
+
if(self.buff_activetime)
if(!gameover)
if((round_handler_IsActive() && !round_handler_IsRoundStarted()) || time >= game_starttime)
if(self.team && !self.buff_waypoint)
buff_Waypoint_Spawn(self);
-
+
if(self.lifetime)
if(time >= self.lifetime)
buff_Respawn(self);
}
-
+
self.nextthink = time;
//self.angles_y = time * 110.1;
}
buff_SetCooldown(autocvar_g_buffs_cooldown_activate);
buff_Waypoint_Reset();
self.buff_activetime_updated = false;
-
+
if(autocvar_g_buffs_random_location || (self.spawnflags & 1))
buff_Respawn(self);
}
void buff_Init(entity ent)
{
if(!cvar("g_buffs")) { remove(self); return; }
-
+
if(!teamplay && self.team) { self.team = 0; }
entity oldself = self;
self = ent;
if(!self.buffs || buff_Available(self.buffs))
buff_NewType(self, 0);
-
+
self.classname = "item_buff";
self.solid = SOLID_TRIGGER;
self.flags = FL_ITEM;
buff_SetCooldown(autocvar_g_buffs_cooldown_activate + game_starttime);
self.buff_active = !self.buff_activetime;
self.pflags = PFLAGS_FULLDYNAMIC;
-
+
if(self.noalign)
self.movetype = MOVETYPE_NONE; // reset by random location
setmodel(self, "models/relics/relic.md3");
setsize(self, BUFF_MIN, BUFF_MAX);
-
+
if(cvar("g_buffs_random_location") || (self.spawnflags & 1))
buff_Respawn(self);
-
+
self = oldself;
}
setorigin(ent, old.origin);
ent.angles = old.angles;
ent.noalign = old.noalign;
-
+
buff_Init(ent);
}
{
if(self.enemy)
Damage(self.enemy, self.owner, self.owner, self.dmg, DEATH_BUFF_VENGEANCE, self.enemy.origin, '0 0 0');
-
+
remove(self);
return;
}
if(random() <= autocvar_g_buffs_medic_survive_chance)
if(frag_target.health - autocvar_g_buffs_medic_survive_health > 0) // not if the final result would be less than 0, medic must get health
frag_damage = frag_target.health - autocvar_g_buffs_medic_survive_health;
-
+
if(frag_target.buffs & BUFF_VENGEANCE)
if(frag_attacker)
if(frag_attacker != frag_target)
if(frag_attacker != frag_target)
if(vlen(frag_force))
frag_force = '0 0 0';
-
+
if(frag_attacker.buffs & BUFF_BASH)
if(vlen(frag_force))
if(frag_attacker == frag_target)
frag_force *= autocvar_g_buffs_bash_force_self;
else
frag_force *= autocvar_g_buffs_bash_force;
-
+
if(frag_attacker.buffs & BUFF_DISABILITY)
if(frag_target != frag_attacker)
frag_target.buff_disability_time = time + autocvar_g_buffs_disability_time;
self.stat_sv_maxspeed *= autocvar_g_buffs_speed_speed;
self.stat_sv_airspeedlimit_nonqw *= autocvar_g_buffs_speed_speed;
}
-
+
if(time < self.buff_disability_time)
{
self.stat_sv_maxspeed *= autocvar_g_buffs_disability_speed;
{
Send_Notification(NOTIF_ALL_EXCEPT, self, MSG_INFO, INFO_ITEM_BUFF_LOST, self.netname, self.buffs);
self.buffs = 0;
-
+
if(self.buff_model)
{
remove(self.buff_model);
remove(self.buff_model);
self.buff_model = world;
}
-
+
// also reset timers here to prevent them continuing after spectating
self.buff_disability_time = 0;
self.buff_disability_effect_time = 0;
{
if(self.buffs & BUFF_SPEED)
weapon_rate *= autocvar_g_buffs_speed_rate;
-
+
if(time < self.buff_disability_time)
weapon_rate *= autocvar_g_buffs_disability_rate;
-
+
return false;
}
MUTATOR_HOOKFUNCTION(buffs_PlayerThink)
{
if(gameover || self.deadflag != DEAD_NO) { return false; }
-
+
if(time < self.buff_disability_time)
if(time >= self.buff_disability_effect_time)
{
pointparticles(particleeffectnum("smoking"), self.origin + ((self.mins + self.maxs) * 0.5), '0 0 0', 1);
self.buff_disability_effect_time = time + 0.5;
}
-
+
if(self.frozen)
{
if(self.buffs)
self.buffs = 0;
}
}
-
+
if((self.buffs & BUFF_INVISIBLE) && (self.oldbuffs & BUFF_INVISIBLE))
if(self.alpha != autocvar_g_buffs_invisible_alpha)
self.alpha = autocvar_g_buffs_invisible_alpha;
if(!self.ammo_nails) { self.ammo_nails = 20; }
if(!self.ammo_fuel) { self.ammo_fuel = 20; }
}
-
+
if(self.oldbuffs & BUFF_INVISIBLE)
{
if(time < self.strength_finished && g_instagib)
self.buff_invisible_prev_alpha = self.alpha;
self.alpha = autocvar_g_buffs_invisible_alpha;
}
-
+
if(self.oldbuffs & BUFF_FLIGHT)
self.gravity = self.buff_flight_prev_gravity;
else if(self.buffs & BUFF_FLIGHT)
self.buff_model.color = Buff_Color(self.buffs);
self.buff_model.glowmod = ((self.buff_model.team) ? Team_ColorRGB(self.buff_model.team) + '0.1 0.1 0.1' : self.buff_model.color);
self.buff_model.skin = Buff_Skin(self.buffs);
-
+
self.effects |= EF_NOSHADOW;
}
else
{
remove(self.buff_model);
self.buff_model = world;
-
+
self.effects &= ~(EF_NOSHADOW);
}
}
self.buff_model.effects = self.effects;
self.buff_model.effects |= EF_LOWPRECISION;
self.buff_model.effects = self.buff_model.effects & EFMASK_CHEAP; // eat performance
-
+
self.buff_model.alpha = self.alpha;
}
regen_mod_limit = regen_mod_max = autocvar_g_buffs_medic_max;
regen_mod_regen = autocvar_g_buffs_medic_regen;
}
-
+
if(self.buffs & BUFF_SPEED)
regen_mod_regen = autocvar_g_buffs_speed_regen;
addstat(STAT_BUFFS, AS_INT, buffs);
addstat(STAT_MOVEVARS_JUMPVELOCITY, AS_FLOAT, stat_jumpheight);
-
+
InitializeEntity(world, buffs_DelayedInit, INITPRIO_FINDTARGET);
}
// client side options
.float cvar_cl_buffs_autoreplace;
-#endif
\ No newline at end of file
+#endif
// the jump part of the dodge cannot be ramped
.float dodging_single_action;
-#endif
\ No newline at end of file
+#endif
// always refill ammo
if(self.monsterid == MON_MAGE)
self.skin = 1;
-
+
return false;
}
if(frag_deathtype & HITTYPE_SECONDARY)
{
frag_damage = frag_mirrordamage = 0;
-
+
if(frag_target != frag_attacker)
{
if(frag_target.health > 0) { Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_SECONDARY_NODAMAGE); }
else { DropBall(frost_target.ballcarried, frost_target.origin, frost_target.velocity);}
if(frost_target.flagcarried) { ctf_Handle_Throw(frost_target, world, DROP_THROW); }
if(frost_target.nade) { toss_nade(frost_target, '0 0 0', time + 0.05); }
-
+
kh_Key_DropAll(frost_target, false);
}
remove(self);
return;
}
-
+
self.nextthink = time;
-
+
if(time >= self.nade_special_time)
{
self.nade_special_time = time+0.25;
pointparticles(particleeffectnum("healing_fx"), other.origin, '0 0 0', 1);
other.health = min(other.health+health_factor, maxhealth);
}
- other.pauserothealth_finished = max(other.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot);
+ other.pauserothealth_finished = max(other.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot);
}
else if ( health_factor < 0 )
{
Damage(other,self,self.realowner,-health_factor,DEATH_NADE_HEAL,other.origin,'0 0 0');
}
-
+
}
-
+
if ( IS_REAL_CLIENT(other) || (other.vehicle_flags & VHF_ISVEHICLE) )
{
entity show_red = (other.vehicle_flags & VHF_ISVEHICLE) ? other.owner : other;
healer.healer_radius = autocvar_g_nades_nade_radius;
vector size = '1 1 1' * healer.healer_radius / 2;
setsize(healer,-size,size);
-
+
Net_LinkEntity(healer, true, 0, healer_send);
-
+
healer.think = nade_heal_think;
healer.nextthink = time;
healer.SendFlags |= 1;
void nade_monster_boom()
{
entity e = spawnmonster(self.pokenade_type, 0, self.realowner, self.realowner, self.origin, false, false, 1);
-
+
if(autocvar_g_nades_pokenade_monster_lifetime > 0)
e.monster_lifetime = time + autocvar_g_nades_pokenade_monster_lifetime;
e.monster_skill = MONSTER_SKILL_INSANE;
remove(self);
return;
}
-
+
PROJECTILE_TOUCH;
//setsize(self, '-2 -2 -2', '2 2 2');
}
self.health -= damage;
-
+
if ( self.nade_type != NADE_TYPE_HEAL || IS_PLAYER(attacker) )
self.realowner = attacker;
self.traileffectnum = particleeffectnum(Nade_TrailEffect(Nade_ProjectileFromID(self.nade_type, false), self.team));
self.alpha = 1;
}
-
+
return true;
}
n.nade_type = ((autocvar_g_nades_client_select) ? self.cvar_cl_nade_type : autocvar_g_nades_nade_type);
n.pokenade_type = ((autocvar_g_nades_client_select) ? self.cvar_cl_pokenade_type : autocvar_g_nades_pokenade_monster_type);
}
-
+
n.nade_type = bound(1, n.nade_type, NADE_TYPE_LAST);
setmodel(n, "models/weapons/v_ok_grenade.md3");
if(g_grappling_hook || client_hasweapon(self, WEP_HOOK, false, false) || (weaponsInMap & WEPSET_HOOK))
key_pressed = self.button16; // if hook is enabled, use an alternate key
-
+
if(self.nade)
{
self.nade_timer = bound(0, (time - self.nade.lifetime) / autocvar_g_nades_nade_lifetime, 1);
time_score = autocvar_g_nades_bonus_score_time_flagcarrier;
else
time_score = autocvar_g_nades_bonus_score_time;
-
+
if(key_count)
time_score = autocvar_g_nades_bonus_score_time_flagcarrier * key_count; // multiply by the number of keys the player is holding
self.nade_type = autocvar_g_nades_bonus_type;
self.pokenade_type = autocvar_g_nades_pokenade_monster_type;
}
-
+
self.nade_type = bound(1, self.nade_type, NADE_TYPE_LAST);
if(self.bonus_nade_score >= 0 && autocvar_g_nades_bonus_score_max)
{
setorigin(self, self.nade_spawnloc.origin);
self.nade_spawnloc.cnt -= 1;
-
+
if(self.nade_spawnloc.cnt <= 0)
{
remove(self.nade_spawnloc);
Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_REVIVED_NADE, frag_target.netname);
Send_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_FREEZETAG_REVIVE_SELF);
}
-
+
return false;
}
addstat(STAT_NADE_BONUS_SCORE, AS_FLOAT, bonus_nade_score);
addstat(STAT_HEALING_ORB, AS_FLOAT, stat_healing_orb);
addstat(STAT_HEALING_ORB_ALPHA, AS_FLOAT, stat_healing_orb_alpha);
-
+
precache_model("models/ok_nade_counter/ok_nade_counter.md3");
precache_model("models/weapons/h_ok_grenade.iqm");
precache_model("models/weapons/v_ok_grenade.md3");
void(entity player, float score) nades_GiveBonus;
// Remove all bonus nades from a player
void(entity player) nades_RemoveBonus;
-#endif
\ No newline at end of file
+#endif
if(nix_nextchange != self.nix_lastchange_id) // this shall only be called once per round!
{
self.ammo_shells = self.ammo_nails = self.ammo_rockets = self.ammo_cells = self.ammo_plasma = self.ammo_fuel = 0;
-
+
if(self.items & IT_UNLIMITED_WEAPON_AMMO)
{
switch(e.ammo_field)
{
self.armorvalue = CalcRotRegen(self.armorvalue, autocvar_g_balance_armor_regenstable, autocvar_g_balance_armor_regen, autocvar_g_balance_armor_regenlinear, 1 * frametime * (time > self.ok_pauseregen_finished), 0, 0, 1, 1 * frametime * (time > self.pauserotarmor_finished), autocvar_g_balance_armor_limit);
self.health = CalcRotRegen(self.health, autocvar_g_balance_health_regenstable, 0, 100, 1 * frametime * (time > self.ok_pauseregen_finished), 200, 0, autocvar_g_balance_health_rotlinear, 1 * frametime * (time > self.pauserothealth_finished), autocvar_g_balance_health_limit);
-
+
float minf, maxf, limitf;
maxf = autocvar_g_balance_fuel_rotstable;
{
self.jump_interval = time + WEP_CVAR_PRI(blaster, refire) * W_WeaponRateFactor();
makevectors(self.v_angle);
-
+
W_Blaster_Attack(
WEP_BLASTER | HITTYPE_SECONDARY,
WEP_CVAR_SEC(vaporizer, shotangle),
}
else
self.ok_use_ammocharge = 0;
-
+
self.ok_pauseregen_finished = time + 2;
return false;
void(entity ent, float wep) ok_DecreaseCharge;
-#endif
\ No newline at end of file
+#endif
MUTATOR_DECLARATION(sandbox);
MUTATOR_DECLARATION(mutator_overkill);
-#endif
\ No newline at end of file
+#endif
#include "mutator_overkill.qh"
#include "mutator_nades.qh"
#include "mutator_buffs.qh"
-#endif
\ No newline at end of file
+#endif
}
self.nextthink = time;
-
+
CSQCMODEL_AUTOUPDATE();
}
setorigin(e, trace_endpos);
e.angles_y = self.v_angle.y;
}
-
+
oldself = self;
self = e;
CSQCMODEL_AUTOINIT();
#include "expandnode.qc"
#include "main.qc"
#include "path_waypoint.qc"
-#endif
\ No newline at end of file
+#endif
void playerdemo_open_read(string f);
void playerdemo_open_write(string f);
-#endif
\ No newline at end of file
+#endif
vector Portal_ApplyTransformToPlayerAngle(vector transform, vector vangle);
void Portal_ClearAll_PortalsOnly(entity own);
-#endif
\ No newline at end of file
+#endif
../warpzonelib/common.qc
../warpzonelib/mathlib.qc
../warpzonelib/server.qc
-../warpzonelib/util_server.qc
\ No newline at end of file
+../warpzonelib/util_server.qc
float race_readTime(string map, float pos);
string race_readUID(string map, float pos);
string race_readName(string map, float pos);
-#endif
\ No newline at end of file
+#endif
#define round_handler_IsRoundStarted() (!round_handler.wait && !round_handler.cnt)
#define round_handler_GetEndTime() (round_handler.round_endtime)
-#endif
\ No newline at end of file
+#endif
* nospectators: exclude spectators
*/
entity PlayerScore_Sort(.float field, float teams, float strict, float nospectators);
-#endif
\ No newline at end of file
+#endif
* update secrets status.
*/
void secrets_setstatus();
-#endif
\ No newline at end of file
+#endif
float SpawnEvent_Send(entity to, float sf);
entity Spawn_FilterOutBadSpots(entity firstspot, float mindist, float teamcheck);
entity SelectSpawnPoint (float anypoint);
-#endif
\ No newline at end of file
+#endif
self.think = Item_Think;
self.nextthink = time;
-
+
//pointparticles(particleeffectnum("item_respawn"), self.origin + self.mins_z * '0 0 1' + '0 0 48', '0 0 0', 1);
pointparticles(particleeffectnum("item_respawn"), self.origin + 0.5 * (self.mins + self.maxs), '0 0 0', 1);
}
Item_Reset();
Net_LinkEntity(self, false, 0, ItemSend);
-
+
self.SendFlags |= ISF_SIZE;
if(self.angles)
self.SendFlags |= ISF_ANGLES;
float GiveItems(entity e, float beginarg, float endarg);
#endif
-#endif
\ No newline at end of file
+#endif
void spawnfunc_target_push();
void spawnfunc_info_notnull();
void spawnfunc_target_position();
-#endif
\ No newline at end of file
+#endif
if (!InitMovingBrushTrigger())
return;
self.effects |= EF_LOWPRECISION;
-
+
if (self.spawnflags & 2)
{
self.platmovetype_turn = true;
void spawnfunc_trigger_teleport (void);
void WarpZone_PostTeleportPlayer_Callback(entity pl);
-#endif
\ No newline at end of file
+#endif
void SV_ChangeTeam(float _color);
void ShufflePlayerOutOfTeam (float source_team);
-#endif
\ No newline at end of file
+#endif
//#include "../units/unit_hive.qc" /// Swarm AI
#endif // TTURRETS_ENABLED
-#endif
\ No newline at end of file
+#endif
const int TNSF_FULL_UPDATE = 16777215;
#endif // TTURRETS_ENABLED
-#endif
\ No newline at end of file
+#endif
void vehicle_bumblebee_assemble();
#endif //CSQC
-#endif
\ No newline at end of file
+#endif
#include "bumblebee.qc"
#endif
#endif
-#endif
\ No newline at end of file
+#endif
void(entity e, vector torque) physics_addtorque = #542; // add relative torque
#endif // VEHICLES_USE_ODE
#endif // VEHICLES_ENABLED
-#endif
\ No newline at end of file
+#endif
void WaypointSprite_PlayerDead();
void WaypointSprite_PlayerGone();
-#endif
\ No newline at end of file
+#endif
// helper
float accuracy_isgooddamage(entity attacker, entity targ);
float accuracy_canbegooddamage(entity attacker);
-#endif
\ No newline at end of file
+#endif
float is_from_contents = (deathtype == DEATH_SLIME || deathtype == DEATH_LAVA);
float is_from_owner = (inflictor == projowner);
float is_from_exception = (exception != -1);
-
+
//dprint(strcat("W_CheckProjectileDamage: from_contents ", ftos(is_from_contents), " : from_owner ", ftos(is_from_owner), " : exception ", strcat(ftos(is_from_exception), " (", ftos(exception), "). \n")));
if(autocvar_g_projectiles_damage <= -2)
return (exception); // if exception is detected, allow it to override
else if(!is_from_contents)
return false; // otherwise, only allow damage from contents
- }
+ }
else if(autocvar_g_projectiles_damage == 1)
{
if(is_from_exception)
{
self.takedamage = DAMAGE_NO;
self.event_damage = func_null;
-
+
if(IS_CLIENT(attacker) && !autocvar_g_projectiles_keep_owner)
{
self.owner = attacker;
self.realowner = attacker;
}
-
+
// do not explode NOW but in the NEXT FRAME!
// because recursive calls to RadiusDamage are not allowed
self.nextthink = time;
void W_PlayStrengthSound(entity player);
float W_CheckProjectileDamage(entity inflictor, entity projowner, float deathtype, float exception);
void W_PrepareExplosionByDamage(entity attacker, void() explode);
-#endif
\ No newline at end of file
+#endif
void UpdateCSQCProjectile(entity e);
void UpdateCSQCProjectileAfterTeleport(entity e);
void CSQCProjectile_Check(entity e);
-#endif
\ No newline at end of file
+#endif
void W_HitPlotAnalysis(entity player, vector screenforward, vector screenright, vector screenup);
void W_HitPlotOpen(entity player);
void W_HitPlotClose(entity player);
-#endif
\ No newline at end of file
+#endif
string W_Apply_Weaponreplace(string in);
void weapon_defaultspawnfunc(float wpn);
-#endif
\ No newline at end of file
+#endif
wep.owner = wep.enemy = own;
wep.flags |= FL_TOSSED;
wep.colormap = own.colormap;
-
+
W_DropEvent(WR_DROP,own,wpn,wep);
if(WepSet_FromWeapon(wpn) & WEPSET_SUPERWEAPONS)
wep.savenextthink = wep.nextthink;
wep.nextthink = min(wep.nextthink, time + 0.5);
wep.pickup_anyway = true; // these are ALWAYS pickable
-
+
//wa = W_AmmoItemCode(wpn);
if(ammotype == ammo_none)
{
W_SwitchWeapon_Force(self, w_getbestweapon(self));
a = W_ThrowNewWeapon(self, w, doreduce, self.origin + delta, velo);
-
+
if(!a) return;
Send_Notification(NOTIF_ONE, self, MSG_MULTI, ITEM_WEAPON_DROP, a, w);
}
void W_ThrowWeapon(vector velo, vector delta, float doreduce);
void SpawnThrownWeapon(vector org, float w);
-#endif
\ No newline at end of file
+#endif
void WeaponStats_LogKill(float awep, float abot, float vwep, float vbot);
#define WEAPONSTATS_GETINDEX(awep,abot,vwep,vbot) (((vwep) + (awep) * (WEP_LAST - WEP_FIRST + 1) - (WEP_FIRST + WEP_FIRST * (WEP_LAST - WEP_FIRST + 1))) * 4 + (abot) * 2 + (vbot))
-#endif
\ No newline at end of file
+#endif
void weapon_thinkf(float fr, float t, void() func);
-#endif
\ No newline at end of file
+#endif
// transformed = original * transform + postshift
vector AnglesTransform_Multiply_GetPostShift(vector sf0, vector st0, vector t1, vector st1);
vector AnglesTransform_PrePostShift_GetPostShift(vector sf, vector t, vector st);
-#endif
\ No newline at end of file
+#endif
vector warpzone_save_view_origin;
vector warpzone_save_view_angles;
-#endif
\ No newline at end of file
+#endif
#ifndef BITXOR_ASSIGN
# define BITXOR_ASSIGN(a,b) ((a) = ((a) | (b)) - ((a) & (b)))
#endif
-#endif
\ No newline at end of file
+#endif
const float M_2_SQRTPI = 1.12837916709551257390; /* 2/sqrt(pi) */
const float M_SQRT2 = 1.41421356237309504880; /* sqrt(2) */
const float M_SQRT1_2 = 0.70710678118654752440; /* 1/sqrt(2) */
-#endif
\ No newline at end of file
+#endif
void WarpZone_PlayerPhysics_FixVAngle(void);
void WarpZone_PostInitialize_Callback(void);
-#endif
\ No newline at end of file
+#endif
float WarpZoneLib_MoveOutOfSolid(entity e);
float WarpZoneLib_ExactTrigger_Touch();
void WarpZoneLib_ExactTrigger_Init();
-#endif
\ No newline at end of file
+#endif
--- /dev/null
+#!/usr/bin/env bash
+
+find . -type f -print0 | \
+ xargs -0 sed -i \
+ `# strip trailing spaces` \
+ -e 's/[[:space:]]*$//' \
+ `# line feed at EOF for #include to work properly` \
+ -e '$a\'