Buff enforcer

This commit is contained in:
Anton Tarasenko 2023-01-23 02:03:36 +07:00
commit 2135c0b46b
20 changed files with 288 additions and 156 deletions

View file

@ -10,84 +10,36 @@
// E-mail: dkanus@gmail.com
//==============================================================================
class NiceEnforcerAbilitiesAdapter extends NiceAbilitiesAdapter;
static function AbilityActivated( string abilityID,
NicePlayerController relatedPlayer){
local NiceHumanPawn nicePawn;
local NiceMonster victim;
if(relatedPlayer == none) return;
nicePawn = NiceHumanPawn(relatedPlayer.pawn);
if(nicePawn == none)
return;
if(abilityID == "fullcounter"){
nicePawn.remainingFCArmor = 100.0;
nicePawn.remainingFCTime = 1.0;
}
if(abilityID == "carnage"){
nicePawn.brutalCranageTimer = 10.0;
}
if(abilityID == class'NiceSkillEnforcerStuporA'.default.abilityID){
relatedPlayer.abilityManager.SetAbilityState(1, ASTATE_COOLDOWN);
foreach relatedPlayer.CollidingActors(class'NiceMonster', victim, class'NiceSkillEnforcerStuporA'.default.radius, relatedPlayer.pawn.location)
{
if (victim == none) continue;
victim.DoRightPainReaction(class'NiceSkillEnforcerStuporA'.default.painScore,
relatedPlayer.pawn, victim.location, Vect(0,0,0), none, 0.0,
KFPlayerReplicationInfo(relatedPlayer.PlayerReplicationInfo));
}
}
}/*
static function AbilityAdded( string abilityID,
NicePlayerController relatedPlayer){
static function AbilityActivated(
string abilityID,
NicePlayerController relatedPlayer)
{
local NiceHumanPawn nicePawn;
if(relatedPlayer == none) return;
local NiceMonster victim;
if (relatedPlayer == none) return;
nicePawn = NiceHumanPawn(relatedPlayer.pawn);
if(nicePawn == none)
return;
if(abilityID == "Calibration"){
nicePawn.currentCalibrationState = CALSTATE_FINISHED;
nicePawn.calibrationScore = 3;
if (nicePawn == none) return;
if (abilityID == "fullcounter")
{
nicePawn.invincibilityTimer += 2.0;
relatedPlayer.abilityManager.SetAbilityState(0, ASTATE_COOLDOWN);
}
if (abilityID == "juggernaut")
{
relatedPlayer.abilityManager.SetAbilityState(1, ASTATE_COOLDOWN);
relatedPlayer.ServerStartleZeds(
class'NiceSkillEnforcerJuggernautA'.default.distance,
class'NiceSkillEnforcerJuggernautA'.default.duration);
}
if (abilityID == "brute")
{
nicePawn.bruteTimer =
class'NiceSkillEnforcerBruteA'.default.abilityDuration;
}
}
static function AbilityRemoved( string abilityID,
NicePlayerController relatedPlayer){
local NiceHumanPawn nicePawn;
if(relatedPlayer == none) return;
nicePawn = NiceHumanPawn(relatedPlayer.pawn);
if(nicePawn == none)
return;
if(abilityID == "Calibration")
nicePawn.currentCalibrationState = CALSTATE_NOABILITY;
if(abilityID == class'NiceSkillSharpshooterGunslingerA'.default.abilityID){
nicePawn.gunslingerTimer = 0.0;
}
}
static function ModAbilityCooldown( string abilityID,
NicePlayerController relatedPlayer,
out float cooldown){
local NiceHumanPawn nicePawn;
if(relatedPlayer == none) return;
nicePawn = NiceHumanPawn(relatedPlayer.pawn);
if( abilityID != class'NiceSkillSharpshooterGunslingerA'.default.abilityID
&& abilityID != class'NiceSkillSharpshooterReaperA'.default.abilityID)
return;
switch(nicePawn.calibrationScore){
case 2:
cooldown *= 0.85;
break;
case 3:
cooldown *= 0.7;
break;
case 4:
cooldown *= 0.5;
break;
case 5:
cooldown *= 0.25;
break;
}
// Reduce calibration score
if(nicePawn.calibrationScore > 3)
nicePawn.calibrationScore -= 1;
}*/
defaultproperties
{
}
}

View file

