]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into terencehill/newpanelhud
authorterencehill <piuntn@gmail.com>
Tue, 26 Oct 2010 22:12:06 +0000 (00:12 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 26 Oct 2010 22:12:06 +0000 (00:12 +0200)
45 files changed:
balanceXonotic.cfg
defaultXonotic.cfg
gfx/crosshair_ring.tga
gfx/hud/default/player_blue.tga [new file with mode: 0644]
gfx/hud/default/player_red.tga [new file with mode: 0644]
gfx/rifle_ring_1.tga [deleted file]
gfx/rifle_ring_2.tga [deleted file]
gfx/rifle_ring_3.tga [deleted file]
gfx/rifle_ring_4.tga [deleted file]
qcsrc/client/View.qc
qcsrc/client/hud.qc
qcsrc/client/miscfunctions.qc
qcsrc/common/constants.qh
qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.c
qcsrc/server/arena.qc
qcsrc/server/cl_client.qc
qcsrc/server/clientcommands.qc
qcsrc/server/defs.qh
qcsrc/server/g_damage.qc
qcsrc/server/g_triggers.qc
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/base.qh
qcsrc/server/mutators/mutator_dodging.qc
qcsrc/server/mutators/mutator_rocketflying.qc [new file with mode: 0644]
qcsrc/server/mutators/mutators.qh
qcsrc/server/progs.src
qcsrc/server/teamplay.qc
qcsrc/server/tturrets/units/unit_machinegun.qc
qcsrc/server/tturrets/units/unit_walker.qc
qcsrc/server/vehicles/spiderbot.qc
qcsrc/server/w_common.qc
qcsrc/server/w_crylink.qc
qcsrc/server/w_electro.qc
qcsrc/server/w_fireball.qc
qcsrc/server/w_grenadelauncher.qc
qcsrc/server/w_hagar.qc
qcsrc/server/w_hlac.qc
qcsrc/server/w_hook.qc
qcsrc/server/w_laser.qc
qcsrc/server/w_minelayer.qc
qcsrc/server/w_porto.qc
qcsrc/server/w_rocketlauncher.qc
qcsrc/server/w_seeker.qc
qcsrc/server/w_uzi.qc

index be8d75bcf3708f51efaec001139f793aba1da9fb..0dcdac942024c96ab403a0deb8f205d66c116be4 100644 (file)
@@ -579,12 +579,12 @@ set g_balance_campingrifle_primary_damage 75
 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
@@ -593,12 +593,12 @@ set g_balance_campingrifle_secondary_damage 50
 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
 // }}}
index e2720b34bc8e0d88c0ea965882d55d482af2a71e..0ba520e135aefda888f97c0f42965804ecceb915 100644 (file)
@@ -211,7 +211,7 @@ seta crosshair_fireball_color_green 1.0     "crosshair color green component to disp
 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)"
@@ -551,6 +551,7 @@ alias clearmap "disconnect"
 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"
 
@@ -614,6 +615,8 @@ set g_arena_respawn_delay 0
 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
@@ -1076,8 +1079,8 @@ set sv_vote_singlecount 0 "set to 1 to count votes once after timeout or to 0 to
 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"
@@ -1522,8 +1525,7 @@ seta menu_mouse_speed 1 "speed multiplier for the mouse in the menu (does not af
 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"
@@ -1644,7 +1646,7 @@ set g_ban_sync_trusted_servers "" "request ban lists from these xonotic servers
 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"
index 970ba1562c179bbf58dc4d6fd853505dea5aaae6..f574012e6bc33934178f8986efce51c25c9fe65e 100644 (file)
Binary files a/gfx/crosshair_ring.tga and b/gfx/crosshair_ring.tga differ
diff --git a/gfx/hud/default/player_blue.tga b/gfx/hud/default/player_blue.tga
new file mode 100644 (file)
index 0000000..cf10bc5
Binary files /dev/null and b/gfx/hud/default/player_blue.tga differ
diff --git a/gfx/hud/default/player_red.tga b/gfx/hud/default/player_red.tga
new file mode 100644 (file)
index 0000000..aea0ed8
Binary files /dev/null and b/gfx/hud/default/player_red.tga differ
diff --git a/gfx/rifle_ring_1.tga b/gfx/rifle_ring_1.tga
deleted file mode 100644 (file)
index 914de35..0000000
Binary files a/gfx/rifle_ring_1.tga and /dev/null differ
diff --git a/gfx/rifle_ring_2.tga b/gfx/rifle_ring_2.tga
deleted file mode 100644 (file)
index db0a808..0000000
Binary files a/gfx/rifle_ring_2.tga and /dev/null differ
diff --git a/gfx/rifle_ring_3.tga b/gfx/rifle_ring_3.tga
deleted file mode 100644 (file)
index 20348c2..0000000
Binary files a/gfx/rifle_ring_3.tga and /dev/null differ
diff --git a/gfx/rifle_ring_4.tga b/gfx/rifle_ring_4.tga
deleted file mode 100644 (file)
index 07975e2..0000000
Binary files a/gfx/rifle_ring_4.tga and /dev/null differ
index 215aa524eb52fbf3d1fbb3b464e1abe84e4fdc68..5ac1f965e3a1d8714da30cd5ebdea66916917257 100644 (file)
@@ -950,11 +950,6 @@ void CSQC_UpdateView(float w, float h)
        // 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"
