Browse Source

Remove useless health component code

Siren's adjustemet code made cahgnes that were soon overwritten without
accomplishing anything. And husk code has some player replication info
obtaining code that is leftover from trying to restore perk resistances
that... didn't actually break from damage type substitution.
pull/8/head
Anton Tarasenko 2 years ago
parent
commit
2326c3d430
  1. 47
      sources/Gameplay/KF1Frontend/Health/KF1_HealthComponent.uc

47
sources/Gameplay/KF1Frontend/Health/KF1_HealthComponent.uc

@ -104,51 +104,13 @@ private function int OnNetDamageHandler(
Vector hitLocation, Vector hitLocation,
out Vector momentum, out Vector momentum,
class<DamageType> damageType) class<DamageType> damageType)
{
if (damageType == class'Dummy_DamTypeVomit') {
damage = ReapplyNativeBileAdjustments(originalDamage, damage, injured);
}
if (damageType == class'Dummy_SirenScreamDamage') {
damage = ReapplyNativeScreamAdjustments(damage, injured, hitLocation);
}
return damage;
}
private function int ReapplyNativeBileAdjustments(
int originalDamage,
int damage,
Pawn injured)
{ {
local KFPlayerReplicationInfo kfPRI; local KFPlayerReplicationInfo kfPRI;
if (ZombieBloatBase(injured) != none) { if (damageType != class'Dummy_DamTypeVomit') return damage;
return 0; if (ZombieBloatBase(injured) != none) return 0;
} if (ZombieFleshpoundBase(injured) != none) return 0;
if (ZombieFleshpoundBase(injured) != none) {
return 0;
}
if (injured != none && injured.controller != none)
{
kfPRI = KFPlayerReplicationInfo(
injured.controller.playerReplicationInfo);
}
return damage;
}
private function int ReapplyNativeScreamAdjustments(
int damage,
Pawn injured,
Vector hitLocation)
{
local KFPawn injuredPawn;
injuredPawn = KFPawn(injured);
if (injuredPawn != none)
{
// TODO: `PlayHit()` is not informed about siren's damage!!!
// TODO: Neither are bloody projectiles!
injuredPawn.lastHitDamType = class'SirenScreamDamage';
}
return damage; return damage;
} }
@ -160,6 +122,9 @@ private function UpdateBileAchievement(Controller killer, Controller killed)
local KFSteamStatsAndAchievements kfSteamStats; local KFSteamStatsAndAchievements kfSteamStats;
local array<ConnectionService.Connection> activeConnections; local array<ConnectionService.Connection> activeConnections;
// `GameInfo` checks that `killed != none`, but between that and this point
// a lot of things can change, so don't count on it and check
if (killed == none) return;
killedMonster = KFMonster(killed.pawn); killedMonster = KFMonster(killed.pawn);
if (killedMonster == none) return; if (killedMonster == none) return;
if (killedMonster.lastDamagedByType != class'Dummy_DamTypeVomit') return; if (killedMonster.lastDamagedByType != class'Dummy_DamTypeVomit') return;

Loading…
Cancel
Save