]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote branches 'origin/fruitiex/hud_damage-dmg_take' and 'origin/divVerent...
authorRudolf Polzer <divverent@alientrap.org>
Tue, 21 Dec 2010 06:17:23 +0000 (07:17 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 21 Dec 2010 06:17:23 +0000 (07:17 +0100)
defaultXonotic.cfg
qcsrc/client/Defs.qc
qcsrc/client/View.qc
qcsrc/menu/xonotic/dialog_multiplayer_create_advanced.c
qcsrc/server/autocvars.qh
qcsrc/server/g_damage.qc

index 4155fa94320be12356efb127081259b612310edf..b26988d104151468400ad93652cebc17fc7eeeee 100644 (file)
@@ -638,10 +638,12 @@ seta timelimit_suddendeath 5 "number of minutes suddendeath mode lasts after all
 set g_tdm 0 "Team Deathmatch: the team who kills their opponents most often wins"
 
 seta teamplay_mode 4 "default teamplay setting in team games. 1 = no friendly fire, self damage. 2 = friendly fire and self damage enabled. 3 = no friendly fire, but self damage enabled. 4 = obey the following four cvars"
-seta g_mirrordamage 0.300000   "for teamplay 4: mirror damage factor"
-seta g_friendlyfire 0.100000   "for teamplay 4: fiendly fire factor"
-seta g_teamdamage_threshold 50 "for teamplay 4: threshold over which to apply mirror damage"
-seta g_teamdamage_resetspeed 30        "for teamplay 4: how fast player's teamdamage count decreases"
+seta g_mirrordamage 0.700000   "for teamplay 4: mirror damage factor"
+seta g_mirrordamage_virtual 1  "for teamplay 4: do not actually apply mirror damage, just show graphics effect for it"
+seta g_friendlyfire 0.500000   "for teamplay 4: fiendly fire factor"
+seta g_friendlyfire_virtual 1  "for teamplay 4: do not actually apply friendly fire, just show graphics effect for it"
+seta g_teamdamage_threshold 40 "for teamplay 4: threshold over which to apply mirror damage"
+seta g_teamdamage_resetspeed 20        "for teamplay 4: how fast player's teamdamage count decreases"
 
 set deathmatch_force_teamplay 0        "Always play TDM instead of DM"
 seta g_balance_teams 0 "automatically balance out players entering instead of asking them for their preferred team"
@@ -1425,8 +1427,8 @@ seta hud_damage_gentle_alpha_multiplier 0.25 "how much to multiply alpha of flas
 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.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_fade_rate 0.75 "how much to subtract from the alpha value each second"
+seta hud_damage_maxalpha 1.5 "how much to limit the alpha value to"
 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"
index 2d780381eedced49f15c67549f6455c535ae3a67..88f0a51b0673e17f6984e4b27bf673ad0b5f3a5b 100644 (file)
@@ -156,7 +156,7 @@ float               scoreboard_showaccuracy;
 // float               coop;
 // float               deathmatch;
 
-// float               dmg_take;
+float          dmg_take;
 // float               dmg_save;
 // vector              dmg_origin;
 
index 908e6dbf17fbc63b9cff14daa7e4d7f49d0866da..121488d57d1225313c23a92601e27a15bf89b4fb 100644 (file)
@@ -676,7 +676,7 @@ void CSQC_UpdateView(float w, float h)
                // fade out
                myhealth_flash = max(0, myhealth_flash - autocvar_hud_damage_fade_rate * frametime);
                // add new damage
-               myhealth_flash = bound(0, myhealth_flash + max(0, myhealth_prev - myhealth) * autocvar_hud_damage_factor, autocvar_hud_damage_maxalpha);
+               myhealth_flash = bound(0, myhealth_flash + dmg_take * autocvar_hud_damage_factor, autocvar_hud_damage_maxalpha);
 
                float pain_threshold, pain_threshold_lower, pain_threshold_lower_health;
                pain_threshold = autocvar_hud_damage_pain_threshold;
index 647f6afbaac36dd25b4ee2b7b16da136d1a4b996..87f82a43d16bc5d392148a4ec8688c3cd128dd4e 100644 (file)
@@ -6,7 +6,7 @@ CLASS(XonoticAdvancedDialog) EXTENDS(XonoticDialog)
        ATTRIB(XonoticAdvancedDialog, title, string, "Advanced server settings")
        ATTRIB(XonoticAdvancedDialog, color, vector, SKINCOLOR_DIALOG_ADVANCED)
        ATTRIB(XonoticAdvancedDialog, intendedWidth, float, 0.5)
-       ATTRIB(XonoticAdvancedDialog, rows, float, 12)
+       ATTRIB(XonoticAdvancedDialog, rows, float, 14)
        ATTRIB(XonoticAdvancedDialog, columns, float, 3)
        ATTRIB(XonoticAdvancedDialog, refilterEntity, entity, NULL)
 ENDCLASS(XonoticAdvancedDialog)
@@ -42,10 +42,16 @@ void XonoticAdvancedDialog_fill(entity me)
                me.TDempty(me, 0.2);
                me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Friendly fire scale:"));
                me.TD(me, 1, 1.6, e = makeXonoticSlider(0, 1.0, 0.05, "g_friendlyfire"));
+       me.TR(me);
+               me.TDempty(me, 0.4);
+               me.TD(me, 1, 2.6, e = makeXonoticCheckBox(0, "g_friendlyfire_virtual", "Virtual friendly fire (effect only)"));
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Friendly fire penalty:"));
                me.TD(me, 1, 1.6, e = makeXonoticSlider(0, 1.0, 0.05, "g_mirrordamage"));
+       me.TR(me);
+               me.TDempty(me, 0.4);
+               me.TD(me, 1, 2.6, e = makeXonoticCheckBox(0, "g_mirrordamage_virtual", "Virtual penalty (effect only)"));
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Teams:"));
index c5beab269911b3a761d0bd7fa9785b870a12bc32..12731fd7395de6026e50c84b9f04d30c76f5b011 100644 (file)
@@ -789,7 +789,9 @@ float autocvar_g_midair_shieldtime;
 float autocvar_g_minstagib_ammo_drop;
 float autocvar_g_minstagib_extralives;
 float autocvar_g_minstagib_speed_highspeed;
+float autocvar_g_mirrordamage;
 #define autocvar_g_mirrordamage cvar("g_mirrordamage")
+#define autocvar_g_mirrordamage_virtual cvar("g_mirrordamage_virtual")
 float autocvar_g_monster_zombie_attack_run_damage;
 float autocvar_g_monster_zombie_attack_run_delay;
 float autocvar_g_monster_zombie_attack_run_force;
index 0d0c90d0d829b227da455fe0eabe28c439193375..2ad648e5d7e429c6efefaeff83f81029a0f9579f 100644 (file)
@@ -582,6 +582,28 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                                        else
                                                                damage = autocvar_g_friendlyfire * damage;
                                                        // mirrordamage will be used LATER
+
+                                                       if(autocvar_g_mirrordamage_virtual)
+                                                       {
+                                                               vector v;
+                                                               v = healtharmor_applydamage(attacker.armorvalue, autocvar_g_balance_armor_blockpercent, mirrordamage);
+                                                               attacker.dmg_take += v_x;
+                                                               attacker.dmg_save += v_y;
+                                                               attacker.dmg_inflictor = inflictor;
+                                                               mirrordamage = 0;
+                                                               mirrorforce = 0;
+                                                       }
+
+                                                       if(autocvar_g_friendlyfire_virtual)
+                                                       {
+                                                               vector v;
+                                                               v = healtharmor_applydamage(targ.armorvalue, autocvar_g_balance_armor_blockpercent, damage);
+                                                               targ.dmg_take += v_x;
+                                                               targ.dmg_save += v_y;
+                                                               targ.dmg_inflictor = inflictor;
+                                                               damage = 0;
+                                                               force = '0 0 0';
+                                                       }
                                                }
                                                else
                                                        damage = 0;
