]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote branch 'origin/master' into samual/keepaway
authorunknown <samual@xonotic.org>
Fri, 19 Nov 2010 22:51:58 +0000 (17:51 -0500)
committerunknown <samual@xonotic.org>
Fri, 19 Nov 2010 22:51:58 +0000 (17:51 -0500)
defaultXonotic.cfg
qcsrc/client/View.qc
qcsrc/client/autocvars.qh
qcsrc/server/assault.qc
qcsrc/server/extensions.qh
qcsrc/server/w_common.qc
qcsrc/server/w_crylink.qc

index b34987718c412964d610b2ad9bf1027dd1eff9eb..d2a47a09eca48dd42d346e3892ea60122bf1f2a6 100644 (file)
@@ -1391,15 +1391,17 @@ seta hud_showbinds 1    "the way to show the keys to press in HUD messages: 0 displ
 seta hud_showbinds_limit 2     "maximum number of bound keys to show for a command. 0 for unlimited"
 
 seta hud_damage 1 "an improved version of gl_polyblend, draw an image instead when hurt"
+seta hud_damage_gentle_alpha_multiplier 0.25 "how much to multiply alpha of flash when using the cl_gentle version, it's much more opaque than the non-gentle version"
+seta hud_damage_gentle_color "1 0.7 1" "color of flash for cl_gentle version"
 seta hud_damage_color "1 0 0" "color of flash"
-seta hud_damage_factor 0.05 "(damage * factor) = how much to add to the alpha value"
+seta hud_damage_factor 0.025 "(damage * factor) = how much to add to the alpha value"
 seta hud_damage_fade_rate 1 "how much to subtract from the alpha value each second"
 seta hud_damage_maxalpha 2 "how much to limit the alpha value to"
-seta hud_damage_pain_treshold 0.1 "how much alpha to ignore (must be bigger than the hud_damage_factor so that e.g. rot is ignored)"
-seta hud_damage_pain_treshold_lower 1 "how much we lower pain_treshold with when nearing 0 health (if pain_treshold gets negative then we always draw a flash at alpha = fabs(pain_treshold)"
-seta hud_damage_pain_treshold_lower_health 50 "at which health we start lowering pain_treshold"
-seta hud_damage_pain_treshold_pulsating_min 0.6 "minimum value when calculating the pulse: max(pulsating_min, fabs(sin(PI * time / period))"
-seta hud_damage_pain_treshold_pulsating_period 0.8 "one pulse every X seconds"
+seta hud_damage_pain_threshold 0.1 "how much alpha to ignore (must be bigger than the hud_damage_factor so that e.g. rot is ignored)"
+seta hud_damage_pain_threshold_lower 1.25 "how much we lower pain_threshold with when nearing 0 health (if pain_threshold gets negative then we always draw a flash at alpha = fabs(pain_threshold)"
+seta hud_damage_pain_threshold_lower_health 50 "at which health we start lowering pain_threshold"
+seta hud_damage_pain_threshold_pulsating_min 0.6 "minimum value when calculating the pulse: max(pulsating_min, fabs(sin(PI * time / period))"
+seta hud_damage_pain_threshold_pulsating_period 0.8 "one pulse every X seconds"
 
 // scoreboard
 seta scoreboard_columns default
@@ -1705,6 +1707,7 @@ seta sv_gentle 0          "force gentle mode for everyone, also remove references to act
 seta cl_gentle 0               "client side gentle mode, master switch for removing both gibs and messages"
 seta cl_gentle_gibs 0          "client side gentle mode (only replaces gibs); when set to 1, white smoke replaces gibs, when set to 2, colorful clouds replace gibs"
 seta cl_gentle_messages 0      "client side gentle mode (only replaces frag messages/centerprints)"
+seta cl_gentle_damage 0                "client side gentle mode (only replaces damage flash); when set to 1, a white flash replaces the blood image, when set to 2, a randomily colored flash is used instead"
 
 seta cl_racetimer_position 0.25 "Y-axis positioning of the race timer (from 0 to 1)"
 seta cl_showpressedkeys        0       "Show which movement keys someone is pressing: 1 for spectating, 2 for always"
index e417ddbed9d136ba018547a368ca78afa6d57803..82a45b7138f707cac89ca81e89054827505b6bbf 100644 (file)
@@ -355,6 +355,8 @@ float use_nex_charge_pool;
 float myhealth, myhealth_prev;
 float myhealth_flash;
 
+vector myhealth_gentlergb;
+
 void CSQC_UpdateView(float w, float h)
 {
        entity e;
@@ -665,6 +667,7 @@ void CSQC_UpdateView(float w, float h)
        }
 
        // improved polyblend
