Remove strict difference between mostly fire and non-fire damage sources

This commit is contained in:
Anton Tarasenko 2024-09-01 17:27:29 +07:00
parent db84dad047
commit 6eb879f0d1

View File

@ -840,7 +840,6 @@ function FireDamageEffects(out int damage,
float headshotLevel, float headshotLevel,
KFPlayerReplicationInfo KFPRI){ KFPlayerReplicationInfo KFPRI){
local float heatDelta, bonusFireDamage; local float heatDelta, bonusFireDamage;
local bool shouldBeSetOnFire, isFireWeapon;
damage = FMax(0.0, damage); damage = FMax(0.0, damage);
iceCrustStrenght = FMax(0.0, iceCrustStrenght); iceCrustStrenght = FMax(0.0, iceCrustStrenght);
if(bFrozenZed){ if(bFrozenZed){
@ -878,15 +877,13 @@ function FireDamageEffects(out int damage,
burnInstigator = instigatedBy; burnInstigator = instigatedBy;
} }
// Double heat damage at the cost of the fuel, if zed is already on fire // Double heat damage at the cost of the fuel, if zed is already on fire
isFireWeapon = (damageType.default.heatPart >= 0.75); if (bOnFire) {
if (bOnFire && isFireWeapon) { bonusFireDamage = FMax(FMin(damage, flameFuel) * 0.25, 0);
bonusFireDamage = FMax(FMin(damage, flameFuel), 0);
flameFuel -= bonusFireDamage; flameFuel -= bonusFireDamage;
damage += bonusFireDamage; damage += bonusFireDamage;
} }
// Set on fire, if necessary // Set on fire, if necessary
shouldBeSetOnFire = (heat > GetIgnitionPoint()) || isFireWeapon; if(heat > GetIgnitionPoint() && !bOnFire && bCanBurn){
if(shouldBeSetOnFire && !bOnFire && bCanBurn){
bBurnified = true; bBurnified = true;
bOnFire = true; bOnFire = true;
burnInstigator = instigatedBy; burnInstigator = instigatedBy;
@ -1007,7 +1004,7 @@ function DealDecapDamage( int damage,
hasSkill(nicePlayer, class'NiceSkillSharpshooterDieAlready')) hasSkill(nicePlayer, class'NiceSkillSharpshooterDieAlready'))
ServerDropFaster(NiceHumanPawn(nicePlayer.pawn)); ServerDropFaster(NiceHumanPawn(nicePlayer.pawn));
} }
function DealHeadDamage( int damage, function DealHeadDamage( int damage,
Pawn instigatedBy, Pawn instigatedBy,
Vector hitLocation, Vector hitLocation,
Vector momentum, Vector momentum,
@ -1026,8 +1023,8 @@ function DealHeadDamage( int damage,
// Skull injury killed a zed // Skull injury killed a zed
if(HeadHealth <= 0) return; if(HeadHealth <= 0) return;
// Additional weakpoint damage to burning zeds from non-flame weapons // Additional weakpoint damage to burning zeds from non-flame weapons
if (bOnFire && damageType.default.heatPart < 0.75) { if (bOnFire) {
damage += 100; damage += 100 * (1 - damageType.default.heatPart);
} }
HeadHealth -= damage; HeadHealth -= damage;
if(nicePlayer != none && IsFinisher(damage, damageType, nicePlayer, true)) if(nicePlayer != none && IsFinisher(damage, damageType, nicePlayer, true))