update16 #35

Merged
NikC- merged 11 commits from update16 into master 2024-11-27 20:00:56 +03:00
6 changed files with 67 additions and 28 deletions
Showing only changes of commit a3f4baabc6 - Show all commits

View File

@ -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; team = C.ViewPort.Actor.Pawn.PlayerReplicationInfo.Team;
//// Draw health still in regen timer //// Draw health still in regen timer
healthToGive = ScrnHumanPawn(C.ViewPort.Actor.Pawn).clientHealthToGive; healthToGive = ScrnHumanPawn(C.ViewPort.Actor.Pawn).clientHealthToGive;

View File

@ -46,10 +46,11 @@ struct InvincExtentions{
var array<InvincExtentions> zedInvExtList; var array<InvincExtentions> zedInvExtList;
var int headshotStack; var int headshotStack;
var float bruteTimer; var float bruteTimer;
var float quadDamageRemaining;
replication{ replication{
reliable if(Role == ROLE_Authority) reliable if(Role == ROLE_Authority)
headshotStack, hmgShieldLevel, forcedZedTimeCountDown, maniacTimeout, invincibilityTimer, safeMeleeMisses, ffScale, headshotStack, hmgShieldLevel, forcedZedTimeCountDown, maniacTimeout, invincibilityTimer, safeMeleeMisses, ffScale,
currentCalibrationState, calibrationScore, gunslingerTimer; currentCalibrationState, calibrationScore, gunslingerTimer, quadDamageRemaining;
reliable if(Role == ROLE_Authority) reliable if(Role == ROLE_Authority)
ClientChangeWeapon; ClientChangeWeapon;
reliable if(Role < ROLE_AUTHORITY) reliable if(Role < ROLE_AUTHORITY)

View File

@ -120,28 +120,28 @@ function SetAbilityState(int abilityIndex, EAbilityState newState){
if(abilityIndex < 0 || abilityIndex >= currentAbilitiesAmount) return; if(abilityIndex < 0 || abilityIndex >= currentAbilitiesAmount) return;
currentState = currentAbilities[abilityIndex].myState; currentState = currentAbilities[abilityIndex].myState;
if(currentState == newState) if(currentState == newState)
return; return;
if( currentState == ASTATE_ACTIVE && newState == ASTATE_READY if( currentState == ASTATE_ACTIVE && newState == ASTATE_READY
&& !currentAbilities[abilityIndex].description.canBeCancelled) && !currentAbilities[abilityIndex].description.canBeCancelled)
return; return;
currentAbilities[abilityIndex].myState = newState; currentAbilities[abilityIndex].myState = newState;
if(newState == ASTATE_COOLDOWN){ if(newState == ASTATE_COOLDOWN){
cooldown = currentAbilities[abilityIndex].description.cooldownLength; cooldown = currentAbilities[abilityIndex].description.cooldownLength;
events.static.CallModAbilityCooldown( events.static.CallModAbilityCooldown(
currentAbilities[abilityIndex].description.ID, currentAbilities[abilityIndex].description.ID,
relatedPlayer, relatedPlayer,
cooldown cooldown
); );
currentAbilities[abilityIndex].cooldown = cooldown; currentAbilities[abilityIndex].cooldown = cooldown;
} }
hackCounter ++; hackCounter ++;
netUpdateTime = level.timeSeconds - 1; netUpdateTime = level.timeSeconds - 1;
// Fire off events // Fire off events
if(newState == ASTATE_ACTIVE){ if(newState == ASTATE_ACTIVE){
events.static.CallAbilityActivated( events.static.CallAbilityActivated(
currentAbilities[abilityIndex].description.ID, currentAbilities[abilityIndex].description.ID,
relatedPlayer relatedPlayer
); );
} }
} }
// Changes ability's cooldown by a given amount. // Changes ability's cooldown by a given amount.

View File

@ -15,7 +15,6 @@ static function AbilityActivated(
NicePlayerController relatedPlayer) NicePlayerController relatedPlayer)
{ {
local NiceHumanPawn nicePawn; local NiceHumanPawn nicePawn;
local NiceMonster victim;
if (relatedPlayer == none) return; if (relatedPlayer == none) return;
nicePawn = NiceHumanPawn(relatedPlayer.pawn); nicePawn = NiceHumanPawn(relatedPlayer.pawn);
@ -37,6 +36,23 @@ static function AbilityActivated(
{ {
nicePawn.bruteTimer = nicePawn.bruteTimer =
class'NiceSkillEnforcerBruteA'.default.abilityDuration; 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;
} }
} }

View File

@ -16,12 +16,15 @@ static function array<int> GetProgressArray(byte ReqNum, optional out int Double
// Other bonuses // Other bonuses
static function int AddDamage(KFPlayerReplicationInfo KFPRI, KFMonster Injured, KFPawn DamageTaker, int InDamage, class<DamageType> DmgType) static function int AddDamage(KFPlayerReplicationInfo KFPRI, KFMonster Injured, KFPawn DamageTaker, int InDamage, class<DamageType> DmgType)
{ {
local float fDamage; local int bruteAbilityIndex;
local float fDamage, addedDamage;
local NicePlayerController nicePlayer; local NicePlayerController nicePlayer;
local NiceHumanPawn nicePawn;
local NiceMonster niceTarget; local NiceMonster niceTarget;
fDamage = float(InDamage); fDamage = float(InDamage);
nicePlayer = NicePlayerController(KFPRI.Owner); nicePlayer = NicePlayerController(KFPRI.Owner);
nicePawn = NiceHumanPawn(nicePlayer.pawn);
niceTarget = NiceMonster(injured); niceTarget = NiceMonster(injured);
if ( niceTarget != none if ( niceTarget != none
&& niceTarget.bFrozenZed && niceTarget.bFrozenZed
@ -31,9 +34,20 @@ static function int AddDamage(KFPlayerReplicationInfo KFPRI, KFMonster Injured,
(1 + class'NiceSkillEnforcerFinisherRounds'.default.damageBonus); (1 + class'NiceSkillEnforcerFinisherRounds'.default.damageBonus);
} }
if( nicePlayer != none && nicePlayer.abilityManager != none if( nicePlayer != none && nicePlayer.abilityManager != none
&& nicePawn != none && nicePawn.quadDamageRemaining > 0
&& nicePlayer.abilityManager.IsAbilityActive(class'NiceSkillEnforcerBruteA'.default.abilityID)) && 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); return int(fDamage);
} }
@ -64,15 +78,6 @@ static function class<Grenade> GetNadeType(KFPlayerReplicationInfo KFPRI){
return class'NiceCryoNade'; return class'NiceCryoNade';
} }
static function float AddExtraAmmoFor(KFPlayerReplicationInfo KFPRI, Class<Ammunition> 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<DamageType> DmgType){ static function int ReduceDamage(KFPlayerReplicationInfo KFPRI, KFPawn Injured, Pawn Instigator, int InDamage, class<DamageType> DmgType){
local float fDamage; local float fDamage;
fDamage = float(inDamage); fDamage = float(inDamage);

View File

@ -5,6 +5,7 @@ var string abilityID;
var float coolDown; var float coolDown;
var float abilityDuration; var float abilityDuration;
var float damageMult; var float damageMult;
var float maximumDamageAdded;
function static SkillSelected(NicePlayerController nicePlayer) function static SkillSelected(NicePlayerController nicePlayer)
{ {
@ -29,6 +30,7 @@ function static SkillDeSelected(NicePlayerController nicePlayer)
defaultproperties defaultproperties
{ {
maximumDamageAdded=10000
abilityID="brute" abilityID="brute"
cooldown=60.000000 cooldown=60.000000
abilityDuration=5.0 abilityDuration=5.0