+       vector rgb;
        if(cvar("hud_damage"))
        {
                float myhealth_flash_temp;
@@ -675,17 +678,17 @@ void CSQC_UpdateView(float w, float h)
                // add new damage
                myhealth_flash = bound(0, myhealth_flash + max(0, myhealth_prev - myhealth) * cvar("hud_damage_factor"), cvar("hud_damage_maxalpha"));
 
-               float pain_treshold, pain_treshold_lower, pain_treshold_lower_health;
-               pain_treshold = cvar("hud_damage_pain_treshold");
-               pain_treshold_lower = cvar("hud_damage_pain_treshold_lower");
-               pain_treshold_lower_health = cvar("hud_damage_pain_treshold_lower_health");
+               float pain_threshold, pain_threshold_lower, pain_threshold_lower_health;
+               pain_threshold = cvar("hud_damage_pain_threshold");
+               pain_threshold_lower = cvar("hud_damage_pain_threshold_lower");
+               pain_threshold_lower_health = cvar("hud_damage_pain_threshold_lower_health");
 
-               if(pain_treshold_lower && myhealth < pain_treshold_lower_health)
+               if(pain_threshold_lower && myhealth < pain_threshold_lower_health)
                {
-                       pain_treshold = pain_treshold - max(cvar("hud_damage_pain_treshold_pulsating_min"), fabs(sin(M_PI * time / cvar("hud_damage_pain_treshold_pulsating_period")))) * pain_treshold_lower * (1 - max(0, myhealth)/pain_treshold_lower_health);
+                       pain_threshold = pain_threshold - max(cvar("hud_damage_pain_threshold_pulsating_min"), fabs(sin(M_PI * time / cvar("hud_damage_pain_threshold_pulsating_period")))) * pain_threshold_lower * (1 - max(0, myhealth)/pain_threshold_lower_health);
                }
 
-               myhealth_flash_temp = bound(0, myhealth_flash - pain_treshold, 1);
+               myhealth_flash_temp = bound(0, myhealth_flash - pain_threshold, 1);
 
                if(myhealth_prev < 1)
                {
@@ -708,7 +711,22 @@ void CSQC_UpdateView(float w, float h)
 
                myhealth_prev = myhealth;
 
-               drawpic(reticle_pos, "gfx/blood", reticle_size, stov(cvar_string("hud_damage_color")), bound(0, myhealth_flash_temp, 1), DRAWFLAG_NORMAL);
+               if(autocvar_cl_gentle_damage || cvar("cl_gentle"))
+               {
+                       if(autocvar_cl_gentle_damage == 2)
+                       {
+                               if(myhealth_flash < pain_threshold) // only randomize when the flash is gone
+                               {
+                                       myhealth_gentlergb = eX * random() + eY * random() + eZ * random();
+                               }
+                       }
+                       else
+                               myhealth_gentlergb = stov(cvar_string("hud_damage_gentle_color"));
+
+                       drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, myhealth_gentlergb, cvar("hud_damage_gentle_alpha_multiplier") * bound(0, myhealth_flash_temp, 1), DRAWFLAG_NORMAL);
+               }
+               else
+                       drawpic(reticle_pos, "gfx/blood", reticle_size, stov(cvar_string("hud_damage_color")), bound(0, myhealth_flash_temp, 1), DRAWFLAG_NORMAL);
        }
 
        // Draw the mouse cursor
