From eb6ef56d7930febc5a24df7e699038e3707923c3 Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Mon, 7 Feb 2022 15:28:24 +0400 Subject: [PATCH 01/23] husk use Myammo func --- sources/Zeds/Mean/MeanZombieHusk.uc | 2 +- sources/Zeds/Mean/MeanZombieHuskAmmo.uc | 7 +++++++ sources/Zeds/Nice/NiceZombieHusk.uc | 28 +++++++++++++++---------- sources/Zeds/Nice/NiceZombieHuskAmmo.uc | 13 ++++++++++++ 4 files changed, 38 insertions(+), 12 deletions(-) create mode 100644 sources/Zeds/Mean/MeanZombieHuskAmmo.uc create mode 100644 sources/Zeds/Nice/NiceZombieHuskAmmo.uc diff --git a/sources/Zeds/Mean/MeanZombieHusk.uc b/sources/Zeds/Mean/MeanZombieHusk.uc index 82dcd86..b0ada50 100644 --- a/sources/Zeds/Mean/MeanZombieHusk.uc +++ b/sources/Zeds/Mean/MeanZombieHusk.uc @@ -48,7 +48,7 @@ function RangedAttack(Actor A) { defaultproperties { maxNormalShots=3 - HuskFireProjClass=class'MeanHuskFireProjectile' + AmmunitionClass=class'MeanZombieHuskAmmo' remainingStuns=1 MenuName="Mean Husk" ControllerClass=class'MeanZombieHuskController' diff --git a/sources/Zeds/Mean/MeanZombieHuskAmmo.uc b/sources/Zeds/Mean/MeanZombieHuskAmmo.uc new file mode 100644 index 0000000..9264e0f --- /dev/null +++ b/sources/Zeds/Mean/MeanZombieHuskAmmo.uc @@ -0,0 +1,7 @@ +class MeanZombieHuskAmmo extends NiceZombieHuskAmmo; + + +defaultproperties +{ + ProjectileClass=class'MeanHuskFireProjectile' +} \ No newline at end of file diff --git a/sources/Zeds/Nice/NiceZombieHusk.uc b/sources/Zeds/Nice/NiceZombieHusk.uc index 0ac191a..c1a981a 100644 --- a/sources/Zeds/Nice/NiceZombieHusk.uc +++ b/sources/Zeds/Nice/NiceZombieHusk.uc @@ -21,14 +21,20 @@ simulated function HeatTick(){ } super.HeatTick(); } + simulated function PostBeginPlay() { // Difficulty Scaling - if (Level.Game != none && !bDiffAdjusted){ + if (Level.Game != none && !bDiffAdjusted) + { ProjectileFireInterval = default.ProjectileFireInterval * 0.6; } + // and why TWI removed this feature... + MyAmmo = spawn(AmmunitionClass); + super.PostBeginPlay(); } + // don't interrupt the bloat while he is puking simulated function bool HitCanInterruptAction() { @@ -146,14 +152,14 @@ function SpawnTwoShots() if (!SavedFireProperties.bInitialized) { - SavedFireProperties.AmmoClass = class'SkaarjAmmo'; - SavedFireProperties.ProjectileClass = HuskFireProjClass; - SavedFireProperties.WarnTargetPct = 1; - SavedFireProperties.MaxRange = 65535; - SavedFireProperties.bTossed = false; - SavedFireProperties.bTrySplash = true; - SavedFireProperties.bLeadTarget = true; - SavedFireProperties.bInstantHit = false; + SavedFireProperties.AmmoClass = MyAmmo.Class; + SavedFireProperties.ProjectileClass = MyAmmo.ProjectileClass; + SavedFireProperties.WarnTargetPct = MyAmmo.WarnTargetPct; + SavedFireProperties.MaxRange = MyAmmo.MaxRange; + SavedFireProperties.bTossed = MyAmmo.bTossed; + SavedFireProperties.bTrySplash = MyAmmo.bTrySplash; + SavedFireProperties.bLeadTarget = MyAmmo.bLeadTarget; + SavedFireProperties.bInstantHit = MyAmmo.bInstantHit; SavedFireProperties.bInitialized = true; } @@ -173,7 +179,7 @@ function SpawnTwoShots() } // added projectile owner... - Spawn(HuskFireProjClass, self, , FireStart, FireRotation); + Spawn(SavedFireProperties.ProjectileClass, self, , FireStart, FireRotation); // Turn extra collision back on ToggleAuxCollision(true); @@ -379,7 +385,7 @@ static simulated function PreCacheMaterials(LevelInfo myLevel) } defaultproperties { - HuskFireProjClass=class'NiceHuskFireProjectile' + AmmunitionClass=class'NiceZombieHuskAmmo' stunLoopStart=0.080000 stunLoopEnd=0.900000 idleInsertFrame=0.930000 diff --git a/sources/Zeds/Nice/NiceZombieHuskAmmo.uc b/sources/Zeds/Nice/NiceZombieHuskAmmo.uc new file mode 100644 index 0000000..47f21ba --- /dev/null +++ b/sources/Zeds/Nice/NiceZombieHuskAmmo.uc @@ -0,0 +1,13 @@ +class NiceZombieHuskAmmo extends Ammunition; + + +defaultproperties +{ + ProjectileClass=class'NiceHuskFireProjectile' + WarnTargetPct=1 + MaxRange=65535 + bTossed=False + bTrySplash=True + bLeadTarget=True + bInstantHit=False +} \ No newline at end of file -- 2.20.1 From b8045655f1253acc30eed7dc4d98fdf98c4794f6 Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Mon, 7 Feb 2022 14:58:46 +0400 Subject: [PATCH 02/23] FP one hit kill fix now they won't send you to hell when you attack them during hit animation --- sources/Zeds/Nice/NiceZombieFleshPound.uc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/Zeds/Nice/NiceZombieFleshPound.uc b/sources/Zeds/Nice/NiceZombieFleshPound.uc index 1a7ea05..539ce75 100644 --- a/sources/Zeds/Nice/NiceZombieFleshPound.uc +++ b/sources/Zeds/Nice/NiceZombieFleshPound.uc @@ -132,7 +132,8 @@ function TakeDamageClient(int Damage, Pawn InstigatedBy, Vector Hitlocation, Vec PostNetReceive(); Super.TakeDamageClient(Damage, instigatedBy, hitLocation, momentum, damageType, headshotLevel, lockonTime); TwoSecondDamageTotal += OldHealth - Health; - if( !bDecapitated && TwoSecondDamageTotal > RageDamageThreshold && !bChargingPlayer && + // fixed their one hit kill ability when you spam attack during hit animation + if( !bDecapitated && TwoSecondDamageTotal > RageDamageThreshold && !bChargingPlayer && !bShotAnim && (!(bWasBurning && bCrispified) || bFrustrated) ) StartChargingFP(InstigatedBy); } -- 2.20.1 From 253238e6a990ed2ab05bd68710a5a5d330661f24 Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Mon, 7 Feb 2022 16:00:27 +0400 Subject: [PATCH 03/23] multitasker fix part 1 --- sources/GUI/NiceInteraction.uc | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/sources/GUI/NiceInteraction.uc b/sources/GUI/NiceInteraction.uc index bbdac18..276a099 100644 --- a/sources/GUI/NiceInteraction.uc +++ b/sources/GUI/NiceInteraction.uc @@ -170,17 +170,21 @@ function PostRender(Canvas C) x += 128 + 4; } } + //// Draw weapons progress bars - if(nicePlayer != none && nicePlayer.bFlagDisplayWeaponProgress) + if (class'NiceVeterancyTypes'.static.hasSkill(nicePlayer, class'NiceSkillEnforcerMultitasker') + && nicePlayer.bFlagDisplayWeaponProgress && niceMutator.niceWeapProgressSet.length > 0) { - x = C.ClipX - InventoryBoxWidth * C.ClipX - 5; - y = C.ClipY * 0.5 - 0.5 * (InventoryBoxHeight * C.ClipX + 4) * niceMutator.niceWeapProgressSet.Length; - for(i = 0;i < niceMutator.niceWeapProgressSet.Length;i ++){ - DrawWeaponProgress(C, niceMutator.niceWeapProgressSet[i], x, y, - C.ViewPort.Actor.Pawn.PlayerReplicationInfo.Team); - y += (InventoryBoxHeight * C.ClipX + 4); - } + x = C.ClipX - InventoryBoxWidth * C.ClipX - 5; + y = C.ClipY * 0.5 - 0.5 * (InventoryBoxHeight * C.ClipX + 4) * niceMutator.niceWeapProgressSet.Length; + for (i = 0;i < niceMutator.niceWeapProgressSet.Length;i ++) + { + DrawWeaponProgress(C, niceMutator.niceWeapProgressSet[i], x, y, + C.ViewPort.Actor.Pawn.PlayerReplicationInfo.Team); + y += (InventoryBoxHeight * C.ClipX + 4); + } } + //// Draw invincibility bar nicePawn = NiceHumanPawn(nicePlayer.pawn); if(nicePawn != none && nicePawn.invincibilityTimer != 0.0) @@ -355,15 +359,18 @@ function DrawCalibrationStars(Canvas C){ x += 32 + 16; } } -function DrawWeaponProgress(Canvas C, NicePack.WeaponProgressDisplay weapProgress, int x, int y, TeamInfo team){ + +function DrawWeaponProgress(Canvas C, NicePack.WeaponProgressDisplay weapProgress, int x, int y, TeamInfo team) +{ local float textWidth, textHeight; local string textToDraw; local float TempWidth, TempHeight, TempBorder; + TempWidth = InventoryBoxWidth * C.ClipX; TempHeight = InventoryBoxHeight * C.ClipX; TempBorder = BorderSize * C.ClipX; // Draw background bar - if(team.teamIndex == 0) + if (team.teamIndex == 0) C.SetDrawColor(255, 64, 64, 64); else C.SetDrawColor(team.teamColor.R, team.teamColor.G, team.teamColor.B, 64); @@ -387,7 +394,8 @@ function DrawWeaponProgress(Canvas C, NicePack.WeaponProgressDisplay weapProgres C.SetDrawColor(255, 64, 64); else C.SetDrawColor(team.teamColor.R, team.teamColor.G, team.teamColor.B); - if(weapProgress.bShowCounter){ + if(weapProgress.bShowCounter) + { textToDraw = string(weapProgress.counter); C.Font = class'ROHUD'.Static.LoadSmallFontStatic(5); C.TextSize(textToDraw, textWidth, textHeight); @@ -395,6 +403,7 @@ function DrawWeaponProgress(Canvas C, NicePack.WeaponProgressDisplay weapProgres C.DrawText(textToDraw); } } + function bool KeyEvent(EInputKey Key, EInputAction Action, float Delta){ local bool bNeedsReload; local string Alias, LeftPart, RigthPart; -- 2.20.1 From 6fa76a8eee78b1d20c26390498b655745dc1b488 Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Wed, 23 Feb 2022 22:01:18 +0400 Subject: [PATCH 04/23] guibuymenu made more readable --- sources/GUI/NiceGUIBuyMenu.uc | 93 ++++++++++++++++++++++------------- 1 file changed, 59 insertions(+), 34 deletions(-) diff --git a/sources/GUI/NiceGUIBuyMenu.uc b/sources/GUI/NiceGUIBuyMenu.uc index c931453..d817e04 100644 --- a/sources/GUI/NiceGUIBuyMenu.uc +++ b/sources/GUI/NiceGUIBuyMenu.uc @@ -1,34 +1,37 @@ class NiceGUIBuyMenu extends UT2k4MainPage; -//The "Header" -var automated GUIImage HeaderBG_Left; -var automated GUIImage HeaderBG_Center; -var automated GUIImage HeaderBG_Right; -var automated GUILabel CurrentPerkLabel; -var automated GUILabel TimeLeftLabel; -var automated GUILabel WaveLabel; -var automated GUILabel HeaderBG_Left_Label; -var automated KFQuickPerkSelect QuickPerkSelect; -var automated KFBuyMenuFilter BuyMenuFilter; -var automated GUIButton StoreTabButton; -var automated GUIButton PerkTabButton; -//The "Footer" -var automated GUIImage WeightBG; -var automated GUIImage WeightIcon; -var automated GUIImage WeightIconBG; -var automated KFWeightBar WeightBar; -//const BUYLIST_CATS =7; -var() editconst noexport float SavedPitch; -var color RedColor; -var color GreenGreyColor; -var() UT2K4TabPanel ActivePanel; -var localized string CurrentPerk; -var localized string NoActivePerk; -var localized string TraderClose; -var localized string WaveString; -var localized string LvAbbrString; + +// The "Header" +var automated GUIImage HeaderBG_Left; +var automated GUIImage HeaderBG_Center; +var automated GUIImage HeaderBG_Right; +var automated GUILabel CurrentPerkLabel; +var automated GUILabel TimeLeftLabel; +var automated GUILabel WaveLabel; +var automated GUILabel HeaderBG_Left_Label; +var automated KFQuickPerkSelect QuickPerkSelect; +var automated KFBuyMenuFilter BuyMenuFilter; +var automated GUIButton StoreTabButton; +var automated GUIButton PerkTabButton; +// The "Footer" +var automated GUIImage WeightBG; +var automated GUIImage WeightIcon; +var automated GUIImage WeightIconBG; +var automated KFWeightBar WeightBar; +// const BUYLIST_CATS =7; +var() editconst noexport float SavedPitch; +var color RedColor; +var color GreenGreyColor; +var() UT2K4TabPanel ActivePanel; +var localized string CurrentPerk; +var localized string NoActivePerk; +var localized string TraderClose; +var localized string WaveString; +var localized string LvAbbrString; + function InitComponent(GUIController MyC, GUIComponent MyO) { local int i; + super.InitComponent(MyC, MyO); c_Tabs.BackgroundImage = none; c_Tabs.BackgroundStyle = none; @@ -39,14 +42,17 @@ function InitComponent(GUIController MyC, GUIComponent MyO) } UpdateWeightBar(); } + function InitTabs() { local int i; + for ( i = 0; i < PanelCaption.Length && i < PanelClass.Length && i < PanelHint.Length; i++ ) { c_Tabs.AddTab(PanelCaption[i], PanelClass[i],, PanelHint[i]); } } + function UpdateWeightBar() { if ( KFHumanPawn(PlayerOwner().Pawn) != none ) @@ -55,9 +61,11 @@ function UpdateWeightBar() WeightBar.CurBoxes = KFHumanPawn(PlayerOwner().Pawn).CurrentWeight; } } + event Opened(GUIComponent Sender) { local rotator PlayerRot; + super.Opened(Sender); c_Tabs.ActivateTabByName(PanelCaption[0], true); // Tell the controller that he is on a shopping spree @@ -78,29 +86,37 @@ event Opened(GUIComponent Sender) PlayerOwner().SetRotation(PlayerRot); SetTimer(0.05f, true); } + function Timer() { UpdateHeader(); UpdateWeightBar(); } + function InternalOnClose(optional bool bCanceled) { local rotator NewRot; + // Reset player NewRot = PlayerOwner().Rotation; NewRot.Pitch = SavedPitch; PlayerOwner().SetRotation(NewRot); - Super.OnClose(bCanceled); + super.OnClose(bCanceled); } + function UpdateHeader() { local int TimeLeftMin, TimeLeftSec; local string TimeString; + local KFGameReplicationInfo KFGRI; + if ( KFPlayerController(PlayerOwner()) == none || PlayerOwner().PlayerReplicationInfo == none || PlayerOwner().GameReplicationInfo == none ) { return; } + KFGRI = KFGameReplicationInfo(PlayerOwner().GameReplicationInfo); + // Current Perk if ( KFPlayerController(PlayerOwner()).SelectedVeterancy != none ) { @@ -110,9 +126,10 @@ function UpdateHeader() { CurrentPerkLabel.Caption = CurrentPerk$":" @ NoActivePerk; } + // Trader time left - TimeLeftMin = KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).TimeToNextWave / 60; - TimeLeftSec = KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).TimeToNextWave % 60; + TimeLeftMin = KFGRI.TimeToNextWave / 60; + TimeLeftSec = KFGRI.TimeToNextWave % 60; if ( TimeLeftMin < 1 ) { TimeString = "00:"; @@ -121,6 +138,7 @@ function UpdateHeader() { TimeString = "0" $ TimeLeftMin $ ":"; } + if ( TimeLeftSec >= 10 ) { TimeString = TimeString $ TimeLeftSec; @@ -129,8 +147,9 @@ function UpdateHeader() { TimeString = TimeString $ "0" $ TimeLeftSec; } + TimeLeftLabel.Caption = TraderClose @ TimeString; - if ( KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).TimeToNextWave < 10 ) + if ( KFGRI.TimeToNextWave < 10 ) { TimeLeftLabel.TextColor = RedColor; } @@ -138,26 +157,31 @@ function UpdateHeader() { TimeLeftLabel.TextColor = GreenGreyColor; } + // Wave Counter - WaveLabel.Caption = WaveString$":" @ (KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).WaveNumber + 1)$"/"$KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).FinalWave; + WaveLabel.Caption = WaveString $ ":" @ (KFGRI.WaveNumber + 1) $ "/" $ KFGRI.FinalWave; } + function KFBuyMenuClosed(optional bool bCanceled) { local rotator NewRot; + // Reset player NewRot = PlayerOwner().Rotation; NewRot.Pitch = SavedPitch; PlayerOwner().SetRotation(NewRot); - Super.OnClose(bCanceled); + super.OnClose(bCanceled); if ( KFPlayerController(PlayerOwner()) != none ) { KFPlayerController(PlayerOwner()).bShopping = false; } } + function CloseSale(bool savePurchases) { Controller.CloseMenu(!savePurchases); } + function bool ButtonClicked(GUIComponent Sender) { if ( Sender == PerkTabButton ) @@ -170,6 +194,7 @@ function bool ButtonClicked(GUIComponent Sender) } return true; } + defaultproperties { Begin Object Class=GUIImage Name=HBGLeft @@ -374,4 +399,4 @@ defaultproperties bAllowedAsLast=True OnClose=NiceGUIBuyMenu.KFBuyMenuClosed WhiteColor=(B=255,G=255,R=255) -} +} \ No newline at end of file -- 2.20.1 From 0ca633cad4c1317ac7a3aa66d90287749a6092c3 Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Wed, 23 Feb 2022 22:06:29 +0400 Subject: [PATCH 05/23] compiler warning fixes --- sources/GUI/NiceInteraction.uc | 8 +-- sources/Weapons/NiceFire.uc | 127 ++++++++++++++++++--------------- 2 files changed, 74 insertions(+), 61 deletions(-) diff --git a/sources/GUI/NiceInteraction.uc b/sources/GUI/NiceInteraction.uc index 276a099..fc309bd 100644 --- a/sources/GUI/NiceInteraction.uc +++ b/sources/GUI/NiceInteraction.uc @@ -63,14 +63,14 @@ function PostRender(Canvas C) local NicePlayerController nicePlayer; local ScrnHUD scrnHUDInstance; // TODO maybe use scrnhud? - local HUDKillingFloor kfHud; + // local HUDKillingFloor kfHud; local Texture barTexture; local int x, y, center, barWidth, offset; local int missesWidth, missesHeight, missesSpace; local int missesX, missesY; - local Vector CamPos, ViewDir; - local Rotator CamRot; - local float OffsetX, BarLength, BarHeight, XL, YL, posY; + // local Vector CamPos, ViewDir; + // local Rotator CamRot; + // local float OffsetX, BarLength, BarHeight, XL, YL, posY; if(C == none) return; if(C.ViewPort == none) return; diff --git a/sources/Weapons/NiceFire.uc b/sources/Weapons/NiceFire.uc index b8fbbe8..19d96ae 100644 --- a/sources/Weapons/NiceFire.uc +++ b/sources/Weapons/NiceFire.uc @@ -450,70 +450,83 @@ function PlayFiring(){ if(!currentContext.bIsBursting) FireCount ++; } -// Handle setting new recoil -simulated function HandleRecoil(float Rec){ - local int stationarySeconds; - local rotator NewRecoilRotation; - local NicePlayerController nicePlayer; - local NiceHumanPawn nicePawn; - local vector AdjustedVelocity; - local float AdjustedSpeed; - local KFWeapon kfWeap; - if(Instigator != none){ - nicePlayer = NicePlayerController(Instigator.Controller); - nicePawn = NiceHumanPawn(Instigator); - } - if(nicePlayer == none || nicePawn == none) - return; - if(bResetRecoil || nicePlayer.IsZedTimeActive() && class'NiceVeterancyTypes'.static.hasSkill(nicePlayer, class'NiceSkillEnforcerZEDBarrage')){ - Rec = 0.0; - bResetRecoil = false; - } - kfWeap= KFWeapon(Weapon); - if (kfWeap.bAimingRifle) { - Rec *= 0.5; - } - if(nicePawn.stationaryTime > 0.0 && class'NiceVeterancyTypes'.static.hasSkill(nicePlayer, class'NiceSkillHeavyStablePosition')){ - stationarySeconds = Ceil(2 * nicePawn.stationaryTime) - 1; - Rec *= FMax(0.0, 1.0 - (stationarySeconds * class'NiceSkillHeavyStablePosition'.default.recoilDampeningBonus)); - } - if(!nicePlayer.bFreeCamera){ - if(Weapon.GetFireMode(ThisModeNum).bIsFiring || currentContext.bIsBursting){ - NewRecoilRotation.Pitch = RandRange(maxVerticalRecoilAngle * 0.5, maxVerticalRecoilAngle); - NewRecoilRotation.Yaw = RandRange(maxHorizontalRecoilAngle * 0.5, maxHorizontalRecoilAngle); - if(!bRecoilRightOnly && Rand(2) == 1) +// Handle setting new recoil +simulated function HandleRecoil(float Rec) +{ + local int stationarySeconds; + local rotator NewRecoilRotation; + local NicePlayerController nicePlayer; + local NiceHumanPawn nicePawn; + local vector AdjustedVelocity; + local float AdjustedSpeed; + local KFWeapon KFW; + + if(Instigator != none) + { + nicePlayer = NicePlayerController(Instigator.Controller); + nicePawn = NiceHumanPawn(Instigator); + } + if(nicePlayer == none || nicePawn == none) + return; + if(bResetRecoil || nicePlayer.IsZedTimeActive() && class'NiceVeterancyTypes'.static.hasSkill(nicePlayer, class'NiceSkillEnforcerZEDBarrage')) + { + Rec = 0.0; + bResetRecoil = false; + } + KFW= KFWeapon(Weapon); + if (KFW.bAimingRifle) + { + Rec *= 0.5; + } + if (nicePawn.stationaryTime > 0.0 && class'NiceVeterancyTypes'.static.hasSkill(nicePlayer, class'NiceSkillHeavyStablePosition')) + { + stationarySeconds = Ceil(2 * nicePawn.stationaryTime) - 1; + Rec *= FMax(0.0, 1.0 - (stationarySeconds * class'NiceSkillHeavyStablePosition'.default.recoilDampeningBonus)); + } + if (!nicePlayer.bFreeCamera) + { + if (Weapon.GetFireMode(ThisModeNum).bIsFiring || currentContext.bIsBursting) + { + NewRecoilRotation.Pitch = RandRange(maxVerticalRecoilAngle * 0.5, maxVerticalRecoilAngle); + NewRecoilRotation.Yaw = RandRange(maxHorizontalRecoilAngle * 0.5, maxHorizontalRecoilAngle); + + if (!bRecoilRightOnly && Rand(2) == 1) NewRecoilRotation.Yaw *= -1; - if(RecoilVelocityScale > 0){ - if(Weapon.Owner != none && Weapon.Owner.Physics == PHYS_Falling && - Weapon.Owner.PhysicsVolume.Gravity.Z > class'PhysicsVolume'.default.Gravity.Z){ - AdjustedVelocity = Weapon.Owner.Velocity; - // Ignore Z velocity in low grav so we don't get massive recoil - AdjustedVelocity.Z = 0; - AdjustedSpeed = VSize(AdjustedVelocity); + if (RecoilVelocityScale > 0) + { + if (Weapon.Owner != none && Weapon.Owner.Physics == PHYS_Falling && + Weapon.Owner.PhysicsVolume.Gravity.Z > class'PhysicsVolume'.default.Gravity.Z) + { + AdjustedVelocity = Weapon.Owner.Velocity; + // Ignore Z velocity in low grav so we don't get massive recoil + AdjustedVelocity.Z = 0; + AdjustedSpeed = VSize(AdjustedVelocity); - // Reduce the falling recoil in low grav - NewRecoilRotation.Pitch += (AdjustedSpeed * RecoilVelocityScale * 0.5); - NewRecoilRotation.Yaw += (AdjustedSpeed * RecoilVelocityScale * 0.5); - } - else{ - NewRecoilRotation.Pitch += (VSize(Weapon.Owner.Velocity) * RecoilVelocityScale); - NewRecoilRotation.Yaw += (VSize(Weapon.Owner.Velocity) * RecoilVelocityScale); - } - } + // Reduce the falling recoil in low grav + NewRecoilRotation.Pitch += (AdjustedSpeed * RecoilVelocityScale * 0.5); + NewRecoilRotation.Yaw += (AdjustedSpeed * RecoilVelocityScale * 0.5); + } + else + { + NewRecoilRotation.Pitch += (VSize(Weapon.Owner.Velocity) * RecoilVelocityScale); + NewRecoilRotation.Yaw += (VSize(Weapon.Owner.Velocity) * RecoilVelocityScale); + } + } - NewRecoilRotation.Pitch += (Instigator.HealthMax / Instigator.Health * 5); - NewRecoilRotation.Yaw += (Instigator.HealthMax / Instigator.Health * 5); - NewRecoilRotation *= Rec; + NewRecoilRotation.Pitch += (Instigator.HealthMax / Instigator.Health * 5); + NewRecoilRotation.Yaw += (Instigator.HealthMax / Instigator.Health * 5); + NewRecoilRotation *= Rec; - if(default.FireRate <= 0) - nicePlayer.SetRecoil(NewRecoilRotation, RecoilRate); - else - nicePlayer.SetRecoil(NewRecoilRotation, RecoilRate * (FireRate / default.FireRate)); - } - } + if (default.FireRate <= 0) + nicePlayer.SetRecoil(NewRecoilRotation, RecoilRate); + else + nicePlayer.SetRecoil(NewRecoilRotation, RecoilRate * (FireRate / default.FireRate)); + } + } } + function DoFireEffect(){ local bool bIsShotgunBullet, bForceComplexTraj; local bool bPinpoint; -- 2.20.1 From 387adee06b748308fe197d2a4389094f388eee2b Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Wed, 23 Feb 2022 22:45:54 +0400 Subject: [PATCH 06/23] nice mut cleanup --- sources/NicePack.uc | 144 ++++++++++---------------------------------- 1 file changed, 31 insertions(+), 113 deletions(-) diff --git a/sources/NicePack.uc b/sources/NicePack.uc index 0490da3..39d6d36 100644 --- a/sources/NicePack.uc +++ b/sources/NicePack.uc @@ -164,9 +164,10 @@ function PreBeginPlay() AddToPackageMap("NicePackSnd.uax"); AddToPackageMap("NicePackT.utx"); } -simulated function PostBeginPlay(){ + +simulated function PostBeginPlay() +{ local int i; - local ZedRecord record; local ScrnVotingHandlerMut VH; local MeanVoting VO; local NiceFFVoting FFVO; @@ -225,125 +226,26 @@ simulated function PostBeginPlay(){ // -- Fill-in zed info i = 0; // - Clot - record.ZedName = "Clot"; - record.ZedType = class'NiceZombieClot'; - record.MeanZedType = class'MeanZombieClot'; - record.HL = 0.0; - record.MeanHLBonus = 0.5; - record.bNeedsReplacement = bReplaceClot; - ZedDatabase[i++] = record; + ZedDatabase[0].bNeedsReplacement = bReplaceClot; // - Crawler - record.ZedName = "Crawler"; - record.ZedType = class'NiceZombieCrawler'; - record.MeanZedType = class'MeanZombieCrawler'; - record.HL = 0.5; - record.MeanHLBonus = 1.5; - record.bNeedsReplacement = bReplaceCrawler; - ZedDatabase[i++] = record; + ZedDatabase[1].bNeedsReplacement = bReplaceCrawler; // - Stalker - record.ZedName = "Stalker"; - record.ZedType = class'NiceZombieStalker'; - record.MeanZedType = class'MeanZombieStalker'; - record.HL = 0.5; - record.MeanHLBonus = 0.5; - record.bNeedsReplacement = bReplaceStalker; - ZedDatabase[i++] = record; + ZedDatabase[2].bNeedsReplacement = bReplaceStalker; // - Gorefast - record.ZedName = "Gorefast"; - record.ZedType = class'NiceZombieGorefast'; - record.MeanZedType = class'MeanZombieGorefast'; - record.HL = 0.0; - record.MeanHLBonus = 0.5; - record.bNeedsReplacement = bReplaceGorefast; - ZedDatabase[i++] = record; + ZedDatabase[3].bNeedsReplacement = bReplaceGorefast; // - Bloat - record.ZedName = "Bloat"; - record.ZedType = class'NiceZombieBloat'; - record.MeanZedType = class'MeanZombieBloat'; - record.HL = 0.0; - record.MeanHLBonus = 0.5; - record.bNeedsReplacement = bReplaceBloat; - ZedDatabase[i++] = record; + ZedDatabase[4].bNeedsReplacement = bReplaceBloat; // - Siren - record.ZedName = "Siren"; - record.ZedType = class'NiceZombieSiren'; - record.MeanZedType = class'MeanZombieSiren'; - record.HL = 1.0; - record.MeanHLBonus = 1.0; - record.bNeedsReplacement = bReplaceSiren; - ZedDatabase[i++] = record; + ZedDatabase[5].bNeedsReplacement = bReplaceSiren; // - Husk - record.ZedName = "Husk"; - record.ZedType = class'NiceZombieHusk'; - record.MeanZedType = class'MeanZombieHusk'; - record.HL = 1.0; - record.MeanHLBonus = 1.5; - record.bNeedsReplacement = bReplaceHusk; - ZedDatabase[i++] = record; + ZedDatabase[6].bNeedsReplacement = bReplaceHusk; // - Scrake - record.ZedName = "Scrake"; - record.ZedType = class'NiceZombieScrake'; - record.MeanZedType = class'MeanZombieScrake'; - record.HL = 1.5; - record.MeanHLBonus = 1.5; - record.bNeedsReplacement = bReplaceScrake; - ZedDatabase[i++] = record; + ZedDatabase[7].bNeedsReplacement = bReplaceScrake; // - Fleshpound - lastStandardZed = i; - record.ZedName = "Fleshpound"; - record.ZedType = class'NiceZombieFleshPound'; - record.MeanZedType = class'MeanZombieFleshPound'; - record.HL = 2.5; - record.MeanHLBonus = 1.5; - record.bNeedsReplacement = bReplaceFleshpound; - ZedDatabase[i++] = record; - // - Shiver - record.ZedName = "Shiver"; - record.ZedType = class'NiceZombieShiver'; - record.MeanZedType = none; - record.HL = 1; - record.bNeedsReplacement = false; - ZedDatabase[i++] = record; - // - Jason - record.ZedName = "Jason"; - record.ZedType = class'NiceZombieJason'; - record.MeanZedType = none; - record.HL = 1.5; - record.bNeedsReplacement = false; - ZedDatabase[i++] = record; - // - Tesla Husk - record.ZedName = "Tesla husk"; - record.ZedType = class'NiceZombieTeslaHusk'; - record.MeanZedType = none; - record.HL = 1.5; - record.bNeedsReplacement = false; - ZedDatabase[i++] = record; - // - Brute - record.ZedName = "Brute"; - record.ZedType = class'NiceZombieBrute'; - record.MeanZedType = none; - record.HL = 2; - record.bNeedsReplacement = false; - ZedDatabase[i++] = record; - // - Ghost - record.ZedName = "Ghost"; - record.ZedType = class'NiceZombieGhost'; - record.MeanZedType = none; - record.HL = 0.5; - record.bNeedsReplacement = false; - ZedDatabase[i++] = record; - // - Sick - record.ZedName = "Sick"; - record.ZedType = class'NiceZombieSick'; - record.MeanZedType = none; - record.HL = 1.0; - record.bNeedsReplacement = false; - ZedDatabase[i++] = record; - // Nothing has yet spawned - for(i = 0;i < ZedDatabase.length;i ++){ - ZedDatabase[i].bAlreadySpawned = false; - ZedDatabase[i].bMeanAlreadySpawned = false; - } + ZedDatabase[8].bNeedsReplacement = bReplaceFleshpound; + // FIXME!!! + lastStandardZed = 8; + // Add voting for mean zeds VH = class'ScrnVotingHandlerMut'.static.GetVotingHandler(Level.Game); if(VH == none){ @@ -361,6 +263,7 @@ simulated function PostBeginPlay(){ else log("Unable to spawn voting handler mutator", class.outer.name); } + simulated function PostNetBeginPlay() { super.PostNetBeginPlay(); @@ -1032,6 +935,21 @@ static function string GetDescriptionText(string SettingName){ } defaultproperties { + ZedDatabase(0)=(ZedName="Clot",ZedType=class'NiceZombieClot',MeanZedType=class'MeanZombieClot',HL=0.0,MeanHLBonus=0.5) + ZedDatabase(1)=(ZedName="Crawler",ZedType=class'NiceZombieCrawler',MeanZedType=class'MeanZombieCrawler',HL=0.5,MeanHLBonus=1.5) + ZedDatabase(2)=(ZedName="Stalker",ZedType=class'NiceZombieStalker',MeanZedType=class'MeanZombieStalker',HL=0.5,MeanHLBonus=0.5) + ZedDatabase(3)=(ZedName="Gorefast",ZedType=class'NiceZombieGorefast',MeanZedType=class'MeanZombieGorefast',HL=0.0,MeanHLBonus=0.5) + ZedDatabase(4)=(ZedName="Bloat",ZedType=class'NiceZombieBloat',MeanZedType=class'MeanZombieBloat',HL=0.0,MeanHLBonus=0.5) + ZedDatabase(5)=(ZedName="Siren",ZedType=class'NiceZombieSiren',MeanZedType=class'MeanZombieSiren',HL=1.0,MeanHLBonus=1.0) + ZedDatabase(6)=(ZedName="Husk",ZedType=class'NiceZombieHusk',MeanZedType=class'MeanZombieHusk',HL=1.0,MeanHLBonus=1.5) + ZedDatabase(7)=(ZedName="Scrake",ZedType=class'NiceZombieScrake',MeanZedType=class'MeanZombieScrake',HL=1.5,MeanHLBonus=1.5) + ZedDatabase(8)=(ZedName="Fleshpound",ZedType=class'NiceZombieFleshPound',MeanZedType=class'MeanZombieFleshPound',HL=2.5,MeanHLBonus=1.5) + ZedDatabase(9)=(ZedName="Shiver",ZedType=class'NiceZombieShiver',HL=1.0) + ZedDatabase(10)=(ZedName="Jason",ZedType=class'NiceZombieJason',HL=1.5) + ZedDatabase(11)=(ZedName="Tesla Husk",ZedType=class'NiceZombieTeslaHusk',HL=1.5) + ZedDatabase(12)=(ZedName="Brute",ZedType=class'NiceZombieBrute',HL=2.0) + ZedDatabase(13)=(ZedName="Ghost",ZedType=class'NiceZombieGhost',HL=0.5) + ZedDatabase(14)=(ZedName="Sick",ZedType=class'NiceZombieSick',HL=1.0) bScaleZedHealth=True bReplacePickups=True bInitialTrader=True -- 2.20.1 From e9e92c5e4d4c5d1d89d424ead836f4bebf014449 Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Wed, 23 Feb 2022 22:56:24 +0400 Subject: [PATCH 07/23] fix armor spawning --- sources/NiceRandomItemSpawn.uc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sources/NiceRandomItemSpawn.uc b/sources/NiceRandomItemSpawn.uc index 5d8a7a8..17e8bce 100644 --- a/sources/NiceRandomItemSpawn.uc +++ b/sources/NiceRandomItemSpawn.uc @@ -9,6 +9,7 @@ defaultproperties PickupClasses(4)=Class'NiceWinchesterPickup' PickupClasses(5)=Class'NiceM79Pickup' PickupClasses(6)=Class'NiceAxePickup' - PickupClasses(7)=Class'ScrnVestPickup' - PickupClasses(8)=class'NiceMAC10Pickup' + // mut's checkreplcmt will change this to proper class! + PickupClasses(7)=Class'KFMod.Vest' + PickupClasses(8)=class'NiceMAC10Pickup' } \ No newline at end of file -- 2.20.1 From 7fc6d92410d948fdf27274b8c8313b73c734dc0b Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Thu, 24 Feb 2022 14:36:29 +0400 Subject: [PATCH 08/23] fix kris's skin, better variant class handling --- sources/NicePack.uc | 19 ++++++------------- .../AssaultRifles/SCAR/NiceSCARMK17Pickup.uc | 6 ++++-- .../Pistols/Deagle/NiceDeaglePickup.uc | 6 ++++-- .../Pistols/Deagle/NiceDualDeaglePickup.uc | 6 ++++-- .../Pistols/Magnum/NiceDualMagnumPickup.uc | 4 +++- .../Pistols/Magnum/NiceMagnumPickup.uc | 4 +++- .../Playable/SMG/Kriss/NiceKrissMPickup.uc | 6 ++++-- .../SniperWeapons/M14EBR/NiceM14EBRPickup.uc | 4 +++- .../SniperWeapons/Mauler/NiceMaulerPickup.uc | 4 +++- .../Winchester/NiceWinchesterPickup.uc | 3 ++- 10 files changed, 36 insertions(+), 26 deletions(-) diff --git a/sources/NicePack.uc b/sources/NicePack.uc index 39d6d36..65e2910 100644 --- a/sources/NicePack.uc +++ b/sources/NicePack.uc @@ -167,30 +167,23 @@ function PreBeginPlay() simulated function PostBeginPlay() { - local int i; local ScrnVotingHandlerMut VH; local MeanVoting VO; local NiceFFVoting FFVO; + super.PostBeginPlay(); + class'ScrnLightVestPickup'.default.cost = 50; class'ScrnHorzineVestPickup'.default.weight = 2; class'ScrnHorzineVestPickup'.default.cost = 750; class'NicePack'.default.Mut = self; - // Gun skins - class'NiceMaulerPickup'.default.VariantClasses[class'NiceMaulerPickup'.default.VariantClasses.length] = class'ScrnSPSniperPickup'; - class'NiceDeaglePickup'.default.VariantClasses[class'NiceDeaglePickup'.default.VariantClasses.length] = class'SkinExecutionerPickup'; - class'NiceDualDeaglePickup'.default.VariantClasses[class'NiceDualDeaglePickup'.default.VariantClasses.length] = class'SkinDualExecutionerPickup'; - class'NiceMagnumPickup'.default.VariantClasses[class'NiceMagnumPickup'.default.VariantClasses.length] = class'SkinCowboyMagnumPickup'; - class'NiceDualMagnumPickup'.default.VariantClasses[class'NiceDualMagnumPickup'.default.VariantClasses.length] = class'SkinDualCowboyMagnumPickup'; - class'NiceWinchesterPickup'.default.VariantClasses[class'NiceWinchesterPickup'.default.VariantClasses.length] = class'SkinRetroLARPickup'; - class'NiceM14EBRPickup'.default.VariantClasses[class'NiceM14EBRPickup'.default.VariantClasses.length] = class'SkinM14EBR2ProPickup'; - class'ScrnKrissMPickup'.default.VariantClasses[class'ScrnKrissMPickup'.default.VariantClasses.length] = class'SkinGoldenKrissPickup'; - class'NiceSCARMK17Pickup'.default.VariantClasses[class'NiceSCARMK17Pickup'.default.VariantClasses.length] = class'SkinCamoSCARMK17Pickup'; + // Abilities class'NiceAbilityManager'.default.events.static.AddAdapter(class'NiceSharpshooterAbilitiesAdapter', level); class'NiceAbilityManager'.default.events.static.AddAdapter(class'NiceEnforcerAbilitiesAdapter', level); + SetTimer(0.25, true); - if(Role < ROLE_Authority) + if (Role < ROLE_Authority) return; // Create sync node serverStorage = new class'NiceStorageServer'; @@ -223,8 +216,8 @@ simulated function PostBeginPlay() // -- Lower starting HL ScrnMut.GameRules.HardcoreLevel -= 7; ScrnMut.GameRules.HardcoreLevelFloat -= 7; + // -- Fill-in zed info - i = 0; // - Clot ZedDatabase[0].bNeedsReplacement = bReplaceClot; // - Crawler diff --git a/sources/Weapons/Playable/AssaultRifles/SCAR/NiceSCARMK17Pickup.uc b/sources/Weapons/Playable/AssaultRifles/SCAR/NiceSCARMK17Pickup.uc index f8be612..6052a53 100644 --- a/sources/Weapons/Playable/AssaultRifles/SCAR/NiceSCARMK17Pickup.uc +++ b/sources/Weapons/Playable/AssaultRifles/SCAR/NiceSCARMK17Pickup.uc @@ -1,6 +1,9 @@ class NiceSCARMK17Pickup extends NiceWeaponPickup; + defaultproperties { + VariantClasses(0)=class'KFMod.NeonSCARMK17Pickup' + VariantClasses(1)=class'SkinCamoSCARMK17Pickup' Weight=8.000000 cost=1250 AmmoCost=28 @@ -15,7 +18,6 @@ defaultproperties AmmoMesh=StaticMesh'KillingFloorStatics.L85Ammo' CorrespondingPerkIndex=3 EquipmentCategoryID=3 - VariantClasses(0)=Class'KFMod.NeonSCARMK17Pickup' InventoryType=class'NiceSCARMK17AssaultRifle' PickupMessage="You got the SCARMK17" PickupSound=Sound'KF_SCARSnd.SCAR_Pickup' @@ -23,4 +25,4 @@ defaultproperties StaticMesh=StaticMesh'KF_pickups2_Trip.Rifles.SCAR_Pickup' CollisionRadius=25.000000 CollisionHeight=5.000000 -} +} \ No newline at end of file diff --git a/sources/Weapons/Playable/Pistols/Deagle/NiceDeaglePickup.uc b/sources/Weapons/Playable/Pistols/Deagle/NiceDeaglePickup.uc index c3faef6..58e0299 100644 --- a/sources/Weapons/Playable/Pistols/Deagle/NiceDeaglePickup.uc +++ b/sources/Weapons/Playable/Pistols/Deagle/NiceDeaglePickup.uc @@ -1,6 +1,9 @@ class NiceDeaglePickup extends NiceSinglePickup; + defaultproperties { + VariantClasses(0)=class'SkinExecutionerPickup' + VariantClasses(1)=class'SkinGoldenDeaglePickup' Weight=2.000000 cost=250 AmmoCost=14 @@ -13,9 +16,8 @@ defaultproperties ItemShortName="Deagle" AmmoItemName=".300 JHP Ammo" AmmoMesh=None - VariantClasses(0)=class'SkinGoldenDeaglePickup' InventoryType=class'NiceDeagle' PickupMessage="You got the Desert Eagle" PickupSound=Sound'KF_HandcannonSnd.50AE_Pickup' StaticMesh=StaticMesh'KF_pickups_Trip.pistol.deagle_pickup' -} +} \ No newline at end of file diff --git a/sources/Weapons/Playable/Pistols/Deagle/NiceDualDeaglePickup.uc b/sources/Weapons/Playable/Pistols/Deagle/NiceDualDeaglePickup.uc index 8f20e53..98dce8c 100644 --- a/sources/Weapons/Playable/Pistols/Deagle/NiceDualDeaglePickup.uc +++ b/sources/Weapons/Playable/Pistols/Deagle/NiceDualDeaglePickup.uc @@ -1,6 +1,9 @@ class NiceDualDeaglePickup extends NiceDualiesPickup; + defaultproperties { + VariantClasses(0)=class'SkinDualExecutionerPickup' + VariantClasses(1)=class'SkinGoldenDualDeaglePickup' Weight=4.000000 cost=500 AmmoCost=28 @@ -13,9 +16,8 @@ defaultproperties ItemShortName="Dual Deagles" AmmoItemName=".300 JHP Ammo" AmmoMesh=StaticMesh'KillingFloorStatics.DeagleAmmo' - VariantClasses(0)=class'SkinGoldenDualDeaglePickup' InventoryType=class'NiceDualDeagle' PickupMessage="You found another Handcannon" PickupSound=Sound'KF_HandcannonSnd.50AE_Pickup' StaticMesh=StaticMesh'KF_pickups_Trip.pistol.deagle_pickup' -} +} \ No newline at end of file diff --git a/sources/Weapons/Playable/Pistols/Magnum/NiceDualMagnumPickup.uc b/sources/Weapons/Playable/Pistols/Magnum/NiceDualMagnumPickup.uc index a8b251b..4ca0a2d 100644 --- a/sources/Weapons/Playable/Pistols/Magnum/NiceDualMagnumPickup.uc +++ b/sources/Weapons/Playable/Pistols/Magnum/NiceDualMagnumPickup.uc @@ -1,6 +1,8 @@ class NiceDualMagnumPickup extends NiceDualiesPickup; + defaultproperties { + VariantClasses(0)=class'SkinDualCowboyMagnumPickup' Weight=4.000000 cost=250 AmmoCost=10 @@ -17,4 +19,4 @@ defaultproperties PickupMessage="You found another 44 Magnum" PickupSound=Sound'KF_RevolverSnd.foley.WEP_Revolver_Foley_Pickup' StaticMesh=StaticMesh'KF_pickups3_Trip.Pistols.revolver_Pickup' -} +} \ No newline at end of file diff --git a/sources/Weapons/Playable/Pistols/Magnum/NiceMagnumPickup.uc b/sources/Weapons/Playable/Pistols/Magnum/NiceMagnumPickup.uc index 08e8141..db4bdee 100644 --- a/sources/Weapons/Playable/Pistols/Magnum/NiceMagnumPickup.uc +++ b/sources/Weapons/Playable/Pistols/Magnum/NiceMagnumPickup.uc @@ -1,6 +1,8 @@ class NiceMagnumPickup extends NiceSinglePickup; + defaultproperties { + VariantClasses(0)=class'SkinCowboyMagnumPickup' Weight=2.000000 cost=125 AmmoCost=5 @@ -17,4 +19,4 @@ defaultproperties PickupMessage="You got the 44 Magnum" PickupSound=Sound'KF_RevolverSnd.foley.WEP_Revolver_Foley_Pickup' StaticMesh=StaticMesh'KF_pickups3_Trip.Pistols.revolver_Pickup' -} +} \ No newline at end of file diff --git a/sources/Weapons/Playable/SMG/Kriss/NiceKrissMPickup.uc b/sources/Weapons/Playable/SMG/Kriss/NiceKrissMPickup.uc index 5729cb8..d8ec776 100644 --- a/sources/Weapons/Playable/SMG/Kriss/NiceKrissMPickup.uc +++ b/sources/Weapons/Playable/SMG/Kriss/NiceKrissMPickup.uc @@ -1,6 +1,9 @@ class NiceKrissMPickup extends NiceWeaponPickup; + defaultproperties { + VariantClasses(0)=class'KFMod.NeonKrissMPickup' + VariantClasses(1)=class'SkinGoldenKrissPickup' Weight=4.000000 cost=750 AmmoCost=22 @@ -15,7 +18,6 @@ defaultproperties AmmoMesh=StaticMesh'KillingFloorStatics.L85Ammo' EquipmentCategoryID=3 CorrespondingPerkIndex=3 - VariantClasses(0)=Class'KFMod.NeonKrissMPickup' InventoryType=class'NiceKrissMMedicGun' PickupMessage="You got the KRISS Vector Medic Gun" PickupSound=Sound'KF_KrissSND.Handling.KF_WEP_KRISS_Handling_Pickup' @@ -23,4 +25,4 @@ defaultproperties StaticMesh=StaticMesh'KF_pickups6_Trip.Rifles.Kriss_Pickup' CollisionRadius=25.000000 CollisionHeight=5.000000 -} +} \ No newline at end of file diff --git a/sources/Weapons/Playable/SniperWeapons/M14EBR/NiceM14EBRPickup.uc b/sources/Weapons/Playable/SniperWeapons/M14EBR/NiceM14EBRPickup.uc index 6465df0..14a32e4 100644 --- a/sources/Weapons/Playable/SniperWeapons/M14EBR/NiceM14EBRPickup.uc +++ b/sources/Weapons/Playable/SniperWeapons/M14EBR/NiceM14EBRPickup.uc @@ -1,6 +1,8 @@ class NiceM14EBRPickup extends NiceWeaponPickup; + defaultproperties { + VariantClasses(0)=class'SkinM14EBR2ProPickup' Weight=8.000000 cost=1000 AmmoCost=25 @@ -22,4 +24,4 @@ defaultproperties StaticMesh=StaticMesh'KF_pickups2_Trip.Rifles.M14_EBR_Pickup' CollisionRadius=25.000000 CollisionHeight=5.000000 -} +} \ No newline at end of file diff --git a/sources/Weapons/Playable/SniperWeapons/Mauler/NiceMaulerPickup.uc b/sources/Weapons/Playable/SniperWeapons/Mauler/NiceMaulerPickup.uc index c701fd0..2af1216 100644 --- a/sources/Weapons/Playable/SniperWeapons/Mauler/NiceMaulerPickup.uc +++ b/sources/Weapons/Playable/SniperWeapons/Mauler/NiceMaulerPickup.uc @@ -1,6 +1,8 @@ class NiceMaulerPickup extends NiceWeaponPickup; + defaultproperties { + VariantClasses(0)=class'ScrnSPSniperPickup' Weight=6.000000 cost=750 AmmoCost=22 @@ -21,4 +23,4 @@ defaultproperties StaticMesh=StaticMesh'NicePackSM.Silver.SniperRifle' CollisionRadius=25.000000 CollisionHeight=5.000000 -} +} \ No newline at end of file diff --git a/sources/Weapons/Playable/SniperWeapons/Winchester/NiceWinchesterPickup.uc b/sources/Weapons/Playable/SniperWeapons/Winchester/NiceWinchesterPickup.uc index bc4ca9c..8a94c4c 100644 --- a/sources/Weapons/Playable/SniperWeapons/Winchester/NiceWinchesterPickup.uc +++ b/sources/Weapons/Playable/SniperWeapons/Winchester/NiceWinchesterPickup.uc @@ -2,6 +2,7 @@ class NiceWinchesterPickup extends NiceWeaponPickup; defaultproperties { + VariantClasses(0)=class'SkinRetroLARPickup' Weight=6.000000 AmmoCost=13 cost=250 @@ -22,4 +23,4 @@ defaultproperties StaticMesh=StaticMesh'KF_pickups_Trip.Rifle.LeverAction_pickup' CollisionRadius=30.000000 CollisionHeight=5.000000 -} +} \ No newline at end of file -- 2.20.1 From fd6980a58168609c68ceb92d542ee1798c48dfc1 Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Thu, 24 Feb 2022 14:45:15 +0400 Subject: [PATCH 09/23] replace func with native one --- sources/NicePack.uc | 50 ++++++--------------------------------------- 1 file changed, 6 insertions(+), 44 deletions(-) diff --git a/sources/NicePack.uc b/sources/NicePack.uc index 65e2910..ca3b4d4 100644 --- a/sources/NicePack.uc +++ b/sources/NicePack.uc @@ -515,7 +515,9 @@ function GiveProgressiveDosh(NicePlayerController nicePlayer){ record.lastCashWave = nextWave; UpdatePlayerRecord(record); } -simulated function Mutate(string MutateString, PlayerController kfPlayer){ + +simulated function Mutate(string MutateString, PlayerController kfPlayer) +{ local int i, readLenght; local NicePlayerController nicePlayer; local NiceServerData remoteData; @@ -529,10 +531,11 @@ simulated function Mutate(string MutateString, PlayerController kfPlayer){ // Always contains at least 10 elements, that may be empty strings if there wasn't enough modifiers. // Done for safe access without the need to check for bounds. local array modArray; + // Helpful sequence white = chr(27)$chr(200)$chr(200)$chr(200); // Transform our command into array for convenience - wordsArray = SplitString(MutateString, " "); + Split(MutateString, " ", wordsArray); // Exit if command is empty if(wordsArray.Length == 0) return; @@ -815,48 +818,7 @@ function BroadcastSkills(){ } } } -// Function for string splitting, because why would we have it as a standard function? It would be silly, right? -function array SplitString(string inputString, string div){ - local array parts; - local bool bEOL; - local string tempChar; - local int preCount, curCount, partCount, strLength; - strLength = Len(inputString); - if(strLength == 0) - return parts; - bEOL = false; - preCount = 0; - curCount = 0; - partCount = 0; - while(!bEOL) - { - tempChar = Mid(inputString, curCount, 1); - if(tempChar != div) - curCount ++; - else - { - if(curCount == preCount) - { - curCount ++; - preCount ++; - } - else - { - parts[partCount] = Mid(inputString, preCount, curCount - preCount); - partCount ++; - preCount = curCount + 1; - curCount = preCount; - } - } - if(curCount == strLength) - { - if(preCount != strLength) - parts[partCount] = Mid(inputString, preCount, curCount); - bEOL = true; - } - } - return parts; -} + // Function for broadcasting messages to players function BroadcastToAll(string message){ local Controller P; -- 2.20.1 From db74083bbd424fb901317b25a617c794c4e23a90 Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Thu, 24 Feb 2022 14:48:35 +0400 Subject: [PATCH 10/23] a --- sources/NicePack.uc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/NicePack.uc b/sources/NicePack.uc index ca3b4d4..6fc83b7 100644 --- a/sources/NicePack.uc +++ b/sources/NicePack.uc @@ -532,6 +532,8 @@ simulated function Mutate(string MutateString, PlayerController kfPlayer) // Done for safe access without the need to check for bounds. local array modArray; + super.Mutate(MutateString, kfPlayer); + // Helpful sequence white = chr(27)$chr(200)$chr(200)$chr(200); // Transform our command into array for convenience @@ -630,7 +632,6 @@ simulated function Mutate(string MutateString, PlayerController kfPlayer) nicePlayer.ClientMessage("Compressed lenght:" @ string(inputStream.GetSizeInBytes()) ); nicePlayer.ClientMessage("Output:"@outputStream.ReadClassName(readLenght)); } - Super.Mutate(MutateString, kfPlayer); } /* Good test for writer else if(command ~= "TEST"){ -- 2.20.1 From ff0782d1f2be5903b7ed4eb86d7afff33fc5331e Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Thu, 24 Feb 2022 14:45:15 +0400 Subject: [PATCH 11/23] replace func with native one --- sources/NicePack.uc | 53 +++++++-------------------------------------- 1 file changed, 8 insertions(+), 45 deletions(-) diff --git a/sources/NicePack.uc b/sources/NicePack.uc index 65e2910..6fc83b7 100644 --- a/sources/NicePack.uc +++ b/sources/NicePack.uc @@ -515,7 +515,9 @@ function GiveProgressiveDosh(NicePlayerController nicePlayer){ record.lastCashWave = nextWave; UpdatePlayerRecord(record); } -simulated function Mutate(string MutateString, PlayerController kfPlayer){ + +simulated function Mutate(string MutateString, PlayerController kfPlayer) +{ local int i, readLenght; local NicePlayerController nicePlayer; local NiceServerData remoteData; @@ -529,10 +531,13 @@ simulated function Mutate(string MutateString, PlayerController kfPlayer){ // Always contains at least 10 elements, that may be empty strings if there wasn't enough modifiers. // Done for safe access without the need to check for bounds. local array modArray; + + super.Mutate(MutateString, kfPlayer); + // Helpful sequence white = chr(27)$chr(200)$chr(200)$chr(200); // Transform our command into array for convenience - wordsArray = SplitString(MutateString, " "); + Split(MutateString, " ", wordsArray); // Exit if command is empty if(wordsArray.Length == 0) return; @@ -627,7 +632,6 @@ simulated function Mutate(string MutateString, PlayerController kfPlayer){ nicePlayer.ClientMessage("Compressed lenght:" @ string(inputStream.GetSizeInBytes()) ); nicePlayer.ClientMessage("Output:"@outputStream.ReadClassName(readLenght)); } - Super.Mutate(MutateString, kfPlayer); } /* Good test for writer else if(command ~= "TEST"){ @@ -815,48 +819,7 @@ function BroadcastSkills(){ } } } -// Function for string splitting, because why would we have it as a standard function? It would be silly, right? -function array SplitString(string inputString, string div){ - local array parts; - local bool bEOL; - local string tempChar; - local int preCount, curCount, partCount, strLength; - strLength = Len(inputString); - if(strLength == 0) - return parts; - bEOL = false; - preCount = 0; - curCount = 0; - partCount = 0; - while(!bEOL) - { - tempChar = Mid(inputString, curCount, 1); - if(tempChar != div) - curCount ++; - else - { - if(curCount == preCount) - { - curCount ++; - preCount ++; - } - else - { - parts[partCount] = Mid(inputString, preCount, curCount - preCount); - partCount ++; - preCount = curCount + 1; - curCount = preCount; - } - } - if(curCount == strLength) - { - if(preCount != strLength) - parts[partCount] = Mid(inputString, preCount, curCount); - bEOL = true; - } - } - return parts; -} + // Function for broadcasting messages to players function BroadcastToAll(string message){ local Controller P; -- 2.20.1 From e4b2f7396900ad79e4f93c934c057c699d01e8db Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Thu, 24 Feb 2022 15:02:50 +0400 Subject: [PATCH 12/23] unused super code removed --- sources/NiceHumanPawn.uc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sources/NiceHumanPawn.uc b/sources/NiceHumanPawn.uc index 8970d8a..ab83d3d 100644 --- a/sources/NiceHumanPawn.uc +++ b/sources/NiceHumanPawn.uc @@ -63,14 +63,16 @@ simulated function bool IsZedExtentionsRecorded(NiceMonster niceZed){ return true; return false; } -function ReplaceRequiredEquipment(){ - Super.ReplaceRequiredEquipment(); - RequiredEquipment[0] = String(class'NiceMachete'); - RequiredEquipment[1] = String(class'Nice9mmPlus'); - RequiredEquipment[2] = String(class'ScrnFrag'); - RequiredEquipment[3] = String(class'ScrnSyringe'); - RequiredEquipment[4] = String(class'KFMod.Welder'); + +function ReplaceRequiredEquipment() +{ + RequiredEquipment[0] = string(class'NiceMachete'); + RequiredEquipment[1] = string(class'Nice9mmPlus'); + RequiredEquipment[2] = string(class'ScrnFrag'); + RequiredEquipment[3] = string(class'ScrnSyringe'); + RequiredEquipment[4] = string(class'KFMod.Welder'); } + simulated function int CalculateCalibrationScore(){ local float accuracy; accuracy = (float(calibrationHits)) / (float(calibrationTotalShots)); -- 2.20.1 From 79b9151c66e5148a384031b975560b7e279c9504 Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Thu, 24 Feb 2022 15:18:05 +0400 Subject: [PATCH 13/23] skip scrn code in CanBuyNow() --- sources/NiceHumanPawn.uc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sources/NiceHumanPawn.uc b/sources/NiceHumanPawn.uc index ab83d3d..a074992 100644 --- a/sources/NiceHumanPawn.uc +++ b/sources/NiceHumanPawn.uc @@ -491,15 +491,17 @@ simulated function ClientChangeWeapon(NiceWeapon newWeap){ // Validate that client is not hacking. function bool CanBuyNow() { - local NicePlayerController niceController; + local NiceGameType NiceGT; - niceController = NicePlayerController(Controller); - if (niceController == none) + NiceGT = NiceGameType(Level.Game); + if (NicePlayerController(Controller) == none) return false; - if (NiceGameType(Level.Game) != none && NiceGameType(Level.Game).NicePackMutator != none - && NiceGameType(Level.Game).NicePackMutator.bIsPreGame) + if (NiceGT != none && NiceGT.NicePackMutator != none + && NiceGT.NicePackMutator.bIsPreGame) return true; - return Super.CanBuyNow(); + + // skip Scrn code! + return super(KFPawn).CanBuyNow(); } // Overridden to not modify dual pistols' weapon group -- 2.20.1 From af04a01d46c9e401c3fd8251a6de25d038c19a06 Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Fri, 25 Feb 2022 14:53:39 +0400 Subject: [PATCH 14/23] remove unused code, comments --- sources/NiceHumanPawn.uc | 1 + sources/NicePack.uc | 68 ++++++++++++++++++++-------------------- 2 files changed, 35 insertions(+), 34 deletions(-) diff --git a/sources/NiceHumanPawn.uc b/sources/NiceHumanPawn.uc index a074992..6adfcb8 100644 --- a/sources/NiceHumanPawn.uc +++ b/sources/NiceHumanPawn.uc @@ -64,6 +64,7 @@ simulated function bool IsZedExtentionsRecorded(NiceMonster niceZed){ return false; } +// TODO remove this Scrn func function ReplaceRequiredEquipment() { RequiredEquipment[0] = string(class'NiceMachete'); diff --git a/sources/NicePack.uc b/sources/NicePack.uc index 6fc83b7..ea1da92 100644 --- a/sources/NicePack.uc +++ b/sources/NicePack.uc @@ -104,8 +104,6 @@ struct WeaponProgressDisplay{ var int counter; }; var array niceWeapProgressSet; -// Map Description array -var const array NiceUniversalDescriptions[4]; // Replication of config between player and server var int SrvFlags; var array playersList; @@ -889,23 +887,34 @@ static function string GetDescriptionText(string SettingName){ } return Super.GetDescriptionText(SettingName); } + defaultproperties { - ZedDatabase(0)=(ZedName="Clot",ZedType=class'NiceZombieClot',MeanZedType=class'MeanZombieClot',HL=0.0,MeanHLBonus=0.5) - ZedDatabase(1)=(ZedName="Crawler",ZedType=class'NiceZombieCrawler',MeanZedType=class'MeanZombieCrawler',HL=0.5,MeanHLBonus=1.5) - ZedDatabase(2)=(ZedName="Stalker",ZedType=class'NiceZombieStalker',MeanZedType=class'MeanZombieStalker',HL=0.5,MeanHLBonus=0.5) - ZedDatabase(3)=(ZedName="Gorefast",ZedType=class'NiceZombieGorefast',MeanZedType=class'MeanZombieGorefast',HL=0.0,MeanHLBonus=0.5) - ZedDatabase(4)=(ZedName="Bloat",ZedType=class'NiceZombieBloat',MeanZedType=class'MeanZombieBloat',HL=0.0,MeanHLBonus=0.5) - ZedDatabase(5)=(ZedName="Siren",ZedType=class'NiceZombieSiren',MeanZedType=class'MeanZombieSiren',HL=1.0,MeanHLBonus=1.0) - ZedDatabase(6)=(ZedName="Husk",ZedType=class'NiceZombieHusk',MeanZedType=class'MeanZombieHusk',HL=1.0,MeanHLBonus=1.5) - ZedDatabase(7)=(ZedName="Scrake",ZedType=class'NiceZombieScrake',MeanZedType=class'MeanZombieScrake',HL=1.5,MeanHLBonus=1.5) - ZedDatabase(8)=(ZedName="Fleshpound",ZedType=class'NiceZombieFleshPound',MeanZedType=class'MeanZombieFleshPound',HL=2.5,MeanHLBonus=1.5) - ZedDatabase(9)=(ZedName="Shiver",ZedType=class'NiceZombieShiver',HL=1.0) + GroupName="KFNicePack" + FriendlyName="Package for nice/mean servers" + Description="Does stuff." + bAlwaysRelevant=True + RemoteRole=ROLE_SimulatedProxy + bAddToServerPackages=True + + // used in scrn voting and HL calculation + // TODO remove HL! + ZedDatabase(00)=(ZedName="Clot",ZedType=class'NiceZombieClot',MeanZedType=class'MeanZombieClot',HL=0.0,MeanHLBonus=0.5) + ZedDatabase(01)=(ZedName="Crawler",ZedType=class'NiceZombieCrawler',MeanZedType=class'MeanZombieCrawler',HL=0.5,MeanHLBonus=1.5) + ZedDatabase(02)=(ZedName="Stalker",ZedType=class'NiceZombieStalker',MeanZedType=class'MeanZombieStalker',HL=0.5,MeanHLBonus=0.5) + ZedDatabase(03)=(ZedName="Gorefast",ZedType=class'NiceZombieGorefast',MeanZedType=class'MeanZombieGorefast',HL=0.0,MeanHLBonus=0.5) + ZedDatabase(04)=(ZedName="Bloat",ZedType=class'NiceZombieBloat',MeanZedType=class'MeanZombieBloat',HL=0.0,MeanHLBonus=0.5) + ZedDatabase(05)=(ZedName="Siren",ZedType=class'NiceZombieSiren',MeanZedType=class'MeanZombieSiren',HL=1.0,MeanHLBonus=1.0) + ZedDatabase(06)=(ZedName="Husk",ZedType=class'NiceZombieHusk',MeanZedType=class'MeanZombieHusk',HL=1.0,MeanHLBonus=1.5) + ZedDatabase(07)=(ZedName="Scrake",ZedType=class'NiceZombieScrake',MeanZedType=class'MeanZombieScrake',HL=1.5,MeanHLBonus=1.5) + ZedDatabase(08)=(ZedName="Fleshpound",ZedType=class'NiceZombieFleshPound',MeanZedType=class'MeanZombieFleshPound',HL=2.5,MeanHLBonus=1.5) + ZedDatabase(09)=(ZedName="Shiver",ZedType=class'NiceZombieShiver',HL=1.0) ZedDatabase(10)=(ZedName="Jason",ZedType=class'NiceZombieJason',HL=1.5) ZedDatabase(11)=(ZedName="Tesla Husk",ZedType=class'NiceZombieTeslaHusk',HL=1.5) ZedDatabase(12)=(ZedName="Brute",ZedType=class'NiceZombieBrute',HL=2.0) ZedDatabase(13)=(ZedName="Ghost",ZedType=class'NiceZombieGhost',HL=0.5) ZedDatabase(14)=(ZedName="Sick",ZedType=class'NiceZombieSick',HL=1.0) + bScaleZedHealth=True bReplacePickups=True bInitialTrader=True @@ -938,28 +947,19 @@ defaultproperties bNoLateFFIncrease=True junkieNextGoal=1 bIsPreGame=True - pickupReplaceArray(0)=(vanillaClass=Class'KFMod.MAC10Pickup',scrnClass=Class'ScrnMAC10Pickup',NewClass=class'NiceMAC10Pickup') - pickupReplaceArray(1)=(vanillaClass=Class'KFMod.WinchesterPickup',scrnClass=Class'ScrnWinchesterPickup',NewClass=class'NiceWinchesterPickup') - pickupReplaceArray(2)=(vanillaClass=Class'KFMod.CrossbowPickup',scrnClass=Class'ScrnCrossbowPickup',NewClass=class'NiceCrossbowPickup') - pickupReplaceArray(3)=(vanillaClass=Class'KFMod.SPSniperPickup',scrnClass=Class'ScrnSPSniperPickup',NewClass=class'NiceMaulerPickup') - pickupReplaceArray(4)=(vanillaClass=Class'KFMod.M14EBRPickup',scrnClass=Class'ScrnM14EBRPickup',NewClass=class'NiceM14EBRPickup') - pickupReplaceArray(5)=(vanillaClass=Class'KFMod.M99Pickup',scrnClass=Class'ScrnM99Pickup',NewClass=class'NiceM99Pickup') - pickupReplaceArray(6)=(vanillaClass=Class'KFMod.ShotgunPickup',scrnClass=Class'ScrnShotgunPickup',NewClass=class'NiceShotgunPickup') - pickupReplaceArray(7)=(vanillaClass=Class'KFMod.BoomStickPickup',scrnClass=Class'ScrnBoomStickPickup',NewClass=class'NiceBoomStickPickup') - pickupReplaceArray(8)=(vanillaClass=Class'KFMod.NailGunPickup',scrnClass=Class'ScrnNailGunPickup',NewClass=class'NiceNailGunPickup') - pickupReplaceArray(9)=(vanillaClass=Class'KFMod.KSGPickup',scrnClass=Class'ScrnKSGPickup',NewClass=class'NiceKSGPickup') + + // replace pickups that map spawn's itself + pickupReplaceArray(00)=(vanillaClass=Class'KFMod.MAC10Pickup',scrnClass=Class'ScrnMAC10Pickup',NewClass=class'NiceMAC10Pickup') + pickupReplaceArray(01)=(vanillaClass=Class'KFMod.WinchesterPickup',scrnClass=Class'ScrnWinchesterPickup',NewClass=class'NiceWinchesterPickup') + pickupReplaceArray(02)=(vanillaClass=Class'KFMod.CrossbowPickup',scrnClass=Class'ScrnCrossbowPickup',NewClass=class'NiceCrossbowPickup') + pickupReplaceArray(03)=(vanillaClass=Class'KFMod.SPSniperPickup',scrnClass=Class'ScrnSPSniperPickup',NewClass=class'NiceMaulerPickup') + pickupReplaceArray(04)=(vanillaClass=Class'KFMod.M14EBRPickup',scrnClass=Class'ScrnM14EBRPickup',NewClass=class'NiceM14EBRPickup') + pickupReplaceArray(05)=(vanillaClass=Class'KFMod.M99Pickup',scrnClass=Class'ScrnM99Pickup',NewClass=class'NiceM99Pickup') + pickupReplaceArray(06)=(vanillaClass=Class'KFMod.ShotgunPickup',scrnClass=Class'ScrnShotgunPickup',NewClass=class'NiceShotgunPickup') + pickupReplaceArray(07)=(vanillaClass=Class'KFMod.BoomStickPickup',scrnClass=Class'ScrnBoomStickPickup',NewClass=class'NiceBoomStickPickup') + pickupReplaceArray(08)=(vanillaClass=Class'KFMod.NailGunPickup',scrnClass=Class'ScrnNailGunPickup',NewClass=class'NiceNailGunPickup') + pickupReplaceArray(09)=(vanillaClass=Class'KFMod.KSGPickup',scrnClass=Class'ScrnKSGPickup',NewClass=class'NiceKSGPickup') pickupReplaceArray(10)=(vanillaClass=Class'KFMod.BenelliPickup',scrnClass=Class'ScrnBenelliPickup',NewClass=class'NiceBenelliPickup') pickupReplaceArray(11)=(vanillaClass=Class'KFMod.AA12Pickup',scrnClass=Class'ScrnAA12Pickup',NewClass=class'NiceAA12Pickup') pickupReplaceArray(12)=(vanillaClass=Class'KFMod.MachetePickup',scrnClass=Class'ScrnMachetePickup',NewClass=class'NiceMachetePickup') - - NiceUniversalDescriptions(0)="Survive on %m in ScrN Balance mode" - NiceUniversalDescriptions(1)="Survive on %m in ScrN Balance mode with Hardcore Level 5+" - NiceUniversalDescriptions(2)="Survive on %m in ScrN Balance mode with Hardcore Level 10+" - NiceUniversalDescriptions(3)="Survive on %m in ScrN Balance mode with Hardcore Level 15+" - bAddToServerPackages=True - GroupName="KFNicePack" - FriendlyName="Package for nice/mean servers" - Description="Does stuff." - bAlwaysRelevant=True - RemoteRole=ROLE_SimulatedProxy -} +} \ No newline at end of file -- 2.20.1 From 665e19303be9f2aca08dedaf0eba485e2a2643bf Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Fri, 25 Feb 2022 15:50:51 +0400 Subject: [PATCH 15/23] colored, cutom loading hints --- sources/NiceGameType.uc | 46 +++++++++++++++++++++++++----------- sources/Utility.uc | 52 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 14 deletions(-) create mode 100644 sources/Utility.uc diff --git a/sources/NiceGameType.uc b/sources/NiceGameType.uc index 80ca45c..aeb6572 100644 --- a/sources/NiceGameType.uc +++ b/sources/NiceGameType.uc @@ -1,8 +1,10 @@ // made to fix KFStoryGameInfo loading for KFO maps class NiceGameType extends ScrnGameType; + var NicePack NicePackMutator; var bool lessDramatic; var float LesserZedTimeSlomoScale; + function RegisterMutator(NicePack activePack){ NicePackMutator = activePack; } @@ -77,7 +79,7 @@ function ScoreKill(Controller Killer, Controller Other) local Controller C; OtherPRI = Other.PlayerReplicationInfo; - if ( OtherPRI != None ) + if ( OtherPRI != none ) { OtherPRI.NumLives++; OtherPRI.Score -= (OtherPRI.Score * (GameDifficulty * 0.05)); // you Lose 35% of your current cash on Hell on Earth, 15% on normal. @@ -90,23 +92,23 @@ function ScoreKill(Controller Killer, Controller Other) OtherPRI.Team.NetUpdateTime = Level.TimeSeconds - 1; OtherPRI.bOutOfLives = true; - if( Killer!=None && Killer.PlayerReplicationInfo!=None && Killer.bIsPlayer ) + if( Killer!=none && Killer.PlayerReplicationInfo!=none && Killer.bIsPlayer ) BroadcastLocalizedMessage(class'KFInvasionMessage',1,OtherPRI,Killer.PlayerReplicationInfo); - else if( Killer==None || Monster(Killer.Pawn)==None ) + else if( Killer==none || Monster(Killer.Pawn)==none ) BroadcastLocalizedMessage(class'KFInvasionMessage',1,OtherPRI); else BroadcastLocalizedMessage(class'KFInvasionMessage',1,OtherPRI,,Killer.Pawn.Class); - CheckScore(None); + CheckScore(none); } - if ( GameRulesModifiers != None ) + if ( GameRulesModifiers != none ) GameRulesModifiers.ScoreKill(Killer, Other); - if ( MonsterController(Killer) != None ) + if ( MonsterController(Killer) != none ) return; - if( (killer == Other) || (killer == None) ) + if( (killer == Other) || (killer == none) ) { - if ( Other.PlayerReplicationInfo != None ) + if ( Other.PlayerReplicationInfo != none ) { Other.PlayerReplicationInfo.Score -= 1; Other.PlayerReplicationInfo.NetUpdateTime = Level.TimeSeconds - 1; @@ -114,7 +116,7 @@ function ScoreKill(Controller Killer, Controller Other) } } - if ( Killer==None || !Killer.bIsPlayer || (Killer==Other) ) + if ( Killer==none || !Killer.bIsPlayer || (Killer==Other) ) return; if ( Other.bIsPlayer ) @@ -126,7 +128,7 @@ function ScoreKill(Controller Killer, Controller Other) ScoreEvent(Killer.PlayerReplicationInfo, -5, "team_frag"); return; } - if ( LastKilledMonsterClass == None ) + if ( LastKilledMonsterClass == none ) KillScore = 1; else if(Killer.PlayerReplicationInfo !=none) { @@ -179,9 +181,9 @@ function ScoreKill(Controller Killer, Controller Other) if( Class'HUDKillingFloor'.Default.MessageHealthLimit<=Other.Pawn.Default.Health || Class'HUDKillingFloor'.Default.MessageMassLimit<=Other.Pawn.Default.Mass ) { - for( C=Level.ControllerList; C!=None; C=C.nextController ) + for( C=Level.ControllerList; C!=none; C=C.nextController ) { - if( C.bIsPlayer && xPlayer(C)!=None ) + if( C.bIsPlayer && xPlayer(C)!=none ) { xPlayer(C).ReceiveLocalizedMessage(Class'KillsMessage',1,Killer.PlayerReplicationInfo,,Other.Pawn.Class); } @@ -189,7 +191,7 @@ function ScoreKill(Controller Killer, Controller Other) } else { - if( xPlayer(Killer)!=None ) + if( xPlayer(Killer)!=none ) { xPlayer(Killer).ReceiveLocalizedMessage(Class'KillsMessage',,,,Other.Pawn.Class); } @@ -303,10 +305,26 @@ function int ReduceDamage(int Damage, pawn injured, pawn instigatedBy, vector Hi } return Super.ReduceDamage(Damage, injured, InstigatedBy, HitLocation, Momentum, DamageType); } + +// HINTS: override to make fancy loading creen hints +static function string GetLoadingHint(PlayerController pc, string MapName, Color ColorHint) +{ + // call super code just to draw the map icon and description + super.GetLoadingHint(pc, MapName, ColorHint); + // return colored and custom HINTS + return class'Utility'.static.GetNiceHint(); +} + +// HINTS: override to make fancy ingame menu hints +static function array GetAllLoadHints(optional bool bThisClassOnly) +{ + return class'Utility'.static.GetNiceHintArray(); +} + defaultproperties { GameName="Nice Floor" Description="Nice Edition of ScrN Killing Floor game mode (ScrnGameType)." ZedTimeSlomoScale=0.4 LesserZedTimeSlomoScale=0.6 -} +} \ No newline at end of file diff --git a/sources/Utility.uc b/sources/Utility.uc new file mode 100644 index 0000000..6ddf1a3 --- /dev/null +++ b/sources/Utility.uc @@ -0,0 +1,52 @@ +class Utility extends object + abstract; + +// custom, colored hints +var const array NiceHints; + +final static function string GetNiceHint() +{ + local string white, blue; + + white = chr(27) $ chr(200) $ chr(200) $ chr(200); + blue = chr(27) $ chr(1) $ chr(100) $ chr(200); + + return white $ "Nice Floor: " $ blue $ default.NiceHints[rand(default.NiceHints.Length)]; +} + +final static function array GetNiceHintArray() +{ + local int i; + local string white, blue; + local array Hints; + + white = chr(27) $ chr(200) $ chr(200) $ chr(200); + blue = chr(27) $ chr(1) $ chr(100) $ chr(200); + + for ( i = 0; i < default.NiceHints.Length; i++ ) + Hints[Hints.Length] = white $ "Nice Floor: " $ blue $ default.NiceHints[i]; + + return Hints; +} + +defaultproperties +{ + // 'funny', customized hints + NiceHints[00]="Most weapons are clientside, so aim for the heads!" + NiceHints[01]="If you feel this is hard, you are not alone." + NiceHints[02]="This mode will always be in alpha state. Kill your hope." + NiceHints[03]="Only KAIO is able to compile this." + NiceHints[04]="We really hate kiting, so we made camping much harder." + NiceHints[05]="We love camping, so we made kiting almost impossible." + NiceHints[06]="You can play this if you beat 5 faked / 6p HP zeds." + NiceHints[07]="Hold or Die!" + NiceHints[08]="The Wipe Train has no breaks." + NiceHints[09]="We are glad to hear your wishes and requests. Just remember we are super lazy." + NiceHints[10]="If you die - always blame dkanus." + NiceHints[11]="If nothing works - it's intended." + NiceHints[12]="If you find any bug, we can make it a feature." + NiceHints[13]="Play this only if you don't have real life." + NiceHints[14]="You suck and we hate you." + NiceHints[15]="GITGUD" + NiceHints[16]="Git ur shit bucket." +} \ No newline at end of file -- 2.20.1 From ff332c3140011d1c7fc8ad3c95506e551cc04bdc Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Fri, 25 Feb 2022 16:55:54 +0400 Subject: [PATCH 16/23] AddToPackageMap -> exec directive --- sources/NicePack.uc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sources/NicePack.uc b/sources/NicePack.uc index ea1da92..b68e14d 100644 --- a/sources/NicePack.uc +++ b/sources/NicePack.uc @@ -1,6 +1,12 @@ class NicePack extends Mutator dependson(NiceStorageServer) config(NicePack); + +#exec OBJ LOAD FILE=NicePackA.ukx +#exec OBJ LOAD FILE=NicePackSM.usx +#exec OBJ LOAD FILE=NicePackSnd.uax +#exec OBJ LOAD FILE=NicePackT.utx + // Should we scale health off all zeds to 6-player level? var config bool bScaleZedHealth; // Should we replace all pickups with their Nice versions when available? @@ -157,10 +163,6 @@ function PreBeginPlay() super.PreBeginPlay(); foreach AllActors(Class'ZombieVolume', ZV) ZV.MinDistanceToPlayer = minimalSpawnDistance; - AddToPackageMap("NicePackA.ukx"); - AddToPackageMap("NicePackSM.usx"); - AddToPackageMap("NicePackSnd.uax"); - AddToPackageMap("NicePackT.utx"); } simulated function PostBeginPlay() -- 2.20.1 From 2dfc44b90ad081c9b42b879630d2b6d1bef9da2f Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Fri, 25 Feb 2022 16:58:37 +0400 Subject: [PATCH 17/23] remove unnecessary role check --- sources/NicePack.uc | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/sources/NicePack.uc b/sources/NicePack.uc index b68e14d..7eb6072 100644 --- a/sources/NicePack.uc +++ b/sources/NicePack.uc @@ -260,22 +260,26 @@ simulated function PostBeginPlay() simulated function PostNetBeginPlay() { super.PostNetBeginPlay(); - if(Role < ROLE_Authority) + + if (Role < ROLE_Authority) LoadReplicationData(); } -function SetReplicationData(){ - SrvFlags = 0; - if(bInitialTrader) - SrvFlags = SrvFlags | 0x00000001; - if(bStillDuringInitTrader) - SrvFlags = SrvFlags | 0x00000002; -} -simulated function LoadReplicationData(){ - if(Role == ROLE_Authority) - return; + +simulated function LoadReplicationData() +{ bInitialTrader = (SrvFlags & 0x00000001) > 0; bStillDuringInitTrader = (SrvFlags & 0x00000002) > 0; } + +function SetReplicationData() +{ + SrvFlags = 0; + if (bInitialTrader) + SrvFlags = SrvFlags | 0x00000001; + if (bStillDuringInitTrader) + SrvFlags = SrvFlags | 0x00000002; +} + simulated function Timer(){ local KFHumanPawn nextPawn; local int currentPlayersMax; -- 2.20.1 From 075f4f14c10d49fa777c78430a0481901b473f04 Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Fri, 25 Feb 2022 17:56:26 +0400 Subject: [PATCH 18/23] mut tick made more light --- sources/NicePack.uc | 97 +++++++++++++++++++++++++++++---------------- 1 file changed, 62 insertions(+), 35 deletions(-) diff --git a/sources/NicePack.uc b/sources/NicePack.uc index 7eb6072..7f06226 100644 --- a/sources/NicePack.uc +++ b/sources/NicePack.uc @@ -309,56 +309,83 @@ simulated function Timer(){ } maxPlayersInGame = Max(maxPlayersInGame, currentPlayersMax); } -simulated function Tick(float Delta){ - local int i; - local NiceInteraction niceInt; - local NicePlayerController localPlayer; - super.Tick(Delta); - if(ScrnGT != none && ScrnGT.WaveCountDown <= 5) - bIsPreGame = false; - if(ScrnMut != none && !bSpawnRateEnforced && ScrnMut.bTickExecuted){ - bSpawnRateEnforced = true; - ScrnMut.OriginalWaveSpawnPeriod = FMax(minSpawnRate, FMin(maxSpawnRate, ScrnMut.OriginalWaveSpawnPeriod)); + +// add interaction +auto state loadInteractionnSpawnRate +{ + // state timer, overrides global + simulated function Tick(float Delta) + { + local NiceInteraction niceInt; + local NicePlayerController localPlayer; + + if (level.netMode == NM_DedicatedServer) + { + // set spawn rate! + if (ScrnMut != none) + ScrnMut.OriginalWaveSpawnPeriod = FMax(minSpawnRate, FMin(maxSpawnRate, ScrnMut.OriginalWaveSpawnPeriod)); + // do not execute below code on dedicated servers! + GoToState(''); + return; + } + + localPlayer = NicePlayerController(Level.GetLocalPlayerController()); + if (localPlayer == none) + return; + + // Actually add the interaction + niceInt = NiceInteraction(localPlayer.Player.InteractionMaster.AddInteraction(string(class'NiceInteraction'), localPlayer.Player)); + niceInt.RegisterMutator(Self); + // break this and go to global state + GoToState(''); } +} + +simulated function Tick(float Delta) +{ + local int i; + local NicePlayerController localPlayer; + + super.Tick(Delta); + if (ScrnGT != none && ScrnGT.WaveCountDown <= 5) + bIsPreGame = false; localPlayer = NicePlayerController(Level.GetLocalPlayerController()); // Check if the local PlayerController is available yet - if(localPlayer == none) + if (localPlayer == none) return; - if( Role < Role_AUTHORITY && !bClientLinkEstablished - && localPlayer.storageClient != none && localPlayer.remoteRI != none){ + if (Role < Role_AUTHORITY && !bClientLinkEstablished + && localPlayer.storageClient != none && localPlayer.remoteRI != none) + { bClientLinkEstablished = true; localPlayer.storageClient.remoteRI = localPlayer.remoteRI; localPlayer.storageClient.events.static.CallLinkEstablished(); } - if(localPlayer.bFlagDisplayCounters){ - for(i = 0;i < niceCounterSet.Length;i ++){ - if(niceCounterSet[i].ownerSkill == none) - niceCounterSet[i].value = UpdateCounterValue(niceCounterSet[i].cName); - else if(class'NiceVeterancyTypes'.static.hasSkill(localPlayer, niceCounterSet[i].ownerSkill)) - niceCounterSet[i].value = niceCounterSet[i].ownerSkill.static. + if(localPlayer.bFlagDisplayCounters) + { + for (i = 0; i < niceCounterSet.Length; i++) + { + if (niceCounterSet[i].ownerSkill == none) + niceCounterSet[i].value = UpdateCounterValue(niceCounterSet[i].cName); + else if(class'NiceVeterancyTypes'.static.hasSkill(localPlayer, niceCounterSet[i].ownerSkill)) + niceCounterSet[i].value = niceCounterSet[i].ownerSkill.static. UpdateCounterValue(niceCounterSet[i].cName, localPlayer); - else - niceCounterSet[i].value = 0; - } + else + niceCounterSet[i].value = 0; + } } // Reset tick counter for traces localPlayer.tracesThisTick = 0; // Manage resetting of effects' limits - if(Level.TimeSeconds >= localPlayer.nextEffectsResetTime){ - localPlayer.nextEffectsResetTime = Level.TimeSeconds + 0.1; - localPlayer.currentEffectTimeWindow ++; - if(localPlayer.currentEffectTimeWindow >= 10) - localPlayer.currentEffectTimeWindow = 0; - localPlayer.effectsSpawned[localPlayer.currentEffectTimeWindow] = 0; + if (Level.TimeSeconds >= localPlayer.nextEffectsResetTime) + { + localPlayer.nextEffectsResetTime = Level.TimeSeconds + 0.1; + localPlayer.currentEffectTimeWindow ++; + if (localPlayer.currentEffectTimeWindow >= 10) + localPlayer.currentEffectTimeWindow = 0; + localPlayer.effectsSpawned[localPlayer.currentEffectTimeWindow] = 0; } - // Add interaction - if(interactionAdded) - return; - // Actually add the interaction - niceInt = NiceInteraction(localPlayer.Player.InteractionMaster.AddInteraction(string(class'NiceInteraction'), localPlayer.Player)); - niceInt.RegisterMutator(Self); - interactionAdded = true; } + simulated function bool CheckReplacement(Actor Other, out byte bSuperRelevant){ local int i; local NiceMonster niceMonster; -- 2.20.1 From ee82159942128f25856317f4a9a8edd9a74623d5 Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Fri, 25 Feb 2022 18:39:45 +0400 Subject: [PATCH 19/23] fix for initial trader buy --- sources/NicePack.uc | 6 ++---- sources/Utility.uc | 14 ++++++-------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/sources/NicePack.uc b/sources/NicePack.uc index 7f06226..f110786 100644 --- a/sources/NicePack.uc +++ b/sources/NicePack.uc @@ -45,7 +45,6 @@ var config int mediumZedMinHealth; var int maxPlayersInGame; -var bool bSpawnRateEnforced; // Set to true after spawn rate was altered // 'Adrenaline junkie' zed-time extensions var int junkieDoneGoals; // How many times we collected enough head-shots to trigger zed-time extension var int junkieNextGoal; // How many head-shots we need for next zed-time extension @@ -347,8 +346,7 @@ simulated function Tick(float Delta) local NicePlayerController localPlayer; super.Tick(Delta); - if (ScrnGT != none && ScrnGT.WaveCountDown <= 5) - bIsPreGame = false; + localPlayer = NicePlayerController(Level.GetLocalPlayerController()); // Check if the local PlayerController is available yet if (localPlayer == none) @@ -360,7 +358,7 @@ simulated function Tick(float Delta) localPlayer.storageClient.remoteRI = localPlayer.remoteRI; localPlayer.storageClient.events.static.CallLinkEstablished(); } - if(localPlayer.bFlagDisplayCounters) + if (localPlayer.bFlagDisplayCounters) { for (i = 0; i < niceCounterSet.Length; i++) { diff --git a/sources/Utility.uc b/sources/Utility.uc index 6ddf1a3..81620ad 100644 --- a/sources/Utility.uc +++ b/sources/Utility.uc @@ -41,12 +41,10 @@ defaultproperties NiceHints[06]="You can play this if you beat 5 faked / 6p HP zeds." NiceHints[07]="Hold or Die!" NiceHints[08]="The Wipe Train has no breaks." - NiceHints[09]="We are glad to hear your wishes and requests. Just remember we are super lazy." - NiceHints[10]="If you die - always blame dkanus." - NiceHints[11]="If nothing works - it's intended." - NiceHints[12]="If you find any bug, we can make it a feature." - NiceHints[13]="Play this only if you don't have real life." - NiceHints[14]="You suck and we hate you." - NiceHints[15]="GITGUD" - NiceHints[16]="Git ur shit bucket." + NiceHints[09]="You're welcome with requests. Just remember we are super lazy." + NiceHints[10]="If nothing works - it's intended." + NiceHints[11]="If you find any bug, we can make it a feature." + NiceHints[12]="Play this only if you don't have real life." + NiceHints[13]="You suck and we hate you." + NiceHints[14]="GITGUD" } \ No newline at end of file -- 2.20.1 From 90599fd6b72f9773ccd3f5e1ffbbedc108b5d5ad Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Fri, 25 Feb 2022 22:50:54 +0400 Subject: [PATCH 20/23] made tick more light --- sources/NicePack.uc | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/sources/NicePack.uc b/sources/NicePack.uc index f110786..9f11278 100644 --- a/sources/NicePack.uc +++ b/sources/NicePack.uc @@ -62,7 +62,6 @@ var NiceGameType NiceGT; var NicePack Mut; var NiceRules GameRules; var NiceStorageServer serverStorage; -var bool bClientLinkEstablished; var bool interactionAdded; var bool bIsPreGame; var bool bIsTraderTime; @@ -309,10 +308,10 @@ simulated function Timer(){ maxPlayersInGame = Max(maxPlayersInGame, currentPlayersMax); } -// add interaction +// initial tick, does some job and shuts down auto state loadInteractionnSpawnRate { - // state timer, overrides global + // state tick, overrides global simulated function Tick(float Delta) { local NiceInteraction niceInt; @@ -332,14 +331,23 @@ auto state loadInteractionnSpawnRate if (localPlayer == none) return; + // spawn some magic + if (localPlayer.storageClient != none && localPlayer.remoteRI != none) + { + localPlayer.storageClient.remoteRI = localPlayer.remoteRI; + localPlayer.storageClient.events.static.CallLinkEstablished(); + } + // Actually add the interaction niceInt = NiceInteraction(localPlayer.Player.InteractionMaster.AddInteraction(string(class'NiceInteraction'), localPlayer.Player)); niceInt.RegisterMutator(Self); - // break this and go to global state + + // break this state and go to global GoToState(''); } } +// global tick simulated function Tick(float Delta) { local int i; @@ -351,13 +359,7 @@ simulated function Tick(float Delta) // Check if the local PlayerController is available yet if (localPlayer == none) return; - if (Role < Role_AUTHORITY && !bClientLinkEstablished - && localPlayer.storageClient != none && localPlayer.remoteRI != none) - { - bClientLinkEstablished = true; - localPlayer.storageClient.remoteRI = localPlayer.remoteRI; - localPlayer.storageClient.events.static.CallLinkEstablished(); - } + if (localPlayer.bFlagDisplayCounters) { for (i = 0; i < niceCounterSet.Length; i++) -- 2.20.1 From 5df8f93add2037b5ac460006b3122d94c63750a6 Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Fri, 25 Feb 2022 23:00:26 +0400 Subject: [PATCH 21/23] Revert "AddToPackageMap -> exec directive" This reverts commit ff332c3140011d1c7fc8ad3c95506e551cc04bdc. --- sources/NicePack.uc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sources/NicePack.uc b/sources/NicePack.uc index 9f11278..7f68931 100644 --- a/sources/NicePack.uc +++ b/sources/NicePack.uc @@ -1,12 +1,6 @@ class NicePack extends Mutator dependson(NiceStorageServer) config(NicePack); - -#exec OBJ LOAD FILE=NicePackA.ukx -#exec OBJ LOAD FILE=NicePackSM.usx -#exec OBJ LOAD FILE=NicePackSnd.uax -#exec OBJ LOAD FILE=NicePackT.utx - // Should we scale health off all zeds to 6-player level? var config bool bScaleZedHealth; // Should we replace all pickups with their Nice versions when available? @@ -161,6 +155,10 @@ function PreBeginPlay() super.PreBeginPlay(); foreach AllActors(Class'ZombieVolume', ZV) ZV.MinDistanceToPlayer = minimalSpawnDistance; + AddToPackageMap("NicePackA.ukx"); + AddToPackageMap("NicePackSM.usx"); + AddToPackageMap("NicePackSnd.uax"); + AddToPackageMap("NicePackT.utx"); } simulated function PostBeginPlay() -- 2.20.1 From 406257c0e92d4b169e63a2990980e859d63dd0ec Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Mon, 28 Feb 2022 02:08:06 +0400 Subject: [PATCH 22/23] disable mut tick for server --- sources/NicePack.uc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sources/NicePack.uc b/sources/NicePack.uc index 7f68931..8260514 100644 --- a/sources/NicePack.uc +++ b/sources/NicePack.uc @@ -322,6 +322,7 @@ auto state loadInteractionnSpawnRate ScrnMut.OriginalWaveSpawnPeriod = FMax(minSpawnRate, FMin(maxSpawnRate, ScrnMut.OriginalWaveSpawnPeriod)); // do not execute below code on dedicated servers! GoToState(''); + DisableServerGlobalTick(); return; } @@ -345,14 +346,18 @@ auto state loadInteractionnSpawnRate } } +// disable tick for servers! +final private function DisableServerGlobalTick() +{ + Disable('Tick'); +} + // global tick simulated function Tick(float Delta) { local int i; local NicePlayerController localPlayer; - super.Tick(Delta); - localPlayer = NicePlayerController(Level.GetLocalPlayerController()); // Check if the local PlayerController is available yet if (localPlayer == none) -- 2.20.1 From 74700d7f204e8e2f25651e1241072385a6f29a9b Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Thu, 3 Mar 2022 15:07:18 +0400 Subject: [PATCH 23/23] mutator code cleanup --- sources/NiceGameType.uc | 5 +++++ sources/NicePack.uc | 19 +++++++------------ sources/NicePlayerController.uc | 1 + 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/sources/NiceGameType.uc b/sources/NiceGameType.uc index aeb6572..ca0aaa7 100644 --- a/sources/NiceGameType.uc +++ b/sources/NiceGameType.uc @@ -325,6 +325,11 @@ defaultproperties { GameName="Nice Floor" Description="Nice Edition of ScrN Killing Floor game mode (ScrnGameType)." + // custom player controller + PlayerControllerClass=class'NicePlayerController' + PlayerControllerClassName="NicePack.NicePlayerController" + // skills menu + LoginMenuClass="NicePack.NiceInvasionLoginMenu" ZedTimeSlomoScale=0.4 LesserZedTimeSlomoScale=0.6 } \ No newline at end of file diff --git a/sources/NicePack.uc b/sources/NicePack.uc index 8260514..29fc08a 100644 --- a/sources/NicePack.uc +++ b/sources/NicePack.uc @@ -188,25 +188,20 @@ simulated function PostBeginPlay() // Find game type and ScrN mutator ScrnGT = ScrnGameType(Level.Game); NiceGT = NiceGameType(Level.Game); - if(ScrnGT == none){ - Log("ERROR: Wrong GameType (requires at least ScrnGameType)", Class.Outer.Name); + if (NiceGT == none) + { + Log("ERROR: Wrong GameType (requires NiceGameType)", class.Outer.Name); Destroy(); return; } - // Skills menu - ScrnGT.LoginMenuClass = string(class'NiceInvasionLoginMenu'); - if(NiceGT != none) - NiceGT.RegisterMutator(Self); - ScrnMut = ScrnGT.ScrnBalanceMut; + // FIXME poosh forces this variable in his mutator... + NiceGT.LoginMenuClass = "NicePack.NiceInvasionLoginMenu"; + NiceGT.RegisterMutator(self); + ScrnMut = NiceGT.ScrnBalanceMut; if(bReplacePickups) ScrnMut.bReplacePickups = false; // Replication of some variables SetReplicationData(); - // New player controller class - if(!ClassIsChildOf(ScrnGT.PlayerControllerClass, class'NicePlayerController')){ - ScrnGT.PlayerControllerClass = class'NicePlayerController'; - ScrnGT.PlayerControllerClassName = string(class'NicePlayerController'); - } // Game rules GameRules = Spawn(class'NiceRules', self); // -- Lower starting HL diff --git a/sources/NicePlayerController.uc b/sources/NicePlayerController.uc index 7b67034..00e8fae 100644 --- a/sources/NicePlayerController.uc +++ b/sources/NicePlayerController.uc @@ -1537,6 +1537,7 @@ function ClientLocationalVoiceMessage(PlayerReplicationInfo Sender, defaultproperties { + MidGameMenuClass="NicePack.NiceInvasionLoginMenu" nicePlayerInfoVersionNumber=1 bAltSwitchesModes=True bAdvReloadCheck=True -- 2.20.1