HUD_Radar_Show_Maximized(!hud_panel_radar_maximized,0);
return;
}
-
+
case "clickradar":
{
HUD_Radar_Show_Maximized(!hud_panel_radar_mouse,1);
self.cp_bob_origin_z = 4 * PI * (1 - cos(self.cp_bob_spd));
self.cp_bob_spd = self.cp_bob_spd + 1.875 * frametime;
self.colormod = '1 1 1' * (2 - bound(0, (self.pain_finished - time) / 10, 1));
-
+
if(!self.iscaptured) self.alpha = self.health / self.max_health;
-
+
if(self.iscaptured)
{
if (self.punchangle_x > 0)
self.angles_z = self.punchangle_z;
self.move_angles_y = self.move_angles_y + 45 * frametime;
}
-
+
setorigin(self, self.cp_origin + self.cp_bob_origin + self.cp_bob_dmg);
}
setmodel(self, "models/onslaught/controlpoint_icon_dmg1.md3");
else if(hp <= self.max_health || hp >= self.max_health)
setmodel(self, "models/onslaught/controlpoint_icon.md3");
-
+
self.punchangle = (2 * randomvec() - '1 1 1') * 45;
self.cp_bob_dmg_z = (2 * random() - 1) * 15;
setmodel(self, "models/onslaught/controlpoint_icon.md3");
setsize(self, CPICON_MIN, CPICON_MAX);
-
+
if(self.icon_realmodel == world)
{
self.icon_realmodel = spawn();
self.icon_realmodel.solid = SOLID_NOT;
self.icon_realmodel.move_origin = self.icon_realmodel.origin;
}
-
+
if(self.iscaptured) { self.icon_realmodel.solid = SOLID_BBOX; }
self.move_movetype = MOVETYPE_NOCLIP;
{
if(time < self.move_time)
return;
-
+
self.move_time = time + 0.05;
if(self.count > 10)
}
else
pointparticles(particleeffectnum("torch_small"), self.origin + randompos('-60 -60 -20', '60 60 60'), '0 0 0', 1);
-
+
self.move_time = time + 0.1;
-
+
return;
}
sound(self, CH_TRIGGER, "onslaught/shockwave.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("electro_combo"), self.origin, '0 0 0', 6);
}
-
+
// rays
if(random() > 0.25)
{
{
hud_panel_radar_maximized = doshow;
hud_panel_radar_temp_hidden = 0;
-
+
if ( doshow )
{
if (clickable)
{
if(autocvar_hud_cursormode)
setcursormode(1);
- hud_panel_radar_mouse = 1;
+ hud_panel_radar_mouse = 1;
}
}
else if ( hud_panel_radar_mouse )
float HUD_Radar_InputEvent(float bInputType, float nPrimary, float nSecondary)
{
- if(!hud_panel_radar_maximized || !hud_panel_radar_mouse ||
+ if(!hud_panel_radar_maximized || !hud_panel_radar_mouse ||
autocvar__hud_configure || mv_active)
return false;
if(nPrimary == stof(argv(i)))
return false;
}
-
+
if ( getstati(STAT_HEALTH) <= 0 )
{
// Show scoreboard
}
else if ( bInputType == 0 )
HUD_Radar_Hide_Maximized();
-
+
return false;
}
{
if ( !hud_panel_radar_mouse ) return;
if(mv_active) return;
-
+
if ( intermission )
{
HUD_Radar_Hide_Maximized();
return;
}
-
+
if(mouseClicked & S_MOUSE2)
{
HUD_Radar_Hide_Maximized();
return;
}
-
+
if(!autocvar_hud_cursormode)
{
mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed;
}
HUD_Panel_UpdateCvars();
-
-
+
+
panel_size = autocvar_hud_panel_radar_maximized_size;
panel_size_x = bound(0.2, panel_size_x, 1) * vid_conwidth;
panel_size_y = bound(0.2, panel_size_y, 1) * vid_conheight;
panel_pos_x = (vid_conwidth - panel_size_x) / 2;
panel_pos_y = (vid_conheight - panel_size_y) / 2;
-
+
if(mouseClicked & S_MOUSE1)
{
// click outside
}
vector pos = teamradar_texcoord_to_3dcoord(teamradar_2dcoord_to_texcoord(mousepos),view_origin_z);
localcmd(sprintf("cmd ons_spawn %f %f %f",pos_x,pos_y,pos_z));
-
+
HUD_Radar_Hide_Maximized();
return;
}
-
+
const vector cursor_size = '32 32 0';
drawpic(mousepos-'8 4 0', strcat("gfx/menu/", autocvar_menu_skin, "/cursor.tga"), cursor_size, '1 1 1', 0.8, DRAWFLAG_NORMAL);
drawresetcliparea();
if ( hud_panel_radar_mouse )
- {
+ {
string message = "Click to select teleport destination";
if ( getstati(STAT_HEALTH) <= 0 )
{
vector out;
out = in;
-
+
out -= teamradar_origin2d;
if(v_flipped)
out_x = -out_x;
out = out / teamradar_size;
-
+
out_y = - out_y; // screen space is reversed
out = rotate(out, -teamradar_angle * DEG2RAD);
-
+
out += teamradar_origin3d_in_texcoord;
return out;
float vehicle_chase = (hud != HUD_NORMAL && (autocvar_cl_eventchase_vehicle || spectatee_status > 0));
float ons_roundlost = (gametype == MAPINFO_TYPE_ONSLAUGHT && getstati(STAT_ROUNDLOST));
entity gen = world;
-
+
if(ons_roundlost)
{
entity e;
if(autocvar__hud_configure)
HUD_Panel_Mouse();
- else
+ else
HUD_Radar_Mouse();
if(hud && !intermission)
tur_config_file = -1;
tur_config_alsoprint = -1;
string filename = argv(1);
-
+
if(filename == "")
{
filename = "turrets_dump.cfg";
tur_config_alsoprint = TRUE;
}
tur_config_file = fopen(filename, FILE_WRITE);
-
+
if(tur_config_file >= 0)
{
Dump_Turret_Settings();
#endif
return;
}
-
+
default:
case CMD_REQUEST_USAGE:
{
CSQCMODEL_PROPERTY(1024, float, ReadAngle, WriteAngle, v_angle_x) \
CSQCMODEL_PROPERTY_SCALED(4096, float, ReadByte, WriteByte, scale, 16, 0, 255) \
CSQCMODEL_PROPERTY(8192, int, ReadInt24_t, WriteInt24_t, dphitcontentsmask) \
- CSQCMODEL_PROPERTY(16384, TAG_VIEWLOC_TYPE, ReadShort, WriteEntity, TAG_VIEWLOC_NAME)
+ CSQCMODEL_PROPERTY(16384, TAG_VIEWLOC_TYPE, ReadShort, WriteEntity, TAG_VIEWLOC_NAME)
// TODO get rid of colormod/glowmod here, find good solution for vortex charge glowmod hack; also get rid of some useless properties on non-players that only exist for CopyBody
// add hook function calls here
vel_y = ReadCoord();
vel_z = ReadCoord();
}
-
+
if(!eff_trail)
eff_cnt = ReadByte();
Net_LinkEntity(net_eff, false, 0, Net_Write_Effect);
}
-#endif
\ No newline at end of file
+#endif
EFFECT(0, EFFECT_ITEM_PICKUP, "item_pickup") \
EFFECT(0, EFFECT_ITEM_RESPAWN, "item_respawn") \
EFFECT(0, EFFECT_JUMPPAD, "jumppad_activate") \
- EFFECT(1, EFFECT_BULLET, "tr_bullet")
+ EFFECT(1, EFFECT_BULLET, "tr_bullet")
for(i = 0; i <= MAX_CLIP_PLANES; ++i)
planes[i] = '0 0 0';
-
+
grav = 0;
restore_velocity = self.move_velocity;
void _Movetype_Physics_Pusher(float dt);
-#endif
\ No newline at end of file
+#endif
void _Movetype_Physics_Toss(float dt);
-#endif
\ No newline at end of file
+#endif
/*
Copyright (C) 2015 Micah Talkiewicz.
-
+
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
+
See the GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
+
vector vec_bias(vector v, float f){
vector c;
c_x = v_x + f;
c_z = min (a_z, b_z);
return c;
}
-
+
vector vec_to_max (vector a, vector b) {
vector c;
c_x = max (a_x, b_x);
c_z = max (a_z, b_z);
return c;
}
-
+
// there may already be a function for bounding a vector in this manner, however my very quick search did not reveal one -- Player_2
vector vec_bounds_in (vector point, vector a, vector b) {
vector c, d, e;
-
+
d = vec_to_min(a,b);
e = vec_to_max(a,b);
-
+
c = vec_to_max(point, d);
c = vec_to_min(c, e);
-
+
return c;
-
+
}
-
+
vector vec_bounds_out (vector point, vector a, vector b) {
vector c, d, e;
-
+
d = vec_to_max(a,b);
e = vec_to_min(a,b);
-
+
c = vec_to_max(point, d);
c = vec_to_min(c, e);
-
+
return c;
-
+
}
-
+
float angle_snap_f (float f, float increment){
-
+
float i;
for (i = 0; i <= 360; ){
if (f <= i - increment)
return i - increment;
i = i + increment;
}
-
+
return 0;
}
-
+
vector angle_snap_vec (vector v, float increment) {
vector c;
c_x = angle_snap_f (v_x, increment);
/*
Copyright (C) 2015 Micah Talkiewicz.
-
+
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
+
See the GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
vector trace1_plane_normal = '0 0 0';
vector trace2_plane_normal = '0 0 0';
vector trace3_plane_normal = '0 0 0';
-
+
PM_ClientMovement_UpdateStatus(false);
primalvelocity = self.velocity;
PM_ClientMovement_UpdateStatus(true);
#endif
-
+
#ifdef SVQC
WarpZone_PlayerPhysics_FixVAngle();
PM_Main();
#ifdef CSQC
- self.pmove_flags =
+ self.pmove_flags =
((self.flags & FL_DUCKED) ? PMF_DUCKED : 0) |
(!(self.flags & FL_JUMPRELEASED) ? 0 : PMF_JUMP_HELD) |
((self.flags & FL_ONGROUND) ? PMF_ONGROUND : 0);
void door_blocked()
{
- if((self.spawnflags & 8)
+ if((self.spawnflags & 8)
#ifdef SVQC
&& (other.takedamage != DAMAGE_NO)
#elif defined(CSQC)
void Ent_PointParticles();
-#endif
\ No newline at end of file
+#endif
if (!InitMovingBrushTrigger())
return;
self.effects |= EF_LOWPRECISION;
-
+
if (self.spawnflags & 2)
{
self.platmovetype_turn = true;
void ent_viewloc_trigger();
#endif
-#endif
\ No newline at end of file
+#endif
self.maxdistance = autocvar_g_waypointsprite_turrets_maxdist;
self.teamradar_color = '1 0 0';
self.alpha = 1;
-
+
TUR_ACTION(self.turretid, TR_SETUP);
}
self.angles_x = ReadAngle();
self.angles_y = ReadAngle();
-
+
turret_construct();
self.colormap = 1024;
self.glowmod = '0 1 1';
else if(c > r) { return -1; }
else { return 1; }
}
-
+
return 0;
}
// step 3: sort queue
heapsort(TUR_CONFIG_COUNT, T_Config_Queue_Swap, T_Config_Queue_Compare, world);
-
+
// step 4: write queue
TUR_CONFIG_WRITETOFILE(sprintf("// {{{ #%d: %s\n", i, TUR_NAME(i)))
for(x = 0; x <= TUR_CONFIG_COUNT; ++x)
if (self.aim_flags & TFL_AIM_SHOTTIMECOMPENSATE) // Need to conpensate for shot traveltime
{
prep = pre_pos;
-
+
distance = vlen(prep - self.tur_shotorg);
impact_time = distance / self.shot_speed;
self.think = turret_think;
self.SendFlags = TNSF_FULL_UPDATE;
-
+
TUR_ACTION(self.turretid, TR_SETUP);
}
{
if (autocvar_g_turrets_nofire != 0)
return;
-
+
TUR_ACTION(self.turretid, TR_ATTACK);
self.attack_finished_single = time + self.shot_refire;
// Fire!
if (self.turret_firecheckfunc() != 0)
turret_fire();
-
+
TUR_ACTION(self.turretid, TR_THINK);
return;
// Turn & pitch
if(!(self.track_flags & TFL_TRACK_NO))
turret_track();
-
+
TUR_ACTION(self.turretid, TR_THINK);
// And bail.
self.cvar_basename = tur.cvar_basename;
load_unit_settings(self, self.cvar_basename, 0);
-
+
if(!self.team || !teamplay) { self.team = MAX_SHOT_DISTANCE; }
if(!self.ticrate) { self.ticrate = ((self.turret_flags & TUR_FLAG_SUPPORT) ? 0.2 : 0.1); }
if(!self.health) { self.health = 1000; }
if(!self.target_select_flags) { self.target_select_flags = TFL_TARGETSELECT_LOS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_RANGELIMITS | TFL_TARGETSELECT_ANGLELIMITS; }
if(!self.firecheck_flags) { self.firecheck_flags = TFL_FIRECHECK_DEAD | TFL_FIRECHECK_DISTANCES | TFL_FIRECHECK_LOS
| TFL_FIRECHECK_AIMDIST | TFL_FIRECHECK_TEAMCHECK | TFL_FIRECHECK_AMMO_OWN | TFL_FIRECHECK_REFIRE; }
-
+
if(self.track_type != TFL_TRACKTYPE_STEPMOTOR)
{
// Fluid / Ineria mode. Looks mutch nicer.
// Can reduce aim preformance alot, needs a bit diffrent aimspeed
-
+
self.aim_speed = bound(0.1, ((!self.aim_speed) ? 180 : self.aim_speed), 1000);
-
+
if(!self.track_accel_pitch) { self.track_accel_pitch = 0.5; }
if(!self.track_accel_rotate) { self.track_accel_rotate = 0.5; }
if(!self.track_blendrate) { self.track_blendrate = 0.35; }
}
-
+
self.respawntime = max(-1, ((!self.respawntime) ? 60 : self.respawntime));
self.shot_refire = bound(0.01, ((!self.shot_refire) ? 1 : self.shot_refire), 9999);
self.shot_dmg = max(1, ((!self.shot_dmg) ? self.shot_refire * 50 : self.shot_dmg));
self.target_select_playerbias = bound(-10, ((!self.target_select_playerbias) ? 1 : self.target_select_playerbias), 10);
self.ammo_max = max(self.shot_dmg, ((!self.ammo_max) ? self.shot_dmg * 10 : self.ammo_max));
self.ammo_recharge = max(0, ((!self.ammo_recharge) ? self.shot_dmg * 0.5 : self.ammo_recharge));
-
+
self.turret_flags = TUR_FLAG_ISTURRET | (tur.spawnflags);
-
+
if(self.turret_flags & TUR_FLAG_SPLASH)
self.aim_flags |= TFL_AIM_SPLASH;
-
+
if(self.turret_flags & TUR_FLAG_MISSILE)
self.target_select_flags |= TFL_TARGETSELECT_MISSILES;
if(self.turret_flags & TUR_FLAG_PLAYER)
self.target_select_flags |= TFL_TARGETSELECT_PLAYERS;
-
+
if(self.spawnflags & TSL_NO_RESPAWN)
self.damage_flags |= TFL_DMG_DEATH_NORESPAWN;
-
+
if (self.turret_flags & TUR_FLAG_SUPPORT)
self.turret_score_target = turret_targetscore_support;
else
self.turret_score_target = turret_targetscore_generic;
-
+
++turret_count;
-
+
setmodel(self, tur.model);
setsize(self, tur.mins, tur.maxs);
-
+
self.turretid = tur_id;
self.classname = "turret_main";
self.active = ACTIVE_ACTIVE;
self.bot_attack = true;
self.nextthink = time + 1;
self.nextthink += turret_count * sys_frametime;
-
+
self.tur_head = spawn();
setmodel(self.tur_head, tur.head_model);
setsize(self.tur_head, '0 0 0', '0 0 0');
setorigin(self.tur_head, '0 0 0');
setattachment(self.tur_head, self, "tag_head");
-
+
self.tur_head.netname = self.tur_head.classname = "turret_head";
self.tur_head.team = self.team;
self.tur_head.owner = self;
self.tur_head.takedamage = DAMAGE_NO;
self.tur_head.solid = SOLID_NOT;
self.tur_head.movetype = self.movetype;
-
+
if(!self.tur_defend)
if(self.target != "")
{
dprint("Turret has invalid defendpoint!\n");
}
}
-
+
if (self.tur_defend)
self.idle_aim = self.tur_head.angles + angleofs(self.tur_head, self.tur_defend);
else
self.idle_aim = '0 0 0';
-
+
#ifdef TURRET_DEBUG
self.tur_debug_start = self.nextthink;
while (vlen(self.tur_debug_rvec) < 2)
turret_link();
turret_respawn();
turret_tag_fire_update();
-
+
TUR_ACTION(tur_id, TR_SETUP);
-
+
if(MUTATOR_CALLHOOK(TurretSpawn, self))
return false;
precache_model ("models/turrets/head-gib4.md3");
precache_model ("models/turrets/base.md3");
precache_model ("models/turrets/rocket.md3");
-
+
precache_model ("models/turrets/c512.md3");
precache_model ("models/marker.md3");
-
+
#ifdef TURRET_DEBUG
precache_model ("models/turrets/c512.md3");
precache_model ("models/pathlib/goodsquare.md3");
e.maxs = max_s;
e.model = strzone(strcat("models/turrets/", modelname));
e.head_model = strzone(strcat("models/turrets/", headmodelname));
-
+
#ifndef MENUQC
turrets_common_precache();
#endif
void vehicles_think()
{
self.nextthink = time;
-
+
if(self.owner)
self.owner.vehicle_weapon2mode = self.vehicle_weapon2mode;
-
+
VEH_ACTION(self.vehicleid, VR_THINK);
CSQCMODEL_AUTOUPDATE();
if(!veh.vehicleid)
return false;
-
+
if(!veh.tur_head) { VEH_ACTION(veh.vehicleid, VR_PRECACHE); }
if(self.targetname && self.targetname != "")
{
entity pilot, vehic;
vector newvel;
-
+
if(intermission_running)
{
self.vehicle.velocity = '0 0 0';
self.think = vehicles_think;
self.nextthink = time;
-
+
CSQCMODEL_AUTOUPDATE();
}
self.think = bumblebee_land;
self.nextthink = time;
}
-
+
self.movetype = MOVETYPE_TOSS;
if(!self.owner)
{
if(autocvar_g_vehicle_bumblebee_bouncepain)
vehicles_impact(autocvar_g_vehicle_bumblebee_bouncepain_x, autocvar_g_vehicle_bumblebee_bouncepain_y, autocvar_g_vehicle_bumblebee_bouncepain_z);
-
+
return true;
}
case VR_ENTER:
{
self.angles_z *= 0.8;
self.angles_x *= 0.8;
-
+
self.nextthink = time;
-
+
if(!self.owner)
{
- entity oldself = self;
+ entity oldself = self;
if(self.gunner1)
{
self = self.gunner1;
other = oldother;
return true;
}
-
+
if(self.gunner2)
{
self = self.gunner2;
self.touch();
other = oldother;
return true;
- }
+ }
}
-
+
return true;
}
case VR_DEATH:
// Hide beam
if(self.gun3.enemy || !wasfreed(self.gun3.enemy))
self.gun3.enemy.effects |= EF_NODRAW;
-
+
if(self.gunner1)
{
self = self.gunner1;
_body.touch = bumblebee_blowup;
else
_body.touch = func_null;
-
+
_body.think = bumblebee_diethink;
_body.nextthink = time;
_body.wait = time + 2 + (random() * 8);
_body.angles = self.angles;
Send_Effect("explosion_medium", findbetterlocation(self.origin, 16), '0 0 0', 1);
-
+
self.health = 0;
self.event_damage = func_null;
self.solid = SOLID_NOT;
setorigin(self.gun2.vehicle_viewport, '-85 0 50');
self.scale = 1.5;
-
+
// Raygun beam
if(self.gun3.enemy == world)
- {
+ {
self.gun3.enemy = spawn();
Net_LinkEntity(self.gun3.enemy, true, 0, bumble_raygun_send);
- self.gun3.enemy.SendFlags = BRG_SETUP;
- self.gun3.enemy.cnt = autocvar_g_vehicle_bumblebee_raygun;
+ self.gun3.enemy.SendFlags = BRG_SETUP;
+ self.gun3.enemy.cnt = autocvar_g_vehicle_bumblebee_raygun;
self.gun3.enemy.effects = EF_NODRAW | EF_LOWPRECISION;
}
}
self.solid = SOLID_BBOX;
self.movetype = MOVETYPE_TOSS;
self.damageforcescale = 0.025;
-
+
self.PlayerPhysplug = bumblebee_pilot_frame;
-
+
setorigin(self, self.origin + '0 0 25');
return true;
}
if(autocvar_g_vehicle_bumblebee_health_regen)
self.vehicle_flags |= VHF_HEALTHREGEN;
-
+
self.vehicle_exit = bumblebee_exit;
self.respawntime = autocvar_g_vehicle_bumblebee_respawntime;
self.vehicle_health = autocvar_g_vehicle_bumblebee_health;
self.max_health = self.vehicle_health;
self.vehicle_shield = autocvar_g_vehicle_bumblebee_shield;
-
+
return true;
}
case VR_PRECACHE:
self.velocity += push_vector * _delta;
float uforce = autocvar_g_vehicle_racer_upforcedamper;
-
+
int cont = pointcontents(self.origin - '0 0 64');
if(cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME)
{
else
self.velocity_z += 200;
}
-
+
// Anti ocilation
if(self.velocity_z > 0)
self.velocity = olddir * newvel;
self.velocity_z -= 1600 * sys_frametime; // 2x grav looks better for this one
}
-
+
int cont = pointcontents(self.origin - '0 0 32');
if(cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME)
self.velocity_z += 200;
self.angles_x *= 1 - (autocvar_g_vehicle_racer_anglestabilizer * pushdeltatime);
self.angles_z *= 1 - (autocvar_g_vehicle_racer_anglestabilizer * pushdeltatime);
-
+
CSQCMODEL_AUTOUPDATE();
}
void racer_blowup_think()
{
self.nextthink = time;
-
+
if(time >= self.delay)
racer_blowup();
-
+
CSQCMODEL_AUTOUPDATE();
}
self.move_angles_x *= 1 - (getstatf(STAT_VEH_RACER_ANGLESTABILIZER) * pushdeltatime);
self.move_angles_z *= 1 - (getstatf(STAT_VEH_RACER_ANGLESTABILIZER) * pushdeltatime);
-
+
Movetype_Physics_MatchServer(false);
}
#endif
self.move_movetype = MOVETYPE_BOUNCE;
#endif
-
+
return true;
}
self.solid = SOLID_SLIDEBOX;
self.delay = time;
self.scale = 0.5;
-
+
self.PlayerPhysplug = racer_frame;
-
+
self.bouncefactor = autocvar_g_vehicle_racer_bouncefactor;
self.bouncestop = autocvar_g_vehicle_racer_bouncestop;
self.damageforcescale = 0.5;
}
self.nextthink = time;
-
+
CSQCMODEL_AUTOUPDATE();
}
player = self;
raptor = self.vehicle;
self = raptor;
-
+
vehicles_painframe();
/*
ftmp = vlen(self.velocity);
player = self;
raptor = self.vehicle;
self = raptor;
-
+
self.nextthink = time;
CSQCMODEL_AUTOUPDATE();
self.nextthink = 0; // will this work?
-
+
if(self.sound_nexttime < time)
{
self.sound_nexttime = time + 7.955812; //soundlength("vehicles/raptor_fly.wav");
Send_Effect("explosion_small", randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
}
self.nextthink = time;
-
+
CSQCMODEL_AUTOUPDATE();
}
{
if(autocvar_g_vehicle_raptor_bouncepain)
vehicles_impact(autocvar_g_vehicle_raptor_bouncepain_x, autocvar_g_vehicle_raptor_bouncepain_y, autocvar_g_vehicle_raptor_bouncepain_z);
-
+
return true;
}
case VR_ENTER:
self.movetype = MOVETYPE_TOSS;
self.solid = SOLID_SLIDEBOX;
self.vehicle_energy = 1;
-
+
self.PlayerPhysplug = raptor_frame;
self.bomb1.gun1.avelocity_y = 90;
self.bomb1.gun2.avelocity_y = -90;
-
+
self.delay = time;
self.bouncefactor = autocvar_g_vehicle_raptor_bouncefactor;
if(autocvar_g_vehicle_raptor_energy_regen)
self.vehicle_flags |= VHF_ENERGYREGEN;
-
+
self.vehicle_exit = raptor_exit;
self.respawntime = autocvar_g_vehicle_raptor_respawntime;
self.vehicle_health = autocvar_g_vehicle_raptor_health;
self.vehicle_shield = autocvar_g_vehicle_raptor_shield;
self.max_health = self.vehicle_health;
-
+
return true;
}
case VR_PRECACHE:
precache_sound ("vehicles/raptor_fly.wav");
precache_sound ("vehicles/raptor_speed.wav");
precache_sound ("vehicles/missile_alarm.wav");
-
+
return true;
}
}
case RSM_BOMB: crosshair = vCROSS_BURST; break;
default: crosshair = vCROSS_BURST;
}
-
+
Vehicles_drawHUD(VEH_RAPTOR.m_icon, "vehicle_raptor_weapon1", "vehicle_raptor_weapon2",
"vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color,
"vehicle_icon_ammo2", autocvar_hud_progressbar_vehicles_ammo2_color,
if(self.wait != -10)
if(!self.owner.BUTTON_ATCK2)
return;
-
+
if(forbidWeaponUse(self.owner))
return;
{
if(autocvar_g_vehicle_spiderbot_bouncepain)
vehicles_impact(autocvar_g_vehicle_spiderbot_bouncepain_x, autocvar_g_vehicle_spiderbot_bouncepain_y, autocvar_g_vehicle_spiderbot_bouncepain_z);
-
+
return true;
}
case VR_ENTER:
setattachment(self.owner.flagcarried, self.tur_head, "");
setorigin(self.owner.flagcarried, '-20 0 120');
}
-
+
return true;
}
case VR_THINK:
{
if(self.flags & FL_ONGROUND)
movelib_beak_simple(autocvar_g_vehicle_spiderbot_speed_stop);
-
+
return true;
}
case VR_DEATH:
self.colormod = self.tur_head.colormod = '-1 -1 -1';
self.frame = 10;
self.movetype = MOVETYPE_TOSS;
-
+
CSQCModel_UnlinkEntity(); // networking the death scene would be a nightmare
return true;
self.damageforcescale = 0.03;
self.vehicle_health = autocvar_g_vehicle_spiderbot_health;
self.vehicle_shield = autocvar_g_vehicle_spiderbot_shield;
-
+
self.PlayerPhysplug = spiderbot_frame;
return true;
{
AuxiliaryXhair[0].axh_image = vCROSS_HINT; // Minigun1
AuxiliaryXhair[1].axh_image = vCROSS_HINT; // Minigun2
-
+
return true;
}
case VR_PRECACHE:
position_a = view.viewloc.enemy.origin;
position_b = view.viewloc.goalentity.origin;
-#if 0
+#if 0
/*TODO: have the camera only move when a player moves too much from the center of the camera
* basically the player can move around in a "box" in the center of th screen with out changing the camera position or angles
*/
camera_angle = '0 0 0';
- // a tracking camera follows the player when it leaves the world box
+ // a tracking camera follows the player when it leaves the world box
if (cvar("cam_track")) {
camera_angle = aim_vec (camera_position, view.origin);
}
-
+
// hard snap changes the angle as soon as it crosses over the nearest 90 degree mark
if (cvar("cam_snap_hard")){
camera_angle = angle_snap_vec(aim_vec(camera_position, view.origin), 90);
}
-
+
// tries to avoid snapping unless it *really* needs to
if (cvar("cam_snap_close")){
-
+
// like hard snap, but don't snap angles yet.
camera_angle = aim_vec(camera_position, view.origin);
-
+
/* if the difference between the old and new angle is 60 degrees or more, switch angles.
* NOTE: bug/feature: this will use non-snaped angles for one frame.
* doing this resualts in less code, faster code, and a smoother transisition between angles.
else
camera_angle_y = old_camera_angle_y;
}
-
+
//unlocking this allows the camera to look up and down. this also allows a top-down view.
if (!cvar("cam_snap_unlock")) {
camera_angle_x = 0;
camera_angle_z = 0;
}
-
+
#if 0
dprint(vtos(camera_position), "\n");
dprint(vtos(old_camera_angle), "\n");
freeze_ang = getpropertyvec(VF_ANGLES);
setproperty(VF_ORIGIN, camera_position);
setproperty(VF_ANGLES, camera_angle);
-
+
forward = vectoangles(normalize(vec_to_min(position_b, position_a) - vec_to_max(position_b, position_a)));
backward = vectoangles(normalize(vec_to_max(position_b, position_a) - vec_to_min(position_b, position_a)));
-
+
if(input_movevalues_y < 0) // left
view.angles_y = backward_y;
if(input_movevalues_y > 0) // favour right
{
runstandardplayerphysics(self);
#ifdef CSQC
- self.flags =
+ self.flags =
((self.pmove_flags & PMF_DUCKED) ? FL_DUCKED : 0) |
(!(self.pmove_flags & PMF_JUMP_HELD) ? FL_JUMPRELEASED : 0) |
((self.pmove_flags & PMF_ONGROUND) ? FL_ONGROUND : 0);
//darkplaces implementation: Blub\0
//cvar definitions:
// utf8_enable: enable utf8 encoding
-//description: utf8 characters are allowed inside cvars, protocol strings, files, progs strings, etc.,
+//description: utf8 characters are allowed inside cvars, protocol strings, files, progs strings, etc.,
//and count as 1 char for string functions like strlen, substring, etc.
// note: utf8_enable is run-time cvar, could be changed during execution
// note: beware that str2chr() could return value bigger than 255 once utf8 is enabled
// description: allows alternative 'static' lightstyle syntax : "=value"
// examples: "=0.5", "=2.0", "=2.75"
// could be used to control switchable lights or making styled lights with brightness > 2
-// Warning: this extension is experimental. It safely works in CSQC, but SVQC use is limited by the fact
+// Warning: this extension is experimental. It safely works in CSQC, but SVQC use is limited by the fact
// that other engines (which do not support this extension) could connect to a game and misunderstand this kind of lightstyle syntax
//DP_LITSPRITES
//syntax of .dpsubs files: each line in .dpsubs file defines 1 subtitle, there are three tokens:
// <start> <end> "string"
// start: subtitle start time in seconds
-// end: subtitle time-to-show in seconds, if 0 - subtitle will be showed until next subtitle is started,
+// end: subtitle time-to-show in seconds, if 0 - subtitle will be showed until next subtitle is started,
// if below 0 - show until next subtitles minus this number of seconds
// text: subtitle text, color codes (Q3-style and ^xRGB) are allowed
//example of subtitle file:
// 3 0 "Vengeance! Vengeance for my eternity of suffering!"
// 9 0 "Whelp! As if you knew what eternity was!"
// 13 0 "Grovel before your true master."
-// 17 0 "Never!"
+// 17 0 "Never!"
// 18 7 "I'll hack you from crotch to gizzard and feed what's left of you to your brides..."
//DP_SOLIDCORPSE
.vector massofs; // offsets a mass center out of object center, if not set a center of model bounds is used
.float friction; // a friction of object, get multiplied by second objects's friction on contact
.float bouncefactor;
-.float bouncestop;
+.float bouncestop;
.float jointtype; // type of joint
.float forcetype; // type of force
-.float erp; // error restitution parameter, makes ODE solver attempt to fix errors in contacts,
- // bringing together 2 joints or fixing object being stuch in other object,
+.float erp; // error restitution parameter, makes ODE solver attempt to fix errors in contacts,
+ // bringing together 2 joints or fixing object being stuch in other object,
// a value of 0.1 will fix slightly, a value of 1.0 attempts to fix whole error in one frame
// use with care as high values makes system unstable and likely to explode
//builtin definitions:
float drawcolorcodedstring(vector position, string text, vector scale, float alpha, float flag) = #467;
vector drawcolorcodedstring2(vector position, string text, vector scale, vector rgb, float alpha, float flag) = #467;
-
+
float drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag) = #456;
float drawfill(vector position, vector size, vector rgb, float alpha, float flag) = #457;
me.stringFilter = strzone(box.text);
else
me.stringFilter = string_null;
-
+
me.refilter(me);
}
case CMD_REQUEST_COMMAND:
{
string command = strtolower(argv(1));
-
+
if(!autocvar_g_physics_clientselect)
{
sprint(self, "Client physics selection is currently disabled.\n");
sprint(self, strcat("Available physics sets: \n\n", autocvar_g_physics_clientselect_options, " default\n"));
return;
}
-
+
if(Physics_Valid(command) || command == "default")
{
stuffcmd(self, strcat("\nseta cl_physics ", command, "\nsendcvar cl_physics\n"));
return;
}
}
-
+
default:
sprint(self, strcat("Current physics set: ^3", self.cvar_cl_physics, "\n"));
case CMD_REQUEST_USAGE:
if(!player) { return; } // without someone to give the reward to, we can't possibly cap
if(CTF_DIFFTEAM(player, flag)) { return; }
-
+
if(ctf_oneflag)
for(tmp_entity = ctf_worldflaglist; tmp_entity; tmp_entity = tmp_entity.ctf_worldflagnext)
if(SAME_TEAM(tmp_entity, player))
else { Send_Notification(NOTIF_ONE, player, MSG_CENTER, ((SAME_TEAM(player, flag)) ? CENTER_CTF_PICKUP_TEAM : CENTER_CTF_PICKUP_TEAM_ENEMY), Team_ColorCode(flag.team)); }
Send_Notification(NOTIF_TEAM_EXCEPT, player, MSG_CHOICE, ((flag.team) ? APP_TEAM_ENT_4(flag, CHOICE_CTF_PICKUP_TEAM_) : CHOICE_CTF_PICKUP_TEAM_NEUTRAL), Team_ColorCode(player.team), player.netname);
-
+
if(!flag.team)
FOR_EACH_PLAYER(tmp_entity)
if(tmp_entity != player)
if(DIFF_TEAM(player, tmp_entity))
Send_Notification(NOTIF_ONE, tmp_entity, MSG_CHOICE, CHOICE_CTF_PICKUP_ENEMY_NEUTRAL, Team_ColorCode(player.team), player.netname);
-
+
if(flag.team)
FOR_EACH_PLAYER(tmp_entity)
if(tmp_entity != player)
default: flag.effects |= EF_DIMLIGHT; break;
}
}
-
+
// flag placement
if((flag.spawnflags & 1) || flag.noalign) // don't drop to floor, just stay at fixed location
{
int t = 0, t2 = 0, t3 = 0;
// initially clear items so they can be set as necessary later.
- self.ctf_flagstatus &= ~(CTF_RED_FLAG_CARRYING | CTF_RED_FLAG_TAKEN | CTF_RED_FLAG_LOST
+ self.ctf_flagstatus &= ~(CTF_RED_FLAG_CARRYING | CTF_RED_FLAG_TAKEN | CTF_RED_FLAG_LOST
| CTF_BLUE_FLAG_CARRYING | CTF_BLUE_FLAG_TAKEN | CTF_BLUE_FLAG_LOST
| CTF_YELLOW_FLAG_CARRYING | CTF_YELLOW_FLAG_TAKEN | CTF_YELLOW_FLAG_LOST
| CTF_PINK_FLAG_CARRYING | CTF_PINK_FLAG_TAKEN | CTF_PINK_FLAG_LOST
{
if((flag.owner == self) || (flag.pass_sender == self))
self.ctf_flagstatus |= t; // carrying: self is currently carrying the flag
- else
+ else
self.ctf_flagstatus |= t2; // taken: someone else is carrying the flag
break;
}
/*QUAKED spawnfunc_item_flag_team3 (0 0.5 0.8) (-48 -48 -37) (48 48 37)
CTF flag for team three (Yellow).
-Keys:
-"angle" Angle the flag will point (minus 90 degrees)...
+Keys:
+"angle" Angle the flag will point (minus 90 degrees)...
"model" model to use, note this needs red, blue yellow and pink as skins 0, 1, 2 and 3...
"noise" sound played when flag is picked up...
"noise1" sound played when flag is returned by a teammate...
"noise2" sound played when flag is captured...
-"noise3" sound played when flag is lost in the field and respawns itself...
+"noise3" sound played when flag is lost in the field and respawns itself...
"noise4" sound played when flag is dropped by a player...
"noise5" sound played when flag touches the ground... */
void spawnfunc_item_flag_team3()
/*QUAKED spawnfunc_item_flag_team4 (0 0.5 0.8) (-48 -48 -37) (48 48 37)
CTF flag for team four (Pink).
-Keys:
-"angle" Angle the flag will point (minus 90 degrees)...
+Keys:
+"angle" Angle the flag will point (minus 90 degrees)...
"model" model to use, note this needs red, blue yellow and pink as skins 0, 1, 2 and 3...
"noise" sound played when flag is picked up...
"noise1" sound played when flag is returned by a teammate...
"noise2" sound played when flag is captured...
-"noise3" sound played when flag is lost in the field and respawns itself...
+"noise3" sound played when flag is lost in the field and respawns itself...
"noise4" sound played when flag is dropped by a player...
"noise5" sound played when flag touches the ground... */
void spawnfunc_item_flag_team4()
/*QUAKED spawnfunc_item_flag_neutral (0 0.5 0.8) (-48 -48 -37) (48 48 37)
CTF flag (Neutral).
-Keys:
-"angle" Angle the flag will point (minus 90 degrees)...
+Keys:
+"angle" Angle the flag will point (minus 90 degrees)...
"model" model to use, note this needs red, blue yellow and pink as skins 0, 1, 2 and 3...
"noise" sound played when flag is picked up...
"noise1" sound played when flag is returned by a teammate...
"noise2" sound played when flag is captured...
-"noise3" sound played when flag is lost in the field and respawns itself...
+"noise3" sound played when flag is lost in the field and respawns itself...
"noise4" sound played when flag is dropped by a player...
"noise5" sound played when flag touches the ground... */
void spawnfunc_item_flag_neutral()
shield.avelocity = '7 0 11';
shield.scale = 1;
shield.model = ((is_generator) ? "models/onslaught/generator_shield.md3" : "models/onslaught/controlpoint_shield.md3");
-
+
precache_model(shield.model);
setorigin(shield, generator.origin);
setmodel(shield, shield.model);
{
// TODO check if the two sides have moved (currently they won't move anyway)
float cc = 0, cc1 = 0, cc2 = 0;
-
+
if(self.goalentity.islinked || self.goalentity.iscaptured) { cc1 = (self.goalentity.team - 1) * 0x01; }
if(self.enemy.islinked || self.enemy.iscaptured) { cc2 = (self.enemy.team - 1) * 0x10; }
-
+
cc = cc1 + cc2;
if(cc != self.clientcolors)
void ons_ControlPoint_Icon_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
entity oself;
-
+
if(damage <= 0) { return; }
if (self.owner.isshielded)
sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM_4(self.team, INFO_ONSLAUGHT_CPDESTROYED_), self.owner.message, attacker.netname);
-
+
PlayerScore_Add(attacker, SP_ONS_TAKES, 1);
PlayerScore_Add(attacker, SP_SCORE, 10);
-
+
self.owner.goalentity = world;
self.owner.islinked = false;
self.owner.iscaptured = false;
remove(self);
}
-
+
self.SendFlags |= CPSF_STATUS;
}
return;
self.health = self.health + self.count;
-
+
self.SendFlags |= CPSF_STATUS;
if (self.health >= self.max_health)
PlayerScore_Add(self.owner.ons_toucher, SP_ONS_CAPS, 1);
PlayerTeamScore_AddScore(self.owner.ons_toucher, 10);
}
-
+
self.owner.ons_toucher = world;
onslaught_updatelinks();
activator = self;
SUB_UseTargets ();
self = oself;
-
+
self.SendFlags |= CPSF_SETUP;
}
if(self.owner.model != "models/onslaught/controlpoint_pad2.md3")
setmodel_fixsize(self.owner, "models/onslaught/controlpoint_pad2.md3");
-
+
if(random() < 0.9 - self.health / self.max_health)
Send_Effect("rage", self.origin + 10 * randomvec(), '0 0 -1', 1);
}
void ons_ControlPoint_Icon_Spawn(entity cp, entity player)
{
entity e = spawn();
-
+
setsize(e, CPICON_MIN, CPICON_MAX);
setorigin(e, cp.origin + CPICON_OFFSET);
-
+
e.classname = "onslaught_controlpoint_icon";
e.owner = cp;
e.max_health = autocvar_g_onslaught_cp_health;
e.team = player.team;
e.colormap = 1024 + (e.team - 1) * 17;
e.count = (e.max_health - e.health) * ONS_CP_THINKRATE / autocvar_g_onslaught_cp_buildtime; // how long it takes to build
-
+
sound(e, CH_TRIGGER, "onslaught/controlpoint_build.wav", VOL_BASE, ATTEN_NORM);
-
+
cp.goalentity = e;
cp.team = e.team;
cp.colormap = e.colormap;
if(e.team)
{
int a = ons_ControlPoint_Attackable(e, e.team);
-
+
if(a == -2) { return "ons-cp-dfnd"; } // defend now
if(a == -1 || a == 1 || a == 2) { return "ons-cp"; } // touch
if(a == 3 || a == 4) { return "ons-cp-atck"; } // attack
{
entity toucher = other;
int attackable;
-
+
if(IS_VEHICLE(toucher) && toucher.owner)
if(autocvar_g_onslaught_allow_vehicle_touch)
toucher = toucher.owner;
else
return;
-
+
if(!IS_PLAYER(toucher)) { return; }
if(toucher.frozen) { return; }
if(toucher.deadflag != DEAD_NO) { return; }
-
+
if ( SAME_TEAM(self,toucher) )
if ( self.iscaptured )
{
else
Send_Notification(NOTIF_ONE, toucher, MSG_CENTER, CENTER_ONS_TELEPORT);
}
-
+
attackable = ons_ControlPoint_Attackable(self, toucher.team);
if(attackable != 2 && attackable != 4)
return;
// so start building the captured point icon (which only captures this
// point if it successfully builds without being destroyed first)
ons_ControlPoint_Icon_Spawn(self, toucher);
-
+
self.ons_toucher = toucher;
onslaught_updatelinks();
void ons_DelayedControlPoint_Setup(void)
{
onslaught_updatelinks();
-
+
// captureshield setup
ons_CaptureShield_Spawn(self, false);
{
// declarations
self = cp; // for later usage with droptofloor()
-
+
// main setup
cp.ons_worldcpnext = ons_worldcplist; // link control point into ons_worldcplist
ons_worldcplist = cp;
-
+
cp.netname = "Control point";
cp.team = 0;
cp.solid = SOLID_BBOX;
cp.iscaptured = false;
cp.islinked = false;
cp.isshielded = true;
-
+
if(cp.message == "") { cp.message = "a"; }
// precache - TODO: clean up!
precache_sound("onslaught/controlpoint_underattack.wav");
precache_sound("onslaught/ons_spark1.wav");
precache_sound("onslaught/ons_spark2.wav");
-
+
// appearence
setmodel_fixsize(cp, "models/onslaught/controlpoint_pad.md3");
-
+
// control point placement
if((cp.spawnflags & 1) || cp.noalign) // don't drop to floor, just stay at fixed location
{
droptofloor();
cp.movetype = MOVETYPE_TOSS;
}
-
+
// waypointsprites
WaypointSprite_SpawnFixed(string_null, self.origin + CPGEN_WAYPOINT_OFFSET, self, sprite, RADARICON_NONE, '0 0 0');
WaypointSprite_UpdateRule(self.sprite, self.team, SPRITERULE_TEAMPLAY);
-
+
InitializeEntity(cp, ons_DelayedControlPoint_Setup, INITPRIO_SETLOCATION);
}
self.event_damage = ons_GeneratorDamage;
self.think = ons_GeneratorThink;
self.nextthink = time + GEN_THINKRATE;
-
+
Net_LinkEntity(self, false, 0, generator_send);
-
+
self.SendFlags = GSF_SETUP; // just incase
self.SendFlags |= GSF_STATUS;
WaypointSprite_UpdateMaxHealth(self.sprite, self.max_health);
WaypointSprite_UpdateHealth(self.sprite, self.health);
WaypointSprite_UpdateRule(self.sprite,self.team,SPRITERULE_TEAMPLAY);
-
+
onslaught_updatelinks();
}
// captureshield setup
ons_CaptureShield_Spawn(self, true);
-
+
onslaught_updatelinks();
-
+
Net_LinkEntity(self, false, 0, generator_send);
}
// declarations
int teamnumber = gen.team;
self = gen; // for later usage with droptofloor()
-
+
// main setup
gen.ons_worldgeneratornext = ons_worldgeneratorlist; // link generator into ons_worldgeneratorlist
ons_worldgeneratorlist = gen;
-
+
gen.netname = sprintf("%s generator", Team_ColoredFullName(teamnumber));
gen.classname = "onslaught_generator";
gen.solid = SOLID_BBOX;
gen.islinked = true;
gen.isshielded = true;
gen.touch = onslaught_generator_touch;
-
+
// precache - TODO: clean up!
precache_model("models/onslaught/generator_shield.md3");
precache_model("models/onslaught/gen_gib1.md3");
precache_sound("onslaught/ons_hit1.wav");
precache_sound("onslaught/ons_hit2.wav");
precache_sound("onslaught/generator_underattack.wav");
-
+
// appearence
// model handled by CSQC
setsize(gen, GENERATOR_MIN, GENERATOR_MAX);
setorigin(gen, (gen.origin + CPGEN_SPAWN_OFFSET));
gen.colormap = 1024 + (teamnumber - 1) * 17;
-
+
// generator placement
self = gen;
droptofloor();
-
+
// waypointsprites
WaypointSprite_SpawnFixed(string_null, self.origin + CPGEN_WAYPOINT_OFFSET, self, sprite, RADARICON_NONE, '0 0 0');
WaypointSprite_UpdateRule(self.sprite, self.team, SPRITERULE_TEAMPLAY);
WaypointSprite_UpdateMaxHealth(self.sprite, self.max_health);
WaypointSprite_UpdateHealth(self.sprite, self.health);
-
+
InitializeEntity(gen, ons_DelayedGeneratorSetup, INITPRIO_SETLOCATION);
}
bool Onslaught_CheckWinner()
{
entity e;
-
+
if ((autocvar_timelimit && time > game_starttime + autocvar_timelimit * 60) || (round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0))
{
ons_stalemate = true;
d = d * tmp_entity.max_health / max(30, 60 * autocvar_timelimit_suddendeath);
Damage(tmp_entity, tmp_entity, tmp_entity, d, DEATH_HURTTRIGGER, tmp_entity.origin, '0 0 0');
-
+
tmp_entity.sprite.SendFlags |= 16;
tmp_entity.ons_overtime_damagedelay = time + 1;
else { wpforenemy_announced = false; ons_stalemate = false; }
Onslaught_count_generators();
-
+
if(ONS_OWNED_GENERATORS_OK())
return 0;
Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_TIED);
Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_TIED);
}
-
+
ons_stalemate = false;
play2all(sprintf("ctf/%s_capture.wav", Static_Team_ColorName_Lower(winner_team)));
-
+
round_handler_Init(7, autocvar_g_onslaught_warmup, autocvar_g_onslaught_round_timelimit);
-
+
FOR_EACH_PLAYER(e)
{
e.ons_roundlost = true;
closest_target = tmp_entity;
tmp_entity = tmp_entity.chain;
}
-
+
return closest_target;
}
entity tmp_entity, closest_target = world;
vector delta;
float smallest_distance = 0, distance;
-
+
tmp_entity = findchain(classname, "onslaught_controlpoint");
while(tmp_entity)
{
delta = tmp_entity.origin - pos;
delta_z = 0;
distance = vlen(delta);
-
+
if(SAME_TEAM(tmp_entity, self))
if(tmp_entity.iscaptured)
if(max_dist <= 0 || distance <= max_dist)
closest_target = tmp_entity;
smallest_distance = distance;
}
-
+
tmp_entity = tmp_entity.chain;
}
tmp_entity = findchain(classname, "onslaught_generator");
delta = tmp_entity.origin - pos;
delta_z = 0;
distance = vlen(delta);
-
+
if(SAME_TEAM(tmp_entity, self))
if(max_dist <= 0 || distance <= max_dist)
if(closest_target == world || distance <= smallest_distance )
closest_target = tmp_entity;
smallest_distance = distance;
}
-
+
tmp_entity = tmp_entity.chain;
}
-
+
return closest_target;
}
/**
{
if ( !tele_target )
return false;
-
+
int i;
vector loc;
float theta;
loc_x = cos(theta);
loc_z = 0;
loc *= random() * range;
-
+
loc += tele_target.origin + '0 0 128';
-
+
tracebox(loc, PL_MIN, PL_MAX, loc, MOVE_NORMAL, player);
if(trace_fraction == 1.0 && !trace_startsolid)
{
}
}
}
-
+
return false;
}
self.player_blocked = true;
return false;
}
-
+
entity l;
for(l = ons_worldgeneratorlist; l; l = l.ons_worldgeneratornext)
{
self.ons_spawn_by = world;
return false;
}
-
+
if(autocvar_g_onslaught_spawn_at_controlpoints)
if(random() <= autocvar_g_onslaught_spawn_at_controlpoints_chance)
{
float random_target = autocvar_g_onslaught_spawn_at_controlpoints_random;
entity tmp_entity, closest_target = world;
vector spawn_loc = self.ons_deathloc;
-
+
// new joining player or round reset, don't bother checking
if(spawn_loc == '0 0 0') { return false; }
else if(vlen(tmp_entity.origin - spawn_loc) <= vlen(closest_target.origin - spawn_loc) || closest_target == world)
closest_target = tmp_entity;
}
-
+
if(random_target) { closest_target = RandomSelection_chosen_ent; }
-
+
if(closest_target)
{
float i;
}
}
}
-
+
if(autocvar_g_onslaught_spawn_at_generator)
if(random() <= autocvar_g_onslaught_spawn_at_generator_chance)
{
float random_target = autocvar_g_onslaught_spawn_at_generator_random;
entity tmp_entity, closest_target = world;
vector spawn_loc = self.ons_deathloc;
-
+
// new joining player or round reset, don't bother checking
if(spawn_loc == '0 0 0') { return false; }
-
+
if(random_target) { RandomSelection_Init(); }
for(tmp_entity = ons_worldgeneratorlist; tmp_entity; tmp_entity = tmp_entity.ons_worldgeneratornext)
closest_target = tmp_entity;
}
}
-
+
if(random_target) { closest_target = RandomSelection_chosen_ent; }
-
+
if(closest_target)
{
float i;
{
l.sprite.SendFlags |= 16;
}
-
+
if ( autocvar_g_onslaught_spawn_choose )
if ( ons_Count_SelfControlPoints() > 1 )
stuffcmd(self, "qc_cmd_cl hud clickradar\n");
-
+
return false;
}
void ons_MonsterSpawn_Delayed()
{
entity e, own = self.owner;
-
+
if(!own) { remove(self); return; }
-
+
if(own.targetname)
{
e = find(world, target, own.targetname);
if(e != world)
{
own.team = e.team;
-
+
activator = e;
own.use();
}
}
-
+
remove(self);
}
{
own.team = e.team;
own.active = ACTIVE_NOT;
-
+
activator = e;
own.use();
}
pos_y = stof(argv(2));
if(cmd_argc > 3)
pos_z = stof(argv(3));
-
+
if ( IS_PLAYER(self) )
{
if ( !self.frozen )
{
entity source_point = ons_Nearest_ControlPoint(self.origin, autocvar_g_onslaught_teleport_radius);
-
+
if ( !source_point && self.health > 0 )
{
sprint(self, "\nYou need to be next to a control point\n");
return 1;
}
-
-
+
+
entity closest_target = ons_Nearest_ControlPoint_2D(pos, autocvar_g_onslaught_click_radius);
-
+
if ( closest_target == world )
{
sprint(self, "\nNo control point found\n");
return 1;
}
-
+
if ( self.health <= 0 )
{
self.ons_spawn_by = closest_target;
sprint(self, "\nTeleporting to the same point\n");
return 1;
}
-
+
if ( !ons_Teleport(self,closest_target,autocvar_g_onslaught_teleport_radius,true) )
sprint(self, "\nUnable to teleport there\n");
}
-
+
return 1;
}
-
+
sprint(self, "\nNo teleportation for you\n");
}
-
+
return 1;
}
return 0;
MUTATOR_HOOKFUNCTION(ons_PlayerUseKey)
{
if(MUTATOR_RETURNVALUE || gameover) { return false; }
-
+
if((time > self.teleport_antispam) && (self.deadflag == DEAD_NO) && !self.vehicle)
{
entity source_point = ons_Nearest_ControlPoint(self.origin, autocvar_g_onslaught_teleport_radius);
return true;
}
}
-
+
return false;
}
void spawnfunc_onslaught_controlpoint()
{
if(!g_onslaught) { remove(self); return; }
-
+
ons_ControlPoint_Setup(self);
}
void ons_DelayedInit() // Do this check with a delay so we can wait for teams to be set up
{
ons_ScoreRules();
-
+
round_handler_Spawn(Onslaught_CheckPlayers, Onslaught_CheckWinner, Onslaught_RoundStart);
round_handler_Init(5, autocvar_g_onslaught_warmup, autocvar_g_onslaught_round_timelimit);
}