X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_damage.qc;h=e0e6bb62d2fd12fbbfb76eabfc734e7af8769d36;hb=836bf45aa198f1bb7a4a0fa8bba2ac800d7bd5e9;hp=ac19363cca71453481684233336c8bd6a3a35819;hpb=05c1916e1f78c8233a0eb88b5f619d31ac5c9569;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index ac19363cc..e0e6bb62d 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -33,7 +33,7 @@ void UpdateFrags(entity player, int f) void GiveFrags (entity attacker, entity targ, float f, int deathtype) { // TODO route through PlayerScores instead - if(gameover) return; + if(game_stopped) return; if(f < 0) { @@ -273,8 +273,8 @@ bool frag_centermessage_override(entity attacker, entity targ, int deathtype, in { if(deathtype == DEATH_FIRE.m_id) { - Send_Notification(NOTIF_ONE, attacker, MSG_CHOICE, CHOICE_FRAG_FIRE, targ.netname, kill_count_to_attacker, (IS_BOT_CLIENT(targ) ? -1 : targ.ping)); - Send_Notification(NOTIF_ONE, targ, MSG_CHOICE, CHOICE_FRAGGED_FIRE, attacker.netname, kill_count_to_target, attacker.health, attacker.armorvalue, (IS_BOT_CLIENT(attacker) ? -1 : attacker.ping)); + Send_Notification(NOTIF_ONE, attacker, MSG_CHOICE, CHOICE_FRAG_FIRE, targ.netname, kill_count_to_attacker, (IS_BOT_CLIENT(targ) ? -1 : CS(targ).ping)); + Send_Notification(NOTIF_ONE, targ, MSG_CHOICE, CHOICE_FRAGGED_FIRE, attacker.netname, kill_count_to_target, attacker.health, attacker.armorvalue, (IS_BOT_CLIENT(attacker) ? -1 : CS(attacker).ping)); return true; } @@ -375,6 +375,8 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype) attacker.taunt_soundtime = time + 1; attacker.killcount = attacker.killcount + 1; + attacker.killsound += 1; + #define SPREE_ITEM(counta,countb,center,normal,gentle) \ case counta: \ { \ @@ -415,7 +417,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype) CHOICE_TYPEFRAG, targ.netname, kill_count_to_attacker, - (IS_BOT_CLIENT(targ) ? -1 : targ.ping) + (IS_BOT_CLIENT(targ) ? -1 : CS(targ).ping) ); Send_Notification( NOTIF_ONE, @@ -426,7 +428,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype) kill_count_to_target, attacker.health, attacker.armorvalue, - (IS_BOT_CLIENT(attacker) ? -1 : attacker.ping) + (IS_BOT_CLIENT(attacker) ? -1 : CS(attacker).ping) ); } else if(!frag_centermessage_override(attacker, targ, deathtype, kill_count_to_attacker, kill_count_to_target)) @@ -438,7 +440,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype) CHOICE_FRAG, targ.netname, kill_count_to_attacker, - (IS_BOT_CLIENT(targ) ? -1 : targ.ping) + (IS_BOT_CLIENT(targ) ? -1 : CS(targ).ping) ); Send_Notification( NOTIF_ONE, @@ -449,7 +451,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype) kill_count_to_target, attacker.health, attacker.armorvalue, - (IS_BOT_CLIENT(attacker) ? -1 : attacker.ping) + (IS_BOT_CLIENT(attacker) ? -1 : CS(attacker).ping) ); } @@ -616,30 +618,14 @@ void Unfreeze (entity targ) void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force) { - float mirrordamage; - float mirrorforce; float complainteamdamage = 0; - entity attacker_save; - mirrordamage = 0; - mirrorforce = 0; + float mirrordamage = 0; + float mirrorforce = 0; - if (gameover || targ.killcount == FRAGS_SPECTATOR) + if (game_stopped || targ.killcount == FRAGS_SPECTATOR) return; - damage_targ = targ; - damage_inflictor = inflictor; - damage_attacker = attacker; - attacker_save = attacker; - - if(IS_PLAYER(targ)) - { - for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) - { - .entity weaponentity = weaponentities[slot]; - if(targ.(weaponentity).hook && targ.(weaponentity).hook.aiment == attacker) - RemoveHook(targ.(weaponentity).hook); - } - } + entity attacker_save = attacker; // special rule: gravity bomb does not hit team mates (other than for disconnecting the hook) if(DEATH_ISWEAPON(deathtype, WEP_HOOK) || DEATH_ISWEAPON(deathtype, WEP_TUBA)) @@ -738,11 +724,21 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d } // should this be changed at all? If so, in what way? - MUTATOR_CALLHOOK(PlayerDamage_Calculate, inflictor, attacker, targ, deathtype, damage, mirrordamage, force); + MUTATOR_CALLHOOK(Damage_Calculate, inflictor, attacker, targ, deathtype, damage, mirrordamage, force); damage = M_ARGV(4, float); mirrordamage = M_ARGV(5, float); force = M_ARGV(6, vector); + if(IS_PLAYER(targ) && damage > 0 && attacker) + { + for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) + { + .entity weaponentity = weaponentities[slot]; + if(targ.(weaponentity).hook && targ.(weaponentity).hook.aiment == attacker) + RemoveHook(targ.(weaponentity).hook); + } + } + if(STAT(FROZEN, targ)) if(deathtype != DEATH_HURTTRIGGER.m_id && deathtype != DEATH_TEAMCHANGE.m_id && deathtype != DEATH_AUTOTEAMCHANGE.m_id) { @@ -1029,7 +1025,7 @@ float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector in LOG_INFOF("THROUGHFLOOR: D=%f F=%f max(dD)=1/%f max(dF)=1/%f", finaldmg, vlen(force), mininv_d, mininv_f); - total = 0.25 * pow(max(mininv_f, mininv_d), 2); + total = 0.25 * (max(mininv_f, mininv_d) ** 2); if(autocvar_g_throughfloor_debug) LOG_INFOF(" steps=%f", total);