X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_damage.qc;h=908f9c34fa5ac6a0cae7617b5243d4b5bd69cf69;hb=2bb2db9c0f8016645a23381d7493588d748ecacf;hp=3b7251261dc54ea3fbee04ee792908e6bc1b13a3;hpb=5d91cc9be5e22267a8801a4a634d32b7a58fb060;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 3b7251261..908f9c34f 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -120,10 +120,6 @@ void GiveFrags (entity attacker, entity targ, float f, float deathtype) PlayerScore_Add(targ, SP_DEATHS, 1); - if(g_arena || g_ca) - if(autocvar_g_arena_roundbased) - return; - if(targ != attacker) // not for suicides if(g_weaponarena_random) { @@ -186,24 +182,6 @@ void GiveFrags (entity attacker, entity targ, float f, float deathtype) else { self = oldself; - if(g_lms) - { - // remove a life - float tl; - tl = PlayerScore_Add(targ, SP_LMS_LIVES, -1); - if(tl < lms_lowest_lives) - lms_lowest_lives = tl; - if(tl <= 0) - { - if(!lms_next_place) - lms_next_place = player_count; - else - lms_next_place = min(lms_next_place, player_count); - PlayerScore_Add(targ, SP_LMS_RANK, lms_next_place); // won't ever spawn again - --lms_next_place; - } - f = 0; - } } attacker.totalfrags += f; @@ -376,7 +354,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, float deathtype) string deathlocation = (autocvar_notification_server_allows_location ? NearestLocation(targ.death_origin) : ""); #ifdef NOTIFICATIONS_DEBUG - dprint( + Debug_Notification( sprintf( "Obituary(%s, %s, %s, %s = %d);\n", attacker.netname, @@ -660,12 +638,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float if(complainteamdamage > 0 && !g_ca) // FIXME why is g_ca ruled out here? Why not just g_mirrordamage 0 on CA servers? mirrordamage = autocvar_g_mirrordamage * complainteamdamage; mirrorforce = autocvar_g_mirrordamage * vlen(force); - if(g_minstagib) - { - if(autocvar_g_friendlyfire == 0) - damage = 0; - } - else if(g_ca) + if(g_ca) damage = 0; else damage = autocvar_g_friendlyfire * damage; @@ -699,52 +672,6 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float } } - if(targ.classname == "player") - if(attacker.classname == "player") - if(attacker != targ) - { - targ.lms_traveled_distance = autocvar_g_lms_campcheck_distance; - attacker.lms_traveled_distance = autocvar_g_lms_campcheck_distance; - } - - if(targ.classname == "player") - if (g_minstagib) - { - if ((deathtype == DEATH_FALL) || - (deathtype == DEATH_DROWN) || - (deathtype == DEATH_SLIME) || - (deathtype == DEATH_LAVA) || - (!DEATH_ISWEAPON(deathtype, WEP_LASER) && damage > 0 && damage < 100)) - { - self = oldself; - return; - } - if(damage > 0) - damage = 10000; - if (targ.armorvalue && (deathtype == WEP_MINSTANEX) && damage) - { - targ.armorvalue -= 1; - centerprint(targ, strcat("^3Remaining extra lives: ",ftos(targ.armorvalue))); - damage = 0; - targ.hitsound += 1; - attacker.hitsound += 1; // TODO change this to a future specific hitsound for armor hit - } - if (DEATH_ISWEAPON(deathtype, WEP_LASER)) - { - damage = 0; - mirrordamage = 0; - complainteamdamage = 0; - if (targ != attacker) - { - if ((targ.health >= 1) && (targ.classname == "player")) - centerprint(attacker, "Secondary fire inflicts no damage!"); - force = '0 0 0'; - // keep mirrorforce - attacker = targ; - } - } - } - if not(DEATH_ISSPECIAL(deathtype)) { damage *= g_weapondamagefactor; @@ -760,28 +687,33 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float frag_damage = damage; frag_force = force; frag_deathtype = deathtype; + frag_mirrordamage = mirrordamage; MUTATOR_CALLHOOK(PlayerDamage_Calculate); damage = frag_damage; + mirrordamage = frag_mirrordamage; force = frag_force; - // apply strength multiplier - if ((attacker.items & IT_STRENGTH) && !g_minstagib) + if not(g_minstagib) { - if(targ == attacker) - { - damage = damage * autocvar_g_balance_powerup_strength_selfdamage; - force = force * autocvar_g_balance_powerup_strength_selfforce; - } - else + // apply strength multiplier + if (attacker.items & IT_STRENGTH) { - damage = damage * autocvar_g_balance_powerup_strength_damage; - force = force * autocvar_g_balance_powerup_strength_force; + if(targ == attacker) + { + damage = damage * autocvar_g_balance_powerup_strength_selfdamage; + force = force * autocvar_g_balance_powerup_strength_selfforce; + } + else + { + damage = damage * autocvar_g_balance_powerup_strength_damage; + force = force * autocvar_g_balance_powerup_strength_force; + } } - } - // apply invincibility multiplier - if (targ.items & IT_INVINCIBLE && !g_minstagib) - damage = damage * autocvar_g_balance_powerup_invincible_takedamage; + // apply invincibility multiplier + if (targ.items & IT_INVINCIBLE) + damage = damage * autocvar_g_balance_powerup_invincible_takedamage; + } if (targ == attacker) { @@ -823,13 +755,8 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float if not(DEATH_ISSPECIAL(deathtype)) { if(targ.classname == "player") // don't do this for vehicles - if(!g_minstagib) if(IsFlying(victim)) yoda = 1; - - if(g_minstagib) - if(victim.items & IT_STRENGTH) - yoda = 1; } } } @@ -886,18 +813,6 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float if(mirrordamage > 0 || mirrorforce > 0) { attacker = attacker_save; - if(g_minstagib) - if(mirrordamage > 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("^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);