index 2e9bcb4f195d430376e20fd636c643b3ac6e812c..397941f0e0677a780552e50454192f9ba743841a 100644 (file)
@@ -3867,6 +3867,37 @@ void HUD_VoteWindow(void)
 
 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
@@ -4363,7 +4394,7 @@ void HUD_ModIcons(void)
        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;
@@ -4400,6 +4431,8 @@ void HUD_ModIcons(void)
                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)
index 5c377bffadb8ade59c381071def85021d3181ba8..049368c1636b07944ae7de43de10008dfbbd9da2 100644 (file)
@@ -627,28 +627,33 @@ void drawcolorcodedstring_aspect_expanding(vector pos, string text, vector sz, f
 }
 
 // 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)
index 6f0eccfafb8af72f94a556ad5709a0554c0ccfab..b4b92ff8bd2e72cc41cc07b01bf8a339eb9e1006 100644 (file)
@@ -310,6 +310,7 @@ const float STAT_SHOTORG = 46; // compressShotOrigin
 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;
@@ -320,7 +321,6 @@ const float CTF_STATE_ATTACK = 1;
 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;
@@ -337,6 +337,10 @@ const float STAT_VEHICLESTAT_RELOAD1 = 64;
 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
 
index c0d16a959727cb2c7bf3de5b980153b7eba124ea..37a4669c512e0174adf448a4e1c222bc3e3fbc20 100644 (file)
@@ -70,6 +70,8 @@ string XonoticMutatorsDialog_toString(entity me)
                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)
@@ -78,8 +80,6 @@ string XonoticMutatorsDialog_toString(entity me)
                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"))
@@ -170,9 +170,6 @@ void XonoticMutatorsDialog_fill(entity me)
        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"));
@@ -208,6 +205,9 @@ void XonoticMutatorsDialog_fill(entity me)
        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"));
index ee4ce1b87ed9388ca2bf376f98a437866ef21bc3..046743151dbc02fd27dbd706a77d8065418397b6 100644 (file)
@@ -8,8 +8,8 @@ float arena_roundbased;
 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;
@@ -122,7 +122,7 @@ void reset_map(float dorespawn)
        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);
 
@@ -195,11 +195,15 @@ void Arena_Warmup()
        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;
@@ -208,7 +212,7 @@ void Arena_Warmup()
                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) {
@@ -257,6 +261,9 @@ void Arena_Warmup()
 }
 
 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
@@ -266,6 +273,22 @@ float next_round;
  */
 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;
 
@@ -285,34 +308,43 @@ void Spawnqueue_Check()
                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);
                }
index df6c8d4b2a3f41e0793e271d8aae9a9b54512692..bb2b753b84369a3d87907d307885b0e44b94bcbf 100644 (file)
@@ -1305,7 +1305,12 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto
 
 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)
index a9fd886bfe9c331e34b7651faf4c4bca063703c5..b705e9c09ce18a1877a3e9889e2130c06a53daa9 100644 (file)
@@ -430,7 +430,7 @@ void ReadyRestartForce()
 
        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
 
@@ -448,7 +448,7 @@ void ReadyRestartForce()
        }
 
        //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;
index d1d86ed79a19703ceb266b0f5d8bf40e6836d7d2..745a6e0b2a5e148be15ba87a3e3da7079d4d2f86 100644 (file)
@@ -651,3 +651,5 @@ string deathmessage;
 .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)
index c7336356cae0363a2a8e79a4bd8bff10775c82e8..ab0638387e472b6eeaf43830a065a388fd78a733 100644 (file)
@@ -753,6 +753,8 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                                        if(deathtype & HITTYPE_HEADSHOT)
                                                                headshot = 1;
                                                }
