diff --git a/sources/GUI/NiceInteraction.uc b/sources/GUI/NiceInteraction.uc index 103d2cd..2afc1e1 100644 --- a/sources/GUI/NiceInteraction.uc +++ b/sources/GUI/NiceInteraction.uc @@ -260,6 +260,21 @@ function PostRender(Canvas C) } } + //// Draw quad damage bar + if (nicePawn != none && nicePawn.quadDamageRemaining > 0.0) + { + C.SetDrawColor(255, 255, 255); + barTexture = redBar; + center = C.ClipX * 0.5; + y = C.ClipY * 0.45; + barWidth = C.ClipX * 0.2; + barWidth *= nicePawn.quadDamageRemaining / class'NiceSkillEnforcerBruteA'.default.maximumDamageAdded; + x = center - (barWidth / 2); + C.SetPos(x, y); + Log("DRAWING" @ x @ y @ barWidth); + C.DrawTile(barTexture, barWidth, 32, 0, 0, barTexture.MaterialUSize(), barTexture.MaterialVSize()); + }//native(466) final function DrawTile( material Mat, float XL, float YL, float U, float V, float UL, float VL ); + team = C.ViewPort.Actor.Pawn.PlayerReplicationInfo.Team; //// Draw health still in regen timer healthToGive = ScrnHumanPawn(C.ViewPort.Actor.Pawn).clientHealthToGive; diff --git a/sources/NiceHumanPawn.uc b/sources/NiceHumanPawn.uc index 448e554..9b500a6 100644 --- a/sources/NiceHumanPawn.uc +++ b/sources/NiceHumanPawn.uc @@ -46,10 +46,11 @@ struct InvincExtentions{ var array zedInvExtList; var int headshotStack; var float bruteTimer; +var float quadDamageRemaining; replication{ reliable if(Role == ROLE_Authority) headshotStack, hmgShieldLevel, forcedZedTimeCountDown, maniacTimeout, invincibilityTimer, safeMeleeMisses, ffScale, - currentCalibrationState, calibrationScore, gunslingerTimer; + currentCalibrationState, calibrationScore, gunslingerTimer, quadDamageRemaining; reliable if(Role == ROLE_Authority) ClientChangeWeapon; reliable if(Role < ROLE_AUTHORITY) diff --git a/sources/Perks/Abilities/NiceAbilityManager.uc b/sources/Perks/Abilities/NiceAbilityManager.uc index ad1cff5..4e96c95 100644 --- a/sources/Perks/Abilities/NiceAbilityManager.uc +++ b/sources/Perks/Abilities/NiceAbilityManager.uc @@ -120,28 +120,28 @@ function SetAbilityState(int abilityIndex, EAbilityState newState){ if(abilityIndex < 0 || abilityIndex >= currentAbilitiesAmount) return; currentState = currentAbilities[abilityIndex].myState; if(currentState == newState) - return; + return; if( currentState == ASTATE_ACTIVE && newState == ASTATE_READY - && !currentAbilities[abilityIndex].description.canBeCancelled) - return; + && !currentAbilities[abilityIndex].description.canBeCancelled) + return; currentAbilities[abilityIndex].myState = newState; if(newState == ASTATE_COOLDOWN){ - cooldown = currentAbilities[abilityIndex].description.cooldownLength; - events.static.CallModAbilityCooldown( - currentAbilities[abilityIndex].description.ID, - relatedPlayer, - cooldown - ); - currentAbilities[abilityIndex].cooldown = cooldown; + cooldown = currentAbilities[abilityIndex].description.cooldownLength; + events.static.CallModAbilityCooldown( + currentAbilities[abilityIndex].description.ID, + relatedPlayer, + cooldown + ); + currentAbilities[abilityIndex].cooldown = cooldown; } hackCounter ++; netUpdateTime = level.timeSeconds - 1; // Fire off events if(newState == ASTATE_ACTIVE){ - events.static.CallAbilityActivated( - currentAbilities[abilityIndex].description.ID, - relatedPlayer - ); + events.static.CallAbilityActivated( + currentAbilities[abilityIndex].description.ID, + relatedPlayer + ); } } // Changes ability's cooldown by a given amount. diff --git a/sources/Perks/Enforcer/NiceEnforcerAbilitiesAdapter.uc b/sources/Perks/Enforcer/NiceEnforcerAbilitiesAdapter.uc index 0f5116f..11946da 100644 --- a/sources/Perks/Enforcer/NiceEnforcerAbilitiesAdapter.uc +++ b/sources/Perks/Enforcer/NiceEnforcerAbilitiesAdapter.uc @@ -15,7 +15,6 @@ static function AbilityActivated( NicePlayerController relatedPlayer) { local NiceHumanPawn nicePawn; - local NiceMonster victim; if (relatedPlayer == none) return; nicePawn = NiceHumanPawn(relatedPlayer.pawn); @@ -37,6 +36,23 @@ static function AbilityActivated( { nicePawn.bruteTimer = class'NiceSkillEnforcerBruteA'.default.abilityDuration; + nicePawn.quadDamageRemaining = class'NiceSkillEnforcerBruteA'.default.maximumDamageAdded; + } +} + +static function ModAbilityCooldown( string abilityID, + NicePlayerController relatedPlayer, + out float cooldown) +{ + local NiceHumanPawn nicePawn; + + if (relatedPlayer == none) return; + nicePawn = NiceHumanPawn(relatedPlayer.pawn); + if (nicePawn == none) return; + + if (abilityID == "brute") + { + nicePawn.quadDamageRemaining = 0; } } diff --git a/sources/Perks/Enforcer/NiceVetEnforcer.uc b/sources/Perks/Enforcer/NiceVetEnforcer.uc index 76d120d..c1b8182 100644 --- a/sources/Perks/Enforcer/NiceVetEnforcer.uc +++ b/sources/Perks/Enforcer/NiceVetEnforcer.uc @@ -16,12 +16,15 @@ static function array GetProgressArray(byte ReqNum, optional out int Double // Other bonuses static function int AddDamage(KFPlayerReplicationInfo KFPRI, KFMonster Injured, KFPawn DamageTaker, int InDamage, class DmgType) { - local float fDamage; + local int bruteAbilityIndex; + local float fDamage, addedDamage; local NicePlayerController nicePlayer; + local NiceHumanPawn nicePawn; local NiceMonster niceTarget; fDamage = float(InDamage); nicePlayer = NicePlayerController(KFPRI.Owner); + nicePawn = NiceHumanPawn(nicePlayer.pawn); niceTarget = NiceMonster(injured); if ( niceTarget != none && niceTarget.bFrozenZed @@ -31,9 +34,20 @@ static function int AddDamage(KFPlayerReplicationInfo KFPRI, KFMonster Injured, (1 + class'NiceSkillEnforcerFinisherRounds'.default.damageBonus); } if( nicePlayer != none && nicePlayer.abilityManager != none + && nicePawn != none && nicePawn.quadDamageRemaining > 0 && nicePlayer.abilityManager.IsAbilityActive(class'NiceSkillEnforcerBruteA'.default.abilityID)) { - fDamage *= class'NiceSkillEnforcerBruteA'.default.damageMult; + addedDamage = fDamage * class'NiceSkillEnforcerBruteA'.default.damageMult - fDamage; + if (addedDamage >= nicePawn.quadDamageRemaining) { + addedDamage = nicePawn.quadDamageRemaining; + nicePawn.quadDamageRemaining = 0.0; + bruteAbilityIndex = nicePlayer.abilityManager.GetAbilityIndex(class'NiceSkillEnforcerBruteA'.default.abilityID); + nicePlayer.abilityManager.SetAbilityState(bruteAbilityIndex, ASTATE_COOLDOWN); + } + else { + nicePawn.quadDamageRemaining -= addedDamage; + } + fDamage += addedDamage; } return int(fDamage); } @@ -45,7 +59,7 @@ static function float GetPenetrationDamageMulti(KFPlayerReplicationInfo KFPRI, f return DefaultPenDamageReduction; if(HasSkill(NicePlayerController(KFPRI.Owner), class'NiceSkillSupportStubbornness')) bonusReduction = class'NiceSkillSupportStubbornness'.default.penLossRed; - PenDamageInverse = (1.0 - FMax(0, DefaultPenDamageReduction)); + PenDamageInverse = (1.0 - FMax(0, DefaultPenDamageReduction)); return DefaultPenDamageReduction + PenDamageInverse * (0.6 + 0.4 * bonusReduction); // 60% better penetrations + bonus } @@ -64,15 +78,6 @@ static function class GetNadeType(KFPlayerReplicationInfo KFPRI){ return class'NiceCryoNade'; } -static function float AddExtraAmmoFor(KFPlayerReplicationInfo KFPRI, Class AmmoType){ - local float bonusNades; - // Default bonus - bonusNades = 2; - if(AmmoType == class'FragAmmo') - return 1.0 + 0.2 * bonusNades; - return 1.0; -} - static function int ReduceDamage(KFPlayerReplicationInfo KFPRI, KFPawn Injured, Pawn Instigator, int InDamage, class DmgType){ local float fDamage; fDamage = float(inDamage); diff --git a/sources/Perks/Enforcer/Skills/NiceSkillEnforcerBruteA.uc b/sources/Perks/Enforcer/Skills/NiceSkillEnforcerBruteA.uc index 8bf9399..e7a87df 100644 --- a/sources/Perks/Enforcer/Skills/NiceSkillEnforcerBruteA.uc +++ b/sources/Perks/Enforcer/Skills/NiceSkillEnforcerBruteA.uc @@ -5,6 +5,7 @@ var string abilityID; var float coolDown; var float abilityDuration; var float damageMult; +var float maximumDamageAdded; function static SkillSelected(NicePlayerController nicePlayer) { @@ -29,6 +30,7 @@ function static SkillDeSelected(NicePlayerController nicePlayer) defaultproperties { + maximumDamageAdded=10000 abilityID="brute" cooldown=60.000000 abilityDuration=5.0