diff --git a/Docs/CHANGELOG.md b/Docs/CHANGELOG.md index 8cb2de1..48050eb 100644 --- a/Docs/CHANGELOG.md +++ b/Docs/CHANGELOG.md @@ -6,6 +6,44 @@ All notable changes to this project will be documented in this file. List of changes for version 0.2.0 may be incomplete. Weapon and perk changes are described relative to ScrN versions. +## [Update 404] - 00.00.2022 + +### General + +- NicePakc bundle is now in 7z. +- Code break: `meanreplicationinfo` disabled. +- Less scrnbalance hardcode. +- TSC and all it's classes removed. +- README, changelog, file directory updates. +- HUGE amount of accessed none fixes. +- Tabs -> x4 spaces. +- All hardcoded classes / subobjects removed. Now Kaio can compile his fpp 😂 + +#### Zeds + +- Disable all zed collisions on death. Now jumping crawlers, running gorefasts won't interupt your movement. +- Siren has faster iterator. +- Siren won't spawn emitter on death. +- Siren won't scream at low hp zeds, will try to melee instead. +- Husk doesn't shoot if headless, dying, falling, being moved by other husks. +- Husk ignores zeds that the he can't actually see. +- Husk's projectile won't detonate multiple times during slomo. + +### GUI + +- New lobby footer from base class. New fancy buttons! +- New lobby menu! Much cleaner and doesn't have ad square. +- Skill menu has new backgrounds. +- NiceGUISettings: New dropdown list to control Commando's zed health bars: + - All zeds. + - Only big zeds (>1000hp). + - Disabled. + +### Weapons + +- Fix for nade throwing if you hold non nice weapon. +- Machete pickup removed, axe spawns instead. + ## [Update 008] - 14.01.2022 ### Changed diff --git a/README.md b/README.md index 4ce1668..2e00cb6 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This repo contains sources for the last public NicePack release. It is a haphazard bunch of changes that were made to customize ScrN for ourselves. It is unfinished, but due to some reasons I don't want to release it publicly anymore. -The link to the compiled NicePack, along with all necessary files, is here: +The link to the compiled NicePack, along with all necessary files, is here: ## Config Files diff --git a/sources/GUI/NiceGUICheckBoxButton.uc b/sources/GUI/NiceGUICheckBoxButton.uc new file mode 100644 index 0000000..98a7150 --- /dev/null +++ b/sources/GUI/NiceGUICheckBoxButton.uc @@ -0,0 +1,13 @@ +class NiceGUICheckBoxButton extends GUICheckBoxButton; + +defaultproperties +{ + CheckedOverlay(0)=Texture'KF_InterfaceArt_tex.Menu.Checkbox' // checked + CheckedOverlay(1)=Texture'KF_InterfaceArt_tex.Menu.checkbox_highlight' // checked, mouse over + CheckedOverlay(2)=Texture'KF_InterfaceArt_tex.Menu.checkbox_highlight' // checked, focused + CheckedOverlay(3)=Texture'KF_InterfaceArt_tex.Menu.checkbox_dark' // checked, clicked + CheckedOverlay(4)=Texture'KF_InterfaceArt_tex.Menu.checkbox_dark' // checked, disabled + ImageIndex=0 + bAllOverlay=False + StyleName="CheckBox" +} \ No newline at end of file diff --git a/sources/GUI/NiceGUISettings.uc b/sources/GUI/NiceGUISettings.uc index d782df9..2ceaa06 100644 --- a/sources/GUI/NiceGUISettings.uc +++ b/sources/GUI/NiceGUISettings.uc @@ -1,273 +1,216 @@ -class NiceGUISettings extends Settings_Tabs; -//var automated GUIButton skillButtonA; -var array ForceProjItems; -var automated moCheckBox ch_WeapManagement; -var automated moCheckBox ch_AltSwitches; -var automated moCheckBox ch_DispCounters; -var automated moCheckBox ch_DisWeapProgress; -var automated moCheckBox ch_ShowHLMessages; -var automated moCheckBox ch_CancelFire; -var automated moCheckBox ch_CancelSwitching; -var automated moCheckBox ch_CancelNades; -var automated moCheckBox ch_CancelAiming; -var automated moCheckBox ch_ReloadWontWork; -var automated GUISectionBackground bg_WEAP; -var automated GUISectionBackground bg_RELOAD; -function InitComponent(GUIController MyController, GUIComponent MyOwner){ +class NiceGUISettings extends UT2K4TabPanel; + +// GENERAL WEAPON SETTINGS +var automated GUISectionBackground bg_WEAP; +var automated moCheckBox ch_WeapManagement; +var automated moCheckBox ch_AltSwitches; +var automated moCheckBox ch_DispCounters; +var automated moCheckBox ch_DisWeapProgress; +var automated moCheckBox ch_ShowHLMessages; + +// WEAPON RELOAD SETTINGS +var automated GUISectionBackground bg_RELOAD; +var automated moCheckBox ch_CancelFire; +var automated moCheckBox ch_CancelSwitching; +var automated moCheckBox ch_CancelNades; +var automated moCheckBox ch_CancelAiming; +var automated moCheckBox ch_ReloadWontWork; + +// RANDOM SETTINGS +var automated GUISectionBackground bg_RANDOM; +var automated MoComboBox mo_ZedHPBars; + +function InitComponent(GUIController MyController, GUIComponent MyOwner) +{ super.InitComponent(MyController, MyOwner); -} -function InternalOnLoadINI(GUIComponent sender, string s){ + + mo_ZedHPBars.AddItem("Big Zeds"); + mo_ZedHPBars.AddItem("All Zeds"); + mo_ZedHPBars.AddItem("Disable"); + + // GENERAL WEAPON SETTINGS + bg_WEAP.ManageComponent(ch_WeapManagement); + bg_WEAP.ManageComponent(ch_AltSwitches); + bg_WEAP.ManageComponent(ch_DispCounters); + bg_WEAP.ManageComponent(ch_DisWeapProgress); + bg_WEAP.ManageComponent(ch_ShowHLMessages); + + // WEAPON RELOAD SETTINGS + bg_RELOAD.ManageComponent(ch_CancelFire); + bg_RELOAD.ManageComponent(ch_CancelSwitching); + bg_RELOAD.ManageComponent(ch_CancelNades); + bg_RELOAD.ManageComponent(ch_CancelAiming); + bg_RELOAD.ManageComponent(ch_ReloadWontWork); + + // RANDOM SETTINGS + bg_RANDOM.ManageComponent(mo_ZedHPBars); +} + +function InternalOnLoadINI(GUIComponent sender, string s) +{ local NicePlayerController nicePlayer; + nicePlayer = NicePlayerController(PlayerOwner()); - if(nicePlayer == none) - return; - switch(sender){ - case ch_WeapManagement: - ch_WeapManagement.Checked(nicePlayer.bNiceWeaponManagement); - break; - case ch_AltSwitches: - ch_AltSwitches.Checked(nicePlayer.bFlagAltSwitchesModes); - break; - case ch_DispCounters: - ch_DispCounters.Checked(nicePlayer.bFlagDisplayCounters); - break; - case ch_DisWeapProgress: - ch_DisWeapProgress.Checked(nicePlayer.bFlagDisplayWeaponProgress); - break; - case ch_ShowHLMessages: - ch_ShowHLMessages.Checked(nicePlayer.bFlagShowHLMessages); - break; - case ch_CancelFire: - ch_CancelFire.Checked(nicePlayer.bRelCancelByFire); - break; - case ch_CancelSwitching: - ch_CancelSwitching.Checked(nicePlayer.bRelCancelBySwitching); - break; - case ch_CancelNades: - ch_CancelNades.Checked(nicePlayer.bRelCancelByNades); - break; - case ch_CancelAiming: - ch_CancelAiming.Checked(nicePlayer.bRelCancelByAiming); - break; - case ch_ReloadWontWork: - ch_ReloadWontWork.Checked(nicePlayer.bFlagUseServerReload); - break; + if (nicePlayer == none) + return; + + switch(sender) + { + case ch_WeapManagement: + ch_WeapManagement.Checked(nicePlayer.bNiceWeaponManagement); + break; + case ch_AltSwitches: + ch_AltSwitches.Checked(nicePlayer.bFlagAltSwitchesModes); + break; + case ch_DispCounters: + ch_DispCounters.Checked(nicePlayer.bFlagDisplayCounters); + break; + case ch_DisWeapProgress: + ch_DisWeapProgress.Checked(nicePlayer.bFlagDisplayWeaponProgress); + break; + case ch_ShowHLMessages: + ch_ShowHLMessages.Checked(nicePlayer.bFlagShowHLMessages); + break; + case ch_CancelFire: + ch_CancelFire.Checked(nicePlayer.bRelCancelByFire); + break; + case ch_CancelSwitching: + ch_CancelSwitching.Checked(nicePlayer.bRelCancelBySwitching); + break; + case ch_CancelNades: + ch_CancelNades.Checked(nicePlayer.bRelCancelByNades); + break; + case ch_CancelAiming: + ch_CancelAiming.Checked(nicePlayer.bRelCancelByAiming); + break; + case ch_ReloadWontWork: + ch_ReloadWontWork.Checked(nicePlayer.bFlagUseServerReload); + break; + case mo_ZedHPBars: + mo_ZedHPBars.SetIndex(nicePlayer.ZedHPBarStyle); + break; } } -function InternalOnChange(GUIComponent Sender){ + +function InternalOnChange(GUIComponent Sender) +{ local NicePlayerController nicePlayer; - super.InternalOnChange(Sender); + nicePlayer = NicePlayerController(PlayerOwner()); - if(nicePlayer == none) - return; - switch(sender){ - case ch_WeapManagement: - nicePlayer.bNiceWeaponManagement = ch_WeapManagement.IsChecked(); - break; - case ch_AltSwitches: - nicePlayer.ServerSetAltSwitchesModes(ch_AltSwitches.IsChecked()); - break; - case ch_DispCounters: - nicePlayer.ServerSetDisplayCounters(ch_DispCounters.IsChecked()); - break; - case ch_DisWeapProgress: - nicePlayer.ServerSetDisplayWeaponProgress(ch_DisWeapProgress.IsChecked()); - break; - case ch_ShowHLMessages: - nicePlayer.ServerSetHLMessages(ch_ShowHLMessages.IsChecked()); - break; - case ch_CancelFire: - nicePlayer.bRelCancelByFire = ch_CancelFire.IsChecked(); - break; - case ch_CancelSwitching: - nicePlayer.bRelCancelBySwitching = ch_CancelSwitching.IsChecked(); - break; - case ch_CancelNades: - nicePlayer.bRelCancelByNades = ch_CancelNades.IsChecked(); - break; - case ch_CancelAiming: - nicePlayer.bRelCancelByAiming = ch_CancelAiming.IsChecked(); - break; - case ch_ReloadWontWork: - nicePlayer.ServerSetUseServerReload(ch_ReloadWontWork.IsChecked()); - break; + if (nicePlayer == none) + return; + + switch(sender) + { + case ch_WeapManagement: + nicePlayer.bNiceWeaponManagement = ch_WeapManagement.IsChecked(); + break; + case ch_AltSwitches: + nicePlayer.ServerSetAltSwitchesModes(ch_AltSwitches.IsChecked()); + break; + case ch_DispCounters: + nicePlayer.ServerSetDisplayCounters(ch_DispCounters.IsChecked()); + break; + case ch_DisWeapProgress: + nicePlayer.ServerSetDisplayWeaponProgress(ch_DisWeapProgress.IsChecked()); + break; + case ch_ShowHLMessages: + nicePlayer.ServerSetHLMessages(ch_ShowHLMessages.IsChecked()); + break; + case ch_CancelFire: + nicePlayer.bRelCancelByFire = ch_CancelFire.IsChecked(); + break; + case ch_CancelSwitching: + nicePlayer.bRelCancelBySwitching = ch_CancelSwitching.IsChecked(); + break; + case ch_CancelNades: + nicePlayer.bRelCancelByNades = ch_CancelNades.IsChecked(); + break; + case ch_CancelAiming: + nicePlayer.bRelCancelByAiming = ch_CancelAiming.IsChecked(); + break; + case ch_ReloadWontWork: + nicePlayer.ServerSetUseServerReload(ch_ReloadWontWork.IsChecked()); + break; + case mo_ZedHPBars: + nicePlayer.ZedHPBarStyle = mo_ZedHPBars.GetIndex(); + break; } nicePlayer.ClientSaveConfig(); } + // size = (x=0.0125, y=0.0) ; (w=1.0, h=0.865) // tab order defaultproperties { - Begin Object Class=moCheckBox Name=WeaponManagement - CaptionWidth=0.955000 - Caption="Nice weapon management" - ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton" - OnCreateComponent=WeaponManagement.InternalOnCreateComponent - IniOption="@Internal" - Hint="If checked, NicePack will use it's own system to manage weapon switching" - WinTop=0.050000 - WinLeft=0.012500 - WinWidth=0.278000 - TabOrder=4 - OnChange=NiceGUISettings.InternalOnChange - OnLoadINI=NiceGUISettings.InternalOnLoadINI - End Object - ch_WeapManagement=WeaponManagement - - Begin Object Class=moCheckBox Name=AltSwitches - CaptionWidth=0.955000 - Caption="Alt fire switches modes" - ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton" - OnCreateComponent=AltSwitches.InternalOnCreateComponent - IniOption="@Internal" - Hint="Assault-rifle only; if enabled - alt fire button switches between fire modes, otherwise - acts as an alt fire" - WinTop=0.100000 - WinLeft=0.012500 - WinWidth=0.278000 - TabOrder=6 - OnChange=NiceGUISettings.InternalOnChange - OnLoadINI=NiceGUISettings.InternalOnLoadINI - End Object - ch_AltSwitches=AltSwitches - - Begin Object Class=moCheckBox Name=DispCounters - CaptionWidth=0.955000 - Caption="Display counters" - ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton" - OnCreateComponent=DispCounters.InternalOnCreateComponent - IniOption="@Internal" - Hint="Toggles display of the various counters used by skills" - WinTop=0.150000 - WinLeft=0.012500 - WinWidth=0.278000 - TabOrder=7 - OnChange=NiceGUISettings.InternalOnChange - OnLoadINI=NiceGUISettings.InternalOnLoadINI - End Object - ch_DispCounters=DispCounters - - Begin Object Class=moCheckBox Name=DispWeapProgress - CaptionWidth=0.955000 - Caption="Display weapon progress" - ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton" - OnCreateComponent=DispWeapProgress.InternalOnCreateComponent - IniOption="@Internal" - Hint="Displays weapon progress rate, however it's defined by a skill that's using this functionality" - WinTop=0.200000 - WinLeft=0.012500 - WinWidth=0.278000 - TabOrder=8 - OnChange=NiceGUISettings.InternalOnChange - OnLoadINI=NiceGUISettings.InternalOnLoadINI - End Object - ch_DisWeapProgress=DispWeapProgress - - Begin Object Class=moCheckBox Name=ShowHLMessages - CaptionWidth=0.955000 - Caption="Show Hardcore Level messages" - ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton" - OnCreateComponent=ShowHLMessages.InternalOnCreateComponent - IniOption="@Internal" - Hint="Enable to be notified each time Hardcore Level is changed" - WinTop=0.300000 - WinLeft=0.012500 - WinWidth=0.278000 - TabOrder=9 - OnChange=NiceGUISettings.InternalOnChange - OnLoadINI=NiceGUISettings.InternalOnLoadINI - End Object - ch_ShowHLMessages=ShowHLMessages - - Begin Object Class=moCheckBox Name=CancelFire - CaptionWidth=0.955000 - Caption="Cancel reload by shooting" - ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton" - OnCreateComponent=CancelFire.InternalOnCreateComponent - IniOption="@Internal" - Hint="If checked, you'll be able to cancel reload of converted weapons by shooting (when you have ammo)" - WinTop=0.050000 - WinLeft=0.517500 - WinWidth=0.287000 - TabOrder=11 - OnChange=NiceGUISettings.InternalOnChange - OnLoadINI=NiceGUISettings.InternalOnLoadINI - End Object - ch_CancelFire=CancelFire - - Begin Object Class=moCheckBox Name=CancelSwitching - CaptionWidth=0.955000 - Caption="Cancel reload by switching weapons" - ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton" - OnCreateComponent=CancelSwitching.InternalOnCreateComponent - IniOption="@Internal" - Hint="If checked, you'll be able to cancel reload of converted weapons by switching to different weapon" - WinTop=0.100000 - WinLeft=0.517500 - WinWidth=0.287000 - TabOrder=12 - OnChange=NiceGUISettings.InternalOnChange - OnLoadINI=NiceGUISettings.InternalOnLoadINI - End Object - ch_CancelSwitching=CancelSwitching - - Begin Object Class=moCheckBox Name=CancelNades - CaptionWidth=0.955000 - Caption="Cancel reload by throwing grenades" - ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton" - OnCreateComponent=CancelNades.InternalOnCreateComponent - IniOption="@Internal" - Hint="If checked, you'll be able to cancel reload of converted weapons by throwing a grenade" - WinTop=0.150000 - WinLeft=0.517500 - WinWidth=0.287000 - TabOrder=13 - OnChange=NiceGUISettings.InternalOnChange - OnLoadINI=NiceGUISettings.InternalOnLoadINI - End Object - ch_CancelNades=CancelNades - - Begin Object Class=moCheckBox Name=CancelAiming - CaptionWidth=0.955000 - Caption="Cancel reload by aiming" - ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton" - OnCreateComponent=CancelAiming.InternalOnCreateComponent - IniOption="@Internal" - Hint="If checked, you'll be able to cancel reload of converted weapons by going into iron sights (when you have ammo)" - WinTop=0.200000 - WinLeft=0.517500 - WinWidth=0.287000 - TabOrder=14 - OnChange=NiceGUISettings.InternalOnChange - OnLoadINI=NiceGUISettings.InternalOnLoadINI - End Object - ch_CancelAiming=CancelAiming - - Begin Object Class=moCheckBox Name=ServerReload - CaptionWidth=0.955000 - Caption="My reload doesn't work" - ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton" - OnCreateComponent=ServerReload.InternalOnCreateComponent - IniOption="@Internal" - Hint="Check this option ONLY in case converted weapons don't reload at all for you; this option should fix the problem, but then latency will affect both reload and active reload" - WinTop=0.250000 - WinLeft=0.517500 - WinWidth=0.287000 - TabOrder=15 - OnChange=NiceGUISettings.InternalOnChange - OnLoadINI=NiceGUISettings.InternalOnLoadINI - End Object - ch_ReloadWontWork=ServerReload - + // GENERAL WEAPON SETTINGS Begin Object Class=GUISectionBackground Name=WEAPBG Caption="General weapon settings" WinTop=0.012500 WinWidth=0.495000 WinHeight=0.287500 RenderWeight=0.100100 - OnPreDraw=WeaponsBG.InternalPreDraw + // OnPreDraw=WeaponsBG.InternalPreDraw + OnPreDraw=WEAPBG.InternalPreDraw End Object bg_WEAP=WEAPBG + Begin Object Class=moCheckBox Name=WeaponManagement + Caption="Nice weapon management" + ComponentClassName="NicePack.NiceGUICheckBoxButton" + OnCreateComponent=WeaponManagement.InternalOnCreateComponent + IniOption="@Internal" + Hint="If checked, NicePack will use it's own system to manage weapon switching" + OnChange=NiceGUISettings.InternalOnChange + OnLoadINI=NiceGUISettings.InternalOnLoadINI + End Object + ch_WeapManagement=WeaponManagement + + Begin Object Class=moCheckBox Name=AltSwitches + Caption="Alt fire switches modes" + ComponentClassName="NicePack.NiceGUICheckBoxButton" + OnCreateComponent=AltSwitches.InternalOnCreateComponent + IniOption="@Internal" + Hint="Assault-rifle only; if enabled - alt fire button switches between fire modes, otherwise - acts as an alt fire" + OnChange=NiceGUISettings.InternalOnChange + OnLoadINI=NiceGUISettings.InternalOnLoadINI + End Object + ch_AltSwitches=AltSwitches + + Begin Object Class=moCheckBox Name=DispCounters + Caption="Display counters" + ComponentClassName="NicePack.NiceGUICheckBoxButton" + OnCreateComponent=DispCounters.InternalOnCreateComponent + IniOption="@Internal" + Hint="Toggles display of the various counters used by skills" + OnChange=NiceGUISettings.InternalOnChange + OnLoadINI=NiceGUISettings.InternalOnLoadINI + End Object + ch_DispCounters=DispCounters + + Begin Object Class=moCheckBox Name=DispWeapProgress + Caption="Display weapon progress" + ComponentClassName="NicePack.NiceGUICheckBoxButton" + OnCreateComponent=DispWeapProgress.InternalOnCreateComponent + IniOption="@Internal" + Hint="Displays weapon progress rate, however it's defined by a skill that's using this functionality" + OnChange=NiceGUISettings.InternalOnChange + OnLoadINI=NiceGUISettings.InternalOnLoadINI + End Object + ch_DisWeapProgress=DispWeapProgress + + Begin Object Class=moCheckBox Name=ShowHLMessages + Caption="Show Hardcore Level messages" + ComponentClassName="NicePack.NiceGUICheckBoxButton" + OnCreateComponent=ShowHLMessages.InternalOnCreateComponent + IniOption="@Internal" + Hint="Enable to be notified each time Hardcore Level is changed" + OnChange=NiceGUISettings.InternalOnChange + OnLoadINI=NiceGUISettings.InternalOnLoadINI + End Object + ch_ShowHLMessages=ShowHLMessages + + // WEAPON RELOAD SETTINGS Begin Object Class=GUISectionBackground Name=RELOADBG Caption="Weapon reload settings" WinTop=0.012500 @@ -275,7 +218,87 @@ defaultproperties WinWidth=0.495000 WinHeight=0.287500 RenderWeight=0.100100 - OnPreDraw=WeaponsBG.InternalPreDraw + // OnPreDraw=WeaponsBG.InternalPreDraw + OnPreDraw=RELOADBG.InternalPreDraw End Object bg_RELOAD=RELOADBG -} + + Begin Object Class=moCheckBox Name=CancelFire + Caption="Cancel reload by shooting" + ComponentClassName="NicePack.NiceGUICheckBoxButton" + OnCreateComponent=CancelFire.InternalOnCreateComponent + IniOption="@Internal" + Hint="If checked, you'll be able to cancel reload of converted weapons by shooting (when you have ammo)" + OnChange=NiceGUISettings.InternalOnChange + OnLoadINI=NiceGUISettings.InternalOnLoadINI + End Object + ch_CancelFire=CancelFire + + Begin Object Class=moCheckBox Name=CancelSwitching + Caption="Cancel reload by switching weapons" + ComponentClassName="NicePack.NiceGUICheckBoxButton" + OnCreateComponent=CancelSwitching.InternalOnCreateComponent + IniOption="@Internal" + Hint="If checked, you'll be able to cancel reload of converted weapons by switching to different weapon" + OnChange=NiceGUISettings.InternalOnChange + OnLoadINI=NiceGUISettings.InternalOnLoadINI + End Object + ch_CancelSwitching=CancelSwitching + + Begin Object Class=moCheckBox Name=CancelNades + Caption="Cancel reload by throwing grenades" + ComponentClassName="NicePack.NiceGUICheckBoxButton" + OnCreateComponent=CancelNades.InternalOnCreateComponent + IniOption="@Internal" + Hint="If checked, you'll be able to cancel reload of converted weapons by throwing a grenade" + OnChange=NiceGUISettings.InternalOnChange + OnLoadINI=NiceGUISettings.InternalOnLoadINI + End Object + ch_CancelNades=CancelNades + + Begin Object Class=moCheckBox Name=CancelAiming + Caption="Cancel reload by aiming" + ComponentClassName="NicePack.NiceGUICheckBoxButton" + OnCreateComponent=CancelAiming.InternalOnCreateComponent + IniOption="@Internal" + Hint="If checked, you'll be able to cancel reload of converted weapons by going into iron sights (when you have ammo)" + OnChange=NiceGUISettings.InternalOnChange + OnLoadINI=NiceGUISettings.InternalOnLoadINI + End Object + ch_CancelAiming=CancelAiming + + Begin Object Class=moCheckBox Name=ServerReload + Caption="My reload doesn't work" + ComponentClassName="NicePack.NiceGUICheckBoxButton" + OnCreateComponent=ServerReload.InternalOnCreateComponent + IniOption="@Internal" + Hint="Check this option ONLY in case converted weapons don't reload at all for you; this option should fix the problem, but then latency will affect both reload and active reload" + OnChange=NiceGUISettings.InternalOnChange + OnLoadINI=NiceGUISettings.InternalOnLoadINI + End Object + ch_ReloadWontWork=ServerReload + + // RANDOM SETTINGS + Begin Object Class=GUISectionBackground Name=randbg + Caption="Random settings" + WinTop=0.300000 + WinWidth=0.495000 + WinHeight=0.287500 + WinLeft=0.505000 + RenderWeight=0.100100 + // OnPreDraw=WeaponsBG.InternalPreDraw + OnPreDraw=randbg.InternalPreDraw + End Object + bg_RANDOM=randbg + + Begin Object class=moComboBox Name=zedhbarpmethod + bReadOnly=true + CaptionWidth=0.000000 + Caption="Zed health bars" + Hint="Choose what health bars you want to see" + OnCreateComponent=zedhbarpmethod.InternalOnCreateComponent + OnChange=NiceGUISettings.InternalOnChange + OnLoadINI=NiceGUISettings.InternalOnLoadINI + End Object + mo_ZedHPBars=zedhbarpmethod +} \ No newline at end of file diff --git a/sources/GUI/NiceInteraction.uc b/sources/GUI/NiceInteraction.uc index f6f7e11..bbdac18 100644 --- a/sources/GUI/NiceInteraction.uc +++ b/sources/GUI/NiceInteraction.uc @@ -12,33 +12,66 @@ var float size; var float InventoryBoxWidth; var float InventoryBoxHeight; var float BorderSize; -event NotifyLevelChange(){ - Master.RemoveInteraction(self); + +event NotifyLevelChange() +{ + Master.RemoveInteraction(self); } -function RegisterMutator(NicePack activePack){ - NicePackMutator = activePack; + +function RegisterMutator(NicePack activePack) +{ + NicePackMutator = activePack; } -function bool isPoisoned(ScrnHumanPawn pwn){ - local Inventory I; - if(pwn.Inventory != none) - for(I = pwn.Inventory; I != none; I = I.Inventory) - if(I != none && MeanPoisonInventory(I) != none) - return true; - return false; + +final private function bool bIsPoisoned(ScrnHumanPawn pwn) +{ + local Inventory I; + + if (pwn.Inventory != none) + { + for (I = pwn.Inventory; I != none; I = I.Inventory) + { + if (MeanPoisonInventory(I) != none) + return true; + } + } + return false; } -function PostRender(Canvas C){ + +final private function bool bIsBleeding(ScrnHumanPawn pwn) +{ + local Inventory I; + + if (pwn.Inventory != none) + { + for (I = pwn.Inventory; I != none; I = I.Inventory) + { + if (MeanBleedInventory(I) != none) + return true; + } + } + return false; +} + +function PostRender(Canvas C) +{ local int i; local NicePack niceMutator; local NiceHumanPawn nicePawn; local class niceVet; - local MeanReplicationInfo szRI; local NiceWeapon niceWeap; local NicePlayerController nicePlayer; local ScrnHUD scrnHUDInstance; + // TODO maybe use scrnhud? + 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; + if(C == none) return; if(C.ViewPort == none) return; if(C.ViewPort.Actor == none) return; @@ -48,25 +81,70 @@ function PostRender(Canvas C){ if(nicePlayer == none) return; scrnHUDInstance = ScrnHUD(nicePlayer.myHUD); - //// Draw bleed and poison icons - szRI = class'MeanReplicationInfo'.static.findSZri(ViewportOwner.Actor.PlayerReplicationInfo); + + //// Draw bleed and poison icons for OWNER offset = 4; - if(szRI != none){ - if(szRI.isBleeding){ - x = C.ClipX * 0.007; - y = C.ClipY * 0.93 - size * offset; - C.SetPos(x, y); - C.DrawTile(bleedIcon, size, size, 0, 0, bleedIcon.MaterialUSize(), bleedIcon.MaterialVSize()); - } - offset++; - if(isPoisoned(ScrnHumanPawn(C.ViewPort.Actor.Pawn))){ - x = C.ClipX * 0.007; - y = C.ClipY * 0.93 - size * offset; - C.SetPos(x, y); - C.DrawTile(poisonIcon, size, size, 0, 0, poisonIcon.MaterialUSize(), poisonIcon.MaterialVSize()); - } - } - if(niceWeap != none && niceWeap.bShowSecondaryCharge && scrnHUDInstance != none){ + // BLEED!!! + if (bIsBleeding(ScrnHumanPawn(C.ViewPort.Actor.Pawn))) + { + x = C.ClipX * 0.007; + y = C.ClipY * 0.93 - size * offset; + C.SetPos(x, y); + C.DrawTile(bleedIcon, size, size, 0, 0, bleedIcon.MaterialUSize(), bleedIcon.MaterialVSize()); + } + offset++; + // POISON!!! + if (bIsPoisoned(ScrnHumanPawn(C.ViewPort.Actor.Pawn))) + { + x = C.ClipX * 0.007; + y = C.ClipY * 0.93 - size * offset; + C.SetPos(x, y); + C.DrawTile(poisonIcon, size, size, 0, 0, poisonIcon.MaterialUSize(), poisonIcon.MaterialVSize()); + } + + // draw bleed and poison icons for TEAMMATES +// C.GetCAmeraLocation(CamPos, CamRot); +// ViewDir = vector(CamRot); +// kfHud = HUDKillingFloor(ViewportOwner.Actor.myHUD); +// OffsetX = (36.f * kfHud.default.VeterancyMatScaleFactor * 0.6) - (kfHud.default.HealthIconSize + 2.0); +// BarLength = FMin(kfHud.default.BarLength * (float(C.SizeX) / 1024.f), kfHud.default.BarLength); +// BarHeight = FMin(kfHud.default.BarHeight * (float(C.SizeX) / 1024.f), kfHud.default.BarHeight); +// for (i = 0; i < kfHUD.PlayerInfoPawns.Length; i++) +// { +// if (kfHUD.PlayerInfoPawns[i].Pawn != none && kfHUD.PlayerInfoPawns[i].Pawn.Health > 0 && +// (kfHUD.PlayerInfoPawns[i].Pawn.Location - kfHUD.PawnOwner.Location) dot ViewDir > 0.8 && +// kfHUD.PlayerInfoPawns[i].RendTime > ViewportOwner.Actor.Level.TimeSeconds) +// { +// C.StrLen(Left(kfHUD.PlayerInfoPawns[i].Pawn.PlayerReplicationInfo.PlayerName, 16), XL, YL); +// if (kfHUD.PlayerInfoPawns[i].Pawn.ShieldStrength <= 0) +// { +// posY = (kfHUD.PlayerInfoPawns[i].PlayerInfoScreenPosY - YL) - 2.75 * BarHeight - +// kfHUD.default.ArmorIconSize * 0.5; +// } +// else +// { +// posY = (kfHUD.PlayerInfoPawns[i].PlayerInfoScreenPosY - YL) - 3.8 * BarHeight - +// kfHUD.default.ArmorIconSize * 0.5; +// } +// offset = 0; + +// if (bIsBleeding(ScrnHumanPawn(kfHUD.PlayerInfoPawns[i].Pawn))) +// { +// C.SetPos(kfHUD.PlayerInfoPawns[i].PlayerInfoScreenPosX - OffsetX - 0.15 * BarLength - +// kfHUD.default.ArmorIconSize - 2.0, posY); +// C.DrawTileScaled(bleedIcon, 0.1875, 0.1875); +// } +// if (bIsPoisoned(ScrnHumanPawn(kfHUD.PlayerInfoPawns[i].Pawn))) +// { +// C.SetPos(kfHUD.PlayerInfoPawns[i].PlayerInfoScreenPosX - OffsetX + 0.15 * BarLength - +// kfHUD.default.ArmorIconSize - 2.0, posY); +// C.DrawTileScaled(poisonIcon, 0.1875, 0.1875); +// } +// } +// } + + if (niceWeap != none && niceWeap.bShowSecondaryCharge && scrnHUDInstance != none) + { C.ColorModulate.X = 1; C.ColorModulate.Y = 1; C.ColorModulate.Z = 1; @@ -77,11 +155,13 @@ function PostRender(Canvas C){ scrnHUDInstance.SecondaryClipsDigits.value = niceWeap.secondaryCharge; scrnHUDInstance.DrawNumericWidget(C, scrnHUDInstance.SecondaryClipsDigits, scrnHUDInstance.DigitsSmall); } + niceMutator = class'NicePack'.static.Myself(C.ViewPort.Actor.Pawn.Level); - if(niceMutator == none) + if (niceMutator == none) return; //// Draw counters - if(nicePlayer != none && nicePlayer.bFlagDisplayCounters){ + if(nicePlayer != none && nicePlayer.bFlagDisplayCounters) + { x = C.ClipX * 0.5 - (64 + 2) * niceMutator.GetVisibleCountersAmount(); y = C.ClipY * 0.01; for(i = 0;i < niceMutator.niceCounterSet.Length;i ++) @@ -91,7 +171,8 @@ function PostRender(Canvas C){ } } //// Draw weapons progress bars - if(nicePlayer != none && nicePlayer.bFlagDisplayWeaponProgress){ + if(nicePlayer != none && nicePlayer.bFlagDisplayWeaponProgress) + { 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 ++){ @@ -102,7 +183,8 @@ function PostRender(Canvas C){ } //// Draw invincibility bar nicePawn = NiceHumanPawn(nicePlayer.pawn); - if(nicePawn != none && nicePawn.invincibilityTimer != 0.0){ + if(nicePawn != none && nicePawn.invincibilityTimer != 0.0) + { C.SetDrawColor(255, 255, 255); if(nicePawn.invincibilityTimer > 0) barTexture = greenBar; @@ -147,6 +229,7 @@ function PostRender(Canvas C){ for(i = 0;i < nicePlayer.abilityManager.currentAbilitiesAmount;i ++) DrawAbilityCooldown(C, i); } + function DrawCounter(Canvas C, NicePack.CounterDisplay counter, int x, int y, TeamInfo team){ local float borderSpace; local Texture textureToDraw; diff --git a/sources/GUI/NiceInvasionLoginMenu.uc b/sources/GUI/NiceInvasionLoginMenu.uc index 6f260a2..94e6868 100644 --- a/sources/GUI/NiceInvasionLoginMenu.uc +++ b/sources/GUI/NiceInvasionLoginMenu.uc @@ -8,16 +8,16 @@ function InitComponent(GUIController MyController, GUIComponent MyOwner){ local SRMenuAddition M; local int indexAfterScrn; // Setup panel classes. - Panels[0].ClassName = string(Class'ScrnBalanceSrv.ScrnTab_MidGamePerks'); + Panels[0].ClassName = string(class'ScrnTab_MidGamePerks'); Panels[1].ClassName = string(class'NicePanelSkills'); - Panels[2].ClassName = string(Class'SRTab_MidGameVoiceChat'); - Panels[3].ClassName = string(Class'SRTab_MidGameStats'); - Panels[0].Caption = Class'KFInvasionLoginMenu'.Default.Panels[1].Caption; + Panels[2].ClassName = string(class'SRTab_MidGameVoiceChat'); + Panels[3].ClassName = string(class'SRTab_MidGameStats'); + Panels[0].Caption = class'KFInvasionLoginMenu'.Default.Panels[1].Caption; Panels[1].Caption = "Skills"; - Panels[2].Caption = Class'KFInvasionLoginMenu'.Default.Panels[2].Caption; - Panels[0].Hint = Class'KFInvasionLoginMenu'.Default.Panels[1].Hint; + Panels[2].Caption = class'KFInvasionLoginMenu'.Default.Panels[2].Caption; + Panels[0].Hint = class'KFInvasionLoginMenu'.Default.Panels[1].Hint; Panels[1].Hint = "Customize your perk"; - Panels[2].Hint = Class'KFInvasionLoginMenu'.Default.Panels[2].Hint; + Panels[2].Hint = class'KFInvasionLoginMenu'.Default.Panels[2].Hint; b_Spec.Caption=class'KFTab_MidGamePerks'.default.b_Spec.Caption; b_MatchSetup.Caption=class'KFTab_MidGamePerks'.default.b_MatchSetup.Caption; b_KickVote.Caption=class'KFTab_MidGamePerks'.default.b_KickVote.Caption; @@ -28,17 +28,18 @@ function InitComponent(GUIController MyController, GUIComponent MyOwner){ b_Settings.Caption=class'KFTab_MidGamePerks'.default.b_Settings.Caption; b_Browser.Caption=class'KFTab_MidGamePerks'.default.b_Browser.Caption; // Other panels - Panels[4].ClassName = "ScrnBalanceSrv.ScrnTab_Achievements"; + Panels[4].ClassName = string(class'ScrnTab_Achievements'); Panels[4].Caption = "Achievements"; Panels[4].Hint = "ScrN server-side achievements"; - if(default.bShowScrnMenu){ - Panels[5].ClassName = "ScrnBalanceSrv.ScrnTab_UserSettings"; + if (default.bShowScrnMenu) + { + Panels[5].ClassName = string(class'ScrnTab_UserSettings'); Panels[5].Caption = "ScrN Features"; Panels[5].Hint = "ScrN Balance features, settings and info"; indexAfterScrn = 6; } else - indexAfterScrn = 5; + indexAfterScrn = 5; Panels[indexAfterScrn].ClassName = string(class'NiceGUISettings'); Panels[indexAfterScrn].Caption = "Nice settings"; Panels[indexAfterScrn].Hint = "Settings specific to NicePack mutator"; diff --git a/sources/GUI/NiceLobbyMenu.uc b/sources/GUI/NiceLobbyMenu.uc index fd2fd75..b89db7c 100644 --- a/sources/GUI/NiceLobbyMenu.uc +++ b/sources/GUI/NiceLobbyMenu.uc @@ -78,13 +78,29 @@ function InitComponent(GUIController MyC, GUIComponent MyO) { super(UT2k4MainPage).InitComponent(MyC, MyO); - i_Portrait.WinTop = PlayerPortraitBG.ActualTop() + 30; - i_Portrait.WinHeight = PlayerPortraitBG.ActualHeight() - 36; - + FixPortrait(); t_ChatBox.FocusInstead = PerkClickLabel; } +event ResolutionChanged(int ResX, int ResY) +{ + super.ResolutionChanged(ResX, ResY); + FixPortrait(); +} + + +// FUCKING TWI, YOUR FUCKING BUGS +final private function bool FixPortrait() +{ + i_Portrait.WinTop = PlayerPortraitBG.RelativeTop(i_Portrait.WinTop); // ActualTop() + 30; + i_Portrait.WinHeight = PlayerPortraitBG.RelativeHeight(i_Portrait.WinHeight); // ActualHeight() - 36; + // log(">>> HideLobbyMenu: FixPortrait() called!!!"); + + return false; +} + + // Called when the Menu Owner is opened event Opened(GUIComponent Sender) { diff --git a/sources/GUI/NicePanelSkills.uc b/sources/GUI/NicePanelSkills.uc index 65ba5b9..e7302da 100644 --- a/sources/GUI/NicePanelSkills.uc +++ b/sources/GUI/NicePanelSkills.uc @@ -1,36 +1,94 @@ -class NicePanelSkills extends Settings_Tabs; -var automated NiceGUIPerkButton skillButtonA[5], skillButtonB[5]; -function ShowPanel(bool bShow){ +class NicePanelSkills extends UT2K4TabPanel; + +var automated NiceGUIPerkButton skillButtonA[5], skillButtonB[5]; +var automated GUISectionBackground sb_big_left, sb_big_right; + +function ShowPanel(bool bShow) +{ local int i; local class niceVet; local NicePlayerController nicePlayer; - Super.ShowPanel(bShow); + + super.ShowPanel(bShow); + + // loops are for puss + sb_big_left.ManageComponent(skillButtonA[0]); + sb_big_left.ManageComponent(skillButtonA[1]); + sb_big_left.ManageComponent(skillButtonA[2]); + sb_big_left.ManageComponent(skillButtonA[3]); + sb_big_left.ManageComponent(skillButtonA[4]); + + sb_big_right.ManageComponent(skillButtonB[0]); + sb_big_right.ManageComponent(skillButtonB[1]); + sb_big_right.ManageComponent(skillButtonB[2]); + sb_big_right.ManageComponent(skillButtonB[3]); + sb_big_right.ManageComponent(skillButtonB[4]); + nicePlayer = NicePlayerController(PlayerOwner()); - if(nicePlayer != none) + if (nicePlayer != none) niceVet = class'NiceVeterancyTypes'.static.GetVeterancy(nicePlayer.PlayerReplicationInfo); - if(niceVet != none){ - for(i = 0;i < 5;i ++){ - skillButtonA[i].skillIndex = i; - skillButtonB[i].skillIndex = i; - skillButtonA[i].skillPerkIndex = niceVet.default.PerkIndex; - skillButtonB[i].skillPerkIndex = niceVet.default.PerkIndex; - skillButtonA[i].isAltSkill = false; - skillButtonB[i].isAltSkill = true; - skillButtonA[i].associatedSkill = niceVet.default.SkillGroupA[i]; - skillButtonB[i].associatedSkill = niceVet.default.SkillGroupB[i]; - } + if (niceVet != none) + { + for (i = 0;i < 5;i ++) + { + skillButtonA[i].skillIndex = i; + skillButtonB[i].skillIndex = i; + skillButtonA[i].skillPerkIndex = niceVet.default.PerkIndex; + skillButtonB[i].skillPerkIndex = niceVet.default.PerkIndex; + skillButtonA[i].isAltSkill = false; + skillButtonB[i].isAltSkill = true; + skillButtonA[i].associatedSkill = niceVet.default.SkillGroupA[i]; + skillButtonB[i].associatedSkill = niceVet.default.SkillGroupB[i]; + } } } + // size = (x=0.0125, y=0.0) ; (w=1.0, h=0.865) // setup caption defaultproperties { + // BACKGROUNDS + Begin Object Class=AltSectionBackground Name=skillbckgrndl + Caption="LEFT SKILLS" + // bNoCaption=true + LeftPadding=0.000000 + RightPadding=0.030000 + TopPadding=0.000000 + BottomPadding=0.000000 + WinTop=0.000000 + WinLeft=0.000000 + WinWidth=0.500000 + WinHeight=0.87 + bBoundToParent=True + bScaleToParent=True + OnPreDraw=skillbckgrndl.InternalPreDraw + End Object + sb_big_left=skillbckgrndl + + Begin Object Class=AltSectionBackground Name=skillbckgrndr + Caption="OBVIOUSLY RIGHT SKILLS" + // bNoCaption=true + LeftPadding=0.000000 + RightPadding=0.030000 + TopPadding=0.000000 + BottomPadding=0.000000 + WinTop=0.000000 + WinLeft=0.500000 + WinWidth=0.500000 + WinHeight=0.87 + bBoundToParent=True + bScaleToParent=True + OnPreDraw=skillbckgrndr.InternalPreDraw + End Object + sb_big_right=skillbckgrndr + + // buttons Begin Object Class=NiceGUIPerkButton Name=btn1A - WinTop=0.012500 + // WinTop=0.012500 WinWidth=0.495000 WinHeight=0.160000 - RenderWeight=2.000000 - TabOrder=1 + // RenderWeight=2.000000 + // TabOrder=1 bBoundToParent=True bScaleToParent=True bMouseOverSound=False @@ -40,11 +98,11 @@ defaultproperties skillButtonA(0)=btn1A Begin Object Class=NiceGUIPerkButton Name=btn2A - WinTop=0.188500 + // WinTop=0.188500 WinWidth=0.495000 WinHeight=0.160000 - RenderWeight=2.000000 - TabOrder=3 + // RenderWeight=2.000000 + // TabOrder=3 bBoundToParent=True bScaleToParent=True bMouseOverSound=False @@ -54,11 +112,11 @@ defaultproperties skillButtonA(1)=btn2A Begin Object Class=NiceGUIPerkButton Name=btn3A - WinTop=0.364500 + // WinTop=0.364500 WinWidth=0.495000 WinHeight=0.160000 - RenderWeight=2.000000 - TabOrder=5 + // RenderWeight=2.000000 + // TabOrder=5 bBoundToParent=True bScaleToParent=True bMouseOverSound=False @@ -68,11 +126,11 @@ defaultproperties skillButtonA(2)=btn3A Begin Object Class=NiceGUIPerkButton Name=btn4A - WinTop=0.540500 + // WinTop=0.540500 WinWidth=0.495000 WinHeight=0.160000 - RenderWeight=2.000000 - TabOrder=7 + // RenderWeight=2.000000 + // TabOrder=7 bBoundToParent=True bScaleToParent=True bMouseOverSound=False @@ -82,11 +140,11 @@ defaultproperties skillButtonA(3)=btn4A Begin Object Class=NiceGUIPerkButton Name=btn5A - WinTop=0.716500 + // WinTop=0.716500 WinWidth=0.495000 WinHeight=0.160000 - RenderWeight=2.000000 - TabOrder=9 + // RenderWeight=2.000000 + // TabOrder=9 bBoundToParent=True bScaleToParent=True bMouseOverSound=False diff --git a/sources/NiceHumanPawn.uc b/sources/NiceHumanPawn.uc index ebbd6b0..8970d8a 100644 --- a/sources/NiceHumanPawn.uc +++ b/sources/NiceHumanPawn.uc @@ -67,8 +67,8 @@ function ReplaceRequiredEquipment(){ Super.ReplaceRequiredEquipment(); RequiredEquipment[0] = String(class'NiceMachete'); RequiredEquipment[1] = String(class'Nice9mmPlus'); - RequiredEquipment[2] = String(class'ScrnBalanceSrv.ScrnFrag'); - RequiredEquipment[3] = String(class'ScrnBalanceSrv.ScrnSyringe'); + RequiredEquipment[2] = String(class'ScrnFrag'); + RequiredEquipment[3] = String(class'ScrnSyringe'); RequiredEquipment[4] = String(class'KFMod.Welder'); } simulated function int CalculateCalibrationScore(){ @@ -510,7 +510,7 @@ function bool AddInventory(inventory NewItem){ if((DualDeagle(weap) != none || Dual44Magnum(weap) != none || DualMK23Pistol(weap) != none) && weap.InventoryGroup != 4 ) { if(KFPRI != none && - ClassIsChildOf(KFPRI.ClientVeteranSkill, class'ScrnBalanceSrv.ScrnVetGunslinger')) + ClassIsChildOf(KFPRI.ClientVeteranSkill, class'ScrnVetGunslinger')) weap.InventoryGroup = 3; else weap.InventoryGroup = 2; @@ -555,16 +555,21 @@ simulated function CookGrenade(){ niceWeap.ClientGrenadeState = GN_TempDown; niceWeap.PutDown(); } -simulated function ThrowGrenade(){ +simulated function ThrowGrenade() +{ local NiceWeapon niceWeap; niceWeap = NiceWeapon(Weapon); if(niceWeap != none) niceWeap.ClientForceInterruptReload(CANCEL_NADE); if(bThrowingNade || SecondaryItem != none) return; - if( niceWeap == none - || (niceWeap.bIsReloading && !niceWeap.InterruptReload())) - return; + + if(niceWeap == none || (niceWeap.bIsReloading && !niceWeap.InterruptReload())) + { + super.ThrowGrenade(); + return; + } + if(playerGrenade == none) playerGrenade = FindPlayerGrenade(); if(playerGrenade != none && playerGrenade.HasAmmo()){ @@ -863,6 +868,40 @@ simulated function AltFire(optional float F){ super.AltFire(F); } +// added copy-cated function to disable some log +simulated function Setup(xUtil.PlayerRecord rec, optional bool bLoadNow) +{ + local ScrnPlayerController PC; + local string CN; + + PC = ScrnPlayerController(Controller); + if ( PC != none && IsLocallyControlled() ) + { + // check this only on player side, because it stores + // RedCharacter & BlueCharacter in the config + CN = rec.DefaultName; + if ( !PC.ValidateCharacter(CN) ) { + // character invalid, change it valid one, which was set up in ValidateCharacter() + rec = class'xUtil'.static.FindPlayerRecord(CN); + PC.ChangeCharacter(CN); + } + } + + super(KFPawn).Setup(rec, bLoadNow); + + if( class(Species) != none ) + { + BreathingSound = class'KFDARSoundGroup'.default.BreathingSound; + } + else if( class(Species) != none ) + { + BreathingSound = class'KFFemaleSoundGroup'.default.BreathingSound; + } + // disable the log!!! + // log(BreathingSound); +} + + defaultproperties { defaultInvincibilityDuration=2.000000 diff --git a/sources/NicePack.uc b/sources/NicePack.uc index 40fc897..0490da3 100644 --- a/sources/NicePack.uc +++ b/sources/NicePack.uc @@ -176,14 +176,14 @@ simulated function PostBeginPlay(){ class'ScrnHorzineVestPickup'.default.cost = 750; class'NicePack'.default.Mut = self; // Gun skins - class'NiceMaulerPickup'.default.VariantClasses[class'NiceMaulerPickup'.default.VariantClasses.length] = class'ScrnBalanceSrv.ScrnSPSniperPickup'; + 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'ScrnBalanceSrv.ScrnKrissMPickup'.default.VariantClasses[class'ScrnBalanceSrv.ScrnKrissMPickup'.default.VariantClasses.length] = class'SkinGoldenKrissPickup'; + 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); @@ -468,14 +468,13 @@ simulated function bool CheckReplacement(Actor Other, out byte bSuperRelevant){ local NicePlayerController playerContr; local NiceRepInfoRemoteData remoteRI; local NiceReplicationInfo niceRI; - local MeanReplicationInfo meanRI; local PlayerReplicationInfo pri; // Replace loot on levels - if(Other.class == class'KFRandomItemSpawn' || Other.class == class'ScrnBalanceSrv.ScrnRandomItemSpawn'){ + if(Other.class == class'KFRandomItemSpawn' || Other.class == class'ScrnRandomItemSpawn'){ ReplaceWith(Other, string(class'NiceRandomItemSpawn')); return false; } - else if(Other.class == class'KFAmmoPickup' || Other.class == class'ScrnBalanceSrv.ScrnAmmoPickup') { + else if(Other.class == class'KFAmmoPickup' || Other.class == class'ScrnAmmoPickup') { ReplaceWith(Other, string(class'NiceAmmoPickup')); return false; } @@ -493,8 +492,6 @@ simulated function bool CheckReplacement(Actor Other, out byte bSuperRelevant){ niceRI = spawn(class'NiceReplicationInfo', pri.Owner); niceRI.Mut = self; remoteRI = spawn(class'NiceRepInfoRemoteData', pri.Owner); - meanRI = spawn(class'MeanReplicationInfo', pri.Owner); - meanRI.ownerPRI = pri; playerContr = NicePlayerController(PlayerReplicationInfo(Other).Owner); playerContr.niceRI = niceRI; playerContr.remoteRI = remoteRI; @@ -1067,18 +1064,20 @@ defaultproperties bNoLateFFIncrease=True junkieNextGoal=1 bIsPreGame=True - pickupReplaceArray(0)=(vanillaClass=Class'KFMod.MAC10Pickup',scrnClass=Class'ScrnBalanceSrv.ScrnMAC10Pickup',NewClass=class'NiceMAC10Pickup') - pickupReplaceArray(1)=(vanillaClass=Class'KFMod.WinchesterPickup',scrnClass=Class'ScrnBalanceSrv.ScrnWinchesterPickup',NewClass=class'NiceWinchesterPickup') - pickupReplaceArray(2)=(vanillaClass=Class'KFMod.CrossbowPickup',scrnClass=Class'ScrnBalanceSrv.ScrnCrossbowPickup',NewClass=class'NiceCrossbowPickup') - pickupReplaceArray(3)=(vanillaClass=Class'KFMod.SPSniperPickup',scrnClass=Class'ScrnBalanceSrv.ScrnSPSniperPickup',NewClass=class'NiceMaulerPickup') - pickupReplaceArray(4)=(vanillaClass=Class'KFMod.M14EBRPickup',scrnClass=Class'ScrnBalanceSrv.ScrnM14EBRPickup',NewClass=class'NiceM14EBRPickup') - pickupReplaceArray(5)=(vanillaClass=Class'KFMod.M99Pickup',scrnClass=Class'ScrnBalanceSrv.ScrnM99Pickup',NewClass=class'NiceM99Pickup') - pickupReplaceArray(6)=(vanillaClass=Class'KFMod.ShotgunPickup',scrnClass=Class'ScrnBalanceSrv.ScrnShotgunPickup',NewClass=class'NiceShotgunPickup') - pickupReplaceArray(7)=(vanillaClass=Class'KFMod.BoomStickPickup',scrnClass=Class'ScrnBalanceSrv.ScrnBoomStickPickup',NewClass=class'NiceBoomStickPickup') - pickupReplaceArray(8)=(vanillaClass=Class'KFMod.NailGunPickup',scrnClass=Class'ScrnBalanceSrv.ScrnNailGunPickup',NewClass=class'NiceNailGunPickup') - pickupReplaceArray(9)=(vanillaClass=Class'KFMod.KSGPickup',scrnClass=Class'ScrnBalanceSrv.ScrnKSGPickup',NewClass=class'NiceKSGPickup') - pickupReplaceArray(10)=(vanillaClass=Class'KFMod.BenelliPickup',scrnClass=Class'ScrnBalanceSrv.ScrnBenelliPickup',NewClass=class'NiceBenelliPickup') - pickupReplaceArray(11)=(vanillaClass=Class'KFMod.AA12Pickup',scrnClass=Class'ScrnBalanceSrv.ScrnAA12Pickup',NewClass=class'NiceAA12Pickup') + 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') + 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+" diff --git a/sources/NicePlayerController.uc b/sources/NicePlayerController.uc index 3e02237..7b67034 100644 --- a/sources/NicePlayerController.uc +++ b/sources/NicePlayerController.uc @@ -2,6 +2,8 @@ class NicePlayerController extends ScrnPlayerController config(NiceUser) dependson(NicePack) dependson(NiceFire); + +var globalconfig int ZedHPBarStyle; // 0 - big zeds, 1 - all, 2 - disabled var globalconfig int nicePlayerInfoVersionNumber; // These are values stored in a settings file var globalconfig bool bDebug; @@ -403,12 +405,12 @@ simulated event Destroyed(){ // Screw that simulated function ClientWeaponDestroyed(class WClass){} // This event is generated when new pawn spawns -function PawnSpawned(){ +function PawnSpawned() +{ local bool bFoundExp; local float convertedExp; local ClientPerkRepLink R; local SRCustomProgress exp; - local MeanReplicationInfo meanRI; local NicePack.PlayerRecord record; //local NiceHumanPawn nicePawn; // Make sure our health is at it's top @@ -496,10 +498,6 @@ function PawnSpawned(){ exp.IncrementProgress(convertedExp); } } - // Stop after-death bleeding - meanRI = class'MeanReplicationInfo'.static.findSZri(PlayerReplicationInfo); - if(meanRI != none) - meanRI.stopBleeding(); // Give necessary dosh to the player if(NicePackMutator != none) NicePackMutator.GiveProgressiveDosh(self); @@ -1442,6 +1440,101 @@ exec simulated function Siren(float value) sirenScreamMod = value; } + +// copy-cat to fix MyTrader accessed none log spam +function ClientLocationalVoiceMessage(PlayerReplicationInfo Sender, + PlayerReplicationInfo Recipient, + name MessageType, byte MessageID, + optional Pawn SenderPawn, optional vector SenderLocation) +{ + local VoicePack Voice; + local ShopVolume Shop; + + if (Sender == none || Sender.VoiceType == none || Player.Console == none || Level.NetMode == NM_DedicatedServer) + { + return; + } + + Voice = Spawn(Sender.VoiceType, self); + if (KFVoicePack(Voice) != none) + { + if (MessageType == 'TRADER') + { + if (Pawn != none && MessageID >= 4) + { + foreach Pawn.TouchingActors(class'ShopVolume', Shop) + { + // fix this + if (Shop.MyTrader != none) + SenderLocation = Shop.MyTrader.Location; + else + SenderLocation = Shop.Location; + + // Only play the 30 Seconds remaining messages come across as Locational Speech if we're in the Shop + if (MessageID == 4) + { + return; + } + else if (MessageID == 5) + { + MessageID = 999; + } + + break; + } + } + + // Only play the 10 Seconds remaining message if we are in the Shop + // and only play the 30 seconds remaning message if we haven't been to the Shop + if (MessageID == 5 || (MessageID == 4 && bHasHeardTraderWelcomeMessage)) + { + return; + } + else if (MessageID == 999) + { + MessageID = 5; + } + + // Store the fact that we've heard the Trader's Welcome message on the client + if (MessageID == 7) + { + bHasHeardTraderWelcomeMessage = true; + } + // If we're hearing the Shop's Closed Message, reset the Trader's Welcome message flag + else if (MessageID == 6) + { + bHasHeardTraderWelcomeMessage = false; + } + + KFVoicePack(Voice).ClientInitializeLocational(Sender, Recipient, MessageType, MessageID, SenderPawn, SenderLocation); + + if (MessageID > 6 /*&& bBuyMenuIsOpen*/) + { + // TODO: Show KFVoicePack(Voice).GetClientParsedMessage() in the Buy Menu + } + else if (KFVoicePack(Voice).GetClientParsedMessage() != "") + { + // Radio commands print to Text + TeamMessage(Sender, KFVoicePack(Voice).GetClientParsedMessage(), 'Trader'); + } + } + else + { + KFVoicePack(Voice).ClientInitializeLocational(Sender, Recipient, MessageType, MessageID, SenderPawn, SenderLocation); + + if (KFVoicePack(Voice).GetClientParsedMessage() != "") + { + TeamMessage(Sender, KFVoicePack(Voice).GetClientParsedMessage(), 'Voice'); + } + } + } + else if (Voice != none) + { + Voice.ClientInitialize(Sender, Recipient, MessageType, MessageID); + } +} + + defaultproperties { nicePlayerInfoVersionNumber=1 diff --git a/sources/NiceRandomItemSpawn.uc b/sources/NiceRandomItemSpawn.uc index 24cf52b..5d8a7a8 100644 --- a/sources/NiceRandomItemSpawn.uc +++ b/sources/NiceRandomItemSpawn.uc @@ -1,11 +1,14 @@ class NiceRandomItemSpawn extends ScrnRandomItemSpawn; + defaultproperties { - PickupClasses(0)=class'NiceWinchesterPickup' - PickupClasses(1)=class'NiceShotgunPickup' - PickupClasses(2)=class'NiceBullpupPickup' - PickupClasses(3)=class'NiceMagnumPickup' - PickupClasses(4)=class'NiceWinchesterPickup' - PickupClasses(5)=class'NiceM79Pickup' - PickupClasses(8)=class'NiceMAC10Pickup' -} + PickupClasses(0)=Class'NiceWinchesterPickup' + PickupClasses(1)=Class'NiceShotgunPickup' + PickupClasses(2)=Class'NiceBullpupPickup' + PickupClasses(3)=Class'NiceMagnumPickup' + PickupClasses(4)=Class'NiceWinchesterPickup' + PickupClasses(5)=Class'NiceM79Pickup' + PickupClasses(6)=Class'NiceAxePickup' + PickupClasses(7)=Class'ScrnVestPickup' + PickupClasses(8)=class'NiceMAC10Pickup' +} \ No newline at end of file diff --git a/sources/NiceReplicationInfo.uc b/sources/NiceReplicationInfo.uc index 9a07d35..ad3c131 100644 --- a/sources/NiceReplicationInfo.uc +++ b/sources/NiceReplicationInfo.uc @@ -185,25 +185,19 @@ simulated function HandleNiceHealingMechanicsAndSkills simulated function RemovePoisonAndBleed(NiceHumanPawn healed) { - local Inventory I; - local MeanReplicationInfo MRI; + local Inventory I; // log spam fix if (healed == none) return; - // No bleeding - MRI = class'MeanReplicationInfo'.static. - findSZri(healed.PlayerReplicationInfo); - if (MRI != none) - MRI.stopBleeding(); - // No poison + // No poison and bleed if (healed.inventory == none) return; for (I = healed.inventory; I != none; I = I.inventory) { - if (MeanPoisonInventory(I) != none) + if (MeanPoisonInventory(I) != none || MeanBleedInventory(I) != none) I.Destroy(); } } diff --git a/sources/Perks/Firebug/NiceVetFirebug.uc b/sources/Perks/Firebug/NiceVetFirebug.uc index 6da1222..00e87f0 100644 --- a/sources/Perks/Firebug/NiceVetFirebug.uc +++ b/sources/Perks/Firebug/NiceVetFirebug.uc @@ -96,7 +96,7 @@ static function class GetNadeType(KFPlayerReplicationInfo KFPRI) //can't cook fire nades static function bool CanCookNade(KFPlayerReplicationInfo KFPRI, Weapon Weap) { - return GetNadeType(KFPRI) != class'ScrnBalanceSrv.ScrnFlameNade'; + return GetNadeType(KFPRI) != class'ScrnFlameNade'; } //v2.60: +60% faster charge with Husk Gun static function float GetReloadSpeedModifierStatic(KFPlayerReplicationInfo KFPRI, class Other) diff --git a/sources/Perks/NiceVeterancyTypes.uc b/sources/Perks/NiceVeterancyTypes.uc index 28c3d31..24560b4 100644 --- a/sources/Perks/NiceVeterancyTypes.uc +++ b/sources/Perks/NiceVeterancyTypes.uc @@ -285,20 +285,39 @@ static function int GetInvincibilityDuration(KFPlayerReplicationInfo KFPRI){ static function int GetInvincibilitySafeMisses(KFPlayerReplicationInfo KFPRI){ return 0; } -static function SpecialHUDInfo(KFPlayerReplicationInfo KFPRI, Canvas C){ + +static function SpecialHUDInfo(KFPlayerReplicationInfo KFPRI, Canvas C) +{ local KFMonster KFEnemy; local HUDKillingFloor HKF; + local int i, hp; local float MaxDistanceSquared; + MaxDistanceSquared = 640000; MaxDistanceSquared *= GetHealthBarsDistanceMulti(KFPRI)**2; HKF = HUDKillingFloor(C.ViewPort.Actor.myHUD); - if(HKF == none || C.ViewPort.Actor.Pawn == none || MaxDistanceSquared <= 0) + if (HKF == none || C.ViewPort.Actor.Pawn == none || MaxDistanceSquared <= 0) return; - foreach C.ViewPort.Actor.DynamicActors(class'KFMonster', KFEnemy){ - if(KFEnemy.Health > 0 && (!KFEnemy.Cloaked() || KFEnemy.bZapped || KFEnemy.bSpotted) && VSizeSquared(KFEnemy.Location - C.ViewPort.Actor.Pawn.Location) < MaxDistanceSquared) + + // read and use player settings + // 0 - big zeds, 1 - all, 2 - disabled + i = NicePlayerController(C.ViewPort.actor).ZedHPBarStyle; + + if (i == 2) + return; + else if (i == 1) + hp = 0; + else + hp = 1000; + + foreach C.ViewPort.Actor.DynamicActors(class'KFMonster', KFEnemy) + { + // check with stopwatch + if (KFEnemy.Health > hp && (!KFEnemy.Cloaked() || KFEnemy.bZapped || KFEnemy.bSpotted) && VSizeSquared(KFEnemy.Location - C.ViewPort.Actor.Pawn.Location) < MaxDistanceSquared) HKF.DrawHealthBar(C, KFEnemy, KFEnemy.Health, KFEnemy.HealthMax , 50.0); } } + // Is player standing still? static function bool IsStandingStill(KFPlayerReplicationInfo KFPRI){ if(KFPRI != none && PlayerController(KFPRI.Owner) != none && PlayerController(KFPRI.Owner).Pawn != none && VSize(PlayerController(KFPRI.Owner).Pawn.Velocity) > 0.0) diff --git a/sources/Weapons/NiceWeapon.uc b/sources/Weapons/NiceWeapon.uc index 3adda40..efc2a0a 100644 --- a/sources/Weapons/NiceWeapon.uc +++ b/sources/Weapons/NiceWeapon.uc @@ -1626,8 +1626,8 @@ defaultproperties { recordedZoomTime=-1.000000 SecondaryCharge=1 - LaserAttachmentClass=Class'ScrnBalanceSrv.ScrnLaserAttachmentFirstPerson' - LaserDotClass=Class'ScrnBalanceSrv.ScrnLocalLaserDot' + LaserAttachmentClass=Class'ScrnLaserAttachmentFirstPerson' + LaserDotClass=Class'ScrnLocalLaserDot' LaserAttachmentBone="LightBone" MagazineBone="Magazine" bHasChargePhase=True diff --git a/sources/Weapons/Playable/Grenades/NiceNade.uc b/sources/Weapons/Playable/Grenades/NiceNade.uc index 1a2b71e..48b778b 100644 --- a/sources/Weapons/Playable/Grenades/NiceNade.uc +++ b/sources/Weapons/Playable/Grenades/NiceNade.uc @@ -135,7 +135,7 @@ simulated function HurtRadius( float DamageAmount, float DamageRadius, class= 5 && Stats != none ) - class'ScrnBalanceSrv.ScrnAchievements'.static.ProgressAchievementByID(Stats.Rep, 'SuicideBomber', 1); + class'ScrnAchievements'.static.ProgressAchievementByID(Stats.Rep, 'SuicideBomber', 1); if ( NumKilled >= 4 ) { diff --git a/sources/Weapons/Playable/Incendiary/HuskGun/NiceHuskGunFire.uc b/sources/Weapons/Playable/Incendiary/HuskGun/NiceHuskGunFire.uc index a25fa63..d806ad1 100644 --- a/sources/Weapons/Playable/Incendiary/HuskGun/NiceHuskGunFire.uc +++ b/sources/Weapons/Playable/Incendiary/HuskGun/NiceHuskGunFire.uc @@ -11,7 +11,7 @@ function Timer() // if (AmmoInCharge == MaxChargeAmmo) { // Player = Level.GetLocalPlayerController(); // if (Player != none) - // Player.ReceiveLocalizedMessage(class'ScrnBalanceSrv.ScrnPlayerMessage',0); + // Player.ReceiveLocalizedMessage(class'ScrnPlayerMessage',0); // } } super.Timer(); diff --git a/sources/Zeds/Mean/MeanBleedInventory.uc b/sources/Zeds/Mean/MeanBleedInventory.uc new file mode 100644 index 0000000..796923b --- /dev/null +++ b/sources/Zeds/Mean/MeanBleedInventory.uc @@ -0,0 +1,67 @@ +class MeanBleedInventory extends Inventory; + + +const dmtype_bleed=class'NiceDamTypeStalkerBleed'; +var int maxBleedCount; +var private float fBleedPeriod; + +var int bleedLevel; +var MeanZombieCrawler stalker; + + +event PostBeginPlay() +{ + super.PostBeginPlay(); + // start the timer + SetTimer(fBleedPeriod, true); +} + + +event Timer() +{ + local pawn locpawn; + local bool amAlive; + local int bleedDamage; + + locpawn = Pawn(Owner); + amAlive = locpawn != none && locpawn.Health > 0; + + bleedDamage = bleedLevel * 7; + // if pawn owner is dead or bleed count is done - destroy + if (!amAlive || maxBleedCount < 0 || bleedDamage < 1.0) + { + Destroy(); + return; + } + + maxBleedCount--; + + if (stalker != none) + locpawn.TakeDamage(bleedDamage, stalker, locpawn.Location, + vect(0, 0, 0), dmtype_bleed); + else + locpawn.TakeDamage(bleedDamage, locpawn, locpawn.Location, + vect(0, 0, 0), dmtype_bleed); + + if (locpawn.isA('KFPawn')) + { + KFPawn(locpawn).HealthToGive -= 2 * bleedLevel; + } +} + + +// cleanup +function Destroyed() +{ + if (stalker != none) + stalker = none; + + super.Destroyed(); +} + + +defaultproperties +{ + maxBleedCount=7 + fBleedPeriod=1.500000 +} \ No newline at end of file diff --git a/sources/Zeds/Mean/MeanZombieStalker.uc b/sources/Zeds/Mean/MeanZombieStalker.uc index 53111d2..b68ed69 100644 --- a/sources/Zeds/Mean/MeanZombieStalker.uc +++ b/sources/Zeds/Mean/MeanZombieStalker.uc @@ -190,20 +190,49 @@ function bool MeleeDamageTarget(int hitdamage, vector pushdir) if (result && targetPawn != none) { - if (targetPawn.ShieldStrength > 100) - return result; - else if (targetPawn.ShieldStrength < 0) - effectStrenght = 1.0; - else - effectStrenght = (100 - targetPawn.ShieldStrength) * 0.01; + if (targetPawn.ShieldStrength > 100) + return result; + else if (targetPawn.ShieldStrength <= 0) + effectStrenght = 1.0; + else + effectStrenght = (100 - targetPawn.ShieldStrength) * 0.01; - class'MeanReplicationInfo'.static - .findSZri(targetPawn.PlayerReplicationInfo) - .setBleeding(Self, effectStrenght); + MakeBleed(targetPawn, effectStrenght); } return result; } +final private function MakeBleed(NiceHumanPawn poorpawn, coerce int effectStrenght) +{ + local Inventory I; + local MeanBleedInventory bleedinv; + local bool bFoundPoison; + + if (poorpawn.Inventory != none) + { + for (I = poorpawn.Inventory; I != none; I = I.Inventory) + { + if (MeanBleedInventory(I) != none) + { + bleedinv = MeanBleedInventory(I); + bFoundPoison = true; + bleedinv.stalker = self; + bleedinv.bleedLevel = effectStrenght; + // reset bleed count + bleedinv.maxBleedCount = bleedinv.default.maxBleedCount; + } + } + } + if (!bFoundPoison) + { + I = Controller.Spawn(class(DynamicLoadObject(string(class'MeanBleedInventory'), class'Class'))); + bleedinv = MeanBleedInventory(I); + bleedinv.stalker = self; + bleedinv.bleedLevel = effectStrenght; + bleedinv.GiveTo(poorpawn); + } +} + function RemoveHead() { Super(NiceMonster).RemoveHead(); diff --git a/sources/Zeds/MeanReplicationInfo.uc b/sources/Zeds/MeanReplicationInfo.uc index a6684a5..d25c2c7 100644 --- a/sources/Zeds/MeanReplicationInfo.uc +++ b/sources/Zeds/MeanReplicationInfo.uc @@ -1,82 +1,4 @@ -// Copy pasted from super zombies mutator with small alterations +// no use atm class MeanReplicationInfo extends ReplicationInfo; -struct BleedingState { - var float nextBleedTime; - var Pawn instigator; - var int count; -}; -var PlayerReplicationInfo ownerPRI; -var bool isBleeding; -var int maxBleedCount; -var BleedingState bleedState; -var float bleedPeriod; -var float bleedLevel; -replication { - reliable if (bNetDirty && Role == ROLE_Authority) - isBleeding, ownerPRI; -} -// Returns bleed damage, corresponding to given bleed level and damage scale. -// Rand(7) should be used as a scale. -// Separate function created to allow for lowest/highest damage value computing. -function int calcBleedDamage(float level, int scale){ - return level * (3 + scale); -} -function Tick(float DeltaTime) { - local PlayerController ownerCtrllr; - local bool amAlive; - local float bleedDamage; - ownerCtrllr = PlayerController(Owner); - amAlive = ownerCtrllr != none && ownerCtrllr.Pawn != none && ownerCtrllr.Pawn.Health > 0; - if(amAlive && bleedState.count > 0) { - if(bleedState.nextBleedTime < Level.TimeSeconds) { - bleedState.count--; - bleedState.nextBleedTime+= bleedPeriod; - // Fix bleeding when stalker dies - bleedDamage = calcBleedDamage(bleedLevel, rand(7)); - if(bleedDamage < 1.0) - stopBleeding(); - if(bleedState.instigator != none) - ownerCtrllr.Pawn.TakeDamage(bleedDamage, bleedState.instigator, ownerCtrllr.Pawn.Location, - vect(0, 0, 0), class'NiceDamTypeStalkerBleed'); - else - ownerCtrllr.Pawn.TakeDamage(bleedDamage, ownerCtrllr.Pawn, ownerCtrllr.Pawn.Location, - vect(0, 0, 0), class'NiceDamTypeStalkerBleed'); - if (ownerCtrllr.Pawn.isA('KFPawn')) { - KFPawn(ownerCtrllr.Pawn).HealthToGive -= 2 * bleedLevel; - } - } - } else { - isBleeding= false; - } -} -function stopBleeding(){ - isBleeding = false; - bleedState.count = 0; -} -function setBleeding(Pawn instigator, float effectStrenght) { - // Can max possible damage do anything? If no, then don't even bother. - if(calcBleedDamage(effectStrenght, 7) < 1.0) - return; - bleedState.instigator = instigator; - bleedState.count = maxBleedCount; - bleedLevel = effectStrenght; - if(!isBleeding){ - bleedState.nextBleedTime = Level.TimeSeconds; - isBleeding = true; - } -} -static function MeanReplicationInfo findSZri(PlayerReplicationInfo pri) { - local MeanReplicationInfo repInfo; - if(pri == none) - return none; - foreach pri.DynamicActors(Class'MeanReplicationInfo', repInfo) - if(repInfo.ownerPRI == pri) - return repInfo; - - return none; -} -defaultproperties -{ - maxBleedCount=7 - bleedPeriod=1.500000 -} + +defaultproperties{} \ No newline at end of file diff --git a/sources/Zeds/Nice/NiceZombieBloat.uc b/sources/Zeds/Nice/NiceZombieBloat.uc index 2e2a315..c3ab99b 100644 --- a/sources/Zeds/Nice/NiceZombieBloat.uc +++ b/sources/Zeds/Nice/NiceZombieBloat.uc @@ -158,7 +158,12 @@ function SpawnTwoShots() { local vector X,Y,Z, FireStart; local rotator FireRotation; - if( Controller!=none && KFDoorMover(Controller.Target)!=none ) + + // check this from the very start to prevent any log spam + if (Controller == none || IsInState('ZombieDying')) + return; + + if (KFDoorMover(Controller.Target)!=none ) { Controller.Target.TakeDamage(22,Self,Location,vect(0,0,0),Class'DamTypeVomit'); return; @@ -195,7 +200,10 @@ simulated function Tick(float deltatime) { local vector BileExplosionLoc; local FleshHitEmitter GibBileExplosion; + Super.tick(deltatime); + + if( Role == ROLE_Authority && bMovingPukeAttack ) { // Keep moving toward the target until the timer runs out (anim finishes) @@ -238,7 +246,8 @@ simulated function Tick(float deltatime) { if ( !class'GameInfo'.static.UseLowGore() ) { - BileExplosionLoc = self.Location; + // remove self. + BileExplosionLoc = Location; BileExplosionLoc.z += (CollisionHeight - (CollisionHeight * 0.5)); if (bDecapitated) @@ -253,10 +262,10 @@ simulated function Tick(float deltatime) } else { - BileExplosionLoc = self.Location; + BileExplosionLoc = Location; BileExplosionLoc.z += (CollisionHeight - (CollisionHeight * 0.5)); - GibBileExplosion = Spawn(class 'LowGoreBileExplosion',self,, BileExplosionLoc ); + GibBileExplosion = Spawn(class'LowGoreBileExplosion',self,, BileExplosionLoc ); bPlayBileSplash = true; } } diff --git a/sources/Zeds/Nice/NiceZombieClot.uc b/sources/Zeds/Nice/NiceZombieClot.uc index 0e73657..57875e8 100644 --- a/sources/Zeds/Nice/NiceZombieClot.uc +++ b/sources/Zeds/Nice/NiceZombieClot.uc @@ -1,14 +1,17 @@ // Zombie Monster for KF Invasion gametype class NiceZombieClot extends NiceZombieClotBase; + #exec OBJ LOAD FILE=KF_Freaks_Trip.ukx #exec OBJ LOAD FILE=KF_Specimens_Trip_T.utx #exec OBJ LOAD FILE=MeanZedSkins.utx + function ClawDamageTarget() { local vector PushDir; local KFPawn KFP; local float UsedMeleeDamage; + // TODO Controller fix if( MeleeDamage > 1 ) { UsedMeleeDamage = (MeleeDamage - (MeleeDamage * 0.05)) + (MeleeDamage * (FRand() * 0.1)); @@ -40,6 +43,7 @@ function ClawDamageTarget() } } } + function RangedAttack(Actor A) { if ( bShotAnim || Physics == PHYS_Swimming) diff --git a/sources/Zeds/Nice/NiceZombieCrawler.uc b/sources/Zeds/Nice/NiceZombieCrawler.uc index f70ad70..a4ce6cf 100644 --- a/sources/Zeds/Nice/NiceZombieCrawler.uc +++ b/sources/Zeds/Nice/NiceZombieCrawler.uc @@ -69,6 +69,7 @@ simulated function int DoAnimAction( name AnimName ) } return Super.DoAnimAction(AnimName); } + simulated event SetAnimAction(name NewAction) { local int meleeAnimIndex; diff --git a/sources/Zeds/Nice/NiceZombieCrawlerBase.uc b/sources/Zeds/Nice/NiceZombieCrawlerBase.uc index f21f995..87eb48b 100644 --- a/sources/Zeds/Nice/NiceZombieCrawlerBase.uc +++ b/sources/Zeds/Nice/NiceZombieCrawlerBase.uc @@ -1,7 +1,7 @@ // Zombie Monster for KF Invasion gametype class NiceZombieCrawlerBase extends NiceMonster abstract; -#exec OBJ LOAD FILE= +// #exec OBJ LOAD FILE= var() float PounceSpeed; var bool bPouncing; var(Anims) name MeleeAirAnims[3]; // Attack anims for when flying through the air @@ -9,101 +9,7 @@ var(Anims) name MeleeAirAnims[3]; // Attack anims for when flying through th // NOTE: All Code resides in the child class(this class was only created to // eliminate hitching caused by loading default properties during play) //------------------------------------------------------------------------------- -function bool DoPounce() -{ - if ( bZapped || bIsCrouched || bWantsToCrouch || (Physics != PHYS_Walking) || VSize(Location - Controller.Target.Location) > (MeleeRange * 5) ) - return false; - Velocity = Normal(Controller.Target.Location-Location)*PounceSpeed; - Velocity.Z = JumpZ; - SetPhysics(PHYS_Falling); - ZombieSpringAnim(); - bPouncing=true; - return true; -} -simulated function ZombieSpringAnim() -{ - SetAnimAction('ZombieSpring'); -} -event Landed(vector HitNormal) -{ - bPouncing=false; - super.Landed(HitNormal); -} -event Bump(actor Other) -{ - // TODO: is there a better way - if(bPouncing && KFHumanPawn(Other)!=none ) - { - KFHumanPawn(Other).TakeDamage(((MeleeDamage - (MeleeDamage * 0.05)) + (MeleeDamage * (FRand() * 0.1))), self ,self.Location,self.velocity, class'NiceZedMeleeDamageType'); - if (KFHumanPawn(Other).Health <=0) - { - //TODO - move this to humanpawn.takedamage? Also see KFMonster.MeleeDamageTarget - KFHumanPawn(Other).SpawnGibs(self.rotation, 1); - } - //After impact, there'll be no momentum for further bumps - bPouncing=false; - } -} -// Blend his attacks so he can hit you in mid air. -simulated function int DoAnimAction( name AnimName ) -{ - if( AnimName=='InAir_Attack1' || AnimName=='InAir_Attack2' ) - { - AnimBlendParams(1, 1.0, 0.0,, FireRootBone); - PlayAnim(AnimName,, 0.0, 1); - return 1; - } - if( AnimName=='HitF' ) - { - AnimBlendParams(1, 1.0, 0.0,, NeckBone); - PlayAnim(AnimName,, 0.0, 1); - return 1; - } - if( AnimName=='ZombieSpring' ) - { - PlayAnim(AnimName,,0.02); - return 0; - } - return Super.DoAnimAction(AnimName); -} -simulated event SetAnimAction(name NewAction) -{ - local int meleeAnimIndex; - if( NewAction=='' ) - Return; - if(NewAction == 'Claw') - { - meleeAnimIndex = Rand(2); - if( Physics == PHYS_Falling ) - { - NewAction = MeleeAirAnims[meleeAnimIndex]; - } - else - { - NewAction = meleeAnims[meleeAnimIndex]; - } - } - ExpectingChannel = DoAnimAction(NewAction); - if( AnimNeedsWait(NewAction) ) - { - bWaitForAnim = true; - } - if( Level.NetMode!=NM_Client ) - { - AnimAction = NewAction; - bResetAnimAct = True; - ResetAnimActTime = Level.TimeSeconds+0.3; - } -} -// The animation is full body and should set the bWaitForAnim flag -simulated function bool AnimNeedsWait(name TestAnim) -{ - if( TestAnim == 'ZombieSpring' || TestAnim == 'DoorBash' ) - { - return true; - } - return false; -} + defaultproperties { PounceSpeed=330.000000 diff --git a/sources/Zeds/Nice/NiceZombieScrakeBase.uc b/sources/Zeds/Nice/NiceZombieScrakeBase.uc index 75ec86a..6ccd9f6 100644 --- a/sources/Zeds/Nice/NiceZombieScrakeBase.uc +++ b/sources/Zeds/Nice/NiceZombieScrakeBase.uc @@ -2,7 +2,7 @@ // He's not quite as speedy as the other Zombies, But his attacks are TRULY damaging. class NiceZombieScrakeBase extends NiceMonster abstract; -#exec OBJ LOAD FILE= +// #exec OBJ LOAD FILE= var(Sounds) sound SawAttackLoopSound; // THe sound for the saw revved up, looping var(Sounds) sound ChainSawOffSound; //The sound of this zombie dieing without a head var bool bCharging; // Scrake charges when his health gets low diff --git a/sources/Zeds/Nice/NiceZombieSiren.uc b/sources/Zeds/Nice/NiceZombieSiren.uc index 6a5c687..ad5b69b 100644 --- a/sources/Zeds/Nice/NiceZombieSiren.uc +++ b/sources/Zeds/Nice/NiceZombieSiren.uc @@ -77,48 +77,62 @@ function DiscardCurrentScreamBall(){ currScreamTiming = -1; } } + function RangedAttack(Actor A) { local int LastFireTime; local float Dist; - if ( bShotAnim ) - return; + + if (bShotAnim) + return; Dist = VSize(A.Location - Location); - if ( Physics == PHYS_Swimming ) + + if (Physics == PHYS_Swimming) { - SetAnimAction('Claw'); - bShotAnim = true; - LastFireTime = Level.TimeSeconds; + SetAnimAction('Claw'); + bShotAnim = true; + LastFireTime = Level.TimeSeconds; } - else if(Dist < MeleeRange + CollisionRadius + A.CollisionRadius && A != Self) + else if (Dist < MeleeRange + CollisionRadius + A.CollisionRadius && A != Self) { - bShotAnim = true; - LastFireTime = Level.TimeSeconds; - SetAnimAction('Claw'); - Controller.bPreparingMove = true; - Acceleration = vect(0,0,0); + bShotAnim = true; + LastFireTime = Level.TimeSeconds; + SetAnimAction('Claw'); + Controller.bPreparingMove = true; + Acceleration = vect(0,0,0); } - else if( Dist <= ScreamRadius && !bDecapitated && !bZapped ) + // ok se we DO NOT want to scream at other nice zeds + else if (!bNotAHuman() && Dist <= ScreamRadius && !bDecapitated && !bZapped) { - bShotAnim=true; - SetAnimAction('Siren_Scream'); - if(screamStartTime > 0) + bShotAnim = true; + SetAnimAction('Siren_Scream'); + if (screamStartTime > 0) DiscardCurrentScreamBall(); - currScreamTiming = 0; - screamStartTime = Level.TimeSeconds; - // Only stop moving if we are close - if( Dist < ScreamRadius * 0.25 ) - { - Controller.bPreparingMove = true; - Acceleration = vect(0,0,0); - } - else - { - Acceleration = AccelRate * Normal(A.Location - Location); - } - Acceleration.Z = FMin(Acceleration.Z, 0.0f); + currScreamTiming = 0; + screamStartTime = Level.TimeSeconds; + // Only stop moving if we are close + if (Dist < ScreamRadius * 0.25) + { + Controller.bPreparingMove = true; + Acceleration = vect(0,0,0); + } + else + { + Acceleration = AccelRate * Normal(A.Location - Location); + } + Acceleration.Z = FMin(Acceleration.Z, 0.0f); } } + +final private function bool bNotAHuman() +{ + if (Controller == none || Controller.Enemy == none) + return false; + + // log("Zed enemy classname was " $ Controller.Enemy.class); + return ClassIsChildOf(Controller.Enemy.class, class'NiceMonster'); +} + simulated function int DoAnimAction( name AnimName ) { if( AnimName=='Siren_Scream' || AnimName=='Siren_Bite' || AnimName=='Siren_Bite2' ) diff --git a/sources/Zeds/Nice/NiceZombieStalkerBase.uc b/sources/Zeds/Nice/NiceZombieStalkerBase.uc index a16e42f..edc85c2 100644 --- a/sources/Zeds/Nice/NiceZombieStalkerBase.uc +++ b/sources/Zeds/Nice/NiceZombieStalkerBase.uc @@ -1,7 +1,7 @@ // Zombie Monster for KF Invasion gametype class NiceZombieStalkerBase extends NiceMonster abstract; -#exec OBJ LOAD FILE= +// #exec OBJ LOAD FILE= #exec OBJ LOAD FILE=KFX.utx #exec OBJ LOAD FILE=KF_BaseStalker.uax var float NextCheckTime; diff --git a/sources/Zeds/NiceMonster.uc b/sources/Zeds/NiceMonster.uc index b53123e..59c9b46 100644 --- a/sources/Zeds/NiceMonster.uc +++ b/sources/Zeds/NiceMonster.uc @@ -899,42 +899,46 @@ function BileDamageEffect( int damage, NextBileTime = Level.TimeSeconds + BileFrequency; } } + function float GetDecapDamageModifier( class damageType, NicePlayerController nicePlayer, - KFPlayerReplicationInfo KFPRI){ - local float damageMod; - local bool shouldDoGoodDecap; - local bool hasTrashCleaner; - local bool isPerkedPickup; - local class pickupClass; - local class niceVet; - niceVet = class(KFPRI.ClientVeteranSkill); - isPerkedPickup = false; - if(niceVet != none){ - pickupClass = niceVet.static.GetPickupFromDamageType(damageType); - if(pickupClass != none) - isPerkedPickup = niceVet.static.IsPerkedPickup(pickupClass); - } - shouldDoGoodDecap = false; - shouldDoGoodDecap = (damageType.default.decapType == DB_DROP); - shouldDoGoodDecap = shouldDoGoodDecap || + KFPlayerReplicationInfo KFPRI) +{ + local float damageMod; + local bool shouldDoGoodDecap; + local bool hasTrashCleaner; + local bool isPerkedPickup; + local class pickupClass; + local class niceVet; + + // KFPRI accessed none fix + if (KFPRI != none) + niceVet = class(KFPRI.ClientVeteranSkill); + isPerkedPickup = false; + if (niceVet != none) + { + pickupClass = niceVet.static.GetPickupFromDamageType(damageType); + if (pickupClass != none) + isPerkedPickup = niceVet.static.IsPerkedPickup(pickupClass); + } + shouldDoGoodDecap = false; + shouldDoGoodDecap = (damageType.default.decapType == DB_DROP); + shouldDoGoodDecap = shouldDoGoodDecap || (damageType.default.decapType == DB_PERKED && isPerkedPickup); - if(shouldDoGoodDecap) - damageMod = damageType.default.goodDecapMod; - else - damageMod = damageType.default.badDecapMod; - if(nicePlayer != none) - hasTrashCleaner = class'NiceVeterancyTypes'.static. + if (shouldDoGoodDecap) + damageMod = damageType.default.goodDecapMod; + else + damageMod = damageType.default.badDecapMod; + if (nicePlayer != none) + hasTrashCleaner = class'NiceVeterancyTypes'.static. hasSkill(nicePlayer, class'NiceSkillCommandoTrashCleaner'); - if(hasTrashCleaner){ - damageMod = FMin( - damageMod, - class'NiceSkillCommandoTrashCleaner'.default. - decapitationMultiLimit - ); - } - return damageMod; + if (hasTrashCleaner) + { + damageMod = FMin(damageMod, class'NiceSkillCommandoTrashCleaner'.default.decapitationMultiLimit); + } + return damageMod; } + function DealDecapDamage( int damage, Pawn instigatedBy, Vector hitLocation, diff --git a/sources/Zeds/NiceMonsterController.uc b/sources/Zeds/NiceMonsterController.uc index f0165d7..60b680c 100644 --- a/sources/Zeds/NiceMonsterController.uc +++ b/sources/Zeds/NiceMonsterController.uc @@ -414,36 +414,47 @@ Begin: } WhatToDoNext(99); } + function bool SetEnemy( pawn newEnemy, optional bool bHateMonster, - optional float MonsterHateChanceOverride){ + optional float MonsterHateChanceOverride) +{ local NiceMonster niceZed; local NiceZombieFleshpound niceFP; local bool bCanForceFight; + // Can we fight anything? niceZed = NiceMonster(pawn); niceFP = NiceZombieFleshpound(niceZed); - if(niceZed != none) - bCanForceFight = + + if (niceZed != none) + { + bCanForceFight = KFMonster(pawn).HeadHealth <= 0 || KFMonster(pawn).bDecapitated - || newEnemy.Health <= 15; + || (newEnemy != none && newEnemy.Health <= 15); + } + if (niceFP != none && niceFP.IsInState('RageCharging')) bCanForceFight = false; - if(newEnemy != none) - bCanForceFight = bCanForceFight - && newEnemy.Health > 0 && newEnemy != enemy; + + if (newEnemy != none) + bCanForceFight = bCanForceFight && newEnemy.Health > 0 && newEnemy != enemy; else bCanForceFight = false; + // Do fight if we can - if(bCanForceFight){ + if(bCanForceFight) + { ChangeEnemy(newEnemy, true); FightEnemy(false); return true; } + // Otherwise - do the usual stupid stuff return super.SetEnemy(newEnemy, bHateMonster, monsterHateChanceOverride); } + simulated function AddKillAssistant(Controller PC, float damage){ local bool bIsalreadyAssistant; local int i;