+                                               if(g_ca)
+                                                       PlayerScore_Add(attacker, SP_SCORE, damage * cvar("g_ca_damage2score_multiplier"));
                                        }
                                }
                                else
index 8ded34feae4e6fae28e931a5a18f85868c6dc8e0..4a66f229380ea9c505962ae4e5aa0abe9674d171 100644 (file)
@@ -416,6 +416,10 @@ void trigger_hurt_touch()
        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)
        {
@@ -1012,6 +1016,8 @@ void misc_laser_think()
 {
        vector o;
        entity oldself;
+       entity hitent;
+       vector hitloc;
 
        self.nextthink = time;
 
@@ -1032,20 +1038,18 @@ void misc_laser_think()
                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;
@@ -1071,6 +1075,15 @@ void misc_laser_think()
                        }
                }
        }
+
+       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)
index 5c783acbc3789881a82cffba039920e2d95673a2..6260d7e86d8f08a404afd3228908f70bdce1e774 100644 (file)
@@ -280,6 +280,8 @@ void cvar_changes_init()
                BADCVAR("sys_colortranslation");
                BADCVAR("sys_specialcharactertranslation");
                BADCVAR("timestamps");
+               BADCVAR("net_address");
+               BADCVAR("net_address_ipv6");
 
                // mapinfo
                BADCVAR("timelimit");
@@ -438,6 +440,8 @@ void spawnfunc_worldspawn (void)
 
        compressShortVector_init();
 
+       allowed_to_spawn = TRUE;
+
        local entity head;
        head = nextent(world);
        maxclients = 0;
@@ -640,6 +644,11 @@ void spawnfunc_worldspawn (void)
 
        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);
index 59428f65dbca241c03f7b330440cdd8cf75fce98..05f297746c5243812b1a0e61d811002c8aa422c9 100644 (file)
@@ -1172,6 +1172,10 @@ void readlevelcvars(void)
        // 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");
index 73c16a9cd01c371a05d151d24499c82bf660faa8..cdc28f76bf426a44a4acace7da91b2a6396a807c 100644 (file)
@@ -112,3 +112,9 @@ MUTATOR_HOOKABLE(GetCvars);
        // INPUT:
                float get_cvars_f;
                string get_cvars_s;
+
+MUTATOR_HOOKABLE(EditProjectile);
+       // can edit any "just fired" projectile
+       // INPUT:
+               entity self;
+               entity other;
index d3b8e6d64ee04d26d9317f28894579ac6335eedc..894bb3ee54d2212f2f6dcfe056b06f5b4d8cc580 100644 (file)
@@ -266,7 +266,7 @@ MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys) {
        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..
diff --git a/qcsrc/server/mutators/mutator_rocketflying.qc b/qcsrc/server/mutators/mutator_rocketflying.qc
new file mode 100644 (file)
index 0000000..4cd26a4
--- /dev/null
@@ -0,0 +1,32 @@
+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;
+}
index da14483a4d40fa52e10fb198b65af8fe109e10dd..91d2ea5be78c915997474f7fc24c851310bac36c 100644 (file)
@@ -1,5 +1,5 @@
 MUTATOR_DECLARATION(gamemode_keyhunt);
 
 MUTATOR_DECLARATION(mutator_nix);
-
-MUTATOR_DECLARATION(dodging);
+MUTATOR_DECLARATION(mutator_dodging);
+MUTATOR_DECLARATION(mutator_rocketflying);
index adf4b4a1d89545418734228dddc0b16345100f0a..d492a04ed3cb7f81e77a5b5c1ae978bd2c0868bf 100644 (file)
@@ -179,6 +179,7 @@ mutators/base.qc
 mutators/gamemode_keyhunt.qc
 mutators/mutator_nix.qc
 mutators/mutator_dodging.qc
+mutators/mutator_rocketflying.qc
 
 ../warpzonelib/anglestransform.qc
 ../warpzonelib/mathlib.qc
index 912e22c2441e8c9aabea1cef218d45f234b3a2dc..1232e3c8eb9262f180e8bb97279fdaf761f29181 100644 (file)
@@ -210,9 +210,6 @@ void InitGameplayMode()
        fraglimit_override = cvar("fraglimit_override");
        leadlimit_override = cvar("leadlimit_override");
 
