Menus overhaul #14

Merged
dkanus merged 30 commits from :somechanges into master 2022-01-23 22:14:51 +03:00
4 changed files with 10 additions and 98 deletions
Showing only changes of commit 45d331ab09 - Show all commits

View File

@ -49,12 +49,12 @@ final private function bool bIsBleeding(ScrnHumanPawn pwn)
return false; return false;
} }
function PostRender(Canvas C){ function PostRender(Canvas C)
{
local int i; local int i;
local NicePack niceMutator; local NicePack niceMutator;
local NiceHumanPawn nicePawn; local NiceHumanPawn nicePawn;
local class<NiceVeterancyTypes> niceVet; local class<NiceVeterancyTypes> niceVet;
local MeanReplicationInfo szRI;
local NiceWeapon niceWeap; local NiceWeapon niceWeap;
local NicePlayerController nicePlayer; local NicePlayerController nicePlayer;
local ScrnHUD scrnHUDInstance; local ScrnHUD scrnHUDInstance;

View File

@ -405,12 +405,12 @@ simulated event Destroyed(){
// Screw that // Screw that
simulated function ClientWeaponDestroyed(class<Weapon> WClass){} simulated function ClientWeaponDestroyed(class<Weapon> WClass){}
// This event is generated when new pawn spawns // This event is generated when new pawn spawns
function PawnSpawned(){ function PawnSpawned()
{
local bool bFoundExp; local bool bFoundExp;
local float convertedExp; local float convertedExp;
local ClientPerkRepLink R; local ClientPerkRepLink R;
local SRCustomProgress exp; local SRCustomProgress exp;
local MeanReplicationInfo meanRI;
local NicePack.PlayerRecord record; local NicePack.PlayerRecord record;
//local NiceHumanPawn nicePawn; //local NiceHumanPawn nicePawn;
// Make sure our health is at it's top // Make sure our health is at it's top
@ -498,10 +498,6 @@ function PawnSpawned(){
exp.IncrementProgress(convertedExp); exp.IncrementProgress(convertedExp);
} }
} }
// Stop after-death bleeding
meanRI = class'MeanReplicationInfo'.static.findSZri(PlayerReplicationInfo);
if(meanRI != none)
meanRI.stopBleeding();
// Give necessary dosh to the player // Give necessary dosh to the player
if(NicePackMutator != none) if(NicePackMutator != none)
NicePackMutator.GiveProgressiveDosh(self); NicePackMutator.GiveProgressiveDosh(self);

View File

@ -185,25 +185,19 @@ simulated function HandleNiceHealingMechanicsAndSkills
simulated function RemovePoisonAndBleed(NiceHumanPawn healed) simulated function RemovePoisonAndBleed(NiceHumanPawn healed)
{ {
local Inventory I; local Inventory I;
local MeanReplicationInfo MRI;
// log spam fix // log spam fix
if (healed == none) if (healed == none)
return; return;
// No bleeding // No poison and bleed
MRI = class'MeanReplicationInfo'.static.
findSZri(healed.PlayerReplicationInfo);
if (MRI != none)
MRI.stopBleeding();
// No poison
if (healed.inventory == none) if (healed.inventory == none)
return; return;
for (I = healed.inventory; I != none; I = I.inventory) for (I = healed.inventory; I != none; I = I.inventory)
{ {
if (MeanPoisonInventory(I) != none) if (MeanPoisonInventory(I) != none || MeanBleedInventory(I) != none)
I.Destroy(); I.Destroy();
} }
} }

View File

@ -1,82 +1,4 @@
// Copy pasted from super zombies mutator with small alterations // no use atm
class MeanReplicationInfo extends ReplicationInfo; class MeanReplicationInfo extends ReplicationInfo;
struct BleedingState {
var float nextBleedTime; defaultproperties{}
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
}