@@ -623,12 +645,11 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                        if (DEATH_ISWEAPON(deathtype, WEP_LASER))
                        {
                                damage = 0;
+                               mirrordamage = 0;
                                if (targ != attacker)
                                {
                                        if ((targ.health >= 1) && (targ.classname == "player"))
                                                centerprint(attacker, strcat(DAMAGE_CENTERPRINT_SPACER, "Secondary fire inflicts no damage!"));
-                                       damage = 0;
-                                       mirrordamage = 0;
                                        force = '0 0 0';
                                        // keep mirrorforce
                                        attacker = targ;
@@ -858,17 +879,18 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
        {
                attacker = attacker_save;
                if(g_minstagib)
-                       if(mirrordamage > 0)
+               if(mirrordamage > 0)
+               {
+                       // just lose extra LIVES, don't kill the player for mirror damage
+                       if(attacker.armorvalue > 0)
                        {
-                               // just lose extra LIVES, don't kill the player for mirror damage
-                               if(attacker.armorvalue > 0)
-                               {
-                                       attacker.armorvalue = attacker.armorvalue - 1;
-                                       centerprint(attacker, strcat(DAMAGE_CENTERPRINT_SPACER, "^3Remaining extra lives: ",ftos(attacker.armorvalue)));
-                                       attacker.hitsound += 1;
-                               }
-                               mirrordamage = 0;
+                               attacker.armorvalue = attacker.armorvalue - 1;
+                               centerprint(attacker, strcat(DAMAGE_CENTERPRINT_SPACER, "^3Remaining extra lives: ",ftos(attacker.armorvalue)));
+                               attacker.hitsound += 1;
                        }
+                       mirrordamage = 0;
+               }
+
                force = normalize(attacker.origin + attacker.view_ofs - hitloc) * mirrorforce;
                Damage(attacker, inflictor, attacker, mirrordamage, DEATH_MIRRORDAMAGE, attacker.origin, force);
        }