set g_balance_campingrifle_primary_headshotaddeddamage 75
set g_balance_campingrifle_primary_spread 0
set g_balance_campingrifle_primary_force 2
-set g_balance_campingrifle_primary_speed 35000
+set g_balance_campingrifle_primary_speed 40000
set g_balance_campingrifle_primary_lifetime 5
set g_balance_campingrifle_primary_refire 1.5
set g_balance_campingrifle_primary_animtime 1.4
set g_balance_campingrifle_primary_ammo 10
-set g_balance_campingrifle_primary_bulletconstant 130 // 56.3qu
+set g_balance_campingrifle_primary_bulletconstant 110 // 62.2qu
set g_balance_campingrifle_primary_burstcost 0
set g_balance_campingrifle_primary_bullethail 0 // empty magazine on shot
set g_balance_campingrifle_secondary 1
set g_balance_campingrifle_secondary_headshotaddeddamage 50 // 50 damage only on head
set g_balance_campingrifle_secondary_spread 0
set g_balance_campingrifle_secondary_force 2
-set g_balance_campingrifle_secondary_speed 15000
+set g_balance_campingrifle_secondary_speed 20000
set g_balance_campingrifle_secondary_lifetime 5
set g_balance_campingrifle_secondary_refire 1.5
set g_balance_campingrifle_secondary_animtime 1.4
set g_balance_campingrifle_secondary_ammo 10
-set g_balance_campingrifle_secondary_bulletconstant 130 // 10.3qu
+set g_balance_campingrifle_secondary_bulletconstant 110 // 15.5qu
set g_balance_campingrifle_secondary_burstcost 0
set g_balance_campingrifle_secondary_bullethail 0 // empty magazine on shot
// }}}
seta crosshair_fireball_color_blue 0.2 "crosshair color blue component to display when wielding the fireball"
seta crosshair_fireball_color_alpha 1 "crosshair alpha value to display when wielding the fireball"
seta crosshair_fireball_size 1 "crosshair size when wielding the fireball"
-seta crosshair_ring_size 3 "bullet counter ring size for Rifle, velocity ring for Nex"
+seta crosshair_ring_size 2 "bullet counter ring size for Rifle, velocity ring for Nex"
seta crosshair_campingrifle_bulletcounter_alpha 0.15
seta crosshair_nexvelocity_alpha 0.15
seta cl_reticle_stretch 0 "whether to stretch reticles so they fit the screen (brakes image proportions)"
set g_grappling_hook 0 "let players spawn with the grappling hook which allows them to pull themselves up"
set g_dodging 0 "set to 1 to enable dodging in games"
+set g_rocket_flying 0 "set to 1 to enable rocket flying in all balance configs"
seta cl_dodging_timeout 0.2 "determines how long apart (in seconds) two taps on the same direction key are considered a dodge. use 0 to disable"
set g_arena_respawn_waves 0
set g_ca_respawn_delay 0
set g_ca_respawn_waves 0
+set g_ca_damage2score_multiplier 0.01
+set g_ca_round_timelimit 180
set g_nexball_respawn_delay 0
set g_nexball_respawn_waves 0
set g_as_respawn_delay 0
set sv_vote_timeout 30 "a vote will timeout after this many seconds"
set sv_vote_wait 120 "a player can not call a vote again for this many seconds when his vote was not accepted"
set sv_vote_stop 15 "a player can not call a vote again for this many seconds when he stopped this vote (e.g. to correct it)"
-set sv_vote_majority_factor 0.5 "which quotient of the PLAYERS constitute a majority? (try: 0.667, 0.75 when using the above)"
-set sv_vote_simple_majority_factor 0.667 "which quotient of the VOTERS constitute a majority too? (0 = off, otherwise it must be higher than or equal to sv_vote_majority_factor)"
+set sv_vote_majority_factor 0.5 "which quotient of the PLAYERS constitute a majority? (try: 0.666, 0.75 when using the above)"
+set sv_vote_simple_majority_factor 0.666 "which quotient of the VOTERS constitute a majority too? (0 = off, otherwise it must be higher than or equal to sv_vote_majority_factor)"
// when disabled, don't allow game type changes "note: set these two equal to JUST support simple majorities"
set sv_vote_override_mostrecent 0
alias vhelp "cmd vote help"
set menu_use_default_hostname 1
alias sethostname "set menu_use_default_hostname 0; hostname $*"
-// force fog for people who turn it off in game (set this to like 5 if you suspect people are "cheating" that way)
-set sv_foginterval 0
+set sv_foginterval 1 "force enable fog in regular intervals"
// Audio track names (for old-style "cd loop NUMBER" usage)
set _cdtrack_first "1"
set g_ban_sync_timeout 45 "time out in seconds for the ban sync requests"
set g_ban_sync_trusted_servers_verify 0 "when set to 1, additional bans sent by the servers are ignored, and only bans for the requested IP are used"
-set g_showweaponspawns 0 "1: display sprites for weapon spawns found on the map when a weapon key is pressed and the weapon is not available"
+set g_showweaponspawns 1 "display sprites for weapon spawns found on the map when a weapon key is pressed and the weapon is not available"
alias records "cmd records"
alias rankings "cmd rankings"
// let's reset the view back to normal for the end
R_SetView(VF_MIN, '0 0 0');
R_SetView(VF_SIZE, '1 0 0' * w + '0 1 0' * h);
-
- // be safe against triggerbots until everyone has the fixed engine
- // this call is meant to overwrite the trace globals by something
- // unsuspicious
- traceline('0 0 0', '0 0 0', MOVE_WORLDONLY, world);
}
#define spider_h "gfx/vehicles/hud_bg.tga"
float mod_active; // is there any active mod icon?
+// Clan Arena HUD modicons
+void HUD_Mod_CA(vector pos, vector mySize)
+{
+ mod_active = 1; // CA should never hide the mod icons panel
+ float redalive, bluealive;
+ redalive = getstati(STAT_REDALIVE);
+ bluealive = getstati(STAT_BLUEALIVE);
+
+ drawfont = hud_bigfont;
+ vector redpos, bluepos;
+ if(mySize_x > mySize_y)
+ {
+ redpos = pos;
+ bluepos = pos + eY * 0.5 * mySize_y;
+ drawpic_aspect_skin(redpos, "player_red.tga", 0.5 * mySize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(redpos + eX * 0.5 * mySize_x, ftos(redalive), 0.5 * mySize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawpic_aspect_skin(bluepos, "player_blue.tga", 0.5 * mySize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(bluepos + eX * 0.5 * mySize_x, ftos(bluealive), 0.5 * mySize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ }
+ else
+ {
+ redpos = pos;
+ bluepos = pos + eY * 0.5 * mySize_y;
+ drawpic_aspect_skin(redpos, "player_red.tga", eX * mySize_x + eY * 0.3 * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(redpos + eY * 0.3 * mySize_y, ftos(redalive), eX * mySize_x + eY * 0.2 * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawpic_aspect_skin(bluepos, "player_blue.tga", eX * mySize_x + eY * 0.3 * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(bluepos + eY * 0.3 * mySize_y, ftos(bluealive), eX * mySize_x + eY * 0.2 * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ }
+ drawfont = hud_font;
+}
+
// CTF HUD modicon section
float redflag_prevframe, blueflag_prevframe; // status during previous frame
float redflag_prevstatus, blueflag_prevstatus; // last remembered status
if(!autocvar_hud_panel_modicons && !autocvar__hud_configure)
return;
- if (gametype != GAME_KEYHUNT && gametype != GAME_CTF && gametype != GAME_NEXBALL && gametype != GAME_CTS && gametype != GAME_RACE && !autocvar__hud_configure)
+ if (gametype != GAME_KEYHUNT && gametype != GAME_CTF && gametype != GAME_NEXBALL && gametype != GAME_CTS && gametype != GAME_RACE && gametype != GAME_CA && !autocvar__hud_configure)
return;
active_panel = HUD_PANEL_MODICONS;
HUD_Mod_NexBall(pos, mySize);
else if(gametype == GAME_CTS || gametype == GAME_RACE)
HUD_Mod_Race(pos, mySize);
+ else if(gametype == GAME_CA)
+ HUD_Mod_CA(pos, mySize);
}
// Draw pressed keys (#11)
}
// this draws the triangles of a model DIRECTLY. Don't expect high performance, really...
-void PolyDrawModel(entity e)
+float PolyDrawModelSurface(entity e, float i_s)
{
- float i_s, i_t;
+ float i_t;
float n_t;
vector tri;
string tex;
- for(i_s = 0; ; ++i_s)
+ tex = getsurfacetexture(e, i_s);
+ if not(tex)
+ return 0; // this is beyond the last one
+ n_t = getsurfacenumtriangles(e, i_s);
+ for(i_t = 0; i_t < n_t; ++i_t)
{
- tex = getsurfacetexture(e, i_s);
- if not(tex)
- break; // this is beyond the last one
- n_t = getsurfacenumtriangles(e, i_s);
- for(i_t = 0; i_t < n_t; ++i_t)
- {
- tri = getsurfacetriangle(e, i_s, i_t);
- R_BeginPolygon(tex, 0);
- R_PolygonVertex(getsurfacepoint(e, i_s, tri_x), getsurfacepointattribute(e, i_s, tri_x, SPA_TEXCOORDS0), '1 1 1', 1);
- R_PolygonVertex(getsurfacepoint(e, i_s, tri_y), getsurfacepointattribute(e, i_s, tri_y, SPA_TEXCOORDS0), '1 1 1', 1);
- R_PolygonVertex(getsurfacepoint(e, i_s, tri_z), getsurfacepointattribute(e, i_s, tri_z, SPA_TEXCOORDS0), '1 1 1', 1);
- R_EndPolygon();
- }
+ tri = getsurfacetriangle(e, i_s, i_t);
+ R_BeginPolygon(tex, 0);
+ R_PolygonVertex(getsurfacepoint(e, i_s, tri_x), getsurfacepointattribute(e, i_s, tri_x, SPA_TEXCOORDS0), '1 1 1', 1);
+ R_PolygonVertex(getsurfacepoint(e, i_s, tri_y), getsurfacepointattribute(e, i_s, tri_y, SPA_TEXCOORDS0), '1 1 1', 1);
+ R_PolygonVertex(getsurfacepoint(e, i_s, tri_z), getsurfacepointattribute(e, i_s, tri_z, SPA_TEXCOORDS0), '1 1 1', 1);
+ R_EndPolygon();
}
+ return 1;
+}
+void PolyDrawModel(entity e)
+{
+ float i_s;
+ for(i_s = 0; ; ++i_s)
+ if(!PolyDrawModelSurface(e, i_s))
+ break;
}
void DrawCircleClippedPic(vector centre, float radius, string pic, float f, vector rgb, float a, float drawflag)
const float STAT_LEADLIMIT = 47;
const float STAT_BULLETS_LOADED = 48;
const float STAT_NEX_CHARGE = 49;
+const float STAT_HUD = 50;
// see DP source, quakedef.h
const float STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222;
const float CTF_STATE_DEFEND = 2;
const float CTF_STATE_COMMANDER = 3;
-const float STAT_HUD = 50;
const float HUD_NORMAL = 0;
const float HUD_SPIDERBOT = 10;
const float HUD_WAKIZASHI = 11;
const float STAT_VEHICLESTAT_AMMO2 = 65;
const float STAT_VEHICLESTAT_RELOAD2 = 66;
+// mod stats (1xx)
+const float STAT_REDALIVE = 100;
+const float STAT_BLUEALIVE = 101;
+
//const float STAT_SPIDERBOT_AIM 53 // compressShotOrigin
//const float STAT_SPIDERBOT_TARGET 54 // compressShotOrigin
s = strcat(s, ", MinstaGib");
if(cvar("g_nix"))
s = strcat(s, ", NIX");
+ if(cvar("g_rocket_flying"))
+ s = strcat(s, ", Rocket Flying");
if(cvar_string("g_weaponarena") != "0")
s = strcat(s, ", ", WeaponArenaString());
if(cvar("g_start_weapon_laser") == 0)
s = strcat(s, ", Low gravity");
if(cvar("g_cloaked"))
s = strcat(s, ", Cloaked");
- if(cvar("g_footsteps"))
- s = strcat(s, ", Steps");
if(cvar("g_grappling_hook"))
s = strcat(s, ", Hook");
if(cvar("g_laserguided_missile"))
me.TR(me);
me.TDempty(me, 0.2);
me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_cloaked", "Cloaked"));
- me.TR(me);
- me.TDempty(me, 0.2);
- me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_footsteps", "Footsteps"));
me.TR(me);
me.TDempty(me, 0.2);
me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_midair", "Midair"));
me.TR(me);
me.TDempty(me, 0.2);
me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_laserguided_missile", "Laser guided missiles"));
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_rocket_flying", "Rocket Flying"));
me.TR(me);
me.TDempty(me, 0.2);
me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_pinata", "Pinata"));
entity spawnqueue_first;
entity spawnqueue_last;
entity champion;
+string champion_name;
float warmup;
-float allowed_to_spawn;
float ca_players;
float required_ca_players;
.float caplayer;
if(g_keyhunt)
kh_Controller_SetThink(cvar("g_balance_keyhunt_delay_round")+(game_starttime - time), "", kh_StartRound);
- if(g_arena || g_ca)
+ if(g_arena)
if(champion && champion.classname == "player" && player_count > 1)
UpdateFrags(champion, +1);
if((!g_arena && !g_ca) || (g_arena && !arena_roundbased) || (time < game_starttime))
return;
- f = floor(warmup - time + 1);
+ f = ceil(warmup - time);
+ if(f > 0)
+ champion = world; // this is done because a if(champion) will not execute if champion = world
allowed_to_spawn = 0;
- if(g_ca && (ca_players < required_ca_players || inWarmupStage))
+ if(inWarmupStage)
+ allowed_to_spawn = 1;
+ if(ca_players < required_ca_players)
allowed_to_spawn = 1;
msg = NEWLINES;
if (g_ca)
allowed_to_spawn = 1;
if(champion && g_arena)
- msg = strcat("The Champion is ", champion.netname, "^7\n");
+ msg = strcat("The Champion is ", champion_name, "^7\n");
//centerprint(self, strcat(msg, "The Champion is ", champion.netname, "^7\n"));
if(f != roundStartTime_prev) {
}
float next_round;
+float stopalivecheck;
+float redalive, bluealive;
+.float redalive_stat, bluealive_stat;
/**
* This function finds out whether an arena round is over 1 player is left.
* It determines the last player who's still alive and saves it's entity reference
*/
void Spawnqueue_Check()
{
+ if(g_ca) // we want to perform this before the return block below...
+ {
+ // this is STUPID to perform again, but has to be done so that we can give instant feedback when a round ends
+ // and so the code won't start searching for a champion using find() before all players are actually REMOVED
+ redalive = 0; bluealive = 0;
+ FOR_EACH_PLAYER(self) {
+ if (self.team == COLOR_TEAM1 && self.health >= 1) redalive += 1;
+ else if (self.team == COLOR_TEAM2 && self.health >= 1) bluealive += 1;
+ }
+ // as if the above stuff wasn't stupid enough, let's run it a third time! :D
+ // (so that we can send redalive/bluealive as a stat)
+ FOR_EACH_PLAYER(self) {
+ self.redalive_stat = redalive;
+ self.bluealive_stat = bluealive;
+ }
+ }
if(time < warmup + 1 || inWarmupStage)
return;
else if(ca_players < required_ca_players) {
FOR_EACH_PLAYER(self)
centerprint(self, strcat("^1Need at least 1 player in each team to play CA", "^7\n"));
-
- allowed_to_spawn = 1;
return;
}
else if(!next_round) {
if((redspawned && !bluespawned) || (bluespawned && !redspawned)) {
next_round = time + 5;
-
champion = find(world, classname, "player");
- string champion_team;
- if(champion.team == COLOR_TEAM1) {
- champion_team = "^1Red team";
- play2all("ctf/red_capture.wav");
- }
- else if(champion.team == COLOR_TEAM2) {
- champion_team = "^4Blue team";
- play2all("ctf/blue_capture.wav");
- }
- FOR_EACH_CLIENT(self) centerprint(self, strcat(champion_team, "^7 wins the round.", "^7\n"));
+ if(champion_name)
+ strunzone(champion_name);
+ champion_name = strzone(champion.netname);
}
- else if(!redspawned && !bluespawned) {
+ else if((!redspawned && !bluespawned) || time - warmup > cvar("g_ca_round_timelimit")) {
FOR_EACH_CLIENT(self) centerprint(self, strcat("^7Round tied.", "^7\n"));
next_round = time + 5;
}
+
+ }
+ if(!stopalivecheck)
+ {
+ if(redalive && !bluealive)
+ {
+ play2all("ctf/red_capture.wav");
+ FOR_EACH_CLIENT(self) centerprint(self, "^1 RED ^7team wins the round.\n");
+ TeamScore_AddToTeam(COLOR_TEAM1, ST_SCORE, +1);
+ stopalivecheck = TRUE;
+ }
+ else if(bluealive && !redalive)
+ {
+ play2all("ctf/blue_capture.wav");
+ FOR_EACH_CLIENT(self) centerprint(self, "^4 BLUE ^7team wins the round.\n");
+ TeamScore_AddToTeam(COLOR_TEAM2, ST_SCORE, +1);
+ stopalivecheck = TRUE;
+ }
}
if((next_round && next_round < time))
{
+ stopalivecheck = FALSE;
next_round = 0;
reset_map(TRUE);
}
void ClientKill (void)
{
- ClientKill_TeamChange(0);
+ if((g_arena || g_ca) && ((champion && champion.classname == "player" && player_count > 1) || player_count == 1)) // don't allow a kill in this case either
+ {
+ // do nothing
+ }
+ else
+ ClientKill_TeamChange(0);
}
void DoTeamChange(float destteam)
readyrestart_happened = 1;
game_starttime = time;
- if(!g_ca)
+ if(!g_ca && !g_arena)
game_starttime += RESTART_COUNTDOWN;
restart_mapalreadyrestarted = 0; //reset this var, needed when cvar sv_ready_restart_repeatable is in use
}
//initiate the restart-countdown-announcer entity
- if(cvar("sv_ready_restart_after_countdown"))
+ if(cvar("sv_ready_restart_after_countdown") && !g_ca && !g_arena)
{
restartTimer = spawn();
restartTimer.think = restartTimer_Think;
.entity realowner;
.float nex_charge;
+
+float allowed_to_spawn; // boolean variable used by the clan arena code to determine if a player can spawn (after the round has ended)
if(deathtype & HITTYPE_HEADSHOT)
headshot = 1;
}
+ if(g_ca)
+ PlayerScore_Add(attacker, SP_SCORE, damage * cvar("g_ca_damage2score_multiplier"));
}
}
else
if (self.active != ACTIVE_ACTIVE)
return;
+ if(self.team)
+ if((self.spawnflags & 4 == 0) == (self.team != other.team))
+ return;
+
// only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu)
if (other.iscreature)
{
{
vector o;
entity oldself;
+ entity hitent;
+ vector hitloc;
self.nextthink = time;
o = self.origin + v_forward * 32768;
}
- if(self.dmg)
+ if(self.dmg || self.enemy.target != "")
{
- if(self.dmg < 0)
- FireRailgunBullet(self.origin, o, 100000, 0, 0, 0, 0, 0, DEATH_HURTTRIGGER);
- else
- FireRailgunBullet(self.origin, o, self.dmg * frametime, 0, 0, 0, 0, 0, DEATH_HURTTRIGGER);
+ traceline(self.origin, o, MOVE_NORMAL, self);
}
+ hitent = trace_ent;
+ hitloc = trace_endpos;
if(self.enemy.target != "") // DETECTOR laser
{
- traceline(self.origin, o, MOVE_NORMAL, self);
if(trace_ent.iscreature)
{
- self.pusher = trace_ent;
+ self.pusher = hitent;
if(!self.count)
{
self.count = 1;
}
}
}
+
+ if(self.dmg)
+ {
+ if(self.team)
+ if((self.spawnflags & 8 == 0) == (self.team != hitent.team))
+ return;
+ if(hitent.takedamage)
+ Damage(hitent, self, self, ((self.dmg < 0) ? 100000 : (self.dmg * frametime)), DEATH_HURTTRIGGER, hitloc, '0 0 0');
+ }
}
float laser_SendEntity(entity to, float fl)
BADCVAR("sys_colortranslation");
BADCVAR("sys_specialcharactertranslation");
BADCVAR("timestamps");
+ BADCVAR("net_address");
+ BADCVAR("net_address_ipv6");
// mapinfo
BADCVAR("timelimit");
compressShortVector_init();
+ allowed_to_spawn = TRUE;
+
local entity head;
head = nextent(world);
maxclients = 0;
addstat(STAT_NEX_CHARGE, AS_FLOAT, nex_charge);
+ if(g_ca)
+ {
+ addstat(STAT_REDALIVE, AS_INT, redalive_stat);
+ addstat(STAT_BLUEALIVE, AS_INT, bluealive_stat);
+ }
// g_movementspeed hack
addstat(STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW, AS_FLOAT, stat_sv_airspeedlimit_nonqw);
addstat(STAT_MOVEVARS_AIRACCEL_QW, AS_FLOAT, stat_sv_airaccel_qw);
// first load all the mutators
if(cvar("g_nix"))
MUTATOR_ADD(mutator_nix);
+ if(cvar("g_dodging"))
+ MUTATOR_ADD(mutator_dodging);
+ if(cvar("g_rocket_flying") || (cvar("g_balance_rocketlauncher_detonatedelay") == 0 && stof(cvar_defstring("g_balance_rocketlauncher_detonatedelay")) != 0))
+ MUTATOR_ADD(mutator_rocketflying);
g_bugrigs = cvar("g_bugrigs");
g_bugrigs_planar_movement = cvar("g_bugrigs_planar_movement");
// INPUT:
float get_cvars_f;
string get_cvars_s;
+
+MUTATOR_HOOKABLE(EditProjectile);
+ // can edit any "just fired" projectile
+ // INPUT:
+ entity self;
+ entity other;
return 0;
}
-MUTATOR_DEFINITION(dodging)
+MUTATOR_DEFINITION(mutator_dodging)
{
// we need to be called before GetPressedKey does its thing so we can
// detect state changes and therefore dodging actions..
--- /dev/null
+MUTATOR_HOOKFUNCTION(rocketflying_EditProjectile)
+{
+ if(other.classname == "rocket")
+ {
+ // kill detonate delay of rockets
+ other.spawnshieldtime = time;
+ }
+ return 0;
+}
+
+MUTATOR_HOOKFUNCTION(rocketflying_BuildMutatorsString)
+{
+ ret_string = strcat(ret_string, ":RocketFlying");
+ return 0;
+}
+
+MUTATOR_HOOKFUNCTION(rocketflying_BuildMutatorsPrettyString)
+{
+ ret_string = strcat(ret_string, ", Rocket Flying");
+ return 0;
+}
+
+MUTATOR_DEFINITION(mutator_rocketflying)
+{
+ entity e;
+
+ MUTATOR_HOOK(EditProjectile, rocketflying_EditProjectile, CBC_ORDER_ANY);
+ MUTATOR_HOOK(BuildMutatorsString, rocketflying_BuildMutatorsString, CBC_ORDER_ANY);
+ MUTATOR_HOOK(BuildMutatorsPrettyString, rocketflying_BuildMutatorsPrettyString, CBC_ORDER_ANY);
+
+ return 0;
+}
MUTATOR_DECLARATION(gamemode_keyhunt);
MUTATOR_DECLARATION(mutator_nix);
-
-MUTATOR_DECLARATION(dodging);
+MUTATOR_DECLARATION(mutator_dodging);
+MUTATOR_DECLARATION(mutator_rocketflying);
mutators/gamemode_keyhunt.qc
mutators/mutator_nix.qc
mutators/mutator_dodging.qc
+mutators/mutator_rocketflying.qc
../warpzonelib/anglestransform.qc
../warpzonelib/mathlib.qc
fraglimit_override = cvar("fraglimit_override");
leadlimit_override = cvar("leadlimit_override");
- if(cvar("g_dodging"))
- MUTATOR_ADD(dodging);
-
if(g_dm)
{
game = GAME_DEATHMATCH;
//.float bulletcounter;
void turret_machinegun_attack()
{
-
- entity flash;
-
sound (self, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET, 0, 1, cvar("g_balance_uzi_bulletconstant"));
endFireBallisticBullet();
//w_deathtypestring = "had an alergic reaction due to 10 kilos of led";
te_smallflash(self.tur_shotorg);
- // muzzle flash for 3rd person view
- flash = spawn();
- setmodel(flash, "models/uziflash.md3"); // precision set below
- setattachment(flash, self.tur_head, "tag_fire");
- flash.think = W_Uzi_Flash_Go;
- flash.nextthink = time + 0.02;
- flash.frame = 2;
- flash.angles_z = flash.v_angle_z + random() * 180;
- flash.alpha = 1;
- flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
+ UziFlash();
+ setattachment(self.muzzle_flash, self.tur_head, "tag_fire");
}
void walker_attack()
{
- entity flash;
-
sound (self, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET, 0, 1, cvar("g_balance_uzi_bulletconstant"));
endFireBallisticBullet();
if (self.uzi_bulletcounter == 2)
{
- flash = spawn();
-
- setmodel(flash, "models/uziflash.md3");
- setattachment(flash, self.tur_head, "tag_fire");
-
- flash.scale = 3;
- flash.think = W_Uzi_Flash_Go;
- flash.nextthink = time + 0.02;
- flash.frame = 2;
- flash.angles_z = flash.v_angle_z + random() * 180;
- flash.alpha = 1;
- flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
+ UziFlash();
+ setattachment(self.muzzle_flash, self.tur_head, "tag_fire");
self.uzi_bulletcounter = 0;
}
self.gun2.cnt = time + self.attack_finished_single;
}
+/*
void spiderbot_minigun_fire_Flash_Go() {
if (self.frame > 10)
{
self.scale -= 0.01;
self.nextthink = time + 0.02;
}
+*/
-void spiderbot_minigun_fire(entity gun,float trail)
+void spiderbot_minigun_fire(entity gun, float trail)
{
-
- entity flash;
vector v;
+
v = gettaginfo(gun,gettagindex(gun,"barrels"));
v_forward = normalize(v_forward);
fireBullet (v, v_forward, cvar("g_vehicle_spiderbot_minigun_spread"), cvar("g_vehicle_spiderbot_minigun_damage"),
cvar("g_vehicle_spiderbot_minigun_spread"), DEATH_SBMINIGUN, 0);
- if not (gun.enemy)
- {
- gun.enemy = spawn();
- setattachment(gun.enemy , gun, "barrels");
- setorigin(gun.enemy ,gun.enemy.origin + '52 0 0');
- }
- flash = gun.enemy;
- setmodel(flash, "models/uziflash.md3");
- flash.think = spiderbot_minigun_fire_Flash_Go;
- flash.nextthink = time + 0.02;
- flash.frame = 2;
- flash.angles_z = flash.v_angle_z + random() * 180;
- flash.alpha = 1;
- flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
- flash.scale = 1;
+ UziFlash();
+ setattachment(self.muzzle_flash, self.tur_head, "tag_fire");
if(trail)
trailparticles(self, particleeffectnum("EF_MGTURRETTRAIL"), v, trace_endpos);
proj.oldvelocity = proj.velocity;
+ other = proj; MUTATOR_CALLHOOK(EditProjectile);
+
if(cvar("g_antilag_bullets"))
if(pSpeed >= cvar("g_antilag_bullets"))
{
CSQCProjectile(proj, TRUE, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), TRUE);
+ other = proj; MUTATOR_CALLHOOK(EditProjectile);
+
counter = counter + 1;
}
}
CSQCProjectile(proj, TRUE, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), TRUE);
+ other = proj; MUTATOR_CALLHOOK(EditProjectile);
+
counter = counter + 1;
}
}
//sounds bad
CSQCProjectile(proj, TRUE, PROJECTILE_ELECTRO_BEAM, TRUE);
+
+ other = proj; MUTATOR_CALLHOOK(EditProjectile);
}
void W_Electro_Attack2()
#endif
CSQCProjectile(proj, TRUE, PROJECTILE_ELECTRO, FALSE); // no culling, it has sound
+
+ other = proj; MUTATOR_CALLHOOK(EditProjectile);
}
.vector hook_start, hook_end;
proj.flags = FL_PROJECTILE;
CSQCProjectile(proj, TRUE, PROJECTILE_FIREBALL, TRUE);
+
+ other = proj; MUTATOR_CALLHOOK(EditProjectile);
}
void W_Fireball_AttackEffect(float i, vector f_diff)
proj.flags = FL_PROJECTILE;
CSQCProjectile(proj, TRUE, PROJECTILE_FIREMINE, TRUE);
+
+ other = proj; MUTATOR_CALLHOOK(EditProjectile);
}
void spawnfunc_weapon_fireball (void)
CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE, TRUE);
else
CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE_BOUNCING, TRUE);
+
+ other = gren; MUTATOR_CALLHOOK(EditProjectile);
}
void W_Grenade_Attack2 (void)
CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE, TRUE);
else
CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE_BOUNCING, TRUE);
+
+ other = gren; MUTATOR_CALLHOOK(EditProjectile);
}
void spawnfunc_weapon_grenadelauncher (void)
missile.flags = FL_PROJECTILE;
CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR, TRUE);
+
+ other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
void W_Hagar_Attack2 (void)
missile.flags = FL_PROJECTILE;
CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR_BOUNCING, TRUE);
+
+ other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
void spawnfunc_weapon_hagar (void)
missile.projectiledeathtype = WEP_HLAC;
CSQCProjectile(missile, TRUE, PROJECTILE_HLAC, TRUE);
+
+ other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
void W_HLAC_Attack2f (void)
missile.projectiledeathtype = WEP_HLAC | HITTYPE_SECONDARY;
CSQCProjectile(missile, TRUE, PROJECTILE_HLAC, TRUE);
+
+ other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
void W_HLAC_Attack2 (void)
gren.flags = FL_PROJECTILE;
CSQCProjectile(gren, TRUE, PROJECTILE_HOOKBOMB, TRUE);
+
+ other = gren; MUTATOR_CALLHOOK(EditProjectile);
}
void spawnfunc_weapon_hook (void)
missile.think = W_Laser_Think;
missile.nextthink = time + cvar("g_balance_laser_primary_delay");
+
+ other = missile; MUTATOR_CALLHOOK(EditProjectile);
+
if(time >= missile.nextthink)
{
entity oldself;
W_AttachToShotorg(flash, '5 0 0');
// common properties
+
+ other = mine; MUTATOR_CALLHOOK(EditProjectile);
}
void spawnfunc_weapon_minelayer (void); // defined in t_items.qc
gren.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP;
CSQCProjectile(gren, TRUE, PROJECTILE_PORTO_RED, TRUE);
+
+ other = gren; MUTATOR_CALLHOOK(EditProjectile);
}
void spawnfunc_weapon_porto (void)
W_AttachToShotorg(flash, '5 0 0');
// common properties
+ other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
void spawnfunc_weapon_rocketlauncher (void); // defined in t_items.qc
missile.angles = vectoangles (missile.velocity);
CSQCProjectile(missile, FALSE, PROJECTILE_SEEKER, TRUE);
+
+ other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
void Seeker_Vollycontroler_Think()
missile.angles = vectoangles (missile.velocity);
CSQCProjectile(missile, TRUE, PROJECTILE_TAG, FALSE); // has sound
+
+ other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
missile.flags = FL_PROJECTILE;
CSQCProjectile(missile, TRUE, PROJECTILE_FLAC, TRUE);
+
+ other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
void spawnfunc_weapon_seeker (void)
REGISTER_WEAPON(UZI, w_uzi, IT_NAILS, 3, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_MID, "uzi", "uzi", "Machine Gun");
#else
#ifdef SVQC
+.entity muzzle_flash;
+
// leilei's fancy muzzleflash stuff
-void W_Uzi_Flash_Go() {
- if (self.alpha >= 0)
- {
- setmodel(self, "");
- return;
- }
+void Uzi_Flash_Go()
+{
self.frame = self.frame + 2;
self.scale = self.scale * 0.5;
self.alpha = self.alpha - 0.25;
- self.think = W_Uzi_Flash_Go;
self.nextthink = time + 0.05;
-};
+
+ if (self.alpha <= 0)
+ {
+ self.think = SUB_Remove;
+ self.nextthink = time;
+ self.owner.muzzle_flash = world;
+ return;
+ }
+
+}
+
+void UziFlash()
+{
+ if (self.muzzle_flash == world)
+ self.muzzle_flash = spawn();
+
+ // muzzle flash for 1st person view
+ setmodel(self.muzzle_flash, "models/uziflash.md3"); // precision set below
+
+ self.muzzle_flash.scale = 0.75;
+ self.muzzle_flash.think = Uzi_Flash_Go;
+ self.muzzle_flash.nextthink = time + 0.02;
+ self.muzzle_flash.frame = 2;
+ self.muzzle_flash.alpha = 0.75;
+ self.muzzle_flash.angles_z = random() * 180;
+ self.muzzle_flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
+ self.muzzle_flash.owner = self;
+
+
+}
.float uzi_bulletcounter;
-.entity muzzleflash;
void W_Uzi_Attack (float deathtype)
{
- local entity flash;
-
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
{
if (self.uzi_bulletcounter == 1)
pointparticles(particleeffectnum("uzi_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
- if ((self.muzzleflash == world) || wasfreed(self.muzzleflash))
- self.muzzleflash = spawn();
-
- // muzzle flash for 1st person view
- setmodel(self.muzzleflash, "models/uziflash.md3"); // precision set below
- //SUB_SetFade(flash, time + 0.06, 0);
- self.muzzleflash.scale = 0.75;
- self.muzzleflash.think = W_Uzi_Flash_Go;
- self.muzzleflash.nextthink = time + 0.02;
- self.muzzleflash.frame = 2;
- self.muzzleflash.alpha = 0.75;
- self.muzzleflash.angles_z = random() * 180;
- self.muzzleflash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
- W_AttachToShotorg(self.muzzleflash, '5 0 0');
+ UziFlash();
+ W_AttachToShotorg(self.muzzle_flash, '5 0 0');
// casing code
if (cvar("g_casings") >= 2)