@@ -922,7 +940,6 @@ void CSQC_UpdateView(float w, float h)
                        }
                        else if (activeweapon == WEP_NEX && nex_charge) // ring around crosshair representing velocity-dependent damage for the nex
                        {
-                               vector rgb;
                                if(nex_charge_pool || use_nex_charge_pool)
                                {
                                        use_nex_charge_pool = 1;
index 28340719323309f095a63751e6c9e423332151fa..873df14a358e435d0b68d3e8e0634028575b6f94 100644 (file)
@@ -6,6 +6,8 @@ var float autocvar_cl_gibs_sloppy = 1;
 var float autocvar_cl_casings_ticrate = 0.1;
 var float autocvar_cl_casings_sloppy = 1;
 
+var float autocvar_cl_gentle_damage;
+
 var float autocvar_scoreboard_color_bg_team;
 
 var float autocvar__menu_alpha;
index d7ea87d33211d9799b9fbef9ed45bf1139676a15..3575d563293d4d6c20261bc5b7e4606ca576142e 100644 (file)
@@ -251,31 +251,30 @@ void assault_roundstart_use() {
        activator = self;
        SUB_UseTargets();
 
-       /*
+       
 #ifdef TTURRETS_ENABLED
-entity ent,oldself;
+       entity ent, oldself;
 
        //(Re)spawn all turrets
        oldself = self;
        ent = find(world, classname, "turret_main");
        while(ent) {
-       // Swap turret teams
-       if(ent.team == COLOR_TEAM1)
-       ent.team = COLOR_TEAM2;
-       else
-       ent.team = COLOR_TEAM1;
+               // Swap turret teams
+               if(ent.team == COLOR_TEAM1)
+                       ent.team = COLOR_TEAM2;
+               else
+                       ent.team = COLOR_TEAM1;
 
-       self = ent;
+               self = ent;
 
-       // Dubbles as teamchange
-       turret_stdproc_respawn();
-       //ent.turret_spawnfunc();
+               // Dubbles as teamchange
+               turret_stdproc_respawn();
 
-       ent = find(ent, classname, "turret_main");
+               ent = find(ent, classname, "turret_main");
        }
        self = oldself;
 #endif
-*/
+
 
 }
 
index b72a0500013dc8402a8257d8febd4baef1bd6f75..feb60217aa050b7d441dd5f897501e4cbd552f20 100644 (file)
@@ -1806,14 +1806,14 @@ float Q3SURFACEFLAG_LADDER = 8; // climbable surface
 float Q3SURFACEFLAG_NOIMPACT = 16; // projectiles should remove themselves on impact (this is set on sky)
 float Q3SURFACEFLAG_NOMARKS = 32; // projectiles should not leave marks, such as decals (this is set on sky)
 float Q3SURFACEFLAG_FLESH = 64; // projectiles should do a fleshy effect (blood?) on impact
-//float Q3SURFACEFLAG_NODRAW = 128; // compiler hint (not important to qc)
+float Q3SURFACEFLAG_NODRAW = 128; // compiler hint (not important to qc)
 //float Q3SURFACEFLAG_HINT = 256; // compiler hint (not important to qc)
 //float Q3SURFACEFLAG_SKIP = 512; // compiler hint (not important to qc)
 //float Q3SURFACEFLAG_NOLIGHTMAP = 1024; // compiler hint (not important to qc)
 //float Q3SURFACEFLAG_POINTLIGHT = 2048; // compiler hint (not important to qc)
 float Q3SURFACEFLAG_METALSTEPS = 4096; // walking on this surface should make metal step sounds
 float Q3SURFACEFLAG_NOSTEPS = 8192; // walking on this surface should not make footstep sounds
-//float Q3SURFACEFLAG_NONSOLID = 16384; // compiler hint (not important to qc)
+float Q3SURFACEFLAG_NONSOLID = 16384; // compiler hint (not important to qc)
 //float Q3SURFACEFLAG_LIGHTFILTER = 32768; // compiler hint (not important to qc)
 //float Q3SURFACEFLAG_ALPHASHADOW = 65536; // compiler hint (not important to qc)
 //float Q3SURFACEFLAG_NODLIGHT = 131072; // compiler hint (not important to qc)
index 3995a48151e4fe590947ecf993c1b9acdeaa660c..320ffb7507e6173714af897ba43ab4ed917316bb 100644 (file)
@@ -310,6 +310,26 @@ void W_BallisticBullet_Touch (void)
        PROJECTILE_TOUCH;
        W_BallisticBullet_Hit ();
 
+       // if we hit "weapclip", bail out
+       //
+       // rationale of this check:
+       //
+       // any shader that is solid, nodraw AND trans is meant to clip weapon
+       // shots and players, but has no other effect!
+       //
+       // if it is not trans, it is caulk and should not have this side effect
+       //
+       // matching shaders:
+       //   common/weapclip (intended)
+       //   common/noimpact (is supposed to eat projectiles, but is erased farther above)
+       if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NODRAW)
+       if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NONSOLID)
+       if not(trace_dphitcontents & DPCONTENTS_OPAQUE)
+       {
+               remove(self);
+               return;
+       }
+
        density = other.ballistics_density;
        if(density == 0)
                density = 1;
index 07100c7784966e13e672a250b55dbb1dde0708d5..b688a9f7f5d7a04e264550d900edfce7dc1d624b 100644 (file)
@@ -39,6 +39,27 @@ void W_Crylink_LinkExplode (entity e, entity e2)
        remove (e);
 }
 
+void W_Crylink_CheckLinks(entity e)
+{
+       float i;
+       entity p;
+
+       if(e == world)
+               error("W_Crylink_CheckLinks: entity is world");
+
+       p = e;
+       for(i = 0; i < 1000; ++i)
+       {
+               if(p.queuenext.queueprev != p || p.queueprev.queuenext != p)
+                       error("W_Crylink_CheckLinks: queue is inconsistent");
+               p = p.queuenext;
+               if(p == e)
+                       break;
+       }
+       if(i >= 1000)
+               error("W_Crylink_CheckLinks: infinite chain");
+}
+
 // adjust towards center
 // returns the origin where they will meet... and the time till the meeting is
 // stored in w_crylink_linkjoin_time.
@@ -54,6 +75,9 @@ vector W_Crylink_LinkJoin(entity e, float jspeed, float jtime)
        float avg_dist, n;
        entity p;
 
+       // FIXME remove this debug code
+       W_Crylink_CheckLinks(e);
+
        w_crylink_linkjoin_time = 0;
 
        avg_origin = e.origin;