@ -14,7 +14,29 @@ static function array<int> GetProgressArray(byte ReqNum, optional out int Double
}
// Other bonuses
static function int AddDamage(KFPlayerReplicationInfo KFPRI, KFMonster Injured, KFPawn DamageTaker, int InDamage, class<DamageType> DmgType)
{
local float fDamage;
local NicePlayerController nicePlayer;
local NiceMonster niceTarget;
fDamage = float(InDamage);
nicePlayer = NicePlayerController(KFPRI.Owner);
niceTarget = NiceMonster(injured);
if ( niceTarget != none
&& niceTarget.bFrozenZed
&& HasSkill(nicePlayer, class'NiceSkillEnforcerFinisherRounds'))
{
fDamage *=
(1 + class'NiceSkillEnforcerFinisherRounds'.default.damageBonus);
}
if( nicePlayer != none && nicePlayer.abilityManager != none
&& nicePlayer.abilityManager.IsAbilityActive(class'NiceSkillEnforcerBruteA'.default.abilityID))
{
fDamage *= class'NiceSkillEnforcerBruteA'.default.damageMult;
}
return int(fDamage);
}
static function float GetPenetrationDamageMulti(KFPlayerReplicationInfo KFPRI, float DefaultPenDamageReduction, class<NiceWeaponDamageType> fireIntance){
local float bonusReduction;
local float PenDamageInverse;
@ -52,17 +74,24 @@ static function float AddExtraAmmoFor(KFPlayerReplicationInfo KFPRI, Class<Ammun
}
static function int ReduceDamage(KFPlayerReplicationInfo KFPRI, KFPawn Injured, Pawn Instigator, int InDamage, class<DamageType> DmgType){
if(HasSkill(NicePlayerController(KFPRI.Owner), class'NiceSkillEnforcerDetermination') && Injured.Health < class'NiceSkillEnforcerDetermination'.default.healthBound)
InDamage *= (1 - class'NiceSkillEnforcerDetermination'.default.addedResist);
if(HasSkill(NicePlayerController(KFPRI.Owner), class'NiceSkillEnforcerUnshakable'))
InDamage *= (1 - class'NiceSkillEnforcerUnshakable'.default.skillResist);
local float fDamage;
fDamage = float(inDamage);
if(HasSkill(NicePlayerController(KFPRI.Owner), class'NiceSkillEnforcerUnkillable') && Injured.Health < class'NiceSkillEnforcerUnkillable'.default.healthBound)
fDamage *= (1 - class'NiceSkillEnforcerUnkillable'.default.addedResist);
if(HasSkill(NicePlayerController(KFPRI.Owner), class'NiceSkillEnforcerCoating') && Injured.ShieldStrength > 0){
if( class<KFWeaponDamageType>(DmgType) != none
&& ((class<KFWeaponDamageType>(DmgType).default.bDealBurningDamage && KFMonster(Instigator) != none)
|| DmgType == class'NiceZombieTeslaHusk'.default.MyDamageType) )
InDamage *= (1 - class'NiceSkillEnforcerCoating'.default.huskResist);
{
if (Injured.ShieldStrength >= 100) {
fDamage *= (1 - class'NiceSkillEnforcerCoating'.default.huskResist);
}
else {
fDamage *= (1 - class'NiceSkillEnforcerCoating'.default.huskResist * (Injured.ShieldStrength / 100));
}
}
}
return InDamage;
return int(fDamage);
}
static function float GetFireSpeedModStatic(KFPlayerReplicationInfo KFPRI, class<Weapon> other){
@ -92,6 +121,10 @@ static function float ModifyRecoilSpread(KFPlayerReplicationInfo KFPRI, WeaponFi
return Recoil;
}
static function int GetInvincibilityDuration(KFPlayerReplicationInfo KFPRI){
return 10.0;
}
/*static function float GetMagCapacityModStatic(KFPlayerReplicationInfo KFPRI, class<KFWeapon> other){
local class<NiceWeapon> niceWeap;
niceWeap = class<NiceWeapon>(other);
@ -143,13 +176,13 @@ defaultproperties
SkillGroupA(0)=class'NiceSkillEnforcerUnstoppable'
SkillGroupA(1)=class'NiceSkillEnforcerBombard'
SkillGroupA(2)=class'NiceSkillEnforcerCoating'
SkillGroupA(3)=class'NiceSkillEnforcerStuporA'
SkillGroupA(3)=class'NiceSkillEnforcerJuggernautA'
SkillGroupA(4)=class'NiceSkillEnforcerZEDBarrage'
SkillGroupB(0)=class'NiceSkillEnforcerUnshakable'
SkillGroupB(0)=class'NiceSkillEnforcerUnkillable'
SkillGroupB(1)=class'NiceSkillEnforcerMultitasker'
SkillGroupB(2)=class'NiceSkillEnforcerDetermination'
SkillGroupB(3)=class'NiceSkillEnforcerBrutalCarnageA'
SkillGroupB(4)=class'NiceSkillEnforcerZEDJuggernaut'
SkillGroupB(2)=class'NiceSkillEnforcerFinisherRounds'
SkillGroupB(3)=class'NiceSkillEnforcerBruteA'
SkillGroupB(4)=class'NiceSkillEnforcerZEDIceGiant'
progressArray0(0)=100
progressArray0(1)=1000
progressArray0(2)=3000
@ -164,7 +197,7 @@ defaultproperties
OnHUDIcons(3)=(PerkIcon=Texture'ScrnTex.Perks.Perk_Support_Blue',StarIcon=Texture'ScrnTex.Perks.Hud_Perk_Star_Blue',DrawColor=(B=255,G=255,R=255,A=255))
OnHUDIcons(4)=(PerkIcon=Texture'ScrnTex.Perks.Perk_Support_Purple',StarIcon=Texture'ScrnTex.Perks.Hud_Perk_Star_Purple',DrawColor=(B=255,G=255,R=255,A=255))
OnHUDIcons(5)=(PerkIcon=Texture'ScrnTex.Perks.Perk_Support_Orange',StarIcon=Texture'ScrnTex.Perks.Hud_Perk_Star_Orange',DrawColor=(B=255,G=255,R=255,A=255))
CustomLevelInfo="Level up by doing damage with perked weapons|60% better penetration with all weapons|+2 grenades"
CustomLevelInfo="Level up by doing damage with perked weapons|60% better penetration with all weapons|+2 grenades|Cannot gain melee invincibility"
PerkIndex=1
OnHUDIcon=Texture'KillingFloorHUD.Perks.Perk_Support'
OnHUDGoldIcon=Texture'KillingFloor2HUD.Perk_Icons.Perk_Support_Gold'

View file

@ -0,0 +1,38 @@
class NiceSkillEnforcerBruteA extends NiceSkill
abstract;
var string abilityID;
var float coolDown;
var float abilityDuration;
var float damageMult;
function static SkillSelected(NicePlayerController nicePlayer)
{
local NiceAbilityManager.NiceAbilityDescription carnage;
if(nicePlayer == none) return;
if(nicePlayer.abilityManager == none) return;
carnage.ID = default.abilityID;
carnage.icon = Texture'NicePackT.HudCounter.demo';
carnage.cooldownLength = default.cooldown;
carnage.canBeCancelled = false;
nicePlayer.abilityManager.AddAbility(carnage);
}
function static SkillDeSelected(NicePlayerController nicePlayer)
{
if(nicePlayer == none) return;
if(nicePlayer.abilityManager == none) return;
nicePlayer.abilityManager.RemoveAbility(default.abilityID);
}
defaultproperties
{
abilityID="brute"
cooldown=60.000000
abilityDuration=5.0
damageMult=4.0
SkillName="Brute"
SkillEffects="Temporarily lose ability to do headshots in exchange for quad damage."
}

View file

@ -0,0 +1,10 @@
class NiceSkillEnforcerFinisherRounds extends NiceSkill
abstract;
var float damageBonus;
defaultproperties
{
damageBonus=0.500000
SkillName="Finisher rounds"
SkillEffects="Deal 50% more damage to frozen targets."
}

View file

@ -0,0 +1,38 @@
class NiceSkillEnforcerJuggernautA extends NiceSkill
abstract;
var string abilityID;
var float distance;
var float cooldown;
var float duration;
function static SkillSelected(NicePlayerController nicePlayer)
{
local NiceAbilityManager.NiceAbilityDescription stupor;
if(nicePlayer == none) return;
if(nicePlayer.abilityManager == none) return;
stupor.ID = default.abilityID;
stupor.icon = Texture'NicePackT.HudCounter.demo';
stupor.cooldownLength = default.cooldown;
stupor.canBeCancelled = false;
nicePlayer.abilityManager.AddAbility(stupor);
}
function static SkillDeSelected(NicePlayerController nicePlayer)
{
if(nicePlayer == none) return;
if(nicePlayer.abilityManager == none) return;
nicePlayer.abilityManager.RemoveAbility(default.abilityID);
}
defaultproperties
{
abilityID="juggernaut"
Distance=800.000000
cooldown=30
SkillName="Juggernaut"
SkillEffects="Startle zeds around you for three seconds."
}

View file

@ -1,11 +1,12 @@
class NiceSkillEnforcerDetermination extends NiceSkill
class NiceSkillEnforcerUnkillable extends NiceSkill
abstract;
var int healthBound;
var float addedResist;
defaultproperties
{
healthBound=50
addedResist=0.500000
SkillName="Determination"
SkillName="Unkillable"
SkillEffects="Receive 50% less damage when your health falls below 50 mark."
}

View file

@ -3,7 +3,7 @@ class NiceSkillEnforcerUnstoppable extends NiceSkill
var float speedMult;
defaultproperties
{
speedMult=0.750000
speedMult=1.000000
SkillName="Unstoppable"
SkillEffects="Your speed doesn't decrease from additional weight, low health, poison or siren's pull, but you also receive -25% speed penalty."
SkillEffects="Your speed doesn't decrease from additional weight, low health, poison or siren's pull and your screen doesn't shake or blur."
}

View file

@ -3,5 +3,5 @@ class NiceSkillEnforcerZEDBarrage extends NiceSkill
defaultproperties
{
SkillName="Barrage"
SkillEffects="Shoot without any recoil during zed-time."
SkillEffects="Shoot without any recoil during zed-time at twice the speed."
}

View file

@ -0,0 +1,7 @@
class NiceSkillEnforcerZEDIceGiant extends NiceSkill
abstract;
defaultproperties
{
SkillName="Ice giant"
SkillEffects="Freeze zeds around you during zed time."
}

View file

@ -1,9 +0,0 @@
class NiceSkillEnforcerZEDJuggernaut extends NiceSkill
abstract;
var float distance;
defaultproperties
{
Distance=800.000000
SkillName="Juggernaut"
SkillEffects="You startle zeds around you upon entering zed-time."
}