From 45d331ab098f696766ebc721e473f553c067f923 Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Sun, 23 Jan 2022 17:08:46 +0400 Subject: [PATCH] shut meanrepinfo / removes bleed on heal fix --- sources/GUI/NiceInteraction.uc | 4 +- sources/NicePlayerController.uc | 8 +-- sources/NiceReplicationInfo.uc | 12 ++--- sources/Zeds/MeanReplicationInfo.uc | 84 ++--------------------------- 4 files changed, 10 insertions(+), 98 deletions(-) diff --git a/sources/GUI/NiceInteraction.uc b/sources/GUI/NiceInteraction.uc index ceb5312..c9d5f9d 100644 --- a/sources/GUI/NiceInteraction.uc +++ b/sources/GUI/NiceInteraction.uc @@ -49,12 +49,12 @@ final private function bool bIsBleeding(ScrnHumanPawn pwn) return false; } -function PostRender(Canvas C){ +function PostRender(Canvas C) +{ local int i; local NicePack niceMutator; local NiceHumanPawn nicePawn; local class niceVet; - local MeanReplicationInfo szRI; local NiceWeapon niceWeap; local NicePlayerController nicePlayer; local ScrnHUD scrnHUDInstance; diff --git a/sources/NicePlayerController.uc b/sources/NicePlayerController.uc index bc7d74f..7b67034 100644 --- a/sources/NicePlayerController.uc +++ b/sources/NicePlayerController.uc @@ -405,12 +405,12 @@ simulated event Destroyed(){ // Screw that simulated function ClientWeaponDestroyed(class WClass){} // This event is generated when new pawn spawns -function PawnSpawned(){ +function PawnSpawned() +{ local bool bFoundExp; local float convertedExp; local ClientPerkRepLink R; local SRCustomProgress exp; - local MeanReplicationInfo meanRI; local NicePack.PlayerRecord record; //local NiceHumanPawn nicePawn; // Make sure our health is at it's top @@ -498,10 +498,6 @@ function PawnSpawned(){ exp.IncrementProgress(convertedExp); } } - // Stop after-death bleeding - meanRI = class'MeanReplicationInfo'.static.findSZri(PlayerReplicationInfo); - if(meanRI != none) - meanRI.stopBleeding(); // Give necessary dosh to the player if(NicePackMutator != none) NicePackMutator.GiveProgressiveDosh(self); diff --git a/sources/NiceReplicationInfo.uc b/sources/NiceReplicationInfo.uc index 9a07d35..ad3c131 100644 --- a/sources/NiceReplicationInfo.uc +++ b/sources/NiceReplicationInfo.uc @@ -185,25 +185,19 @@ simulated function HandleNiceHealingMechanicsAndSkills simulated function RemovePoisonAndBleed(NiceHumanPawn healed) { - local Inventory I; - local MeanReplicationInfo MRI; + local Inventory I; // log spam fix if (healed == none) return; - // No bleeding - MRI = class'MeanReplicationInfo'.static. - findSZri(healed.PlayerReplicationInfo); - if (MRI != none) - MRI.stopBleeding(); - // No poison + // No poison and bleed if (healed.inventory == none) return; for (I = healed.inventory; I != none; I = I.inventory) { - if (MeanPoisonInventory(I) != none) + if (MeanPoisonInventory(I) != none || MeanBleedInventory(I) != none) I.Destroy(); } } diff --git a/sources/Zeds/MeanReplicationInfo.uc b/sources/Zeds/MeanReplicationInfo.uc index a6684a5..d25c2c7 100644 --- a/sources/Zeds/MeanReplicationInfo.uc +++ b/sources/Zeds/MeanReplicationInfo.uc @@ -1,82 +1,4 @@ -// Copy pasted from super zombies mutator with small alterations +// no use atm class MeanReplicationInfo extends ReplicationInfo; -struct BleedingState { - var float nextBleedTime; - var Pawn instigator; - var int count; -}; -var PlayerReplicationInfo ownerPRI; -var bool isBleeding; -var int maxBleedCount; -var BleedingState bleedState; -var float bleedPeriod; -var float bleedLevel; -replication { - reliable if (bNetDirty && Role == ROLE_Authority) - isBleeding, ownerPRI; -} -// Returns bleed damage, corresponding to given bleed level and damage scale. -// Rand(7) should be used as a scale. -// Separate function created to allow for lowest/highest damage value computing. -function int calcBleedDamage(float level, int scale){ - return level * (3 + scale); -} -function Tick(float DeltaTime) { - local PlayerController ownerCtrllr; - local bool amAlive; - local float bleedDamage; - ownerCtrllr = PlayerController(Owner); - amAlive = ownerCtrllr != none && ownerCtrllr.Pawn != none && ownerCtrllr.Pawn.Health > 0; - if(amAlive && bleedState.count > 0) { - if(bleedState.nextBleedTime < Level.TimeSeconds) { - bleedState.count--; - bleedState.nextBleedTime+= bleedPeriod; - // Fix bleeding when stalker dies - bleedDamage = calcBleedDamage(bleedLevel, rand(7)); - if(bleedDamage < 1.0) - stopBleeding(); - if(bleedState.instigator != none) - ownerCtrllr.Pawn.TakeDamage(bleedDamage, bleedState.instigator, ownerCtrllr.Pawn.Location, - vect(0, 0, 0), class'NiceDamTypeStalkerBleed'); - else - ownerCtrllr.Pawn.TakeDamage(bleedDamage, ownerCtrllr.Pawn, ownerCtrllr.Pawn.Location, - vect(0, 0, 0), class'NiceDamTypeStalkerBleed'); - if (ownerCtrllr.Pawn.isA('KFPawn')) { - KFPawn(ownerCtrllr.Pawn).HealthToGive -= 2 * bleedLevel; - } - } - } else { - isBleeding= false; - } -} -function stopBleeding(){ - isBleeding = false; - bleedState.count = 0; -} -function setBleeding(Pawn instigator, float effectStrenght) { - // Can max possible damage do anything? If no, then don't even bother. - if(calcBleedDamage(effectStrenght, 7) < 1.0) - return; - bleedState.instigator = instigator; - bleedState.count = maxBleedCount; - bleedLevel = effectStrenght; - if(!isBleeding){ - bleedState.nextBleedTime = Level.TimeSeconds; - isBleeding = true; - } -} -static function MeanReplicationInfo findSZri(PlayerReplicationInfo pri) { - local MeanReplicationInfo repInfo; - if(pri == none) - return none; - foreach pri.DynamicActors(Class'MeanReplicationInfo', repInfo) - if(repInfo.ownerPRI == pri) - return repInfo; - - return none; -} -defaultproperties -{ - maxBleedCount=7 - bleedPeriod=1.500000 -} + +defaultproperties{} \ No newline at end of file