-       if(cvar("g_dodging"))
-               MUTATOR_ADD(dodging);
-       
        if(g_dm)
        {
                game = GAME_DEATHMATCH;
index 4777722da86223327ccf145b01219422817e6ab1..c9a37416b6cdd581edff7b5eb317f734368aaec5 100644 (file)
@@ -5,9 +5,6 @@ void turret_machinegun_attack();
 //.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();
@@ -15,16 +12,8 @@ void turret_machinegun_attack()
     //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");
 }
 
 
index e12bbb83025b944179770233667eccb6f1393824..59aaf653de3750a80540b616fdd41ca5df20e081 100644 (file)
@@ -615,26 +615,14 @@ void walker_postthink()
 
 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;
     }
index ba4360550ebe161c4736eba5ec5d22fa0a331142..056249ed53a6bc5f276da85ecbfc38532ab6ace6 100644 (file)
@@ -188,6 +188,7 @@ void spiderbot_rocket_do()
     self.gun2.cnt = time + self.attack_finished_single;
 }
 
+/*
 void spiderbot_minigun_fire_Flash_Go() {
        if (self.frame > 10)
        {
@@ -201,12 +202,12 @@ void spiderbot_minigun_fire_Flash_Go() {
        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);
 
@@ -215,22 +216,9 @@ void spiderbot_minigun_fire(entity gun,float trail)
     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);
index 99df7041baf7196e83f4016123a2075ef6b30295..0b405ba77e8043dc2d73e7edf7a1155aa8f7554a 100644 (file)
@@ -371,6 +371,8 @@ void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, f
 
        proj.oldvelocity = proj.velocity;
 
+       other = proj; MUTATOR_CALLHOOK(EditProjectile);
+
        if(cvar("g_antilag_bullets"))
        if(pSpeed >= cvar("g_antilag_bullets"))
        {
index 5d1721f78f7def80f188107343408d8cb5d98d87..44e3967b546d9840970229196257bd256d0af6d4 100644 (file)
@@ -206,6 +206,8 @@ void W_Crylink_Attack (void)
 
                CSQCProjectile(proj, TRUE, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), TRUE);
 
+               other = proj; MUTATOR_CALLHOOK(EditProjectile);
+
                counter = counter + 1;
        }
 }
@@ -279,6 +281,8 @@ void W_Crylink_Attack2 (void)
 
                CSQCProjectile(proj, TRUE, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), TRUE);
 
+               other = proj; MUTATOR_CALLHOOK(EditProjectile);
+
                counter = counter + 1;
        }
 }
index 2268ca7cb150a558e9f83d325027213b238b4beb..6634837db6131f9da80daf588a54b53ceae2c008 100644 (file)
@@ -136,6 +136,8 @@ void W_Electro_Attack()
        //sounds bad
 
        CSQCProjectile(proj, TRUE, PROJECTILE_ELECTRO_BEAM, TRUE);
+
+       other = proj; MUTATOR_CALLHOOK(EditProjectile);
 }
 
 void W_Electro_Attack2()
@@ -182,6 +184,8 @@ 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;
index 6b98d37cd7404b024f8252e55b49307d58ecf4c1..e78bb2bbc3b1c03ace99f72afcf8f9b280b8430c 100644 (file)
@@ -155,6 +155,8 @@ void W_Fireball_Attack1()
        proj.flags = FL_PROJECTILE;
 
        CSQCProjectile(proj, TRUE, PROJECTILE_FIREBALL, TRUE);
+
+       other = proj; MUTATOR_CALLHOOK(EditProjectile);
 }
 
 void W_Fireball_AttackEffect(float i, vector f_diff)
@@ -289,6 +291,8 @@ void W_Fireball_Attack2()
        proj.flags = FL_PROJECTILE;
 
        CSQCProjectile(proj, TRUE, PROJECTILE_FIREMINE, TRUE);
+
+       other = proj; MUTATOR_CALLHOOK(EditProjectile);
 }
 
 void spawnfunc_weapon_fireball (void)
index 0bc08b8de77f2b2a6d84c9603d571bac6188421e..e92b2b26062bdae5bddfbe1b7ddb1b18785608b8 100644 (file)
@@ -200,6 +200,8 @@ void W_Grenade_Attack (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)
@@ -244,6 +246,8 @@ 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)
index 1d9e9e698e211b3ac12812cf4ebdb8a987e48c40..587c9fccc04b4a2de5528d23aa394f63dda06ec0 100644 (file)
@@ -71,6 +71,8 @@ void W_Hagar_Attack (void)
        missile.flags = FL_PROJECTILE;
 
        CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR, TRUE);
+
+       other = missile; MUTATOR_CALLHOOK(EditProjectile);
 }
 
 void W_Hagar_Attack2 (void)
@@ -106,6 +108,8 @@ 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)
index 9abb8a7a0200f76e63a5ecbe6b2ddeb2d19e7652..6aaf174147142b1f70212fd276274cbec9c5c053 100644 (file)
@@ -74,6 +74,8 @@ void W_HLAC_Attack (void)
        missile.projectiledeathtype = WEP_HLAC;
 
        CSQCProjectile(missile, TRUE, PROJECTILE_HLAC, TRUE);
+
+       other = missile; MUTATOR_CALLHOOK(EditProjectile);
 }
 
 void W_HLAC_Attack2f (void)
@@ -116,6 +118,8 @@ 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)
index 70fe77814de201e42e9f583d1e7b49c3da89e8a2..334e434c8afa9526774aab288d2ad2dfcbfa6dd5 100644 (file)
@@ -93,6 +93,8 @@ void W_Hook_Attack2()
        gren.flags = FL_PROJECTILE;
 
        CSQCProjectile(gren, TRUE, PROJECTILE_HOOKBOMB, TRUE);
+
+       other = gren; MUTATOR_CALLHOOK(EditProjectile);
 }
 
 void spawnfunc_weapon_hook (void)
index 18715a9b4ba51ff79c7f995cd665d5a0bb1e88b5..db11eb395c3a370dce30aa21749e6a4199662702 100644 (file)
@@ -77,6 +77,9 @@ void W_Laser_Attack (float issecondary)
 
        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;
index 8c81d89f72c355c4281510a50f34357da2d4d74c..dc4f48152e4ebb6d6dc07df6a0af8d49695cb77c 100644 (file)
@@ -262,6 +262,8 @@ void W_Mine_Attack (void)
        W_AttachToShotorg(flash, '5 0 0');
 
        // common properties
+
+       other = mine; MUTATOR_CALLHOOK(EditProjectile);
 }
 
 void spawnfunc_weapon_minelayer (void); // defined in t_items.qc
index 010a0f8b36546ccf7ad18a47b3460349b3d61a18..65442b21b957caa3b667202c422d9add5497e82b 100644 (file)
@@ -200,6 +200,8 @@ void W_Porto_Attack (void)
        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)
index 12f7647e570c9b262373350a20c4260de8238152..c109fc796b68afeb88d1b62d683083bd33062c29 100644 (file)
@@ -367,6 +367,7 @@ void W_Rocket_Attack (void)
        W_AttachToShotorg(flash, '5 0 0');
 
        // common properties
+       other = missile; MUTATOR_CALLHOOK(EditProjectile);
 }
 
 void spawnfunc_weapon_rocketlauncher (void); // defined in t_items.qc
index c91e4f40869ff7fb11e74a8cd9f514422c31b790..08b1a678269e3b88c8aa1a106a108f35c7aee022 100644 (file)
@@ -212,6 +212,8 @@ void Seeker_Fire_Missile(vector f_diff)
        missile.angles = vectoangles (missile.velocity);
 
        CSQCProjectile(missile, FALSE, PROJECTILE_SEEKER, TRUE);
+
+       other = missile; MUTATOR_CALLHOOK(EditProjectile);
 }
 
 void Seeker_Vollycontroler_Think()
@@ -351,6 +353,8 @@ void Seeker_Fire_Tag()
        missile.angles = vectoangles (missile.velocity);
 
        CSQCProjectile(missile, TRUE, PROJECTILE_TAG, FALSE); // has sound
+
+       other = missile; MUTATOR_CALLHOOK(EditProjectile);
 }
 
 
@@ -424,6 +428,8 @@ void Seeker_Fire_Flac()
        missile.flags = FL_PROJECTILE;
 
        CSQCProjectile(missile, TRUE, PROJECTILE_FLAC, TRUE);
+
+       other = missile; MUTATOR_CALLHOOK(EditProjectile);
 }
 
 void spawnfunc_weapon_seeker (void)
index d9197412b98287e9805d0736220ee97bbfc4cfb4..788c9880fe7c4f57df428a9ccc17afbbdc2e7138 100644 (file)
@@ -2,26 +2,49 @@
 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)
@@ -47,20 +70,8 @@ void W_Uzi_Attack (float deathtype)
 
        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)